what-core 0.8.3 → 0.10.0
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/chunk-AW3BAPIK.js +1685 -0
- package/dist/chunk-AW3BAPIK.js.map +7 -0
- package/dist/chunk-AZP2EOGX.js +188 -0
- package/dist/chunk-AZP2EOGX.js.map +7 -0
- package/dist/chunk-F2HUXI22.js +1675 -0
- package/dist/chunk-F2HUXI22.js.map +7 -0
- package/dist/chunk-KBM6CWG4.min.js +2 -0
- package/dist/chunk-KBM6CWG4.min.js.map +7 -0
- package/dist/chunk-KL7TNUIU.min.js +2 -0
- package/dist/chunk-KL7TNUIU.min.js.map +7 -0
- package/dist/chunk-L6XOF7P4.min.js +2 -0
- package/dist/chunk-L6XOF7P4.min.js.map +7 -0
- package/dist/chunk-M7UEET5O.js +1323 -0
- package/dist/chunk-M7UEET5O.js.map +7 -0
- package/dist/chunk-O3SKPRTY.min.js +2 -0
- package/dist/chunk-O3SKPRTY.min.js.map +7 -0
- package/dist/chunk-RN6QIBWL.min.js +2 -0
- package/dist/chunk-RN6QIBWL.min.js.map +7 -0
- package/dist/chunk-VMTTYB4L.min.js +2 -0
- package/dist/chunk-VMTTYB4L.min.js.map +7 -0
- package/dist/chunk-VP4WLF5A.js +1323 -0
- package/dist/chunk-VP4WLF5A.js.map +7 -0
- package/dist/chunk-YA3W4XKH.js +1323 -0
- package/dist/chunk-YA3W4XKH.js.map +7 -0
- package/dist/index.js +212 -2785
- package/dist/index.js.map +4 -4
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +4 -4
- package/dist/jsx-dev-runtime.js +4 -53
- package/dist/jsx-dev-runtime.js.map +3 -3
- package/dist/jsx-dev-runtime.min.js +1 -1
- package/dist/jsx-dev-runtime.min.js.map +4 -4
- package/dist/jsx-runtime.js +4 -53
- package/dist/jsx-runtime.js.map +3 -3
- package/dist/jsx-runtime.min.js +1 -1
- package/dist/jsx-runtime.min.js.map +4 -4
- package/dist/render.js +22 -2044
- package/dist/render.js.map +4 -4
- package/dist/render.min.js +1 -1
- package/dist/render.min.js.map +4 -4
- package/dist/testing.js +13 -1079
- package/dist/testing.js.map +4 -4
- package/dist/testing.min.js +1 -1
- package/dist/testing.min.js.map +4 -4
- package/package.json +2 -2
- package/src/dom.js +54 -6
- package/src/h.js +15 -3
- package/src/head.js +72 -2
- package/src/hooks.js +65 -4
- package/src/hydration-data.js +34 -0
- package/src/index.js +9 -2
- package/src/reactive.js +78 -1
- package/src/render.js +450 -105
- package/src/server-context.js +48 -0
- package/src/store.js +6 -2
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
props = props || EMPTY_OBJ;
|
|
6
|
-
const argLen = arguments.length;
|
|
7
|
-
let flat;
|
|
8
|
-
if (argLen <= 2) {
|
|
9
|
-
flat = EMPTY_ARR;
|
|
10
|
-
} else if (argLen === 3) {
|
|
11
|
-
flat = _flattenSingle(arguments[2]);
|
|
12
|
-
} else {
|
|
13
|
-
const out = [];
|
|
14
|
-
for (let i = 2; i < argLen; i++) {
|
|
15
|
-
_flattenInto(arguments[i], out);
|
|
16
|
-
}
|
|
17
|
-
flat = out;
|
|
18
|
-
}
|
|
19
|
-
const key = props.key ?? null;
|
|
20
|
-
if (props.key !== void 0) {
|
|
21
|
-
props = { ...props };
|
|
22
|
-
delete props.key;
|
|
23
|
-
}
|
|
24
|
-
return { tag, props, children: flat, key, _vnode: true };
|
|
25
|
-
}
|
|
26
|
-
function Fragment({ children }) {
|
|
27
|
-
return children;
|
|
28
|
-
}
|
|
29
|
-
function _flattenSingle(child) {
|
|
30
|
-
if (child == null || child === false || child === true) return EMPTY_ARR;
|
|
31
|
-
if (Array.isArray(child)) {
|
|
32
|
-
const out = [];
|
|
33
|
-
_flattenInto(child, out);
|
|
34
|
-
return out;
|
|
35
|
-
}
|
|
36
|
-
if (typeof child === "object" && child._vnode) return [child];
|
|
37
|
-
if (typeof child === "function") return [child];
|
|
38
|
-
return [String(child)];
|
|
39
|
-
}
|
|
40
|
-
function _flattenInto(child, out) {
|
|
41
|
-
if (child == null || child === false || child === true) return;
|
|
42
|
-
if (Array.isArray(child)) {
|
|
43
|
-
for (let i = 0; i < child.length; i++) {
|
|
44
|
-
_flattenInto(child[i], out);
|
|
45
|
-
}
|
|
46
|
-
} else if (typeof child === "object" && child._vnode) {
|
|
47
|
-
out.push(child);
|
|
48
|
-
} else if (typeof child === "function") {
|
|
49
|
-
out.push(child);
|
|
50
|
-
} else {
|
|
51
|
-
out.push(String(child));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Fragment,
|
|
3
|
+
h
|
|
4
|
+
} from "./chunk-AZP2EOGX.js";
|
|
54
5
|
|
|
55
6
|
// packages/core/src/jsx-dev-runtime.js
|
|
56
7
|
function jsxDEV(type, props, key) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["// What Framework
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": ["../src/jsx-dev-runtime.js"],
|
|
4
|
+
"sourcesContent": ["// What Framework \u2014 JSX Dev Runtime\n// Same as jsx-runtime but used in development mode by Vite.\n\nimport { h, Fragment } from './h.js';\n\nexport { Fragment };\n\nexport function jsxDEV(type, props, key) {\n if (props == null) return h(type, null);\n const { children, ...rest } = props;\n if (key !== undefined) rest.key = key;\n if (children === undefined) return h(type, rest);\n if (Array.isArray(children)) return h(type, rest, ...children);\n return h(type, rest, children);\n}\n\n// Also export jsx/jsxs for compatibility \u2014 some bundlers use these even in dev\nexport const jsx = jsxDEV;\nexport const jsxs = jsxDEV;\n"],
|
|
5
|
+
"mappings": ";;;;;;AAOO,SAAS,OAAO,MAAM,OAAO,KAAK;AACvC,MAAI,SAAS,KAAM,QAAO,EAAE,MAAM,IAAI;AACtC,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI;AAC9B,MAAI,QAAQ,OAAW,MAAK,MAAM;AAClC,MAAI,aAAa,OAAW,QAAO,EAAE,MAAM,IAAI;AAC/C,MAAI,MAAM,QAAQ,QAAQ,EAAG,QAAO,EAAE,MAAM,MAAM,GAAG,QAAQ;AAC7D,SAAO,EAAE,MAAM,MAAM,QAAQ;AAC/B;AAGO,IAAM,MAAM;AACZ,IAAM,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as r,b as f}from"./chunk-O3SKPRTY.min.js";function u(n,i,o){if(i==null)return r(n,null);let{children:e,...t}=i;return o!==void 0&&(t.key=o),e===void 0?r(n,t):Array.isArray(e)?r(n,t,...e):r(n,t,e)}var x=u,c=u;export{f as Fragment,x as jsx,u as jsxDEV,c as jsxs};
|
|
2
2
|
//# sourceMappingURL=jsx-dev-runtime.min.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["// What Framework
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../src/jsx-dev-runtime.js"],
|
|
4
|
+
"sourcesContent": ["// What Framework \u2014 JSX Dev Runtime\n// Same as jsx-runtime but used in development mode by Vite.\n\nimport { h, Fragment } from './h.js';\n\nexport { Fragment };\n\nexport function jsxDEV(type, props, key) {\n if (props == null) return h(type, null);\n const { children, ...rest } = props;\n if (key !== undefined) rest.key = key;\n if (children === undefined) return h(type, rest);\n if (Array.isArray(children)) return h(type, rest, ...children);\n return h(type, rest, children);\n}\n\n// Also export jsx/jsxs for compatibility \u2014 some bundlers use these even in dev\nexport const jsx = jsxDEV;\nexport const jsxs = jsxDEV;\n"],
|
|
5
|
+
"mappings": "mDAOO,SAASA,EAAOC,EAAMC,EAAOC,EAAK,CACvC,GAAID,GAAS,KAAM,OAAOE,EAAEH,EAAM,IAAI,EACtC,GAAM,CAAE,SAAAI,EAAU,GAAGC,CAAK,EAAIJ,EAE9B,OADIC,IAAQ,SAAWG,EAAK,IAAMH,GAC9BE,IAAa,OAAkBD,EAAEH,EAAMK,CAAI,EAC3C,MAAM,QAAQD,CAAQ,EAAUD,EAAEH,EAAMK,EAAM,GAAGD,CAAQ,EACtDD,EAAEH,EAAMK,EAAMD,CAAQ,CAC/B,CAGO,IAAME,EAAMP,EACNQ,EAAOR",
|
|
6
|
+
"names": ["jsxDEV", "type", "props", "key", "h", "children", "rest", "jsx", "jsxs"]
|
|
7
7
|
}
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
props = props || EMPTY_OBJ;
|
|
6
|
-
const argLen = arguments.length;
|
|
7
|
-
let flat;
|
|
8
|
-
if (argLen <= 2) {
|
|
9
|
-
flat = EMPTY_ARR;
|
|
10
|
-
} else if (argLen === 3) {
|
|
11
|
-
flat = _flattenSingle(arguments[2]);
|
|
12
|
-
} else {
|
|
13
|
-
const out = [];
|
|
14
|
-
for (let i = 2; i < argLen; i++) {
|
|
15
|
-
_flattenInto(arguments[i], out);
|
|
16
|
-
}
|
|
17
|
-
flat = out;
|
|
18
|
-
}
|
|
19
|
-
const key = props.key ?? null;
|
|
20
|
-
if (props.key !== void 0) {
|
|
21
|
-
props = { ...props };
|
|
22
|
-
delete props.key;
|
|
23
|
-
}
|
|
24
|
-
return { tag, props, children: flat, key, _vnode: true };
|
|
25
|
-
}
|
|
26
|
-
function Fragment({ children }) {
|
|
27
|
-
return children;
|
|
28
|
-
}
|
|
29
|
-
function _flattenSingle(child) {
|
|
30
|
-
if (child == null || child === false || child === true) return EMPTY_ARR;
|
|
31
|
-
if (Array.isArray(child)) {
|
|
32
|
-
const out = [];
|
|
33
|
-
_flattenInto(child, out);
|
|
34
|
-
return out;
|
|
35
|
-
}
|
|
36
|
-
if (typeof child === "object" && child._vnode) return [child];
|
|
37
|
-
if (typeof child === "function") return [child];
|
|
38
|
-
return [String(child)];
|
|
39
|
-
}
|
|
40
|
-
function _flattenInto(child, out) {
|
|
41
|
-
if (child == null || child === false || child === true) return;
|
|
42
|
-
if (Array.isArray(child)) {
|
|
43
|
-
for (let i = 0; i < child.length; i++) {
|
|
44
|
-
_flattenInto(child[i], out);
|
|
45
|
-
}
|
|
46
|
-
} else if (typeof child === "object" && child._vnode) {
|
|
47
|
-
out.push(child);
|
|
48
|
-
} else if (typeof child === "function") {
|
|
49
|
-
out.push(child);
|
|
50
|
-
} else {
|
|
51
|
-
out.push(String(child));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Fragment,
|
|
3
|
+
h
|
|
4
|
+
} from "./chunk-AZP2EOGX.js";
|
|
54
5
|
|
|
55
6
|
// packages/core/src/jsx-runtime.js
|
|
56
7
|
function jsx(type, props, key) {
|
package/dist/jsx-runtime.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["// What Framework
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": ["../src/jsx-runtime.js"],
|
|
4
|
+
"sourcesContent": ["// What Framework \u2014 JSX Automatic Runtime\n// Used by: jsxImportSource: \"what-framework\" (or \"what-core\")\n// Vite/esbuild import this automatically when using the \"react-jsx\" transform.\n\nimport { h, Fragment } from './h.js';\n\nexport { Fragment };\n\n// Automatic JSX transform signature: jsx(type, { children, ...props }, key)\n// What's h() signature: h(type, props, ...children)\nexport function jsx(type, props, key) {\n if (props == null) return h(type, null);\n const { children, ...rest } = props;\n if (key !== undefined) rest.key = key;\n if (children === undefined) return h(type, rest);\n if (Array.isArray(children)) return h(type, rest, ...children);\n return h(type, rest, children);\n}\n\n// jsxs = jsx for static children (multiple). Same behavior for What.\nexport const jsxs = jsx;\n"],
|
|
5
|
+
"mappings": ";;;;;;AAUO,SAAS,IAAI,MAAM,OAAO,KAAK;AACpC,MAAI,SAAS,KAAM,QAAO,EAAE,MAAM,IAAI;AACtC,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI;AAC9B,MAAI,QAAQ,OAAW,MAAK,MAAM;AAClC,MAAI,aAAa,OAAW,QAAO,EAAE,MAAM,IAAI;AAC/C,MAAI,MAAM,QAAQ,QAAQ,EAAG,QAAO,EAAE,MAAM,MAAM,GAAG,QAAQ;AAC7D,SAAO,EAAE,MAAM,MAAM,QAAQ;AAC/B;AAGO,IAAM,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx-runtime.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as r,b as f}from"./chunk-O3SKPRTY.min.js";function o(n,t,u){if(t==null)return r(n,null);let{children:e,...i}=t;return u!==void 0&&(i.key=u),e===void 0?r(n,i):Array.isArray(e)?r(n,i,...e):r(n,i,e)}var d=o;export{f as Fragment,o as jsx,d as jsxs};
|
|
2
2
|
//# sourceMappingURL=jsx-runtime.min.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["// What Framework
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../src/jsx-runtime.js"],
|
|
4
|
+
"sourcesContent": ["// What Framework \u2014 JSX Automatic Runtime\n// Used by: jsxImportSource: \"what-framework\" (or \"what-core\")\n// Vite/esbuild import this automatically when using the \"react-jsx\" transform.\n\nimport { h, Fragment } from './h.js';\n\nexport { Fragment };\n\n// Automatic JSX transform signature: jsx(type, { children, ...props }, key)\n// What's h() signature: h(type, props, ...children)\nexport function jsx(type, props, key) {\n if (props == null) return h(type, null);\n const { children, ...rest } = props;\n if (key !== undefined) rest.key = key;\n if (children === undefined) return h(type, rest);\n if (Array.isArray(children)) return h(type, rest, ...children);\n return h(type, rest, children);\n}\n\n// jsxs = jsx for static children (multiple). Same behavior for What.\nexport const jsxs = jsx;\n"],
|
|
5
|
+
"mappings": "mDAUO,SAASA,EAAIC,EAAMC,EAAOC,EAAK,CACpC,GAAID,GAAS,KAAM,OAAOE,EAAEH,EAAM,IAAI,EACtC,GAAM,CAAE,SAAAI,EAAU,GAAGC,CAAK,EAAIJ,EAE9B,OADIC,IAAQ,SAAWG,EAAK,IAAMH,GAC9BE,IAAa,OAAkBD,EAAEH,EAAMK,CAAI,EAC3C,MAAM,QAAQD,CAAQ,EAAUD,EAAEH,EAAMK,EAAM,GAAGD,CAAQ,EACtDD,EAAEH,EAAMK,EAAMD,CAAQ,CAC/B,CAGO,IAAME,EAAOP",
|
|
6
|
+
"names": ["jsx", "type", "props", "key", "h", "children", "rest", "jsxs"]
|
|
7
7
|
}
|