@vielzeug/craftit 2.1.0 → 3.0.3

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 (325) hide show
  1. package/README.md +58 -124
  2. package/dist/controls/a11y-control.cjs +1 -1
  3. package/dist/controls/a11y-control.cjs.map +1 -1
  4. package/dist/controls/a11y-control.d.ts +1 -1
  5. package/dist/controls/a11y-control.d.ts.map +1 -1
  6. package/dist/controls/a11y-control.js +1 -1
  7. package/dist/controls/a11y-control.js.map +1 -1
  8. package/dist/controls/checkable-control.cjs +1 -1
  9. package/dist/controls/checkable-control.cjs.map +1 -1
  10. package/dist/controls/checkable-control.d.ts +7 -7
  11. package/dist/controls/checkable-control.d.ts.map +1 -1
  12. package/dist/controls/checkable-control.js +1 -1
  13. package/dist/controls/checkable-control.js.map +1 -1
  14. package/dist/controls/choice-field-control.cjs +2 -0
  15. package/dist/controls/choice-field-control.cjs.map +1 -0
  16. package/dist/controls/choice-field-control.d.ts +3 -0
  17. package/dist/controls/choice-field-control.d.ts.map +1 -0
  18. package/dist/controls/choice-field-control.js +2 -0
  19. package/dist/controls/choice-field-control.js.map +1 -0
  20. package/dist/controls/field-control.cjs +1 -1
  21. package/dist/controls/field-control.cjs.map +1 -1
  22. package/dist/controls/field-control.d.ts +28 -73
  23. package/dist/controls/field-control.d.ts.map +1 -1
  24. package/dist/controls/field-control.js +1 -1
  25. package/dist/controls/field-control.js.map +1 -1
  26. package/dist/controls/index.d.ts +11 -9
  27. package/dist/controls/index.d.ts.map +1 -1
  28. package/dist/controls/internal/control-state.cjs +1 -1
  29. package/dist/controls/internal/control-state.cjs.map +1 -1
  30. package/dist/controls/internal/control-state.d.ts +6 -4
  31. package/dist/controls/internal/control-state.d.ts.map +1 -1
  32. package/dist/controls/internal/control-state.js +1 -1
  33. package/dist/controls/internal/control-state.js.map +1 -1
  34. package/dist/controls/internal/keyboard-utils.cjs.map +1 -1
  35. package/dist/controls/internal/keyboard-utils.js.map +1 -1
  36. package/dist/controls/internal/number-utils.cjs.map +1 -1
  37. package/dist/controls/internal/number-utils.js.map +1 -1
  38. package/dist/controls/internal/validation-utils.cjs.map +1 -1
  39. package/dist/controls/internal/validation-utils.js.map +1 -1
  40. package/dist/controls/list-control.cjs +1 -1
  41. package/dist/controls/list-control.cjs.map +1 -1
  42. package/dist/controls/list-control.d.ts +10 -8
  43. package/dist/controls/list-control.d.ts.map +1 -1
  44. package/dist/controls/list-control.js +1 -1
  45. package/dist/controls/list-control.js.map +1 -1
  46. package/dist/controls/overlay-control.cjs +1 -1
  47. package/dist/controls/overlay-control.cjs.map +1 -1
  48. package/dist/controls/overlay-control.d.ts +17 -14
  49. package/dist/controls/overlay-control.d.ts.map +1 -1
  50. package/dist/controls/overlay-control.js +1 -1
  51. package/dist/controls/overlay-control.js.map +1 -1
  52. package/dist/controls/popup-list-control.cjs +2 -0
  53. package/dist/controls/popup-list-control.cjs.map +1 -0
  54. package/dist/controls/popup-list-control.d.ts +160 -0
  55. package/dist/controls/popup-list-control.d.ts.map +1 -0
  56. package/dist/controls/popup-list-control.js +2 -0
  57. package/dist/controls/popup-list-control.js.map +1 -0
  58. package/dist/controls/press-control.cjs.map +1 -1
  59. package/dist/controls/press-control.js.map +1 -1
  60. package/dist/controls/slider-control.cjs.map +1 -1
  61. package/dist/controls/slider-control.js.map +1 -1
  62. package/dist/controls/spinner-control.cjs.map +1 -1
  63. package/dist/controls/spinner-control.js.map +1 -1
  64. package/dist/controls/swipe-control.cjs +2 -0
  65. package/dist/controls/swipe-control.cjs.map +1 -0
  66. package/dist/controls/swipe-control.d.ts +32 -0
  67. package/dist/controls/swipe-control.d.ts.map +1 -0
  68. package/dist/controls/swipe-control.js +2 -0
  69. package/dist/controls/swipe-control.js.map +1 -0
  70. package/dist/controls/text-field-control.cjs +2 -0
  71. package/dist/controls/text-field-control.cjs.map +1 -0
  72. package/dist/controls/text-field-control.d.ts +3 -0
  73. package/dist/controls/text-field-control.d.ts.map +1 -0
  74. package/dist/controls/text-field-control.js +2 -0
  75. package/dist/controls/text-field-control.js.map +1 -0
  76. package/dist/controls.cjs +1 -1
  77. package/dist/controls.js +1 -1
  78. package/dist/craftit.cjs +1 -1
  79. package/dist/craftit.cjs.map +1 -1
  80. package/dist/craftit.js +1 -1
  81. package/dist/craftit.js.map +1 -1
  82. package/dist/directives/classMap.cjs +2 -0
  83. package/dist/directives/classMap.cjs.map +1 -0
  84. package/dist/directives/classMap.d.ts +19 -0
  85. package/dist/directives/classMap.d.ts.map +1 -0
  86. package/dist/directives/classMap.js +2 -0
  87. package/dist/directives/classMap.js.map +1 -0
  88. package/dist/directives/each.cjs +1 -1
  89. package/dist/directives/each.cjs.map +1 -1
  90. package/dist/directives/each.d.ts +5 -30
  91. package/dist/directives/each.d.ts.map +1 -1
  92. package/dist/directives/each.js +1 -1
  93. package/dist/directives/each.js.map +1 -1
  94. package/dist/directives/guard.cjs +2 -0
  95. package/dist/directives/guard.cjs.map +1 -0
  96. package/dist/directives/guard.d.ts +10 -0
  97. package/dist/directives/guard.d.ts.map +1 -0
  98. package/dist/directives/guard.js +2 -0
  99. package/dist/directives/guard.js.map +1 -0
  100. package/dist/directives/live.cjs +2 -0
  101. package/dist/directives/live.cjs.map +1 -0
  102. package/dist/directives/live.d.ts +23 -0
  103. package/dist/directives/live.d.ts.map +1 -0
  104. package/dist/directives/live.js +2 -0
  105. package/dist/directives/live.js.map +1 -0
  106. package/dist/directives/raw.cjs +1 -1
  107. package/dist/directives/raw.cjs.map +1 -1
  108. package/dist/directives/raw.d.ts +3 -5
  109. package/dist/directives/raw.d.ts.map +1 -1
  110. package/dist/directives/raw.js +1 -1
  111. package/dist/directives/raw.js.map +1 -1
  112. package/dist/directives/resource.cjs +2 -0
  113. package/dist/directives/resource.cjs.map +1 -0
  114. package/dist/directives/resource.d.ts +32 -0
  115. package/dist/directives/resource.d.ts.map +1 -0
  116. package/dist/directives/resource.js +2 -0
  117. package/dist/directives/resource.js.map +1 -0
  118. package/dist/directives/styleMap.cjs +2 -0
  119. package/dist/directives/styleMap.cjs.map +1 -0
  120. package/dist/directives/styleMap.d.ts +11 -0
  121. package/dist/directives/styleMap.d.ts.map +1 -0
  122. package/dist/directives/styleMap.js +2 -0
  123. package/dist/directives/styleMap.js.map +1 -0
  124. package/dist/directives/when.cjs +1 -1
  125. package/dist/directives/when.cjs.map +1 -1
  126. package/dist/directives/when.d.ts +6 -19
  127. package/dist/directives/when.d.ts.map +1 -1
  128. package/dist/directives/when.js +1 -1
  129. package/dist/directives/when.js.map +1 -1
  130. package/dist/errors.cjs +2 -0
  131. package/dist/errors.cjs.map +1 -0
  132. package/dist/errors.d.ts +12 -0
  133. package/dist/errors.d.ts.map +1 -0
  134. package/dist/errors.js +2 -0
  135. package/dist/errors.js.map +1 -0
  136. package/dist/form.cjs +1 -1
  137. package/dist/form.cjs.map +1 -1
  138. package/dist/form.d.ts +3 -17
  139. package/dist/form.d.ts.map +1 -1
  140. package/dist/form.js +1 -1
  141. package/dist/form.js.map +1 -1
  142. package/dist/host.cjs +1 -1
  143. package/dist/host.cjs.map +1 -1
  144. package/dist/host.d.ts +40 -37
  145. package/dist/host.d.ts.map +1 -1
  146. package/dist/host.js +1 -1
  147. package/dist/host.js.map +1 -1
  148. package/dist/index.cjs +1 -1
  149. package/dist/index.d.ts +16 -8
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +1 -1
  152. package/dist/internal.cjs +1 -1
  153. package/dist/internal.cjs.map +1 -1
  154. package/dist/internal.d.ts +60 -120
  155. package/dist/internal.d.ts.map +1 -1
  156. package/dist/internal.js +1 -1
  157. package/dist/internal.js.map +1 -1
  158. package/dist/observers/index.d.ts +1 -0
  159. package/dist/observers/index.d.ts.map +1 -1
  160. package/dist/observers/intersection-observe.cjs +1 -1
  161. package/dist/observers/intersection-observe.cjs.map +1 -1
  162. package/dist/observers/intersection-observe.d.ts +1 -1
  163. package/dist/observers/intersection-observe.js +1 -1
  164. package/dist/observers/intersection-observe.js.map +1 -1
  165. package/dist/observers/media-observe.cjs +1 -1
  166. package/dist/observers/media-observe.cjs.map +1 -1
  167. package/dist/observers/media-observe.d.ts +1 -1
  168. package/dist/observers/media-observe.js +1 -1
  169. package/dist/observers/media-observe.js.map +1 -1
  170. package/dist/observers/mutation-observe.cjs +2 -0
  171. package/dist/observers/mutation-observe.cjs.map +1 -0
  172. package/dist/observers/mutation-observe.d.ts +10 -0
  173. package/dist/observers/mutation-observe.d.ts.map +1 -0
  174. package/dist/observers/mutation-observe.js +2 -0
  175. package/dist/observers/mutation-observe.js.map +1 -0
  176. package/dist/observers/resize-observe.cjs +1 -1
  177. package/dist/observers/resize-observe.cjs.map +1 -1
  178. package/dist/observers/resize-observe.d.ts +1 -1
  179. package/dist/observers/resize-observe.js +1 -1
  180. package/dist/observers/resize-observe.js.map +1 -1
  181. package/dist/observers.cjs +1 -1
  182. package/dist/observers.js +1 -1
  183. package/dist/props.cjs +1 -1
  184. package/dist/props.cjs.map +1 -1
  185. package/dist/props.d.ts +18 -31
  186. package/dist/props.d.ts.map +1 -1
  187. package/dist/props.js +1 -1
  188. package/dist/props.js.map +1 -1
  189. package/dist/registration.cjs +1 -1
  190. package/dist/registration.cjs.map +1 -1
  191. package/dist/registration.d.ts +27 -7
  192. package/dist/registration.d.ts.map +1 -1
  193. package/dist/registration.js +1 -1
  194. package/dist/registration.js.map +1 -1
  195. package/dist/runtime.cjs +1 -1
  196. package/dist/runtime.cjs.map +1 -1
  197. package/dist/runtime.d.ts +29 -17
  198. package/dist/runtime.d.ts.map +1 -1
  199. package/dist/runtime.js +1 -1
  200. package/dist/runtime.js.map +1 -1
  201. package/dist/template-bindings.cjs +1 -1
  202. package/dist/template-bindings.cjs.map +1 -1
  203. package/dist/template-bindings.d.ts +10 -47
  204. package/dist/template-bindings.d.ts.map +1 -1
  205. package/dist/template-bindings.js +1 -1
  206. package/dist/template-bindings.js.map +1 -1
  207. package/dist/template-compiler.cjs +1 -1
  208. package/dist/template-compiler.cjs.map +1 -1
  209. package/dist/template-compiler.d.ts +1 -21
  210. package/dist/template-compiler.d.ts.map +1 -1
  211. package/dist/template-compiler.js +1 -1
  212. package/dist/template-compiler.js.map +1 -1
  213. package/dist/testing/testing.cjs +1 -1
  214. package/dist/testing/testing.cjs.map +1 -1
  215. package/dist/testing/testing.d.ts +12 -5
  216. package/dist/testing/testing.d.ts.map +1 -1
  217. package/dist/testing/testing.js +1 -1
  218. package/dist/testing/testing.js.map +1 -1
  219. package/package.json +6 -12
  220. package/dist/component.cjs +0 -2
  221. package/dist/component.cjs.map +0 -1
  222. package/dist/component.d.ts +0 -39
  223. package/dist/component.d.ts.map +0 -1
  224. package/dist/component.js +0 -2
  225. package/dist/component.js.map +0 -1
  226. package/dist/controls/list-key-control.cjs +0 -2
  227. package/dist/controls/list-key-control.cjs.map +0 -1
  228. package/dist/controls/list-key-control.d.ts +0 -14
  229. package/dist/controls/list-key-control.d.ts.map +0 -1
  230. package/dist/controls/list-key-control.js +0 -2
  231. package/dist/controls/list-key-control.js.map +0 -1
  232. package/dist/directives/attr.cjs +0 -2
  233. package/dist/directives/attr.cjs.map +0 -1
  234. package/dist/directives/attr.d.ts +0 -12
  235. package/dist/directives/attr.d.ts.map +0 -1
  236. package/dist/directives/attr.js +0 -2
  237. package/dist/directives/attr.js.map +0 -1
  238. package/dist/directives/bind.cjs +0 -2
  239. package/dist/directives/bind.cjs.map +0 -1
  240. package/dist/directives/bind.d.ts +0 -38
  241. package/dist/directives/bind.d.ts.map +0 -1
  242. package/dist/directives/bind.js +0 -2
  243. package/dist/directives/bind.js.map +0 -1
  244. package/dist/directives/choose.cjs +0 -2
  245. package/dist/directives/choose.cjs.map +0 -1
  246. package/dist/directives/choose.d.ts +0 -39
  247. package/dist/directives/choose.d.ts.map +0 -1
  248. package/dist/directives/choose.js +0 -2
  249. package/dist/directives/choose.js.map +0 -1
  250. package/dist/directives/classes.cjs +0 -2
  251. package/dist/directives/classes.cjs.map +0 -1
  252. package/dist/directives/classes.d.ts +0 -20
  253. package/dist/directives/classes.d.ts.map +0 -1
  254. package/dist/directives/classes.js +0 -2
  255. package/dist/directives/classes.js.map +0 -1
  256. package/dist/directives/index.d.ts +0 -13
  257. package/dist/directives/index.d.ts.map +0 -1
  258. package/dist/directives/memo.cjs +0 -2
  259. package/dist/directives/memo.cjs.map +0 -1
  260. package/dist/directives/memo.d.ts +0 -27
  261. package/dist/directives/memo.d.ts.map +0 -1
  262. package/dist/directives/memo.js +0 -2
  263. package/dist/directives/memo.js.map +0 -1
  264. package/dist/directives/on.cjs +0 -2
  265. package/dist/directives/on.cjs.map +0 -1
  266. package/dist/directives/on.d.ts +0 -25
  267. package/dist/directives/on.d.ts.map +0 -1
  268. package/dist/directives/on.js +0 -2
  269. package/dist/directives/on.js.map +0 -1
  270. package/dist/directives/spread.cjs +0 -2
  271. package/dist/directives/spread.cjs.map +0 -1
  272. package/dist/directives/spread.d.ts +0 -14
  273. package/dist/directives/spread.d.ts.map +0 -1
  274. package/dist/directives/spread.js +0 -2
  275. package/dist/directives/spread.js.map +0 -1
  276. package/dist/directives/style.cjs +0 -2
  277. package/dist/directives/style.cjs.map +0 -1
  278. package/dist/directives/style.d.ts +0 -22
  279. package/dist/directives/style.d.ts.map +0 -1
  280. package/dist/directives/style.js +0 -2
  281. package/dist/directives/style.js.map +0 -1
  282. package/dist/directives/until.cjs +0 -2
  283. package/dist/directives/until.cjs.map +0 -1
  284. package/dist/directives/until.d.ts +0 -26
  285. package/dist/directives/until.d.ts.map +0 -1
  286. package/dist/directives/until.js +0 -2
  287. package/dist/directives/until.js.map +0 -1
  288. package/dist/directives.cjs +0 -1
  289. package/dist/directives.js +0 -1
  290. package/dist/runtime-bindings.cjs +0 -2
  291. package/dist/runtime-bindings.cjs.map +0 -1
  292. package/dist/runtime-bindings.d.ts +0 -6
  293. package/dist/runtime-bindings.d.ts.map +0 -1
  294. package/dist/runtime-bindings.js +0 -2
  295. package/dist/runtime-bindings.js.map +0 -1
  296. package/dist/runtime-core.cjs +0 -2
  297. package/dist/runtime-core.cjs.map +0 -1
  298. package/dist/runtime-core.d.ts +0 -21
  299. package/dist/runtime-core.d.ts.map +0 -1
  300. package/dist/runtime-core.js +0 -2
  301. package/dist/runtime-core.js.map +0 -1
  302. package/dist/runtime-lifecycle.cjs +0 -2
  303. package/dist/runtime-lifecycle.cjs.map +0 -1
  304. package/dist/runtime-lifecycle.d.ts +0 -24
  305. package/dist/runtime-lifecycle.d.ts.map +0 -1
  306. package/dist/runtime-lifecycle.js +0 -2
  307. package/dist/runtime-lifecycle.js.map +0 -1
  308. package/dist/template-dom.cjs +0 -2
  309. package/dist/template-dom.cjs.map +0 -1
  310. package/dist/template-dom.d.ts +0 -13
  311. package/dist/template-dom.d.ts.map +0 -1
  312. package/dist/template-dom.js +0 -2
  313. package/dist/template-dom.js.map +0 -1
  314. package/dist/template-html.cjs +0 -2
  315. package/dist/template-html.cjs.map +0 -1
  316. package/dist/template-html.d.ts +0 -23
  317. package/dist/template-html.d.ts.map +0 -1
  318. package/dist/template-html.js +0 -2
  319. package/dist/template-html.js.map +0 -1
  320. package/dist/template.cjs +0 -2
  321. package/dist/template.cjs.map +0 -1
  322. package/dist/template.d.ts +0 -10
  323. package/dist/template.d.ts.map +0 -1
  324. package/dist/template.js +0 -2
  325. package/dist/template.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
