@pixi-ui-editor/runtime-pixi 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controls.d.ts +17 -1
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +30 -1
- package/dist/controls.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +36 -0
- package/dist/scene.js.map +1 -1
- package/dist/views/ItemTableNodeView.d.ts +57 -0
- package/dist/views/ItemTableNodeView.d.ts.map +1 -0
- package/dist/views/ItemTableNodeView.js +100 -0
- package/dist/views/ItemTableNodeView.js.map +1 -0
- package/dist/views/NodeView.d.ts +14 -0
- package/dist/views/NodeView.d.ts.map +1 -1
- package/dist/views/NodeView.js +18 -1
- package/dist/views/NodeView.js.map +1 -1
- package/dist/views/PaginationNodeView.d.ts +38 -2
- package/dist/views/PaginationNodeView.d.ts.map +1 -1
- package/dist/views/PaginationNodeView.js +85 -28
- package/dist/views/PaginationNodeView.js.map +1 -1
- package/dist/views/createNodeView.d.ts.map +1 -1
- package/dist/views/createNodeView.js +4 -0
- package/dist/views/createNodeView.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationNodeView.js","sourceRoot":"","sources":["../../src/views/PaginationNodeView.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAyB,MAAM,SAAS,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAA6B,MAAM,eAAe,CAAC;AAIpE,MAAM,oBAAoB,GAAwB,EAAE,UAAU,EAAE,OAAO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AI,CAAC;QACxB,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED,iHAAiH;IACzG,OAAO,CAAC,KAAa;QAC3B,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;YAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAAC,CAAC;QACpF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["import { type LayoutPadding, type PaginationNode, type TextStyleDefinition, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { List } from \"@pixi/ui\";\r\nimport { Container, NineSliceSprite, Sprite, Text, Texture, type TextStyleOptions } from \"pixi.js\";\r\nimport { Signal } from \"typed-signals\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\n\r\nexport type { PaginationNode };\r\n\r\nconst DEFAULT_NUMBER_STYLE: TextStyleDefinition = { fontFamily: \"Arial\", fontSize: 18, fontWeight: \"normal\", fontStyle: \"normal\", fill: \"#FFFFFF\", align: \"center\", verticalAlign: \"middle\", wordWrap: false, breakWords: false, letterSpacing: 0 };\r\n\r\n/** Same shape `ValueControlNodeViews.ts`'s own `textStyle` resolves — kept as its own small copy rather\r\n * than shared, the same call ADR 0029 makes for two similar-but-separately-evolving style resolvers. */\r\nfunction numberTextStyle(style: TextStyleDefinition | undefined, fill: string, fonts: ReadonlyMap<string, string> | undefined): Partial<TextStyleOptions> {\r\n const resolved = style ?? DEFAULT_NUMBER_STYLE;\r\n return {\r\n fontFamily: resolved.fontAssetId === undefined ? resolved.fontFamily : fonts?.get(resolved.fontAssetId) ?? resolved.fontFamily,\r\n fontSize: resolved.fontSize,\r\n fontWeight: resolved.fontWeight,\r\n fontStyle: resolved.fontStyle,\r\n fill,\r\n align: resolved.align,\r\n wordWrap: resolved.wordWrap,\r\n breakWords: resolved.breakWords,\r\n lineHeight: resolved.lineHeight,\r\n letterSpacing: resolved.letterSpacing,\r\n stroke: resolved.stroke === undefined ? undefined : { color: resolved.stroke.color, width: resolved.stroke.width },\r\n };\r\n}\r\n\r\n/** Clamps a page index into the valid `[0, pageCount)` range; an empty widget still shows dot 0. */\r\nfunction clampPage(page: number, pageCount: number): number {\r\n return Math.min(Math.max(0, Math.round(page)), Math.max(0, pageCount - 1));\r\n}\r\n\r\n/**\r\n * One `numbers`-style item: a centered page-number label, plus an optional \"pill\" background shown\r\n * only while it is the current page. `width`/`height` are overridden to the authored `dotSize` — the\r\n * same fixed-footprint trick `ScrollItemContainer` uses — so the `List` spaces every item evenly\r\n * whether or not its (rarely-present) background happens to be attached right now.\r\n */\r\nclass NumberItem extends Container {\r\n private itemWidth = 0;\r\n private itemHeight = 0;\r\n private background?: Sprite | NineSliceSprite;\r\n\r\n // Named `numberText`, not `label`: `Container.label` is pixi.js's own display-object name string.\r\n constructor(readonly numberText: Text) {\r\n super();\r\n numberText.anchor.set(0.5);\r\n super.addChild(numberText);\r\n }\r\n\r\n override get width(): number { return this.itemWidth; }\r\n override set width(value: number) { this.itemWidth = value; }\r\n override get height(): number { return this.itemHeight; }\r\n override set height(value: number) { this.itemHeight = value; }\r\n\r\n resize(width: number, height: number): void {\r\n this.itemWidth = width;\r\n this.itemHeight = height;\r\n this.numberText.position.set(width / 2, height / 2);\r\n this.background?.setSize(width, height);\r\n }\r\n\r\n /** Replaces the pill behind the label (destroying the previous one); `undefined` removes it. */\r\n setBackground(view: Sprite | NineSliceSprite | undefined): void {\r\n if (this.background !== undefined) { super.removeChild(this.background); this.background.destroy(); }\r\n this.background = view;\r\n if (view === undefined) return;\r\n view.setSize(this.itemWidth, this.itemHeight);\r\n super.addChildAt(view, 0);\r\n }\r\n}\r\n\r\n/**\r\n * Standalone page indicator: N procedurally generated items arranged by `@pixi/ui`'s `List` (the same\r\n * approach `ScrollViewNodeView`/`scrollView.ts` use for arranging children) — this view never\r\n * reimplements arrangement. Deliberately not wired to any scroll-view: game code owns the actual page\r\n * transition and drives the widget one-way through `setPaginationViewPage`/`setPaginationViewPageCount`,\r\n * the same relationship a slider or progress bar has to whatever value it displays.\r\n *\r\n * `style` picks between two mutually exclusive, differently-rendered item kinds — image dots\r\n * (`Sprite`, two states) or rendered page-number text (`NumberItem`: a label, base style + an optional\r\n * highlight color, plus an optional pill background behind only the current page) — never both.\r\n * Switching `style` rebuilds every item, the same \"view's required *type* changed\" rule\r\n * `StagedButtonNodeView` follows for its state views; `pageCount`/`dotSize` changes do too, since the\r\n * item count/footprint is a runtime fact about this control, not scene topology — it only rebuilds this\r\n * view's own item children, never the owning `NodeView` or the wider scene tree. The active pill itself\r\n * is not structural: switching pages only recreates the (one) background view that needs to move.\r\n */\r\nexport class PaginationNodeView extends NodeView {\r\n private readonly list: List;\r\n private readonly interaction: SceneInteractionMode;\r\n private readonly fonts: ReadonlyMap<string, string> | undefined;\r\n private items: (Sprite | NumberItem)[] = [];\r\n private styleMode: PaginationNode[\"style\"];\r\n private activeTexture: Texture;\r\n private inactiveTexture: Texture;\r\n private numberStyle: TextStyleDefinition | undefined;\r\n private numberActiveColor: string | undefined;\r\n private numberActiveBackgroundTexture: Texture | undefined;\r\n private numberActiveNineSlice: LayoutPadding | undefined;\r\n private pageCountState: number;\r\n private currentPage: number;\r\n private dotWidth: number;\r\n private dotHeight: number;\r\n private clickableState: boolean;\r\n\r\n /** Fires only from a click on an item (when `clickable`); setting `page` programmatically never emits. */\r\n readonly onPageChange = new Signal<(page: number) => void>();\r\n\r\n constructor(node: PaginationNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, fonts: ReadonlyMap<string, string> | undefined) {\r\n super(textures);\r\n this.interaction = interaction;\r\n this.fonts = fonts;\r\n this.styleMode = node.style;\r\n this.activeTexture = node.activeAssetId === undefined ? Texture.WHITE : this.textureFor(node.activeAssetId) ?? Texture.WHITE;\r\n this.inactiveTexture = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;\r\n this.numberStyle = node.numberStyle;\r\n this.numberActiveColor = node.numberActiveColor;\r\n this.numberActiveBackgroundTexture = node.numberActiveBackgroundAssetId === undefined ? undefined : this.textureFor(node.numberActiveBackgroundAssetId);\r\n this.numberActiveNineSlice = node.numberActiveNineSlice;\r\n this.pageCountState = Math.max(1, Math.round(node.pageCount));\r\n this.currentPage = clampPage(node.defaultPage, this.pageCountState);\r\n this.dotWidth = node.dotSize.width;\r\n this.dotHeight = node.dotSize.height;\r\n this.clickableState = node.clickable;\r\n this.list = new List({ type: node.direction, elementsMargin: node.spacing });\r\n this.buildItems();\r\n this.setContent(this.list);\r\n }\r\n\r\n private createBackgroundView(texture: Texture): Sprite | NineSliceSprite {\r\n return this.numberActiveNineSlice === undefined\r\n ? new Sprite(texture)\r\n : new NineSliceSprite({ texture, leftWidth: this.numberActiveNineSlice.left, topHeight: this.numberActiveNineSlice.top, rightWidth: this.numberActiveNineSlice.right, bottomHeight: this.numberActiveNineSlice.bottom });\r\n }\r\n\r\n private createItem(index: number): Sprite | NumberItem {\r\n if (this.styleMode === \"dots\") {\r\n const dot = new Sprite(index === this.currentPage ? this.activeTexture : this.inactiveTexture);\r\n dot.setSize(this.dotWidth, this.dotHeight);\r\n return dot;\r\n }\r\n const isActive = index === this.currentPage;\r\n const baseFill = this.numberStyle?.fill ?? DEFAULT_NUMBER_STYLE.fill;\r\n const fill = isActive ? this.numberActiveColor ?? baseFill : baseFill;\r\n const item = new NumberItem(new Text({ text: String(index + 1), style: numberTextStyle(this.numberStyle, fill, this.fonts) }));\r\n item.resize(this.dotWidth, this.dotHeight);\r\n if (isActive && this.numberActiveBackgroundTexture !== undefined) item.setBackground(this.createBackgroundView(this.numberActiveBackgroundTexture));\r\n return item;\r\n }\r\n\r\n /** Recreates every item for the current `styleMode`/`pageCountState`/`dotWidth`/`dotHeight`. */\r\n private buildItems(): void {\r\n this.list.removeChildren();\r\n this.items = [];\r\n for (let index = 0; index < this.pageCountState; index++) {\r\n const item = this.createItem(index);\r\n this.wireItem(item, index);\r\n this.items.push(item);\r\n this.list.addChild(item);\r\n }\r\n }\r\n\r\n /** Authoring canvas stays inert like every other control; a clickable item is only live at runtime. */\r\n private wireItem(item: Sprite | NumberItem, index: number): void {\r\n if (this.interaction === \"authoring\" || !this.clickableState) { item.eventMode = \"none\"; return; }\r\n item.eventMode = \"static\";\r\n item.cursor = \"pointer\";\r\n item.on(\"pointertap\", () => this.setPage(index));\r\n }\r\n\r\n private applyCurrentPage(): void {\r\n if (this.styleMode === \"dots\") {\r\n this.items.forEach((item, index) => { if (item instanceof Sprite) item.texture = index === this.currentPage ? this.activeTexture : this.inactiveTexture; });\r\n return;\r\n }\r\n const baseFill = this.numberStyle?.fill ?? DEFAULT_NUMBER_STYLE.fill;\r\n this.items.forEach((item, index) => {\r\n if (!(item instanceof NumberItem)) return;\r\n const isActive = index === this.currentPage;\r\n const fill = isActive ? this.numberActiveColor ?? baseFill : baseFill;\r\n item.numberText.style = numberTextStyle(this.numberStyle, fill, this.fonts);\r\n item.setBackground(isActive && this.numberActiveBackgroundTexture !== undefined ? this.createBackgroundView(this.numberActiveBackgroundTexture) : undefined);\r\n });\r\n }\r\n\r\n protected syncContent(node: UINode): void {\r\n if (node.type !== \"pagination\") return;\r\n const active = node.activeAssetId === undefined ? Texture.WHITE : this.textureFor(node.activeAssetId) ?? Texture.WHITE;\r\n const inactive = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;\r\n const pageCount = Math.max(1, Math.round(node.pageCount));\r\n this.clickableState = node.clickable;\r\n\r\n const structureChanged = node.style !== this.styleMode || pageCount !== this.pageCountState || node.dotSize.width !== this.dotWidth || node.dotSize.height !== this.dotHeight;\r\n this.styleMode = node.style;\r\n this.activeTexture = active;\r\n this.inactiveTexture = inactive;\r\n this.numberStyle = node.numberStyle;\r\n this.numberActiveColor = node.numberActiveColor;\r\n this.numberActiveBackgroundTexture = node.numberActiveBackgroundAssetId === undefined ? undefined : this.textureFor(node.numberActiveBackgroundAssetId);\r\n this.numberActiveNineSlice = node.numberActiveNineSlice;\r\n this.pageCountState = pageCount;\r\n this.dotWidth = node.dotSize.width;\r\n this.dotHeight = node.dotSize.height;\r\n this.currentPage = clampPage(this.currentPage, pageCount);\r\n\r\n if (this.list.type !== node.direction) this.list.type = node.direction;\r\n if (this.list.elementsMargin !== node.spacing) this.list.elementsMargin = node.spacing;\r\n\r\n if (structureChanged) this.buildItems();\r\n else this.applyCurrentPage();\r\n }\r\n\r\n get pageCount(): number { return this.pageCountState; }\r\n\r\n /** Structural: rebuilds every item. Used both by document edits and `setPaginationViewPageCount`. */\r\n set pageCount(value: number) {\r\n const next = Math.max(1, Math.round(value));\r\n if (next === this.pageCountState) return;\r\n this.pageCountState = next;\r\n this.currentPage = clampPage(this.currentPage, next);\r\n this.buildItems();\r\n }\r\n\r\n get page(): number { return this.currentPage; }\r\n\r\n /** External sync from game code (or editor preview): highlights an item without emitting `onPageChange`. */\r\n set page(value: number) {\r\n const next = clampPage(value, this.pageCountState);\r\n if (next === this.currentPage) return;\r\n this.currentPage = next;\r\n this.applyCurrentPage();\r\n }\r\n\r\n /** An item click: highlights immediately, then notifies game code — the same order a checkbox/slider follows. */\r\n private setPage(index: number): void {\r\n const next = clampPage(index, this.pageCountState);\r\n if (next !== this.currentPage) { this.currentPage = next; this.applyCurrentPage(); }\r\n this.onPageChange.emit(next);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"PaginationNodeView.js","sourceRoot":"","sources":["../../src/views/PaginationNodeView.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAyB,MAAM,SAAS,CAAC;AACnG,O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AAI,CAAC;QACxB,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED,iHAAiH;IACzG,OAAO,CAAC,KAAa;QAC3B,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;YAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAAC,CAAC;QACpF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["import { type LayoutPadding, type PaginationNode, type TextStyleDefinition, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { List } from \"@pixi/ui\";\r\nimport { Container, NineSliceSprite, Sprite, Text, Texture, type TextStyleOptions } from \"pixi.js\";\r\nimport { Signal } from \"typed-signals\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\n\r\nexport type { PaginationNode };\r\n\r\nconst DEFAULT_NUMBER_STYLE: TextStyleDefinition = { fontFamily: \"Arial\", fontSize: 18, fontWeight: \"normal\", fontStyle: \"normal\", fill: \"#FFFFFF\", align: \"center\", verticalAlign: \"middle\", wordWrap: false, breakWords: false, letterSpacing: 0 };\r\n\r\n/** Same shape `ValueControlNodeViews.ts`'s own `textStyle` resolves — kept as its own small copy rather\r\n * than shared, the same call ADR 0029 makes for two similar-but-separately-evolving style resolvers. */\r\nfunction numberTextStyle(style: TextStyleDefinition | undefined, fill: string, fonts: ReadonlyMap<string, string> | undefined): Partial<TextStyleOptions> {\r\n const resolved = style ?? DEFAULT_NUMBER_STYLE;\r\n return {\r\n fontFamily: resolved.fontAssetId === undefined ? resolved.fontFamily : fonts?.get(resolved.fontAssetId) ?? resolved.fontFamily,\r\n fontSize: resolved.fontSize,\r\n fontWeight: resolved.fontWeight,\r\n fontStyle: resolved.fontStyle,\r\n fill,\r\n align: resolved.align,\r\n wordWrap: resolved.wordWrap,\r\n breakWords: resolved.breakWords,\r\n lineHeight: resolved.lineHeight,\r\n letterSpacing: resolved.letterSpacing,\r\n stroke: resolved.stroke === undefined ? undefined : { color: resolved.stroke.color, width: resolved.stroke.width },\r\n };\r\n}\r\n\r\n/**\r\n * Кнопка-стрелка пагинатора: ровно та часть `ButtonNodeView`/`StagedButtonNodeView`, которая нужна\r\n * виджету, — нажатие и «доступна ли». Тип объявлен структурно, чтобы этот файл не зависел от обоих\r\n * классов кнопок и не решал, какой из них «настоящий».\r\n */\r\nexport type PaginationArrow = { onPress: { connect(handler: () => void): unknown }; enabled: boolean };\r\n\r\n/** Clamps a page index into the valid `[0, pageCount)` range; an empty widget still shows dot 0. */\r\nfunction clampPage(page: number, pageCount: number): number {\r\n return Math.min(Math.max(0, Math.round(page)), Math.max(0, pageCount - 1));\r\n}\r\n\r\n/**\r\n * One `numbers`-style item: a centered page-number label, plus an optional \"pill\" background shown\r\n * only while it is the current page. `width`/`height` are overridden to the authored `dotSize` — the\r\n * same fixed-footprint trick `ScrollItemContainer` uses — so the `List` spaces every item evenly\r\n * whether or not its (rarely-present) background happens to be attached right now.\r\n */\r\nclass NumberItem extends Container {\r\n private itemWidth = 0;\r\n private itemHeight = 0;\r\n private background?: Sprite | NineSliceSprite;\r\n\r\n // Named `numberText`, not `label`: `Container.label` is pixi.js's own display-object name string.\r\n constructor(readonly numberText: Text) {\r\n super();\r\n numberText.anchor.set(0.5);\r\n super.addChild(numberText);\r\n }\r\n\r\n override get width(): number { return this.itemWidth; }\r\n override set width(value: number) { this.itemWidth = value; }\r\n override get height(): number { return this.itemHeight; }\r\n override set height(value: number) { this.itemHeight = value; }\r\n\r\n resize(width: number, height: number): void {\r\n this.itemWidth = width;\r\n this.itemHeight = height;\r\n this.numberText.position.set(width / 2, height / 2);\r\n this.background?.setSize(width, height);\r\n }\r\n\r\n /** Replaces the pill behind the label (destroying the previous one); `undefined` removes it. */\r\n setBackground(view: Sprite | NineSliceSprite | undefined): void {\r\n if (this.background !== undefined) { super.removeChild(this.background); this.background.destroy(); }\r\n this.background = view;\r\n if (view === undefined) return;\r\n view.setSize(this.itemWidth, this.itemHeight);\r\n super.addChildAt(view, 0);\r\n }\r\n}\r\n\r\n/**\r\n * Standalone page indicator: N procedurally generated items arranged by `@pixi/ui`'s `List` (the same\r\n * approach `ScrollViewNodeView`/`scrollView.ts` use for arranging children) — this view never\r\n * reimplements arrangement. Deliberately not wired to any scroll-view: game code owns the actual page\r\n * transition and drives the widget one-way through `setPaginationViewPage`/`setPaginationViewPageCount`,\r\n * the same relationship a slider or progress bar has to whatever value it displays.\r\n *\r\n * `style` picks between two mutually exclusive, differently-rendered item kinds — image dots\r\n * (`Sprite`, two states) or rendered page-number text (`NumberItem`: a label, base style + an optional\r\n * highlight color, plus an optional pill background behind only the current page) — never both.\r\n * Switching `style` rebuilds every item, the same \"view's required *type* changed\" rule\r\n * `StagedButtonNodeView` follows for its state views; `pageCount`/`dotSize` changes do too, since the\r\n * item count/footprint is a runtime fact about this control, not scene topology — it only rebuilds this\r\n * view's own item children, never the owning `NodeView` or the wider scene tree. The active pill itself\r\n * is not structural: switching pages only recreates the (one) background view that needs to move.\r\n *\r\n * With `visiblePageCount` set, the indicator becomes a fixed strip of that many slots with the active\r\n * page always in the middle one (4 pages, page 3 active → 2-3-4). A slot pointing outside the real\r\n * page range keeps its footprint and renders nothing, so the active page never shifts sideways.\r\n *\r\n * The prev/next arrows are ordinary authored button nodes placed wherever the layout needs them; the\r\n * widget only takes their views (`scene.ts`'s `wireNodeReferences`, the same address → view resolution\r\n * Spine connector targets use) and steps the page on press. It never draws an arrow itself.\r\n */\r\nexport class PaginationNodeView extends NodeView {\r\n private readonly list: List;\r\n private readonly interaction: SceneInteractionMode;\r\n private readonly fonts: ReadonlyMap<string, string> | undefined;\r\n private items: (Sprite | NumberItem)[] = [];\r\n private visibleSlots: number | undefined;\r\n private arrows?: { previous?: PaginationArrow; next?: PaginationArrow };\r\n private styleMode: PaginationNode[\"style\"];\r\n private activeTexture: Texture;\r\n private inactiveTexture: Texture;\r\n private numberStyle: TextStyleDefinition | undefined;\r\n private numberActiveColor: string | undefined;\r\n private numberActiveBackgroundTexture: Texture | undefined;\r\n private numberActiveNineSlice: LayoutPadding | undefined;\r\n private pageCountState: number;\r\n private currentPage: number;\r\n private dotWidth: number;\r\n private dotHeight: number;\r\n private clickableState: boolean;\r\n\r\n /** Fires only from a click on an item (when `clickable`); setting `page` programmatically never emits. */\r\n readonly onPageChange = new Signal<(page: number) => void>();\r\n\r\n constructor(node: PaginationNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, fonts: ReadonlyMap<string, string> | undefined) {\r\n super(textures);\r\n this.interaction = interaction;\r\n this.fonts = fonts;\r\n this.styleMode = node.style;\r\n this.activeTexture = node.activeAssetId === undefined ? Texture.WHITE : this.textureFor(node.activeAssetId) ?? Texture.WHITE;\r\n this.inactiveTexture = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;\r\n this.numberStyle = node.numberStyle;\r\n this.numberActiveColor = node.numberActiveColor;\r\n this.numberActiveBackgroundTexture = node.numberActiveBackgroundAssetId === undefined ? undefined : this.textureFor(node.numberActiveBackgroundAssetId);\r\n this.numberActiveNineSlice = node.numberActiveNineSlice;\r\n this.pageCountState = Math.max(1, Math.round(node.pageCount));\r\n this.visibleSlots = node.visiblePageCount;\r\n this.currentPage = clampPage(node.defaultPage, this.pageCount);\r\n this.dotWidth = node.dotSize.width;\r\n this.dotHeight = node.dotSize.height;\r\n this.clickableState = node.clickable;\r\n this.list = new List({ type: node.direction, elementsMargin: node.spacing });\r\n this.buildItems();\r\n this.setContent(this.list);\r\n }\r\n\r\n private createBackgroundView(texture: Texture): Sprite | NineSliceSprite {\r\n return this.numberActiveNineSlice === undefined\r\n ? new Sprite(texture)\r\n : new NineSliceSprite({ texture, leftWidth: this.numberActiveNineSlice.left, topHeight: this.numberActiveNineSlice.top, rightWidth: this.numberActiveNineSlice.right, bottomHeight: this.numberActiveNineSlice.bottom });\r\n }\r\n\r\n /** How many indicator slots are drawn: the fixed authored window, or one slot per real page. */\r\n private get slotCount(): number {\r\n return this.visibleSlots === undefined ? this.pageCount : Math.max(1, Math.round(this.visibleSlots));\r\n }\r\n\r\n /** The page a slot points at. Windowed slots slide with the current page, which keeps its middle seat. */\r\n private pageForSlot(slot: number): number {\r\n return this.visibleSlots === undefined ? slot : this.currentPage - Math.floor(this.slotCount / 2) + slot;\r\n }\r\n\r\n private createItem(slot: number): Sprite | NumberItem {\r\n const page = this.pageForSlot(slot);\r\n const exists = page >= 0 && page < this.pageCount;\r\n const isActive = exists && page === this.currentPage;\r\n if (this.styleMode === \"dots\") {\r\n const dot = new Sprite(isActive ? this.activeTexture : this.inactiveTexture);\r\n dot.setSize(this.dotWidth, this.dotHeight);\r\n // An out-of-range slot renders nothing but keeps its size, so `List` still reserves its place.\r\n dot.visible = exists;\r\n return dot;\r\n }\r\n const baseFill = this.numberStyle?.fill ?? DEFAULT_NUMBER_STYLE.fill;\r\n const fill = isActive ? this.numberActiveColor ?? baseFill : baseFill;\r\n const item = new NumberItem(new Text({ text: exists ? String(page + 1) : \"\", style: numberTextStyle(this.numberStyle, fill, this.fonts) }));\r\n item.resize(this.dotWidth, this.dotHeight);\r\n if (isActive && this.numberActiveBackgroundTexture !== undefined) item.setBackground(this.createBackgroundView(this.numberActiveBackgroundTexture));\r\n return item;\r\n }\r\n\r\n /** Recreates every item for the current `styleMode`/`slotCount`/`dotWidth`/`dotHeight`. */\r\n private buildItems(): void {\r\n this.list.removeChildren();\r\n this.items = [];\r\n for (let slot = 0; slot < this.slotCount; slot++) {\r\n const item = this.createItem(slot);\r\n this.wireItem(item, slot);\r\n this.items.push(item);\r\n this.list.addChild(item);\r\n }\r\n this.applyArrowState();\r\n }\r\n\r\n /** Authoring canvas stays inert like every other control; a clickable item is only live at runtime. */\r\n private wireItem(item: Sprite | NumberItem, slot: number): void {\r\n if (this.interaction === \"authoring\" || !this.clickableState) { item.eventMode = \"none\"; return; }\r\n item.eventMode = \"static\";\r\n item.cursor = \"pointer\";\r\n // Resolved on click, not captured: a windowed slot points at a different page after every move.\r\n item.on(\"pointertap\", () => {\r\n const page = this.pageForSlot(slot);\r\n if (page >= 0 && page < this.pageCount) this.setPage(page);\r\n });\r\n }\r\n\r\n private applyCurrentPage(): void {\r\n const baseFill = this.numberStyle?.fill ?? DEFAULT_NUMBER_STYLE.fill;\r\n this.items.forEach((item, slot) => {\r\n const page = this.pageForSlot(slot);\r\n const exists = page >= 0 && page < this.pageCount;\r\n const isActive = exists && page === this.currentPage;\r\n if (item instanceof NumberItem) {\r\n item.numberText.text = exists ? String(page + 1) : \"\";\r\n item.numberText.style = numberTextStyle(this.numberStyle, isActive ? this.numberActiveColor ?? baseFill : baseFill, this.fonts);\r\n item.setBackground(isActive && this.numberActiveBackgroundTexture !== undefined ? this.createBackgroundView(this.numberActiveBackgroundTexture) : undefined);\r\n return;\r\n }\r\n item.texture = isActive ? this.activeTexture : this.inactiveTexture;\r\n item.setSize(this.dotWidth, this.dotHeight);\r\n item.visible = exists;\r\n });\r\n this.applyArrowState();\r\n }\r\n\r\n /**\r\n * Подключает авторские кнопки-стрелки: нажатие шагает на страницу назад/вперёд и эмитит\r\n * `onPageChange`, как клик по самому пункту. Кнопки остаются обычными нодами сцены — виджет только\r\n * подписывается на них и гасит ту, за которой страниц больше нет.\r\n */\r\n setArrows(arrows: { previous?: PaginationArrow; next?: PaginationArrow }): void {\r\n this.arrows = arrows;\r\n arrows.previous?.onPress.connect(() => this.setPage(this.currentPage - 1));\r\n arrows.next?.onPress.connect(() => this.setPage(this.currentPage + 1));\r\n this.applyArrowState();\r\n }\r\n\r\n /** На краях диапазона соответствующая стрелка недоступна — она никуда не ведёт. */\r\n private applyArrowState(): void {\r\n if (this.arrows === undefined) return;\r\n if (this.arrows.previous !== undefined) this.arrows.previous.enabled = this.currentPage > 0;\r\n if (this.arrows.next !== undefined) this.arrows.next.enabled = this.currentPage < this.pageCount - 1;\r\n }\r\n\r\n protected syncContent(node: UINode): void {\r\n if (node.type !== \"pagination\") return;\r\n const active = node.activeAssetId === undefined ? Texture.WHITE : this.textureFor(node.activeAssetId) ?? Texture.WHITE;\r\n const inactive = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;\r\n const pageCount = Math.max(1, Math.round(node.pageCount));\r\n this.clickableState = node.clickable;\r\n\r\n const previousSlotCount = this.slotCount;\r\n this.visibleSlots = node.visiblePageCount;\r\n this.pageCountState = pageCount;\r\n const structureChanged = node.style !== this.styleMode || this.slotCount !== previousSlotCount || node.dotSize.width !== this.dotWidth || node.dotSize.height !== this.dotHeight;\r\n this.styleMode = node.style;\r\n this.activeTexture = active;\r\n this.inactiveTexture = inactive;\r\n this.numberStyle = node.numberStyle;\r\n this.numberActiveColor = node.numberActiveColor;\r\n this.numberActiveBackgroundTexture = node.numberActiveBackgroundAssetId === undefined ? undefined : this.textureFor(node.numberActiveBackgroundAssetId);\r\n this.numberActiveNineSlice = node.numberActiveNineSlice;\r\n this.dotWidth = node.dotSize.width;\r\n this.dotHeight = node.dotSize.height;\r\n this.currentPage = clampPage(this.currentPage, this.pageCount);\r\n\r\n if (this.list.type !== node.direction) this.list.type = node.direction;\r\n if (this.list.elementsMargin !== node.spacing) this.list.elementsMargin = node.spacing;\r\n\r\n if (structureChanged) this.buildItems();\r\n else this.applyCurrentPage();\r\n }\r\n\r\n get pageCount(): number { return this.pageCountState; }\r\n\r\n /** Used by `setPaginationViewPageCount` once game code knows the real content length. */\r\n set pageCount(value: number) {\r\n const next = Math.max(1, Math.round(value));\r\n if (next === this.pageCountState) return;\r\n const previousSlotCount = this.slotCount;\r\n this.pageCountState = next;\r\n this.currentPage = clampPage(this.currentPage, this.pageCount);\r\n if (this.slotCount === previousSlotCount) this.applyCurrentPage();\r\n else this.buildItems();\r\n }\r\n\r\n get page(): number { return this.currentPage; }\r\n\r\n /** External sync from game code (or editor preview): highlights an item without emitting `onPageChange`. */\r\n set page(value: number) {\r\n const next = clampPage(value, this.pageCountState);\r\n if (next === this.currentPage) return;\r\n this.currentPage = next;\r\n this.applyCurrentPage();\r\n }\r\n\r\n /** An item click: highlights immediately, then notifies game code — the same order a checkbox/slider follows. */\r\n private setPage(index: number): void {\r\n const next = clampPage(index, this.pageCountState);\r\n if (next !== this.currentPage) { this.currentPage = next; this.applyCurrentPage(); }\r\n this.onPageChange.emit(next);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNodeView.d.ts","sourceRoot":"","sources":["../../src/views/createNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,wBAAwB,EAAE,KAAK,mBAAmB,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACtJ,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAa,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAK1D,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"createNodeView.d.ts","sourceRoot":"","sources":["../../src/views/createNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,wBAAwB,EAAE,KAAK,mBAAmB,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACtJ,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAa,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAK1D,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAUpE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,wBAAwB,EAAE,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CA6C5a;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAmE1D"}
|
|
@@ -3,6 +3,7 @@ import { ButtonNodeView } from "./ButtonNodeView.js";
|
|
|
3
3
|
import { CheckboxNodeView } from "./CheckboxNodeView.js";
|
|
4
4
|
import { BitmapTextNodeView, ContainerNodeView, ImageNodeView, LayoutGroupNodeView, MaskNodeView, OpacityGroupNodeView, PrefabInstanceNodeView, TextNodeView } from "./basic.js";
|
|
5
5
|
import { InputNodeView } from "./InputNodeView.js";
|
|
6
|
+
import { ItemTableNodeView } from "./ItemTableNodeView.js";
|
|
6
7
|
import { PageGroupNodeView } from "./PageGroupNodeView.js";
|
|
7
8
|
import { PaginationNodeView } from "./PaginationNodeView.js";
|
|
8
9
|
import { ScrollViewNodeView } from "./ScrollViewNodeView.js";
|
|
@@ -30,6 +31,8 @@ export function createNodeView(node, interaction, textures, spines, hasPrefab, f
|
|
|
30
31
|
return new ScrollViewNodeView(node, textures, interaction);
|
|
31
32
|
case "page-group":
|
|
32
33
|
return new PageGroupNodeView(node, textures);
|
|
34
|
+
case "item-table":
|
|
35
|
+
return new ItemTableNodeView();
|
|
33
36
|
case "image":
|
|
34
37
|
return new ImageNodeView(node.assetId, textures, node.nineSlice);
|
|
35
38
|
case "text":
|
|
@@ -92,6 +95,7 @@ export function collectNodeAssetIds(node) {
|
|
|
92
95
|
case "container":
|
|
93
96
|
case "mask":
|
|
94
97
|
case "opacity-group":
|
|
98
|
+
case "item-table":
|
|
95
99
|
case "prefab-instance":
|
|
96
100
|
return [];
|
|
97
101
|
case "horizontal-layout":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNodeView.js","sourceRoot":"","sources":["../../src/views/createNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAwE,MAAM,wBAAwB,CAAC;AAItJ,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACjL,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;GAG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G,CAAC;QACb,CAAC;QACD,KAAK,QAAQ,EAAE,CAAC;YACd,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAC3E,IAAI,IAAI,CAAC,cAAc,EAAE,WAAW,KAAK,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;YAC9F,OAAO,GAAG,CAAC;QACb,CAAC;QACD,KAAK,cAAc;YACjB,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,KAAK,YAAY;YACf,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAqB,EAAE,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;QACrL,KAAK,kBAAkB;YACrB,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { BUTTON_STATE_KEYS, CHECKBOX_STATE_KEYS, type ParticleEffectDefinition, type SpineReferenceFrame, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { type SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport type { Sound } from \"@pixi/sound\";\r\nimport { Container, Texture, type Ticker } from \"pixi.js\";\r\nimport { ButtonNodeView } from \"./ButtonNodeView.js\";\r\nimport { CheckboxNodeView } from \"./CheckboxNodeView.js\";\r\nimport { BitmapTextNodeView, ContainerNodeView, ImageNodeView, LayoutGroupNodeView, MaskNodeView, OpacityGroupNodeView, PrefabInstanceNodeView, TextNodeView } from \"./basic.js\";\r\nimport { InputNodeView } from \"./InputNodeView.js\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\nimport { PageGroupNodeView } from \"./PageGroupNodeView.js\";\r\nimport { PaginationNodeView } from \"./PaginationNodeView.js\";\r\nimport { ScrollViewNodeView } from \"./ScrollViewNodeView.js\";\r\nimport { SpineNodeView } from \"./SpineNodeView.js\";\r\nimport { StagedButtonNodeView } from \"./StagedButtonNodeView.js\";\r\nimport { ProgressBarNodeView, SliderNodeView } from \"./ValueControlNodeViews.js\";\r\nimport { ParticleEmitterNodeView } from \"./ParticleEmitterNodeView.js\";\r\n\r\n/**\r\n * `hasPrefab` только сообщает, существует ли определение пресета: содержимое инстанса приходит его\r\n * обычными детьми из общего резолвера иерархии, а не отдельной веткой сборки.\r\n */\r\nexport function createNodeView(node: UINode, interaction: SceneInteractionMode, textures?: ReadonlyMap<string, Texture>, spines?: ReadonlyMap<string, SkeletonData>, hasPrefab?: (prefabId: string) => boolean, fonts?: ReadonlyMap<string, string>, sounds?: ReadonlyMap<string, Sound>, effect?: ParticleEffectDefinition, spineReferenceFrame?: SpineReferenceFrame, ticker?: Ticker, bitmapFonts?: ReadonlyMap<string, string>): NodeView {\r\n switch (node.type) {\r\n case \"container\":\r\n return new ContainerNodeView();\r\n case \"mask\":\r\n return new MaskNodeView();\r\n case \"opacity-group\":\r\n return new OpacityGroupNodeView(interaction);\r\n case \"horizontal-layout\":\r\n case \"vertical-layout\":\r\n case \"grid-layout\":\r\n return new LayoutGroupNodeView(textures);\r\n case \"scroll-view\":\r\n return new ScrollViewNodeView(node, textures, interaction);\r\n case \"page-group\":\r\n return new PageGroupNodeView(node, textures);\r\n case \"image\":\r\n return new ImageNodeView(node.assetId, textures, node.nineSlice);\r\n case \"text\":\r\n return new TextNodeView(node.text, fonts);\r\n case \"bitmap-text\":\r\n return new BitmapTextNodeView(bitmapFonts);\r\n case \"spine\":\r\n return new SpineNodeView(spines?.get(node.assetId), node.animation, node.autoplay ?? true, node.loop ?? true, node.animationSpeed ?? 1, interaction === \"authoring\", spineReferenceFrame, ticker);\r\n case \"button\":\r\n return new ButtonNodeView(node, textures, interaction, sounds);\r\n case \"staged-button\":\r\n return new StagedButtonNodeView(node, textures, interaction, sounds);\r\n case \"checkbox\":\r\n return new CheckboxNodeView(node, textures, interaction, sounds);\r\n case \"input\":\r\n return new InputNodeView(node, textures, interaction, fonts);\r\n case \"slider\":\r\n return new SliderNodeView(node, textures, interaction, fonts);\r\n case \"progress-bar\":\r\n return new ProgressBarNodeView(node, textures);\r\n case \"pagination\":\r\n return new PaginationNodeView(node, textures, interaction, fonts);\r\n case \"particle-emitter\":\r\n return effect === undefined ? new ContainerNodeView() : new ParticleEmitterNodeView(effect, textures);\r\n case \"prefab-instance\":\r\n return new PrefabInstanceNodeView(hasPrefab?.(node.prefabId) ?? false);\r\n }\r\n}\r\n\r\n/**\r\n * Every asset a node references: the image, the Spine data, or each of a button's state images.\r\n * Single source of truth for \"which assets does this node use\" — texture loading and the editor's\r\n * usage count both read it, so a new node type can never silently drop out of one of them.\r\n */\r\nexport function collectNodeAssetIds(node: UINode): string[] {\r\n switch (node.type) {\r\n case \"image\":\r\n return node.assetId === undefined ? [] : [node.assetId];\r\n case \"spine\":\r\n return [node.assetId];\r\n case \"button\":\r\n return [\r\n ...BUTTON_STATE_KEYS\r\n .map((state) => node.states[`${state}AssetId`])\r\n .filter((assetId): assetId is string => assetId !== undefined),\r\n ...[node.sounds?.pressAssetId, node.sounds?.hoverAssetId].filter((assetId): assetId is string => assetId !== undefined),\r\n ];\r\n case \"staged-button\":\r\n return [...new Set([\r\n ...node.stages.flatMap((stage) => BUTTON_STATE_KEYS.map((state) => stage.states[`${state}AssetId`])),\r\n node.sounds?.pressAssetId,\r\n node.sounds?.hoverAssetId,\r\n ].filter((assetId): assetId is string => assetId !== undefined))];\r\n case \"checkbox\":\r\n return [\r\n ...CHECKBOX_STATE_KEYS\r\n .map((state) => node.states[`${state}AssetId`])\r\n .filter((assetId): assetId is string => assetId !== undefined),\r\n ...[node.sounds?.checkAssetId, node.sounds?.uncheckAssetId].filter((assetId): assetId is string => assetId !== undefined),\r\n ];\r\n case \"container\":\r\n case \"mask\":\r\n case \"opacity-group\":\r\n case \"prefab-instance\":\r\n return [];\r\n case \"horizontal-layout\":\r\n case \"vertical-layout\":\r\n case \"grid-layout\": {\r\n const backgroundAssetId = node.backgroundAssetId;\r\n return backgroundAssetId === undefined ? [] : [backgroundAssetId];\r\n }\r\n case \"scroll-view\":\r\n case \"page-group\":\r\n return [];\r\n case \"text\":\r\n return [...new Set([\r\n node.style?.fontAssetId,\r\n node.textStyleOverrides?.desktop?.fontAssetId,\r\n node.textStyleOverrides?.mobile?.fontAssetId,\r\n ].filter((assetId): assetId is string => assetId !== undefined))];\r\n case \"bitmap-text\":\r\n return [node.assetId];\r\n case \"input\": {\r\n const ids: string[] = [];\r\n if (node.backgroundAssetId !== undefined) ids.push(node.backgroundAssetId);\r\n if (node.textStyle.fontAssetId !== undefined) ids.push(node.textStyle.fontAssetId);\r\n return ids;\r\n }\r\n case \"slider\": {\r\n const ids = [node.backgroundAssetId, node.fillAssetId, node.handleAssetId];\r\n if (node.valueTextStyle?.fontAssetId !== undefined) ids.push(node.valueTextStyle.fontAssetId);\r\n return ids;\r\n }\r\n case \"progress-bar\":\r\n return [node.backgroundAssetId, node.fillAssetId];\r\n case \"pagination\":\r\n return [node.activeAssetId, node.inactiveAssetId, node.numberStyle?.fontAssetId, node.numberActiveBackgroundAssetId].filter((assetId): assetId is string => assetId !== undefined);\r\n case \"particle-emitter\":\r\n return [];\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"createNodeView.js","sourceRoot":"","sources":["../../src/views/createNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAwE,MAAM,wBAAwB,CAAC;AAItJ,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,EAAE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,EAAqB,EAAE,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;QACrL,KAAK,kBAAkB;YACrB,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { BUTTON_STATE_KEYS, CHECKBOX_STATE_KEYS, type ParticleEffectDefinition, type SpineReferenceFrame, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { type SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport type { Sound } from \"@pixi/sound\";\r\nimport { Container, Texture, type Ticker } from \"pixi.js\";\r\nimport { ButtonNodeView } from \"./ButtonNodeView.js\";\r\nimport { CheckboxNodeView } from \"./CheckboxNodeView.js\";\r\nimport { BitmapTextNodeView, ContainerNodeView, ImageNodeView, LayoutGroupNodeView, MaskNodeView, OpacityGroupNodeView, PrefabInstanceNodeView, TextNodeView } from \"./basic.js\";\r\nimport { InputNodeView } from \"./InputNodeView.js\";\r\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\r\nimport { ItemTableNodeView } from \"./ItemTableNodeView.js\";\r\nimport { PageGroupNodeView } from \"./PageGroupNodeView.js\";\r\nimport { PaginationNodeView } from \"./PaginationNodeView.js\";\r\nimport { ScrollViewNodeView } from \"./ScrollViewNodeView.js\";\r\nimport { SpineNodeView } from \"./SpineNodeView.js\";\r\nimport { StagedButtonNodeView } from \"./StagedButtonNodeView.js\";\r\nimport { ProgressBarNodeView, SliderNodeView } from \"./ValueControlNodeViews.js\";\r\nimport { ParticleEmitterNodeView } from \"./ParticleEmitterNodeView.js\";\r\n\r\n/**\r\n * `hasPrefab` только сообщает, существует ли определение пресета: содержимое инстанса приходит его\r\n * обычными детьми из общего резолвера иерархии, а не отдельной веткой сборки.\r\n */\r\nexport function createNodeView(node: UINode, interaction: SceneInteractionMode, textures?: ReadonlyMap<string, Texture>, spines?: ReadonlyMap<string, SkeletonData>, hasPrefab?: (prefabId: string) => boolean, fonts?: ReadonlyMap<string, string>, sounds?: ReadonlyMap<string, Sound>, effect?: ParticleEffectDefinition, spineReferenceFrame?: SpineReferenceFrame, ticker?: Ticker, bitmapFonts?: ReadonlyMap<string, string>): NodeView {\r\n switch (node.type) {\r\n case \"container\":\r\n return new ContainerNodeView();\r\n case \"mask\":\r\n return new MaskNodeView();\r\n case \"opacity-group\":\r\n return new OpacityGroupNodeView(interaction);\r\n case \"horizontal-layout\":\r\n case \"vertical-layout\":\r\n case \"grid-layout\":\r\n return new LayoutGroupNodeView(textures);\r\n case \"scroll-view\":\r\n return new ScrollViewNodeView(node, textures, interaction);\r\n case \"page-group\":\r\n return new PageGroupNodeView(node, textures);\r\n case \"item-table\":\r\n return new ItemTableNodeView();\r\n case \"image\":\r\n return new ImageNodeView(node.assetId, textures, node.nineSlice);\r\n case \"text\":\r\n return new TextNodeView(node.text, fonts);\r\n case \"bitmap-text\":\r\n return new BitmapTextNodeView(bitmapFonts);\r\n case \"spine\":\r\n return new SpineNodeView(spines?.get(node.assetId), node.animation, node.autoplay ?? true, node.loop ?? true, node.animationSpeed ?? 1, interaction === \"authoring\", spineReferenceFrame, ticker);\r\n case \"button\":\r\n return new ButtonNodeView(node, textures, interaction, sounds);\r\n case \"staged-button\":\r\n return new StagedButtonNodeView(node, textures, interaction, sounds);\r\n case \"checkbox\":\r\n return new CheckboxNodeView(node, textures, interaction, sounds);\r\n case \"input\":\r\n return new InputNodeView(node, textures, interaction, fonts);\r\n case \"slider\":\r\n return new SliderNodeView(node, textures, interaction, fonts);\r\n case \"progress-bar\":\r\n return new ProgressBarNodeView(node, textures);\r\n case \"pagination\":\r\n return new PaginationNodeView(node, textures, interaction, fonts);\r\n case \"particle-emitter\":\r\n return effect === undefined ? new ContainerNodeView() : new ParticleEmitterNodeView(effect, textures);\r\n case \"prefab-instance\":\r\n return new PrefabInstanceNodeView(hasPrefab?.(node.prefabId) ?? false);\r\n }\r\n}\r\n\r\n/**\r\n * Every asset a node references: the image, the Spine data, or each of a button's state images.\r\n * Single source of truth for \"which assets does this node use\" — texture loading and the editor's\r\n * usage count both read it, so a new node type can never silently drop out of one of them.\r\n */\r\nexport function collectNodeAssetIds(node: UINode): string[] {\r\n switch (node.type) {\r\n case \"image\":\r\n return node.assetId === undefined ? [] : [node.assetId];\r\n case \"spine\":\r\n return [node.assetId];\r\n case \"button\":\r\n return [\r\n ...BUTTON_STATE_KEYS\r\n .map((state) => node.states[`${state}AssetId`])\r\n .filter((assetId): assetId is string => assetId !== undefined),\r\n ...[node.sounds?.pressAssetId, node.sounds?.hoverAssetId].filter((assetId): assetId is string => assetId !== undefined),\r\n ];\r\n case \"staged-button\":\r\n return [...new Set([\r\n ...node.stages.flatMap((stage) => BUTTON_STATE_KEYS.map((state) => stage.states[`${state}AssetId`])),\r\n node.sounds?.pressAssetId,\r\n node.sounds?.hoverAssetId,\r\n ].filter((assetId): assetId is string => assetId !== undefined))];\r\n case \"checkbox\":\r\n return [\r\n ...CHECKBOX_STATE_KEYS\r\n .map((state) => node.states[`${state}AssetId`])\r\n .filter((assetId): assetId is string => assetId !== undefined),\r\n ...[node.sounds?.checkAssetId, node.sounds?.uncheckAssetId].filter((assetId): assetId is string => assetId !== undefined),\r\n ];\r\n case \"container\":\r\n case \"mask\":\r\n case \"opacity-group\":\r\n case \"item-table\":\r\n case \"prefab-instance\":\r\n return [];\r\n case \"horizontal-layout\":\r\n case \"vertical-layout\":\r\n case \"grid-layout\": {\r\n const backgroundAssetId = node.backgroundAssetId;\r\n return backgroundAssetId === undefined ? [] : [backgroundAssetId];\r\n }\r\n case \"scroll-view\":\r\n case \"page-group\":\r\n return [];\r\n case \"text\":\r\n return [...new Set([\r\n node.style?.fontAssetId,\r\n node.textStyleOverrides?.desktop?.fontAssetId,\r\n node.textStyleOverrides?.mobile?.fontAssetId,\r\n ].filter((assetId): assetId is string => assetId !== undefined))];\r\n case \"bitmap-text\":\r\n return [node.assetId];\r\n case \"input\": {\r\n const ids: string[] = [];\r\n if (node.backgroundAssetId !== undefined) ids.push(node.backgroundAssetId);\r\n if (node.textStyle.fontAssetId !== undefined) ids.push(node.textStyle.fontAssetId);\r\n return ids;\r\n }\r\n case \"slider\": {\r\n const ids = [node.backgroundAssetId, node.fillAssetId, node.handleAssetId];\r\n if (node.valueTextStyle?.fontAssetId !== undefined) ids.push(node.valueTextStyle.fontAssetId);\r\n return ids;\r\n }\r\n case \"progress-bar\":\r\n return [node.backgroundAssetId, node.fillAssetId];\r\n case \"pagination\":\r\n return [node.activeAssetId, node.inactiveAssetId, node.numberStyle?.fontAssetId, node.numberActiveBackgroundAssetId].filter((assetId): assetId is string => assetId !== undefined);\r\n case \"particle-emitter\":\r\n return [];\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixi-ui-editor/runtime-pixi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "PixiJS runtime that renders Pixi UI Editor scene documents in a game.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"pixi.js": "^8.19.0",
|
|
31
31
|
"typed-signals": "^2.5.0",
|
|
32
32
|
"yoga-layout": "^3.2.1",
|
|
33
|
-
"@pixi-ui-editor/schema": "0.
|
|
33
|
+
"@pixi-ui-editor/schema": "0.9.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^26.2.0"
|