@number10/phaserjsx 0.1.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 (326) hide show
  1. package/LICENSE +667 -0
  2. package/README.md +238 -0
  3. package/dist/TransformOriginView-BYPbRH8N.cjs +17045 -0
  4. package/dist/TransformOriginView-BYPbRH8N.cjs.map +1 -0
  5. package/dist/TransformOriginView-CO-tJCmV.js +17046 -0
  6. package/dist/TransformOriginView-CO-tJCmV.js.map +1 -0
  7. package/dist/animation/animated-signal.d.ts +35 -0
  8. package/dist/animation/animated-signal.d.ts.map +1 -0
  9. package/dist/animation/index.d.ts +7 -0
  10. package/dist/animation/index.d.ts.map +1 -0
  11. package/dist/animation/spring-physics.d.ts +120 -0
  12. package/dist/animation/spring-physics.d.ts.map +1 -0
  13. package/dist/animation/useSpring.d.ts +54 -0
  14. package/dist/animation/useSpring.d.ts.map +1 -0
  15. package/dist/colors/color-presets.d.ts +89 -0
  16. package/dist/colors/color-presets.d.ts.map +1 -0
  17. package/dist/colors/color-theme-helpers.d.ts +65 -0
  18. package/dist/colors/color-theme-helpers.d.ts.map +1 -0
  19. package/dist/colors/color-types.d.ts +100 -0
  20. package/dist/colors/color-types.d.ts.map +1 -0
  21. package/dist/colors/color-utils.d.ts +171 -0
  22. package/dist/colors/color-utils.d.ts.map +1 -0
  23. package/dist/colors/index.d.ts +17 -0
  24. package/dist/colors/index.d.ts.map +1 -0
  25. package/dist/colors/preset-manager.d.ts +35 -0
  26. package/dist/colors/preset-manager.d.ts.map +1 -0
  27. package/dist/colors/use-color-mode.d.ts +22 -0
  28. package/dist/colors/use-color-mode.d.ts.map +1 -0
  29. package/dist/colors/use-colors.d.ts +40 -0
  30. package/dist/colors/use-colors.d.ts.map +1 -0
  31. package/dist/components/appliers/applyBackground.d.ts +13 -0
  32. package/dist/components/appliers/applyBackground.d.ts.map +1 -0
  33. package/dist/components/appliers/applyGestures.d.ts +12 -0
  34. package/dist/components/appliers/applyGestures.d.ts.map +1 -0
  35. package/dist/components/appliers/applyGraphics.d.ts +10 -0
  36. package/dist/components/appliers/applyGraphics.d.ts.map +1 -0
  37. package/dist/components/appliers/applyGraphicsLayout.d.ts +10 -0
  38. package/dist/components/appliers/applyGraphicsLayout.d.ts.map +1 -0
  39. package/dist/components/appliers/applyImage.d.ts +10 -0
  40. package/dist/components/appliers/applyImage.d.ts.map +1 -0
  41. package/dist/components/appliers/applyImageLayout.d.ts +15 -0
  42. package/dist/components/appliers/applyImageLayout.d.ts.map +1 -0
  43. package/dist/components/appliers/applyLayout.d.ts +15 -0
  44. package/dist/components/appliers/applyLayout.d.ts.map +1 -0
  45. package/dist/components/appliers/applyNineSlice.d.ts +11 -0
  46. package/dist/components/appliers/applyNineSlice.d.ts.map +1 -0
  47. package/dist/components/appliers/applyNineSliceLayout.d.ts +15 -0
  48. package/dist/components/appliers/applyNineSliceLayout.d.ts.map +1 -0
  49. package/dist/components/appliers/applyPhaser.d.ts +22 -0
  50. package/dist/components/appliers/applyPhaser.d.ts.map +1 -0
  51. package/dist/components/appliers/applySprite.d.ts +10 -0
  52. package/dist/components/appliers/applySprite.d.ts.map +1 -0
  53. package/dist/components/appliers/applySpriteLayout.d.ts +14 -0
  54. package/dist/components/appliers/applySpriteLayout.d.ts.map +1 -0
  55. package/dist/components/appliers/applyText.d.ts +25 -0
  56. package/dist/components/appliers/applyText.d.ts.map +1 -0
  57. package/dist/components/appliers/applyTextLayout.d.ts +15 -0
  58. package/dist/components/appliers/applyTextLayout.d.ts.map +1 -0
  59. package/dist/components/appliers/applyTooltip.d.ts +12 -0
  60. package/dist/components/appliers/applyTooltip.d.ts.map +1 -0
  61. package/dist/components/appliers/applyTransform.d.ts +21 -0
  62. package/dist/components/appliers/applyTransform.d.ts.map +1 -0
  63. package/dist/components/creators/createBackground.d.ts +15 -0
  64. package/dist/components/creators/createBackground.d.ts.map +1 -0
  65. package/dist/components/creators/createGestures.d.ts +11 -0
  66. package/dist/components/creators/createGestures.d.ts.map +1 -0
  67. package/dist/components/creators/createGraphicsLayout.d.ts +9 -0
  68. package/dist/components/creators/createGraphicsLayout.d.ts.map +1 -0
  69. package/dist/components/creators/createImageLayout.d.ts +14 -0
  70. package/dist/components/creators/createImageLayout.d.ts.map +1 -0
  71. package/dist/components/creators/createLayout.d.ts +15 -0
  72. package/dist/components/creators/createLayout.d.ts.map +1 -0
  73. package/dist/components/creators/createNineSliceLayout.d.ts +14 -0
  74. package/dist/components/creators/createNineSliceLayout.d.ts.map +1 -0
  75. package/dist/components/creators/createPhaser.d.ts +14 -0
  76. package/dist/components/creators/createPhaser.d.ts.map +1 -0
  77. package/dist/components/creators/createSpriteLayout.d.ts +15 -0
  78. package/dist/components/creators/createSpriteLayout.d.ts.map +1 -0
  79. package/dist/components/creators/createTextLayout.d.ts +14 -0
  80. package/dist/components/creators/createTextLayout.d.ts.map +1 -0
  81. package/dist/components/creators/createTransform.d.ts +11 -0
  82. package/dist/components/creators/createTransform.d.ts.map +1 -0
  83. package/dist/components/custom/Accordion.d.ts +34 -0
  84. package/dist/components/custom/Accordion.d.ts.map +1 -0
  85. package/dist/components/custom/AlertDialog.d.ts +63 -0
  86. package/dist/components/custom/AlertDialog.d.ts.map +1 -0
  87. package/dist/components/custom/Button.d.ts +44 -0
  88. package/dist/components/custom/Button.d.ts.map +1 -0
  89. package/dist/components/custom/CharText/CharText.d.ts +8 -0
  90. package/dist/components/custom/CharText/CharText.d.ts.map +1 -0
  91. package/dist/components/custom/CharText/index.d.ts +3 -0
  92. package/dist/components/custom/CharText/index.d.ts.map +1 -0
  93. package/dist/components/custom/CharText/types.d.ts +117 -0
  94. package/dist/components/custom/CharText/types.d.ts.map +1 -0
  95. package/dist/components/custom/CharText/utils.d.ts +34 -0
  96. package/dist/components/custom/CharText/utils.d.ts.map +1 -0
  97. package/dist/components/custom/CharTextInput.d.ts +62 -0
  98. package/dist/components/custom/CharTextInput.d.ts.map +1 -0
  99. package/dist/components/custom/Dialog.d.ts +60 -0
  100. package/dist/components/custom/Dialog.d.ts.map +1 -0
  101. package/dist/components/custom/Divider.d.ts +21 -0
  102. package/dist/components/custom/Divider.d.ts.map +1 -0
  103. package/dist/components/custom/Dropdown.d.ts +91 -0
  104. package/dist/components/custom/Dropdown.d.ts.map +1 -0
  105. package/dist/components/custom/Icon.d.ts +75 -0
  106. package/dist/components/custom/Icon.d.ts.map +1 -0
  107. package/dist/components/custom/Image.d.ts +50 -0
  108. package/dist/components/custom/Image.d.ts.map +1 -0
  109. package/dist/components/custom/Modal.d.ts +37 -0
  110. package/dist/components/custom/Modal.d.ts.map +1 -0
  111. package/dist/components/custom/NineSlice.d.ts +81 -0
  112. package/dist/components/custom/NineSlice.d.ts.map +1 -0
  113. package/dist/components/custom/NineSliceButton.d.ts +128 -0
  114. package/dist/components/custom/NineSliceButton.d.ts.map +1 -0
  115. package/dist/components/custom/Portal.d.ts +43 -0
  116. package/dist/components/custom/Portal.d.ts.map +1 -0
  117. package/dist/components/custom/Portal.test.d.ts +2 -0
  118. package/dist/components/custom/Portal.test.d.ts.map +1 -0
  119. package/dist/components/custom/RadioButton.d.ts +20 -0
  120. package/dist/components/custom/RadioButton.d.ts.map +1 -0
  121. package/dist/components/custom/RadioGroup.d.ts +33 -0
  122. package/dist/components/custom/RadioGroup.d.ts.map +1 -0
  123. package/dist/components/custom/RefOriginView.d.ts +45 -0
  124. package/dist/components/custom/RefOriginView.d.ts.map +1 -0
  125. package/dist/components/custom/ScrollSlider.d.ts +36 -0
  126. package/dist/components/custom/ScrollSlider.d.ts.map +1 -0
  127. package/dist/components/custom/ScrollView.d.ts +48 -0
  128. package/dist/components/custom/ScrollView.d.ts.map +1 -0
  129. package/dist/components/custom/Sidebar.d.ts +50 -0
  130. package/dist/components/custom/Sidebar.d.ts.map +1 -0
  131. package/dist/components/custom/Slider.d.ts +131 -0
  132. package/dist/components/custom/Slider.d.ts.map +1 -0
  133. package/dist/components/custom/Text.d.ts +26 -0
  134. package/dist/components/custom/Text.d.ts.map +1 -0
  135. package/dist/components/custom/Toggle.d.ts +51 -0
  136. package/dist/components/custom/Toggle.d.ts.map +1 -0
  137. package/dist/components/custom/TransformOriginView.d.ts +34 -0
  138. package/dist/components/custom/TransformOriginView.d.ts.map +1 -0
  139. package/dist/components/custom/View.d.ts +33 -0
  140. package/dist/components/custom/View.d.ts.map +1 -0
  141. package/dist/components/custom/WrapText.d.ts +60 -0
  142. package/dist/components/custom/WrapText.d.ts.map +1 -0
  143. package/dist/components/custom/index.cjs +32 -0
  144. package/dist/components/custom/index.cjs.map +1 -0
  145. package/dist/components/custom/index.d.ts +29 -0
  146. package/dist/components/custom/index.d.ts.map +1 -0
  147. package/dist/components/custom/index.js +32 -0
  148. package/dist/components/custom/index.js.map +1 -0
  149. package/dist/components/index.d.ts +28 -0
  150. package/dist/components/index.d.ts.map +1 -0
  151. package/dist/components/internal/SceneWrapper.d.ts +20 -0
  152. package/dist/components/internal/SceneWrapper.d.ts.map +1 -0
  153. package/dist/components/primitives/graphics.d.ts +40 -0
  154. package/dist/components/primitives/graphics.d.ts.map +1 -0
  155. package/dist/components/primitives/image.d.ts +45 -0
  156. package/dist/components/primitives/image.d.ts.map +1 -0
  157. package/dist/components/primitives/nineslice.d.ts +111 -0
  158. package/dist/components/primitives/nineslice.d.ts.map +1 -0
  159. package/dist/components/primitives/sprite.d.ts +58 -0
  160. package/dist/components/primitives/sprite.d.ts.map +1 -0
  161. package/dist/components/primitives/text.d.ts +26 -0
  162. package/dist/components/primitives/text.d.ts.map +1 -0
  163. package/dist/components/primitives/tilesprite.d.ts +47 -0
  164. package/dist/components/primitives/tilesprite.d.ts.map +1 -0
  165. package/dist/components/primitives/view.d.ts +23 -0
  166. package/dist/components/primitives/view.d.ts.map +1 -0
  167. package/dist/core-props.d.ts +605 -0
  168. package/dist/core-props.d.ts.map +1 -0
  169. package/dist/core-types.d.ts +59 -0
  170. package/dist/core-types.d.ts.map +1 -0
  171. package/dist/design-tokens/design-token-presets.d.ts +26 -0
  172. package/dist/design-tokens/design-token-presets.d.ts.map +1 -0
  173. package/dist/design-tokens/design-token-types.d.ts +109 -0
  174. package/dist/design-tokens/design-token-types.d.ts.map +1 -0
  175. package/dist/design-tokens/index.d.ts +8 -0
  176. package/dist/design-tokens/index.d.ts.map +1 -0
  177. package/dist/design-tokens/use-theme-tokens.d.ts +28 -0
  178. package/dist/design-tokens/use-theme-tokens.d.ts.map +1 -0
  179. package/dist/dev-config.d.ts +238 -0
  180. package/dist/dev-config.d.ts.map +1 -0
  181. package/dist/effects/effect-registry.d.ts +54 -0
  182. package/dist/effects/effect-registry.d.ts.map +1 -0
  183. package/dist/effects/index.d.ts +56 -0
  184. package/dist/effects/index.d.ts.map +1 -0
  185. package/dist/effects/use-effect.d.ts +172 -0
  186. package/dist/effects/use-effect.d.ts.map +1 -0
  187. package/dist/fx/convenience-hooks/index.d.ts +7 -0
  188. package/dist/fx/convenience-hooks/index.d.ts.map +1 -0
  189. package/dist/fx/convenience-hooks/use-blur.d.ts +21 -0
  190. package/dist/fx/convenience-hooks/use-blur.d.ts.map +1 -0
  191. package/dist/fx/convenience-hooks/use-glow.d.ts +21 -0
  192. package/dist/fx/convenience-hooks/use-glow.d.ts.map +1 -0
  193. package/dist/fx/convenience-hooks/use-shadow.d.ts +21 -0
  194. package/dist/fx/convenience-hooks/use-shadow.d.ts.map +1 -0
  195. package/dist/fx/fx-creators/blur.d.ts +37 -0
  196. package/dist/fx/fx-creators/blur.d.ts.map +1 -0
  197. package/dist/fx/fx-creators/color-matrix.d.ts +31 -0
  198. package/dist/fx/fx-creators/color-matrix.d.ts.map +1 -0
  199. package/dist/fx/fx-creators/glow.d.ts +36 -0
  200. package/dist/fx/fx-creators/glow.d.ts.map +1 -0
  201. package/dist/fx/fx-creators/index.d.ts +10 -0
  202. package/dist/fx/fx-creators/index.d.ts.map +1 -0
  203. package/dist/fx/fx-creators/pixelate.d.ts +24 -0
  204. package/dist/fx/fx-creators/pixelate.d.ts.map +1 -0
  205. package/dist/fx/fx-creators/shadow.d.ts +43 -0
  206. package/dist/fx/fx-creators/shadow.d.ts.map +1 -0
  207. package/dist/fx/fx-creators/vignette.d.ts +33 -0
  208. package/dist/fx/fx-creators/vignette.d.ts.map +1 -0
  209. package/dist/fx/fx-registry.d.ts +59 -0
  210. package/dist/fx/fx-registry.d.ts.map +1 -0
  211. package/dist/fx/index.d.ts +51 -0
  212. package/dist/fx/index.d.ts.map +1 -0
  213. package/dist/fx/use-fx.d.ts +53 -0
  214. package/dist/fx/use-fx.d.ts.map +1 -0
  215. package/dist/gestures/gesture-manager.d.ts +149 -0
  216. package/dist/gestures/gesture-manager.d.ts.map +1 -0
  217. package/dist/gestures/gesture-types.d.ts +229 -0
  218. package/dist/gestures/gesture-types.d.ts.map +1 -0
  219. package/dist/hooks-svg.d.ts +104 -0
  220. package/dist/hooks-svg.d.ts.map +1 -0
  221. package/dist/hooks.d.ts +135 -0
  222. package/dist/hooks.d.ts.map +1 -0
  223. package/dist/host.d.ts +74 -0
  224. package/dist/host.d.ts.map +1 -0
  225. package/dist/index.cjs +584 -0
  226. package/dist/index.cjs.map +1 -0
  227. package/dist/index.d.ts +34 -0
  228. package/dist/index.d.ts.map +1 -0
  229. package/dist/index.js +582 -0
  230. package/dist/index.js.map +1 -0
  231. package/dist/jsx-dev-runtime.cjs +10 -0
  232. package/dist/jsx-dev-runtime.cjs.map +1 -0
  233. package/dist/jsx-dev-runtime.d.ts +5 -0
  234. package/dist/jsx-dev-runtime.d.ts.map +1 -0
  235. package/dist/jsx-dev-runtime.js +11 -0
  236. package/dist/jsx-dev-runtime.js.map +1 -0
  237. package/dist/jsx-runtime.cjs +43 -0
  238. package/dist/jsx-runtime.cjs.map +1 -0
  239. package/dist/jsx-runtime.d.ts +25 -0
  240. package/dist/jsx-runtime.d.ts.map +1 -0
  241. package/dist/jsx-runtime.js +43 -0
  242. package/dist/jsx-runtime.js.map +1 -0
  243. package/dist/jsx-types.d.ts +33 -0
  244. package/dist/jsx-types.d.ts.map +1 -0
  245. package/dist/layout/appliers/background-applier.d.ts +16 -0
  246. package/dist/layout/appliers/background-applier.d.ts.map +1 -0
  247. package/dist/layout/appliers/container-applier.d.ts +9 -0
  248. package/dist/layout/appliers/container-applier.d.ts.map +1 -0
  249. package/dist/layout/appliers/position-applier.d.ts +8 -0
  250. package/dist/layout/appliers/position-applier.d.ts.map +1 -0
  251. package/dist/layout/index.d.ts +22 -0
  252. package/dist/layout/index.d.ts.map +1 -0
  253. package/dist/layout/layout-engine-test-utils.d.ts +19 -0
  254. package/dist/layout/layout-engine-test-utils.d.ts.map +1 -0
  255. package/dist/layout/layout-engine.d.ts +98 -0
  256. package/dist/layout/layout-engine.d.ts.map +1 -0
  257. package/dist/layout/strategies/base-strategy.d.ts +59 -0
  258. package/dist/layout/strategies/base-strategy.d.ts.map +1 -0
  259. package/dist/layout/strategies/column-layout.d.ts +38 -0
  260. package/dist/layout/strategies/column-layout.d.ts.map +1 -0
  261. package/dist/layout/strategies/row-layout.d.ts +38 -0
  262. package/dist/layout/strategies/row-layout.d.ts.map +1 -0
  263. package/dist/layout/strategies/stack-layout.d.ts +30 -0
  264. package/dist/layout/strategies/stack-layout.d.ts.map +1 -0
  265. package/dist/layout/types.d.ts +137 -0
  266. package/dist/layout/types.d.ts.map +1 -0
  267. package/dist/layout/utils/child-utils.d.ts +74 -0
  268. package/dist/layout/utils/child-utils.d.ts.map +1 -0
  269. package/dist/layout/utils/dimension-calculator.d.ts +59 -0
  270. package/dist/layout/utils/dimension-calculator.d.ts.map +1 -0
  271. package/dist/layout/utils/flex-distributor.d.ts +18 -0
  272. package/dist/layout/utils/flex-distributor.d.ts.map +1 -0
  273. package/dist/layout/utils/size-resolver.d.ts +84 -0
  274. package/dist/layout/utils/size-resolver.d.ts.map +1 -0
  275. package/dist/layout/utils/spacing-calculator.d.ts +27 -0
  276. package/dist/layout/utils/spacing-calculator.d.ts.map +1 -0
  277. package/dist/memo.d.ts +29 -0
  278. package/dist/memo.d.ts.map +1 -0
  279. package/dist/portal/index.d.ts +6 -0
  280. package/dist/portal/index.d.ts.map +1 -0
  281. package/dist/portal/portal-registry.d.ts +97 -0
  282. package/dist/portal/portal-registry.d.ts.map +1 -0
  283. package/dist/portal/portal-types.d.ts +20 -0
  284. package/dist/portal/portal-types.d.ts.map +1 -0
  285. package/dist/render-context.d.ts +118 -0
  286. package/dist/render-context.d.ts.map +1 -0
  287. package/dist/scripts/generate-icon-loaders.d.ts +2 -0
  288. package/dist/scripts/generate-icon-loaders.d.ts.map +1 -0
  289. package/dist/scripts/generate-icon-loaders.js +195 -0
  290. package/dist/scripts/generate-icon-types.d.ts +2 -0
  291. package/dist/scripts/generate-icon-types.d.ts.map +1 -0
  292. package/dist/scripts/generate-icon-types.js +124 -0
  293. package/dist/scripts/generate-icons.d.ts +37 -0
  294. package/dist/scripts/generate-icons.d.ts.map +1 -0
  295. package/dist/scripts/generate-icons.js +494 -0
  296. package/dist/scripts/icon-generator-config.d.ts +87 -0
  297. package/dist/scripts/icon-generator-config.d.ts.map +1 -0
  298. package/dist/scripts/icon-generator-config.js +6 -0
  299. package/dist/theme-base.d.ts +116 -0
  300. package/dist/theme-base.d.ts.map +1 -0
  301. package/dist/theme-custom.d.ts +262 -0
  302. package/dist/theme-custom.d.ts.map +1 -0
  303. package/dist/theme-defaults.d.ts +6 -0
  304. package/dist/theme-defaults.d.ts.map +1 -0
  305. package/dist/theme.d.ts +132 -0
  306. package/dist/theme.d.ts.map +1 -0
  307. package/dist/tooltip/tooltip-types.d.ts +57 -0
  308. package/dist/tooltip/tooltip-types.d.ts.map +1 -0
  309. package/dist/types.d.ts +34 -0
  310. package/dist/types.d.ts.map +1 -0
  311. package/dist/utils/KeyboardInputManager.d.ts +48 -0
  312. package/dist/utils/KeyboardInputManager.d.ts.map +1 -0
  313. package/dist/utils/dom-input-manager.d.ts +109 -0
  314. package/dist/utils/dom-input-manager.d.ts.map +1 -0
  315. package/dist/utils/svg-texture.d.ts +30 -0
  316. package/dist/utils/svg-texture.d.ts.map +1 -0
  317. package/dist/utils/texture-registry.d.ts +49 -0
  318. package/dist/utils/texture-registry.d.ts.map +1 -0
  319. package/dist/vdom.d.ts +60 -0
  320. package/dist/vdom.d.ts.map +1 -0
  321. package/dist/viewport-context.d.ts +39 -0
  322. package/dist/viewport-context.d.ts.map +1 -0
  323. package/dist/vite-plugin-icons.d.ts +29 -0
  324. package/dist/vite-plugin-icons.d.ts.map +1 -0
  325. package/dist/vite-plugin-icons.js +95 -0
  326. package/package.json +117 -0
