@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,628 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const coreProps = require("../core-props.cjs");
4
+ const devConfig = require("../dev-config.cjs");
5
+ const globalRegistry = require("../global-registry.cjs");
6
+ const containerApplier = require("./appliers/container-applier.cjs");
7
+ const positionApplier = require("./appliers/position-applier.cjs");
8
+ const columnLayout = require("./strategies/column-layout.cjs");
9
+ const rowLayout = require("./strategies/row-layout.cjs");
10
+ const stackLayout = require("./strategies/stack-layout.cjs");
11
+ const childUtils = require("./utils/child-utils.cjs");
12
+ const dimensionCalculator = require("./utils/dimension-calculator.cjs");
13
+ const flexDistributor = require("./utils/flex-distributor.cjs");
14
+ const sizeResolver = require("./utils/size-resolver.cjs");
15
+ const spacingCalculator = require("./utils/spacing-calculator.cjs");
16
+ const GLOBAL_NS = "@number10/jsx-core:layout";
17
+ const _overflowClipRegistryKey = /* @__PURE__ */ Symbol.for(`${GLOBAL_NS}:overflowClipRegistry`);
18
+ const _onAfterLayoutKey = /* @__PURE__ */ Symbol.for(`${GLOBAL_NS}:onAfterLayout`);
19
+ function getOverflowClipRegistry() {
20
+ return globalRegistry.getOrCreateGlobalValue(_overflowClipRegistryKey, () => []);
21
+ }
22
+ function getOnAfterLayout() {
23
+ return globalRegistry.getGlobalValue(_onAfterLayoutKey) ?? noopAfterLayout;
24
+ }
25
+ function setOnAfterLayout(fn) {
26
+ globalRegistry.setGlobalValue(_onAfterLayoutKey, fn);
27
+ }
28
+ const noopAfterLayout = () => {
29
+ };
30
+ function registerApplyOverflowClip(fn) {
31
+ getOverflowClipRegistry().push(fn);
32
+ }
33
+ function setApplyOverflowClip(fn) {
34
+ const registry = getOverflowClipRegistry();
35
+ registry.length = 0;
36
+ registry.push(fn);
37
+ }
38
+ function setAfterLayout(fn) {
39
+ setOnAfterLayout(fn);
40
+ }
41
+ class DeferredLayoutQueue {
42
+ static callbacks = [];
43
+ static scheduled = false;
44
+ /**
45
+ * Schedule a callback to execute after current layout pass completes
46
+ * All callbacks are batched and executed in single requestAnimationFrame
47
+ * @param callback - Function to execute in next frame
48
+ */
49
+ static defer(callback) {
50
+ this.callbacks.push(callback);
51
+ if (!this.scheduled) {
52
+ this.scheduled = true;
53
+ requestAnimationFrame(() => this.flush());
54
+ }
55
+ }
56
+ /**
57
+ * Execute all pending callbacks in batch
58
+ * Called once per frame via requestAnimationFrame
59
+ */
60
+ static flush() {
61
+ this.scheduled = false;
62
+ const callbacks = [...this.callbacks];
63
+ this.callbacks = [];
64
+ for (const callback of callbacks) {
65
+ try {
66
+ callback();
67
+ } catch (error) {
68
+ devConfig.DebugLogger.error("DeferredLayoutQueue", "Error in deferred callback:", error);
69
+ }
70
+ }
71
+ }
72
+ }
73
+ class LayoutBatchQueue {
74
+ static pending = /* @__PURE__ */ new Map();
75
+ static scheduled = false;
76
+ /**
77
+ * Enable synchronous mode for testing
78
+ * When true, layouts execute immediately instead of batching
79
+ */
80
+ static synchronous = false;
81
+ /**
82
+ * Schedule a layout calculation to execute after current call stack
83
+ * Uses microtask (Promise) instead of requestAnimationFrame to avoid flickering
84
+ * If container is already scheduled, updates entry with latest props
85
+ * @param container - Container to calculate layout for
86
+ * @param containerProps - Layout props
87
+ * @param parentSize - Optional parent size for percentage resolution
88
+ * @param parentPadding - Optional parent padding for fill resolution
89
+ */
90
+ static schedule(container, containerProps, parentSize, parentPadding) {
91
+ if (this.synchronous) {
92
+ calculateLayoutImmediate(container, containerProps, parentSize, parentPadding);
93
+ return;
94
+ }
95
+ this.pending.set(container, { container, containerProps, parentSize, parentPadding });
96
+ if (!this.scheduled) {
97
+ this.scheduled = true;
98
+ Promise.resolve().then(() => this.flush());
99
+ }
100
+ }
101
+ /**
102
+ * Execute all pending layout calculations immediately
103
+ * Processes in bottom-up order (deepest children first)
104
+ * This prevents redundant parent recalculations
105
+ */
106
+ static flush() {
107
+ this.scheduled = false;
108
+ if (this.pending.size === 0) return;
109
+ devConfig.DebugLogger.time("performance", "LayoutBatchQueue.flush");
110
+ const entries = Array.from(this.pending.values());
111
+ this.pending.clear();
112
+ entries.sort((a, b) => {
113
+ const depthA = getContainerDepth(a.container);
114
+ const depthB = getContainerDepth(b.container);
115
+ return depthB - depthA;
116
+ });
117
+ for (const entry of entries) {
118
+ try {
119
+ const node = entry.container;
120
+ if (node.destroyed === true) continue;
121
+ if (entry.container.visible === false) continue;
122
+ calculateLayoutImmediate(
123
+ entry.container,
124
+ entry.containerProps,
125
+ entry.parentSize,
126
+ entry.parentPadding
127
+ );
128
+ } catch (error) {
129
+ devConfig.DebugLogger.error("LayoutBatchQueue", "Error calculating layout:", error);
130
+ }
131
+ }
132
+ devConfig.DebugLogger.timeEnd("performance", "LayoutBatchQueue.flush");
133
+ }
134
+ }
135
+ function getContainerDepth(container) {
136
+ let depth = 0;
137
+ let current = getLayoutParent(container);
138
+ while (current) {
139
+ depth++;
140
+ current = getLayoutParent(current);
141
+ }
142
+ return depth;
143
+ }
144
+ function getLayoutParent(container) {
145
+ if (container.__layoutParent) {
146
+ return container.__layoutParent;
147
+ }
148
+ if (container.parent) {
149
+ return container.parent;
150
+ }
151
+ const parentContainer = container.parentContainer;
152
+ if (parentContainer && typeof parentContainer === "object") {
153
+ return parentContainer;
154
+ }
155
+ return void 0;
156
+ }
157
+ function applyOverflowMask(container, containerProps, width, height) {
158
+ for (const clip of getOverflowClipRegistry()) {
159
+ clip(container, containerProps, width, height);
160
+ }
161
+ }
162
+ const strategies = {
163
+ column: new columnLayout.ColumnLayoutStrategy(),
164
+ row: new rowLayout.RowLayoutStrategy(),
165
+ stack: new stackLayout.StackLayoutStrategy()
166
+ };
167
+ const LAYOUT_CYCLE_EPSILON = 0.5;
168
+ const LAYOUT_CYCLE_TIME_MS = 20;
169
+ const LAYOUT_CYCLE_MAX = 5;
170
+ const LAYOUT_MAX_SIZE = 2e5;
171
+ const layoutCycleGuard = /* @__PURE__ */ new WeakMap();
172
+ const deferredParentInvalidations = /* @__PURE__ */ new WeakSet();
173
+ function isCloseSize(a, b, epsilon) {
174
+ return Math.abs(a.width - b.width) < epsilon && Math.abs(a.height - b.height) < epsilon;
175
+ }
176
+ function invalidateParentLayoutIfNeeded(container, oldSize, newWidth, newHeight) {
177
+ if (!oldSize || Math.abs(oldSize.width - newWidth) < LAYOUT_CYCLE_EPSILON && Math.abs(oldSize.height - newHeight) < LAYOUT_CYCLE_EPSILON) {
178
+ return;
179
+ }
180
+ if (!Number.isFinite(newWidth) || !Number.isFinite(newHeight) || newWidth > LAYOUT_MAX_SIZE || newHeight > LAYOUT_MAX_SIZE) {
181
+ devConfig.DebugLogger.warn("layout", "Runaway layout size detected, skipping parent invalidation", {
182
+ oldSize,
183
+ newSize: { width: newWidth, height: newHeight },
184
+ containerProps: container.__layoutProps,
185
+ childCount: container.list?.length ?? 0
186
+ });
187
+ return;
188
+ }
189
+ const newSize = { width: newWidth, height: newHeight };
190
+ const now = Date.now();
191
+ const parent = getLayoutParent(container);
192
+ if (!parent || !parent.__layoutProps) {
193
+ return;
194
+ }
195
+ const guard = layoutCycleGuard.get(container);
196
+ if (guard) {
197
+ const repeatsPrev = guard.prev ? isCloseSize(guard.prev, newSize, LAYOUT_CYCLE_EPSILON) : false;
198
+ if (repeatsPrev && now - guard.lastTime < LAYOUT_CYCLE_TIME_MS) {
199
+ guard.count += 1;
200
+ } else {
201
+ guard.count = 0;
202
+ }
203
+ guard.prev = guard.last;
204
+ guard.last = newSize;
205
+ guard.lastTime = now;
206
+ layoutCycleGuard.set(container, guard);
207
+ if (guard.count >= LAYOUT_CYCLE_MAX) {
208
+ devConfig.DebugLogger.log("layout", "Layout cycle detected, deferring parent invalidation", {
209
+ container,
210
+ oldSize,
211
+ newSize
212
+ });
213
+ guard.count = 0;
214
+ guard.lastTime = 0;
215
+ layoutCycleGuard.set(container, guard);
216
+ deferParentLayoutInvalidation(container);
217
+ return;
218
+ }
219
+ } else {
220
+ layoutCycleGuard.set(container, {
221
+ last: newSize,
222
+ count: 0,
223
+ lastTime: now
224
+ });
225
+ }
226
+ devConfig.DebugLogger.log(
227
+ "layout",
228
+ "Container size changed, invalidating parent:",
229
+ `${oldSize.width}x${oldSize.height} -> ${newWidth}x${newHeight}`
230
+ );
231
+ invalidateParentLayout(container);
232
+ }
233
+ function deferParentLayoutInvalidation(container) {
234
+ if (deferredParentInvalidations.has(container)) {
235
+ return;
236
+ }
237
+ deferredParentInvalidations.add(container);
238
+ DeferredLayoutQueue.defer(() => {
239
+ deferredParentInvalidations.delete(container);
240
+ invalidateParentLayout(container);
241
+ });
242
+ }
243
+ function invalidateParentLayout(container) {
244
+ const parent = getLayoutParent(container);
245
+ if (!parent || !parent.__layoutProps) {
246
+ return;
247
+ }
248
+ const grandParent = getLayoutParent(parent);
249
+ let grandParentSize;
250
+ if (grandParent && grandParent.__getLayoutSize) {
251
+ const totalSize = grandParent.__getLayoutSize();
252
+ const padding = grandParent.__layoutProps?.padding ?? 0;
253
+ const normPadding = typeof padding === "number" ? { left: padding, right: padding, top: padding, bottom: padding } : {
254
+ left: padding.left ?? 0,
255
+ right: padding.right ?? 0,
256
+ top: padding.top ?? 0,
257
+ bottom: padding.bottom ?? 0
258
+ };
259
+ grandParentSize = {
260
+ width: totalSize.width - normPadding.left - normPadding.right,
261
+ height: totalSize.height - normPadding.top - normPadding.bottom
262
+ };
263
+ }
264
+ calculateLayout(parent, parent.__layoutProps, grandParentSize);
265
+ }
266
+ function calculateLayoutImmediate(container, containerProps, parentSize, parentPadding) {
267
+ const children = container.list ?? [];
268
+ const containerWithLayout = container;
269
+ const oldContainerSize = containerWithLayout.__getLayoutSize?.();
270
+ if (!children || !Array.isArray(children)) {
271
+ return;
272
+ }
273
+ devConfig.DebugLogger.time("performance", "calculateLayout");
274
+ const direction = containerProps.direction ?? "column";
275
+ const padding = dimensionCalculator.normalizePadding(containerProps.padding);
276
+ const gap = coreProps.normalizeGap(containerProps.gap);
277
+ const justifyContent = containerProps.justifyContent ?? "start";
278
+ devConfig.DebugLogger.log("layout", `Direction: ${direction}, Padding:`, padding);
279
+ let currentContainerSize;
280
+ const parsedWidth = sizeResolver.parseSize(containerProps.width);
281
+ const canCalculateWidth = parsedWidth.type === "fixed" || parentSize?.width !== void 0 && (parsedWidth.type === "percent" || parsedWidth.type === "fill" || parsedWidth.type === "calc");
282
+ const width = canCalculateWidth ? sizeResolver.resolveSize(parsedWidth, parentSize?.width, container.width, parentPadding?.horizontal) : void 0;
283
+ const parsedHeight = sizeResolver.parseSize(containerProps.height);
284
+ const canCalculateHeight = parsedHeight.type === "fixed" || parentSize?.height !== void 0 && (parsedHeight.type === "percent" || parsedHeight.type === "fill" || parsedHeight.type === "calc");
285
+ const height = canCalculateHeight ? sizeResolver.resolveSize(parsedHeight, parentSize?.height, container.height, parentPadding?.vertical) : void 0;
286
+ if (width !== void 0 || height !== void 0) {
287
+ const clampedWidth = width !== void 0 ? sizeResolver.clampSize(
288
+ width,
289
+ containerProps.minWidth,
290
+ containerProps.maxWidth,
291
+ parentSize?.width,
292
+ container.width,
293
+ parentPadding?.horizontal
294
+ ) : container.width ?? 0;
295
+ const clampedHeight = height !== void 0 ? sizeResolver.clampSize(
296
+ height,
297
+ containerProps.minHeight,
298
+ containerProps.maxHeight,
299
+ parentSize?.height,
300
+ container.height,
301
+ parentPadding?.vertical
302
+ ) : container.height ?? 0;
303
+ currentContainerSize = {
304
+ width: clampedWidth,
305
+ height: clampedHeight
306
+ };
307
+ }
308
+ const availableContentSize = currentContainerSize ? {
309
+ width: currentContainerSize.width - padding.left - padding.right,
310
+ height: currentContainerSize.height - padding.top - padding.bottom
311
+ } : void 0;
312
+ devConfig.DebugLogger.log("layout", "Pre-calculated container size:", currentContainerSize);
313
+ devConfig.DebugLogger.log("layout", "Available content size (for fill):", availableContentSize);
314
+ const layoutChildren = [];
315
+ for (const child of children) {
316
+ if (!childUtils.isLayoutChild(child)) {
317
+ devConfig.DebugLogger.log("layout", "Skipping non-layout child:", {
318
+ isBackground: child.__isBackground,
319
+ headless: child.__layoutProps?.headless,
320
+ hasLayoutSize: typeof child.__getLayoutSize === "function"
321
+ });
322
+ continue;
323
+ }
324
+ const hasFlex = (child.__layoutProps?.flex ?? 0) > 0;
325
+ if (!hasFlex) {
326
+ const parentSizeForNested = currentContainerSize ? {
327
+ width: currentContainerSize.width - padding.left - padding.right,
328
+ height: currentContainerSize.height - padding.top - padding.bottom
329
+ } : parentSize ? {
330
+ width: parentSize.width - (parentPadding?.horizontal ?? 0),
331
+ height: parentSize.height - (parentPadding?.vertical ?? 0)
332
+ } : void 0;
333
+ childUtils.processNestedContainer(
334
+ child,
335
+ calculateLayout,
336
+ parentSizeForNested,
337
+ void 0
338
+ // No padding offset needed since we pass content-area
339
+ );
340
+ }
341
+ const contentAreaForChild = currentContainerSize ? {
342
+ width: currentContainerSize.width - padding.left - padding.right,
343
+ height: currentContainerSize.height - padding.top - padding.bottom
344
+ } : parentSize ? {
345
+ width: parentSize.width - (parentPadding?.horizontal ?? 0),
346
+ height: parentSize.height - (parentPadding?.vertical ?? 0)
347
+ } : void 0;
348
+ const size = childUtils.getChildSize(child, contentAreaForChild, void 0);
349
+ const margin = childUtils.getMargin(child);
350
+ layoutChildren.push({ child, size, margin });
351
+ }
352
+ const strategy = strategies[direction];
353
+ if (!strategy) {
354
+ devConfig.DebugLogger.error("Layout", `Unknown direction: ${direction}`);
355
+ return;
356
+ }
357
+ const contextPartial = {
358
+ containerProps,
359
+ padding,
360
+ gap,
361
+ children: layoutChildren
362
+ };
363
+ const metrics = strategy.calculateMetrics(layoutChildren, contextPartial);
364
+ const flexWrap = containerProps.flexWrap ?? "nowrap";
365
+ const shouldWrap = flexWrap !== "nowrap" && direction !== "stack";
366
+ const { width: containerWidth, height: containerHeight } = dimensionCalculator.calculateContainerSize(
367
+ containerProps,
368
+ metrics,
369
+ padding,
370
+ direction,
371
+ gap,
372
+ layoutChildren.length,
373
+ parentSize,
374
+ parentPadding
375
+ );
376
+ let finalLayoutChildren = layoutChildren;
377
+ if (flexDistributor.hasFlexChildren(layoutChildren) && !shouldWrap) {
378
+ const contentSize = direction === "row" ? containerWidth - padding.left - padding.right : containerHeight - padding.top - padding.bottom;
379
+ const gapValue2 = direction === "row" ? gap.horizontal : gap.vertical;
380
+ const totalGapSpace2 = layoutChildren.length > 1 ? gapValue2 * (layoutChildren.length - 1) : 0;
381
+ const availableMainSpace2 = contentSize - totalGapSpace2;
382
+ finalLayoutChildren = flexDistributor.distributeFlexSpace(layoutChildren, availableMainSpace2, direction);
383
+ for (const layoutChild of finalLayoutChildren) {
384
+ const props = layoutChild.child.__layoutProps;
385
+ const isFlexItem = props?.flex !== void 0 && props.flex > 0 || props?.flexShrink !== void 0 || props?.flexBasis !== void 0;
386
+ if (isFlexItem) {
387
+ const originalProps = { ...layoutChild.child.__layoutProps };
388
+ if (direction === "row") {
389
+ layoutChild.child.__layoutProps = {
390
+ ...layoutChild.child.__layoutProps,
391
+ width: layoutChild.size.width
392
+ };
393
+ } else {
394
+ layoutChild.child.__layoutProps = {
395
+ ...layoutChild.child.__layoutProps,
396
+ height: layoutChild.size.height
397
+ };
398
+ }
399
+ childUtils.processNestedContainer(
400
+ layoutChild.child,
401
+ calculateLayout,
402
+ {
403
+ width: containerWidth,
404
+ height: containerHeight
405
+ },
406
+ {
407
+ horizontal: padding.left + padding.right,
408
+ vertical: padding.top + padding.bottom
409
+ }
410
+ );
411
+ layoutChild.child.__layoutProps = originalProps;
412
+ }
413
+ }
414
+ const updatedMetrics = strategy.calculateMetrics(
415
+ finalLayoutChildren,
416
+ contextPartial
417
+ );
418
+ metrics.totalMainSize = updatedMetrics.totalMainSize;
419
+ if (direction === "column") {
420
+ metrics.maxWidth = updatedMetrics.maxWidth;
421
+ } else if (direction === "row") {
422
+ metrics.maxHeight = updatedMetrics.maxHeight;
423
+ }
424
+ }
425
+ const contentArea = {
426
+ width: containerWidth - padding.left - padding.right,
427
+ height: containerHeight - padding.top - padding.bottom
428
+ };
429
+ const context = {
430
+ ...contextPartial,
431
+ children: finalLayoutChildren,
432
+ contentArea,
433
+ parentSize: {
434
+ width: containerWidth,
435
+ height: containerHeight
436
+ }
437
+ };
438
+ const availableMainSpace = direction === "row" ? contentArea.width : contentArea.height;
439
+ const gapValue = direction === "row" ? gap.horizontal : gap.vertical;
440
+ const totalGapSpace = finalLayoutChildren.length > 1 ? gapValue * (finalLayoutChildren.length - 1) : 0;
441
+ const remainingSpace = availableMainSpace - metrics.totalMainSize - totalGapSpace;
442
+ let mainStart = 0;
443
+ let spaceBetween = 0;
444
+ if (direction !== "stack") {
445
+ const justifyResult = spacingCalculator.calculateJustifyContent(
446
+ justifyContent,
447
+ remainingSpace,
448
+ finalLayoutChildren.length
449
+ );
450
+ mainStart = justifyResult.mainStart;
451
+ spaceBetween = justifyResult.spaceBetween;
452
+ }
453
+ const alignItems = containerProps.alignItems ?? "start";
454
+ if (alignItems === "stretch" && direction !== "stack") {
455
+ for (const layoutChild of finalLayoutChildren) {
456
+ const margin = childUtils.getMargin(layoutChild.child);
457
+ const child = layoutChild.child;
458
+ if (direction === "row") {
459
+ const stretchHeight = contentArea.height - (margin.top ?? 0) - (margin.bottom ?? 0);
460
+ layoutChild.size.height = Math.max(0, stretchHeight);
461
+ if (child.__layoutProps) {
462
+ const originalHeight = child.__layoutProps.height;
463
+ child.__layoutProps = { ...child.__layoutProps, height: stretchHeight };
464
+ childUtils.processNestedContainer(child, calculateLayout, {
465
+ width: containerWidth,
466
+ height: containerHeight
467
+ });
468
+ child.__layoutProps = { ...child.__layoutProps, height: originalHeight };
469
+ }
470
+ } else if (direction === "column") {
471
+ const stretchWidth = contentArea.width - (margin.left ?? 0) - (margin.right ?? 0);
472
+ layoutChild.size.width = Math.max(0, stretchWidth);
473
+ if (child.__layoutProps) {
474
+ const originalWidth = child.__layoutProps.width;
475
+ child.__layoutProps = { ...child.__layoutProps, width: stretchWidth };
476
+ childUtils.processNestedContainer(child, calculateLayout, {
477
+ width: containerWidth,
478
+ height: containerHeight
479
+ });
480
+ child.__layoutProps = { ...child.__layoutProps, width: originalWidth };
481
+ }
482
+ }
483
+ }
484
+ }
485
+ const positions = [];
486
+ let adjustedContainerWidth = containerWidth;
487
+ let adjustedContainerHeight = containerHeight;
488
+ if (shouldWrap && "wrapChildren" in strategy) {
489
+ const availableMainSize = direction === "row" ? contentArea.width : contentArea.height;
490
+ const mainGapValue = direction === "row" ? gap.horizontal : gap.vertical;
491
+ const lines = strategy.wrapChildren(
492
+ finalLayoutChildren,
493
+ availableMainSize,
494
+ mainGapValue
495
+ );
496
+ if (flexWrap === "wrap-reverse") {
497
+ lines.reverse();
498
+ }
499
+ const totalCrossSize = lines.reduce(
500
+ (sum, line) => sum + line.crossAxisSize,
501
+ 0
502
+ );
503
+ const crossGapValue = direction === "row" ? gap.vertical : gap.horizontal;
504
+ const totalLineGaps = (lines.length - 1) * crossGapValue;
505
+ if (direction === "row" && (containerProps.height === void 0 || containerProps.height === "auto")) {
506
+ adjustedContainerHeight = totalCrossSize + totalLineGaps + padding.top + padding.bottom;
507
+ } else if (direction === "column" && (containerProps.width === void 0 || containerProps.width === "auto")) {
508
+ adjustedContainerWidth = totalCrossSize + totalLineGaps + padding.left + padding.right;
509
+ }
510
+ const availableCrossSize = direction === "row" ? contentArea.height : contentArea.width;
511
+ const freeCrossSpace = availableCrossSize - totalCrossSize - totalLineGaps;
512
+ const alignContent = containerProps.alignContent ?? "stretch";
513
+ let crossOffset = 0;
514
+ let lineCrossSpacing = 0;
515
+ if (alignContent === "center") {
516
+ crossOffset = freeCrossSpace / 2;
517
+ } else if (alignContent === "end") {
518
+ crossOffset = freeCrossSpace;
519
+ } else if (alignContent === "space-between" && lines.length > 1) {
520
+ lineCrossSpacing = freeCrossSpace / (lines.length - 1);
521
+ } else if (alignContent === "space-around") {
522
+ lineCrossSpacing = freeCrossSpace / lines.length;
523
+ crossOffset = lineCrossSpacing / 2;
524
+ }
525
+ for (const line of lines) {
526
+ let lineChildren = line.children;
527
+ if (flexDistributor.hasFlexChildren(line.children)) {
528
+ const lineGapSpace2 = (line.children.length - 1) * mainGapValue;
529
+ const lineAvailableSpace = availableMainSize - lineGapSpace2;
530
+ lineChildren = flexDistributor.distributeFlexSpace(line.children, lineAvailableSpace, direction);
531
+ line.mainAxisSize = lineChildren.reduce((sum, child) => {
532
+ const size = direction === "row" ? child.size.width : child.size.height;
533
+ const margin = childUtils.getMargin(child.child);
534
+ const marginSize = direction === "row" ? (margin.left ?? 0) + (margin.right ?? 0) : (margin.top ?? 0) + (margin.bottom ?? 0);
535
+ return sum + size + marginSize;
536
+ }, 0);
537
+ }
538
+ const lineMainSize = line.mainAxisSize;
539
+ const lineAvailableMain = availableMainSize;
540
+ const lineRemainingSpace = lineAvailableMain - lineMainSize;
541
+ const lineGapSpace = (line.children.length - 1) * mainGapValue;
542
+ const lineFreeSpace = lineRemainingSpace - lineGapSpace;
543
+ const lineJustifyResult = spacingCalculator.calculateJustifyContent(
544
+ justifyContent,
545
+ lineFreeSpace,
546
+ line.children.length
547
+ );
548
+ let lineMainOffset = lineJustifyResult.mainStart;
549
+ const lineSpaceBetween = lineJustifyResult.spaceBetween;
550
+ for (let i = 0; i < lineChildren.length; i++) {
551
+ const child = lineChildren[i];
552
+ if (!child) continue;
553
+ const margin = childUtils.getMargin(child.child);
554
+ let x;
555
+ let y;
556
+ if (direction === "row") {
557
+ lineMainOffset += margin.left ?? 0;
558
+ x = padding.left + lineMainOffset;
559
+ const childCrossOffset = spacingCalculator.calculateAlignItems(
560
+ alignItems,
561
+ line.crossAxisSize,
562
+ child.size.height,
563
+ margin.top ?? 0,
564
+ margin.bottom ?? 0
565
+ );
566
+ y = padding.top + crossOffset + childCrossOffset;
567
+ lineMainOffset += child.size.width + (margin.right ?? 0);
568
+ if (i < lineChildren.length - 1) {
569
+ lineMainOffset += mainGapValue + lineSpaceBetween;
570
+ }
571
+ } else {
572
+ lineMainOffset += margin.top ?? 0;
573
+ y = padding.top + lineMainOffset;
574
+ const childCrossOffset = spacingCalculator.calculateAlignItems(
575
+ alignItems,
576
+ line.crossAxisSize,
577
+ child.size.width,
578
+ margin.left ?? 0,
579
+ margin.right ?? 0
580
+ );
581
+ x = padding.left + crossOffset + childCrossOffset;
582
+ lineMainOffset += child.size.height + (margin.bottom ?? 0);
583
+ if (i < lineChildren.length - 1) {
584
+ lineMainOffset += mainGapValue + lineSpaceBetween;
585
+ }
586
+ }
587
+ const childIndex = finalLayoutChildren.indexOf(child);
588
+ if (childIndex !== -1) {
589
+ positions[childIndex] = { x, y };
590
+ }
591
+ }
592
+ crossOffset += line.crossAxisSize + crossGapValue + lineCrossSpacing;
593
+ }
594
+ } else {
595
+ let currentMain = mainStart;
596
+ for (let i = 0; i < finalLayoutChildren.length; i++) {
597
+ const child = finalLayoutChildren[i];
598
+ if (!child) continue;
599
+ const result = strategy.positionChild(child, i, context, currentMain);
600
+ positions.push(result.position);
601
+ currentMain = result.nextMain;
602
+ if (direction !== "stack" && i < finalLayoutChildren.length - 1) {
603
+ currentMain += gapValue + spaceBetween;
604
+ }
605
+ }
606
+ }
607
+ positionApplier.applyChildPositions(finalLayoutChildren, positions);
608
+ containerApplier.applyContainerDimensions(container, adjustedContainerWidth, adjustedContainerHeight);
609
+ getOnAfterLayout()(container, adjustedContainerWidth, adjustedContainerHeight);
610
+ applyOverflowMask(container, containerProps, adjustedContainerWidth, adjustedContainerHeight);
611
+ devConfig.DebugLogger.timeEnd("performance", "calculateLayout");
612
+ invalidateParentLayoutIfNeeded(
613
+ container,
614
+ oldContainerSize,
615
+ adjustedContainerWidth,
616
+ adjustedContainerHeight
617
+ );
618
+ }
619
+ function calculateLayout(container, containerProps, parentSize, parentPadding) {
620
+ LayoutBatchQueue.schedule(container, containerProps, parentSize, parentPadding);
621
+ }
622
+ exports.DeferredLayoutQueue = DeferredLayoutQueue;
623
+ exports.LayoutBatchQueue = LayoutBatchQueue;
624
+ exports.calculateLayout = calculateLayout;
625
+ exports.registerApplyOverflowClip = registerApplyOverflowClip;
626
+ exports.setAfterLayout = setAfterLayout;
627
+ exports.setApplyOverflowClip = setApplyOverflowClip;
628
+ //# sourceMappingURL=layout-engine.cjs.map