@unsetsoft/ryunixjs 1.2.3-canary.1 → 1.2.3-canary.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.
- package/jsx-dev-runtime.js +28 -0
- package/jsx-runtime.js +27 -0
- package/package.json +14 -3
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const Ryunix =
|
|
2
|
+
typeof window !== 'undefined' && window.Ryunix
|
|
3
|
+
? window.Ryunix
|
|
4
|
+
: typeof global !== 'undefined' && global.Ryunix
|
|
5
|
+
? global.Ryunix
|
|
6
|
+
: null
|
|
7
|
+
|
|
8
|
+
if (!Ryunix) {
|
|
9
|
+
throw new Error('Ryunix must be available globally')
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function jsxDEV(type, props, key) {
|
|
13
|
+
const { children, ...restProps } = props || {}
|
|
14
|
+
|
|
15
|
+
if (key !== undefined) {
|
|
16
|
+
restProps.key = key
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (Array.isArray(children)) {
|
|
20
|
+
return Ryunix.createElement(type, restProps, ...children)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return Ryunix.createElement(type, restProps, children)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const Fragment = Ryunix.Fragment
|
|
27
|
+
|
|
28
|
+
export default { jsxDEV, Fragment }
|
package/jsx-runtime.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const Ryunix =
|
|
2
|
+
typeof window !== 'undefined' && window.Ryunix
|
|
3
|
+
? window.Ryunix
|
|
4
|
+
: typeof global !== 'undefined' && global.Ryunix
|
|
5
|
+
? global.Ryunix
|
|
6
|
+
: null
|
|
7
|
+
|
|
8
|
+
if (!Ryunix) {
|
|
9
|
+
throw new Error('Ryunix must be available globally')
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function jsx(type, props) {
|
|
13
|
+
const { children, ...restProps } = props || {}
|
|
14
|
+
return Ryunix.createElement(type, restProps, children)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function jsxs(type, props) {
|
|
18
|
+
const { children, ...restProps } = props || {}
|
|
19
|
+
if (Array.isArray(children)) {
|
|
20
|
+
return Ryunix.createElement(type, restProps, ...children)
|
|
21
|
+
}
|
|
22
|
+
return Ryunix.createElement(type, restProps, children)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Fragment = Ryunix.Fragment
|
|
26
|
+
|
|
27
|
+
export default { jsx, jsxs, Fragment }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unsetsoft/ryunixjs",
|
|
3
|
-
"version": "1.2.3-canary.
|
|
3
|
+
"version": "1.2.3-canary.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/Ryunix.min.js",
|
|
6
6
|
"types": "./dist/Ryunix.d.ts",
|
|
@@ -43,6 +43,17 @@
|
|
|
43
43
|
"registry": "https://registry.npmjs.org"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
|
-
"dist"
|
|
47
|
-
|
|
46
|
+
"dist",
|
|
47
|
+
"jsx-runtime.js",
|
|
48
|
+
"jsx-dev-runtime.js"
|
|
49
|
+
],
|
|
50
|
+
"exports": {
|
|
51
|
+
".": "./dist/Ryunix.min.js",
|
|
52
|
+
"./jsx-runtime": {
|
|
53
|
+
"development": "./jsx-dev-runtime.js",
|
|
54
|
+
"production": "./jsx-runtime.js",
|
|
55
|
+
"default": "./jsx-runtime.js"
|
|
56
|
+
},
|
|
57
|
+
"./jsx-dev-runtime": "./jsx-dev-runtime.js"
|
|
58
|
+
}
|
|
48
59
|
}
|