diff --git a/src/Tempest/View/src/Components/Form.php b/src/Tempest/View/src/Components/XForm.php
similarity index 92%
rename from src/Tempest/View/src/Components/Form.php
rename to src/Tempest/View/src/Components/XForm.php
index 24ab6bb7c..73a6cb93f 100644
--- a/src/Tempest/View/src/Components/Form.php
+++ b/src/Tempest/View/src/Components/XForm.php
@@ -7,7 +7,7 @@
use Tempest\View\Elements\ViewComponentElement;
use Tempest\View\ViewComponent;
-final readonly class Form implements ViewComponent
+final readonly class XForm implements ViewComponent
{
public static function getName(): string
{
diff --git a/src/Tempest/View/src/Components/Input.php b/src/Tempest/View/src/Components/XInput.php
similarity index 97%
rename from src/Tempest/View/src/Components/Input.php
rename to src/Tempest/View/src/Components/XInput.php
index 75b9ef9f6..5340a16ac 100644
--- a/src/Tempest/View/src/Components/Input.php
+++ b/src/Tempest/View/src/Components/XInput.php
@@ -9,7 +9,7 @@
use Tempest\View\Elements\ViewComponentElement;
use Tempest\View\ViewComponent;
-final readonly class Input implements ViewComponent
+final readonly class XInput implements ViewComponent
{
public function __construct(
private Session $session,
diff --git a/src/Tempest/View/src/Components/Submit.php b/src/Tempest/View/src/Components/XSubmit.php
similarity index 89%
rename from src/Tempest/View/src/Components/Submit.php
rename to src/Tempest/View/src/Components/XSubmit.php
index a927757c6..2a4f53df4 100644
--- a/src/Tempest/View/src/Components/Submit.php
+++ b/src/Tempest/View/src/Components/XSubmit.php
@@ -7,7 +7,7 @@
use Tempest\View\Elements\ViewComponentElement;
use Tempest\View\ViewComponent;
-final readonly class Submit implements ViewComponent
+final readonly class XSubmit implements ViewComponent
{
public static function getName(): string
{
diff --git a/src/Tempest/View/src/Elements/ElementFactory.php b/src/Tempest/View/src/Elements/ElementFactory.php
index 4d30e4ee0..5aaccebd5 100644
--- a/src/Tempest/View/src/Elements/ElementFactory.php
+++ b/src/Tempest/View/src/Elements/ElementFactory.php
@@ -63,8 +63,11 @@ private function makeElement(DOMNode $node, ?Element $parent): ?Element
if (! $node instanceof DOMElement
|| $node->tagName === 'pre'
- || $node->tagName === 'code') {
+ || $node->tagName === 'code'
+ || $node->tagName === 'x-raw'
+ ) {
$content = '';
+
foreach ($node->childNodes as $child) {
$content .= $node->ownerDocument->saveHTML($child);
}
@@ -82,9 +85,9 @@ private function makeElement(DOMNode $node, ?Element $parent): ?Element
}
$element = new ViewComponentElement(
- $this->compiler,
- $viewComponentClass,
- $attributes,
+ compiler: $this->compiler,
+ viewComponent: $viewComponentClass,
+ attributes: $attributes,
);
} elseif ($node->tagName === 'x-slot') {
$element = new SlotElement(
diff --git a/src/Tempest/View/src/Elements/RawElement.php b/src/Tempest/View/src/Elements/RawElement.php
index c2b2ef923..b01f0caea 100644
--- a/src/Tempest/View/src/Elements/RawElement.php
+++ b/src/Tempest/View/src/Elements/RawElement.php
@@ -21,7 +21,7 @@ public function __construct(
public function compile(): string
{
- if ($this->tag === null) {
+ if ($this->tag === null || $this->tag === 'x-raw') {
return $this->content;
}
diff --git a/tests/Integration/View/TempestViewRendererTest.php b/tests/Integration/View/TempestViewRendererTest.php
index 722912f42..300b29b2e 100644
--- a/tests/Integration/View/TempestViewRendererTest.php
+++ b/tests/Integration/View/TempestViewRendererTest.php
@@ -416,4 +416,11 @@ public function test_view_component_with_multiple_attributes(): void
$html = $this->render(view('