@wiajs/core 1.1.22 → 1.1.23

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,40 @@
1
+ // replace react, use by @babel/plugin-transform-react-jsx
2
+ /* eslint-disable prefer-rest-params */
3
+ function jsx(tag, props) {
4
+ const attrs = props || {};
5
+ const children = props.children || [];
6
+
7
+ const attrsString = Object.keys(attrs)
8
+ .map((attr) => {
9
+ if (attr[0] === '_') {
10
+ if (attrs[attr]) return attr.replace('_', '');
11
+ return '';
12
+ }
13
+ return `${attr}="${attrs[attr]}"`;
14
+ })
15
+ .filter((attr) => !!attr)
16
+ .join(' ');
17
+
18
+ if (['path', 'img', 'circle', 'polygon', 'line', 'input'].indexOf(tag) >= 0) {
19
+ return `<${tag} ${attrsString} />`.trim();
20
+ }
21
+ const childrenContent = children
22
+ .filter((c) => !!c)
23
+ .map((c) => (Array.isArray(c) ? c.join('') : c))
24
+ .join('');
25
+ return `<${tag} ${attrsString}>${childrenContent}</${tag}>`.trim();
26
+ };
27
+
28
+ function Fragment(props) {
29
+ return props.children;
30
+ }
31
+
32
+ exports.Fragment = Fragment;
33
+ exports.jsx = jsx;
34
+ exports.jsxs = jsx;
35
+ exports.jsxDEV = jsx;
36
+
37
+ // "browser": "./dist/jsx-runtime.module.js",
38
+ // "umd": "./dist/jsxRuntime.umd.js",
39
+ // "import": "./dist/jsxRuntime.mjs",
40
+ // "require": "./dist/jsxRuntime.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wiajs/core",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "description": "wia app core package",
5
5
  "main": "./dist/core.cjs",
6
6
  "module": "./dist/core.mjs",
@@ -14,17 +14,11 @@
14
14
  },
15
15
  "./jsx-runtime": {
16
16
  "types": "./dist/jsxRuntime.d.ts",
17
- "browser": "./dist/jsxRuntime.module.js",
18
- "umd": "./dist/jsxRuntime.umd.js",
19
- "import": "./dist/jsxRuntime.mjs",
20
- "require": "./dist/jsxRuntime.js"
17
+ "default": "./dist/jsx-runtime.js"
21
18
  },
22
19
  "./jsx-dev-runtime": {
23
20
  "types": "./dist/jsxRuntime.d.ts",
24
- "browser": "./dist/jsxRuntime.module.js",
25
- "umd": "./dist/jsxRuntime.umd.js",
26
- "import": "./dist/jsxRuntime.mjs",
27
- "require": "./dist/jsxRuntime.js"
21
+ "default": "./dist/jsx-runtime.js"
28
22
  },
29
23
  "./util/*": [
30
24
  "./util/*.js",