@foldkit/ui 0.168.0-canary.bfd880b1e6ca → 0.168.0-canary.c55d84c8199b

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 (318) hide show
  1. package/README.md +6 -8
  2. package/dist/anchor/anchor.d.ts +9 -8
  3. package/dist/anchor/anchor.d.ts.map +1 -1
  4. package/dist/anchor/anchor.js +16 -15
  5. package/dist/anchor/index.d.ts +1 -1
  6. package/dist/anchor/index.d.ts.map +1 -1
  7. package/dist/anchor/index.js +1 -1
  8. package/dist/animation/index.d.ts +51 -1
  9. package/dist/animation/index.d.ts.map +1 -1
  10. package/dist/animation/index.js +74 -1
  11. package/dist/animation/public.d.ts +2 -3
  12. package/dist/animation/public.d.ts.map +1 -1
  13. package/dist/animation/public.js +1 -3
  14. package/dist/animation/schema.d.ts +2 -10
  15. package/dist/animation/schema.d.ts.map +1 -1
  16. package/dist/animation/schema.js +3 -9
  17. package/dist/animation/update.d.ts +20 -358
  18. package/dist/animation/update.d.ts.map +1 -1
  19. package/dist/animation/update.js +87 -132
  20. package/dist/button/index.d.ts +23 -1
  21. package/dist/button/index.d.ts.map +1 -1
  22. package/dist/button/index.js +29 -1
  23. package/dist/calendar/index.d.ts +877 -1
  24. package/dist/calendar/index.d.ts.map +1 -1
  25. package/dist/calendar/index.js +785 -1
  26. package/dist/calendar/public.d.ts +2 -3
  27. package/dist/calendar/public.d.ts.map +1 -1
  28. package/dist/calendar/public.js +1 -3
  29. package/dist/checkbox/index.d.ts +83 -1
  30. package/dist/checkbox/index.d.ts.map +1 -1
  31. package/dist/checkbox/index.js +81 -1
  32. package/dist/combobox/multi.d.ts +88 -6355
  33. package/dist/combobox/multi.d.ts.map +1 -1
  34. package/dist/combobox/multi.js +23 -79
  35. package/dist/combobox/multiPublic.d.ts +2 -2
  36. package/dist/combobox/multiPublic.d.ts.map +1 -1
  37. package/dist/combobox/multiPublic.js +1 -1
  38. package/dist/combobox/public.d.ts +5 -6
  39. package/dist/combobox/public.d.ts.map +1 -1
  40. package/dist/combobox/public.js +3 -4
  41. package/dist/combobox/shared.d.ts +107 -6890
  42. package/dist/combobox/shared.d.ts.map +1 -1
  43. package/dist/combobox/shared.js +258 -295
  44. package/dist/combobox/single.d.ts +67 -6333
  45. package/dist/combobox/single.d.ts.map +1 -1
  46. package/dist/combobox/single.js +35 -105
  47. package/dist/datePicker/index.d.ts +1000 -1
  48. package/dist/datePicker/index.d.ts.map +1 -1
  49. package/dist/datePicker/index.js +305 -1
  50. package/dist/datePicker/public.d.ts +2 -1
  51. package/dist/datePicker/public.d.ts.map +1 -1
  52. package/dist/datePicker/public.js +1 -1
  53. package/dist/dialog/index.d.ts +335 -1
  54. package/dist/dialog/index.d.ts.map +1 -1
  55. package/dist/dialog/index.js +420 -1
  56. package/dist/dialog/public.d.ts +2 -3
  57. package/dist/dialog/public.d.ts.map +1 -1
  58. package/dist/dialog/public.js +1 -3
  59. package/dist/disclosure/index.d.ts +84 -1
  60. package/dist/disclosure/index.d.ts.map +1 -1
  61. package/dist/disclosure/index.js +96 -1
  62. package/dist/dragAndDrop/index.d.ts +650 -1
  63. package/dist/dragAndDrop/index.d.ts.map +1 -1
  64. package/dist/dragAndDrop/index.js +493 -1
  65. package/dist/dragAndDrop/public.d.ts +2 -2
  66. package/dist/dragAndDrop/public.d.ts.map +1 -1
  67. package/dist/dragAndDrop/public.js +1 -2
  68. package/dist/dragAndDrop/test.d.ts +11 -7
  69. package/dist/dragAndDrop/test.d.ts.map +1 -1
  70. package/dist/dragAndDrop/test.js +12 -7
  71. package/dist/fieldset/index.d.ts +20 -1
  72. package/dist/fieldset/index.d.ts.map +1 -1
  73. package/dist/fieldset/index.js +27 -1
  74. package/dist/fileDrop/index.d.ts +102 -1
  75. package/dist/fileDrop/index.d.ts.map +1 -1
  76. package/dist/fileDrop/index.js +96 -1
  77. package/dist/fileDrop/public.d.ts +2 -1
  78. package/dist/fileDrop/public.d.ts.map +1 -1
  79. package/dist/fileDrop/public.js +1 -1
  80. package/dist/hoverIntent/hoverIntent.d.ts +106 -0
  81. package/dist/hoverIntent/hoverIntent.d.ts.map +1 -0
  82. package/dist/hoverIntent/{block.js → hoverIntent.js} +84 -105
  83. package/dist/hoverIntent/index.d.ts +3 -1
  84. package/dist/hoverIntent/index.d.ts.map +1 -1
  85. package/dist/hoverIntent/index.js +2 -1
  86. package/dist/hoverIntent/message.d.ts +0 -2
  87. package/dist/hoverIntent/message.d.ts.map +1 -1
  88. package/dist/hoverIntent/message.js +0 -1
  89. package/dist/hoverIntent/public.d.ts +2 -3
  90. package/dist/hoverIntent/public.d.ts.map +1 -1
  91. package/dist/hoverIntent/public.js +1 -3
  92. package/dist/index.d.ts +0 -10
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js +0 -10
  95. package/dist/input/index.d.ts +26 -1
  96. package/dist/input/index.d.ts.map +1 -1
  97. package/dist/input/index.js +52 -1
  98. package/dist/listbox/multi.d.ts +79 -6167
  99. package/dist/listbox/multi.d.ts.map +1 -1
  100. package/dist/listbox/multi.js +30 -63
  101. package/dist/listbox/multiPublic.d.ts +2 -2
  102. package/dist/listbox/multiPublic.d.ts.map +1 -1
  103. package/dist/listbox/multiPublic.js +1 -1
  104. package/dist/listbox/public.d.ts +5 -6
  105. package/dist/listbox/public.d.ts.map +1 -1
  106. package/dist/listbox/public.js +3 -4
  107. package/dist/listbox/shared.d.ts +109 -6315
  108. package/dist/listbox/shared.d.ts.map +1 -1
  109. package/dist/listbox/shared.js +246 -249
  110. package/dist/listbox/single.d.ts +91 -6171
  111. package/dist/listbox/single.d.ts.map +1 -1
  112. package/dist/listbox/single.js +50 -68
  113. package/dist/menu/index.d.ts +473 -1
  114. package/dist/menu/index.d.ts.map +1 -1
  115. package/dist/menu/index.js +740 -1
  116. package/dist/menu/public.d.ts +2 -3
  117. package/dist/menu/public.d.ts.map +1 -1
  118. package/dist/menu/public.js +1 -3
  119. package/dist/meter/index.d.ts +25 -1
  120. package/dist/meter/index.d.ts.map +1 -1
  121. package/dist/meter/index.js +67 -1
  122. package/dist/nav/index.d.ts +48 -1
  123. package/dist/nav/index.d.ts.map +1 -1
  124. package/dist/nav/index.js +43 -1
  125. package/dist/popover/index.d.ts +364 -1
  126. package/dist/popover/index.d.ts.map +1 -1
  127. package/dist/popover/index.js +407 -1
  128. package/dist/popover/public.d.ts +2 -3
  129. package/dist/popover/public.d.ts.map +1 -1
  130. package/dist/popover/public.js +1 -3
  131. package/dist/progress/index.d.ts +23 -1
  132. package/dist/progress/index.d.ts.map +1 -1
  133. package/dist/progress/index.js +85 -1
  134. package/dist/radioGroup/index.d.ts +180 -1
  135. package/dist/radioGroup/index.d.ts.map +1 -1
  136. package/dist/radioGroup/index.js +216 -1
  137. package/dist/radioGroup/public.d.ts +2 -3
  138. package/dist/radioGroup/public.d.ts.map +1 -1
  139. package/dist/radioGroup/public.js +1 -3
  140. package/dist/select/index.d.ts +23 -1
  141. package/dist/select/index.d.ts.map +1 -1
  142. package/dist/select/index.js +42 -1
  143. package/dist/slider/index.d.ts +414 -1
  144. package/dist/slider/index.d.ts.map +1 -1
  145. package/dist/slider/index.js +384 -1
  146. package/dist/slider/public.d.ts +2 -1
  147. package/dist/slider/public.d.ts.map +1 -1
  148. package/dist/slider/public.js +1 -1
  149. package/dist/switch/index.d.ts +73 -1
  150. package/dist/switch/index.d.ts.map +1 -1
  151. package/dist/switch/index.js +71 -1
  152. package/dist/tabs/index.d.ts +176 -1
  153. package/dist/tabs/index.d.ts.map +1 -1
  154. package/dist/tabs/index.js +181 -1
  155. package/dist/tabs/public.d.ts +2 -3
  156. package/dist/tabs/public.d.ts.map +1 -1
  157. package/dist/tabs/public.js +1 -3
  158. package/dist/test/apps/disabledButton.d.ts +41 -18226
  159. package/dist/test/apps/disabledButton.d.ts.map +1 -1
  160. package/dist/test/apps/disabledButton.js +28 -43
  161. package/dist/textarea/index.d.ts +26 -1
  162. package/dist/textarea/index.d.ts.map +1 -1
  163. package/dist/textarea/index.js +53 -1
  164. package/dist/toast/index.d.ts +1448 -1
  165. package/dist/toast/index.d.ts.map +1 -1
  166. package/dist/toast/index.js +206 -1
  167. package/dist/toast/public.d.ts +3 -1
  168. package/dist/toast/public.d.ts.map +1 -1
  169. package/dist/toast/public.js +1 -1
  170. package/dist/toast/schema.d.ts +44 -32
  171. package/dist/toast/schema.d.ts.map +1 -1
  172. package/dist/toast/schema.js +20 -21
  173. package/dist/toast/test.d.ts +7 -40
  174. package/dist/toast/test.d.ts.map +1 -1
  175. package/dist/toast/test.js +25 -24
  176. package/dist/toast/update.d.ts +768 -11866
  177. package/dist/toast/update.d.ts.map +1 -1
  178. package/dist/toast/update.js +296 -337
  179. package/dist/tooltip/index.d.ts +3 -1
  180. package/dist/tooltip/index.d.ts.map +1 -1
  181. package/dist/tooltip/index.js +2 -1
  182. package/dist/tooltip/message.d.ts +0 -3
  183. package/dist/tooltip/message.d.ts.map +1 -1
  184. package/dist/tooltip/message.js +0 -1
  185. package/dist/tooltip/public.d.ts +2 -3
  186. package/dist/tooltip/public.d.ts.map +1 -1
  187. package/dist/tooltip/public.js +1 -3
  188. package/dist/tooltip/tooltip.d.ts +130 -0
  189. package/dist/tooltip/tooltip.d.ts.map +1 -0
  190. package/dist/tooltip/{block.js → tooltip.js} +70 -98
  191. package/dist/virtualList/index.d.ts +476 -1
  192. package/dist/virtualList/index.d.ts.map +1 -1
  193. package/dist/virtualList/index.js +781 -1
  194. package/dist/virtualList/public.d.ts +2 -3
  195. package/dist/virtualList/public.d.ts.map +1 -1
  196. package/dist/virtualList/public.js +1 -3
  197. package/package.json +4 -5
  198. package/dist/animation/block.d.ts +0 -837
  199. package/dist/animation/block.d.ts.map +0 -1
  200. package/dist/animation/block.js +0 -98
  201. package/dist/animation/test.d.ts +0 -2
  202. package/dist/animation/test.d.ts.map +0 -1
  203. package/dist/animation/test.js +0 -1
  204. package/dist/button/button.d.ts +0 -24
  205. package/dist/button/button.d.ts.map +0 -1
  206. package/dist/button/button.js +0 -29
  207. package/dist/calendar/block.d.ts +0 -8929
  208. package/dist/calendar/block.d.ts.map +0 -1
  209. package/dist/calendar/block.js +0 -816
  210. package/dist/calendar/test.d.ts +0 -2
  211. package/dist/calendar/test.d.ts.map +0 -1
  212. package/dist/calendar/test.js +0 -1
  213. package/dist/checkbox/checkbox.d.ts +0 -84
  214. package/dist/checkbox/checkbox.d.ts.map +0 -1
  215. package/dist/checkbox/checkbox.js +0 -81
  216. package/dist/combobox/test.d.ts +0 -2
  217. package/dist/combobox/test.d.ts.map +0 -1
  218. package/dist/combobox/test.js +0 -1
  219. package/dist/datePicker/block.d.ts +0 -61913
  220. package/dist/datePicker/block.d.ts.map +0 -1
  221. package/dist/datePicker/block.js +0 -293
  222. package/dist/dialog/block.d.ts +0 -5557
  223. package/dist/dialog/block.d.ts.map +0 -1
  224. package/dist/dialog/block.js +0 -399
  225. package/dist/dialog/test.d.ts +0 -2
  226. package/dist/dialog/test.d.ts.map +0 -1
  227. package/dist/dialog/test.js +0 -1
  228. package/dist/disclosure/disclosure.d.ts +0 -85
  229. package/dist/disclosure/disclosure.d.ts.map +0 -1
  230. package/dist/disclosure/disclosure.js +0 -96
  231. package/dist/dragAndDrop/block.d.ts +0 -2471
  232. package/dist/dragAndDrop/block.d.ts.map +0 -1
  233. package/dist/dragAndDrop/block.js +0 -534
  234. package/dist/fieldset/fieldset.d.ts +0 -21
  235. package/dist/fieldset/fieldset.d.ts.map +0 -1
  236. package/dist/fieldset/fieldset.js +0 -27
  237. package/dist/fileDrop/block.d.ts +0 -296
  238. package/dist/fileDrop/block.d.ts.map +0 -1
  239. package/dist/fileDrop/block.js +0 -110
  240. package/dist/hoverIntent/block.d.ts +0 -883
  241. package/dist/hoverIntent/block.d.ts.map +0 -1
  242. package/dist/hoverIntent/test.d.ts +0 -2
  243. package/dist/hoverIntent/test.d.ts.map +0 -1
  244. package/dist/hoverIntent/test.js +0 -1
  245. package/dist/input/input.d.ts +0 -27
  246. package/dist/input/input.d.ts.map +0 -1
  247. package/dist/input/input.js +0 -52
  248. package/dist/listbox/test.d.ts +0 -2
  249. package/dist/listbox/test.d.ts.map +0 -1
  250. package/dist/listbox/test.js +0 -1
  251. package/dist/menu/definition.d.ts +0 -4
  252. package/dist/menu/definition.d.ts.map +0 -1
  253. package/dist/menu/definition.js +0 -3
  254. package/dist/menu/menu.d.ts +0 -14265
  255. package/dist/menu/menu.d.ts.map +0 -1
  256. package/dist/menu/menu.js +0 -790
  257. package/dist/menu/test.d.ts +0 -2
  258. package/dist/menu/test.d.ts.map +0 -1
  259. package/dist/menu/test.js +0 -1
  260. package/dist/meter/meter.d.ts +0 -26
  261. package/dist/meter/meter.d.ts.map +0 -1
  262. package/dist/meter/meter.js +0 -67
  263. package/dist/nav/nav.d.ts +0 -49
  264. package/dist/nav/nav.d.ts.map +0 -1
  265. package/dist/nav/nav.js +0 -42
  266. package/dist/popover/block.d.ts +0 -6117
  267. package/dist/popover/block.d.ts.map +0 -1
  268. package/dist/popover/block.js +0 -412
  269. package/dist/popover/test.d.ts +0 -2
  270. package/dist/popover/test.d.ts.map +0 -1
  271. package/dist/popover/test.js +0 -1
  272. package/dist/progress/progress.d.ts +0 -24
  273. package/dist/progress/progress.d.ts.map +0 -1
  274. package/dist/progress/progress.js +0 -85
  275. package/dist/radioGroup/definition.d.ts +0 -4
  276. package/dist/radioGroup/definition.d.ts.map +0 -1
  277. package/dist/radioGroup/definition.js +0 -3
  278. package/dist/radioGroup/radioGroup.d.ts +0 -606
  279. package/dist/radioGroup/radioGroup.d.ts.map +0 -1
  280. package/dist/radioGroup/radioGroup.js +0 -247
  281. package/dist/radioGroup/test.d.ts +0 -2
  282. package/dist/radioGroup/test.d.ts.map +0 -1
  283. package/dist/radioGroup/test.js +0 -1
  284. package/dist/select/select.d.ts +0 -24
  285. package/dist/select/select.d.ts.map +0 -1
  286. package/dist/select/select.js +0 -42
  287. package/dist/slider/slider.d.ts +0 -1643
  288. package/dist/slider/slider.d.ts.map +0 -1
  289. package/dist/slider/slider.js +0 -438
  290. package/dist/switch/switch.d.ts +0 -74
  291. package/dist/switch/switch.d.ts.map +0 -1
  292. package/dist/switch/switch.js +0 -71
  293. package/dist/tabs/definition.d.ts +0 -4
  294. package/dist/tabs/definition.d.ts.map +0 -1
  295. package/dist/tabs/definition.js +0 -3
  296. package/dist/tabs/tabs.d.ts +0 -612
  297. package/dist/tabs/tabs.d.ts.map +0 -1
  298. package/dist/tabs/tabs.js +0 -213
  299. package/dist/tabs/test.d.ts +0 -2
  300. package/dist/tabs/test.d.ts.map +0 -1
  301. package/dist/tabs/test.js +0 -1
  302. package/dist/textarea/textarea.d.ts +0 -27
  303. package/dist/textarea/textarea.d.ts.map +0 -1
  304. package/dist/textarea/textarea.js +0 -53
  305. package/dist/toast/toast.d.ts +0 -10781
  306. package/dist/toast/toast.d.ts.map +0 -1
  307. package/dist/toast/toast.js +0 -211
  308. package/dist/tooltip/block.d.ts +0 -945
  309. package/dist/tooltip/block.d.ts.map +0 -1
  310. package/dist/tooltip/test.d.ts +0 -2
  311. package/dist/tooltip/test.d.ts.map +0 -1
  312. package/dist/tooltip/test.js +0 -1
  313. package/dist/virtualList/test.d.ts +0 -2
  314. package/dist/virtualList/test.d.ts.map +0 -1
  315. package/dist/virtualList/test.js +0 -1
  316. package/dist/virtualList/virtualList.d.ts +0 -9060
  317. package/dist/virtualList/virtualList.d.ts.map +0 -1
  318. package/dist/virtualList/virtualList.js +0 -870