@@ -1,2 +0,0 @@
1
- let e=require(`@vielzeug/stateit`);function t(t){let n=(0,e.computed)(()=>{for(let n of t.deps??[])(0,e.isSignal)(n)&&Reflect.get(n,`value`);return(0,e.untrack)(t.render)});return()=>n.value}exports.memo=t;
2
- //# sourceMappingURL=memo.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memo.cjs","names":[],"sources":["../../src/directives/memo.ts"],"sourcesContent":["import { computed, isSignal, type ReadonlySignal, untrack } from '@vielzeug/stateit';\n\nimport type { HTMLResult } from '../internal';\n\ntype Dep = unknown | ReadonlySignal<unknown>;\n\nexport type MemoOptions = {\n deps?: ReadonlyArray<Dep>;\n render: () => string | HTMLResult;\n};\n\n/**\n * Memoizes a template fragment — `templateFn` is only re-called when at least\n * one entry in `deps` has changed (compared with `Object.is`).\n *\n * Signal values in `deps` are automatically unwrapped and tracked, so changing a\n * dep signal triggers a re-evaluation. This is useful for skipping expensive\n * sub-tree renders when only unrelated state changes.\n *\n * @example\n * import { memo } from '@vielzeug/craftit/directives';\n *\n * // Only re-renders the table when `rows` actually changes\n * html`${memo({ deps: [rows], render: () => html`<big-table :data=${rows}></big-table>` })}`\n *\n * // Multiple deps — re-renders when either changes\n * html`${memo({ deps: [locale, theme], render: () => html`<themed-chart :locale=${locale}></themed-chart>` })}`\n */\nexport function memo(options: MemoOptions): () => string | HTMLResult {\n const renderSignal = computed(() => {\n for (const dep of options.deps ?? []) {\n if (isSignal(dep)) Reflect.get(dep, 'value');\n }\n\n return untrack(options.render);\n });\n\n return () => renderSignal.value;\n}\n"],"mappings":"mCA4BA,SAAgB,EAAK,EAAiD,CACpE,IAAM,GAAA,EAAA,EAAA,cAA8B,CAClC,IAAK,IAAM,KAAO,EAAQ,MAAQ,EAAE,EAClC,EAAA,EAAA,UAAa,EAAI,EAAE,QAAQ,IAAI,EAAK,QAAQ,CAG9C,OAAA,EAAA,EAAA,SAAe,EAAQ,OAAO,EAC9B,CAEF,UAAa,EAAa"}
@@ -1,27 +0,0 @@
1
- import { type ReadonlySignal } from '@vielzeug/stateit';
2
- import type { HTMLResult } from '../internal';
3
- type Dep = unknown | ReadonlySignal<unknown>;
4
- export type MemoOptions = {
5
- deps?: ReadonlyArray<Dep>;
6
- render: () => string | HTMLResult;
7
- };
8
- /**
9
- * Memoizes a template fragment — `templateFn` is only re-called when at least
10
- * one entry in `deps` has changed (compared with `Object.is`).
11
- *
12
- * Signal values in `deps` are automatically unwrapped and tracked, so changing a
13
- * dep signal triggers a re-evaluation. This is useful for skipping expensive
14
- * sub-tree renders when only unrelated state changes.
15
- *
16
- * @example
17
- * import { memo } from '@vielzeug/craftit/directives';
18
- *
19
- * // Only re-renders the table when `rows` actually changes
20
- * html`${memo({ deps: [rows], render: () => html`<big-table :data=${rows}></big-table>` })}`
21
- *
22
- * // Multiple deps — re-renders when either changes
23
- * html`${memo({ deps: [locale, theme], render: () => html`<themed-chart :locale=${locale}></themed-chart>` })}`
24
- */
25
- export declare function memo(options: MemoOptions): () => string | HTMLResult;
26
- export {};
27
- //# sourceMappingURL=memo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../../src/directives/memo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,cAAc,EAAW,MAAM,mBAAmB,CAAC;AAErF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,KAAK,GAAG,GAAG,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,MAAM,MAAM,GAAG,UAAU,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,MAAM,GAAG,UAAU,CAUpE"}
@@ -1,2 +0,0 @@
1
- import{computed as e,isSignal as t,untrack as n}from"@vielzeug/stateit";function r(r){let i=e(()=>{for(let e of r.deps??[])t(e)&&Reflect.get(e,`value`);return n(r.render)});return()=>i.value}export{r as memo};
2
- //# sourceMappingURL=memo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memo.js","names":[],"sources":["../../src/directives/memo.ts"],"sourcesContent":["import { computed, isSignal, type ReadonlySignal, untrack } from '@vielzeug/stateit';\n\nimport type { HTMLResult } from '../internal';\n\ntype Dep = unknown | ReadonlySignal<unknown>;\n\nexport type MemoOptions = {\n deps?: ReadonlyArray<Dep>;\n render: () => string | HTMLResult;\n};\n\n/**\n * Memoizes a template fragment — `templateFn` is only re-called when at least\n * one entry in `deps` has changed (compared with `Object.is`).\n *\n * Signal values in `deps` are automatically unwrapped and tracked, so changing a\n * dep signal triggers a re-evaluation. This is useful for skipping expensive\n * sub-tree renders when only unrelated state changes.\n *\n * @example\n * import { memo } from '@vielzeug/craftit/directives';\n *\n * // Only re-renders the table when `rows` actually changes\n * html`${memo({ deps: [rows], render: () => html`<big-table :data=${rows}></big-table>` })}`\n *\n * // Multiple deps — re-renders when either changes\n * html`${memo({ deps: [locale, theme], render: () => html`<themed-chart :locale=${locale}></themed-chart>` })}`\n */\nexport function memo(options: MemoOptions): () => string | HTMLResult {\n const renderSignal = computed(() => {\n for (const dep of options.deps ?? []) {\n if (isSignal(dep)) Reflect.get(dep, 'value');\n }\n\n return untrack(options.render);\n });\n\n return () => renderSignal.value;\n}\n"],"mappings":"wEA4BA,SAAgB,EAAK,EAAiD,CACpE,IAAM,EAAe,MAAe,CAClC,IAAK,IAAM,KAAO,EAAQ,MAAQ,EAAE,CAC9B,EAAS,EAAI,EAAE,QAAQ,IAAI,EAAK,QAAQ,CAG9C,OAAO,EAAQ,EAAQ,OAAO,EAC9B,CAEF,UAAa,EAAa"}
@@ -1,2 +0,0 @@
1
- const e=require(`../internal.cjs`);function t(t,n,r){return{mount(i,{registerCleanup:a}){if(t===`clickOutside`){let t=i.ownerDocument??document;a(e.listen(t,`click`,e=>{e.composedPath().includes(i)||n(e)},r))}else a(e.listen(i,t,n,r))}}}exports.on=t;
2
- //# sourceMappingURL=on.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"on.cjs","names":[],"sources":["../../src/directives/on.ts"],"sourcesContent":["import type { Directive } from '../internal';\n\nimport { listen } from '../internal';\n\n/**\n * Attaches an event listener to an element as a spread directive, supporting\n * full `AddEventListenerOptions` (e.g. `passive`, `once`, `capture`).\n *\n * **Synthetic event: `'clickOutside'`**\n * When the event name is `'clickOutside'`, the listener is attached to `document`\n * and fires whenever a click occurs *outside* the host element — useful for\n * closing dropdowns, modals, and popovers.\n *\n * @example\n * import { on } from '@vielzeug/craftit/directives';\n *\n * // Passive wheel listener (not possible with @wheel= template syntax)\n * html`<div ${on('wheel', onScroll, { passive: true })}></div>`\n *\n * // Typed handler — `e` inferred as `MouseEvent`\n * html`<button ${on('click', (e) => e.clientX)}></button>`\n *\n * // Click-outside (closes a dropdown when the user clicks away)\n * html`<div ${on('clickOutside', () => open.value = false)}></div>`\n */\nexport function on(\n event: 'clickOutside',\n handler: (e: MouseEvent) => void,\n options?: AddEventListenerOptions,\n): Directive;\nexport function on<K extends keyof HTMLElementEventMap>(\n event: K,\n handler: (e: HTMLElementEventMap[K]) => void,\n options?: AddEventListenerOptions,\n): Directive;\nexport function on(event: string, handler: (e: any) => void, options?: AddEventListenerOptions): Directive {\n return {\n mount(el, { registerCleanup }) {\n if (event === 'clickOutside') {\n const doc = el.ownerDocument ?? document;\n const docHandler = (e: Event) => {\n if (!e.composedPath().includes(el)) handler(e as MouseEvent);\n };\n\n registerCleanup(listen(doc, 'click', docHandler, options));\n } else {\n registerCleanup(listen(el, event, handler, options));\n }\n },\n };\n}\n"],"mappings":"mCAmCA,SAAgB,EAAG,EAAe,EAA2B,EAA8C,CACzG,MAAO,CACL,MAAM,EAAI,CAAE,mBAAmB,CAC7B,GAAI,IAAU,eAAgB,CAC5B,IAAM,EAAM,EAAG,eAAiB,SAKhC,EAAgB,EAAA,OAAO,EAAK,QAJR,GAAa,CAC1B,EAAE,cAAc,CAAC,SAAS,EAAG,EAAE,EAAQ,EAAgB,EAGb,EAAQ,CAAC,MAE1D,EAAgB,EAAA,OAAO,EAAI,EAAO,EAAS,EAAQ,CAAC,EAGzD"}
@@ -1,25 +0,0 @@
1
- import type { Directive } from '../internal';
2
- /**
3
- * Attaches an event listener to an element as a spread directive, supporting
4
- * full `AddEventListenerOptions` (e.g. `passive`, `once`, `capture`).
5
- *
6
- * **Synthetic event: `'clickOutside'`**
7
- * When the event name is `'clickOutside'`, the listener is attached to `document`
8
- * and fires whenever a click occurs *outside* the host element — useful for
9
- * closing dropdowns, modals, and popovers.
10
- *
11
- * @example
12
- * import { on } from '@vielzeug/craftit/directives';
13
- *
14
- * // Passive wheel listener (not possible with @wheel= template syntax)
15
- * html`<div ${on('wheel', onScroll, { passive: true })}></div>`
16
- *
17
- * // Typed handler — `e` inferred as `MouseEvent`
18
- * html`<button ${on('click', (e) => e.clientX)}></button>`
19
- *
20
- * // Click-outside (closes a dropdown when the user clicks away)
21
- * html`<div ${on('clickOutside', () => open.value = false)}></div>`
22
- */
23
- export declare function on(event: 'clickOutside', handler: (e: MouseEvent) => void, options?: AddEventListenerOptions): Directive;
24
- export declare function on<K extends keyof HTMLElementEventMap>(event: K, handler: (e: HTMLElementEventMap[K]) => void, options?: AddEventListenerOptions): Directive;
25
- //# sourceMappingURL=on.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"on.d.ts","sourceRoot":"","sources":["../../src/directives/on.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,EAAE,CAChB,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,EAChC,OAAO,CAAC,EAAE,uBAAuB,GAChC,SAAS,CAAC;AACb,wBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,mBAAmB,EACpD,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,IAAI,EAC5C,OAAO,CAAC,EAAE,uBAAuB,GAChC,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- import{listen as e}from"../internal.js";function t(t,n,r){return{mount(i,{registerCleanup:a}){a(t===`clickOutside`?e(i.ownerDocument??document,`click`,e=>{e.composedPath().includes(i)||n(e)},r):e(i,t,n,r))}}}export{t as on};
2
- //# sourceMappingURL=on.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"on.js","names":[],"sources":["../../src/directives/on.ts"],"sourcesContent":["import type { Directive } from '../internal';\n\nimport { listen } from '../internal';\n\n/**\n * Attaches an event listener to an element as a spread directive, supporting\n * full `AddEventListenerOptions` (e.g. `passive`, `once`, `capture`).\n *\n * **Synthetic event: `'clickOutside'`**\n * When the event name is `'clickOutside'`, the listener is attached to `document`\n * and fires whenever a click occurs *outside* the host element — useful for\n * closing dropdowns, modals, and popovers.\n *\n * @example\n * import { on } from '@vielzeug/craftit/directives';\n *\n * // Passive wheel listener (not possible with @wheel= template syntax)\n * html`<div ${on('wheel', onScroll, { passive: true })}></div>`\n *\n * // Typed handler — `e` inferred as `MouseEvent`\n * html`<button ${on('click', (e) => e.clientX)}></button>`\n *\n * // Click-outside (closes a dropdown when the user clicks away)\n * html`<div ${on('clickOutside', () => open.value = false)}></div>`\n */\nexport function on(\n event: 'clickOutside',\n handler: (e: MouseEvent) => void,\n options?: AddEventListenerOptions,\n): Directive;\nexport function on<K extends keyof HTMLElementEventMap>(\n event: K,\n handler: (e: HTMLElementEventMap[K]) => void,\n options?: AddEventListenerOptions,\n): Directive;\nexport function on(event: string, handler: (e: any) => void, options?: AddEventListenerOptions): Directive {\n return {\n mount(el, { registerCleanup }) {\n if (event === 'clickOutside') {\n const doc = el.ownerDocument ?? document;\n const docHandler = (e: Event) => {\n if (!e.composedPath().includes(el)) handler(e as MouseEvent);\n };\n\n registerCleanup(listen(doc, 'click', docHandler, options));\n } else {\n registerCleanup(listen(el, event, handler, options));\n }\n },\n };\n}\n"],"mappings":"wCAmCA,SAAgB,EAAG,EAAe,EAA2B,EAA8C,CACzG,MAAO,CACL,MAAM,EAAI,CAAE,mBAAmB,CAO3B,EANE,IAAU,eAMI,EALJ,EAAG,eAAiB,SAKJ,QAJR,GAAa,CAC1B,EAAE,cAAc,CAAC,SAAS,EAAG,EAAE,EAAQ,EAAgB,EAGb,EAAQ,CAEzC,EAAO,EAAI,EAAO,EAAS,EAAQ,CAAC,EAGzD"}
@@ -1,2 +0,0 @@
1
- const e=require(`../internal.cjs`),t=require(`../runtime-bindings.cjs`);let n=require(`@vielzeug/stateit`);var r=(e,t,r)=>e?(r((0,n.effect)(()=>{t(e.value)})),!0):!1,i=(t,n,r,i)=>n.startsWith(`@`)?(typeof r==`function`&&i(e.listen(t,n.slice(1),r)),!0):!1,a=(e,n,i,a)=>{if(!n.startsWith(`.`))return!1;let o=n.slice(1),s=t.hasWritableValueSetter(i)?i:void 0;return r(t.toReactiveBindingSource(i),t=>e[o]=t,a)||(e[o]=i),t.bindPropertyModel(e,o,s,a),!0},o=(e,n,i,a)=>{if(!n.startsWith(`?`))return!1;let o=n.slice(1);return r(t.toReactiveBindingSource(i),t=>e.toggleAttribute(o,!!t),a)||e.toggleAttribute(o,!!i),!0},s=(n,i,a,o)=>{r(t.toReactiveBindingSource(a),t=>e.setAttr(n,i,t),o)||e.setAttr(n,i,a)},c=(e,t,n,r)=>{n!==void 0&&(i(e,t,n,r)||a(e,t,n,r)||o(e,t,n,r)||s(e,t,n,r))};function l(e){return{mount(t,{registerCleanup:n}){for(let[r,i]of Object.entries(e))c(t,r,i,n)}}}exports.spread=l;
2
- //# sourceMappingURL=spread.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spread.cjs","names":[],"sources":["../../src/directives/spread.ts"],"sourcesContent":["import { effect, type ReadonlySignal } from '@vielzeug/stateit';\n\nimport { type Directive, listen, setAttr } from '../internal';\nimport { bindPropertyModel, hasWritableValueSetter, toReactiveBindingSource } from '../runtime-bindings';\n\nexport type SpreadValue =\n | string\n | number\n | boolean\n | null\n | undefined\n | ReadonlySignal<string | number | boolean | null | undefined>\n | (() => string | number | boolean | null | undefined)\n | ((event: Event) => void);\n\ntype RegisterCleanup = (fn: () => void) => void;\n\nconst applyReactiveValue = (\n source: ReadonlySignal<unknown> | undefined,\n apply: (value: unknown) => void,\n registerCleanup: RegisterCleanup,\n): boolean => {\n if (!source) return false;\n\n registerCleanup(\n effect(() => {\n apply(source.value);\n }),\n );\n\n return true;\n};\n\nconst applyEventEntry = (\n el: HTMLElement,\n rawKey: string,\n rawValue: SpreadValue,\n registerCleanup: RegisterCleanup,\n): boolean => {\n if (!rawKey.startsWith('@')) return false;\n\n if (typeof rawValue === 'function') {\n registerCleanup(listen(el, rawKey.slice(1), rawValue as (event: Event) => void));\n }\n\n return true;\n};\n\nconst applyPropertyEntry = (\n el: HTMLElement,\n rawKey: string,\n rawValue: SpreadValue,\n registerCleanup: RegisterCleanup,\n): boolean => {\n if (!rawKey.startsWith('.')) return false;\n\n const key = rawKey.slice(1);\n const writableModel = hasWritableValueSetter(rawValue) ? rawValue : undefined;\n const source = toReactiveBindingSource(rawValue);\n\n if (!applyReactiveValue(source, (value) => ((el as any)[key] = value), registerCleanup)) {\n (el as any)[key] = rawValue;\n }\n\n bindPropertyModel(el, key, writableModel, registerCleanup);\n\n return true;\n};\n\nconst applyBooleanAttributeEntry = (\n el: HTMLElement,\n rawKey: string,\n rawValue: SpreadValue,\n registerCleanup: RegisterCleanup,\n): boolean => {\n if (!rawKey.startsWith('?')) return false;\n\n const key = rawKey.slice(1);\n const source = toReactiveBindingSource(rawValue);\n\n if (!applyReactiveValue(source, (value) => el.toggleAttribute(key, Boolean(value)), registerCleanup)) {\n el.toggleAttribute(key, Boolean(rawValue));\n }\n\n return true;\n};\n\nconst applyAttributeEntry = (\n el: HTMLElement,\n rawKey: string,\n rawValue: SpreadValue,\n registerCleanup: RegisterCleanup,\n): void => {\n const source = toReactiveBindingSource(rawValue);\n\n if (!applyReactiveValue(source, (value) => setAttr(el, rawKey, value), registerCleanup)) {\n setAttr(el, rawKey, rawValue);\n }\n};\n\nconst applyEntry = (el: HTMLElement, rawKey: string, rawValue: SpreadValue, registerCleanup: RegisterCleanup): void => {\n if (rawValue === undefined) return;\n\n if (applyEventEntry(el, rawKey, rawValue, registerCleanup)) return;\n\n if (applyPropertyEntry(el, rawKey, rawValue, registerCleanup)) return;\n\n if (applyBooleanAttributeEntry(el, rawKey, rawValue, registerCleanup)) return;\n\n applyAttributeEntry(el, rawKey, rawValue, registerCleanup);\n};\n\n/**\n * Unified spread directive for attributes, properties, and events.\n *\n * Key prefixes:\n * - `name` -> attribute\n * - `?name` -> boolean attribute\n * - `.name` -> DOM property\n * - `@name` -> event listener\n */\nexport function spread(map: Record<string, SpreadValue>): Directive {\n return {\n mount(el, { registerCleanup }) {\n for (const [key, value] of Object.entries(map)) {\n applyEntry(el, key, value, registerCleanup);\n }\n },\n };\n}\n"],"mappings":"2GAiBA,IAAM,GACJ,EACA,EACA,IAEK,GAEL,GAAA,EAAA,EAAA,YACe,CACX,EAAM,EAAO,MAAM,EACnB,CACH,CAEM,IARa,GAWhB,GACJ,EACA,EACA,EACA,IAEK,EAAO,WAAW,IAAI,EAEvB,OAAO,GAAa,YACtB,EAAgB,EAAA,OAAO,EAAI,EAAO,MAAM,EAAE,CAAE,EAAmC,CAAC,CAG3E,IAN6B,GAShC,GACJ,EACA,EACA,EACA,IACY,CACZ,GAAI,CAAC,EAAO,WAAW,IAAI,CAAE,MAAO,GAEpC,IAAM,EAAM,EAAO,MAAM,EAAE,CACrB,EAAgB,EAAA,uBAAuB,EAAS,CAAG,EAAW,IAAA,GASpE,OANK,EAFU,EAAA,wBAAwB,EAAS,CAEf,GAAW,EAAY,GAAO,EAAQ,EAAgB,GACpF,EAAW,GAAO,GAGrB,EAAA,kBAAkB,EAAI,EAAK,EAAe,EAAgB,CAEnD,IAGH,GACJ,EACA,EACA,EACA,IACY,CACZ,GAAI,CAAC,EAAO,WAAW,IAAI,CAAE,MAAO,GAEpC,IAAM,EAAM,EAAO,MAAM,EAAE,CAO3B,OAJK,EAFU,EAAA,wBAAwB,EAAS,CAEf,GAAU,EAAG,gBAAgB,EAAK,EAAQ,EAAO,CAAE,EAAgB,EAClG,EAAG,gBAAgB,EAAK,EAAQ,EAAU,CAGrC,IAGH,GACJ,EACA,EACA,EACA,IACS,CAGJ,EAFU,EAAA,wBAAwB,EAAS,CAEf,GAAU,EAAA,QAAQ,EAAI,EAAQ,EAAM,CAAE,EAAgB,EACrF,EAAA,QAAQ,EAAI,EAAQ,EAAS,EAI3B,GAAc,EAAiB,EAAgB,EAAuB,IAA2C,CACjH,IAAa,IAAA,KAEb,EAAgB,EAAI,EAAQ,EAAU,EAAgB,EAEtD,EAAmB,EAAI,EAAQ,EAAU,EAAgB,EAEzD,EAA2B,EAAI,EAAQ,EAAU,EAAgB,EAErE,EAAoB,EAAI,EAAQ,EAAU,EAAgB,GAY5D,SAAgB,EAAO,EAA6C,CAClE,MAAO,CACL,MAAM,EAAI,CAAE,mBAAmB,CAC7B,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,EAAI,CAC5C,EAAW,EAAI,EAAK,EAAO,EAAgB,EAGhD"}
@@ -1,14 +0,0 @@
1
- import { type ReadonlySignal } from '@vielzeug/stateit';
2
- import { type Directive } from '../internal';
3
- export type SpreadValue = string | number | boolean | null | undefined | ReadonlySignal<string | number | boolean | null | undefined> | (() => string | number | boolean | null | undefined) | ((event: Event) => void);
4
- /**
5
- * Unified spread directive for attributes, properties, and events.
6
- *
7
- * Key prefixes:
8
- * - `name` -> attribute
9
- * - `?name` -> boolean attribute
10
- * - `.name` -> DOM property
11
- * - `@name` -> event listener
12
- */
13
- export declare function spread(map: Record<string, SpreadValue>): Directive;
14
- //# sourceMappingURL=spread.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spread.d.ts","sourceRoot":"","sources":["../../src/directives/spread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,aAAa,CAAC;AAG9D,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,cAAc,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,GAC5D,CAAC,MAAM,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,GACpD,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC;AAmG7B;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,CAQlE"}
@@ -1,2 +0,0 @@
1
- import{listen as e,setAttr as t}from"../internal.js";import{bindPropertyModel as n,hasWritableValueSetter as r,toReactiveBindingSource as i}from"../runtime-bindings.js";import{effect as a}from"@vielzeug/stateit";var o=(e,t,n)=>e?(n(a(()=>{t(e.value)})),!0):!1,s=(t,n,r,i)=>n.startsWith(`@`)?(typeof r==`function`&&i(e(t,n.slice(1),r)),!0):!1,c=(e,t,a,s)=>{if(!t.startsWith(`.`))return!1;let c=t.slice(1),l=r(a)?a:void 0;return o(i(a),t=>e[c]=t,s)||(e[c]=a),n(e,c,l,s),!0},l=(e,t,n,r)=>{if(!t.startsWith(`?`))return!1;let a=t.slice(1);return o(i(n),t=>e.toggleAttribute(a,!!t),r)||e.toggleAttribute(a,!!n),!0},u=(e,n,r,a)=>{o(i(r),r=>t(e,n,r),a)||t(e,n,r)},d=(e,t,n,r)=>{n!==void 0&&(s(e,t,n,r)||c(e,t,n,r)||l(e,t,n,r)||u(e,t,n,r))};function f(e){return{mount(t,{registerCleanup:n}){for(let[r,i]of Object.entries(e))d(t,r,i,n)}}}export{f as spread};
2
- //# sourceMappingURL=spread.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spread.js","names":[],"sources":["../../src/directives/spread.ts"],"sourcesContent":["import { effect, type ReadonlySignal } from '@vielzeug/stateit';\n\nimport { type Directive, listen, setAttr } from '../internal';\nimport { bindPropertyModel, hasWritableValueSetter, toReactiveBindingSource } from '../runtime-bindings';\n\nexport type SpreadValue =\n | string\n | number\n | boolean\n | null\n | undefined\n | ReadonlySignal<string | number | boolean | null | undefined>\n | (() => string | number | boolean | null | undefined)\n | ((event: Event) => void);\n\ntype RegisterCleanup = (fn: () => void) => void;\n\nconst applyReactiveValue = (\n source: ReadonlySignal<unknown> | undefined,\n apply: (value: unknown) => void,\n registerCleanup: RegisterCleanup,\n): boolean => {\n if (!source) return false;\n\n registerCleanup(\n effect(() => {\n apply(source.value);\n }),\n );\n\n return true;\n};\n\nconst applyEventEntry = (\n el: HTMLElement,\n rawKey: string,\n rawValue: SpreadValue,\n registerCleanup: RegisterCleanup,\n): boolean => {\n if (!rawKey.startsWith('@')) return false;\n\n if (typeof rawValue === 'function') {\n registerCleanup(listen(el, rawKey.slice(1), rawValue as (event: Event) => void));\n }\n\n return true;\n};\n\nconst applyPropertyEntry = (\n el: HTMLElement,\n rawKey: string,\n rawValue: SpreadValue,\n registerCleanup: RegisterCleanup,\n): boolean => {\n if (!rawKey.startsWith('.')) return false;\n\n const key = rawKey.slice(1);\n const writableModel = hasWritableValueSetter(rawValue) ? rawValue : undefined;\n const source = toReactiveBindingSource(rawValue);\n\n if (!applyReactiveValue(source, (value) => ((el as any)[key] = value), registerCleanup)) {\n (el as any)[key] = rawValue;\n }\n\n bindPropertyModel(el, key, writableModel, registerCleanup);\n\n return true;\n};\n\nconst applyBooleanAttributeEntry = (\n el: HTMLElement,\n rawKey: string,\n rawValue: SpreadValue,\n registerCleanup: RegisterCleanup,\n): boolean => {\n if (!rawKey.startsWith('?')) return false;\n\n const key = rawKey.slice(1);\n const source = toReactiveBindingSource(rawValue);\n\n if (!applyReactiveValue(source, (value) => el.toggleAttribute(key, Boolean(value)), registerCleanup)) {\n el.toggleAttribute(key, Boolean(rawValue));\n }\n\n return true;\n};\n\nconst applyAttributeEntry = (\n el: HTMLElement,\n rawKey: string,\n rawValue: SpreadValue,\n registerCleanup: RegisterCleanup,\n): void => {\n const source = toReactiveBindingSource(rawValue);\n\n if (!applyReactiveValue(source, (value) => setAttr(el, rawKey, value), registerCleanup)) {\n setAttr(el, rawKey, rawValue);\n }\n};\n\nconst applyEntry = (el: HTMLElement, rawKey: string, rawValue: SpreadValue, registerCleanup: RegisterCleanup): void => {\n if (rawValue === undefined) return;\n\n if (applyEventEntry(el, rawKey, rawValue, registerCleanup)) return;\n\n if (applyPropertyEntry(el, rawKey, rawValue, registerCleanup)) return;\n\n if (applyBooleanAttributeEntry(el, rawKey, rawValue, registerCleanup)) return;\n\n applyAttributeEntry(el, rawKey, rawValue, registerCleanup);\n};\n\n/**\n * Unified spread directive for attributes, properties, and events.\n *\n * Key prefixes:\n * - `name` -> attribute\n * - `?name` -> boolean attribute\n * - `.name` -> DOM property\n * - `@name` -> event listener\n */\nexport function spread(map: Record<string, SpreadValue>): Directive {\n return {\n mount(el, { registerCleanup }) {\n for (const [key, value] of Object.entries(map)) {\n applyEntry(el, key, value, registerCleanup);\n }\n },\n };\n}\n"],"mappings":"oNAiBA,IAAM,GACJ,EACA,EACA,IAEK,GAEL,EACE,MAAa,CACX,EAAM,EAAO,MAAM,EACnB,CACH,CAEM,IARa,GAWhB,GACJ,EACA,EACA,EACA,IAEK,EAAO,WAAW,IAAI,EAEvB,OAAO,GAAa,YACtB,EAAgB,EAAO,EAAI,EAAO,MAAM,EAAE,CAAE,EAAmC,CAAC,CAG3E,IAN6B,GAShC,GACJ,EACA,EACA,EACA,IACY,CACZ,GAAI,CAAC,EAAO,WAAW,IAAI,CAAE,MAAO,GAEpC,IAAM,EAAM,EAAO,MAAM,EAAE,CACrB,EAAgB,EAAuB,EAAS,CAAG,EAAW,IAAA,GASpE,OANK,EAFU,EAAwB,EAAS,CAEf,GAAW,EAAY,GAAO,EAAQ,EAAgB,GACpF,EAAW,GAAO,GAGrB,EAAkB,EAAI,EAAK,EAAe,EAAgB,CAEnD,IAGH,GACJ,EACA,EACA,EACA,IACY,CACZ,GAAI,CAAC,EAAO,WAAW,IAAI,CAAE,MAAO,GAEpC,IAAM,EAAM,EAAO,MAAM,EAAE,CAO3B,OAJK,EAFU,EAAwB,EAAS,CAEf,GAAU,EAAG,gBAAgB,EAAK,EAAQ,EAAO,CAAE,EAAgB,EAClG,EAAG,gBAAgB,EAAK,EAAQ,EAAU,CAGrC,IAGH,GACJ,EACA,EACA,EACA,IACS,CAGJ,EAFU,EAAwB,EAAS,CAEf,GAAU,EAAQ,EAAI,EAAQ,EAAM,CAAE,EAAgB,EACrF,EAAQ,EAAI,EAAQ,EAAS,EAI3B,GAAc,EAAiB,EAAgB,EAAuB,IAA2C,CACjH,IAAa,IAAA,KAEb,EAAgB,EAAI,EAAQ,EAAU,EAAgB,EAEtD,EAAmB,EAAI,EAAQ,EAAU,EAAgB,EAEzD,EAA2B,EAAI,EAAQ,EAAU,EAAgB,EAErE,EAAoB,EAAI,EAAQ,EAAU,EAAgB,GAY5D,SAAgB,EAAO,EAA6C,CAClE,MAAO,CACL,MAAM,EAAI,CAAE,mBAAmB,CAC7B,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,EAAI,CAC5C,EAAW,EAAI,EAAK,EAAO,EAAgB,EAGhD"}
@@ -1,2 +0,0 @@
1
- const e=require(`../internal.cjs`);let t=require(`@vielzeug/stateit`);var n=new Set([`animationIterationCount`,`columnCount`,`flex`,`flexGrow`,`flexShrink`,`fontWeight`,`gridColumn`,`gridRow`,`lineHeight`,`opacity`,`order`,`orphans`,`tabSize`,`widows`,`zIndex`]),r=(e,t)=>typeof t==`number`&&!n.has(e)?`${t}px`:String(t);function i(n){let i=Object.entries(n),a=i.some(([,e])=>(0,t.isSignal)(e)||typeof e==`function`),o=()=>{let n=[];for(let[a,o]of i){let i=(0,t.isSignal)(o)?o.value:typeof o==`function`?o():o;i!=null&&i!==``&&n.push(`${e.toKebab(a)}:${r(a,i)}`)}return n.join(`;`)};return a?(0,t.computed)(o):o()}exports.style=i;
2
- //# sourceMappingURL=style.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.cjs","names":[],"sources":["../../src/directives/style.ts"],"sourcesContent":["import { computed, isSignal, type ReadonlySignal, type Signal } from '@vielzeug/stateit';\n\nimport { toKebab } from '../internal';\n\ntype StyleValue =\n | string\n | number\n | undefined\n | null\n | Signal<string | number>\n | ReadonlySignal<string | number>\n | (() => string | number | null | undefined);\n\n/** Properties that are unitless — numbers are NOT suffixed with 'px'. */\nconst UNITLESS = new Set([\n 'animationIterationCount',\n 'columnCount',\n 'flex',\n 'flexGrow',\n 'flexShrink',\n 'fontWeight',\n 'gridColumn',\n 'gridRow',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'tabSize',\n 'widows',\n 'zIndex',\n]);\n\nconst toCssValue = (prop: string, val: string | number): string => {\n if (typeof val === 'number' && !UNITLESS.has(prop)) return `${val}px`;\n\n return String(val);\n};\n\n/**\n * Build a dynamic inline style string from an object map of CSS properties to values.\n * Supports camelCase property names (auto-converted to kebab-case). Number values\n * automatically get a `px` suffix except for unitless properties (opacity, zIndex, etc.).\n *\n * When any value is a reactive Signal or getter function the returned value is a\n * `ReadonlySignal<string>` that updates automatically — no arrow-function wrapper needed.\n *\n * @example\n * import { style } from '@vielzeug/craftit/directives';\n *\n * // Static — returns a plain string\n * html`<div style=${style({ color: 'red', fontSize: 16 })}></div>`\n *\n * // Reactive — returns a signal\n * html`<div style=${style({ fontSize: size, color: theme })}></div>`\n */\nexport function style(map: Record<string, StyleValue>): string | ReadonlySignal<string> {\n const entries = Object.entries(map);\n const hasReactive = entries.some(([, v]) => isSignal(v) || typeof v === 'function');\n\n const build = (): string => {\n const parts: string[] = [];\n\n for (const [k, v] of entries) {\n const raw = isSignal(v)\n ? (v as ReadonlySignal<string | number>).value\n : typeof v === 'function'\n ? (v as () => string | number | null | undefined)()\n : v;\n\n if (raw != null && raw !== '') parts.push(`${toKebab(k)}:${toCssValue(k, raw as string | number)}`);\n }\n\n return parts.join(';');\n };\n\n return hasReactive ? computed(build) : build();\n}\n"],"mappings":"sEAcA,IAAM,EAAW,IAAI,IAAI,CACvB,0BACA,cACA,OACA,WACA,aACA,aACA,aACA,UACA,aACA,UACA,QACA,UACA,UACA,SACA,SACD,CAAC,CAEI,GAAc,EAAc,IAC5B,OAAO,GAAQ,UAAY,CAAC,EAAS,IAAI,EAAK,CAAS,GAAG,EAAI,IAE3D,OAAO,EAAI,CAoBpB,SAAgB,EAAM,EAAkE,CACtF,IAAM,EAAU,OAAO,QAAQ,EAAI,CAC7B,EAAc,EAAQ,MAAM,EAAG,MAAA,EAAA,EAAA,UAAgB,EAAE,EAAI,OAAO,GAAM,WAAW,CAE7E,MAAsB,CAC1B,IAAM,EAAkB,EAAE,CAE1B,IAAK,GAAM,CAAC,EAAG,KAAM,EAAS,CAC5B,IAAM,GAAA,EAAA,EAAA,UAAe,EAAE,CAClB,EAAsC,MACvC,OAAO,GAAM,WACV,GAAgD,CACjD,EAEF,GAAO,MAAQ,IAAQ,IAAI,EAAM,KAAK,GAAG,EAAA,QAAQ,EAAE,CAAC,GAAG,EAAW,EAAG,EAAuB,GAAG,CAGrG,OAAO,EAAM,KAAK,IAAI,EAGxB,OAAO,GAAA,EAAA,EAAA,UAAuB,EAAM,CAAG,GAAO"}
@@ -1,22 +0,0 @@
1
- import { type ReadonlySignal, type Signal } from '@vielzeug/stateit';
2
- type StyleValue = string | number | undefined | null | Signal<string | number> | ReadonlySignal<string | number> | (() => string | number | null | undefined);
3
- /**
4
- * Build a dynamic inline style string from an object map of CSS properties to values.
5
- * Supports camelCase property names (auto-converted to kebab-case). Number values
6
- * automatically get a `px` suffix except for unitless properties (opacity, zIndex, etc.).
7
- *
8
- * When any value is a reactive Signal or getter function the returned value is a
9
- * `ReadonlySignal<string>` that updates automatically — no arrow-function wrapper needed.
10
- *
11
- * @example
12
- * import { style } from '@vielzeug/craftit/directives';
13
- *
14
- * // Static — returns a plain string
15
- * html`<div style=${style({ color: 'red', fontSize: 16 })}></div>`
16
- *
17
- * // Reactive — returns a signal
18
- * html`<div style=${style({ fontSize: size, color: theme })}></div>`
19
- */
20
- export declare function style(map: Record<string, StyleValue>): string | ReadonlySignal<string>;
21
- export {};
22
- //# sourceMappingURL=style.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/directives/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIzF,KAAK,UAAU,GACX,MAAM,GACN,MAAM,GACN,SAAS,GACT,IAAI,GACJ,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,GACvB,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,GAC/B,CAAC,MAAM,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AA2B/C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAqBtF"}
@@ -1,2 +0,0 @@
1
- import{toKebab as e}from"../internal.js";import{computed as t,isSignal as n}from"@vielzeug/stateit";var r=new Set([`animationIterationCount`,`columnCount`,`flex`,`flexGrow`,`flexShrink`,`fontWeight`,`gridColumn`,`gridRow`,`lineHeight`,`opacity`,`order`,`orphans`,`tabSize`,`widows`,`zIndex`]),i=(e,t)=>typeof t==`number`&&!r.has(e)?`${t}px`:String(t);function a(r){let a=Object.entries(r),o=a.some(([,e])=>n(e)||typeof e==`function`),s=()=>{let t=[];for(let[r,o]of a){let a=n(o)?o.value:typeof o==`function`?o():o;a!=null&&a!==``&&t.push(`${e(r)}:${i(r,a)}`)}return t.join(`;`)};return o?t(s):s()}export{a as style};
2
- //# sourceMappingURL=style.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.js","names":[],"sources":["../../src/directives/style.ts"],"sourcesContent":["import { computed, isSignal, type ReadonlySignal, type Signal } from '@vielzeug/stateit';\n\nimport { toKebab } from '../internal';\n\ntype StyleValue =\n | string\n | number\n | undefined\n | null\n | Signal<string | number>\n | ReadonlySignal<string | number>\n | (() => string | number | null | undefined);\n\n/** Properties that are unitless — numbers are NOT suffixed with 'px'. */\nconst UNITLESS = new Set([\n 'animationIterationCount',\n 'columnCount',\n 'flex',\n 'flexGrow',\n 'flexShrink',\n 'fontWeight',\n 'gridColumn',\n 'gridRow',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'tabSize',\n 'widows',\n 'zIndex',\n]);\n\nconst toCssValue = (prop: string, val: string | number): string => {\n if (typeof val === 'number' && !UNITLESS.has(prop)) return `${val}px`;\n\n return String(val);\n};\n\n/**\n * Build a dynamic inline style string from an object map of CSS properties to values.\n * Supports camelCase property names (auto-converted to kebab-case). Number values\n * automatically get a `px` suffix except for unitless properties (opacity, zIndex, etc.).\n *\n * When any value is a reactive Signal or getter function the returned value is a\n * `ReadonlySignal<string>` that updates automatically — no arrow-function wrapper needed.\n *\n * @example\n * import { style } from '@vielzeug/craftit/directives';\n *\n * // Static — returns a plain string\n * html`<div style=${style({ color: 'red', fontSize: 16 })}></div>`\n *\n * // Reactive — returns a signal\n * html`<div style=${style({ fontSize: size, color: theme })}></div>`\n */\nexport function style(map: Record<string, StyleValue>): string | ReadonlySignal<string> {\n const entries = Object.entries(map);\n const hasReactive = entries.some(([, v]) => isSignal(v) || typeof v === 'function');\n\n const build = (): string => {\n const parts: string[] = [];\n\n for (const [k, v] of entries) {\n const raw = isSignal(v)\n ? (v as ReadonlySignal<string | number>).value\n : typeof v === 'function'\n ? (v as () => string | number | null | undefined)()\n : v;\n\n if (raw != null && raw !== '') parts.push(`${toKebab(k)}:${toCssValue(k, raw as string | number)}`);\n }\n\n return parts.join(';');\n };\n\n return hasReactive ? computed(build) : build();\n}\n"],"mappings":"oGAcA,IAAM,EAAW,IAAI,IAAI,CACvB,0BACA,cACA,OACA,WACA,aACA,aACA,aACA,UACA,aACA,UACA,QACA,UACA,UACA,SACA,SACD,CAAC,CAEI,GAAc,EAAc,IAC5B,OAAO,GAAQ,UAAY,CAAC,EAAS,IAAI,EAAK,CAAS,GAAG,EAAI,IAE3D,OAAO,EAAI,CAoBpB,SAAgB,EAAM,EAAkE,CACtF,IAAM,EAAU,OAAO,QAAQ,EAAI,CAC7B,EAAc,EAAQ,MAAM,EAAG,KAAO,EAAS,EAAE,EAAI,OAAO,GAAM,WAAW,CAE7E,MAAsB,CAC1B,IAAM,EAAkB,EAAE,CAE1B,IAAK,GAAM,CAAC,EAAG,KAAM,EAAS,CAC5B,IAAM,EAAM,EAAS,EAAE,CAClB,EAAsC,MACvC,OAAO,GAAM,WACV,GAAgD,CACjD,EAEF,GAAO,MAAQ,IAAQ,IAAI,EAAM,KAAK,GAAG,EAAQ,EAAE,CAAC,GAAG,EAAW,EAAG,EAAuB,GAAG,CAGrG,OAAO,EAAM,KAAK,IAAI,EAGxB,OAAO,EAAc,EAAS,EAAM,CAAG,GAAO"}
@@ -1,2 +0,0 @@
1
- let e=require(`@vielzeug/stateit`);function t(t,n,r){let i=(0,e.signal)({done:!1});return t.then(e=>{i.value={done:!0,value:e}},e=>{r?i.value={done:!0,value:r(e)}:i.value={done:!0,value:`Error: ${String(e)}`}}),()=>i.value.done?i.value.value:n?.()??``}exports.until=t;
2
- //# sourceMappingURL=until.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"until.cjs","names":[],"sources":["../../src/directives/until.ts"],"sourcesContent":["import { signal } from '@vielzeug/stateit';\n\nimport type { HTMLResult } from '../internal';\n\ntype State = { done: false } | { done: true; value: string | HTMLResult };\n\n/**\n * Renders `pendingFn` while a Promise is pending, then switches to the resolved\n * result. Lighter-weight alternative to `suspense()` for one-shot data loading\n * with no error/retry UI.\n *\n * Returns a reactive getter the engine tracks automatically — no manual signal\n * management needed at the call site.\n *\n * @param promise The promise to await. Should already resolve to a renderable value.\n * @param pendingFn Optional function called while the promise is pending.\n * @param onError Optional function called when the promise rejects. Receives the rejection reason.\n *\n * @example\n * import { until } from '@vielzeug/craftit/directives';\n *\n * const data = fetch('/api/user').then(r => r.json());\n *\n * html`${until(\n * data.then(u => html`<p>Hello, ${u.name}!</p>`),\n * () => html`<p>Loading…</p>`,\n * (err) => html`<p>Error: ${String(err)}</p>`,\n * )}`\n */\nexport function until(\n promise: Promise<string | HTMLResult>,\n pendingFn?: () => string | HTMLResult,\n onError?: (err: unknown) => string | HTMLResult,\n): () => string | HTMLResult {\n const state = signal<State>({ done: false });\n\n promise.then(\n (val) => {\n state.value = { done: true, value: val };\n },\n (err) => {\n if (onError) {\n state.value = { done: true, value: onError(err) };\n } else {\n state.value = { done: true, value: `Error: ${String(err)}` };\n }\n },\n );\n\n return () => (state.value.done ? state.value.value : (pendingFn?.() ?? ''));\n}\n"],"mappings":"mCA6BA,SAAgB,EACd,EACA,EACA,EAC2B,CAC3B,IAAM,GAAA,EAAA,EAAA,QAAsB,CAAE,KAAM,GAAO,CAAC,CAe5C,OAbA,EAAQ,KACL,GAAQ,CACP,EAAM,MAAQ,CAAE,KAAM,GAAM,MAAO,EAAK,EAEzC,GAAQ,CACH,EACF,EAAM,MAAQ,CAAE,KAAM,GAAM,MAAO,EAAQ,EAAI,CAAE,CAEjD,EAAM,MAAQ,CAAE,KAAM,GAAM,MAAO,UAAU,OAAO,EAAI,GAAI,EAGjE,KAEa,EAAM,MAAM,KAAO,EAAM,MAAM,MAAS,KAAa,EAAI"}
@@ -1,26 +0,0 @@
1
- import type { HTMLResult } from '../internal';
2
- /**
3
- * Renders `pendingFn` while a Promise is pending, then switches to the resolved
4
- * result. Lighter-weight alternative to `suspense()` for one-shot data loading
5
- * with no error/retry UI.
6
- *
7
- * Returns a reactive getter the engine tracks automatically — no manual signal
8
- * management needed at the call site.
9
- *
10
- * @param promise The promise to await. Should already resolve to a renderable value.
11
- * @param pendingFn Optional function called while the promise is pending.
12
- * @param onError Optional function called when the promise rejects. Receives the rejection reason.
13
- *
14
- * @example
15
- * import { until } from '@vielzeug/craftit/directives';
16
- *
17
- * const data = fetch('/api/user').then(r => r.json());
18
- *
19
- * html`${until(
20
- * data.then(u => html`<p>Hello, ${u.name}!</p>`),
21
- * () => html`<p>Loading…</p>`,
22
- * (err) => html`<p>Error: ${String(err)}</p>`,
23
- * )}`
24
- */
25
- export declare function until(promise: Promise<string | HTMLResult>, pendingFn?: () => string | HTMLResult, onError?: (err: unknown) => string | HTMLResult): () => string | HTMLResult;
26
- //# sourceMappingURL=until.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"until.d.ts","sourceRoot":"","sources":["../../src/directives/until.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CACnB,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC,EACrC,SAAS,CAAC,EAAE,MAAM,MAAM,GAAG,UAAU,EACrC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,UAAU,GAC9C,MAAM,MAAM,GAAG,UAAU,CAiB3B"}
@@ -1,2 +0,0 @@
1
- import{signal as e}from"@vielzeug/stateit";function t(t,n,r){let i=e({done:!1});return t.then(e=>{i.value={done:!0,value:e}},e=>{r?i.value={done:!0,value:r(e)}:i.value={done:!0,value:`Error: ${String(e)}`}}),()=>i.value.done?i.value.value:n?.()??``}export{t as until};
2
- //# sourceMappingURL=until.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"until.js","names":[],"sources":["../../src/directives/until.ts"],"sourcesContent":["import { signal } from '@vielzeug/stateit';\n\nimport type { HTMLResult } from '../internal';\n\ntype State = { done: false } | { done: true; value: string | HTMLResult };\n\n/**\n * Renders `pendingFn` while a Promise is pending, then switches to the resolved\n * result. Lighter-weight alternative to `suspense()` for one-shot data loading\n * with no error/retry UI.\n *\n * Returns a reactive getter the engine tracks automatically — no manual signal\n * management needed at the call site.\n *\n * @param promise The promise to await. Should already resolve to a renderable value.\n * @param pendingFn Optional function called while the promise is pending.\n * @param onError Optional function called when the promise rejects. Receives the rejection reason.\n *\n * @example\n * import { until } from '@vielzeug/craftit/directives';\n *\n * const data = fetch('/api/user').then(r => r.json());\n *\n * html`${until(\n * data.then(u => html`<p>Hello, ${u.name}!</p>`),\n * () => html`<p>Loading…</p>`,\n * (err) => html`<p>Error: ${String(err)}</p>`,\n * )}`\n */\nexport function until(\n promise: Promise<string | HTMLResult>,\n pendingFn?: () => string | HTMLResult,\n onError?: (err: unknown) => string | HTMLResult,\n): () => string | HTMLResult {\n const state = signal<State>({ done: false });\n\n promise.then(\n (val) => {\n state.value = { done: true, value: val };\n },\n (err) => {\n if (onError) {\n state.value = { done: true, value: onError(err) };\n } else {\n state.value = { done: true, value: `Error: ${String(err)}` };\n }\n },\n );\n\n return () => (state.value.done ? state.value.value : (pendingFn?.() ?? ''));\n}\n"],"mappings":"2CA6BA,SAAgB,EACd,EACA,EACA,EAC2B,CAC3B,IAAM,EAAQ,EAAc,CAAE,KAAM,GAAO,CAAC,CAe5C,OAbA,EAAQ,KACL,GAAQ,CACP,EAAM,MAAQ,CAAE,KAAM,GAAM,MAAO,EAAK,EAEzC,GAAQ,CACH,EACF,EAAM,MAAQ,CAAE,KAAM,GAAM,MAAO,EAAQ,EAAI,CAAE,CAEjD,EAAM,MAAQ,CAAE,KAAM,GAAM,MAAO,UAAU,OAAO,EAAI,GAAI,EAGjE,KAEa,EAAM,MAAM,KAAO,EAAM,MAAM,MAAS,KAAa,EAAI"}
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./directives/spread.cjs`),t=require(`./directives/attr.cjs`),n=require(`./directives/bind.cjs`),r=require(`./directives/choose.cjs`),i=require(`./directives/classes.cjs`),a=require(`./directives/each.cjs`),o=require(`./directives/memo.cjs`),s=require(`./directives/on.cjs`),c=require(`./directives/raw.cjs`),l=require(`./directives/style.cjs`),u=require(`./directives/until.cjs`),d=require(`./directives/when.cjs`);exports.attrs=t.attrs,exports.bind=n.bind,exports.choose=r.choose,exports.classes=i.classes,exports.each=a.each,exports.memo=o.memo,exports.on=s.on,exports.raw=c.raw,exports.spread=e.spread,exports.style=l.style,exports.until=u.until,exports.when=d.when;
@@ -1 +0,0 @@
1
- import{spread as e}from"./directives/spread.js";import{attrs as t}from"./directives/attr.js";import{bind as n}from"./directives/bind.js";import{choose as r}from"./directives/choose.js";import{classes as i}from"./directives/classes.js";import{each as a}from"./directives/each.js";import{memo as o}from"./directives/memo.js";import{on as s}from"./directives/on.js";import{raw as c}from"./directives/raw.js";import{style as l}from"./directives/style.js";import{until as u}from"./directives/until.js";import{when as d}from"./directives/when.js";export{t as attrs,n as bind,r as choose,i as classes,a as each,o as memo,s as on,c as raw,e as spread,l as style,u as until,d as when};
@@ -1,2 +0,0 @@
1
- const e=require(`./internal.cjs`);let t=require(`@vielzeug/stateit`);var n=e=>{if((0,t.isSignal)(e))return e;if(typeof e==`function`)return(0,t.computed)(e)},r=e=>{if(!(0,t.isSignal)(e))return!1;let n=Object.getPrototypeOf(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,`value`);if(e)return typeof e.set==`function`;n=Object.getPrototypeOf(n)}return!1},i=(e,t)=>{if(!Object.is(e.value,t))try{e.value=t}catch{}},a=(t,n,r,a)=>{if(r){if(n===`value`){(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&a(e.listen(t,t instanceof HTMLSelectElement?`change`:`input`,()=>{i(r,t.value)}));return}n===`checked`&&t instanceof HTMLInputElement&&a(e.listen(t,`change`,()=>{i(r,t.checked)}))}};exports.bindPropertyModel=a,exports.hasWritableValueSetter=r,exports.toReactiveBindingSource=n;
2
- //# sourceMappingURL=runtime-bindings.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-bindings.cjs","names":[],"sources":["../src/runtime-bindings.ts"],"sourcesContent":["import { computed, isSignal, type ReadonlySignal, type Signal } from '@vielzeug/stateit';\n\nimport { listen } from './internal';\n\nexport type RegisterPropertyCleanup = (fn: () => void) => void;\n\nexport const toReactiveBindingSource = (value: unknown): ReadonlySignal<unknown> | undefined => {\n if (isSignal(value)) return value as ReadonlySignal<unknown>;\n\n if (typeof value === 'function') return computed(value as () => unknown);\n\n return undefined;\n};\n\nexport const hasWritableValueSetter = (value: unknown): value is Signal<unknown> => {\n if (!isSignal(value)) return false;\n\n let proto: object | null = Object.getPrototypeOf(value);\n\n while (proto) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, 'value');\n\n if (descriptor) return typeof descriptor.set === 'function';\n\n proto = Object.getPrototypeOf(proto);\n }\n\n return false;\n};\n\nconst updateModelValue = (model: Signal<unknown>, next: unknown): void => {\n if (Object.is(model.value, next)) return;\n\n try {\n model.value = next;\n } catch {\n // Readonly signal/computed source: keep one-way behavior.\n }\n};\n\nexport const bindPropertyModel = (\n el: HTMLElement,\n name: string,\n model: Signal<unknown> | undefined,\n registerCleanup: RegisterPropertyCleanup,\n): void => {\n if (!model) return;\n\n if (name === 'value') {\n if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement) {\n const eventName = el instanceof HTMLSelectElement ? 'change' : 'input';\n\n registerCleanup(\n listen(el, eventName, () => {\n updateModelValue(model, el.value);\n }),\n );\n }\n\n return;\n }\n\n if (name === 'checked' && el instanceof HTMLInputElement) {\n registerCleanup(\n listen(el, 'change', () => {\n updateModelValue(model, el.checked);\n }),\n );\n }\n};\n"],"mappings":"qEAMA,IAAa,EAA2B,GAAwD,CAC9F,IAAA,EAAA,EAAA,UAAa,EAAM,CAAE,OAAO,EAE5B,GAAI,OAAO,GAAU,WAAY,OAAA,EAAA,EAAA,UAAgB,EAAuB,EAK7D,EAA0B,GAA6C,CAClF,GAAI,EAAA,EAAA,EAAA,UAAU,EAAM,CAAE,MAAO,GAE7B,IAAI,EAAuB,OAAO,eAAe,EAAM,CAEvD,KAAO,GAAO,CACZ,IAAM,EAAa,OAAO,yBAAyB,EAAO,QAAQ,CAElE,GAAI,EAAY,OAAO,OAAO,EAAW,KAAQ,WAEjD,EAAQ,OAAO,eAAe,EAAM,CAGtC,MAAO,IAGH,GAAoB,EAAwB,IAAwB,CACpE,WAAO,GAAG,EAAM,MAAO,EAAK,CAEhC,GAAI,CACF,EAAM,MAAQ,OACR,IAKG,GACX,EACA,EACA,EACA,IACS,CACJ,KAEL,IAAI,IAAS,QAAS,EAChB,aAAc,kBAAoB,aAAc,qBAAuB,aAAc,oBAGvF,EACE,EAAA,OAAO,EAHS,aAAc,kBAAoB,SAAW,YAGjC,CAC1B,EAAiB,EAAO,EAAG,MAAM,EACjC,CACH,CAGH,OAGE,IAAS,WAAa,aAAc,kBACtC,EACE,EAAA,OAAO,EAAI,aAAgB,CACzB,EAAiB,EAAO,EAAG,QAAQ,EACnC,CACH"}
@@ -1,6 +0,0 @@
1
- import { type ReadonlySignal, type Signal } from '@vielzeug/stateit';
2
- export type RegisterPropertyCleanup = (fn: () => void) => void;
3
- export declare const toReactiveBindingSource: (value: unknown) => ReadonlySignal<unknown> | undefined;
4
- export declare const hasWritableValueSetter: (value: unknown) => value is Signal<unknown>;
5
- export declare const bindPropertyModel: (el: HTMLElement, name: string, model: Signal<unknown> | undefined, registerCleanup: RegisterPropertyCleanup) => void;
6
- //# sourceMappingURL=runtime-bindings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-bindings.d.ts","sourceRoot":"","sources":["../src/runtime-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIzF,MAAM,MAAM,uBAAuB,GAAG,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;AAE/D,eAAO,MAAM,uBAAuB,GAAI,OAAO,OAAO,KAAG,cAAc,CAAC,OAAO,CAAC,GAAG,SAMlF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,OAAO,CAc9E,CAAC;AAYF,eAAO,MAAM,iBAAiB,GAC5B,IAAI,WAAW,EACf,MAAM,MAAM,EACZ,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,SAAS,EAClC,iBAAiB,uBAAuB,KACvC,IAwBF,CAAC"}
@@ -1,2 +0,0 @@
1
- import{listen as e}from"./internal.js";import{computed as t,isSignal as n}from"@vielzeug/stateit";var r=e=>{if(n(e))return e;if(typeof e==`function`)return t(e)},i=e=>{if(!n(e))return!1;let t=Object.getPrototypeOf(e);for(;t;){let e=Object.getOwnPropertyDescriptor(t,`value`);if(e)return typeof e.set==`function`;t=Object.getPrototypeOf(t)}return!1},a=(e,t)=>{if(!Object.is(e.value,t))try{e.value=t}catch{}},o=(t,n,r,i)=>{if(r){if(n===`value`){(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&i(e(t,t instanceof HTMLSelectElement?`change`:`input`,()=>{a(r,t.value)}));return}n===`checked`&&t instanceof HTMLInputElement&&i(e(t,`change`,()=>{a(r,t.checked)}))}};export{o as bindPropertyModel,i as hasWritableValueSetter,r as toReactiveBindingSource};
2
- //# sourceMappingURL=runtime-bindings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-bindings.js","names":[],"sources":["../src/runtime-bindings.ts"],"sourcesContent":["import { computed, isSignal, type ReadonlySignal, type Signal } from '@vielzeug/stateit';\n\nimport { listen } from './internal';\n\nexport type RegisterPropertyCleanup = (fn: () => void) => void;\n\nexport const toReactiveBindingSource = (value: unknown): ReadonlySignal<unknown> | undefined => {\n if (isSignal(value)) return value as ReadonlySignal<unknown>;\n\n if (typeof value === 'function') return computed(value as () => unknown);\n\n return undefined;\n};\n\nexport const hasWritableValueSetter = (value: unknown): value is Signal<unknown> => {\n if (!isSignal(value)) return false;\n\n let proto: object | null = Object.getPrototypeOf(value);\n\n while (proto) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, 'value');\n\n if (descriptor) return typeof descriptor.set === 'function';\n\n proto = Object.getPrototypeOf(proto);\n }\n\n return false;\n};\n\nconst updateModelValue = (model: Signal<unknown>, next: unknown): void => {\n if (Object.is(model.value, next)) return;\n\n try {\n model.value = next;\n } catch {\n // Readonly signal/computed source: keep one-way behavior.\n }\n};\n\nexport const bindPropertyModel = (\n el: HTMLElement,\n name: string,\n model: Signal<unknown> | undefined,\n registerCleanup: RegisterPropertyCleanup,\n): void => {\n if (!model) return;\n\n if (name === 'value') {\n if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement) {\n const eventName = el instanceof HTMLSelectElement ? 'change' : 'input';\n\n registerCleanup(\n listen(el, eventName, () => {\n updateModelValue(model, el.value);\n }),\n );\n }\n\n return;\n }\n\n if (name === 'checked' && el instanceof HTMLInputElement) {\n registerCleanup(\n listen(el, 'change', () => {\n updateModelValue(model, el.checked);\n }),\n );\n }\n};\n"],"mappings":"kGAMA,IAAa,EAA2B,GAAwD,CAC9F,GAAI,EAAS,EAAM,CAAE,OAAO,EAE5B,GAAI,OAAO,GAAU,WAAY,OAAO,EAAS,EAAuB,EAK7D,EAA0B,GAA6C,CAClF,GAAI,CAAC,EAAS,EAAM,CAAE,MAAO,GAE7B,IAAI,EAAuB,OAAO,eAAe,EAAM,CAEvD,KAAO,GAAO,CACZ,IAAM,EAAa,OAAO,yBAAyB,EAAO,QAAQ,CAElE,GAAI,EAAY,OAAO,OAAO,EAAW,KAAQ,WAEjD,EAAQ,OAAO,eAAe,EAAM,CAGtC,MAAO,IAGH,GAAoB,EAAwB,IAAwB,CACpE,WAAO,GAAG,EAAM,MAAO,EAAK,CAEhC,GAAI,CACF,EAAM,MAAQ,OACR,IAKG,GACX,EACA,EACA,EACA,IACS,CACJ,KAEL,IAAI,IAAS,QAAS,EAChB,aAAc,kBAAoB,aAAc,qBAAuB,aAAc,oBAGvF,EACE,EAAO,EAHS,aAAc,kBAAoB,SAAW,YAGjC,CAC1B,EAAiB,EAAO,EAAG,MAAM,EACjC,CACH,CAGH,OAGE,IAAS,WAAa,aAAc,kBACtC,EACE,EAAO,EAAI,aAAgB,CACzB,EAAiB,EAAO,EAAG,QAAQ,EACnC,CACH"}
@@ -1,2 +0,0 @@
1
- require(`./internal.cjs`),require(`@vielzeug/stateit`);var e=[],t=()=>{let t=e[e.length-1];if(!t)throw Error(`[craftit:E1] lifecycle outside setup`);return t};exports.currentRuntime=t,exports.runtimeStack=e;
2
- //# sourceMappingURL=runtime-core.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-core.cjs","names":[],"sources":["../src/runtime-core.ts"],"sourcesContent":["import { type CleanupFn } from '@vielzeug/stateit';\n\nimport { type CSSResult } from './internal';\n\nexport type ComponentRuntime = {\n /** Cleanup functions to run when the component is disconnected. */\n cleanups: CleanupFn[];\n /** The host element instance. */\n el: HTMLElement;\n /** Custom error handlers registered via `onError`. */\n errorHandlers: ((err: unknown) => void)[];\n /** Callbacks to run when the component is connected for the first time or re-connected. */\n onMount: (() => CleanupFn | undefined | void)[];\n /** Stylesheets to apply to the shadow root. */\n styles?: (string | CSSStyleSheet | CSSResult)[];\n};\n\nexport const runtimeStack: ComponentRuntime[] = [];\n\n/**\n * Returns the current component runtime.\n * Throws if called outside of a component's setup or lifecycle.\n */\nexport const currentRuntime = (): ComponentRuntime => {\n const rt = runtimeStack[runtimeStack.length - 1];\n\n if (!rt) throw new Error('[craftit:E1] lifecycle outside setup');\n\n return rt;\n};\n"],"mappings":"uDAiBA,IAAa,EAAmC,EAAE,CAMrC,MAAyC,CACpD,IAAM,EAAK,EAAa,EAAa,OAAS,GAE9C,GAAI,CAAC,EAAI,MAAU,MAAM,uCAAuC,CAEhE,OAAO"}
@@ -1,21 +0,0 @@
1
- import { type CleanupFn } from '@vielzeug/stateit';
2
- import { type CSSResult } from './internal';
3
- export type ComponentRuntime = {
4
- /** Cleanup functions to run when the component is disconnected. */
5
- cleanups: CleanupFn[];
6
- /** The host element instance. */
7
- el: HTMLElement;
8
- /** Custom error handlers registered via `onError`. */
9
- errorHandlers: ((err: unknown) => void)[];
10
- /** Callbacks to run when the component is connected for the first time or re-connected. */
11
- onMount: (() => CleanupFn | undefined | void)[];
12
- /** Stylesheets to apply to the shadow root. */
13
- styles?: (string | CSSStyleSheet | CSSResult)[];
14
- };
15
- export declare const runtimeStack: ComponentRuntime[];
16
- /**
17
- * Returns the current component runtime.
18
- * Throws if called outside of a component's setup or lifecycle.
19
- */
20
- export declare const currentRuntime: () => ComponentRuntime;
21
- //# sourceMappingURL=runtime-core.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-core.d.ts","sourceRoot":"","sources":["../src/runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mEAAmE;IACnE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,iCAAiC;IACjC,EAAE,EAAE,WAAW,CAAC;IAChB,sDAAsD;IACtD,aAAa,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC,EAAE,CAAC;IAC1C,2FAA2F;IAC3F,OAAO,EAAE,CAAC,MAAM,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC;IAChD,+CAA+C;IAC/C,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,gBAAgB,EAAO,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,gBAMjC,CAAC"}
@@ -1,2 +0,0 @@
1
- import"./internal.js";import"@vielzeug/stateit";var e=[],t=()=>{let t=e[e.length-1];if(!t)throw Error(`[craftit:E1] lifecycle outside setup`);return t};export{t as currentRuntime,e as runtimeStack};
2
- //# sourceMappingURL=runtime-core.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-core.js","names":[],"sources":["../src/runtime-core.ts"],"sourcesContent":["import { type CleanupFn } from '@vielzeug/stateit';\n\nimport { type CSSResult } from './internal';\n\nexport type ComponentRuntime = {\n /** Cleanup functions to run when the component is disconnected. */\n cleanups: CleanupFn[];\n /** The host element instance. */\n el: HTMLElement;\n /** Custom error handlers registered via `onError`. */\n errorHandlers: ((err: unknown) => void)[];\n /** Callbacks to run when the component is connected for the first time or re-connected. */\n onMount: (() => CleanupFn | undefined | void)[];\n /** Stylesheets to apply to the shadow root. */\n styles?: (string | CSSStyleSheet | CSSResult)[];\n};\n\nexport const runtimeStack: ComponentRuntime[] = [];\n\n/**\n * Returns the current component runtime.\n * Throws if called outside of a component's setup or lifecycle.\n */\nexport const currentRuntime = (): ComponentRuntime => {\n const rt = runtimeStack[runtimeStack.length - 1];\n\n if (!rt) throw new Error('[craftit:E1] lifecycle outside setup');\n\n return rt;\n};\n"],"mappings":"gDAiBA,IAAa,EAAmC,EAAE,CAMrC,MAAyC,CACpD,IAAM,EAAK,EAAa,EAAa,OAAS,GAE9C,GAAI,CAAC,EAAI,MAAU,MAAM,uCAAuC,CAEhE,OAAO"}
@@ -1,2 +0,0 @@
1
- const e=require(`./runtime-core.cjs`);let t=require(`@vielzeug/stateit`);var n=t=>{e.currentRuntime().onMount.push(t)},r=n=>{e.runtimeStack.length>0?e.currentRuntime().cleanups.push(n):(0,t.onCleanup)(n)},i=t=>{e.runtimeStack.length>0&&r(t)},a=t=>{e.currentRuntime().errorHandlers.push(t)},o=(e,n)=>{let r=(0,t.effect)(e,n);return i(r),r};function s(e,n,r){let a=(0,t.watch)(e,n,r);return i(a),a}function c(e,t,n,i){e&&(e.addEventListener(t,n,i),r(()=>e.removeEventListener(t,n,i)))}var l=()=>{let e=(0,t.signal)(null),n=()=>{e.value?.(),e.value=null};return r(n),{clear:n,set:t=>{e.value!==t&&(n(),e.value=t??null)},value:e}},u=(e,t,n)=>o(()=>{let n=e.value;if(n)return t(n)},n);exports.createCleanupSignal=l,exports.effect=o,exports.handle=c,exports.onCleanup=r,exports.onElement=u,exports.onError=a,exports.onMount=n,exports.watch=s;
2
- //# sourceMappingURL=runtime-lifecycle.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-lifecycle.cjs","names":[],"sources":["../src/runtime-lifecycle.ts"],"sourcesContent":["import {\n effect as _effect,\n onCleanup as _onCleanup,\n signal,\n watch as _watch,\n type CleanupFn,\n type EffectCallback,\n type EffectOptions,\n type ReadonlySignal,\n type Subscription,\n type WatchOptions,\n} from '@vielzeug/stateit';\n\nimport { currentRuntime, runtimeStack } from './runtime-core';\n\ntype NoDetail = void | undefined | never;\ntype HostCustomEventMap<CustomEvents extends Record<string, unknown>> = {\n [K in keyof CustomEvents & string]: [CustomEvents[K]] extends [Event]\n ? CustomEvents[K]\n : [CustomEvents[K]] extends [NoDetail]\n ? CustomEvent<undefined>\n : CustomEvent<CustomEvents[K]>;\n};\n\nexport type HostEventMap<CustomEvents extends Record<string, unknown> = Record<string, never>> = HTMLElementEventMap &\n HostCustomEventMap<CustomEvents>;\n\nexport type HostEventListeners<CustomEvents extends Record<string, unknown> = Record<string, never>> = {\n [K in keyof HostEventMap<CustomEvents>]?: (e: HostEventMap<CustomEvents>[K]) => void;\n};\n\nexport const onMount = (fn: () => CleanupFn | undefined | void): void => {\n currentRuntime().onMount.push(fn);\n};\n\nexport const onCleanup = (fn: CleanupFn): void => {\n if (runtimeStack.length > 0) {\n currentRuntime().cleanups.push(fn);\n } else {\n _onCleanup(fn);\n }\n};\n\nconst autoCleanup = (dispose: Subscription | CleanupFn): void => {\n if (runtimeStack.length > 0) onCleanup(dispose);\n};\n\nexport const onError = (fn: (err: unknown) => void): void => {\n currentRuntime().errorHandlers.push(fn);\n};\n\nexport const effect = (fn: EffectCallback, options?: EffectOptions): Subscription => {\n const dispose = _effect(fn, options);\n\n autoCleanup(dispose);\n\n return dispose;\n};\n\nexport function watch<T>(\n source: ReadonlySignal<T>,\n cb: (value: T, prev: T) => void,\n options?: WatchOptions<T>,\n): Subscription;\nexport function watch(\n source: ReadonlySignal<unknown>,\n cb: (value: unknown, prev: unknown) => void,\n options?: WatchOptions<unknown>,\n): Subscription {\n const stop = _watch(source, cb, options);\n\n autoCleanup(stop);\n\n return stop;\n}\n\nexport function handle<K extends keyof HTMLElementEventMap>(\n target: EventTarget | null | undefined,\n event: K,\n listener: (e: HTMLElementEventMap[K]) => void,\n options?: AddEventListenerOptions,\n): void;\nexport function handle(\n target: EventTarget | null | undefined,\n event: string,\n listener: EventListener,\n options?: AddEventListenerOptions,\n): void;\nexport function handle(\n target: EventTarget | null | undefined,\n event: string,\n listener: EventListener,\n options?: AddEventListenerOptions,\n): void {\n if (!target) return;\n\n target.addEventListener(event, listener, options);\n onCleanup(() => target.removeEventListener(event, listener, options));\n}\n\nexport const createCleanupSignal = () => {\n const cleanup = signal<CleanupFn | null>(null);\n\n const clear = () => {\n cleanup.value?.();\n cleanup.value = null;\n };\n\n const set = (next: CleanupFn | null | undefined) => {\n if (cleanup.value === next) return;\n\n clear();\n cleanup.value = next ?? null;\n };\n\n onCleanup(clear);\n\n return { clear, set, value: cleanup as ReadonlySignal<CleanupFn | null> };\n};\n\nexport const onElement = <T extends HTMLElement>(\n ref: ReadonlySignal<T | null>,\n callback: (el: T) => CleanupFn | undefined | void,\n options?: EffectOptions,\n): Subscription => {\n return effect(() => {\n const el = ref.value;\n\n if (el) return callback(el);\n }, options);\n};\n"],"mappings":"yEA+BA,IAAa,EAAW,GAAiD,CACvE,EAAA,gBAAgB,CAAC,QAAQ,KAAK,EAAG,EAGtB,EAAa,GAAwB,CAC5C,EAAA,aAAa,OAAS,EACxB,EAAA,gBAAgB,CAAC,SAAS,KAAK,EAAG,EAElC,EAAA,EAAA,WAAW,EAAG,EAIZ,EAAe,GAA4C,CAC3D,EAAA,aAAa,OAAS,GAAG,EAAU,EAAQ,EAGpC,EAAW,GAAqC,CAC3D,EAAA,gBAAgB,CAAC,cAAc,KAAK,EAAG,EAG5B,GAAU,EAAoB,IAA0C,CACnF,IAAM,GAAA,EAAA,EAAA,QAAkB,EAAI,EAAQ,CAIpC,OAFA,EAAY,EAAQ,CAEb,GAQT,SAAgB,EACd,EACA,EACA,EACc,CACd,IAAM,GAAA,EAAA,EAAA,OAAc,EAAQ,EAAI,EAAQ,CAIxC,OAFA,EAAY,EAAK,CAEV,EAeT,SAAgB,EACd,EACA,EACA,EACA,EACM,CACD,IAEL,EAAO,iBAAiB,EAAO,EAAU,EAAQ,CACjD,MAAgB,EAAO,oBAAoB,EAAO,EAAU,EAAQ,CAAC,EAGvE,IAAa,MAA4B,CACvC,IAAM,GAAA,EAAA,EAAA,QAAmC,KAAK,CAExC,MAAc,CAClB,EAAQ,SAAS,CACjB,EAAQ,MAAQ,MAYlB,OAFA,EAAU,EAAM,CAET,CAAE,QAAO,IATH,GAAuC,CAC9C,EAAQ,QAAU,IAEtB,GAAO,CACP,EAAQ,MAAQ,GAAQ,OAKL,MAAO,EAA6C,EAG9D,GACX,EACA,EACA,IAEO,MAAa,CAClB,IAAM,EAAK,EAAI,MAEf,GAAI,EAAI,OAAO,EAAS,EAAG,EAC1B,EAAQ"}
@@ -1,24 +0,0 @@
1
- import { type CleanupFn, type EffectCallback, type EffectOptions, type ReadonlySignal, type Subscription, type WatchOptions } from '@vielzeug/stateit';
2
- type NoDetail = void | undefined | never;
3
- type HostCustomEventMap<CustomEvents extends Record<string, unknown>> = {
4
- [K in keyof CustomEvents & string]: [CustomEvents[K]] extends [Event] ? CustomEvents[K] : [CustomEvents[K]] extends [NoDetail] ? CustomEvent<undefined> : CustomEvent<CustomEvents[K]>;
5
- };
6
- export type HostEventMap<CustomEvents extends Record<string, unknown> = Record<string, never>> = HTMLElementEventMap & HostCustomEventMap<CustomEvents>;
7
- export type HostEventListeners<CustomEvents extends Record<string, unknown> = Record<string, never>> = {
8
- [K in keyof HostEventMap<CustomEvents>]?: (e: HostEventMap<CustomEvents>[K]) => void;
9
- };
10
- export declare const onMount: (fn: () => CleanupFn | undefined | void) => void;
11
- export declare const onCleanup: (fn: CleanupFn) => void;
12
- export declare const onError: (fn: (err: unknown) => void) => void;
13
- export declare const effect: (fn: EffectCallback, options?: EffectOptions) => Subscription;
14
- export declare function watch<T>(source: ReadonlySignal<T>, cb: (value: T, prev: T) => void, options?: WatchOptions<T>): Subscription;
15
- export declare function handle<K extends keyof HTMLElementEventMap>(target: EventTarget | null | undefined, event: K, listener: (e: HTMLElementEventMap[K]) => void, options?: AddEventListenerOptions): void;
16
- export declare function handle(target: EventTarget | null | undefined, event: string, listener: EventListener, options?: AddEventListenerOptions): void;
17
- export declare const createCleanupSignal: () => {
18
- clear: () => void;
19
- set: (next: CleanupFn | null | undefined) => void;
20
- value: ReadonlySignal<CleanupFn | null>;
21
- };
22
- export declare const onElement: <T extends HTMLElement>(ref: ReadonlySignal<T | null>, callback: (el: T) => CleanupFn | undefined | void, options?: EffectOptions) => Subscription;
23
- export {};
24
- //# sourceMappingURL=runtime-lifecycle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-lifecycle.d.ts","sourceRoot":"","sources":["../src/runtime-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAI3B,KAAK,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;AACzC,KAAK,kBAAkB,CAAC,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;KACrE,CAAC,IAAI,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACjE,YAAY,CAAC,CAAC,CAAC,GACf,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,GAClC,WAAW,CAAC,SAAS,CAAC,GACtB,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,mBAAmB,GAClH,kBAAkB,CAAC,YAAY,CAAC,CAAC;AAEnC,MAAM,MAAM,kBAAkB,CAAC,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI;KACpG,CAAC,IAAI,MAAM,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;CACrF,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,IAAI,MAAM,SAAS,GAAG,SAAS,GAAG,IAAI,KAAG,IAEhE,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,IAAI,SAAS,KAAG,IAMzC,CAAC;AAMF,eAAO,MAAM,OAAO,GAAI,IAAI,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,KAAG,IAEpD,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,IAAI,cAAc,EAAE,UAAU,aAAa,KAAG,YAMpE,CAAC;AAEF,wBAAgB,KAAK,CAAC,CAAC,EACrB,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EACzB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,EAC/B,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GACxB,YAAY,CAAC;AAahB,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,mBAAmB,EACxD,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACtC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,IAAI,EAC7C,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAAC;AACR,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACtC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAAC;AAaR,eAAO,MAAM,mBAAmB;;gBAQX,SAAS,GAAG,IAAI,GAAG,SAAS;WASR,cAAc,CAAC,SAAS,GAAG,IAAI,CAAC;CACxE,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,WAAW,EAC7C,KAAK,cAAc,CAAC,CAAC,GAAG,IAAI,CAAC,EAC7B,UAAU,CAAC,EAAE,EAAE,CAAC,KAAK,SAAS,GAAG,SAAS,GAAG,IAAI,EACjD,UAAU,aAAa,KACtB,YAMF,CAAC"}
@@ -1,2 +0,0 @@
1
- import{currentRuntime as e,runtimeStack as t}from"./runtime-core.js";import{effect as n,onCleanup as r,signal as i,watch as a}from"@vielzeug/stateit";var o=t=>{e().onMount.push(t)},s=n=>{t.length>0?e().cleanups.push(n):r(n)},c=e=>{t.length>0&&s(e)},l=t=>{e().errorHandlers.push(t)},u=(e,t)=>{let r=n(e,t);return c(r),r};function d(e,t,n){let r=a(e,t,n);return c(r),r}function f(e,t,n,r){e&&(e.addEventListener(t,n,r),s(()=>e.removeEventListener(t,n,r)))}var p=()=>{let e=i(null),t=()=>{e.value?.(),e.value=null};return s(t),{clear:t,set:n=>{e.value!==n&&(t(),e.value=n??null)},value:e}},m=(e,t,n)=>u(()=>{let n=e.value;if(n)return t(n)},n);export{p as createCleanupSignal,u as effect,f as handle,s as onCleanup,m as onElement,l as onError,o as onMount,d as watch};
2
- //# sourceMappingURL=runtime-lifecycle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-lifecycle.js","names":[],"sources":["../src/runtime-lifecycle.ts"],"sourcesContent":["import {\n effect as _effect,\n onCleanup as _onCleanup,\n signal,\n watch as _watch,\n type CleanupFn,\n type EffectCallback,\n type EffectOptions,\n type ReadonlySignal,\n type Subscription,\n type WatchOptions,\n} from '@vielzeug/stateit';\n\nimport { currentRuntime, runtimeStack } from './runtime-core';\n\ntype NoDetail = void | undefined | never;\ntype HostCustomEventMap<CustomEvents extends Record<string, unknown>> = {\n [K in keyof CustomEvents & string]: [CustomEvents[K]] extends [Event]\n ? CustomEvents[K]\n : [CustomEvents[K]] extends [NoDetail]\n ? CustomEvent<undefined>\n : CustomEvent<CustomEvents[K]>;\n};\n\nexport type HostEventMap<CustomEvents extends Record<string, unknown> = Record<string, never>> = HTMLElementEventMap &\n HostCustomEventMap<CustomEvents>;\n\nexport type HostEventListeners<CustomEvents extends Record<string, unknown> = Record<string, never>> = {\n [K in keyof HostEventMap<CustomEvents>]?: (e: HostEventMap<CustomEvents>[K]) => void;\n};\n\nexport const onMount = (fn: () => CleanupFn | undefined | void): void => {\n currentRuntime().onMount.push(fn);\n};\n\nexport const onCleanup = (fn: CleanupFn): void => {\n if (runtimeStack.length > 0) {\n currentRuntime().cleanups.push(fn);\n } else {\n _onCleanup(fn);\n }\n};\n\nconst autoCleanup = (dispose: Subscription | CleanupFn): void => {\n if (runtimeStack.length > 0) onCleanup(dispose);\n};\n\nexport const onError = (fn: (err: unknown) => void): void => {\n currentRuntime().errorHandlers.push(fn);\n};\n\nexport const effect = (fn: EffectCallback, options?: EffectOptions): Subscription => {\n const dispose = _effect(fn, options);\n\n autoCleanup(dispose);\n\n return dispose;\n};\n\nexport function watch<T>(\n source: ReadonlySignal<T>,\n cb: (value: T, prev: T) => void,\n options?: WatchOptions<T>,\n): Subscription;\nexport function watch(\n source: ReadonlySignal<unknown>,\n cb: (value: unknown, prev: unknown) => void,\n options?: WatchOptions<unknown>,\n): Subscription {\n const stop = _watch(source, cb, options);\n\n autoCleanup(stop);\n\n return stop;\n}\n\nexport function handle<K extends keyof HTMLElementEventMap>(\n target: EventTarget | null | undefined,\n event: K,\n listener: (e: HTMLElementEventMap[K]) => void,\n options?: AddEventListenerOptions,\n): void;\nexport function handle(\n target: EventTarget | null | undefined,\n event: string,\n listener: EventListener,\n options?: AddEventListenerOptions,\n): void;\nexport function handle(\n target: EventTarget | null | undefined,\n event: string,\n listener: EventListener,\n options?: AddEventListenerOptions,\n): void {\n if (!target) return;\n\n target.addEventListener(event, listener, options);\n onCleanup(() => target.removeEventListener(event, listener, options));\n}\n\nexport const createCleanupSignal = () => {\n const cleanup = signal<CleanupFn | null>(null);\n\n const clear = () => {\n cleanup.value?.();\n cleanup.value = null;\n };\n\n const set = (next: CleanupFn | null | undefined) => {\n if (cleanup.value === next) return;\n\n clear();\n cleanup.value = next ?? null;\n };\n\n onCleanup(clear);\n\n return { clear, set, value: cleanup as ReadonlySignal<CleanupFn | null> };\n};\n\nexport const onElement = <T extends HTMLElement>(\n ref: ReadonlySignal<T | null>,\n callback: (el: T) => CleanupFn | undefined | void,\n options?: EffectOptions,\n): Subscription => {\n return effect(() => {\n const el = ref.value;\n\n if (el) return callback(el);\n }, options);\n};\n"],"mappings":"sJA+BA,IAAa,EAAW,GAAiD,CACvE,GAAgB,CAAC,QAAQ,KAAK,EAAG,EAGtB,EAAa,GAAwB,CAC5C,EAAa,OAAS,EACxB,GAAgB,CAAC,SAAS,KAAK,EAAG,CAElC,EAAW,EAAG,EAIZ,EAAe,GAA4C,CAC3D,EAAa,OAAS,GAAG,EAAU,EAAQ,EAGpC,EAAW,GAAqC,CAC3D,GAAgB,CAAC,cAAc,KAAK,EAAG,EAG5B,GAAU,EAAoB,IAA0C,CACnF,IAAM,EAAU,EAAQ,EAAI,EAAQ,CAIpC,OAFA,EAAY,EAAQ,CAEb,GAQT,SAAgB,EACd,EACA,EACA,EACc,CACd,IAAM,EAAO,EAAO,EAAQ,EAAI,EAAQ,CAIxC,OAFA,EAAY,EAAK,CAEV,EAeT,SAAgB,EACd,EACA,EACA,EACA,EACM,CACD,IAEL,EAAO,iBAAiB,EAAO,EAAU,EAAQ,CACjD,MAAgB,EAAO,oBAAoB,EAAO,EAAU,EAAQ,CAAC,EAGvE,IAAa,MAA4B,CACvC,IAAM,EAAU,EAAyB,KAAK,CAExC,MAAc,CAClB,EAAQ,SAAS,CACjB,EAAQ,MAAQ,MAYlB,OAFA,EAAU,EAAM,CAET,CAAE,QAAO,IATH,GAAuC,CAC9C,EAAQ,QAAU,IAEtB,GAAO,CACP,EAAQ,MAAQ,GAAQ,OAKL,MAAO,EAA6C,EAG9D,GACX,EACA,EACA,IAEO,MAAa,CAClB,IAAM,EAAK,EAAI,MAEf,GAAI,EAAI,OAAO,EAAS,EAAG,EAC1B,EAAQ"}
@@ -1,2 +0,0 @@
1
- require(`./internal.cjs`);var e=new Map,t=t=>{let n=e.get(t);return n||(n=document.createElement(`template`),n.innerHTML=t,e.set(t,n)),n},n=e=>t(e).content.cloneNode(!0),r=(e,t)=>{if(e.nodeType===Node.COMMENT_NODE){let n=e.nodeValue;n&&t.comments.set(n,e);return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e.getAttribute(`u`);n&&t.elements.set(n,e)},i=e=>{let t={comments:new Map,elements:new Map},n=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);for(r(e,t);n.nextNode();)r(n.currentNode,t);return t},a=e=>{let t={comments:new Map,elements:new Map};for(let n of e){let e=document.createTreeWalker(n,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);for(r(n,t);e.nextNode();)r(e.currentNode,t)}return t},o=(e,t)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(;n.nextNode();){let e=n.currentNode;if(e.nodeValue===t)return e}return null},s=e=>Array.from(n(e).childNodes),c=(e,t,n)=>{if(e.parentNode)for(let r of t)e.parentNode.insertBefore(r,n)};exports.createNodes=s,exports.findCommentMarker=o,exports.indexBindings=i,exports.indexBindingsInNodes=a,exports.insertNodes=c,exports.parseHTML=n;
2
- //# sourceMappingURL=template-dom.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-dom.cjs","names":[],"sources":["../src/template-dom.ts"],"sourcesContent":["import { CF_ID_ATTR } from './internal';\n\nexport type BindingTargets = {\n comments: Map<string, Comment>;\n elements: Map<string, HTMLElement>;\n};\n\nconst templateCache = new Map<string, HTMLTemplateElement>();\n\nconst getCachedTemplate = (html: string): HTMLTemplateElement => {\n let tpl = templateCache.get(html);\n\n if (!tpl) {\n tpl = document.createElement('template');\n tpl.innerHTML = html;\n\n templateCache.set(html, tpl);\n }\n\n return tpl;\n};\n\nexport const parseHTML = (html: string): DocumentFragment =>\n getCachedTemplate(html).content.cloneNode(true) as DocumentFragment;\n\nconst collectBindingTarget = (node: Node, targets: BindingTargets): void => {\n if (node.nodeType === Node.COMMENT_NODE) {\n const marker = (node as Comment).nodeValue;\n\n if (marker) targets.comments.set(marker, node as Comment);\n\n return;\n }\n\n if (node.nodeType !== Node.ELEMENT_NODE) return;\n\n const id = (node as Element).getAttribute(CF_ID_ATTR);\n\n if (id) targets.elements.set(id, node as HTMLElement);\n};\n\nexport const indexBindings = (root: Node): BindingTargets => {\n const targets: BindingTargets = { comments: new Map(), elements: new Map() };\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT);\n\n collectBindingTarget(root, targets);\n\n while (walker.nextNode()) collectBindingTarget(walker.currentNode, targets);\n\n return targets;\n};\n\nexport const indexBindingsInNodes = (nodes: Iterable<Node>): BindingTargets => {\n const targets: BindingTargets = { comments: new Map(), elements: new Map() };\n\n for (const node of nodes) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT);\n\n collectBindingTarget(node, targets);\n\n while (walker.nextNode()) collectBindingTarget(walker.currentNode, targets);\n }\n\n return targets;\n};\nexport const findCommentMarker = (root: Node, marker: string): Comment | null => {\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_COMMENT);\n\n while (walker.nextNode()) {\n const comment = walker.currentNode as Comment;\n\n if (comment.nodeValue === marker) return comment;\n }\n\n return null;\n};\n\nexport const isHtmlBindingMarker = (node: Node): boolean =>\n node.nodeType === Node.COMMENT_NODE &&\n ((node as Comment).data === 'html-binding' || (node as Comment).data.startsWith('__h_'));\n\nexport const clearAfterMarker = (marker: Comment): void => {\n let next = marker.nextSibling;\n\n while (next) {\n if (isHtmlBindingMarker(next)) break;\n\n const toRemove = next;\n\n next = next.nextSibling;\n toRemove.remove();\n }\n};\n\nexport const createNodes = (htmlString: string): Node[] => Array.from(parseHTML(htmlString).childNodes);\n\nexport const insertNodes = (marker: Comment, nodes: Node[], before: Node | null): void => {\n if (marker.parentNode) {\n for (const node of nodes) marker.parentNode.insertBefore(node, before);\n }\n};\n"],"mappings":"0BAOA,IAAM,EAAgB,IAAI,IAEpB,EAAqB,GAAsC,CAC/D,IAAI,EAAM,EAAc,IAAI,EAAK,CASjC,OAPK,IACH,EAAM,SAAS,cAAc,WAAW,CACxC,EAAI,UAAY,EAEhB,EAAc,IAAI,EAAM,EAAI,EAGvB,GAGI,EAAa,GACxB,EAAkB,EAAK,CAAC,QAAQ,UAAU,GAAK,CAE3C,GAAwB,EAAY,IAAkC,CAC1E,GAAI,EAAK,WAAa,KAAK,aAAc,CACvC,IAAM,EAAU,EAAiB,UAE7B,GAAQ,EAAQ,SAAS,IAAI,EAAQ,EAAgB,CAEzD,OAGF,GAAI,EAAK,WAAa,KAAK,aAAc,OAEzC,IAAM,EAAM,EAAiB,aAAA,IAAwB,CAEjD,GAAI,EAAQ,SAAS,IAAI,EAAI,EAAoB,EAG1C,EAAiB,GAA+B,CAC3D,IAAM,EAA0B,CAAE,SAAU,IAAI,IAAO,SAAU,IAAI,IAAO,CACtE,EAAS,SAAS,iBAAiB,EAAM,WAAW,aAAe,WAAW,aAAa,CAIjG,IAFA,EAAqB,EAAM,EAAQ,CAE5B,EAAO,UAAU,EAAE,EAAqB,EAAO,YAAa,EAAQ,CAE3E,OAAO,GAGI,EAAwB,GAA0C,CAC7E,IAAM,EAA0B,CAAE,SAAU,IAAI,IAAO,SAAU,IAAI,IAAO,CAE5E,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAS,SAAS,iBAAiB,EAAM,WAAW,aAAe,WAAW,aAAa,CAIjG,IAFA,EAAqB,EAAM,EAAQ,CAE5B,EAAO,UAAU,EAAE,EAAqB,EAAO,YAAa,EAAQ,CAG7E,OAAO,GAEI,GAAqB,EAAY,IAAmC,CAC/E,IAAM,EAAS,SAAS,iBAAiB,EAAM,WAAW,aAAa,CAEvE,KAAO,EAAO,UAAU,EAAE,CACxB,IAAM,EAAU,EAAO,YAEvB,GAAI,EAAQ,YAAc,EAAQ,OAAO,EAG3C,OAAO,MAoBI,EAAe,GAA+B,MAAM,KAAK,EAAU,EAAW,CAAC,WAAW,CAE1F,GAAe,EAAiB,EAAe,IAA8B,CACxF,GAAI,EAAO,WACT,IAAK,IAAM,KAAQ,EAAO,EAAO,WAAW,aAAa,EAAM,EAAO"}
@@ -1,13 +0,0 @@
1
- export type BindingTargets = {
2
- comments: Map<string, Comment>;
3
- elements: Map<string, HTMLElement>;
4
- };
5
- export declare const parseHTML: (html: string) => DocumentFragment;
6
- export declare const indexBindings: (root: Node) => BindingTargets;
7
- export declare const indexBindingsInNodes: (nodes: Iterable<Node>) => BindingTargets;
8
- export declare const findCommentMarker: (root: Node, marker: string) => Comment | null;
9
- export declare const isHtmlBindingMarker: (node: Node) => boolean;
10
- export declare const clearAfterMarker: (marker: Comment) => void;
11
- export declare const createNodes: (htmlString: string) => Node[];
12
- export declare const insertNodes: (marker: Comment, nodes: Node[], before: Node | null) => void;
13
- //# sourceMappingURL=template-dom.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-dom.d.ts","sourceRoot":"","sources":["../src/template-dom.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACpC,CAAC;AAiBF,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,gBAC4B,CAAC;AAkBtE,eAAO,MAAM,aAAa,GAAI,MAAM,IAAI,KAAG,cAS1C,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAG,cAY5D,CAAC;AACF,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,EAAE,QAAQ,MAAM,KAAG,OAAO,GAAG,IAUxE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,IAAI,KAAG,OAEyC,CAAC;AAE3F,eAAO,MAAM,gBAAgB,GAAI,QAAQ,OAAO,KAAG,IAWlD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,KAAG,IAAI,EAAkD,CAAC;AAExG,eAAO,MAAM,WAAW,GAAI,QAAQ,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,QAAQ,IAAI,GAAG,IAAI,KAAG,IAIjF,CAAC"}
@@ -1,2 +0,0 @@
1
- import"./internal.js";var e=new Map,t=t=>{let n=e.get(t);return n||(n=document.createElement(`template`),n.innerHTML=t,e.set(t,n)),n},n=e=>t(e).content.cloneNode(!0),r=(e,t)=>{if(e.nodeType===Node.COMMENT_NODE){let n=e.nodeValue;n&&t.comments.set(n,e);return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e.getAttribute(`u`);n&&t.elements.set(n,e)},i=e=>{let t={comments:new Map,elements:new Map},n=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);for(r(e,t);n.nextNode();)r(n.currentNode,t);return t},a=e=>{let t={comments:new Map,elements:new Map};for(let n of e){let e=document.createTreeWalker(n,NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_ELEMENT);for(r(n,t);e.nextNode();)r(e.currentNode,t)}return t},o=(e,t)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(;n.nextNode();){let e=n.currentNode;if(e.nodeValue===t)return e}return null},s=e=>Array.from(n(e).childNodes),c=(e,t,n)=>{if(e.parentNode)for(let r of t)e.parentNode.insertBefore(r,n)};export{s as createNodes,o as findCommentMarker,i as indexBindings,a as indexBindingsInNodes,c as insertNodes,n as parseHTML};
2
- //# sourceMappingURL=template-dom.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-dom.js","names":[],"sources":["../src/template-dom.ts"],"sourcesContent":["import { CF_ID_ATTR } from './internal';\n\nexport type BindingTargets = {\n comments: Map<string, Comment>;\n elements: Map<string, HTMLElement>;\n};\n\nconst templateCache = new Map<string, HTMLTemplateElement>();\n\nconst getCachedTemplate = (html: string): HTMLTemplateElement => {\n let tpl = templateCache.get(html);\n\n if (!tpl) {\n tpl = document.createElement('template');\n tpl.innerHTML = html;\n\n templateCache.set(html, tpl);\n }\n\n return tpl;\n};\n\nexport const parseHTML = (html: string): DocumentFragment =>\n getCachedTemplate(html).content.cloneNode(true) as DocumentFragment;\n\nconst collectBindingTarget = (node: Node, targets: BindingTargets): void => {\n if (node.nodeType === Node.COMMENT_NODE) {\n const marker = (node as Comment).nodeValue;\n\n if (marker) targets.comments.set(marker, node as Comment);\n\n return;\n }\n\n if (node.nodeType !== Node.ELEMENT_NODE) return;\n\n const id = (node as Element).getAttribute(CF_ID_ATTR);\n\n if (id) targets.elements.set(id, node as HTMLElement);\n};\n\nexport const indexBindings = (root: Node): BindingTargets => {\n const targets: BindingTargets = { comments: new Map(), elements: new Map() };\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT);\n\n collectBindingTarget(root, targets);\n\n while (walker.nextNode()) collectBindingTarget(walker.currentNode, targets);\n\n return targets;\n};\n\nexport const indexBindingsInNodes = (nodes: Iterable<Node>): BindingTargets => {\n const targets: BindingTargets = { comments: new Map(), elements: new Map() };\n\n for (const node of nodes) {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_ELEMENT);\n\n collectBindingTarget(node, targets);\n\n while (walker.nextNode()) collectBindingTarget(walker.currentNode, targets);\n }\n\n return targets;\n};\nexport const findCommentMarker = (root: Node, marker: string): Comment | null => {\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_COMMENT);\n\n while (walker.nextNode()) {\n const comment = walker.currentNode as Comment;\n\n if (comment.nodeValue === marker) return comment;\n }\n\n return null;\n};\n\nexport const isHtmlBindingMarker = (node: Node): boolean =>\n node.nodeType === Node.COMMENT_NODE &&\n ((node as Comment).data === 'html-binding' || (node as Comment).data.startsWith('__h_'));\n\nexport const clearAfterMarker = (marker: Comment): void => {\n let next = marker.nextSibling;\n\n while (next) {\n if (isHtmlBindingMarker(next)) break;\n\n const toRemove = next;\n\n next = next.nextSibling;\n toRemove.remove();\n }\n};\n\nexport const createNodes = (htmlString: string): Node[] => Array.from(parseHTML(htmlString).childNodes);\n\nexport const insertNodes = (marker: Comment, nodes: Node[], before: Node | null): void => {\n if (marker.parentNode) {\n for (const node of nodes) marker.parentNode.insertBefore(node, before);\n }\n};\n"],"mappings":"sBAOA,IAAM,EAAgB,IAAI,IAEpB,EAAqB,GAAsC,CAC/D,IAAI,EAAM,EAAc,IAAI,EAAK,CASjC,OAPK,IACH,EAAM,SAAS,cAAc,WAAW,CACxC,EAAI,UAAY,EAEhB,EAAc,IAAI,EAAM,EAAI,EAGvB,GAGI,EAAa,GACxB,EAAkB,EAAK,CAAC,QAAQ,UAAU,GAAK,CAE3C,GAAwB,EAAY,IAAkC,CAC1E,GAAI,EAAK,WAAa,KAAK,aAAc,CACvC,IAAM,EAAU,EAAiB,UAE7B,GAAQ,EAAQ,SAAS,IAAI,EAAQ,EAAgB,CAEzD,OAGF,GAAI,EAAK,WAAa,KAAK,aAAc,OAEzC,IAAM,EAAM,EAAiB,aAAA,IAAwB,CAEjD,GAAI,EAAQ,SAAS,IAAI,EAAI,EAAoB,EAG1C,EAAiB,GAA+B,CAC3D,IAAM,EAA0B,CAAE,SAAU,IAAI,IAAO,SAAU,IAAI,IAAO,CACtE,EAAS,SAAS,iBAAiB,EAAM,WAAW,aAAe,WAAW,aAAa,CAIjG,IAFA,EAAqB,EAAM,EAAQ,CAE5B,EAAO,UAAU,EAAE,EAAqB,EAAO,YAAa,EAAQ,CAE3E,OAAO,GAGI,EAAwB,GAA0C,CAC7E,IAAM,EAA0B,CAAE,SAAU,IAAI,IAAO,SAAU,IAAI,IAAO,CAE5E,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAS,SAAS,iBAAiB,EAAM,WAAW,aAAe,WAAW,aAAa,CAIjG,IAFA,EAAqB,EAAM,EAAQ,CAE5B,EAAO,UAAU,EAAE,EAAqB,EAAO,YAAa,EAAQ,CAG7E,OAAO,GAEI,GAAqB,EAAY,IAAmC,CAC/E,IAAM,EAAS,SAAS,iBAAiB,EAAM,WAAW,aAAa,CAEvE,KAAO,EAAO,UAAU,EAAE,CACxB,IAAM,EAAU,EAAO,YAEvB,GAAI,EAAQ,YAAc,EAAQ,OAAO,EAG3C,OAAO,MAoBI,EAAe,GAA+B,MAAM,KAAK,EAAU,EAAW,CAAC,WAAW,CAE1F,GAAe,EAAiB,EAAe,IAA8B,CACxF,GAAI,EAAO,WACT,IAAK,IAAM,KAAQ,EAAO,EAAO,WAAW,aAAa,EAAM,EAAO"}
@@ -1,2 +0,0 @@
1
- const e=require(`./internal.cjs`),t=require(`./template-dom.cjs`),n=require(`./template-bindings.cjs`);let r=require(`@vielzeug/stateit`);var i=t=>{e.runAll(t.cleanups);for(let e of t.nodes)e.remove()},a=(e,r,i=t.indexBindingsInNodes(e))=>{let a=[];return n.applyBindingsWithTargets(r,e=>a.push(e),i),a},o=(s,c,l,u)=>{let d=t.findCommentMarker(s,c.uid);if(!d)return;let f=document.createComment(`html-binding`);d.replaceWith(f);let p=[],m=e=>p.push(e),h=()=>{e.runAll(p),p=[]},g=null,_=[];l((0,r.effect)(()=>{(0,r.batch)(()=>{let l=c.signal.value;if(!c.keyed&&l.html===g)return;g=l.html,h();let{bindings:d,html:p,keys:v}=l;c.keyed&&!u.has(c.uid)&&u.set(c.uid,new Map);let y=c.keyed?u.get(c.uid):null,b=f.parentElement||s,x=!1;(0,r.untrack)(()=>{(0,r.batch)(()=>{if(y&&v?.length&&l.items?.length===v.length){if(x=!0,y.size===0&&_.length>0){for(let e of _)e.remove();_=[]}let n=new Map;for(let r=0;r<v.length;r++){let i=v[r],o=l.items[r],s=y.get(i),c=r>0?n.get(v[r-1])?.nodes:null,u=c?.length?c[c.length-1].nextSibling:f.nextSibling;if(s&&s.html===o.html){s.nodes[0]&&t.insertNodes(f,s.nodes,u),e.runAll(s.cleanups);let r=t.indexBindingsInNodes(s.nodes),c=a(s.nodes,o.bindings,r);n.set(i,{...s,bindings:o.bindings,cleanups:c,targets:r})}else if(s){e.runAll(s.cleanups);let r=t.createNodes(o.html),c=t.indexBindingsInNodes(r);t.insertNodes(f,r,u);let l=a(r,o.bindings,c);n.set(i,{bindings:o.bindings,cleanups:l,html:o.html,nodes:r,targets:c});for(let e of s.nodes)e.remove()}else{let e=t.createNodes(o.html),r=t.indexBindingsInNodes(e);t.insertNodes(f,e,u);let s=a(e,o.bindings,r);n.set(i,{bindings:o.bindings,cleanups:s,html:o.html,nodes:e,targets:r})}}for(let[e,t]of y)n.has(e)||i(t);u.set(c.uid,n)}else{if(c.keyed&&y&&y.size>0)for(let[,e]of y)i(e);else for(let e of _)e.remove();let e=t.parseHTML(p);_=Array.from(e.childNodes),f.after(e),c.keyed&&u.set(c.uid,new Map)}}),x||n.applyBindingsInContainer(b,d,m,{onHtml:e=>o(b,e,m,u)})})})})),l(h),c.keyed&&l(()=>u.delete(c.uid))};exports.applyHtmlBinding=o;
2
- //# sourceMappingURL=template-html.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-html.cjs","names":[],"sources":["../src/template-html.ts"],"sourcesContent":["import { batch, untrack, effect as _effect, type CleanupFn } from '@vielzeug/stateit';\n\nimport { type Binding, type HtmlBinding } from './internal';\nimport { runAll } from './internal';\nimport { applyBindingsInContainer, applyBindingsWithTargets } from './template-bindings';\nimport { type RegisterCleanup } from './template-bindings';\nimport {\n createNodes,\n findCommentMarker,\n indexBindingsInNodes,\n insertNodes,\n parseHTML,\n type BindingTargets,\n} from './template-dom';\n\n/** Keyed reconciliation node — holds DOM nodes + lifecycle for one `each()` item. */\nexport type KeyedNode = {\n bindings: Binding[];\n cleanups: CleanupFn[];\n html: string;\n nodes: Node[];\n targets: BindingTargets;\n};\n\nconst removeKeyed = (keyedNode: KeyedNode) => {\n runAll(keyedNode.cleanups);\n for (const n of keyedNode.nodes) (n as ChildNode).remove();\n};\n\n/** Apply bindings to keyed item nodes using pre-indexed targets. */\nconst applyKeyedItemBindings = (\n nodes: Node[],\n itemBindings: Binding[],\n targets = indexBindingsInNodes(nodes),\n): CleanupFn[] => {\n const itemCleanups: CleanupFn[] = [];\n const itemRegisterCleanup: RegisterCleanup = (fn) => itemCleanups.push(fn);\n\n applyBindingsWithTargets(itemBindings, itemRegisterCleanup, targets);\n\n return itemCleanups;\n};\n\n/**\n * Sets up the reactive effect for an html-binding marker. Handles both non-keyed\n * (full replace) and keyed (`each()`) reconciliation.\n *\n * @param root The root node containing the marker comment.\n * @param b The HtmlBinding descriptor.\n * @param registerCleanup Function that registers a cleanup tied to the outer container's lifetime.\n * @param keyedStates Per-element map of `marker → (key → KeyedNode)` — caller owns this state.\n */\nexport const applyHtmlBinding = (\n root: Node,\n b: HtmlBinding,\n registerCleanup: RegisterCleanup,\n keyedStates: Map<string, Map<string | number, KeyedNode>>,\n): void => {\n const found = findCommentMarker(root, b.uid);\n\n if (!found) return;\n\n const marker = document.createComment('html-binding');\n\n found.replaceWith(marker);\n\n let currentCleanups: CleanupFn[] = [];\n const registerInnerCleanup: RegisterCleanup = (fn) => currentCleanups.push(fn);\n const runCurrentCleanups = () => {\n runAll(currentCleanups);\n currentCleanups = [];\n };\n let lastHtml: string | null = null;\n let lastInsertedNodes: Node[] = [];\n\n // Use stateit.effect directly so cleanup is managed manually via registerCleanup, not autoCleanup.\n const stop = _effect(() => {\n batch(() => {\n const data = b.signal.value;\n\n if (!b.keyed && data.html === lastHtml) {\n return;\n }\n\n lastHtml = data.html;\n\n runCurrentCleanups();\n\n const { bindings, html, keys } = data;\n\n if (b.keyed && !keyedStates.has(b.uid)) keyedStates.set(b.uid, new Map());\n\n const keyedState = b.keyed ? keyedStates.get(b.uid)! : null;\n const container = (marker.parentElement || root) as ParentNode;\n\n let bindingsAlreadyApplied = false;\n\n untrack(() => {\n batch(() => {\n if (keyedState && keys?.length && data.items?.length === keys.length) {\n bindingsAlreadyApplied = true;\n\n // Transition from empty/fallback insertion back to keyed list items.\n if (keyedState.size === 0 && lastInsertedNodes.length > 0) {\n for (const n of lastInsertedNodes) (n as ChildNode).remove();\n lastInsertedNodes = [];\n }\n\n const newKeyedState = new Map<string | number, KeyedNode>();\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const itemData = data.items[i];\n const existing = keyedState.get(key);\n\n const prevNodes = i > 0 ? newKeyedState.get(keys[i - 1])?.nodes : null;\n const insertPoint = prevNodes?.length ? prevNodes[prevNodes.length - 1].nextSibling : marker.nextSibling;\n\n if (existing && existing.html === itemData.html) {\n // UPDATE: Same HTML — reuse nodes, reapply bindings\n if (existing.nodes[0]) insertNodes(marker, existing.nodes, insertPoint);\n\n runAll(existing.cleanups);\n\n const itemTargets = indexBindingsInNodes(existing.nodes);\n const itemCleanups = applyKeyedItemBindings(existing.nodes, itemData.bindings, itemTargets);\n\n newKeyedState.set(key, {\n ...existing,\n bindings: itemData.bindings,\n cleanups: itemCleanups,\n targets: itemTargets,\n });\n } else if (existing) {\n // REPLACE: Different HTML — create new nodes, remove old\n runAll(existing.cleanups);\n\n const newNodes = createNodes(itemData.html);\n const itemTargets = indexBindingsInNodes(newNodes);\n\n insertNodes(marker, newNodes, insertPoint);\n\n const itemCleanups = applyKeyedItemBindings(newNodes, itemData.bindings, itemTargets);\n\n newKeyedState.set(key, {\n bindings: itemData.bindings,\n cleanups: itemCleanups,\n html: itemData.html,\n nodes: newNodes,\n targets: itemTargets,\n });\n for (const n of existing.nodes) (n as ChildNode).remove();\n } else {\n // CREATE: New item\n const newNodes = createNodes(itemData.html);\n const itemTargets = indexBindingsInNodes(newNodes);\n\n insertNodes(marker, newNodes, insertPoint);\n\n const itemCleanups = applyKeyedItemBindings(newNodes, itemData.bindings, itemTargets);\n\n newKeyedState.set(key, {\n bindings: itemData.bindings,\n cleanups: itemCleanups,\n html: itemData.html,\n nodes: newNodes,\n targets: itemTargets,\n });\n }\n }\n\n // DELETE: Remove old items not in new state\n for (const [oldKey, oldNode] of keyedState) {\n if (!newKeyedState.has(oldKey)) removeKeyed(oldNode);\n }\n\n keyedStates.set(b.uid, newKeyedState);\n } else {\n // Non-keyed or empty list: replace previously inserted nodes.\n if (b.keyed && keyedState && keyedState.size > 0) {\n for (const [, kn] of keyedState) removeKeyed(kn);\n } else {\n for (const n of lastInsertedNodes) (n as ChildNode).remove();\n }\n\n const parsed = parseHTML(html);\n\n lastInsertedNodes = Array.from(parsed.childNodes);\n marker.after(parsed);\n\n if (b.keyed) keyedStates.set(b.uid, new Map());\n }\n });\n\n if (!bindingsAlreadyApplied) {\n applyBindingsInContainer(container, bindings, registerInnerCleanup, {\n onHtml: (binding) => applyHtmlBinding(container, binding, registerInnerCleanup, keyedStates),\n });\n }\n });\n });\n });\n\n registerCleanup(stop);\n registerCleanup(runCurrentCleanups);\n\n if (b.keyed) registerCleanup(() => keyedStates.delete(b.uid));\n};\n"],"mappings":"0IAwBA,IAAM,EAAe,GAAyB,CAC5C,EAAA,OAAO,EAAU,SAAS,CAC1B,IAAK,IAAM,KAAK,EAAU,MAAQ,EAAgB,QAAQ,EAItD,GACJ,EACA,EACA,EAAU,EAAA,qBAAqB,EAAM,GACrB,CAChB,IAAM,EAA4B,EAAE,CAKpC,OAFA,EAAA,yBAAyB,EAFqB,GAAO,EAAa,KAAK,EAAG,CAEd,EAAQ,CAE7D,GAYI,GACX,EACA,EACA,EACA,IACS,CACT,IAAM,EAAQ,EAAA,kBAAkB,EAAM,EAAE,IAAI,CAE5C,GAAI,CAAC,EAAO,OAEZ,IAAM,EAAS,SAAS,cAAc,eAAe,CAErD,EAAM,YAAY,EAAO,CAEzB,IAAI,EAA+B,EAAE,CAC/B,EAAyC,GAAO,EAAgB,KAAK,EAAG,CACxE,MAA2B,CAC/B,EAAA,OAAO,EAAgB,CACvB,EAAkB,EAAE,EAElB,EAA0B,KAC1B,EAA4B,EAAE,CAkIlC,GAAA,EAAA,EAAA,YA/H2B,EACzB,EAAA,EAAA,WAAY,CACV,IAAM,EAAO,EAAE,OAAO,MAEtB,GAAI,CAAC,EAAE,OAAS,EAAK,OAAS,EAC5B,OAGF,EAAW,EAAK,KAEhB,GAAoB,CAEpB,GAAM,CAAE,WAAU,OAAM,QAAS,EAE7B,EAAE,OAAS,CAAC,EAAY,IAAI,EAAE,IAAI,EAAE,EAAY,IAAI,EAAE,IAAK,IAAI,IAAM,CAEzE,IAAM,EAAa,EAAE,MAAQ,EAAY,IAAI,EAAE,IAAI,CAAI,KACjD,EAAa,EAAO,eAAiB,EAEvC,EAAyB,IAE7B,EAAA,EAAA,aAAc,EACZ,EAAA,EAAA,WAAY,CACV,GAAI,GAAc,GAAM,QAAU,EAAK,OAAO,SAAW,EAAK,OAAQ,CAIpE,GAHA,EAAyB,GAGrB,EAAW,OAAS,GAAK,EAAkB,OAAS,EAAG,CACzD,IAAK,IAAM,KAAK,EAAoB,EAAgB,QAAQ,CAC5D,EAAoB,EAAE,CAGxB,IAAM,EAAgB,IAAI,IAE1B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAQ,IAAK,CACpC,IAAM,EAAM,EAAK,GACX,EAAW,EAAK,MAAM,GACtB,EAAW,EAAW,IAAI,EAAI,CAE9B,EAAY,EAAI,EAAI,EAAc,IAAI,EAAK,EAAI,GAAG,EAAE,MAAQ,KAC5D,EAAc,GAAW,OAAS,EAAU,EAAU,OAAS,GAAG,YAAc,EAAO,YAE7F,GAAI,GAAY,EAAS,OAAS,EAAS,KAAM,CAE3C,EAAS,MAAM,IAAI,EAAA,YAAY,EAAQ,EAAS,MAAO,EAAY,CAEvE,EAAA,OAAO,EAAS,SAAS,CAEzB,IAAM,EAAc,EAAA,qBAAqB,EAAS,MAAM,CAClD,EAAe,EAAuB,EAAS,MAAO,EAAS,SAAU,EAAY,CAE3F,EAAc,IAAI,EAAK,CACrB,GAAG,EACH,SAAU,EAAS,SACnB,SAAU,EACV,QAAS,EACV,CAAC,SACO,EAAU,CAEnB,EAAA,OAAO,EAAS,SAAS,CAEzB,IAAM,EAAW,EAAA,YAAY,EAAS,KAAK,CACrC,EAAc,EAAA,qBAAqB,EAAS,CAElD,EAAA,YAAY,EAAQ,EAAU,EAAY,CAE1C,IAAM,EAAe,EAAuB,EAAU,EAAS,SAAU,EAAY,CAErF,EAAc,IAAI,EAAK,CACrB,SAAU,EAAS,SACnB,SAAU,EACV,KAAM,EAAS,KACf,MAAO,EACP,QAAS,EACV,CAAC,CACF,IAAK,IAAM,KAAK,EAAS,MAAQ,EAAgB,QAAQ,KACpD,CAEL,IAAM,EAAW,EAAA,YAAY,EAAS,KAAK,CACrC,EAAc,EAAA,qBAAqB,EAAS,CAElD,EAAA,YAAY,EAAQ,EAAU,EAAY,CAE1C,IAAM,EAAe,EAAuB,EAAU,EAAS,SAAU,EAAY,CAErF,EAAc,IAAI,EAAK,CACrB,SAAU,EAAS,SACnB,SAAU,EACV,KAAM,EAAS,KACf,MAAO,EACP,QAAS,EACV,CAAC,EAKN,IAAK,GAAM,CAAC,EAAQ,KAAY,EACzB,EAAc,IAAI,EAAO,EAAE,EAAY,EAAQ,CAGtD,EAAY,IAAI,EAAE,IAAK,EAAc,KAChC,CAEL,GAAI,EAAE,OAAS,GAAc,EAAW,KAAO,EAC7C,IAAK,GAAM,EAAG,KAAO,EAAY,EAAY,EAAG,MAEhD,IAAK,IAAM,KAAK,EAAoB,EAAgB,QAAQ,CAG9D,IAAM,EAAS,EAAA,UAAU,EAAK,CAE9B,EAAoB,MAAM,KAAK,EAAO,WAAW,CACjD,EAAO,MAAM,EAAO,CAEhB,EAAE,OAAO,EAAY,IAAI,EAAE,IAAK,IAAI,IAAM,GAEhD,CAEG,GACH,EAAA,yBAAyB,EAAW,EAAU,EAAsB,CAClE,OAAS,GAAY,EAAiB,EAAW,EAAS,EAAsB,EAAY,CAC7F,CAAC,EAEJ,EACF,EACF,CAEmB,CACrB,EAAgB,EAAmB,CAE/B,EAAE,OAAO,MAAsB,EAAY,OAAO,EAAE,IAAI,CAAC"}