@wiajs/core 1.1.26 → 1.1.27
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/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/core.min.js +2 -2
- package/dist/core.mjs +1 -1
- package/dist/jsx-runtime.js +40 -28
- package/package.json +1 -1
package/dist/core.cjs
CHANGED
package/dist/core.js
CHANGED
package/dist/core.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* wia core v1.1.
|
|
2
|
+
* wia core v1.1.27
|
|
3
3
|
* (c) 2015-2024 Sibyl Yu and contributors
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
/*!
|
|
7
|
-
* wia core v1.1.
|
|
7
|
+
* wia core v1.1.27
|
|
8
8
|
* (c) 2015-2024 Sibyl Yu and contributors
|
|
9
9
|
* Released under the MIT License.
|
|
10
10
|
*/
|
package/dist/core.mjs
CHANGED
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* wia core v1.1.
|
|
2
|
+
* wia core v1.1.27
|
|
3
3
|
* (c) 2015-2024 Sibyl Yu and contributors
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -9,38 +9,50 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
9
9
|
|
|
10
10
|
var jsxRuntime = {};
|
|
11
11
|
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const attrs = props || {};
|
|
16
|
-
const children = props.children || [];
|
|
17
|
-
if (attrs.children) delete attrs.children;
|
|
12
|
+
// runtime: 'automatic', // automatic or classic automatic 使用 JSX 运行时(在React 17 中引入)
|
|
13
|
+
function jsx(tag, {children, ...props} = {}) {
|
|
14
|
+
let R = '';
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
if (typeof tag === 'function') R = tag({children, ...props});
|
|
17
|
+
else if (typeof tag === 'string') {
|
|
18
|
+
const attrs = props || {};
|
|
19
|
+
const attrsString = Object.keys(attrs)
|
|
20
|
+
.map(attr => {
|
|
21
|
+
if (attr[0] === '_') {
|
|
22
|
+
if (attrs[attr]) return attr.replace('_', '');
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
return `${attr}="${attrs[attr]}"`;
|
|
26
|
+
})
|
|
27
|
+
.filter(attr => !!attr)
|
|
28
|
+
.join(' ');
|
|
20
29
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.join(' ');
|
|
30
|
+
if (['path', 'img', 'circle', 'polygon', 'line', 'input'].indexOf(tag) >= 0)
|
|
31
|
+
R = `<${tag} ${attrsString} />`.trim();
|
|
32
|
+
else {
|
|
33
|
+
const childrenContent = Array.isArray(children)
|
|
34
|
+
? children
|
|
35
|
+
.filter(c => !!c)
|
|
36
|
+
.map(c => (Array.isArray(c) ? c.join('') : c))
|
|
37
|
+
.join('')
|
|
38
|
+
: children;
|
|
31
39
|
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
R = `<${tag} ${attrsString}>${childrenContent}</${tag}>`.trim();
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.map((c) => (Array.isArray(c) ? c.join('') : c))
|
|
38
|
-
.join('')
|
|
39
|
-
: children;
|
|
40
|
-
return `<${tag} ${attrsString}>${childrenContent}</${tag}>`.trim();
|
|
43
|
+
|
|
44
|
+
return R;
|
|
41
45
|
}
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
|
|
47
|
+
function Fragment({children} = {}) {
|
|
48
|
+
const R = Array.isArray(children)
|
|
49
|
+
? children
|
|
50
|
+
.filter(c => !!c)
|
|
51
|
+
.map(c => (Array.isArray(c) ? c.join('') : c))
|
|
52
|
+
.join('')
|
|
53
|
+
: children;
|
|
54
|
+
|
|
55
|
+
return R;
|
|
44
56
|
}
|
|
45
57
|
|
|
46
58
|
var Fragment_1 = jsxRuntime.Fragment = Fragment;
|