package/README.md CHANGED
@@ -18,7 +18,7 @@ yarn add @foldkit/ui
18
18
 
19
19
  ## Usage
20
20
 
21
- Import a component namespace by name. Stateful components are completed Blocks: `Application.bindChild(Dialog.block, config)` connects their state, Messages, public operations, view, and lifecycle effects to the parent. Stateless render helpers such as Button expose a view function.
21
+ Import a component by name. Each import is a namespace that groups the component's `view` and, for stateful components, its `Model`, `Message`, `init`, and `update`.
22
22
 
23
23
  ```typescript
24
24
  import type { HtmlBuilder } from 'foldkit/html'
@@ -28,7 +28,7 @@ import { Button } from '@foldkit/ui'
28
28
  const view = (h: HtmlBuilder<Message>) =>
29
29
  Button.view(
30
30
  {
31
- onClick: Message.ClickedSave(),
31
+ onClick: ClickedSave(), // your Message
32
32
  toView: attributes =>
33
33
  h.button(
34
34
  [...attributes.button, h.Class('px-4 py-2 rounded-lg')],
@@ -42,14 +42,12 @@ const view = (h: HtmlBuilder<Message>) =>
42
42
  Components come in two shapes:
43
43
 
44
44
  - **Render helpers** (Button, Input, Textarea, Select, Checkbox, Switch, Disclosure, Fieldset) are stateless. Call their `view` directly with a typed config. The controlled helpers (Checkbox, Switch, Disclosure) take the current value in through their config and dispatch a parent Message when the user changes it; you store that value in your own Model.
45
- - **Blocks** (Combobox, Dialog, Listbox, Menu, Popover, RadioGroup, and the like) own a Model. Create a Binding through the parent authoring value, such as `const DialogBinding = Application.bindChild(Dialog.block, config)`, include it in the Composition's `bindings`, and render its `embedView(...)` descriptor with `h.block`. The Binding also folds the child's Messages and OutMessages into the parent.
45
+ - **Submodels** (Combobox, Dialog, Listbox, Menu, Popover, RadioGroup, and the like) own a Model. Embed them with `h.submodel`, drive them through their `update`, and consume their `OutMessage` in the parent.
46
46
 
47
- Component subpaths also expose domain helpers and types. Generic factories are separate exports: `Combobox.create(City)` returns a completed Block with Schema-refined payloads, and `Tabs.create<Tab>()` refines a type-only tab value. Import component ViewInputs and other helper types from their subpaths.
48
-
49
- Stateless render helpers are also available as subpath namespaces:
47
+ Every component is also available as a subpath import:
50
48
 
51
49
  ```typescript
