@zeus-js/output-react-wrapper 0.1.0-beta.0 → 0.1.0-beta.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-react-wrapper v0.1.0-beta.
|
|
2
|
+
* output-react-wrapper v0.1.0-beta.2
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -39,8 +39,12 @@ function generateReactWrapper(input) {
|
|
|
39
39
|
];
|
|
40
40
|
const destructuredProps = destructuredPropNames.length ? `${destructuredPropNames.join(",\n ")},` : "";
|
|
41
41
|
return `
|
|
42
|
-
import
|
|
42
|
+
import {
|
|
43
|
+
createElement,
|
|
44
|
+
cloneElement,
|
|
45
|
+
Fragment,
|
|
43
46
|
forwardRef,
|
|
47
|
+
isValidElement,
|
|
44
48
|
useEffect,
|
|
45
49
|
useImperativeHandle,
|
|
46
50
|
useRef,
|
|
@@ -77,7 +81,7 @@ export const ${component.name} = forwardRef(function ${component.name}(props, re
|
|
|
77
81
|
slotChildren.push(children);
|
|
78
82
|
}
|
|
79
83
|
|
|
80
|
-
return
|
|
84
|
+
return createElement(
|
|
81
85
|
${JSON.stringify(component.tag)},
|
|
82
86
|
{
|
|
83
87
|
...rest,
|
|
@@ -93,13 +97,13 @@ function createNamedSlot(name, value) {
|
|
|
93
97
|
if (value == null || value === false) return null;
|
|
94
98
|
|
|
95
99
|
if (
|
|
96
|
-
|
|
97
|
-
value.type !==
|
|
100
|
+
isValidElement(value) &&
|
|
101
|
+
value.type !== Fragment
|
|
98
102
|
) {
|
|
99
|
-
return
|
|
103
|
+
return cloneElement(value, { slot: name });
|
|
100
104
|
}
|
|
101
105
|
|
|
102
|
-
return
|
|
106
|
+
return createElement(
|
|
103
107
|
'span',
|
|
104
108
|
{
|
|
105
109
|
slot: name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-react-wrapper v0.1.0-beta.
|
|
2
|
+
* output-react-wrapper v0.1.0-beta.2
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -39,8 +39,12 @@ function generateReactWrapper(input) {
|
|
|
39
39
|
];
|
|
40
40
|
const destructuredProps = destructuredPropNames.length ? `${destructuredPropNames.join(",\n ")},` : "";
|
|
41
41
|
return `
|
|
42
|
-
import
|
|
42
|
+
import {
|
|
43
|
+
createElement,
|
|
44
|
+
cloneElement,
|
|
45
|
+
Fragment,
|
|
43
46
|
forwardRef,
|
|
47
|
+
isValidElement,
|
|
44
48
|
useEffect,
|
|
45
49
|
useImperativeHandle,
|
|
46
50
|
useRef,
|
|
@@ -77,7 +81,7 @@ export const ${component.name} = forwardRef(function ${component.name}(props, re
|
|
|
77
81
|
slotChildren.push(children);
|
|
78
82
|
}
|
|
79
83
|
|
|
80
|
-
return
|
|
84
|
+
return createElement(
|
|
81
85
|
${JSON.stringify(component.tag)},
|
|
82
86
|
{
|
|
83
87
|
...rest,
|
|
@@ -93,13 +97,13 @@ function createNamedSlot(name, value) {
|
|
|
93
97
|
if (value == null || value === false) return null;
|
|
94
98
|
|
|
95
99
|
if (
|
|
96
|
-
|
|
97
|
-
value.type !==
|
|
100
|
+
isValidElement(value) &&
|
|
101
|
+
value.type !== Fragment
|
|
98
102
|
) {
|
|
99
|
-
return
|
|
103
|
+
return cloneElement(value, { slot: name });
|
|
100
104
|
}
|
|
101
105
|
|
|
102
|
-
return
|
|
106
|
+
return createElement(
|
|
103
107
|
'span',
|
|
104
108
|
{
|
|
105
109
|
slot: name,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* output-react-wrapper v0.1.0-beta.
|
|
2
|
+
* output-react-wrapper v0.1.0-beta.2
|
|
3
3
|
* (c) 2026 baicie
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
**/
|
|
@@ -35,8 +35,12 @@ function generateReactWrapper(input) {
|
|
|
35
35
|
];
|
|
36
36
|
const destructuredProps = destructuredPropNames.length ? `${destructuredPropNames.join(",\n ")},` : "";
|
|
37
37
|
return `
|
|
38
|
-
import
|
|
38
|
+
import {
|
|
39
|
+
createElement,
|
|
40
|
+
cloneElement,
|
|
41
|
+
Fragment,
|
|
39
42
|
forwardRef,
|
|
43
|
+
isValidElement,
|
|
40
44
|
useEffect,
|
|
41
45
|
useImperativeHandle,
|
|
42
46
|
useRef,
|
|
@@ -73,7 +77,7 @@ export const ${component.name} = forwardRef(function ${component.name}(props, re
|
|
|
73
77
|
slotChildren.push(children);
|
|
74
78
|
}
|
|
75
79
|
|
|
76
|
-
return
|
|
80
|
+
return createElement(
|
|
77
81
|
${JSON.stringify(component.tag)},
|
|
78
82
|
{
|
|
79
83
|
...rest,
|
|
@@ -89,13 +93,13 @@ function createNamedSlot(name, value) {
|
|
|
89
93
|
if (value == null || value === false) return null;
|
|
90
94
|
|
|
91
95
|
if (
|
|
92
|
-
|
|
93
|
-
value.type !==
|
|
96
|
+
isValidElement(value) &&
|
|
97
|
+
value.type !== Fragment
|
|
94
98
|
) {
|
|
95
|
-
return
|
|
99
|
+
return cloneElement(value, { slot: name });
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
return
|
|
102
|
+
return createElement(
|
|
99
103
|
'span',
|
|
100
104
|
{
|
|
101
105
|
slot: name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeus-js/output-react-wrapper",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"description": "Zeus React wrapper output plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"module": "./dist/output-react-wrapper.esm-bundler.js",
|
|
22
22
|
"import": "./dist/output-react-wrapper.esm-bundler.js",
|
|
23
23
|
"require": "./index.js"
|
|
24
|
-
}
|
|
25
|
-
"./*": "./*"
|
|
24
|
+
}
|
|
26
25
|
},
|
|
27
26
|
"sideEffects": false,
|
|
28
27
|
"repository": {
|
|
@@ -37,9 +36,9 @@
|
|
|
37
36
|
]
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"@zeus-js/
|
|
41
|
-
"@zeus-js/
|
|
42
|
-
"@zeus-js/component-dts": "0.1.0-beta.
|
|
39
|
+
"@zeus-js/component-analyzer": "0.1.0-beta.2",
|
|
40
|
+
"@zeus-js/bundler-plugin": "0.1.0-beta.2",
|
|
41
|
+
"@zeus-js/component-dts": "0.1.0-beta.2"
|
|
43
42
|
},
|
|
44
43
|
"peerDependencies": {
|
|
45
44
|
"react": ">=18 || >=19"
|