spell-ui 0.8.15 → 0.8.17

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 (285) hide show
  1. package/README-components.md +4 -2
  2. package/README-runtime.md +26 -1
  3. package/README.md +2 -1
  4. package/dist/SliderScale-DunjyaDW.js +67 -0
  5. package/dist/SliderScale-DunjyaDW.js.map +1 -0
  6. package/dist/{ThemeDraft-CyX3YA_L.js → ThemeDraft-spaNC2dD.js} +2 -2
  7. package/dist/{ThemeDraft-CyX3YA_L.js.map → ThemeDraft-spaNC2dD.js.map} +1 -1
  8. package/dist/{UIInput-B3K0w4ow.js → UIInput-8s1aiaw1.js} +2 -2
  9. package/dist/UIInput-8s1aiaw1.js.map +1 -0
  10. package/dist/{UIRuntime-DCv4sy30.js → UIRuntime-BaokNnwk.js} +900 -158
  11. package/dist/UIRuntime-BaokNnwk.js.map +1 -0
  12. package/dist/_spell-element/UIComponent.d.ts +7 -0
  13. package/dist/_spell-element/elements.types.d.ts +6 -0
  14. package/dist/_spell-element/vocabulary.types.d.ts +27 -0
  15. package/dist/_util/dom.d.ts +7 -0
  16. package/dist/components/components.es.d.ts +1 -0
  17. package/dist/components/ui-dial/DialArc.d.ts +43 -0
  18. package/dist/components/ui-dial/UIDial.d.ts +263 -0
  19. package/dist/components/ui-dial/UIDial.en.d.ts +149 -0
  20. package/dist/components/ui-dial/UIDial.es.d.ts +25 -0
  21. package/dist/components/ui-dial/UIDial.fallback.d.ts +167 -0
  22. package/dist/components/ui-dial/UIDial.types.d.ts +11 -0
  23. package/dist/components/ui-dial/index.d.ts +3 -0
  24. package/dist/components/ui-graph/UIGraph.d.ts +17 -0
  25. package/dist/components/ui-graph/UIGraph.en.d.ts +17 -0
  26. package/dist/components/ui-graph/UIGraph.es.d.ts +6 -0
  27. package/dist/components/ui-input/UIInput.d.ts +46 -3
  28. package/dist/components/ui-input/UIInput.en.d.ts +6 -1
  29. package/dist/components/ui-input/UIInput.es.d.ts +1 -0
  30. package/dist/components/ui-input/UIInput.fallback.d.ts +6 -1
  31. package/dist/components/ui-json/UIJson.d.ts +5 -4
  32. package/dist/components/ui-modal/ChoiceRows.d.ts +61 -0
  33. package/dist/components/ui-modal/ModalDialogs.d.ts +15 -1
  34. package/dist/components/ui-modal/UIModal.d.ts +6 -2
  35. package/dist/components/ui-modal/UIModal.en.d.ts +6 -2
  36. package/dist/components/ui-modal/UIModal.es.d.ts +1 -0
  37. package/dist/components/ui-page-layout/UIPageLayout.d.ts +141 -8
  38. package/dist/components/ui-page-layout/UIPageLayout.en.d.ts +51 -2
  39. package/dist/components/ui-page-layout/UIPageLayout.es.d.ts +3 -0
  40. package/dist/components/ui-property-editor/UIProperty.d.ts +2 -2
  41. package/dist/components/ui-site-links/UISiteLinks.d.ts +124 -0
  42. package/dist/components/ui-site-links/UISiteLinks.en.d.ts +60 -0
  43. package/dist/components/ui-site-links/UISiteLinks.es.d.ts +26 -0
  44. package/dist/components/ui-site-links/index.d.ts +1 -0
  45. package/dist/components/ui-site-nav-button/UISiteNavButton.d.ts +12 -5
  46. package/dist/components/ui-site-nav-button/UISiteNavButton.en.d.ts +32 -12
  47. package/dist/components/ui-site-nav-button/UISiteNavButton.es.d.ts +3 -0
  48. package/dist/components/ui-site-tabs/UISiteTabs.d.ts +13 -0
  49. package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +9 -0
  50. package/dist/components/ui-slider/SliderScale.d.ts +26 -2
  51. package/dist/components/ui-slider/UISlider.d.ts +0 -2
  52. package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
  53. package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
  54. package/dist/components/ui-toc/TocIndex.d.ts +16 -1
  55. package/dist/components/ui-toc/UIToc.d.ts +27 -3
  56. package/dist/components/ui-toc/UIToc.en.d.ts +1 -1
  57. package/dist/components/ui-toc/UIToc.types.d.ts +5 -0
  58. package/dist/components/ui-tree/UITree.d.ts +38 -2
  59. package/dist/components/ui-tree/UITree.en.d.ts +9 -0
  60. package/dist/components/ui-tree/UITree.es.d.ts +4 -0
  61. package/dist/components/ui-uploader/UIUploader.d.ts +721 -0
  62. package/dist/components/ui-uploader/UIUploader.en.d.ts +394 -0
  63. package/dist/components/ui-uploader/UIUploader.es.d.ts +112 -0
  64. package/dist/components/ui-uploader/index.d.ts +1 -0
  65. package/dist/{components.es-DilRG1VO.js → components.es-jY2nBwuP.js} +249 -65
  66. package/dist/components.es-jY2nBwuP.js.map +1 -0
  67. package/dist/core.js +605 -571
  68. package/dist/core.js.map +1 -1
  69. package/dist/docs-components/docs-components.types.d.ts +2 -0
  70. package/dist/index.d.ts +3 -0
  71. package/dist/index.js +101 -97
  72. package/dist/jsx.d.ts +1138 -21
  73. package/dist/runtime/DataTooltips.d.ts +10 -0
  74. package/dist/runtime/Modals.d.ts +7 -2
  75. package/dist/runtime/Styles.d.ts +7 -1
  76. package/dist/runtime/UIRuntime.d.ts +6 -0
  77. package/dist/runtime/runtime.types.d.ts +26 -1
  78. package/dist/sound-library/back.ogg +0 -0
  79. package/dist/sound-library/beep.ogg +0 -0
  80. package/dist/sound-library/bell.ogg +0 -0
  81. package/dist/sound-library/big-punch.ogg +0 -0
  82. package/dist/sound-library/bong.ogg +0 -0
  83. package/dist/sound-library/book-close.ogg +0 -0
  84. package/dist/sound-library/book-down.ogg +0 -0
  85. package/dist/sound-library/book-open.ogg +0 -0
  86. package/dist/sound-library/card-fan-2.ogg +0 -0
  87. package/dist/sound-library/card-fan.ogg +0 -0
  88. package/dist/sound-library/card-place-2.ogg +0 -0
  89. package/dist/sound-library/card-place-3.ogg +0 -0
  90. package/dist/sound-library/card-place.ogg +0 -0
  91. package/dist/sound-library/card-shove-2.ogg +0 -0
  92. package/dist/sound-library/card-shove.ogg +0 -0
  93. package/dist/sound-library/card-slide-2.ogg +0 -0
  94. package/dist/sound-library/card-slide-3.ogg +0 -0
  95. package/dist/sound-library/card-slide-4.ogg +0 -0
  96. package/dist/sound-library/card-slide.ogg +0 -0
  97. package/dist/sound-library/chip-down-2.ogg +0 -0
  98. package/dist/sound-library/chip-down.ogg +0 -0
  99. package/dist/sound-library/chips-collide.ogg +0 -0
  100. package/dist/sound-library/chips-handle.ogg +0 -0
  101. package/dist/sound-library/chips-stack-2.ogg +0 -0
  102. package/dist/sound-library/chips-stack.ogg +0 -0
  103. package/dist/sound-library/chop.ogg +0 -0
  104. package/dist/sound-library/click-2.ogg +0 -0
  105. package/dist/sound-library/click-3.ogg +0 -0
  106. package/dist/sound-library/click.ogg +0 -0
  107. package/dist/sound-library/close.ogg +0 -0
  108. package/dist/sound-library/cloth.ogg +0 -0
  109. package/dist/sound-library/coins-2.ogg +0 -0
  110. package/dist/sound-library/coins.ogg +0 -0
  111. package/dist/sound-library/confirm-2.ogg +0 -0
  112. package/dist/sound-library/confirm.ogg +0 -0
  113. package/dist/sound-library/creak.ogg +0 -0
  114. package/dist/sound-library/deck-open.ogg +0 -0
  115. package/dist/sound-library/deck-take-out.ogg +0 -0
  116. package/dist/sound-library/dice-grab.ogg +0 -0
  117. package/dist/sound-library/dice-shake-2.ogg +0 -0
  118. package/dist/sound-library/dice-shake.ogg +0 -0
  119. package/dist/sound-library/dice-throw-2.ogg +0 -0
  120. package/dist/sound-library/dice-throw.ogg +0 -0
  121. package/dist/sound-library/die-throw-2.ogg +0 -0
  122. package/dist/sound-library/die-throw.ogg +0 -0
  123. package/dist/sound-library/door-close.ogg +0 -0
  124. package/dist/sound-library/door-open.ogg +0 -0
  125. package/dist/sound-library/drop.ogg +0 -0
  126. package/dist/sound-library/error-2.ogg +0 -0
  127. package/dist/sound-library/error.ogg +0 -0
  128. package/dist/sound-library/fail.ogg +0 -0
  129. package/dist/sound-library/fall.ogg +0 -0
  130. package/dist/sound-library/glass-break.ogg +0 -0
  131. package/dist/sound-library/glass-clink.ogg +0 -0
  132. package/dist/sound-library/glass-tap.ogg +0 -0
  133. package/dist/sound-library/glass.ogg +0 -0
  134. package/dist/sound-library/glitch.ogg +0 -0
  135. package/dist/sound-library/grow.ogg +0 -0
  136. package/dist/sound-library/high-up.ogg +0 -0
  137. package/dist/sound-library/hover-2.ogg +0 -0
  138. package/dist/sound-library/hover.ogg +0 -0
  139. package/dist/sound-library/jingle-2.ogg +0 -0
  140. package/dist/sound-library/jingle-3.ogg +0 -0
  141. package/dist/sound-library/jingle-4.ogg +0 -0
  142. package/dist/sound-library/jingle.ogg +0 -0
  143. package/dist/sound-library/jump.ogg +0 -0
  144. package/dist/sound-library/knife-draw.ogg +0 -0
  145. package/dist/sound-library/knife-slice.ogg +0 -0
  146. package/dist/sound-library/laser-2.ogg +0 -0
  147. package/dist/sound-library/laser.ogg +0 -0
  148. package/dist/sound-library/latch.ogg +0 -0
  149. package/dist/sound-library/level-up.ogg +0 -0
  150. package/dist/sound-library/lose-2.ogg +0 -0
  151. package/dist/sound-library/lose-3.ogg +0 -0
  152. package/dist/sound-library/lose-4.ogg +0 -0
  153. package/dist/sound-library/lose.ogg +0 -0
  154. package/dist/sound-library/low-down.ogg +0 -0
  155. package/dist/sound-library/metal-clang.ogg +0 -0
  156. package/dist/sound-library/metal-click.ogg +0 -0
  157. package/dist/sound-library/metal-crash.ogg +0 -0
  158. package/dist/sound-library/metal-tap.ogg +0 -0
  159. package/dist/sound-library/mouse-click.ogg +0 -0
  160. package/dist/sound-library/mouse-release.ogg +0 -0
  161. package/dist/sound-library/open.ogg +0 -0
  162. package/dist/sound-library/orchestra-hit-2.ogg +0 -0
  163. package/dist/sound-library/orchestra-hit.ogg +0 -0
  164. package/dist/sound-library/page-turn-2.ogg +0 -0
  165. package/dist/sound-library/page-turn.ogg +0 -0
  166. package/dist/sound-library/pickaxe.ogg +0 -0
  167. package/dist/sound-library/piece-down-2.ogg +0 -0
  168. package/dist/sound-library/piece-down-3.ogg +0 -0
  169. package/dist/sound-library/piece-down.ogg +0 -0
  170. package/dist/sound-library/piece-take-2.ogg +0 -0
  171. package/dist/sound-library/piece-take.ogg +0 -0
  172. package/dist/sound-library/piece-tap-2.ogg +0 -0
  173. package/dist/sound-library/piece-tap.ogg +0 -0
  174. package/dist/sound-library/plank.ogg +0 -0
  175. package/dist/sound-library/plate.ogg +0 -0
  176. package/dist/sound-library/pluck.ogg +0 -0
  177. package/dist/sound-library/pot.ogg +0 -0
  178. package/dist/sound-library/power-up-2.ogg +0 -0
  179. package/dist/sound-library/power-up-3.ogg +0 -0
  180. package/dist/sound-library/power-up.ogg +0 -0
  181. package/dist/sound-library/punch.ogg +0 -0
  182. package/dist/sound-library/question.ogg +0 -0
  183. package/dist/sound-library/rise.ogg +0 -0
  184. package/dist/sound-library/scratch.ogg +0 -0
  185. package/dist/sound-library/scroll.ogg +0 -0
  186. package/dist/sound-library/select-2.ogg +0 -0
  187. package/dist/sound-library/select.ogg +0 -0
  188. package/dist/sound-library/shrink.ogg +0 -0
  189. package/dist/sound-library/shuffle.ogg +0 -0
  190. package/dist/sound-library/soft-thud-2.ogg +0 -0
  191. package/dist/sound-library/soft-thud.ogg +0 -0
  192. package/dist/sound-library/space-junk.ogg +0 -0
  193. package/dist/sound-library/step-2.ogg +0 -0
  194. package/dist/sound-library/step-on-carpet.ogg +0 -0
  195. package/dist/sound-library/step-on-grass.ogg +0 -0
  196. package/dist/sound-library/step-on-snow.ogg +0 -0
  197. package/dist/sound-library/step-on-stone.ogg +0 -0
  198. package/dist/sound-library/step-on-wood.ogg +0 -0
  199. package/dist/sound-library/step.ogg +0 -0
  200. package/dist/sound-library/switch-2.ogg +0 -0
  201. package/dist/sound-library/switch.ogg +0 -0
  202. package/dist/sound-library/tap-2.ogg +0 -0
  203. package/dist/sound-library/tap.ogg +0 -0
  204. package/dist/sound-library/three-tones.ogg +0 -0
  205. package/dist/sound-library/tick-2.ogg +0 -0
  206. package/dist/sound-library/tick.ogg +0 -0
  207. package/dist/sound-library/tin.ogg +0 -0
  208. package/dist/sound-library/toggle-2.ogg +0 -0
  209. package/dist/sound-library/toggle.ogg +0 -0
  210. package/dist/sound-library/two-tones.ogg +0 -0
  211. package/dist/sound-library/win-2.ogg +0 -0
  212. package/dist/sound-library/win-3.ogg +0 -0
  213. package/dist/sound-library/win-4.ogg +0 -0
  214. package/dist/sound-library/win.ogg +0 -0
  215. package/dist/sound-library/wood-thud.ogg +0 -0
  216. package/dist/sound-library/zap.ogg +0 -0
  217. package/dist/sounds/BuiltInSounds.d.ts +41 -0
  218. package/dist/sounds/index.d.ts +9 -0
  219. package/dist/sounds/sounds.types.d.ts +22 -0
  220. package/dist/ui-calendar.js +1 -1
  221. package/dist/ui-dial.editor-CjjdKi5L.js +5 -0
  222. package/dist/ui-dial.editor-CjjdKi5L.js.map +1 -0
  223. package/dist/ui-dial.js +467 -0
  224. package/dist/ui-dial.js.map +1 -0
  225. package/dist/ui-graph.js +22 -0
  226. package/dist/ui-graph.js.map +1 -1
  227. package/dist/{ui-input.editor-budoNoB0.js → ui-input.editor-D11iRgXR.js} +2 -2
  228. package/dist/ui-input.editor-D11iRgXR.js.map +1 -0
  229. package/dist/ui-input.js +84 -54
  230. package/dist/ui-input.js.map +1 -1
  231. package/dist/ui-json.js +8 -8
  232. package/dist/ui-json.js.map +1 -1
  233. package/dist/ui-modal.js +183 -97
  234. package/dist/ui-modal.js.map +1 -1
  235. package/dist/ui-page-layout.editor-IgDEveUY.js +5 -0
  236. package/dist/ui-page-layout.editor-IgDEveUY.js.map +1 -0
  237. package/dist/ui-page-layout.js +217 -72
  238. package/dist/ui-page-layout.js.map +1 -1
  239. package/dist/ui-popup.js +34 -34
  240. package/dist/ui-popup.js.map +1 -1
  241. package/dist/ui-property-editor.js +7 -4
  242. package/dist/ui-property-editor.js.map +1 -1
  243. package/dist/ui-root.js +71 -5
  244. package/dist/ui-root.js.map +1 -1
  245. package/dist/ui-search.js +1 -1
  246. package/dist/ui-section.js +97 -96
  247. package/dist/ui-section.js.map +1 -1
  248. package/dist/ui-site-links.editor-BME3sw5H.js +5 -0
  249. package/dist/ui-site-links.editor-BME3sw5H.js.map +1 -0
  250. package/dist/ui-site-links.js +150 -0
  251. package/dist/ui-site-links.js.map +1 -0
  252. package/dist/ui-site-nav-button.editor-ChY4xe1U.js +5 -0
  253. package/dist/ui-site-nav-button.editor-ChY4xe1U.js.map +1 -0
  254. package/dist/ui-site-nav-button.js +57 -18
  255. package/dist/ui-site-nav-button.js.map +1 -1
  256. package/dist/{ui-site-tabs.editor-DDvQfH6S.js → ui-site-tabs.editor-CdMIw4jw.js} +2 -2
  257. package/dist/ui-site-tabs.editor-CdMIw4jw.js.map +1 -0
  258. package/dist/ui-site-tabs.js +30 -14
  259. package/dist/ui-site-tabs.js.map +1 -1
  260. package/dist/ui-slider.js +75 -124
  261. package/dist/ui-slider.js.map +1 -1
  262. package/dist/ui-statistic.js +1 -0
  263. package/dist/ui-statistic.js.map +1 -1
  264. package/dist/ui-theme-editor.js +2 -2
  265. package/dist/{ui-theme-menu-BZYUMrHe.js → ui-theme-menu-BEBu6dyq.js} +3 -3
  266. package/dist/{ui-theme-menu-BZYUMrHe.js.map → ui-theme-menu-BEBu6dyq.js.map} +1 -1
  267. package/dist/ui-toc.js +159 -122
  268. package/dist/ui-toc.js.map +1 -1
  269. package/dist/ui-tree.js +142 -87
  270. package/dist/ui-tree.js.map +1 -1
  271. package/dist/ui-uploader.editor-DrE80KjL.js +5 -0
  272. package/dist/ui-uploader.editor-DrE80KjL.js.map +1 -0
  273. package/dist/ui-uploader.js +1442 -0
  274. package/dist/ui-uploader.js.map +1 -0
  275. package/dist/vocabulary/hooks.generated.d.ts +7 -0
  276. package/package.json +1 -1
  277. package/dist/UIInput-B3K0w4ow.js.map +0 -1
  278. package/dist/UIRuntime-DCv4sy30.js.map +0 -1
  279. package/dist/components.es-DilRG1VO.js.map +0 -1
  280. package/dist/ui-input.editor-budoNoB0.js.map +0 -1
  281. package/dist/ui-page-layout.editor-xtQW0FZk.js +0 -5
  282. package/dist/ui-page-layout.editor-xtQW0FZk.js.map +0 -1
  283. package/dist/ui-site-nav-button.editor-6J-zJLtZ.js +0 -5
  284. package/dist/ui-site-nav-button.editor-6J-zJLtZ.js.map +0 -1
  285. package/dist/ui-site-tabs.editor-DDvQfH6S.js.map +0 -1
