@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.
@@ -42,8 +42,12 @@ export declare function getItemTableViewItem(view: Container, index: number): Co
42
42
  export declare function setItemTableViewVisibleCount(view: Container, count: number | undefined): void;
43
43
  /** Показывает или прячет все элементы разом; `undefined` возвращает управление вместимости. */
44
44
  export declare function setItemTableViewItemsVisible(view: Container, visible: boolean | undefined): void;
45
- /** Switches which direct child ("page") of a page group is shown; every other child is hidden. */
45
+ /** Switches which direct child ("page") of a page group is shown; every other child is hidden. Out-of-range indices clamp into range, so passing whatever a caller has on hand can never throw or leave the group blank. */
46
46
  export declare function setPageGroupViewPage(view: Container, page: number): void;
47
+ /** Currently shown page index, or `undefined` if `view` is not a page group. */
48
+ export declare function getPageGroupViewPage(view: Container): number | undefined;
49
+ /** Total number of pages (authored children plus any appended via `addPageGroupViewPage`); `0` if `view` is not a page group. */
50
+ export declare function getPageGroupViewPageCount(view: Container): number;
47
51
  /**
48
52
  * Appends a page built at runtime (e.g. the `root` from `buildPrefabView`/`loadPrefabView`, or any
49
53
  * hand-built `Container`) after the last one — for a dataset that grows during play (a spin history
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAiBpC,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CASn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G7E;AAED,oGAAoG;AACpG,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAEnF;AAED,wFAAwF;AACxF,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAE1F"}
package/dist/controls.js CHANGED
@@ -111,11 +111,19 @@ export function setItemTableViewItemsVisible(view, visible) {
111
111
  if (view instanceof ItemTableNodeView)
112
112
  view.setItemsVisible(visible);
113
113
  }
114
- /** Switches which direct child ("page") of a page group is shown; every other child is hidden. */
114
+ /** Switches which direct child ("page") of a page group is shown; every other child is hidden. Out-of-range indices clamp into range, so passing whatever a caller has on hand can never throw or leave the group blank. */
115
115
  export function setPageGroupViewPage(view, page) {
116
116
  if (view instanceof PageGroupNodeView)
117
117
  view.page = page;
118
118
  }
