@number10/jsx-core 5.0.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.
Files changed (340) hide show
  1. package/LICENSE +667 -0
  2. package/README.md +38 -0
  3. package/dist/animation/animated-signal.cjs +19 -0
  4. package/dist/animation/animated-signal.cjs.map +1 -0
  5. package/dist/animation/animated-signal.d.ts +35 -0
  6. package/dist/animation/animated-signal.d.ts.map +1 -0
  7. package/dist/animation/animated-signal.js +19 -0
  8. package/dist/animation/animated-signal.js.map +1 -0
  9. package/dist/animation/create-spring.cjs +80 -0
  10. package/dist/animation/create-spring.cjs.map +1 -0
  11. package/dist/animation/create-spring.d.ts +56 -0
  12. package/dist/animation/create-spring.d.ts.map +1 -0
  13. package/dist/animation/create-spring.js +80 -0
  14. package/dist/animation/create-spring.js.map +1 -0
  15. package/dist/animation/easing.cjs +76 -0
  16. package/dist/animation/easing.cjs.map +1 -0
  17. package/dist/animation/easing.d.ts +45 -0
  18. package/dist/animation/easing.d.ts.map +1 -0
  19. package/dist/animation/easing.js +76 -0
  20. package/dist/animation/easing.js.map +1 -0
  21. package/dist/animation/effect-definitions.cjs +441 -0
  22. package/dist/animation/effect-definitions.cjs.map +1 -0
  23. package/dist/animation/effect-definitions.d.ts +60 -0
  24. package/dist/animation/effect-definitions.d.ts.map +1 -0
  25. package/dist/animation/effect-definitions.js +441 -0
  26. package/dist/animation/effect-definitions.js.map +1 -0
  27. package/dist/animation/effect-engine.cjs +189 -0
  28. package/dist/animation/effect-engine.cjs.map +1 -0
  29. package/dist/animation/effect-engine.d.ts +70 -0
  30. package/dist/animation/effect-engine.d.ts.map +1 -0
  31. package/dist/animation/effect-engine.js +189 -0
  32. package/dist/animation/effect-engine.js.map +1 -0
  33. package/dist/animation/index.d.ts +24 -0
  34. package/dist/animation/index.d.ts.map +1 -0
  35. package/dist/animation/spring-physics.cjs +94 -0
  36. package/dist/animation/spring-physics.cjs.map +1 -0
  37. package/dist/animation/spring-physics.d.ts +145 -0
  38. package/dist/animation/spring-physics.d.ts.map +1 -0
  39. package/dist/animation/spring-physics.js +94 -0
  40. package/dist/animation/spring-physics.js.map +1 -0
  41. package/dist/animation/tween.cjs +67 -0
  42. package/dist/animation/tween.cjs.map +1 -0
  43. package/dist/animation/tween.d.ts +60 -0
  44. package/dist/animation/tween.d.ts.map +1 -0
  45. package/dist/animation/tween.js +67 -0
  46. package/dist/animation/tween.js.map +1 -0
  47. package/dist/animation/types.d.ts +31 -0
  48. package/dist/animation/types.d.ts.map +1 -0
  49. package/dist/animation/useSpring.cjs +152 -0
  50. package/dist/animation/useSpring.cjs.map +1 -0
  51. package/dist/animation/useSpring.d.ts +55 -0
  52. package/dist/animation/useSpring.d.ts.map +1 -0
  53. package/dist/animation/useSpring.js +149 -0
  54. package/dist/animation/useSpring.js.map +1 -0
  55. package/dist/animation/useTween.cjs +208 -0
  56. package/dist/animation/useTween.cjs.map +1 -0
  57. package/dist/animation/useTween.d.ts +116 -0
  58. package/dist/animation/useTween.d.ts.map +1 -0
  59. package/dist/animation/useTween.js +208 -0
  60. package/dist/animation/useTween.js.map +1 -0
  61. package/dist/border-geometry.cjs +447 -0
  62. package/dist/border-geometry.cjs.map +1 -0
  63. package/dist/border-geometry.d.ts +114 -0
  64. package/dist/border-geometry.d.ts.map +1 -0
  65. package/dist/border-geometry.js +447 -0
  66. package/dist/border-geometry.js.map +1 -0
  67. package/dist/colors/color-presets.cjs +236 -0
  68. package/dist/colors/color-presets.cjs.map +1 -0
  69. package/dist/colors/color-presets.d.ts +89 -0
  70. package/dist/colors/color-presets.d.ts.map +1 -0
  71. package/dist/colors/color-presets.js +236 -0
  72. package/dist/colors/color-presets.js.map +1 -0
  73. package/dist/colors/color-theme-helpers.cjs +32 -0
  74. package/dist/colors/color-theme-helpers.cjs.map +1 -0
  75. package/dist/colors/color-theme-helpers.d.ts +65 -0
  76. package/dist/colors/color-theme-helpers.d.ts.map +1 -0
  77. package/dist/colors/color-theme-helpers.js +32 -0
  78. package/dist/colors/color-theme-helpers.js.map +1 -0
  79. package/dist/colors/color-types.cjs +38 -0
  80. package/dist/colors/color-types.cjs.map +1 -0
  81. package/dist/colors/color-types.d.ts +112 -0
  82. package/dist/colors/color-types.d.ts.map +1 -0
  83. package/dist/colors/color-types.js +38 -0
  84. package/dist/colors/color-types.js.map +1 -0
  85. package/dist/colors/color-utils.cjs +197 -0
  86. package/dist/colors/color-utils.cjs.map +1 -0
  87. package/dist/colors/color-utils.d.ts +216 -0
  88. package/dist/colors/color-utils.d.ts.map +1 -0
  89. package/dist/colors/color-utils.js +197 -0
  90. package/dist/colors/color-utils.js.map +1 -0
  91. package/dist/colors/contrast-contracts.cjs +265 -0
  92. package/dist/colors/contrast-contracts.cjs.map +1 -0
  93. package/dist/colors/contrast-contracts.d.ts +289 -0
  94. package/dist/colors/contrast-contracts.d.ts.map +1 -0
  95. package/dist/colors/contrast-contracts.js +265 -0
  96. package/dist/colors/contrast-contracts.js.map +1 -0
  97. package/dist/colors/index.cjs +55 -0
  98. package/dist/colors/index.cjs.map +1 -0
  99. package/dist/colors/index.d.ts +16 -0
  100. package/dist/colors/index.d.ts.map +1 -0
  101. package/dist/colors/index.js +55 -0
  102. package/dist/colors/index.js.map +1 -0
  103. package/dist/core-props.cjs +66 -0
  104. package/dist/core-props.cjs.map +1 -0
  105. package/dist/core-props.d.ts +395 -0
  106. package/dist/core-props.d.ts.map +1 -0
  107. package/dist/core-props.js +66 -0
  108. package/dist/core-props.js.map +1 -0
  109. package/dist/design-tokens/design-token-presets.cjs +91 -0
  110. package/dist/design-tokens/design-token-presets.cjs.map +1 -0
  111. package/dist/design-tokens/design-token-presets.d.ts +34 -0
  112. package/dist/design-tokens/design-token-presets.d.ts.map +1 -0
  113. package/dist/design-tokens/design-token-presets.js +91 -0
  114. package/dist/design-tokens/design-token-presets.js.map +1 -0
  115. package/dist/design-tokens/design-token-types.d.ts +97 -0
  116. package/dist/design-tokens/design-token-types.d.ts.map +1 -0
  117. package/dist/design-tokens/index.cjs +10 -0
  118. package/dist/design-tokens/index.cjs.map +1 -0
  119. package/dist/design-tokens/index.d.ts +9 -0
  120. package/dist/design-tokens/index.d.ts.map +1 -0
  121. package/dist/design-tokens/index.js +10 -0
  122. package/dist/design-tokens/index.js.map +1 -0
  123. package/dist/dev-config.cjs +296 -0
  124. package/dist/dev-config.cjs.map +1 -0
  125. package/dist/dev-config.d.ts +238 -0
  126. package/dist/dev-config.d.ts.map +1 -0
  127. package/dist/dev-config.js +296 -0
  128. package/dist/dev-config.js.map +1 -0
  129. package/dist/effects.cjs +69 -0
  130. package/dist/effects.cjs.map +1 -0
  131. package/dist/effects.d.ts +152 -0
  132. package/dist/effects.d.ts.map +1 -0
  133. package/dist/effects.js +69 -0
  134. package/dist/effects.js.map +1 -0
  135. package/dist/global-registry.cjs +25 -0
  136. package/dist/global-registry.cjs.map +1 -0
  137. package/dist/global-registry.d.ts +19 -0
  138. package/dist/global-registry.d.ts.map +1 -0
  139. package/dist/global-registry.js +25 -0
  140. package/dist/global-registry.js.map +1 -0
  141. package/dist/hooks.cjs +378 -0
  142. package/dist/hooks.cjs.map +1 -0
  143. package/dist/hooks.d.ts +322 -0
  144. package/dist/hooks.d.ts.map +1 -0
  145. package/dist/hooks.js +378 -0
  146. package/dist/hooks.js.map +1 -0
  147. package/dist/host-adapter.d.ts +414 -0
  148. package/dist/host-adapter.d.ts.map +1 -0
  149. package/dist/index.cjs +229 -0
  150. package/dist/index.cjs.map +1 -0
  151. package/dist/index.d.ts +32 -0
  152. package/dist/index.d.ts.map +1 -0
  153. package/dist/index.js +226 -0
  154. package/dist/index.js.map +1 -0
  155. package/dist/jsx-dev-runtime.cjs +10 -0
  156. package/dist/jsx-dev-runtime.cjs.map +1 -0
  157. package/dist/jsx-dev-runtime.d.ts +5 -0
  158. package/dist/jsx-dev-runtime.d.ts.map +1 -0
  159. package/dist/jsx-dev-runtime.js +11 -0
  160. package/dist/jsx-dev-runtime.js.map +1 -0
  161. package/dist/jsx-runtime.cjs +44 -0
  162. package/dist/jsx-runtime.cjs.map +1 -0
  163. package/dist/jsx-runtime.d.ts +24 -0
  164. package/dist/jsx-runtime.d.ts.map +1 -0
  165. package/dist/jsx-runtime.js +44 -0
  166. package/dist/jsx-runtime.js.map +1 -0
  167. package/dist/jsx-types.d.ts +25 -0
  168. package/dist/jsx-types.d.ts.map +1 -0
  169. package/dist/layout/appliers/container-applier.cjs +20 -0
  170. package/dist/layout/appliers/container-applier.cjs.map +1 -0
  171. package/dist/layout/appliers/container-applier.d.ts +9 -0
  172. package/dist/layout/appliers/container-applier.d.ts.map +1 -0
  173. package/dist/layout/appliers/container-applier.js +20 -0
  174. package/dist/layout/appliers/container-applier.js.map +1 -0
  175. package/dist/layout/appliers/position-applier.cjs +31 -0
  176. package/dist/layout/appliers/position-applier.cjs.map +1 -0
  177. package/dist/layout/appliers/position-applier.d.ts +8 -0
  178. package/dist/layout/appliers/position-applier.d.ts.map +1 -0
  179. package/dist/layout/appliers/position-applier.js +31 -0
  180. package/dist/layout/appliers/position-applier.js.map +1 -0
  181. package/dist/layout/layout-engine-test-utils.d.ts +26 -0
  182. package/dist/layout/layout-engine-test-utils.d.ts.map +1 -0
  183. package/dist/layout/layout-engine.cjs +628 -0
  184. package/dist/layout/layout-engine.cjs.map +1 -0
  185. package/dist/layout/layout-engine.d.ts +140 -0
  186. package/dist/layout/layout-engine.d.ts.map +1 -0
  187. package/dist/layout/layout-engine.js +628 -0
  188. package/dist/layout/layout-engine.js.map +1 -0
  189. package/dist/layout/strategies/base-strategy.cjs +31 -0
  190. package/dist/layout/strategies/base-strategy.cjs.map +1 -0
  191. package/dist/layout/strategies/base-strategy.d.ts +59 -0
  192. package/dist/layout/strategies/base-strategy.d.ts.map +1 -0
  193. package/dist/layout/strategies/base-strategy.js +31 -0
  194. package/dist/layout/strategies/base-strategy.js.map +1 -0
  195. package/dist/layout/strategies/column-layout.cjs +145 -0
  196. package/dist/layout/strategies/column-layout.cjs.map +1 -0
  197. package/dist/layout/strategies/column-layout.d.ts +38 -0
  198. package/dist/layout/strategies/column-layout.d.ts.map +1 -0
  199. package/dist/layout/strategies/column-layout.js +145 -0
  200. package/dist/layout/strategies/column-layout.js.map +1 -0
  201. package/dist/layout/strategies/row-layout.cjs +145 -0
  202. package/dist/layout/strategies/row-layout.cjs.map +1 -0
  203. package/dist/layout/strategies/row-layout.d.ts +38 -0
  204. package/dist/layout/strategies/row-layout.d.ts.map +1 -0
  205. package/dist/layout/strategies/row-layout.js +145 -0
  206. package/dist/layout/strategies/row-layout.js.map +1 -0
  207. package/dist/layout/strategies/stack-layout.cjs +94 -0
  208. package/dist/layout/strategies/stack-layout.cjs.map +1 -0
  209. package/dist/layout/strategies/stack-layout.d.ts +30 -0
  210. package/dist/layout/strategies/stack-layout.d.ts.map +1 -0
  211. package/dist/layout/strategies/stack-layout.js +94 -0
  212. package/dist/layout/strategies/stack-layout.js.map +1 -0
  213. package/dist/layout/types.d.ts +134 -0
  214. package/dist/layout/types.d.ts.map +1 -0
  215. package/dist/layout/utils/child-utils.cjs +129 -0
  216. package/dist/layout/utils/child-utils.cjs.map +1 -0
  217. package/dist/layout/utils/child-utils.d.ts +54 -0
  218. package/dist/layout/utils/child-utils.d.ts.map +1 -0
  219. package/dist/layout/utils/child-utils.js +129 -0
  220. package/dist/layout/utils/child-utils.js.map +1 -0
  221. package/dist/layout/utils/dimension-calculator.cjs +109 -0
  222. package/dist/layout/utils/dimension-calculator.cjs.map +1 -0
  223. package/dist/layout/utils/dimension-calculator.d.ts +59 -0
  224. package/dist/layout/utils/dimension-calculator.d.ts.map +1 -0
  225. package/dist/layout/utils/dimension-calculator.js +109 -0
  226. package/dist/layout/utils/dimension-calculator.js.map +1 -0
  227. package/dist/layout/utils/flex-distributor.cjs +173 -0
  228. package/dist/layout/utils/flex-distributor.cjs.map +1 -0
  229. package/dist/layout/utils/flex-distributor.d.ts +18 -0
  230. package/dist/layout/utils/flex-distributor.d.ts.map +1 -0
  231. package/dist/layout/utils/flex-distributor.js +173 -0
  232. package/dist/layout/utils/flex-distributor.js.map +1 -0
  233. package/dist/layout/utils/size-resolver.cjs +280 -0
  234. package/dist/layout/utils/size-resolver.cjs.map +1 -0
  235. package/dist/layout/utils/size-resolver.d.ts +84 -0
  236. package/dist/layout/utils/size-resolver.d.ts.map +1 -0
  237. package/dist/layout/utils/size-resolver.js +280 -0
  238. package/dist/layout/utils/size-resolver.js.map +1 -0
  239. package/dist/layout/utils/spacing-calculator.cjs +50 -0
  240. package/dist/layout/utils/spacing-calculator.cjs.map +1 -0
  241. package/dist/layout/utils/spacing-calculator.d.ts +27 -0
  242. package/dist/layout/utils/spacing-calculator.d.ts.map +1 -0
  243. package/dist/layout/utils/spacing-calculator.js +50 -0
  244. package/dist/layout/utils/spacing-calculator.js.map +1 -0
  245. package/dist/memo.cjs +18 -0
  246. package/dist/memo.cjs.map +1 -0
  247. package/dist/memo.d.ts +29 -0
  248. package/dist/memo.d.ts.map +1 -0
  249. package/dist/memo.js +18 -0
  250. package/dist/memo.js.map +1 -0
  251. package/dist/nineslice-contract.cjs +60 -0
  252. package/dist/nineslice-contract.cjs.map +1 -0
  253. package/dist/nineslice-contract.d.ts +107 -0
  254. package/dist/nineslice-contract.d.ts.map +1 -0
  255. package/dist/nineslice-contract.js +60 -0
  256. package/dist/nineslice-contract.js.map +1 -0
  257. package/dist/placeholder.cjs +12 -0
  258. package/dist/placeholder.cjs.map +1 -0
  259. package/dist/placeholder.d.ts +44 -0
  260. package/dist/placeholder.d.ts.map +1 -0
  261. package/dist/placeholder.js +12 -0
  262. package/dist/placeholder.js.map +1 -0
  263. package/dist/portal.cjs +89 -0
  264. package/dist/portal.cjs.map +1 -0
  265. package/dist/portal.d.ts +62 -0
  266. package/dist/portal.d.ts.map +1 -0
  267. package/dist/portal.js +89 -0
  268. package/dist/portal.js.map +1 -0
  269. package/dist/primitive-contracts.cjs +12 -0
  270. package/dist/primitive-contracts.cjs.map +1 -0
  271. package/dist/primitive-contracts.d.ts +186 -0
  272. package/dist/primitive-contracts.d.ts.map +1 -0
  273. package/dist/primitive-contracts.js +12 -0
  274. package/dist/primitive-contracts.js.map +1 -0
  275. package/dist/theme.cjs +332 -0
  276. package/dist/theme.cjs.map +1 -0
  277. package/dist/theme.d.ts +204 -0
  278. package/dist/theme.d.ts.map +1 -0
  279. package/dist/theme.js +332 -0
  280. package/dist/theme.js.map +1 -0
  281. package/dist/types.d.ts +86 -0
  282. package/dist/types.d.ts.map +1 -0
  283. package/dist/vdom/create-runtime.cjs +79 -0
  284. package/dist/vdom/create-runtime.cjs.map +1 -0
  285. package/dist/vdom/create-runtime.d.ts +7 -0
  286. package/dist/vdom/create-runtime.d.ts.map +1 -0
  287. package/dist/vdom/create-runtime.js +79 -0
  288. package/dist/vdom/create-runtime.js.map +1 -0
  289. package/dist/vdom/index.cjs +8 -0
  290. package/dist/vdom/index.cjs.map +1 -0
  291. package/dist/vdom/index.d.ts +4 -0
  292. package/dist/vdom/index.d.ts.map +1 -0
  293. package/dist/vdom/index.js +8 -0
  294. package/dist/vdom/index.js.map +1 -0
  295. package/dist/vdom/mount.cjs +161 -0
  296. package/dist/vdom/mount.cjs.map +1 -0
  297. package/dist/vdom/mount.d.ts +6 -0
  298. package/dist/vdom/mount.d.ts.map +1 -0
  299. package/dist/vdom/mount.js +161 -0
  300. package/dist/vdom/mount.js.map +1 -0
  301. package/dist/vdom/patch.cjs +163 -0
  302. package/dist/vdom/patch.cjs.map +1 -0
  303. package/dist/vdom/patch.d.ts +3 -0
  304. package/dist/vdom/patch.d.ts.map +1 -0
  305. package/dist/vdom/patch.js +163 -0
  306. package/dist/vdom/patch.js.map +1 -0
  307. package/dist/vdom/registry.cjs +85 -0
  308. package/dist/vdom/registry.cjs.map +1 -0
  309. package/dist/vdom/registry.d.ts +28 -0
  310. package/dist/vdom/registry.d.ts.map +1 -0
  311. package/dist/vdom/registry.js +85 -0
  312. package/dist/vdom/registry.js.map +1 -0
  313. package/dist/vdom/runtime-helpers.cjs +23 -0
  314. package/dist/vdom/runtime-helpers.cjs.map +1 -0
  315. package/dist/vdom/runtime-helpers.d.ts +8 -0
  316. package/dist/vdom/runtime-helpers.d.ts.map +1 -0
  317. package/dist/vdom/runtime-helpers.js +23 -0
  318. package/dist/vdom/runtime-helpers.js.map +1 -0
  319. package/dist/vdom/surface.cjs +107 -0
  320. package/dist/vdom/surface.cjs.map +1 -0
  321. package/dist/vdom/surface.d.ts +9 -0
  322. package/dist/vdom/surface.d.ts.map +1 -0
  323. package/dist/vdom/surface.js +107 -0
  324. package/dist/vdom/surface.js.map +1 -0
  325. package/dist/vdom/types.d.ts +104 -0
  326. package/dist/vdom/types.d.ts.map +1 -0
  327. package/dist/vdom/utils.cjs +146 -0
  328. package/dist/vdom/utils.cjs.map +1 -0
  329. package/dist/vdom/utils.d.ts +24 -0
  330. package/dist/vdom/utils.d.ts.map +1 -0
  331. package/dist/vdom/utils.js +146 -0
  332. package/dist/vdom/utils.js.map +1 -0
  333. package/dist/vdom.d.ts +4 -0
  334. package/dist/vdom.d.ts.map +1 -0
  335. package/dist/vector-draw-context.d.ts +63 -0
  336. package/dist/vector-draw-context.d.ts.map +1 -0
  337. package/package.json +161 -0
  338. package/vdom/index.cjs +1 -0
  339. package/vdom/index.d.ts +1 -0
  340. package/vdom/index.js +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-engine.cjs","sources":["../../src/layout/layout-engine.ts"],"sourcesContent":["/**\n * Layout engine — main orchestrator for layout calculations.\n *\n * Renderer-neutral. Uses strategy pattern for layout directions.\n * Renderer-specific operations (clipping, background drawing, hit areas)\n * are injected via callbacks.\n *\n * @migration(audit:phase-5f+) Phase 5F+ — moved from @number10/jsx-phaser to @number10/jsx-core.\n * Phaser-specific parts (stencil clip, background) extracted to callbacks.\n */\nimport type { LayoutProps } from '../core-props'\nimport { normalizeGap } from '../core-props'\nimport { DebugLogger } from '../dev-config'\nimport { getGlobalValue, getOrCreateGlobalValue, setGlobalValue } from '../global-registry'\nimport { applyContainerDimensions } from './appliers/container-applier'\nimport { applyChildPositions } from './appliers/position-applier'\nimport type { LayoutStrategy } from './strategies/base-strategy'\nimport { ColumnLayoutStrategy } from './strategies/column-layout'\nimport { RowLayoutStrategy } from './strategies/row-layout'\nimport { StackLayoutStrategy } from './strategies/stack-layout'\nimport type { LayoutChild, LayoutContainer, LayoutContext, LayoutLine, Position } from './types'\nimport { getChildSize, getMargin, isLayoutChild, processNestedContainer } from './utils/child-utils'\nimport { calculateContainerSize, normalizePadding } from './utils/dimension-calculator'\nimport { distributeFlexSpace, hasFlexChildren } from './utils/flex-distributor'\nimport { clampSize, parseSize, resolveSize } from './utils/size-resolver'\nimport { calculateAlignItems, calculateJustifyContent } from './utils/spacing-calculator'\n\n// ---------------------------------------------------------------------------\n// Renderer-specific callbacks (injected by the renderer package)\n// ---------------------------------------------------------------------------\n\n/**\n * Callback to apply overflow clipping on a container.\n * Each renderer implements its own clipping mechanism (e.g., stencil buffer, scissor rect).\n */\nexport type ApplyOverflowClip = (\n container: LayoutContainer,\n containerProps: LayoutProps & {\n cornerRadius?: number | { tl?: number; tr?: number; bl?: number; br?: number }\n },\n width: number,\n height: number\n) => void\n\n/**\n * Callback invoked after layout dimensions are applied.\n * Used for renderer-specific post-layout operations (background drawing, hit areas).\n */\nexport type AfterLayoutCallback = (\n container: LayoutContainer,\n width: number,\n height: number\n) => void\n\nconst GLOBAL_NS = '@number10/jsx-core:layout'\nconst _overflowClipRegistryKey = Symbol.for(`${GLOBAL_NS}:overflowClipRegistry`)\nconst _onAfterLayoutKey = Symbol.for(`${GLOBAL_NS}:onAfterLayout`)\n\nfunction getOverflowClipRegistry(): ApplyOverflowClip[] {\n return getOrCreateGlobalValue(_overflowClipRegistryKey, () => [])\n}\n\nfunction getOnAfterLayout(): AfterLayoutCallback {\n return getGlobalValue<AfterLayoutCallback>(_onAfterLayoutKey) ?? noopAfterLayout\n}\n\nfunction setOnAfterLayout(fn: AfterLayoutCallback): void {\n setGlobalValue(_onAfterLayoutKey, fn)\n}\n\n/** No-op defaults — renderer must inject real implementations. */\nconst noopAfterLayout: AfterLayoutCallback = () => {}\n\n/**\n * Register a renderer-specific overflow clip implementation.\n * Multiple renderers can each register their own clip; the layout engine\n * tries each one until a handler accepts the container.\n * Prefer this over setApplyOverflowClip for multi-renderer setups.\n */\nexport function registerApplyOverflowClip(fn: ApplyOverflowClip): void {\n getOverflowClipRegistry().push(fn)\n}\n\n/**\n * Replace all registered overflow clip handlers with a single one.\n * For single-renderer setups. Equivalent to clearing the registry and registering one.\n * @deprecated Prefer registerApplyOverflowClip for multi-renderer safety.\n */\nexport function setApplyOverflowClip(fn: ApplyOverflowClip): void {\n const registry = getOverflowClipRegistry()\n registry.length = 0\n registry.push(fn)\n}\n\n/** Inject the renderer-specific after-layout callback (background, hit area). */\nexport function setAfterLayout(fn: AfterLayoutCallback): void {\n setOnAfterLayout(fn)\n}\n\n/**\n * Callback function for deferred layout updates\n * Executed after all layouts are complete in next frame\n */\ntype DeferredUpdateCallback = () => void\n\n/**\n * Central processor for deferred layout updates\n * Collects all updates that require final world coordinates or completed parent layouts\n * Executes them in batch via single requestAnimationFrame for optimal performance\n *\n * Use cases:\n * - Overflow mask positioning (needs world coordinates)\n * - Scroll position updates (needs final content size)\n * - Animation initialization (needs final positions)\n * - Custom effects requiring complete layout\n * - Gesture hit area updates (needs final layout size)\n */\nexport class DeferredLayoutQueue {\n private static callbacks: DeferredUpdateCallback[] = []\n private static scheduled = false\n\n /**\n * Schedule a callback to execute after current layout pass completes\n * All callbacks are batched and executed in single requestAnimationFrame\n * @param callback - Function to execute in next frame\n */\n static defer(callback: DeferredUpdateCallback): void {\n this.callbacks.push(callback)\n\n // Schedule flush if not already scheduled (only 1 requestAnimationFrame per frame)\n if (!this.scheduled) {\n this.scheduled = true\n requestAnimationFrame(() => this.flush())\n }\n }\n\n /**\n * Execute all pending callbacks in batch\n * Called once per frame via requestAnimationFrame\n */\n private static flush(): void {\n this.scheduled = false\n\n // Copy and clear callbacks before execution to prevent infinite loops\n const callbacks = [...this.callbacks]\n this.callbacks = []\n\n // Execute all callbacks with error isolation\n for (const callback of callbacks) {\n try {\n callback()\n } catch (error) {\n DebugLogger.error('DeferredLayoutQueue', 'Error in deferred callback:', error)\n }\n }\n }\n}\n\n/**\n * Entry for batched layout calculation\n */\ninterface LayoutBatchEntry {\n container: LayoutContainer\n containerProps: LayoutProps\n parentSize: { width: number; height: number } | undefined\n parentPadding: { horizontal: number; vertical: number } | undefined\n}\n\n/**\n * Batches layout calculations to reduce redundant recalculations\n * Prevents multiple calculations of same container within single synchronous call stack\n * Does NOT defer to next frame - executes immediately after current stack completes\n *\n * Benefits:\n * - Prevents multiple calculations of same container in one update\n * - Bottom-up execution order prevents redundant parent recalculations\n * - No visual flickering (executes in same frame)\n *\n * Usage:\n * - VDOM patches: LayoutBatchQueue.schedule() instead of direct calculateLayout()\n * - Appliers: LayoutBatchQueue.schedule() instead of direct calculateLayout()\n * - Tests: Set LayoutBatchQueue.synchronous = true for immediate execution\n */\nexport class LayoutBatchQueue {\n private static pending = new Map<LayoutContainer, LayoutBatchEntry>()\n private static scheduled = false\n\n /**\n * Enable synchronous mode for testing\n * When true, layouts execute immediately instead of batching\n */\n static synchronous = false\n\n /**\n * Schedule a layout calculation to execute after current call stack\n * Uses microtask (Promise) instead of requestAnimationFrame to avoid flickering\n * If container is already scheduled, updates entry with latest props\n * @param container - Container to calculate layout for\n * @param containerProps - Layout props\n * @param parentSize - Optional parent size for percentage resolution\n * @param parentPadding - Optional parent padding for fill resolution\n */\n static schedule(\n container: LayoutContainer,\n containerProps: LayoutProps,\n parentSize?: { width: number; height: number },\n parentPadding?: { horizontal: number; vertical: number }\n ): void {\n // Synchronous mode for tests - execute immediately\n if (this.synchronous) {\n calculateLayoutImmediate(container, containerProps, parentSize, parentPadding)\n return\n }\n\n // Update or add entry (latest props win if scheduled multiple times)\n this.pending.set(container, { container, containerProps, parentSize, parentPadding })\n\n // Schedule flush if not already scheduled\n // Use microtask (Promise.resolve) instead of requestAnimationFrame\n // This executes in SAME FRAME after current call stack, preventing flickering\n if (!this.scheduled) {\n this.scheduled = true\n Promise.resolve().then(() => this.flush())\n }\n }\n\n /**\n * Execute all pending layout calculations immediately\n * Processes in bottom-up order (deepest children first)\n * This prevents redundant parent recalculations\n */\n static flush(): void {\n this.scheduled = false\n\n if (this.pending.size === 0) return\n\n DebugLogger.time('performance', 'LayoutBatchQueue.flush')\n\n // Copy and clear pending entries\n const entries = Array.from(this.pending.values())\n this.pending.clear()\n\n // Sort bottom-up (deepest containers first)\n // This ensures children are laid out before parents\n entries.sort((a, b) => {\n const depthA = getContainerDepth(a.container)\n const depthB = getContainerDepth(b.container)\n return depthB - depthA // Higher depth = deeper = execute first\n })\n\n // Execute layout calculations in optimal order\n for (const entry of entries) {\n try {\n // Only calculate if container still exists, is visible, and not destroyed\n const node = entry.container as LayoutContainer & { destroyed?: boolean }\n if (node.destroyed === true) continue\n if (entry.container.visible === false) continue\n calculateLayoutImmediate(\n entry.container,\n entry.containerProps,\n entry.parentSize,\n entry.parentPadding\n )\n } catch (error) {\n DebugLogger.error('LayoutBatchQueue', 'Error calculating layout:', error)\n }\n }\n\n DebugLogger.timeEnd('performance', 'LayoutBatchQueue.flush')\n }\n}\n\n/**\n * Get depth of container in scene hierarchy by walking parent references.\n * Root containers have depth 0, children have depth 1, etc.\n * Requires LayoutNode.parent to be set by the VDOM / mount process.\n * @param container - Container to get depth for\n * @returns Depth level (0 = root)\n */\nfunction getContainerDepth(container: LayoutContainer): number {\n let depth = 0\n let current: LayoutContainer | undefined = getLayoutParent(container)\n\n while (current) {\n depth++\n current = getLayoutParent(current)\n }\n\n return depth\n}\n\nfunction getLayoutParent(container: LayoutContainer): LayoutContainer | undefined {\n if (container.__layoutParent) {\n return container.__layoutParent as LayoutContainer\n }\n\n if (container.parent) {\n return container.parent\n }\n\n // Phaser uses parentContainer instead of the renderer-neutral parent field.\n const parentContainer = (container as Record<string, unknown>).parentContainer\n if (parentContainer && typeof parentContainer === 'object') {\n return parentContainer as LayoutContainer\n }\n\n return undefined\n}\n\n/**\n * Applies overflow clipping via the renderer-injected callback.\n * Each renderer provides its own clipping implementation.\n */\nfunction applyOverflowMask(\n container: LayoutContainer,\n containerProps: LayoutProps & {\n cornerRadius?: number | { tl?: number; tr?: number; bl?: number; br?: number }\n },\n width: number,\n height: number\n): void {\n for (const clip of getOverflowClipRegistry()) {\n clip(container, containerProps, width, height)\n }\n}\n\n/**\n * Strategy map - reusable strategy instances\n */\nconst strategies: Record<string, LayoutStrategy> = {\n column: new ColumnLayoutStrategy(),\n row: new RowLayoutStrategy(),\n stack: new StackLayoutStrategy(),\n}\n\n/**\n * Invalidates parent layout if container size changed after recalculation\n * Propagates layout changes up the hierarchy to ensure parent containers adapt\n * @param container - Container that was just laid out\n * @param oldSize - Size before layout calculation\n * @param newWidth - New width after layout\n * @param newHeight - New height after layout\n */\ntype LayoutSize = { width: number; height: number }\ntype LayoutCycleState = {\n last: LayoutSize\n prev?: LayoutSize\n count: number\n lastTime: number\n}\n\nconst LAYOUT_CYCLE_EPSILON = 0.5\nconst LAYOUT_CYCLE_TIME_MS = 20\nconst LAYOUT_CYCLE_MAX = 5\nconst LAYOUT_MAX_SIZE = 200000\nconst layoutCycleGuard = new WeakMap<LayoutContainer, LayoutCycleState>()\nconst deferredParentInvalidations = new WeakSet<LayoutContainer>()\n\nfunction isCloseSize(a: LayoutSize, b: LayoutSize, epsilon: number): boolean {\n return Math.abs(a.width - b.width) < epsilon && Math.abs(a.height - b.height) < epsilon\n}\n\nfunction invalidateParentLayoutIfNeeded(\n container: LayoutContainer,\n oldSize: { width: number; height: number } | undefined,\n newWidth: number,\n newHeight: number\n): void {\n // Skip if no old size (first layout) or size unchanged\n if (\n !oldSize ||\n (Math.abs(oldSize.width - newWidth) < LAYOUT_CYCLE_EPSILON &&\n Math.abs(oldSize.height - newHeight) < LAYOUT_CYCLE_EPSILON)\n ) {\n return\n }\n\n if (\n !Number.isFinite(newWidth) ||\n !Number.isFinite(newHeight) ||\n newWidth > LAYOUT_MAX_SIZE ||\n newHeight > LAYOUT_MAX_SIZE\n ) {\n DebugLogger.warn('layout', 'Runaway layout size detected, skipping parent invalidation', {\n oldSize,\n newSize: { width: newWidth, height: newHeight },\n containerProps: container.__layoutProps,\n childCount: (container.list as unknown[])?.length ?? 0,\n })\n return\n }\n\n const newSize = { width: newWidth, height: newHeight }\n const now = Date.now()\n\n // Size changed - need to recalculate parent layout\n const parent = getLayoutParent(container) as\n | (LayoutContainer & {\n __layoutProps?: LayoutProps\n __getLayoutSize?: () => { width: number; height: number }\n })\n | undefined\n\n if (!parent || !parent.__layoutProps) {\n return // No layout parent to invalidate\n }\n\n const guard = layoutCycleGuard.get(container)\n if (guard) {\n const repeatsPrev = guard.prev ? isCloseSize(guard.prev, newSize, LAYOUT_CYCLE_EPSILON) : false\n if (repeatsPrev && now - guard.lastTime < LAYOUT_CYCLE_TIME_MS) {\n guard.count += 1\n } else {\n guard.count = 0\n }\n guard.prev = guard.last\n guard.last = newSize\n guard.lastTime = now\n layoutCycleGuard.set(container, guard)\n\n if (guard.count >= LAYOUT_CYCLE_MAX) {\n DebugLogger.log('layout', 'Layout cycle detected, deferring parent invalidation', {\n container,\n oldSize,\n newSize,\n })\n guard.count = 0\n guard.lastTime = 0\n layoutCycleGuard.set(container, guard)\n deferParentLayoutInvalidation(container)\n return\n }\n } else {\n layoutCycleGuard.set(container, {\n last: newSize,\n count: 0,\n lastTime: now,\n })\n }\n\n DebugLogger.log(\n 'layout',\n 'Container size changed, invalidating parent:',\n `${oldSize.width}x${oldSize.height} -> ${newWidth}x${newHeight}`\n )\n invalidateParentLayout(container)\n}\n\nfunction deferParentLayoutInvalidation(container: LayoutContainer): void {\n if (deferredParentInvalidations.has(container)) {\n return\n }\n\n deferredParentInvalidations.add(container)\n DeferredLayoutQueue.defer(() => {\n deferredParentInvalidations.delete(container)\n invalidateParentLayout(container)\n })\n}\n\nfunction invalidateParentLayout(container: LayoutContainer): void {\n const parent = getLayoutParent(container) as\n | (LayoutContainer & {\n __layoutProps?: LayoutProps\n __getLayoutSize?: () => { width: number; height: number }\n })\n | undefined\n\n if (!parent || !parent.__layoutProps) {\n return\n }\n\n const grandParent = getLayoutParent(parent) as\n | (LayoutContainer & {\n __layoutProps?: LayoutProps\n __getLayoutSize?: () => { width: number; height: number }\n })\n | undefined\n\n let grandParentSize: { width: number; height: number } | undefined\n if (grandParent && grandParent.__getLayoutSize) {\n const totalSize = grandParent.__getLayoutSize()\n const padding = (grandParent.__layoutProps?.padding ?? 0) as\n | number\n | { left?: number; right?: number; top?: number; bottom?: number }\n const normPadding =\n typeof padding === 'number'\n ? { left: padding, right: padding, top: padding, bottom: padding }\n : {\n left: padding.left ?? 0,\n right: padding.right ?? 0,\n top: padding.top ?? 0,\n bottom: padding.bottom ?? 0,\n }\n grandParentSize = {\n width: totalSize.width - normPadding.left - normPadding.right,\n height: totalSize.height - normPadding.top - normPadding.bottom,\n }\n }\n\n calculateLayout(parent, parent.__layoutProps, grandParentSize)\n}\n\n/**\n * Calculate layout for a container and its children immediately (internal)\n * DO NOT CALL DIRECTLY - Use calculateLayout() which batches for performance\n * @param container - Phaser container with children\n * @param containerProps - Layout props of the container\n * @param parentSize - Optional parent dimensions for percentage resolution\n * @param parentPadding - Optional parent padding for 'fill' resolution\n */\nfunction calculateLayoutImmediate(\n container: LayoutContainer,\n containerProps: LayoutProps,\n parentSize?: { width: number; height: number },\n parentPadding?: { horizontal: number; vertical: number }\n): void {\n const children = (container.list ?? []) as LayoutContainer[]\n\n // Store old size before layout calculation for parent invalidation\n const containerWithLayout = container as typeof container & {\n __getLayoutSize?: () => { width: number; height: number }\n }\n const oldContainerSize = containerWithLayout.__getLayoutSize?.()\n\n // Debug: Track excessive layout calls\n // console.log('[LAYOUT] calculateLayout called for container with', children?.length ?? 0, 'children')\n\n if (!children || !Array.isArray(children)) {\n return\n }\n\n // Performance timing\n DebugLogger.time('performance', 'calculateLayout')\n\n // 1. Extract layout parameters\n const direction = containerProps.direction ?? 'column'\n const padding = normalizePadding(containerProps.padding)\n const gap = normalizeGap(containerProps.gap)\n const justifyContent = containerProps.justifyContent ?? 'start'\n\n DebugLogger.log('layout', `Direction: ${direction}, Padding:`, padding)\n\n // 2a. Pre-calculate container size if possible (needed for percentage children and nested containers)\n // This allows percentage-based child sizes to resolve correctly and nested containers\n // to receive the correct content-area as their parent size\n let currentContainerSize: { width: number; height: number } | undefined\n\n // Try to calculate width early if we have explicit width or can resolve from parent\n const parsedWidth = parseSize(containerProps.width)\n const canCalculateWidth =\n parsedWidth.type === 'fixed' ||\n (parentSize?.width !== undefined &&\n (parsedWidth.type === 'percent' ||\n parsedWidth.type === 'fill' ||\n parsedWidth.type === 'calc'))\n\n const width = canCalculateWidth\n ? resolveSize(parsedWidth, parentSize?.width, container.width, parentPadding?.horizontal)\n : undefined\n\n // Try to calculate height early if we have explicit height or can resolve from parent\n const parsedHeight = parseSize(containerProps.height)\n const canCalculateHeight =\n parsedHeight.type === 'fixed' ||\n (parentSize?.height !== undefined &&\n (parsedHeight.type === 'percent' ||\n parsedHeight.type === 'fill' ||\n parsedHeight.type === 'calc'))\n\n const height = canCalculateHeight\n ? resolveSize(parsedHeight, parentSize?.height, container.height, parentPadding?.vertical)\n : undefined\n\n // Set currentContainerSize if we could calculate at least one dimension\n if (width !== undefined || height !== undefined) {\n // Apply constraints\n const clampedWidth =\n width !== undefined\n ? clampSize(\n width,\n containerProps.minWidth,\n containerProps.maxWidth,\n parentSize?.width,\n container.width,\n parentPadding?.horizontal\n )\n : (container.width ?? 0)\n const clampedHeight =\n height !== undefined\n ? clampSize(\n height,\n containerProps.minHeight,\n containerProps.maxHeight,\n parentSize?.height,\n container.height,\n parentPadding?.vertical\n )\n : (container.height ?? 0)\n\n currentContainerSize = {\n width: clampedWidth,\n height: clampedHeight,\n }\n }\n\n // Calculate available content size (container minus padding) for child size resolution\n // This allows 'fill' and percentage sizes to resolve correctly relative to content area\n const availableContentSize = currentContainerSize\n ? {\n width: currentContainerSize.width - padding.left - padding.right,\n height: currentContainerSize.height - padding.top - padding.bottom,\n }\n : undefined\n\n DebugLogger.log('layout', 'Pre-calculated container size:', currentContainerSize)\n DebugLogger.log('layout', 'Available content size (for fill):', availableContentSize)\n\n // 2. Prepare layout children (filter backgrounds, headless objects, process nested containers)\n const layoutChildren: LayoutChild[] = []\n\n for (const child of children) {\n // Skip non-layout children (backgrounds, headless objects, missing __getLayoutSize)\n if (!isLayoutChild(child)) {\n DebugLogger.log('layout', 'Skipping non-layout child:', {\n isBackground: child.__isBackground,\n headless: child.__layoutProps?.headless,\n hasLayoutSize: typeof child.__getLayoutSize === 'function',\n })\n continue\n } // Skip processing nested containers with flex (they need parent size first)\n const hasFlex = (child.__layoutProps?.flex ?? 0) > 0\n if (!hasFlex) {\n // Process nested containers - pass content-area (size minus padding) as parent size\n // This ensures nested children see the correct available space\n const parentSizeForNested = currentContainerSize\n ? {\n width: currentContainerSize.width - padding.left - padding.right,\n height: currentContainerSize.height - padding.top - padding.bottom,\n }\n : parentSize\n ? {\n width: parentSize.width - (parentPadding?.horizontal ?? 0),\n height: parentSize.height - (parentPadding?.vertical ?? 0),\n }\n : undefined\n\n processNestedContainer(\n child,\n calculateLayout,\n parentSizeForNested,\n undefined // No padding offset needed since we pass content-area\n )\n }\n\n // Get child size - pass content-area (container size minus padding) for % and fill\n // This way percentages and fill are relative to available content space\n const contentAreaForChild = currentContainerSize\n ? {\n width: currentContainerSize.width - padding.left - padding.right,\n height: currentContainerSize.height - padding.top - padding.bottom,\n }\n : parentSize\n ? {\n width: parentSize.width - (parentPadding?.horizontal ?? 0),\n height: parentSize.height - (parentPadding?.vertical ?? 0),\n }\n : undefined\n\n const size = getChildSize(child, contentAreaForChild, undefined)\n const margin = getMargin(child)\n\n layoutChildren.push({ child, size, margin })\n }\n\n // 3. Select strategy based on direction\n const strategy = strategies[direction]\n if (!strategy) {\n DebugLogger.error('Layout', `Unknown direction: ${direction}`)\n return\n }\n\n // 4. Build layout context (will be used after we know container dimensions)\n const contextPartial = {\n containerProps,\n padding,\n gap,\n children: layoutChildren,\n }\n\n // 5. Calculate metrics using strategy\n const metrics = strategy.calculateMetrics(layoutChildren, contextPartial as LayoutContext)\n\n // 5a. Check if wrapping is enabled\n const flexWrap = containerProps.flexWrap ?? 'nowrap'\n const shouldWrap = flexWrap !== 'nowrap' && direction !== 'stack'\n\n // 6. Calculate container dimensions (with parent size and padding for resolution)\n const { width: containerWidth, height: containerHeight } = calculateContainerSize(\n containerProps,\n metrics,\n padding,\n direction,\n gap,\n layoutChildren.length,\n parentSize,\n parentPadding\n )\n\n // 6a. Distribute flex space if there are flex children (skip if wrapping - will be done per line)\n let finalLayoutChildren = layoutChildren\n if (hasFlexChildren(layoutChildren) && !shouldWrap) {\n const contentSize =\n direction === 'row'\n ? containerWidth - padding.left - padding.right\n : containerHeight - padding.top - padding.bottom\n\n // Subtract gap space (gap appears between children, so n-1 gaps for n children)\n const gapValue = direction === 'row' ? gap.horizontal : gap.vertical\n const totalGapSpace = layoutChildren.length > 1 ? gapValue * (layoutChildren.length - 1) : 0\n const availableMainSpace = contentSize - totalGapSpace\n\n finalLayoutChildren = distributeFlexSpace(layoutChildren, availableMainSpace, direction)\n\n // Process nested flex containers now that they have their size\n for (const layoutChild of finalLayoutChildren) {\n const props = layoutChild.child.__layoutProps\n const isFlexItem =\n (props?.flex !== undefined && props.flex > 0) ||\n props?.flexShrink !== undefined ||\n props?.flexBasis !== undefined\n if (isFlexItem) {\n // Temporarily set explicit size based on flex calculation\n const originalProps = { ...layoutChild.child.__layoutProps }\n if (direction === 'row') {\n layoutChild.child.__layoutProps = {\n ...layoutChild.child.__layoutProps,\n width: layoutChild.size.width,\n }\n } else {\n layoutChild.child.__layoutProps = {\n ...layoutChild.child.__layoutProps,\n height: layoutChild.size.height,\n }\n }\n\n processNestedContainer(\n layoutChild.child,\n calculateLayout,\n {\n width: containerWidth,\n height: containerHeight,\n },\n {\n horizontal: padding.left + padding.right,\n vertical: padding.top + padding.bottom,\n }\n )\n\n // Restore original props\n layoutChild.child.__layoutProps = originalProps\n }\n }\n\n // Recalculate metrics with updated sizes\n const updatedMetrics = strategy.calculateMetrics(\n finalLayoutChildren,\n contextPartial as LayoutContext\n )\n metrics.totalMainSize = updatedMetrics.totalMainSize\n if (direction === 'column') {\n metrics.maxWidth = updatedMetrics.maxWidth\n } else if (direction === 'row') {\n metrics.maxHeight = updatedMetrics.maxHeight\n }\n }\n\n // 7. Calculate content area\n const contentArea = {\n width: containerWidth - padding.left - padding.right,\n height: containerHeight - padding.top - padding.bottom,\n }\n\n // 8. Complete layout context\n const context: LayoutContext = {\n ...contextPartial,\n children: finalLayoutChildren,\n contentArea,\n parentSize: {\n width: containerWidth,\n height: containerHeight,\n },\n }\n\n // 9. Calculate spacing for justifyContent\n const availableMainSpace = direction === 'row' ? contentArea.width : contentArea.height\n // Calculate total gap space (gaps between children, not before first or after last)\n const gapValue = direction === 'row' ? gap.horizontal : gap.vertical\n const totalGapSpace =\n finalLayoutChildren.length > 1 ? gapValue * (finalLayoutChildren.length - 1) : 0\n const remainingSpace = availableMainSpace - metrics.totalMainSize - totalGapSpace\n\n let mainStart = 0\n let spaceBetween = 0\n\n // For stack direction, justifyContent is not applicable\n if (direction !== 'stack') {\n const justifyResult = calculateJustifyContent(\n justifyContent,\n remainingSpace,\n finalLayoutChildren.length\n )\n mainStart = justifyResult.mainStart\n spaceBetween = justifyResult.spaceBetween\n }\n\n // 9a. Apply stretch if alignItems is 'stretch'\n const alignItems = containerProps.alignItems ?? 'start'\n if (alignItems === 'stretch' && direction !== 'stack') {\n for (const layoutChild of finalLayoutChildren) {\n const margin = getMargin(layoutChild.child)\n const child = layoutChild.child\n\n if (direction === 'row') {\n // Stretch height to full cross-axis (minus margins)\n const stretchHeight = contentArea.height - (margin.top ?? 0) - (margin.bottom ?? 0)\n layoutChild.size.height = Math.max(0, stretchHeight)\n\n // If child is a container with layout props, update its height prop and recalculate nested layout\n if (child.__layoutProps) {\n const originalHeight = child.__layoutProps.height\n child.__layoutProps = { ...child.__layoutProps, height: stretchHeight }\n\n // Recalculate nested container layout with new height\n processNestedContainer(child, calculateLayout, {\n width: containerWidth,\n height: containerHeight,\n })\n\n // Restore original height prop (in case it was percentage or undefined)\n child.__layoutProps = { ...child.__layoutProps, height: originalHeight }\n }\n } else if (direction === 'column') {\n // Stretch width to full cross-axis (minus margins)\n const stretchWidth = contentArea.width - (margin.left ?? 0) - (margin.right ?? 0)\n layoutChild.size.width = Math.max(0, stretchWidth)\n\n // If child is a container with layout props, update its width prop and recalculate nested layout\n if (child.__layoutProps) {\n const originalWidth = child.__layoutProps.width\n child.__layoutProps = { ...child.__layoutProps, width: stretchWidth }\n\n // Recalculate nested container layout with new width\n processNestedContainer(child, calculateLayout, {\n width: containerWidth,\n height: containerHeight,\n })\n\n // Restore original width prop (in case it was percentage or undefined)\n child.__layoutProps = { ...child.__layoutProps, width: originalWidth }\n }\n }\n }\n }\n\n // 10. Handle wrapping if enabled\n const positions: Position[] = []\n let adjustedContainerWidth = containerWidth\n let adjustedContainerHeight = containerHeight\n\n if (shouldWrap && 'wrapChildren' in strategy) {\n // Wrap children into multiple lines\n const availableMainSize = direction === 'row' ? contentArea.width : contentArea.height\n const mainGapValue = direction === 'row' ? gap.horizontal : gap.vertical\n const lines = (strategy as RowLayoutStrategy | ColumnLayoutStrategy).wrapChildren(\n finalLayoutChildren,\n availableMainSize,\n mainGapValue\n )\n\n if (flexWrap === 'wrap-reverse') {\n lines.reverse()\n }\n\n // Calculate total cross size needed for all lines\n const totalCrossSize = lines.reduce(\n (sum: number, line: LayoutLine) => sum + line.crossAxisSize,\n 0\n )\n const crossGapValue = direction === 'row' ? gap.vertical : gap.horizontal\n const totalLineGaps = (lines.length - 1) * crossGapValue\n\n // Adjust container dimensions if auto-sizing and wrapping occurred\n if (\n direction === 'row' &&\n (containerProps.height === undefined || containerProps.height === 'auto')\n ) {\n // For row direction with auto-height, calculate height based on wrapped lines\n adjustedContainerHeight = totalCrossSize + totalLineGaps + padding.top + padding.bottom\n } else if (\n direction === 'column' &&\n (containerProps.width === undefined || containerProps.width === 'auto')\n ) {\n // For column direction with auto-width, calculate width based on wrapped lines\n adjustedContainerWidth = totalCrossSize + totalLineGaps + padding.left + padding.right\n }\n\n const availableCrossSize = direction === 'row' ? contentArea.height : contentArea.width\n const freeCrossSpace = availableCrossSize - totalCrossSize - totalLineGaps\n\n // Apply alignContent to distribute lines\n const alignContent = containerProps.alignContent ?? 'stretch'\n let crossOffset = 0\n let lineCrossSpacing = 0\n\n if (alignContent === 'center') {\n crossOffset = freeCrossSpace / 2\n } else if (alignContent === 'end') {\n crossOffset = freeCrossSpace\n } else if (alignContent === 'space-between' && lines.length > 1) {\n lineCrossSpacing = freeCrossSpace / (lines.length - 1)\n } else if (alignContent === 'space-around') {\n lineCrossSpacing = freeCrossSpace / lines.length\n crossOffset = lineCrossSpacing / 2\n }\n\n // Position children line by line\n for (const line of lines) {\n // Apply flex distribution per line if line has flex children\n let lineChildren = line.children\n if (hasFlexChildren(line.children)) {\n const lineGapSpace = (line.children.length - 1) * mainGapValue\n const lineAvailableSpace = availableMainSize - lineGapSpace\n lineChildren = distributeFlexSpace(line.children, lineAvailableSpace, direction)\n\n // Update line main size after flex distribution\n line.mainAxisSize = lineChildren.reduce((sum: number, child: LayoutChild) => {\n const size = direction === 'row' ? child.size.width : child.size.height\n const margin = getMargin(child.child)\n const marginSize =\n direction === 'row'\n ? (margin.left ?? 0) + (margin.right ?? 0)\n : (margin.top ?? 0) + (margin.bottom ?? 0)\n return sum + size + marginSize\n }, 0)\n }\n\n // Calculate line-specific justifyContent\n const lineMainSize = line.mainAxisSize\n const lineAvailableMain = availableMainSize\n const lineRemainingSpace = lineAvailableMain - lineMainSize\n const lineGapSpace = (line.children.length - 1) * mainGapValue\n const lineFreeSpace = lineRemainingSpace - lineGapSpace\n\n const lineJustifyResult = calculateJustifyContent(\n justifyContent,\n lineFreeSpace,\n line.children.length\n )\n\n let lineMainOffset = lineJustifyResult.mainStart\n const lineSpaceBetween = lineJustifyResult.spaceBetween\n\n // Position each child in the line\n for (let i = 0; i < lineChildren.length; i++) {\n const child = lineChildren[i]\n if (!child) continue\n\n const margin = getMargin(child.child)\n\n let x: number\n let y: number\n\n if (direction === 'row') {\n // Main axis: horizontal\n lineMainOffset += margin.left ?? 0\n x = padding.left + lineMainOffset\n\n // Cross axis: vertical\n const childCrossOffset = calculateAlignItems(\n alignItems,\n line.crossAxisSize,\n child.size.height,\n margin.top ?? 0,\n margin.bottom ?? 0\n )\n y = padding.top + crossOffset + childCrossOffset\n\n lineMainOffset += child.size.width + (margin.right ?? 0)\n if (i < lineChildren.length - 1) {\n lineMainOffset += mainGapValue + lineSpaceBetween\n }\n } else {\n // Main axis: vertical\n lineMainOffset += margin.top ?? 0\n y = padding.top + lineMainOffset\n\n // Cross axis: horizontal\n const childCrossOffset = calculateAlignItems(\n alignItems,\n line.crossAxisSize,\n child.size.width,\n margin.left ?? 0,\n margin.right ?? 0\n )\n x = padding.left + crossOffset + childCrossOffset\n\n lineMainOffset += child.size.height + (margin.bottom ?? 0)\n if (i < lineChildren.length - 1) {\n lineMainOffset += mainGapValue + lineSpaceBetween\n }\n }\n\n // Find child index in original array for correct position assignment\n const childIndex = finalLayoutChildren.indexOf(child)\n if (childIndex !== -1) {\n positions[childIndex] = { x, y }\n }\n }\n\n // Move to next line\n crossOffset += line.crossAxisSize + crossGapValue + lineCrossSpacing\n }\n } else {\n // No wrapping - use original single-line positioning\n let currentMain = mainStart\n\n for (let i = 0; i < finalLayoutChildren.length; i++) {\n const child = finalLayoutChildren[i]\n if (!child) continue\n\n const result = strategy.positionChild(child, i, context, currentMain)\n\n positions.push(result.position)\n currentMain = result.nextMain\n\n // Add gap and space-between spacing (not for stack)\n if (direction !== 'stack' && i < finalLayoutChildren.length - 1) {\n currentMain += gapValue + spaceBetween\n }\n }\n }\n\n // 11. Apply positions to children\n applyChildPositions(finalLayoutChildren, positions)\n\n // 12. Apply container dimensions (use adjusted dimensions if wrapping changed them)\n applyContainerDimensions(container, adjustedContainerWidth, adjustedContainerHeight)\n\n // 13. Invoke after-layout callback (renderer-specific: background, hit area)\n getOnAfterLayout()(container, adjustedContainerWidth, adjustedContainerHeight)\n\n // 14. Apply overflow mask if needed\n applyOverflowMask(container, containerProps, adjustedContainerWidth, adjustedContainerHeight)\n\n // End performance timing\n DebugLogger.timeEnd('performance', 'calculateLayout')\n\n // 15. Propagate layout changes to parent if size changed\n // This ensures parent containers resize when child content changes\n invalidateParentLayoutIfNeeded(\n container,\n oldContainerSize,\n adjustedContainerWidth,\n adjustedContainerHeight\n )\n}\n\n/**\n * Calculate layout for a container and its children\n * Batches layout calculations for optimal performance\n * Multiple calls within same frame are deduplicated and executed bottom-up\n * @param container - Phaser container with children\n * @param containerProps - Layout props of the container\n * @param parentSize - Optional parent dimensions for percentage resolution\n * @param parentPadding - Optional parent padding for 'fill' resolution\n */\n/**\n * Main entry point for layout calculation.\n *\n * @param container - Container node to layout (satisfies LayoutContainer via duck-typing)\n * @param containerProps - Layout properties\n * @param parentSize - Parent dimensions for percentage/fill resolution (optional)\n * @param parentPadding - Parent padding for fill resolution (optional)\n *\n * @migration(audit:scene-portal-mount) Phase 2 — LayoutContainer replaces Phaser.GameObjects.Container\n */\nexport function calculateLayout(\n container: LayoutContainer,\n containerProps: LayoutProps,\n parentSize?: { width: number; height: number },\n parentPadding?: { horizontal: number; vertical: number }\n): void {\n LayoutBatchQueue.schedule(container, containerProps, parentSize, parentPadding)\n}\n"],"names":["getOrCreateGlobalValue","getGlobalValue","setGlobalValue","DebugLogger","ColumnLayoutStrategy","RowLayoutStrategy","StackLayoutStrategy","normalizePadding","normalizeGap","parseSize","resolveSize","clampSize","isLayoutChild","processNestedContainer","getChildSize","getMargin","calculateContainerSize","hasFlexChildren","gapValue","totalGapSpace","availableMainSpace","distributeFlexSpace","calculateJustifyContent","lineGapSpace","calculateAlignItems","applyChildPositions","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from './types';