@@ -0,0 +1,467 @@
1
+ import "./rolldown-runtime-c6e9CmGy.js";
2
+ import { C as e, Converters as t, Gt as n, Jt as r, Kt as i, NativeFallback as a, UI as o, Ut as s, Wt as c, Yt as l, afterSolidUpdate as u, clamp as d, controlled as f, cssState as p, derived as m, proto as h, protoMerged as g, qt as _, state as v, untracked as y, w as b } from "./core.js";
3
+ import { FormComponent as x } from "./forms.js";
4
+ import { t as S } from "./SliderScale-DunjyaDW.js";
5
+ import { For as C, Show as w } from "solid-js";
6
+ import { addEvent as T, className as E, createComponent as D, delegateEvents as ee, effect as O, insert as k, isServer as te, readShallow as A, ref as ne, setAttribute as j, template as M } from "@solidjs/web";
7
+ // src/components/ui-dial/UIDial.en.ts
8
+ var re = {
9
+ tag: "ui-dial",
10
+ icon: "gauge",
11
+ snippet: "<ui-dial label=\"Volume\"></ui-dial>",
12
+ formControl: !0,
13
+ topics: [
14
+ "inputs",
15
+ "forms",
16
+ "controls",
17
+ "modules"
18
+ ],
19
+ aka: [
20
+ "knob",
21
+ "rotary knob",
22
+ "radial slider",
23
+ "circular slider",
24
+ "gauge",
25
+ "arc slider"
26
+ ],
27
+ skeleton: "inline 10 x 11.5",
28
+ noun: "dial",
29
+ partOfSpeech: "action",
30
+ description: "A dial lets people pick a number by turning it, with its value in the middle and its label under it.",
31
+ attributes: [
32
+ {
33
+ name: "label",
34
+ group: "name",
35
+ kind: "string",
36
+ description: "The words under the dial; also its name for screen readers, unless `aria-label` or a `<label for>` names it."
37
+ },
38
+ {
39
+ name: "size",
40
+ group: "appearance",
41
+ kind: "size",
42
+ description: "Size of the whole dial, `mini` ... `massive`."
43
+ },
44
+ {
45
+ name: "color",
46
+ group: "appearance",
47
+ kind: "color",
48
+ description: "Hue of the arc and the handle; uncoloured, the theme's primary colour."
49
+ },
50
+ {
51
+ name: "ticks",
52
+ group: "appearance",
53
+ kind: "string",
54
+ description: "Dots round the inside of the ring: `ticks` alone draws 9 (8 gaps), `ticks=\"10\"` that many gaps. Only a look: values still snap to `step`."
55
+ },
56
+ {
57
+ name: "unit",
58
+ group: "appearance",
59
+ kind: "string",
60
+ description: "Written right after the number: `unit=\"%\"` shows `98%`, `unit=\" px\"` shows `16 px`."
61
+ },
62
+ {
63
+ name: "disabled",
64
+ group: "states",
65
+ kind: "keyOnly",
66
+ description: "Can't be used: dimmed, not focusable, left out of the form."
67
+ },
68
+ {
69
+ ...e.readonly,
70
+ description: "Shows its value but can't be changed; still focusable and submitted."
71
+ },
72
+ {
73
+ name: "min",
74
+ group: "form",
75
+ kind: "number",
76
+ default: 0,
77
+ description: "Lowest value, at the ring's start."
78
+ },
79
+ {
80
+ name: "max",
81
+ group: "form",
82
+ kind: "number",
83
+ default: 100,
84
+ description: "Highest value, at the ring's end."
85
+ },
86
+ {
87
+ name: "step",
88
+ group: "form",
89
+ kind: "number",
90
+ default: 1,
91
+ description: "Values snap to multiples of it from `min`; `0`: any."
92
+ },
93
+ {
94
+ name: "value",
95
+ group: "form",
96
+ kind: "number",
97
+ reflect: !1,
98
+ description: "The value, default `min`. Attribute: the starting (and reset) value; property: the live one."
99
+ },
100
+ e.name,
101
+ e.parameter,
102
+ {
103
+ ...e.required,
104
+ description: "Form validation: a value must be chosen, by the page (`value`) or by turning the dial. Unset, the handle rests at `min` but counts as no value (`valueMissing`)."
105
+ }
106
+ ],
107
+ events: [{
108
+ name: "ui-moved",
109
+ detail: "{ value: number, originalEvent?: Event }",
110
+ description: "The handle moved (each drag step, key or wheel turn). A handler that re-sets `value` wins."
111
+ }, {
112
+ name: "ui-changed",
113
+ detail: "{ value: number, originalEvent?: Event }",
114
+ description: "A change was committed: on a key or wheel turn, or when a drag ends somewhere new."
115
+ }],
116
+ slots: [],
117
+ parts: [
118
+ {
119
+ name: "dial",
120
+ description: "The root box: the ring, then the label."
121
+ },
122
+ {
123
+ name: "control",
124
+ description: "The round control itself (`role=slider`), which takes focus."
125
+ },
126
+ {
127
+ name: "track",
128
+ description: "The empty ring."
129
+ },
130
+ {
131
+ name: "track-fill",
132
+ description: "The coloured arc, from the start to the value."
133
+ },
134
+ {
135
+ name: "handle",
136
+ description: "The round handle, at the arc's end."
137
+ },
138
+ {
139
+ name: "disc",
140
+ description: "The disc in the middle."
141
+ },
142
+ {
143
+ name: "ticks",
144
+ description: "The tick dots (`ticks`)."
145
+ },
146
+ {
147
+ name: "value",
148
+ description: "The value, written in the disc."
149
+ },
150
+ {
151
+ name: "label",
152
+ description: "The words under the dial (`label`)."
153
+ }
154
+ ],
155
+ states: [
156
+ {
157
+ name: "disabled",
158
+ description: "Can't be used."
159
+ },
160
+ {
161
+ name: "dragging",
162
+ description: "The handle is being dragged."
163
+ },
164
+ {
165
+ ...b.invalid,
166
+ description: "Fails validation (`required`), once a person has interacted."
167
+ }
168
+ ],
169
+ texts: []
170
+ }, N, ie, P, F, I = class _DialFallback extends (P = a, ie = [h], N = [h], P) {
171
+ constructor() {
172
+ super(...arguments), r(this, "input");
173
+ }
174
+ build() {
175
+ let e = this.domElement, t = this.number("min", 0), n = Math.max(t, this.number("max", 100)), r = this.attr("label") ?? void 0, i = this.create("input", {
176
+ type: "range",
177
+ min: String(t),
178
+ max: String(n),
179
+ step: String(this.number("step", 1) || "any"),
180
+ disabled: this.flag("disabled"),
181
+ "aria-readonly": this.flag("readonly") ? "true" : void 0
182
+ });
183
+ this.decorate(i, "control"), r && !i.hasAttribute("aria-label") && i.setAttribute("aria-label", r), i.value = String(e.value ?? this.number("value", t)), this.listen(i, "input", (e) => this.changed(e, "ui-moved")), this.listen(i, "change", (e) => this.changed(e, "ui-changed")), this.listen(i, "keydown", (e) => {
184
+ this.flag("readonly") && e.preventDefault();
185
+ }), this.listen(i, "pointerdown", (e) => {
186
+ this.flag("readonly") && e.preventDefault();
187
+ }), this.input = i;
188
+ let a = r ? [this.create("div", {
189
+ class: se,
190
+ part: se,
191
+ "aria-hidden": "true"
192
+ }, r)] : [];
193
+ return [this.create("div", {
194
+ class: this.classes(),
195
+ part: oe
196
+ }, i, ...a)];
197
+ }
198
+ changed(e, t) {
199
+ let n = this.domElement;
200
+ n.value = Number(this.input.value), this.sync(), this.send(t, {
201
+ value: n.value,
202
+ originalEvent: e
203
+ });
204
+ }
205
+ sync() {
206
+ this.syncForm({ value: this.input?.value });
207
+ }
208
+ number(e, t) {
209
+ let n = Number(this.attr(e) ?? NaN);
210
+ return Number.isFinite(n) ? n : t;
211
+ }
212
+ };
213
+ F = n(P), s(F, 13, "vocabulary", ie, I), s(F, 13, "degraded", N, I), c(F, I), i(I, "DialFallback"), r(I, "vocabulary", l(F, 8, I, re)), l(F, 11, I), r(I, "degraded", l(F, 12, I, ["the ring, its arc, handle, disc and ticks (the browser's range input instead)", "the value written in the middle, `unit`, the wheel, vetoing by re-setting `value`, form reset"])), l(F, 15, I);
214
+ var ae = I, oe = "dial", se = "label", L = class DialArc {
215
+ static START = -135;
216
+ static SWEEP = 270;
217
+ static END = DialArc.START + DialArc.SWEEP;
218
+ static CENTRE = 50;
219
+ static angleAt(e) {
220
+ return DialArc.START + DialArc.SWEEP * d(e, 0, 1);
221
+ }
222
+ static ratioAt(e) {
223
+ return d((e - DialArc.START) / DialArc.SWEEP, 0, 1);
224
+ }
225
+ static pointAt(e, t) {
226
+ let n = DialArc.angleAt(e) * Math.PI / 180;
227
+ return {
228
+ x: round(DialArc.CENTRE + t * Math.sin(n)),
229
+ y: round(DialArc.CENTRE - t * Math.cos(n))
230
+ };
231
+ }
232
+ static path(e, t, n) {
233
+ if (t <= e) return "";
234
+ let r = DialArc.pointAt(e, n), i = DialArc.pointAt(t, n), a = +((t - e) * DialArc.SWEEP > 180);
235
+ return `M ${r.x} ${r.y} A ${n} ${n} 0 ${a} 1 ${i.x} ${i.y}`;
236
+ }
237
+ static angleOf(e, t) {
238
+ return Math.atan2(e, -t) * 180 / Math.PI;
239
+ }
240
+ static follow(e, t) {
241
+ let n = (t - e) % 360;
242
+ return n > 180 && (n -= 360), n < -180 && (n += 360), d(e + n, -ce, ce);
243
+ }
244
+ }, ce = 360;
245
+ function round(e) {
246
+ return Math.round(e * 1e3) / 1e3;
247
+ }
248
+ // src/components/ui-dial/UIDial.css?inline
249
+ var le = "@layer ui.components.dial.types{:host{vertical-align:top;display:inline-block}:host(:focus-visible){outline:none}.ui.dial{--_ui-dial-size:var(--ui-dial-size,round(10em, var(--ui-grid,4px)));--_ui-dial-track-width:var(--ui-dial-track-width,4.5);--_ui-dial-track-color:var(--ui-dial-track-color,oklch(from var(--ui-ink) l c h / .16));--_ui-dial-fill-color:var(--ui-dial-fill-color,var(--ui-primary));--_ui-dial-disc-color:var(--ui-dial-disc-color,oklch(from var(--ui-ink) l c h / .07));--_ui-dial-tick-color:var(--ui-dial-tick-color,oklch(from var(--ui-ink) l c h / .4));--_ui-dial-value-color:var(--ui-dial-value-color,var(--ui-text-color));--_ui-dial-value-font-size:var(--ui-dial-value-font-size,15cqi);--_ui-dial-value-font-weight:var(--ui-dial-value-font-weight,400);--_ui-dial-label-color:var(--ui-dial-label-color,var(--ui-text-color));--_ui-dial-label-gap:var(--ui-dial-label-gap,round(.75em, var(--ui-grid,4px)));--_ui-dial-focus-width:var(--ui-dial-focus-width,2);--_ui-dial-focus-color:var(--ui-dial-focus-color,var(--ui-focus-color));--_ui-dial-disabled-opacity:var(--ui-dial-disabled-opacity,.45);align-items:center;gap:var(--_ui-dial-label-gap);box-sizing:border-box;width:var(--_ui-dial-size);font-family:var(--ui-font-family);font-size:calc(var(--ui-font-size) * var(--ui-scale,1));flex-direction:column;line-height:1.25;display:flex}.ui.dial .control{aspect-ratio:1;touch-action:none;cursor:grab;-webkit-user-select:none;user-select:none;border-radius:50%;outline:none;place-items:center;width:100%;display:grid;position:relative;container-type:inline-size}.ui.dial .ring{width:100%;height:100%;position:absolute;inset:0;overflow:visible}.ui.dial .track,.ui.dial .track-fill{fill:none;stroke-width:var(--_ui-dial-track-width);stroke-linecap:round}.ui.dial .track{stroke:var(--_ui-dial-track-color)}.ui.dial .track-fill{stroke:var(--ui-color,var(--_ui-dial-fill-color))}.ui.dial .handle{fill:var(--ui-color,var(--_ui-dial-fill-color))}.ui.dial .disc{fill:var(--_ui-dial-disc-color)}.ui.dial .ticks{fill:var(--_ui-dial-tick-color)}.ui.dial .focus-ring{fill:none;stroke:var(--_ui-dial-focus-color);stroke-width:var(--_ui-dial-focus-width);visibility:hidden}.ui.dial .value{max-width:58%;color:var(--_ui-dial-value-color);font-size:var(--_ui-dial-value-font-size);font-weight:var(--_ui-dial-value-font-weight);font-variant-numeric:tabular-nums;text-align:center;text-overflow:ellipsis;white-space:nowrap;line-height:1;position:relative;overflow:hidden}.ui.dial .label{max-width:100%;line-height:round(1.25em, var(--ui-grid,4px));color:var(--_ui-dial-label-color);text-align:center}.ui.dial>input[type=range]{width:100%;accent-color:var(--ui-color,var(--_ui-dial-fill-color));margin:0}}@layer ui.components.dial.content,ui.components.dial.variations;@layer ui.components.dial.states{.ui.dial .control:focus-visible .focus-ring{visibility:visible}:host(:state(dragging)) .ui.dial .control{cursor:grabbing}.ui.read-only.dial .control{cursor:default}.ui.disabled.dial{opacity:var(--_ui-dial-disabled-opacity)}.ui.disabled.dial .control{cursor:default}}", ue = /* @__PURE__ */ M("<div aria-hidden=true>"), de = /* @__PURE__ */ M("<div><div role=slider><span aria-hidden=true></span></div><!><!>"), fe = /* @__PURE__ */ M("<svg><g></svg>", 2), pe = /* @__PURE__ */ M("<svg viewBox=\"0 0 100 100\"aria-hidden=true><path></path><path></path><circle></circle><circle></circle><circle>"), me = /* @__PURE__ */ M("<svg><circle></svg>", 2), he = /* @__PURE__ */ M("<input type=hidden>"), ge, _e, ve, R, z, B, V, H, U, W, G, K, q, ye, be, J, Y, X, Z, Q = class _UIDial extends (J = x, be = [h], ye = [g], q = [f("value")], K = [m], G = [y], W = [m], U = [p("dragging"), v], H = [y], V = [y], B = [y], z = [y], R = [y], ve = [y], _e = [y], ge = [y], J) {
250
+ constructor() {
251
+ super(...arguments), l(Y, 5, this), r(this, "control"), _(this, X, l(Y, 8, this)), l(Y, 11, this), _(this, Z, l(Y, 12, this, !1)), l(Y, 15, this), r(this, "dragAngle"), r(this, "valueAtDragStart"), r(this, "onPointerDown", l(Y, 24, this, /* @__PURE__ */ i((e) => {
252
+ if (e.button !== 0 || !this.isInteractive || !this.control) return;
253
+ e.preventDefault(), this.control.focus();
254
+ let { angle: t, distance: n } = this.pointerAt(e);
255
+ n < Ae || (this.capture(e.pointerId), this.valueAtDragStart = this.snappedValue, this.isDragging = !0, this.dragAngle = d(t, -180, 180), this.turnTo(this.valueAtAngle(this.dragAngle), e));
256
+ }, "onPointerDown"))), l(Y, 27, this), r(this, "onPointerMove", l(Y, 28, this, /* @__PURE__ */ i((e) => {
257
+ this.dragAngle !== void 0 && (this.dragAngle = L.follow(this.dragAngle, this.pointerAt(e).angle), this.turnTo(this.valueAtAngle(this.dragAngle), e));
258
+ }, "onPointerMove"))), l(Y, 31, this), r(this, "onPointerUp", l(Y, 32, this, /* @__PURE__ */ i((e) => {
259
+ if (this.dragAngle === void 0) return;
260
+ this.dragAngle = void 0, this.isDragging = !1, this.control?.hasPointerCapture(e.pointerId) && this.control.releasePointerCapture(e.pointerId);
261
+ let t = this.valueAtDragStart;
262
+ this.valueAtDragStart = void 0, u(() => {
263
+ this.snappedValue !== t && this.send("ui-changed", {
264
+ value: this.snappedValue,
265
+ originalEvent: e
266
+ });
267
+ });
268
+ }, "onPointerUp"))), l(Y, 35, this), r(this, "onWheel", l(Y, 36, this, /* @__PURE__ */ i((e) => {
269
+ this.control?.matches(":focus") && e.deltaY && (e.preventDefault(), this.isInteractive && this.commit(this.scale.move(this.snappedValue, e.deltaY < 0 ? 1 : -1), e));
270
+ }, "onWheel"))), l(Y, 39, this), r(this, "onKeyDown", l(Y, 40, this, /* @__PURE__ */ i((e) => {
271
+ let t = this.scale.valueForKey(e.key, this.snappedValue);
272
+ t !== void 0 && (e.preventDefault(), this.isInteractive && this.commit(t, e));
273
+ }, "onKeyDown"))), l(Y, 43, this);
274
+ }
275
+ get scale() {
276
+ return new S({
277
+ min: this.min ?? 0,
278
+ max: this.max ?? 100,
279
+ step: this.step ?? 1
280
+ });
281
+ }
282
+ get snappedValue() {
283
+ let e = this.scale;
284
+ return e.snap(Number(this.value ?? e.min));
285
+ }
286
+ valueText(e) {
287
+ return o.i18n.formatNumber(e) + (this.unit ?? "");
288
+ }
289
+ turnTo(e, t) {
290
+ let n = this.scale.snap(e);
291
+ return n !== this.snappedValue && this.requestChange("value", n, () => this.send("ui-moved", {
292
+ value: n,
293
+ originalEvent: t
294
+ }));
295
+ }
296
+ get isInteractive() {
297
+ return !this.isDisabled && !this.readonly;
298
+ }
299
+ get formValue() {
300
+ return String(this.snappedValue);
301
+ }
302
+ get validationValue() {
303
+ return this.value === void 0 ? void 0 : this.formValue;
304
+ }
305
+ onFormReset() {
306
+ this.value = t.number(this.attributes.value);
307
+ }
308
+ onFormStateRestore(e) {
309
+ let t = e instanceof FormData ? [...e.values()].map(String)[0] : e;
310
+ typeof t == "string" && (this.value = Number(t));
311
+ }
312
+ get tickGaps() {
313
+ let e = this.attributes.ticks;
314
+ if (e == null || we.test(e)) return 0;
315
+ let t = Math.round(Number(e));
316
+ return e.trim() === "" || Ce.test(e) ? Se : Number.isFinite(t) ? Math.max(0, t) : 0;
317
+ }
318
+ get ratio() {
319
+ return this.scale.ratio(this.snappedValue);
320
+ }
321
+ render() {
322
+ let e = this;
323
+ var t = de(), n = t.firstChild, r = n.firstChild, i = n.nextSibling, a = i.nextSibling;
324
+ return T(n, "keydown", e.onKeyDown, !0), T(n, "pointercancel", e.onPointerUp), T(n, "pointerup", e.onPointerUp, !0), T(n, "pointermove", e.onPointerMove, !0), T(n, "pointerdown", e.onPointerDown, !0), ne(() => (t) => e.attach(t), n), k(n, () => e.drawing(), r), k(r, () => e.valueText(e.snappedValue)), k(t, D(w, {
325
+ get when() {
326
+ return e.label;
327
+ },
328
+ get children() {
329
+ var t = ue();
330
+ return k(t, () => e.label), O(() => ({
331
+ e: A(Be),
332
+ t: e.partForName("label")
333
+ }), ({ e, t: n }, r) => {
334
+ E(t, e, r?.e), n !== r?.t && j(t, "part", n);
335
+ }), t;
336
+ }
337
+ }), i), k(t, () => te && e.staticValue(), a), O(() => ({
338
+ e: A(e.rootClass),
339
+ t: e.partForName("dial"),
340
+ a: A(je),
341
+ o: e.partForName("control"),
342
+ i: e.isDisabled ? void 0 : 0,
343
+ n: e.scale.min,
344
+ s: e.scale.max,
345
+ h: e.snappedValue,
346
+ r: e.valueText(e.snappedValue),
347
+ d: e.labels.accessibleName ?? e.label ?? void 0,
348
+ l: e.isDisabled ? "true" : void 0,
349
+ u: e.readonly ? "true" : void 0,
350
+ c: A(ze),
351
+ w: e.partForName("value")
352
+ }), ({ e, t: i, a, o, i: s, n: c, s: l, h: u, r: d, d: f, l: p, u: m, c: h, w: g }, _) => {
353
+ E(t, e, _?.e), i !== _?.t && j(t, "part", i), E(n, a, _?.a), o !== _?.o && j(n, "part", o), s !== _?.i && j(n, "tabindex", s), c !== _?.n && j(n, "aria-valuemin", c), l !== _?.s && j(n, "aria-valuemax", l), u !== _?.h && j(n, "aria-valuenow", u), d !== _?.r && j(n, "aria-valuetext", d), f !== _?.d && j(n, "aria-label", f), p !== _?.l && j(n, "aria-disabled", p), m !== _?.u && j(n, "aria-readonly", m), E(r, h, _?.c), g !== _?.w && j(r, "part", g);
354
+ }), t;
355
+ }
356
+ drawing() {
357
+ let e = /* @__PURE__ */ i(() => L.pointAt(this.ratio, $), "handle"), t = this;
358
+ var n = pe(), r = n.firstChild, a = r.nextSibling, o = a.nextSibling, s = o.nextSibling, c = s.nextSibling;
359
+ return j(o, "r", De), k(n, D(w, {
360
+ get when() {
361
+ return t.tickGaps;
362
+ },
363
+ get children() {
364
+ var e = fe();
365
+ return k(e, D(C, {
366
+ get each() {
367
+ return t.tickRatios;
368
+ },
369
+ keyed: !1,
370
+ children: (e) => (() => {
371
+ var t = me();
372
+ return j(t, "r", ke), O(() => ({
373
+ e: L.pointAt(e(), Oe).x,
374
+ t: L.pointAt(e(), Oe).y
375
+ }), ({ e, t: n }, r) => {
376
+ e !== r?.e && j(t, "cx", e), n !== r?.t && j(t, "cy", n);
377
+ }), t;
378
+ })()
379
+ })), O(() => ({
380
+ e: A(Ie),
381
+ t: t.partForName("ticks")
382
+ }), ({ e: t, t: n }, r) => {
383
+ E(e, t, r?.e), n !== r?.t && j(e, "part", n);
384
+ }), e;
385
+ }
386
+ }), s), j(s, "r", Ee), j(c, "r", Te), O(() => ({
387
+ e: A(Me),
388
+ t: A(Ne),
389
+ a: t.partForName("track"),
390
+ o: L.path(0, 1, $),
391
+ i: A(Pe),
392
+ n: t.partForName("track-fill"),
393
+ s: L.path(0, t.ratio, $),
394
+ h: A(Fe),
395
+ r: t.partForName("disc"),
396
+ d: L.CENTRE,
397
+ l: L.CENTRE,
398
+ u: A(Le),
399
+ c: e().x,
400
+ w: e().y,
401
+ m: A(Re),
402
+ f: t.partForName("handle"),
403
+ y: e().x,
404
+ g: e().y
405
+ }), ({ e, t, a: i, o: l, i: u, n: d, s: f, h: p, r: m, d: h, l: g, u: _, c: v, w: y, m: b, f: x, y: S, g: C }, w) => {
406
+ E(n, e, w?.e), E(r, t, w?.t), i !== w?.a && j(r, "part", i), l !== w?.o && j(r, "d", l), E(a, u, w?.i), d !== w?.n && j(a, "part", d), f !== w?.s && j(a, "d", f), E(o, p, w?.h), m !== w?.r && j(o, "part", m), h !== w?.d && j(o, "cx", h), g !== w?.l && j(o, "cy", g), E(s, _, w?.u), v !== w?.c && j(s, "cx", v), y !== w?.w && j(s, "cy", y), E(c, b, w?.m), x !== w?.f && j(c, "part", x), S !== w?.y && j(c, "cx", S), C !== w?.g && j(c, "cy", C);
407
+ }), n;
408
+ }
409
+ get tickRatios() {
410
+ let e = this.tickGaps;
411
+ return Array.from({ length: e ? e + 1 : 0 }, (t, n) => n / e);
412
+ }
413
+ staticValue() {
414
+ let e = this.name;
415
+ if (!e) return;
416
+ let t = this;
417
+ var n = he();
418
+ return j(n, "name", e), O(() => ({
419
+ e: t.formValue,
420
+ t: t.isDisabled
421
+ }), ({ e, t }, r) => {
422
+ n.value = e ?? "", t !== r?.t && j(n, "disabled", t);
423
+ }), n;
424
+ }
425
+ attach(e) {
426
+ this.control = e, e.addEventListener("wheel", this.onWheel, { passive: !1 });
427
+ }
428
+ capture(e) {
429
+ try {
430
+ this.control?.setPointerCapture(e);
431
+ } catch {}
432
+ }
433
+ pointerAt(e) {
434
+ let t = this.control.getBoundingClientRect(), n = t.width / 100 || 1, r = (e.clientX - t.left) / n - L.CENTRE, i = (e.clientY - t.top) / n - L.CENTRE;
435
+ return {
436
+ angle: L.angleOf(r, i),
437
+ distance: Math.hypot(r, i)
438
+ };
439
+ }
440
+ valueAtAngle(e) {
441
+ return this.scale.valueAt(L.ratioAt(e));
442
+ }
443
+ commit(e, t) {
444
+ this.turnTo(e, t) && this.send("ui-changed", {
445
+ value: this.snappedValue,
446
+ originalEvent: t
447
+ });
448
+ }
449
+ activateControl() {
450
+ this.control?.focus();
451
+ }
452
+ };
453
+ Y = n(J), X = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), s(Y, 4, "value", q, Q, X), s(Y, 2, "scale", K, Q), s(Y, 1, "turnTo", G, Q), s(Y, 2, "tickRatios", W, Q), s(Y, 4, "isDragging", U, Q, Z), s(Y, 1, "pointerAt", R, Q), s(Y, 1, "valueAtAngle", ve, Q), s(Y, 1, "commit", ge, Q), s(Y, 13, "vocabulary", be, Q), s(Y, 13, "elementSetup", ye, Q), s(Y, 5, "onPointerDown", H, Q), s(Y, 5, "onPointerMove", V, Q), s(Y, 5, "onPointerUp", B, Q), s(Y, 5, "onWheel", z, Q), s(Y, 5, "onKeyDown", _e, Q), c(Y, Q), i(Q, "UIDial"), r(Q, "vocabulary", l(Y, 16, Q, re)), l(Y, 19, Q), r(Q, "elementSetup", l(Y, 20, Q, {
454
+ styleSheets: { dial: le },
455
+ Fallback: ae
456
+ })), l(Y, 23, Q);
457
+ var xe = Q, Se = 8, Ce = /^(true|yes)$/i, we = /^(false|no)$/i, $ = 43, Te = 7, Ee = 9.5, De = 31, Oe = 36, ke = 1, Ae = 12, je = "control", Me = "ring", Ne = "track", Pe = "track-fill", Fe = "disc", Ie = "ticks", Le = "focus-ring", Re = "handle", ze = "value", Be = "label";
458
+ // src/components/ui-dial/index.ts
459
+ ee([
460
+ "pointerdown",
461
+ "pointermove",
462
+ "pointerup",
463
+ "keydown"
464
+ ]), xe.define();
465
+ export { L as DialArc, xe as UIDial };
466
+
467
+ //# sourceMappingURL=ui-dial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-dial.js","names":["_vocabulary_dec","_a","_init","E.NativeFallback","E.proto","LABEL","__name","E.clamp","this","ref={(element) => this.attach(element)}","<div\n ref={(element) => this.attach(element)}\n class={CONTROL}\n part={this.partForName(\"control\")}\n role=\"slider\"\n tabindex={this.isDisabled ? void 0 : 0}\n aria-valuemin={this.scale.min}\n aria-valuemax={this.scale.max}\n aria-valuenow={this.snappedValue}\n aria-valuetext={this.valueText(this.snappedValue)}\n aria-label={this.labels.accessibleName ?? this.label ?? void 0}\n aria-disabled={this.isDisabled ? \"true\" : void 0}\n aria-readonly={this.readonly ? \"true\" : void 0}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n onKeyDown={this.onKeyDown}\n >\n {this.drawing()}\n <span class={VALUE} part={this.partForName(\"value\")} aria-hidden=\"true\">\n {this.valueText(this.snappedValue)}\n </span>\n </div>","<Show when={this.label}>\n <div class={LABEL} part={this.partForName(\"label\")} aria-hidden=\"true\">\n {this.label}\n </div>\n </Show>","part={this.partForName(\"label\")}","<div class={LABEL} part={this.partForName(\"label\")} aria-hidden=\"true\">\n {this.label}\n </div>","<div class={this.rootClass} part={this.partForName(\"dial\")}>\n <div\n ref={(element) => this.attach(element)}\n class={CONTROL}\n part={this.partForName(\"control\")}\n role=\"slider\"\n tabindex={this.isDisabled ? void 0 : 0}\n aria-valuemin={this.scale.min}\n aria-valuemax={this.scale.max}\n aria-valuenow={this.snappedValue}\n aria-valuetext={this.valueText(this.snappedValue)}\n aria-label={this.labels.accessibleName ?? this.label ?? void 0}\n aria-disabled={this.isDisabled ? \"true\" : void 0}\n aria-readonly={this.readonly ? \"true\" : void 0}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n onKeyDown={this.onKeyDown}\n >\n {this.drawing()}\n <span class={VALUE} part={this.partForName(\"value\")} aria-hidden=\"true\">\n {this.valueText(this.snappedValue)}\n </span>\n </div>\n <Show when={this.label}>\n <div class={LABEL} part={this.partForName(\"label\")} aria-hidden=\"true\">\n {this.label}\n </div>\n </Show>\n {isServer && this.staticValue()}\n </div>","part={this.partForName(\"dial\")}","class={CONTROL}","part={this.partForName(\"control\")}","tabindex={this.isDisabled ? void 0 : 0}","aria-valuemin={this.scale.min}","aria-valuemax={this.scale.max}","aria-valuenow={this.snappedValue}","aria-valuetext={this.valueText(this.snappedValue)}","aria-label={this.labels.accessibleName ?? this.label ?? void 0}","aria-disabled={this.isDisabled ? \"true\" : void 0}","aria-readonly={this.readonly ? \"true\" : void 0}","class={VALUE}","part={this.partForName(\"value\")}","<Show when={this.tickGaps}>\n <g class={TICKS} part={this.partForName(\"ticks\")}>\n <For each={this.tickRatios} keyed={false}>\n {(ratio) => <circle\n cx={DialArc.pointAt(ratio(), TICK_RADIUS).x}\n cy={DialArc.pointAt(ratio(), TICK_RADIUS).y}\n r={TICK_DOT_RADIUS}\n />}\n </For>\n </g>\n </Show>","<For each={this.tickRatios} keyed={false}>\n {(ratio) => <circle\n cx={DialArc.pointAt(ratio(), TICK_RADIUS).x}\n cy={DialArc.pointAt(ratio(), TICK_RADIUS).y}\n r={TICK_DOT_RADIUS}\n />}\n </For>","keyed={false}","cy={DialArc.pointAt(ratio(), TICK_RADIUS).y}","part={this.partForName(\"ticks\")}","<g class={TICKS} part={this.partForName(\"ticks\")}>\n <For each={this.tickRatios} keyed={false}>\n {(ratio) => <circle\n cx={DialArc.pointAt(ratio(), TICK_RADIUS).x}\n cy={DialArc.pointAt(ratio(), TICK_RADIUS).y}\n r={TICK_DOT_RADIUS}\n />}\n </For>\n </g>","<svg class={RING} viewBox=\"0 0 100 100\" aria-hidden=\"true\">\n <path class={TRACK} part={this.partForName(\"track\")} d={DialArc.path(0, 1, TRACK_RADIUS)} />\n <path class={TRACK_FILL} part={this.partForName(\"track-fill\")} d={DialArc.path(0, this.ratio, TRACK_RADIUS)} />\n <circle class={DISC} part={this.partForName(\"disc\")} cx={DialArc.CENTRE} cy={DialArc.CENTRE} r={DISC_RADIUS} />\n <Show when={this.tickGaps}>\n <g class={TICKS} part={this.partForName(\"ticks\")}>\n <For each={this.tickRatios} keyed={false}>\n {(ratio) => <circle\n cx={DialArc.pointAt(ratio(), TICK_RADIUS).x}\n cy={DialArc.pointAt(ratio(), TICK_RADIUS).y}\n r={TICK_DOT_RADIUS}\n />}\n </For>\n </g>\n </Show>\n <circle class={FOCUS_RING} cx={handle().x} cy={handle().y} r={FOCUS_RING_RADIUS} />\n <circle class={HANDLE} part={this.partForName(\"handle\")} cx={handle().x} cy={handle().y} r={HANDLE_RADIUS} />\n </svg>","class={TRACK}","part={this.partForName(\"track\")}","d={DialArc.path(0, 1, TRACK_RADIUS)}","class={TRACK_FILL}","part={this.partForName(\"track-fill\")}","d={DialArc.path(0, this.ratio, TRACK_RADIUS)}","class={DISC}","part={this.partForName(\"disc\")}","cx={DialArc.CENTRE}","cy={DialArc.CENTRE}","class={FOCUS_RING}","cx={handle().x}","cy={handle().y}","class={HANDLE}","part={this.partForName(\"handle\")}","disabled={this.isDisabled}","<input type=\"hidden\" name={name} value={this.formValue} disabled={this.isDisabled} />","F.FormComponent","E.proto","E.protoMerged","E.controlled","E.derived","E.untracked","E.cssState","E.state","E.clamp","_$readShallow","_$setAttribute","__name","dialCSS","FormControlAttributes","__decoratorStart","__publicField","__name$1","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","FormControlStates","SliderScale","dialVocabulary","_degraded_dec","_vocabulary_dec$1","_a$1","_init$1","_DialFallback","NativeFallback","proto","domElement","min","max","label","input","event","words","LABEL$1","ROOT_PART","name","value","fallback","DialFallback","DialArc","clamp","ratio","angle","radians","radius","to","from","start","end","isLarge","dx","dy","turn","previous","WOUND_LIMIT","UIDial_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_commit_dec","_onKeyDown_dec","_valueAtAngle_dec","_pointerAt_dec","_onWheel_dec","_onPointerUp_dec","_onPointerMove_dec","_onPointerDown_dec","_isDragging_dec","_tickRatios_dec","_turnTo_dec","_scale_dec","_value_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_value","_isDragging","_UIDial","FormComponent","protoMerged","controlled","derived","untracked","cssState","state","distance","DEAD_CENTRE","before","afterSolidUpdate","next","scale","UI","Converters","saved","ticks","OFF","gaps","ON","DEFAULT_TICK_GAPS","_self$","_el$","_el$2","_el$3","_el$5","_el$6","addEvent","ref","element","insert","createComponent","Show","_el$4","effect","readShallow","LABEL","className","_p$","t","setAttribute","isServer","CONTROL","VALUE","i","n","s","h","r","d","l","u","c","w","handle","TRACK_RADIUS","_self$2","_el$7","_el$8","_el$9","_el$10","_el$12","_el$13","DISC_RADIUS","_el$11","For","_el$14","TICK_DOT_RADIUS","TICK_RADIUS","TICKS","e","FOCUS_RING_RADIUS","HANDLE_RADIUS","RING","TRACK","TRACK_FILL","DISC","FOCUS_RING","HANDLE","a","o","m","f","y","g","index","_self$3","_el$15","control","id","box","UIDial","delegateEvents"],"sources":["../src/components/ui-dial/UIDial.en.ts","../src/components/ui-dial/UIDial.fallback.ts","../src/components/ui-dial/DialArc.ts","../src/components/ui-dial/UIDial.tsx","../src/components/ui-dial/index.ts"],"sourcesContent":["/**\n * Every name `<ui-dial>` uses: tag, attributes (kind + allowed values), events, parts, states.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`:\n * `<ui-dial size=\"small\" color=\"orange\" ticks readonly>` => `ui small orange ticked read-only dial`.\n * - `min` / `max` / `step` / `value` are a slider's: a dial is the same number line, bent round.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `<ui-dial>`\n * A dial: a round control that picks a number, by dragging its handle round an open ring.\n ****************/\nexport const dialVocabulary = {\n tag: \"ui-dial\",\n icon: \"gauge\",\n snippet: '<ui-dial label=\"Volume\"></ui-dial>',\n formControl: true,\n topics: [\"inputs\", \"forms\", \"controls\", \"modules\"],\n aka: [\"knob\", \"rotary knob\", \"radial slider\", \"circular slider\", \"gauge\", \"arc slider\"],\n skeleton: \"inline 10 x 11.5\",\n noun: \"dial\",\n partOfSpeech: \"action\",\n description: \"A dial lets people pick a number by turning it, with its value in the middle and its label under it.\",\n attributes: [\n {\n name: \"label\",\n group: \"name\",\n kind: \"string\",\n description:\n \"The words under the dial; also its name for screen readers, unless `aria-label` or a `<label for>` names it.\"\n },\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size of the whole dial, `mini` ... `massive`.\"\n },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Hue of the arc and the handle; uncoloured, the theme's primary colour.\"\n },\n {\n name: \"ticks\",\n group: \"appearance\",\n kind: \"string\",\n description:\n 'Dots round the inside of the ring: `ticks` alone draws 9 (8 gaps), `ticks=\"10\"` that many gaps. ' +\n \"Only a look: values still snap to `step`.\"\n },\n {\n name: \"unit\",\n group: \"appearance\",\n kind: \"string\",\n description: 'Written right after the number: `unit=\"%\"` shows `98%`, `unit=\" px\"` shows `16 px`.'\n },\n {\n name: \"disabled\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Can't be used: dimmed, not focusable, left out of the form.\"\n },\n {\n ...UIT.FormControlAttributes.readonly,\n description: \"Shows its value but can't be changed; still focusable and submitted.\"\n },\n { name: \"min\", group: \"form\", kind: \"number\", default: 0, description: \"Lowest value, at the ring's start.\" },\n { name: \"max\", group: \"form\", kind: \"number\", default: 100, description: \"Highest value, at the ring's end.\" },\n {\n name: \"step\",\n group: \"form\",\n kind: \"number\",\n default: 1,\n description: \"Values snap to multiples of it from `min`; `0`: any.\"\n },\n {\n name: \"value\",\n group: \"form\",\n kind: \"number\",\n reflect: false,\n description: \"The value, default `min`. Attribute: the starting (and reset) value; property: the live one.\"\n },\n UIT.FormControlAttributes.name,\n UIT.FormControlAttributes.parameter,\n {\n ...UIT.FormControlAttributes.required,\n description:\n \"Form validation: a value must be chosen, by the page (`value`) or by turning the dial. \" +\n \"Unset, the handle rests at `min` but counts as no value (`valueMissing`).\"\n }\n ],\n events: [\n {\n name: \"ui-moved\",\n detail: \"{ value: number, originalEvent?: Event }\",\n description: \"The handle moved (each drag step, key or wheel turn). A handler that re-sets `value` wins.\"\n },\n {\n name: \"ui-changed\",\n detail: \"{ value: number, originalEvent?: Event }\",\n description: \"A change was committed: on a key or wheel turn, or when a drag ends somewhere new.\"\n }\n ],\n slots: [],\n parts: [\n { name: \"dial\", description: \"The root box: the ring, then the label.\" },\n { name: \"control\", description: \"The round control itself (`role=slider`), which takes focus.\" },\n { name: \"track\", description: \"The empty ring.\" },\n { name: \"track-fill\", description: \"The coloured arc, from the start to the value.\" },\n { name: \"handle\", description: \"The round handle, at the arc's end.\" },\n { name: \"disc\", description: \"The disc in the middle.\" },\n { name: \"ticks\", description: \"The tick dots (`ticks`).\" },\n { name: \"value\", description: \"The value, written in the disc.\" },\n { name: \"label\", description: \"The words under the dial (`label`).\" }\n ],\n states: [\n { name: \"disabled\", description: \"Can't be used.\" },\n { name: \"dragging\", description: \"The handle is being dragged.\" },\n { ...UIT.FormControlStates.invalid, description: \"Fails validation (`required`), once a person has interacted.\" }\n ],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","import { E } from \"spell/ui/core\"\nimport { dialVocabulary } from \"./UIDial.en\"\nimport { DEFAULT_MAX, DEFAULT_MIN, DEFAULT_STEP } from \"./UIDial.types\"\n\n/****************\n * ### `DialFallback`\n * The native fallback of `<ui-dial>`: what it shows when its component breaks,\n * so the value is still chosen and submitted with the form.\n *\n * - Its shadow DOM: a native `<input type=\"range\" part=\"control\">` in the root\n * (`<div class=\"ui … dial\" part=\"dial\">`), then the `label`'s words.\n * - Still a form control. `input` / `change`:\n * - set the DOM element's form value\n * - set `domElement.value`\n * - send a composed `ui-moved` / `ui-changed`.\n * - Its starting value is the DOM element's `value` PROPERTY, else the attribute;\n * `min` / `max` / `step` default to 0 / 100 / 1, as the dial's.\n * - Named by the DOM element's `aria-*` (copied onto the input), else its `label`.\n ****************/\nexport class DialFallback extends E.NativeFallback<typeof dialVocabulary> {\n @E.proto static vocabulary = dialVocabulary\n @E.proto static degraded = [\n \"the ring, its arc, handle, disc and ticks (the browser's range input instead)\",\n \"the value written in the middle, `unit`, the wheel, vetoing by re-setting `value`, form reset\"\n ]\n\n /** The native input, once built, for `sync()`. */\n private input?: HTMLInputElement\n\n protected override build() {\n const domElement = this.domElement as DialDOMElement\n const min = this.number(\"min\", DEFAULT_MIN)\n const max = Math.max(min, this.number(\"max\", DEFAULT_MAX))\n const label = this.attr(\"label\") ?? undefined\n const input = this.create(\"input\", {\n type: \"range\",\n min: String(min),\n max: String(max),\n step: String(this.number(\"step\", DEFAULT_STEP) || \"any\"),\n disabled: this.flag(\"disabled\"),\n \"aria-readonly\": this.flag(\"readonly\") ? \"true\" : undefined\n })\n this.decorate(input, \"control\")\n if (label && !input.hasAttribute(\"aria-label\")) input.setAttribute(\"aria-label\", label)\n input.value = String(domElement.value ?? this.number(\"value\", min))\n this.listen(input, \"input\", (event) => this.changed(event, \"ui-moved\"))\n this.listen(input, \"change\", (event) => this.changed(event, \"ui-changed\"))\n this.listen(input, \"keydown\", (event: KeyboardEvent) => {\n if (this.flag(\"readonly\")) event.preventDefault()\n })\n this.listen(input, \"pointerdown\", (event) => {\n if (this.flag(\"readonly\")) event.preventDefault()\n })\n this.input = input\n const words = label ? [this.create(\"div\", { class: LABEL, part: LABEL, \"aria-hidden\": \"true\" }, label)] : []\n // the root takes no `aria-*`: the input carries the DOM element's name\n return [this.create(\"div\", { class: this.classes(), part: ROOT_PART }, input, ...words)]\n }\n\n /** The input moved: update the DOM element, send event `name`. */\n private changed(originalEvent: Event, name: E.EventName<typeof dialVocabulary>) {\n const domElement = this.domElement as DialDOMElement\n domElement.value = Number(this.input!.value)\n this.sync()\n this.send(name, { value: domElement.value, originalEvent })\n }\n\n /** The value; a range input is never invalid, so no validity. */\n protected override sync() {\n this.syncForm({ value: this.input?.value })\n }\n\n /** The DOM element's attribute `name` as a number, else `fallback`. */\n private number(name: E.AttributeNameOf<typeof dialVocabulary>, fallback: number): number {\n const value = Number(this.attr(name) ?? Number.NaN)\n return Number.isFinite(value) ? value : fallback\n }\n}\n\n/** What the fallback reads and writes of the DOM element: optional, the element may not have upgraded. */\ntype DialDOMElement = HTMLElement & {\n /** the value, once set as a property */\n value?: number\n}\n\n/** The root's part. */\nconst ROOT_PART = \"dial\"\n\n/** The label's class and part. */\nconst LABEL = \"label\"\n","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `DialArc`\n * The geometry of a dial's ring: an open circle of 270°, its gap at the bottom, drawn clockwise from bottom left.\n * - Angles are in degrees, clockwise from 12 o'clock: the ring runs `START` (-135°) ... `END` (135°).\n * - Lengths are in the dial's drawing units: a 100 by 100 box, centred on `CENTRE`.\n * - Pure arithmetic (no DOM; of the core, only `E.clamp()`), so it's tested on its own.\n * - The value maths (snapping, steps, keys) is `SliderScale`'s: a dial is a slider's number line, bent round.\n * - STATIC and instance-free on purpose: every dial has the same ring; only its ratio differs.\n ****************/\nexport class DialArc {\n /** Where the ring starts (`min`): bottom left. */\n static readonly START = -135\n\n /** How far round the ring runs. */\n static readonly SWEEP = 270\n\n /** Where the ring ends (`max`): bottom right. */\n static readonly END = DialArc.START + DialArc.SWEEP\n\n /** The centre of the drawing, both ways. */\n static readonly CENTRE = 50\n\n /** The angle at `ratio` (`0` ... `1`) along the ring. */\n static angleAt(ratio: number): number {\n return DialArc.START + DialArc.SWEEP * E.clamp(ratio, 0, 1)\n }\n\n /** Where along the ring (`0` ... `1`) `angle` lies; an angle in the gap goes to the nearer end. */\n static ratioAt(angle: number): number {\n return E.clamp((angle - DialArc.START) / DialArc.SWEEP, 0, 1)\n }\n\n /** The point at `ratio` along a circle of `radius` round the centre. */\n static pointAt(ratio: number, radius: number): { x: number; y: number } {\n const radians = (DialArc.angleAt(ratio) * Math.PI) / 180\n return {\n x: round(DialArc.CENTRE + radius * Math.sin(radians)),\n y: round(DialArc.CENTRE - radius * Math.cos(radians))\n }\n }\n\n /**\n * An SVG path along a circle of `radius`, from ratio `from` to `to`; `\"\"` when it would be empty.\n * - One arc command: the ring is never a full circle, so its ends never meet.\n */\n static path(from: number, to: number, radius: number): string {\n if (to <= from) return \"\"\n const start = DialArc.pointAt(from, radius)\n const end = DialArc.pointAt(to, radius)\n const isLarge = (to - from) * DialArc.SWEEP > 180 ? 1 : 0\n return `M ${start.x} ${start.y} A ${radius} ${radius} 0 ${isLarge} 1 ${end.x} ${end.y}`\n }\n\n /** The angle of the point `dx`, `dy` from the centre, `-180` ... `180` (screen axes: `dy` grows downward). */\n static angleOf(dx: number, dy: number): number {\n return (Math.atan2(dx, -dy) * 180) / Math.PI\n }\n\n /**\n * Follow a dragging pointer from `previous` to `angle` the short way round, winding on past the ring's ends:\n * so the value never jumps across the gap (`ratioAt()` holds a wound angle at the nearer end).\n * - A pointer dragged past `max`, on round the gap to the start, stays at `max` until it comes back.\n * - Held within half a turn past either end (`-360` ... `360`): winding further loses no more than that,\n * and the short way round from there still lands past the end, so it can't jump either.\n */\n static follow(previous: number, angle: number): number {\n let turn = (angle - previous) % 360\n if (turn > 180) turn -= 360\n if (turn < -180) turn += 360\n return E.clamp(previous + turn, -WOUND_LIMIT, WOUND_LIMIT)\n }\n}\n\n/** How far past 12 o'clock a dragged angle may wind, either way: half a turn past either end of the gap. */\nconst WOUND_LIMIT = 360\n\n/** `value` to 3 decimals: short path data, the same on every browser. */\nfunction round(value: number): number {\n return Math.round(value * 1000) / 1000\n}\n","import { For, Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\nimport { SliderScale } from \"spell/ui/components/ui-slider/SliderScale\"\nimport { dialVocabulary } from \"./UIDial.en\"\nimport { DialFallback } from \"./UIDial.fallback\"\nimport { DialArc } from \"./DialArc\"\nimport { DEFAULT_MAX, DEFAULT_MIN, DEFAULT_STEP } from \"./UIDial.types\"\n\nimport dialCSS from \"./UIDial.css?inline\"\n\n/****************\n * ### `UIDial`\n * The component behind `<ui-dial>`: a dial, to pick a number by turning a handle round an open ring.\n *\n * - Its shadow DOM:\n * `<div class=\"ui … dial\" part=\"dial\">` around the control (`part=\"control\"`, `role=slider`) and, with `label`,\n * the words under it (`part=\"label\"`).\n * - The control holds an SVG drawing (the ring, its coloured arc, the disc, the tick dots, the handle)\n * and the value, written over the disc in the page's font.\n * - The drawing is a 100 by 100 box; its geometry is `DialArc`'s, the ring 270° with its gap at the bottom.\n *\n * - The control is an APG slider (`role=slider`, `aria-value*`): it takes focus, and draws its focus ring round\n * the handle.\n * - Named by `aria-label`, a `<label for>` (`labels`), else by its own `label`.\n * - `aria-valuetext` is the value as shown, `unit` included.\n *\n * - Keys (on the control), as `<ui-slider>`'s (`SliderScale.valueForKey()`):\n * - Right / Up step up, Left / Down step down\n * - PageUp / PageDown take 2 steps\n * - Home / End go to `min` / `max`\n * - each key sends `ui-moved`, then `ui-changed`.\n * - Wheel: only while the control has focus (so the page still scrolls past it), a step a notch.\n * - Pointer: pressing the ring moves the handle there, and dragging turns it (pointer capture).\n * - The drag follows the pointer round, never across the gap: `DialArc.follow()`.\n * - A press on the disc's middle only focuses it: its angle means nothing there.\n * - `ui-moved` for each new value, `ui-changed` once when the drag ends somewhere new.\n *\n * - `value` is controlled (`@controlled`): a `ui-moved` handler that sets it again wins.\n * The ATTRIBUTE is the starting (and reset) value.\n * - The value maths is `<ui-slider>`'s `SliderScale`: a dial is a slider's number line, bent round.\n * - A form control: it submits `value`, restores a saved state, and takes `required` as a slider does.\n ****************/\nexport class UIDial extends F.FormComponent<typeof dialVocabulary> {\n @E.proto static vocabulary = dialVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { dial: dialCSS },\n Fallback: DialFallback\n } satisfies Partial<E.ElementSetup>\n\n /** The control: the drawing and the value, `role=slider`. */\n private control?: HTMLElement\n\n ////////////////\n // ## Value\n ////////////////\n\n /** `value`: set by the page, or turned; `min` until either. */\n @E.controlled(\"value\") accessor value: number | undefined = undefined\n\n /** The number line. */\n @E.derived\n get scale(): SliderScale {\n return new SliderScale({\n min: this.min ?? DEFAULT_MIN,\n max: this.max ?? DEFAULT_MAX,\n step: this.step ?? DEFAULT_STEP\n })\n }\n\n /** The value, snapped. */\n get snappedValue(): number {\n const scale = this.scale\n return scale.snap(Number(this.value ?? scale.min))\n }\n\n /** Text for `value`: the number in the page's format, then `unit`. */\n valueText(value: number): string {\n return UI.i18n.formatNumber(value) + (this.unit ?? \"\")\n }\n\n /**\n * Turn the dial to `value` as a person would: send `ui-moved`, then set the DOM element's property,\n * unless a handler set it first.\n * - Returns true when the value changed.\n */\n @E.untracked\n private turnTo(value: number, originalEvent: Event): boolean {\n const next = this.scale.snap(value)\n if (next === this.snappedValue) return false\n return this.requestChange(\"value\", next, () => this.send(\"ui-moved\", { value: next, originalEvent }))\n }\n\n ////////////////\n // ## Disabled\n ////////////////\n\n /** Can a person change it? */\n get isInteractive(): boolean {\n return !this.isDisabled && !this.readonly\n }\n\n ////////////////\n // ## Form\n ////////////////\n\n get formValue(): E.FieldValue {\n return String(this.snappedValue)\n }\n\n /**\n * Empty while no value was ever set: `required` then fails.\n * - The handle resting at `min` is a default, not a choice; `formValue` still submits it.\n */\n protected get validationValue(): E.FieldValue {\n return this.value === undefined ? undefined : this.formValue\n }\n\n /** Back to the `value` ATTRIBUTE. */\n onFormReset() {\n this.value = E.Converters.number(this.attributes.value)\n }\n\n /** A saved state: its value. `null`: DOM API `formStateRestoreCallback()`'s. */\n onFormStateRestore(state: File | string | FormData | null) {\n const saved = state instanceof FormData ? [...state.values()].map(String)[0] : state\n if (typeof saved === \"string\") this.value = Number(saved)\n }\n\n ////////////////\n // ## Ticks\n ////////////////\n\n /**\n * Number of gaps between tick dots: `0` for none.\n * - `ticks` alone (or `true` / `yes`): `DEFAULT_TICK_GAPS`; a number: that many; `false` / `no`: none.\n */\n get tickGaps(): number {\n const ticks = this.attributes.ticks\n if (ticks === null || ticks === undefined || OFF.test(ticks)) return 0\n const gaps = Math.round(Number(ticks))\n return ticks.trim() === \"\" || ON.test(ticks) ? DEFAULT_TICK_GAPS : Number.isFinite(gaps) ? Math.max(0, gaps) : 0\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** Where the handle is drawn, `0` ... `1` along the ring. */\n get ratio(): number {\n return this.scale.ratio(this.snappedValue)\n }\n\n render(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"dial\")}>\n <div\n ref={(element) => this.attach(element)}\n class={CONTROL}\n part={this.partForName(\"control\")}\n role=\"slider\"\n tabindex={this.isDisabled ? undefined : 0}\n aria-valuemin={this.scale.min}\n aria-valuemax={this.scale.max}\n aria-valuenow={this.snappedValue}\n aria-valuetext={this.valueText(this.snappedValue)}\n aria-label={this.labels.accessibleName ?? this.label ?? undefined}\n aria-disabled={this.isDisabled ? \"true\" : undefined}\n aria-readonly={this.readonly ? \"true\" : undefined}\n onPointerDown={this.onPointerDown}\n onPointerMove={this.onPointerMove}\n onPointerUp={this.onPointerUp}\n onPointerCancel={this.onPointerUp}\n onKeyDown={this.onKeyDown}\n >\n {this.drawing()}\n <span class={VALUE} part={this.partForName(\"value\")} aria-hidden=\"true\">\n {this.valueText(this.snappedValue)}\n </span>\n </div>\n <Show when={this.label}>\n <div class={LABEL} part={this.partForName(\"label\")} aria-hidden=\"true\">\n {this.label}\n </div>\n </Show>\n {isServer && this.staticValue()}\n </div>\n )\n }\n\n /** The SVG drawing: ring, arc, disc, ticks, focus ring, handle. */\n private drawing(): JSX.Element {\n const handle = () => DialArc.pointAt(this.ratio, TRACK_RADIUS)\n return (\n <svg class={RING} viewBox=\"0 0 100 100\" aria-hidden=\"true\">\n <path class={TRACK} part={this.partForName(\"track\")} d={DialArc.path(0, 1, TRACK_RADIUS)} />\n <path class={TRACK_FILL} part={this.partForName(\"track-fill\")} d={DialArc.path(0, this.ratio, TRACK_RADIUS)} />\n <circle class={DISC} part={this.partForName(\"disc\")} cx={DialArc.CENTRE} cy={DialArc.CENTRE} r={DISC_RADIUS} />\n <Show when={this.tickGaps}>\n <g class={TICKS} part={this.partForName(\"ticks\")}>\n <For each={this.tickRatios} keyed={false}>\n {(ratio) => (\n <circle\n cx={DialArc.pointAt(ratio(), TICK_RADIUS).x}\n cy={DialArc.pointAt(ratio(), TICK_RADIUS).y}\n r={TICK_DOT_RADIUS}\n />\n )}\n </For>\n </g>\n </Show>\n <circle class={FOCUS_RING} cx={handle().x} cy={handle().y} r={FOCUS_RING_RADIUS} />\n <circle class={HANDLE} part={this.partForName(\"handle\")} cx={handle().x} cy={handle().y} r={HANDLE_RADIUS} />\n </svg>\n )\n }\n\n /** The ratio of each tick dot, both ends included. */\n @E.derived\n private get tickRatios(): number[] {\n const gaps = this.tickGaps\n return Array.from({ length: gaps ? gaps + 1 : 0 }, (_, index) => index / gaps)\n }\n\n /**\n * Server render only (`spell/ui/static`): the value as a hidden input, so a static form submits it without script.\n * - In a browser the DOM element submits (`ElementInternals`).\n */\n private staticValue(): JSX.Element {\n const name = this.name\n if (!name) return undefined\n return <input type=\"hidden\" name={name} value={this.formValue as string} disabled={this.isDisabled} />\n }\n\n ////////////////\n // ## Turning: pointer and wheel\n ////////////////\n\n /** The handle is being dragged. */\n @E.cssState(\"dragging\")\n @E.state\n accessor isDragging = false\n\n /** The dragged angle, wound on past the ring's ends (`DialArc.follow()`); `undefined` between drags. */\n private dragAngle?: number\n\n /** The value when the current drag began, to tell whether it changed anything. */\n private valueAtDragStart?: number\n\n /** Keep the control, and listen for the wheel on it: not passive, so a turn can stop the page scrolling. */\n private attach(control: HTMLElement) {\n this.control = control\n control.addEventListener(\"wheel\", this.onWheel, { passive: false })\n }\n\n /** Press: on the ring, the handle jumps there and is dragged; on the disc's middle, only focus. */\n @E.untracked\n private readonly onPointerDown = (event: PointerEvent) => {\n if (event.button !== 0 || !this.isInteractive || !this.control) return\n event.preventDefault()\n this.control.focus()\n const { angle, distance } = this.pointerAt(event)\n if (distance < DEAD_CENTRE) return\n this.capture(event.pointerId)\n this.valueAtDragStart = this.snappedValue\n this.isDragging = true\n this.dragAngle = E.clamp(angle, -180, 180)\n this.turnTo(this.valueAtAngle(this.dragAngle), event)\n }\n\n /** Drag: follow the pointer round. */\n @E.untracked\n private readonly onPointerMove = (event: PointerEvent) => {\n if (this.dragAngle === undefined) return\n this.dragAngle = DialArc.follow(this.dragAngle, this.pointerAt(event).angle)\n this.turnTo(this.valueAtAngle(this.dragAngle), event)\n }\n\n /** Release: `ui-changed` when the drag moved anything. */\n @E.untracked\n private readonly onPointerUp = (event: PointerEvent) => {\n if (this.dragAngle === undefined) return\n this.dragAngle = undefined\n this.isDragging = false\n if (this.control?.hasPointerCapture(event.pointerId)) this.control.releasePointerCapture(event.pointerId)\n const before = this.valueAtDragStart\n this.valueAtDragStart = undefined\n E.afterSolidUpdate(() => {\n if (this.snappedValue !== before) this.send(\"ui-changed\", { value: this.snappedValue, originalEvent: event })\n })\n }\n\n /** Wheel, while focused: a step a notch (up turns up); else the page scrolls as usual. */\n @E.untracked\n private readonly onWheel = (event: WheelEvent) => {\n if (!this.control?.matches(\":focus\") || !event.deltaY) return\n event.preventDefault()\n if (!this.isInteractive) return\n this.commit(this.scale.move(this.snappedValue, event.deltaY < 0 ? 1 : -1), event)\n }\n\n /**\n * Route pointer `id`'s moves to the control until release.\n * - A pointer with no pressed button (a synthetic event) can't be captured: moves then only arrive while over it.\n */\n private capture(id: number) {\n try {\n this.control?.setPointerCapture(id)\n } catch {\n // not an active pointer\n }\n }\n\n /** The pointer's angle round the drawing's centre, and its distance from it in drawing units. */\n @E.untracked\n private pointerAt(event: PointerEvent): { angle: number; distance: number } {\n const box = this.control!.getBoundingClientRect()\n const scale = box.width / 100 || 1\n const dx = (event.clientX - box.left) / scale - DialArc.CENTRE\n const dy = (event.clientY - box.top) / scale - DialArc.CENTRE\n return { angle: DialArc.angleOf(dx, dy), distance: Math.hypot(dx, dy) }\n }\n\n /** The snapped value at `angle` round the ring. */\n @E.untracked\n private valueAtAngle(angle: number): number {\n return this.scale.valueAt(DialArc.ratioAt(angle))\n }\n\n ////////////////\n // ## Keys and clicks\n ////////////////\n\n /** Keys on the control, see the class doc. */\n @E.untracked\n private readonly onKeyDown = (event: KeyboardEvent) => {\n const next = this.scale.valueForKey(event.key, this.snappedValue)\n if (next === undefined) return\n event.preventDefault()\n if (!this.isInteractive) return\n this.commit(next, event)\n }\n\n /** Turn to `value` and, when it moved, send `ui-changed` at once: a key or a wheel notch is a whole change. */\n @E.untracked\n private commit(value: number, event: Event) {\n if (this.turnTo(value, event)) this.send(\"ui-changed\", { value: this.snappedValue, originalEvent: event })\n }\n\n /** A click aimed at the DOM element itself (its `<label for>`) focuses the control. */\n protected activateControl() {\n this.control?.focus()\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIDial extends E.AttributeValues<typeof dialVocabulary> {}\n\n/** Gaps between tick dots for a bare `ticks`: a dot every eighth of the ring, 9 in all. */\nconst DEFAULT_TICK_GAPS = 8\n\n/** `ticks` values that turn them on, as the shared booleans read. */\nconst ON = /^(true|yes)$/i\n\n/** `ticks` values that turn them off. */\nconst OFF = /^(false|no)$/i\n\n////////////////\n// ## The drawing, in its 100 by 100 units\n////////////////\n\n/** The ring's middle line: the handle (`HANDLE_RADIUS`) just fits inside the box at 3 and 9 o'clock. */\nconst TRACK_RADIUS = 43\n\n/** The handle. */\nconst HANDLE_RADIUS = 7\n\n/** The focus ring round the handle: a gap, then the ring's own width. */\nconst FOCUS_RING_RADIUS = HANDLE_RADIUS + 2.5\n\n/** The disc in the middle, under the value. */\nconst DISC_RADIUS = 31\n\n/** The circle the tick dots sit on: between the disc and the ring. */\nconst TICK_RADIUS = 36\n\n/** One tick dot. */\nconst TICK_DOT_RADIUS = 1\n\n/** A press nearer the centre than this only focuses: its angle is noise. */\nconst DEAD_CENTRE = 12\n\n////////////////\n// ## Class words\n////////////////\n\n/** Class of the control: the drawing and the value. */\nconst CONTROL = \"control\"\n\n/** Class of the SVG drawing. */\nconst RING = \"ring\"\n\n/** Class of the empty ring. */\nconst TRACK = \"track\"\n\n/** Class of the coloured arc. */\nconst TRACK_FILL = \"track-fill\"\n\n/** Class of the disc in the middle. */\nconst DISC = \"disc\"\n\n/** Class of the tick dots' group. */\nconst TICKS = \"ticks\"\n\n/** Class of the focus ring round the handle, shown on keyboard focus. */\nconst FOCUS_RING = \"focus-ring\"\n\n/** Class of the handle. */\nconst HANDLE = \"handle\"\n\n/** Class of the value, written over the disc. */\nconst VALUE = \"value\"\n\n/** Class of the words under the dial. */\nconst LABEL = \"label\"\n","/**\n * The dial family: defines `<ui-dial>`, and exports its component.\n * - Also the library's `spell/ui/ui-dial` entry.\n * - SIDE EFFECT: importing it defines the tag.\n * - NOTE: `DialArc` (the ring's geometry) is exported too; its value maths is the slider's `SliderScale`.\n */\n\nimport { UIDial } from \"./UIDial\"\nimport { DialArc } from \"./DialArc\"\n\nUIDial.define()\n\nexport { UIDial, DialArc }\n"],"mappings":";;;;;;;AAeA,IAAa2E,KAAiB;CAC5B,KAAK;CACL,MAAM;CACN,S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kB/D,EAAA,CAAA,GAApBJ,EAAAgE,GAAA,IADEG,CAAA,GAEIvE,EAFJuE,GAEW,gBAAenE,EAAtBgE,GAAA,IAFJG,GAE0B;CACnC,aAAa,EAAE,MAAM1E,GAAQ;CAC7B,UAAU+B;AACZ,CAAA,CAAA,GAHexB,EAAAgE,GAAA,IAFJG,CAAA;AAAN,IAAM4F,KAAN5F,GA4TDqB,KAAoB,GAGpBD,KAAK,iBAGLF,KAAM,iBAONsC,IAAe,IAGfiB,KAAgB,GAGhBD,KAAoB,KAGpBR,KAAc,IAGdK,KAAc,IAGdD,KAAkB,GAGlB3D,KAAc,IAOdkC,KAAU,WAGV+B,KAAO,QAGPC,KAAQ,SAGRC,KAAa,cAGbC,KAAO,QAGPP,KAAQ,SAGRQ,KAAa,cAGbC,KAAS,UAGTnC,KAAQ,SAGRP,KAAQ;;;;;;;A,IChaduD,GAAO,OAAO"}
package/dist/ui-graph.js CHANGED
@@ -666,6 +666,28 @@ var se = {
666
666
  text: "Loading …",
667
667
  description: "A node whose children are loading."
668
668
  }
