@number10/phaserjsx 0.6.1 → 4.1.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 +43 -3
- package/dist/chunk-C2EiDwsr.cjs +35 -0
- package/dist/clip/index.cjs +696 -0
- package/dist/clip/index.cjs.map +1 -0
- package/dist/clip/index.d.ts +3 -0
- package/dist/clip/index.d.ts.map +1 -0
- package/dist/clip/index.js +688 -0
- package/dist/clip/index.js.map +1 -0
- package/dist/clip/stencil-clip-extension.d.ts +18 -0
- package/dist/clip/stencil-clip-extension.d.ts.map +1 -0
- package/dist/clip/stencil-clip.d.ts +134 -0
- package/dist/clip/stencil-clip.d.ts.map +1 -0
- package/dist/components/appliers/applyBackground.d.ts +2 -1
- package/dist/components/appliers/applyBackground.d.ts.map +1 -1
- package/dist/components/appliers/applyGestures.d.ts.map +1 -1
- package/dist/components/appliers/applyTooltip.d.ts.map +1 -1
- package/dist/components/backgroundImage.d.ts +12 -0
- package/dist/components/backgroundImage.d.ts.map +1 -0
- package/dist/components/creators/createBackground.d.ts +2 -1
- package/dist/components/creators/createBackground.d.ts.map +1 -1
- package/dist/components/creators/createGestures.d.ts.map +1 -1
- package/dist/components/custom/Accordion.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/Dropdown.d.ts.map +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-C_w8D39m.js +29259 -0
- package/dist/custom-C_w8D39m.js.map +1 -0
- package/dist/custom-Dp3yAJdU.cjs +30498 -0
- package/dist/custom-Dp3yAJdU.cjs.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/hooks.d.ts +9 -8
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.cjs +1628 -2837
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1430 -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/appliers/background-applier.d.ts.map +1 -1
- package/dist/layout/layout-engine.d.ts.map +1 -1
- package/dist/layout/types.d.ts +2 -1
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/scene-backgrounds.d.ts +51 -1
- package/dist/scene-backgrounds.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/vite-plugin-icons.d.ts +1 -2
- package/dist/vite-plugin-icons.js +109 -90
- package/package.json +29 -22
- package/dist/TransformOriginView-Dw_HKnFH.cjs +0 -17116
- package/dist/TransformOriginView-Dw_HKnFH.cjs.map +0 -1
- package/dist/TransformOriginView-i8uVBHb1.js +0 -17100
- package/dist/TransformOriginView-i8uVBHb1.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":"background-applier.d.ts","sourceRoot":"","sources":["../../../src/layout/appliers/background-applier.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"background-applier.d.ts","sourceRoot":"","sources":["../../../src/layout/appliers/background-applier.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AASrC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,IAAI,CAsBN;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,IAAI,CAmBN"}
|
|
@@ -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;AAEhC,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;AAmzBD;;;;;;;;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"}
|
package/dist/layout/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BackgroundProps, EdgeInsets, LayoutProps, TransformProps } from '../core-props';
|
|
2
|
+
import { BackgroundImage } from '../components/backgroundImage';
|
|
2
3
|
/**
|
|
3
4
|
* Type definitions for the layout system
|
|
4
5
|
*/
|
|
@@ -28,7 +29,7 @@ export interface LayoutSizeProvider {
|
|
|
28
29
|
export type GameObjectWithLayout = Phaser.GameObjects.GameObject & {
|
|
29
30
|
__layoutProps?: LayoutProps & BackgroundProps & TransformProps;
|
|
30
31
|
__isBackground?: boolean;
|
|
31
|
-
__background?:
|
|
32
|
+
__background?: BackgroundImage;
|
|
32
33
|
__getLayoutSize?: () => LayoutSize;
|
|
33
34
|
__cachedLayoutSize?: LayoutSize;
|
|
34
35
|
__originalGetLayoutSize?: () => LayoutSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/layout/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/layout/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,19 +1,69 @@
|
|
|
1
1
|
import * as Phaser from 'phaser';
|
|
2
|
+
/**
|
|
3
|
+
* Built-in decorative background variants that can be attached to a Phaser scene.
|
|
4
|
+
*/
|
|
2
5
|
export type SceneBackgroundType = 'grid' | 'logo' | 'gradient' | 'particles' | 'none';
|
|
6
|
+
/**
|
|
7
|
+
* Optional animation applied to a scene background after it is created.
|
|
8
|
+
*/
|
|
3
9
|
export type BackgroundAnimation = 'lemniscate' | 'wave' | 'pulse' | 'rotate' | 'static';
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for {@link addSceneBackground}.
|
|
12
|
+
*/
|
|
4
13
|
export interface BackgroundConfig {
|
|
14
|
+
/** Background variant to create. Use `'none'` to disable background creation. */
|
|
5
15
|
type: SceneBackgroundType;
|
|
16
|
+
/** Animation preset applied to the created background. Defaults depend on caller config. */
|
|
6
17
|
animation?: BackgroundAnimation;
|
|
18
|
+
/** Background opacity, usually between `0` and `1`. */
|
|
7
19
|
opacity?: number;
|
|
20
|
+
/** Primary color as a Phaser numeric color, for example `0x4a9eff`. */
|
|
8
21
|
color?: number;
|
|
22
|
+
/** Secondary color used by gradient backgrounds. */
|
|
9
23
|
colorSecondary?: number;
|
|
24
|
+
/** Texture key used by the logo background. Defaults to the built-in logo key. */
|
|
10
25
|
logoKey?: string;
|
|
11
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Handle returned by {@link addSceneBackground}.
|
|
29
|
+
*/
|
|
12
30
|
export interface SceneBackgroundHandle {
|
|
13
|
-
|
|
31
|
+
/** Root game object created for the background. */
|
|
32
|
+
background: BackgroundTarget;
|
|
33
|
+
/** Stops animations, destroys game objects, removes generated textures, and detaches listeners. */
|
|
14
34
|
destroy: () => void;
|
|
35
|
+
/** Manually resize the background to match an external viewport size. */
|
|
15
36
|
resize: (width: number, height: number) => void;
|
|
16
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Default scene background used when no explicit config is provided.
|
|
40
|
+
*/
|
|
17
41
|
export declare const DEFAULT_BACKGROUND: BackgroundConfig;
|
|
42
|
+
type BackgroundTarget = Phaser.GameObjects.Container | Phaser.GameObjects.Image | Phaser.GameObjects.TileSprite;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a decorative background object to a Phaser scene.
|
|
45
|
+
*
|
|
46
|
+
* The helper owns all game objects, tweens, resize listeners, and generated textures it creates.
|
|
47
|
+
* It automatically cleans up on scene shutdown or destroy. Call `handle.destroy()` when removing
|
|
48
|
+
* the background earlier.
|
|
49
|
+
*
|
|
50
|
+
* @param scene - Phaser scene that receives the background.
|
|
51
|
+
* @param config - Background type, colors, opacity, animation, and optional logo texture key.
|
|
52
|
+
* @returns A handle for manual resize and cleanup, or `null` when `config.type` is `'none'`.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const handle = addSceneBackground(scene, {
|
|
57
|
+
* type: 'grid',
|
|
58
|
+
* animation: 'wave',
|
|
59
|
+
* color: 0x4a9eff,
|
|
60
|
+
* opacity: 0.12,
|
|
61
|
+
* })
|
|
62
|
+
*
|
|
63
|
+
* // Later, if the background should be removed before scene shutdown:
|
|
64
|
+
* handle?.destroy()
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
18
67
|
export declare function addSceneBackground(scene: Phaser.Scene, config?: BackgroundConfig): SceneBackgroundHandle | null;
|
|
68
|
+
export {};
|
|
19
69
|
//# sourceMappingURL=scene-backgrounds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-backgrounds.d.ts","sourceRoot":"","sources":["../src/scene-backgrounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAAA;AAErF,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEvF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"scene-backgrounds.d.ts","sourceRoot":"","sources":["../src/scene-backgrounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAAA;AAErF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEvF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,IAAI,EAAE,mBAAmB,CAAA;IAEzB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAE/B,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,UAAU,EAAE,gBAAgB,CAAA;IAE5B,mGAAmG;IACnG,OAAO,EAAE,MAAM,IAAI,CAAA;IAEnB,yEAAyE;IACzE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAChD;AAID;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,gBAKhC,CAAA;AAED,KAAK,gBAAgB,GACjB,MAAM,CAAC,WAAW,CAAC,SAAS,GAC5B,MAAM,CAAC,WAAW,CAAC,KAAK,GACxB,MAAM,CAAC,WAAW,CAAC,UAAU,CAAA;AA4CjC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,MAAM,GAAE,gBAAqC,GAC5C,qBAAqB,GAAG,IAAI,CA6L9B"}
|