@pixi-ui-editor/runtime-pixi 0.18.0 → 0.20.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/scene.d.ts.map +1 -1
- package/dist/scene.js +6 -3
- package/dist/scene.js.map +1 -1
- package/dist/views/PaginationNodeView.d.ts +24 -23
- package/dist/views/PaginationNodeView.d.ts.map +1 -1
- package/dist/views/PaginationNodeView.js +32 -66
- package/dist/views/PaginationNodeView.js.map +1 -1
- package/dist/views/SpineNodeView.d.ts.map +1 -1
- package/dist/views/SpineNodeView.js +2 -0
- package/dist/views/SpineNodeView.js.map +1 -1
- package/dist/views/createNodeView.js +1 -1
- package/dist/views/createNodeView.js.map +1 -1
- package/package.json +2 -2
package/dist/scene.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../src/scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAsG,KAAK,gBAAgB,EAA2B,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,KAAK,KAAK,EAAE,KAAK,mBAAmB,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3R,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAA2F,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACvI,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAe1E,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAo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AA;CAAE,GAC/J,OAAO,CAAC,eAAe,CAAC,CAY1B"}
|
package/dist/scene.js
CHANGED
|
@@ -237,7 +237,8 @@ function wireSpineConnectors(nodes, nodeViews) {
|
|
|
237
237
|
* следующая не завела собственный обход с чуть другой областью видимости.
|
|
238
238
|
*
|
|
239
239
|
* Стрелки подключаются только в runtime-сцене: на authoring-канвасе контрол инертен, как и клик по
|
|
240
|
-
* самой точке пагинатора. Вместимость
|
|
240
|
+
* самой точке пагинатора. Вместимость таблицы и видимость ноды-фона активной страницы пагинатора,
|
|
241
|
+
* наоборот, видны и в редакторе — это не интерактивность.
|
|
241
242
|
*/
|
|
242
243
|
function wireNodeReferences(nodes, nodeViews, interaction) {
|
|
243
244
|
const arrowView = (nodeId) => {
|
|
@@ -249,8 +250,10 @@ function wireNodeReferences(nodes, nodeViews, interaction) {
|
|
|
249
250
|
if (node.type === "item-table" && view instanceof ItemTableNodeView) {
|
|
250
251
|
view.setItems((node.items ?? []).map((itemId) => nodeViews.get(itemId)));
|
|
251
252
|
}
|
|
252
|
-
else if (node.type === "pagination" && view instanceof PaginationNodeView
|
|
253
|
-
|
|
253
|
+
else if (node.type === "pagination" && view instanceof PaginationNodeView) {
|
|
254
|
+
if (interaction === "runtime")
|
|
255
|
+
view.setArrows({ previous: arrowView(node.prevButtonNodeId), next: arrowView(node.nextButtonNodeId) });
|
|
256
|
+
view.setActiveBackground(node.activeBackgroundNodeId === undefined ? undefined : nodeViews.get(node.activeBackgroundNodeId));
|
|
254
257
|
}
|
|
255
258
|
else if (node.type === "page-group" && view instanceof PageGroupNodeView && interaction === "runtime") {
|
|
256
259
|
view.setArrows({ up: arrowView(node.pageUpButtonNodeId), down: arrowView(node.pageDownButtonNodeId) });
|
package/dist/scene.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene.js","sourceRoot":"","sources":["../src/scene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB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C5E,CAAC,CAAC;IACH,OAAO,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;AACpO,CAAC","sourcesContent":["import { type SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport { createStableId, isLayoutGroup, isParticleEffect, resolveLayoutGroupSettings, resolveOwnerNodeGraph, type EffectDefinition, type GridLayoutSettings, type LayoutProfileId, type ProjectDocument, type Scene, type SpineReferenceFrame, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container, Texture, type Ticker } from \"pixi.js\";\r\nimport { loadSceneSpines } from \"./assets/spine.js\";\r\nimport { loadSceneTextures, type FileUrlResolver } from \"./assets/textures.js\";\r\nimport { loadSceneFonts } from \"./assets/fonts.js\";\r\nimport { loadSceneBitmapFonts } from \"./assets/bitmapFonts.js\";\r\nimport type { SceneAssetCache } from \"./assets/cache.js\";\r\nimport { getCanvasLogicalSize, getCanvasScale, resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"./layout.js\";\r\nimport { NodeView, type SceneInteractionMode } from \"./views/NodeView.js\";\r\nimport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\r\nimport { createNodeView } from \"./views/createNodeView.js\";\r\nimport { applyLayoutGroup, applyLayoutItem, createGridLineBreak, initializePixiLayout, LayoutItemContainer } from \"./layoutGroups.js\";\r\nimport { LayoutGroupNodeView } from \"./views/basic.js\";\r\nimport { PageItemContainer } from \"./pageGroup.js\";\r\nimport { PageGroupNodeView } from \"./views/PageGroupNodeView.js\";\r\nimport { PaginationNodeView, type PaginationArrow } from \"./views/PaginationNodeView.js\";\r\nimport { ItemTableNodeView } from \"./views/ItemTableNodeView.js\";\r\nimport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\r\nimport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\r\nimport { ScrollItemContainer } from \"./scrollView.js\";\r\nimport { ScrollViewNodeView } from \"./views/ScrollViewNodeView.js\";\r\nimport { SpineNodeView } from \"./views/SpineNodeView.js\";\r\nimport { ParticleEmitterNodeView } from \"./views/ParticleEmitterNodeView.js\";\r\nimport { SceneLocalization, type SceneLocalizationOptions } from \"./localization.js\";\r\nimport { SceneViewport } from \"./SceneViewport.js\";\r\nimport { createSceneAudio, type AudioBus } from \"./audio/bus.js\";\r\n\r\nexport type BuildSceneViewOptions = {\r\n /** Explicit: an editor canvas must pass \"authoring\", Preview and the consuming app \"runtime\". */\r\n interaction: SceneInteractionMode;\r\n textures?: ReadonlyMap<string, Texture>;\r\n spines?: ReadonlyMap<string, SkeletonData>;\r\n fonts?: ReadonlyMap<string, string>;\r\n bitmapFonts?: ReadonlyMap<string, string>;\r\n /**\r\n * Шина звуковых событий (обычно `createRuntimeAudio(...)`). Без неё сцена не публикует звуковые\r\n * события вовсе — ровно так строится инертный authoring-канвас редактора.\r\n */\r\n audio?: AudioBus;\r\n /**\r\n * The host's own Application ticker, driving self-updating content such as Spine skeletons.\r\n * Without it they fall back to `Ticker.shared`, which runs a second rAF loop independent of the\r\n * renderer that draws them — see the same rule as `updateParticleEmitters`.\r\n */\r\n ticker?: Ticker;\r\n /** Called after Yoga changes a managed rectangle; authoring hosts use it to refresh overlays. */\r\n onLayout?: () => void;\r\n /**\r\n * Начальное состояние локализации. Опция необязательна: при наличии `Text.textKey` base locale\r\n * каталога применяется и без неё, а документ без ключей выглядит ровно как раньше.\r\n */\r\n localization?: SceneLocalizationOptions;\r\n /** Internal host boundary override: prefab views are spawnable content, not screen viewports. */\r\n clipToViewport?: boolean;\r\n};\r\n\r\nexport type SceneViewResult = { root: SceneViewport; nodeViews: Map<string, Container>; localization: SceneLocalization; readonly profile: LayoutProfileId };\nconst particleEmitterRegistry = new WeakMap<Container, readonly ParticleEmitterNodeView[]>();\r\n\r\nfunction spineReferenceFrameFor(document: ProjectDocument, node: UINode): SpineReferenceFrame | undefined {\r\n if (node.type !== \"spine\") return undefined;\r\n const asset = document.assets.find((candidate) => candidate.id === node.assetId);\r\n return asset?.type === \"spine\" ? asset.referenceFrame : undefined;\r\n}\r\n\r\n/** Builds a PixiJS display tree for a scene without depending on DOM or editor state. */\r\nexport function buildSceneView(\r\n document: ProjectDocument,\r\n sceneId: string,\r\n profile: LayoutProfileId,\r\n options: BuildSceneViewOptions,\r\n): SceneViewResult {\r\n initializePixiLayout();\r\n const { interaction, textures, spines, fonts, bitmapFonts, ticker, onLayout } = options;\r\n const scene = document.scenes.find((candidate) => candidate.id === sceneId);\r\n\r\n if (scene === undefined) {\r\n throw new Error(`Scene '${sceneId}' does not exist in the project document.`);\r\n }\r\n\r\n const nodeViews = new Map<string, Container>();\r\n const particleEmitters: ParticleEmitterNodeView[] = [];\r\n // Резолв «id ассета → имя звука» живёт здесь: вьюхи знают только id, а документ — только эта функция.\r\n const sceneAudio = options.audio === undefined ? undefined : createSceneAudio(document, options.audio);\r\n\r\n // Materialized prefab children use instance-scoped IDs, so authoring and runtime can address\r\n // multiple instances independently without changing canonical definition IDs.\r\n const screenSize = scene.layout.referenceViewports[profile];\r\n const referenceResolution = scene.layout.preferredViewports[profile];\r\n const canvasScale = getCanvasScale(screenSize, referenceResolution);\r\n const canvasSize = getCanvasLogicalSize(screenSize, referenceResolution);\r\n\r\n // Единый резолвер иерархии: тот же граф, что видит редактор, включая вложенные пресеты.\r\n const owner = resolveOwnerNodeGraph(document, scene);\r\n const prefabIds = new Set(document.prefabs.map((prefab) => prefab.id));\r\n\r\n const buildOwner = (rootSize: LayoutSize): Container => {\r\n const nodesById = new Map(owner.nodes.map((node) => [node.id, node]));\r\n\r\n const buildNode = (nodeId: string, parentSize: LayoutSize): NodeView => {\r\n const node = nodesById.get(nodeId);\r\n\r\n if (node === undefined) {\r\n throw new Error(`Scene '${sceneId}' references missing node '${nodeId}'.`);\r\n }\r\n\r\n const resolved = resolveProfileTransform(node, profile);\r\n const transform = resolveAnchoredTransform(resolved.transform, parentSize);\r\n const view = createNodeView(node, interaction, textures, spines, (prefabId) => prefabIds.has(prefabId), fonts, sceneAudio, node.type === \"particle-emitter\" ? document.effects.find((effect) => effect.id === node.effectId && isParticleEffect(effect)) : undefined, spineReferenceFrameFor(document, node), ticker, bitmapFonts);\r\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, parentSize);\r\n // Yoga owns only the group's inner layoutContent; the outer NodeView keeps authored transform.\r\n view.update(node, profile, parentSize);\r\n nodeViews.set(node.id, view);\r\n if (view instanceof ParticleEmitterNodeView) particleEmitters.push(view);\r\n\r\n // Прямые дети корня сцены разрешают якоря относительно логического Canvas, а не размера корня.\r\n // Прямой ребёнок grid-layout (сам `node` здесь) не владеет своим отрисованным размером: Unity-подобная\r\n // фиксированная ячейка полностью переопределяет authored transform (см. applyLayoutItem). Его\r\n // собственным потомкам нужен именно cellWidth/cellHeight, а не anchor-resolved authored-размер —\r\n // иначе они не отслеживают изменение Cell width/height и якорятся относительно устаревшего размера.\r\n const gridParent = node.parentId === null ? undefined : nodesById.get(node.parentId);\r\n const gridCell = gridParent?.type === \"grid-layout\" ? resolveLayoutGroupSettings<GridLayoutSettings>(gridParent, profile) : undefined;\r\n // Та же логика для прямого ребёнка page-group (страницы): `PageItemContainer`/`updateManaged`\r\n // растягивают её на весь resolved rectangle группы независимо от собственных anchors ноды\r\n // (см. NodeView.applyResolvedTransform, managedByLayout). Здесь `node` — сама страница, поэтому\r\n // это переопределённый размер, который она фактически получит, — `parentSize`, уже разрешённый\r\n // как rectangle page-group. Без этой ветки дети страницы якорились бы относительно её\r\n // anchor-resolved authored-размера, который может расходиться с фактическим rectangle группы,\r\n // особенно в другом layout-профиле.\r\n const childSize = node.parentId === null\r\n ? rootSize\r\n : gridCell !== undefined\r\n ? { width: gridCell.cellWidth, height: gridCell.cellHeight }\r\n : gridParent?.type === \"page-group\"\r\n ? parentSize\r\n : { width: transform.width, height: transform.height };\r\n for (const [childIndex, childId] of node.children.entries()) {\r\n const childNode = nodesById.get(childId);\r\n const childView = buildNode(childId, childSize);\r\n if (isLayoutGroup(node) && childNode !== undefined && view instanceof LayoutGroupNodeView) {\r\n const layoutItem = new LayoutItemContainer(childView, onLayout);\r\n applyLayoutItem(layoutItem, childNode, node, profile);\r\n view.addLayoutChild(layoutItem);\r\n } else if (node.type === \"scroll-view\" && childNode !== undefined && view instanceof ScrollViewNodeView) {\r\n const scrollItem = new ScrollItemContainer(childView, onLayout);\r\n // Как и у layout-item: собственный (не растянутый якорями) размер ребёнка — List не\r\n // предоставляет per-item override размера, в отличие от Yoga flexGrow/cellSize.\r\n const own = resolveProfileTransform(childNode, profile).transform;\r\n scrollItem.sync(childNode, profile, { width: own.width, height: own.height });\r\n view.addScrollItem(scrollItem);\r\n } else if (node.type === \"page-group\" && childNode !== undefined && view instanceof PageGroupNodeView) {\r\n // Unlike a scroll-view item, a page fills the group's own resolved rect completely\r\n // (`childSize`, computed above): a page is a full sub-screen, not content sized to itself.\r\n const pageItem = new PageItemContainer(childView);\r\n pageItem.sync(childNode, profile, childSize);\r\n view.addPageItem(pageItem);\r\n } else {\r\n view.addChild(childView);\r\n }\r\n if (node.type === \"grid-layout\") {\r\n const settings = node.layoutGroup.overrides?.[profile] === undefined ? node.layoutGroup.base : { ...node.layoutGroup.base, ...node.layoutGroup.overrides[profile] };\r\n if (settings.constraint !== \"flexible\" && settings.constraintCount !== undefined && (childIndex + 1) % settings.constraintCount === 0 && childIndex + 1 < node.children.length) {\r\n const lineBreak = createGridLineBreak(node, profile);\r\n if (lineBreak !== undefined && view instanceof LayoutGroupNodeView) view.addLayoutChild(lineBreak);\r\n }\r\n }\r\n }\r\n\r\n return view;\r\n };\r\n\r\n const ownerRoot = new Container();\r\n for (const rootNodeId of owner.rootNodeIds) {\r\n ownerRoot.addChild(buildNode(rootNodeId, rootSize));\r\n }\r\n\r\n return ownerRoot;\r\n };\r\n\r\n const canvasRoot = buildOwner(canvasSize);\r\n canvasRoot.scale.set(canvasScale);\r\n const hostRoot = new SceneViewport(canvasRoot, screenSize, options.clipToViewport ?? interaction === \"runtime\");\r\n particleEmitterRegistry.set(hostRoot, particleEmitters);\r\n // Контроллер применяет переводы сразу к уже созданным views, поэтому keyed Text показывает\r\n // базовую локаль без единого дополнительного вызова со стороны хоста.\r\n const localization = new SceneLocalization(document, scene, nodeViews, options.localization);\r\n wireCheckboxGroups(owner.nodes, nodeViews);\r\n wireSpineConnectors(owner.nodes, nodeViews);\r\n wireNodeReferences(owner.nodes, nodeViews, interaction);\r\n return { root: hostRoot, nodeViews, localization, profile };\n}\n\nconst GRID_LINE_BREAK_LABEL = \"__layout-grid-line-break__\";\n\n/** Recreates only technical Yoga line breaks while retaining every authored NodeView and wrapper. */\nfunction syncGridLineBreaks(view: LayoutGroupNodeView, node: Extract<UINode, { type: \"grid-layout\" }>, profile: LayoutProfileId, nodesById: ReadonlyMap<string, UINode>, nodeViews: ReadonlyMap<string, Container>): void {\n for (const child of [...view.layoutTarget.children]) {\n if (child.label === GRID_LINE_BREAK_LABEL) child.destroy();\n }\n const settings = resolveLayoutGroupSettings<GridLayoutSettings>(node, profile);\n for (const [childIndex, childId] of node.children.entries()) {\n const childNode = nodesById.get(childId);\n const childView = nodeViews.get(childId);\n if (childNode !== undefined && childView instanceof NodeView && childView.parent instanceof LayoutItemContainer) {\n view.addLayoutChild(childView.parent);\n }\n if (settings.constraint !== \"flexible\" && settings.constraintCount !== undefined && (childIndex + 1) % settings.constraintCount === 0 && childIndex + 1 < node.children.length) {\n const lineBreak = createGridLineBreak(node, profile);\n if (lineBreak !== undefined) view.addLayoutChild(lineBreak);\n }\n }\n}\n\n/**\n * Applies another layout profile to an already-built scene without loading assets or replacing views.\n * Runtime-only state owned by the views (button state, page, capacity overrides, scroll position) is\n * retained. Reapplying the live profile is an observable no-op.\n */\nexport function applyProfile(view: SceneViewResult, document: ProjectDocument, sceneId: string, profile: LayoutProfileId): void {\n if (view.profile === profile) return;\n const scene = document.scenes.find((candidate) => candidate.id === sceneId);\n if (scene === undefined) throw new Error(`Scene '${sceneId}' does not exist in the project document.`);\n\n const owner = resolveOwnerNodeGraph(document, scene);\n const nodesById = new Map(owner.nodes.map((node) => [node.id, node]));\n const activeSpines = [...view.nodeViews.values()].filter((candidate): candidate is SpineNodeView => candidate instanceof SpineNodeView && candidate.activeConnectorBones);\n for (const spine of activeSpines) spine.activeConnectorBones = false;\n\n const screenSize = scene.layout.referenceViewports[profile];\n const referenceResolution = scene.layout.preferredViewports[profile];\n const canvasSize = getCanvasLogicalSize(screenSize, referenceResolution);\n\n const updateNode = (nodeId: string, parentSize: LayoutSize): void => {\n const node = nodesById.get(nodeId);\n const nodeView = view.nodeViews.get(nodeId);\n if (node === undefined || nodeView === undefined) return;\n const parentNode = node.parentId === null ? undefined : nodesById.get(node.parentId);\n updateNodeView(nodeView, node, profile, parentSize, parentNode, node.type === \"particle-emitter\" ? document.effects.find((effect) => effect.id === node.effectId) : undefined, spineReferenceFrameFor(document, node));\n\n const transform = resolveAnchoredTransform(resolveProfileTransform(node, profile).transform, parentSize);\n const gridCell = parentNode?.type === \"grid-layout\" ? resolveLayoutGroupSettings<GridLayoutSettings>(parentNode, profile) : undefined;\n const childSize = node.parentId === null\n ? canvasSize\n : gridCell !== undefined\n ? { width: gridCell.cellWidth, height: gridCell.cellHeight }\n : parentNode?.type === \"page-group\"\n ? parentSize\n : { width: transform.width, height: transform.height };\n for (const childId of node.children) updateNode(childId, childSize);\n if (node.type === \"grid-layout\" && nodeView instanceof LayoutGroupNodeView) syncGridLineBreaks(nodeView, node, profile, nodesById, view.nodeViews);\n };\n\n try {\n for (const rootNodeId of owner.rootNodeIds) updateNode(rootNodeId, canvasSize);\n view.root.content.scale.set(getCanvasScale(screenSize, referenceResolution));\n view.root.setReferenceViewport(screenSize);\n (view as { profile: LayoutProfileId }).profile = profile;\n } finally {\n for (const spine of activeSpines) spine.activeConnectorBones = true;\n }\n}\n\r\nfunction wireSpineConnectors(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>): void {\r\n for (const node of nodes) {\r\n if (node.type !== \"spine\") continue;\r\n const view = nodeViews.get(node.id);\r\n if (!(view instanceof SpineNodeView)) continue;\r\n view.setConnectorBones((node.connectors ?? []).flatMap((connector) => {\r\n const target = nodeViews.get(connector.targetNodeId);\r\n return target === undefined ? [] : [{ ...connector, target }];\r\n }));\r\n }\r\n}\r\n\r\n/**\r\n * Разрешает все ссылки «нода → нода» в живые views: элементы item table и кнопки-стрелки пагинатора.\r\n * Та же форма, что у `wireSpineConnectors`: документ хранит id, а во что он превратился, знает только\r\n * собранная сцена, поэтому сами виды никогда не резолвят id. Один проход на все виды ссылок, чтобы\r\n * следующая не завела собственный обход с чуть другой областью видимости.\r\n *\r\n * Стрелки подключаются только в runtime-сцене: на authoring-канвасе контрол инертен, как и клик по\r\n * самой точке пагинатора. Вместимость таблицы, наоборот, видна и в редакторе — это не интерактивность.\r\n */\r\nfunction wireNodeReferences(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>, interaction: SceneInteractionMode): void {\r\n const arrowView = (nodeId: string | undefined): PaginationArrow | undefined => {\r\n const view = nodeId === undefined ? undefined : nodeViews.get(nodeId);\r\n return view instanceof ButtonNodeView || view instanceof StagedButtonNodeView ? view : undefined;\r\n };\r\n for (const node of nodes) {\r\n const view = nodeViews.get(node.id);\r\n if (node.type === \"item-table\" && view instanceof ItemTableNodeView) {\r\n view.setItems((node.items ?? []).map((itemId) => nodeViews.get(itemId)));\r\n } else if (node.type === \"pagination\" && view instanceof PaginationNodeView && interaction === \"runtime\") {\r\n view.setArrows({ previous: arrowView(node.prevButtonNodeId), next: arrowView(node.nextButtonNodeId) });\r\n } else if (node.type === \"page-group\" && view instanceof PageGroupNodeView && interaction === \"runtime\") {\r\n view.setArrows({ up: arrowView(node.pageUpButtonNodeId), down: arrowView(node.pageDownButtonNodeId) });\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Authored `group` gives sibling checkboxes radio-button behavior: checking one force-unchecks its\r\n * live group-mates (same `parentId`, same `group`), without touching the document. Runs once per\r\n * scene build; `CheckboxNodeView.forceCheck` never re-emits `onCheck`, so this can't recurse.\r\n */\r\nfunction wireCheckboxGroups(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>): void {\r\n const byGroup = new Map<string, CheckboxNodeView[]>();\r\n for (const node of nodes) {\r\n if (node.type !== \"checkbox\" || node.group === undefined) continue;\r\n const view = nodeViews.get(node.id);\r\n if (!(view instanceof CheckboxNodeView)) continue;\r\n const key = `${node.parentId ?? \"\"}::${node.group}`;\r\n const group = byGroup.get(key) ?? [];\r\n group.push(view);\r\n byGroup.set(key, group);\r\n }\r\n for (const group of byGroup.values()) {\r\n if (group.length < 2) continue;\r\n for (const view of group) {\r\n view.onCheck.connect((checked) => {\r\n if (!checked) return;\r\n for (const other of group) if (other !== view) other.forceCheck(false);\r\n });\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies a node's resolved transform, visibility, and content to an existing display object,\r\n * so editors can update views in place without rebuilding the scene tree.\r\n */\r\nexport function updateNodeView(view: Container, node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize, parentNode?: UINode, effect?: EffectDefinition, spineReferenceFrame?: SpineReferenceFrame): void {\r\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, parentSize);\r\n if (!(view instanceof NodeView)) return;\r\n if (view instanceof SpineNodeView) view.setReferenceFrame(spineReferenceFrame);\r\n if (node.type === \"particle-emitter\" && effect !== undefined && isParticleEffect(effect) && \"syncEffect\" in view && typeof (view as { syncEffect?: unknown }).syncEffect === \"function\") (view as { syncEffect(effect: import(\"@pixi-ui-editor/schema\").ParticleEffectDefinition): void }).syncEffect(effect);\r\n if (parentNode !== undefined && isLayoutGroup(parentNode) && view.parent instanceof LayoutItemContainer) {\r\n applyLayoutItem(view.parent, node, parentNode, profile);\r\n } else if (parentNode !== undefined && parentNode.type === \"scroll-view\" && view.parent instanceof ScrollItemContainer) {\r\n const own = resolveProfileTransform(node, profile).transform;\r\n view.parent.sync(node, profile, { width: own.width, height: own.height });\r\n } else if (parentNode !== undefined && parentNode.type === \"page-group\" && view.parent instanceof PageItemContainer && parentSize !== undefined) {\r\n // A page is position-managed exactly like a layout/scroll item: it fills the group's own rectangle\r\n // (`parentSize`, the same value `buildSceneView` passes as `childSize`). Without this branch an\r\n // in-place update fell through to `view.update` and handed the page back its authored x/y and\r\n // anchors, so editing anything inside a page group knocked its pages out of place.\r\n view.parent.sync(node, profile, parentSize);\r\n } else {\r\n view.update(node, profile, parentSize);\r\n }\r\n}\r\n\r\n/** Previews a resolved editor rectangle without consulting content bounds or rebuilding the view. */\r\nexport function previewNodeView(view: Container, node: UINode, profile: LayoutProfileId, transform: UINode[\"transform\"]): void {\r\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, undefined, { width: transform.width, height: transform.height });\r\n if (view instanceof NodeView) view.preview(node, transform, resolveProfileTransform(node, profile).visible, profile);\r\n}\r\n\r\n/** Hosts call this from their own Application ticker; runtime never subscribes to Ticker.shared. */\r\nexport function updateParticleEmitters(root: Container, deltaSeconds: number): void {\r\n const registered = particleEmitterRegistry.get(root);\r\n if (registered !== undefined) {\r\n for (const emitter of registered) emitter.updateParticles(deltaSeconds);\r\n return;\r\n }\r\n // Backward-compatible fallback for hosts that assemble a display tree manually instead of using\r\n // buildSceneView. Built scenes always take the O(emitter count) registry path above.\r\n const visit = (view: Container): void => {\r\n if (view instanceof ParticleEmitterNodeView) view.updateParticles(deltaSeconds);\r\n for (const child of view.children) visit(child);\r\n };\r\n visit(root);\r\n}\r\n\r\n/** Lists the nodes a scene renders, including nodes of prefab definitions its prefab instances expand to. */\r\nexport function collectRenderedNodes(document: ProjectDocument, scene: Scene): UINode[] {\r\n return resolveOwnerNodeGraph(document, scene).nodes;\r\n}\r\n\r\nexport type PrefabViewConfiguration = Pick<Extract<UINode, { type: \"prefab-instance\" }>, \"propertyOverrides\" | \"locallyAddedNodes\"> & { instanceId?: string };\r\n\r\nfunction prefabScene(document: ProjectDocument, prefabId: string, configuration: PrefabViewConfiguration = {}): { document: ProjectDocument; sceneId: string; instanceId: string } {\r\n const prefab = document.prefabs.find((candidate) => candidate.id === prefabId);\r\n if (prefab === undefined) throw new Error(`Prefab '${prefabId}' does not exist in the project document.`);\r\n const width = Math.max(1, ...prefab.nodes.map((node) => Math.abs(node.transform.x) + Math.max(0, node.transform.width)));\r\n const height = Math.max(1, ...prefab.nodes.map((node) => Math.abs(node.transform.y) + Math.max(0, node.transform.height)));\r\n const instanceId = configuration.instanceId ?? createStableId();\r\n const instance: Extract<UINode, { type: \"prefab-instance\" }> = {\r\n id: instanceId, name: prefab.name, type: \"prefab-instance\", prefabId, parentId: null, children: [],\r\n visible: true, transform: { x: 0, y: 0, width, height, scaleX: 1, scaleY: 1, rotation: 0, anchorMinX: 0, anchorMaxX: 0, anchorMinY: 0, anchorMaxY: 0, pivotX: 0, pivotY: 0 },\r\n ...(configuration.propertyOverrides === undefined ? {} : { propertyOverrides: structuredClone(configuration.propertyOverrides) }),\r\n ...(configuration.locallyAddedNodes === undefined ? {} : { locallyAddedNodes: structuredClone(configuration.locallyAddedNodes) }),\r\n };\r\n const sceneId = createStableId();\r\n const viewport = { width, height };\r\n const scene: Scene = { id: sceneId, name: prefab.name, rootNodeIds: [instance.id], nodes: [instance], layout: { referenceViewports: { desktop: viewport, mobile: viewport }, preferredViewports: { desktop: viewport, mobile: viewport } } };\r\n return { document: { ...document, scenes: [...document.scenes, scene] }, sceneId, instanceId };\r\n}\r\n\r\n/** Builds a fresh runtime prefab instance without requiring it to already exist in a scene. */\r\nexport function buildPrefabView(document: ProjectDocument, prefabId: string, profile: LayoutProfileId, options: BuildSceneViewOptions, configuration: PrefabViewConfiguration = {}): SceneViewResult & { instanceId: string } {\r\n const synthetic = prefabScene(document, prefabId, configuration);\r\n return { ...buildSceneView(synthetic.document, synthetic.sceneId, profile, { ...options, clipToViewport: false }), instanceId: synthetic.instanceId };\r\n}\r\n\r\n/** Loads a prefab's assets and returns a fresh display tree suitable for dynamic game-code spawning. */\r\nexport async function loadPrefabView(document: ProjectDocument, prefabId: string, profile: LayoutProfileId, resolveFileUrl: FileUrlResolver, options: { interaction: SceneInteractionMode; ticker?: Ticker; localization?: SceneLocalizationOptions; assetCache?: SceneAssetCache }, configuration: PrefabViewConfiguration = {}): Promise<SceneViewResult & { instanceId: string }> {\r\n const synthetic = prefabScene(document, prefabId, configuration);\r\n return { ...await loadSceneView(synthetic.document, synthetic.sceneId, profile, resolveFileUrl, { ...options, clipToViewport: false }), instanceId: synthetic.instanceId };\r\n}\r\n\r\n/** Loads a scene's textures and Spine data, then builds its display tree in one call. */\r\nexport async function loadSceneView(\r\n document: ProjectDocument,\r\n sceneId: string,\r\n profile: LayoutProfileId,\r\n resolveFileUrl: FileUrlResolver,\r\n options: { interaction: SceneInteractionMode; ticker?: Ticker; localization?: SceneLocalizationOptions; clipToViewport?: boolean; assetCache?: SceneAssetCache },\r\n): Promise<SceneViewResult> {\r\n // Без assetCache каждый вызов начинает с пустых кэшей: для одиночной загрузки сцены это нормально, а вот\r\n // игровой код, который поднимает пресеты по одному, обязан передать собственный кэш — иначе один и тот же\r\n // скелет, атлас и текстура парсятся заново на каждую вьюху и дублируются в видеопамяти.\r\n const cache = options.assetCache;\r\n const [textures, spines, fonts, bitmapFonts] = await Promise.all([\r\n loadSceneTextures(document, sceneId, (asset) => (asset.type === \"image\" ? resolveFileUrl(asset.source.uri) : undefined), resolveFileUrl, cache?.textures, cache?.spritesheets, cache?.bitmapFonts),\r\n loadSceneSpines(document, sceneId, resolveFileUrl, cache?.spines),\r\n loadSceneFonts(document, sceneId, resolveFileUrl, cache?.fonts),\r\n loadSceneBitmapFonts(document, sceneId, resolveFileUrl, cache?.bitmapFonts),\r\n ]);\r\n return buildSceneView(document, sceneId, profile, { interaction: options.interaction, textures, spines, fonts, bitmapFonts, ticker: options.ticker, localization: options.localization, clipToViewport: options.clipToViewport });\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"scene.js","sourceRoot":"","sources":["../src/scene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,qBAAqB,EAAiJ,MAAM,wBAAwB,CAAC;AAC3R,OAAO,EAAE,SAAS,EAAwB,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAwB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,wBAAwB,EAAE,uBAAuB,EAAmB,MAAM,aAAa,CAAC;AACvI,OAAO,EAAE,QAAQ,EAA6B,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACtI,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAwB,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,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,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,CAAC;QAClM,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,CAAC;QACjE,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,CAAC;QAC/D,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,CAAC;KAC5E,CAAC,CAAC;IACH,OAAO,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;AACpO,CAAC","sourcesContent":["import { type SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport { createStableId, isLayoutGroup, isParticleEffect, resolveLayoutGroupSettings, resolveOwnerNodeGraph, type EffectDefinition, type GridLayoutSettings, type LayoutProfileId, type ProjectDocument, type Scene, type SpineReferenceFrame, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container, Texture, type Ticker } from \"pixi.js\";\r\nimport { loadSceneSpines } from \"./assets/spine.js\";\r\nimport { loadSceneTextures, type FileUrlResolver } from \"./assets/textures.js\";\r\nimport { loadSceneFonts } from \"./assets/fonts.js\";\r\nimport { loadSceneBitmapFonts } from \"./assets/bitmapFonts.js\";\r\nimport type { SceneAssetCache } from \"./assets/cache.js\";\r\nimport { getCanvasLogicalSize, getCanvasScale, resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"./layout.js\";\r\nimport { NodeView, type SceneInteractionMode } from \"./views/NodeView.js\";\r\nimport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\r\nimport { createNodeView } from \"./views/createNodeView.js\";\r\nimport { applyLayoutGroup, applyLayoutItem, createGridLineBreak, initializePixiLayout, LayoutItemContainer } from \"./layoutGroups.js\";\r\nimport { LayoutGroupNodeView } from \"./views/basic.js\";\r\nimport { PageItemContainer } from \"./pageGroup.js\";\r\nimport { PageGroupNodeView } from \"./views/PageGroupNodeView.js\";\r\nimport { PaginationNodeView, type PaginationArrow } from \"./views/PaginationNodeView.js\";\r\nimport { ItemTableNodeView } from \"./views/ItemTableNodeView.js\";\r\nimport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\r\nimport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\r\nimport { ScrollItemContainer } from \"./scrollView.js\";\r\nimport { ScrollViewNodeView } from \"./views/ScrollViewNodeView.js\";\r\nimport { SpineNodeView } from \"./views/SpineNodeView.js\";\r\nimport { ParticleEmitterNodeView } from \"./views/ParticleEmitterNodeView.js\";\r\nimport { SceneLocalization, type SceneLocalizationOptions } from \"./localization.js\";\r\nimport { SceneViewport } from \"./SceneViewport.js\";\r\nimport { createSceneAudio, type AudioBus } from \"./audio/bus.js\";\r\n\r\nexport type BuildSceneViewOptions = {\r\n /** Explicit: an editor canvas must pass \"authoring\", Preview and the consuming app \"runtime\". */\r\n interaction: SceneInteractionMode;\r\n textures?: ReadonlyMap<string, Texture>;\r\n spines?: ReadonlyMap<string, SkeletonData>;\r\n fonts?: ReadonlyMap<string, string>;\r\n bitmapFonts?: ReadonlyMap<string, string>;\r\n /**\r\n * Шина звуковых событий (обычно `createRuntimeAudio(...)`). Без неё сцена не публикует звуковые\r\n * события вовсе — ровно так строится инертный authoring-канвас редактора.\r\n */\r\n audio?: AudioBus;\r\n /**\r\n * The host's own Application ticker, driving self-updating content such as Spine skeletons.\r\n * Without it they fall back to `Ticker.shared`, which runs a second rAF loop independent of the\r\n * renderer that draws them — see the same rule as `updateParticleEmitters`.\r\n */\r\n ticker?: Ticker;\r\n /** Called after Yoga changes a managed rectangle; authoring hosts use it to refresh overlays. */\r\n onLayout?: () => void;\r\n /**\r\n * Начальное состояние локализации. Опция необязательна: при наличии `Text.textKey` base locale\r\n * каталога применяется и без неё, а документ без ключей выглядит ровно как раньше.\r\n */\r\n localization?: SceneLocalizationOptions;\r\n /** Internal host boundary override: prefab views are spawnable content, not screen viewports. */\r\n clipToViewport?: boolean;\r\n};\r\n\r\nexport type SceneViewResult = { root: SceneViewport; nodeViews: Map<string, Container>; localization: SceneLocalization; readonly profile: LayoutProfileId };\r\nconst particleEmitterRegistry = new WeakMap<Container, readonly ParticleEmitterNodeView[]>();\r\n\r\nfunction spineReferenceFrameFor(document: ProjectDocument, node: UINode): SpineReferenceFrame | undefined {\r\n if (node.type !== \"spine\") return undefined;\r\n const asset = document.assets.find((candidate) => candidate.id === node.assetId);\r\n return asset?.type === \"spine\" ? asset.referenceFrame : undefined;\r\n}\r\n\r\n/** Builds a PixiJS display tree for a scene without depending on DOM or editor state. */\r\nexport function buildSceneView(\r\n document: ProjectDocument,\r\n sceneId: string,\r\n profile: LayoutProfileId,\r\n options: BuildSceneViewOptions,\r\n): SceneViewResult {\r\n initializePixiLayout();\r\n const { interaction, textures, spines, fonts, bitmapFonts, ticker, onLayout } = options;\r\n const scene = document.scenes.find((candidate) => candidate.id === sceneId);\r\n\r\n if (scene === undefined) {\r\n throw new Error(`Scene '${sceneId}' does not exist in the project document.`);\r\n }\r\n\r\n const nodeViews = new Map<string, Container>();\r\n const particleEmitters: ParticleEmitterNodeView[] = [];\r\n // Резолв «id ассета → имя звука» живёт здесь: вьюхи знают только id, а документ — только эта функция.\r\n const sceneAudio = options.audio === undefined ? undefined : createSceneAudio(document, options.audio);\r\n\r\n // Materialized prefab children use instance-scoped IDs, so authoring and runtime can address\r\n // multiple instances independently without changing canonical definition IDs.\r\n const screenSize = scene.layout.referenceViewports[profile];\r\n const referenceResolution = scene.layout.preferredViewports[profile];\r\n const canvasScale = getCanvasScale(screenSize, referenceResolution);\r\n const canvasSize = getCanvasLogicalSize(screenSize, referenceResolution);\r\n\r\n // Единый резолвер иерархии: тот же граф, что видит редактор, включая вложенные пресеты.\r\n const owner = resolveOwnerNodeGraph(document, scene);\r\n const prefabIds = new Set(document.prefabs.map((prefab) => prefab.id));\r\n\r\n const buildOwner = (rootSize: LayoutSize): Container => {\r\n const nodesById = new Map(owner.nodes.map((node) => [node.id, node]));\r\n\r\n const buildNode = (nodeId: string, parentSize: LayoutSize): NodeView => {\r\n const node = nodesById.get(nodeId);\r\n\r\n if (node === undefined) {\r\n throw new Error(`Scene '${sceneId}' references missing node '${nodeId}'.`);\r\n }\r\n\r\n const resolved = resolveProfileTransform(node, profile);\r\n const transform = resolveAnchoredTransform(resolved.transform, parentSize);\r\n const view = createNodeView(node, interaction, textures, spines, (prefabId) => prefabIds.has(prefabId), fonts, sceneAudio, node.type === \"particle-emitter\" ? document.effects.find((effect) => effect.id === node.effectId && isParticleEffect(effect)) : undefined, spineReferenceFrameFor(document, node), ticker, bitmapFonts);\r\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, parentSize);\r\n // Yoga owns only the group's inner layoutContent; the outer NodeView keeps authored transform.\r\n view.update(node, profile, parentSize);\r\n nodeViews.set(node.id, view);\r\n if (view instanceof ParticleEmitterNodeView) particleEmitters.push(view);\r\n\r\n // Прямые дети корня сцены разрешают якоря относительно логического Canvas, а не размера корня.\r\n // Прямой ребёнок grid-layout (сам `node` здесь) не владеет своим отрисованным размером: Unity-подобная\r\n // фиксированная ячейка полностью переопределяет authored transform (см. applyLayoutItem). Его\r\n // собственным потомкам нужен именно cellWidth/cellHeight, а не anchor-resolved authored-размер —\r\n // иначе они не отслеживают изменение Cell width/height и якорятся относительно устаревшего размера.\r\n const gridParent = node.parentId === null ? undefined : nodesById.get(node.parentId);\r\n const gridCell = gridParent?.type === \"grid-layout\" ? resolveLayoutGroupSettings<GridLayoutSettings>(gridParent, profile) : undefined;\r\n // Та же логика для прямого ребёнка page-group (страницы): `PageItemContainer`/`updateManaged`\r\n // растягивают её на весь resolved rectangle группы независимо от собственных anchors ноды\r\n // (см. NodeView.applyResolvedTransform, managedByLayout). Здесь `node` — сама страница, поэтому\r\n // это переопределённый размер, который она фактически получит, — `parentSize`, уже разрешённый\r\n // как rectangle page-group. Без этой ветки дети страницы якорились бы относительно её\r\n // anchor-resolved authored-размера, который может расходиться с фактическим rectangle группы,\r\n // особенно в другом layout-профиле.\r\n const childSize = node.parentId === null\r\n ? rootSize\r\n : gridCell !== undefined\r\n ? { width: gridCell.cellWidth, height: gridCell.cellHeight }\r\n : gridParent?.type === \"page-group\"\r\n ? parentSize\r\n : { width: transform.width, height: transform.height };\r\n for (const [childIndex, childId] of node.children.entries()) {\r\n const childNode = nodesById.get(childId);\r\n const childView = buildNode(childId, childSize);\r\n if (isLayoutGroup(node) && childNode !== undefined && view instanceof LayoutGroupNodeView) {\r\n const layoutItem = new LayoutItemContainer(childView, onLayout);\r\n applyLayoutItem(layoutItem, childNode, node, profile);\r\n view.addLayoutChild(layoutItem);\r\n } else if (node.type === \"scroll-view\" && childNode !== undefined && view instanceof ScrollViewNodeView) {\r\n const scrollItem = new ScrollItemContainer(childView, onLayout);\r\n // Как и у layout-item: собственный (не растянутый якорями) размер ребёнка — List не\r\n // предоставляет per-item override размера, в отличие от Yoga flexGrow/cellSize.\r\n const own = resolveProfileTransform(childNode, profile).transform;\r\n scrollItem.sync(childNode, profile, { width: own.width, height: own.height });\r\n view.addScrollItem(scrollItem);\r\n } else if (node.type === \"page-group\" && childNode !== undefined && view instanceof PageGroupNodeView) {\r\n // Unlike a scroll-view item, a page fills the group's own resolved rect completely\r\n // (`childSize`, computed above): a page is a full sub-screen, not content sized to itself.\r\n const pageItem = new PageItemContainer(childView);\r\n pageItem.sync(childNode, profile, childSize);\r\n view.addPageItem(pageItem);\r\n } else {\r\n view.addChild(childView);\r\n }\r\n if (node.type === \"grid-layout\") {\r\n const settings = node.layoutGroup.overrides?.[profile] === undefined ? node.layoutGroup.base : { ...node.layoutGroup.base, ...node.layoutGroup.overrides[profile] };\r\n if (settings.constraint !== \"flexible\" && settings.constraintCount !== undefined && (childIndex + 1) % settings.constraintCount === 0 && childIndex + 1 < node.children.length) {\r\n const lineBreak = createGridLineBreak(node, profile);\r\n if (lineBreak !== undefined && view instanceof LayoutGroupNodeView) view.addLayoutChild(lineBreak);\r\n }\r\n }\r\n }\r\n\r\n return view;\r\n };\r\n\r\n const ownerRoot = new Container();\r\n for (const rootNodeId of owner.rootNodeIds) {\r\n ownerRoot.addChild(buildNode(rootNodeId, rootSize));\r\n }\r\n\r\n return ownerRoot;\r\n };\r\n\r\n const canvasRoot = buildOwner(canvasSize);\r\n canvasRoot.scale.set(canvasScale);\r\n const hostRoot = new SceneViewport(canvasRoot, screenSize, options.clipToViewport ?? interaction === \"runtime\");\r\n particleEmitterRegistry.set(hostRoot, particleEmitters);\r\n // Контроллер применяет переводы сразу к уже созданным views, поэтому keyed Text показывает\r\n // базовую локаль без единого дополнительного вызова со стороны хоста.\r\n const localization = new SceneLocalization(document, scene, nodeViews, options.localization);\r\n wireCheckboxGroups(owner.nodes, nodeViews);\r\n wireSpineConnectors(owner.nodes, nodeViews);\r\n wireNodeReferences(owner.nodes, nodeViews, interaction);\r\n return { root: hostRoot, nodeViews, localization, profile };\r\n}\r\n\r\nconst GRID_LINE_BREAK_LABEL = \"__layout-grid-line-break__\";\r\n\r\n/** Recreates only technical Yoga line breaks while retaining every authored NodeView and wrapper. */\r\nfunction syncGridLineBreaks(view: LayoutGroupNodeView, node: Extract<UINode, { type: \"grid-layout\" }>, profile: LayoutProfileId, nodesById: ReadonlyMap<string, UINode>, nodeViews: ReadonlyMap<string, Container>): void {\r\n for (const child of [...view.layoutTarget.children]) {\r\n if (child.label === GRID_LINE_BREAK_LABEL) child.destroy();\r\n }\r\n const settings = resolveLayoutGroupSettings<GridLayoutSettings>(node, profile);\r\n for (const [childIndex, childId] of node.children.entries()) {\r\n const childNode = nodesById.get(childId);\r\n const childView = nodeViews.get(childId);\r\n if (childNode !== undefined && childView instanceof NodeView && childView.parent instanceof LayoutItemContainer) {\r\n view.addLayoutChild(childView.parent);\r\n }\r\n if (settings.constraint !== \"flexible\" && settings.constraintCount !== undefined && (childIndex + 1) % settings.constraintCount === 0 && childIndex + 1 < node.children.length) {\r\n const lineBreak = createGridLineBreak(node, profile);\r\n if (lineBreak !== undefined) view.addLayoutChild(lineBreak);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies another layout profile to an already-built scene without loading assets or replacing views.\r\n * Runtime-only state owned by the views (button state, page, capacity overrides, scroll position) is\r\n * retained. Reapplying the live profile is an observable no-op.\r\n */\r\nexport function applyProfile(view: SceneViewResult, document: ProjectDocument, sceneId: string, profile: LayoutProfileId): void {\r\n if (view.profile === profile) return;\r\n const scene = document.scenes.find((candidate) => candidate.id === sceneId);\r\n if (scene === undefined) throw new Error(`Scene '${sceneId}' does not exist in the project document.`);\r\n\r\n const owner = resolveOwnerNodeGraph(document, scene);\r\n const nodesById = new Map(owner.nodes.map((node) => [node.id, node]));\r\n const activeSpines = [...view.nodeViews.values()].filter((candidate): candidate is SpineNodeView => candidate instanceof SpineNodeView && candidate.activeConnectorBones);\r\n for (const spine of activeSpines) spine.activeConnectorBones = false;\r\n\r\n const screenSize = scene.layout.referenceViewports[profile];\r\n const referenceResolution = scene.layout.preferredViewports[profile];\r\n const canvasSize = getCanvasLogicalSize(screenSize, referenceResolution);\r\n\r\n const updateNode = (nodeId: string, parentSize: LayoutSize): void => {\r\n const node = nodesById.get(nodeId);\r\n const nodeView = view.nodeViews.get(nodeId);\r\n if (node === undefined || nodeView === undefined) return;\r\n const parentNode = node.parentId === null ? undefined : nodesById.get(node.parentId);\r\n updateNodeView(nodeView, node, profile, parentSize, parentNode, node.type === \"particle-emitter\" ? document.effects.find((effect) => effect.id === node.effectId) : undefined, spineReferenceFrameFor(document, node));\r\n\r\n const transform = resolveAnchoredTransform(resolveProfileTransform(node, profile).transform, parentSize);\r\n const gridCell = parentNode?.type === \"grid-layout\" ? resolveLayoutGroupSettings<GridLayoutSettings>(parentNode, profile) : undefined;\r\n const childSize = node.parentId === null\r\n ? canvasSize\r\n : gridCell !== undefined\r\n ? { width: gridCell.cellWidth, height: gridCell.cellHeight }\r\n : parentNode?.type === \"page-group\"\r\n ? parentSize\r\n : { width: transform.width, height: transform.height };\r\n for (const childId of node.children) updateNode(childId, childSize);\r\n if (node.type === \"grid-layout\" && nodeView instanceof LayoutGroupNodeView) syncGridLineBreaks(nodeView, node, profile, nodesById, view.nodeViews);\r\n };\r\n\r\n try {\r\n for (const rootNodeId of owner.rootNodeIds) updateNode(rootNodeId, canvasSize);\r\n view.root.content.scale.set(getCanvasScale(screenSize, referenceResolution));\r\n view.root.setReferenceViewport(screenSize);\r\n (view as { profile: LayoutProfileId }).profile = profile;\r\n } finally {\r\n for (const spine of activeSpines) spine.activeConnectorBones = true;\r\n }\r\n}\r\n\r\nfunction wireSpineConnectors(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>): void {\r\n for (const node of nodes) {\r\n if (node.type !== \"spine\") continue;\r\n const view = nodeViews.get(node.id);\r\n if (!(view instanceof SpineNodeView)) continue;\r\n view.setConnectorBones((node.connectors ?? []).flatMap((connector) => {\r\n const target = nodeViews.get(connector.targetNodeId);\r\n return target === undefined ? [] : [{ ...connector, target }];\r\n }));\r\n }\r\n}\r\n\r\n/**\r\n * Разрешает все ссылки «нода → нода» в живые views: элементы item table и кнопки-стрелки пагинатора.\r\n * Та же форма, что у `wireSpineConnectors`: документ хранит id, а во что он превратился, знает только\r\n * собранная сцена, поэтому сами виды никогда не резолвят id. Один проход на все виды ссылок, чтобы\r\n * следующая не завела собственный обход с чуть другой областью видимости.\r\n *\r\n * Стрелки подключаются только в runtime-сцене: на authoring-канвасе контрол инертен, как и клик по\r\n * самой точке пагинатора. Вместимость таблицы и видимость ноды-фона активной страницы пагинатора,\r\n * наоборот, видны и в редакторе — это не интерактивность.\r\n */\r\nfunction wireNodeReferences(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>, interaction: SceneInteractionMode): void {\r\n const arrowView = (nodeId: string | undefined): PaginationArrow | undefined => {\r\n const view = nodeId === undefined ? undefined : nodeViews.get(nodeId);\r\n return view instanceof ButtonNodeView || view instanceof StagedButtonNodeView ? view : undefined;\r\n };\r\n for (const node of nodes) {\r\n const view = nodeViews.get(node.id);\r\n if (node.type === \"item-table\" && view instanceof ItemTableNodeView) {\r\n view.setItems((node.items ?? []).map((itemId) => nodeViews.get(itemId)));\r\n } else if (node.type === \"pagination\" && view instanceof PaginationNodeView) {\r\n if (interaction === \"runtime\") view.setArrows({ previous: arrowView(node.prevButtonNodeId), next: arrowView(node.nextButtonNodeId) });\r\n view.setActiveBackground(node.activeBackgroundNodeId === undefined ? undefined : nodeViews.get(node.activeBackgroundNodeId));\r\n } else if (node.type === \"page-group\" && view instanceof PageGroupNodeView && interaction === \"runtime\") {\r\n view.setArrows({ up: arrowView(node.pageUpButtonNodeId), down: arrowView(node.pageDownButtonNodeId) });\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Authored `group` gives sibling checkboxes radio-button behavior: checking one force-unchecks its\r\n * live group-mates (same `parentId`, same `group`), without touching the document. Runs once per\r\n * scene build; `CheckboxNodeView.forceCheck` never re-emits `onCheck`, so this can't recurse.\r\n */\r\nfunction wireCheckboxGroups(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>): void {\r\n const byGroup = new Map<string, CheckboxNodeView[]>();\r\n for (const node of nodes) {\r\n if (node.type !== \"checkbox\" || node.group === undefined) continue;\r\n const view = nodeViews.get(node.id);\r\n if (!(view instanceof CheckboxNodeView)) continue;\r\n const key = `${node.parentId ?? \"\"}::${node.group}`;\r\n const group = byGroup.get(key) ?? [];\r\n group.push(view);\r\n byGroup.set(key, group);\r\n }\r\n for (const group of byGroup.values()) {\r\n if (group.length < 2) continue;\r\n for (const view of group) {\r\n view.onCheck.connect((checked) => {\r\n if (!checked) return;\r\n for (const other of group) if (other !== view) other.forceCheck(false);\r\n });\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies a node's resolved transform, visibility, and content to an existing display object,\r\n * so editors can update views in place without rebuilding the scene tree.\r\n */\r\nexport function updateNodeView(view: Container, node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize, parentNode?: UINode, effect?: EffectDefinition, spineReferenceFrame?: SpineReferenceFrame): void {\r\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, parentSize);\r\n if (!(view instanceof NodeView)) return;\r\n if (view instanceof SpineNodeView) view.setReferenceFrame(spineReferenceFrame);\r\n if (node.type === \"particle-emitter\" && effect !== undefined && isParticleEffect(effect) && \"syncEffect\" in view && typeof (view as { syncEffect?: unknown }).syncEffect === \"function\") (view as { syncEffect(effect: import(\"@pixi-ui-editor/schema\").ParticleEffectDefinition): void }).syncEffect(effect);\r\n if (parentNode !== undefined && isLayoutGroup(parentNode) && view.parent instanceof LayoutItemContainer) {\r\n applyLayoutItem(view.parent, node, parentNode, profile);\r\n } else if (parentNode !== undefined && parentNode.type === \"scroll-view\" && view.parent instanceof ScrollItemContainer) {\r\n const own = resolveProfileTransform(node, profile).transform;\r\n view.parent.sync(node, profile, { width: own.width, height: own.height });\r\n } else if (parentNode !== undefined && parentNode.type === \"page-group\" && view.parent instanceof PageItemContainer && parentSize !== undefined) {\r\n // A page is position-managed exactly like a layout/scroll item: it fills the group's own rectangle\r\n // (`parentSize`, the same value `buildSceneView` passes as `childSize`). Without this branch an\r\n // in-place update fell through to `view.update` and handed the page back its authored x/y and\r\n // anchors, so editing anything inside a page group knocked its pages out of place.\r\n view.parent.sync(node, profile, parentSize);\r\n } else {\r\n view.update(node, profile, parentSize);\r\n }\r\n}\r\n\r\n/** Previews a resolved editor rectangle without consulting content bounds or rebuilding the view. */\r\nexport function previewNodeView(view: Container, node: UINode, profile: LayoutProfileId, transform: UINode[\"transform\"]): void {\r\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, undefined, { width: transform.width, height: transform.height });\r\n if (view instanceof NodeView) view.preview(node, transform, resolveProfileTransform(node, profile).visible, profile);\r\n}\r\n\r\n/** Hosts call this from their own Application ticker; runtime never subscribes to Ticker.shared. */\r\nexport function updateParticleEmitters(root: Container, deltaSeconds: number): void {\r\n const registered = particleEmitterRegistry.get(root);\r\n if (registered !== undefined) {\r\n for (const emitter of registered) emitter.updateParticles(deltaSeconds);\r\n return;\r\n }\r\n // Backward-compatible fallback for hosts that assemble a display tree manually instead of using\r\n // buildSceneView. Built scenes always take the O(emitter count) registry path above.\r\n const visit = (view: Container): void => {\r\n if (view instanceof ParticleEmitterNodeView) view.updateParticles(deltaSeconds);\r\n for (const child of view.children) visit(child);\r\n };\r\n visit(root);\r\n}\r\n\r\n/** Lists the nodes a scene renders, including nodes of prefab definitions its prefab instances expand to. */\r\nexport function collectRenderedNodes(document: ProjectDocument, scene: Scene): UINode[] {\r\n return resolveOwnerNodeGraph(document, scene).nodes;\r\n}\r\n\r\nexport type PrefabViewConfiguration = Pick<Extract<UINode, { type: \"prefab-instance\" }>, \"propertyOverrides\" | \"locallyAddedNodes\"> & { instanceId?: string };\r\n\r\nfunction prefabScene(document: ProjectDocument, prefabId: string, configuration: PrefabViewConfiguration = {}): { document: ProjectDocument; sceneId: string; instanceId: string } {\r\n const prefab = document.prefabs.find((candidate) => candidate.id === prefabId);\r\n if (prefab === undefined) throw new Error(`Prefab '${prefabId}' does not exist in the project document.`);\r\n const width = Math.max(1, ...prefab.nodes.map((node) => Math.abs(node.transform.x) + Math.max(0, node.transform.width)));\r\n const height = Math.max(1, ...prefab.nodes.map((node) => Math.abs(node.transform.y) + Math.max(0, node.transform.height)));\r\n const instanceId = configuration.instanceId ?? createStableId();\r\n const instance: Extract<UINode, { type: \"prefab-instance\" }> = {\r\n id: instanceId, name: prefab.name, type: \"prefab-instance\", prefabId, parentId: null, children: [],\r\n visible: true, transform: { x: 0, y: 0, width, height, scaleX: 1, scaleY: 1, rotation: 0, anchorMinX: 0, anchorMaxX: 0, anchorMinY: 0, anchorMaxY: 0, pivotX: 0, pivotY: 0 },\r\n ...(configuration.propertyOverrides === undefined ? {} : { propertyOverrides: structuredClone(configuration.propertyOverrides) }),\r\n ...(configuration.locallyAddedNodes === undefined ? {} : { locallyAddedNodes: structuredClone(configuration.locallyAddedNodes) }),\r\n };\r\n const sceneId = createStableId();\r\n const viewport = { width, height };\r\n const scene: Scene = { id: sceneId, name: prefab.name, rootNodeIds: [instance.id], nodes: [instance], layout: { referenceViewports: { desktop: viewport, mobile: viewport }, preferredViewports: { desktop: viewport, mobile: viewport } } };\r\n return { document: { ...document, scenes: [...document.scenes, scene] }, sceneId, instanceId };\r\n}\r\n\r\n/** Builds a fresh runtime prefab instance without requiring it to already exist in a scene. */\r\nexport function buildPrefabView(document: ProjectDocument, prefabId: string, profile: LayoutProfileId, options: BuildSceneViewOptions, configuration: PrefabViewConfiguration = {}): SceneViewResult & { instanceId: string } {\r\n const synthetic = prefabScene(document, prefabId, configuration);\r\n return { ...buildSceneView(synthetic.document, synthetic.sceneId, profile, { ...options, clipToViewport: false }), instanceId: synthetic.instanceId };\r\n}\r\n\r\n/** Loads a prefab's assets and returns a fresh display tree suitable for dynamic game-code spawning. */\r\nexport async function loadPrefabView(document: ProjectDocument, prefabId: string, profile: LayoutProfileId, resolveFileUrl: FileUrlResolver, options: { interaction: SceneInteractionMode; ticker?: Ticker; localization?: SceneLocalizationOptions; assetCache?: SceneAssetCache }, configuration: PrefabViewConfiguration = {}): Promise<SceneViewResult & { instanceId: string }> {\r\n const synthetic = prefabScene(document, prefabId, configuration);\r\n return { ...await loadSceneView(synthetic.document, synthetic.sceneId, profile, resolveFileUrl, { ...options, clipToViewport: false }), instanceId: synthetic.instanceId };\r\n}\r\n\r\n/** Loads a scene's textures and Spine data, then builds its display tree in one call. */\r\nexport async function loadSceneView(\r\n document: ProjectDocument,\r\n sceneId: string,\r\n profile: LayoutProfileId,\r\n resolveFileUrl: FileUrlResolver,\r\n options: { interaction: SceneInteractionMode; ticker?: Ticker; localization?: SceneLocalizationOptions; clipToViewport?: boolean; assetCache?: SceneAssetCache },\r\n): Promise<SceneViewResult> {\r\n // Без assetCache каждый вызов начинает с пустых кэшей: для одиночной загрузки сцены это нормально, а вот\r\n // игровой код, который поднимает пресеты по одному, обязан передать собственный кэш — иначе один и тот же\r\n // скелет, атлас и текстура парсятся заново на каждую вьюху и дублируются в видеопамяти.\r\n const cache = options.assetCache;\r\n const [textures, spines, fonts, bitmapFonts] = await Promise.all([\r\n loadSceneTextures(document, sceneId, (asset) => (asset.type === \"image\" ? resolveFileUrl(asset.source.uri) : undefined), resolveFileUrl, cache?.textures, cache?.spritesheets, cache?.bitmapFonts),\r\n loadSceneSpines(document, sceneId, resolveFileUrl, cache?.spines),\r\n loadSceneFonts(document, sceneId, resolveFileUrl, cache?.fonts),\r\n loadSceneBitmapFonts(document, sceneId, resolveFileUrl, cache?.bitmapFonts),\r\n ]);\r\n return buildSceneView(document, sceneId, profile, { interaction: options.interaction, textures, spines, fonts, bitmapFonts, ticker: options.ticker, localization: options.localization, clipToViewport: options.clipToViewport });\r\n}\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PaginationNode, type UINode } from "@pixi-ui-editor/schema";
|
|
2
|
-
import { Container,
|
|
2
|
+
import { Container, Text, Texture } from "pixi.js";
|
|
3
3
|
import { Signal } from "typed-signals";
|
|
4
4
|
import { NodeView, type SceneInteractionMode } from "./NodeView.js";
|
|
5
5
|
export type { PaginationNode };
|
|
@@ -15,28 +15,22 @@ export type PaginationArrow = {
|
|
|
15
15
|
enabled: boolean;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
-
* One `numbers`-style item: a centered page-number label
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* One `numbers`-style item: a centered page-number label. `width`/`height` are overridden to the
|
|
19
|
+
* authored `dotSize` — the same fixed-footprint trick `ScrollItemContainer` uses — so the `List`
|
|
20
|
+
* spaces every item evenly. The active-page highlight is a separate authored node the widget only
|
|
21
|
+
* toggles `visible` on (see `PaginationNodeView.setActiveBackground`), never a child of this item.
|
|
22
22
|
*/
|
|
23
|
-
/** @internal Exported only so DOM-free render-contract tests can exercise the
|
|
23
|
+
/** @internal Exported only so DOM-free render-contract tests can exercise the footprint in isolation. */
|
|
24
24
|
export declare class NumberItem extends Container {
|
|
25
25
|
readonly numberText: Text;
|
|
26
26
|
private itemWidth;
|
|
27
27
|
private itemHeight;
|
|
28
|
-
private background?;
|
|
29
|
-
private backgroundMask?;
|
|
30
|
-
private backgroundCornerRadius?;
|
|
31
28
|
constructor(numberText: Text);
|
|
32
29
|
get width(): number;
|
|
33
30
|
set width(value: number);
|
|
34
31
|
get height(): number;
|
|
35
32
|
set height(value: number);
|
|
36
33
|
resize(width: number, height: number): void;
|
|
37
|
-
/** Replaces the pill behind the label (destroying the previous one); `undefined` removes it. */
|
|
38
|
-
setBackground(view: Sprite | NineSliceSprite | undefined, cornerRadius: number | undefined): void;
|
|
39
|
-
private syncBackgroundMask;
|
|
40
34
|
}
|
|
41
35
|
/**
|
|
42
36
|
* Standalone page indicator: N procedurally generated items arranged by `@pixi/ui`'s `List` (the same
|
|
@@ -47,12 +41,11 @@ export declare class NumberItem extends Container {
|
|
|
47
41
|
*
|
|
48
42
|
* `style` picks between two mutually exclusive, differently-rendered item kinds — image dots
|
|
49
43
|
* (`Sprite`, two states) or rendered page-number text (`NumberItem`: a label, base style + an optional
|
|
50
|
-
* highlight color
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* is not structural: switching pages only recreates the (one) background view that needs to move.
|
|
44
|
+
* highlight color) — never both. Switching `style` rebuilds every item, the same "view's required
|
|
45
|
+
* *type* changed" rule `StagedButtonNodeView` follows for its state views; `pageCount`/`dotSize`
|
|
46
|
+
* changes do too, since the item count/footprint is a runtime fact about this control, not scene
|
|
47
|
+
* topology — it only rebuilds this view's own item children, never the owning `NodeView` or the wider
|
|
48
|
+
* scene tree.
|
|
56
49
|
*
|
|
57
50
|
* With `visiblePageCount` set, the indicator becomes a fixed strip of that many slots with the active
|
|
58
51
|
* page always in the middle one (4 pages, page 3 active → 2-3-4). A slot pointing outside the real
|
|
@@ -60,7 +53,10 @@ export declare class NumberItem extends Container {
|
|
|
60
53
|
*
|
|
61
54
|
* The prev/next arrows are ordinary authored button nodes placed wherever the layout needs them; the
|
|
62
55
|
* widget only takes their views (`scene.ts`'s `wireNodeReferences`, the same address → view resolution
|
|
63
|
-
* Spine connector targets use) and steps the page on press. It never draws an arrow itself.
|
|
56
|
+
* Spine connector targets use) and steps the page on press. It never draws an arrow itself. The
|
|
57
|
+
* `numbers`-style active-page highlight follows the same reference-not-owned contract: it is an
|
|
58
|
+
* authored node the widget only toggles `visible` on while `style: "numbers"` — the node carries its
|
|
59
|
+
* own image / nine-slice / rounded corners / size / position, none of it configured here.
|
|
64
60
|
*/
|
|
65
61
|
export declare class PaginationNodeView extends NodeView {
|
|
66
62
|
private readonly list;
|
|
@@ -74,9 +70,8 @@ export declare class PaginationNodeView extends NodeView {
|
|
|
74
70
|
private inactiveTexture;
|
|
75
71
|
private numberStyle;
|
|
76
72
|
private numberActiveColor;
|
|
77
|
-
|
|
78
|
-
private
|
|
79
|
-
private numberActiveCornerRadius;
|
|
73
|
+
/** The authored highlight node; the widget owns only its `visible` flag while `style: "numbers"`. */
|
|
74
|
+
private activeBackground;
|
|
80
75
|
private pageCountState;
|
|
81
76
|
private currentPage;
|
|
82
77
|
private dotWidth;
|
|
@@ -85,7 +80,6 @@ export declare class PaginationNodeView extends NodeView {
|
|
|
85
80
|
/** Fires only from a click on an item (when `clickable`); setting `page` programmatically never emits. */
|
|
86
81
|
readonly onPageChange: Signal<(page: number) => void>;
|
|
87
82
|
constructor(node: PaginationNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, fonts: ReadonlyMap<string, string> | undefined);
|
|
88
|
-
private createBackgroundView;
|
|
89
83
|
/** How many indicator slots are drawn: the fixed authored window, or one slot per real page. */
|
|
90
84
|
private get slotCount();
|
|
91
85
|
/** The page a slot points at. Windowed slots slide with the current page, which keeps its middle seat. */
|
|
@@ -107,6 +101,13 @@ export declare class PaginationNodeView extends NodeView {
|
|
|
107
101
|
}): void;
|
|
108
102
|
/** На краях диапазона соответствующая стрелка недоступна — она никуда не ведёт. */
|
|
109
103
|
private applyArrowState;
|
|
104
|
+
/**
|
|
105
|
+
* Связывает виджет с авторской нодой-подсветкой активной страницы. Как и стрелки, нода остаётся
|
|
106
|
+
* обычным узлом сцены со своим визуалом — виджет лишь владеет её флагом `visible`: показывает при
|
|
107
|
+
* `style: "numbers"` (активная страница есть всегда) и прячет в стиле `dots`.
|
|
108
|
+
*/
|
|
109
|
+
setActiveBackground(view: Container | undefined): void;
|
|
110
|
+
private applyActiveBackgroundVisibility;
|
|
110
111
|
protected syncContent(node: UINode): void;
|
|
111
112
|
get pageCount(): number;
|
|
112
113
|
/** Used by `setPaginationViewPageCount` once game code knows the real content length. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationNodeView.d.ts","sourceRoot":"","sources":["../../src/views/PaginationNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PaginationNodeView.d.ts","sourceRoot":"","sources":["../../src/views/PaginationNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAA4B,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEpG,OAAO,EAAE,SAAS,EAAU,IAAI,EAAE,OAAO,EAAyB,MAAM,SAAS,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEpE,YAAY,EAAE,cAAc,EAAE,CAAC;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List } from "@pixi/ui";
|
|
2
|
-
import { Container,
|
|
2
|
+
import { Container, Sprite, Text, Texture } from "pixi.js";
|
|
3
3
|
import { Signal } from "typed-signals";
|
|
4
4
|
import { NodeView } from "./NodeView.js";
|
|
5
5
|
const DEFAULT_NUMBER_STYLE = { fontFamily: "Arial", fontSize: 18, fontWeight: "normal", fontStyle: "normal", fill: "#FFFFFF", align: "center", verticalAlign: "middle", wordWrap: false, breakWords: false, letterSpacing: 0 };
|
|
@@ -26,19 +26,16 @@ function clampPage(page, pageCount) {
|
|
|
26
26
|
return Math.min(Math.max(0, Math.round(page)), Math.max(0, pageCount - 1));
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* One `numbers`-style item: a centered page-number label
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* One `numbers`-style item: a centered page-number label. `width`/`height` are overridden to the
|
|
30
|
+
* authored `dotSize` — the same fixed-footprint trick `ScrollItemContainer` uses — so the `List`
|
|
31
|
+
* spaces every item evenly. The active-page highlight is a separate authored node the widget only
|
|
32
|
+
* toggles `visible` on (see `PaginationNodeView.setActiveBackground`), never a child of this item.
|
|
33
33
|
*/
|
|
34
|
-
/** @internal Exported only so DOM-free render-contract tests can exercise the
|
|
34
|
+
/** @internal Exported only so DOM-free render-contract tests can exercise the footprint in isolation. */
|
|
35
35
|
export class NumberItem extends Container {
|
|
36
36
|
numberText;
|
|
37
37
|
itemWidth = 0;
|
|
38
38
|
itemHeight = 0;
|
|
39
|
-
background;
|
|
40
|
-
backgroundMask;
|
|
41
|
-
backgroundCornerRadius;
|
|
42
39
|
// Named `numberText`, not `label`: `Container.label` is pixi.js's own display-object name string.
|
|
43
40
|
constructor(numberText) {
|
|
44
41
|
super();
|
|
@@ -54,39 +51,6 @@ export class NumberItem extends Container {
|
|
|
54
51
|
this.itemWidth = width;
|
|
55
52
|
this.itemHeight = height;
|
|
56
53
|
this.numberText.position.set(width / 2, height / 2);
|
|
57
|
-
this.background?.setSize(width, height);
|
|
58
|
-
this.syncBackgroundMask();
|
|
59
|
-
}
|
|
60
|
-
/** Replaces the pill behind the label (destroying the previous one); `undefined` removes it. */
|
|
61
|
-
setBackground(view, cornerRadius) {
|
|
62
|
-
if (this.background !== undefined) {
|
|
63
|
-
super.removeChild(this.background);
|
|
64
|
-
this.background.destroy();
|
|
65
|
-
}
|
|
66
|
-
if (this.backgroundMask !== undefined) {
|
|
67
|
-
super.removeChild(this.backgroundMask);
|
|
68
|
-
this.backgroundMask.destroy();
|
|
69
|
-
this.backgroundMask = undefined;
|
|
70
|
-
}
|
|
71
|
-
this.background = view;
|
|
72
|
-
this.backgroundCornerRadius = cornerRadius;
|
|
73
|
-
if (view === undefined)
|
|
74
|
-
return;
|
|
75
|
-
view.setSize(this.itemWidth, this.itemHeight);
|
|
76
|
-
super.addChildAt(view, 0);
|
|
77
|
-
if (cornerRadius !== undefined) {
|
|
78
|
-
this.backgroundMask = new Graphics();
|
|
79
|
-
this.syncBackgroundMask();
|
|
80
|
-
// Keep the mask before the background in this item's render tree, as SceneViewport does.
|
|
81
|
-
super.addChildAt(this.backgroundMask, 0);
|
|
82
|
-
view.mask = this.backgroundMask;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
syncBackgroundMask() {
|
|
86
|
-
if (this.backgroundMask === undefined)
|
|
87
|
-
return;
|
|
88
|
-
const radius = Math.min(this.backgroundCornerRadius ?? 0, this.itemWidth / 2, this.itemHeight / 2);
|
|
89
|
-
this.backgroundMask.clear().roundRect(0, 0, this.itemWidth, this.itemHeight, radius).fill(0xffffff);
|
|
90
54
|
}
|
|
91
55
|
}
|
|
92
56
|
/**
|
|
@@ -98,12 +62,11 @@ export class NumberItem extends Container {
|
|
|
98
62
|
*
|
|
99
63
|
* `style` picks between two mutually exclusive, differently-rendered item kinds — image dots
|
|
100
64
|
* (`Sprite`, two states) or rendered page-number text (`NumberItem`: a label, base style + an optional
|
|
101
|
-
* highlight color
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* is not structural: switching pages only recreates the (one) background view that needs to move.
|
|
65
|
+
* highlight color) — never both. Switching `style` rebuilds every item, the same "view's required
|
|
66
|
+
* *type* changed" rule `StagedButtonNodeView` follows for its state views; `pageCount`/`dotSize`
|
|
67
|
+
* changes do too, since the item count/footprint is a runtime fact about this control, not scene
|
|
68
|
+
* topology — it only rebuilds this view's own item children, never the owning `NodeView` or the wider
|
|
69
|
+
* scene tree.
|
|
107
70
|
*
|
|
108
71
|
* With `visiblePageCount` set, the indicator becomes a fixed strip of that many slots with the active
|
|
109
72
|
* page always in the middle one (4 pages, page 3 active → 2-3-4). A slot pointing outside the real
|
|
@@ -111,7 +74,10 @@ export class NumberItem extends Container {
|
|
|
111
74
|
*
|
|
112
75
|
* The prev/next arrows are ordinary authored button nodes placed wherever the layout needs them; the
|
|
113
76
|
* widget only takes their views (`scene.ts`'s `wireNodeReferences`, the same address → view resolution
|
|
114
|
-
* Spine connector targets use) and steps the page on press. It never draws an arrow itself.
|
|
77
|
+
* Spine connector targets use) and steps the page on press. It never draws an arrow itself. The
|
|
78
|
+
* `numbers`-style active-page highlight follows the same reference-not-owned contract: it is an
|
|
79
|
+
* authored node the widget only toggles `visible` on while `style: "numbers"` — the node carries its
|
|
80
|
+
* own image / nine-slice / rounded corners / size / position, none of it configured here.
|
|
115
81
|
*/
|
|
116
82
|
export class PaginationNodeView extends NodeView {
|
|
117
83
|
list;
|
|
@@ -125,9 +91,8 @@ export class PaginationNodeView extends NodeView {
|
|
|
125
91
|
inactiveTexture;
|
|
126
92
|
numberStyle;
|
|
127
93
|
numberActiveColor;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
numberActiveCornerRadius;
|
|
94
|
+
/** The authored highlight node; the widget owns only its `visible` flag while `style: "numbers"`. */
|
|
95
|
+
activeBackground;
|
|
131
96
|
pageCountState;
|
|
132
97
|
currentPage;
|
|
133
98
|
dotWidth;
|
|
@@ -144,9 +109,6 @@ export class PaginationNodeView extends NodeView {
|
|
|
144
109
|
this.inactiveTexture = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;
|
|
145
110
|
this.numberStyle = node.numberStyle;
|
|
146
111
|
this.numberActiveColor = node.numberActiveColor;
|
|
147
|
-
this.numberActiveBackgroundTexture = node.numberActiveBackgroundAssetId === undefined ? undefined : this.textureFor(node.numberActiveBackgroundAssetId);
|
|
148
|
-
this.numberActiveNineSlice = node.numberActiveNineSlice;
|
|
149
|
-
this.numberActiveCornerRadius = node.numberActiveNineSlice === undefined ? node.numberActiveCornerRadius : undefined;
|
|
150
112
|
this.pageCountState = Math.max(1, Math.round(node.pageCount));
|
|
151
113
|
this.visibleSlots = node.visiblePageCount;
|
|
152
114
|
this.currentPage = clampPage(node.defaultPage, this.pageCount);
|
|
@@ -157,11 +119,6 @@ export class PaginationNodeView extends NodeView {
|
|
|
157
119
|
this.buildItems();
|
|
158
120
|
this.setContent(this.list);
|
|
159
121
|
}
|
|
160
|
-
createBackgroundView(texture) {
|
|
161
|
-
return this.numberActiveNineSlice === undefined
|
|
162
|
-
? new Sprite(texture)
|
|
163
|
-
: new NineSliceSprite({ texture, leftWidth: this.numberActiveNineSlice.left, topHeight: this.numberActiveNineSlice.top, rightWidth: this.numberActiveNineSlice.right, bottomHeight: this.numberActiveNineSlice.bottom });
|
|
164
|
-
}
|
|
165
122
|
/** How many indicator slots are drawn: the fixed authored window, or one slot per real page. */
|
|
166
123
|
get slotCount() {
|
|
167
124
|
return this.visibleSlots === undefined ? this.pageCount : Math.max(1, Math.round(this.visibleSlots));
|
|
@@ -185,8 +142,6 @@ export class PaginationNodeView extends NodeView {
|
|
|
185
142
|
const fill = isActive ? this.numberActiveColor ?? baseFill : baseFill;
|
|
186
143
|
const item = new NumberItem(new Text({ text: exists ? String(page + 1) : "", style: numberTextStyle(this.numberStyle, fill, this.fonts) }));
|
|
187
144
|
item.resize(this.dotWidth, this.dotHeight);
|
|
188
|
-
if (isActive && this.numberActiveBackgroundTexture !== undefined)
|
|
189
|
-
item.setBackground(this.createBackgroundView(this.numberActiveBackgroundTexture), this.numberActiveCornerRadius);
|
|
190
145
|
return item;
|
|
191
146
|
}
|
|
192
147
|
/** Recreates every item for the current `styleMode`/`slotCount`/`dotWidth`/`dotHeight`. */
|
|
@@ -225,7 +180,6 @@ export class PaginationNodeView extends NodeView {
|
|
|
225
180
|
if (item instanceof NumberItem) {
|
|
226
181
|
item.numberText.text = exists ? String(page + 1) : "";
|
|
227
182
|
item.numberText.style = numberTextStyle(this.numberStyle, isActive ? this.numberActiveColor ?? baseFill : baseFill, this.fonts);
|
|
228
|
-
item.setBackground(isActive && this.numberActiveBackgroundTexture !== undefined ? this.createBackgroundView(this.numberActiveBackgroundTexture) : undefined, this.numberActiveCornerRadius);
|
|
229
183
|
return;
|
|
230
184
|
}
|
|
231
185
|
item.texture = isActive ? this.activeTexture : this.inactiveTexture;
|
|
@@ -254,6 +208,20 @@ export class PaginationNodeView extends NodeView {
|
|
|
254
208
|
if (this.arrows.next !== undefined)
|
|
255
209
|
this.arrows.next.enabled = this.currentPage < this.pageCount - 1;
|
|
256
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* Связывает виджет с авторской нодой-подсветкой активной страницы. Как и стрелки, нода остаётся
|
|
213
|
+
* обычным узлом сцены со своим визуалом — виджет лишь владеет её флагом `visible`: показывает при
|
|
214
|
+
* `style: "numbers"` (активная страница есть всегда) и прячет в стиле `dots`.
|
|
215
|
+
*/
|
|
216
|
+
setActiveBackground(view) {
|
|
217
|
+
this.activeBackground = view;
|
|
218
|
+
this.applyActiveBackgroundVisibility();
|
|
219
|
+
}
|
|
220
|
+
applyActiveBackgroundVisibility() {
|
|
221
|
+
if (this.activeBackground === undefined)
|
|
222
|
+
return;
|
|
223
|
+
this.activeBackground.visible = this.styleMode === "numbers";
|
|
224
|
+
}
|
|
257
225
|
syncContent(node) {
|
|
258
226
|
if (node.type !== "pagination")
|
|
259
227
|
return;
|
|
@@ -270,9 +238,7 @@ export class PaginationNodeView extends NodeView {
|
|
|
270
238
|
this.inactiveTexture = inactive;
|
|
271
239
|
this.numberStyle = node.numberStyle;
|
|
272
240
|
this.numberActiveColor = node.numberActiveColor;
|
|
273
|
-
this.
|
|
274
|
-
this.numberActiveNineSlice = node.numberActiveNineSlice;
|
|
275
|
-
this.numberActiveCornerRadius = node.numberActiveNineSlice === undefined ? node.numberActiveCornerRadius : undefined;
|
|
241
|
+
this.applyActiveBackgroundVisibility();
|
|
276
242
|
this.dotWidth = node.dotSize.width;
|
|
277
243
|
this.dotHeight = node.dotSize.height;
|
|
278
244
|
this.currentPage = clampPage(this.currentPage, this.pageCount);
|
|
@@ -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,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAyB,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAA6B,MAAM,eAAe,CAAC;AAIpE,MAAM,oBAAoB,GAAwB,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;AAEpP;wGACwG;AACxG,SAAS,eAAe,CAAC,KAAsC,EAAE,IAAY,EAAE,KAA8C;IAC3H,MAAM,QAAQ,GAAG,KAAK,IAAI,oBAAoB,CAAC;IAC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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\";\nimport { List } from \"@pixi/ui\";\nimport { Container, Graphics, NineSliceSprite, Sprite, Text, Texture, type TextStyleOptions } from \"pixi.js\";\nimport { Signal } from \"typed-signals\";\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\n\nexport type { PaginationNode };\n\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 };\n\n/** Same shape `ValueControlNodeViews.ts`'s own `textStyle` resolves — kept as its own small copy rather\n * than shared, the same call ADR 0029 makes for two similar-but-separately-evolving style resolvers. */\nfunction numberTextStyle(style: TextStyleDefinition | undefined, fill: string, fonts: ReadonlyMap<string, string> | undefined): Partial<TextStyleOptions> {\n const resolved = style ?? DEFAULT_NUMBER_STYLE;\n return {\n fontFamily: resolved.fontAssetId === undefined ? resolved.fontFamily : fonts?.get(resolved.fontAssetId) ?? resolved.fontFamily,\n fontSize: resolved.fontSize,\n fontWeight: resolved.fontWeight,\n fontStyle: resolved.fontStyle,\n fill,\n align: resolved.align,\n wordWrap: resolved.wordWrap,\n breakWords: resolved.breakWords,\n lineHeight: resolved.lineHeight,\n letterSpacing: resolved.letterSpacing,\n stroke: resolved.stroke === undefined ? undefined : { color: resolved.stroke.color, width: resolved.stroke.width },\n };\n}\n\n/**\n * Кнопка-стрелка пагинатора: ровно та часть `ButtonNodeView`/`StagedButtonNodeView`, которая нужна\n * виджету, — нажатие и «доступна ли». Тип объявлен структурно, чтобы этот файл не зависел от обоих\n * классов кнопок и не решал, какой из них «настоящий».\n */\nexport type PaginationArrow = { onPress: { connect(handler: () => void): unknown }; enabled: boolean };\n\n/** Clamps a page index into the valid `[0, pageCount)` range; an empty widget still shows dot 0. */\nfunction clampPage(page: number, pageCount: number): number {\n return Math.min(Math.max(0, Math.round(page)), Math.max(0, pageCount - 1));\n}\n\n/**\n * One `numbers`-style item: a centered page-number label, plus an optional \"pill\" background shown\n * only while it is the current page. `width`/`height` are overridden to the authored `dotSize` — the\n * same fixed-footprint trick `ScrollItemContainer` uses — so the `List` spaces every item evenly\n * whether or not its (rarely-present) background happens to be attached right now.\n */\n/** @internal Exported only so DOM-free render-contract tests can exercise the background in isolation. */\nexport class NumberItem extends Container {\n private itemWidth = 0;\n private itemHeight = 0;\n private background?: Sprite | NineSliceSprite;\n private backgroundMask?: Graphics;\n private backgroundCornerRadius?: number;\n\n // Named `numberText`, not `label`: `Container.label` is pixi.js's own display-object name string.\n constructor(readonly numberText: Text) {\n super();\n numberText.anchor.set(0.5);\n super.addChild(numberText);\n }\n\n override get width(): number { return this.itemWidth; }\n override set width(value: number) { this.itemWidth = value; }\n override get height(): number { return this.itemHeight; }\n override set height(value: number) { this.itemHeight = value; }\n\n resize(width: number, height: number): void {\n this.itemWidth = width;\n this.itemHeight = height;\n this.numberText.position.set(width / 2, height / 2);\n this.background?.setSize(width, height);\n this.syncBackgroundMask();\n }\n\n /** Replaces the pill behind the label (destroying the previous one); `undefined` removes it. */\n setBackground(view: Sprite | NineSliceSprite | undefined, cornerRadius: number | undefined): void {\n if (this.background !== undefined) { super.removeChild(this.background); this.background.destroy(); }\n if (this.backgroundMask !== undefined) { super.removeChild(this.backgroundMask); this.backgroundMask.destroy(); this.backgroundMask = undefined; }\n this.background = view;\n this.backgroundCornerRadius = cornerRadius;\n if (view === undefined) return;\n view.setSize(this.itemWidth, this.itemHeight);\n super.addChildAt(view, 0);\n if (cornerRadius !== undefined) {\n this.backgroundMask = new Graphics();\n this.syncBackgroundMask();\n // Keep the mask before the background in this item's render tree, as SceneViewport does.\n super.addChildAt(this.backgroundMask, 0);\n view.mask = this.backgroundMask;\n }\n }\n\n private syncBackgroundMask(): void {\n if (this.backgroundMask === undefined) return;\n const radius = Math.min(this.backgroundCornerRadius ?? 0, this.itemWidth / 2, this.itemHeight / 2);\n this.backgroundMask.clear().roundRect(0, 0, this.itemWidth, this.itemHeight, radius).fill(0xffffff);\n }\n}\n\n/**\n * Standalone page indicator: N procedurally generated items arranged by `@pixi/ui`'s `List` (the same\n * approach `ScrollViewNodeView`/`scrollView.ts` use for arranging children) — this view never\n * reimplements arrangement. Deliberately not wired to any scroll-view: game code owns the actual page\n * transition and drives the widget one-way through `setPaginationViewPage`/`setPaginationViewPageCount`,\n * the same relationship a slider or progress bar has to whatever value it displays.\n *\n * `style` picks between two mutually exclusive, differently-rendered item kinds — image dots\n * (`Sprite`, two states) or rendered page-number text (`NumberItem`: a label, base style + an optional\n * highlight color, plus an optional pill background behind only the current page) — never both.\n * Switching `style` rebuilds every item, the same \"view's required *type* changed\" rule\n * `StagedButtonNodeView` follows for its state views; `pageCount`/`dotSize` changes do too, since the\n * item count/footprint is a runtime fact about this control, not scene topology — it only rebuilds this\n * view's own item children, never the owning `NodeView` or the wider scene tree. The active pill itself\n * is not structural: switching pages only recreates the (one) background view that needs to move.\n *\n * With `visiblePageCount` set, the indicator becomes a fixed strip of that many slots with the active\n * page always in the middle one (4 pages, page 3 active → 2-3-4). A slot pointing outside the real\n * page range keeps its footprint and renders nothing, so the active page never shifts sideways.\n *\n * The prev/next arrows are ordinary authored button nodes placed wherever the layout needs them; the\n * widget only takes their views (`scene.ts`'s `wireNodeReferences`, the same address → view resolution\n * Spine connector targets use) and steps the page on press. It never draws an arrow itself.\n */\nexport class PaginationNodeView extends NodeView {\n private readonly list: List;\n private readonly interaction: SceneInteractionMode;\n private readonly fonts: ReadonlyMap<string, string> | undefined;\n private items: (Sprite | NumberItem)[] = [];\n private visibleSlots: number | undefined;\n private arrows?: { previous?: PaginationArrow; next?: PaginationArrow };\n private styleMode: PaginationNode[\"style\"];\n private activeTexture: Texture;\n private inactiveTexture: Texture;\n private numberStyle: TextStyleDefinition | undefined;\n private numberActiveColor: string | undefined;\n private numberActiveBackgroundTexture: Texture | undefined;\n private numberActiveNineSlice: LayoutPadding | undefined;\n private numberActiveCornerRadius: number | undefined;\n private pageCountState: number;\n private currentPage: number;\n private dotWidth: number;\n private dotHeight: number;\n private clickableState: boolean;\n\n /** Fires only from a click on an item (when `clickable`); setting `page` programmatically never emits. */\n readonly onPageChange = new Signal<(page: number) => void>();\n\n constructor(node: PaginationNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, fonts: ReadonlyMap<string, string> | undefined) {\n super(textures);\n this.interaction = interaction;\n this.fonts = fonts;\n this.styleMode = node.style;\n this.activeTexture = node.activeAssetId === undefined ? Texture.WHITE : this.textureFor(node.activeAssetId) ?? Texture.WHITE;\n this.inactiveTexture = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;\n this.numberStyle = node.numberStyle;\n this.numberActiveColor = node.numberActiveColor;\n this.numberActiveBackgroundTexture = node.numberActiveBackgroundAssetId === undefined ? undefined : this.textureFor(node.numberActiveBackgroundAssetId);\n this.numberActiveNineSlice = node.numberActiveNineSlice;\n this.numberActiveCornerRadius = node.numberActiveNineSlice === undefined ? node.numberActiveCornerRadius : undefined;\n this.pageCountState = Math.max(1, Math.round(node.pageCount));\n this.visibleSlots = node.visiblePageCount;\n this.currentPage = clampPage(node.defaultPage, this.pageCount);\n this.dotWidth = node.dotSize.width;\n this.dotHeight = node.dotSize.height;\n this.clickableState = node.clickable;\n this.list = new List({ type: node.direction, elementsMargin: node.spacing });\n this.buildItems();\n this.setContent(this.list);\n }\n\n private createBackgroundView(texture: Texture): Sprite | NineSliceSprite {\n return this.numberActiveNineSlice === undefined\n ? new Sprite(texture)\n : new NineSliceSprite({ texture, leftWidth: this.numberActiveNineSlice.left, topHeight: this.numberActiveNineSlice.top, rightWidth: this.numberActiveNineSlice.right, bottomHeight: this.numberActiveNineSlice.bottom });\n }\n\n /** How many indicator slots are drawn: the fixed authored window, or one slot per real page. */\n private get slotCount(): number {\n return this.visibleSlots === undefined ? this.pageCount : Math.max(1, Math.round(this.visibleSlots));\n }\n\n /** The page a slot points at. Windowed slots slide with the current page, which keeps its middle seat. */\n private pageForSlot(slot: number): number {\n return this.visibleSlots === undefined ? slot : this.currentPage - Math.floor(this.slotCount / 2) + slot;\n }\n\n private createItem(slot: number): Sprite | NumberItem {\n const page = this.pageForSlot(slot);\n const exists = page >= 0 && page < this.pageCount;\n const isActive = exists && page === this.currentPage;\n if (this.styleMode === \"dots\") {\n const dot = new Sprite(isActive ? this.activeTexture : this.inactiveTexture);\n dot.setSize(this.dotWidth, this.dotHeight);\n // An out-of-range slot renders nothing but keeps its size, so `List` still reserves its place.\n dot.visible = exists;\n return dot;\n }\n const baseFill = this.numberStyle?.fill ?? DEFAULT_NUMBER_STYLE.fill;\n const fill = isActive ? this.numberActiveColor ?? baseFill : baseFill;\n const item = new NumberItem(new Text({ text: exists ? String(page + 1) : \"\", style: numberTextStyle(this.numberStyle, fill, this.fonts) }));\n item.resize(this.dotWidth, this.dotHeight);\n if (isActive && this.numberActiveBackgroundTexture !== undefined) item.setBackground(this.createBackgroundView(this.numberActiveBackgroundTexture), this.numberActiveCornerRadius);\n return item;\n }\n\n /** Recreates every item for the current `styleMode`/`slotCount`/`dotWidth`/`dotHeight`. */\n private buildItems(): void {\n this.list.removeChildren();\n this.items = [];\n for (let slot = 0; slot < this.slotCount; slot++) {\n const item = this.createItem(slot);\n this.wireItem(item, slot);\n this.items.push(item);\n this.list.addChild(item);\n }\n this.applyArrowState();\n }\n\n /** Authoring canvas stays inert like every other control; a clickable item is only live at runtime. */\n private wireItem(item: Sprite | NumberItem, slot: number): void {\n if (this.interaction === \"authoring\" || !this.clickableState) { item.eventMode = \"none\"; return; }\n item.eventMode = \"static\";\n item.cursor = \"pointer\";\n // Resolved on click, not captured: a windowed slot points at a different page after every move.\n item.on(\"pointertap\", () => {\n const page = this.pageForSlot(slot);\n if (page >= 0 && page < this.pageCount) this.setPage(page);\n });\n }\n\n private applyCurrentPage(): void {\n const baseFill = this.numberStyle?.fill ?? DEFAULT_NUMBER_STYLE.fill;\n this.items.forEach((item, slot) => {\n const page = this.pageForSlot(slot);\n const exists = page >= 0 && page < this.pageCount;\n const isActive = exists && page === this.currentPage;\n if (item instanceof NumberItem) {\n item.numberText.text = exists ? String(page + 1) : \"\";\n item.numberText.style = numberTextStyle(this.numberStyle, isActive ? this.numberActiveColor ?? baseFill : baseFill, this.fonts);\n item.setBackground(isActive && this.numberActiveBackgroundTexture !== undefined ? this.createBackgroundView(this.numberActiveBackgroundTexture) : undefined, this.numberActiveCornerRadius);\n return;\n }\n item.texture = isActive ? this.activeTexture : this.inactiveTexture;\n item.setSize(this.dotWidth, this.dotHeight);\n item.visible = exists;\n });\n this.applyArrowState();\n }\n\n /**\n * Подключает авторские кнопки-стрелки: нажатие шагает на страницу назад/вперёд и эмитит\n * `onPageChange`, как клик по самому пункту. Кнопки остаются обычными нодами сцены — виджет только\n * подписывается на них и гасит ту, за которой страниц больше нет.\n */\n setArrows(arrows: { previous?: PaginationArrow; next?: PaginationArrow }): void {\n this.arrows = arrows;\n arrows.previous?.onPress.connect(() => this.setPage(this.currentPage - 1));\n arrows.next?.onPress.connect(() => this.setPage(this.currentPage + 1));\n this.applyArrowState();\n }\n\n /** На краях диапазона соответствующая стрелка недоступна — она никуда не ведёт. */\n private applyArrowState(): void {\n if (this.arrows === undefined) return;\n if (this.arrows.previous !== undefined) this.arrows.previous.enabled = this.currentPage > 0;\n if (this.arrows.next !== undefined) this.arrows.next.enabled = this.currentPage < this.pageCount - 1;\n }\n\n protected syncContent(node: UINode): void {\n if (node.type !== \"pagination\") return;\n const active = node.activeAssetId === undefined ? Texture.WHITE : this.textureFor(node.activeAssetId) ?? Texture.WHITE;\n const inactive = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;\n const pageCount = Math.max(1, Math.round(node.pageCount));\n this.clickableState = node.clickable;\n\n const previousSlotCount = this.slotCount;\n this.visibleSlots = node.visiblePageCount;\n this.pageCountState = pageCount;\n const structureChanged = node.style !== this.styleMode || this.slotCount !== previousSlotCount || node.dotSize.width !== this.dotWidth || node.dotSize.height !== this.dotHeight;\n this.styleMode = node.style;\n this.activeTexture = active;\n this.inactiveTexture = inactive;\n this.numberStyle = node.numberStyle;\n this.numberActiveColor = node.numberActiveColor;\n this.numberActiveBackgroundTexture = node.numberActiveBackgroundAssetId === undefined ? undefined : this.textureFor(node.numberActiveBackgroundAssetId);\n this.numberActiveNineSlice = node.numberActiveNineSlice;\n this.numberActiveCornerRadius = node.numberActiveNineSlice === undefined ? node.numberActiveCornerRadius : undefined;\n this.dotWidth = node.dotSize.width;\n this.dotHeight = node.dotSize.height;\n this.currentPage = clampPage(this.currentPage, this.pageCount);\n\n if (this.list.type !== node.direction) this.list.type = node.direction;\n if (this.list.elementsMargin !== node.spacing) this.list.elementsMargin = node.spacing;\n\n if (structureChanged) this.buildItems();\n else this.applyCurrentPage();\n }\n\n get pageCount(): number { return this.pageCountState; }\n\n /** Used by `setPaginationViewPageCount` once game code knows the real content length. */\n set pageCount(value: number) {\n const next = Math.max(1, Math.round(value));\n if (next === this.pageCountState) return;\n const previousSlotCount = this.slotCount;\n this.pageCountState = next;\n this.currentPage = clampPage(this.currentPage, this.pageCount);\n if (this.slotCount === previousSlotCount) this.applyCurrentPage();\n else this.buildItems();\n }\n\n get page(): number { return this.currentPage; }\n\n /** External sync from game code (or editor preview): highlights an item without emitting `onPageChange`. */\n set page(value: number) {\n const next = clampPage(value, this.pageCountState);\n if (next === this.currentPage) return;\n this.currentPage = next;\n this.applyCurrentPage();\n }\n\n /** An item click: highlights immediately, then notifies game code — the same order a checkbox/slider follows. */\n private setPage(index: number): void {\n const next = clampPage(index, this.pageCountState);\n if (next !== this.currentPage) { this.currentPage = next; this.applyCurrentPage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AE,IAAI,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW;YAAE,OAAO;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,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 PaginationNode, type TextStyleDefinition, type UINode } from \"@pixi-ui-editor/schema\";\nimport { List } from \"@pixi/ui\";\nimport { Container, Sprite, Text, Texture, type TextStyleOptions } from \"pixi.js\";\nimport { Signal } from \"typed-signals\";\nimport { NodeView, type SceneInteractionMode } from \"./NodeView.js\";\n\nexport type { PaginationNode };\n\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 };\n\n/** Same shape `ValueControlNodeViews.ts`'s own `textStyle` resolves — kept as its own small copy rather\n * than shared, the same call ADR 0029 makes for two similar-but-separately-evolving style resolvers. */\nfunction numberTextStyle(style: TextStyleDefinition | undefined, fill: string, fonts: ReadonlyMap<string, string> | undefined): Partial<TextStyleOptions> {\n const resolved = style ?? DEFAULT_NUMBER_STYLE;\n return {\n fontFamily: resolved.fontAssetId === undefined ? resolved.fontFamily : fonts?.get(resolved.fontAssetId) ?? resolved.fontFamily,\n fontSize: resolved.fontSize,\n fontWeight: resolved.fontWeight,\n fontStyle: resolved.fontStyle,\n fill,\n align: resolved.align,\n wordWrap: resolved.wordWrap,\n breakWords: resolved.breakWords,\n lineHeight: resolved.lineHeight,\n letterSpacing: resolved.letterSpacing,\n stroke: resolved.stroke === undefined ? undefined : { color: resolved.stroke.color, width: resolved.stroke.width },\n };\n}\n\n/**\n * Кнопка-стрелка пагинатора: ровно та часть `ButtonNodeView`/`StagedButtonNodeView`, которая нужна\n * виджету, — нажатие и «доступна ли». Тип объявлен структурно, чтобы этот файл не зависел от обоих\n * классов кнопок и не решал, какой из них «настоящий».\n */\nexport type PaginationArrow = { onPress: { connect(handler: () => void): unknown }; enabled: boolean };\n\n/** Clamps a page index into the valid `[0, pageCount)` range; an empty widget still shows dot 0. */\nfunction clampPage(page: number, pageCount: number): number {\n return Math.min(Math.max(0, Math.round(page)), Math.max(0, pageCount - 1));\n}\n\n/**\n * One `numbers`-style item: a centered page-number label. `width`/`height` are overridden to the\n * authored `dotSize` — the same fixed-footprint trick `ScrollItemContainer` uses — so the `List`\n * spaces every item evenly. The active-page highlight is a separate authored node the widget only\n * toggles `visible` on (see `PaginationNodeView.setActiveBackground`), never a child of this item.\n */\n/** @internal Exported only so DOM-free render-contract tests can exercise the footprint in isolation. */\nexport class NumberItem extends Container {\n private itemWidth = 0;\n private itemHeight = 0;\n\n // Named `numberText`, not `label`: `Container.label` is pixi.js's own display-object name string.\n constructor(readonly numberText: Text) {\n super();\n numberText.anchor.set(0.5);\n super.addChild(numberText);\n }\n\n override get width(): number { return this.itemWidth; }\n override set width(value: number) { this.itemWidth = value; }\n override get height(): number { return this.itemHeight; }\n override set height(value: number) { this.itemHeight = value; }\n\n resize(width: number, height: number): void {\n this.itemWidth = width;\n this.itemHeight = height;\n this.numberText.position.set(width / 2, height / 2);\n }\n}\n\n/**\n * Standalone page indicator: N procedurally generated items arranged by `@pixi/ui`'s `List` (the same\n * approach `ScrollViewNodeView`/`scrollView.ts` use for arranging children) — this view never\n * reimplements arrangement. Deliberately not wired to any scroll-view: game code owns the actual page\n * transition and drives the widget one-way through `setPaginationViewPage`/`setPaginationViewPageCount`,\n * the same relationship a slider or progress bar has to whatever value it displays.\n *\n * `style` picks between two mutually exclusive, differently-rendered item kinds — image dots\n * (`Sprite`, two states) or rendered page-number text (`NumberItem`: a label, base style + an optional\n * highlight color) — never both. Switching `style` rebuilds every item, the same \"view's required\n * *type* changed\" rule `StagedButtonNodeView` follows for its state views; `pageCount`/`dotSize`\n * changes do too, since the item count/footprint is a runtime fact about this control, not scene\n * topology — it only rebuilds this view's own item children, never the owning `NodeView` or the wider\n * scene tree.\n *\n * With `visiblePageCount` set, the indicator becomes a fixed strip of that many slots with the active\n * page always in the middle one (4 pages, page 3 active → 2-3-4). A slot pointing outside the real\n * page range keeps its footprint and renders nothing, so the active page never shifts sideways.\n *\n * The prev/next arrows are ordinary authored button nodes placed wherever the layout needs them; the\n * widget only takes their views (`scene.ts`'s `wireNodeReferences`, the same address → view resolution\n * Spine connector targets use) and steps the page on press. It never draws an arrow itself. The\n * `numbers`-style active-page highlight follows the same reference-not-owned contract: it is an\n * authored node the widget only toggles `visible` on while `style: \"numbers\"` — the node carries its\n * own image / nine-slice / rounded corners / size / position, none of it configured here.\n */\nexport class PaginationNodeView extends NodeView {\n private readonly list: List;\n private readonly interaction: SceneInteractionMode;\n private readonly fonts: ReadonlyMap<string, string> | undefined;\n private items: (Sprite | NumberItem)[] = [];\n private visibleSlots: number | undefined;\n private arrows?: { previous?: PaginationArrow; next?: PaginationArrow };\n private styleMode: PaginationNode[\"style\"];\n private activeTexture: Texture;\n private inactiveTexture: Texture;\n private numberStyle: TextStyleDefinition | undefined;\n private numberActiveColor: string | undefined;\n /** The authored highlight node; the widget owns only its `visible` flag while `style: \"numbers\"`. */\n private activeBackground: Container | undefined;\n private pageCountState: number;\n private currentPage: number;\n private dotWidth: number;\n private dotHeight: number;\n private clickableState: boolean;\n\n /** Fires only from a click on an item (when `clickable`); setting `page` programmatically never emits. */\n readonly onPageChange = new Signal<(page: number) => void>();\n\n constructor(node: PaginationNode, textures: ReadonlyMap<string, Texture> | undefined, interaction: SceneInteractionMode, fonts: ReadonlyMap<string, string> | undefined) {\n super(textures);\n this.interaction = interaction;\n this.fonts = fonts;\n this.styleMode = node.style;\n this.activeTexture = node.activeAssetId === undefined ? Texture.WHITE : this.textureFor(node.activeAssetId) ?? Texture.WHITE;\n this.inactiveTexture = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;\n this.numberStyle = node.numberStyle;\n this.numberActiveColor = node.numberActiveColor;\n this.pageCountState = Math.max(1, Math.round(node.pageCount));\n this.visibleSlots = node.visiblePageCount;\n this.currentPage = clampPage(node.defaultPage, this.pageCount);\n this.dotWidth = node.dotSize.width;\n this.dotHeight = node.dotSize.height;\n this.clickableState = node.clickable;\n this.list = new List({ type: node.direction, elementsMargin: node.spacing });\n this.buildItems();\n this.setContent(this.list);\n }\n\n /** How many indicator slots are drawn: the fixed authored window, or one slot per real page. */\n private get slotCount(): number {\n return this.visibleSlots === undefined ? this.pageCount : Math.max(1, Math.round(this.visibleSlots));\n }\n\n /** The page a slot points at. Windowed slots slide with the current page, which keeps its middle seat. */\n private pageForSlot(slot: number): number {\n return this.visibleSlots === undefined ? slot : this.currentPage - Math.floor(this.slotCount / 2) + slot;\n }\n\n private createItem(slot: number): Sprite | NumberItem {\n const page = this.pageForSlot(slot);\n const exists = page >= 0 && page < this.pageCount;\n const isActive = exists && page === this.currentPage;\n if (this.styleMode === \"dots\") {\n const dot = new Sprite(isActive ? this.activeTexture : this.inactiveTexture);\n dot.setSize(this.dotWidth, this.dotHeight);\n // An out-of-range slot renders nothing but keeps its size, so `List` still reserves its place.\n dot.visible = exists;\n return dot;\n }\n const baseFill = this.numberStyle?.fill ?? DEFAULT_NUMBER_STYLE.fill;\n const fill = isActive ? this.numberActiveColor ?? baseFill : baseFill;\n const item = new NumberItem(new Text({ text: exists ? String(page + 1) : \"\", style: numberTextStyle(this.numberStyle, fill, this.fonts) }));\n item.resize(this.dotWidth, this.dotHeight);\n return item;\n }\n\n /** Recreates every item for the current `styleMode`/`slotCount`/`dotWidth`/`dotHeight`. */\n private buildItems(): void {\n this.list.removeChildren();\n this.items = [];\n for (let slot = 0; slot < this.slotCount; slot++) {\n const item = this.createItem(slot);\n this.wireItem(item, slot);\n this.items.push(item);\n this.list.addChild(item);\n }\n this.applyArrowState();\n }\n\n /** Authoring canvas stays inert like every other control; a clickable item is only live at runtime. */\n private wireItem(item: Sprite | NumberItem, slot: number): void {\n if (this.interaction === \"authoring\" || !this.clickableState) { item.eventMode = \"none\"; return; }\n item.eventMode = \"static\";\n item.cursor = \"pointer\";\n // Resolved on click, not captured: a windowed slot points at a different page after every move.\n item.on(\"pointertap\", () => {\n const page = this.pageForSlot(slot);\n if (page >= 0 && page < this.pageCount) this.setPage(page);\n });\n }\n\n private applyCurrentPage(): void {\n const baseFill = this.numberStyle?.fill ?? DEFAULT_NUMBER_STYLE.fill;\n this.items.forEach((item, slot) => {\n const page = this.pageForSlot(slot);\n const exists = page >= 0 && page < this.pageCount;\n const isActive = exists && page === this.currentPage;\n if (item instanceof NumberItem) {\n item.numberText.text = exists ? String(page + 1) : \"\";\n item.numberText.style = numberTextStyle(this.numberStyle, isActive ? this.numberActiveColor ?? baseFill : baseFill, this.fonts);\n return;\n }\n item.texture = isActive ? this.activeTexture : this.inactiveTexture;\n item.setSize(this.dotWidth, this.dotHeight);\n item.visible = exists;\n });\n this.applyArrowState();\n }\n\n /**\n * Подключает авторские кнопки-стрелки: нажатие шагает на страницу назад/вперёд и эмитит\n * `onPageChange`, как клик по самому пункту. Кнопки остаются обычными нодами сцены — виджет только\n * подписывается на них и гасит ту, за которой страниц больше нет.\n */\n setArrows(arrows: { previous?: PaginationArrow; next?: PaginationArrow }): void {\n this.arrows = arrows;\n arrows.previous?.onPress.connect(() => this.setPage(this.currentPage - 1));\n arrows.next?.onPress.connect(() => this.setPage(this.currentPage + 1));\n this.applyArrowState();\n }\n\n /** На краях диапазона соответствующая стрелка недоступна — она никуда не ведёт. */\n private applyArrowState(): void {\n if (this.arrows === undefined) return;\n if (this.arrows.previous !== undefined) this.arrows.previous.enabled = this.currentPage > 0;\n if (this.arrows.next !== undefined) this.arrows.next.enabled = this.currentPage < this.pageCount - 1;\n }\n\n /**\n * Связывает виджет с авторской нодой-подсветкой активной страницы. Как и стрелки, нода остаётся\n * обычным узлом сцены со своим визуалом — виджет лишь владеет её флагом `visible`: показывает при\n * `style: \"numbers\"` (активная страница есть всегда) и прячет в стиле `dots`.\n */\n setActiveBackground(view: Container | undefined): void {\n this.activeBackground = view;\n this.applyActiveBackgroundVisibility();\n }\n\n private applyActiveBackgroundVisibility(): void {\n if (this.activeBackground === undefined) return;\n this.activeBackground.visible = this.styleMode === \"numbers\";\n }\n\n protected syncContent(node: UINode): void {\n if (node.type !== \"pagination\") return;\n const active = node.activeAssetId === undefined ? Texture.WHITE : this.textureFor(node.activeAssetId) ?? Texture.WHITE;\n const inactive = node.inactiveAssetId === undefined ? Texture.WHITE : this.textureFor(node.inactiveAssetId) ?? Texture.WHITE;\n const pageCount = Math.max(1, Math.round(node.pageCount));\n this.clickableState = node.clickable;\n\n const previousSlotCount = this.slotCount;\n this.visibleSlots = node.visiblePageCount;\n this.pageCountState = pageCount;\n const structureChanged = node.style !== this.styleMode || this.slotCount !== previousSlotCount || node.dotSize.width !== this.dotWidth || node.dotSize.height !== this.dotHeight;\n this.styleMode = node.style;\n this.activeTexture = active;\n this.inactiveTexture = inactive;\n this.numberStyle = node.numberStyle;\n this.numberActiveColor = node.numberActiveColor;\n this.applyActiveBackgroundVisibility();\n this.dotWidth = node.dotSize.width;\n this.dotHeight = node.dotSize.height;\n this.currentPage = clampPage(this.currentPage, this.pageCount);\n\n if (this.list.type !== node.direction) this.list.type = node.direction;\n if (this.list.elementsMargin !== node.spacing) this.list.elementsMargin = node.spacing;\n\n if (structureChanged) this.buildItems();\n else this.applyCurrentPage();\n }\n\n get pageCount(): number { return this.pageCountState; }\n\n /** Used by `setPaginationViewPageCount` once game code knows the real content length. */\n set pageCount(value: number) {\n const next = Math.max(1, Math.round(value));\n if (next === this.pageCountState) return;\n const previousSlotCount = this.slotCount;\n this.pageCountState = next;\n this.currentPage = clampPage(this.currentPage, this.pageCount);\n if (this.slotCount === previousSlotCount) this.applyCurrentPage();\n else this.buildItems();\n }\n\n get page(): number { return this.currentPage; }\n\n /** External sync from game code (or editor preview): highlights an item without emitting `onPageChange`. */\n set page(value: number) {\n const next = clampPage(value, this.pageCountState);\n if (next === this.currentPage) return;\n this.currentPage = next;\n this.applyCurrentPage();\n }\n\n /** An item click: highlights immediately, then notifies game code — the same order a checkbox/slider follows. */\n private setPage(index: number): void {\n const next = clampPage(index, this.pageCountState);\n if (next !== this.currentPage) { this.currentPage = next; this.applyCurrentPage(); }\n this.onPageChange.emit(next);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpineNodeView.d.ts","sourceRoot":"","sources":["../../src/views/SpineNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACvH,OAAO,EAA2C,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACnK,OAAO,EAAE,SAAS,EAAoB,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,KAAK,gBAAgB,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,CAAC;AAC/D,KAAK,uBAAuB,GAAG,gBAAgB,GAAG,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG,OAAO,CAAC,gBAAgB,CA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IAED,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwC7C;IAED,8EAA8E;IAC9E,qBAAqB,IAAI,IAAI,CAkD5B;IAED,OAAO,CAAC,uBAAuB;IAiB/B,iBAAiB,CAAC,cAAc,EAAE,mBAAmB,GAAG,SAAS,GAAG,IAAI,CAEvE;IAED;;;;;OAKG;IACH,SAAS,CAAC,wBAAwB,IAAI,IAAI,CAEzC;IAED,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAiClG;CACF"}
|
|
@@ -187,6 +187,8 @@ export class SpineNodeView extends NodeView {
|
|
|
187
187
|
}
|
|
188
188
|
syncContent(node, transform, profile) {
|
|
189
189
|
this.activeProfile = profile;
|
|
190
|
+
if (node.type === "spine" && this.content !== undefined)
|
|
191
|
+
this.content.alpha = node.opacity ?? 1;
|
|
190
192
|
if (this.content instanceof Spine) {
|
|
191
193
|
if (node.type === "spine") {
|
|
192
194
|
const settings = resolveSpineSettings(node, profile);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpineNodeView.js","sourceRoot":"","sources":["../../src/views/SpineNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAqB,MAAM,iCAAiC,CAAC;AACvH,OAAO,EAAE,uCAAuC,EAAoF,MAAM,wBAAwB,CAAC;AACnK,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgBzC,SAAS,oBAAoB,CAAC,OAAgC;IAC5D,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,MAAM,IAAI,OAAO,CA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;aAAM,IAAI,IAAI,CAAC,OAAO,YAAY,QAAQ,EAAE,CAAC;YAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;CACF","sourcesContent":["import { PointAttachment, RegionAttachment, Spine, Vector2, type SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport { resolveSpineConnectorPositionMultiplier, type LayoutProfileId, type SpineConnector, type SpineReferenceFrame, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container, Graphics, Matrix, type Ticker } from \"pixi.js\";\r\nimport { fitSpineToTransform, resolveSpineSettings } from \"../layout.js\";\r\nimport { NodeView } from \"./NodeView.js\";\r\n\r\ntype ConnectorBinding = SpineConnector & { target: Container };\r\ntype RuntimeConnectorBinding = ConnectorBinding | ({ boneName: string; targetNodeId: string; target: Container } & Partial<ConnectorBinding>);\r\ntype ConnectorSnapshot = {\r\n target: Container;\r\n parent: Container;\r\n index: number;\r\n position: { x: number; y: number };\r\n scale: { x: number; y: number };\r\n skew: { x: number; y: number };\r\n pivot: { x: number; y: number };\r\n rotation: number;\r\n};\r\ntype ActiveConnector = ConnectorSnapshot & Pick<SpineConnector, \"partType\" | \"partName\" | \"positionMultiplier\" | \"positionMultiplierOverrides\"> & { host: Container };\r\n\r\nfunction resolveConnectorPart(binding: RuntimeConnectorBinding): Pick<SpineConnector, \"partType\" | \"partName\"> | undefined {\r\n if ((binding.partType === \"bone\" || binding.partType === \"slot\") && typeof binding.partName === \"string\" && binding.partName.length > 0) {\r\n return { partType: binding.partType, partName: binding.partName };\r\n }\r\n const boneName = \"boneName\" in binding ? binding.boneName : undefined;\r\n return typeof boneName === \"string\" && boneName.length > 0 ? { partType: \"bone\", partName: boneName } : undefined;\r\n}\r\n\r\nexport class SpineNodeView extends NodeView {\r\n private referenceFrame: SpineReferenceFrame | undefined;\r\n private readonly initializeForAuthoring: boolean;\r\n private connectorBindings: RuntimeConnectorBinding[] = [];\r\n private activeConnectors: ActiveConnector[] = [];\r\n private connectorBonesActive = false;\r\n /** Layout profile the view was last synced with; connector multipliers resolve against it. */\r\n private activeProfile: LayoutProfileId = \"desktop\";\r\n\r\n constructor(skeletonData: SkeletonData | undefined, animation: string | undefined, autoplay: boolean, loop: boolean, animationSpeed: number, initializeForAuthoring: boolean, referenceFrame?: SpineReferenceFrame, ticker?: Ticker) {\r\n super();\r\n this.referenceFrame = referenceFrame;\r\n this.initializeForAuthoring = initializeForAuthoring;\r\n if (skeletonData === undefined) {\r\n this.setContent(new Graphics());\r\n return;\r\n }\r\n // The host's own Application ticker, when it passed one: a Spine left on the default\r\n // `Ticker.shared` advances its skeleton in a second rAF loop, out of band with the renderer\r\n // that actually draws it.\r\n //\r\n // An authoring view starts at the node's own autoplay setting, so a scene full of paused\r\n // skeletons subscribes to no ticker at all — the editor toggles `autoUpdate` from there.\r\n // A runtime view always keeps it on: an animation game code starts later must advance without\r\n // the game touching `autoUpdate` itself.\r\n const spine = new Spine({ skeletonData, autoUpdate: initializeForAuthoring ? autoplay : true, ...(ticker === undefined ? {} : { ticker }) });\r\n spine.afterUpdateWorldTransforms = () => this.refreshConnectorBones();\r\n // A configured animation always gets a track, posed to its own first frame — a skeleton left\r\n // without one instead renders Spine's setup/bind pose, which is almost never the intended \"static\"\r\n // look and was reported as a visibly broken/twitching pose (still-running physics/IK constraints\r\n // have nothing to settle against without a driving animation). When not autoplaying, `timeScale`\r\n // is frozen at 0 so the track holds frame 0 forever without playing; game code starting a real\r\n // animation later just calls `state.setAnimation(...)` itself, same as before.\r\n if (animation !== undefined && skeletonData.findAnimation(animation) !== null) {\r\n const playing = autoplay || initializeForAuthoring;\r\n spine.state.setAnimation(0, animation, loop).timeScale = playing ? animationSpeed : 0;\r\n }\r\n this.setContent(spine);\r\n }\r\n\r\n /** Runtime switch used by game code; authored connector definitions are inactive by default. */\r\n get activeConnectorBones(): boolean {\r\n return this.connectorBonesActive;\r\n }\r\n\r\n set activeConnectorBones(active: boolean) {\r\n this.setConnectorBonesActive(active);\r\n }\r\n\r\n /** Replaces the scene-resolved connector targets, preserving the current active state. */\r\n setConnectorBones(bindings: readonly RuntimeConnectorBinding[]): void {\r\n const wasActive = this.connectorBonesActive;\r\n if (wasActive) this.setConnectorBonesActive(false);\r\n this.connectorBindings = [...bindings];\r\n if (wasActive) this.setConnectorBonesActive(true);\r\n }\r\n\r\n setConnectorBonesActive(active: boolean): void {\r\n if (active === this.connectorBonesActive) return;\r\n this.connectorBonesActive = active;\r\n if (!active) {\r\n this.restoreConnectorTargets();\r\n return;\r\n }\r\n\r\n const spine = this.getSpine();\r\n if (spine === undefined) return;\r\n for (const binding of this.connectorBindings) {\r\n const part = resolveConnectorPart(binding);\r\n if (part === undefined) continue;\r\n if (part.partType === \"bone\" ? spine.skeleton.findBone(part.partName) === null : spine.skeleton.findSlot(part.partName) === null) continue;\r\n const parent = binding.target.parent;\r\n if (parent === null || parent.destroyed) continue;\r\n const host = new Container();\r\n const snapshot: ActiveConnector = {\r\n partType: part.partType,\r\n partName: part.partName,\r\n positionMultiplier: binding.positionMultiplier,\r\n positionMultiplierOverrides: binding.positionMultiplierOverrides,\r\n target: binding.target,\r\n parent,\r\n index: parent.getChildIndex(binding.target),\r\n position: { x: binding.target.position.x, y: binding.target.position.y },\r\n scale: { x: binding.target.scale.x, y: binding.target.scale.y },\r\n skew: { x: binding.target.skew.x, y: binding.target.skew.y },\r\n pivot: { x: binding.target.pivot.x, y: binding.target.pivot.y },\r\n rotation: binding.target.rotation,\r\n host,\r\n };\r\n // The host genuinely belongs to the Spine view, so the authored skeleton offset inherits the\r\n // visual Spine fit. refreshConnectorBones compensates the host's linear transform only, so the\r\n // target keeps its original UI size/orientation.\r\n spine.addChild(host);\r\n host.addChild(binding.target);\r\n this.activeConnectors.push(snapshot);\r\n }\r\n this.refreshConnectorBones();\r\n }\r\n\r\n /** Reapplies bone matrices and the target's required zero local transform. */\r\n refreshConnectorBones(): void {\r\n const spine = this.getSpine();\r\n if (spine === undefined) return;\r\n for (const connector of this.activeConnectors) {\r\n const slot = connector.partType === \"slot\" ? spine.skeleton.findSlot(connector.partName) : null;\r\n const bone = connector.partType === \"bone\" ? spine.skeleton.findBone(connector.partName) : slot?.bone;\r\n if (bone === null || bone === undefined || connector.parent.destroyed) continue;\r\n // A slot itself has no transform beyond its bone, but a region attachment does: Spine stores\r\n // its authored Point offset in attachment.x/y. Project that attachment origin, otherwise\r\n // changing Point from e.g. -650 to -850 moves the visual attachment but not the UI connector.\r\n const attachment = slot?.attachment;\r\n let spineX = bone.worldX;\r\n let spineY = bone.worldY;\r\n if (attachment instanceof PointAttachment) {\r\n const point = attachment.computeWorldPosition(bone, new Vector2());\r\n spineX = point.x;\r\n spineY = point.y;\r\n } else if (attachment instanceof RegionAttachment) {\r\n spineX += attachment.x * bone.a + attachment.y * bone.b;\r\n spineY += attachment.x * bone.c + attachment.y * bone.d;\r\n }\r\n const spineWorld = spine.getGlobalTransform();\r\n const parentWorld = connector.parent.getGlobalTransform();\r\n const determinant = spineWorld.a * spineWorld.d - spineWorld.b * spineWorld.c;\r\n if (!Number.isFinite(determinant) || Math.abs(determinant) < 1e-8) continue;\r\n\r\n // Authored per-axis position multiplier (default 1): scales the projected part position from\r\n // the Spine node's origin before the parent transform compensation, so the target keeps its\r\n // own size/orientation and only its offset is multiplied.\r\n const multiplier = resolveSpineConnectorPositionMultiplier(connector, this.activeProfile);\r\n\r\n // The attachment position remains in original Spine source units and therefore inherits the\r\n // fitted Spine scale. For example, y=-650 at a 1/3 fit becomes roughly -217 on the UI scene.\r\n // Only the host's linear transform is compensated, so the target itself does not shrink.\r\n const hostA = (spineWorld.d * parentWorld.a - spineWorld.c * parentWorld.b) / determinant;\r\n const hostB = (-spineWorld.b * parentWorld.a + spineWorld.a * parentWorld.b) / determinant;\r\n const hostC = (spineWorld.d * parentWorld.c - spineWorld.c * parentWorld.d) / determinant;\r\n const hostD = (-spineWorld.b * parentWorld.c + spineWorld.a * parentWorld.d) / determinant;\r\n connector.host.setFromMatrix(new Matrix(\r\n hostA,\r\n hostB,\r\n hostC,\r\n hostD,\r\n spineX * multiplier.x,\r\n spineY * multiplier.y,\r\n ));\r\n connector.host.visible = slot === null\r\n || (spine.skeleton.drawOrder.includes(slot) && slot.attachment !== null && spine.alpha > 0 && spine.skeleton.color.a * slot.color.a > 0);\r\n connector.target.position.set(0, 0);\r\n }\r\n }\r\n\r\n private restoreConnectorTargets(): void {\r\n for (const connector of this.activeConnectors) {\r\n const { target, parent } = connector;\r\n if (!target.destroyed && !parent.destroyed) {\r\n const index = Math.min(connector.index, parent.children.length);\r\n parent.addChildAt(target, index);\r\n target.position.set(connector.position.x, connector.position.y);\r\n target.scale.set(connector.scale.x, connector.scale.y);\r\n target.skew.set(connector.skew.x, connector.skew.y);\r\n target.pivot.set(connector.pivot.x, connector.pivot.y);\r\n target.rotation = connector.rotation;\r\n }\r\n connector.host.destroy({ children: false });\r\n }\r\n this.activeConnectors = [];\r\n }\r\n\r\n setReferenceFrame(referenceFrame: SpineReferenceFrame | undefined): void {\r\n this.referenceFrame = referenceFrame;\r\n }\r\n\r\n /**\r\n * Every transform application (editor gesture previews, document commits, layout updates, anchor\r\n * resizes) recomputes active connector hosts immediately. The host's local matrix depends on the\r\n * spine's world transform — including the fitted width/height scale — so a resize of the spine\r\n * node must move its targets in the same pass, not on the next ticker frame or document commit.\r\n */\r\n protected onLayoutTransformApplied(): void {\r\n if (this.connectorBonesActive) this.refreshConnectorBones();\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"], profile: LayoutProfileId): void {\r\n this.activeProfile = profile;\r\n if (this.content instanceof Spine) {\r\n if (node.type === \"spine\") {\r\n const settings = resolveSpineSettings(node, profile);\r\n const track = this.content.state.tracks[0];\r\n const animationChanged = track?.animation?.name !== settings.animation;\r\n const loopChanged = track !== null && track !== undefined && track.loop !== settings.loop;\r\n // Same \"always a track, frozen at frame 0 unless actually playing\" contract as the constructor:\r\n // a static (non-autoplay) skeleton stays posed to its configured animation's first frame,\r\n // never Spine's setup/bind pose.\r\n const playing = settings.autoplay || this.initializeForAuthoring;\r\n const desiredTimeScale = playing ? settings.animationSpeed : 0;\r\n if (settings.animation === undefined) {\r\n if (track !== null && track !== undefined) this.content.state.clearTrack(0);\r\n } else if ((animationChanged || loopChanged) && this.content.skeleton.data.findAnimation(settings.animation) !== null) {\r\n this.content.state.setAnimation(0, settings.animation, settings.loop).timeScale = desiredTimeScale;\r\n } else if (track !== null && track !== undefined) {\r\n track.timeScale = desiredTimeScale;\r\n }\r\n }\r\n const fit = fitSpineToTransform(this.content.skeleton.data, transform, this.referenceFrame);\r\n if (fit !== undefined) {\r\n this.content.scale.set(fit.scaleX, fit.scaleY);\r\n this.content.position.set(fit.x, fit.y);\r\n }\r\n // A paused Spine does not receive a ticker update. Refresh its world transforms after a\r\n // layout/viewport change so its displayed pose immediately matches the new fitted bounds.\r\n this.content.update(0);\r\n } else if (this.content instanceof Graphics) {\r\n this.content.clear().rect(0, 0, transform.width, transform.height).fill(0xff00ff);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SpineNodeView.js","sourceRoot":"","sources":["../../src/views/SpineNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAqB,MAAM,iCAAiC,CAAC;AACvH,OAAO,EAAE,uCAAuC,EAAoF,MAAM,wBAAwB,CAAC;AACnK,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAgBzC,SAAS,oBAAoB,CAAC,OAAgC;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C/C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;YAC1C,CAAC;YACD,wFAAwF;YACxF,0FAA0F;YAC1F,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;aAAM,IAAI,IAAI,CAAC,OAAO,YAAY,QAAQ,EAAE,CAAC;YAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;CACF","sourcesContent":["import { PointAttachment, RegionAttachment, Spine, Vector2, type SkeletonData } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport { resolveSpineConnectorPositionMultiplier, type LayoutProfileId, type SpineConnector, type SpineReferenceFrame, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container, Graphics, Matrix, type Ticker } from \"pixi.js\";\r\nimport { fitSpineToTransform, resolveSpineSettings } from \"../layout.js\";\r\nimport { NodeView } from \"./NodeView.js\";\r\n\r\ntype ConnectorBinding = SpineConnector & { target: Container };\r\ntype RuntimeConnectorBinding = ConnectorBinding | ({ boneName: string; targetNodeId: string; target: Container } & Partial<ConnectorBinding>);\r\ntype ConnectorSnapshot = {\r\n target: Container;\r\n parent: Container;\r\n index: number;\r\n position: { x: number; y: number };\r\n scale: { x: number; y: number };\r\n skew: { x: number; y: number };\r\n pivot: { x: number; y: number };\r\n rotation: number;\r\n};\r\ntype ActiveConnector = ConnectorSnapshot & Pick<SpineConnector, \"partType\" | \"partName\" | \"positionMultiplier\" | \"positionMultiplierOverrides\"> & { host: Container };\r\n\r\nfunction resolveConnectorPart(binding: RuntimeConnectorBinding): Pick<SpineConnector, \"partType\" | \"partName\"> | undefined {\r\n if ((binding.partType === \"bone\" || binding.partType === \"slot\") && typeof binding.partName === \"string\" && binding.partName.length > 0) {\r\n return { partType: binding.partType, partName: binding.partName };\r\n }\r\n const boneName = \"boneName\" in binding ? binding.boneName : undefined;\r\n return typeof boneName === \"string\" && boneName.length > 0 ? { partType: \"bone\", partName: boneName } : undefined;\r\n}\r\n\r\nexport class SpineNodeView extends NodeView {\r\n private referenceFrame: SpineReferenceFrame | undefined;\r\n private readonly initializeForAuthoring: boolean;\r\n private connectorBindings: RuntimeConnectorBinding[] = [];\r\n private activeConnectors: ActiveConnector[] = [];\r\n private connectorBonesActive = false;\r\n /** Layout profile the view was last synced with; connector multipliers resolve against it. */\r\n private activeProfile: LayoutProfileId = \"desktop\";\r\n\r\n constructor(skeletonData: SkeletonData | undefined, animation: string | undefined, autoplay: boolean, loop: boolean, animationSpeed: number, initializeForAuthoring: boolean, referenceFrame?: SpineReferenceFrame, ticker?: Ticker) {\r\n super();\r\n this.referenceFrame = referenceFrame;\r\n this.initializeForAuthoring = initializeForAuthoring;\r\n if (skeletonData === undefined) {\r\n this.setContent(new Graphics());\r\n return;\r\n }\r\n // The host's own Application ticker, when it passed one: a Spine left on the default\r\n // `Ticker.shared` advances its skeleton in a second rAF loop, out of band with the renderer\r\n // that actually draws it.\r\n //\r\n // An authoring view starts at the node's own autoplay setting, so a scene full of paused\r\n // skeletons subscribes to no ticker at all — the editor toggles `autoUpdate` from there.\r\n // A runtime view always keeps it on: an animation game code starts later must advance without\r\n // the game touching `autoUpdate` itself.\r\n const spine = new Spine({ skeletonData, autoUpdate: initializeForAuthoring ? autoplay : true, ...(ticker === undefined ? {} : { ticker }) });\r\n spine.afterUpdateWorldTransforms = () => this.refreshConnectorBones();\r\n // A configured animation always gets a track, posed to its own first frame — a skeleton left\r\n // without one instead renders Spine's setup/bind pose, which is almost never the intended \"static\"\r\n // look and was reported as a visibly broken/twitching pose (still-running physics/IK constraints\r\n // have nothing to settle against without a driving animation). When not autoplaying, `timeScale`\r\n // is frozen at 0 so the track holds frame 0 forever without playing; game code starting a real\r\n // animation later just calls `state.setAnimation(...)` itself, same as before.\r\n if (animation !== undefined && skeletonData.findAnimation(animation) !== null) {\r\n const playing = autoplay || initializeForAuthoring;\r\n spine.state.setAnimation(0, animation, loop).timeScale = playing ? animationSpeed : 0;\r\n }\r\n this.setContent(spine);\r\n }\r\n\r\n /** Runtime switch used by game code; authored connector definitions are inactive by default. */\r\n get activeConnectorBones(): boolean {\r\n return this.connectorBonesActive;\r\n }\r\n\r\n set activeConnectorBones(active: boolean) {\r\n this.setConnectorBonesActive(active);\r\n }\r\n\r\n /** Replaces the scene-resolved connector targets, preserving the current active state. */\r\n setConnectorBones(bindings: readonly RuntimeConnectorBinding[]): void {\r\n const wasActive = this.connectorBonesActive;\r\n if (wasActive) this.setConnectorBonesActive(false);\r\n this.connectorBindings = [...bindings];\r\n if (wasActive) this.setConnectorBonesActive(true);\r\n }\r\n\r\n setConnectorBonesActive(active: boolean): void {\r\n if (active === this.connectorBonesActive) return;\r\n this.connectorBonesActive = active;\r\n if (!active) {\r\n this.restoreConnectorTargets();\r\n return;\r\n }\r\n\r\n const spine = this.getSpine();\r\n if (spine === undefined) return;\r\n for (const binding of this.connectorBindings) {\r\n const part = resolveConnectorPart(binding);\r\n if (part === undefined) continue;\r\n if (part.partType === \"bone\" ? spine.skeleton.findBone(part.partName) === null : spine.skeleton.findSlot(part.partName) === null) continue;\r\n const parent = binding.target.parent;\r\n if (parent === null || parent.destroyed) continue;\r\n const host = new Container();\r\n const snapshot: ActiveConnector = {\r\n partType: part.partType,\r\n partName: part.partName,\r\n positionMultiplier: binding.positionMultiplier,\r\n positionMultiplierOverrides: binding.positionMultiplierOverrides,\r\n target: binding.target,\r\n parent,\r\n index: parent.getChildIndex(binding.target),\r\n position: { x: binding.target.position.x, y: binding.target.position.y },\r\n scale: { x: binding.target.scale.x, y: binding.target.scale.y },\r\n skew: { x: binding.target.skew.x, y: binding.target.skew.y },\r\n pivot: { x: binding.target.pivot.x, y: binding.target.pivot.y },\r\n rotation: binding.target.rotation,\r\n host,\r\n };\r\n // The host genuinely belongs to the Spine view, so the authored skeleton offset inherits the\r\n // visual Spine fit. refreshConnectorBones compensates the host's linear transform only, so the\r\n // target keeps its original UI size/orientation.\r\n spine.addChild(host);\r\n host.addChild(binding.target);\r\n this.activeConnectors.push(snapshot);\r\n }\r\n this.refreshConnectorBones();\r\n }\r\n\r\n /** Reapplies bone matrices and the target's required zero local transform. */\r\n refreshConnectorBones(): void {\r\n const spine = this.getSpine();\r\n if (spine === undefined) return;\r\n for (const connector of this.activeConnectors) {\r\n const slot = connector.partType === \"slot\" ? spine.skeleton.findSlot(connector.partName) : null;\r\n const bone = connector.partType === \"bone\" ? spine.skeleton.findBone(connector.partName) : slot?.bone;\r\n if (bone === null || bone === undefined || connector.parent.destroyed) continue;\r\n // A slot itself has no transform beyond its bone, but a region attachment does: Spine stores\r\n // its authored Point offset in attachment.x/y. Project that attachment origin, otherwise\r\n // changing Point from e.g. -650 to -850 moves the visual attachment but not the UI connector.\r\n const attachment = slot?.attachment;\r\n let spineX = bone.worldX;\r\n let spineY = bone.worldY;\r\n if (attachment instanceof PointAttachment) {\r\n const point = attachment.computeWorldPosition(bone, new Vector2());\r\n spineX = point.x;\r\n spineY = point.y;\r\n } else if (attachment instanceof RegionAttachment) {\r\n spineX += attachment.x * bone.a + attachment.y * bone.b;\r\n spineY += attachment.x * bone.c + attachment.y * bone.d;\r\n }\r\n const spineWorld = spine.getGlobalTransform();\r\n const parentWorld = connector.parent.getGlobalTransform();\r\n const determinant = spineWorld.a * spineWorld.d - spineWorld.b * spineWorld.c;\r\n if (!Number.isFinite(determinant) || Math.abs(determinant) < 1e-8) continue;\r\n\r\n // Authored per-axis position multiplier (default 1): scales the projected part position from\r\n // the Spine node's origin before the parent transform compensation, so the target keeps its\r\n // own size/orientation and only its offset is multiplied.\r\n const multiplier = resolveSpineConnectorPositionMultiplier(connector, this.activeProfile);\r\n\r\n // The attachment position remains in original Spine source units and therefore inherits the\r\n // fitted Spine scale. For example, y=-650 at a 1/3 fit becomes roughly -217 on the UI scene.\r\n // Only the host's linear transform is compensated, so the target itself does not shrink.\r\n const hostA = (spineWorld.d * parentWorld.a - spineWorld.c * parentWorld.b) / determinant;\r\n const hostB = (-spineWorld.b * parentWorld.a + spineWorld.a * parentWorld.b) / determinant;\r\n const hostC = (spineWorld.d * parentWorld.c - spineWorld.c * parentWorld.d) / determinant;\r\n const hostD = (-spineWorld.b * parentWorld.c + spineWorld.a * parentWorld.d) / determinant;\r\n connector.host.setFromMatrix(new Matrix(\r\n hostA,\r\n hostB,\r\n hostC,\r\n hostD,\r\n spineX * multiplier.x,\r\n spineY * multiplier.y,\r\n ));\r\n connector.host.visible = slot === null\r\n || (spine.skeleton.drawOrder.includes(slot) && slot.attachment !== null && spine.alpha > 0 && spine.skeleton.color.a * slot.color.a > 0);\r\n connector.target.position.set(0, 0);\r\n }\r\n }\r\n\r\n private restoreConnectorTargets(): void {\r\n for (const connector of this.activeConnectors) {\r\n const { target, parent } = connector;\r\n if (!target.destroyed && !parent.destroyed) {\r\n const index = Math.min(connector.index, parent.children.length);\r\n parent.addChildAt(target, index);\r\n target.position.set(connector.position.x, connector.position.y);\r\n target.scale.set(connector.scale.x, connector.scale.y);\r\n target.skew.set(connector.skew.x, connector.skew.y);\r\n target.pivot.set(connector.pivot.x, connector.pivot.y);\r\n target.rotation = connector.rotation;\r\n }\r\n connector.host.destroy({ children: false });\r\n }\r\n this.activeConnectors = [];\r\n }\r\n\r\n setReferenceFrame(referenceFrame: SpineReferenceFrame | undefined): void {\r\n this.referenceFrame = referenceFrame;\r\n }\r\n\r\n /**\r\n * Every transform application (editor gesture previews, document commits, layout updates, anchor\r\n * resizes) recomputes active connector hosts immediately. The host's local matrix depends on the\r\n * spine's world transform — including the fitted width/height scale — so a resize of the spine\r\n * node must move its targets in the same pass, not on the next ticker frame or document commit.\r\n */\r\n protected onLayoutTransformApplied(): void {\r\n if (this.connectorBonesActive) this.refreshConnectorBones();\r\n }\r\n\r\n protected syncContent(node: UINode, transform: UINode[\"transform\"], profile: LayoutProfileId): void {\r\n this.activeProfile = profile;\r\n if (node.type === \"spine\" && this.content !== undefined) this.content.alpha = node.opacity ?? 1;\r\n if (this.content instanceof Spine) {\r\n if (node.type === \"spine\") {\r\n const settings = resolveSpineSettings(node, profile);\r\n const track = this.content.state.tracks[0];\r\n const animationChanged = track?.animation?.name !== settings.animation;\r\n const loopChanged = track !== null && track !== undefined && track.loop !== settings.loop;\r\n // Same \"always a track, frozen at frame 0 unless actually playing\" contract as the constructor:\r\n // a static (non-autoplay) skeleton stays posed to its configured animation's first frame,\r\n // never Spine's setup/bind pose.\r\n const playing = settings.autoplay || this.initializeForAuthoring;\r\n const desiredTimeScale = playing ? settings.animationSpeed : 0;\r\n if (settings.animation === undefined) {\r\n if (track !== null && track !== undefined) this.content.state.clearTrack(0);\r\n } else if ((animationChanged || loopChanged) && this.content.skeleton.data.findAnimation(settings.animation) !== null) {\r\n this.content.state.setAnimation(0, settings.animation, settings.loop).timeScale = desiredTimeScale;\r\n } else if (track !== null && track !== undefined) {\r\n track.timeScale = desiredTimeScale;\r\n }\r\n }\r\n const fit = fitSpineToTransform(this.content.skeleton.data, transform, this.referenceFrame);\r\n if (fit !== undefined) {\r\n this.content.scale.set(fit.scaleX, fit.scaleY);\r\n this.content.position.set(fit.x, fit.y);\r\n }\r\n // A paused Spine does not receive a ticker update. Refresh its world transforms after a\r\n // layout/viewport change so its displayed pose immediately matches the new fitted bounds.\r\n this.content.update(0);\r\n } else if (this.content instanceof Graphics) {\r\n this.content.clear().rect(0, 0, transform.width, transform.height).fill(0xff00ff);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -132,7 +132,7 @@ export function collectNodeAssetIds(node) {
|
|
|
132
132
|
case "progress-bar":
|
|
133
133
|
return [node.backgroundAssetId, node.fillAssetId];
|
|
134
134
|
case "pagination":
|
|
135
|
-
return [node.activeAssetId, node.inactiveAssetId, node.numberStyle?.fontAssetId
|
|
135
|
+
return [node.activeAssetId, node.inactiveAssetId, node.numberStyle?.fontAssetId].filter((assetId) => assetId !== undefined);
|
|
136
136
|
case "particle-emitter":
|
|
137
137
|
return [];
|
|
138
138
|
}
|
|
@@ -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;AAGtJ,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;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,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;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,WAAiC,EAAE,QAAuC,EAAE,MAA0C,EAAE,SAAyC,EAAE,KAAmC,EAAE,KAAkB,EAAE,MAAiC,EAAE,mBAAyC,EAAE,MAAe,EAAE,W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IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,KAAK,SAAS;gBAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACnF,OAAO,GAAG,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 { 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 type { SceneAudio } from \"../audio/bus.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>, audio?: SceneAudio, 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);\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, audio);\r\n case \"staged-button\":\r\n return new StagedButtonNodeView(node, textures, interaction, audio);\r\n case \"checkbox\":\r\n return new CheckboxNodeView(node, textures, interaction, audio);\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 [...new Set([node.assetId, node.bitmapTextOverrides?.desktop?.assetId, node.bitmapTextOverrides?.mobile?.assetId].filter((assetId): assetId is string => assetId !== undefined))];\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","source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,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,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAqB,EAAE,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;QACjJ,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 { 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 type { SceneAudio } from \"../audio/bus.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>, audio?: SceneAudio, 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, audio);\r\n case \"staged-button\":\r\n return new StagedButtonNodeView(node, textures, interaction, audio);\r\n case \"checkbox\":\r\n return new CheckboxNodeView(node, textures, interaction, audio);\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 [...new Set([node.assetId, node.bitmapTextOverrides?.desktop?.assetId, node.bitmapTextOverrides?.mobile?.assetId].filter((assetId): assetId is string => assetId !== undefined))];\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].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.20.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.20.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^26.2.0"
|