669
+ ],
670
+ hooks: [
671
+ {
672
+ name: "nodeLabel",
673
+ words: "give the label of (a node)",
674
+ description: "A node's text; by default its `label`, else its id."
675
+ },
676
+ {
677
+ name: "nodeClass",
678
+ words: "give the class of (a node)",
679
+ description: "Extra class names on a node, for the subclass's own sheet."
680
+ },
681
+ {
682
+ name: "edgeLabel",
683
+ words: "give the label of (an edge)",
684
+ description: "An edge's text, at its middle; none: no text."
685
+ },
686
+ {
687
+ name: "edgeClass",
688
+ words: "give the class of (an edge)",
689
+ description: "Extra class names on an edge, for the subclass's own sheet."
690
+ }
669
691
  ]
670
692
  }, ce = "@layer ui.components.graph.types{:host{font-family:var(--ui-graph-font-family,var(--ui-font-family));display:block}.ui.graph,.ui.graph :is(.node,.edge-group,.port,.pin){--_ui-graph-height:var(--ui-graph-height,28em);--_ui-graph-background:var(--ui-graph-background,var(--ui-surface));--_ui-graph-border-color:var(--ui-graph-border-color,var(--ui-border-color));--_ui-graph-radius:var(--ui-graph-radius,var(--ui-radius-m));--_ui-graph-node-background:var(--ui-graph-node-background,var(--ui-surface-muted));--_ui-graph-node-border-color:var(--ui-graph-node-border-color,var(--ui-border-color-strong));--_ui-graph-container-background:var(--ui-graph-container-background,transparent);--_ui-graph-container-border-color:var(--ui-graph-container-border-color,var(--ui-border-color-strong));--_ui-graph-label-color:var(--ui-graph-label-color,var(--ui-text-color));--_ui-graph-port-color:var(--ui-graph-port-color,var(--ui-text-muted));--_ui-graph-edge-color:var(--ui-graph-edge-color,var(--ui-text-light));--_ui-graph-edge-label-color:var(--ui-graph-edge-label-color,var(--ui-text-muted));--_ui-graph-highlight-color:var(--ui-graph-highlight-color,var(--ui-primary));--_ui-graph-selected-color:var(--ui-graph-selected-color,var(--ui-orange,var(--ui-primary)))}.ui.graph{height:var(--_ui-graph-height);border:1px solid var(--_ui-graph-border-color);border-radius:var(--_ui-graph-radius);background:var(--_ui-graph-background);flex-direction:column;display:flex;position:relative;overflow:hidden}.breadcrumbs{border-bottom:1px solid var(--_ui-graph-border-color);flex:none;padding:.5em .75em;display:block}.breadcrumbs ui-breadcrumb:not([selected]){cursor:var(--ui-control-cursor,pointer)}.toolbar{z-index:1;gap:.25em;display:flex;position:absolute;bottom:.5em;right:.5em}.toolbar button{border:1px solid var(--_ui-graph-border-color);border-radius:var(--ui-radius-s,4px);background:var(--_ui-graph-background);color:var(--ui-text-color);font:inherit;cursor:var(--ui-control-cursor,pointer);padding:.25em .75em;font-size:.8125em}.toolbar button:hover{border-color:var(--_ui-graph-highlight-color)}.canvas{cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;flex:auto;width:100%;min-height:0;display:block}:host(:state(panning)) .canvas{cursor:grabbing}.modal-graph-box{padding:1em}}@layer ui.components.graph.content{.canvas{& .box{fill:var(--_ui-graph-node-background);stroke:var(--_ui-graph-node-border-color);stroke-width:1px;rx:4px}& .container>.box{fill:var(--_ui-graph-container-background);stroke:var(--_ui-graph-container-border-color);stroke-dasharray:4 3}& .label{fill:var(--_ui-graph-label-color);dominant-baseline:central}& .container>.label{font-weight:var(--ui-font-weight-semibold)}& .node{cursor:var(--ui-control-cursor,pointer)}& .loading>.label{fill:var(--_ui-graph-port-color)}& .port-dot{fill:var(--_ui-graph-background);stroke:var(--_ui-graph-port-color);stroke-width:1.25px}& .port-label{fill:var(--_ui-graph-port-color);dominant-baseline:central}& .pin-mark{fill:var(--_ui-graph-node-border-color)}& .edge{fill:none;stroke:var(--_ui-graph-edge-color);stroke-width:1.25px;pointer-events:none}& .edge-hit{fill:none;stroke:#0000;stroke-width:8px;cursor:var(--ui-control-cursor,pointer)}& .edge-label{fill:var(--_ui-graph-edge-label-color);paint-order:stroke;stroke:var(--_ui-graph-background);stroke-width:3px;pointer-events:none}& .toggle{cursor:var(--ui-control-cursor,pointer)}& .toggle-target{fill:#0000}& .toggle-circle{fill:var(--_ui-graph-edge-color)}& .toggle-mark{fill:none;stroke:var(--ui-text-inverted-color);stroke-width:1.5px;stroke-linecap:round}& .toggle:focus{outline:none}& .toggle:focus-visible .toggle-circle{fill:var(--_ui-graph-highlight-color)}}}@layer ui.components.graph.variations;@layer ui.components.graph.states{.canvas{& .node.lit>.box,& .node:hover>.box{stroke:var(--_ui-graph-highlight-color)}& .edge-group.lit .edge,& .edge-group:hover .edge{stroke:var(--_ui-graph-highlight-color);stroke-width:2.25px}& .port.lit .port-dot,& .port:hover .port-dot,& .pin.lit .pin-mark{fill:var(--_ui-graph-highlight-color);stroke:var(--_ui-graph-highlight-color)}& .node.selected>.box,& .edge-group.selected .edge{stroke:var(--_ui-graph-selected-color);stroke-width:2.5px}& .port.selected .port-dot{fill:var(--_ui-graph-selected-color);stroke:var(--_ui-graph-selected-color)}}}", le = /* @__PURE__ */ j("<svg><rect></svg>", 2), ue = /* @__PURE__ */ j("<svg><text></svg>", 2), de = /* @__PURE__ */ j("<div><div><button type=button></button></div><svg role=group><g><!><!><!><!></g></svg><ui-modal size=large closable><div>", 1), fe = /* @__PURE__ */ j("<ui-breadcrumbs divider=›>", 1), pe = /* @__PURE__ */ j("<ui-breadcrumb>", 1), me = /* @__PURE__ */ j("<svg><g><!><!><!><!></svg>", 2), he = /* @__PURE__ */ j("<title>"), ge = /* @__PURE__ */ j("<svg><g role=button tabindex=0><title></title><circle r=10></circle><circle r=6></circle><path></svg>", 2), _e = /* @__PURE__ */ j("<svg><g><circle></svg>", 2), ve = /* @__PURE__ */ j("<svg><g><path></path><text text-anchor=middle></svg>", 2), ye = /* @__PURE__ */ j("<svg><text text-anchor=middle></svg>", 2), be = /* @__PURE__ */ j("<svg><g><path></path><path></svg>", 2), F, I, L, R, xe, Se, Ce, we, z, Te, Ee, De, Oe, ke, Ae, je, Me, Ne, Pe, Fe, Ie, Le, Re, ze, Be, B, V, H, U, W, G, K, q, J, Y, DOMGraphElement = class extends e {
671
693
  static {