@@ -0,0 +1,38 @@
1
+ import { LayoutChild, LayoutContext, LayoutLine, Position } from '../types';
2
+ import { ContentMetrics } from '../utils/dimension-calculator';
3
+ import { BaseLayoutStrategy } from './base-strategy';
4
+ /**
5
+ * Column layout strategy - stacks children vertically
6
+ */
7
+ export declare class ColumnLayoutStrategy extends BaseLayoutStrategy {
8
+ /**
9
+ * Calculate content dimensions for column layout
10
+ * For flex children, uses a minimum default size to avoid chicken-egg sizing issues
11
+ * @param children - Array of layout children
12
+ * @param context - Layout context
13
+ * @returns Content metrics
14
+ */
15
+ calculateMetrics(children: LayoutChild[], _context: LayoutContext): ContentMetrics;
16
+ /**
17
+ * Position a child in column layout
18
+ * @param child - Layout child
19
+ * @param _index - Child index (unused for column layout)
20
+ * @param context - Layout context
21
+ * @param currentMain - Current Y position
22
+ * @returns Position and next main axis value
23
+ */
24
+ positionChild(child: LayoutChild, _index: number, context: LayoutContext, currentMain: number): {
25
+ position: Position;
26
+ nextMain: number;
27
+ };
28
+ /**
29
+ * Wrap children into lines based on available height
30
+ * Used when flexWrap is 'wrap' or 'wrap-reverse'
31
+ * @param children - Layout children to wrap
32
+ * @param availableHeight - Available height for each line
33
+ * @param gap - Gap between children
34
+ * @returns Array of layout lines
35
+ */
36
+ wrapChildren(children: LayoutChild[], availableHeight: number, gap: number): LayoutLine[];
37
+ }
38
+ //# sourceMappingURL=column-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-layout.d.ts","sourceRoot":"","sources":["../../../src/layout/strategies/column-layout.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAGnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,aAAa,GAAG,cAAc;IA4BlF;;;;;;;OAOG;IACH,aAAa,CACX,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,MAAM,GAClB;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;IA2D3C;;;;;;;OAOG;IACH,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE;CAoE1F"}
@@ -0,0 +1,38 @@
1
+ import { LayoutChild, LayoutContext, LayoutLine, Position } from '../types';
2
+ import { ContentMetrics } from '../utils/dimension-calculator';
3
+ import { BaseLayoutStrategy } from './base-strategy';
4
+ /**
5
+ * Row layout strategy - stacks children horizontally
6
+ */
7
+ export declare class RowLayoutStrategy extends BaseLayoutStrategy {
8
+ /**
9
+ * Calculate content dimensions for row layout
10
+ * For flex children, uses a minimum default size to avoid chicken-egg sizing issues
11
+ * @param children - Array of layout children
12
+ * @param context - Layout context
13
+ * @returns Content metrics
14
+ */
15
+ calculateMetrics(children: LayoutChild[], _context: LayoutContext): ContentMetrics;
16
+ /**
17
+ * Position a child in row layout
18
+ * @param child - Layout child
19
+ * @param _index - Child index (unused for row layout)
20
+ * @param context - Layout context
21
+ * @param currentMain - Current X position
22
+ * @returns Position and next main axis value
23
+ */
24
+ positionChild(child: LayoutChild, _index: number, context: LayoutContext, currentMain: number): {
25
+ position: Position;
26
+ nextMain: number;
27
+ };
28
+ /**
29
+ * Wrap children into lines based on available width
30
+ * Used when flexWrap is 'wrap' or 'wrap-reverse'
31
+ * @param children - Layout children to wrap
32
+ * @param availableWidth - Available width for each line
33
+ * @param gap - Gap between children
34
+ * @returns Array of layout lines
35
+ */
36
+ wrapChildren(children: LayoutChild[], availableWidth: number, gap: number): LayoutLine[];
37
+ }
38
+ //# sourceMappingURL=row-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"row-layout.d.ts","sourceRoot":"","sources":["../../../src/layout/strategies/row-layout.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAGnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,kBAAkB;IACvD;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,aAAa,GAAG,cAAc;IA4BlF;;;;;;;OAOG;IACH,aAAa,CACX,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,MAAM,GAClB;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;IA0D3C;;;;;;;OAOG;IACH,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE;CAoEzF"}
@@ -0,0 +1,30 @@
1
+ import { LayoutChild, LayoutContext, Position } from '../types';
2
+ import { ContentMetrics } from '../utils/dimension-calculator';
3
+ import { BaseLayoutStrategy } from './base-strategy';
4
+ /**
5
+ * Stack layout strategy - overlays all children at the same position
6
+ */
7
+ export declare class StackLayoutStrategy extends BaseLayoutStrategy {
8
+ /**
9
+ * Calculate content dimensions for stack layout
10
+ * For stack, we track max dimensions as children overlay
11
+ * @param children - Array of layout children
12
+ * @param context - Layout context
13
+ * @returns Content metrics
14
+ */
15
+ calculateMetrics(children: LayoutChild[], _context: LayoutContext): ContentMetrics;
16
+ /**
17
+ * Position a child in stack layout
18
+ * All children positioned at same location, aligned via alignItems
19
+ * @param child - Layout child
20
+ * @param _index - Child index (unused for stack layout)
21
+ * @param context - Layout context
22
+ * @param currentMain - Current position (unused for stack)
23
+ * @returns Position and unchanged currentMain
24
+ */
25
+ positionChild(child: LayoutChild, _index: number, context: LayoutContext, currentMain: number): {
26
+ position: Position;
27
+ nextMain: number;
28
+ };
29
+ }
30
+ //# sourceMappingURL=stack-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-layout.d.ts","sourceRoot":"","sources":["../../../src/layout/strategies/stack-layout.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD;;;;;;OAMG;IACH,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,aAAa,GAAG,cAAc;IAiBlF;;;;;;;;OAQG;IACH,aAAa,CACX,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,MAAM,GAClB;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;CAgD5C"}
@@ -0,0 +1,137 @@
1
+ import { default as Phaser } from 'phaser';
2
+ import { BackgroundProps, EdgeInsets, LayoutProps, TransformProps } from '../core-props';
3
+ /**
4
+ * Size information for layout calculations
5
+ */
6
+ export interface LayoutSize {
7
+ width: number;
8
+ height: number;
9
+ }
10
+ /**
11
+ * Interface for nodes that can provide their layout dimensions dynamically
12
+ */
13
+ export interface LayoutSizeProvider {
14
+ /**
15
+ * Get the layout size of this node
16
+ * This can be computed dynamically (e.g., from text bounds, children, etc.)
17
+ * or return fixed dimensions
18
+ * @returns Width and height for layout calculations
19
+ */
20
+ __getLayoutSize: () => LayoutSize;
21
+ }
22
+ /**
23
+ * Extended GameObject with layout metadata
24
+ */
25
+ export type GameObjectWithLayout = Phaser.GameObjects.GameObject & {
26
+ __layoutProps?: LayoutProps & BackgroundProps & TransformProps;
27
+ __isBackground?: boolean;
28
+ __background?: Phaser.GameObjects.Graphics;
29
+ __getLayoutSize?: () => LayoutSize;
30
+ __cachedLayoutSize?: LayoutSize;
31
+ __originalGetLayoutSize?: () => LayoutSize;
32
+ visible?: boolean;
33
+ x?: number;
34
+ y?: number;
35
+ width?: number;
36
+ height?: number;
37
+ setPosition?: (x: number, y: number) => void;
38
+ };
39
+ /**
40
+ * Prepared child data for layout calculations
41
+ */
42
+ export interface LayoutChild {
43
+ child: GameObjectWithLayout;
44
+ size: LayoutSize;
45
+ margin: EdgeInsets;
46
+ }
47
+ /**
48
+ * A line of children in a wrapped flex layout
49
+ */
50
+ export interface LayoutLine {
51
+ children: LayoutChild[];
52
+ mainAxisSize: number;
53
+ crossAxisSize: number;
54
+ }
55
+ /**
56
+ * Computed padding values
57
+ */
58
+ export interface PaddingValues {
59
+ top: number;
60
+ right: number;
61
+ bottom: number;
62
+ left: number;
63
+ }
64
+ /**
65
+ * Position for a child element
66
+ */
67
+ export interface Position {
68
+ x: number;
69
+ y: number;
70
+ }
71
+ /**
72
+ * Content area dimensions (container minus padding)
73
+ */
74
+ export interface ContentArea {
75
+ width: number;
76
+ height: number;
77
+ }
78
+ /**
79
+ * Parsed size representation
80
+ */
81
+ export interface ParsedSize {
82
+ /** Size type: fixed pixels, percentage of parent, viewport units (vw/vh), auto (content-based), calc expression, or fill (parent content-area) */
83
+ type: 'fixed' | 'percent' | 'vw' | 'vh' | 'auto' | 'calc' | 'fill';
84
+ /** Numeric value - pixels for fixed, 0-100 for percent, 0-100 for vw/vh, undefined for auto/calc/fill */
85
+ value?: number;
86
+ /** Calc expression data (only for type='calc') */
87
+ calc?: CalcExpression;
88
+ }
89
+ /**
90
+ * Calc expression representation
91
+ * Supports: calc(50% - 20px), calc(100vw - 40px), calc(100vh + 10px), calc((50% + 10px) * 2), etc.
92
+ */
93
+ export interface CalcExpression {
94
+ /** Left operand or sub-expression */
95
+ left: CalcOperand | CalcExpression;
96
+ /** Operator: +, -, *, / */
97
+ operator: '+' | '-' | '*' | '/';
98
+ /** Right operand or sub-expression */
99
+ right: CalcOperand | CalcExpression;
100
+ }
101
+ /**
102
+ * Calc operand - can be fixed pixels, percentage, or viewport units
103
+ */
104
+ export interface CalcOperand {
105
+ /** Operand type */
106
+ type: 'fixed' | 'percent' | 'vw' | 'vh';
107
+ /** Numeric value */
108
+ value: number;
109
+ }
110
+ /**
111
+ * Computed metrics from children analysis
112
+ * Note: maxWidth/maxHeight here are resolved pixel values, not SizeValue types
113
+ */
114
+ export interface ContentMetrics {
115
+ maxWidth: number;
116
+ maxHeight: number;
117
+ totalMainSize: number;
118
+ }
119
+ /**
120
+ * Complete layout context passed to strategies
121
+ */
122
+ export interface LayoutContext {
123
+ containerProps: LayoutProps;
124
+ padding: PaddingValues;
125
+ contentArea: ContentArea;
126
+ gap: {
127
+ horizontal: number;
128
+ vertical: number;
129
+ };
130
+ children: LayoutChild[];
131
+ /** Parent dimensions for percentage resolution */
132
+ parentSize?: {
133
+ width: number;
134
+ height: number;
135
+ };
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,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,WAAW,CAAA;IAC3B,OAAO,EAAE,aAAa,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,GAAG,EAAE;QACH,UAAU,EAAE,MAAM,CAAA;QAClB,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB,kDAAkD;IAClD,UAAU,CAAC,EAAE;QACX,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF"}
@@ -0,0 +1,74 @@
1
+ import { default as Phaser } from 'phaser';
2
+ import { EdgeInsets, LayoutProps } from '../../core-props';
3
+ import { GameObjectWithLayout, LayoutChild, LayoutSize } from '../types';
4
+ /**
5
+ * Check if a child should participate in layout calculations
6
+ * Headless objects participate in layout (for alignment) but report size 0
7
+ * @param child - Child game object
8
+ * @returns True if child should be included in layout
9
+ */
10
+ export declare function isLayoutChild(child: GameObjectWithLayout): boolean;
11
+ /**
12
+ * Get effective margin for a child
13
+ * Normalizes margin to EdgeInsets (supports number for all sides)
14
+ * Headless objects have no margin (positioned as point)
15
+ * @param child - Child game object
16
+ * @returns Edge insets
17
+ */
18
+ export declare function getMargin(child: GameObjectWithLayout): EdgeInsets;
19
+ /**
20
+ * Get effective size of a child
21
+ * Calls __getLayoutSize if available, otherwise falls back to layoutProps or default
22
+ * Note: String sizes (percentages) are resolved later with parent context
23
+ * @param child - Child game object
24
+ * @param parentSize - Optional parent dimensions for percentage resolution
25
+ * @param parentPadding - Optional parent padding for 'fill' resolution
26
+ * @returns Width and height in pixels
27
+ */
28
+ export declare function getChildSize(child: GameObjectWithLayout, parentSize?: {
29
+ width: number;
30
+ height: number;
31
+ }, parentPadding?: {
32
+ horizontal: number;
33
+ vertical: number;
34
+ }): LayoutSize;
35
+ /**
36
+ * Process a child container by recursively calculating its layout
37
+ * @param child - Child game object to process
38
+ * @param calculateLayoutFn - Layout calculation function (passed to avoid circular dependency)
39
+ * @param parentSize - Optional parent dimensions for percentage resolution
40
+ * @param parentPadding - Optional parent padding for 'fill' resolution
41
+ */
42
+ export declare function processNestedContainer(child: GameObjectWithLayout, calculateLayoutFn: (container: Phaser.GameObjects.Container, props: LayoutProps, parentSize?: {
43
+ width: number;
44
+ height: number;
45
+ }, parentPadding?: {
46
+ horizontal: number;
47
+ vertical: number;
48
+ }) => void, parentSize?: {
49
+ width: number;
50
+ height: number;
51
+ }, parentPadding?: {
52
+ horizontal: number;
53
+ vertical: number;
54
+ }): void;
55
+ /**
56
+ * Filter and prepare children for layout calculations
57
+ * Skips background elements and processes nested containers
58
+ * @param children - Raw children from container
59
+ * @param calculateLayoutFn - Layout calculation function for nested containers
60
+ * @returns Prepared layout children with size and margin data
61
+ */
62
+ export declare function prepareLayoutChildren(children: GameObjectWithLayout[], calculateLayoutFn: (container: Phaser.GameObjects.Container, props: LayoutProps) => void): LayoutChild[];
63
+ /**
64
+ * Extract margin values with defaults
65
+ * @param margin - Edge insets
66
+ * @returns Individual margin values
67
+ */
68
+ export declare function extractMarginValues(margin: EdgeInsets): {
69
+ top: number;
70
+ right: number;
71
+ bottom: number;
72
+ left: number;
73
+ };
74
+ //# sourceMappingURL=child-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-utils.d.ts","sourceRoot":"","sources":["../../../src/layout/utils/child-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG7E;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,o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import { EdgeInsets, LayoutProps } from '../../core-props';
2
+ import { LayoutChild } from '../types';
3
+ /**
4
+ * Content dimension metrics
5
+ */
6
+ export interface ContentMetrics {
7
+ maxWidth: number;
8
+ maxHeight: number;
9
+ totalMainSize: number;
10
+ }
11
+ /**
12
+ * Padding values (normalized)
13
+ */
14
+ export interface PaddingValues {
15
+ left: number;
16
+ top: number;
17
+ right: number;
18
+ bottom: number;
19
+ }
20
+ /**
21
+ * Calculate content dimensions based on children and layout direction
22
+ * For flex children, uses a minimum default size to avoid chicken-egg sizing issues
23
+ * @param children - Array of layout children with size and margin info
24
+ * @param direction - Layout direction ('row', 'column', or 'stack')
25
+ * @returns Content metrics including max dimensions and total main axis size
26
+ */
27
+ export declare function calculateContentDimensions(children: LayoutChild[], direction: 'row' | 'column' | 'stack'): ContentMetrics;
28
+ /**
29
+ * Calculate final container dimensions
30
+ * @param props - Layout properties
31
+ * @param metrics - Content metrics from calculateContentDimensions
32
+ * @param padding - Normalized padding values
33
+ * @param direction - Layout direction
34
+ * @param gap - Gap between children (horizontal and vertical)
35
+ * @param childCount - Number of children
36
+ * @param parentSize - Parent dimensions for percentage resolution
37
+ * @param parentPadding - Parent padding for 'fill' resolution
38
+ * @returns Container width and height in pixels
39
+ */
40
+ export declare function calculateContainerSize(props: LayoutProps, metrics: ContentMetrics, padding: PaddingValues, direction: 'row' | 'column' | 'stack', gap: {
41
+ horizontal: number;
42
+ vertical: number;
43
+ }, childCount: number, parentSize?: {
44
+ width: number;
45
+ height: number;
46
+ }, parentPadding?: {
47
+ horizontal: number;
48
+ vertical: number;
49
+ }): {
50
+ width: number;
51
+ height: number;
52
+ };
53
+ /**
54
+ * Normalize padding from EdgeInsets or number to PaddingValues
55
+ * @param padding - Edge insets (may be undefined, partial, or a single number for all sides)
56
+ * @returns Normalized padding with all values defined
57
+ */
58
+ export declare function normalizePadding(padding?: number | EdgeInsets): PaddingValues;
59
+ //# sourceMappingURL=dimension-calculator.d.ts.map
@@ -0,0 +1 @@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AgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,CAe7E"}
@@ -0,0 +1,18 @@
1
+ import { LayoutChild } from '../types';
2
+ /**
3
+ * Calculate flex distribution for children
4
+ * Implements flexbox algorithm with grow, shrink, and basis support
5
+ * Respects min/max constraints during distribution
6
+ * @param children - Layout children
7
+ * @param availableSpace - Total available space on main axis
8
+ * @param direction - Layout direction ('row' or 'column')
9
+ * @returns Updated children with flex sizes resolved
10
+ */
11
+ export declare function distributeFlexSpace(children: LayoutChild[], availableSpace: number, direction: 'row' | 'column' | 'stack'): LayoutChild[];
12
+ /**
13
+ * Check if any children have flex properties (flex, flexShrink, or flexBasis)
14
+ * @param children - Layout children
15
+ * @returns True if at least one child participates in flexbox
16
+ */
17
+ export declare function hasFlexChildren(children: LayoutChild[]): boolean;
18
+ //# sourceMappingURL=flex-distributor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex-distributor.d.ts","sourceRoot":"","sources":["../../../src/layout/utils/flex-distributor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAkB3C;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,WAAW,EAAE,EACvB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,GACpC,WAAW,EAAE,CAiIf;AAiID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAShE"}
@@ -0,0 +1,84 @@
1
+ import { ParsedSize } from '../types';
2
+ export type { ParsedSize } from '../types';
3
+ /**
4
+ * Parse a size value into its components
5
+ * Results are cached to avoid repeated string parsing during layout calculations
6
+ * @param size - Size value (number, string, or undefined)
7
+ * @returns Parsed size information
8
+ * @throws Error if string format is invalid
9
+ *
10
+ * @example
11
+ * parseSize(100) // { type: 'fixed', value: 100 }
12
+ * parseSize('50%') // { type: 'percent', value: 50 }
13
+ * parseSize('calc(100% - 40px)') // { type: 'calc', calc: {...} }
14
+ * parseSize(undefined) // { type: 'auto' }
15
+ * parseSize('auto') // { type: 'auto' }
16
+ */
17
+ export declare function parseSize(size: number | string | undefined): ParsedSize;
18
+ /**
19
+ * Resolve a parsed size to actual pixel value
20
+ * @param parsed - Parsed size information
21
+ * @param parentSize - Parent dimension in pixels (required for percentage and calc)
22
+ * @param contentSize - Content dimension in pixels (fallback for auto)
23
+ * @param parentPadding - Parent padding in the relevant direction (for fill)
24
+ * @param viewportSize - Viewport dimensions for vw/vh resolution
25
+ * @returns Resolved size in pixels
26
+ *
27
+ * @example
28
+ * resolveSize({ type: 'fixed', value: 100 }, 200) // 100
29
+ * resolveSize({ type: 'percent', value: 50 }, 200) // 100 (50% of 200)
30
+ * resolveSize({ type: 'vw', value: 100 }, undefined, undefined, undefined, viewport) // viewport.width
31
+ * resolveSize({ type: 'vh', value: 50 }, undefined, undefined, undefined, viewport) // viewport.height * 0.5
32
+ * resolveSize({ type: 'calc', calc: {...} }, 200) // calc result
33
+ * resolveSize({ type: 'auto' }, 200, 150) // 150 (content size)
34
+ * resolveSize({ type: 'fill' }, 200, undefined, 40) // 160 (200 - 40)
35
+ */
36
+ export declare function resolveSize(parsed: ParsedSize, parentSize?: number, contentSize?: number, parentPadding?: number, viewportSize?: {
37
+ width: number;
38
+ height: number;
39
+ }): number;
40
+ /**
41
+ * Clear the parseSize cache and warning deduplication set
42
+ * Useful for testing or memory management in long-running applications
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * // Clear caches after major UI rebuild
47
+ * clearSizeCaches()
48
+ * ```
49
+ */
50
+ export declare function clearSizeCaches(): void;
51
+ /**
52
+ * Check if a size needs parent context to resolve
53
+ * @param parsed - Parsed size information
54
+ * @returns True if size requires parent dimension
55
+ */
56
+ export declare function requiresParent(parsed: ParsedSize): boolean;
57
+ /**
58
+ * Check if a size can be determined without content measurement
59
+ * @param parsed - Parsed size information
60
+ * @returns True if size is explicitly defined (not auto)
61
+ */
62
+ export declare function isExplicit(parsed: ParsedSize): boolean;
63
+ /**
64
+ * Clamp a size value to min/max constraints
65
+ * Min/max constraints can be SizeValue (pixels, percentage, viewport units, calc)
66
+ * They are resolved relative to the same parent/viewport context as the size itself
67
+ *
68
+ * @param size - Resolved size in pixels
69
+ * @param minSize - Minimum size constraint (SizeValue or undefined = no constraint)
70
+ * @param maxSize - Maximum size constraint (SizeValue or undefined = no constraint)
71
+ * @param parentSize - Parent dimension for percentage resolution in constraints
72
+ * @param fallbackSize - Fallback size for auto constraints (not typically used for min/max)
73
+ * @param parentPadding - Parent padding for fill constraints (not typically used for min/max)
74
+ * @returns Clamped size in pixels
75
+ *
76
+ * @example
77
+ * clampSize(150, 100, 200) // 150 (within bounds)
78
+ * clampSize(50, 100, 200) // 100 (clamped to min)
79
+ * clampSize(300, 100, 200) // 200 (clamped to max)
80
+ * clampSize(150, undefined, "80%", 1000) // 150 (max = 800px)
81
+ * clampSize(1000, undefined, "80%", 1000) // 800 (clamped to 80% of parent)
82
+ */
83
+ export declare function clampSize(size: number, minSize?: number | string, maxSize?: number | string, parentSize?: number, fallbackSize?: number, parentPadding?: number): number;
84
+ //# sourceMappingURL=size-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"size-resolver.d.ts","sourceRoot":"","sources":["../../../src/layout/utils/size-resolver.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAA+B,UAAU,EAAE,MAAM,UAAU,CAAA;AAGvE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAmH1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAiBvE;AA8JD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,UAAU,EAClB,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,MAAM,EACtB,YAAY,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC/C,MAAM,CAuER;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAGtC;AAkBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAW1D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAStD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EACzB,UAAU,CAAC,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,CAsBR"}
@@ -0,0 +1,27 @@
1
+ import { LayoutProps } from '../../core-props';
2
+ /**
3
+ * Justify content calculation result
4
+ */
5
+ export interface JustifyResult {
6
+ mainStart: number;
7
+ spaceBetween: number;
8
+ }
9
+ /**
10
+ * Calculate main axis starting position and spacing between children
11
+ * @param justifyContent - Justify content value
12
+ * @param remainingSpace - Space remaining after children are placed
13
+ * @param childCount - Number of children
14
+ * @returns Main axis starting offset and spacing between children
15
+ */
16
+ export declare function calculateJustifyContent(justifyContent: LayoutProps['justifyContent'], remainingSpace: number, childCount: number): JustifyResult;
17
+ /**
18
+ * Calculate cross axis position for a child
19
+ * @param alignItems - Align items value
20
+ * @param contentArea - Available space on cross axis
21
+ * @param childSize - Size of child on cross axis
22
+ * @param marginStart - Margin at start of cross axis (top for row, left for column)
23
+ * @param marginEnd - Margin at end of cross axis (bottom for row, right for column)
24
+ * @returns Cross axis position
25
+ */
26
+ export declare function calculateAlignItems(alignItems: LayoutProps['alignItems'], contentArea: number, childSize: number, marginStart: number, marginEnd: number): number;
27
+ //# sourceMappingURL=spacing-calculator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spacing-calculator.d.ts","sourceRoot":"","sources":["../../../src/layout/utils/spacing-calculator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,EAC7C,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,GACjB,aAAa,CAiCf;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,EACrC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,CAcR"}
package/dist/memo.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { VNode } from './hooks';
2
+ /**
3
+ * Marks a component to skip memoization (always re-render on prop changes)
4
+ * Use when component has side effects or needs to re-render every time
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * function AlwaysUpdate({ value }) {
9
+ * console.log('Rendering with:', value)
10
+ * return <Text text={value} />
11
+ * }
12
+ *
13
+ * // Disable memoization
14
+ * <AlwaysUpdate value={counter} __memo={false} />
15
+ * ```
16
+ *
17
+ * @param vnode - VNode to mark
18
+ * @returns Same VNode with memoization disabled (may be a copy if frozen)
19
+ */
20
+ export declare function noMemo<T extends VNode>(vnode: T): T;
21
+ /**
22
+ * Explicitly enable memoization for a component (default behavior)
23
+ * This is the default - you don't need to call this unless you want to be explicit
24
+ *
25
+ * @param vnode - VNode to mark
26
+ * @returns Same VNode with memoization enabled (may be a copy if frozen)
27
+ */
28
+ export declare function memo<T extends VNode>(vnode: T): T;
29
+ //# sourceMappingURL=memo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../src/memo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAiBpC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEnD;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAEjD"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Portal exports
3
+ */
4
+ export { portalRegistry } from './portal-registry';
5
+ export type { PortalTree } from './portal-types';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/portal/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA"}