canvasengine 2.0.0-beta.6 → 2.0.0-beta.61
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/DebugRenderer-DkjTAc48.js +1384 -0
- package/dist/DebugRenderer-DkjTAc48.js.map +1 -0
- package/dist/components/Button.d.ts +185 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Canvas.d.ts +17 -0
- package/dist/components/Canvas.d.ts.map +1 -0
- package/dist/components/DOMElement.d.ts +54 -0
- package/dist/components/DOMElement.d.ts.map +1 -0
- package/dist/components/DOMSprite.d.ts +127 -0
- package/dist/components/DOMSprite.d.ts.map +1 -0
- package/dist/components/FocusContainer.d.ts +129 -0
- package/dist/components/FocusContainer.d.ts.map +1 -0
- package/dist/components/Graphic.d.ts +64 -0
- package/dist/components/Graphic.d.ts.map +1 -0
- package/dist/components/Joystick.d.ts +36 -0
- package/dist/components/Joystick.d.ts.map +1 -0
- package/dist/components/NineSliceSprite.d.ts +16 -0
- package/dist/components/NineSliceSprite.d.ts.map +1 -0
- package/dist/components/ParticleEmitter.d.ts +4 -0
- package/dist/components/ParticleEmitter.d.ts.map +1 -0
- package/dist/components/Scene.d.ts +2 -0
- package/dist/components/Scene.d.ts.map +1 -0
- package/dist/components/Text.d.ts +24 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/TilingSprite.d.ts +17 -0
- package/dist/components/TilingSprite.d.ts.map +1 -0
- package/dist/components/Video.d.ts +14 -0
- package/dist/components/Video.d.ts.map +1 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/types/DisplayObject.d.ts +118 -0
- package/dist/components/types/DisplayObject.d.ts.map +1 -0
- package/dist/components/types/MouseEvent.d.ts +4 -0
- package/dist/components/types/MouseEvent.d.ts.map +1 -0
- package/dist/components/types/Spritesheet.d.ts +248 -0
- package/dist/components/types/Spritesheet.d.ts.map +1 -0
- package/dist/components/types/index.d.ts +4 -0
- package/dist/components/types/index.d.ts.map +1 -0
- package/dist/directives/Controls.d.ts +112 -0
- package/dist/directives/Controls.d.ts.map +1 -0
- package/dist/directives/ControlsBase.d.ts +199 -0
- package/dist/directives/ControlsBase.d.ts.map +1 -0
- package/dist/directives/Drag.d.ts +69 -0
- package/dist/directives/Drag.d.ts.map +1 -0
- package/dist/directives/Flash.d.ts +116 -0
- package/dist/directives/Flash.d.ts.map +1 -0
- package/dist/directives/FocusNavigation.d.ts +52 -0
- package/dist/directives/FocusNavigation.d.ts.map +1 -0
- package/dist/directives/FogVisibility.d.ts +47 -0
- package/dist/directives/FogVisibility.d.ts.map +1 -0
- package/dist/directives/GamepadControls.d.ts +224 -0
- package/dist/directives/GamepadControls.d.ts.map +1 -0
- package/dist/directives/JoystickControls.d.ts +171 -0
- package/dist/directives/JoystickControls.d.ts.map +1 -0
- package/dist/directives/KeyboardControls.d.ts +219 -0
- package/dist/directives/KeyboardControls.d.ts.map +1 -0
- package/dist/directives/Scheduler.d.ts +36 -0
- package/dist/directives/Scheduler.d.ts.map +1 -0
- package/dist/directives/Shake.d.ts +98 -0
- package/dist/directives/Shake.d.ts.map +1 -0
- package/dist/directives/Sound.d.ts +25 -0
- package/dist/directives/Sound.d.ts.map +1 -0
- package/dist/directives/Transition.d.ts +10 -0
- package/dist/directives/Transition.d.ts.map +1 -0
- package/dist/directives/ViewportCull.d.ts +11 -0
- package/dist/directives/ViewportCull.d.ts.map +1 -0
- package/dist/directives/ViewportFollow.d.ts +18 -0
- package/dist/directives/ViewportFollow.d.ts.map +1 -0
- package/dist/directives/index.d.ts +14 -0
- package/dist/directives/index.d.ts.map +1 -0
- package/dist/dist-BOOc43Qm.js +778 -0
- package/dist/dist-BOOc43Qm.js.map +1 -0
- package/dist/engine/FocusManager.d.ts +174 -0
- package/dist/engine/FocusManager.d.ts.map +1 -0
- package/dist/engine/animation.d.ts +72 -0
- package/dist/engine/animation.d.ts.map +1 -0
- package/dist/engine/bootstrap.d.ts +52 -0
- package/dist/engine/bootstrap.d.ts.map +1 -0
- package/dist/engine/directive.d.ts +13 -0
- package/dist/engine/directive.d.ts.map +1 -0
- package/dist/engine/reactive.d.ts +135 -0
- package/dist/engine/reactive.d.ts.map +1 -0
- package/dist/engine/signal.d.ts +73 -0
- package/dist/engine/signal.d.ts.map +1 -0
- package/dist/engine/trigger.d.ts +54 -0
- package/dist/engine/trigger.d.ts.map +1 -0
- package/dist/engine/utils.d.ts +89 -0
- package/dist/engine/utils.d.ts.map +1 -0
- package/dist/hooks/addContext.d.ts +2 -0
- package/dist/hooks/addContext.d.ts.map +1 -0
- package/dist/hooks/useFocus.d.ts +60 -0
- package/dist/hooks/useFocus.d.ts.map +1 -0
- package/dist/hooks/useProps.d.ts +42 -0
- package/dist/hooks/useProps.d.ts.map +1 -0
- package/dist/hooks/useRef.d.ts +4 -0
- package/dist/hooks/useRef.d.ts.map +1 -0
- package/dist/index.d.ts +19 -1107
- package/dist/index.d.ts.map +1 -0
- package/dist/index.global.js +8 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +14708 -3135
- package/dist/index.js.map +1 -1
- package/dist/utils/Ease.d.ts +17 -0
- package/dist/utils/Ease.d.ts.map +1 -0
- package/dist/utils/GlobalAssetLoader.d.ts +141 -0
- package/dist/utils/GlobalAssetLoader.d.ts.map +1 -0
- package/dist/utils/RadialGradient.d.ts +57 -0
- package/dist/utils/RadialGradient.d.ts.map +1 -0
- package/dist/utils/functions.d.ts +2 -0
- package/dist/utils/functions.d.ts.map +1 -0
- package/dist/utils/tabindex.d.ts +16 -0
- package/dist/utils/tabindex.d.ts.map +1 -0
- package/package.json +16 -9
- package/src/components/Button.ts +399 -0
- package/src/components/Canvas.ts +82 -51
- package/src/components/Container.ts +21 -2
- package/src/components/DOMContainer.ts +379 -0
- package/src/components/DOMElement.ts +556 -0
- package/src/components/DOMSprite.ts +1040 -0
- package/src/components/DisplayObject.ts +422 -201
- package/src/components/FocusContainer.ts +368 -0
- package/src/components/Graphic.ts +239 -73
- package/src/components/Joystick.ts +363 -0
- package/src/components/Mesh.ts +222 -0
- package/src/components/NineSliceSprite.ts +4 -1
- package/src/components/ParticleEmitter.ts +12 -8
- package/src/components/Sprite.ts +418 -52
- package/src/components/Text.ts +270 -26
- package/src/components/Viewport.ts +122 -63
- package/src/components/index.ts +9 -2
- package/src/components/types/DisplayObject.ts +53 -5
- package/src/components/types/Spritesheet.ts +0 -118
- package/src/directives/Controls.ts +254 -0
- package/src/directives/ControlsBase.ts +267 -0
- package/src/directives/Drag.ts +357 -52
- package/src/directives/Flash.ts +419 -0
- package/src/directives/FocusNavigation.ts +113 -0
- package/src/directives/FogVisibility.ts +273 -0
- package/src/directives/GamepadControls.ts +537 -0
- package/src/directives/JoystickControls.ts +396 -0
- package/src/directives/KeyboardControls.ts +85 -430
- package/src/directives/Scheduler.ts +21 -5
- package/src/directives/Shake.ts +298 -0
- package/src/directives/Sound.ts +94 -31
- package/src/directives/ViewportFollow.ts +40 -9
- package/src/directives/index.ts +13 -6
- package/src/engine/FocusManager.ts +510 -0
- package/src/engine/animation.ts +175 -21
- package/src/engine/bootstrap.ts +140 -6
- package/src/engine/directive.ts +4 -4
- package/src/engine/reactive.ts +980 -177
- package/src/engine/signal.ts +241 -47
- package/src/engine/trigger.ts +34 -7
- package/src/engine/utils.ts +19 -3
- package/src/hooks/useFocus.ts +91 -0
- package/src/hooks/useProps.ts +1 -1
- package/src/index.ts +8 -2
- package/src/types/pixi-cull.d.ts +7 -0
- package/src/utils/GlobalAssetLoader.ts +257 -0
- package/src/utils/functions.ts +7 -0
- package/src/utils/tabindex.ts +70 -0
- package/testing/index.ts +35 -4
- package/tsconfig.json +18 -0
- package/vite.config.ts +39 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dist-BOOc43Qm.js","names":["__defProp","__defNormalProp","__publicField","TilingSprite$1","NineSliceSprite$1"],"sources":["../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/yoga.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/utils/getNumberFromStyle.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/utils/position/calculateWithDoubleValue.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/utils/position/calculateWithQuadValue.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/utils/position/calculateWithSingleValue.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/utils/calculatePositionSpecifier.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/utils/getPixiSize.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/utils/nearlyEqual.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/utils/throttle.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/LayoutSystem.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/style/applyStyle.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/style/formatStyles.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/utils/sort-children.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/Layout.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/utils/calculateObjectFit.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/utils/baseComputeLayoutData.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/ContainerMixin.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/TextMixin.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/core/mixins/ViewContainerMixin.mjs","../../../node_modules/.pnpm/@pixi+layout@3.2.0_@types+react@19.1.3_pixi.js@8.9.2_react@19.1.0_yoga-layout@3.2.1/node_modules/@pixi/layout/dist/index.mjs"],"sourcesContent":["let yoga;\nfunction getYoga() {\n return yoga;\n}\nfunction setYoga(newYoga) {\n yoga = newYoga;\n}\nlet yogaConfig;\nfunction setYogaConfig(config) {\n yogaConfig = config;\n}\nfunction getYogaConfig() {\n return yogaConfig;\n}\nexport {\n getYoga,\n getYogaConfig,\n setYoga,\n setYogaConfig\n};\n//# sourceMappingURL=yoga.mjs.map\n","function getNumberFromStyle(value, size) {\n if (!value) return 0;\n if (typeof value === \"number\") {\n return value;\n } else if (typeof value === \"string\" && value.endsWith(\"%\")) {\n size ?? (size = 1);\n return size * (parseFloat(value) / 100);\n } else if (!Number.isNaN(parseFloat(value))) {\n return parseFloat(value);\n }\n return 0;\n}\nfunction getTypeFromStyle(value) {\n if (typeof value === \"number\") return \"number\";\n if (value.endsWith(\"%\")) return \"percentage\";\n if (Number.isNaN(parseInt(value, 10))) return \"keyword\";\n return \"number\";\n}\nexport {\n getNumberFromStyle,\n getTypeFromStyle\n};\n//# sourceMappingURL=getNumberFromStyle.mjs.map\n","import { getTypeFromStyle, getNumberFromStyle } from \"../../../utils/getNumberFromStyle.mjs\";\nfunction calculateCenterPosition(dimension, computedLayout, visualBounds) {\n return (computedLayout[dimension] - visualBounds[dimension]) / 2;\n}\nfunction calculateNonKeywordPosition(value, valueType, dimension, computedLayout, visualBounds) {\n const multiple = valueType === \"percentage\" ? computedLayout[dimension] - visualBounds[dimension] : 1;\n return getNumberFromStyle(value) * multiple;\n}\nfunction calculateWithDoubleValue(tokens, computedLayout, visualBounds) {\n const [first, second] = tokens;\n const firstType = getTypeFromStyle(first);\n const secondType = getTypeFromStyle(second);\n const result = { x: void 0, y: void 0 };\n switch (first) {\n case \"top\":\n result.y = 0;\n break;\n case \"bottom\":\n result.y = computedLayout.height - visualBounds.height;\n break;\n case \"center\":\n if (second === \"left\" || second === \"right\") {\n result.y = calculateCenterPosition(\"height\", computedLayout, visualBounds);\n } else {\n result.x = calculateCenterPosition(\"width\", computedLayout, visualBounds);\n }\n break;\n case \"left\":\n result.x = 0;\n break;\n case \"right\":\n result.x = computedLayout.width - visualBounds.width;\n break;\n default: {\n const dimension = second === \"top\" || second === \"bottom\" || secondType !== \"keyword\" ? \"width\" : \"height\";\n const target = dimension === \"width\" ? \"x\" : \"y\";\n result[target] = calculateNonKeywordPosition(first, firstType, dimension, computedLayout, visualBounds);\n }\n }\n switch (second) {\n case \"top\":\n result.y = 0;\n break;\n case \"bottom\":\n result.y = computedLayout.height - visualBounds.height;\n break;\n case \"center\":\n if (result.y === void 0) {\n result.y = calculateCenterPosition(\"height\", computedLayout, visualBounds);\n } else {\n result.x = calculateCenterPosition(\"width\", computedLayout, visualBounds);\n }\n break;\n case \"left\":\n result.x = 0;\n break;\n case \"right\":\n result.x = computedLayout.width - visualBounds.width;\n break;\n default: {\n const target = result.y === void 0 ? \"y\" : \"x\";\n const dimension = target === \"y\" ? \"height\" : \"width\";\n result[target] = calculateNonKeywordPosition(second, secondType, dimension, computedLayout, visualBounds);\n }\n }\n return result;\n}\nexport {\n calculateWithDoubleValue\n};\n//# sourceMappingURL=calculateWithDoubleValue.mjs.map\n","import { getTypeFromStyle, getNumberFromStyle } from \"../../../utils/getNumberFromStyle.mjs\";\nimport { calculateWithDoubleValue } from \"./calculateWithDoubleValue.mjs\";\nfunction calculateAxisOffset(keyword, value, type, bounds) {\n const isNegativeOffset = keyword === \"right\" || keyword === \"bottom\";\n const offset = type === \"percentage\" ? value * bounds : value;\n return isNegativeOffset ? -offset : offset;\n}\nfunction calculateWithQuadValue(tokens, computedLayout, visualBounds) {\n const [first, second, third, fourth] = tokens;\n const firstType = getTypeFromStyle(first);\n const secondType = getTypeFromStyle(second);\n const thirdType = getTypeFromStyle(third);\n const fourthType = getTypeFromStyle(fourth);\n if (secondType === \"keyword\" || fourthType === \"keyword\") {\n throw new Error(\"Invalid objectPosition value: second and fourth values must be numbers or percentages\");\n }\n if (firstType !== \"keyword\" || thirdType !== \"keyword\") {\n throw new Error(\"Invalid objectPosition value: first and third values must be keywords\");\n }\n const basePosition = calculateWithDoubleValue([first, third], computedLayout, visualBounds);\n const result = { ...basePosition };\n const secondValue = getNumberFromStyle(second);\n const fourthValue = getNumberFromStyle(fourth);\n if (first === \"left\" || first === \"right\") {\n result.x = basePosition.x + calculateAxisOffset(first, secondValue, secondType, visualBounds.width);\n } else if (first === \"top\" || first === \"bottom\") {\n result.y = basePosition.y + calculateAxisOffset(first, secondValue, secondType, visualBounds.height);\n }\n if (third === \"left\" || third === \"right\") {\n result.x = basePosition.x + calculateAxisOffset(third, fourthValue, fourthType, visualBounds.width);\n } else if (third === \"top\" || third === \"bottom\") {\n result.y = basePosition.y + calculateAxisOffset(third, fourthValue, fourthType, visualBounds.height);\n }\n return result;\n}\nexport {\n calculateWithQuadValue\n};\n//# sourceMappingURL=calculateWithQuadValue.mjs.map\n","import { getTypeFromStyle, getNumberFromStyle } from \"../../../utils/getNumberFromStyle.mjs\";\nfunction calculateWithSingleValue(tokens, computedLayout, visualBounds) {\n const keyword = tokens[0];\n const result = { x: void 0, y: void 0 };\n switch (keyword) {\n case \"top\":\n result.y = 0;\n result.x = (computedLayout.width - visualBounds.width) / 2;\n break;\n case \"bottom\":\n result.y = computedLayout.height - visualBounds.height;\n result.x = (computedLayout.width - visualBounds.width) / 2;\n break;\n case \"left\":\n result.x = 0;\n result.y = (computedLayout.height - visualBounds.height) / 2;\n break;\n case \"right\":\n result.x = computedLayout.width - visualBounds.width;\n result.y = (computedLayout.height - visualBounds.height) / 2;\n break;\n case \"center\":\n result.x = (computedLayout.width - visualBounds.width) / 2;\n result.y = (computedLayout.height - visualBounds.height) / 2;\n break;\n default: {\n const isPercentage = getTypeFromStyle(keyword) === \"percentage\";\n const multiple = isPercentage ? computedLayout.width - visualBounds.width : 1;\n result.x = getNumberFromStyle(keyword) * multiple;\n result.y = (computedLayout.height - visualBounds.height) / 2;\n }\n }\n return result;\n}\nexport {\n calculateWithSingleValue\n};\n//# sourceMappingURL=calculateWithSingleValue.mjs.map\n","import { calculateWithDoubleValue } from \"./position/calculateWithDoubleValue.mjs\";\nimport { calculateWithQuadValue } from \"./position/calculateWithQuadValue.mjs\";\nimport { calculateWithSingleValue } from \"./position/calculateWithSingleValue.mjs\";\nfunction calculatePositionSpecifier(value, computedLayout, visualBounds) {\n if (!value) return { x: 0, y: 0 };\n const tokens = typeof value === \"string\" ? value.split(\" \") : [value];\n switch (tokens.length) {\n case 1:\n return calculateWithSingleValue(tokens, computedLayout, visualBounds);\n case 2:\n return calculateWithDoubleValue(tokens, computedLayout, visualBounds);\n case 4:\n return calculateWithQuadValue(tokens, computedLayout, visualBounds);\n default:\n throw new Error(\"Invalid objectPosition value: must have 1, 2, or 4 values\");\n }\n}\nexport {\n calculatePositionSpecifier\n};\n//# sourceMappingURL=calculatePositionSpecifier.mjs.map\n","const temp = { width: 0, height: 0 };\nfunction getPixiSize(layout) {\n const bounds = layout.target.getLocalBounds();\n const scale = layout.target.scale;\n temp.width = Math.abs(bounds.width * scale.x);\n temp.height = Math.abs(bounds.height * scale.y);\n return temp;\n}\nexport {\n getPixiSize\n};\n//# sourceMappingURL=getPixiSize.mjs.map\n","function nearlyEqual(a, b, EPSILON = 0.49) {\n return Math.abs(a - b) < EPSILON;\n}\nexport {\n nearlyEqual\n};\n//# sourceMappingURL=nearlyEqual.mjs.map\n","function debounce(func, wait = 0, options = {}) {\n let lastArgs;\n let lastThis;\n const maxWait = options.maxWait ? options.maxWait : wait;\n let result;\n let timerId;\n let lastCallTime;\n let lastInvokeTime = 0;\n const leading = !!options.leading;\n const maxing = \"maxWait\" in options;\n const trailing = options.trailing ?? true;\n const useRAF = wait !== 0 && typeof globalThis.requestAnimationFrame === \"function\";\n if (typeof func !== \"function\") {\n throw new TypeError(\"Expected a function\");\n }\n function invokeFunc(time) {\n const args = lastArgs;\n const thisArg = lastThis;\n lastArgs = lastThis = void 0;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n function startTimer(pendingFunc, milliseconds) {\n if (useRAF) {\n if (typeof timerId === \"number\") {\n globalThis.cancelAnimationFrame(timerId);\n }\n return globalThis.requestAnimationFrame(pendingFunc);\n }\n return setTimeout(pendingFunc, milliseconds);\n }\n function cancelTimer(id) {\n if (useRAF) {\n globalThis.cancelAnimationFrame(id);\n return;\n }\n clearTimeout(id);\n }\n function leadingEdge(time) {\n lastInvokeTime = time;\n timerId = startTimer(timerExpired, wait);\n return leading ? invokeFunc(time) : result;\n }\n function remainingWait(time) {\n const timeSinceLastCall = time - (lastCallTime || 0);\n const timeSinceLastInvoke = time - lastInvokeTime;\n const timeWaiting = wait - timeSinceLastCall;\n return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;\n }\n function shouldInvoke(time) {\n const timeSinceLastCall = time - (lastCallTime || 0);\n const timeSinceLastInvoke = time - lastInvokeTime;\n return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;\n }\n function timerExpired() {\n const time = Date.now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n timerId = startTimer(timerExpired, remainingWait(time));\n return void 0;\n }\n function trailingEdge(time) {\n timerId = void 0;\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = void 0;\n return result;\n }\n function cancel() {\n if (timerId !== void 0) {\n cancelTimer(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = void 0;\n }\n function flush() {\n return timerId === void 0 ? result : trailingEdge(Date.now());\n }\n function pending() {\n return timerId !== void 0;\n }\n function debounced(...args) {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n lastArgs = args;\n lastThis = this;\n lastCallTime = time;\n if (isInvoking) {\n if (timerId === void 0) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n timerId = startTimer(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === void 0) {\n timerId = startTimer(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n debounced.pending = pending;\n return debounced;\n}\nfunction throttle(func, wait, options = {}) {\n const leading = options.leading ?? true;\n const trailing = options.trailing ?? true;\n if (typeof func !== \"function\") {\n throw new TypeError(\"Expected a function\");\n }\n return debounce(func, wait, {\n leading,\n trailing,\n maxWait: wait\n });\n}\nexport {\n debounce,\n throttle\n};\n//# sourceMappingURL=throttle.mjs.map\n","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nimport { ExtensionType } from \"pixi.js\";\nimport { loadYoga, Direction } from \"yoga-layout/load\";\nimport { setYoga, setYogaConfig, getYoga } from \"../yoga.mjs\";\nimport { calculatePositionSpecifier } from \"./mixins/utils/calculatePositionSpecifier.mjs\";\nimport { getPixiSize } from \"./utils/getPixiSize.mjs\";\nimport { nearlyEqual } from \"./utils/nearlyEqual.mjs\";\nimport { throttle } from \"./utils/throttle.mjs\";\nclass LayoutSystem {\n constructor() {\n /**\n * Whether the layout system should automatically update the layout when it detects changes\n * @default true\n */\n __publicField(this, \"autoUpdate\", true);\n __publicField(this, \"_debugEnabled\", false);\n __publicField(this, \"_debugRenderer\", null);\n __publicField(this, \"_throttledUpdateSize\");\n __publicField(this, \"_throttle\", 100);\n __publicField(this, \"_modificationCount\", 50);\n }\n /**\n * Initializes the layout system by loading the Yoga library asynchronously\n * @returns A promise that resolves when the system is ready\n */\n async init(options) {\n setYoga(await loadYoga());\n setYogaConfig(getYoga().Config.create());\n const { layout } = options ?? {};\n const { autoUpdate, enableDebug, throttle: throttle$1, debugModificationCount } = layout ?? {};\n if (enableDebug) {\n void this.enableDebug(true);\n }\n if (autoUpdate !== void 0) {\n this.autoUpdate = autoUpdate;\n }\n this._throttle = throttle$1 ?? this._throttle;\n this._throttledUpdateSize = throttle((container) => this._updateSize(container), this._throttle, {\n leading: true,\n trailing: true\n });\n this._modificationCount = debugModificationCount ?? this._modificationCount;\n }\n /**\n * Toggles the debug mode for the layout system\n * @param value - Whether to enable or disable debug mode\n */\n async enableDebug(value = !this._debugEnabled) {\n this._debugEnabled = value;\n if (!this._debugRenderer) {\n const res = await import(\"./debug/DebugRenderer.mjs\");\n this._debugRenderer = new res.DebugRenderer();\n }\n if (!this._debugEnabled) {\n this._debugRenderer.reset();\n }\n }\n /**\n * Updates the layout of the container and its children\n * @param container - The container to update the layout for\n */\n update(container) {\n if (this._debugEnabled && this._debugRenderer) {\n this._debugRenderer.reset();\n container.addChild(this._debugRenderer.holder);\n }\n this._throttle === 0 ? this._updateSize(container) : this._throttledUpdateSize(container);\n this.updateLayout(container);\n }\n prerender({ container }) {\n if (this.autoUpdate) {\n this.update(container);\n }\n }\n /**\n * Updates the size of the yoga nodes for the containers that use pixi size\n * @param container - The container to update the size for\n */\n _updateSize(container) {\n if (container.destroyed) return;\n const layout = container._layout;\n if (layout) {\n const layoutStyles = layout.style;\n if (layoutStyles.width === \"intrinsic\" || layoutStyles.height === \"intrinsic\") {\n const size = getPixiSize(layout);\n if (layoutStyles.width === \"intrinsic\") {\n const currentWidth = layout.yoga.getWidth().value;\n if (!nearlyEqual(currentWidth, size.width)) {\n layout.yoga.setWidth(size.width);\n layout.invalidateRoot();\n }\n }\n if (layoutStyles.height === \"intrinsic\") {\n const currentHeight = layout.yoga.getHeight().value;\n if (!nearlyEqual(currentHeight, size.height)) {\n layout.yoga.setHeight(size.height);\n layout.invalidateRoot();\n }\n }\n }\n if (!container.visible) {\n layout._onChildRemoved();\n return;\n }\n }\n for (let i = 0; i < container.children.length; i++) {\n this._updateSize(container.children[i]);\n }\n }\n /**\n * Updates the layout of the container and its children\n * @param container - The container to update the layout for\n */\n updateLayout(container) {\n var _a, _b, _c, _d;\n const layout = container._layout;\n if (!container.visible) {\n return;\n }\n if (layout) {\n const yogaNode = layout.yoga;\n const layoutStyles = layout.style;\n const isOverflowContainer = (_a = container.parent) == null ? void 0 : _a.isOverflowContainer;\n const hasParentLayout = (_b = container.parent) == null ? void 0 : _b._layout;\n if (!hasParentLayout && !isOverflowContainer) {\n if (layout._isDirty) {\n layout._isDirty = false;\n yogaNode.calculateLayout(\n layoutStyles.width,\n // TODO: if this is not a number, it will not work\n layoutStyles.height,\n yogaNode.getDirection() ?? Direction.LTR\n );\n }\n }\n if (yogaNode.hasNewLayout() || layout._forceUpdate) {\n yogaNode.markLayoutSeen();\n layout._forceUpdate = false;\n layout._computedLayout = yogaNode.getComputedLayout();\n const res = calculatePositionSpecifier(layoutStyles.transformOrigin, layout._computedLayout, {\n width: 0,\n height: 0\n });\n layout._computedPixiLayout = {\n ...container.computeLayoutData(layout._computedLayout),\n originX: res.x,\n originY: res.y\n };\n container.emit(\"layout\", layout);\n (_c = container.onLayout) == null ? void 0 : _c.call(container, layout);\n container._onUpdate();\n }\n if (this._debugEnabled) {\n if (layout._styles.custom.debug || layout._modificationCount > this._modificationCount && layout._styles.custom.debugHeat !== false) {\n (_d = this._debugRenderer) == null ? void 0 : _d.render(layout);\n }\n }\n }\n for (let i = 0; i < container.children.length; i++) {\n this.updateLayout(container.children[i]);\n }\n }\n /**\n * @ignore\n */\n destroy() {\n if (!this._debugEnabled && this._debugRenderer) {\n this._debugRenderer.destroy();\n }\n }\n}\n/** @ignore */\n__publicField(LayoutSystem, \"extension\", {\n type: [ExtensionType.WebGLSystem, ExtensionType.WebGPUSystem],\n name: \"layout\"\n});\nexport {\n LayoutSystem\n};\n//# sourceMappingURL=LayoutSystem.mjs.map\n","import { Align, BoxSizing, Direction, Display, FlexDirection, Wrap, Justify, Overflow, PositionType, Edge, Gutter } from \"yoga-layout/load\";\nconst ALIGN_CONTENT_MAP = {\n \"flex-start\": Align.FlexStart,\n \"flex-end\": Align.FlexEnd,\n center: Align.Center,\n stretch: Align.Stretch,\n \"space-between\": Align.SpaceBetween,\n \"space-around\": Align.SpaceAround,\n \"space-evenly\": Align.SpaceEvenly\n};\nconst ALIGN_ITEMS_MAP = {\n \"flex-start\": Align.FlexStart,\n \"flex-end\": Align.FlexEnd,\n center: Align.Center,\n stretch: Align.Stretch,\n baseline: Align.Baseline\n};\nconst ALIGN_SELF_MAP = {\n auto: Align.Auto,\n \"flex-start\": Align.FlexStart,\n \"flex-end\": Align.FlexEnd,\n center: Align.Center,\n stretch: Align.Stretch,\n baseline: Align.Baseline\n};\nconst BOX_SIZING_MAP = {\n \"border-box\": BoxSizing.BorderBox,\n \"content-box\": BoxSizing.ContentBox\n};\nconst DIRECTION_MAP = {\n ltr: Direction.LTR,\n rtl: Direction.RTL\n};\nconst DISPLAY_MAP = {\n none: Display.None,\n flex: Display.Flex,\n contents: Display.Contents\n};\nconst FLEX_DIRECTION_MAP = {\n row: FlexDirection.Row,\n column: FlexDirection.Column,\n \"row-reverse\": FlexDirection.RowReverse,\n \"column-reverse\": FlexDirection.ColumnReverse\n};\nconst FLEX_WRAP_MAP = {\n wrap: Wrap.Wrap,\n nowrap: Wrap.NoWrap,\n \"wrap-reverse\": Wrap.WrapReverse\n};\nconst JUSTIFY_CONTENT_MAP = {\n \"flex-start\": Justify.FlexStart,\n \"flex-end\": Justify.FlexEnd,\n center: Justify.Center,\n \"space-between\": Justify.SpaceBetween,\n \"space-around\": Justify.SpaceAround,\n \"space-evenly\": Justify.SpaceEvenly\n};\nconst OVERFLOW_MAP = {\n visible: Overflow.Visible,\n hidden: Overflow.Hidden,\n scroll: Overflow.Scroll\n};\nconst POSITION_MAP = {\n absolute: PositionType.Absolute,\n relative: PositionType.Relative,\n static: PositionType.Static\n};\nconst styleSetters = {\n alignContent: (node, value) => node.setAlignContent(alignContent(value)),\n alignItems: (node, value) => node.setAlignItems(alignItems(value)),\n alignSelf: (node, value) => node.setAlignSelf(alignSelf(value)),\n aspectRatio: (node, value) => node.setAspectRatio(value),\n borderBottomWidth: (node, value) => node.setBorder(Edge.Bottom, value),\n borderEndWidth: (node, value) => node.setBorder(Edge.End, value),\n borderLeftWidth: (node, value) => node.setBorder(Edge.Left, value),\n borderRightWidth: (node, value) => node.setBorder(Edge.Right, value),\n borderStartWidth: (node, value) => node.setBorder(Edge.Start, value),\n borderTopWidth: (node, value) => node.setBorder(Edge.Top, value),\n borderWidth: (node, value) => node.setBorder(Edge.All, value),\n borderInlineWidth: (node, value) => node.setBorder(Edge.Horizontal, value),\n borderBlockWidth: (node, value) => node.setBorder(Edge.Vertical, value),\n bottom: (node, value) => node.setPosition(Edge.Bottom, value),\n boxSizing: (node, value) => node.setBoxSizing(boxSizing(value)),\n direction: (node, value) => node.setDirection(direction(value)),\n display: (node, value) => node.setDisplay(display(value)),\n end: (node, value) => node.setPosition(Edge.End, value),\n flex: (node, value) => node.setFlex(value),\n flexBasis: (node, value) => node.setFlexBasis(value),\n flexDirection: (node, value) => node.setFlexDirection(flexDirection(value)),\n rowGap: (node, value) => node.setGap(Gutter.Row, value),\n gap: (node, value) => node.setGap(Gutter.All, value),\n columnGap: (node, value) => node.setGap(Gutter.Column, value),\n flexGrow: (node, value) => node.setFlexGrow(value),\n flexShrink: (node, value) => node.setFlexShrink(value),\n flexWrap: (node, value) => node.setFlexWrap(flexWrap(value)),\n height: (node, value) => node.setHeight(value),\n justifyContent: (node, value) => node.setJustifyContent(justifyContent(value)),\n left: (node, value) => node.setPosition(Edge.Left, value),\n margin: (node, value) => node.setMargin(Edge.All, value),\n marginBottom: (node, value) => node.setMargin(Edge.Bottom, value),\n marginEnd: (node, value) => node.setMargin(Edge.End, value),\n marginLeft: (node, value) => node.setMargin(Edge.Left, value),\n marginRight: (node, value) => node.setMargin(Edge.Right, value),\n marginStart: (node, value) => node.setMargin(Edge.Start, value),\n marginTop: (node, value) => node.setMargin(Edge.Top, value),\n marginInline: (node, value) => node.setMargin(Edge.Horizontal, value),\n marginBlock: (node, value) => node.setMargin(Edge.Vertical, value),\n maxHeight: (node, value) => node.setMaxHeight(value),\n maxWidth: (node, value) => node.setMaxWidth(value),\n minHeight: (node, value) => node.setMinHeight(value),\n minWidth: (node, value) => node.setMinWidth(value),\n overflow: (node, value) => node.setOverflow(overflow(value)),\n padding: (node, value) => node.setPadding(Edge.All, value),\n paddingBottom: (node, value) => node.setPadding(Edge.Bottom, value),\n paddingEnd: (node, value) => node.setPadding(Edge.End, value),\n paddingLeft: (node, value) => node.setPadding(Edge.Left, value),\n paddingRight: (node, value) => node.setPadding(Edge.Right, value),\n paddingStart: (node, value) => node.setPadding(Edge.Start, value),\n paddingTop: (node, value) => node.setPadding(Edge.Top, value),\n paddingInline: (node, value) => node.setPadding(Edge.Horizontal, value),\n paddingBlock: (node, value) => node.setPadding(Edge.Vertical, value),\n position: (node, value) => node.setPositionType(position(value)),\n right: (node, value) => node.setPosition(Edge.Right, value),\n start: (node, value) => node.setPosition(Edge.Start, value),\n top: (node, value) => node.setPosition(Edge.Top, value),\n insetInline: (node, value) => node.setPosition(Edge.Horizontal, value),\n insetBlock: (node, value) => node.setPosition(Edge.Vertical, value),\n inset: (node, value) => node.setPosition(Edge.All, value),\n width: (node, value) => node.setWidth(value)\n};\nfunction alignContent(str) {\n if (str in ALIGN_CONTENT_MAP) return ALIGN_CONTENT_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for alignContent`);\n}\nfunction alignItems(str) {\n if (str in ALIGN_ITEMS_MAP) return ALIGN_ITEMS_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for alignItems`);\n}\nfunction alignSelf(str) {\n if (str in ALIGN_SELF_MAP) return ALIGN_SELF_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for alignSelf`);\n}\nfunction boxSizing(str) {\n if (str in BOX_SIZING_MAP) return BOX_SIZING_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for boxSizing`);\n}\nfunction direction(str) {\n if (str in DIRECTION_MAP) return DIRECTION_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for direction`);\n}\nfunction display(str) {\n if (str in DISPLAY_MAP) return DISPLAY_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for display`);\n}\nfunction flexDirection(str) {\n if (str in FLEX_DIRECTION_MAP) return FLEX_DIRECTION_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for flexDirection`);\n}\nfunction flexWrap(str) {\n if (str in FLEX_WRAP_MAP) return FLEX_WRAP_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for flexWrap`);\n}\nfunction justifyContent(str) {\n if (str in JUSTIFY_CONTENT_MAP) return JUSTIFY_CONTENT_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for justifyContent`);\n}\nfunction overflow(str) {\n if (str in OVERFLOW_MAP) return OVERFLOW_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for overflow`);\n}\nfunction position(str) {\n if (str in POSITION_MAP) return POSITION_MAP[str];\n throw new Error(`\"${str}\" is not a valid value for position`);\n}\nfunction applyStyle(node, style = {}) {\n for (const [key, value] of Object.entries(style)) {\n try {\n const setter = styleSetters[key];\n if (setter) {\n setter(node, value);\n }\n } catch (_e) {\n }\n }\n if (style.width !== void 0) {\n const widthValue = style.left !== void 0 && style.right !== void 0 ? \"auto\" : style.width;\n node.setWidth(widthValue);\n }\n if (style.height !== void 0) {\n const heightValue = style.top !== void 0 && style.bottom !== void 0 ? \"auto\" : style.height;\n node.setHeight(heightValue);\n }\n}\nexport {\n applyStyle\n};\n//# sourceMappingURL=applyStyle.mjs.map\n","import { ViewContainer } from \"pixi.js\";\nimport { Layout } from \"../Layout.mjs\";\nimport { getPixiSize } from \"../utils/getPixiSize.mjs\";\nfunction formatStyles(layout, style) {\n const currentStyles = layout._styles;\n let customStyles = { ...currentStyles.custom, ...style };\n const defaultStyle = {\n ...Layout.defaultStyle.shared,\n ...layout.target instanceof ViewContainer || customStyles.isLeaf || Layout.defaultStyle.shared.isLeaf ? Layout.defaultStyle.leaf : Layout.defaultStyle.container\n };\n customStyles = { ...defaultStyle, ...customStyles };\n const yogaStyles = { ...customStyles };\n const widthIntrinsic = customStyles.width === \"intrinsic\";\n const heightIntrinsic = customStyles.height === \"intrinsic\";\n if (widthIntrinsic || heightIntrinsic) {\n const { width, height } = getPixiSize(layout);\n if (widthIntrinsic) {\n yogaStyles.width = width;\n }\n if (heightIntrinsic) {\n yogaStyles.height = height;\n }\n }\n return { custom: customStyles, yoga: yogaStyles };\n}\nexport {\n formatStyles\n};\n//# sourceMappingURL=formatStyles.mjs.map\n","function onChildAdded(layout, pixiParent) {\n var _a;\n let parentLayout = pixiParent.layout;\n let overflowContainer;\n if (!parentLayout && pixiParent.isOverflowContainer) {\n overflowContainer = pixiParent;\n parentLayout = (_a = overflowContainer.parent) == null ? void 0 : _a.layout;\n pixiParent = overflowContainer.parent;\n }\n if (!parentLayout) {\n return false;\n }\n const yogaParent = layout.yoga.getParent();\n if (yogaParent) {\n yogaParent.removeChild(layout.yoga);\n }\n const yogaIndex = computeYogaInsertionIndex(layout, pixiParent, overflowContainer);\n if (yogaIndex === -1) {\n return false;\n }\n if (yogaIndex === parentLayout.yoga.getChildCount()) {\n parentLayout.yoga.insertChild(layout.yoga, yogaIndex);\n return true;\n }\n parentLayout.yoga.insertChild(layout.yoga, yogaIndex);\n return true;\n}\nfunction computeYogaInsertionIndex(layout, parent, overflow) {\n const target = layout.target;\n let index = 0;\n if (overflow) {\n for (const child of parent.children) {\n if (child === overflow) {\n for (const inner of overflow.children) {\n if (!inner.layout || !inner.visible) continue;\n if (inner === target) return index;\n index++;\n }\n return -1;\n }\n if (child.layout && child.visible) {\n index++;\n }\n }\n return -1;\n }\n for (const child of parent.children) {\n if (!child.layout || !child.visible) continue;\n if (child === target) return index;\n index++;\n }\n return -1;\n}\nfunction onChildRemoved(layout) {\n const yogaParent = layout.yoga.getParent();\n if (yogaParent) {\n yogaParent.removeChild(layout.yoga);\n }\n}\nexport {\n onChildAdded,\n onChildRemoved\n};\n//# sourceMappingURL=sort-children.mjs.map\n","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nimport { getYoga, getYogaConfig } from \"../yoga.mjs\";\nimport { applyStyle } from \"./style/applyStyle.mjs\";\nimport { formatStyles } from \"./style/formatStyles.mjs\";\nimport { onChildAdded, onChildRemoved } from \"./utils/sort-children.mjs\";\nclass Layout {\n constructor({ target }) {\n /** The Yoga node instance for this layout */\n __publicField(this, \"yoga\");\n /** The target PixiJS container */\n __publicField(this, \"target\");\n /**\n * Whether this object has been destroyed. If true, the object should no longer be used.\n * After an object is destroyed, all of its functionality is disabled and references are removed.\n */\n __publicField(this, \"destroyed\", false);\n /**\n * Flag indicating if layout needs recalculation\n * @ignore\n */\n __publicField(this, \"_isDirty\", false);\n /**\n * The computed pixi layout that is applied to the target container in the updateLocalTransform step\n * @ignore\n */\n __publicField(this, \"_computedPixiLayout\", {\n /** The left value of the view */\n x: 0,\n /** The top value of the view */\n y: 0,\n /** The offset x value of the view within its box */\n offsetX: 0,\n /** The offset y value of the view within its box */\n offsetY: 0,\n /** The scale x value of the view within its box */\n scaleX: 1,\n /** The scale y value of the view within its box */\n scaleY: 1,\n /** The x origin of the view */\n originX: 0,\n /** The y origin of the view */\n originY: 0\n });\n /**\n * The computed bounds of the yoga node\n * @ignore\n */\n __publicField(this, \"_computedLayout\", {\n /** The left value of the view */\n left: 0,\n /** The right value of the view */\n right: 0,\n /** The top value of the view */\n top: 0,\n /** The bottom value of the view */\n bottom: 0,\n /** The width of the view */\n width: 0,\n /** The height of the view */\n height: 0\n });\n /**\n * The styles used for layout calculation\n * @ignore\n */\n __publicField(this, \"_styles\", {\n custom: {},\n yoga: {}\n });\n /**\n * The number of times the layout has been modified\n * @ignore\n */\n __publicField(this, \"_modificationCount\", 0);\n /**\n * Flag indicating if the layout should be recalculated even if it hasn't changed the yoga node.\n * This is used to force an update when certain style properties change such as `objectFit`.\n * @ignore\n */\n __publicField(this, \"_forceUpdate\", false);\n /**\n * Flag indicating if the layout has a parent node\n */\n __publicField(this, \"hasParent\", false);\n /**\n * The keys to track for changes to force an update\n * @ignore\n */\n __publicField(this, \"_trackedStyleKeys\", [\n \"borderRadius\",\n \"borderColor\",\n \"backgroundColor\",\n \"objectFit\",\n \"objectPosition\",\n \"transformOrigin\",\n \"isLeaf\"\n ]);\n this.target = target;\n this.yoga = getYoga().Node.create(getYogaConfig());\n target.on(\"added\", this._onChildAdded, this);\n target.on(\"removed\", this._onChildRemoved, this);\n target.on(\"destroyed\", this.destroy, this);\n }\n /** Returns the layout style */\n get style() {\n return this._styles.custom;\n }\n /** Returns the computed layout of the yoga node */\n get computedLayout() {\n return this._computedLayout;\n }\n /** Returns the computed layout of the pixi node */\n get computedPixiLayout() {\n return this._computedPixiLayout;\n }\n /**\n * Returns the true x position of the target.\n *\n * When an element is in layout, the x/y position is an offset from where it is laid out.\n * This is the true x position of the element in the parent container.\n */\n get realX() {\n return this.target.localTransform.tx;\n }\n /**\n * Returns the true y position of the target.\n *\n * When an element is in layout, the x/y position is an offset from where it is laid out.\n * This is the true y position of the element in the parent container.\n */\n get realY() {\n return this.target.localTransform.ty;\n }\n /**\n * Returns the true x scale of the target.\n *\n * When an element is in layout, the scale is an offset from 1.\n * This is the true x scale of the element.\n */\n get realScaleX() {\n return this.target.localTransform.a;\n }\n /**\n * Returns the true y scale of the target.\n *\n * When an element is in layout, the scale is an offset from 1.\n * This is the true y scale of the element.\n */\n get realScaleY() {\n return this.target.localTransform.d;\n }\n /**\n * Updates the layout style and triggers recalculation\n * @param style - New layout style to apply\n */\n setStyle(style) {\n const styles = formatStyles(this, style);\n const differentCustom = JSON.stringify(this._styles.custom) !== JSON.stringify(styles.custom);\n const differentYoga = JSON.stringify(this._styles.yoga) !== JSON.stringify(styles.yoga);\n const different = differentCustom || differentYoga;\n const hasTrackedChanges = this._trackedStyleKeys.some((key) => styles.custom[key] !== this._styles.custom[key]);\n this._styles = styles;\n if (hasTrackedChanges) {\n this._forceUpdate = true;\n }\n if (different) {\n applyStyle(this.yoga, this._styles.yoga);\n this.target._onUpdate();\n this.invalidateRoot();\n }\n }\n /**\n * Marks the root layout as needing recalculation\n * @param start - Optional container to start searching for the root from\n */\n invalidateRoot(start) {\n const root = this.getRoot(start);\n if (root.destroyed) return;\n root._layout._isDirty = true;\n root._onUpdate();\n this._modificationCount++;\n }\n /**\n * Forces an update of the layout even if it hasn't changed the yoga node.\n * This is used to force an update when certain style properties change such as `objectFit`.\n * Or when you have changed something inside of Pixi that is not tracked by the layout system.\n */\n forceUpdate() {\n this._forceUpdate = true;\n }\n /**\n * Finds the root container by traversing up the layout tree\n * @param start - Optional container to start searching for the root from\n * @returns The root container\n */\n getRoot(start) {\n var _a, _b;\n let root = start || this.target;\n while (((_a = root.parent) == null ? void 0 : _a._layout) || ((_b = root.parent) == null ? void 0 : _b.isOverflowContainer)) {\n root = root.parent;\n if (root.isOverflowContainer) {\n root = root.parent;\n }\n }\n return root;\n }\n /**\n * @ignore\n */\n _onChildAdded(pixiParent) {\n if (this.hasParent) return;\n if (onChildAdded(this, pixiParent) === false) {\n return;\n }\n this.hasParent = true;\n this.invalidateRoot();\n }\n /**\n * @ignore\n */\n _onChildRemoved(parent) {\n if (!this.hasParent) return;\n this.hasParent = false;\n this.invalidateRoot(parent);\n onChildRemoved(this);\n }\n destroy() {\n if (this.destroyed) return;\n this.destroyed = true;\n this.invalidateRoot();\n this.yoga.free();\n this.target.off(\"added\", this._onChildAdded, this);\n this.target.off(\"removed\", this._onChildRemoved, this);\n this._styles = null;\n this._computedPixiLayout = null;\n this._computedLayout = null;\n this.target = null;\n this.hasParent = false;\n }\n}\n/** Default style values to apply to the layout */\n__publicField(Layout, \"defaultStyle\", {\n leaf: {\n width: \"intrinsic\",\n height: \"intrinsic\"\n },\n container: {\n width: \"auto\",\n height: \"auto\"\n },\n shared: {\n transformOrigin: \"50%\",\n objectPosition: \"center\",\n flexShrink: 1,\n flexDirection: \"row\",\n alignContent: \"stretch\",\n flexWrap: \"nowrap\",\n overflow: \"visible\"\n }\n});\nexport {\n Layout\n};\n//# sourceMappingURL=Layout.mjs.map\n","function calculateObjectFit(value, computedLayout, bounds) {\n let offsetScaleX = 1;\n let offsetScaleY = 1;\n switch (value) {\n case \"fill\":\n offsetScaleX = computedLayout.width / bounds.width;\n offsetScaleY = computedLayout.height / bounds.height;\n break;\n case \"contain\": {\n const scaleContain = Math.min(computedLayout.width / bounds.width, computedLayout.height / bounds.height);\n offsetScaleX = scaleContain;\n offsetScaleY = scaleContain;\n break;\n }\n case \"cover\": {\n const scaleCover = Math.max(computedLayout.width / bounds.width, computedLayout.height / bounds.height);\n offsetScaleX = scaleCover;\n offsetScaleY = scaleCover;\n break;\n }\n case \"none\":\n offsetScaleX = 1;\n offsetScaleY = 1;\n break;\n case \"scale-down\": {\n const scaleDown = Math.min(1, computedLayout.width / bounds.width, computedLayout.height / bounds.height);\n offsetScaleX = scaleDown;\n offsetScaleY = scaleDown;\n break;\n }\n }\n return {\n offsetScaleX,\n offsetScaleY\n };\n}\nexport {\n calculateObjectFit\n};\n//# sourceMappingURL=calculateObjectFit.mjs.map\n","import { TilingSprite as TilingSprite$1, NineSliceSprite as NineSliceSprite$1 } from \"pixi.js\";\nimport { calculateObjectFit } from \"./calculateObjectFit.mjs\";\nimport { calculatePositionSpecifier } from \"./calculatePositionSpecifier.mjs\";\nfunction baseComputeLayoutData(container, computedLayout, defaultObjectFit, anchor) {\n const bounds = container.getLocalBounds();\n const objectFit = container.layout.style.objectFit || defaultObjectFit;\n let { offsetScaleX, offsetScaleY } = calculateObjectFit(objectFit, computedLayout, bounds);\n const scaledBounds = {\n width: bounds.width * offsetScaleX,\n height: bounds.height * offsetScaleY\n };\n let { x: offsetX, y: offsetY } = calculatePositionSpecifier(\n container.layout.style.objectPosition,\n computedLayout,\n scaledBounds\n );\n if (anchor) {\n offsetX += bounds.width * offsetScaleX * anchor._x;\n offsetY += bounds.height * offsetScaleY * anchor._y;\n } else {\n offsetX -= bounds.minX * offsetScaleX;\n offsetY -= bounds.minY * offsetScaleY;\n }\n const applySizeDirectly = container.layout.style.applySizeDirectly;\n if (applySizeDirectly === true || // eslint-disable-next-line eqeqeq\n applySizeDirectly == void 0 && (container instanceof TilingSprite$1 || container instanceof NineSliceSprite$1)) {\n container.width = bounds.width * offsetScaleX;\n container.height = bounds.height * offsetScaleY;\n offsetScaleX = 1;\n offsetScaleY = 1;\n }\n return {\n x: computedLayout.left,\n y: computedLayout.top,\n offsetX,\n offsetY,\n scaleX: offsetScaleX,\n scaleY: offsetScaleY\n };\n}\nexport {\n baseComputeLayoutData\n};\n//# sourceMappingURL=baseComputeLayoutData.mjs.map\n","import { Container, extensions } from \"pixi.js\";\nimport { Layout } from \"../Layout.mjs\";\nimport { baseComputeLayoutData } from \"./utils/baseComputeLayoutData.mjs\";\nconst visibility = Object.getOwnPropertyDescriptor(Container.prototype, \"visible\");\nconst mixin = {\n // Internal reference to the layout object\n _layout: null,\n /**\n * Gets the current layout associated with this container\n * @returns The container's layout or null if no layout is attached\n */\n get layout() {\n return this._layout ?? null;\n },\n /**\n * Sets the layout for this container\n * @param value - Layout options to apply, or null to remove layout\n */\n set layout(value) {\n value = value === true ? {} : value;\n if (!value) {\n if (this._layout) {\n this._layout.destroy();\n this._layout = null;\n this.updateLocalTransform = Container.prototype.updateLocalTransform;\n Object.defineProperty(Container.prototype, \"visible\", visibility);\n }\n return;\n }\n if (!this._layout) {\n this._layout = new Layout({ target: this });\n Object.defineProperty(Container.prototype, \"visible\", {\n ...visibility,\n set(visibleValue) {\n visibility.set.call(this, visibleValue);\n if (this.layout) {\n if (visibleValue && this.parent) {\n this.layout._onChildAdded(this.parent);\n } else {\n this.layout._onChildRemoved();\n }\n }\n }\n });\n for (const child of this.children) {\n if (child.layout && child.visible) {\n child.layout._onChildRemoved();\n child.layout._onChildAdded(this);\n }\n }\n if (this.parent && this.visible) {\n this._layout._onChildAdded(this.parent);\n }\n }\n this._layout.setStyle(value);\n this.updateLocalTransform = this.updateLocalTransformWithLayout;\n this._onUpdate();\n },\n /**\n * This function overrides how we calculate the local transform of the container.\n * For the layout, we need to not only calculate the transform matrix, but also\n * take into account the yoga layout's position and scale.\n */\n updateLocalTransformWithLayout() {\n const localTransformChangeId = this._didContainerChangeTick;\n if (this._didLocalTransformChangeId === localTransformChangeId) return;\n this._didLocalTransformChangeId = localTransformChangeId;\n const layout = this._layout;\n const { x, y, offsetX, offsetY, scaleX, scaleY, originX, originY } = layout._computedPixiLayout;\n const lt = this.localTransform;\n const { rotation, skew, scale, position } = this;\n const xRotY = rotation + skew._y;\n const xRotX = rotation - skew._x;\n const a = Math.cos(xRotY) * scale._x;\n const b = Math.sin(xRotY) * scale._x;\n const c = -Math.sin(xRotX) * scale._y;\n const d = Math.cos(xRotX) * scale._y;\n const tx = position._x + x - originX * a - originY * c;\n const ty = position._y + y - originX * b - originY * d;\n lt.a = a * scaleX;\n lt.b = b * scaleX;\n lt.c = c * scaleY;\n lt.d = d * scaleY;\n lt.tx = tx + (offsetX * a + offsetY * c) + originX;\n lt.ty = ty + (offsetX * b + offsetY * d) + originY;\n },\n /**\n * Apply the computed layout to the container\n * Converts Yoga layout information into PixiJS positioning\n * @param computedLayout - Layout data from Yoga engine\n * @returns Transformed position and scale data for this container\n * @memberof scene.Container#\n */\n computeLayoutData(computedLayout) {\n const layout = this._layout;\n const { isLeaf } = layout._styles.custom;\n if (isLeaf) {\n return baseComputeLayoutData(this, computedLayout, \"fill\");\n }\n return {\n x: computedLayout.left,\n y: computedLayout.top,\n offsetX: 0,\n offsetY: 0,\n scaleX: 1,\n scaleY: 1\n };\n }\n};\nextensions.mixin(Container, mixin);\n//# sourceMappingURL=ContainerMixin.mjs.map\n","import { Point, extensions, AbstractText } from \"pixi.js\";\nimport { calculateObjectFit } from \"./utils/calculateObjectFit.mjs\";\nimport { calculatePositionSpecifier } from \"./utils/calculatePositionSpecifier.mjs\";\nconst tempScale = new Point(0, 0);\nconst mixin = {\n /**\n * Computes the layout data for the text element\n * @param computedLayout - The computed layout from Yoga\n * @returns The layout data for the text element\n */\n computeLayoutData(computedLayout) {\n const style = this._style;\n tempScale.copyFrom(this.scale);\n this.scale = 1;\n if (style.wordWrap) {\n style.wordWrapWidth = computedLayout.width;\n }\n let bounds = this.getLocalBounds();\n const objectFit = this.layout.style.objectFit || \"scale-down\";\n const { offsetScaleX, offsetScaleY } = calculateObjectFit(objectFit, computedLayout, bounds);\n if (style.wordWrap) {\n style.wordWrapWidth = computedLayout.width / Math.min(1, Math.max(offsetScaleX, offsetScaleY));\n }\n bounds = this.getLocalBounds();\n const scaledBounds = {\n width: bounds.width * offsetScaleX,\n height: bounds.height * offsetScaleY\n };\n let { x: offsetX, y: offsetY } = calculatePositionSpecifier(\n this.layout.style.objectPosition,\n computedLayout,\n scaledBounds\n );\n offsetX += bounds.width * offsetScaleX * this.anchor._x;\n offsetY += bounds.height * offsetScaleY * this.anchor._y;\n const applySizeDirectly = this.layout.style.applySizeDirectly;\n if (applySizeDirectly === true) {\n this.width = bounds.width * offsetScaleX;\n this.height = bounds.height * offsetScaleY;\n }\n this.scale.copyFrom(tempScale);\n return {\n x: computedLayout.left,\n y: computedLayout.top,\n offsetX,\n offsetY,\n scaleX: offsetScaleX,\n scaleY: offsetScaleY\n };\n }\n};\nextensions.mixin(AbstractText, mixin);\nconst text = Object.getOwnPropertyDescriptor(AbstractText.prototype, \"text\");\nObject.defineProperty(AbstractText.prototype, \"text\", {\n ...text,\n set(textString) {\n var _a;\n const currentText = text.get.call(this);\n text.set.call(this, textString);\n if (currentText === textString) return;\n (_a = this.layout) == null ? void 0 : _a.forceUpdate();\n }\n});\n//# sourceMappingURL=TextMixin.mjs.map\n","import { extensions, ViewContainer } from \"pixi.js\";\nimport { baseComputeLayoutData } from \"./utils/baseComputeLayoutData.mjs\";\nconst mixin = {\n /**\n * Computes the layout data for the container\n * @param computedLayout - The computed layout from Yoga\n * @returns The layout data for the container\n */\n computeLayoutData(computedLayout) {\n return baseComputeLayoutData(this, computedLayout, \"fill\", this._anchor);\n }\n};\nextensions.mixin(ViewContainer, mixin);\n//# sourceMappingURL=ViewContainerMixin.mjs.map\n","import { extensions } from \"pixi.js\";\nimport { LayoutSystem } from \"./core/LayoutSystem.mjs\";\nimport \"./core/mixins/ContainerMixin.mjs\";\nimport \"./core/mixins/TextMixin.mjs\";\nimport \"./core/mixins/ViewContainerMixin.mjs\";\nimport { DebugRenderer } from \"./core/debug/DebugRenderer.mjs\";\nimport { Layout } from \"./core/Layout.mjs\";\nimport { applyStyle } from \"./core/style/applyStyle.mjs\";\nimport { formatStyles } from \"./core/style/formatStyles.mjs\";\nimport { getNumberFromStyle, getTypeFromStyle } from \"./core/utils/getNumberFromStyle.mjs\";\nimport { getPixiSize } from \"./core/utils/getPixiSize.mjs\";\nimport { nearlyEqual } from \"./core/utils/nearlyEqual.mjs\";\nimport { onChildAdded, onChildRemoved } from \"./core/utils/sort-children.mjs\";\nimport { getYoga, getYogaConfig, setYoga, setYogaConfig } from \"./yoga.mjs\";\nextensions.add(LayoutSystem);\nexport {\n DebugRenderer,\n Layout,\n LayoutSystem,\n applyStyle,\n formatStyles,\n getNumberFromStyle,\n getPixiSize,\n getTypeFromStyle,\n getYoga,\n getYogaConfig,\n nearlyEqual,\n onChildAdded,\n onChildRemoved,\n setYoga,\n setYogaConfig\n};\n//# sourceMappingURL=index.mjs.map\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"mappings":";;;AAAA,IAAI;AACJ,SAAS,IAAU;AACjB,QAAO;;AAET,SAAS,EAAQ,GAAS;AACxB,KAAO;;AAET,IAAI;AACJ,SAAS,EAAc,GAAQ;AAC7B,KAAa;;AAEf,SAAS,IAAgB;AACvB,QAAO;;;;ACZT,SAAS,EAAmB,GAAO,GAAM;AAUvC,QATK,IACD,OAAO,KAAU,WACZ,IACE,OAAO,KAAU,YAAY,EAAM,SAAS,IAAI,IACzD,AAAS,MAAO,GACD,WAAW,EAAM,GAA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AAM,aAAa,cACoB,GAAgB,EAAO;AAI5F,CAHI,EAAM,aACR,EAAM,gBAAgB,EAAe,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,GAAc,EAAa,CAAC,GAEhG,IAAS,KAAK,gBAAgB;CAC9B,IAAM,IAAe;EACnB,OAAO,EAAO,QAAQ;EACtB,QAAQ,EAAO,SAAS;EACzB,EACG,EAAE,GAAG,GAAS,GAAG,MAAY,EAC/B,KAAK,OAAO,MAAM,gBAClB,GACA,EACD;AASD,QARA,KAAW,EAAO,QAAQ,IAAe,KAAK,OAAO,IACrD,KAAW,EAAO,SAAS,IAAe,KAAK,OAAO,IAC5B,KAAK,OAAO,MAAM,sBAClB,OACxB,KAAK,QAAQ,EAAO,QAAQ,GAC5B,KAAK,SAAS,EAAO,SAAS,IAEhC,KAAK,MAAM,SAAS,GAAU,EACvB;EACL,GAAG,EAAe;EAClB,GAAG,EAAe;EAClB;EACA;EACA,QAAQ;EACR,QAAQ;EACT;GAG+B,CAAC;AACrC,IAAM,IAAO,OAAO,yBAAyB,EAAa,WAAW,OAAO;;;AAC5E,OAAO,eAAe,EAAa,WAAW,QAAQ;CACpD,GAAG;CACH,IAAI,GAAY;EACd,IAAI;EACJ,IAAM,IAAc,EAAK,IAAI,KAAK,KAAK;AACvC,IAAK,IAAI,KAAK,MAAM,EAAW,EAC3B,MAAgB,OACnB,IAAK,KAAK,WAAW,QAAgB,EAAG,aAAa;;CAEzD,CAAC,EClDF,EAAW,MAAM,GAAe,EAJ9B,kBAAkB,GAAgB;AAChC,QAAO,EAAsB,MAAM,GAAgB,QAAQ,KAAK,QAAQ;GAGvC,CAAC,ECEtC,EAAW,IAAI,EAAa"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Signal, WritableSignal, WritableObjectSignal } from '@signe/reactive';
|
|
2
|
+
import { Element } from './reactive';
|
|
3
|
+
import { CanvasViewport } from '../components/Viewport';
|
|
4
|
+
import { SignalOrPrimitive } from '../components/types';
|
|
5
|
+
/**
|
|
6
|
+
* Options for scroll behavior when navigating to focused elements
|
|
7
|
+
*
|
|
8
|
+
* @property padding - Padding around the element in pixels (default: 0)
|
|
9
|
+
* @property smooth - Enable smooth scrolling animation (default: false)
|
|
10
|
+
* @property center - Center the element in the viewport (default: true)
|
|
11
|
+
* @property duration - Animation duration in ms if smooth=true (default: 300)
|
|
12
|
+
*/
|
|
13
|
+
export interface ScrollOptions {
|
|
14
|
+
padding?: number;
|
|
15
|
+
smooth?: boolean;
|
|
16
|
+
center?: boolean;
|
|
17
|
+
duration?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Data structure for a focus container
|
|
21
|
+
*/
|
|
22
|
+
type WritableElementSignal = WritableSignal<Element | null> | WritableObjectSignal<Element | null>;
|
|
23
|
+
interface FocusContainerData {
|
|
24
|
+
id: string;
|
|
25
|
+
element?: Element<any>;
|
|
26
|
+
focusables: Map<number, Element<any>>;
|
|
27
|
+
currentIndex: WritableSignal<number | null>;
|
|
28
|
+
focusedElement: WritableElementSignal;
|
|
29
|
+
onFocusChange?: (index: number, element: Element | null) => void;
|
|
30
|
+
autoScroll?: boolean | ScrollOptions;
|
|
31
|
+
viewport?: CanvasViewport;
|
|
32
|
+
tabindex?: SignalOrPrimitive<number> | null;
|
|
33
|
+
tabindexSubscription?: any;
|
|
34
|
+
pendingIndex?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Central manager for focus navigation system
|
|
38
|
+
*
|
|
39
|
+
* Manages focusable elements within containers, handles navigation,
|
|
40
|
+
* and provides scroll integration with Viewport.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const manager = FocusManager.getInstance();
|
|
45
|
+
* manager.registerContainer('menu', containerData);
|
|
46
|
+
* manager.navigate('menu', 'next');
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare class FocusManager {
|
|
50
|
+
private static instance;
|
|
51
|
+
private containers;
|
|
52
|
+
private scrollAnimations;
|
|
53
|
+
/**
|
|
54
|
+
* Get the singleton instance of FocusManager
|
|
55
|
+
*
|
|
56
|
+
* @returns The FocusManager instance
|
|
57
|
+
*/
|
|
58
|
+
static getInstance(): FocusManager;
|
|
59
|
+
/**
|
|
60
|
+
* Register a focus container
|
|
61
|
+
*
|
|
62
|
+
* @param id - Unique identifier for the container
|
|
63
|
+
* @param data - Container data including signals and callbacks
|
|
64
|
+
*/
|
|
65
|
+
registerContainer(id: string, data: Omit<FocusContainerData, 'id'>): void;
|
|
66
|
+
/**
|
|
67
|
+
* Update a focus container's data
|
|
68
|
+
*
|
|
69
|
+
* @param id - Container identifier
|
|
70
|
+
* @param data - Partial container data to update
|
|
71
|
+
*/
|
|
72
|
+
updateContainer(id: string, data: Partial<Omit<FocusContainerData, 'id'>>): void;
|
|
73
|
+
setTabindex(id: string, tabindex?: SignalOrPrimitive<number> | null): void;
|
|
74
|
+
/**
|
|
75
|
+
* Unregister a focus container
|
|
76
|
+
*
|
|
77
|
+
* @param id - Container identifier to remove
|
|
78
|
+
*/
|
|
79
|
+
unregisterContainer(id: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* Register a focusable element in a container
|
|
82
|
+
*
|
|
83
|
+
* @param containerId - Container identifier
|
|
84
|
+
* @param element - Element to register
|
|
85
|
+
* @param index - Focus index for this element
|
|
86
|
+
*/
|
|
87
|
+
registerFocusable(containerId: string, element: Element, index: number): void;
|
|
88
|
+
/**
|
|
89
|
+
* Unregister a focusable element from a container
|
|
90
|
+
*
|
|
91
|
+
* @param containerId - Container identifier
|
|
92
|
+
* @param index - Focus index to remove
|
|
93
|
+
*/
|
|
94
|
+
unregisterFocusable(containerId: string, index: number): void;
|
|
95
|
+
/**
|
|
96
|
+
* Navigate to next or previous focusable element
|
|
97
|
+
*
|
|
98
|
+
* @param containerId - Container identifier
|
|
99
|
+
* @param direction - Navigation direction ('next' or 'previous')
|
|
100
|
+
*/
|
|
101
|
+
navigate(containerId: string, direction: 'next' | 'previous'): void;
|
|
102
|
+
/**
|
|
103
|
+
* Set the focus index for a container
|
|
104
|
+
*
|
|
105
|
+
* @param containerId - Container identifier
|
|
106
|
+
* @param index - Focus index to set
|
|
107
|
+
*/
|
|
108
|
+
setIndex(containerId: string, index: number): void;
|
|
109
|
+
private applyFocus;
|
|
110
|
+
/**
|
|
111
|
+
* Get the element at a specific index
|
|
112
|
+
*
|
|
113
|
+
* @param containerId - Container identifier
|
|
114
|
+
* @param index - Focus index
|
|
115
|
+
* @returns Element at index or null
|
|
116
|
+
*/
|
|
117
|
+
getElement(containerId: string, index: number): Element | null;
|
|
118
|
+
/**
|
|
119
|
+
* Get current focus index for a container
|
|
120
|
+
*
|
|
121
|
+
* @param containerId - Container identifier
|
|
122
|
+
* @returns Current index signal
|
|
123
|
+
*/
|
|
124
|
+
getCurrentIndexSignal(containerId: string): Signal<number | null> | null;
|
|
125
|
+
/**
|
|
126
|
+
* Get current focused element signal for a container
|
|
127
|
+
*
|
|
128
|
+
* @param containerId - Container identifier
|
|
129
|
+
* @returns Current element signal
|
|
130
|
+
*/
|
|
131
|
+
getFocusedElementSignal(containerId: string): Signal<Element | null> | null;
|
|
132
|
+
/**
|
|
133
|
+
* Check if an element is visible in the viewport
|
|
134
|
+
*
|
|
135
|
+
* @param element - Element to check
|
|
136
|
+
* @param viewport - Viewport to check against (optional)
|
|
137
|
+
* @returns True if element is visible
|
|
138
|
+
*/
|
|
139
|
+
isElementVisible(element: Element, viewport?: CanvasViewport): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Get global bounds of an element
|
|
142
|
+
*
|
|
143
|
+
* @param element - Element to get bounds for
|
|
144
|
+
* @returns Bounds object with x, y, width, height
|
|
145
|
+
*/
|
|
146
|
+
getElementBounds(element: Element): {
|
|
147
|
+
x: number;
|
|
148
|
+
y: number;
|
|
149
|
+
width: number;
|
|
150
|
+
height: number;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Scroll viewport to show an element
|
|
154
|
+
*
|
|
155
|
+
* @param containerId - Container identifier
|
|
156
|
+
* @param index - Focus index of element to scroll to
|
|
157
|
+
* @param viewport - Viewport instance (optional, uses container's viewport if not provided)
|
|
158
|
+
* @param options - Scroll options
|
|
159
|
+
*/
|
|
160
|
+
scrollToElement(containerId: string, index: number, viewport?: CanvasViewport, options?: ScrollOptions): void;
|
|
161
|
+
/**
|
|
162
|
+
* Animate smooth scrolling
|
|
163
|
+
*
|
|
164
|
+
* @param containerId - Container identifier
|
|
165
|
+
* @param viewport - Viewport instance
|
|
166
|
+
* @param targetX - Target X position
|
|
167
|
+
* @param targetY - Target Y position
|
|
168
|
+
* @param duration - Animation duration in ms
|
|
169
|
+
*/
|
|
170
|
+
private animateScroll;
|
|
171
|
+
}
|
|
172
|
+
export declare const focusManager: FocusManager;
|
|
173
|
+
export {};
|
|
174
|
+
//# sourceMappingURL=FocusManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusManager.d.ts","sourceRoot":"","sources":["../../src/engine/FocusManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAE,OAAO,EAAmB,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,KAAK,qBAAqB,GAAG,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,oBAAoB,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAEnG,UA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ACH,OAAO,CAAC,aAAa;CA+CtB;AAGD,eAAO,MAAM,YAAY,cAA6B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { WritableSignal, Signal } from '@signe/reactive';
|
|
2
|
+
import { Tick } from '../directives/Scheduler';
|
|
3
|
+
export interface AnimateOptions<T> {
|
|
4
|
+
duration?: number;
|
|
5
|
+
ease?: (t: number) => number;
|
|
6
|
+
onUpdate?: (value: T) => void;
|
|
7
|
+
onComplete?: () => void;
|
|
8
|
+
tick?: Signal<Tick>;
|
|
9
|
+
}
|
|
10
|
+
export interface AnimatedState<T> {
|
|
11
|
+
current: T;
|
|
12
|
+
start: T;
|
|
13
|
+
end: T;
|
|
14
|
+
}
|
|
15
|
+
export interface AnimatedSignal<T> extends Omit<WritableSignal<T>, 'set'> {
|
|
16
|
+
(): T;
|
|
17
|
+
set: (newValue: T, options?: AnimateOptions<T>) => Promise<void>;
|
|
18
|
+
animatedState: WritableSignal<AnimatedState<T>>;
|
|
19
|
+
update: (updater: (value: T) => T) => void;
|
|
20
|
+
pause: () => void;
|
|
21
|
+
resume: () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function isAnimatedSignal(signal: WritableSignal<any>): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Creates an animated signal with the given initial value and animation options.
|
|
26
|
+
* It's a writable signal that can be animated using popmotion. Properties of the animated signal are:
|
|
27
|
+
* - current: the current value of the signal.
|
|
28
|
+
* - start: the start value of the animation.
|
|
29
|
+
* - end: the end value of the animation.
|
|
30
|
+
*
|
|
31
|
+
* If a tick signal is provided in options, the animation will use the engine's tick system.
|
|
32
|
+
* Otherwise, it will automatically use the global tick signal from the Canvas context if available.
|
|
33
|
+
* If no tick signal is available, it will use requestAnimationFrame by default.
|
|
34
|
+
*
|
|
35
|
+
* @param initialValue The initial value of the signal.
|
|
36
|
+
* @param options The animation options. Can include a `tick` signal to use a specific tick system.
|
|
37
|
+
* @returns The animated signal.
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* // Automatically uses the Canvas tick system if available, otherwise requestAnimationFrame
|
|
41
|
+
* const animatedValue = animatedSignal(0, { duration: 1000 });
|
|
42
|
+
* animatedValue.set(10);
|
|
43
|
+
*
|
|
44
|
+
* // Explicitly using a specific tick signal
|
|
45
|
+
* mount((element) => {
|
|
46
|
+
* const tickSignal = element.props.context.tick;
|
|
47
|
+
* const animatedValue = animatedSignal(0, { duration: 1000, tick: tickSignal });
|
|
48
|
+
* animatedValue.set(10);
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function animatedSignal<T>(initialValue: T, options?: AnimateOptions<T>): AnimatedSignal<T>;
|
|
53
|
+
/**
|
|
54
|
+
* Executes a sequence of animations. If an array is provided as an element in the sequence,
|
|
55
|
+
* those animations will be executed in parallel.
|
|
56
|
+
*
|
|
57
|
+
* @param sequence Array of animation functions or arrays of animation functions for parallel execution
|
|
58
|
+
* @returns Promise that resolves when all animations are complete
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* await animatedSequence([
|
|
62
|
+
* () => value1.set(10),
|
|
63
|
+
* [
|
|
64
|
+
* () => value2.set(20),
|
|
65
|
+
* () => value3.set(30)
|
|
66
|
+
* ],
|
|
67
|
+
* () => value1.set(0)
|
|
68
|
+
* ])
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function animatedSequence(sequence: ((() => Promise<void>) | (() => Promise<void>)[])[]): Promise<void>;
|
|
72
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/engine/animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAa/C,MAAM,WAAW,cAAc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AQ,EAAE,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,iBAQnG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Application, ApplicationOptions } from 'pixi.js';
|
|
2
|
+
import { Subscription } from 'rxjs';
|
|
3
|
+
import { ComponentFunction } from './signal';
|
|
4
|
+
/**
|
|
5
|
+
* Extended options for bootstrapCanvas that includes component registration configuration.
|
|
6
|
+
*
|
|
7
|
+
* @property components - Optional mapping of component names to their classes (can include mocks for testing)
|
|
8
|
+
* @property autoRegister - If true (default), registers all default components before applying custom components. If false, only registers the specified components.
|
|
9
|
+
*/
|
|
10
|
+
export interface BootstrapOptions extends ApplicationOptions {
|
|
11
|
+
components?: {
|
|
12
|
+
[name: string]: any;
|
|
13
|
+
};
|
|
14
|
+
autoRegister?: boolean;
|
|
15
|
+
enableLayout?: boolean;
|
|
16
|
+
}
|
|
17
|
+
type BootstrapResult = {
|
|
18
|
+
canvasElement: any;
|
|
19
|
+
app: Application;
|
|
20
|
+
hmrSubscription?: Subscription;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Bootstraps a canvas element and renders it to the DOM.
|
|
24
|
+
*
|
|
25
|
+
* @param rootElement - The HTML element where the canvas will be rendered. Can be null.
|
|
26
|
+
* @param canvas - A Promise that resolves to an Element representing the canvas component.
|
|
27
|
+
* @param options - Optional bootstrap options including ApplicationOptions and component registration configuration.
|
|
28
|
+
* @returns A Promise that resolves to the rendered canvas element.
|
|
29
|
+
* @throws {Error} If the provided element is not a Canvas component.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // Default: all components registered automatically
|
|
34
|
+
* await bootstrapCanvas(rootElement, MyComponent, {
|
|
35
|
+
* width: 800,
|
|
36
|
+
* height: 600
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* // With mocks for testing
|
|
43
|
+
* import { mockComponents } from '@canvasengine/testing';
|
|
44
|
+
* await bootstrapCanvas(rootElement, MyComponent, {
|
|
45
|
+
* components: mockComponents,
|
|
46
|
+
* autoRegister: false
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare const bootstrapCanvas: (rootElement: HTMLElement | null, canvas: ComponentFunction<any>, options?: BootstrapOptions) => Promise<BootstrapResult>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/engine/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAc,YAAY,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAK,MAAM,UAAU,CAAC;AAOhD,OAAO,sBAAsB,CAAC;AAC9B,OAAO,yBAAyB,CAAC;AACjC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,wBAAwB,CAAC;AAChC,OAAO,4BAA4B,CAAC;AACpC,OAAO,+BAA+B,CAAC;AACvC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,UAAU,CAAC,EAAE;QACX,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;KACrB,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,KAAK,eAAe,GAAG;IACrB,aAAa,EAAE,GAAG,CAAC;IACnB,GAAG,EAAE,WAAW,CAAC;IACjB,eAAe,CAAC,EAAE,YAAY,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,eAAe,GAAU,aAAa,WAAW,GAAG,IAAI,EAAE,QAAQ,iBAAiB,CAAC,GAAG,CAAC,EAAE,UAAU,gBAAgB,KAAG,OAAO,CAAC,eAAe,CAkF1J,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Element } from './reactive';
|
|
2
|
+
export declare const directives: {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
|
+
export declare abstract class Directive {
|
|
6
|
+
abstract onDestroy(element: Element<any>): any;
|
|
7
|
+
abstract onInit(element: Element<any>): any;
|
|
8
|
+
abstract onMount(element: Element<any>): any;
|
|
9
|
+
abstract onUpdate(props: any, element: Element<any>): any;
|
|
10
|
+
}
|
|
11
|
+
export declare function registerDirective(name: string, directive: any): void;
|
|
12
|
+
export declare function applyDirective(element: Element<any>, directiveName: string): any;
|
|
13
|
+
//# sourceMappingURL=directive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../src/engine/directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAO,CAAA;AAEpD,8BAAsB,SAAS;IAC3B,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;IACxC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAG,OAAO,CAAC,GAAG,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;CACtD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,QAE7D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,MAAM,OAO1E"}
|