create-prisma-php-app 3.3.12 → 3.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bootstrap.php
CHANGED
|
@@ -1033,13 +1033,6 @@ try {
|
|
|
1033
1033
|
Bootstrap::createUpdateRequestData();
|
|
1034
1034
|
}
|
|
1035
1035
|
|
|
1036
|
-
// If there’s caching
|
|
1037
|
-
if (isset(Bootstrap::$requestFilesData[Request::$decodedUri])) {
|
|
1038
|
-
if ($_ENV['CACHE_ENABLED'] === 'true') {
|
|
1039
|
-
CacheHandler::serveCache(Request::$decodedUri, intval($_ENV['CACHE_TTL']));
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
1036
|
// For wire calls, re-include the files if needed
|
|
1044
1037
|
if (Request::$isWire && !Bootstrap::$secondRequestC69CD) {
|
|
1045
1038
|
if (isset(Bootstrap::$requestFilesData[Request::$decodedUri])) {
|
|
@@ -1059,6 +1052,13 @@ try {
|
|
|
1059
1052
|
Bootstrap::wireCallback();
|
|
1060
1053
|
}
|
|
1061
1054
|
|
|
1055
|
+
// If there’s caching
|
|
1056
|
+
if ((!Request::$isWire && !Bootstrap::$secondRequestC69CD) && isset(Bootstrap::$requestFilesData[Request::$decodedUri])) {
|
|
1057
|
+
if ($_ENV['CACHE_ENABLED'] === 'true') {
|
|
1058
|
+
CacheHandler::serveCache(Request::$decodedUri, intval($_ENV['CACHE_TTL']));
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
1062
|
MainLayout::$children = MainLayout::$childLayoutChildren . Bootstrap::getLoadingsFiles();
|
|
1063
1063
|
|
|
1064
1064
|
ob_start();
|
|
@@ -1069,7 +1069,7 @@ try {
|
|
|
1069
1069
|
MainLayout::$html = "<!DOCTYPE html>\n" . MainLayout::$html;
|
|
1070
1070
|
|
|
1071
1071
|
if (
|
|
1072
|
-
http_response_code() === 200 && isset(Bootstrap::$requestFilesData[Request::$decodedUri]['fileName']) && $_ENV['CACHE_ENABLED'] === 'true'
|
|
1072
|
+
http_response_code() === 200 && isset(Bootstrap::$requestFilesData[Request::$decodedUri]['fileName']) && $_ENV['CACHE_ENABLED'] === 'true' && (!Request::$isWire && !Bootstrap::$secondRequestC69CD)
|
|
1073
1073
|
) {
|
|
1074
1074
|
CacheHandler::saveCache(Request::$decodedUri, MainLayout::$html);
|
|
1075
1075
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Lib\PHPX;
|
|
6
|
+
|
|
7
|
+
use Lib\PHPX\PHPX;
|
|
8
|
+
|
|
9
|
+
class Fragment extends PHPX
|
|
10
|
+
{
|
|
11
|
+
/** @property ?string $as = div|span|section|article|nav|header|footer|main|aside */
|
|
12
|
+
public ?string $as = null;
|
|
13
|
+
public ?string $class = '';
|
|
14
|
+
|
|
15
|
+
public function __construct(array $props = [])
|
|
16
|
+
{
|
|
17
|
+
parent::__construct($props);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public function render(): string
|
|
21
|
+
{
|
|
22
|
+
if ($this->as !== null) {
|
|
23
|
+
$attributes = $this->getAttributes();
|
|
24
|
+
$class = $this->getMergeClasses($this->class);
|
|
25
|
+
$classAttr = $class ? "class=\"{$class}\"" : '';
|
|
26
|
+
|
|
27
|
+
return "<{$this->as} {$classAttr} {$attributes}>{$this->children}</{$this->as}>";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return $this->children;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -424,6 +424,8 @@ class TemplateCompiler
|
|
|
424
424
|
$sectionId = $idx === 0 ? $baseId : "{$baseId}{$idx}";
|
|
425
425
|
|
|
426
426
|
$html = $instance->render();
|
|
427
|
+
$html = self::preprocessFragmentSyntax($html);
|
|
428
|
+
|
|
427
429
|
$fragDom = self::convertToXml($html);
|
|
428
430
|
$root = $fragDom->documentElement;
|
|
429
431
|
foreach ($root->childNodes as $c) {
|
|
@@ -445,6 +447,14 @@ class TemplateCompiler
|
|
|
445
447
|
return $htmlOut;
|
|
446
448
|
}
|
|
447
449
|
|
|
450
|
+
private static function preprocessFragmentSyntax(string $content): string
|
|
451
|
+
{
|
|
452
|
+
$content = preg_replace('/<>/', '<Fragment>', $content);
|
|
453
|
+
$content = preg_replace('/<\/>/', '</Fragment>', $content);
|
|
454
|
+
|
|
455
|
+
return $content;
|
|
456
|
+
}
|
|
457
|
+
|
|
448
458
|
private static function selectComponentMapping(string $componentName): array
|
|
449
459
|
{
|
|
450
460
|
if (!isset(self::$classMappings[$componentName])) {
|
|
@@ -151,20 +151,20 @@ class TwMerge
|
|
|
151
151
|
'border-w-r' => ['/^border-r(-(\d+|px|\[.+\]))?$/'],
|
|
152
152
|
'border-w-b' => ['/^border-b(-(\d+|px|\[.+\]))?$/'],
|
|
153
153
|
'border-w-l' => ['/^border-l(-(\d+|px|\[.+\]))?$/'],
|
|
154
|
-
'border-color' => ['/^border(-[trbl])?-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d
|
|
154
|
+
'border-color' => ['/^border(-[trbl])?-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d+|\[.+\])$/'],
|
|
155
155
|
'border-style' => ['/^border-(solid|dashed|dotted|double|hidden|none)$/'],
|
|
156
156
|
'divide-x' => ['/^divide-x(-(\d+|px|reverse|\[.+\]))?$/'],
|
|
157
157
|
'divide-y' => ['/^divide-y(-(\d+|px|reverse|\[.+\]))?$/'],
|
|
158
|
-
'divide-color' => ['/^divide-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d
|
|
158
|
+
'divide-color' => ['/^divide-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d+|\[.+\])$/'],
|
|
159
159
|
'divide-style' => ['/^divide-(solid|dashed|dotted|double|none)$/'],
|
|
160
160
|
'outline-w' => ['/^outline(-(\d+|px|\[.+\]))?$/'],
|
|
161
|
-
'outline-color' => ['/^outline-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d
|
|
161
|
+
'outline-color' => ['/^outline-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d+|\[.+\])$/'],
|
|
162
162
|
'outline-style' => ['/^outline-(none|solid|dashed|dotted|double)$/'],
|
|
163
163
|
'outline-offset' => ['/^outline-offset-(\d+|px|\[.+\])$/'],
|
|
164
164
|
'ring-w' => ['/^ring(-(\d+|px|inset|\[.+\]))?$/'],
|
|
165
|
-
'ring-color' => ['/^ring-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d
|
|
165
|
+
'ring-color' => ['/^ring-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d+|\[.+\])$/'],
|
|
166
166
|
'ring-offset-w' => ['/^ring-offset-(\d+|px|\[.+\])$/'],
|
|
167
|
-
'ring-offset-color' => ['/^ring-offset-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d
|
|
167
|
+
'ring-offset-color' => ['/^ring-offset-(inherit|current|transparent|black|white|slate-\d+|gray-\d+|zinc-\d+|neutral-\d+|stone-\d+|red-\d+|orange-\d+|amber-\d+|yellow-\d+|lime-\d+|green-\d+|emerald-\d+|teal-\d+|cyan-\d+|sky-\d+|blue-\d+|indigo-\d+|violet-\d+|purple-\d+|fuchsia-\d+|pink-\d+|rose-\d+|\[.+\])$/'],
|
|
168
168
|
|
|
169
169
|
// Effects
|
|
170
170
|
'shadow' => ['/^shadow(-(\w+|\[.+\]))?$/'],
|