create-prisma-php-app 1.26.520 → 1.26.522

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.
@@ -0,0 +1,30 @@
1
+ <?php
2
+
3
+ namespace Lib\PHPX;
4
+
5
+ /**
6
+ * Interface IPHPX
7
+ *
8
+ * The interface for the PHPX component classes.
9
+ */
10
+
11
+ interface IPHPX {
12
+ /**
13
+ * Constructor to initialize the component with the given properties.
14
+ *
15
+ * @param array<string, mixed> $props Optional properties to customize the component.
16
+ */
17
+ public function __construct(array $props = []);
18
+
19
+ /**
20
+ * Registers or initializes any necessary components or settings. (Placeholder method).
21
+ */
22
+ public static function init(): void;
23
+
24
+ /**
25
+ * Renders the component with the given properties and children.
26
+ *
27
+ * @return string The rendered HTML content.
28
+ */
29
+ public function render(): string;
30
+ }
@@ -0,0 +1,41 @@
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ namespace Lib\PHPX;
6
+
7
+ class Utils
8
+ {
9
+ public static function mergeClasses(...$classes)
10
+ {
11
+ $classArray = [];
12
+
13
+ foreach ($classes as $class) {
14
+ if (!empty(trim($class))) {
15
+ $splitClasses = explode(' ', $class);
16
+ foreach ($splitClasses as $individualClass) {
17
+ // Extract the base of the class (e.g., bg-red, flex) and replace the previous occurrence
18
+ // You can customize this based on how Tailwind classes work or specific rules you want
19
+ $classPrefix = self::getClassPrefix($individualClass);
20
+
21
+ // Update the array, prioritizing the last occurrence
22
+ $classArray[$classPrefix] = $individualClass;
23
+ }
24
+ }
25
+ }
26
+
27
+ // Return the final string of classes after merging
28
+ return implode(' ', array_values($classArray));
29
+ }
30
+
31
+ private static function getClassPrefix($class)
32
+ {
33
+ // Implement logic to determine the base of the class (e.g., bg-red-500 -> bg, flex -> flex)
34
+ // This is just an example, and you might need to adjust based on your use case
35
+ if (preg_match('/^(\w+-)/', $class, $matches)) {
36
+ return $matches[1];
37
+ }
38
+
39
+ return $class;
40
+ }
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.26.520",
3
+ "version": "1.26.522",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",