@number10/phaserjsx 0.6.0 → 4.0.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/README.md +13 -3
- package/dist/clip/stencil-clip.d.ts +86 -0
- package/dist/clip/stencil-clip.d.ts.map +1 -0
- package/dist/components/appliers/applyGestures.d.ts.map +1 -1
- package/dist/components/creators/createGestures.d.ts.map +1 -1
- package/dist/components/custom/CharText/CharText.d.ts.map +1 -1
- package/dist/components/custom/Dialog.d.ts +1 -1
- package/dist/components/custom/Divider.d.ts +1 -1
- package/dist/components/custom/Graphics.d.ts +1 -1
- package/dist/components/custom/Graphics.d.ts.map +1 -1
- package/dist/components/custom/Icon.d.ts.map +1 -1
- package/dist/components/custom/Image.d.ts.map +1 -1
- package/dist/components/custom/Joystick.d.ts +1 -1
- package/dist/components/custom/NineSlice.d.ts.map +1 -1
- package/dist/components/custom/Particles.d.ts +1 -1
- package/dist/components/custom/Particles.d.ts.map +1 -1
- package/dist/components/custom/Portal.d.ts.map +1 -1
- package/dist/components/custom/RefOriginView.d.ts +1 -1
- package/dist/components/custom/ScrollView.d.ts.map +1 -1
- package/dist/components/custom/Sprite.d.ts +1 -1
- package/dist/components/custom/Sprite.d.ts.map +1 -1
- package/dist/components/custom/Text.d.ts.map +1 -1
- package/dist/components/custom/TileSprite.d.ts +1 -1
- package/dist/components/custom/TileSprite.d.ts.map +1 -1
- package/dist/components/custom/View.d.ts.map +1 -1
- package/dist/components/custom/index.cjs +34 -36
- package/dist/components/custom/index.js +2 -37
- package/dist/components/primitives/graphics.d.ts.map +1 -1
- package/dist/components/primitives/image.d.ts.map +1 -1
- package/dist/components/primitives/nineslice.d.ts.map +1 -1
- package/dist/components/primitives/particles.d.ts.map +1 -1
- package/dist/components/primitives/sprite.d.ts.map +1 -1
- package/dist/components/primitives/text.d.ts.map +1 -1
- package/dist/components/primitives/tilesprite.d.ts.map +1 -1
- package/dist/components/primitives/view.d.ts.map +1 -1
- package/dist/custom-BN31OAJq.cjs +30826 -0
- package/dist/custom-BN31OAJq.cjs.map +1 -0
- package/dist/custom-oy3mBnrW.js +29562 -0
- package/dist/custom-oy3mBnrW.js.map +1 -0
- package/dist/fx/fx-creators/blur.d.ts.map +1 -1
- package/dist/fx/fx-creators/color-matrix.d.ts.map +1 -1
- package/dist/fx/fx-creators/glow.d.ts.map +1 -1
- package/dist/fx/fx-creators/pixelate.d.ts.map +1 -1
- package/dist/fx/fx-creators/shadow.d.ts.map +1 -1
- package/dist/fx/fx-creators/vignette.d.ts.map +1 -1
- package/dist/fx/use-fx.d.ts +3 -3
- package/dist/fx/use-fx.d.ts.map +1 -1
- package/dist/gestures/gesture-manager.d.ts +3 -1
- package/dist/gestures/gesture-manager.d.ts.map +1 -1
- package/dist/gestures/gesture-types.d.ts +1 -1
- package/dist/gestures/gesture-types.d.ts.map +1 -1
- package/dist/index.cjs +1547 -2837
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1356 -2866
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.cjs +12 -7
- package/dist/jsx-dev-runtime.cjs.map +1 -1
- package/dist/jsx-dev-runtime.js +11 -11
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.cjs +55 -33
- package/dist/jsx-runtime.cjs.map +1 -1
- package/dist/jsx-runtime.js +56 -37
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/layout/layout-engine.d.ts.map +1 -1
- package/dist/scripts/generate-icon-loaders.js +146 -143
- package/dist/scripts/generate-icon-types.js +94 -83
- package/dist/scripts/generate-icons.d.ts +1 -2
- package/dist/scripts/generate-icons.d.ts.map +1 -1
- package/dist/scripts/generate-icons.js +381 -399
- package/dist/scripts/icon-generator-config.d.ts +0 -1
- package/dist/scripts/icon-generator-config.js +7 -4
- package/dist/theme-base.d.ts.map +1 -1
- package/dist/utils/svg-texture.d.ts.map +1 -1
- package/dist/vite-plugin-icons.d.ts +1 -2
- package/dist/vite-plugin-icons.js +109 -90
- package/package.json +24 -22
- package/dist/TransformOriginView-DsD_qZno.cjs +0 -17115
- package/dist/TransformOriginView-DsD_qZno.cjs.map +0 -1
- package/dist/TransformOriginView-uYYqbEHW.js +0 -17099
- package/dist/TransformOriginView-uYYqbEHW.js.map +0 -1
- package/dist/components/custom/index.cjs.map +0 -1
- package/dist/components/custom/index.js.map +0 -1
package/dist/jsx-dev-runtime.cjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports
|
|
7
|
-
|
|
2
|
+
const require_jsx_runtime = require("./jsx-runtime.cjs");
|
|
3
|
+
//#region src/jsx-dev-runtime.ts
|
|
4
|
+
/**
|
|
5
|
+
* JSX dev runtime (re-exports jsx-runtime for development mode)
|
|
6
|
+
*/
|
|
7
|
+
var jsx = require_jsx_runtime.jsx;
|
|
8
|
+
var jsxDEV = require_jsx_runtime.jsx;
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.Fragment = require_jsx_runtime.Fragment;
|
|
8
11
|
exports.jsx = jsx;
|
|
9
12
|
exports.jsxDEV = jsxDEV;
|
|
10
|
-
|
|
13
|
+
exports.jsxs = require_jsx_runtime.jsxs;
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=jsx-dev-runtime.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-dev-runtime.cjs","sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["/**\n * JSX dev runtime (re-exports jsx-runtime for development mode)\n */\nimport { jsx as jsxProd } from './jsx-runtime'\n\nexport { Fragment, jsxs } from './jsx-runtime'\nexport const jsx = jsxProd\nexport const jsxDEV = jsxProd\n"],"
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.cjs","names":[],"sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["/**\n * JSX dev runtime (re-exports jsx-runtime for development mode)\n */\nimport { jsx as jsxProd } from './jsx-runtime'\n\nexport { Fragment, jsxs } from './jsx-runtime'\nexport const jsx = jsxProd\nexport const jsxDEV = jsxProd\n"],"mappings":";;;;;;AAMA,IAAa,MAAM,oBAAA;AACnB,IAAa,SAAS,oBAAA"}
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as jsx$1 } from "./jsx-runtime.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=jsx-dev-runtime.js.map
|
|
1
|
+
import { Fragment, jsx as jsx$1, jsxs } from "./jsx-runtime.js";
|
|
2
|
+
//#region src/jsx-dev-runtime.ts
|
|
3
|
+
/**
|
|
4
|
+
* JSX dev runtime (re-exports jsx-runtime for development mode)
|
|
5
|
+
*/
|
|
6
|
+
var jsx = jsx$1;
|
|
7
|
+
var jsxDEV = jsx$1;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Fragment, jsx, jsxDEV, jsxs };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=jsx-dev-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-dev-runtime.js","sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["/**\n * JSX dev runtime (re-exports jsx-runtime for development mode)\n */\nimport { jsx as jsxProd } from './jsx-runtime'\n\nexport { Fragment, jsxs } from './jsx-runtime'\nexport const jsx = jsxProd\nexport const jsxDEV = jsxProd\n"],"
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.js","names":[],"sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["/**\n * JSX dev runtime (re-exports jsx-runtime for development mode)\n */\nimport { jsx as jsxProd } from './jsx-runtime'\n\nexport { Fragment, jsxs } from './jsx-runtime'\nexport const jsx = jsxProd\nexport const jsxDEV = jsxProd\n"],"mappings":";;;;;AAMA,IAAa,MAAM;AACnB,IAAa,SAAS"}
|
package/dist/jsx-runtime.cjs
CHANGED
|
@@ -1,43 +1,65 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
|
|
2
|
+
//#region src/jsx-runtime.ts
|
|
3
|
+
var Fragment = (props) => props?.children ?? null;
|
|
4
|
+
/**
|
|
5
|
+
* Safely sets a property on a VNode, handling frozen/sealed objects from bundlers
|
|
6
|
+
* @param vnode - VNode to set property on
|
|
7
|
+
* @param key - Property key
|
|
8
|
+
* @param value - Value to set
|
|
9
|
+
* @returns Original VNode if extensible, or shallow copy with property
|
|
10
|
+
*/
|
|
4
11
|
function setVNodeProp(vnode, key, value) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
if (Object.isExtensible(vnode)) {
|
|
13
|
+
vnode[key] = value;
|
|
14
|
+
return vnode;
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
...vnode,
|
|
18
|
+
[key]: value
|
|
19
|
+
};
|
|
10
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* JSX factory for automatic runtime (dynamic children)
|
|
23
|
+
* Used by TypeScript for expressions like {items.map(...)}
|
|
24
|
+
* @param type - Element type (string or component function)
|
|
25
|
+
* @param props - Props including children
|
|
26
|
+
* @param key - Optional key for identity tracking
|
|
27
|
+
* @returns VNode object
|
|
28
|
+
*/
|
|
11
29
|
function jsx(type, props, key) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (expand !== void 0) addConfig.expand = expand;
|
|
28
|
-
if (proportion !== void 0) addConfig.proportion = proportion;
|
|
29
|
-
vnode = setVNodeProp(vnode, "__addConfig", addConfig);
|
|
30
|
-
}
|
|
31
|
-
return vnode;
|
|
30
|
+
const { children, expand, proportion, theme, ...rest } = props ?? {};
|
|
31
|
+
let vnode = {
|
|
32
|
+
type,
|
|
33
|
+
props: rest,
|
|
34
|
+
children: children == null ? [] : Array.isArray(children) ? children.flat(Infinity) : [children]
|
|
35
|
+
};
|
|
36
|
+
if (key !== void 0 && key !== null) vnode = setVNodeProp(vnode, "__key", typeof key === "string" || typeof key === "number" ? key : String(key));
|
|
37
|
+
if (theme !== void 0) vnode = setVNodeProp(vnode, "__theme", theme);
|
|
38
|
+
if (expand !== void 0 || proportion !== void 0) {
|
|
39
|
+
const addConfig = {};
|
|
40
|
+
if (expand !== void 0) addConfig.expand = expand;
|
|
41
|
+
if (proportion !== void 0) addConfig.proportion = proportion;
|
|
42
|
+
vnode = setVNodeProp(vnode, "__addConfig", addConfig);
|
|
43
|
+
}
|
|
44
|
+
return vnode;
|
|
32
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* JSX factory for static children arrays
|
|
48
|
+
* Used by TypeScript when children are directly listed in JSX (not via .map())
|
|
49
|
+
* Marks children as static so VDOM doesn't warn about missing keys
|
|
50
|
+
* @param type - Element type (string or component function)
|
|
51
|
+
* @param props - Props including children
|
|
52
|
+
* @param key - Optional key for identity tracking
|
|
53
|
+
* @returns VNode object
|
|
54
|
+
*/
|
|
33
55
|
function jsxs(type, props, key) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
return vnode;
|
|
56
|
+
let vnode = jsx(type, props, key);
|
|
57
|
+
if (vnode && typeof vnode === "object" && "type" in vnode) vnode = setVNodeProp(vnode, "__staticChildren", true);
|
|
58
|
+
return vnode;
|
|
39
59
|
}
|
|
60
|
+
//#endregion
|
|
40
61
|
exports.Fragment = Fragment;
|
|
41
62
|
exports.jsx = jsx;
|
|
42
63
|
exports.jsxs = jsxs;
|
|
43
|
-
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=jsx-runtime.cjs.map
|
package/dist/jsx-runtime.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.cjs","sources":["../src/jsx-runtime.ts"],"sourcesContent":["/**\n * Minimal JSX runtime for the TS \"react-jsx\" automatic runtime.\n * This builds plain VNode objects consumed by our custom mount/patch.\n */\nimport type { VNode } from './hooks'\nimport type { VNodeLike } from './types'\n\nexport const Fragment = (props: { children?: VNodeLike }): VNodeLike => props?.children ?? null\n\n/**\n * Safely sets a property on a VNode, handling frozen/sealed objects from bundlers\n * @param vnode - VNode to set property on\n * @param key - Property key\n * @param value - Value to set\n * @returns Original VNode if extensible, or shallow copy with property\n */\nfunction setVNodeProp<T extends VNode, K extends keyof VNode>(\n vnode: T,\n key: K,\n value: VNode[K]\n): T {\n if (Object.isExtensible(vnode)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(vnode as any)[key] = value\n return vnode\n }\n // VNode is frozen - create shallow copy\n return { ...vnode, [key]: value } as T\n}\n\n/**\n * JSX factory for automatic runtime (dynamic children)\n * Used by TypeScript for expressions like {items.map(...)}\n * @param type - Element type (string or component function)\n * @param props - Props including children\n * @param key - Optional key for identity tracking\n * @returns VNode object\n */\nexport function jsx(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: unknown\n): VNodeLike {\n const { children, expand, proportion, theme, ...rest } = props ?? {}\n // Flatten children arrays deeply to support {arrayVariable} in JSX\n const kids =\n children == null ? [] : Array.isArray(children) ? children.flat(Infinity) : [children]\n let vnode: VNode = { type, props: rest, children: kids }\n\n // Extract key\n if (key !== undefined && key !== null) {\n vnode = setVNodeProp(\n vnode,\n '__key',\n typeof key === 'string' || typeof key === 'number' ? key : String(key)\n )\n }\n\n // Extract theme and store separately (removed from props)\n if (theme !== undefined) {\n vnode = setVNodeProp(vnode, '__theme', theme as NonNullable<VNode['__theme']>)\n }\n\n // Extract UI add() config and store separately (removed from props)\n if (expand !== undefined || proportion !== undefined) {\n const addConfig: NonNullable<VNode['__addConfig']> = {}\n if (expand !== undefined) addConfig.expand = expand as boolean\n if (proportion !== undefined) addConfig.proportion = proportion as number\n vnode = setVNodeProp(vnode, '__addConfig', addConfig)\n }\n\n return vnode\n}\n\n/**\n * JSX factory for static children arrays\n * Used by TypeScript when children are directly listed in JSX (not via .map())\n * Marks children as static so VDOM doesn't warn about missing keys\n * @param type - Element type (string or component function)\n * @param props - Props including children\n * @param key - Optional key for identity tracking\n * @returns VNode object\n */\nexport function jsxs(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: unknown\n): VNodeLike {\n let vnode = jsx(type, props, key) as VNode\n // Mark as static children - no key warnings needed\n if (vnode && typeof vnode === 'object' && 'type' in vnode) {\n vnode = setVNodeProp(vnode, '__staticChildren', true)\n }\n return vnode\n}\n"],"
|
|
1
|
+
{"version":3,"file":"jsx-runtime.cjs","names":[],"sources":["../src/jsx-runtime.ts"],"sourcesContent":["/**\n * Minimal JSX runtime for the TS \"react-jsx\" automatic runtime.\n * This builds plain VNode objects consumed by our custom mount/patch.\n */\nimport type { VNode } from './hooks'\nimport type { VNodeLike } from './types'\n\nexport const Fragment = (props: { children?: VNodeLike }): VNodeLike => props?.children ?? null\n\n/**\n * Safely sets a property on a VNode, handling frozen/sealed objects from bundlers\n * @param vnode - VNode to set property on\n * @param key - Property key\n * @param value - Value to set\n * @returns Original VNode if extensible, or shallow copy with property\n */\nfunction setVNodeProp<T extends VNode, K extends keyof VNode>(\n vnode: T,\n key: K,\n value: VNode[K]\n): T {\n if (Object.isExtensible(vnode)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(vnode as any)[key] = value\n return vnode\n }\n // VNode is frozen - create shallow copy\n return { ...vnode, [key]: value } as T\n}\n\n/**\n * JSX factory for automatic runtime (dynamic children)\n * Used by TypeScript for expressions like {items.map(...)}\n * @param type - Element type (string or component function)\n * @param props - Props including children\n * @param key - Optional key for identity tracking\n * @returns VNode object\n */\nexport function jsx(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: unknown\n): VNodeLike {\n const { children, expand, proportion, theme, ...rest } = props ?? {}\n // Flatten children arrays deeply to support {arrayVariable} in JSX\n const kids =\n children == null ? [] : Array.isArray(children) ? children.flat(Infinity) : [children]\n let vnode: VNode = { type, props: rest, children: kids }\n\n // Extract key\n if (key !== undefined && key !== null) {\n vnode = setVNodeProp(\n vnode,\n '__key',\n typeof key === 'string' || typeof key === 'number' ? key : String(key)\n )\n }\n\n // Extract theme and store separately (removed from props)\n if (theme !== undefined) {\n vnode = setVNodeProp(vnode, '__theme', theme as NonNullable<VNode['__theme']>)\n }\n\n // Extract UI add() config and store separately (removed from props)\n if (expand !== undefined || proportion !== undefined) {\n const addConfig: NonNullable<VNode['__addConfig']> = {}\n if (expand !== undefined) addConfig.expand = expand as boolean\n if (proportion !== undefined) addConfig.proportion = proportion as number\n vnode = setVNodeProp(vnode, '__addConfig', addConfig)\n }\n\n return vnode\n}\n\n/**\n * JSX factory for static children arrays\n * Used by TypeScript when children are directly listed in JSX (not via .map())\n * Marks children as static so VDOM doesn't warn about missing keys\n * @param type - Element type (string or component function)\n * @param props - Props including children\n * @param key - Optional key for identity tracking\n * @returns VNode object\n */\nexport function jsxs(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: unknown\n): VNodeLike {\n let vnode = jsx(type, props, key) as VNode\n // Mark as static children - no key warnings needed\n if (vnode && typeof vnode === 'object' && 'type' in vnode) {\n vnode = setVNodeProp(vnode, '__staticChildren', true)\n }\n return vnode\n}\n"],"mappings":";;AAOA,IAAa,YAAY,UAA+C,OAAO,YAAY;;;;;;;;AAS3F,SAAS,aACP,OACA,KACA,OACG;CACH,IAAI,OAAO,aAAa,KAAK,GAAG;EAE7B,MAAe,OAAO;EACvB,OAAO;CACT;CAEA,OAAO;EAAE,GAAG;GAAQ,MAAM;CAAM;AAClC;;;;;;;;;AAUA,SAAgB,IACd,MACA,OACA,KACW;CACX,MAAM,EAAE,UAAU,QAAQ,YAAY,OAAO,GAAG,SAAS,SAAS,CAAC;CAInE,IAAI,QAAe;EAAE;EAAM,OAAO;EAAM,UADtC,YAAY,OAAO,CAAC,IAAI,MAAM,QAAQ,QAAQ,IAAI,SAAS,KAAK,QAAQ,IAAI,CAAC,QAAQ;CAChC;CAGvD,IAAI,QAAQ,KAAA,KAAa,QAAQ,MAC/B,QAAQ,aACN,OACA,SACA,OAAO,QAAQ,YAAY,OAAO,QAAQ,WAAW,MAAM,OAAO,GAAG,CACvE;CAIF,IAAI,UAAU,KAAA,GACZ,QAAQ,aAAa,OAAO,WAAW,KAAsC;CAI/E,IAAI,WAAW,KAAA,KAAa,eAAe,KAAA,GAAW;EACpD,MAAM,YAA+C,CAAC;EACtD,IAAI,WAAW,KAAA,GAAW,UAAU,SAAS;EAC7C,IAAI,eAAe,KAAA,GAAW,UAAU,aAAa;EACrD,QAAQ,aAAa,OAAO,eAAe,SAAS;CACtD;CAEA,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,KACd,MACA,OACA,KACW;CACX,IAAI,QAAQ,IAAI,MAAM,OAAO,GAAG;CAEhC,IAAI,SAAS,OAAO,UAAU,YAAY,UAAU,OAClD,QAAQ,aAAa,OAAO,oBAAoB,IAAI;CAEtD,OAAO;AACT"}
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,43 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/jsx-runtime.ts
|
|
2
|
+
var Fragment = (props) => props?.children ?? null;
|
|
3
|
+
/**
|
|
4
|
+
* Safely sets a property on a VNode, handling frozen/sealed objects from bundlers
|
|
5
|
+
* @param vnode - VNode to set property on
|
|
6
|
+
* @param key - Property key
|
|
7
|
+
* @param value - Value to set
|
|
8
|
+
* @returns Original VNode if extensible, or shallow copy with property
|
|
9
|
+
*/
|
|
2
10
|
function setVNodeProp(vnode, key, value) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
if (Object.isExtensible(vnode)) {
|
|
12
|
+
vnode[key] = value;
|
|
13
|
+
return vnode;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
...vnode,
|
|
17
|
+
[key]: value
|
|
18
|
+
};
|
|
8
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* JSX factory for automatic runtime (dynamic children)
|
|
22
|
+
* Used by TypeScript for expressions like {items.map(...)}
|
|
23
|
+
* @param type - Element type (string or component function)
|
|
24
|
+
* @param props - Props including children
|
|
25
|
+
* @param key - Optional key for identity tracking
|
|
26
|
+
* @returns VNode object
|
|
27
|
+
*/
|
|
9
28
|
function jsx(type, props, key) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (expand !== void 0) addConfig.expand = expand;
|
|
26
|
-
if (proportion !== void 0) addConfig.proportion = proportion;
|
|
27
|
-
vnode = setVNodeProp(vnode, "__addConfig", addConfig);
|
|
28
|
-
}
|
|
29
|
-
return vnode;
|
|
29
|
+
const { children, expand, proportion, theme, ...rest } = props ?? {};
|
|
30
|
+
let vnode = {
|
|
31
|
+
type,
|
|
32
|
+
props: rest,
|
|
33
|
+
children: children == null ? [] : Array.isArray(children) ? children.flat(Infinity) : [children]
|
|
34
|
+
};
|
|
35
|
+
if (key !== void 0 && key !== null) vnode = setVNodeProp(vnode, "__key", typeof key === "string" || typeof key === "number" ? key : String(key));
|
|
36
|
+
if (theme !== void 0) vnode = setVNodeProp(vnode, "__theme", theme);
|
|
37
|
+
if (expand !== void 0 || proportion !== void 0) {
|
|
38
|
+
const addConfig = {};
|
|
39
|
+
if (expand !== void 0) addConfig.expand = expand;
|
|
40
|
+
if (proportion !== void 0) addConfig.proportion = proportion;
|
|
41
|
+
vnode = setVNodeProp(vnode, "__addConfig", addConfig);
|
|
42
|
+
}
|
|
43
|
+
return vnode;
|
|
30
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* JSX factory for static children arrays
|
|
47
|
+
* Used by TypeScript when children are directly listed in JSX (not via .map())
|
|
48
|
+
* Marks children as static so VDOM doesn't warn about missing keys
|
|
49
|
+
* @param type - Element type (string or component function)
|
|
50
|
+
* @param props - Props including children
|
|
51
|
+
* @param key - Optional key for identity tracking
|
|
52
|
+
* @returns VNode object
|
|
53
|
+
*/
|
|
31
54
|
function jsxs(type, props, key) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
return vnode;
|
|
55
|
+
let vnode = jsx(type, props, key);
|
|
56
|
+
if (vnode && typeof vnode === "object" && "type" in vnode) vnode = setVNodeProp(vnode, "__staticChildren", true);
|
|
57
|
+
return vnode;
|
|
37
58
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=jsx-runtime.js.map
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Fragment, jsx, jsxs };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
package/dist/jsx-runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.js","sources":["../src/jsx-runtime.ts"],"sourcesContent":["/**\n * Minimal JSX runtime for the TS \"react-jsx\" automatic runtime.\n * This builds plain VNode objects consumed by our custom mount/patch.\n */\nimport type { VNode } from './hooks'\nimport type { VNodeLike } from './types'\n\nexport const Fragment = (props: { children?: VNodeLike }): VNodeLike => props?.children ?? null\n\n/**\n * Safely sets a property on a VNode, handling frozen/sealed objects from bundlers\n * @param vnode - VNode to set property on\n * @param key - Property key\n * @param value - Value to set\n * @returns Original VNode if extensible, or shallow copy with property\n */\nfunction setVNodeProp<T extends VNode, K extends keyof VNode>(\n vnode: T,\n key: K,\n value: VNode[K]\n): T {\n if (Object.isExtensible(vnode)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(vnode as any)[key] = value\n return vnode\n }\n // VNode is frozen - create shallow copy\n return { ...vnode, [key]: value } as T\n}\n\n/**\n * JSX factory for automatic runtime (dynamic children)\n * Used by TypeScript for expressions like {items.map(...)}\n * @param type - Element type (string or component function)\n * @param props - Props including children\n * @param key - Optional key for identity tracking\n * @returns VNode object\n */\nexport function jsx(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: unknown\n): VNodeLike {\n const { children, expand, proportion, theme, ...rest } = props ?? {}\n // Flatten children arrays deeply to support {arrayVariable} in JSX\n const kids =\n children == null ? [] : Array.isArray(children) ? children.flat(Infinity) : [children]\n let vnode: VNode = { type, props: rest, children: kids }\n\n // Extract key\n if (key !== undefined && key !== null) {\n vnode = setVNodeProp(\n vnode,\n '__key',\n typeof key === 'string' || typeof key === 'number' ? key : String(key)\n )\n }\n\n // Extract theme and store separately (removed from props)\n if (theme !== undefined) {\n vnode = setVNodeProp(vnode, '__theme', theme as NonNullable<VNode['__theme']>)\n }\n\n // Extract UI add() config and store separately (removed from props)\n if (expand !== undefined || proportion !== undefined) {\n const addConfig: NonNullable<VNode['__addConfig']> = {}\n if (expand !== undefined) addConfig.expand = expand as boolean\n if (proportion !== undefined) addConfig.proportion = proportion as number\n vnode = setVNodeProp(vnode, '__addConfig', addConfig)\n }\n\n return vnode\n}\n\n/**\n * JSX factory for static children arrays\n * Used by TypeScript when children are directly listed in JSX (not via .map())\n * Marks children as static so VDOM doesn't warn about missing keys\n * @param type - Element type (string or component function)\n * @param props - Props including children\n * @param key - Optional key for identity tracking\n * @returns VNode object\n */\nexport function jsxs(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: unknown\n): VNodeLike {\n let vnode = jsx(type, props, key) as VNode\n // Mark as static children - no key warnings needed\n if (vnode && typeof vnode === 'object' && 'type' in vnode) {\n vnode = setVNodeProp(vnode, '__staticChildren', true)\n }\n return vnode\n}\n"],"
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","names":[],"sources":["../src/jsx-runtime.ts"],"sourcesContent":["/**\n * Minimal JSX runtime for the TS \"react-jsx\" automatic runtime.\n * This builds plain VNode objects consumed by our custom mount/patch.\n */\nimport type { VNode } from './hooks'\nimport type { VNodeLike } from './types'\n\nexport const Fragment = (props: { children?: VNodeLike }): VNodeLike => props?.children ?? null\n\n/**\n * Safely sets a property on a VNode, handling frozen/sealed objects from bundlers\n * @param vnode - VNode to set property on\n * @param key - Property key\n * @param value - Value to set\n * @returns Original VNode if extensible, or shallow copy with property\n */\nfunction setVNodeProp<T extends VNode, K extends keyof VNode>(\n vnode: T,\n key: K,\n value: VNode[K]\n): T {\n if (Object.isExtensible(vnode)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(vnode as any)[key] = value\n return vnode\n }\n // VNode is frozen - create shallow copy\n return { ...vnode, [key]: value } as T\n}\n\n/**\n * JSX factory for automatic runtime (dynamic children)\n * Used by TypeScript for expressions like {items.map(...)}\n * @param type - Element type (string or component function)\n * @param props - Props including children\n * @param key - Optional key for identity tracking\n * @returns VNode object\n */\nexport function jsx(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: unknown\n): VNodeLike {\n const { children, expand, proportion, theme, ...rest } = props ?? {}\n // Flatten children arrays deeply to support {arrayVariable} in JSX\n const kids =\n children == null ? [] : Array.isArray(children) ? children.flat(Infinity) : [children]\n let vnode: VNode = { type, props: rest, children: kids }\n\n // Extract key\n if (key !== undefined && key !== null) {\n vnode = setVNodeProp(\n vnode,\n '__key',\n typeof key === 'string' || typeof key === 'number' ? key : String(key)\n )\n }\n\n // Extract theme and store separately (removed from props)\n if (theme !== undefined) {\n vnode = setVNodeProp(vnode, '__theme', theme as NonNullable<VNode['__theme']>)\n }\n\n // Extract UI add() config and store separately (removed from props)\n if (expand !== undefined || proportion !== undefined) {\n const addConfig: NonNullable<VNode['__addConfig']> = {}\n if (expand !== undefined) addConfig.expand = expand as boolean\n if (proportion !== undefined) addConfig.proportion = proportion as number\n vnode = setVNodeProp(vnode, '__addConfig', addConfig)\n }\n\n return vnode\n}\n\n/**\n * JSX factory for static children arrays\n * Used by TypeScript when children are directly listed in JSX (not via .map())\n * Marks children as static so VDOM doesn't warn about missing keys\n * @param type - Element type (string or component function)\n * @param props - Props including children\n * @param key - Optional key for identity tracking\n * @returns VNode object\n */\nexport function jsxs(\n type: unknown,\n props: Record<string, unknown> | null,\n key?: unknown\n): VNodeLike {\n let vnode = jsx(type, props, key) as VNode\n // Mark as static children - no key warnings needed\n if (vnode && typeof vnode === 'object' && 'type' in vnode) {\n vnode = setVNodeProp(vnode, '__staticChildren', true)\n }\n return vnode\n}\n"],"mappings":";AAOA,IAAa,YAAY,UAA+C,OAAO,YAAY;;;;;;;;AAS3F,SAAS,aACP,OACA,KACA,OACG;CACH,IAAI,OAAO,aAAa,KAAK,GAAG;EAE7B,MAAe,OAAO;EACvB,OAAO;CACT;CAEA,OAAO;EAAE,GAAG;GAAQ,MAAM;CAAM;AAClC;;;;;;;;;AAUA,SAAgB,IACd,MACA,OACA,KACW;CACX,MAAM,EAAE,UAAU,QAAQ,YAAY,OAAO,GAAG,SAAS,SAAS,CAAC;CAInE,IAAI,QAAe;EAAE;EAAM,OAAO;EAAM,UADtC,YAAY,OAAO,CAAC,IAAI,MAAM,QAAQ,QAAQ,IAAI,SAAS,KAAK,QAAQ,IAAI,CAAC,QAAQ;CAChC;CAGvD,IAAI,QAAQ,KAAA,KAAa,QAAQ,MAC/B,QAAQ,aACN,OACA,SACA,OAAO,QAAQ,YAAY,OAAO,QAAQ,WAAW,MAAM,OAAO,GAAG,CACvE;CAIF,IAAI,UAAU,KAAA,GACZ,QAAQ,aAAa,OAAO,WAAW,KAAsC;CAI/E,IAAI,WAAW,KAAA,KAAa,eAAe,KAAA,GAAW;EACpD,MAAM,YAA+C,CAAC;EACtD,IAAI,WAAW,KAAA,GAAW,UAAU,SAAS;EAC7C,IAAI,eAAe,KAAA,GAAW,UAAU,aAAa;EACrD,QAAQ,aAAa,OAAO,eAAe,SAAS;CACtD;CAEA,OAAO;AACT;;;;;;;;;;AAWA,SAAgB,KACd,MACA,OACA,KACW;CACX,IAAI,QAAQ,IAAI,MAAM,OAAO,GAAG;CAEhC,IAAI,SAAS,OAAO,UAAU,YAAY,UAAU,OAClD,QAAQ,aAAa,OAAO,oBAAoB,IAAI;CAEtD,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-engine.d.ts","sourceRoot":"","sources":["../../src/layout/layout-engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"layout-engine.d.ts","sourceRoot":"","sources":["../../src/layout/layout-engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAGhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAuBhD;;;GAGG;AACH,KAAK,sBAAsB,GAAG,MAAM,IAAI,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAC,SAAS,CAA+B;IACvD,OAAO,CAAC,MAAM,CAAC,SAAS,CAAQ;IAEhC;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI;IAUpD;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,KAAK;CAgBrB;AAYD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,OAAO,CAA4D;IAClF,OAAO,CAAC,MAAM,CAAC,SAAS,CAAQ;IAEhC;;;OAGG;IACH,MAAM,CAAC,WAAW,UAAQ;IAE1B;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,CACb,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EACvC,cAAc,EAAE,WAAW,EAC3B,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAC9C,aAAa,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GACvD,IAAI;IAmBP;;;;OAIG;IACH,MAAM,CAAC,KAAK,IAAI,IAAI;CAsCrB;AAuxBD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EACvC,cAAc,EAAE,WAAW,EAC3B,UAAU,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC9C,aAAa,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACvD,IAAI,CAEN"}
|