119
+ /** Currently shown page index, or `undefined` if `view` is not a page group. */
120
+ export function getPageGroupViewPage(view) {
121
+ return view instanceof PageGroupNodeView ? view.page : undefined;
122
+ }
123
+ /** Total number of pages (authored children plus any appended via `addPageGroupViewPage`); `0` if `view` is not a page group. */
124
+ export function getPageGroupViewPageCount(view) {
125
+ return view instanceof PageGroupNodeView ? view.pageCount : 0;
126
+ }
119
127
  /**
120
128
  * Appends a page built at runtime (e.g. the `root` from `buildPrefabView`/`loadPrefabView`, or any
121
129
  * hand-built `Container`) after the last one — for a dataset that grows during play (a spin history
@@ -1 +1 @@
1
- {"version":3,"file":"controls.js","sourceRoot":"","sources":["../src/controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM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AAoB,CAAC,IAAe,EAAE,IAAY;IAChE,IAAI,IAAI,YAAY,iBAAiB;QAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AAC1D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAAE,IAAe;IACnE,OAAO,IAAI,YAAY,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAe,EAAE,OAA2B;IACrF,IAAI,IAAI,YAAY,oBAAoB;QAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAAE,QAAiB;IACrE,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;AACvD,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,4BAA4B,CAAC,IAAe,EAAE,MAAe;IAC3E,IAAI,IAAI,YAAY,aAAa;QAAE,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC;AACxE,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,0BAA0B,CAAC,SAAyC;IAClF,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,MAAM,EAAE;QAAE,IAAI,IAAI,YAAY,aAAa,IAAI,IAAI,CAAC,oBAAoB;YAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC;AACtI,CAAC","sourcesContent":["import { type SkeletonData, Spine } from \"@esotericsoftware/spine-pixi-v8\";\nimport { type ButtonStateKey, type LayoutPadding } from \"@pixi-ui-editor/schema\";\nimport { Container } from \"pixi.js\";\nimport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\nimport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\nimport { ItemTableNodeView } from \"./views/ItemTableNodeView.js\";\nimport { PageGroupNodeView } from \"./views/PageGroupNodeView.js\";\nimport { PaginationNodeView } from \"./views/PaginationNodeView.js\";\nimport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\nimport { ImageNodeView, OpacityGroupNodeView } from \"./views/basic.js\";\nimport { NodeView } from \"./views/NodeView.js\";\nimport { ProgressBarNodeView, SliderNodeView } from \"./views/ValueControlNodeViews.js\";\nimport { SpineNodeView } from \"./views/SpineNodeView.js\";\n\nfunction findSpineChild(view: Container): Spine | undefined {\n if (view instanceof NodeView) return view.getSpine();\n return view instanceof Spine ? view : view.children.find((child): child is Spine => child instanceof Spine);\n}\n\n/** Reads the current 1-based animation frame for an editor Spine node. */\nexport function getSpineViewPlayback(view: Container, skeletonData: SkeletonData, animation: string): { current: number; total: number } | undefined {\n const spine = findSpineChild(view);\n const track = spine?.state.tracks[0];\n const duration = skeletonData.findAnimation(animation)?.duration;\n if (track === null || track === undefined || duration === undefined || duration <= 0) return undefined;\n const fps = skeletonData.fps && skeletonData.fps > 0 ? skeletonData.fps : 60;\n const total = Math.max(1, Math.round(duration * fps));\n const time = track.loop ? track.trackTime % duration : Math.min(track.trackTime, duration);\n return { current: Math.min(total, Math.floor(time * fps) + 1), total };\n}\n\n/** Seeks an editor Spine node to a 1-based animation frame without changing its serialized animation settings. */\nexport function setSpineViewFrame(view: Container, frame: number, skeletonData: SkeletonData, animation: string): void {\n const spine = findSpineChild(view);\n const track = spine?.state.tracks[0];\n const duration = skeletonData.findAnimation(animation)?.duration;\n if (track === null || track === undefined || duration === undefined || duration <= 0) return;\n const fps = skeletonData.fps && skeletonData.fps > 0 ? skeletonData.fps : 60;\n const total = Math.max(1, Math.round(duration * fps));\n track.trackTime = Math.min(total, Math.max(1, Math.round(frame)) - 1) / fps;\n spine?.update(0);\n}\n\n/** Forces an editor-only button state; the node's serialized `enabled` and states stay untouched. */\nexport function setButtonViewState(view: Container, state: ButtonStateKey): void {\n if (view instanceof ButtonNodeView) view.setState(state);\n}\n\n/** Forces an editor-only checkbox checked state; the node's serialized `defaultChecked` stays untouched. */\nexport function setCheckboxViewChecked(view: Container, checked: boolean): void {\n if (view instanceof CheckboxNodeView) view.forceCheck(checked);\n}\n\n/** Forces an editor-only staged button preview stage; the document's `stages`/current stage stay untouched. */\nexport function setStagedButtonViewStage(view: Container, index: number): void {\n if (view instanceof StagedButtonNodeView) view.forceStage(index);\n}\n\n/** Forces an editor-only staged button visual state; the node's serialized `enabled` stays untouched. */\nexport function setStagedButtonViewState(view: Container, state: ButtonStateKey): void {\n if (view instanceof StagedButtonNodeView) view.setState(state);\n}\n\n/** Live-previews nine-slice border edits while dragging the canvas gizmo; commits only on release. */\nexport function previewNineSlice(view: Container, nineSlice: LayoutPadding): void {\n if (view instanceof ImageNodeView || view instanceof ButtonNodeView || view instanceof StagedButtonNodeView) view.previewNineSlice(nineSlice);\n}\n\n/** Applies an editor-only slider preview value without touching the document. */\nexport function setSliderViewValue(view: Container, value: number): void {\n if (view instanceof SliderNodeView) view.value = value;\n}\n\n/** Applies an editor-only progress preview without touching the document. */\nexport function setProgressBarViewProgress(view: Container, progress: number): void {\n if (view instanceof ProgressBarNodeView) view.progress = progress;\n}\n\n/** One-way sync from game code (or editor preview) into the widget: highlights a dot without emitting `onPageChange`. */\nexport function setPaginationViewPage(view: Container, page: number): void {\n if (view instanceof PaginationNodeView) view.page = page;\n}\n\n/**\n * Rebuilds the widget's dots for a runtime-known page count, e.g. once actual content length is known.\n * Ignored while the widget pages through authored `items`: there the item list already fixes the count.\n */\nexport function setPaginationViewPageCount(view: Container, pageCount: number): void {\n if (view instanceof PaginationNodeView) view.pageCount = pageCount;\n}\n\n/**\n * Все элементы таблицы в порядке иерархии, включая скрытые вместимостью — «что вообще есть».\n * Возвращает пустой список, если `view` не item-table.\n */\nexport function getItemTableViewItems(view: Container): Container[] {\n return view instanceof ItemTableNodeView ? view.items : [];\n}\n\n/** Элементы, показанные прямо сейчас: столько, сколько влезает в текущем профиле. */\nexport function getItemTableViewVisibleItems(view: Container): Container[] {\n return view instanceof ItemTableNodeView ? view.visibleItems : [];\n}\n\n/** Один элемент по индексу — адресация, на которой игровой код раскладывает свои данные. */\nexport function getItemTableViewItem(view: Container, index: number): Container | undefined {\n return view instanceof ItemTableNodeView ? view.itemAt(index) : undefined;\n}\n\n/** Транзиентно меняет вместимость; `undefined` возвращает авторское значение профиля. */\nexport function setItemTableViewVisibleCount(view: Container, count: number | undefined): void {\n if (view instanceof ItemTableNodeView) view.visibleCount = count;\n}\n\n/** Показывает или прячет все элементы разом; `undefined` возвращает управление вместимости. */\nexport function setItemTableViewItemsVisible(view: Container, visible: boolean | undefined): void {\n if (view instanceof ItemTableNodeView) view.setItemsVisible(visible);\n}\n\n/** Switches which direct child (\"page\") of a page group is shown; every other child is hidden. */\nexport function setPageGroupViewPage(view: Container, page: number): void {\n if (view instanceof PageGroupNodeView) view.page = page;\n}\n\n/**\n * Appends a page built at runtime (e.g. the `root` from `buildPrefabView`/`loadPrefabView`, or any\n * hand-built `Container`) after the last one — for a dataset that grows during play (a spin history\n * list, a chat log, ...) rather than one fully known at authoring time. Fits the page to the group's\n * current rectangle and hides it until switched to. Returns the new page's index, or `undefined` if\n * `view` is not a page group. Keep `setPaginationViewPageCount` in sync with the resulting `pageCount`\n * if a `pagination` widget is showing this group's page count.\n */\nexport function addPageGroupViewPage(view: Container, page: Container): number | undefined {\n return view instanceof PageGroupNodeView ? view.addPage(page) : undefined;\n}\n\n/**\n * Fades a whole subtree by driving one opacity group, the cheap `CanvasGroup.alpha` equivalent: the\n * value multiplies into every descendant through PixiJS `worldAlpha`, so animating a fade is one write\n * per frame regardless of how many nodes are inside. The node's authored `opacity` stays untouched in\n * the document; pass `undefined` to hand control back to it. Tweening itself belongs to game code —\n * the runtime deliberately ships no animation engine, the same way `page-group` ships no swipe gesture.\n */\nexport function setOpacityGroupViewOpacity(view: Container, opacity: number | undefined): void {\n if (view instanceof OpacityGroupNodeView) view.setOpacity(opacity);\n}\n\n/** Enables or pauses editor-only automatic playback without affecting serialized node data. */\nexport function setSpineViewAutoplay(view: Container, autoplay: boolean): void {\n const spine = findSpineChild(view);\n if (spine !== undefined) spine.autoUpdate = autoplay;\n}\n\n/** Activates authored bone/slot part connectors on one Spine node without mutating the document. */\nexport function setSpineConnectorBonesActive(view: Container, active: boolean): void {\n if (view instanceof SpineNodeView) view.activeConnectorBones = active;\n}\n\n/** Reasserts active connector matrices after a host performs live node-view updates. */\nexport function refreshSpineConnectorBones(nodeViews: ReadonlyMap<string, Container>): void {\n for (const view of nodeViews.values()) if (view instanceof SpineNodeView && view.activeConnectorBones) view.refreshConnectorBones();\n}\n"]}
1
+ {"version":3,"file":"controls.js","sourceRoot":"","sources":["../src/controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,SAAS,cAAc,CAAC,IAAe;IACrC,IAAI,IAAI,YAAY,QAAQ;QAAE,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC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G;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAAE,IAAe;IACnE,OAAO,IAAI,YAAY,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAe,EAAE,OAA2B;IACrF,IAAI,IAAI,YAAY,oBAAoB;QAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAAE,QAAiB;IACrE,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;AACvD,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,4BAA4B,CAAC,IAAe,EAAE,MAAe;IAC3E,IAAI,IAAI,YAAY,aAAa;QAAE,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC;AACxE,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,0BAA0B,CAAC,SAAyC;IAClF,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,MAAM,EAAE;QAAE,IAAI,IAAI,YAAY,aAAa,IAAI,IAAI,CAAC,oBAAoB;YAAE,IAAI,CAAC,qBAAqB,EAAE,CAAC;AACtI,CAAC","sourcesContent":["import { type SkeletonData, Spine } from \"@esotericsoftware/spine-pixi-v8\";\nimport { type ButtonStateKey, type LayoutPadding } from \"@pixi-ui-editor/schema\";\nimport { Container } from \"pixi.js\";\nimport { ButtonNodeView } from \"./views/ButtonNodeView.js\";\nimport { CheckboxNodeView } from \"./views/CheckboxNodeView.js\";\nimport { ItemTableNodeView } from \"./views/ItemTableNodeView.js\";\nimport { PageGroupNodeView } from \"./views/PageGroupNodeView.js\";\nimport { PaginationNodeView } from \"./views/PaginationNodeView.js\";\nimport { StagedButtonNodeView } from \"./views/StagedButtonNodeView.js\";\nimport { ImageNodeView, OpacityGroupNodeView } from \"./views/basic.js\";\nimport { NodeView } from \"./views/NodeView.js\";\nimport { ProgressBarNodeView, SliderNodeView } from \"./views/ValueControlNodeViews.js\";\nimport { SpineNodeView } from \"./views/SpineNodeView.js\";\n\nfunction findSpineChild(view: Container): Spine | undefined {\n if (view instanceof NodeView) return view.getSpine();\n return view instanceof Spine ? view : view.children.find((child): child is Spine => child instanceof Spine);\n}\n\n/** Reads the current 1-based animation frame for an editor Spine node. */\nexport function getSpineViewPlayback(view: Container, skeletonData: SkeletonData, animation: string): { current: number; total: number } | undefined {\n const spine = findSpineChild(view);\n const track = spine?.state.tracks[0];\n const duration = skeletonData.findAnimation(animation)?.duration;\n if (track === null || track === undefined || duration === undefined || duration <= 0) return undefined;\n const fps = skeletonData.fps && skeletonData.fps > 0 ? skeletonData.fps : 60;\n const total = Math.max(1, Math.round(duration * fps));\n const time = track.loop ? track.trackTime % duration : Math.min(track.trackTime, duration);\n return { current: Math.min(total, Math.floor(time * fps) + 1), total };\n}\n\n/** Seeks an editor Spine node to a 1-based animation frame without changing its serialized animation settings. */\nexport function setSpineViewFrame(view: Container, frame: number, skeletonData: SkeletonData, animation: string): void {\n const spine = findSpineChild(view);\n const track = spine?.state.tracks[0];\n const duration = skeletonData.findAnimation(animation)?.duration;\n if (track === null || track === undefined || duration === undefined || duration <= 0) return;\n const fps = skeletonData.fps && skeletonData.fps > 0 ? skeletonData.fps : 60;\n const total = Math.max(1, Math.round(duration * fps));\n track.trackTime = Math.min(total, Math.max(1, Math.round(frame)) - 1) / fps;\n spine?.update(0);\n}\n\n/** Forces an editor-only button state; the node's serialized `enabled` and states stay untouched. */\nexport function setButtonViewState(view: Container, state: ButtonStateKey): void {\n if (view instanceof ButtonNodeView) view.setState(state);\n}\n\n/** Forces an editor-only checkbox checked state; the node's serialized `defaultChecked` stays untouched. */\nexport function setCheckboxViewChecked(view: Container, checked: boolean): void {\n if (view instanceof CheckboxNodeView) view.forceCheck(checked);\n}\n\n/** Forces an editor-only staged button preview stage; the document's `stages`/current stage stay untouched. */\nexport function setStagedButtonViewStage(view: Container, index: number): void {\n if (view instanceof StagedButtonNodeView) view.forceStage(index);\n}\n\n/** Forces an editor-only staged button visual state; the node's serialized `enabled` stays untouched. */\nexport function setStagedButtonViewState(view: Container, state: ButtonStateKey): void {\n if (view instanceof StagedButtonNodeView) view.setState(state);\n}\n\n/** Live-previews nine-slice border edits while dragging the canvas gizmo; commits only on release. */\nexport function previewNineSlice(view: Container, nineSlice: LayoutPadding): void {\n if (view instanceof ImageNodeView || view instanceof ButtonNodeView || view instanceof StagedButtonNodeView) view.previewNineSlice(nineSlice);\n}\n\n/** Applies an editor-only slider preview value without touching the document. */\nexport function setSliderViewValue(view: Container, value: number): void {\n if (view instanceof SliderNodeView) view.value = value;\n}\n\n/** Applies an editor-only progress preview without touching the document. */\nexport function setProgressBarViewProgress(view: Container, progress: number): void {\n if (view instanceof ProgressBarNodeView) view.progress = progress;\n}\n\n/** One-way sync from game code (or editor preview) into the widget: highlights a dot without emitting `onPageChange`. */\nexport function setPaginationViewPage(view: Container, page: number): void {\n if (view instanceof PaginationNodeView) view.page = page;\n}\n\n/**\n * Rebuilds the widget's dots for a runtime-known page count, e.g. once actual content length is known.\n * Ignored while the widget pages through authored `items`: there the item list already fixes the count.\n */\nexport function setPaginationViewPageCount(view: Container, pageCount: number): void {\n if (view instanceof PaginationNodeView) view.pageCount = pageCount;\n}\n\n/**\n * Все элементы таблицы в порядке иерархии, включая скрытые вместимостью — «что вообще есть».\n * Возвращает пустой список, если `view` не item-table.\n */\nexport function getItemTableViewItems(view: Container): Container[] {\n return view instanceof ItemTableNodeView ? view.items : [];\n}\n\n/** Элементы, показанные прямо сейчас: столько, сколько влезает в текущем профиле. */\nexport function getItemTableViewVisibleItems(view: Container): Container[] {\n return view instanceof ItemTableNodeView ? view.visibleItems : [];\n}\n\n/** Один элемент по индексу — адресация, на которой игровой код раскладывает свои данные. */\nexport function getItemTableViewItem(view: Container, index: number): Container | undefined {\n return view instanceof ItemTableNodeView ? view.itemAt(index) : undefined;\n}\n\n/** Транзиентно меняет вместимость; `undefined` возвращает авторское значение профиля. */\nexport function setItemTableViewVisibleCount(view: Container, count: number | undefined): void {\n if (view instanceof ItemTableNodeView) view.visibleCount = count;\n}\n\n/** Показывает или прячет все элементы разом; `undefined` возвращает управление вместимости. */\nexport function setItemTableViewItemsVisible(view: Container, visible: boolean | undefined): void {\n if (view instanceof ItemTableNodeView) view.setItemsVisible(visible);\n}\n\n/** Switches which direct child (\"page\") of a page group is shown; every other child is hidden. Out-of-range indices clamp into range, so passing whatever a caller has on hand can never throw or leave the group blank. */\nexport function setPageGroupViewPage(view: Container, page: number): void {\n if (view instanceof PageGroupNodeView) view.page = page;\n}\n\n/** Currently shown page index, or `undefined` if `view` is not a page group. */\nexport function getPageGroupViewPage(view: Container): number | undefined {\n return view instanceof PageGroupNodeView ? view.page : undefined;\n}\n\n/** Total number of pages (authored children plus any appended via `addPageGroupViewPage`); `0` if `view` is not a page group. */\nexport function getPageGroupViewPageCount(view: Container): number {\n return view instanceof PageGroupNodeView ? view.pageCount : 0;\n}\n\n/**\n * Appends a page built at runtime (e.g. the `root` from `buildPrefabView`/`loadPrefabView`, or any\n * hand-built `Container`) after the last one — for a dataset that grows during play (a spin history\n * list, a chat log, ...) rather than one fully known at authoring time. Fits the page to the group's\n * current rectangle and hides it until switched to. Returns the new page's index, or `undefined` if\n * `view` is not a page group. Keep `setPaginationViewPageCount` in sync with the resulting `pageCount`\n * if a `pagination` widget is showing this group's page count.\n */\nexport function addPageGroupViewPage(view: Container, page: Container): number | undefined {\n return view instanceof PageGroupNodeView ? view.addPage(page) : undefined;\n}\n\n/**\n * Fades a whole subtree by driving one opacity group, the cheap `CanvasGroup.alpha` equivalent: the\n * value multiplies into every descendant through PixiJS `worldAlpha`, so animating a fade is one write\n * per frame regardless of how many nodes are inside. The node's authored `opacity` stays untouched in\n * the document; pass `undefined` to hand control back to it. Tweening itself belongs to game code —\n * the runtime deliberately ships no animation engine, the same way `page-group` ships no swipe gesture.\n */\nexport function setOpacityGroupViewOpacity(view: Container, opacity: number | undefined): void {\n if (view instanceof OpacityGroupNodeView) view.setOpacity(opacity);\n}\n\n/** Enables or pauses editor-only automatic playback without affecting serialized node data. */\nexport function setSpineViewAutoplay(view: Container, autoplay: boolean): void {\n const spine = findSpineChild(view);\n if (spine !== undefined) spine.autoUpdate = autoplay;\n}\n\n/** Activates authored bone/slot part connectors on one Spine node without mutating the document. */\nexport function setSpineConnectorBonesActive(view: Container, active: boolean): void {\n if (view instanceof SpineNodeView) view.activeConnectorBones = active;\n}\n\n/** Reasserts active connector matrices after a host performs live node-view updates. */\nexport function refreshSpineConnectorBones(nodeViews: ReadonlyMap<string, Container>): void {\n for (const view of nodeViews.values()) if (view instanceof SpineNodeView && view.activeConnectorBones) view.refreshConnectorBones();\n}\n"]}
@@ -1,10 +1,26 @@
1
1
  import "@pixi/layout";
2
- import { type LayoutGroupNode, type LayoutProfileId, type UINode } from "@pixi-ui-editor/schema";
2
+ import { type GridLayoutSettings, type LayoutGroupNode, type LayoutProfileId, type UINode } from "@pixi-ui-editor/schema";
3
3
  import { Container } from "pixi.js";
4
4
  import { type LayoutSize } from "./layout.js";
5
5
  import { NodeView } from "./views/NodeView.js";
6
6
  /** Importing @pixi/layout installs its renderer extension. Kept as a shared explicit contract for every host. */
7
7
  export declare function initializePixiLayout(): void;
8
+ /**
9
+ * Направление заполнения сетки, выведенное из startCorner/startAxis/constraint. Единственный
10
+ * источник правды: рантайм задаёт по нему Yoga-флексбокс, а редактор считает по нему же рамки
11
+ * выделения, поэтому расходиться этим двум расчётам негде.
12
+ */
13
+ export type GridFlow = {
14
+ /** Строки являются линиями переноса (иначе линии — это колонки). */
15
+ readonly fillsByRow: boolean;
16
+ /** Главная ось (порядок внутри линии) идёт справа налево / снизу вверх. */
17
+ readonly mainReversed: boolean;
18
+ /** Поперечная ось (порядок линий) идёт снизу вверх / справа налево. */
19
+ readonly crossReversed: boolean;
20
+ /** Фиксированный constraint переносит линии явными разрывами, а не переполнением. */
21
+ readonly usesLineBreaks: boolean;
22
+ };
23
+ export declare function resolveGridFlow(grid: GridLayoutSettings): GridFlow;
8
24
  /** Applies one declarative document group to Pixi Layout; no computed Yoga data crosses the document boundary. */
9
25
  export declare function applyLayoutGroup(view: Container, node: LayoutGroupNode, profile: LayoutProfileId, parentSize?: LayoutSize, managedSize?: LayoutSize): void;
10
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"layoutGroups.d.ts","sourceRoot":"","sources":["../src/layoutGroups.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAmE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAClK,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAqD,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEjG,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,iHAAiH;AACjH,wBAAgB,oBAAoB,IAAI,IAAI,CAAkE;AAe9G,kHAAkH;AAClH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,UAAU,GAAG,IAAI,CAkC1J;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;IAKpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ;IAAE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;IAJ1E,OAAO,CAAC,IAAI,CAAC,CAAS;IACtB,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,YAAY,CAAuC;IAE3D,YAAqB,QAAQ,EAAE,QAAQ,EAAmB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,OAAO,CAEpF"}
@@ -12,6 +12,17 @@ function alignmentParts(alignment) {
12
12
  vertical: vertical === "upper" ? "flex-start" : vertical === "lower" ? "flex-end" : "center",
13
13
  };
14
14
  }
