create-prisma-php-app 3.4.6 → 3.4.7

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.
@@ -66,15 +66,13 @@ class PHPX implements IPHPX
66
66
  */
67
67
  protected function getParentComponent(): ?string
68
68
  {
69
- // Use the same logic as getComponentHierarchy to get full hierarchy
70
69
  $fullHierarchy = $this->getComponentHierarchy();
71
70
 
72
- // Return the parent component (second to last in full hierarchy)
73
71
  if (count($fullHierarchy) >= 2) {
74
72
  return $fullHierarchy[count($fullHierarchy) - 2];
75
73
  }
76
74
 
77
- return null; // No parent
75
+ return null;
78
76
  }
79
77
 
80
78
  /**
@@ -97,7 +95,6 @@ class PHPX implements IPHPX
97
95
  {
98
96
  $hierarchy = self::$currentHierarchy ?? ['app'];
99
97
 
100
- // Ensure current component is included
101
98
  if (self::$currentComponentId && !in_array(self::$currentComponentId, $hierarchy)) {
102
99
  $hierarchy[] = self::$currentComponentId;
103
100
  }
@@ -413,19 +413,24 @@ class TemplateCompiler
413
413
  $mapping = self::selectComponentMapping($componentName);
414
414
  $instance = self::initializeComponentInstance($mapping, $incomingProps);
415
415
 
416
+ $baseId = 's' . base_convert(sprintf('%u', crc32($mapping['className'])), 10, 36);
417
+ $idx = self::$componentInstanceCounts[$baseId] ?? 0;
418
+ self::$componentInstanceCounts[$baseId] = $idx + 1;
419
+ $sectionId = $idx === 0 ? $baseId : "{$baseId}{$idx}";
420
+
421
+ $originalStack = self::$sectionStack;
422
+ self::$sectionStack[] = $sectionId;
423
+
416
424
  $childHtml = '';
417
425
  foreach ($node->childNodes as $c) {
418
426
  $childHtml .= self::processNode($c);
419
427
  }
420
428
 
421
- $instance->children = trim($childHtml);
429
+ self::$sectionStack = $originalStack;
422
430
 
423
- $baseId = 's' . base_convert(sprintf('%u', crc32($mapping['className'])), 10, 36);
424
- $idx = self::$componentInstanceCounts[$baseId] ?? 0;
425
- self::$componentInstanceCounts[$baseId] = $idx + 1;
426
- $sectionId = $idx === 0 ? $baseId : "{$baseId}{$idx}";
431
+ $instance->children = trim($childHtml);
427
432
 
428
- PHPX::setRenderingContext(self::$sectionStack, $sectionId);
433
+ PHPX::setRenderingContext($originalStack, $sectionId);
429
434
 
430
435
  $html = $instance->render();
431
436
  $html = self::preprocessFragmentSyntax($html);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "3.4.6",
3
+ "version": "3.4.7",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",