3
+ /**
4
+ * Callback to apply overflow clipping on a container.
5
+ * Each renderer implements its own clipping mechanism (e.g., stencil buffer, scissor rect).
6
+ */
7
+ export type ApplyOverflowClip = (container: LayoutContainer, containerProps: LayoutProps & {
8
+ cornerRadius?: number | {
9
+ tl?: number;
10
+ tr?: number;
11
+ bl?: number;
12
+ br?: number;
13
+ };
14
+ }, width: number, height: number) => void;
15
+ /**
16
+ * Callback invoked after layout dimensions are applied.
17
+ * Used for renderer-specific post-layout operations (background drawing, hit areas).
18
+ */
19
+ export type AfterLayoutCallback = (container: LayoutContainer, width: number, height: number) => void;
20
+ /**
21
+ * Register a renderer-specific overflow clip implementation.
22
+ * Multiple renderers can each register their own clip; the layout engine
23
+ * tries each one until a handler accepts the container.
24
+ * Prefer this over setApplyOverflowClip for multi-renderer setups.
25
+ */
26
+ export declare function registerApplyOverflowClip(fn: ApplyOverflowClip): void;
27
+ /**
28
+ * Replace all registered overflow clip handlers with a single one.
29
+ * For single-renderer setups. Equivalent to clearing the registry and registering one.
30
+ * @deprecated Prefer registerApplyOverflowClip for multi-renderer safety.
31
+ */
32
+ export declare function setApplyOverflowClip(fn: ApplyOverflowClip): void;
33
+ /** Inject the renderer-specific after-layout callback (background, hit area). */
34
+ export declare function setAfterLayout(fn: AfterLayoutCallback): void;
35
+ /**
36
+ * Callback function for deferred layout updates
37
+ * Executed after all layouts are complete in next frame
38
+ */
39
+ type DeferredUpdateCallback = () => void;
40
+ /**
41
+ * Central processor for deferred layout updates
42
+ * Collects all updates that require final world coordinates or completed parent layouts
43
+ * Executes them in batch via single requestAnimationFrame for optimal performance
44
+ *
45
+ * Use cases:
46
+ * - Overflow mask positioning (needs world coordinates)
47
+ * - Scroll position updates (needs final content size)
48
+ * - Animation initialization (needs final positions)
49
+ * - Custom effects requiring complete layout
50
+ * - Gesture hit area updates (needs final layout size)
51
+ */
52
+ export declare class DeferredLayoutQueue {
53
+ private static callbacks;
54
+ private static scheduled;
55
+ /**
56
+ * Schedule a callback to execute after current layout pass completes
57
+ * All callbacks are batched and executed in single requestAnimationFrame
58
+ * @param callback - Function to execute in next frame
59
+ */
60
+ static defer(callback: DeferredUpdateCallback): void;
61
+ /**
62
+ * Execute all pending callbacks in batch
63
+ * Called once per frame via requestAnimationFrame
64
+ */
65
+ private static flush;
66
+ }
67
+ /**
68
+ * Batches layout calculations to reduce redundant recalculations
69
+ * Prevents multiple calculations of same container within single synchronous call stack
70
+ * Does NOT defer to next frame - executes immediately after current stack completes
71
+ *
72
+ * Benefits:
73
+ * - Prevents multiple calculations of same container in one update
74
+ * - Bottom-up execution order prevents redundant parent recalculations
75
+ * - No visual flickering (executes in same frame)
76
+ *
77
+ * Usage:
78
+ * - VDOM patches: LayoutBatchQueue.schedule() instead of direct calculateLayout()
79
+ * - Appliers: LayoutBatchQueue.schedule() instead of direct calculateLayout()
80
+ * - Tests: Set LayoutBatchQueue.synchronous = true for immediate execution
81
+ */
82
+ export declare class LayoutBatchQueue {
83
+ private static pending;
84
+ private static scheduled;
85
+ /**
86
+ * Enable synchronous mode for testing
87
+ * When true, layouts execute immediately instead of batching
88
+ */
89
+ static synchronous: boolean;
90
+ /**
91
+ * Schedule a layout calculation to execute after current call stack
92
+ * Uses microtask (Promise) instead of requestAnimationFrame to avoid flickering
93
+ * If container is already scheduled, updates entry with latest props
94
+ * @param container - Container to calculate layout for
95
+ * @param containerProps - Layout props
96
+ * @param parentSize - Optional parent size for percentage resolution
97
+ * @param parentPadding - Optional parent padding for fill resolution
98
+ */
99
+ static schedule(container: LayoutContainer, containerProps: LayoutProps, parentSize?: {
100
+ width: number;
101
+ height: number;
102
+ }, parentPadding?: {
103
+ horizontal: number;
104
+ vertical: number;
105
+ }): void;
106
+ /**
107
+ * Execute all pending layout calculations immediately
108
+ * Processes in bottom-up order (deepest children first)
109
+ * This prevents redundant parent recalculations
110
+ */
111
+ static flush(): void;
112
+ }
113
+ /**
114
+ * Calculate layout for a container and its children
115
+ * Batches layout calculations for optimal performance
116
+ * Multiple calls within same frame are deduplicated and executed bottom-up
117
+ * @param container - Phaser container with children
118
+ * @param containerProps - Layout props of the container
119
+ * @param parentSize - Optional parent dimensions for percentage resolution
120
+ * @param parentPadding - Optional parent padding for 'fill' resolution
121
+ */
122
+ /**
123
+ * Main entry point for layout calculation.
124
+ *
125
+ * @param container - Container node to layout (satisfies LayoutContainer via duck-typing)
126
+ * @param containerProps - Layout properties
127
+ * @param parentSize - Parent dimensions for percentage/fill resolution (optional)
128
+ * @param parentPadding - Parent padding for fill resolution (optional)
129
+ *
130
+ * @migration(audit:scene-portal-mount) Phase 2 — LayoutContainer replaces Phaser.GameObjects.Container
131
+ */
132
+ export declare function calculateLayout(container: LayoutContainer, containerProps: LayoutProps, parentSize?: {
133
+ width: number;
134
+ height: number;
135
+ }, parentPadding?: {
136
+ horizontal: number;
137
+ vertical: number;
138
+ }): void;
139
+ export {};
140
+ //# sourceMappingURL=layout-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-engine.d.ts","sourceRoot":"","sources":["../../src/layout/layout-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAUhD,OAAO,KAAK,EAAe,eAAe,EAAuC,MAAM,SAAS,CAAA;AAWhG;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC9B,SAAS,EAAE,eAAe,EAC1B,cAAc,EAAE,WAAW,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/E,EACD,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,KACX,IAAI,CAAA;AAET;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,SAAS,EAAE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