15
+ export function resolveGridFlow(grid) {
16
+ const reverseX = grid.startCorner.endsWith("right");
17
+ const reverseY = grid.startCorner.startsWith("lower");
18
+ const fillsByRow = grid.constraint === "fixed-column-count" || (grid.constraint === "flexible" && grid.startAxis === "horizontal");
19
+ return {
20
+ fillsByRow,
21
+ mainReversed: fillsByRow ? reverseX : reverseY,
22
+ crossReversed: fillsByRow ? reverseY : reverseX,
23
+ usesLineBreaks: grid.constraint !== "flexible" && grid.constraintCount !== undefined,
24
+ };
25
+ }
15
26
  function layoutSize(node, profile, parentSize) {
16
27
  const transform = resolveAnchoredTransform(resolveProfileTransform(node, profile).transform, parentSize);
17
28
  return { width: transform.width, height: transform.height };
@@ -36,19 +47,22 @@ export function applyLayoutGroup(view, node, profile, parentSize, managedSize) {
36
47
  return;
37
48
  }
38
49
  const grid = settings;
39
- const reverseX = grid.startCorner.endsWith("right");
40
- const reverseY = grid.startCorner.startsWith("lower");
41
- const fillsByRow = grid.constraint === "fixed-column-count" || (grid.constraint === "flexible" && grid.startAxis === "horizontal");
50
+ const flow = resolveGridFlow(grid);
42
51
  const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;
43
52
  const alignment = alignmentParts(grid.childAlignment);
53
+ // justify-content при flex-wrap выравнивает КАЖДУЮ линию отдельно, поэтому неполная последняя
54
+ // строка центрируется сама по себе. Это и есть per-row alignment, отдельного поля не нужно.
44
55
  target.layout = {
45
56
  ...common,
46
- justifyContent: fillsByRow ? alignment.horizontal : alignment.vertical,
47
- alignItems: fillsByRow ? alignment.vertical : alignment.horizontal,
48
- alignContent: fillsByRow ? alignment.vertical : alignment.horizontal,
49
- flexDirection: fillsByRow ? (reverseX ? "row-reverse" : "row") : (reverseY ? "column-reverse" : "column"),
50
- flexWrap: reverseY && fillsByRow ? "wrap-reverse" : "wrap",
51
- columnGap: grid.spacingX, rowGap: grid.spacingY,
57
+ justifyContent: flow.fillsByRow ? alignment.horizontal : alignment.vertical,
58
+ alignItems: flow.fillsByRow ? alignment.vertical : alignment.horizontal,
59
+ alignContent: flow.fillsByRow ? alignment.vertical : alignment.horizontal,
60
+ flexDirection: flow.fillsByRow ? (flow.mainReversed ? "row-reverse" : "row") : (flow.mainReversed ? "column-reverse" : "column"),
61
+ flexWrap: flow.crossReversed ? "wrap-reverse" : "wrap",
62
+ // Разрыв строки занимает собственную линию, поэтому поперечный зазор пришёл бы дважды: до
63
+ // разрыва и после него. Зазор перенесён в размер самого разрыва, а gutter обнулён.
64
+ columnGap: flow.usesLineBreaks && !flow.fillsByRow ? 0 : grid.spacingX,
65
+ rowGap: flow.usesLineBreaks && flow.fillsByRow ? 0 : grid.spacingY,
52
66
  paddingLeft: grid.padding.left, paddingRight: grid.padding.right, paddingTop: grid.padding.top, paddingBottom: grid.padding.bottom,
53
67
  };
54
68
  }
