canvasengine 2.0.0-beta.41 → 2.0.0-beta.43
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-BxfW34YG.js → DebugRenderer-K2IZBznP.js} +2 -2
- package/dist/{DebugRenderer-BxfW34YG.js.map → DebugRenderer-K2IZBznP.js.map} +1 -1
- package/dist/components/Button.d.ts +3 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/DOMElement.d.ts.map +1 -1
- package/dist/components/Graphic.d.ts +1 -1
- package/dist/components/Graphic.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/types/DisplayObject.d.ts +12 -16
- package/dist/components/types/DisplayObject.d.ts.map +1 -1
- package/dist/directives/FocusNavigation.d.ts +71 -0
- package/dist/directives/FocusNavigation.d.ts.map +1 -0
- package/dist/directives/KeyboardControls.d.ts.map +1 -1
- package/dist/directives/ViewportFollow.d.ts.map +1 -1
- package/dist/engine/FocusManager.d.ts +174 -0
- package/dist/engine/FocusManager.d.ts.map +1 -0
- package/dist/engine/bootstrap.d.ts +33 -1
- package/dist/engine/bootstrap.d.ts.map +1 -1
- package/dist/engine/reactive.d.ts +20 -0
- package/dist/engine/reactive.d.ts.map +1 -1
- package/dist/hooks/useFocus.d.ts +61 -0
- package/dist/hooks/useFocus.d.ts.map +1 -0
- package/dist/{index-BnuKipxl.js → index-B4hYyfVE.js} +5479 -4677
- package/dist/index-B4hYyfVE.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.global.js +7 -7
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +70 -63
- package/package.json +2 -2
- package/src/components/Button.ts +7 -4
- package/src/components/Canvas.ts +1 -1
- package/src/components/DOMContainer.ts +27 -2
- package/src/components/DOMElement.ts +37 -29
- package/src/components/DisplayObject.ts +15 -3
- package/src/components/FocusContainer.ts +372 -0
- package/src/components/Graphic.ts +43 -48
- package/src/components/Sprite.ts +4 -2
- package/src/components/Viewport.ts +65 -26
- package/src/components/index.ts +2 -1
- package/src/components/types/DisplayObject.ts +7 -4
- package/src/directives/Controls.ts +1 -1
- package/src/directives/ControlsBase.ts +1 -1
- package/src/directives/FocusNavigation.ts +252 -0
- package/src/directives/KeyboardControls.ts +12 -8
- package/src/directives/ViewportFollow.ts +8 -5
- package/src/engine/FocusManager.ts +495 -0
- package/src/engine/bootstrap.ts +69 -2
- package/src/engine/reactive.ts +54 -18
- package/src/hooks/useFocus.ts +94 -0
- package/src/index.ts +3 -0
- package/dist/index-BnuKipxl.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bounds as F, Rectangle as C, Container as M, Graphics as x, BigPool as b } from "pixi.js";
|
|
2
|
-
import { F as _, E as p } from "./index-
|
|
2
|
+
import { F as _, E as p } from "./index-B4hYyfVE.js";
|
|
3
3
|
var l = /* @__PURE__ */ ((e) => (e.Margin = "margin", e.Padding = "padding", e.Border = "border", e.Flex = "flex", e.Content = "content", e))(l || {});
|
|
4
4
|
function w(e, t) {
|
|
5
5
|
const r = `getComputed${t.charAt(0).toUpperCase() + t.slice(1)}`;
|
|
@@ -169,4 +169,4 @@ class y {
|
|
|
169
169
|
export {
|
|
170
170
|
y as DebugRenderer
|
|
171
171
|
};
|
|
172
|
-
//# sourceMappingURL=DebugRenderer-
|
|
172
|
+
//# sourceMappingURL=DebugRenderer-K2IZBznP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugRenderer-BxfW34YG.js","sources":["../../../node_modules/.pnpm/@pixi+layout@3.0.2_@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/debug/calculateDebugRegions.mjs","../../../node_modules/.pnpm/@pixi+layout@3.0.2_@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/debug/DebugNode.mjs","../../../node_modules/.pnpm/@pixi+layout@3.0.2_@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/debug/DebugRenderer.mjs"],"sourcesContent":["import { Bounds, Rectangle } from \"pixi.js\";\nimport { Edge, FlexDirection } from \"yoga-layout/load\";\nvar DebugRegionType = /* @__PURE__ */ ((DebugRegionType2) => {\n DebugRegionType2[\"Margin\"] = \"margin\";\n DebugRegionType2[\"Padding\"] = \"padding\";\n DebugRegionType2[\"Border\"] = \"border\";\n DebugRegionType2[\"Flex\"] = \"flex\";\n DebugRegionType2[\"Content\"] = \"content\";\n return DebugRegionType2;\n})(DebugRegionType || {});\nfunction getEdgeValues(layout, type) {\n const method = `getComputed${type.charAt(0).toUpperCase() + type.slice(1)}`;\n return {\n top: layout.yoga[method](Edge.Top),\n right: layout.yoga[method](Edge.Right),\n bottom: layout.yoga[method](Edge.Bottom),\n left: layout.yoga[method](Edge.Left)\n };\n}\nfunction calculateRegions(layout, regions) {\n const { width, height } = layout.computedLayout;\n const margin = getEdgeValues(layout, \"margin\");\n const border = getEdgeValues(layout, \"border\");\n const padding = getEdgeValues(layout, \"padding\");\n const marginRegion = regions.get(\n \"margin\"\n /* Margin */\n );\n marginRegion.outer.x = -margin.left;\n marginRegion.outer.y = -margin.top;\n marginRegion.outer.width = width + margin.left + margin.right;\n marginRegion.outer.height = height + margin.top + margin.bottom;\n marginRegion.inner.x = 0;\n marginRegion.inner.y = 0;\n marginRegion.inner.width = width;\n marginRegion.inner.height = height;\n const borderRegion = regions.get(\n \"border\"\n /* Border */\n );\n borderRegion.outer.x = 0;\n borderRegion.outer.y = 0;\n borderRegion.outer.width = width;\n borderRegion.outer.height = height;\n borderRegion.inner.x = border.left;\n borderRegion.inner.y = border.top;\n borderRegion.inner.width = width - border.left - border.right;\n borderRegion.inner.height = height - border.top - border.bottom;\n const paddingRegion = regions.get(\n \"padding\"\n /* Padding */\n );\n paddingRegion.outer.copyFrom(borderRegion.inner);\n paddingRegion.inner.x = padding.left + border.left;\n paddingRegion.inner.y = padding.top + border.top;\n paddingRegion.inner.width = width - padding.left - padding.right - border.left - border.right;\n paddingRegion.inner.height = height - padding.top - padding.bottom - border.top - border.bottom;\n calculateFlexRegion(layout, regions);\n}\nfunction calculateFlexRegion(layout, regions) {\n var _a;\n const flexRegion = regions.get(\n \"flex\"\n /* Flex */\n );\n const paddingRegion = regions.get(\n \"padding\"\n /* Padding */\n );\n flexRegion.outer.copyFrom(paddingRegion.inner);\n const bounds = new Bounds();\n const children = layout.yoga.getChildCount();\n for (let i = 0; i < children; i++) {\n const child = layout.yoga.getChild(i);\n const computedBounds = child.getComputedLayout();\n bounds.addRect(\n new Rectangle(computedBounds.left, computedBounds.top, computedBounds.width, computedBounds.height)\n );\n }\n const flexDir = layout.yoga.getFlexDirection();\n if (flexDir === FlexDirection.Column || flexDir === FlexDirection.ColumnReverse) {\n bounds.width = flexRegion.outer.width;\n bounds.x = flexRegion.outer.x;\n } else {\n bounds.height = flexRegion.outer.height;\n bounds.y = flexRegion.outer.y;\n }\n (_a = flexRegion.inner) == null ? void 0 : _a.copyFrom(bounds.rectangle);\n regions.get(\n \"content\"\n /* Content */\n ).outer.copyFrom(bounds.rectangle);\n}\nexport {\n DebugRegionType,\n calculateRegions\n};\n//# sourceMappingURL=calculateDebugRegions.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 { Container, Graphics as Graphics$1 } from \"pixi.js\";\nimport { DebugRegionType } from \"./calculateDebugRegions.mjs\";\nfunction lerpColor(start, end, t) {\n const r = Math.round(start[0] + (end[0] - start[0]) * t);\n const g = Math.round(start[1] + (end[1] - start[1]) * t);\n const b = Math.round(start[2] + (end[2] - start[2]) * t);\n return `rgb(${r},${g},${b})`;\n}\nclass DebugNode extends Container {\n constructor() {\n super();\n /** Graphics objects for each region type */\n __publicField(this, \"graphics\");\n __publicField(this, \"heatGraphics\");\n this.graphics = /* @__PURE__ */ new Map();\n Object.values(DebugRegionType).forEach((type) => {\n const graphics = new Graphics$1();\n this.graphics.set(type, graphics);\n this.addChild(graphics);\n });\n this.heatGraphics = new Graphics$1();\n this.addChild(this.heatGraphics);\n }\n /**\n * Initialize the debug object with region data\n */\n init(regions) {\n const { target, alpha, heat } = regions;\n if (!regions.heatOnly) {\n Object.entries(regions).forEach(([type, region]) => {\n if (type === \"target\" || type === \"alpha\" || type === \"heat\" || type === \"heatOnly\") return;\n region = region;\n const graphics = this.graphics.get(type);\n if (!graphics || !region.draw) return;\n if (region.inner) {\n this.drawCutBox(graphics, region.outer, region.inner, region.color, alpha);\n } else {\n const { x, y, width, height } = region.outer;\n graphics.rect(x, y, width, Math.max(height, 1));\n graphics.fill({ color: region.color, alpha });\n }\n });\n }\n const { invalidationCount, draw } = heat;\n if (invalidationCount > 0 && draw) {\n const MAX_INVALIDATE_COUNT = 20;\n const normalizedAlpha = Math.min(invalidationCount / MAX_INVALIDATE_COUNT, 1);\n const marginRegion = regions[DebugRegionType.Margin];\n const startColor = [255, 255, 0];\n const endColor = [255, 0, 0];\n const color = lerpColor(startColor, endColor, normalizedAlpha);\n this.heatGraphics.rect(\n marginRegion.outer.x,\n marginRegion.outer.y,\n marginRegion.outer.width,\n marginRegion.outer.height\n );\n this.heatGraphics.fill({ color, alpha: Math.min(0.3, normalizedAlpha) });\n this.heatGraphics.stroke({ color, alpha: Math.max(0.3, normalizedAlpha), pixelLine: true });\n }\n this.position.set(target.x, target.y);\n }\n /**\n * Reset the debug object's state\n */\n reset() {\n this.graphics.forEach((graphics) => graphics.clear());\n this.heatGraphics.clear();\n this.removeFromParent();\n }\n /**\n * Draw a box with a cut-out center\n */\n drawCutBox(graphics, outer, inner, color, alpha) {\n const { x, y, width, height } = outer;\n const { x: innerX, y: innerY, width: innerWidth, height: innerHeight } = inner;\n graphics.rect(x, y, width, height);\n graphics.fill({ color, alpha });\n graphics.rect(innerX, innerY, innerWidth, innerHeight);\n graphics.cut();\n }\n}\nexport {\n DebugNode\n};\n//# sourceMappingURL=DebugNode.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 { Container, Rectangle, BigPool } from \"pixi.js\";\nimport { DebugRegionType, calculateRegions } from \"./calculateDebugRegions.mjs\";\nimport { DebugNode } from \"./DebugNode.mjs\";\nclass DebugRenderer {\n constructor() {\n /** Container for all debug visuals */\n __publicField(this, \"holder\", new Container());\n /** Region data for each debug type */\n __publicField(this, \"regions\", /* @__PURE__ */ new Map());\n /** Color configuration for each region type */\n __publicField(this, \"colors\", {\n [DebugRegionType.Margin]: \"#B68655\",\n [DebugRegionType.Padding]: \"#BAC57F\",\n [DebugRegionType.Border]: \"#E7C583\",\n [DebugRegionType.Content]: \"#89B1BE\",\n [DebugRegionType.Flex]: \"#6E28D9\"\n });\n /** Global alpha value for all regions */\n __publicField(this, \"alpha\", 0.75);\n Object.values(DebugRegionType).forEach((type) => {\n this.regions.set(type, {\n outer: new Rectangle(),\n inner: new Rectangle()\n });\n });\n this.holder.__devtoolIgnore = true;\n this.holder.__devtoolIgnoreChildren = true;\n this.holder.eventMode = \"none\";\n this.holder.interactiveChildren = false;\n }\n /**\n * Clean up previous render state\n */\n reset() {\n for (let i = this.holder.children.length - 1; i >= 0; i--) {\n const child = this.holder.children[i];\n BigPool.return(child);\n }\n }\n /**\n * Render debug visuals for the given layout\n */\n render(layout) {\n calculateRegions(layout, this.regions);\n const regionData = Object.values(DebugRegionType).reduce(\n (acc, type) => {\n const region = this.regions.get(type);\n if (!region) return acc;\n const drawString = `debugDraw${type.charAt(0).toUpperCase()}${type.slice(1)}`;\n acc[type] = {\n ...region,\n color: this.colors[type],\n draw: layout._styles.custom[drawString] ?? true\n };\n return acc;\n },\n {}\n );\n const { left, top } = layout.computedLayout;\n const pos = layout.target.getGlobalPosition();\n const debugObject = BigPool.get(DebugNode, {\n ...regionData,\n target: { x: pos.x + left, y: pos.y + top },\n alpha: this.alpha,\n heat: {\n invalidationCount: layout._modificationCount,\n draw: layout._styles.custom.debugHeat !== false\n },\n heatOnly: !layout._styles.custom.debug\n });\n this.holder.addChildAt(debugObject, 0);\n }\n /**\n * Clean up the debug renderer\n */\n destroy() {\n this.reset();\n this.holder.destroy();\n this.regions.clear();\n }\n}\nexport {\n DebugRenderer\n};\n//# sourceMappingURL=DebugRenderer.mjs.map\n"],"names":["DebugRegionType","DebugRegionType2","getEdgeValues","layout","type","method","Edge","calculateRegions","regions","width","height","margin","border","padding","marginRegion","borderRegion","paddingRegion","calculateFlexRegion","_a","flexRegion","bounds","Bounds","children","i","computedBounds","Rectangle","flexDir","FlexDirection","__defProp","__defNormalProp","obj","key","value","__publicField","lerpColor","start","end","t","r","g","b","DebugNode","Container","graphics","Graphics$1","target","alpha","heat","region","x","y","invalidationCount","draw","normalizedAlpha","color","outer","inner","innerX","innerY","innerWidth","innerHeight","DebugRenderer","child","BigPool","regionData","acc","drawString","left","top","pos","debugObject"],"mappings":";;AAEA,IAAIA,IAAmC,kBAACC,OACtCA,EAAiB,SAAY,UAC7BA,EAAiB,UAAa,WAC9BA,EAAiB,SAAY,UAC7BA,EAAiB,OAAU,QAC3BA,EAAiB,UAAa,WACvBA,IACND,KAAmB,CAAA,CAAE;AACxB,SAASE,EAAcC,GAAQC,GAAM;AACnC,QAAMC,IAAS,cAAcD,EAAK,OAAO,CAAC,EAAE,YAAa,IAAGA,EAAK,MAAM,CAAC,CAAC;AACzE,SAAO;AAAA,IACL,KAAKD,EAAO,KAAKE,CAAM,EAAEC,EAAK,GAAG;AAAA,IACjC,OAAOH,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C1B,MAAMA,EAAO,QAAQ,OAAO,cAAc;AAAA,MAC3C;AAAA,MACD,UAAU,CAACA,EAAO,QAAQ,OAAO;AAAA,IACvC,CAAK;AACD,SAAK,OAAO,WAAWmE,GAAa,CAAC;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA,EAIE,UAAU;AACR,SAAK,MAAO,GACZ,KAAK,OAAO,QAAS,GACrB,KAAK,QAAQ,MAAO;AAAA,EACxB;AACA;","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"DebugRenderer-K2IZBznP.js","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/core/debug/calculateDebugRegions.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/debug/DebugNode.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/debug/DebugRenderer.mjs"],"sourcesContent":["import { Bounds, Rectangle } from \"pixi.js\";\nimport { Edge, FlexDirection } from \"yoga-layout/load\";\nvar DebugRegionType = /* @__PURE__ */ ((DebugRegionType2) => {\n DebugRegionType2[\"Margin\"] = \"margin\";\n DebugRegionType2[\"Padding\"] = \"padding\";\n DebugRegionType2[\"Border\"] = \"border\";\n DebugRegionType2[\"Flex\"] = \"flex\";\n DebugRegionType2[\"Content\"] = \"content\";\n return DebugRegionType2;\n})(DebugRegionType || {});\nfunction getEdgeValues(layout, type) {\n const method = `getComputed${type.charAt(0).toUpperCase() + type.slice(1)}`;\n return {\n top: layout.yoga[method](Edge.Top),\n right: layout.yoga[method](Edge.Right),\n bottom: layout.yoga[method](Edge.Bottom),\n left: layout.yoga[method](Edge.Left)\n };\n}\nfunction calculateRegions(layout, regions) {\n const { width, height } = layout.computedLayout;\n const margin = getEdgeValues(layout, \"margin\");\n const border = getEdgeValues(layout, \"border\");\n const padding = getEdgeValues(layout, \"padding\");\n const marginRegion = regions.get(\n \"margin\"\n /* Margin */\n );\n marginRegion.outer.x = -margin.left;\n marginRegion.outer.y = -margin.top;\n marginRegion.outer.width = width + margin.left + margin.right;\n marginRegion.outer.height = height + margin.top + margin.bottom;\n marginRegion.inner.x = 0;\n marginRegion.inner.y = 0;\n marginRegion.inner.width = width;\n marginRegion.inner.height = height;\n const borderRegion = regions.get(\n \"border\"\n /* Border */\n );\n borderRegion.outer.x = 0;\n borderRegion.outer.y = 0;\n borderRegion.outer.width = width;\n borderRegion.outer.height = height;\n borderRegion.inner.x = border.left;\n borderRegion.inner.y = border.top;\n borderRegion.inner.width = width - border.left - border.right;\n borderRegion.inner.height = height - border.top - border.bottom;\n const paddingRegion = regions.get(\n \"padding\"\n /* Padding */\n );\n paddingRegion.outer.copyFrom(borderRegion.inner);\n paddingRegion.inner.x = padding.left + border.left;\n paddingRegion.inner.y = padding.top + border.top;\n paddingRegion.inner.width = width - padding.left - padding.right - border.left - border.right;\n paddingRegion.inner.height = height - padding.top - padding.bottom - border.top - border.bottom;\n calculateFlexRegion(layout, regions);\n}\nfunction calculateFlexRegion(layout, regions) {\n var _a;\n const flexRegion = regions.get(\n \"flex\"\n /* Flex */\n );\n const paddingRegion = regions.get(\n \"padding\"\n /* Padding */\n );\n flexRegion.outer.copyFrom(paddingRegion.inner);\n const bounds = new Bounds();\n const children = layout.yoga.getChildCount();\n for (let i = 0; i < children; i++) {\n const child = layout.yoga.getChild(i);\n const computedBounds = child.getComputedLayout();\n bounds.addRect(\n new Rectangle(computedBounds.left, computedBounds.top, computedBounds.width, computedBounds.height)\n );\n }\n const flexDir = layout.yoga.getFlexDirection();\n if (flexDir === FlexDirection.Column || flexDir === FlexDirection.ColumnReverse) {\n bounds.width = flexRegion.outer.width;\n bounds.x = flexRegion.outer.x;\n } else {\n bounds.height = flexRegion.outer.height;\n bounds.y = flexRegion.outer.y;\n }\n (_a = flexRegion.inner) == null ? void 0 : _a.copyFrom(bounds.rectangle);\n regions.get(\n \"content\"\n /* Content */\n ).outer.copyFrom(bounds.rectangle);\n}\nexport {\n DebugRegionType,\n calculateRegions\n};\n//# sourceMappingURL=calculateDebugRegions.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 { Container, Graphics as Graphics$1 } from \"pixi.js\";\nimport { DebugRegionType } from \"./calculateDebugRegions.mjs\";\nfunction lerpColor(start, end, t) {\n const r = Math.round(start[0] + (end[0] - start[0]) * t);\n const g = Math.round(start[1] + (end[1] - start[1]) * t);\n const b = Math.round(start[2] + (end[2] - start[2]) * t);\n return `rgb(${r},${g},${b})`;\n}\nclass DebugNode extends Container {\n constructor() {\n super();\n /** Graphics objects for each region type */\n __publicField(this, \"graphics\");\n __publicField(this, \"heatGraphics\");\n this.graphics = /* @__PURE__ */ new Map();\n Object.values(DebugRegionType).forEach((type) => {\n const graphics = new Graphics$1();\n this.graphics.set(type, graphics);\n this.addChild(graphics);\n });\n this.heatGraphics = new Graphics$1();\n this.addChild(this.heatGraphics);\n }\n /**\n * Initialize the debug object with region data\n */\n init(regions) {\n const { target, alpha, heat } = regions;\n if (!regions.heatOnly) {\n Object.entries(regions).forEach(([type, region]) => {\n if (type === \"target\" || type === \"alpha\" || type === \"heat\" || type === \"heatOnly\") return;\n region = region;\n const graphics = this.graphics.get(type);\n if (!graphics || !region.draw) return;\n if (region.inner) {\n this.drawCutBox(graphics, region.outer, region.inner, region.color, alpha);\n } else {\n const { x, y, width, height } = region.outer;\n graphics.rect(x, y, width, Math.max(height, 1));\n graphics.fill({ color: region.color, alpha });\n }\n });\n }\n const { invalidationCount, draw } = heat;\n if (invalidationCount > 0 && draw) {\n const MAX_INVALIDATE_COUNT = 20;\n const normalizedAlpha = Math.min(invalidationCount / MAX_INVALIDATE_COUNT, 1);\n const marginRegion = regions[DebugRegionType.Margin];\n const startColor = [255, 255, 0];\n const endColor = [255, 0, 0];\n const color = lerpColor(startColor, endColor, normalizedAlpha);\n this.heatGraphics.rect(\n marginRegion.outer.x,\n marginRegion.outer.y,\n marginRegion.outer.width,\n marginRegion.outer.height\n );\n this.heatGraphics.fill({ color, alpha: Math.min(0.3, normalizedAlpha) });\n this.heatGraphics.stroke({ color, alpha: Math.max(0.3, normalizedAlpha), pixelLine: true });\n }\n this.position.set(target.x, target.y);\n }\n /**\n * Reset the debug object's state\n */\n reset() {\n this.graphics.forEach((graphics) => graphics.clear());\n this.heatGraphics.clear();\n this.removeFromParent();\n }\n /**\n * Draw a box with a cut-out center\n */\n drawCutBox(graphics, outer, inner, color, alpha) {\n const { x, y, width, height } = outer;\n const { x: innerX, y: innerY, width: innerWidth, height: innerHeight } = inner;\n graphics.rect(x, y, width, height);\n graphics.fill({ color, alpha });\n graphics.rect(innerX, innerY, innerWidth, innerHeight);\n graphics.cut();\n }\n}\nexport {\n DebugNode\n};\n//# sourceMappingURL=DebugNode.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 { Container, Rectangle, BigPool } from \"pixi.js\";\nimport { DebugRegionType, calculateRegions } from \"./calculateDebugRegions.mjs\";\nimport { DebugNode } from \"./DebugNode.mjs\";\nclass DebugRenderer {\n constructor() {\n /** Container for all debug visuals */\n __publicField(this, \"holder\", new Container());\n /** Region data for each debug type */\n __publicField(this, \"regions\", /* @__PURE__ */ new Map());\n /** Color configuration for each region type */\n __publicField(this, \"colors\", {\n [DebugRegionType.Margin]: \"#B68655\",\n [DebugRegionType.Padding]: \"#BAC57F\",\n [DebugRegionType.Border]: \"#E7C583\",\n [DebugRegionType.Content]: \"#89B1BE\",\n [DebugRegionType.Flex]: \"#6E28D9\"\n });\n /** Global alpha value for all regions */\n __publicField(this, \"alpha\", 0.75);\n Object.values(DebugRegionType).forEach((type) => {\n this.regions.set(type, {\n outer: new Rectangle(),\n inner: new Rectangle()\n });\n });\n this.holder.__devtoolIgnore = true;\n this.holder.__devtoolIgnoreChildren = true;\n this.holder.eventMode = \"none\";\n this.holder.interactiveChildren = false;\n }\n /**\n * Clean up previous render state\n */\n reset() {\n for (let i = this.holder.children.length - 1; i >= 0; i--) {\n const child = this.holder.children[i];\n BigPool.return(child);\n }\n }\n /**\n * Render debug visuals for the given layout\n */\n render(layout) {\n calculateRegions(layout, this.regions);\n const regionData = Object.values(DebugRegionType).reduce(\n (acc, type) => {\n const region = this.regions.get(type);\n if (!region) return acc;\n const drawString = `debugDraw${type.charAt(0).toUpperCase()}${type.slice(1)}`;\n acc[type] = {\n ...region,\n color: this.colors[type],\n draw: layout._styles.custom[drawString] ?? true\n };\n return acc;\n },\n {}\n );\n const { left, top } = layout.computedLayout;\n const pos = layout.target.getGlobalPosition();\n const debugObject = BigPool.get(DebugNode, {\n ...regionData,\n target: { x: pos.x + left, y: pos.y + top },\n alpha: this.alpha,\n heat: {\n invalidationCount: layout._modificationCount,\n draw: layout._styles.custom.debugHeat !== false\n },\n heatOnly: !layout._styles.custom.debug\n });\n this.holder.addChildAt(debugObject, 0);\n }\n /**\n * Clean up the debug renderer\n */\n destroy() {\n this.reset();\n this.holder.destroy();\n this.regions.clear();\n }\n}\nexport {\n DebugRenderer\n};\n//# sourceMappingURL=DebugRenderer.mjs.map\n"],"names":["DebugRegionType","DebugRegionType2","getEdgeValues","layout","type","method","Edge","calculateRegions","regions","width","height","margin","border","padding","marginRegion","borderRegion","paddingRegion","calculateFlexRegion","_a","flexRegion","bounds","Bounds","children","i","computedBounds","Rectangle","flexDir","FlexDirection","__defProp","__defNormalProp","obj","key","value","__publicField","lerpColor","start","end","t","r","g","b","DebugNode","Container","graphics","Graphics$1","target","alpha","heat","region","x","y","invalidationCount","draw","normalizedAlpha","color","outer","inner","innerX","innerY","innerWidth","innerHeight","DebugRenderer","child","BigPool","regionData","acc","drawString","left","top","pos","debugObject"],"mappings":";;AAEA,IAAIA,IAAmC,kBAACC,OACtCA,EAAiB,SAAY,UAC7BA,EAAiB,UAAa,WAC9BA,EAAiB,SAAY,UAC7BA,EAAiB,OAAU,QAC3BA,EAAiB,UAAa,WACvBA,IACND,KAAmB,CAAA,CAAE;AACxB,SAASE,EAAcC,GAAQC,GAAM;AACnC,QAAMC,IAAS,cAAcD,EAAK,OAAO,CAAC,EAAE,YAAa,IAAGA,EAAK,MAAM,CAAC,CAAC;AACzE,SAAO;AAAA,IACL,KAAKD,EAAO,KAAKE,CAAM,EAAEC,EAAK,GAAG;AAAA,IACjC,OAAOH,EAAO,KAAKE,CAAM,EAAEC,EAAK,KAAK;AAAA,IACrC,QAAQH,EAAO,KAAKE,CAAM,EAAEC,EAAK,MAAM;AAAA,IACvC,MAAMH,EAAO,KAAKE,CAAM,EAAEC,EAAK,IAAI;AAAA,EACpC;AACH;AACA,SAASC,EAAiBJ,GAAQK,GAAS;AACzC,QAAM,EAAE,OAAAC,GAAO,QAAAC,EAAQ,IAAGP,EAAO,gBAC3BQ,IAAST,EAAcC,GAAQ,QAAQ,GACvCS,IAASV,EAAcC,GAAQ,QAAQ,GACvCU,IAAUX,EAAcC,GAAQ,SAAS,GACzCW,IAAeN,EAAQ;AAAA,IAC3B;AAAA;AAAA,EAED;AACD,EAAAM,EAAa,MAAM,IAAI,CAACH,EAAO,MAC/BG,EAAa,MAAM,IAAI,CAACH,EAAO,KAC/BG,EAAa,MAAM,QAAQL,IAAQE,EAAO,OAAOA,EAAO,OACxDG,EAAa,MAAM,SAASJ,IAASC,EAAO,MAAMA,EAAO,QACzDG,EAAa,MAAM,IAAI,GACvBA,EAAa,M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YAAY9D,EAAK,OAAO,CAAC,EAAE,YAAW,CAAE,GAAGA,EAAK,MAAM,CAAC,CAAC;AAC3E,eAAA6D,EAAI7D,CAAI,IAAI;AAAA,UACV,GAAG4C;AAAA,UACH,OAAO,KAAK,OAAO5C,CAAI;AAAA,UACvB,MAAMD,EAAO,QAAQ,OAAO+D,CAAU,KAAK;AAAA,QAC5C,GACMD;AAAA,MACR;AAAA,MACD,CAAA;AAAA,IACD,GACK,EAAE,MAAAE,GAAM,KAAAC,EAAK,IAAGjE,EAAO,gBACvBkE,IAAMlE,EAAO,OAAO,kBAAmB,GACvCmE,IAAcP,EAAQ,IAAItB,GAAW;AAAA,MACzC,GAAGuB;AAAA,MACH,QAAQ,EAAE,GAAGK,EAAI,IAAIF,GAAM,GAAGE,EAAI,IAAID,EAAK;AAAA,MAC3C,OAAO,KAAK;AAAA,MACZ,MAAM;AAAA,QACJ,mBAAmBjE,EAAO;AAAA,QAC1B,MAAMA,EAAO,QAAQ,OAAO,cAAc;AAAA,MAC3C;AAAA,MACD,UAAU,CAACA,EAAO,QAAQ,OAAO;AAAA,IACvC,CAAK;AACD,SAAK,OAAO,WAAWmE,GAAa,CAAC;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA,EAIE,UAAU;AACR,SAAK,MAAO,GACZ,KAAK,OAAO,QAAS,GACrB,KAAK,QAAQ,MAAO;AAAA,EACxB;AACA;","x_google_ignoreList":[0,1,2]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Signal } from '@signe/reactive';
|
|
1
2
|
import { FederatedPointerEvent } from 'pixi.js';
|
|
2
3
|
import { ControlsDirective } from '../directives/Controls';
|
|
3
4
|
import { JoystickControls } from '../directives/JoystickControls';
|
|
@@ -87,6 +88,8 @@ export interface ButtonProps {
|
|
|
87
88
|
background?: Element | any;
|
|
88
89
|
/** Custom children components for button content (takes priority over text if provided) */
|
|
89
90
|
children?: Element[];
|
|
91
|
+
/** Focus index for the button */
|
|
92
|
+
tabindex?: number | Signal<number>;
|
|
90
93
|
}
|
|
91
94
|
/**
|
|
92
95
|
* Creates a Button component with interactive states and customizable styling.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsC,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAMhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;GAEG;AACH,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,eAAe,CAAC,EAAE;QAChB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC;QAC9B,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC;QAC7B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC;QAC/B,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;IACF,2BAA2B;IAC3B,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,mBAAmB;IACnB,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,U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EAAE,OAAO,CAAC;IAClB,oBAAoB;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,GAAG,CAAC;IACtD,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,uFAAuF;IACvF,UAAU,CAAC,EAAE,OAAO,GAAG,GAAG,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,wHA8MxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DOMElement.d.ts","sourceRoot":"","sources":["../../src/components/DOMElement.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoC,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3D,UAAU,iBAAkB,SAAQ,kBAAkB;IACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"DOMElement.d.ts","sourceRoot":"","sources":["../../src/components/DOMElement.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,OAAO,EAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoC,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAA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Y,EAAE,MAAM,IAAI,GACvB,OAAO,CAAC,IAAI,CAAC;CAqBjB;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;CAAI;AAIhE,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,iBAAiB,CAE3D,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { DisplayObjectProps } from './types/DisplayObject';
|
|
|
5
5
|
import { SignalOrPrimitive } from './types';
|
|
6
6
|
|
|
7
7
|
interface GraphicsProps extends DisplayObjectProps {
|
|
8
|
-
draw?: (graphics: PixiGraphics, width: number, height: number) => void;
|
|
8
|
+
draw?: (graphics: PixiGraphics, width: number, height: number, anchor?: [number, number]) => void;
|
|
9
9
|
}
|
|
10
10
|
interface RectProps extends DisplayObjectProps {
|
|
11
11
|
color: SignalOrPrimitive<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graphic.d.ts","sourceRoot":"","sources":["../../src/components/Graphic.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Graphic.d.ts","sourceRoot":"","sources":["../../src/components/Graphic.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAmB,OAAO,EAAqB,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAI5C,UAAU,aAAc,SAAQ,kBAAkB;IAChD,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CACnG;AAED,UAAU,SAAU,SAAQ,kBAAkB;IAC5C,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,UAAU,WAAY,SAAQ,kBAAkB;IAC9C,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,UAAU,YAAa,SAAQ,kBAAkB;IAC/C,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,UAAU,aAAc,SAAQ,kBAAkB;IAChD,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;CAClC;AAED,UAAU,QAAS,SAAQ,kBAAkB;IAC3C,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAsID,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,8BAE5C;AAWD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,8BAqBpC;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,8BAoBxC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,8BAE1C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,8BAmB5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,8BAyBlC"}
|
|
@@ -15,4 +15,5 @@ export { DOMContainer } from './DOMContainer';
|
|
|
15
15
|
export { DOMElement } from './DOMElement';
|
|
16
16
|
export { Button, ButtonState, type ButtonProps, type ButtonStyle } from './Button';
|
|
17
17
|
export { Joystick, type JoystickSettings, type JoystickChangeEvent } from './Joystick';
|
|
18
|
+
export { FocusContainer, type FocusContainerProps } from './FocusContainer';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAClF,OAAO,EAAE,QAAQ,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAClF,OAAO,EAAE,QAAQ,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACtF,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -13,6 +13,13 @@ export type ObjectFit = 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
|
13
13
|
export type ObjectPosition = string;
|
|
14
14
|
export type TransformOrigin = string;
|
|
15
15
|
export type PositionType = 'relative' | 'absolute' | 'static';
|
|
16
|
+
export type ObservablePointSignal = [number, number] | SignalOrPrimitive<[number, number]> | {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
} | SignalOrPrimitive<{
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}>;
|
|
16
23
|
export interface DisplayObjectProps {
|
|
17
24
|
attach?: any;
|
|
18
25
|
ref?: string;
|
|
@@ -46,18 +53,9 @@ export interface DisplayObjectProps {
|
|
|
46
53
|
padding?: EdgeSize;
|
|
47
54
|
border?: EdgeSize;
|
|
48
55
|
absolute?: SignalOrPrimitive<boolean>;
|
|
49
|
-
scale?:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} | number>;
|
|
53
|
-
anchor?: SignalOrPrimitive<{
|
|
54
|
-
x: number;
|
|
55
|
-
y: number;
|
|
56
|
-
}>;
|
|
57
|
-
skew?: SignalOrPrimitive<{
|
|
58
|
-
x: number;
|
|
59
|
-
y: number;
|
|
60
|
-
}>;
|
|
56
|
+
scale?: ObservablePointSignal | number;
|
|
57
|
+
anchor?: ObservablePointSignal;
|
|
58
|
+
skew?: ObservablePointSignal;
|
|
61
59
|
tint?: SignalOrPrimitive<number>;
|
|
62
60
|
rotation?: SignalOrPrimitive<number>;
|
|
63
61
|
angle?: SignalOrPrimitive<number>;
|
|
@@ -65,10 +63,7 @@ export interface DisplayObjectProps {
|
|
|
65
63
|
roundPixels?: SignalOrPrimitive<boolean>;
|
|
66
64
|
cursor?: SignalOrPrimitive<string>;
|
|
67
65
|
visible?: SignalOrPrimitive<boolean>;
|
|
68
|
-
pivot?:
|
|
69
|
-
x: number;
|
|
70
|
-
y: number;
|
|
71
|
-
}>;
|
|
66
|
+
pivot?: ObservablePointSignal;
|
|
72
67
|
filters?: any[];
|
|
73
68
|
blendMode?: SignalOrPrimitive<PIXI.BLEND_MODES>;
|
|
74
69
|
blur?: SignalOrPrimitive<number>;
|
|
@@ -106,5 +101,6 @@ export interface DisplayObjectProps {
|
|
|
106
101
|
touchmove?: PIXI.FederatedEventHandler;
|
|
107
102
|
touchstart?: PIXI.FederatedEventHandler;
|
|
108
103
|
wheel?: PIXI.FederatedEventHandler<PIXI.FederatedWheelEvent>;
|
|
104
|
+
tabindex?: SignalOrPrimitive<number>;
|
|
109
105
|
}
|
|
110
106
|
//# sourceMappingURL=DisplayObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayObject.d.ts","sourceRoot":"","sources":["../../../src/components/types/DisplayObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAChF,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,eAAe,GAAG,cAAc,CAAC;AACrG,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,eAAe,GAAG,cAAc,CAAC;AACnG,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,GAAG,MAAM,GAAG,CAAA;AACxC,MAAM,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AACxF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAC7E,MAAM,MAAM,cAAc,GAAG,MAA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
|
+
import { CanvasFocusContainer } from '../components/FocusContainer';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* FocusNavigation directive for automatic focus navigation via Controls
|
|
7
|
+
*
|
|
8
|
+
* This directive integrates with the Controls system to automatically navigate
|
|
9
|
+
* between focusable elements using keyboard arrows or gamepad input.
|
|
10
|
+
*
|
|
11
|
+
* The directive is automatically applied when a FocusContainer has a `controls` prop.
|
|
12
|
+
* It wraps the existing Controls configuration to add focus navigation behavior.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Automatic navigation with Controls
|
|
17
|
+
* <FocusContainer tabindex={0} controls={controlsConfig}>
|
|
18
|
+
* <Button tabindex={0} text="Button 1" />
|
|
19
|
+
* <Button tabindex={1} text="Button 2" />
|
|
20
|
+
* </FocusContainer>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class FocusNavigationDirective extends Directive {
|
|
24
|
+
private element;
|
|
25
|
+
private controlsDirective;
|
|
26
|
+
private containerId;
|
|
27
|
+
private controlsSubscription;
|
|
28
|
+
private originalControls;
|
|
29
|
+
/**
|
|
30
|
+
* Initialize the focus navigation directive
|
|
31
|
+
*
|
|
32
|
+
* @param element - FocusContainer element
|
|
33
|
+
*/
|
|
34
|
+
onInit(element: Element<CanvasFocusContainer>): void;
|
|
35
|
+
/**
|
|
36
|
+
* Set up navigation controls
|
|
37
|
+
*
|
|
38
|
+
* @param controls - Controls configuration
|
|
39
|
+
*/
|
|
40
|
+
private setupNavigationControls;
|
|
41
|
+
/**
|
|
42
|
+
* Navigate to next or previous focusable element
|
|
43
|
+
*
|
|
44
|
+
* @param direction - Navigation direction
|
|
45
|
+
*/
|
|
46
|
+
private navigate;
|
|
47
|
+
/**
|
|
48
|
+
* Trigger action on currently focused element
|
|
49
|
+
*/
|
|
50
|
+
private triggerAction;
|
|
51
|
+
/**
|
|
52
|
+
* Mount hook
|
|
53
|
+
*
|
|
54
|
+
* @param element - FocusContainer element
|
|
55
|
+
*/
|
|
56
|
+
onMount(element: Element<CanvasFocusContainer>): void;
|
|
57
|
+
/**
|
|
58
|
+
* Update hook
|
|
59
|
+
*
|
|
60
|
+
* @param props - Updated properties
|
|
61
|
+
* @param element - FocusContainer element
|
|
62
|
+
*/
|
|
63
|
+
onUpdate(props: any, element: Element<CanvasFocusContainer>): void;
|
|
64
|
+
/**
|
|
65
|
+
* Destroy hook
|
|
66
|
+
*
|
|
67
|
+
* @param element - FocusContainer element
|
|
68
|
+
*/
|
|
69
|
+
onDestroy(element: Element<CanvasFocusContainer>): void;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=FocusNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusNavigation.d.ts","sourceRoot":"","sources":["../../src/directives/FocusNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAK7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,wBAAyB,SAAQ,SAAS;IACrD,OAAO,CAAC,OAAO,CAA8C;IAC7D,OAAO,CAAC,iBAAiB,CAAkC;IAC3D,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,oBAAoB,CAAa;IACzC,OAAO,CAAC,gBAAgB,CAAyB;IAEjD;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAuB7C;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAsE/B;;;;OAIG;IACH,OAAO,CAAC,QAAQ;IAKhB;;OAEG;IACH,OAAO,CAAC,aAAa;IAiBrB;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC;IA4C9C;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAW3D;;;;OAIG;IACH,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC;CAWjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardControls.d.ts","sourceRoot":"","sources":["../../src/directives/KeyboardControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAElF,oBAAY,KAAK;IACb,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,gBAAgB;IACrB,QAAQ,cAAc;IACtB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,aAAa,mBAAmB;IAChC,KAAK,UAAU;IACf,MAAM,YAAY;IAClB,QAAQ,cAAc;IACtB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,IAAI;IACR,EAAE,IAAI;IACN,KAAK,IAAI;IACT,IAAI,IAAI;IACR,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,WAAW,iBAAiB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,MAAM;IACV,GAAG,MAAM;IACT,GAAG,MAAM;IACT,KAAK,MAAM;IACX,IAAI,MAAM;IACV,IAAI,MAAM;IACV,GAAG,MAAM;IACT,KAAK,MAAM;IACX,MAAM,MAAM;IACZ,IAAI,MAAM;IACV,KAAK,MAAM;IACX,SAAS,gCAAgC;IACzC,QAAQ,MAAM;IACd,MAAM,qBAAqB;IAC3B,IAAI,WAAM;IACV,EAAE,MAAM;IACR,CAAC,MAAM;IACP,CAAC,MAAM;IACP,CAAC,MAAM;IACP,CAAC,MAAM;IACP,CAAC,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C9B,WAAW,iBAAiB;IAC5B,IAAI,MAAM;IACV,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,SAAS,eAAe;IACxB,KAAK,WAAW;IAChB,SAAS,wBAAmB;IAC5B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,WAAW,2BAAsB;IACjC,WAAW,mCAAyB;IACpC,WAAW,iBAAiB;IAC5B,SAAS,eAAe;IACxB,YAAY,2BAAsB;IAClC,WAAW,0BAAqB;IAChC,SAAS,MAAM;IACf,KAAK,UAAU;CAClB;AAGD,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAmLnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAC9C,OAAO,CAAC,QAAQ,CAKV;IACN,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"KeyboardControls.d.ts","sourceRoot":"","sources":["../../src/directives/KeyboardControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAElF,oBAAY,KAAK;IACb,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,gBAAgB;IACrB,QAAQ,cAAc;IACtB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,aAAa,mBAAmB;IAChC,KAAK,UAAU;IACf,MAAM,YAAY;IAClB,QAAQ,cAAc;IACtB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,IAAI;IACR,EAAE,IAAI;IACN,KAAK,IAAI;IACT,IAAI,IAAI;IACR,MAAM,WAA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;OAGG;IACH,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM;IAyBpC,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,WAAW;IAgCnB,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,YAAY;IAepB;;;;;;;;;;;;;;;;;;OAkBG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB7F;;;OAGG;IACH,YAAY;CAKf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportFollow.d.ts","sourceRoot":"","sources":["../../src/directives/ViewportFollow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI7C,MAAM,MAAM,mBAAmB,GAAG;IAC9B,cAAc,CAAC,EAAE,OAAO,GAAG;QACvB,KAAK,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAClC,YAAY,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACtC,CAAC;CACL,CAAA;AAED,qBAAa,cAAe,SAAQ,SAAS;IACzC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAG1C,OAAO,CAAC,OAAO,EAAE,OAAO;IAGxB,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"ViewportFollow.d.ts","sourceRoot":"","sources":["../../src/directives/ViewportFollow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI7C,MAAM,MAAM,mBAAmB,GAAG;IAC9B,cAAc,CAAC,EAAE,OAAO,GAAG;QACvB,KAAK,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAClC,YAAY,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;KACtC,CAAC;CACL,CAAA;AAED,qBAAa,cAAe,SAAQ,SAAS;IACzC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAG1C,OAAO,CAAC,OAAO,EAAE,OAAO;IAGxB,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO;IA2B9C,SAAS,CAAC,OAAO,EAAE,OAAO;CAK7B"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Signal } from '@signe/reactive';
|
|
2
|
+
import { Element } from './reactive';
|
|
3
|
+
import { CanvasViewport } from '../components/Viewport';
|
|
4
|
+
import { SignalOrPrimitive } from '../components/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Options for scroll behavior when navigating to focused elements
|
|
8
|
+
*
|
|
9
|
+
* @property padding - Padding around the element in pixels (default: 0)
|
|
10
|
+
* @property smooth - Enable smooth scrolling animation (default: false)
|
|
11
|
+
* @property center - Center the element in the viewport (default: true)
|
|
12
|
+
* @property duration - Animation duration in ms if smooth=true (default: 300)
|
|
13
|
+
*/
|
|
14
|
+
export interface ScrollOptions {
|
|
15
|
+
padding?: number;
|
|
16
|
+
smooth?: boolean;
|
|
17
|
+
center?: boolean;
|
|
18
|
+
duration?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Data structure for a focus container
|
|
22
|
+
*/
|
|
23
|
+
interface FocusContainerData {
|
|
24
|
+
id: string;
|
|
25
|
+
element?: Element;
|
|
26
|
+
focusables: Map<number, Element>;
|
|
27
|
+
currentIndex: Signal<number | null>;
|
|
28
|
+
focusedElement: Signal<Element | null>;
|
|
29
|
+
onFocusChange?: (index: number, element: Element | null) => void;
|
|
30
|
+
autoScroll?: boolean | ScrollOptions;
|
|
31
|
+
viewport?: CanvasViewport;
|
|
32
|
+
throttle?: number;
|
|
33
|
+
lastNavigateTime?: number;
|
|
34
|
+
tabindex?: SignalOrPrimitive<number>;
|
|
35
|
+
tabindexSubscription?: any;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Central manager for focus navigation system
|
|
39
|
+
*
|
|
40
|
+
* Manages focusable elements within containers, handles navigation,
|
|
41
|
+
* and provides scroll integration with Viewport.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const manager = FocusManager.getInstance();
|
|
46
|
+
* manager.registerContainer('menu', containerData);
|
|
47
|
+
* manager.navigate('menu', 'next');
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class FocusManager {
|
|
51
|
+
private static instance;
|
|
52
|
+
private containers;
|
|
53
|
+
private scrollAnimations;
|
|
54
|
+
/**
|
|
55
|
+
* Get the singleton instance of FocusManager
|
|
56
|
+
*
|
|
57
|
+
* @returns The FocusManager instance
|
|
58
|
+
*/
|
|
59
|
+
static getInstance(): FocusManager;
|
|
60
|
+
/**
|
|
61
|
+
* Register a focus container
|
|
62
|
+
*
|
|
63
|
+
* @param id - Unique identifier for the container
|
|
64
|
+
* @param data - Container data including signals and callbacks
|
|
65
|
+
*/
|
|
66
|
+
registerContainer(id: string, data: Omit<FocusContainerData, 'id'>): void;
|
|
67
|
+
/**
|
|
68
|
+
* Update a focus container's data
|
|
69
|
+
*
|
|
70
|
+
* @param id - Container identifier
|
|
71
|
+
* @param data - Partial container data to update
|
|
72
|
+
*/
|
|
73
|
+
updateContainer(id: string, data: Partial<Omit<FocusContainerData, 'id'>>): void;
|
|
74
|
+
setTabindex(id: string, tabindex: SignalOrPrimitive<number>): void;
|
|
75
|
+
/**
|
|
76
|
+
* Unregister a focus container
|
|
77
|
+
*
|
|
78
|
+
* @param id - Container identifier to remove
|
|
79
|
+
*/
|
|
80
|
+
unregisterContainer(id: string): void;
|
|
81
|
+
/**
|
|
82
|
+
* Register a focusable element in a container
|
|
83
|
+
*
|
|
84
|
+
* @param containerId - Container identifier
|
|
85
|
+
* @param element - Element to register
|
|
86
|
+
* @param index - Focus index for this element
|
|
87
|
+
*/
|
|
88
|
+
registerFocusable(containerId: string, element: Element, index: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* Unregister a focusable element from a container
|
|
91
|
+
*
|
|
92
|
+
* @param containerId - Container identifier
|
|
93
|
+
* @param index - Focus index to remove
|
|
94
|
+
*/
|
|
95
|
+
unregisterFocusable(containerId: string, index: number): void;
|
|
96
|
+
/**
|
|
97
|
+
* Navigate to next or previous focusable element
|
|
98
|
+
*
|
|
99
|
+
* @param containerId - Container identifier
|
|
100
|
+
* @param direction - Navigation direction ('next' or 'previous')
|
|
101
|
+
*/
|
|
102
|
+
navigate(containerId: string, direction: 'next' | 'previous'): void;
|
|
103
|
+
/**
|
|
104
|
+
* Set the focus index for a container
|
|
105
|
+
*
|
|
106
|
+
* @param containerId - Container identifier
|
|
107
|
+
* @param index - Focus index to set
|
|
108
|
+
*/
|
|
109
|
+
setIndex(containerId: string, index: number): void;
|
|
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,MAAM,iBAAiB,CAAC;AAC3D,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,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,UAAU,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IACrC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;I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IAAI;IAM9D;;;;;OAKG;IACH,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI;IAKxE;;;;;OAKG;IACH,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,IAAI;IAK3E;;;;;;OAMG;IACH,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO;IActE;;;;;OAKG;IACH,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAoB3F;;;;;;;OAOG;IACH,eAAe,CACb,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,cAAc,EACzB,OAAO,GAAE,aAAkB,GAC1B,IAAI;IA6DP;;;;;;;;OAQG;IACH,OAAO,CAAC,aAAa;CA+CtB;AAGD,eAAO,MAAM,YAAY,cAA6B,CAAC"}
|
|
@@ -1,15 +1,47 @@
|
|
|
1
1
|
import { Application, ApplicationOptions } from 'pixi.js';
|
|
2
2
|
import { ComponentFunction } from './signal';
|
|
3
3
|
|
|
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
|
+
}
|
|
4
16
|
/**
|
|
5
17
|
* Bootstraps a canvas element and renders it to the DOM.
|
|
6
18
|
*
|
|
7
19
|
* @param rootElement - The HTML element where the canvas will be rendered. Can be null.
|
|
8
20
|
* @param canvas - A Promise that resolves to an Element representing the canvas component.
|
|
21
|
+
* @param options - Optional bootstrap options including ApplicationOptions and component registration configuration.
|
|
9
22
|
* @returns A Promise that resolves to the rendered canvas element.
|
|
10
23
|
* @throws {Error} If the provided element is not a Canvas component.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Default: all components registered automatically
|
|
28
|
+
* await bootstrapCanvas(rootElement, MyComponent, {
|
|
29
|
+
* width: 800,
|
|
30
|
+
* height: 600
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // With mocks for testing
|
|
37
|
+
* import { mockComponents } from '@canvasengine/testing';
|
|
38
|
+
* await bootstrapCanvas(rootElement, MyComponent, {
|
|
39
|
+
* components: mockComponents,
|
|
40
|
+
* autoRegister: false
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
11
43
|
*/
|
|
12
|
-
export declare const bootstrapCanvas: (rootElement: HTMLElement | null, canvas: ComponentFunction<any>, options?:
|
|
44
|
+
export declare const bootstrapCanvas: (rootElement: HTMLElement | null, canvas: ComponentFunction<any>, options?: BootstrapOptions) => Promise<{
|
|
13
45
|
canvasElement: import('./reactive').Element<import('..').ComponentInstance>;
|
|
14
46
|
app: Application<import('pixi.js').Renderer>;
|
|
15
47
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/engine/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAK,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/engine/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC1D,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;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,eAAe,GAAU,aAAa,WAAW,GAAG,IAAI,EAAE,QAAQ,iBAAiB,CAAC,GAAG,CAAC,EAAE,UAAU,gBAAgB;;;EA0ChI,CAAC"}
|
|
@@ -38,6 +38,26 @@ type FlowObservable = Observable<FlowResult>;
|
|
|
38
38
|
export declare const isElement: (value: any) => value is Element;
|
|
39
39
|
export declare const isPrimitive: (value: any) => boolean;
|
|
40
40
|
export declare function registerComponent(name: any, component: any): void;
|
|
41
|
+
/**
|
|
42
|
+
* Registers all default CanvasEngine components.
|
|
43
|
+
*
|
|
44
|
+
* This function imports and registers all core components that are available by default.
|
|
45
|
+
* It's called automatically by bootstrapCanvas() if no custom component configuration is provided.
|
|
46
|
+
*
|
|
47
|
+
* Components register themselves when their modules are imported, so this function ensures
|
|
48
|
+
* all component modules are loaded. Since components call registerComponent() at module load time,
|
|
49
|
+
* importing them will automatically register them synchronously.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* // Register all default components manually
|
|
54
|
+
* registerAllComponents();
|
|
55
|
+
*
|
|
56
|
+
* // Now you can use any component
|
|
57
|
+
* const sprite = createComponent('Sprite', { image: 'hero.png' });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function registerAllComponents(): void;
|
|
41
61
|
/**
|
|
42
62
|
* Checks if an element is currently frozen.
|
|
43
63
|
* An element is frozen when the `freeze` prop is set to `true` (either as a boolean or Signal<boolean>),
|