52
- import * as Button from '@foldkit/ui/button'
50
+ import { Button } from '@foldkit/ui/button'
53
51
  ```
54
52
 
55
53
  When a component name collides with another import (for example core's `Calendar`), alias it:
@@ -66,7 +64,7 @@ See the [component documentation](https://foldkit.dev/ui/overview) for the full
66
64
 
67
65
  ## Anchor
68
66
 
69
- `Anchor` is the positioning runtime the floating components share, exported at `@foldkit/ui/anchor`. It is neither a render helper nor a Block, so it is not in the list above. Reach for it when you need to anchor and portal a panel of your own from a Mount, and none of Listbox, Combobox, Menu, Popover, Tooltip, or DatePicker fits. See the [Anchor documentation](https://foldkit.dev/ui/anchor).
67
+ `Anchor` is the positioning runtime the floating components share, exported at `@foldkit/ui/anchor`. It is neither a render helper nor a Submodel, so it is not in the list above. Reach for it when you need to anchor and portal a panel of your own from a Mount, and none of Listbox, Combobox, Menu, Popover, Tooltip, or DatePicker fits. See the [Anchor documentation](https://foldkit.dev/ui/anchor).
70
68
 
71
69
  ## License
72
70
 
@@ -31,14 +31,15 @@ export type AnchorConfig = typeof AnchorConfig.Type;
31
31
  * that removes it again. Inside a `<dialog>`, the portal root is a div
32
32
  * appended to that dialog, so the element stays above the dialog's content
33
33
  * and interactive while a modal dialog makes everything outside it inert.
34
- * The cleanup removes that div once it is empty. Otherwise the portal root
35
- * is the shared `foldkit-portal-root` div within the element's containing
36
- * root: the shadow root when mounted inside one, otherwise `document.body`.
37
- * Either way the element escapes the clipping and stacking contexts of the
38
- * ancestors it leaves, and keeps its root's scoped styles. Use
39
- * `portalBackdrop` for a click-outside backdrop. Designed to be called from
40
- * inside an `OnMount` action: the consumer wraps the call in `Effect.sync`
41
- * and stashes the returned cleanup in the `Mount` result. */
34
+ * Otherwise the portal root is the shared `foldkit-portal-root` div within
35
+ * the element's containing root: the shadow root when mounted inside one,
36
+ * otherwise `document.body`. Either way the element escapes the clipping
37
+ * and stacking contexts of the ancestors it leaves, and keeps its root's
38
+ * scoped styles. The cleanup removes the portal root once it is empty, so
39
+ * the next open creates a fresh one. Use `portalBackdrop` for a
40
+ * click-outside backdrop. Designed to be called from inside an `OnMount`
41
+ * action: the consumer wraps the call in `Effect.sync` and stashes the
42
+ * returned cleanup in the `Mount` result. */
42
43
  export declare const portalToContainingRoot: (element: Element) => (() => void);
43
44
  /** Relocates a click-outside backdrop and returns a cleanup function that
44
45
  * removes it again. Outside a `<dialog>`, it does what
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/anchor/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAgB,MAAM,QAAQ,CAAA;AAatE;mFACmF;AACnF,eAAO,MAAM,SAAS,0KAapB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;+DAC+D;AAC/D,eAAO,MAAM,OAAO;;;;;IAQlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,oGAAoG;AACpG,eAAO,MAAM,YAAY;;;;;;;;;;;;EAOvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAwEnD;;;;;;;;;;;8DAW8D;AAC9D,eAAO,MAAM,sBAAsB,YAAa,OAAO,KAAG,CAAC,MAAM,IAAI,CAsBpE,CAAA;AAWD;;;;;;;;;;;;;;;;;;;qCAmBqC;AACrC,eAAO,MAAM,cAAc,YAAa,OAAO,KAAG,CAAC,MAAM,IAAI,CAczD,CAAA;AAUJ;;;;;;;;;;;;;;;;;;;;;0BAqB0B;AAC1B,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAsBF;;;;;;;;;;;;;;;;;;;;;;;gFAuBgF;AAChF,eAAO,MAAM,WAAW,YACb,OAAO,UACR,WAAW,KAClB,CAAC,MAAM,IAAI,CAkQb,CAAA"}
1
+ {"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/anchor/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAgB,MAAM,QAAQ,CAAA;AAatE;mFACmF;AACnF,eAAO,MAAM,SAAS,0KAapB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;+DAC+D;AAC/D,eAAO,MAAM,OAAO;;;;;IAQlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,oGAAoG;AACpG,eAAO,MAAM,YAAY;;;;;;;;;;;;EAOvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAqEnD;;;;;;;;;;;;8CAY8C;AAC9C,eAAO,MAAM,sBAAsB,YAAa,OAAO,KAAG,CAAC,MAAM,IAAI,CAuBpE,CAAA;AAWD;;;;;;;;;;;;;;;;;;;qCAmBqC;AACrC,eAAO,MAAM,cAAc,YAAa,OAAO,KAAG,CAAC,MAAM,IAAI,CAczD,CAAA;AAUJ;;;;;;;;;;;;;;;;;;;;;0BAqB0B;AAC1B,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAsBF;;;;;;;;;;;;;;;;;;;;;;;gFAuBgF;AAChF,eAAO,MAAM,WAAW,YACb,OAAO,UACR,WAAW,KAClB,CAAC,MAAM,IAAI,CAkQb,CAAA"}
@@ -78,7 +78,6 @@ const getOrCreateDialogPortalRoot = (dialog) => {
78
78
  dialog.append(portalRoot);
79
79
  return __foldkitBrandViewResult((portalRoot), "@foldkit/ui/anchor/anchor.js#getOrCreateDialogPortalRoot");
80
80
  };
81
- const isDialogPortalRoot = (element) => __foldkitBrandViewResult((element.hasAttribute(DIALOG_PORTAL_ROOT_ATTRIBUTE)), "@foldkit/ui/anchor/anchor.js#isDialogPortalRoot");
82
81
  // NOTE: a dialog is its own stacking level (`Dom.showDialog` gives it a
83
82
  // near-maximal z-index, `showModal()` puts it in the top layer) and the only
84
83
  // subtree a modal dialog leaves interactive. An element portaled out of it is
@@ -93,14 +92,15 @@ const getOrCreatePortalRoot = (element) => __foldkitBrandViewResult((Option.matc
93
92
  * that removes it again. Inside a `<dialog>`, the portal root is a div
94
93
  * appended to that dialog, so the element stays above the dialog's content
95
94
  * and interactive while a modal dialog makes everything outside it inert.
96
- * The cleanup removes that div once it is empty. Otherwise the portal root
97
- * is the shared `foldkit-portal-root` div within the element's containing
98
- * root: the shadow root when mounted inside one, otherwise `document.body`.
99
- * Either way the element escapes the clipping and stacking contexts of the
100
- * ancestors it leaves, and keeps its root's scoped styles. Use
101
- * `portalBackdrop` for a click-outside backdrop. Designed to be called from
102
- * inside an `OnMount` action: the consumer wraps the call in `Effect.sync`
103
- * and stashes the returned cleanup in the `Mount` result. */
95
+ * Otherwise the portal root is the shared `foldkit-portal-root` div within
96
+ * the element's containing root: the shadow root when mounted inside one,
97
+ * otherwise `document.body`. Either way the element escapes the clipping
98
+ * and stacking contexts of the ancestors it leaves, and keeps its root's
99
+ * scoped styles. The cleanup removes the portal root once it is empty, so
100
+ * the next open creates a fresh one. Use `portalBackdrop` for a
101
+ * click-outside backdrop. Designed to be called from inside an `OnMount`
102
+ * action: the consumer wraps the call in `Effect.sync` and stashes the
103
+ * returned cleanup in the `Mount` result. */
104
104
  export const portalToContainingRoot = (element) => {
105
105
  const portalRoot = getOrCreatePortalRoot(element);
106
106
  portalRoot.appendChild(element);
@@ -113,12 +113,13 @@ export const portalToContainingRoot = (element) => {
113
113
  // so the remove() call can throw on a node that's already been removed.
114
114
  // Swallow the error.
115
115
  }
116
- // NOTE: a dialog's children are usually rendered only while it is open,
117
- // so after a close an empty portal root would be the dialog's only child,
118
- // and on the next open the dialog's content would be inserted after it.
119
- // Removing it lets the next element portaled into this dialog append a
120
- // fresh root after the content.
121
- if (isDialogPortalRoot(portalRoot) && !portalRoot.hasChildNodes()) {
116
+ // NOTE: a modal overlay isolates siblings before its Mount portals the
117
+ // panel. An empty shared root would become inert, then receive the panel.
118
+ // Removing empty roots lets the next open create one after isolation.
119
+ // Dialog roots must also be removed so a reopened dialog appends its portal
120
+ // root after the newly rendered content. Occupied shared roots are retained;
121
+ // opening a modal overlay while one exists can still make its panel inert.
122
+ if (!portalRoot.hasChildNodes()) {
122
123
  portalRoot.remove();
123
124
  }
124
125
  }), "@foldkit/ui/anchor/anchor.js#portalToContainingRoot");
@@ -1,2 +1,2 @@
1
- export { Placement, Padding, AnchorConfig, portalToContainingRoot, portalBackdrop, anchorSetup, type SetupConfig, } from './anchor.js';
1
+ export * from './anchor.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/anchor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,YAAY,EACZ,sBAAsB,EACtB,cAAc,EACd,WAAW,EACX,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/anchor/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -1 +1 @@
1
- export { Placement, Padding, AnchorConfig, portalToContainingRoot, portalBackdrop, anchorSetup, } from './anchor.js';
1
+ export * from './anchor.js';
@@ -1,2 +1,52 @@
1
- export { AnimationBlock, TransitionState, defaultLeaveCommand, type InitConfig, type ViewInputs, } from './block.js';
1
+ import type { ChildAttribute, Html, TagName } from 'foldkit/html';
2
+ import { Message, Model, OutMessage, TransitionState, init } from './schema.js';
3
+ import { WaitForAnimationSettled, WaitForPaint, defaultLeaveCommand, hide, show, toggle, update } from './update.js';
4
+ export type { Hid, InitConfig, Showed } from './schema.js';
5
+ export { init, Message, Model, OutMessage, TransitionState };
6
+ export { WaitForAnimationSettled, WaitForPaint, defaultLeaveCommand, hide, show, toggle, update, };
7
+ /** Per-render view inputs passed to `view` via `h.submodel`'s `viewInputs` field. */
8
+ export type ViewInputs = Readonly<{
9
+ content: Html;
10
+ className?: string;
11
+ attributes?: ReadonlyArray<ChildAttribute>;
12
+ element?: Exclude<TagName, 'textarea'>;
13
+ /** When true, wraps content in a CSS grid container that smoothly animates
14
+ * height via `grid-template-rows: 0fr → 1fr`. The element stays in the DOM
15
+ * when hidden (collapsed to zero height) instead of being removed. */
16
+ animateSize?: boolean;
17
+ }>;
18
+ /** Renders a headless animation wrapper that coordinates CSS transitions and
19
+ * CSS keyframe animations via data attributes.
20
+ *
21
+ * Data attributes reflect the current lifecycle phase:
22
+ * - `data-closed`: element is in its hidden/initial state
23
+ * - `data-enter`: enter animation is active
24
+ * - `data-leave`: leave animation is active
25
+ * - `data-transition`: any animation is active
26
+ */
27
+ export declare const view: import("foldkit/submodel").View<{
28
+ readonly id: string;
29
+ readonly isShowing: boolean;
30
+ readonly transitionState: "EnterAnimating" | "EnterStart" | "Idle" | "LeaveAnimating" | "LeaveStart";
31
+ readonly transitionGeneration: number;
32
+ }, {
33
+ readonly _tag: "CompletedWaitForPaint";
34
+ readonly generation: number;
35
+ } | {
36
+ readonly _tag: "EndedAnimation";
37
+ readonly generation: number;
38
+ } | {
39
+ readonly _tag: "Hid";
40
+ } | {
41
+ readonly _tag: "Showed";
42
+ }, Readonly<{
43
+ content: Html;
44
+ className?: string;
45
+ attributes?: ReadonlyArray<ChildAttribute>;
46
+ element?: Exclude<TagName, 'textarea'>;
47
+ /** When true, wraps content in a CSS grid container that smoothly animates
48
+ * height via `grid-template-rows: 0fr → 1fr`. The element stays in the DOM
49
+ * when hidden (collapsed to zero height) instead of being removed. */
50
+ animateSize?: boolean;
51
+ }>>;
2
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGjE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,EACP,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA;AAE5D,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,GACP,CAAA;AAID,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,IAAI,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IACtC;;2EAEuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC,CAAA;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;aAnBN,IAAI;gBACD,MAAM;iBACL,aAAa,CAAC,cAAc,CAAC;cAChC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC;IACtC;;2EAEuE;kBACzD,OAAO;GA2GtB,CAAA"}
@@ -1 +1,74 @@
1
- export { AnimationBlock, TransitionState, defaultLeaveCommand, } from './block.js';
1
+ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
+ import { Match } from 'effect';
3
+ import { defineView } from 'foldkit/submodel';
4
+ import { Message, Model, OutMessage, TransitionState, init } from './schema.js';
5
+ import { WaitForAnimationSettled, WaitForPaint, defaultLeaveCommand, hide, show, toggle, update, } from './update.js';
6
+ export { init, Message, Model, OutMessage, TransitionState };
7
+ export { WaitForAnimationSettled, WaitForPaint, defaultLeaveCommand, hide, show, toggle, update, };
8
+ /** Renders a headless animation wrapper that coordinates CSS transitions and
9
+ * CSS keyframe animations via data attributes.
10
+ *
11
+ * Data attributes reflect the current lifecycle phase:
12
+ * - `data-closed`: element is in its hidden/initial state
13
+ * - `data-enter`: enter animation is active
14
+ * - `data-leave`: leave animation is active
15
+ * - `data-transition`: any animation is active
16
+ */
17
+ export const view = defineView((model, viewInputs, h) => {
18
+ const { id, isShowing, transitionState } = model;
19
+ const { content, className, attributes = [], element = 'div', animateSize = false, } = viewInputs;
20
+ const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating';
21
+ const isVisible = isShowing || isLeaving;
22
+ const transitionAttributes = Match.value(transitionState).pipe(Match.when('EnterStart', () => __foldkitBrandViewResult(([
23
+ h.DataAttribute('closed', ''),
24
+ h.DataAttribute('enter', ''),
25
+ h.DataAttribute('transition', ''),
26
+ ]), "@foldkit/ui/animation/index.js#anonymous~2")), Match.when('EnterAnimating', () => __foldkitBrandViewResult(([
27
+ h.DataAttribute('enter', ''),
28
+ h.DataAttribute('transition', ''),
29
+ ]), "@foldkit/ui/animation/index.js#anonymous~3")), Match.when('LeaveStart', () => __foldkitBrandViewResult(([
30
+ h.DataAttribute('leave', ''),
31
+ h.DataAttribute('transition', ''),
32
+ ]), "@foldkit/ui/animation/index.js#anonymous~4")), Match.when('LeaveAnimating', () => __foldkitBrandViewResult(([
33
+ h.DataAttribute('closed', ''),
34
+ h.DataAttribute('leave', ''),
35
+ h.DataAttribute('transition', ''),
36
+ ]), "@foldkit/ui/animation/index.js#anonymous~5")), Match.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/animation/index.js#anonymous~6")));
37
+ if (animateSize) {
38
+ const isClosed = transitionState === 'EnterStart' ||
39
+ transitionState === 'LeaveAnimating' ||
40
+ !isVisible;
41
+ return __foldkitBrandViewResult((h.div([
42
+ h.Style({
43
+ display: 'grid',
44
+ gridTemplateRows: isClosed ? '0fr' : '1fr',
45
+ transition: 'grid-template-rows 200ms ease-out',
46
+ overflow: 'hidden',
47
+ }),
48
+ ], [
49
+ h.div([
50
+ h.Style({ minHeight: '0px', overflow: 'hidden' }),
51
+ ...(!isVisible ? [h.AriaHidden(true)] : []),
52
+ ], [
53
+ h.keyed(element)(id, [
54
+ h.Id(id),
55
+ ...(isClosed && transitionState === 'Idle'
56
+ ? [h.DataAttribute('closed', '')]
57
+ : []),
58
+ ...transitionAttributes,
59
+ ...(className ? [h.Class(className)] : []),
60
+ ...attributes,
61
+ ], [content]),
62
+ ]),
63
+ ])), "@foldkit/ui/animation/index.js#anonymous");
64
+ }
65
+ if (!isVisible) {
66
+ return __foldkitBrandViewResult((h.empty), "@foldkit/ui/animation/index.js#anonymous");
67
+ }
68
+ return __foldkitBrandViewResult((h.keyed(element)(id, [
69
+ h.Id(id),
70
+ ...transitionAttributes,
71
+ ...(className ? [h.Class(className)] : []),
72
+ ...attributes,
73
+ ], [content])), "@foldkit/ui/animation/index.js#anonymous");
74
+ });
@@ -1,4 +1,3 @@
1
- export { AnimationBlock, TransitionState, defaultLeaveCommand, type InitConfig, type ViewInputs, } from './index.js';
2
- /** Original Animation Command Definitions for Story and Scene test resolution. */
3
- export * as test from './test.js';
1
+ export { init, show, hide, update, toggle, view, defaultLeaveCommand, Model, Message, OutMessage, type Showed, type Hid, TransitionState, WaitForPaint, WaitForAnimationSettled, } from './index.js';
2
+ export type { InitConfig, ViewInputs } from './index.js';
4
3
  //# sourceMappingURL=public.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/animation/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,YAAY,CAAA;AAEnB,kFAAkF;AAClF,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/animation/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,mBAAmB,EACnB,KAAK,EACL,OAAO,EACP,UAAU,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EACR,eAAe,EACf,YAAY,EACZ,uBAAuB,GACxB,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
@@ -1,3 +1 @@
1
- export { AnimationBlock, TransitionState, defaultLeaveCommand, } from './index.js';
2
- /** Original Animation Command Definitions for Story and Scene test resolution. */
3
- export * as test from './test.js';
1
+ export { init, show, hide, update, toggle, view, defaultLeaveCommand, Model, Message, OutMessage, TransitionState, WaitForPaint, WaitForAnimationSettled, } from './index.js';
@@ -15,14 +15,6 @@ export type Model = typeof Model.Type;
15
15
  export declare const Message: import("foldkit/message").MessageUnion<{
16
16
  readonly Showed: {};
17
17
  readonly Hid: {};
18
- readonly RequestedShow: {};
19
- readonly RequestedHide: {};
20
- readonly RequestedFinish: {
21
- generation: Schema.Number;
22
- };
23
- readonly RequestedToggle: {};
24
- readonly RequestedResume: {};
25
- readonly RequestedImmediateReset: {};
26
18
  readonly CompletedWaitForPaint: {
27
19
  generation: Schema.Number;
28
20
  };
@@ -46,6 +38,6 @@ export type InitConfig = Readonly<{
46
38
  id: string;
47
39
  isShowing?: boolean;
48
40
  }>;
49
- /** @internal Creates the initial Animation Model before Composition authoring. */
50
- export declare const makeInitialModel: (config: InitConfig) => Model;
41
+ /** Creates an initial animation model from a config. Defaults to hidden. */
42
+ export declare const init: (config: InitConfig) => Model;
51
43
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/animation/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAK/B,6EAA6E;AAC7E,eAAO,MAAM,eAAe,oGAM1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD;6BAC6B;AAC7B,eAAO,MAAM,KAAK;;;;;EAKhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,iEAAiE;AACjE,eAAO,MAAM,OAAO;;;;;;QAKC,UAAU;;;;;;QAIJ,UAAU;;;QACjB,UAAU;;EAC5B,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,MAAM,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;AAC/C,MAAM,MAAM,GAAG,GAAG,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA;AAIzC,0DAA0D;AAC1D,eAAO,MAAM,UAAU;;QACI,UAAU;;;EAEnC,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC,CAAA;AAEF,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,WAAY,UAAU,KAAG,KAKpD,CAAA"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/animation/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAK/B,6EAA6E;AAC7E,eAAO,MAAM,eAAe,oGAM1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD;6BAC6B;AAC7B,eAAO,MAAM,KAAK;;;;;EAKhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,iEAAiE;AACjE,eAAO,MAAM,OAAO;;;;QAGO,UAAU;;;QACjB,UAAU;;EAC5B,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,MAAM,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;AAC/C,MAAM,MAAM,GAAG,GAAG,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA;AAIzC,0DAA0D;AAC1D,eAAO,MAAM,UAAU;;QACI,UAAU;;;EAEnC,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC,CAAA;AAEF,4EAA4E;AAC5E,eAAO,MAAM,IAAI,WAAY,UAAU,KAAG,KAKxC,CAAA"}
@@ -24,12 +24,6 @@ export const Model = Schema.Struct({
24
24
  export const Message = defineMessageUnion({
25
25
  Showed: {},
26
26
  Hid: {},
27
- RequestedShow: {},
28
- RequestedHide: {},
29
- RequestedFinish: { generation: Schema.Number },
30
- RequestedToggle: {},
31
- RequestedResume: {},
32
- RequestedImmediateReset: {},
33
27
  CompletedWaitForPaint: { generation: Schema.Number },
34
28
  EndedAnimation: { generation: Schema.Number },
35
29
  });
@@ -39,10 +33,10 @@ export const OutMessage = defineMessageUnion({
39
33
  StartedLeaveAnimating: { generation: Schema.Number },
40
34
  TransitionedOut: {},
41
35
  });
42
- /** @internal Creates the initial Animation Model before Composition authoring. */
43
- export const makeInitialModel = (config) => (__foldkitBrandViewResult(({
36
+ /** Creates an initial animation model from a config. Defaults to hidden. */
37
+ export const init = (config) => (__foldkitBrandViewResult(({
44
38
  id: config.id,
45
39
  isShowing: config.isShowing ?? false,
46
40
  transitionState: 'Idle',
47
41
  transitionGeneration: 0,
48
- }), "@foldkit/ui/animation/schema.js#makeInitialModel"));
42
+ }), "@foldkit/ui/animation/schema.js#init"));