@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,414 @@
1
+ /**
2
+ * Host Adapter — renderer-neutral interface for VDOM ↔ engine bridge.
3
+ *
4
+ * Defines the abstract contracts that every renderer (Phaser, PixiJS, ...)
5
+ * must implement. The VDOM operates exclusively against these interfaces.
6
+ *
7
+ * This file lives alongside the existing host.ts during Phase 1 migration.
8
+ * Once vdom.ts runs entirely through these interfaces, host.ts becomes the
9
+ * Phaser-specific implementation of HostAdapter + SurfaceAdapter.
10
+ *
11
+ * @migration(audit:scene-portal-mount) Phase 1 — HostAdapter + SurfaceAdapter definieren
12
+ */
13
+ /** Opaque handle for any renderer-native node (GameObject, DisplayObject, ...) */
14
+ export type HostNode = unknown;
15
+ /** Opaque handle for any renderer-native parent (Scene, Container, Stage, ...) */
16
+ export type HostParent = unknown;
17
+ /** Opaque handle for the renderer-native mount target (Scene, Stage, Canvas, App, ...) */
18
+ export type SurfaceTarget = unknown;
19
+ /** Node type identifier — maps to renderer-specific intrinsic elements */
20
+ export type NodeType = string;
21
+ /** Generic props bag — renderer declares its own typed subsets */
22
+ export type Props = Record<string, unknown>;
23
+ /** Renderer-bound VDOM operations for portable components */
24
+ export interface VDOMOperations {
25
+ /** Mount a VNode into a parent */
26
+ mount: (parent: HostParent, vnode: unknown) => HostNode;
27
+ /** Patch an existing VNode tree */
28
+ patchVNode: (parent: HostParent, oldV: unknown | null, newV: unknown | null) => void;
29
+ /** Unmount and cleanup a VNode */
30
+ unmount: (vnode: unknown | null | undefined | false) => void;
31
+ }
32
+ /** Logical viewport dimensions for a surface */
33
+ export interface SurfaceViewport {
34
+ readonly width: number;
35
+ readonly height: number;
36
+ }
37
+ /** Opaque handle for cancelling a scheduled callback or lifecycle listener */
38
+ export type HostCancelHandle = {
39
+ cancel(): void;
40
+ };
41
+ /**
42
+ * Scheduler abstraction for frame ticks and timer-based deferred work.
43
+ *
44
+ * This deliberately does not model renderer tween systems yet. Tweens are a
45
+ * higher-level animation capability and can remain renderer-native until the
46
+ * portable contract is clear.
47
+ */
48
+ export interface HostScheduler {
49
+ /**
50
+ * Schedule a callback for the next frame/animation tick.
51
+ * Returns a cancel handle.
52
+ */
53
+ requestAnimationFrame(callback: (dt: number) => void): HostCancelHandle;
54
+ /**
55
+ * Register a persistent per-frame callback.
56
+ * Returns a cancel handle.
57
+ * Equivalent to: scene.events.on('update', callback)
58
+ */
59
+ onFrame(callback: (dt: number) => void): HostCancelHandle;
60
+ /**
61
+ * Schedule a one-shot callback after `delay` milliseconds.
62
+ * Returns a cancel handle.
63
+ * Equivalent to: scene.time.addEvent({ delay, callback })
64
+ */
65
+ setTimeout(callback: () => void, delay: number): HostCancelHandle;
66
+ /**
67
+ * Schedule a repeating callback every `interval` milliseconds.
68
+ * Returns a cancel handle.
69
+ * Equivalent to: scene.time.addEvent({ delay: interval, loop: true, callback })
70
+ */
71
+ setInterval(callback: () => void, interval: number): HostCancelHandle;
72
+ }
73
+ /**
74
+ * Portable texture loader — renderer-agnostic asset loading.
75
+ *
76
+ * Each renderer provides its own implementation. The useTexture hook
77
+ * delegates to this interface so components never import renderer code.
78
+ */
79
+ export interface TextureLoader {
80
+ /**
81
+ * Load a texture from a URL and register it under `key`.
82
+ * Returns a promise that resolves when loading is complete.
83
+ * If the texture is already loaded, resolves immediately.
84
+ */
85
+ load(key: string, url: string): Promise<void>;
86
+ /**
87
+ * Load a texture atlas (spritesheet) from image + data URLs.
88
+ * Registers the atlas under `key` so frames can be referenced
89
+ * via `<Image texture={key} frame="frameName" />`.
90
+ */
91
+ loadAtlas(key: string, imageUrl: string, dataUrl: string): Promise<void>;
92
+ /**
93
+ * Render an SVG string to a texture and register it under `key`.
94
+ * The renderer creates a canvas, draws the SVG, and registers
95
+ * the resulting bitmap as a texture.
96
+ */
97
+ loadSVG(key: string, svg: string, width: number, height: number): Promise<void>;
98
+ /**
99
+ * Check whether a texture key is ready for use.
100
+ */
101
+ isLoaded(key: string): boolean;
102
+ }
103
+ /**
104
+ * Pixel rectangle within a texture.
105
+ * Used by portable components (e.g. NineSlice) to reference sub-regions
106
+ * of an atlas frame or standalone texture.
107
+ */
108
+ export interface FrameRect {
109
+ /** Left offset in pixels (relative to texture or frame origin) */
110
+ x: number;
111
+ /** Top offset in pixels */
112
+ y: number;
113
+ /** Width in pixels */
114
+ width: number;
115
+ /** Height in pixels */
116
+ height: number;
117
+ }
118
+ /**
119
+ * Logical size (width × height) in pixels.
120
+ */
121
+ export interface Size {
122
+ width: number;
123
+ height: number;
124
+ }
125
+ /**
126
+ * Portable metadata for a single atlas frame.
127
+ */
128
+ export interface AtlasFrameInfo {
129
+ /** Frame name within the atlas */
130
+ name: string;
131
+ /** Frame region in atlas pixel coordinates */
132
+ rect: FrameRect;
133
+ /** Whether the frame is rotated in atlas packing */
134
+ rotated: boolean;
135
+ /** Whether the frame is trimmed in atlas packing */
136
+ trimmed: boolean;
137
+ /** Original untrimmed source dimensions, when available */
138
+ sourceSize?: Size | undefined;
139
+ /** Placement of the trimmed sprite within the untrimmed source bounds */
140
+ spriteSourceRect?: {
141
+ x: number;
142
+ y: number;
143
+ w: number;
144
+ h: number;
145
+ } | undefined;
146
+ }
147
+ /**
148
+ * Extended texture loader with frame/region metadata queries.
149
+ *
150
+ * Portable components that need to inspect atlas frame geometry
151
+ * (e.g. NineSlice slicing) depend on this interface instead of
152
+ * renderer-specific texture APIs.
153
+ *
154
+ * Each renderer provides its own implementation — typically a thin
155
+ * wrapper around the native texture manager.
156
+ */
157
+ export interface TextureResolver extends TextureLoader {
158
+ /**
159
+ * All available frame names within the atlas identified by `key`.
160
+ * Returns an empty array if the key has no atlas frames or is not loaded.
161
+ */
162
+ getFrameNames(key: string): string[];
163
+ /**
164
+ * Pixel region of a named frame within the atlas identified by `key`.
165
+ * Returns `undefined` if the key or frame is not loaded.
166
+ */
167
+ getFrameRect(key: string, frame: string): FrameRect | undefined;
168
+ /**
169
+ * Full metadata for a named atlas frame.
170
+ * Returns `undefined` if the key or frame is not loaded.
171
+ */
172
+ getFrameInfo(key: string, frame: string): AtlasFrameInfo | undefined;
173
+ /**
174
+ * Total pixel dimensions of the texture registered under `key`.
175
+ * Returns `undefined` if the key is not loaded.
176
+ */
177
+ getTextureSize(key: string): Size | undefined;
178
+ }
179
+ /**
180
+ * Context for a single renderer surface (scene, stage, root view).
181
+ * This is the context passed to the VDOM, hooks, layout and host descriptors.
182
+ */
183
+ export interface SurfaceContext {
184
+ /** Viewport dimensions for this surface in logical pixels */
185
+ readonly viewport: SurfaceViewport;
186
+ /** Scheduler tied to this surface's lifecycle */
187
+ readonly scheduler: HostScheduler;
188
+ /** Set of capability flags the renderer supports */
189
+ readonly capabilities: ReadonlySet<string>;
190
+ /** Design tokens for this surface (colors, text styles, spacing, sizes, radius) */
191
+ readonly themeTokens?: Record<string, unknown> | undefined;
192
+ /** Escape hatch: the underlying renderer-native context (Phaser.Scene, PIXI.Application, ...) */
193
+ readonly raw?: SurfaceTarget;
194
+ /**
195
+ * RootSurface that owns this context.
196
+ * Enables portable overlays to nest relative to the currently active surface
197
+ * instead of always falling back to the renderer target.
198
+ */
199
+ readonly rootSurface?: RootSurface;
200
+ /**
201
+ * SurfaceAdapter for this renderer instance.
202
+ * Set by the renderer during surface creation. Enables portable hooks
203
+ * (e.g., usePortalSurface) to create/destroy portal surfaces without
204
+ * importing renderer-specific code.
205
+ */
206
+ readonly adapter?: SurfaceAdapter;
207
+ /**
208
+ * Renderer-bound VDOM operations (mount, patchVNode, unmount).
209
+ * Set by the renderer during surface creation. Enables portable components
210
+ * (e.g., Portal) to manipulate the VDOM without importing renderer-specific
211
+ * modules. Each renderer has its own VDOM runtime — this field ensures
212
+ * the correct one is used even when multiple renderers coexist.
213
+ */
214
+ readonly vdom?: VDOMOperations;
215
+ /** Optional texture loader — enables portable useTexture hook. */
216
+ readonly textureLoader?: TextureLoader;
217
+ /**
218
+ * Optional debug snapshot collector provided by the renderer.
219
+ * Returns a partial debug snapshot (key → string|number).
220
+ * The generic {@link useDebugSnapshot} hook delegates to this
221
+ * function when available. Each renderer wires its own collector
222
+ * (e.g., Phaser provides FPS/texture count, Pixi provides ticker stats).
223
+ */
224
+ readonly debugSnapshotCollector?: (() => Record<string, string | number>) | undefined;
225
+ }
226
+ /**
227
+ * Compatibility name for operations that conceptually run on host nodes.
228
+ * SurfaceContext is the single source of truth to avoid two diverging context
229
+ * shapes during the migration.
230
+ */
231
+ export type HostContext = SurfaceContext;
232
+ /**
233
+ * Descriptor for a single node type.
234
+ * Each renderer registers one descriptor per intrinsic element it supports.
235
+ */
236
+ export interface HostDescriptor<TProps extends Props = Props, TNode extends HostNode = HostNode> {
237
+ /** Create a new node instance from props */
238
+ create(props: TProps, ctx: HostContext): TNode;
239
+ /** Apply prop changes to an existing node. Called by VDOM diff. */
240
+ patch(node: TNode, prev: TProps, next: TProps, ctx: HostContext): void;
241
+ /** Optional: explicit destruction. If not provided, HostAdapter.remove handles cleanup. */
242
+ destroy?(node: TNode, ctx: HostContext): void;
243
+ }
244
+ /**
245
+ * Central adapter that the VDOM calls for all node operations.
246
+ * Each renderer package provides its own implementation.
247
+ */
248
+ export interface HostAdapter {
249
+ /**
250
+ * Create a node of the given type.
251
+ * Delegates to the registered HostDescriptor for that type.
252
+ */
253
+ create(type: NodeType, props: Props, ctx: HostContext): HostNode;
254
+ /**
255
+ * Update properties on an existing node.
256
+ * Delegates to the registered HostDescriptor for that type.
257
+ */
258
+ patch(type: NodeType, node: HostNode, prev: Props, next: Props, ctx: HostContext): void;
259
+ /**
260
+ * Append a child node to a parent.
261
+ * The parent may be a root container, a scene, or another node.
262
+ */
263
+ append(parent: HostParent, child: HostNode, ctx: HostContext): void;
264
+ /**
265
+ * Optional: insert a child before an existing sibling without remounting.
266
+ * Used by keyed VDOM reconciliation and z/order-sensitive renderers.
267
+ */
268
+ insertBefore?(parent: HostParent, child: HostNode, before: HostNode | null, ctx: HostContext): void;
269
+ /**
270
+ * Remove a child node from a parent and destroy it.
271
+ */
272
+ remove(parent: HostParent, child: HostNode, ctx: HostContext): void;
273
+ /**
274
+ * Get children of a parent node.
275
+ * Used by layout engine and portal sorting.
276
+ */
277
+ getChildren(parent: HostParent): readonly HostNode[];
278
+ /**
279
+ * Check if a node or parent is still alive (not destroyed, surface not shut down).
280
+ * Used by MountRegistry and lifecycle checks.
281
+ */
282
+ isAlive(target: HostNode | HostParent): boolean;
283
+ /**
284
+ * Optional: check if a parent is a top-level surface (scene/stage).
285
+ * Replaces isPhaserScene() type guards.
286
+ */
287
+ isSurface?(target: SurfaceTarget): boolean;
288
+ /**
289
+ * Set node position in local coordinate space.
290
+ * Used by layout engine for child placement.
291
+ */
292
+ setPosition?(node: HostNode, x: number, y: number): void;
293
+ /**
294
+ * Set node dimensions.
295
+ * Used by layout engine for child sizing.
296
+ */
297
+ setSize?(node: HostNode, width: number, height: number): void;
298
+ /**
299
+ * Set node depth/z-order in the display list.
300
+ */
301
+ setDepth?(node: HostNode, depth: number): void;
302
+ /**
303
+ * Set node visibility.
304
+ */
305
+ setVisible?(node: HostNode, visible: boolean): void;
306
+ /**
307
+ * Set node alpha/opacity (0 = transparent, 1 = opaque).
308
+ */
309
+ setAlpha?(node: HostNode, alpha: number): void;
310
+ /**
311
+ * Derive SurfaceContext from a parent or node.
312
+ * Enables hooks and components to access viewport, scheduler, capabilities.
313
+ */
314
+ getSurfaceContext?(target: HostNode | HostParent): SurfaceContext;
315
+ }
316
+ /**
317
+ * A mounted root — either the main scene root (Portal 0) or a Portal overlay.
318
+ */
319
+ export interface RootSurface {
320
+ /** Unique identifier for this root */
321
+ readonly id: string;
322
+ /** Semantic kind */
323
+ readonly kind: 'root' | 'portal';
324
+ /** Z-order among sibling root surfaces (higher = on top) */
325
+ readonly zIndex: number;
326
+ /** Optional parent surface (for portal nesting) */
327
+ readonly parent?: RootSurface;
328
+ /** Context for this surface */
329
+ readonly context: SurfaceContext;
330
+ /** The renderer-native root container for mounting VDOM children */
331
+ readonly root: HostParent;
332
+ }
333
+ export type RootSurfaceKind = RootSurface['kind'];
334
+ interface RootSurfaceOptionsBase {
335
+ /** Unique identifier for this root */
336
+ readonly id?: string;
337
+ /** Z-order among sibling root surfaces (higher = on top) */
338
+ readonly zIndex?: number;
339
+ /** Initial viewport width for this root */
340
+ readonly width: number;
341
+ /** Initial viewport height for this root */
342
+ readonly height: number;
343
+ }
344
+ export type CreateRootSurfaceOptions = (RootSurfaceOptionsBase & {
345
+ /** Portal 0 / main mount root */
346
+ readonly kind?: Extract<RootSurfaceKind, 'root'>;
347
+ /** Renderer-native target for the root surface */
348
+ readonly target: SurfaceTarget;
349
+ readonly parent?: undefined;
350
+ }) | (RootSurfaceOptionsBase & {
351
+ /** Additional portal root */
352
+ readonly kind: Extract<RootSurfaceKind, 'portal'>;
353
+ /** Parent surface that owns the renderer context and z-order group */
354
+ readonly parent: RootSurface;
355
+ /**
356
+ * Optional override target. If omitted, the adapter uses the parent
357
+ * surface's renderer target.
358
+ */
359
+ readonly target?: SurfaceTarget;
360
+ });
361
+ export interface UpdateRootSurfaceOptions {
362
+ readonly zIndex?: number;
363
+ readonly width?: number;
364
+ readonly height?: number;
365
+ }
366
+ /**
367
+ * Adapter for creating and managing root surfaces.
368
+ * Each renderer provides its own implementation.
369
+ */
370
+ export interface SurfaceAdapter {
371
+ /**
372
+ * Create a new root surface. For Phaser this wraps scene.add.container().
373
+ * For the main mount (Portal 0), this creates the implicit root.
374
+ * For <Portal>, this creates an overlay root container.
375
+ */
376
+ createRoot(options: CreateRootSurfaceOptions): RootSurface;
377
+ /**
378
+ * Update an existing root surface's properties.
379
+ */
380
+ updateRoot(surface: RootSurface, options: UpdateRootSurfaceOptions): void;
381
+ /**
382
+ * Destroy a root surface and all its children.
383
+ */
384
+ destroyRoot(surface: RootSurface): void;
385
+ /**
386
+ * Optional: re-sort root surfaces by zIndex.
387
+ * Called when portal z-order changes.
388
+ */
389
+ sortRoots?(roots: readonly RootSurface[]): void;
390
+ /**
391
+ * Optional: check if a root surface is still backed by a live renderer target.
392
+ */
393
+ isAlive?(surface: RootSurface): boolean;
394
+ /**
395
+ * Optional: callback when the surface's lifecycle ends (scene shutdown, stage destroy).
396
+ * The Core calls this to clean up MountRegistry entries.
397
+ */
398
+ onDestroy?(surface: RootSurface, callback: () => void): HostCancelHandle;
399
+ /**
400
+ * Optional: find a root surface by its renderer-native target.
401
+ * Used by Portal to locate the parent RootSurface for a given scene/stage.
402
+ *
403
+ * @migration(audit:scene-portal-mount) Phase 6B — enables Portal → SurfaceAdapter migration.
404
+ */
405
+ getRootByTarget?(target: SurfaceTarget): RootSurface | undefined;
406
+ /**
407
+ * Optional: synchronize event blocking for a portal surface.
408
+ * Implementations should register or unregister the portal root as a
409
+ * transparent blocker and refresh its hit area from the rendered content.
410
+ */
411
+ syncPortalEventBlocking?(surface: RootSurface, blockEvents: boolean): void;
412
+ }
413
+ export {};
414
+ //# sourceMappingURL=host-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-adapter.d.ts","sourceRoot":"","sources":["../src/host-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAA;AAE9B,kFAAkF;AAClF,MAAM,MAAM,UAAU,GAAG,OAAO,CAAA;AAEhC,0FAA0F;AAC1F,MAAM,MAAM,aAAa,GAAG,OAAO,CAAA;AAEnC,0EAA0E;AAC1E,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAA;AAE7B,kEAAkE;AAClE,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAM3C,6DAA6D;AAC7D,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,KAAK,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,KAAK,QAAQ,CAAA;IACvD,mCAAmC;IACnC,UAAU,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IACpF,kCAAkC;IAClC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,KAAK,IAAI,CAAA;CAC7D;AAED,gDAAgD;AAChD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,8EAA8E;AAC9E,MAAM,MAAM,gBAAgB,GAAG;IAAE,MAAM,IAAI,IAAI,CAAA;CAAE,CAAA;AAMjD;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,qBAAqB,CAAC,QA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EAAE,QAAQ,CAAC,CAAA;IAEjD,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAE5B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;CAChC,CAAC,CAAA;AAEN,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,wBAAwB,GAAG,WAAW,CAAA;IAE1D;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAAA;IAEzE;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAEvC;;;OAGG;IACH,SAAS,CAAC,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,IAAI,CAAA;IAE/C;;OAEG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAA;IAEvC;;;OAGG;IACH,SAAS,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,gBAAgB,CAAA;IAExE;;;;;OAKG;IACH,eAAe,CAAC,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,GAAG,SAAS,CAAA;IAEhE;;;;OAIG;IACH,uBAAuB,CAAC,CAAC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,CAAA;CAC3E"}
package/dist/index.cjs ADDED
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxDevRuntime = require("./jsx-dev-runtime.cjs");
4
+ const jsxRuntime = require("./jsx-runtime.cjs");
5
+ const memo = require("./memo.cjs");
6
+ const devConfig = require("./dev-config.cjs");
7
+ const coreProps = require("./core-props.cjs");
8
+ const borderGeometry = require("./border-geometry.cjs");
9
+ const placeholder = require("./placeholder.cjs");
10
+ const portal = require("./portal.cjs");
11
+ const layoutEngine = require("./layout/layout-engine.cjs");
12
+ const childUtils = require("./layout/utils/child-utils.cjs");
13
+ const dimensionCalculator = require("./layout/utils/dimension-calculator.cjs");
14
+ const flexDistributor = require("./layout/utils/flex-distributor.cjs");
15
+ const sizeResolver = require("./layout/utils/size-resolver.cjs");
16
+ const spacingCalculator = require("./layout/utils/spacing-calculator.cjs");
17
+ const baseStrategy = require("./layout/strategies/base-strategy.cjs");
18
+ const columnLayout = require("./layout/strategies/column-layout.cjs");
19
+ const rowLayout = require("./layout/strategies/row-layout.cjs");
20
+ const stackLayout = require("./layout/strategies/stack-layout.cjs");
21
+ const colorTypes = require("./colors/color-types.cjs");
22
+ const colorUtils = require("./colors/color-utils.cjs");
23
+ const contrastContracts = require("./colors/contrast-contracts.cjs");
24
+ const colorPresets = require("./colors/color-presets.cjs");
25
+ const colorThemeHelpers = require("./colors/color-theme-helpers.cjs");
26
+ const designTokenPresets = require("./design-tokens/design-token-presets.cjs");
27
+ const theme = require("./theme.cjs");
28
+ const effects = require("./effects.cjs");
29
+ const hooks = require("./hooks.cjs");
30
+ const effectEngine = require("./animation/effect-engine.cjs");
31
+ const animatedSignal = require("./animation/animated-signal.cjs");
32
+ const createSpring = require("./animation/create-spring.cjs");
33
+ const easing = require("./animation/easing.cjs");
34
+ const effectDefinitions = require("./animation/effect-definitions.cjs");
35
+ const springPhysics = require("./animation/spring-physics.cjs");
36
+ const tween = require("./animation/tween.cjs");
37
+ const useSpring = require("./animation/useSpring.cjs");
38
+ const useTween = require("./animation/useTween.cjs");
39
+ const primitiveContracts = require("./primitive-contracts.cjs");
40
+ const createRuntime = require("./vdom/create-runtime.cjs");
41
+ const utils = require("./vdom/utils.cjs");
42
+ const ninesliceContract = require("./nineslice-contract.cjs");
43
+ const signalsCore = require("@preact/signals-core");
44
+ exports.jsxDEV = jsxDevRuntime.jsxDEV;
45
+ exports.Fragment = jsxRuntime.Fragment;
46
+ exports.jsx = jsxRuntime.jsx;
47
+ exports.jsxs = jsxRuntime.jsxs;
48
+ exports.memo = memo.memo;
49
+ exports.noMemo = memo.noMemo;
50
+ exports.DebugLogger = devConfig.DebugLogger;
51
+ exports.DevConfig = devConfig.DevConfig;
52
+ exports.DevPresets = devConfig.DevPresets;
53
+ exports.clampToViewport = coreProps.clampToViewport;
54
+ exports.getOverlayPosition = coreProps.getOverlayPosition;
55
+ exports.normalizeCornerRadius = coreProps.normalizeCornerRadius;
56
+ exports.normalizeEdgeInsets = coreProps.normalizeEdgeInsets;
57
+ exports.normalizeGap = coreProps.normalizeGap;
58
+ exports.drawBorderGeometry = borderGeometry.drawBorderGeometry;
59
+ exports.hasAnyCornerRadius = borderGeometry.hasAnyCornerRadius;
60
+ exports.isUniformBorder = borderGeometry.isUniformBorder;
61
+ exports.resolveBorderSides = borderGeometry.resolveBorderSides;
62
+ exports.resolveCornerRadii = borderGeometry.resolveCornerRadii;
63
+ exports.shouldUseCoreBorderGeometry = borderGeometry.shouldUseCoreBorderGeometry;
64
+ exports.logNotYetImplemented = placeholder.logNotYetImplemented;
65
+ exports.usePortalSurface = portal.usePortalSurface;
66
+ exports.DeferredLayoutQueue = layoutEngine.DeferredLayoutQueue;
67
+ exports.LayoutBatchQueue = layoutEngine.LayoutBatchQueue;
68
+ exports.calculateLayout = layoutEngine.calculateLayout;
69
+ exports.registerApplyOverflowClip = layoutEngine.registerApplyOverflowClip;
70
+ exports.setAfterLayout = layoutEngine.setAfterLayout;
71
+ exports.setApplyOverflowClip = layoutEngine.setApplyOverflowClip;
72
+ exports.getChildSize = childUtils.getChildSize;
73
+ exports.getMargin = childUtils.getMargin;
74
+ exports.isLayoutChild = childUtils.isLayoutChild;
75
+ exports.processNestedContainer = childUtils.processNestedContainer;
76
+ exports.calculateContainerSize = dimensionCalculator.calculateContainerSize;
77
+ exports.calculateContentDimensions = dimensionCalculator.calculateContentDimensions;
78
+ exports.normalizePadding = dimensionCalculator.normalizePadding;
79
+ exports.distributeFlexSpace = flexDistributor.distributeFlexSpace;
80
+ exports.hasFlexChildren = flexDistributor.hasFlexChildren;
81
+ exports.clampSize = sizeResolver.clampSize;
82
+ exports.clearSizeCaches = sizeResolver.clearSizeCaches;
83
+ exports.isExplicit = sizeResolver.isExplicit;
84
+ exports.parseSize = sizeResolver.parseSize;
85
+ exports.requiresParent = sizeResolver.requiresParent;
86
+ exports.resolveSize = sizeResolver.resolveSize;
87
+ exports.calculateAlignItems = spacingCalculator.calculateAlignItems;
88
+ exports.calculateJustifyContent = spacingCalculator.calculateJustifyContent;
89
+ exports.BaseLayoutStrategy = baseStrategy.BaseLayoutStrategy;
90
+ exports.ColumnLayoutStrategy = columnLayout.ColumnLayoutStrategy;
91
+ exports.RowLayoutStrategy = rowLayout.RowLayoutStrategy;
92
+ exports.StackLayoutStrategy = stackLayout.StackLayoutStrategy;
93
+ exports.HexColor = colorTypes.HexColor;
94
+ exports.alpha = colorUtils.alpha;
95
+ exports.createTextStyle = colorUtils.createTextStyle;
96
+ exports.darken = colorUtils.darken;
97
+ exports.darkenHex = colorUtils.darkenHex;
98
+ exports.ensureContrast = colorUtils.ensureContrast;
99
+ exports.getContrastRatio = colorUtils.getContrastRatio;
100
+ exports.hexToNumber = colorUtils.hexToNumber;
101
+ exports.hslToNumber = colorUtils.hslToNumber;
102
+ exports.hslToRgb = colorUtils.hslToRgb;
103
+ exports.lighten = colorUtils.lighten;
104
+ exports.lightenHex = colorUtils.lightenHex;
105
+ exports.normalizeColorNumber = colorUtils.normalizeColorNumber;
106
+ exports.normalizeTextColor = colorUtils.normalizeTextColor;
107
+ exports.numberToHex = colorUtils.numberToHex;
108
+ exports.numberToHsl = colorUtils.numberToHsl;
109
+ exports.numberToRgb = colorUtils.numberToRgb;
110
+ exports.rgbToHsl = colorUtils.rgbToHsl;
111
+ exports.rgbToNumber = colorUtils.rgbToNumber;
112
+ exports.contrastBackgroundRoles = contrastContracts.contrastBackgroundRoles;
113
+ exports.contrastForegroundRoles = contrastContracts.contrastForegroundRoles;
114
+ exports.defaultContrastContracts = contrastContracts.defaultContrastContracts;
115
+ exports.formatResolvedContrastContract = contrastContracts.formatResolvedContrastContract;
116
+ exports.getContrastContract = contrastContracts.getContrastContract;
117
+ exports.getFailingContrastContracts = contrastContracts.getFailingContrastContracts;
118
+ exports.resolveContrastBackgroundRole = contrastContracts.resolveContrastBackgroundRole;
119
+ exports.resolveContrastColorRef = contrastContracts.resolveContrastColorRef;
120
+ exports.resolveContrastContract = contrastContracts.resolveContrastContract;
121
+ exports.resolveContrastContractById = contrastContracts.resolveContrastContractById;
122
+ exports.resolveContrastForegroundRole = contrastContracts.resolveContrastForegroundRole;
123
+ exports.resolveContrastTextColor = contrastContracts.resolveContrastTextColor;
124
+ exports.resolveContrastTintColor = contrastContracts.resolveContrastTintColor;
125
+ exports.validateContrastContracts = contrastContracts.validateContrastContracts;
126
+ exports.applyDarkMode = colorPresets.applyDarkMode;
127
+ exports.applyLightMode = colorPresets.applyLightMode;
128
+ exports.forestGreenPreset = colorPresets.forestGreenPreset;
129
+ exports.generateColorScale = colorPresets.generateColorScale;
130
+ exports.getPreset = colorPresets.getPreset;
131
+ exports.getPresetWithMode = colorPresets.getPresetWithMode;
132
+ exports.midnightPreset = colorPresets.midnightPreset;
133
+ exports.oceanBluePreset = colorPresets.oceanBluePreset;
134
+ exports.presets = colorPresets.presets;
135
+ exports.colorsToTheme = colorThemeHelpers.colorsToTheme;
136
+ exports.getBackgroundColor = colorThemeHelpers.getBackgroundColor;
137
+ exports.getBorderColor = colorThemeHelpers.getBorderColor;
138
+ exports.getSurfaceColor = colorThemeHelpers.getSurfaceColor;
139
+ exports.getTextColor = colorThemeHelpers.getTextColor;
140
+ exports.createDesignTokens = designTokenPresets.createDesignTokens;
141
+ exports.createTextStyleTokens = designTokenPresets.createTextStyleTokens;
142
+ exports.defaultRadiusTokens = designTokenPresets.defaultRadiusTokens;
143
+ exports.defaultSizeTokens = designTokenPresets.defaultSizeTokens;
144
+ exports.defaultSpacingTokens = designTokenPresets.defaultSpacingTokens;
145
+ exports.defaultTextStyleTokens = designTokenPresets.defaultTextStyleTokens;
146
+ exports.KNOWN_COMPONENTS = theme.KNOWN_COMPONENTS;
147
+ exports.createDefaultTheme = theme.createDefaultTheme;
148
+ exports.createTheme = theme.createTheme;
149
+ exports.deepMergeDefined = theme.deepMergeDefined;
150
+ exports.defaultTheme = theme.defaultTheme;
151
+ exports.extractNestedThemes = theme.extractNestedThemes;
152
+ exports.getAvailablePresets = theme.getAvailablePresets;
153
+ exports.getCurrentPreset = theme.getCurrentPreset;
154
+ exports.getGlobalThemeDefaults = theme.getGlobalThemeDefaults;
155
+ exports.getThemedProps = theme.getThemedProps;
156
+ exports.mergeThemes = theme.mergeThemes;
157
+ exports.normalizeThemeComponentName = theme.normalizeThemeComponentName;
158
+ exports.registerComponentDefaults = theme.registerComponentDefaults;
159
+ exports.registerComponentDefaultsIfMissing = theme.registerComponentDefaultsIfMissing;
160
+ exports.registerComponentThemeDefaults = theme.registerComponentThemeDefaults;
161
+ exports.resolveComponentTheme = theme.resolveComponentTheme;
162
+ exports.setColorMode = theme.setColorMode;
163
+ exports.setColorPreset = theme.setColorPreset;
164
+ exports.setThemeRemountHandler = theme.setThemeRemountHandler;
165
+ exports.themeRegistry = theme.themeRegistry;
166
+ exports.DEFAULT_EFFECT = effects.DEFAULT_EFFECT;
167
+ exports.applyEffect = effects.applyEffect;
168
+ exports.applyEffectByName = effects.applyEffectByName;
169
+ exports.registerEffect = effects.registerEffect;
170
+ exports.registerEffectRunner = effects.registerEffectRunner;
171
+ exports.registerEffectStopRunner = effects.registerEffectStopRunner;
172
+ exports.resolveEffect = effects.resolveEffect;
173
+ exports.resolveEffectTransformOrigin = effects.resolveEffectTransformOrigin;
174
+ exports.stopEffect = effects.stopEffect;
175
+ exports.depsChanged = hooks.depsChanged;
176
+ exports.disposeCtx = hooks.disposeCtx;
177
+ exports.getCurrentCtx = hooks.getCurrentCtx;
178
+ exports.getCurrentOrThrow = hooks.getCurrentOrThrow;
179
+ exports.setCurrentCtx = hooks.setCurrentCtx;
180
+ exports.setUpdateHandler = hooks.setUpdateHandler;
181
+ exports.shallowEqual = hooks.shallowEqual;
182
+ exports.shouldComponentUpdate = hooks.shouldComponentUpdate;
183
+ exports.useAtlas = hooks.useAtlas;
184
+ exports.useCallback = hooks.useCallback;
185
+ exports.useDebugSnapshot = hooks.useDebugSnapshot;
186
+ exports.useEffect = hooks.useEffect;
187
+ exports.useForceRedraw = hooks.useForceRedraw;
188
+ exports.useLayoutEffect = hooks.useLayoutEffect;
189
+ exports.useMemo = hooks.useMemo;
190
+ exports.useRedraw = hooks.useRedraw;
191
+ exports.useRef = hooks.useRef;
192
+ exports.useSVGTexture = hooks.useSVGTexture;
193
+ exports.useState = hooks.useState;
194
+ exports.useSurface = hooks.useSurface;
195
+ exports.useTexture = hooks.useTexture;
196
+ exports.useTheme = hooks.useTheme;
197
+ exports.useThemeTokens = hooks.useThemeTokens;
198
+ exports.useViewportSize = hooks.useViewportSize;
199
+ exports.withHooks = hooks.withHooks;
200
+ exports.runEffect = effectEngine.runEffect;
201
+ exports.stopAnimationEffect = effectEngine.stopEffect;
202
+ exports.animatedSignal = animatedSignal.animatedSignal;
203
+ exports.isAnimatedSignal = animatedSignal.isAnimatedSignal;
204
+ exports.unwrapSignal = animatedSignal.unwrapSignal;
205
+ exports.createSpring = createSpring.createSpring;
206
+ exports.Easing = easing.Easing;
207
+ exports.EFFECT_DEFINITIONS = effectDefinitions.EFFECT_DEFINITIONS;
208
+ exports.DEFAULT_SPRING_CONFIG = springPhysics.DEFAULT_SPRING_CONFIG;
209
+ exports.SPRING_PRESETS = springPhysics.SPRING_PRESETS;
210
+ exports.SpringPhysics = springPhysics.SpringPhysics;
211
+ exports.createTween = tween.createTween;
212
+ exports.useSpring = useSpring.useSpring;
213
+ exports.useSprings = useSpring.useSprings;
214
+ exports.TWEEN_PRESETS = useTween.TWEEN_PRESETS;
215
+ exports.useTween = useTween.useTween;
216
+ exports.useTweens = useTween.useTweens;
217
+ exports.PRIMITIVE_NODES = primitiveContracts.PRIMITIVE_NODES;
218
+ exports.createVDOMRuntime = createRuntime.createVDOMRuntime;
219
+ exports.createElement = utils.createElement;
220
+ exports.normalizeVNodeLike = utils.normalizeVNodeLike;
221
+ exports.computeSourceSlices = ninesliceContract.computeSourceSlices;
222
+ exports.computeTargetXs = ninesliceContract.computeTargetXs;
223
+ exports.computeTargetYs = ninesliceContract.computeTargetYs;
224
+ exports.deriveTargetRects = ninesliceContract.deriveTargetRects;
225
+ Object.defineProperty(exports, "computed", {
226
+ enumerable: true,
227
+ get: () => signalsCore.computed
228
+ });
229
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}