@pixi-ui-editor/runtime-pixi 0.10.0 → 0.12.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.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,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,EAA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AAW,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\";\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\";\nimport { Container, Texture, type Ticker } from \"pixi.js\";\nimport { loadSceneSpines } from \"./assets/spine.js\";\nimport { loadSceneTextures, type FileUrlResolver } from \"./assets/textures.js\";\nimport { loadSceneFonts } from \"./assets/fonts.js\";\nimport { loadSceneBitmapFonts } from \"./assets/bitmapFonts.js\";\nimport type { SceneAssetCache } from \"./assets/cache.js\";\nimport { getCanvasLogicalSize, getCanvasScale, resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"./layout.js\";\nimport { NodeView, type SceneInteractionMode } from \"./views/NodeView.js\";\nimport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\nimport { createNodeView } from \"./views/createNodeView.js\";\nimport { applyLayoutGroup, applyLayoutItem, createGridLineBreak, initializePixiLayout, LayoutItemContainer } from \"./layoutGroups.js\";\nimport { LayoutGroupNodeView } from \"./views/basic.js\";\nimport { PageItemContainer } from \"./pageGroup.js\";\nimport { PageGroupNodeView } from \"./views/PageGroupNodeView.js\";\nimport { PaginationNodeView, type PaginationArrow } from \"./views/PaginationNodeView.js\";\nimport { ItemTableNodeView } from \"./views/ItemTableNodeView.js\";\nimport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\nimport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\nimport { ScrollItemContainer } from \"./scrollView.js\";\nimport { ScrollViewNodeView } from \"./views/ScrollViewNodeView.js\";\nimport { SpineNodeView } from \"./views/SpineNodeView.js\";\nimport { ParticleEmitterNodeView } from \"./views/ParticleEmitterNodeView.js\";\nimport { SceneLocalization, type SceneLocalizationOptions } from \"./localization.js\";\nimport { SceneViewport } from \"./SceneViewport.js\";\nimport type { Sound } from \"@pixi/sound\";\n\nexport type BuildSceneViewOptions = {\n /** Explicit: an editor canvas must pass \"authoring\", Preview and the consuming app \"runtime\". */\n interaction: SceneInteractionMode;\n textures?: ReadonlyMap<string, Texture>;\n spines?: ReadonlyMap<string, SkeletonData>;\n fonts?: ReadonlyMap<string, string>;\n bitmapFonts?: ReadonlyMap<string, string>;\n sounds?: ReadonlyMap<string, Sound>;\n /**\n * The host's own Application ticker, driving self-updating content such as Spine skeletons.\n * Without it they fall back to `Ticker.shared`, which runs a second rAF loop independent of the\n * renderer that draws them — see the same rule as `updateParticleEmitters`.\n */\n ticker?: Ticker;\n /** Called after Yoga changes a managed rectangle; authoring hosts use it to refresh overlays. */\n onLayout?: () => void;\n /**\n * Начальное состояние локализации. Опция необязательна: при наличии `Text.textKey` base locale\n * каталога применяется и без неё, а документ без ключей выглядит ровно как раньше.\n */\n localization?: SceneLocalizationOptions;\n /** Internal host boundary override: prefab views are spawnable content, not screen viewports. */\n clipToViewport?: boolean;\n};\n\nexport type SceneViewResult = { root: SceneViewport; nodeViews: Map<string, Container>; localization: SceneLocalization };\nconst particleEmitterRegistry = new WeakMap<Container, readonly ParticleEmitterNodeView[]>();\n\nfunction spineReferenceFrameFor(document: ProjectDocument, node: UINode): SpineReferenceFrame | undefined {\n if (node.type !== \"spine\") return undefined;\n const asset = document.assets.find((candidate) => candidate.id === node.assetId);\n return asset?.type === \"spine\" ? asset.referenceFrame : undefined;\n}\n\n/** Builds a PixiJS display tree for a scene without depending on DOM or editor state. */\nexport function buildSceneView(\n document: ProjectDocument,\n sceneId: string,\n profile: LayoutProfileId,\n options: BuildSceneViewOptions,\n): SceneViewResult {\n initializePixiLayout();\n const { interaction, textures, spines, fonts, bitmapFonts, sounds, ticker, onLayout } = options;\n const scene = document.scenes.find((candidate) => candidate.id === sceneId);\n\n if (scene === undefined) {\n throw new Error(`Scene '${sceneId}' does not exist in the project document.`);\n }\n\n const nodeViews = new Map<string, Container>();\n const particleEmitters: ParticleEmitterNodeView[] = [];\n\n // Materialized prefab children use instance-scoped IDs, so authoring and runtime can address\n // multiple instances independently without changing canonical definition IDs.\n const screenSize = scene.layout.referenceViewports[profile];\n const referenceResolution = scene.layout.preferredViewports[profile];\n const canvasScale = getCanvasScale(screenSize, referenceResolution);\n const canvasSize = getCanvasLogicalSize(screenSize, referenceResolution);\n\n // Единый резолвер иерархии: тот же граф, что видит редактор, включая вложенные пресеты.\n const owner = resolveOwnerNodeGraph(document, scene);\n const prefabIds = new Set(document.prefabs.map((prefab) => prefab.id));\n\n const buildOwner = (rootSize: LayoutSize): Container => {\n const nodesById = new Map(owner.nodes.map((node) => [node.id, node]));\n\n const buildNode = (nodeId: string, parentSize: LayoutSize): NodeView => {\n const node = nodesById.get(nodeId);\n\n if (node === undefined) {\n throw new Error(`Scene '${sceneId}' references missing node '${nodeId}'.`);\n }\n\n const resolved = resolveProfileTransform(node, profile);\n const transform = resolveAnchoredTransform(resolved.transform, parentSize);\n const view = createNodeView(node, interaction, textures, spines, (prefabId) => prefabIds.has(prefabId), fonts, sounds, node.type === \"particle-emitter\" ? document.effects.find((effect) => effect.id === node.effectId && isParticleEffect(effect)) : undefined, spineReferenceFrameFor(document, node), ticker, bitmapFonts);\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, parentSize);\n // Yoga owns only the group's inner layoutContent; the outer NodeView keeps authored transform.\n view.update(node, profile, parentSize);\n nodeViews.set(node.id, view);\n if (view instanceof ParticleEmitterNodeView) particleEmitters.push(view);\n\n // Прямые дети корня сцены разрешают якоря относительно логического Canvas, а не размера корня.\n // Прямой ребёнок grid-layout (сам `node` здесь) не владеет своим отрисованным размером: Unity-подобная\n // фиксированная ячейка полностью переопределяет authored transform (см. applyLayoutItem). Его\n // собственным потомкам нужен именно cellWidth/cellHeight, а не anchor-resolved authored-размер —\n // иначе они не отслеживают изменение Cell width/height и якорятся относительно устаревшего размера.\n const gridParent = node.parentId === null ? undefined : nodesById.get(node.parentId);\n const gridCell = gridParent?.type === \"grid-layout\" ? resolveLayoutGroupSettings<GridLayoutSettings>(gridParent, profile) : undefined;\n const childSize = node.parentId === null\n ? rootSize\n : gridCell !== undefined\n ? { width: gridCell.cellWidth, height: gridCell.cellHeight }\n : { width: transform.width, height: transform.height };\n for (const [childIndex, childId] of node.children.entries()) {\n const childNode = nodesById.get(childId);\n const childView = buildNode(childId, childSize);\n if (isLayoutGroup(node) && childNode !== undefined && view instanceof LayoutGroupNodeView) {\n const layoutItem = new LayoutItemContainer(childView, onLayout);\n applyLayoutItem(layoutItem, childNode, node, profile);\n view.addLayoutChild(layoutItem);\n } else if (node.type === \"scroll-view\" && childNode !== undefined && view instanceof ScrollViewNodeView) {\n const scrollItem = new ScrollItemContainer(childView, onLayout);\n // Как и у layout-item: собственный (не растянутый якорями) размер ребёнка — List не\n // предоставляет per-item override размера, в отличие от Yoga flexGrow/cellSize.\n const own = resolveProfileTransform(childNode, profile).transform;\n scrollItem.sync(childNode, profile, { width: own.width, height: own.height });\n view.addScrollItem(scrollItem);\n } else if (node.type === \"page-group\" && childNode !== undefined && view instanceof PageGroupNodeView) {\n // Unlike a scroll-view item, a page fills the group's own resolved rect completely\n // (`childSize`, computed above): a page is a full sub-screen, not content sized to itself.\n const pageItem = new PageItemContainer(childView);\n pageItem.sync(childNode, profile, childSize);\n view.addPageItem(pageItem);\n } else {\n view.addChild(childView);\n }\n if (node.type === \"grid-layout\") {\n const settings = node.layoutGroup.overrides?.[profile] === undefined ? node.layoutGroup.base : { ...node.layoutGroup.base, ...node.layoutGroup.overrides[profile] };\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 instanceof LayoutGroupNodeView) view.addLayoutChild(lineBreak);\n }\n }\n }\n\n return view;\n };\n\n const ownerRoot = new Container();\n for (const rootNodeId of owner.rootNodeIds) {\n ownerRoot.addChild(buildNode(rootNodeId, rootSize));\n }\n\n return ownerRoot;\n };\n\n const canvasRoot = buildOwner(canvasSize);\n canvasRoot.scale.set(canvasScale);\n const hostRoot = new SceneViewport(canvasRoot, screenSize, options.clipToViewport ?? interaction === \"runtime\");\n particleEmitterRegistry.set(hostRoot, particleEmitters);\n // Контроллер применяет переводы сразу к уже созданным views, поэтому keyed Text показывает\n // базовую локаль без единого дополнительного вызова со стороны хоста.\n const localization = new SceneLocalization(document, scene, nodeViews, options.localization);\n wireCheckboxGroups(owner.nodes, nodeViews);\n wireSpineConnectors(owner.nodes, nodeViews);\n wireNodeReferences(owner.nodes, nodeViews, interaction);\n return { root: hostRoot, nodeViews, localization };\n}\n\nfunction wireSpineConnectors(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>): void {\n for (const node of nodes) {\n if (node.type !== \"spine\") continue;\n const view = nodeViews.get(node.id);\n if (!(view instanceof SpineNodeView)) continue;\n view.setConnectorBones((node.connectors ?? []).flatMap((connector) => {\n const target = nodeViews.get(connector.targetNodeId);\n return target === undefined ? [] : [{ ...connector, target }];\n }));\n }\n}\n\n/**\n * Разрешает все ссылки «нода → нода» в живые views: элементы item table и кнопки-стрелки пагинатора.\n * Та же форма, что у `wireSpineConnectors`: документ хранит id, а во что он превратился, знает только\n * собранная сцена, поэтому сами виды никогда не резолвят id. Один проход на все виды ссылок, чтобы\n * следующая не завела собственный обход с чуть другой областью видимости.\n *\n * Стрелки подключаются только в runtime-сцене: на authoring-канвасе контрол инертен, как и клик по\n * самой точке пагинатора. Вместимость таблицы, наоборот, видна и в редакторе — это не интерактивность.\n */\nfunction wireNodeReferences(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>, interaction: SceneInteractionMode): void {\n const arrowView = (nodeId: string | undefined): PaginationArrow | undefined => {\n const view = nodeId === undefined ? undefined : nodeViews.get(nodeId);\n return view instanceof ButtonNodeView || view instanceof StagedButtonNodeView ? view : undefined;\n };\n for (const node of nodes) {\n const view = nodeViews.get(node.id);\n if (node.type === \"item-table\" && view instanceof ItemTableNodeView) {\n view.setItems((node.items ?? []).map((itemId) => nodeViews.get(itemId)));\n } else if (node.type === \"pagination\" && view instanceof PaginationNodeView && interaction === \"runtime\") {\n view.setArrows({ previous: arrowView(node.prevButtonNodeId), next: arrowView(node.nextButtonNodeId) });\n }\n }\n}\n\n/**\n * Authored `group` gives sibling checkboxes radio-button behavior: checking one force-unchecks its\n * live group-mates (same `parentId`, same `group`), without touching the document. Runs once per\n * scene build; `CheckboxNodeView.forceCheck` never re-emits `onCheck`, so this can't recurse.\n */\nfunction wireCheckboxGroups(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>): void {\n const byGroup = new Map<string, CheckboxNodeView[]>();\n for (const node of nodes) {\n if (node.type !== \"checkbox\" || node.group === undefined) continue;\n const view = nodeViews.get(node.id);\n if (!(view instanceof CheckboxNodeView)) continue;\n const key = `${node.parentId ?? \"\"}::${node.group}`;\n const group = byGroup.get(key) ?? [];\n group.push(view);\n byGroup.set(key, group);\n }\n for (const group of byGroup.values()) {\n if (group.length < 2) continue;\n for (const view of group) {\n view.onCheck.connect((checked) => {\n if (!checked) return;\n for (const other of group) if (other !== view) other.forceCheck(false);\n });\n }\n }\n}\n\n/**\n * Applies a node's resolved transform, visibility, and content to an existing display object,\n * so editors can update views in place without rebuilding the scene tree.\n */\nexport function updateNodeView(view: Container, node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize, parentNode?: UINode, effect?: EffectDefinition, spineReferenceFrame?: SpineReferenceFrame): void {\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, parentSize);\n if (!(view instanceof NodeView)) return;\n if (view instanceof SpineNodeView) view.setReferenceFrame(spineReferenceFrame);\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);\n if (parentNode !== undefined && isLayoutGroup(parentNode) && view.parent instanceof LayoutItemContainer) {\n applyLayoutItem(view.parent, node, parentNode, profile);\n } else if (parentNode !== undefined && parentNode.type === \"scroll-view\" && view.parent instanceof ScrollItemContainer) {\n const own = resolveProfileTransform(node, profile).transform;\n view.parent.sync(node, profile, { width: own.width, height: own.height });\n } else if (parentNode !== undefined && parentNode.type === \"page-group\" && view.parent instanceof PageItemContainer && parentSize !== undefined) {\n // A page is position-managed exactly like a layout/scroll item: it fills the group's own rectangle\n // (`parentSize`, the same value `buildSceneView` passes as `childSize`). Without this branch an\n // in-place update fell through to `view.update` and handed the page back its authored x/y and\n // anchors, so editing anything inside a page group knocked its pages out of place.\n view.parent.sync(node, profile, parentSize);\n } else {\n view.update(node, profile, parentSize);\n }\n}\n\n/** Previews a resolved editor rectangle without consulting content bounds or rebuilding the view. */\nexport function previewNodeView(view: Container, node: UINode, profile: LayoutProfileId, transform: UINode[\"transform\"]): void {\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, undefined, { width: transform.width, height: transform.height });\n if (view instanceof NodeView) view.preview(node, transform, resolveProfileTransform(node, profile).visible, profile);\n}\n\n/** Hosts call this from their own Application ticker; runtime never subscribes to Ticker.shared. */\nexport function updateParticleEmitters(root: Container, deltaSeconds: number): void {\n const registered = particleEmitterRegistry.get(root);\n if (registered !== undefined) {\n for (const emitter of registered) emitter.updateParticles(deltaSeconds);\n return;\n }\n // Backward-compatible fallback for hosts that assemble a display tree manually instead of using\n // buildSceneView. Built scenes always take the O(emitter count) registry path above.\n const visit = (view: Container): void => {\n if (view instanceof ParticleEmitterNodeView) view.updateParticles(deltaSeconds);\n for (const child of view.children) visit(child);\n };\n visit(root);\n}\n\n/** Lists the nodes a scene renders, including nodes of prefab definitions its prefab instances expand to. */\nexport function collectRenderedNodes(document: ProjectDocument, scene: Scene): UINode[] {\n return resolveOwnerNodeGraph(document, scene).nodes;\n}\n\nexport type PrefabViewConfiguration = Pick<Extract<UINode, { type: \"prefab-instance\" }>, \"propertyOverrides\" | \"locallyAddedNodes\"> & { instanceId?: string };\n\nfunction prefabScene(document: ProjectDocument, prefabId: string, configuration: PrefabViewConfiguration = {}): { document: ProjectDocument; sceneId: string; instanceId: string } {\n const prefab = document.prefabs.find((candidate) => candidate.id === prefabId);\n if (prefab === undefined) throw new Error(`Prefab '${prefabId}' does not exist in the project document.`);\n const width = Math.max(1, ...prefab.nodes.map((node) => Math.abs(node.transform.x) + Math.max(0, node.transform.width)));\n const height = Math.max(1, ...prefab.nodes.map((node) => Math.abs(node.transform.y) + Math.max(0, node.transform.height)));\n const instanceId = configuration.instanceId ?? createStableId();\n const instance: Extract<UINode, { type: \"prefab-instance\" }> = {\n id: instanceId, name: prefab.name, type: \"prefab-instance\", prefabId, parentId: null, children: [],\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 },\n ...(configuration.propertyOverrides === undefined ? {} : { propertyOverrides: structuredClone(configuration.propertyOverrides) }),\n ...(configuration.locallyAddedNodes === undefined ? {} : { locallyAddedNodes: structuredClone(configuration.locallyAddedNodes) }),\n };\n const sceneId = createStableId();\n const viewport = { width, height };\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 } } };\n return { document: { ...document, scenes: [...document.scenes, scene] }, sceneId, instanceId };\n}\n\n/** Builds a fresh runtime prefab instance without requiring it to already exist in a scene. */\nexport function buildPrefabView(document: ProjectDocument, prefabId: string, profile: LayoutProfileId, options: BuildSceneViewOptions, configuration: PrefabViewConfiguration = {}): SceneViewResult & { instanceId: string } {\n const synthetic = prefabScene(document, prefabId, configuration);\n return { ...buildSceneView(synthetic.document, synthetic.sceneId, profile, { ...options, clipToViewport: false }), instanceId: synthetic.instanceId };\n}\n\n/** Loads a prefab's assets and returns a fresh display tree suitable for dynamic game-code spawning. */\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 }> {\n const synthetic = prefabScene(document, prefabId, configuration);\n return { ...await loadSceneView(synthetic.document, synthetic.sceneId, profile, resolveFileUrl, { ...options, clipToViewport: false }), instanceId: synthetic.instanceId };\n}\n\n/** Loads a scene's textures and Spine data, then builds its display tree in one call. */\nexport async function loadSceneView(\n document: ProjectDocument,\n sceneId: string,\n profile: LayoutProfileId,\n resolveFileUrl: FileUrlResolver,\n options: { interaction: SceneInteractionMode; ticker?: Ticker; localization?: SceneLocalizationOptions; clipToViewport?: boolean; assetCache?: SceneAssetCache },\n): Promise<SceneViewResult> {\n // Без assetCache каждый вызов начинает с пустых кэшей: для одиночной загрузки сцены это нормально, а вот\n // игровой код, который поднимает пресеты по одному, обязан передать собственный кэш — иначе один и тот же\n // скелет, атлас и текстура парсятся заново на каждую вьюху и дублируются в видеопамяти.\n const cache = options.assetCache;\n const [textures, spines, fonts, bitmapFonts] = await Promise.all([\n loadSceneTextures(document, sceneId, (asset) => (asset.type === \"image\" ? resolveFileUrl(asset.source.uri) : undefined), resolveFileUrl, cache?.textures, cache?.spritesheets, cache?.bitmapFonts),\n loadSceneSpines(document, sceneId, resolveFileUrl, cache?.spines),\n loadSceneFonts(document, sceneId, resolveFileUrl, cache?.fonts),\n loadSceneBitmapFonts(document, sceneId, resolveFileUrl, cache?.bitmapFonts),\n ]);\n return buildSceneView(document, sceneId, profile, { interaction: options.interaction, textures, spines, fonts, bitmapFonts, ticker: options.ticker, localization: options.localization, clipToViewport: options.clipToViewport });\n}\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,O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iB,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,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\";\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\";\nimport { Container, Texture, type Ticker } from \"pixi.js\";\nimport { loadSceneSpines } from \"./assets/spine.js\";\nimport { loadSceneTextures, type FileUrlResolver } from \"./assets/textures.js\";\nimport { loadSceneFonts } from \"./assets/fonts.js\";\nimport { loadSceneBitmapFonts } from \"./assets/bitmapFonts.js\";\nimport type { SceneAssetCache } from \"./assets/cache.js\";\nimport { getCanvasLogicalSize, getCanvasScale, resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"./layout.js\";\nimport { NodeView, type SceneInteractionMode } from \"./views/NodeView.js\";\nimport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\nimport { createNodeView } from \"./views/createNodeView.js\";\nimport { applyLayoutGroup, applyLayoutItem, createGridLineBreak, initializePixiLayout, LayoutItemContainer } from \"./layoutGroups.js\";\nimport { LayoutGroupNodeView } from \"./views/basic.js\";\nimport { PageItemContainer } from \"./pageGroup.js\";\nimport { PageGroupNodeView } from \"./views/PageGroupNodeView.js\";\nimport { PaginationNodeView, type PaginationArrow } from \"./views/PaginationNodeView.js\";\nimport { ItemTableNodeView } from \"./views/ItemTableNodeView.js\";\nimport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\nimport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\nimport { ScrollItemContainer } from \"./scrollView.js\";\nimport { ScrollViewNodeView } from \"./views/ScrollViewNodeView.js\";\nimport { SpineNodeView } from \"./views/SpineNodeView.js\";\nimport { ParticleEmitterNodeView } from \"./views/ParticleEmitterNodeView.js\";\nimport { SceneLocalization, type SceneLocalizationOptions } from \"./localization.js\";\nimport { SceneViewport } from \"./SceneViewport.js\";\nimport type { Sound } from \"@pixi/sound\";\n\nexport type BuildSceneViewOptions = {\n /** Explicit: an editor canvas must pass \"authoring\", Preview and the consuming app \"runtime\". */\n interaction: SceneInteractionMode;\n textures?: ReadonlyMap<string, Texture>;\n spines?: ReadonlyMap<string, SkeletonData>;\n fonts?: ReadonlyMap<string, string>;\n bitmapFonts?: ReadonlyMap<string, string>;\n sounds?: ReadonlyMap<string, Sound>;\n /**\n * The host's own Application ticker, driving self-updating content such as Spine skeletons.\n * Without it they fall back to `Ticker.shared`, which runs a second rAF loop independent of the\n * renderer that draws them — see the same rule as `updateParticleEmitters`.\n */\n ticker?: Ticker;\n /** Called after Yoga changes a managed rectangle; authoring hosts use it to refresh overlays. */\n onLayout?: () => void;\n /**\n * Начальное состояние локализации. Опция необязательна: при наличии `Text.textKey` base locale\n * каталога применяется и без неё, а документ без ключей выглядит ровно как раньше.\n */\n localization?: SceneLocalizationOptions;\n /** Internal host boundary override: prefab views are spawnable content, not screen viewports. */\n clipToViewport?: boolean;\n};\n\nexport type SceneViewResult = { root: SceneViewport; nodeViews: Map<string, Container>; localization: SceneLocalization };\nconst particleEmitterRegistry = new WeakMap<Container, readonly ParticleEmitterNodeView[]>();\n\nfunction spineReferenceFrameFor(document: ProjectDocument, node: UINode): SpineReferenceFrame | undefined {\n if (node.type !== \"spine\") return undefined;\n const asset = document.assets.find((candidate) => candidate.id === node.assetId);\n return asset?.type === \"spine\" ? asset.referenceFrame : undefined;\n}\n\n/** Builds a PixiJS display tree for a scene without depending on DOM or editor state. */\nexport function buildSceneView(\n document: ProjectDocument,\n sceneId: string,\n profile: LayoutProfileId,\n options: BuildSceneViewOptions,\n): SceneViewResult {\n initializePixiLayout();\n const { interaction, textures, spines, fonts, bitmapFonts, sounds, ticker, onLayout } = options;\n const scene = document.scenes.find((candidate) => candidate.id === sceneId);\n\n if (scene === undefined) {\n throw new Error(`Scene '${sceneId}' does not exist in the project document.`);\n }\n\n const nodeViews = new Map<string, Container>();\n const particleEmitters: ParticleEmitterNodeView[] = [];\n\n // Materialized prefab children use instance-scoped IDs, so authoring and runtime can address\n // multiple instances independently without changing canonical definition IDs.\n const screenSize = scene.layout.referenceViewports[profile];\n const referenceResolution = scene.layout.preferredViewports[profile];\n const canvasScale = getCanvasScale(screenSize, referenceResolution);\n const canvasSize = getCanvasLogicalSize(screenSize, referenceResolution);\n\n // Единый резолвер иерархии: тот же граф, что видит редактор, включая вложенные пресеты.\n const owner = resolveOwnerNodeGraph(document, scene);\n const prefabIds = new Set(document.prefabs.map((prefab) => prefab.id));\n\n const buildOwner = (rootSize: LayoutSize): Container => {\n const nodesById = new Map(owner.nodes.map((node) => [node.id, node]));\n\n const buildNode = (nodeId: string, parentSize: LayoutSize): NodeView => {\n const node = nodesById.get(nodeId);\n\n if (node === undefined) {\n throw new Error(`Scene '${sceneId}' references missing node '${nodeId}'.`);\n }\n\n const resolved = resolveProfileTransform(node, profile);\n const transform = resolveAnchoredTransform(resolved.transform, parentSize);\n const view = createNodeView(node, interaction, textures, spines, (prefabId) => prefabIds.has(prefabId), fonts, sounds, node.type === \"particle-emitter\" ? document.effects.find((effect) => effect.id === node.effectId && isParticleEffect(effect)) : undefined, spineReferenceFrameFor(document, node), ticker, bitmapFonts);\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, parentSize);\n // Yoga owns only the group's inner layoutContent; the outer NodeView keeps authored transform.\n view.update(node, profile, parentSize);\n nodeViews.set(node.id, view);\n if (view instanceof ParticleEmitterNodeView) particleEmitters.push(view);\n\n // Прямые дети корня сцены разрешают якоря относительно логического Canvas, а не размера корня.\n // Прямой ребёнок grid-layout (сам `node` здесь) не владеет своим отрисованным размером: Unity-подобная\n // фиксированная ячейка полностью переопределяет authored transform (см. applyLayoutItem). Его\n // собственным потомкам нужен именно cellWidth/cellHeight, а не anchor-resolved authored-размер —\n // иначе они не отслеживают изменение Cell width/height и якорятся относительно устаревшего размера.\n const gridParent = node.parentId === null ? undefined : nodesById.get(node.parentId);\n const gridCell = gridParent?.type === \"grid-layout\" ? resolveLayoutGroupSettings<GridLayoutSettings>(gridParent, profile) : undefined;\n // Та же логика для прямого ребёнка page-group (страницы): `PageItemContainer`/`updateManaged`\n // растягивают её на весь resolved rectangle группы независимо от собственных anchors ноды\n // (см. NodeView.applyResolvedTransform, managedByLayout). Здесь `node` — сама страница, поэтому\n // это переопределённый размер, который она фактически получит, — `parentSize`, уже разрешённый\n // как rectangle page-group. Без этой ветки дети страницы якорились бы относительно её\n // anchor-resolved authored-размера, который может расходиться с фактическим rectangle группы,\n // особенно в другом layout-профиле.\n const childSize = node.parentId === null\n ? rootSize\n : gridCell !== undefined\n ? { width: gridCell.cellWidth, height: gridCell.cellHeight }\n : gridParent?.type === \"page-group\"\n ? parentSize\n : { width: transform.width, height: transform.height };\n for (const [childIndex, childId] of node.children.entries()) {\n const childNode = nodesById.get(childId);\n const childView = buildNode(childId, childSize);\n if (isLayoutGroup(node) && childNode !== undefined && view instanceof LayoutGroupNodeView) {\n const layoutItem = new LayoutItemContainer(childView, onLayout);\n applyLayoutItem(layoutItem, childNode, node, profile);\n view.addLayoutChild(layoutItem);\n } else if (node.type === \"scroll-view\" && childNode !== undefined && view instanceof ScrollViewNodeView) {\n const scrollItem = new ScrollItemContainer(childView, onLayout);\n // Как и у layout-item: собственный (не растянутый якорями) размер ребёнка — List не\n // предоставляет per-item override размера, в отличие от Yoga flexGrow/cellSize.\n const own = resolveProfileTransform(childNode, profile).transform;\n scrollItem.sync(childNode, profile, { width: own.width, height: own.height });\n view.addScrollItem(scrollItem);\n } else if (node.type === \"page-group\" && childNode !== undefined && view instanceof PageGroupNodeView) {\n // Unlike a scroll-view item, a page fills the group's own resolved rect completely\n // (`childSize`, computed above): a page is a full sub-screen, not content sized to itself.\n const pageItem = new PageItemContainer(childView);\n pageItem.sync(childNode, profile, childSize);\n view.addPageItem(pageItem);\n } else {\n view.addChild(childView);\n }\n if (node.type === \"grid-layout\") {\n const settings = node.layoutGroup.overrides?.[profile] === undefined ? node.layoutGroup.base : { ...node.layoutGroup.base, ...node.layoutGroup.overrides[profile] };\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 instanceof LayoutGroupNodeView) view.addLayoutChild(lineBreak);\n }\n }\n }\n\n return view;\n };\n\n const ownerRoot = new Container();\n for (const rootNodeId of owner.rootNodeIds) {\n ownerRoot.addChild(buildNode(rootNodeId, rootSize));\n }\n\n return ownerRoot;\n };\n\n const canvasRoot = buildOwner(canvasSize);\n canvasRoot.scale.set(canvasScale);\n const hostRoot = new SceneViewport(canvasRoot, screenSize, options.clipToViewport ?? interaction === \"runtime\");\n particleEmitterRegistry.set(hostRoot, particleEmitters);\n // Контроллер применяет переводы сразу к уже созданным views, поэтому keyed Text показывает\n // базовую локаль без единого дополнительного вызова со стороны хоста.\n const localization = new SceneLocalization(document, scene, nodeViews, options.localization);\n wireCheckboxGroups(owner.nodes, nodeViews);\n wireSpineConnectors(owner.nodes, nodeViews);\n wireNodeReferences(owner.nodes, nodeViews, interaction);\n return { root: hostRoot, nodeViews, localization };\n}\n\nfunction wireSpineConnectors(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>): void {\n for (const node of nodes) {\n if (node.type !== \"spine\") continue;\n const view = nodeViews.get(node.id);\n if (!(view instanceof SpineNodeView)) continue;\n view.setConnectorBones((node.connectors ?? []).flatMap((connector) => {\n const target = nodeViews.get(connector.targetNodeId);\n return target === undefined ? [] : [{ ...connector, target }];\n }));\n }\n}\n\n/**\n * Разрешает все ссылки «нода → нода» в живые views: элементы item table и кнопки-стрелки пагинатора.\n * Та же форма, что у `wireSpineConnectors`: документ хранит id, а во что он превратился, знает только\n * собранная сцена, поэтому сами виды никогда не резолвят id. Один проход на все виды ссылок, чтобы\n * следующая не завела собственный обход с чуть другой областью видимости.\n *\n * Стрелки подключаются только в runtime-сцене: на authoring-канвасе контрол инертен, как и клик по\n * самой точке пагинатора. Вместимость таблицы, наоборот, видна и в редакторе — это не интерактивность.\n */\nfunction wireNodeReferences(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>, interaction: SceneInteractionMode): void {\n const arrowView = (nodeId: string | undefined): PaginationArrow | undefined => {\n const view = nodeId === undefined ? undefined : nodeViews.get(nodeId);\n return view instanceof ButtonNodeView || view instanceof StagedButtonNodeView ? view : undefined;\n };\n for (const node of nodes) {\n const view = nodeViews.get(node.id);\n if (node.type === \"item-table\" && view instanceof ItemTableNodeView) {\n view.setItems((node.items ?? []).map((itemId) => nodeViews.get(itemId)));\n } else if (node.type === \"pagination\" && view instanceof PaginationNodeView && interaction === \"runtime\") {\n view.setArrows({ previous: arrowView(node.prevButtonNodeId), next: arrowView(node.nextButtonNodeId) });\n } else if (node.type === \"page-group\" && view instanceof PageGroupNodeView && interaction === \"runtime\") {\n view.setArrows({ up: arrowView(node.pageUpButtonNodeId), down: arrowView(node.pageDownButtonNodeId) });\n }\n }\n}\n\n/**\n * Authored `group` gives sibling checkboxes radio-button behavior: checking one force-unchecks its\n * live group-mates (same `parentId`, same `group`), without touching the document. Runs once per\n * scene build; `CheckboxNodeView.forceCheck` never re-emits `onCheck`, so this can't recurse.\n */\nfunction wireCheckboxGroups(nodes: readonly UINode[], nodeViews: ReadonlyMap<string, Container>): void {\n const byGroup = new Map<string, CheckboxNodeView[]>();\n for (const node of nodes) {\n if (node.type !== \"checkbox\" || node.group === undefined) continue;\n const view = nodeViews.get(node.id);\n if (!(view instanceof CheckboxNodeView)) continue;\n const key = `${node.parentId ?? \"\"}::${node.group}`;\n const group = byGroup.get(key) ?? [];\n group.push(view);\n byGroup.set(key, group);\n }\n for (const group of byGroup.values()) {\n if (group.length < 2) continue;\n for (const view of group) {\n view.onCheck.connect((checked) => {\n if (!checked) return;\n for (const other of group) if (other !== view) other.forceCheck(false);\n });\n }\n }\n}\n\n/**\n * Applies a node's resolved transform, visibility, and content to an existing display object,\n * so editors can update views in place without rebuilding the scene tree.\n */\nexport function updateNodeView(view: Container, node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize, parentNode?: UINode, effect?: EffectDefinition, spineReferenceFrame?: SpineReferenceFrame): void {\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, parentSize);\n if (!(view instanceof NodeView)) return;\n if (view instanceof SpineNodeView) view.setReferenceFrame(spineReferenceFrame);\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);\n if (parentNode !== undefined && isLayoutGroup(parentNode) && view.parent instanceof LayoutItemContainer) {\n applyLayoutItem(view.parent, node, parentNode, profile);\n } else if (parentNode !== undefined && parentNode.type === \"scroll-view\" && view.parent instanceof ScrollItemContainer) {\n const own = resolveProfileTransform(node, profile).transform;\n view.parent.sync(node, profile, { width: own.width, height: own.height });\n } else if (parentNode !== undefined && parentNode.type === \"page-group\" && view.parent instanceof PageItemContainer && parentSize !== undefined) {\n // A page is position-managed exactly like a layout/scroll item: it fills the group's own rectangle\n // (`parentSize`, the same value `buildSceneView` passes as `childSize`). Without this branch an\n // in-place update fell through to `view.update` and handed the page back its authored x/y and\n // anchors, so editing anything inside a page group knocked its pages out of place.\n view.parent.sync(node, profile, parentSize);\n } else {\n view.update(node, profile, parentSize);\n }\n}\n\n/** Previews a resolved editor rectangle without consulting content bounds or rebuilding the view. */\nexport function previewNodeView(view: Container, node: UINode, profile: LayoutProfileId, transform: UINode[\"transform\"]): void {\n if (isLayoutGroup(node)) applyLayoutGroup(view, node, profile, undefined, { width: transform.width, height: transform.height });\n if (view instanceof NodeView) view.preview(node, transform, resolveProfileTransform(node, profile).visible, profile);\n}\n\n/** Hosts call this from their own Application ticker; runtime never subscribes to Ticker.shared. */\nexport function updateParticleEmitters(root: Container, deltaSeconds: number): void {\n const registered = particleEmitterRegistry.get(root);\n if (registered !== undefined) {\n for (const emitter of registered) emitter.updateParticles(deltaSeconds);\n return;\n }\n // Backward-compatible fallback for hosts that assemble a display tree manually instead of using\n // buildSceneView. Built scenes always take the O(emitter count) registry path above.\n const visit = (view: Container): void => {\n if (view instanceof ParticleEmitterNodeView) view.updateParticles(deltaSeconds);\n for (const child of view.children) visit(child);\n };\n visit(root);\n}\n\n/** Lists the nodes a scene renders, including nodes of prefab definitions its prefab instances expand to. */\nexport function collectRenderedNodes(document: ProjectDocument, scene: Scene): UINode[] {\n return resolveOwnerNodeGraph(document, scene).nodes;\n}\n\nexport type PrefabViewConfiguration = Pick<Extract<UINode, { type: \"prefab-instance\" }>, \"propertyOverrides\" | \"locallyAddedNodes\"> & { instanceId?: string };\n\nfunction prefabScene(document: ProjectDocument, prefabId: string, configuration: PrefabViewConfiguration = {}): { document: ProjectDocument; sceneId: string; instanceId: string } {\n const prefab = document.prefabs.find((candidate) => candidate.id === prefabId);\n if (prefab === undefined) throw new Error(`Prefab '${prefabId}' does not exist in the project document.`);\n const width = Math.max(1, ...prefab.nodes.map((node) => Math.abs(node.transform.x) + Math.max(0, node.transform.width)));\n const height = Math.max(1, ...prefab.nodes.map((node) => Math.abs(node.transform.y) + Math.max(0, node.transform.height)));\n const instanceId = configuration.instanceId ?? createStableId();\n const instance: Extract<UINode, { type: \"prefab-instance\" }> = {\n id: instanceId, name: prefab.name, type: \"prefab-instance\", prefabId, parentId: null, children: [],\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 },\n ...(configuration.propertyOverrides === undefined ? {} : { propertyOverrides: structuredClone(configuration.propertyOverrides) }),\n ...(configuration.locallyAddedNodes === undefined ? {} : { locallyAddedNodes: structuredClone(configuration.locallyAddedNodes) }),\n };\n const sceneId = createStableId();\n const viewport = { width, height };\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 } } };\n return { document: { ...document, scenes: [...document.scenes, scene] }, sceneId, instanceId };\n}\n\n/** Builds a fresh runtime prefab instance without requiring it to already exist in a scene. */\nexport function buildPrefabView(document: ProjectDocument, prefabId: string, profile: LayoutProfileId, options: BuildSceneViewOptions, configuration: PrefabViewConfiguration = {}): SceneViewResult & { instanceId: string } {\n const synthetic = prefabScene(document, prefabId, configuration);\n return { ...buildSceneView(synthetic.document, synthetic.sceneId, profile, { ...options, clipToViewport: false }), instanceId: synthetic.instanceId };\n}\n\n/** Loads a prefab's assets and returns a fresh display tree suitable for dynamic game-code spawning. */\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 }> {\n const synthetic = prefabScene(document, prefabId, configuration);\n return { ...await loadSceneView(synthetic.document, synthetic.sceneId, profile, resolveFileUrl, { ...options, clipToViewport: false }), instanceId: synthetic.instanceId };\n}\n\n/** Loads a scene's textures and Spine data, then builds its display tree in one call. */\nexport async function loadSceneView(\n document: ProjectDocument,\n sceneId: string,\n profile: LayoutProfileId,\n resolveFileUrl: FileUrlResolver,\n options: { interaction: SceneInteractionMode; ticker?: Ticker; localization?: SceneLocalizationOptions; clipToViewport?: boolean; assetCache?: SceneAssetCache },\n): Promise<SceneViewResult> {\n // Без assetCache каждый вызов начинает с пустых кэшей: для одиночной загрузки сцены это нормально, а вот\n // игровой код, который поднимает пресеты по одному, обязан передать собственный кэш — иначе один и тот же\n // скелет, атлас и текстура парсятся заново на каждую вьюху и дублируются в видеопамяти.\n const cache = options.assetCache;\n const [textures, spines, fonts, bitmapFonts] = await Promise.all([\n loadSceneTextures(document, sceneId, (asset) => (asset.type === \"image\" ? resolveFileUrl(asset.source.uri) : undefined), resolveFileUrl, cache?.textures, cache?.spritesheets, cache?.bitmapFonts),\n loadSceneSpines(document, sceneId, resolveFileUrl, cache?.spines),\n loadSceneFonts(document, sceneId, resolveFileUrl, cache?.fonts),\n loadSceneBitmapFonts(document, sceneId, resolveFileUrl, cache?.bitmapFonts),\n ]);\n return buildSceneView(document, sceneId, profile, { interaction: options.interaction, textures, spines, fonts, bitmapFonts, ticker: options.ticker, localization: options.localization, clipToViewport: options.clipToViewport });\n}\n"]}
@@ -64,8 +64,15 @@ export declare abstract class NodeView extends Container {
64
64
  update(node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize): void;
65
65
  /** Applies a transient editor rectangle without deriving it from content-dependent Pixi bounds. */
66
66
  preview(node: UINode, transform: UINode["transform"], visible?: boolean, profile?: LayoutProfileId): void;
67
- /** Applies the rectangle owned by a direct parent's layout solver. */
68
- updateManaged(node: UINode, profile: LayoutProfileId, size: LayoutSize): void;
67
+ /**
68
+ * Applies the rectangle owned by a direct parent's layout solver.
69
+ *
70
+ * `forceVisible` lets an owner that already fully owns show/hide of this child (a page group's
71
+ * `PageItemContainer`, see `pageGroup.ts`) override the node's own authored `visible` — the same
72
+ * way it already overrides position: a page isn't a content item that can independently opt out of
73
+ * being shown, it's a whole sub-screen whose only visibility switch is "is it the active page".
74
+ */
75
+ updateManaged(node: UINode, profile: LayoutProfileId, size: LayoutSize, forceVisible?: boolean): void;
69
76
  get layoutRectangle(): LayoutSize;
70
77
  /** Авторская видимость узла отдельно от `visible`, поверх которой применяется `hiddenByOwner`. */
71
78
  get documentVisible(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"NodeView.d.ts","sourceRoot":"","sources":["../../src/views/NodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAa,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAqD,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAElG;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,SAAS,CAAC;AAE3D;;;;GAIG;AACH,8BAAsB,QAAS,SAAQ,SAAS;IAC9C,SAAS,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC9B,4FAA4F;IAC5F,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,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AE,SAAS,GAAG,OAAO,CAEvC;IAED,mGAAmG;IACnG,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAI7C;IAED,kGAAkG;IAClG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAE7G;;;;OAIG;IACH,SAAS,CAAC,wBAAwB,IAAI,IAAI,CAAG;IAE7C,OAAO,CAAC,sBAAsB;IAyB9B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAG5E;IAED,mGAAmG;IACnG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,OAAO,UAAO,EAAE,OAAO,GAAE,eAA2B,GAAG,IAAI,CAEhH;IAED;;;;;;;OAOG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,UAAQ,GAAG,IAAI,CAGlG;IAED,IAAI,eAAe,IAAI,UAAU,CAEhC;IAED,kGAAkG;IAClG,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,QAAQ,IAAI,KAAK,GAAG,SAAS,CAE5B;IAED;;;;;;OAMG;IACH,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAG;CACnD"}
@@ -96,10 +96,17 @@ export class NodeView extends Container {
96
96
  preview(node, transform, visible = true, profile = "desktop") {
97
97
  this.applyResolvedTransform(node, transform, visible, false, profile);
98
98
  }
99
- /** Applies the rectangle owned by a direct parent's layout solver. */
100
- updateManaged(node, profile, size) {
99
+ /**
100
+ * Applies the rectangle owned by a direct parent's layout solver.
101
+ *
102
+ * `forceVisible` lets an owner that already fully owns show/hide of this child (a page group's
103
+ * `PageItemContainer`, see `pageGroup.ts`) override the node's own authored `visible` — the same
104
+ * way it already overrides position: a page isn't a content item that can independently opt out of
105
+ * being shown, it's a whole sub-screen whose only visibility switch is "is it the active page".
106
+ */
107
+ updateManaged(node, profile, size, forceVisible = false) {
101
108
  const resolved = resolveProfileTransform(node, profile);
102
- this.applyResolvedTransform(node, { ...resolved.transform, x: 0, y: 0, width: size.width, height: size.height }, resolved.visible, true, profile);
109
+ this.applyResolvedTransform(node, { ...resolved.transform, x: 0, y: 0, width: size.width, height: size.height }, forceVisible || resolved.visible, true, profile);
103
110
  }
104
111
  get layoutRectangle() {
105
112
  return { width: this.layoutWidth, height: this.layoutHeight };
@@ -1 +1 @@
1
- {"version":3,"file":"NodeView.js","sourceRoot":"","sources":["../../src/views/NodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,SAAS,EAA2B,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAmB,MAAM,cAAc,CAAC;AASlG;;;;GAIG;AACH,MAAM,OAAgB,QAAS,SAAQ,SAAS;IACpC,OAAO,CAAa;IAC9B,4FAA4F;IACzE,QAAQ,CAA2C;IACtE,6FAA6F;IAC5E,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC;IAC5C,yGAAyG;IAC/F,WAAW,GAAG,CAAC,CAAC;IAChB,YAAY,GAAG,CAAC,CAAC;IAC3B;;;;;;;;OAQG;IACH,aAAa,GAAG,KAAK,CAAC;IACtB,4FAA4F;IACpF,eAAe,GAAG,IAAI,CAAC;IAE/B,YAAY,QAAuC;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,UAAU,CAAC,OAA2B;QAC9C,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI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IACtE,aAAa,CAAC,IAAY,EAAE,OAAwB,EAAE,IAAgB;QACpE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACpJ,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;IAChE,CAAC;IAED,kGAAkG;IAClG,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACH,oBAAoB,CAAC,WAAmB,IAAS,CAAC;CACnD","sourcesContent":["import { Spine } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport { type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container, Rectangle, Texture, type PointData } from \"pixi.js\";\r\nimport { resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"../layout.js\";\r\n\r\n/**\r\n * Whether a built scene is an inert authoring surface or a live one.\r\n * The editor canvas builds `authoring` scenes so controls never swallow selection and drag\r\n * gestures; Preview and the consuming app build `runtime` scenes with real pointer handling.\r\n */\r\nexport type SceneInteractionMode = \"authoring\" | \"runtime\";\r\n\r\n/**\r\n * Base display object for every schema node type. The whole layout contract — profile overrides,\r\n * anchors, pivot, position, scale, visibility — lives here once; subclasses only synchronize their\r\n * type-specific content against the resolved layout rectangle.\r\n */\r\nexport abstract class NodeView extends Container {\r\n protected content?: Container;\r\n /** A mutable scene texture map: assets may be loaded after this stable view was created. */\r\n protected readonly textures: ReadonlyMap<string, Texture> | undefined;\r\n /** Node's own grab rectangle in local space, kept equal to its resolved layout rectangle. */\r\n private readonly grabRect = new Rectangle();\r\n /** Authored/computed RectTransform-like rectangle; unlike Pixi bounds it also exists without content. */\r\n protected layoutWidth = 0;\r\n protected layoutHeight = 0;\r\n /**\r\n * Скрыт ли узел владельцем-вместимостью (`ItemTableNodeView`) поверх авторской видимости.\r\n *\r\n * Флаг живёт здесь, а не только в самом владельце, потому что `visible` заново выводится из\r\n * документа на каждом обновлении — в том числе в `updateManaged`, который для элемента внутри\r\n * layout-группы дёргает сам layout-движок своим колбэком `onLayout` (см. `LayoutItemContainer`),\r\n * то есть уже после того, как владелец закончил свой проход. Одно присваивание `visible` снаружи\r\n * пережило бы ровно до следующего пересчёта раскладки; сложение с этим флагом переживает любой.\r\n */\r\n hiddenByOwner = false;\r\n /** Visibility last resolved from the document, before `hiddenByOwner` is applied on top. */\r\n private authoredVisible = true;\r\n\r\n constructor(textures?: ReadonlyMap<string, Texture>) {\r\n super();\r\n this.textures = textures;\r\n }\r\n\r\n protected textureFor(assetId: string | undefined): Texture | undefined {\r\n return assetId === undefined ? undefined : this.textures?.get(assetId);\r\n }\r\n\r\n /**\r\n * Makes every node selectable and draggable by its layout rectangle, whatever it renders.\r\n *\r\n * Lives here rather than in a subclass because a bare `Container` has no `containsPoint` of its\r\n * own: without this, Pixi could only find a node through whatever content the subclass happens to\r\n * draw, so nodes that draw nothing (container) or keep their content out of hit testing (button,\r\n * whose `@pixi/ui` view is inert while authoring) would silently stop being selectable.\r\n *\r\n * Deliberately `containsPoint` and NOT `hitArea`: Pixi's `hitPruneFn` drops a container together\r\n * with its whole subtree once the point falls outside its `hitArea`, which would make any child\r\n * reaching past its parent's rectangle visible but unclickable. `containsPoint` never clips\r\n * children — they are hit-tested first and independently, so a child always stays grabbable.\r\n */\r\n containsPoint(point: PointData): boolean {\r\n return this.grabRect.contains(point.x, point.y);\r\n }\r\n\r\n /** Заменяет содержимое ноды: прежнее снимается со сцены и уничтожается, чтобы не копить сироты. */\r\n protected setContent(content: Container): void {\r\n if (this.content !== undefined) { this.removeChild(this.content); this.content.destroy(); }\r\n this.content = content;\r\n this.addChild(content);\r\n }\r\n\r\n /** Syncs type-specific content to the resolved layout rectangle; layout math itself is shared. */\r\n protected abstract syncContent(node: UINode, transform: UINode[\"transform\"], profile: LayoutProfileId): void;\r\n\r\n /**\r\n * Called after the view's own transform has been applied, before the next render. A subclass can\r\n * use it to recompute geometry that depends on the view's world transform (e.g. Spine connector\r\n * hosts) immediately, without waiting for the next ticker frame or document commit.\r\n */\r\n protected onLayoutTransformApplied(): void {}\r\n\r\n private applyResolvedTransform(node: UINode, transform: UINode[\"transform\"], visible: boolean, managedByLayout: boolean, profile: LayoutProfileId): void {\r\n this.syncContent(node, transform, profile);\r\n\r\n const pivotX = (transform.pivotX ?? 0) * transform.width;\r\n const pivotY = (transform.pivotY ?? 0) * transform.height;\r\n this.pivot.set(pivotX, pivotY);\r\n // x/y are the pivot offset from the resolved anchor. Thus a centred anchor and pivot at\r\n // zero offsets place the visual centre exactly at the parent's centre.\r\n // A managed child is positioned by its technical Yoga item. Its own NodeView keeps only the\r\n // pivot offset inside that computed rectangle; authored x/y and anchors do not participate.\r\n this.position.set(managedByLayout ? pivotX : transform.x, managedByLayout ? pivotY : transform.y);\r\n this.rotation = transform.rotation;\r\n this.scale.set(transform.scaleX, transform.scaleY);\r\n this.authoredVisible = visible;\r\n this.visible = visible && !this.hiddenByOwner;\r\n this.layoutWidth = transform.width;\r\n this.layoutHeight = transform.height;\r\n // Тот же прямоугольник, что видит пользователь: grab-зона не зависит от содержимого ноды.\r\n this.grabRect.x = 0;\r\n this.grabRect.y = 0;\r\n this.grabRect.width = transform.width;\r\n this.grabRect.height = transform.height;\r\n this.onLayoutTransformApplied();\r\n }\r\n\r\n update(node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize): void {\r\n const resolved = resolveProfileTransform(node, profile);\r\n this.applyResolvedTransform(node, resolveAnchoredTransform(resolved.transform, parentSize), resolved.visible, false, profile);\r\n }\r\n\r\n /** Applies a transient editor rectangle without deriving it from content-dependent Pixi bounds. */\r\n preview(node: UINode, transform: UINode[\"transform\"], visible = true, profile: LayoutProfileId = \"desktop\"): void {\r\n this.applyResolvedTransform(node, transform, visible, false, profile);\r\n }\r\n\r\n /** Applies the rectangle owned by a direct parent's layout solver. */\r\n updateManaged(node: UINode, profile: LayoutProfileId, size: LayoutSize): void {\r\n const resolved = resolveProfileTransform(node, profile);\r\n this.applyResolvedTransform(node, { ...resolved.transform, x: 0, y: 0, width: size.width, height: size.height }, resolved.visible, true, profile);\r\n }\r\n\r\n get layoutRectangle(): LayoutSize {\r\n return { width: this.layoutWidth, height: this.layoutHeight };\r\n }\r\n\r\n /** Авторская видимость узла отдельно от `visible`, поверх которой применяется `hiddenByOwner`. */\r\n get documentVisible(): boolean {\r\n return this.authoredVisible;\r\n }\r\n\r\n getSpine(): Spine | undefined {\r\n return this.content instanceof Spine ? this.content : undefined;\r\n }\r\n\r\n /**\r\n * Rasterizes canvas-based content (`TextNodeView`) at a higher pixel density than the renderer's\r\n * own backing resolution, so an authoring camera zoomed in doesn't magnify an already-rasterized\r\n * bitmap past its source resolution and read as blurred. A no-op base implementation: sprite/\r\n * graphics/bitmap-text content is either GPU-native (always crisp under zoom) or, for bitmap-text,\r\n * has its resolution fixed by the installed `BitmapFont` and can't be changed per instance.\r\n */\r\n setContentResolution(_resolution: number): void {}\r\n}\r\n"]}
1
+ {"version":3,"file":"NodeView.js","sourceRoot":"","sources":["../../src/views/NodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,SAAS,EAA2B,MAAM,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AAC,eAAe,CAAC;IAC9B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,CAAC;IAED;;;;;;OAMG;IACH,oBAAoB,CAAC,WAAmB,IAAS,CAAC;CACnD","sourcesContent":["import { Spine } from \"@esotericsoftware/spine-pixi-v8\";\r\nimport { type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container, Rectangle, Texture, type PointData } from \"pixi.js\";\r\nimport { resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"../layout.js\";\r\n\r\n/**\r\n * Whether a built scene is an inert authoring surface or a live one.\r\n * The editor canvas builds `authoring` scenes so controls never swallow selection and drag\r\n * gestures; Preview and the consuming app build `runtime` scenes with real pointer handling.\r\n */\r\nexport type SceneInteractionMode = \"authoring\" | \"runtime\";\r\n\r\n/**\r\n * Base display object for every schema node type. The whole layout contract — profile overrides,\r\n * anchors, pivot, position, scale, visibility — lives here once; subclasses only synchronize their\r\n * type-specific content against the resolved layout rectangle.\r\n */\r\nexport abstract class NodeView extends Container {\r\n protected content?: Container;\r\n /** A mutable scene texture map: assets may be loaded after this stable view was created. */\r\n protected readonly textures: ReadonlyMap<string, Texture> | undefined;\r\n /** Node's own grab rectangle in local space, kept equal to its resolved layout rectangle. */\r\n private readonly grabRect = new Rectangle();\r\n /** Authored/computed RectTransform-like rectangle; unlike Pixi bounds it also exists without content. */\r\n protected layoutWidth = 0;\r\n protected layoutHeight = 0;\r\n /**\r\n * Скрыт ли узел владельцем-вместимостью (`ItemTableNodeView`) поверх авторской видимости.\r\n *\r\n * Флаг живёт здесь, а не только в самом владельце, потому что `visible` заново выводится из\r\n * документа на каждом обновлении — в том числе в `updateManaged`, который для элемента внутри\r\n * layout-группы дёргает сам layout-движок своим колбэком `onLayout` (см. `LayoutItemContainer`),\r\n * то есть уже после того, как владелец закончил свой проход. Одно присваивание `visible` снаружи\r\n * пережило бы ровно до следующего пересчёта раскладки; сложение с этим флагом переживает любой.\r\n */\r\n hiddenByOwner = false;\r\n /** Visibility last resolved from the document, before `hiddenByOwner` is applied on top. */\r\n private authoredVisible = true;\r\n\r\n constructor(textures?: ReadonlyMap<string, Texture>) {\r\n super();\r\n this.textures = textures;\r\n }\r\n\r\n protected textureFor(assetId: string | undefined): Texture | undefined {\r\n return assetId === undefined ? undefined : this.textures?.get(assetId);\r\n }\r\n\r\n /**\r\n * Makes every node selectable and draggable by its layout rectangle, whatever it renders.\r\n *\r\n * Lives here rather than in a subclass because a bare `Container` has no `containsPoint` of its\r\n * own: without this, Pixi could only find a node through whatever content the subclass happens to\r\n * draw, so nodes that draw nothing (container) or keep their content out of hit testing (button,\r\n * whose `@pixi/ui` view is inert while authoring) would silently stop being selectable.\r\n *\r\n * Deliberately `containsPoint` and NOT `hitArea`: Pixi's `hitPruneFn` drops a container together\r\n * with its whole subtree once the point falls outside its `hitArea`, which would make any child\r\n * reaching past its parent's rectangle visible but unclickable. `containsPoint` never clips\r\n * children — they are hit-tested first and independently, so a child always stays grabbable.\r\n */\r\n containsPoint(point: PointData): boolean {\r\n return this.grabRect.contains(point.x, point.y);\r\n }\r\n\r\n /** Заменяет содержимое ноды: прежнее снимается со сцены и уничтожается, чтобы не копить сироты. */\r\n protected setContent(content: Container): void {\r\n if (this.content !== undefined) { this.removeChild(this.content); this.content.destroy(); }\r\n this.content = content;\r\n this.addChild(content);\r\n }\r\n\r\n /** Syncs type-specific content to the resolved layout rectangle; layout math itself is shared. */\r\n protected abstract syncContent(node: UINode, transform: UINode[\"transform\"], profile: LayoutProfileId): void;\r\n\r\n /**\r\n * Called after the view's own transform has been applied, before the next render. A subclass can\r\n * use it to recompute geometry that depends on the view's world transform (e.g. Spine connector\r\n * hosts) immediately, without waiting for the next ticker frame or document commit.\r\n */\r\n protected onLayoutTransformApplied(): void {}\r\n\r\n private applyResolvedTransform(node: UINode, transform: UINode[\"transform\"], visible: boolean, managedByLayout: boolean, profile: LayoutProfileId): void {\r\n this.syncContent(node, transform, profile);\r\n\r\n const pivotX = (transform.pivotX ?? 0) * transform.width;\r\n const pivotY = (transform.pivotY ?? 0) * transform.height;\r\n this.pivot.set(pivotX, pivotY);\r\n // x/y are the pivot offset from the resolved anchor. Thus a centred anchor and pivot at\r\n // zero offsets place the visual centre exactly at the parent's centre.\r\n // A managed child is positioned by its technical Yoga item. Its own NodeView keeps only the\r\n // pivot offset inside that computed rectangle; authored x/y and anchors do not participate.\r\n this.position.set(managedByLayout ? pivotX : transform.x, managedByLayout ? pivotY : transform.y);\r\n this.rotation = transform.rotation;\r\n this.scale.set(transform.scaleX, transform.scaleY);\r\n this.authoredVisible = visible;\r\n this.visible = visible && !this.hiddenByOwner;\r\n this.layoutWidth = transform.width;\r\n this.layoutHeight = transform.height;\r\n // Тот же прямоугольник, что видит пользователь: grab-зона не зависит от содержимого ноды.\r\n this.grabRect.x = 0;\r\n this.grabRect.y = 0;\r\n this.grabRect.width = transform.width;\r\n this.grabRect.height = transform.height;\r\n this.onLayoutTransformApplied();\r\n }\r\n\r\n update(node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize): void {\r\n const resolved = resolveProfileTransform(node, profile);\r\n this.applyResolvedTransform(node, resolveAnchoredTransform(resolved.transform, parentSize), resolved.visible, false, profile);\r\n }\r\n\r\n /** Applies a transient editor rectangle without deriving it from content-dependent Pixi bounds. */\r\n preview(node: UINode, transform: UINode[\"transform\"], visible = true, profile: LayoutProfileId = \"desktop\"): void {\r\n this.applyResolvedTransform(node, transform, visible, false, profile);\r\n }\r\n\r\n /**\r\n * Applies the rectangle owned by a direct parent's layout solver.\r\n *\r\n * `forceVisible` lets an owner that already fully owns show/hide of this child (a page group's\r\n * `PageItemContainer`, see `pageGroup.ts`) override the node's own authored `visible` — the same\r\n * way it already overrides position: a page isn't a content item that can independently opt out of\r\n * being shown, it's a whole sub-screen whose only visibility switch is \"is it the active page\".\r\n */\r\n updateManaged(node: UINode, profile: LayoutProfileId, size: LayoutSize, forceVisible = false): void {\r\n const resolved = resolveProfileTransform(node, profile);\r\n this.applyResolvedTransform(node, { ...resolved.transform, x: 0, y: 0, width: size.width, height: size.height }, forceVisible || resolved.visible, true, profile);\r\n }\r\n\r\n get layoutRectangle(): LayoutSize {\r\n return { width: this.layoutWidth, height: this.layoutHeight };\r\n }\r\n\r\n /** Авторская видимость узла отдельно от `visible`, поверх которой применяется `hiddenByOwner`. */\r\n get documentVisible(): boolean {\r\n return this.authoredVisible;\r\n }\r\n\r\n getSpine(): Spine | undefined {\r\n return this.content instanceof Spine ? this.content : undefined;\r\n }\r\n\r\n /**\r\n * Rasterizes canvas-based content (`TextNodeView`) at a higher pixel density than the renderer's\r\n * own backing resolution, so an authoring camera zoomed in doesn't magnify an already-rasterized\r\n * bitmap past its source resolution and read as blurred. A no-op base implementation: sprite/\r\n * graphics/bitmap-text content is either GPU-native (always crisp under zoom) or, for bitmap-text,\r\n * has its resolution fixed by the installed `BitmapFont` and can't be changed per instance.\r\n */\r\n setContentResolution(_resolution: number): void {}\r\n}\r\n"]}
@@ -2,6 +2,7 @@ import { type PageGroupNode } from "@pixi-ui-editor/schema";
2
2
  import { Container, Texture } from "pixi.js";
3
3
  import { PageItemContainer } from "../pageGroup.js";
4
4
  import { NodeView } from "./NodeView.js";
5
+ import type { PaginationArrow } from "./PaginationNodeView.js";
5
6
  export type { PageGroupNode };
6
7
  /**
7
8
  * Shows exactly one direct child ("page") at a time and hides the rest; each page fills the group's
@@ -38,5 +39,18 @@ export declare class PageGroupNodeView extends NodeView {
38
39
  get page(): number;
39
40
  /** External sync from game code (or the pagination widget's `onPageChange`): switches the visible page. */
40
41
  set page(value: number);
42
+ /**
43
+ * Подключает опциональные авторские кнопки-стрелки `pageUpButtonNodeId`/`pageDownButtonNodeId` —
44
+ * тот же приём, что `PaginationNodeView.setArrows` даёт пагинатору (ADR 0043): кнопки остаются
45
+ * обычными нодами сцены, виджет только подписывается на `onPress`. В отличие от пагинатора, здесь
46
+ * нет края диапазона, который гасил бы стрелку: это карусель — "up" с последней страницы
47
+ * возвращается на первую, "down" с первой уходит на последнюю, поэтому обе стрелки всегда активны.
48
+ */
49
+ setArrows(arrows: {
50
+ up?: PaginationArrow;
51
+ down?: PaginationArrow;
52
+ }): void;
53
+ /** Moves by `delta` pages, wrapping around both ends of the range — a carousel, not a clamp. */
54
+ private step;
41
55
  }
42
56
  //# sourceMappingURL=PageGroupNodeView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageGroupNodeView.d.ts","sourceRoot":"","sources":["../../src/views/PageGroupNodeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IACzC,OAAO,CAAC,WAAW,CAAS;IAE5B,YAAY,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAGlF;IAED,mHAAmH;IACnH,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAKzC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAU/B;IAED,SAAS,CAAC,WAAW,IAAI,IAAI,CAE5B;IAED,OAAO,CAAC,eAAe;IAIvB,IAAI,SAAS,IAAI,MAAM,CAA8B;IAErD,IAAI,IAAI,IAAI,MAAM,CAA6B;IAE/C,2GAA2G;IAC3G,IAAI,IAAI,CAA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,23 @@ export class PageGroupNodeView extends NodeView {
68
68
  this.currentPage = next;
69
69
  this.applyVisibility();
70
70
  }
71
+ /**
72
+ * Подключает опциональные авторские кнопки-стрелки `pageUpButtonNodeId`/`pageDownButtonNodeId` —
73
+ * тот же приём, что `PaginationNodeView.setArrows` даёт пагинатору (ADR 0043): кнопки остаются
74
+ * обычными нодами сцены, виджет только подписывается на `onPress`. В отличие от пагинатора, здесь
75
+ * нет края диапазона, который гасил бы стрелку: это карусель — "up" с последней страницы
76
+ * возвращается на первую, "down" с первой уходит на последнюю, поэтому обе стрелки всегда активны.
77
+ */
78
+ setArrows(arrows) {
79
+ arrows.up?.onPress.connect(() => this.step(1));
80
+ arrows.down?.onPress.connect(() => this.step(-1));
81
+ }
82
+ /** Moves by `delta` pages, wrapping around both ends of the range — a carousel, not a clamp. */
83
+ step(delta) {
84
+ if (this.items.length === 0)
85
+ return;
86
+ const count = this.items.length;
87
+ this.page = (this.currentPage + delta + count) % count;
88
+ }
71
89
  }
72
90
  //# sourceMappingURL=PageGroupNodeView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageGroupNodeView.js","sourceRoot":"","sources":["../../src/views/PageGroupNodeView.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,iBAAkB,SAAQ,QAAQ;IAC5B,KAAK,GAAgB,EAAE,CAAC;IACjC,WAAW,CAAS;IAE5B,YAAY,IAAmB,EAAE,QAAkD;QACjF,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,mHAAmH;IACnH,WAAW,CAAC,IAAuB;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpB,MAAM,KA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IAE/C,2GAA2G;IAC3G,IAAI,IAAI,CAAC,KAAa;QACpB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7E,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW;YAAE,OAAO;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["import { type PageGroupNode, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container, Texture } from \"pixi.js\";\r\nimport { PageItemContainer } from \"../pageGroup.js\";\r\nimport { NodeView } from \"./NodeView.js\";\r\n\r\nexport type { PageGroupNode };\r\n\r\n/**\r\n * Shows exactly one direct child (\"page\") at a time and hides the rest; each page fills the group's\r\n * full resolved rectangle (`PageItemContainer`/`scene.ts`, the same \"children don't own their own\r\n * position\" contract a layout group or scroll-view has). Page order is simply hierarchy child order,\r\n * followed by any pages appended at runtime through `addPage`.\r\n *\r\n * This view never decides on its own when to switch pages — it is driven one-way by `setPageGroupPage`\r\n * from game code, or from the standalone `pagination` widget's `onPageChange` — the same relationship\r\n * `PaginationNodeView` has with the value it displays. No built-in swipe gesture or transition.\r\n *\r\n * Pages are ordinarily authored (one per document child), but the count is not required to be known at\r\n * authoring time: a growing dataset (e.g. a spin history list appended to during play) can start with\r\n * zero or a few authored pages and grow through `addPage` — the same \"the document is a starting point,\r\n * not a ceiling\" contract `ScrollViewNodeView.addScrollItem` already gives scroll-view content.\r\n */\r\nexport class PageGroupNodeView extends NodeView {\r\n private readonly items: Container[] = [];\r\n private currentPage: number;\r\n\r\n constructor(node: PageGroupNode, textures: ReadonlyMap<string, Texture> | undefined) {\r\n super(textures);\r\n this.currentPage = Math.max(0, Math.round(node.defaultPage));\r\n }\r\n\r\n /** Registers a direct child's wrapper in hierarchy order — called once per child while the scene tree is built. */\r\n addPageItem(item: PageItemContainer): void {\r\n this.addChild(item);\r\n const index = this.items.length;\r\n this.items.push(item);\r\n item.visible = index === this.currentPage;\r\n }\r\n\r\n /**\r\n * Appends a page built at runtime (e.g. via `buildPrefabView`/`loadPrefabView`, or any hand-built\r\n * `Container`) after the last one and fits it to the group's current resolved rectangle — a\r\n * `SceneViewport` root is resized through its own `resize(...)` (the same fit contract Preview and\r\n * export already rely on); anything else falls back to `Container.width`/`height`. Hidden until\r\n * switched to via `page`/`setPageGroupViewPage`. Returns the new page's index.\r\n */\r\n addPage(view: Container): number {\r\n const { width, height } = this.layoutRectangle;\r\n const resizable = view as Partial<{ resize: (size: { width: number; height: number }) => void }>;\r\n if (typeof resizable.resize === \"function\") resizable.resize({ width, height });\r\n else { view.width = width; view.height = height; }\r\n const index = this.items.length;\r\n this.items.push(view);\r\n view.visible = index === this.currentPage;\r\n this.addChild(view);\r\n return index;\r\n }\r\n\r\n protected syncContent(): void {\r\n this.applyVisibility();\r\n }\r\n\r\n private applyVisibility(): void {\r\n this.items.forEach((item, index) => { item.visible = index === this.currentPage; });\r\n }\r\n\r\n get pageCount(): number { return this.items.length; }\r\n\r\n get page(): number { return this.currentPage; }\r\n\r\n /** External sync from game code (or the pagination widget's `onPageChange`): switches the visible page. */\r\n set page(value: number) {\r\n if (this.items.length === 0) return;\r\n const next = Math.min(Math.max(0, Math.round(value)), this.items.length - 1);\r\n if (next === this.currentPage) return;\r\n this.currentPage = next;\r\n this.applyVisibility();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PageGroupNodeView.js","sourceRoot":"","sources":["../../src/views/PageGroupNodeView.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKzC;;;;;;;;;;;;;;GAcG;AACH,MAA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YAAE,OAAO;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;IACzD,CAAC;CACF","sourcesContent":["import { type PageGroupNode, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container, Texture } from \"pixi.js\";\r\nimport { PageItemContainer } from \"../pageGroup.js\";\r\nimport { NodeView } from \"./NodeView.js\";\r\nimport type { PaginationArrow } from \"./PaginationNodeView.js\";\r\n\r\nexport type { PageGroupNode };\r\n\r\n/**\r\n * Shows exactly one direct child (\"page\") at a time and hides the rest; each page fills the group's\r\n * full resolved rectangle (`PageItemContainer`/`scene.ts`, the same \"children don't own their own\r\n * position\" contract a layout group or scroll-view has). Page order is simply hierarchy child order,\r\n * followed by any pages appended at runtime through `addPage`.\r\n *\r\n * This view never decides on its own when to switch pages — it is driven one-way by `setPageGroupPage`\r\n * from game code, or from the standalone `pagination` widget's `onPageChange` — the same relationship\r\n * `PaginationNodeView` has with the value it displays. No built-in swipe gesture or transition.\r\n *\r\n * Pages are ordinarily authored (one per document child), but the count is not required to be known at\r\n * authoring time: a growing dataset (e.g. a spin history list appended to during play) can start with\r\n * zero or a few authored pages and grow through `addPage` — the same \"the document is a starting point,\r\n * not a ceiling\" contract `ScrollViewNodeView.addScrollItem` already gives scroll-view content.\r\n */\r\nexport class PageGroupNodeView extends NodeView {\r\n private readonly items: Container[] = [];\r\n private currentPage: number;\r\n\r\n constructor(node: PageGroupNode, textures: ReadonlyMap<string, Texture> | undefined) {\r\n super(textures);\r\n this.currentPage = Math.max(0, Math.round(node.defaultPage));\r\n }\r\n\r\n /** Registers a direct child's wrapper in hierarchy order — called once per child while the scene tree is built. */\r\n addPageItem(item: PageItemContainer): void {\r\n this.addChild(item);\r\n const index = this.items.length;\r\n this.items.push(item);\r\n item.visible = index === this.currentPage;\r\n }\r\n\r\n /**\r\n * Appends a page built at runtime (e.g. via `buildPrefabView`/`loadPrefabView`, or any hand-built\r\n * `Container`) after the last one and fits it to the group's current resolved rectangle — a\r\n * `SceneViewport` root is resized through its own `resize(...)` (the same fit contract Preview and\r\n * export already rely on); anything else falls back to `Container.width`/`height`. Hidden until\r\n * switched to via `page`/`setPageGroupViewPage`. Returns the new page's index.\r\n */\r\n addPage(view: Container): number {\r\n const { width, height } = this.layoutRectangle;\r\n const resizable = view as Partial<{ resize: (size: { width: number; height: number }) => void }>;\r\n if (typeof resizable.resize === \"function\") resizable.resize({ width, height });\r\n else { view.width = width; view.height = height; }\r\n const index = this.items.length;\r\n this.items.push(view);\r\n view.visible = index === this.currentPage;\r\n this.addChild(view);\r\n return index;\r\n }\r\n\r\n protected syncContent(): void {\r\n this.applyVisibility();\r\n }\r\n\r\n private applyVisibility(): void {\r\n this.items.forEach((item, index) => { item.visible = index === this.currentPage; });\r\n }\r\n\r\n get pageCount(): number { return this.items.length; }\r\n\r\n get page(): number { return this.currentPage; }\r\n\r\n /** External sync from game code (or the pagination widget's `onPageChange`): switches the visible page. */\r\n set page(value: number) {\r\n if (this.items.length === 0) return;\r\n const next = Math.min(Math.max(0, Math.round(value)), this.items.length - 1);\r\n if (next === this.currentPage) return;\r\n this.currentPage = next;\r\n this.applyVisibility();\r\n }\r\n\r\n /**\r\n * Подключает опциональные авторские кнопки-стрелки `pageUpButtonNodeId`/`pageDownButtonNodeId` —\r\n * тот же приём, что `PaginationNodeView.setArrows` даёт пагинатору (ADR 0043): кнопки остаются\r\n * обычными нодами сцены, виджет только подписывается на `onPress`. В отличие от пагинатора, здесь\r\n * нет края диапазона, который гасил бы стрелку: это карусель — \"up\" с последней страницы\r\n * возвращается на первую, \"down\" с первой уходит на последнюю, поэтому обе стрелки всегда активны.\r\n */\r\n setArrows(arrows: { up?: PaginationArrow; down?: PaginationArrow }): void {\r\n arrows.up?.onPress.connect(() => this.step(1));\r\n arrows.down?.onPress.connect(() => this.step(-1));\r\n }\r\n\r\n /** Moves by `delta` pages, wrapping around both ends of the range — a carousel, not a clamp. */\r\n private step(delta: number): void {\r\n if (this.items.length === 0) return;\r\n const count = this.items.length;\r\n this.page = (this.currentPage + delta + count) % count;\r\n }\r\n}\r\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,CAAC,CAAC,CAAC;AAqB9I,qBAAa,aAAc,SAAQ,QAAQ;IACzC,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAU;IACjD,OAAO,CAAC,iBAAiB,CAAiC;IAC1D,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,oBAAoB,CAAS;IACrC,8FAA8F;IAC9F,OAAO,CAAC,aAAa,CAA8B;IAEnD,YAAY,YAAY,EAAE,YAAY,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,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+32,20 @@ export class SpineNodeView extends NodeView {
32
32
  //
33
33
  // An authoring view starts at the node's own autoplay setting, so a scene full of paused
34
34
  // skeletons subscribes to no ticker at all — the editor toggles `autoUpdate` from there.
35
- // A runtime view always keeps it on: it carries no track until game code starts an animation,
36
- // and that animation must then advance without the game touching `autoUpdate` itself.
35
+ // A runtime view always keeps it on: an animation game code starts later must advance without
36
+ // the game touching `autoUpdate` itself.
37
37
  const spine = new Spine({ skeletonData, autoUpdate: initializeForAuthoring ? autoplay : true, ...(ticker === undefined ? {} : { ticker }) });
38
38
  spine.afterUpdateWorldTransforms = () => this.refreshConnectorBones();
39
- // Runtime leaves a disabled animation without a track, ready for game code to start on an event.
40
- // Authoring still creates the track so its frame scrubber can inspect either initial state.
41
- if ((autoplay || initializeForAuthoring) && animation !== undefined && skeletonData.findAnimation(animation) !== null)
42
- spine.state.setAnimation(0, animation, loop).timeScale = animationSpeed;
39
+ // A configured animation always gets a track, posed to its own first frame a skeleton left
40
+ // without one instead renders Spine's setup/bind pose, which is almost never the intended "static"
41
+ // look and was reported as a visibly broken/twitching pose (still-running physics/IK constraints
42
+ // have nothing to settle against without a driving animation). When not autoplaying, `timeScale`
43
+ // is frozen at 0 so the track holds frame 0 forever without playing; game code starting a real
44
+ // animation later just calls `state.setAnimation(...)` itself, same as before.
45
+ if (animation !== undefined && skeletonData.findAnimation(animation) !== null) {
46
+ const playing = autoplay || initializeForAuthoring;
47
+ spine.state.setAnimation(0, animation, loop).timeScale = playing ? animationSpeed : 0;
48
+ }
43
49
  this.setContent(spine);
44
50
  }
45
51
  /** Runtime switch used by game code; authored connector definitions are inactive by default. */
@@ -187,15 +193,20 @@ export class SpineNodeView extends NodeView {
187
193
  const track = this.content.state.tracks[0];
188
194
  const animationChanged = track?.animation?.name !== settings.animation;
189
195
  const loopChanged = track !== null && track !== undefined && track.loop !== settings.loop;
190
- if (settings.animation === undefined || (!settings.autoplay && !this.initializeForAuthoring)) {
196
+ // Same "always a track, frozen at frame 0 unless actually playing" contract as the constructor:
197
+ // a static (non-autoplay) skeleton stays posed to its configured animation's first frame,
198
+ // never Spine's setup/bind pose.
199
+ const playing = settings.autoplay || this.initializeForAuthoring;
200
+ const desiredTimeScale = playing ? settings.animationSpeed : 0;
201
+ if (settings.animation === undefined) {
191
202
  if (track !== null && track !== undefined)
192
203
  this.content.state.clearTrack(0);
193
204
  }
194
205
  else if ((animationChanged || loopChanged) && this.content.skeleton.data.findAnimation(settings.animation) !== null) {
195
- this.content.state.setAnimation(0, settings.animation, settings.loop).timeScale = settings.animationSpeed;
206
+ this.content.state.setAnimation(0, settings.animation, settings.loop).timeScale = desiredTimeScale;
196
207
  }
197
208
  else if (track !== null && track !== undefined) {
198
- track.timeScale = settings.animationSpeed;
209
+ track.timeScale = desiredTimeScale;
199
210
  }
200
211
  }
201
212
  const fit = fitSpineToTransform(this.content.skeleton.data, transform, this.referenceFrame);
@@ -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,CAAC,QAAQ,KAAK,MAAM,CAAC,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxI,OAAO,EA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,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC;gBAC5G,CAAC;qBAAM,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACjD,KAAK,CAAC,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC;gBAC5C,CAAC;YACH,CAAC;YACD,MAAM,GAAG,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YAC5F,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACtB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;gBAC/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 };\n\nfunction resolveConnectorPart(binding: RuntimeConnectorBinding): Pick<SpineConnector, \"partType\" | \"partName\"> | undefined {\n if ((binding.partType === \"bone\" || binding.partType === \"slot\") && typeof binding.partName === \"string\" && binding.partName.length > 0) {\n return { partType: binding.partType, partName: binding.partName };\n }\n const boneName = \"boneName\" in binding ? binding.boneName : undefined;\n return typeof boneName === \"string\" && boneName.length > 0 ? { partType: \"bone\", partName: boneName } : undefined;\n}\n\nexport class SpineNodeView extends NodeView {\n private referenceFrame: SpineReferenceFrame | undefined;\n private readonly initializeForAuthoring: boolean;\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\";\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();\n this.referenceFrame = referenceFrame;\n this.initializeForAuthoring = initializeForAuthoring;\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: it carries no track until game code starts an animation,\r\n // and that animation must then advance without the game touching `autoUpdate` itself.\r\n const spine = new Spine({ skeletonData, autoUpdate: initializeForAuthoring ? autoplay : true, ...(ticker === undefined ? {} : { ticker }) });\n spine.afterUpdateWorldTransforms = () => this.refreshConnectorBones();\n // Runtime leaves a disabled animation without a track, ready for game code to start on an event.\r\n // Authoring still creates the track so its frame scrubber can inspect either initial state.\r\n if ((autoplay || initializeForAuthoring) && animation !== undefined && skeletonData.findAnimation(animation) !== null) spine.state.setAnimation(0, animation, loop).timeScale = animationSpeed;\r\n this.setContent(spine);\n }\n\n /** Runtime switch used by game code; authored connector definitions are inactive by default. */\n get activeConnectorBones(): boolean {\n return this.connectorBonesActive;\n }\n\n set activeConnectorBones(active: boolean) {\n this.setConnectorBonesActive(active);\n }\n\n /** Replaces the scene-resolved connector targets, preserving the current active state. */\n setConnectorBones(bindings: readonly RuntimeConnectorBinding[]): void {\n const wasActive = this.connectorBonesActive;\n if (wasActive) this.setConnectorBonesActive(false);\n this.connectorBindings = [...bindings];\n if (wasActive) this.setConnectorBonesActive(true);\n }\n\n setConnectorBonesActive(active: boolean): void {\n if (active === this.connectorBonesActive) return;\n this.connectorBonesActive = active;\n if (!active) {\n this.restoreConnectorTargets();\n return;\n }\n\n const spine = this.getSpine();\n if (spine === undefined) return;\n for (const binding of this.connectorBindings) {\n const part = resolveConnectorPart(binding);\n if (part === undefined) continue;\n if (part.partType === \"bone\" ? spine.skeleton.findBone(part.partName) === null : spine.skeleton.findSlot(part.partName) === null) continue;\n const parent = binding.target.parent;\n if (parent === null || parent.destroyed) continue;\n const host = new Container();\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 };\n // The host genuinely belongs to the Spine view, so the authored skeleton offset inherits the\n // visual Spine fit. refreshConnectorBones compensates the host's linear transform only, so the\n // target keeps its original UI size/orientation.\n spine.addChild(host);\n host.addChild(binding.target);\n this.activeConnectors.push(snapshot);\n }\n this.refreshConnectorBones();\n }\n\n /** Reapplies bone matrices and the target's required zero local transform. */\n refreshConnectorBones(): void {\n const spine = this.getSpine();\n if (spine === undefined) return;\n for (const connector of this.activeConnectors) {\n const slot = connector.partType === \"slot\" ? spine.skeleton.findSlot(connector.partName) : null;\n const bone = connector.partType === \"bone\" ? spine.skeleton.findBone(connector.partName) : slot?.bone;\n if (bone === null || bone === undefined || connector.parent.destroyed) continue;\n // A slot itself has no transform beyond its bone, but a region attachment does: Spine stores\n // its authored Point offset in attachment.x/y. Project that attachment origin, otherwise\n // changing Point from e.g. -650 to -850 moves the visual attachment but not the UI connector.\n const attachment = slot?.attachment;\n let spineX = bone.worldX;\n let spineY = bone.worldY;\n if (attachment instanceof PointAttachment) {\n const point = attachment.computeWorldPosition(bone, new Vector2());\n spineX = point.x;\n spineY = point.y;\n } else if (attachment instanceof RegionAttachment) {\n spineX += attachment.x * bone.a + attachment.y * bone.b;\n spineY += attachment.x * bone.c + attachment.y * bone.d;\n }\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 ));\n connector.host.visible = slot === null\n || (spine.skeleton.drawOrder.includes(slot) && slot.attachment !== null && spine.alpha > 0 && spine.skeleton.color.a * slot.color.a > 0);\n connector.target.position.set(0, 0);\n }\n }\n\n private restoreConnectorTargets(): void {\n for (const connector of this.activeConnectors) {\n const { target, parent } = connector;\n if (!target.destroyed && !parent.destroyed) {\n const index = Math.min(connector.index, parent.children.length);\n parent.addChildAt(target, index);\n target.position.set(connector.position.x, connector.position.y);\n target.scale.set(connector.scale.x, connector.scale.y);\n target.skew.set(connector.skew.x, connector.skew.y);\n target.pivot.set(connector.pivot.x, connector.pivot.y);\n target.rotation = connector.rotation;\n }\n connector.host.destroy({ children: false });\n }\n this.activeConnectors = [];\n }\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) {\n if (node.type === \"spine\") {\n const settings = resolveSpineSettings(node, profile);\n const track = this.content.state.tracks[0];\n const animationChanged = track?.animation?.name !== settings.animation;\n const loopChanged = track !== null && track !== undefined && track.loop !== settings.loop;\n if (settings.animation === undefined || (!settings.autoplay && !this.initializeForAuthoring)) {\n if (track !== null && track !== undefined) this.content.state.clearTrack(0);\n } else if ((animationChanged || loopChanged) && this.content.skeleton.data.findAnimation(settings.animation) !== null) {\n this.content.state.setAnimation(0, settings.animation, settings.loop).timeScale = settings.animationSpeed;\n } else if (track !== null && track !== undefined) {\n track.timeScale = settings.animationSpeed;\n }\n }\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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AM,CAAC,CAAC;gBAC/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 (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"]}