@@ -128,9 +142,10 @@ export function createGridLineBreak(parent, profile) {
128
142
  if (grid.constraint === "flexible" || grid.constraintCount === undefined)
129
143
  return undefined;
130
144
  const lineBreak = new Container({ label: "__layout-grid-line-break__" });
145
+ // Поперечный зазор между линиями живёт здесь, а не в rowGap/columnGap группы: см. applyLayoutGroup.
131
146
  lineBreak.layout = (grid.constraint === "fixed-column-count"
132
- ? { flexBasis: "100%", width: "100%", height: 0 }
133
- : { flexBasis: "100%", height: "100%", width: 0 });
147
+ ? { flexBasis: "100%", width: "100%", height: grid.spacingY, flexShrink: 0 }
148
+ : { flexBasis: "100%", height: "100%", width: grid.spacingX, flexShrink: 0 });
134
149
  return lineBreak;
135
150
  }
136
151
  export function isLayoutManagedChild(node, nodes) {
@@ -1 +1 @@
1
- {"version":3,"file":"layoutGroups.js","sourceRoot":"","sources":["../src/layoutGroups.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,0BA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,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5D,CAAC;AACb,CAAC;AAED,mIAAmI;AACnI,MAAM,UAAU,mBAAmB,CAAC,MAAyD,EAAE,OAAwB;IACrH,MAAM,IAAI,GAAG,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAA8E,CAAC;IACtI,IAAI,IAAI,CAAC,UAAU,KAAK,UAAU,IAAI,IAAI,CAAC,eAAe,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3F,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAC;IACzE,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,KAAK,oBAAoB;QAC1D,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE;QACjD,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAU,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,KAAwB;IACzE,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;AAC7M,CAAC","sourcesContent":["import \"@pixi/layout\";\r\nimport { isLayoutGroup, resolveLayoutGroupSettings, type LayoutAlignment, type LayoutGroupNode, type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport { resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"./layout.js\";\r\nimport { LayoutGroupNodeView } from \"./views/basic.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\n\r\n/** Importing @pixi/layout installs its renderer extension. Kept as a shared explicit contract for every host. */\r\nexport function initializePixiLayout(): void { /* @pixi/layout is installed by this module's side effect. */ }\r\n\r\nfunction alignmentParts(alignment: LayoutAlignment) {\r\n const [vertical, horizontal] = alignment.split(\"-\") as [\"upper\" | \"middle\" | \"lower\", \"left\" | \"center\" | \"right\"];\r\n return {\r\n horizontal: horizontal === \"left\" ? \"flex-start\" : horizontal === \"right\" ? \"flex-end\" : \"center\",\r\n vertical: vertical === \"upper\" ? \"flex-start\" : vertical === \"lower\" ? \"flex-end\" : \"center\",\r\n };\r\n}\r\n\r\nfunction layoutSize(node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize): LayoutSize {\n const transform = resolveAnchoredTransform(resolveProfileTransform(node, profile).transform, parentSize);\n return { width: transform.width, height: transform.height };\n}\n\n/** Applies one declarative document group to Pixi Layout; no computed Yoga data crosses the document boundary. */\nexport function applyLayoutGroup(view: Container, node: LayoutGroupNode, profile: LayoutProfileId, parentSize?: LayoutSize, managedSize?: LayoutSize): void {\n const settings = resolveLayoutGroupSettings(node, profile) as LayoutGroupNode[\"layoutGroup\"][\"base\"];\n const size = managedSize ?? layoutSize(node, profile, parentSize);\n const common = { width: size.width, height: size.height, display: \"flex\" as const };\r\n if (node.type === \"horizontal-layout\" || node.type === \"vertical-layout\") {\r\n const linear = settings as Extract<LayoutGroupNode, { type: \"horizontal-layout\" | \"vertical-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;\r\n const alignment = alignmentParts(linear.childAlignment);\r\n target.layout = {\r\n ...common,\r\n justifyContent: node.type === \"horizontal-layout\" ? alignment.horizontal : alignment.vertical,\r\n alignItems: node.type === \"horizontal-layout\" ? alignment.vertical : alignment.horizontal,\r\n flexDirection: node.type === \"horizontal-layout\" ? (linear.reverseOrder ? \"row-reverse\" : \"row\") : (linear.reverseOrder ? \"column-reverse\" : \"column\"),\r\n gap: linear.spacing,\r\n paddingLeft: linear.padding.left, paddingRight: linear.padding.right, paddingTop: linear.padding.top, paddingBottom: linear.padding.bottom,\r\n } as never;\r\n return;\r\n }\r\n const grid = settings as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const reverseX = grid.startCorner.endsWith(\"right\");\r\n const reverseY = grid.startCorner.startsWith(\"lower\");\r\n const fillsByRow = grid.constraint === \"fixed-column-count\" || (grid.constraint === \"flexible\" && grid.startAxis === \"horizontal\");\r\n const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;\r\n const alignment = alignmentParts(grid.childAlignment);\r\n target.layout = {\r\n ...common,\r\n justifyContent: fillsByRow ? alignment.horizontal : alignment.vertical,\r\n alignItems: fillsByRow ? alignment.vertical : alignment.horizontal,\r\n alignContent: fillsByRow ? alignment.vertical : alignment.horizontal,\r\n flexDirection: fillsByRow ? (reverseX ? \"row-reverse\" : \"row\") : (reverseY ? \"column-reverse\" : \"column\"),\r\n flexWrap: reverseY && fillsByRow ? \"wrap-reverse\" : \"wrap\",\r\n columnGap: grid.spacingX, rowGap: grid.spacingY,\n paddingLeft: grid.padding.left, paddingRight: grid.padding.right, paddingTop: grid.padding.top, paddingBottom: grid.padding.bottom,\r\n } as never;\r\n}\r\n\r\n/**\r\n * Runtime-only Yoga owner for one direct child. The wrapper receives Yoga coordinates while the\r\n * serializable NodeView keeps the shared pivot/rotation/scale/content/hit-test contract.\r\n */\r\nexport class LayoutItemContainer extends Container {\r\n private node?: UINode;\r\n private profile: LayoutProfileId = \"desktop\";\r\n private fallbackSize: LayoutSize = { width: 0, height: 0 };\r\n\r\n constructor(readonly nodeView: NodeView, private readonly onLayoutChanged?: () => void) {\r\n super();\r\n super.addChild(nodeView);\r\n this.onLayout = () => this.applyComputedSize();\r\n }\r\n\r\n sync(node: UINode, profile: LayoutProfileId, fallbackSize: LayoutSize): void {\r\n this.node = node;\r\n this.profile = profile;\r\n this.fallbackSize = fallbackSize;\r\n this.visible = resolveProfileTransform(node, profile).visible;\r\n this.applyComputedSize();\r\n }\r\n\r\n private applyComputedSize(): void {\r\n if (this.node === undefined) return;\r\n const computed = this.layout?.computedLayout;\r\n const size = computed === undefined || computed.width <= 0 || computed.height <= 0\r\n ? this.fallbackSize\r\n : { width: computed.width, height: computed.height };\r\n if (isLayoutGroup(this.node)) applyLayoutGroup(this.nodeView, this.node, this.profile, undefined, size);\n this.nodeView.updateManaged(this.node, this.profile, size);\r\n this.onLayoutChanged?.();\r\n }\r\n}\r\n\r\n/** Marks a direct child's technical wrapper as layout-managed. */\r\nexport function applyLayoutItem(view: LayoutItemContainer, node: UINode, parent: LayoutGroupNode, profile: LayoutProfileId): void {\r\n // Anchors belong to authored positioning and are deliberately ignored while a parent layout owns\r\n // the rectangle. Width/height remain the child's logical intrinsic size, never Pixi content bounds.\r\n const transform = resolveProfileTransform(node, profile).transform;\r\n const own = { width: transform.width, height: transform.height };\r\n const item = node.layoutItem;\r\n const settings = resolveLayoutGroupSettings(parent, profile);\r\n const base = { position: \"relative\" as const, flexGrow: item?.flexGrow ?? 0, flexShrink: item?.flexShrink ?? 0, flexBasis: item?.flexBasis, alignSelf: item?.alignSelf };\r\n view.sync(node, profile, own);\r\n if (parent.type === \"grid-layout\") {\n const grid = settings as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\n view.layout = { ...base, width: grid.cellWidth, height: grid.cellHeight } as never;\n return;\n }\n const linear = settings as Extract<LayoutGroupNode, { type: \"horizontal-layout\" | \"vertical-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const horizontal = parent.type === \"horizontal-layout\";\r\n const expandsMain = horizontal\r\n ? linear.controlChildWidth && linear.forceExpandWidth\r\n : linear.controlChildHeight && linear.forceExpandHeight;\r\n const expandsCross = horizontal\r\n ? linear.controlChildHeight && linear.forceExpandHeight\r\n : linear.controlChildWidth && linear.forceExpandWidth;\r\n view.layout = {\r\n ...base,\r\n // The schema has no separate min/preferred size yet, so the logical authored rect is the safe\r\n // intrinsic fallback for both control modes. Force-expand may then replace the relevant axis.\r\n width: expandsCross && !horizontal ? undefined : own.width,\r\n height: expandsCross && horizontal ? undefined : own.height,\r\n ...(expandsMain ? { flexGrow: Math.max(1, item?.flexGrow ?? 0) } : {}),\r\n ...(expandsCross ? { alignSelf: item?.alignSelf ?? \"stretch\" } : {}),\r\n } as never;\r\n}\r\n\r\n/** A zero-visual Yoga flex item. Fixed Unity grid constraints need explicit line breaks; this is still solved entirely by Yoga. */\r\nexport function createGridLineBreak(parent: Extract<LayoutGroupNode, { type: \"grid-layout\" }>, profile: LayoutProfileId): Container | undefined {\r\n const grid = resolveLayoutGroupSettings(parent, profile) as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n if (grid.constraint === \"flexible\" || grid.constraintCount === undefined) return undefined;\r\n const lineBreak = new Container({ label: \"__layout-grid-line-break__\" });\r\n lineBreak.layout = (grid.constraint === \"fixed-column-count\"\r\n ? { flexBasis: \"100%\", width: \"100%\", height: 0 }\r\n : { flexBasis: \"100%\", height: \"100%\", width: 0 }) as never;\r\n return lineBreak;\r\n}\r\n\r\nexport function isLayoutManagedChild(node: UINode, nodes: readonly UINode[]): boolean {\r\n return node.parentId !== null && isLayoutGroup(nodes.find((candidate) => candidate.id === node.parentId) ?? node) && nodes.some((candidate) => candidate.id === node.parentId && isLayoutGroup(candidate));\r\n}\r\n"]}
1
+ {"version":3,"file":"layoutGroups.js","sourceRoot":"","sources":["../src/layoutGroups.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAA0G,MAAM,wBAAwB,CAAC;AAC3L,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC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AAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,CAAU,CAAC;IACzF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,KAAwB;IACzE,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;AAC7M,CAAC","sourcesContent":["import \"@pixi/layout\";\r\nimport { isLayoutGroup, resolveLayoutGroupSettings, type GridLayoutSettings, type LayoutAlignment, type LayoutGroupNode, type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport { resolveAnchoredTransform, resolveProfileTransform, type LayoutSize } from \"./layout.js\";\r\nimport { LayoutGroupNodeView } from \"./views/basic.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\n\r\n/** Importing @pixi/layout installs its renderer extension. Kept as a shared explicit contract for every host. */\r\nexport function initializePixiLayout(): void { /* @pixi/layout is installed by this module's side effect. */ }\r\n\r\nfunction alignmentParts(alignment: LayoutAlignment) {\r\n const [vertical, horizontal] = alignment.split(\"-\") as [\"upper\" | \"middle\" | \"lower\", \"left\" | \"center\" | \"right\"];\r\n return {\r\n horizontal: horizontal === \"left\" ? \"flex-start\" : horizontal === \"right\" ? \"flex-end\" : \"center\",\r\n vertical: vertical === \"upper\" ? \"flex-start\" : vertical === \"lower\" ? \"flex-end\" : \"center\",\r\n };\r\n}\r\n\r\n/**\r\n * Направление заполнения сетки, выведенное из startCorner/startAxis/constraint. Единственный\r\n * источник правды: рантайм задаёт по нему Yoga-флексбокс, а редактор считает по нему же рамки\r\n * выделения, поэтому расходиться этим двум расчётам негде.\r\n */\r\nexport type GridFlow = {\r\n /** Строки являются линиями переноса (иначе линии — это колонки). */\r\n readonly fillsByRow: boolean;\r\n /** Главная ось (порядок внутри линии) идёт справа налево / снизу вверх. */\r\n readonly mainReversed: boolean;\r\n /** Поперечная ось (порядок линий) идёт снизу вверх / справа налево. */\r\n readonly crossReversed: boolean;\r\n /** Фиксированный constraint переносит линии явными разрывами, а не переполнением. */\r\n readonly usesLineBreaks: boolean;\r\n};\r\n\r\nexport function resolveGridFlow(grid: GridLayoutSettings): GridFlow {\r\n const reverseX = grid.startCorner.endsWith(\"right\");\r\n const reverseY = grid.startCorner.startsWith(\"lower\");\r\n const fillsByRow = grid.constraint === \"fixed-column-count\" || (grid.constraint === \"flexible\" && grid.startAxis === \"horizontal\");\r\n return {\r\n fillsByRow,\r\n mainReversed: fillsByRow ? reverseX : reverseY,\r\n crossReversed: fillsByRow ? reverseY : reverseX,\r\n usesLineBreaks: grid.constraint !== \"flexible\" && grid.constraintCount !== undefined,\r\n };\r\n}\r\n\r\nfunction layoutSize(node: UINode, profile: LayoutProfileId, parentSize?: LayoutSize): LayoutSize {\r\n const transform = resolveAnchoredTransform(resolveProfileTransform(node, profile).transform, parentSize);\r\n return { width: transform.width, height: transform.height };\r\n}\r\n\r\n/** Applies one declarative document group to Pixi Layout; no computed Yoga data crosses the document boundary. */\r\nexport function applyLayoutGroup(view: Container, node: LayoutGroupNode, profile: LayoutProfileId, parentSize?: LayoutSize, managedSize?: LayoutSize): void {\r\n const settings = resolveLayoutGroupSettings(node, profile) as LayoutGroupNode[\"layoutGroup\"][\"base\"];\r\n const size = managedSize ?? layoutSize(node, profile, parentSize);\r\n const common = { width: size.width, height: size.height, display: \"flex\" as const };\r\n if (node.type === \"horizontal-layout\" || node.type === \"vertical-layout\") {\r\n const linear = settings as Extract<LayoutGroupNode, { type: \"horizontal-layout\" | \"vertical-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;\r\n const alignment = alignmentParts(linear.childAlignment);\r\n target.layout = {\r\n ...common,\r\n justifyContent: node.type === \"horizontal-layout\" ? alignment.horizontal : alignment.vertical,\r\n alignItems: node.type === \"horizontal-layout\" ? alignment.vertical : alignment.horizontal,\r\n flexDirection: node.type === \"horizontal-layout\" ? (linear.reverseOrder ? \"row-reverse\" : \"row\") : (linear.reverseOrder ? \"column-reverse\" : \"column\"),\r\n gap: linear.spacing,\r\n paddingLeft: linear.padding.left, paddingRight: linear.padding.right, paddingTop: linear.padding.top, paddingBottom: linear.padding.bottom,\r\n } as never;\r\n return;\r\n }\r\n const grid = settings as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const flow = resolveGridFlow(grid);\r\n const target = view instanceof LayoutGroupNodeView ? view.layoutTarget : view;\r\n const alignment = alignmentParts(grid.childAlignment);\r\n // justify-content при flex-wrap выравнивает КАЖДУЮ линию отдельно, поэтому неполная последняя\r\n // строка центрируется сама по себе. Это и есть per-row alignment, отдельного поля не нужно.\r\n target.layout = {\r\n ...common,\r\n justifyContent: flow.fillsByRow ? alignment.horizontal : alignment.vertical,\r\n alignItems: flow.fillsByRow ? alignment.vertical : alignment.horizontal,\r\n alignContent: flow.fillsByRow ? alignment.vertical : alignment.horizontal,\r\n flexDirection: flow.fillsByRow ? (flow.mainReversed ? \"row-reverse\" : \"row\") : (flow.mainReversed ? \"column-reverse\" : \"column\"),\r\n flexWrap: flow.crossReversed ? \"wrap-reverse\" : \"wrap\",\r\n // Разрыв строки занимает собственную линию, поэтому поперечный зазор пришёл бы дважды: до\r\n // разрыва и после него. Зазор перенесён в размер самого разрыва, а gutter обнулён.\r\n columnGap: flow.usesLineBreaks && !flow.fillsByRow ? 0 : grid.spacingX,\r\n rowGap: flow.usesLineBreaks && flow.fillsByRow ? 0 : grid.spacingY,\r\n paddingLeft: grid.padding.left, paddingRight: grid.padding.right, paddingTop: grid.padding.top, paddingBottom: grid.padding.bottom,\r\n } as never;\r\n}\r\n\r\n/**\r\n * Runtime-only Yoga owner for one direct child. The wrapper receives Yoga coordinates while the\r\n * serializable NodeView keeps the shared pivot/rotation/scale/content/hit-test contract.\r\n */\r\nexport class LayoutItemContainer extends Container {\r\n private node?: UINode;\r\n private profile: LayoutProfileId = \"desktop\";\r\n private fallbackSize: LayoutSize = { width: 0, height: 0 };\r\n\r\n constructor(readonly nodeView: NodeView, private readonly onLayoutChanged?: () => void) {\r\n super();\r\n super.addChild(nodeView);\r\n this.onLayout = () => this.applyComputedSize();\r\n }\r\n\r\n sync(node: UINode, profile: LayoutProfileId, fallbackSize: LayoutSize): void {\r\n this.node = node;\r\n this.profile = profile;\r\n this.fallbackSize = fallbackSize;\r\n this.visible = resolveProfileTransform(node, profile).visible;\r\n this.applyComputedSize();\r\n }\r\n\r\n private applyComputedSize(): void {\r\n if (this.node === undefined) return;\r\n const computed = this.layout?.computedLayout;\r\n const size = computed === undefined || computed.width <= 0 || computed.height <= 0\r\n ? this.fallbackSize\r\n : { width: computed.width, height: computed.height };\r\n if (isLayoutGroup(this.node)) applyLayoutGroup(this.nodeView, this.node, this.profile, undefined, size);\r\n this.nodeView.updateManaged(this.node, this.profile, size);\r\n this.onLayoutChanged?.();\r\n }\r\n}\r\n\r\n/** Marks a direct child's technical wrapper as layout-managed. */\r\nexport function applyLayoutItem(view: LayoutItemContainer, node: UINode, parent: LayoutGroupNode, profile: LayoutProfileId): void {\r\n // Anchors belong to authored positioning and are deliberately ignored while a parent layout owns\r\n // the rectangle. Width/height remain the child's logical intrinsic size, never Pixi content bounds.\r\n const transform = resolveProfileTransform(node, profile).transform;\r\n const own = { width: transform.width, height: transform.height };\r\n const item = node.layoutItem;\r\n const settings = resolveLayoutGroupSettings(parent, profile);\r\n const base = { position: \"relative\" as const, flexGrow: item?.flexGrow ?? 0, flexShrink: item?.flexShrink ?? 0, flexBasis: item?.flexBasis, alignSelf: item?.alignSelf };\r\n view.sync(node, profile, own);\r\n if (parent.type === \"grid-layout\") {\r\n const grid = settings as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n view.layout = { ...base, width: grid.cellWidth, height: grid.cellHeight } as never;\r\n return;\r\n }\r\n const linear = settings as Extract<LayoutGroupNode, { type: \"horizontal-layout\" | \"vertical-layout\" }> [\"layoutGroup\"][\"base\"];\r\n const horizontal = parent.type === \"horizontal-layout\";\r\n const expandsMain = horizontal\r\n ? linear.controlChildWidth && linear.forceExpandWidth\r\n : linear.controlChildHeight && linear.forceExpandHeight;\r\n const expandsCross = horizontal\r\n ? linear.controlChildHeight && linear.forceExpandHeight\r\n : linear.controlChildWidth && linear.forceExpandWidth;\r\n view.layout = {\r\n ...base,\r\n // The schema has no separate min/preferred size yet, so the logical authored rect is the safe\r\n // intrinsic fallback for both control modes. Force-expand may then replace the relevant axis.\r\n width: expandsCross && !horizontal ? undefined : own.width,\r\n height: expandsCross && horizontal ? undefined : own.height,\r\n ...(expandsMain ? { flexGrow: Math.max(1, item?.flexGrow ?? 0) } : {}),\r\n ...(expandsCross ? { alignSelf: item?.alignSelf ?? \"stretch\" } : {}),\r\n } as never;\r\n}\r\n\r\n/** A zero-visual Yoga flex item. Fixed Unity grid constraints need explicit line breaks; this is still solved entirely by Yoga. */\r\nexport function createGridLineBreak(parent: Extract<LayoutGroupNode, { type: \"grid-layout\" }>, profile: LayoutProfileId): Container | undefined {\r\n const grid = resolveLayoutGroupSettings(parent, profile) as Extract<LayoutGroupNode, { type: \"grid-layout\" }> [\"layoutGroup\"][\"base\"];\r\n if (grid.constraint === \"flexible\" || grid.constraintCount === undefined) return undefined;\r\n const lineBreak = new Container({ label: \"__layout-grid-line-break__\" });\r\n // Поперечный зазор между линиями живёт здесь, а не в rowGap/columnGap группы: см. applyLayoutGroup.\r\n lineBreak.layout = (grid.constraint === \"fixed-column-count\"\r\n ? { flexBasis: \"100%\", width: \"100%\", height: grid.spacingY, flexShrink: 0 }\r\n : { flexBasis: \"100%\", height: \"100%\", width: grid.spacingX, flexShrink: 0 }) as never;\r\n return lineBreak;\r\n}\r\n\r\nexport function isLayoutManagedChild(node: UINode, nodes: readonly UINode[]): boolean {\r\n return node.parentId !== null && isLayoutGroup(nodes.find((candidate) => candidate.id === node.parentId) ?? node) && nodes.some((candidate) => candidate.id === node.parentId && isLayoutGroup(candidate));\r\n}\r\n"]}
@@ -5,9 +5,11 @@ import { NodeView } from "./views/NodeView.js";
5
5
  /**
6
6
  * Runtime-only position owner for one direct page-group child: fills the group's whole resolved
7
7
  * rectangle and is shown only while it is the active page. Position and visibility are this wrapper's
8
- * job; the wrapped `NodeView` keeps its own pivot/rotation/scale/visibility contract via
9
- * `updateManaged`, the same split a layout group's `LayoutItemContainer` and a scroll-view's
10
- * `ScrollItemContainer` already use.
8
+ * job; the wrapped `NodeView` keeps its own pivot/rotation/scale contract via `updateManaged`, the
9
+ * same split a layout group's `LayoutItemContainer` and a scroll-view's `ScrollItemContainer` already
10
+ * use — except visibility is *not* split off to the child here: a page's own authored `visible` would
11
+ * otherwise be able to blank out the active page independently of which page the group has switched
12
+ * to, so `forceVisible` makes the group the single source of truth for whether a page's content shows.
11
13
  */
12
14
  export declare class PageItemContainer extends Container {
13
15
  readonly nodeView: NodeView;
@@ -1 +1 @@
1
- {"version":3,"file":"pageGroup.d.ts","sourceRoot":"","sources":["../src/pageGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;IAClC,QAAQ,CAAC,QAAQ,EAAE,QAAQ;IAAvC,YAAqB,QAAQ,EAAE,QAAQ,EAGtC;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAEnE;CACF"}
1
+ {"version":3,"file":"pageGroup.d.ts","sourceRoot":"","sources":["../src/pageGroup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;IAClC,QAAQ,CAAC,QAAQ,EAAE,QAAQ;IAAvC,YAAqB,QAAQ,EAAE,QAAQ,EAGtC;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAEnE;CACF"}
package/dist/pageGroup.js CHANGED
@@ -2,9 +2,11 @@ import { Container } from "pixi.js";
2
2
  /**
3
3
  * Runtime-only position owner for one direct page-group child: fills the group's whole resolved
4
4
  * rectangle and is shown only while it is the active page. Position and visibility are this wrapper's
5
- * job; the wrapped `NodeView` keeps its own pivot/rotation/scale/visibility contract via
6
- * `updateManaged`, the same split a layout group's `LayoutItemContainer` and a scroll-view's
7
- * `ScrollItemContainer` already use.
5
+ * job; the wrapped `NodeView` keeps its own pivot/rotation/scale contract via `updateManaged`, the
6
+ * same split a layout group's `LayoutItemContainer` and a scroll-view's `ScrollItemContainer` already
7
+ * use — except visibility is *not* split off to the child here: a page's own authored `visible` would
8
+ * otherwise be able to blank out the active page independently of which page the group has switched
9
+ * to, so `forceVisible` makes the group the single source of truth for whether a page's content shows.
8
10
  */
9
11
  export class PageItemContainer extends Container {
10
12
  nodeView;
@@ -14,7 +16,7 @@ export class PageItemContainer extends Container {
14
16
  super.addChild(nodeView);
15
17
  }
16
18
  sync(node, profile, size) {
17
- this.nodeView.updateManaged(node, profile, size);
19
+ this.nodeView.updateManaged(node, profile, size, true);
18
20
  }
19
21
  }
20
22
  //# sourceMappingURL=pageGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pageGroup.js","sourceRoot":"","sources":["../src/pageGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IACzB,QAAQ;IAA7B,YAAqB,QAAkB;QACrC,KAAK,EAAE,CAAC;wBADW,QAAQ;QAE3B,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,OAAwB,EAAE,IAAgB;QAC3D,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["import { type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport type { LayoutSize } from \"./layout.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\n\r\n/**\r\n * Runtime-only position owner for one direct page-group child: fills the group's whole resolved\r\n * rectangle and is shown only while it is the active page. Position and visibility are this wrapper's\r\n * job; the wrapped `NodeView` keeps its own pivot/rotation/scale/visibility contract via\r\n * `updateManaged`, the same split a layout group's `LayoutItemContainer` and a scroll-view's\r\n * `ScrollItemContainer` already use.\r\n */\r\nexport class PageItemContainer extends Container {\r\n constructor(readonly nodeView: NodeView) {\r\n super();\r\n super.addChild(nodeView);\r\n }\r\n\r\n sync(node: UINode, profile: LayoutProfileId, size: LayoutSize): void {\r\n this.nodeView.updateManaged(node, profile, size);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"pageGroup.js","sourceRoot":"","sources":["../src/pageGroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC;;;;;;;;GAQG;AACH,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IACzB,QAAQ;IAA7B,YAAqB,QAAkB;QACrC,KAAK,EAAE,CAAC;wBADW,QAAQ;QAE3B,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,OAAwB,EAAE,IAAgB;QAC3D,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;CACF","sourcesContent":["import { type LayoutProfileId, type UINode } from \"@pixi-ui-editor/schema\";\r\nimport { Container } from \"pixi.js\";\r\nimport type { LayoutSize } from \"./layout.js\";\r\nimport { NodeView } from \"./views/NodeView.js\";\r\n\r\n/**\r\n * Runtime-only position owner for one direct page-group child: fills the group's whole resolved\r\n * rectangle and is shown only while it is the active page. Position and visibility are this wrapper's\r\n * job; the wrapped `NodeView` keeps its own pivot/rotation/scale contract via `updateManaged`, the\r\n * same split a layout group's `LayoutItemContainer` and a scroll-view's `ScrollItemContainer` already\r\n * use — except visibility is *not* split off to the child here: a page's own authored `visible` would\r\n * otherwise be able to blank out the active page independently of which page the group has switched\r\n * to, so `forceVisible` makes the group the single source of truth for whether a page's content shows.\r\n */\r\nexport class PageItemContainer extends Container {\r\n constructor(readonly nodeView: NodeView) {\r\n super();\r\n super.addChild(nodeView);\r\n }\r\n\r\n sync(node: UINode, profile: LayoutProfileId, size: LayoutSize): void {\r\n this.nodeView.updateManaged(node, profile, size, true);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../src/scene.ts"],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,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,qBAAqB,EAAE,aAAa,GAAE,uBAA4B,GAAG,eAAe,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAG5N;AAED,wGAAwG;AACxG,wBAAsB,cAAc,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE;IAAE,WAAW,EAAE,oBAAoB,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,wBAAwB,CAAC;IAAC,UAAU,CAAC,EAAE,eAAe,CAAA;CAAE,EAAE,aAAa,GAAE,uBAA4B,GAAG,OAAO,CAAC,eAAe,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAGnX;AAED,yFAAyF;AACzF,wBAAsB,aAAa,CACjC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,cAAc,EAAE,eAAe,EAC/B,OAAO,EAAE;IAAE,WAAW,EAAE,oBAAoB,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,wBAAwB,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,eAAe,CAAA;CAAE,GAC/J,OAAO,CAAC,eAAe,CAAC,CAY1B"}
package/dist/scene.js CHANGED
@@ -72,11 +72,20 @@ export function buildSceneView(document, sceneId, profile, options) {
72
72
  // иначе они не отслеживают изменение Cell width/height и якорятся относительно устаревшего размера.
73
73
  const gridParent = node.parentId === null ? undefined : nodesById.get(node.parentId);
74
74
  const gridCell = gridParent?.type === "grid-layout" ? resolveLayoutGroupSettings(gridParent, profile) : undefined;
75
+ // Та же логика для прямого ребёнка page-group (страницы): `PageItemContainer`/`updateManaged`
76
+ // растягивают её на весь resolved rectangle группы независимо от собственных anchors ноды
77
+ // (см. NodeView.applyResolvedTransform, managedByLayout). Здесь `node` — сама страница, поэтому
78
+ // это переопределённый размер, который она фактически получит, — `parentSize`, уже разрешённый
79
+ // как rectangle page-group. Без этой ветки дети страницы якорились бы относительно её
80
+ // anchor-resolved authored-размера, который может расходиться с фактическим rectangle группы,
81
+ // особенно в другом layout-профиле.
75
82
  const childSize = node.parentId === null
76
83
  ? rootSize
77
84
  : gridCell !== undefined
78
85
  ? { width: gridCell.cellWidth, height: gridCell.cellHeight }
79
- : { width: transform.width, height: transform.height };
86
+ : gridParent?.type === "page-group"
87
+ ? parentSize
88
+ : { width: transform.width, height: transform.height };
80
89
  for (const [childIndex, childId] of node.children.entries()) {
81
90
  const childNode = nodesById.get(childId);
82
91
  const childView = buildNode(childId, childSize);
@@ -167,6 +176,9 @@ function wireNodeReferences(nodes, nodeViews, interaction) {
167
176
  else if (node.type === "pagination" && view instanceof PaginationNodeView && interaction === "runtime") {
168
177
  view.setArrows({ previous: arrowView(node.prevButtonNodeId), next: arrowView(node.nextButtonNodeId) });
169
178
  }
179
+ else if (node.type === "page-group" && view instanceof PageGroupNodeView && interaction === "runtime") {
180
+ view.setArrows({ up: arrowView(node.pageUpButtonNodeId), down: arrowView(node.pageDownButtonNodeId) });
181
+ }
170
182
  }
171
183
  }
172
184
  /**