spell-ui 0.8.6 → 0.8.8

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 (722) hide show
  1. package/README-components.md +14 -6
  2. package/README-frameworks.md +22 -12
  3. package/README-migrating.md +7 -6
  4. package/README-runtime.md +14 -13
  5. package/README-site.md +11 -11
  6. package/README-themes.md +38 -11
  7. package/README.md +61 -73
  8. package/dist/Dragging-CMZoLEWQ.js +169 -0
  9. package/dist/Dragging-CMZoLEWQ.js.map +1 -0
  10. package/dist/{MarkdownEngine-CbuT9Mjc.js → MarkdownEngine-CW1WGqNp.js} +122 -100
  11. package/dist/MarkdownEngine-CW1WGqNp.js.map +1 -0
  12. package/dist/{PrefStore-CeaTtjTz.js → PrefStore-Qv0e5y04.js} +22 -22
  13. package/dist/PrefStore-Qv0e5y04.js.map +1 -0
  14. package/dist/ScrollingRow-7n7Z-HIE.js +88 -0
  15. package/dist/ScrollingRow-7n7Z-HIE.js.map +1 -0
  16. package/dist/SitePages-CciwREek.js +51 -0
  17. package/dist/SitePages-CciwREek.js.map +1 -0
  18. package/dist/{SlottedItems-Ch0tzzlL.js → SlottedItems-Du3aJwG1.js} +22 -22
  19. package/dist/{SlottedItems-Ch0tzzlL.js.map → SlottedItems-Du3aJwG1.js.map} +1 -1
  20. package/dist/ThemeDraft-B7NPif4d.js +805 -0
  21. package/dist/ThemeDraft-B7NPif4d.js.map +1 -0
  22. package/dist/TreeMeasure-BVJeGb1L.js +42 -0
  23. package/dist/TreeMeasure-BVJeGb1L.js.map +1 -0
  24. package/dist/UIButton-DFEds67r.js +6 -0
  25. package/dist/UIButton-DFEds67r.js.map +1 -0
  26. package/dist/UIInput-BodVbUoQ.js +6 -0
  27. package/dist/UIInput-BodVbUoQ.js.map +1 -0
  28. package/dist/{UIKeys-DJF2TIKE.js → UIKeys-Rh_gUZjP.js} +10 -9
  29. package/dist/UIKeys-Rh_gUZjP.js.map +1 -0
  30. package/dist/UILabel-DgJUBzB_.js +6 -0
  31. package/dist/UILabel-DgJUBzB_.js.map +1 -0
  32. package/dist/UIMenu-zdcAtwTa.js +42 -0
  33. package/dist/UIMenu-zdcAtwTa.js.map +1 -0
  34. package/dist/{UIRuntime-BBuehGly.js → UIRuntime-KH309p5B.js} +398 -207
  35. package/dist/UIRuntime-KH309p5B.js.map +1 -0
  36. package/dist/_spell-element/DOMElement.d.ts +62 -5
  37. package/dist/_spell-element/MoveAndResize.d.ts +75 -0
  38. package/dist/_spell-element/UIComponent.d.ts +42 -0
  39. package/dist/_spell-element/elements.types.d.ts +47 -0
  40. package/dist/_spell-element/index.d.ts +1 -0
  41. package/dist/_spell-element/vocabulary.types.d.ts +34 -2
  42. package/dist/{runtime → _util}/Api.d.ts +14 -4
  43. package/dist/_util/Dragging.d.ts +148 -0
  44. package/dist/_util/ListSelection.d.ts +46 -0
  45. package/dist/{util → _util}/LoadOnce.d.ts +9 -1
  46. package/dist/_util/ReconnectingSocket.d.ts +51 -0
  47. package/dist/_util/diagram/DiagramColumns.d.ts +14 -0
  48. package/dist/_util/diagram/DiagramLayout.d.ts +119 -0
  49. package/dist/_util/diagram/DiagramSVG.d.ts +17 -0
  50. package/dist/_util/dom.d.ts +10 -0
  51. package/dist/_util/fetching.d.ts +92 -0
  52. package/dist/_util/measures/Dimension.d.ts +63 -0
  53. package/dist/_util/measures/MeasureSystem.d.ts +66 -0
  54. package/dist/_util/measures/dimensions.generated.d.ts +16 -0
  55. package/dist/_util/persist/ColorScheme.d.ts +6 -0
  56. package/dist/_util/persist/ServerPlace.d.ts +42 -0
  57. package/dist/_util/persist/WaitedOnPlace.d.ts +27 -0
  58. package/dist/_util/persist/persist.types.d.ts +21 -2
  59. package/dist/_util/timing.d.ts +10 -1
  60. package/dist/api.js +8 -7
  61. package/dist/api.js.map +1 -1
  62. package/dist/components/ComponentDefinitions.d.ts +29 -0
  63. package/dist/components/components.es.d.ts +13 -0
  64. package/dist/components/components.types.d.ts +113 -8
  65. package/dist/components/ui-accordion/UIAccordion.d.ts +1 -0
  66. package/dist/components/ui-accordion/UIAccordion.en.d.ts +1 -0
  67. package/dist/components/ui-action/UIAction.en.d.ts +5 -1
  68. package/dist/components/ui-ad/UIAd.d.ts +1 -0
  69. package/dist/components/ui-ad/UIAd.en.d.ts +1 -0
  70. package/dist/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
  71. package/dist/components/ui-breadcrumbs/UIBreadcrumb.en.d.ts +1 -0
  72. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
  73. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.en.d.ts +1 -0
  74. package/dist/components/ui-button/UIButton.d.ts +8 -3
  75. package/dist/components/ui-button/UIButton.en.d.ts +9 -4
  76. package/dist/components/ui-button/UIButton.es.d.ts +6 -0
  77. package/dist/components/ui-button/UIButton.fallback.d.ts +8 -3
  78. package/dist/components/ui-button/UIButtons.d.ts +1 -0
  79. package/dist/components/ui-button/UIButtons.en.d.ts +1 -0
  80. package/dist/components/ui-button/UIOr.d.ts +1 -0
  81. package/dist/components/ui-button/UIOr.en.d.ts +1 -0
  82. package/dist/components/ui-calendar/UICalendar.d.ts +6 -0
  83. package/dist/components/ui-calendar/UICalendar.en.d.ts +6 -0
  84. package/dist/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
  85. package/dist/components/ui-card/CardClicks.d.ts +40 -0
  86. package/dist/components/ui-card/UICard.d.ts +41 -0
  87. package/dist/components/ui-card/UICard.en.d.ts +49 -0
  88. package/dist/components/ui-card/UICard.es.d.ts +1 -0
  89. package/dist/components/ui-card/UICards.d.ts +31 -0
  90. package/dist/components/ui-card/UICards.en.d.ts +31 -0
  91. package/dist/components/ui-card/UICards.es.d.ts +8 -0
  92. package/dist/components/ui-checkbox/CheckControl.d.ts +7 -0
  93. package/dist/components/ui-checkbox/UICheckbox.d.ts +7 -0
  94. package/dist/components/ui-checkbox/UICheckbox.en.d.ts +7 -0
  95. package/dist/components/ui-checkbox/UICheckbox.es.d.ts +1 -0
  96. package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
  97. package/dist/components/ui-checkbox/UICheckbox.types.d.ts +5 -0
  98. package/dist/components/ui-checkbox/UIRadio.d.ts +8 -0
  99. package/dist/components/ui-checkbox/UIRadio.en.d.ts +6 -0
  100. package/dist/components/ui-code/UICode.en.d.ts +1 -0
  101. package/dist/components/ui-comment/UIComment.d.ts +1 -0
  102. package/dist/components/ui-comment/UIComment.en.d.ts +1 -0
  103. package/dist/components/ui-comment/UIComments.d.ts +1 -0
  104. package/dist/components/ui-comment/UIComments.en.d.ts +1 -0
  105. package/dist/components/ui-components/PackHotSwap.d.ts +13 -3
  106. package/dist/components/ui-components/UIComponents.d.ts +1 -0
  107. package/dist/components/ui-components/UIComponents.en.d.ts +1 -0
  108. package/dist/components/ui-container/UIContainer.d.ts +11 -0
  109. package/dist/components/ui-container/UIContainer.en.d.ts +7 -0
  110. package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
  111. package/dist/components/ui-diagram/UIDiagram.d.ts +268 -0
  112. package/dist/components/ui-diagram/UIDiagram.en.d.ts +106 -0
  113. package/dist/components/ui-diagram/UIDiagram.es.d.ts +37 -0
  114. package/dist/components/ui-diagram/UIDiagramNode.d.ts +98 -0
  115. package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +38 -0
  116. package/dist/components/ui-diagram/UIDiagramNode.es.d.ts +16 -0
  117. package/dist/components/ui-diagram/index.d.ts +8 -0
  118. package/dist/components/ui-dimension/UIDimension.d.ts +81 -0
  119. package/dist/components/ui-dimension/UIDimension.en.d.ts +54 -0
  120. package/dist/components/ui-dimension/UIDimension.es.d.ts +22 -0
  121. package/dist/components/ui-dimension/index.d.ts +2 -0
  122. package/dist/components/ui-dimmer/UIDimmer.d.ts +6 -1
  123. package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
  124. package/dist/components/ui-dimmer/UIDimmer.es.d.ts +1 -1
  125. package/dist/components/ui-divider/UIDivider.d.ts +2 -0
  126. package/dist/components/ui-divider/UIDivider.en.d.ts +2 -0
  127. package/dist/components/ui-divider/UIDivider.es.d.ts +1 -0
  128. package/dist/components/ui-dropdown/UIDropdown.d.ts +6 -0
  129. package/dist/components/ui-dropdown/UIDropdown.en.d.ts +6 -0
  130. package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
  131. package/dist/components/ui-embed/UIEmbed.d.ts +1 -0
  132. package/dist/components/ui-embed/UIEmbed.en.d.ts +1 -0
  133. package/dist/components/ui-emoji/UIEmoji.d.ts +1 -0
  134. package/dist/components/ui-emoji/UIEmoji.en.d.ts +1 -0
  135. package/dist/components/ui-example/UIExample.en.d.ts +4 -2
  136. package/dist/components/ui-example/UIExample.es.d.ts +3 -2
  137. package/dist/components/ui-feed/UIFeed.d.ts +1 -0
  138. package/dist/components/ui-feed/UIFeed.en.d.ts +1 -0
  139. package/dist/components/ui-feed/UIFeedEvent.d.ts +1 -0
  140. package/dist/components/ui-feed/UIFeedEvent.en.d.ts +1 -0
  141. package/dist/components/ui-flag/UIFlag.d.ts +1 -0
  142. package/dist/components/ui-flag/UIFlag.en.d.ts +1 -0
  143. package/dist/components/ui-flyout/UIFlyout.d.ts +1 -0
  144. package/dist/components/ui-flyout/UIFlyout.en.d.ts +1 -0
  145. package/dist/components/ui-form/FormBinding.d.ts +13 -1
  146. package/dist/components/ui-form/FormFields.d.ts +4 -4
  147. package/dist/components/ui-form/UIField.d.ts +30 -3
  148. package/dist/components/ui-form/UIField.en.d.ts +9 -0
  149. package/dist/components/ui-form/UIField.es.d.ts +6 -0
  150. package/dist/components/ui-form/UIFields.d.ts +1 -0
  151. package/dist/components/ui-form/UIFields.en.d.ts +1 -0
  152. package/dist/components/ui-form/UIForm.d.ts +15 -0
  153. package/dist/components/ui-form/UIForm.en.d.ts +6 -0
  154. package/dist/components/ui-form/UIRepeat.d.ts +1 -0
  155. package/dist/components/ui-form/UIRepeat.en.d.ts +1 -0
  156. package/dist/components/ui-form/index.d.ts +2 -1
  157. package/dist/components/ui-grid/UIColumn.d.ts +1 -0
  158. package/dist/components/ui-grid/UIColumn.en.d.ts +1 -0
  159. package/dist/components/ui-grid/UIGrid.d.ts +1 -0
  160. package/dist/components/ui-grid/UIGrid.en.d.ts +1 -0
  161. package/dist/components/ui-grid/UIRow.d.ts +1 -0
  162. package/dist/components/ui-grid/UIRow.en.d.ts +1 -0
  163. package/dist/components/ui-icon/UIIcon.d.ts +3 -2
  164. package/dist/components/ui-icon/UIIcon.en.d.ts +3 -2
  165. package/dist/components/ui-icon/UIIcons.d.ts +1 -0
  166. package/dist/components/ui-icon/UIIcons.en.d.ts +1 -0
  167. package/dist/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
  168. package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +6 -0
  169. package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
  170. package/dist/components/ui-image/UIImage.d.ts +34 -0
  171. package/dist/components/ui-image/UIImage.en.d.ts +23 -0
  172. package/dist/components/ui-image/UIImage.es.d.ts +2 -0
  173. package/dist/components/ui-image/UIImages.d.ts +1 -0
  174. package/dist/components/ui-image/UIImages.en.d.ts +1 -0
  175. package/dist/components/ui-include/UIInclude.d.ts +1 -0
  176. package/dist/components/ui-include/UIInclude.en.d.ts +1 -0
  177. package/dist/components/ui-input/TextControl.d.ts +7 -0
  178. package/dist/components/ui-input/UIInput.d.ts +22 -3
  179. package/dist/components/ui-input/UIInput.en.d.ts +9 -2
  180. package/dist/components/ui-input/UIInput.es.d.ts +2 -0
  181. package/dist/components/ui-input/UIInput.fallback.d.ts +9 -2
  182. package/dist/components/ui-input/UITextarea.d.ts +20 -0
  183. package/dist/components/ui-input/UITextarea.en.d.ts +15 -0
  184. package/dist/components/ui-input/UITextarea.es.d.ts +4 -0
  185. package/dist/components/ui-item/UIItem.d.ts +27 -4
  186. package/dist/components/ui-item/UIItem.en.d.ts +5 -1
  187. package/dist/components/ui-items/UIItems.d.ts +1 -0
  188. package/dist/components/ui-items/UIItems.en.d.ts +1 -0
  189. package/dist/components/ui-json/JsonChild.d.ts +30 -0
  190. package/dist/components/ui-json/UIJson.d.ts +128 -0
  191. package/dist/components/ui-json/UIJson.en.d.ts +71 -0
  192. package/dist/components/ui-json/UIJson.es.d.ts +12 -0
  193. package/dist/components/ui-json/index.d.ts +3 -0
  194. package/dist/components/ui-keys/UIKeys.d.ts +1 -0
  195. package/dist/components/ui-keys/UIKeys.en.d.ts +1 -0
  196. package/dist/components/ui-label/UILabel.d.ts +2 -0
  197. package/dist/components/ui-label/UILabel.en.d.ts +2 -0
  198. package/dist/components/ui-label/UILabel.es.d.ts +1 -0
  199. package/dist/components/ui-label/UILabels.d.ts +1 -0
  200. package/dist/components/ui-label/UILabels.en.d.ts +1 -0
  201. package/dist/components/ui-list/UIList.d.ts +2 -0
  202. package/dist/components/ui-list/UIList.en.d.ts +2 -0
  203. package/dist/components/ui-list/UIList.es.d.ts +1 -0
  204. package/dist/components/ui-loader/UILoader.d.ts +1 -0
  205. package/dist/components/ui-loader/UILoader.en.d.ts +1 -0
  206. package/dist/components/ui-markdown/MarkdownBox.d.ts +143 -0
  207. package/dist/components/ui-markdown/MarkdownEngine.d.ts +14 -2
  208. package/dist/components/ui-markdown/MarkdownFormats.d.ts +95 -0
  209. package/dist/components/ui-markdown/MarkdownSource.d.ts +57 -0
  210. package/dist/components/ui-markdown/UIMarkdown.d.ts +126 -6
  211. package/dist/components/ui-markdown/UIMarkdown.en.d.ts +111 -8
  212. package/dist/components/ui-markdown/UIMarkdown.es.d.ts +29 -1
  213. package/dist/components/ui-markdown/UIMarkdown.types.d.ts +26 -0
  214. package/dist/components/ui-menu/ScrollingRow.d.ts +79 -0
  215. package/dist/components/ui-menu/TitleFit.d.ts +3 -0
  216. package/dist/components/ui-menu/UIMenu.d.ts +97 -4
  217. package/dist/components/ui-menu/UIMenu.en.d.ts +50 -1
  218. package/dist/components/ui-menu/UIMenu.es.d.ts +4 -0
  219. package/dist/components/ui-message/UIMessage.d.ts +2 -0
  220. package/dist/components/ui-message/UIMessage.en.d.ts +2 -0
  221. package/dist/components/ui-message/UIMessage.es.d.ts +1 -0
  222. package/dist/components/ui-modal/UIModal.d.ts +1 -0
  223. package/dist/components/ui-modal/UIModal.en.d.ts +1 -0
  224. package/dist/components/ui-nag/UINag.d.ts +1 -0
  225. package/dist/components/ui-nag/UINag.en.d.ts +1 -0
  226. package/dist/components/ui-page/UIPage.d.ts +15 -0
  227. package/dist/components/ui-page/UIPage.en.d.ts +15 -0
  228. package/dist/components/ui-page/UIPage.es.d.ts +1 -0
  229. package/dist/components/ui-panel/UIPanel.d.ts +6 -0
  230. package/dist/components/ui-panel/UIPanel.en.d.ts +33 -20
  231. package/dist/components/ui-parts/UIActions.d.ts +1 -0
  232. package/dist/components/ui-parts/UIActions.en.d.ts +1 -0
  233. package/dist/components/ui-parts/UIAuthor.d.ts +1 -0
  234. package/dist/components/ui-parts/UIAuthor.en.d.ts +1 -0
  235. package/dist/components/ui-parts/UIAvatar.d.ts +1 -0
  236. package/dist/components/ui-parts/UIAvatar.en.d.ts +1 -0
  237. package/dist/components/ui-parts/UIContent.d.ts +1 -0
  238. package/dist/components/ui-parts/UIContent.en.d.ts +1 -0
  239. package/dist/components/ui-parts/UIDate.d.ts +1 -0
  240. package/dist/components/ui-parts/UIDate.en.d.ts +1 -0
  241. package/dist/components/ui-parts/UIDescription.d.ts +1 -0
  242. package/dist/components/ui-parts/UIDescription.en.d.ts +1 -0
  243. package/dist/components/ui-parts/UIDetail.d.ts +1 -0
  244. package/dist/components/ui-parts/UIDetail.en.d.ts +1 -0
  245. package/dist/components/ui-parts/UIExtra.d.ts +1 -0
  246. package/dist/components/ui-parts/UIExtra.en.d.ts +1 -0
  247. package/dist/components/ui-parts/UIHeader.d.ts +3 -1
  248. package/dist/components/ui-parts/UIHeader.en.d.ts +3 -1
  249. package/dist/components/ui-parts/UIMeta.d.ts +1 -0
  250. package/dist/components/ui-parts/UIMeta.en.d.ts +1 -0
  251. package/dist/components/ui-parts/UIParts.types.d.ts +15 -1
  252. package/dist/components/ui-parts/UISummary.d.ts +1 -0
  253. package/dist/components/ui-parts/UISummary.en.d.ts +1 -0
  254. package/dist/components/ui-parts/UITitle.d.ts +1 -0
  255. package/dist/components/ui-parts/UITitle.en.d.ts +1 -0
  256. package/dist/components/ui-parts/UIValue.d.ts +1 -0
  257. package/dist/components/ui-parts/UIValue.en.d.ts +1 -0
  258. package/dist/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
  259. package/dist/components/ui-placeholder/UIPlaceholder.en.d.ts +1 -0
  260. package/dist/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
  261. package/dist/components/ui-placeholder/UIPlaceholderHeader.en.d.ts +1 -0
  262. package/dist/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
  263. package/dist/components/ui-placeholder/UIPlaceholderImage.en.d.ts +1 -0
  264. package/dist/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
  265. package/dist/components/ui-placeholder/UIPlaceholderLine.en.d.ts +1 -0
  266. package/dist/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
  267. package/dist/components/ui-placeholder/UIPlaceholderParagraph.en.d.ts +1 -0
  268. package/dist/components/ui-popup/UIPopup.d.ts +30 -3
  269. package/dist/components/ui-popup/UIPopup.en.d.ts +7 -0
  270. package/dist/components/ui-popup/UIPopup.es.d.ts +1 -0
  271. package/dist/components/ui-progress/UIProgress.d.ts +2 -0
  272. package/dist/components/ui-progress/UIProgress.en.d.ts +2 -0
  273. package/dist/components/ui-progress/UIProgress.es.d.ts +1 -0
  274. package/dist/components/ui-property-editor/UIProperty.d.ts +132 -5
  275. package/dist/components/ui-property-editor/UIProperty.en.d.ts +11 -44
  276. package/dist/components/ui-property-editor/UIProperty.es.d.ts +4 -0
  277. package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +38 -0
  278. package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
  279. package/dist/components/ui-property-editor/UIPropertyEditor.es.d.ts +4 -0
  280. package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +33 -0
  281. package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +12 -0
  282. package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +2 -0
  283. package/dist/components/ui-property-editor/UIPropertyGroup.es.d.ts +9 -0
  284. package/dist/components/ui-property-editor/index.d.ts +1 -0
  285. package/dist/components/ui-quote/UIQuote.d.ts +1 -0
  286. package/dist/components/ui-quote/UIQuote.en.d.ts +1 -0
  287. package/dist/components/ui-rail/UIRail.d.ts +1 -0
  288. package/dist/components/ui-rail/UIRail.en.d.ts +1 -0
  289. package/dist/components/ui-rating/UIRating.d.ts +6 -0
  290. package/dist/components/ui-rating/UIRating.en.d.ts +6 -0
  291. package/dist/components/ui-rating/UIRating.fallback.d.ts +6 -0
  292. package/dist/components/ui-reveal/UIReveal.d.ts +1 -0
  293. package/dist/components/ui-reveal/UIReveal.en.d.ts +1 -0
  294. package/dist/components/ui-root/UIRoot.d.ts +18 -3
  295. package/dist/components/ui-root/UIRoot.en.d.ts +15 -0
  296. package/dist/components/ui-root/UIRoot.es.d.ts +1 -0
  297. package/dist/components/ui-search/UISearch.d.ts +48 -7
  298. package/dist/components/ui-search/UISearch.en.d.ts +13 -1
  299. package/dist/components/ui-search/UISearch.es.d.ts +1 -0
  300. package/dist/components/ui-search/UISearch.fallback.d.ts +13 -1
  301. package/dist/components/ui-section/UISection.d.ts +22 -1
  302. package/dist/components/ui-section/UISection.en.d.ts +10 -0
  303. package/dist/components/ui-section/UISection.es.d.ts +1 -0
  304. package/dist/components/ui-section/UISections.d.ts +1 -0
  305. package/dist/components/ui-section/UISections.en.d.ts +1 -0
  306. package/dist/components/ui-segment/UISegment.d.ts +2 -0
  307. package/dist/components/ui-segment/UISegment.en.d.ts +2 -0
  308. package/dist/components/ui-segment/UISegment.es.d.ts +1 -0
  309. package/dist/components/ui-segment/UISegments.d.ts +1 -0
  310. package/dist/components/ui-segment/UISegments.en.d.ts +1 -0
  311. package/dist/components/ui-select/UISelect.d.ts +6 -0
  312. package/dist/components/ui-select/UISelect.en.d.ts +6 -0
  313. package/dist/components/ui-select/UISelect.fallback.d.ts +6 -0
  314. package/dist/components/ui-shape/UIShape.d.ts +23 -2
  315. package/dist/components/ui-shape/UIShape.en.d.ts +8 -0
  316. package/dist/components/ui-shape/UIShape.es.d.ts +1 -0
  317. package/dist/components/ui-shape/UISide.d.ts +4 -0
  318. package/dist/components/ui-shape/UISide.en.d.ts +4 -0
  319. package/dist/components/ui-sidebar/UIPushable.d.ts +1 -0
  320. package/dist/components/ui-sidebar/UIPushable.en.d.ts +1 -0
  321. package/dist/components/ui-sidebar/UIPusher.d.ts +1 -0
  322. package/dist/components/ui-sidebar/UIPusher.en.d.ts +1 -0
  323. package/dist/components/ui-sidebar/UISidebar.d.ts +1 -0
  324. package/dist/components/ui-sidebar/UISidebar.en.d.ts +1 -0
  325. package/dist/components/ui-sides/UISides.d.ts +209 -0
  326. package/dist/components/ui-sides/UISides.en.d.ts +122 -0
  327. package/dist/components/ui-sides/UISides.es.d.ts +30 -0
  328. package/dist/components/ui-sides/UISides.fallback.d.ts +134 -0
  329. package/dist/components/ui-sides/index.d.ts +2 -0
  330. package/dist/components/ui-site-nav/SitePages.d.ts +53 -0
  331. package/dist/components/ui-site-nav/UISiteNav.d.ts +207 -0
  332. package/dist/components/ui-site-nav/UISiteNav.en.d.ts +87 -0
  333. package/dist/components/ui-site-nav/UISiteNav.es.d.ts +29 -0
  334. package/dist/components/ui-site-nav/index.d.ts +1 -0
  335. package/dist/components/ui-site-tabs/UISiteTabs.d.ts +126 -0
  336. package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +49 -0
  337. package/dist/components/ui-site-tabs/UISiteTabs.es.d.ts +18 -0
  338. package/dist/components/ui-site-tabs/index.d.ts +1 -0
  339. package/dist/components/ui-slider/UISlider.d.ts +7 -0
  340. package/dist/components/ui-slider/UISlider.en.d.ts +7 -0
  341. package/dist/components/ui-slider/UISlider.es.d.ts +1 -0
  342. package/dist/components/ui-slider/UISlider.fallback.d.ts +7 -0
  343. package/dist/components/ui-space/UISpace.d.ts +1 -0
  344. package/dist/components/ui-space/UISpace.en.d.ts +1 -0
  345. package/dist/components/ui-split-panel/UISplitPanel.d.ts +175 -0
  346. package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +74 -0
  347. package/dist/components/ui-split-panel/UISplitPanel.es.d.ts +25 -0
  348. package/dist/components/ui-split-panel/index.d.ts +2 -0
  349. package/dist/components/ui-stack/UIStack.d.ts +31 -5
  350. package/dist/components/ui-stack/UIStack.en.d.ts +15 -3
  351. package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
  352. package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
  353. package/dist/components/ui-statistic/UIStatistics.d.ts +1 -0
  354. package/dist/components/ui-statistic/UIStatistics.en.d.ts +1 -0
  355. package/dist/components/ui-step/UIStep.d.ts +1 -0
  356. package/dist/components/ui-step/UIStep.en.d.ts +1 -0
  357. package/dist/components/ui-step/UISteps.d.ts +1 -0
  358. package/dist/components/ui-step/UISteps.en.d.ts +1 -0
  359. package/dist/components/ui-sticky/UISticky.d.ts +4 -0
  360. package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
  361. package/dist/components/ui-tab/UITab.d.ts +8 -0
  362. package/dist/components/ui-tab/UITab.en.d.ts +1 -0
  363. package/dist/components/ui-tab/UITabs.d.ts +107 -16
  364. package/dist/components/ui-tab/UITabs.en.d.ts +40 -1
  365. package/dist/components/ui-tab/UITabs.es.d.ts +4 -0
  366. package/dist/components/ui-table/TableEditing.d.ts +77 -0
  367. package/dist/components/ui-table/UICell.d.ts +1 -0
  368. package/dist/components/ui-table/UICell.en.d.ts +1 -0
  369. package/dist/components/ui-table/UITable.d.ts +145 -5
  370. package/dist/components/ui-table/UITable.en.d.ts +19 -0
  371. package/dist/components/ui-table/UITable.es.d.ts +3 -0
  372. package/dist/components/ui-terms/UITerm.d.ts +1 -0
  373. package/dist/components/ui-terms/UITerm.en.d.ts +1 -0
  374. package/dist/components/ui-terms/UITerms.d.ts +1 -0
  375. package/dist/components/ui-terms/UITerms.en.d.ts +1 -0
  376. package/dist/components/ui-text/UILink.d.ts +11 -0
  377. package/dist/components/ui-text/UILink.en.d.ts +4 -0
  378. package/dist/components/ui-text/UIText.d.ts +7 -0
  379. package/dist/components/ui-text/UIText.en.d.ts +7 -0
  380. package/dist/components/ui-text/UIText.es.d.ts +2 -0
  381. package/dist/components/ui-theme-editor/SavedTheme.d.ts +55 -43
  382. package/dist/components/ui-theme-editor/ThemeDraft.d.ts +15 -0
  383. package/dist/components/ui-theme-editor/UIColorChip.d.ts +1 -0
  384. package/dist/components/ui-theme-editor/UIColorChip.en.d.ts +1 -0
  385. package/dist/components/ui-theme-editor/UIThemeEditor.d.ts +157 -26
  386. package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +79 -6
  387. package/dist/components/ui-theme-editor/UIThemeEditor.es.d.ts +20 -2
  388. package/dist/components/ui-theme-editor/UIThemeEditor.types.d.ts +0 -2
  389. package/dist/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
  390. package/dist/components/ui-theme-editor/UIThemeToken.en.d.ts +1 -0
  391. package/dist/components/ui-theme-menu/HueDropdown.d.ts +47 -0
  392. package/dist/components/ui-theme-menu/ThemeMenu.d.ts +18 -7
  393. package/dist/components/ui-theme-menu/ThemePreference.d.ts +145 -36
  394. package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +118 -7
  395. package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +82 -2
  396. package/dist/components/ui-theme-menu/UIThemeMenu.es.d.ts +21 -1
  397. package/dist/components/ui-theme-menu/UIThemeMenu.types.d.ts +36 -8
  398. package/dist/components/ui-theme-menu/index.d.ts +2 -1
  399. package/dist/components/ui-toast/UIToast.d.ts +1 -0
  400. package/dist/components/ui-toast/UIToast.en.d.ts +1 -0
  401. package/dist/components/ui-toc/UIToc.d.ts +1 -0
  402. package/dist/components/ui-toc/UIToc.en.d.ts +1 -0
  403. package/dist/components/ui-toolbar/UIToolbar.d.ts +13 -10
  404. package/dist/components/ui-toolbar/UIToolbar.en.d.ts +138 -84
  405. package/dist/components/ui-toolbar/UIToolbar.es.d.ts +2 -0
  406. package/dist/components/ui-transition/UITransition.d.ts +1 -0
  407. package/dist/components/ui-transition/UITransition.en.d.ts +1 -0
  408. package/dist/components/ui-tree/UITree.d.ts +162 -0
  409. package/dist/components/ui-tree/UITree.en.d.ts +88 -0
  410. package/dist/components/ui-tree/UITree.es.d.ts +35 -0
  411. package/dist/components/ui-tree/UITreeItem.d.ts +204 -0
  412. package/dist/components/ui-tree/UITreeItem.en.d.ts +142 -0
  413. package/dist/components/ui-tree/UITreeItem.es.d.ts +32 -0
  414. package/dist/components/ui-tree/index.d.ts +3 -0
  415. package/dist/components/ui-tree-diagram/TreeData.d.ts +3 -12
  416. package/dist/components/ui-tree-diagram/TreeLayout.d.ts +54 -21
  417. package/dist/components/ui-tree-diagram/TreeMeasure.d.ts +36 -0
  418. package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +152 -27
  419. package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +47 -7
  420. package/dist/components/ui-tree-diagram/UITreeDiagram.es.d.ts +12 -1
  421. package/dist/components/ui-tree-diagram/UITreeDiagram.types.d.ts +66 -21
  422. package/dist/components/ui-tree-diagram/UITreeNode.d.ts +148 -0
  423. package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +69 -0
  424. package/dist/components/ui-tree-diagram/UITreeNode.es.d.ts +21 -0
  425. package/dist/components/ui-tree-diagram/index.d.ts +4 -2
  426. package/dist/components/ui-video/UIAudio.d.ts +1 -0
  427. package/dist/components/ui-video/UIAudio.en.d.ts +1 -0
  428. package/dist/components/ui-video/UIVideo.d.ts +1 -0
  429. package/dist/components/ui-video/UIVideo.en.d.ts +1 -0
  430. package/dist/components/ui-visibility/UIVisibility.d.ts +1 -0
  431. package/dist/components/ui-visibility/UIVisibility.en.d.ts +1 -0
  432. package/dist/components/ui-zoom/UIZoom.d.ts +1 -0
  433. package/dist/components/ui-zoom/UIZoom.en.d.ts +1 -0
  434. package/dist/{components.es-DmLzT-Bq.js → components.es-BOa_7gFF.js} +498 -109
  435. package/dist/components.es-BOa_7gFF.js.map +1 -0
  436. package/dist/core.d.ts +3 -1
  437. package/dist/core.js +1082 -511
  438. package/dist/core.js.map +1 -1
  439. package/dist/crisp-VfYZlTph.js +6 -0
  440. package/dist/{crisp-CoZRRDuQ.js.map → crisp-VfYZlTph.js.map} +1 -1
  441. package/dist/docs-components/index.d.ts +1 -0
  442. package/dist/docs-components/ui-docs-index/UIDocsIndex.d.ts +89 -0
  443. package/dist/docs-components/ui-docs-index/UIDocsIndex.en.d.ts +43 -0
  444. package/dist/docs-components/ui-docs-index/index.d.ts +2 -0
  445. package/dist/docs-components/ui-docs-nav/UIDocsNav.d.ts +54 -87
  446. package/dist/docs-components/ui-docs-nav/UIDocsNav.types.d.ts +2 -29
  447. package/dist/docs-components/ui-docs-search/SearchIndex.d.ts +8 -2
  448. package/dist/docs-components/ui-docs-search/UIDocsSearch.d.ts +10 -0
  449. package/dist/docs-components/ui-docs-search/UIDocsSearch.en.d.ts +5 -0
  450. package/dist/elements/AddressParameter.d.ts +87 -0
  451. package/dist/elements/DOMFormControl.d.ts +5 -0
  452. package/dist/elements/FormComponent.d.ts +32 -0
  453. package/dist/elements/LoadableBody.d.ts +6 -1
  454. package/dist/elements/LoadableComponent.d.ts +10 -1
  455. package/dist/elements/RootSettings.d.ts +43 -6
  456. package/dist/elements/SpellUISettings.d.ts +1 -0
  457. package/dist/elements/StickyWatch.d.ts +20 -0
  458. package/dist/elements/elements.types.d.ts +15 -0
  459. package/dist/elements/index.d.ts +2 -0
  460. package/dist/forms.js +93 -63
  461. package/dist/forms.js.map +1 -1
  462. package/dist/fruity-BRVlgJZd.js +6 -0
  463. package/dist/fruity-BRVlgJZd.js.map +1 -0
  464. package/dist/{fruity.theme-BJcMiPl1.js → fruity.theme-CbC7Jyvk.js} +2 -2
  465. package/dist/fruity.theme-CbC7Jyvk.js.map +1 -0
  466. package/dist/glass-x9tbbwVq.js +6 -0
  467. package/dist/glass-x9tbbwVq.js.map +1 -0
  468. package/dist/glass.theme-24wY2wH9.js +6 -0
  469. package/dist/glass.theme-24wY2wH9.js.map +1 -0
  470. package/dist/hot.js +530 -24
  471. package/dist/hot.js.map +1 -1
  472. package/dist/index.d.ts +8 -0
  473. package/dist/index.js +91 -81
  474. package/dist/jsx.d.ts +21149 -10377
  475. package/dist/matrix-QY2gWbJ0.js +6 -0
  476. package/dist/{matrix-CqA59hiF.js.map → matrix-QY2gWbJ0.js.map} +1 -1
  477. package/dist/{matrix.theme-jqQZjcq3.js → matrix.theme-_8xtwhDq.js} +2 -2
  478. package/dist/matrix.theme-_8xtwhDq.js.map +1 -0
  479. package/dist/midnight-BxlTQSfw.js +6 -0
  480. package/dist/{midnight-BnoVOrhC.js.map → midnight-BxlTQSfw.js.map} +1 -1
  481. package/dist/mockup-83ELBuVr.js +6 -0
  482. package/dist/mockup-83ELBuVr.js.map +1 -0
  483. package/dist/mockup.theme-DmpBgGBl.js +6 -0
  484. package/dist/mockup.theme-DmpBgGBl.js.map +1 -0
  485. package/dist/paper-M61nUilz.js +6 -0
  486. package/dist/{paper-CynH8ZuT.js.map → paper-M61nUilz.js.map} +1 -1
  487. package/dist/persist.types-D2m6wD-S.js +9 -0
  488. package/dist/persist.types-D2m6wD-S.js.map +1 -0
  489. package/dist/pop-CxXfytjk.js +6 -0
  490. package/dist/{pop-D2i9V_rG.js.map → pop-CxXfytjk.js.map} +1 -1
  491. package/dist/runtime/DataTooltips.d.ts +75 -0
  492. package/dist/runtime/PropertyControls.d.ts +15 -1
  493. package/dist/runtime/Sources.d.ts +16 -4
  494. package/dist/runtime/Styles.d.ts +11 -0
  495. package/dist/runtime/Themes.d.ts +10 -4
  496. package/dist/runtime/UIRuntime.d.ts +4 -1
  497. package/dist/runtime/index.d.ts +1 -1
  498. package/dist/runtime/runtime.types.d.ts +18 -85
  499. package/dist/spell-By5Y3jKP.js +6 -0
  500. package/dist/{spell-BFtLICm7.js.map → spell-By5Y3jKP.js.map} +1 -1
  501. package/dist/{spell.theme-B7AU7SQX.js → spell.theme-DxGj7qHx.js} +2 -2
  502. package/dist/spell.theme-DxGj7qHx.js.map +1 -0
  503. package/dist/styles/CodeThemeFile.d.ts +73 -0
  504. package/dist/styles/StyleGenerator.d.ts +6 -0
  505. package/dist/styles/styles.en.d.ts +141 -3
  506. package/dist/styles/styles.types.d.ts +2 -0
  507. package/dist/{styles.en-RLpYiO5_.js → styles.en-CUUxNwHo.js} +71 -14
  508. package/dist/styles.en-CUUxNwHo.js.map +1 -0
  509. package/dist/styles.js +13 -13
  510. package/dist/styles.js.map +1 -1
  511. package/dist/ui-accordion.js +54 -53
  512. package/dist/ui-accordion.js.map +1 -1
  513. package/dist/ui-action.js +20 -19
  514. package/dist/ui-action.js.map +1 -1
  515. package/dist/ui-ad.js +5 -4
  516. package/dist/ui-ad.js.map +1 -1
  517. package/dist/ui-breadcrumbs.js +15 -13
  518. package/dist/ui-breadcrumbs.js.map +1 -1
  519. package/dist/ui-button.js +132 -125
  520. package/dist/ui-button.js.map +1 -1
  521. package/dist/ui-calendar.js +208 -206
  522. package/dist/ui-calendar.js.map +1 -1
  523. package/dist/ui-card.js +260 -98
  524. package/dist/ui-card.js.map +1 -1
  525. package/dist/ui-checkbox.js +95 -81
  526. package/dist/ui-checkbox.js.map +1 -1
  527. package/dist/ui-code.js +25 -24
  528. package/dist/ui-code.js.map +1 -1
  529. package/dist/ui-comment.js +14 -12
  530. package/dist/ui-comment.js.map +1 -1
  531. package/dist/ui-components.js +7 -6
  532. package/dist/ui-components.js.map +1 -1
  533. package/dist/ui-container.js +24 -12
  534. package/dist/ui-container.js.map +1 -1
  535. package/dist/ui-diagram.js +1328 -0
  536. package/dist/ui-diagram.js.map +1 -0
  537. package/dist/ui-dimension.js +779 -0
  538. package/dist/ui-dimension.js.map +1 -0
  539. package/dist/ui-dimmer.js +36 -34
  540. package/dist/ui-dimmer.js.map +1 -1
  541. package/dist/ui-divider.js +7 -5
  542. package/dist/ui-divider.js.map +1 -1
  543. package/dist/ui-dropdown.js +107 -105
  544. package/dist/ui-dropdown.js.map +1 -1
  545. package/dist/ui-embed.js +36 -35
  546. package/dist/ui-embed.js.map +1 -1
  547. package/dist/ui-emoji.js +10 -9
  548. package/dist/ui-emoji.js.map +1 -1
  549. package/dist/ui-example.js +63 -61
  550. package/dist/ui-example.js.map +1 -1
  551. package/dist/ui-feed.js +12 -10
  552. package/dist/ui-feed.js.map +1 -1
  553. package/dist/ui-flag.js +10 -9
  554. package/dist/ui-flag.js.map +1 -1
  555. package/dist/ui-flyout.js +7 -6
  556. package/dist/ui-flyout.js.map +1 -1
  557. package/dist/ui-form.js +244 -162
  558. package/dist/ui-form.js.map +1 -1
  559. package/dist/ui-grid.js +21 -18
  560. package/dist/ui-grid.js.map +1 -1
  561. package/dist/ui-icon-picker.js +46 -44
  562. package/dist/ui-icon-picker.js.map +1 -1
  563. package/dist/ui-icon.js +17 -14
  564. package/dist/ui-icon.js.map +1 -1
  565. package/dist/ui-image.js +93 -55
  566. package/dist/ui-image.js.map +1 -1
  567. package/dist/ui-include.js +18 -17
  568. package/dist/ui-include.js.map +1 -1
  569. package/dist/ui-input.js +154 -112
  570. package/dist/ui-input.js.map +1 -1
  571. package/dist/ui-item.js +152 -102
  572. package/dist/ui-item.js.map +1 -1
  573. package/dist/ui-items.js +9 -8
  574. package/dist/ui-items.js.map +1 -1
  575. package/dist/ui-json.js +115 -0
  576. package/dist/ui-json.js.map +1 -0
  577. package/dist/ui-keys.js +1 -1
  578. package/dist/ui-label.js +18 -15
  579. package/dist/ui-label.js.map +1 -1
  580. package/dist/ui-list.js +7 -5
  581. package/dist/ui-list.js.map +1 -1
  582. package/dist/ui-loader.js +7 -6
  583. package/dist/ui-loader.js.map +1 -1
  584. package/dist/ui-markdown.js +975 -83
  585. package/dist/ui-markdown.js.map +1 -1
  586. package/dist/ui-menu.js +329 -196
  587. package/dist/ui-menu.js.map +1 -1
  588. package/dist/ui-message.js +20 -18
  589. package/dist/ui-message.js.map +1 -1
  590. package/dist/ui-modal.js +46 -45
  591. package/dist/ui-modal.js.map +1 -1
  592. package/dist/ui-nag.js +19 -18
  593. package/dist/ui-nag.js.map +1 -1
  594. package/dist/ui-page.js +8 -7
  595. package/dist/ui-page.js.map +1 -1
  596. package/dist/ui-panel.js +28 -17
  597. package/dist/ui-panel.js.map +1 -1
  598. package/dist/ui-parts.js +66 -52
  599. package/dist/ui-parts.js.map +1 -1
  600. package/dist/ui-placeholder.js +21 -16
  601. package/dist/ui-placeholder.js.map +1 -1
  602. package/dist/ui-popup.js +113 -84
  603. package/dist/ui-popup.js.map +1 -1
  604. package/dist/ui-progress.js +9 -7
  605. package/dist/ui-progress.js.map +1 -1
  606. package/dist/ui-property-editor.js +706 -203
  607. package/dist/ui-property-editor.js.map +1 -1
  608. package/dist/ui-quote.js +5 -4
  609. package/dist/ui-quote.js.map +1 -1
  610. package/dist/ui-rail.js +5 -4
  611. package/dist/ui-rail.js.map +1 -1
  612. package/dist/ui-rating.js +31 -29
  613. package/dist/ui-rating.js.map +1 -1
  614. package/dist/ui-reveal.js +7 -6
  615. package/dist/ui-reveal.js.map +1 -1
  616. package/dist/ui-root.js +324 -158
  617. package/dist/ui-root.js.map +1 -1
  618. package/dist/ui-search.js +210 -168
  619. package/dist/ui-search.js.map +1 -1
  620. package/dist/ui-section.js +124 -92
  621. package/dist/ui-section.js.map +1 -1
  622. package/dist/ui-segment.js +15 -12
  623. package/dist/ui-segment.js.map +1 -1
  624. package/dist/ui-select.js +83 -81
  625. package/dist/ui-select.js.map +1 -1
  626. package/dist/ui-shape.js +86 -58
  627. package/dist/ui-shape.js.map +1 -1
  628. package/dist/ui-sidebar.js +59 -56
  629. package/dist/ui-sidebar.js.map +1 -1
  630. package/dist/ui-sides.js +325 -0
  631. package/dist/ui-sides.js.map +1 -0
  632. package/dist/ui-site-nav.js +329 -0
  633. package/dist/ui-site-nav.js.map +1 -0
  634. package/dist/ui-site-tabs.js +177 -0
  635. package/dist/ui-site-tabs.js.map +1 -0
  636. package/dist/ui-slider.js +84 -81
  637. package/dist/ui-slider.js.map +1 -1
  638. package/dist/ui-space.js +7 -6
  639. package/dist/ui-space.js.map +1 -1
  640. package/dist/ui-split-panel.js +298 -0
  641. package/dist/ui-split-panel.js.map +1 -0
  642. package/dist/ui-stack.js +47 -23
  643. package/dist/ui-stack.js.map +1 -1
  644. package/dist/ui-statistic.js +15 -13
  645. package/dist/ui-statistic.js.map +1 -1
  646. package/dist/ui-step.js +31 -29
  647. package/dist/ui-step.js.map +1 -1
  648. package/dist/ui-sticky.js +7 -6
  649. package/dist/ui-sticky.js.map +1 -1
  650. package/dist/ui-tab.js +230 -138
  651. package/dist/ui-tab.js.map +1 -1
  652. package/dist/ui-table.js +724 -162
  653. package/dist/ui-table.js.map +1 -1
  654. package/dist/ui-terms.js +12 -10
  655. package/dist/ui-terms.js.map +1 -1
  656. package/dist/ui-text.js +53 -28
  657. package/dist/ui-text.js.map +1 -1
  658. package/dist/ui-theme-editor.js +1018 -1545
  659. package/dist/ui-theme-editor.js.map +1 -1
  660. package/dist/ui-theme-menu-CuIjr8Ou.js +1493 -0
  661. package/dist/ui-theme-menu-CuIjr8Ou.js.map +1 -0
  662. package/dist/ui-toast.js +45 -44
  663. package/dist/ui-toast.js.map +1 -1
  664. package/dist/ui-toc.js +75 -74
  665. package/dist/ui-toc.js.map +1 -1
  666. package/dist/ui-toolbar.js +51 -73
  667. package/dist/ui-toolbar.js.map +1 -1
  668. package/dist/ui-transition.js +12 -11
  669. package/dist/ui-transition.js.map +1 -1
  670. package/dist/ui-tree-diagram.js +676 -197
  671. package/dist/ui-tree-diagram.js.map +1 -1
  672. package/dist/ui-tree.js +625 -0
  673. package/dist/ui-tree.js.map +1 -0
  674. package/dist/ui-video.js +13 -11
  675. package/dist/ui-video.js.map +1 -1
  676. package/dist/ui-visibility.js +26 -25
  677. package/dist/ui-visibility.js.map +1 -1
  678. package/dist/ui-zoom.js +79 -78
  679. package/dist/ui-zoom.js.map +1 -1
  680. package/dist/util/TopLayerTip.d.ts +28 -0
  681. package/dist/util/index.d.ts +5 -2
  682. package/dist/vocabulary/DefaultValues.d.ts +34 -0
  683. package/dist/vocabulary/SharedVocabulary.d.ts +4 -0
  684. package/dist/vocabulary/SharedVocabulary.es.d.ts +7 -0
  685. package/dist/vocabulary/ValueSets.d.ts +18 -0
  686. package/dist/vocabulary/Vocabulary.d.ts +1 -0
  687. package/dist/vocabulary/defaults.generated.d.ts +6 -0
  688. package/dist/vocabulary/index.d.ts +1 -0
  689. package/package.json +1 -1
  690. package/dist/MarkdownEngine-CbuT9Mjc.js.map +0 -1
  691. package/dist/PrefStore-CeaTtjTz.js.map +0 -1
  692. package/dist/UIButton-XkfGqgh6.js +0 -6
  693. package/dist/UIButton-XkfGqgh6.js.map +0 -1
  694. package/dist/UIInput-BUudZstW.js +0 -6
  695. package/dist/UIInput-BUudZstW.js.map +0 -1
  696. package/dist/UIKeys-DJF2TIKE.js.map +0 -1
  697. package/dist/UILabel-C1jy3Yl8.js +0 -6
  698. package/dist/UILabel-C1jy3Yl8.js.map +0 -1
  699. package/dist/UIMenu-Btd-8V3A.js +0 -42
  700. package/dist/UIMenu-Btd-8V3A.js.map +0 -1
  701. package/dist/UIRuntime-BBuehGly.js.map +0 -1
  702. package/dist/components.es-DmLzT-Bq.js.map +0 -1
  703. package/dist/crisp-CoZRRDuQ.js +0 -6
  704. package/dist/fruity-CQFYeRlh.js +0 -6
  705. package/dist/fruity-CQFYeRlh.js.map +0 -1
  706. package/dist/fruity.theme-BJcMiPl1.js.map +0 -1
  707. package/dist/glass-CAfW11kL.js +0 -6
  708. package/dist/glass-CAfW11kL.js.map +0 -1
  709. package/dist/glass.theme-DQcBbtCW.js +0 -6
  710. package/dist/glass.theme-DQcBbtCW.js.map +0 -1
  711. package/dist/matrix-CqA59hiF.js +0 -6
  712. package/dist/matrix.theme-jqQZjcq3.js.map +0 -1
  713. package/dist/midnight-BnoVOrhC.js +0 -6
  714. package/dist/paper-CynH8ZuT.js +0 -6
  715. package/dist/persist.types-CsZxS8TG.js +0 -9
  716. package/dist/persist.types-CsZxS8TG.js.map +0 -1
  717. package/dist/pop-D2i9V_rG.js +0 -6
  718. package/dist/spell-BFtLICm7.js +0 -6
  719. package/dist/spell.theme-B7AU7SQX.js.map +0 -1
  720. package/dist/styles.en-RLpYiO5_.js.map +0 -1
  721. package/dist/ui-theme-menu-DyKZygpV.js +0 -921
  722. package/dist/ui-theme-menu-DyKZygpV.js.map +0 -1
package/dist/forms.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"forms.js","names":["_init","E.proto","E.suggest","__name","E.MenuSearchFields","E.clamp","E.withoutAccents","_init","__name","E.DOMElement","_init","E.UIComponent","E.protoMerged","E.onChange","E.proto","E.state","E.on","E.whileConnected","E.cssState","F.ControlLabels","UIT.REQUIRED_RULE","__name","text","E.state","E.byDocumentOrder","__name","__exportAll","__publicField","__decorateElement","__decoratorMetadata","REQUIRED_RULE","__decoratorStart","__name$1","__runInitializers","__privateAdd","_rules_dec","_flags_dec","_cards_dec","_regExp_dec","_text_dec","_prompts_dec","proto","_init$3","_Validator","text","value","options","errors","context","rule","rules","parsed","test","guess","suggest","flags","error","source","bracket","hasBracket","type","bracketValue","ruleValue","prompt","prompts","RANGE_PROMPT_RULES","min","max","RANGE_SUFFIX_RULES","suffix","bounds","range","pattern","subject","measure","number","trim","raw","regExp","flag","parts","length","otherValue","fieldValues","other","types","card","unionPay","sum","index","double","digit","LUHN_DOUBLED","count","Validator","MenuOptions","addition","keys","query","search","folding","term","fields","MenuSearchFields","option","field","fullTextSearch","selected","values","allowAdditions","ignoreCase","wanted","additionLabel","hideAdditions","list","additionPosition","from","delta","wrap","step","origin","target","clamp","tries","prefix","TYPE_AHEAD","repeated","REPEATED_CHARACTER","start","offset","at","folded","origins","ranges","position","char","found","end","last","ignoreDiacritics","withoutAccents","piece","unit","key","_index_dec","state","_init$2","_index","_HighlightedOption","HighlightedOption","DOMElement","_onDOMElementClick_dec","_isReadOnly_dec","_refreshLabels_dec","_onInvalid_dec","_isTouched_dec","_onValidationChanged_dec","_invalidShows_dec","_onFormValueChanged_dec","_elementSetup_dec","_a","_init$1","_isTouched","_FormComponent","UIComponent","protoMerged","onChange","on","whileConnected","cssState","args","ControlLabels","name","result","internals","INVALID_STATE","isShownInvalid","Reactive","event","data","item","FormComponent","LabelWatch","root","member","records","ids","all","record","nodes","node","NodeType","element","labels","label","watch","_accessibleName_dec","_init","_accessibleName","_ControlLabels","domElement","isServer","refresh","attributeObserver","WATCHED_ATTRIBUTES","selector","byDocumentOrder","wrapping","wrappingFor","own","text2","id","child","forms_exports"],"sources":["../src/elements/Validator.ts","../src/elements/MenuOptions.ts","../src/elements/HighlightedOption.ts","../src/elements/DOMFormControl.ts","../src/elements/FormComponent.ts","../src/elements/LabelWatch.ts","../src/elements/ControlLabels.ts","../src/forms.ts"],"sourcesContent":["import { E } from \"spell/ui/core\"\n\n/****************\n * ### `Validator`\n * Fomantic's form validation rules (`form.js` `settings.rules`) as pure functions, with its English prompts.\n * - Why a port rather than native constraints alone: Fomantic's rule vocabulary (`minLength[6]`, `match[password]`,\n * `creditCard[visa,amex]`) is what `ui-form rules` and authors already speak.\n * - Output feeds `ElementInternals.setValidity(result.flags, result.message)` directly: each rule maps to a\n * Constraint Validation flag (`Validator.flags`), so `:invalid` / `:user-invalid` and `validity.*` just work.\n * - Rule semantics follow Fomantic exactly, quirks included (`number` accepts `\"\"`), except where noted:\n * - counts use the array length when the value IS an array, and `maxCount[0]` accepts an empty value\n * - `range[a..b]` prompts interpolate `{min}` / `{max}` (Fomantic leaves them literal)\n * - an empty range bound is open, so `minValue` / `maxValue` work (see `bounds()`)\n * - Data is `@proto static` so `UI.i18n` can swap `prompts` / `text` per instance, and a subclass can add rules.\n * - Fomantic's names stay where they're its API (`prompts`, `text`, `regExp`, `rules`, a rule's `(value, ruleValue)`);\n * the steps rules share (`range()`, `normalize()`, `count()`: `RuleValidator`) are ours.\n * - Library-neutral: no DOM, no Solid; of the core (`E`), it uses only `E.proto`, `E.suggest()`, `E.Warnings` and\n * the folder's types. Part of the `forms` entry: reaches the core through the `spell/ui/core` ENTRY, never its leaves\n * (`forms.ts`).\n ****************/\nexport class Validator {\n /** Prompt per rule type, `{name}` ... interpolated; see `@proto static prompts`. */\n declare prompts: Readonly<Record<string, string>>\n /** Words the prompts use; see `@proto static text`. */\n declare text: E.ValidatorText\n /** Patterns the rules test; see `@proto static regExp`. */\n declare regExp: E.ValidatorRegExps\n /** Card brands for `creditCard`; see `@proto static cards`. */\n declare cards: Readonly<Record<string, E.CreditCardSpec>>\n /** Constraint Validation flag per rule; see `@proto static flags`. */\n declare flags: E.ValidityFlagMap\n /** The rules by type; see `@proto static rules`. */\n declare rules: Readonly<Record<string, E.RuleFunction>>\n\n ////////////////\n // ## Data\n ////////////////\n\n /** Fomantic's `settings.prompt`, verbatim. `{name}`, `{value}`, `{ruleValue}`, `{min}`, `{max}`, `{identifier}`. */\n @E.proto static prompts: Readonly<Record<string, string>> = {\n range: \"{name} must be in a range from {min} to {max}\",\n maxValue: \"{name} must have a maximum value of {ruleValue}\",\n minValue: \"{name} must have a minimum value of {ruleValue}\",\n notEmpty: \"{name} must have a value\",\n checked: \"{name} must be checked\",\n email: \"{name} must be a valid e-mail\",\n url: \"{name} must be a valid url\",\n regExp: \"{name} is not formatted correctly\",\n integer: \"{name} must be an integer\",\n decimal: \"{name} must be a decimal number\",\n number: \"{name} must be set to a number\",\n is: '{name} must be \"{ruleValue}\"',\n isExactly: '{name} must be exactly \"{ruleValue}\"',\n not: '{name} cannot be set to \"{ruleValue}\"',\n notExactly: '{name} cannot be set to exactly \"{ruleValue}\"',\n contains: '{name} must contain \"{ruleValue}\"',\n containsExactly: '{name} must contain exactly \"{ruleValue}\"',\n doesntContain: '{name} cannot contain \"{ruleValue}\"',\n doesntContainExactly: '{name} cannot contain exactly \"{ruleValue}\"',\n minLength: \"{name} must be at least {ruleValue} characters\",\n exactLength: \"{name} must be exactly {ruleValue} characters\",\n maxLength: \"{name} cannot be longer than {ruleValue} characters\",\n size: \"{name} must have a length between {min} and {max} characters\",\n match: \"{name} must match {ruleValue} field\",\n different: \"{name} must have a different value than {ruleValue} field\",\n creditCard: \"{name} must be a valid credit card number\",\n minCount: \"{name} must have at least {ruleValue} choices\",\n exactCount: \"{name} must have exactly {ruleValue} choices\",\n maxCount: \"{name} must have {ruleValue} or less choices\"\n }\n\n /** Fomantic's `settings.text` entries prompts use. */\n @E.proto static text: E.ValidatorText = {\n and: \"and\",\n unspecifiedRule: \"Please enter a valid value\",\n unspecifiedField: \"This field\"\n }\n\n /** Fomantic's `settings.regExp`, verbatim. */\n @E.proto static regExp: E.ValidatorRegExps = {\n decimal: /^\\d+\\.?\\d*$/,\n email: /^[\\w!#$%&'*+./=?^`{|}~-]+@[\\da-z]([\\da-z-]*[\\da-z])?(\\.[\\da-z]([\\da-z-]*[\\da-z])?)*$/i,\n integer: /^-?\\d+$/,\n number: /^-?\\d*(\\.\\d+)?$/,\n url: /(https?:\\/\\/(?:www\\.|(?!www))[^\\s.]+\\.\\S{2,}|www\\.\\S+\\.\\S{2,})/i,\n flags: /^\\/(.*)\\/(.*)?/\n }\n\n /** Card brands for `creditCard[visa,amex]`, from Fomantic's `rules.creditCard`. */\n @E.proto static cards: Readonly<Record<string, E.CreditCardSpec>> = {\n visa: { pattern: /^4/, length: [16] },\n amex: { pattern: /^3[47]/, length: [15] },\n mastercard: { pattern: /^5[1-5]/, length: [16] },\n discover: { pattern: /^(6011|622(12[6-9]|1[3-9]\\d|[2-8]\\d{2}|9[01]\\d|92[0-5]|64[4-9])|65)/, length: [16] },\n unionPay: { pattern: /^(62|88)/, length: [16, 17, 18, 19] },\n jcb: { pattern: /^35(2[89]|[3-8]\\d)/, length: [16] },\n maestro: { pattern: /^(5018|5020|5038|6304|6759|676[1-3])/, length: [12, 13, 14, 15, 16, 17, 18, 19] },\n dinersClub: { pattern: /^(30[0-5]|^36)/, length: [14] },\n laser: { pattern: /^(6304|670[69]|6771)/, length: [16, 17, 18, 19] },\n visaElectron: { pattern: /^(4026|417500|4508|4844|491(3|7))/, length: [16] }\n }\n\n /**\n * Constraint Validation flag per rule, for `ElementInternals.setValidity()`.\n * - `\"auto\"` rules pick by value: type failure => `typeMismatch`, else under / over the range.\n * - Rules with no native equivalent (`is`, `match` ...) => `customError`.\n */\n @E.proto static flags: E.ValidityFlagMap = {\n notEmpty: \"valueMissing\",\n checked: \"valueMissing\",\n email: \"typeMismatch\",\n url: \"typeMismatch\",\n creditCard: \"typeMismatch\",\n regExp: \"patternMismatch\",\n minValue: \"auto\",\n maxValue: \"auto\",\n integer: \"auto\",\n range: \"auto\",\n decimal: \"auto\",\n number: \"auto\",\n minLength: \"tooShort\",\n maxLength: \"tooLong\",\n exactLength: \"auto\",\n size: \"auto\",\n minCount: \"rangeUnderflow\",\n maxCount: \"rangeOverflow\",\n exactCount: \"auto\",\n is: \"customError\",\n isExactly: \"customError\",\n not: \"customError\",\n notExactly: \"customError\",\n contains: \"customError\",\n containsExactly: \"customError\",\n doesntContain: \"customError\",\n doesntContainExactly: \"customError\",\n match: \"customError\",\n different: \"customError\"\n }\n\n /**\n * The rules, as methods called with `this` ~== the validator.\n * - `value` is normalized (see `normalize()`); `context.raw` has the original.\n */\n @E.proto static rules: Readonly<Record<string, E.RuleFunction>> = {\n /** Not blank; an empty array or unchecked (`false`) checkbox is blank. */\n notEmpty(value) {\n return value !== \"\"\n },\n /** Checkbox checked: `true`, or any value but `\"\"` / `\"false\"` (a checked checkbox's value, e.g. `on`). */\n checked(value, _, { raw }) {\n return raw === true || (raw !== false && value !== \"\" && value !== \"false\")\n },\n email(value) {\n return this.regExp.email.test(value)\n },\n url(value) {\n return this.regExp.url.test(value)\n },\n /** `regExp[/^\\d+$/i]`, a bare pattern `regExp[^\\d+$]`, or a real `RegExp`. */\n regExp(value, pattern) {\n if (pattern instanceof RegExp) return value.match(pattern) !== null\n const text = pattern ?? \"\"\n const parts = this.regExp.flags.exec(text)\n return value.match(parts ? new RegExp(parts[1], parts[2] ?? \"\") : new RegExp(text)) !== null\n },\n minValue(value, min) {\n return this.range(value, { range: `${String(min)}..`, pattern: this.regExp.number })\n },\n maxValue(value, max) {\n return this.range(value, { range: `..${String(max)}`, pattern: this.regExp.number })\n },\n /** Integer, optionally in `integer[min..max]`. */\n integer(value, range) {\n return this.range(value, { range, pattern: this.regExp.integer })\n },\n /** Integer in `range[min..max]`. */\n range(value, range) {\n return this.range(value, { range, pattern: this.regExp.integer })\n },\n /** Unsigned decimal, optionally in range. NOTE: Fomantic's pattern rejects negatives. */\n decimal(value, range) {\n return this.range(value, { range, pattern: this.regExp.decimal })\n },\n /** Number, optionally in range. NOTE: Fomantic's pattern accepts `\"\"`; pair with `notEmpty`. */\n number(value, range) {\n return this.range(value, { range, pattern: this.regExp.number })\n },\n is(value, text) {\n return value.toLowerCase() === String(text ?? \"\").toLowerCase()\n },\n isExactly(value, text) {\n return value === String(text ?? \"\")\n },\n not(value, text) {\n return value.toLowerCase() !== String(text ?? \"\").toLowerCase()\n },\n notExactly(value, text) {\n return value !== String(text ?? \"\")\n },\n contains(value, text) {\n return value.toLowerCase().includes(String(text ?? \"\").toLowerCase())\n },\n containsExactly(value, text) {\n return value.includes(String(text ?? \"\"))\n },\n doesntContain(value, text) {\n return !value.toLowerCase().includes(String(text ?? \"\").toLowerCase())\n },\n doesntContainExactly(value, text) {\n return !value.includes(String(text ?? \"\"))\n },\n minLength(value, min) {\n return this.range(value, { range: `${String(min)}..`, pattern: this.regExp.integer, measure: \"length\" })\n },\n exactLength(value, length) {\n const range = `${String(length)}..${String(length)}`\n return this.range(value, { range, pattern: this.regExp.integer, measure: \"length\" })\n },\n maxLength(value, max) {\n return this.range(value, { range: `..${String(max)}`, pattern: this.regExp.integer, measure: \"length\" })\n },\n /** Length in `size[min..max]`. */\n size(value, range) {\n return this.range(value, { range, pattern: this.regExp.integer, measure: \"length\" })\n },\n /** Equal to field `match[other]`; false when that field is missing. */\n match(value, other, { fieldValues }) {\n const otherValue = fieldValues?.[String(other)]\n return otherValue !== undefined && value === this.normalize(otherValue)\n },\n /** Differs from field `different[other]`; false when that field is missing, as Fomantic. */\n different(value, other, { fieldValues }) {\n const otherValue = fieldValues?.[String(other)]\n return otherValue !== undefined && value !== this.normalize(otherValue)\n },\n /**\n * Luhn-valid card number, optionally of `creditCard[visa,mastercard]` brands.\n * - Spaces and dashes allowed; UnionPay skips Luhn, as Fomantic.\n */\n creditCard(value, types) {\n const number = value.replace(/[\\s-]/g, \"\")\n if (!/^\\d+$/.test(number)) return false\n if (typeof types === \"string\" && types) {\n const brands = types.split(\",\").map((type) => this.cards[type.trim()])\n const known = brands.some((card) => card && card.length.includes(number.length) && card.pattern.test(number))\n if (!known) return false\n }\n const unionPay = this.cards.unionPay\n if (unionPay && unionPay.length.includes(number.length) && unionPay.pattern.test(number)) return true\n let sum = 0\n for (let index = number.length - 1, double = false; index >= 0; index--, double = !double) {\n const digit = number.charCodeAt(index) - 48\n sum += double ? LUHN_DOUBLED[digit] : digit\n }\n return sum % 10 === 0 && sum > 0\n },\n minCount(value, min, { raw }) {\n return this.count(value, raw) >= Number(min)\n },\n exactCount(value, count, { raw }) {\n return this.count(value, raw) === Number(count)\n },\n maxCount(value, max, { raw }) {\n return this.count(value, raw) <= Number(max)\n }\n }\n\n ////////////////\n // ## Validate\n ////////////////\n\n /**\n * Run `rules` against `value`; returns every failure with its prompt and Constraint Validation flag.\n * - Rules run in order and ALL run (Fomantic's default `errorLimit: 0`).\n * - `optional` skips everything when the value is blank.\n * - SIDE EFFECT (dev only): warns about unknown rule types, with a suggestion, and skips them.\n */\n validate(\n value: E.FieldValue,\n rules: readonly E.ValidationRule[],\n options: E.ValidateOptions = {}\n ): E.ValidationResult {\n const text = this.normalize(value, options)\n const errors: E.ValidationError[] = []\n if (!(options.optional && text === \"\")) {\n const context: E.RuleContext = { raw: value, fieldValues: options.fieldValues }\n for (const rule of rules) {\n const parsed = this.parseRule(rule)\n const test = this.rules[parsed.type]\n if (!test) {\n const guess = E.suggest(parsed.type, Object.keys(this.rules))\n E.Warnings.devWarn(\n \"Validator\",\n `unknown rule ${JSON.stringify(parsed.type)}${guess ? `; did you mean \"${guess}\"?` : \"\"}`\n )\n continue\n }\n if (test.call(this, text, parsed.value, context)) continue\n errors.push({\n type: parsed.type,\n ruleValue: parsed.value,\n message: this.prompt(parsed, text, options),\n flag: this.flagFor(parsed, text, value)\n })\n }\n }\n const flags: ValidityStateFlags = {}\n for (const error of errors) flags[error.flag] = true\n return { valid: errors.length === 0, errors, flags, message: errors[0]?.message ?? \"\" }\n }\n\n /**\n * True if `value` passes the single `rule`, e.g. `validator.test(\"minLength[6]\", \"secret\")`.\n * - Unknown rules pass.\n */\n test(rule: E.ValidationRule, value: E.FieldValue, fieldValues?: E.ValidateOptions[\"fieldValues\"]): boolean {\n return this.validate(value, [rule], { fieldValues }).valid\n }\n\n /**\n * `\"minLength[6]\"` => `{ type: \"minLength\", value: \"6\" }`; objects keep their `prompt`.\n * - Bracket runs from the FIRST `[` to the final `]`, so `regExp[/^[a-z]+$/]` keeps its inner brackets.\n * - An object's own `value` wins over a bracket in its `type`.\n */\n parseRule(rule: E.ValidationRule): E.ParsedRule {\n const source = typeof rule === \"string\" ? rule : rule.type\n const bracket = source.indexOf(\"[\")\n const hasBracket = bracket > 0 && source.endsWith(\"]\")\n const type = hasBracket ? source.slice(0, bracket) : source\n const bracketValue = hasBracket ? source.slice(bracket + 1, -1) : undefined\n if (typeof rule === \"string\") return { type, value: bracketValue }\n return { type, value: rule.value ?? bracketValue, prompt: rule.prompt }\n }\n\n /**\n * Interpolated message for a failed `rule`, as Fomantic's `get.prompt()`.\n * - `{name}` => label, `{identifier}` => name, `{value}` => the value, `{ruleValue}` => the bracket.\n * - Ranges (`integer[1..10]`) append Fomantic's range suffix to the default prompt:\n * \"Age must be an integer and must be in a range from 1 to 10\".\n * - `match` / `different` name the OTHER field by its label.\n */\n prompt(rule: E.ParsedRule, value: string, options: E.ValidateOptions = {}): string {\n const { prompts, text } = this\n const ruleValue = rule.value === undefined ? \"\" : String(rule.value)\n let prompt =\n typeof rule.prompt === \"function\"\n ? rule.prompt(value)\n : (rule.prompt ?? prompts[rule.type] ?? text.unspecifiedRule)\n if (ruleValue.includes(\"..\") && RANGE_PROMPT_RULES.has(rule.type)) {\n const [min, max] = ruleValue.split(\"..\", 2)\n if (!rule.prompt && RANGE_SUFFIX_RULES.has(rule.type)) {\n const suffix =\n min === \"\"\n ? prompts.maxValue.replaceAll(\"{ruleValue}\", \"{max}\")\n : max === \"\"\n ? prompts.minValue.replaceAll(\"{ruleValue}\", \"{min}\")\n : prompts.range\n prompt += suffix.replaceAll(\"{name}\", ` ${text.and}`)\n }\n prompt = prompt.replaceAll(\"{min}\", min).replaceAll(\"{max}\", max)\n }\n if (ruleValue && (rule.type === \"match\" || rule.type === \"different\")) {\n prompt = prompt.replaceAll(\"{ruleValue}\", options.fieldLabels?.[ruleValue] ?? ruleValue)\n }\n return prompt\n .replaceAll(\"{value}\", value)\n .replaceAll(\"{name}\", options.label ?? options.name ?? text.unspecifiedField)\n .replaceAll(\"{identifier}\", options.name ?? \"\")\n .replaceAll(\"{ruleValue}\", ruleValue)\n }\n\n ////////////////\n // ## Rule helpers\n ////////////////\n\n /**\n * `value` (or, `measure: \"length\"`, its length) matches `pattern` and lies within `range` (`\"min..max\"`, `\"n\"`,\n * `\"..max\"`): Fomantic's `rules.range()`, as a shared step.\n * - Ours: Fomantic's takes `(value, range, regExp, testLength)`, a positional boolean; rules call this one\n * with a `RangeTest`.\n * - Bounds that don't match `pattern` are ignored, as Fomantic.\n */\n range(value: string, { range, pattern, measure = \"value\" }: E.RangeTest): boolean {\n const bounds = this.bounds(range, pattern)\n const subject = measure === \"length\" ? String(value.length) : value\n const number = Number(subject)\n return (\n pattern.test(subject) &&\n (bounds.min === undefined || number >= bounds.min) &&\n (bounds.max === undefined || number <= bounds.max)\n )\n }\n\n /**\n * A field value as the rules see it: a string, trimmed unless `trim` is false (`ValidateOptions.trim`).\n * - `null` / `undefined` / `false` => `\"\"`; `true` => `\"true\"`; arrays comma-joined.\n */\n normalize(value: E.FieldValue, { trim = true }: Pick<E.ValidateOptions, \"trim\"> = {}): string {\n if (value == null || value === false) return \"\"\n const text = typeof value === \"string\" ? value : Array.isArray(value) ? value.join(\",\") : String(value)\n return trim ? text.trim() : text\n }\n\n /** Number of choices: the array's length, else comma-separated entries of `value`. */\n count(value: string, raw: E.FieldValue): number {\n if (Array.isArray(raw)) return raw.length\n return value === \"\" ? 0 : value.split(\",\").length\n }\n\n ////////////////\n // ## Internals\n ////////////////\n\n /**\n * Numeric `{ min, max }` of `range`; either may be `undefined` (open-ended).\n * - An EMPTY bound is open. Fomantic tests it against the pattern, and its `number` pattern matches `\"\"`,\n * so its `minValue[5]` (`\"5..\"`) gets `max = 0` and rejects everything positive.\n */\n private bounds(range: E.RuleValue, regExp: RegExp): { min?: number; max?: number } {\n const text = range === undefined ? \"\" : String(range)\n if (text === \"\" || text === \"..\") return {}\n if (!text.includes(\"..\")) return regExp.test(text) ? { min: Number(text), max: Number(text) } : {}\n const [min, max] = text.split(\"..\", 2)\n return {\n min: min !== \"\" && regExp.test(min) ? Number(min) : undefined,\n max: max !== \"\" && regExp.test(max) ? Number(max) : undefined\n }\n }\n\n /** Constraint Validation flag for a failed `rule`, resolving `\"auto\"` from the value. */\n private flagFor(rule: E.ParsedRule, value: string, raw: E.FieldValue): E.ValidityFlag {\n const flag = this.flags[rule.type] ?? \"customError\"\n if (flag !== \"auto\") return flag\n switch (rule.type) {\n case \"exactLength\":\n return value.length < Number(rule.value) ? \"tooShort\" : \"tooLong\"\n case \"size\":\n return value.length < (this.bounds(rule.value, this.regExp.integer).min ?? 0) ? \"tooShort\" : \"tooLong\"\n case \"exactCount\":\n return this.count(value, raw) < Number(rule.value) ? \"rangeUnderflow\" : \"rangeOverflow\"\n case \"minValue\":\n return this.regExp.number.test(value) ? \"rangeUnderflow\" : \"typeMismatch\"\n case \"maxValue\":\n return this.regExp.number.test(value) ? \"rangeOverflow\" : \"typeMismatch\"\n }\n const pattern =\n rule.type === \"decimal\" ? this.regExp.decimal : rule.type === \"number\" ? this.regExp.number : this.regExp.integer\n if (!pattern.test(value)) return \"typeMismatch\"\n return Number(value) < (this.bounds(rule.value, pattern).min ?? -Infinity) ? \"rangeUnderflow\" : \"rangeOverflow\"\n }\n}\n\n/** Rules whose `{min}` / `{max}` come from a `min..max` bracket. Fomantic's. */\nconst RANGE_PROMPT_RULES: ReadonlySet<string> = new Set([\"integer\", \"decimal\", \"number\", \"size\", \"range\"])\n\n/** Rules whose default prompt gets Fomantic's range suffix appended. */\nconst RANGE_SUFFIX_RULES: ReadonlySet<string> = new Set([\"integer\", \"decimal\", \"number\"])\n\n/** Luhn: digit => doubled digit's digit sum. */\nconst LUHN_DOUBLED: readonly number[] = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9]\n","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `MenuOptions`\n * The option model behind dropdown / select / search: filtering, additions, selection exclusion, keyboard\n * navigation, type-ahead and match highlighting. Pure data, NO DOM.\n * - Ported from SUI React's `getMenuOptions()` (filter => exclude selected => additions) with Fomantic's\n * dropdown `match` settings (`match`, `fullTextSearch`, `ignoreDiacritics`, `ignoreSearchCase`, `minCharacters`).\n * - Immutable: each step returns a NEW `MenuOptions`, so a render can keep the previous list, e.g.\n * `menu.excludeSelected(values).filter(query).withAdditions(query, { allowAdditions: true })`.\n * - Fast on 1000s of options: lower-cased (and, on demand, diacritic-stripped) search keys are computed\n * lazily ONCE per option object and shared by every derived list through a `WeakMap`.\n * - Library-neutral: no Solid, no element; of the core (`E`), it uses only the folder's types (`E.MenuOption` ...).\n ****************/\nexport class MenuOptions {\n /** The options in this list, in order. */\n readonly options: readonly (E.MenuOption | E.MenuAddition)[]\n\n /**\n * The pending addition from `withAdditions()` -- also set when `hideAdditions` keeps it out of `options`,\n * so Enter can still add it.\n */\n readonly addition: E.MenuAddition | undefined\n\n /** Search keys per option, shared with derived lists. */\n private readonly keys: WeakMap<E.MenuOption, MenuSearchKeys>\n\n /** A list of `options`; `addition` and `keys` are how a derived list carries its source's on. */\n constructor({ options = [], addition, keys = new WeakMap() }: MenuOptionsProps = {}) {\n this.options = options\n this.addition = addition\n this.keys = keys\n }\n\n /** Number of options. */\n get length() {\n return this.options.length\n }\n\n ////////////////\n // ## Filtering\n ////////////////\n\n /**\n * Options matching `query`, as Fomantic's `filterItems()`: prefix match always counts, then\n * `fullTextSearch` widens it (`\"exact\"` => substring, `true` => fuzzy).\n * - An empty query, or one shorter than `minCharacters`, filters nothing.\n * - `search: \"both\"` (default) matches text OR value.\n */\n filter(query: string, options: E.MenuFilterOptions = {}): MenuOptions {\n const { search = \"both\", fullTextSearch = \"exact\", ignoreDiacritics = false, ignoreCase = true } = options\n if (!query || query.length < (options.minCharacters ?? 0)) return this\n if (typeof search === \"function\") return this.derive(search(this.options, query))\n const folding = { ignoreCase, ignoreDiacritics }\n const term = this.normalize(query, folding)\n // `\"both\"` (or anything else) matches every field\n const fields: readonly E.MenuSearchField[] = search === \"text\" || search === \"value\" ? [search] : E.MenuSearchFields\n return this.derive(\n this.options.filter((option) =>\n fields.some((field) => MenuOptions.matches(this.key(option, field, folding), term, fullTextSearch))\n )\n )\n }\n\n /** Options whose value isn't in `values`, e.g. hide chosen labels in a multiple dropdown. */\n excludeSelected(values: Iterable<string>): MenuOptions {\n const selected = new Set(values)\n if (!selected.size) return this\n return this.derive(this.options.filter((option) => !selected.has(option.value)))\n }\n\n /**\n * Add `query` as a new option when additions are allowed and no option's text or value equals it.\n * - `additionPosition: \"top\"` (default) puts it first; `\"bottom\"` last.\n * - `hideAdditions` keeps it out of `options` but sets `addition`.\n * - NOTE: text / value equality is case-insensitive by default, so `Red` isn't offered next to `red`.\n */\n withAdditions(query: string, options: E.MenuAdditionOptions = {}): MenuOptions {\n const { allowAdditions = false, additionLabel = \"Add \", additionPosition = \"top\", hideAdditions = false } = options\n const term = query.trim()\n if (!allowAdditions || !term) return this\n const ignoreCase = options.ignoreCase ?? true\n const wanted = ignoreCase ? term.toLowerCase() : term\n const exists = this.options.some((option) => {\n const keys = this.keysFor(option)\n return ignoreCase\n ? keys.text === wanted || keys.value === wanted\n : option.text === wanted || option.value === wanted\n })\n if (exists) return this\n const addition: E.MenuAddition = { value: term, text: term, addition: true, label: additionLabel }\n if (hideAdditions) return new MenuOptions({ options: this.options, addition, keys: this.keys })\n const list = additionPosition === \"bottom\" ? [...this.options, addition] : [addition, ...this.options]\n return new MenuOptions({ options: list, addition, keys: this.keys })\n }\n\n ////////////////\n // ## Navigation\n ////////////////\n\n /**\n * Index of the enabled option `delta` steps from `from`, skipping disabled ones -- arrow keys, PageUp / Down.\n * - `from` may be `-1` (nothing active): `+1` lands on the first enabled option, `-1` on the last.\n * - Without `wrap`, stops at the ends: returns the last enabled option in that direction, or `from` if\n * there is none.\n * - `-1` when no option is enabled.\n * - The same steps over any list: `MenuOptions.nextEnabledIndexIn()`.\n */\n nextEnabledIndex(from: number, delta: number, options: E.MenuNavigateOptions = {}): number {\n return MenuOptions.nextEnabledIndexIn(this.options, from, delta, options)\n }\n\n /**\n * `nextEnabledIndex()`'s steps over `list`, any list of objects, each maybe `disabled`:\n * a search's results, an icon picker's cells (`HighlightedOption.move()`).\n * - STATIC: pure, needs no option model.\n */\n static nextEnabledIndexIn(\n list: readonly object[],\n from: number,\n delta: number,\n options: E.MenuNavigateOptions = {}\n ): number {\n const { length } = list\n const wrap = options.wrap ?? false\n const isDisabled = (index: number) => \"disabled\" in list[index] && !!list[index].disabled\n if (list.every((_option, index) => isDisabled(index))) return -1\n if (!delta) return from\n const step = delta > 0 ? 1 : -1\n const origin = from < 0 || from >= length ? (step > 0 ? -1 : length) : from\n const target = wrap ? MenuOptions.wrap(origin + delta, length) : E.clamp(origin + delta, 0, length - 1)\n for (let index = target, tries = 0; tries < length; tries++) {\n if (!isDisabled(index)) return index\n index += step\n if (wrap) index = MenuOptions.wrap(index, length)\n else if (index < 0 || index >= length) break\n }\n // Ran off an end without wrapping: take the furthest enabled option between `from` and that end.\n for (let index = target - step; index !== origin && index >= 0 && index < length; index -= step) {\n if (!isDisabled(index)) return index\n }\n return from\n }\n\n /**\n * Type-ahead: index of the next enabled option after `from` whose text starts with `prefix`, wrapping.\n * - Case- and diacritic-insensitive.\n * - Repeating one character (`\"aaa\"`) cycles through options starting with it, per the APG listbox pattern.\n * - `-1` when nothing matches. The element owns the keystroke buffer and its timeout.\n */\n selectionForKey(prefix: string, from = -1): number {\n const { length } = this.options\n if (!prefix || !length) return -1\n let term = this.normalize(prefix, TYPE_AHEAD)\n const repeated = REPEATED_CHARACTER.exec(term)\n if (repeated) term = repeated[1]\n // A multi-character buffer refines the CURRENT match, so start there; one character moves on.\n const start = term.length > 1 ? Math.max(from, 0) : from + 1\n for (let offset = 0; offset < length; offset++) {\n const index = (start + offset + length) % length\n const option = this.options[index]\n if (!option.disabled && this.key(option, \"text\", TYPE_AHEAD).startsWith(term)) return index\n }\n return -1\n }\n\n ////////////////\n // ## Highlighting\n ////////////////\n\n /**\n * Ranges of `option.text` matching `query`, for `highlightMatches`: one range for a contiguous match,\n * else one per fuzzy-matched character (adjacent ones merged).\n * - Indices are into the ORIGINAL text, even when diacritics or case were ignored.\n * - `[]` when nothing matches.\n */\n highlights(option: E.MenuOption, query: string, options: E.MenuFilterOptions = {}): E.HighlightRange[] {\n const { ignoreDiacritics = false, ignoreCase = true } = options\n if (!query) return []\n const folding = { ignoreCase, ignoreDiacritics }\n const term = this.normalize(query, folding)\n const { folded, origins } = this.fold(option.text, folding)\n const at = folded.indexOf(term)\n if (at >= 0) return [[origins[at], origins[at + term.length]]]\n const ranges: [number, number][] = []\n let position = 0\n for (const char of term) {\n const found = folded.indexOf(char, position)\n if (found < 0) return []\n const start = origins[found]\n const end = origins[found + char.length]\n const last = ranges.at(-1)\n if (last && last[1] === start) last[1] = end\n else ranges.push([start, end])\n position = found + char.length\n }\n return ranges\n }\n\n ////////////////\n // ## Internals\n ////////////////\n\n /** New list sharing this one's key cache. */\n private derive(options: readonly E.MenuOption[]) {\n return new MenuOptions({ options, keys: this.keys })\n }\n\n /** Cached keys for `option`, created on first use. */\n private keysFor(option: E.MenuOption): MenuSearchKeys {\n let keys = this.keys.get(option)\n if (!keys) {\n keys = { text: option.text.toLowerCase(), value: String(option.value).toLowerCase() }\n this.keys.set(option, keys)\n }\n return keys\n }\n\n /** `query` folded the same way as the keys it's compared with. */\n private normalize(query: string, { ignoreCase, ignoreDiacritics }: Folding) {\n const text = ignoreDiacritics ? E.withoutAccents(query) : query\n return ignoreCase ? text.toLowerCase() : text\n }\n\n /**\n * `text` folded char by char, with each folded index's origin in `text`, so highlight ranges map back.\n * - `origins` has one extra entry (`text.length`) so `origins[end]` works for a match at the very end.\n */\n private fold(text: string, { ignoreCase, ignoreDiacritics }: Folding) {\n let folded = \"\"\n const origins: number[] = []\n let index = 0\n for (const char of text) {\n let piece = ignoreDiacritics ? E.withoutAccents(char) : char\n if (ignoreCase) piece = piece.toLowerCase()\n for (let unit = 0; unit < piece.length; unit++) origins.push(index)\n folded += piece\n index += char.length\n }\n origins.push(index)\n return { folded, origins }\n }\n\n /**\n * `option`'s folded text or value for comparing with a folded query; the diacritic-free variant\n * is computed on first need and cached.\n */\n private key(option: E.MenuOption, field: E.MenuSearchField, { ignoreCase, ignoreDiacritics }: Folding) {\n if (!ignoreCase) {\n const raw = field === \"text\" ? option.text : String(option.value)\n return ignoreDiacritics ? E.withoutAccents(raw) : raw\n }\n const keys = this.keysFor(option)\n if (!ignoreDiacritics) return keys[field]\n if (field === \"text\") return (keys.plainText ??= E.withoutAccents(keys.text))\n return (keys.plainValue ??= E.withoutAccents(keys.value))\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /** `index` wrapped into `0 .. length - 1`. Static: pure arithmetic. */\n private static wrap(index: number, length: number) {\n return ((index % length) + length) % length\n }\n\n /**\n * Fomantic's match: prefix, else substring (`\"exact\"`) or in-order characters (`true`).\n * - Static: pure. `fullTextSearch` keeps Fomantic's shape (`MenuFilterOptions.fullTextSearch`).\n */\n private static matches(key: string, term: string, fullTextSearch: E.MenuFilterOptions[\"fullTextSearch\"]) {\n if (key.startsWith(term)) return true\n if (fullTextSearch === \"exact\") return key.includes(term)\n if (fullTextSearch === true) return MenuOptions.fuzzy(key, term)\n return false\n }\n\n /** Fomantic's `fuzzySearch()`: every character of `term` appears in `key`, in order. Static: pure. */\n private static fuzzy(key: string, term: string) {\n if (term.length > key.length) return false\n let position = 0\n for (let index = 0; index < term.length; index++) {\n position = key.indexOf(term[index], position) + 1\n if (!position) return false\n }\n return true\n }\n}\n\n/** Constructor props of `MenuOptions`. */\nexport type MenuOptionsProps = {\n /** the options, in order; default none */\n options?: readonly (E.MenuOption | E.MenuAddition)[]\n /** the pending addition (`withAdditions()`) */\n addition?: E.MenuAddition\n /** search keys per option, shared with derived lists; pass one to share it across lists made apart */\n keys?: WeakMap<E.MenuOption, MenuSearchKeys>\n}\n\n/** How a query and the keys it's compared with are folded (`MenuFilterOptions`' two switches, settled). */\ntype Folding = {\n /** lower-case both sides */\n ignoreCase: boolean\n /** strip diacritics from both sides */\n ignoreDiacritics: boolean\n}\n\n/** Lazily-filled search keys for one option (`MenuOptionsProps.keys`). */\nexport type MenuSearchKeys = {\n /** Lower-cased text. */\n text: string\n /** Lower-cased value. */\n value: string\n /** Lower-cased, diacritic-free text; computed on first `ignoreDiacritics` search. */\n plainText?: string\n /** Lower-cased, diacritic-free value. */\n plainValue?: string\n}\n\n/** How type-ahead folds: case- and diacritic-insensitive, whatever the filter says. */\nconst TYPE_AHEAD: Folding = { ignoreCase: true, ignoreDiacritics: true }\n\n/** One character typed more than once, e.g. `aaa`. */\nconst REPEATED_CHARACTER = /^(.)\\1+$/su\n","import { E } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\n// Import directly to avoid circular import: spell-element imports nothing of Spell UI, so it has always loaded first\nimport { state } from \"spell/element\"\n\n/****************\n * ### `HighlightedOption`\n * The ONE highlighted option of a list a control opens: what the arrows move, Enter picks,\n * and `aria-activedescendant` points at.\n * - Shared by `<ui-dropdown>`'s options, `<ui-search>`'s results and `<ui-icon-picker>`'s cells.\n * - Reactive (`index`), so a component draws from it and its effects follow it.\n * - Knows its list only through `list()`, read fresh each time: a filtered list keeps the highlight's index,\n * so the control says what a new list does to it (`clear()`, `index = 0` ...).\n * - Steps as `MenuOptions.nextEnabledIndexIn()` does: disabled options skipped, stopping at the ends unless `wrap`.\n ****************/\nexport class HighlightedOption<T extends object> {\n /** Index into `list()` of the highlighted option; `-1` for none. */\n @state accessor index = -1\n\n /** The list the highlight moves through, read fresh each time. */\n private readonly list: () => readonly T[]\n\n constructor(list: () => readonly T[]) {\n this.list = list\n }\n\n /** The highlighted option; `undefined` for none. */\n get option(): T | undefined {\n return this.list()[this.index]\n }\n\n /** Highlight `option`, when it's in the list (the pointer over a row). */\n highlight(option: T) {\n const at = this.list().indexOf(option)\n if (at >= 0 && at !== this.index) this.index = at\n }\n\n /**\n * Move the highlight `delta` enabled options (an arrow key, PageUp / Down): from none, `+1` is the first.\n * - `-1` for none when the list has no enabled option.\n */\n move(delta: number, options?: E.MenuNavigateOptions) {\n this.index = F.MenuOptions.nextEnabledIndexIn(this.list(), this.index, delta, options)\n }\n\n /** Highlight the first (`\"first\"`) or last (`\"last\"`) enabled option: Home / End. */\n moveTo(end: \"first\" | \"last\") {\n this.index = F.MenuOptions.nextEnabledIndexIn(this.list(), -1, end === \"first\" ? 1 : -1)\n }\n\n /** Nothing highlighted. */\n clear() {\n this.index = -1\n }\n}\n","import { E } from \"spell/ui/core\"\nimport type { F } from \"spell/ui/forms\"\n\n/****************\n * ### `DOMFormControl`\n * The DOM element of a form control (`<ui-dropdown>`, `<ui-input>`, `<ui-checkbox>` ...):\n * it adds the platform's form-control API (`form`, `validity`, `checkValidity()` ...), read from `internals`.\n * - Its component is a `FormComponent`, whose `elementSetup.DOMElement` names this class.\n * A control's own subclass names its component class (`DOMCheckElement extends F.DOMFormControl<CheckControl>`).\n * - Form association itself is `elementSetup.isAFormControl`\n * (DOM API `static formAssociated`, set per tag by `UIComponent.define()`).\n * - The browser's form callbacks reach the component as its methods (`onFormReset()`, `onFormDisabled()` ...),\n * through `DOMElement`.\n * - A reset clears the component's `isTouched` first: so no control's `onFormReset()` has to.\n * - `<ui-button type=\"submit|reset\">` is form-associated too, but keeps `DOMElement`: it needs no value or validity.\n * - Part of the `forms` entry: extends `E.DOMElement` through the `spell/ui/core` ENTRY, never its leaf.\n * Safe while this module evaluates, since the core never imports `forms` (see `FormComponent`).\n * - `null` where the platform says it (`form`): the same API as a native control.\n ****************/\nexport class DOMFormControl<C extends F.FormComponent<any> = F.FormComponent<any>> extends E.DOMElement<C> {\n /** Form owner; `null` outside a form, as a native control's. */\n get form(): HTMLFormElement | null {\n return this.internals.form\n }\n\n /** Constraint validation state. */\n get validity(): ValidityState {\n return this.internals.validity\n }\n\n /** Current validation message. */\n get validationMessage(): string {\n return this.internals.validationMessage\n }\n\n /** Takes part in constraint validation? */\n get willValidate(): boolean {\n return this.internals.willValidate\n }\n\n /** `<label>`s pointing at this element. */\n get labels(): NodeList {\n return this.internals.labels\n }\n\n /** Valid? Fires `invalid` when not. */\n checkValidity(): boolean {\n return this.internals.checkValidity()\n }\n\n /** Valid? Shows the browser's message when not. */\n reportValidity(): boolean {\n return this.internals.reportValidity()\n }\n\n /**\n * DOM API: the form was reset.\n * - The component forgets the interaction (`isTouched`), then restores its starting value (`onFormReset()`).\n */\n formResetCallback() {\n if (this.component) this.component.isTouched = false\n super.formResetCallback()\n }\n}\n","import { E, UIT } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\n// Import directly to avoid circular import\nimport { DOMFormControl } from \"./DOMFormControl\"\nimport { Validator } from \"./Validator\"\n\n/****************\n * ### `FormComponent`\n * The base class of the form controls' components (`UIInput`, `UIDropdown`, `UICheckbox` ...):\n * the form value, validity, reset, and a `<fieldset disabled>` around it.\n * - `elementSetup.isAFormControl` makes the DOM element a form control (DOM API `static formAssociated`);\n * its DOM element class is a `DOMFormControl` (the form-control API).\n * - The browser's form callbacks arrive as methods (`UIComponent`, \"Lifecycle\"):\n * a reset as `onFormReset()`, a `<fieldset disabled>` as `formIsDisabled`.\n * - Pushes `formValue` into `ElementInternals.setFormValue()`:\n * a `string[]` becomes a `FormData` with one entry per value,\n * so `new FormData(form).getAll(name)` returns them all.\n * - Pushes `validationRules`, through `Validator`, into `setValidity()`.\n * - `:state(invalid)` follows `isShownInvalid`: at once, or only once someone has interacted (`invalidShows`).\n * The anchor for the browser's bubble is `validationAnchor`.\n *\n * - What every control gets from here, so it writes none of it:\n * - `isDisabled`: its `disabled` attribute, or a disabled fieldset (`isMarkedDisabled`);\n * the `disabled` class follows it, and `:state(disabled)` (`UIComponent`)\n * - `isReadOnly`: `readonly`, with `:state(readonly)`\n * - `labels` (`ControlLabels`): what names the DOM element (`<label for>`, `aria-label` ...),\n * as `accessibleName` for its inner control; read again each time it connects\n * - `isTouched`: someone has interacted; an `invalid` event (a submit, `reportValidity()`) sets it,\n * a form reset clears it (`DOMFormControl`)\n * - `formName`: `name`\n * - `validationRules`: `required` => Fomantic's `notEmpty`\n * - a click aimed at the DOM element itself (its `<label for>`, its `click()`) calls `activateControl()`\n * - Every form vocabulary has `disabled`, `name` and `required`: their getters are typed here once (`FormAttributes`).\n *\n * - Part of the `forms` entry: reaches the element core through the `spell/ui/core` ENTRY (`E`), never its leaves,\n * or the build splits what `core` and `forms` share into a third chunk.\n * - `E.UIComponent` and the decorators (`@E.proto`, `@E.onChange` ...) are safe while this module evaluates:\n * the core never imports `forms`, so it has always finished loading first.\n * - Its `forms` peers `DOMFormControl` / `Validator` come directly:\n * static initializers read them (WWOD §4 › \"Circular imports\").\n * - `ControlLabels` comes through `F`, as only an instance field reads it.\n ****************/\nexport abstract class FormComponent<V extends E.ComponentVocabulary = E.ComponentVocabulary> extends E.UIComponent<V> {\n @E.protoMerged static elementSetup: Partial<E.ElementSetup> = {\n // with the form-control API\n DOMElement: DOMFormControl,\n isAFormControl: true,\n // each control disables its native control: still in the accessibility tree, as a disabled control\n disabled: \"its own\"\n }\n\n /**\n * The DOM element, as the form control it is (`elementSetup.DOMElement`): `form`, `validity`, `internals` ...\n * - `declare`, a type only: the constructor (`UIComponent`) sets it.\n */\n declare readonly domElement: DOMFormControl\n\n constructor(...args: ConstructorParameters<typeof E.UIComponent>) {\n super(...args)\n // here, not in a field initializer: TypeScript refuses one reading `domElement`, `declare`d above (TS2729)\n this.labels = new F.ControlLabels(this.domElement)\n }\n\n ////////////////\n // ## Value\n ////////////////\n\n /**\n * Hook: value to submit; tracked.\n * - `null` / `undefined` submits nothing.\n */\n abstract get formValue(): E.FieldValue\n\n /** Hook: field name for `FormData` entries of a multi-value control; default `name`. */\n protected get formName(): string | undefined {\n return this.name\n }\n\n /**\n * Hook: what `setFormValue()` gets for `value`; default `FormComponent.submission()`.\n * - A file input overrides it to submit its `File`s.\n */\n protected formSubmission(value: E.FieldValue, name: string | undefined): string | File | FormData | null {\n return FormComponent.submission(value, name)\n }\n\n /** The value (or its name) changed: hand the submission to the form. */\n @E.onChange(\"formValue\", \"formName\")\n protected onFormValueChanged(value: E.FieldValue, name: string | undefined) {\n this.domElement.internals.setFormValue(this.formSubmission(value, name))\n }\n\n /**\n * Hook: restore the starting value (DOM API `formResetCallback()`); every form control has one.\n * - `isTouched` is already cleared when it runs (`DOMFormControl`).\n */\n abstract onFormReset(): void\n\n ////////////////\n // ## Validity\n ////////////////\n\n /**\n * `validationRules` checked against `validationValue`.\n * - A plain getter for now: `brand`'s hooks still read `Cell`s and memos, which a `@derived` cache can't see change.\n * It becomes `@derived` once they read record members (`TextControl`'s override is one already).\n */\n get validation(): E.ValidationResult {\n return FormComponent.validator.validate(this.validationValue, this.validationRules, { label: this.validationLabel })\n }\n\n /**\n * Hook: validation rules; default: `required` => Fomantic's `notEmpty`, else none.\n * - `notEmpty` checks `validationValue`: a control with a default it shows before anyone chose\n * (a slider's `min`, a colour picker's colour) leaves it empty until a value is set.\n * - Not `rules`: the attribute of `<ui-input>`, `<ui-textarea>` and `<ui-form>`,\n * whose getter a base member of that name would hide (`UIComponent`'s doc).\n */\n protected get validationRules(): E.ValidationRule[] {\n return this.required ? [UIT.REQUIRED_RULE] : []\n }\n\n /**\n * Hook: value `validationRules` check; tracked.\n * - Default: `formValue`.\n * - A checkbox checks its chosen state alone: its `off-value` is submitted, yet never \"checked\".\n */\n protected get validationValue(): E.FieldValue {\n return this.formValue\n }\n\n /** Hook: label used in validation messages. */\n protected get validationLabel(): string | undefined {\n return undefined\n }\n\n /** Hook: element the browser anchors its validation bubble to. */\n protected get validationAnchor(): HTMLElement | undefined {\n return undefined\n }\n\n /**\n * When `:state(invalid)` shows: `\"at once\"` (as `:invalid` does), or `\"once touched\"` (as `:user-invalid` does).\n * - See `@proto static invalidShows`.\n */\n declare readonly invalidShows: E.InvalidTiming\n\n /**\n * Class setting: when `:state(invalid)` shows.\n * - Default `\"at once\"`.\n * - Text and check controls and the rating wait for the person: `\"once touched\"`.\n */\n @E.proto static invalidShows: E.InvalidTiming = \"at once\"\n\n /**\n * Shown as invalid? Invalid, and (`invalidShows: \"once touched\"`) touched; tracked.\n * - `:state(invalid)`, which every form vocabulary names.\n * Text and check controls and the rating hand it to their inner control as `aria-invalid`.\n * - Set by `onValidationChanged()`, NOT `@cssState`:\n * - the one `:state()` render effect also reads a radio's own `selected`,\n * and a group's validation reads every member's\n * - so it would draw a frame against a stale membership while the group unchooses the others\n * (`EFFECT_RELAY_TEAR`, `UICheckbox.test.tsx`)\n */\n get isShownInvalid(): boolean {\n return !this.validation.valid && (this.invalidShows === \"at once\" || this.isTouched)\n }\n\n /**\n * The validation changed: hand the result (and the bubble's anchor) to the form, and show it (`:state(invalid)`).\n */\n @E.onChange(\"validation\", \"isShownInvalid\")\n protected onValidationChanged(result: E.ValidationResult, isShownInvalid: boolean) {\n const { internals } = this.domElement\n if (result.valid) internals.setValidity({})\n else internals.setValidity(result.flags, result.message, this.validationAnchor)\n this.domElement.setState(INVALID_STATE, isShownInvalid)\n }\n\n ////////////////\n // ## Interaction\n ////////////////\n\n /**\n * Has someone interacted with it?\n * - Only then does a `\"once touched\"` control show `:state(invalid)`.\n * - Set here by an `invalid` event; a control sets it on its own interactions too (a choice, a committed edit).\n * - Cleared by a form reset, before `onFormReset()` (`DOMFormControl`).\n */\n @E.state accessor isTouched = false\n\n /** A submit or `reportValidity()` found it invalid: show it. */\n @E.on(\"invalid\")\n protected onInvalid() {\n this.isTouched = true\n }\n\n ////////////////\n // ## Name\n ////////////////\n\n /**\n * What names the DOM element (`<label for>`, a wrapping `<label>`, `aria-label`, `aria-labelledby`),\n * as `labels.accessibleName`: the name a control hands its inner control (its `<input>`, its group).\n * - Created by the constructor, under the component's owner, as `ControlLabels` needs.\n */\n readonly labels: F.ControlLabels\n\n /** Connected: read the labels again (they may be others now). */\n @E.whileConnected\n protected refreshLabels() {\n this.labels.refresh()\n }\n\n ////////////////\n // ## Disabled\n ////////////////\n\n /**\n * Disabled by its `disabled` attribute, or by a disabled fieldset / form (`isMarkedDisabled`).\n * - Unusable its own way (`elementSetup.disabled` is `\"its own\"`): each control disables its native control,\n * so it stays in the accessibility tree as a disabled control, where the base class would make it inert.\n */\n get isDisabled(): boolean {\n return this.isMarkedDisabled\n }\n\n /** The `disabled` class follows `isDisabled`: a disabled fieldset adds it too. */\n protected classValue(name: E.AttributeName<V>): unknown {\n if (name === \"disabled\") return this.isDisabled\n return super.classValue(name)\n }\n\n ////////////////\n // ## Read-only\n ////////////////\n\n /**\n * Is `readonly` set? `:state(readonly)`.\n * - It shows its value, can be focused, and is submitted, but people can't change it (unlike `disabled`).\n * - Every form control's vocabulary declares it (`property: \"readOnly\"`, as the platform's),\n * each saying what it does there; `false` where one doesn't.\n * - Each control refuses changes its own way (its native control's `readonly`, a click it ignores ...).\n */\n @E.cssState(\"readonly\")\n get isReadOnly(): boolean {\n return E.Reactive.attributeValue(this, \"readonly\") === true\n }\n\n ////////////////\n // ## Activation\n ////////////////\n\n /**\n * A click aimed at the DOM element itself (its `<label for>`, its `click()`):\n * `activateControl()`, unless disabled.\n * - Clicks from inside the shadow root arrive retargeted, and are left alone.\n */\n @E.on(\"click\")\n protected onDOMElementClick(event: MouseEvent) {\n if (event.composedPath()[0] !== this.domElement || this.isDisabled) return\n this.activateControl()\n }\n\n /**\n * Hook: what a click aimed at the DOM element itself does; default nothing.\n * - A text control focuses its `<input>`, a rating its tab stop, a slider its first thumb.\n * - A checkbox clicks its input, as a native `<label>` does.\n */\n protected activateControl() {}\n\n ////////////////\n // ## Statics\n ////////////////\n\n /**\n * Fomantic's rules, for every form control (and `FormFields`, `UIRadio`'s group).\n * - Static: ONE for the page; it's stateless, its data on the prototype (`Validator`).\n */\n static validator = new Validator()\n\n /**\n * What `setFormValue()` takes for `value`: a string, a `FormData` of one entry per array item, or `null`.\n * - `null`: the platform's \"submit nothing\" (`setFormValue()` is a boundary that takes it).\n * - Static: pure; `formSubmission()` is the per-element hook over it.\n * - NOTE: a `FormData` needs `name`; unnamed controls submit nothing anyway.\n */\n static submission(value: E.FieldValue, name: string | undefined): string | FormData | null {\n if (value == null || value === false) return null\n if (!Array.isArray(value)) return String(value)\n if (!name) return null\n const data = new FormData()\n for (const item of value as readonly string[]) data.append(name, item)\n return data\n }\n}\n\n/**\n * The vocabulary getters every form control's vocabulary has, typed once for this base\n * (see \"Attributes\" in `UIComponent`).\n */\nexport interface FormComponent<V extends E.ComponentVocabulary = E.ComponentVocabulary> extends FormAttributes {}\n\n/** Getters of the attributes every form vocabulary declares. */\ntype FormAttributes = {\n /** the `disabled` attribute (a disabled fieldset is `formIsDisabled`) */\n disabled: boolean\n /** the form field's name */\n name: string | undefined\n /**\n * a value is needed\n * - A slider or colour picker set up with no value fails it, though it shows a default (`validationValue`).\n */\n required: boolean\n}\n\n/**\n * `:state()` for failed validation.\n * - Every form vocabulary names it `invalid`: here, not per component, because the base sets it.\n */\nconst INVALID_STATE = \"invalid\"\n","import { E } from \"spell/ui/core\"\nimport type { F } from \"spell/ui/forms\"\n\n/****************\n * ### `LabelWatch`\n * One `MutationObserver` per root node (document or shadow root), shared by the `ControlLabels` in it: refreshes\n * the controls a `<label>` added, removed or re-pointed (`for`) there may name.\n * - Cheap by scope: exists only while a control is connected in that root; a batch without a `<label>` in it\n * costs one pass over its records.\n * - Targeted: a label with `for` refreshes the controls with that id (old and new `for`); one without (a wrapping\n * label) refreshes every control in the root.\n * - `ControlLabels`' helper, in a file of its own (WWOD §8 › \"One exported class per file\"): only it imports this,\n * so it's in neither the `spell/ui/elements` barrel nor the `forms` entry. Knows `ControlLabels` as a type only.\n ****************/\nexport class LabelWatch {\n /** Controls in this root. */\n private readonly members = new Set<F.ControlLabels>()\n\n /** The observer, while there are members. */\n private observer?: MutationObserver\n\n /** The root node watched. */\n private readonly root: Node\n\n /** A watch over `root`; callers go through `LabelWatch.of()`, so there's one per root. */\n constructor(root: Node) {\n this.root = root\n }\n\n /** Start refreshing `member`; observes from the first one. */\n add(member: F.ControlLabels) {\n this.members.add(member)\n if (this.observer) return\n this.observer = new MutationObserver((records) => this.changed(records))\n this.observer.observe(this.root, {\n childList: true,\n subtree: true,\n attributeFilter: [\"for\"],\n attributeOldValue: true\n })\n }\n\n /** Stop refreshing `member`; stops observing after the last one. */\n remove(member: F.ControlLabels) {\n this.members.delete(member)\n if (this.members.size) return\n this.observer?.disconnect()\n this.observer = undefined\n }\n\n /** Refresh the members `records` may concern. */\n private changed(records: MutationRecord[]) {\n const ids = new Set<string>()\n let all = false\n for (const record of records) {\n if (record.type === \"attributes\") {\n if (!LabelWatch.isLabel(record.target)) continue\n if (record.oldValue) ids.add(record.oldValue)\n ids.add(record.target.htmlFor)\n continue\n }\n for (const nodes of [record.addedNodes, record.removedNodes]) {\n for (const node of nodes) {\n if (node.nodeType !== E.NodeType.element) continue\n const element = node as Element\n const labels = LabelWatch.isLabel(element) ? [element] : element.getElementsByTagName(\"label\")\n for (const label of labels as Iterable<HTMLLabelElement>) {\n if (label.htmlFor) ids.add(label.htmlFor)\n else all = true\n }\n }\n }\n }\n if (!all && !ids.size) return\n for (const member of [...this.members]) if (all || ids.has(member.id)) member.refresh()\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /** The watch for `root`, created on first use. Static: the one registry of every root's watch. */\n static of(root: Node): LabelWatch {\n let watch = LabelWatch.watches.get(root)\n if (!watch) LabelWatch.watches.set(root, (watch = new LabelWatch(root)))\n return watch\n }\n\n /**\n * Forget every root's watch, for tests.\n * - NOTE: a watch already handed out keeps observing until its last member leaves.\n */\n static reset() {\n LabelWatch.watches = new WeakMap()\n }\n\n /** Watches by root node: page-wide, so every control in a root shares one observer. */\n private static watches = new WeakMap<Node, LabelWatch>()\n\n /** Is `node` a `<label>`? By `localName`: no `HTMLLabelElement` global in a server render. */\n private static isLabel(node: Node): node is HTMLLabelElement {\n return (node as Element).localName === \"label\"\n }\n}\n","import { onSettled } from \"solid-js\"\nimport { isServer } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport type { F } from \"spell/ui/forms\"\n// Not in the `forms` entry: `ControlLabels`' own helper\nimport { LabelWatch } from \"./LabelWatch\"\n\n/****************\n * ### `ControlLabels`\n * The accessible name of a form control's INNER element (the `<input>` in its shadow root), from whatever names\n * its DOM element.\n * - Why: `<label for=\"email\">` + `<ui-input id=\"email\">` labels the DOM element (`ElementInternals.labels`), but the\n * focusable element inside has no name of its own, and `aria-labelledby` can't point across the shadow boundary.\n * The element hands `accessibleName` to its inner control as `aria-label`.\n * - Sources, first wins:\n * - DOM element `aria-label`\n * - DOM element `aria-labelledby`: ids resolved in the DOM element's tree, their text joined\n * - the DOM element's `<label>`s (`internals.labels`), their text joined --\n * text inside the DOM element itself is skipped,\n * so a wrapping `<label>Name <ui-input></ui-input></label>` names it \"Name\"\n * - Watched (`MutationObserver`s), re-read on connect and on focus too:\n * - the DOM element's attributes\n * - the current labels' text\n * - `<label>`s added to / removed from the DOM element's tree, and their `for` changes: ONE observer per root node\n * (document or shadow root), shared by every control in it (`LabelWatch`)\n * - NOTE: `aria-labelledby` targets added later are not watched\n * - Server render (`spell/ui/static`): read ONCE, in the constructor, from the parsed page (`serverLabels()`);\n * nothing is watched. Why: a slider thumb, a rating's radio group, an inline calendar's group can't be named by\n * a `<label for>` on the static page either.\n * - MUST be created under the element's owner (it creates an `onSettled`).\n * - Part of the `forms` entry: reaches the core through the `spell/ui/core` ENTRY (`E`), never its leaves, and its\n * `forms` peers through `F` (`forms.ts`); `LabelWatch` directly, its own helper, in neither entry. `@E.state` is\n * safe while this module evaluates: the core never imports `forms`.\n ****************/\nexport class ControlLabels {\n /**\n * The inner control's accessible name (the platform's term); tracked.\n * - `undefined` when nothing names the DOM element.\n */\n @E.state accessor accessibleName: string | undefined = undefined\n\n /** The DOM element. */\n private readonly domElement: F.DOMFormControl\n\n /** Watches the labels found last. */\n private labelObserver?: MutationObserver\n\n /** Watches the DOM element's root node for `<label>`s coming and going. */\n private watch?: LabelWatch\n\n /** The name of `domElement`'s inner control; call it under the element's owner. */\n constructor(domElement: F.DOMFormControl) {\n this.domElement = domElement\n // a server render (`spell/ui/static`) reads the page once: nothing changes, nothing is watched\n if (isServer) {\n this.accessibleName = this.nameFor(this.serverLabels())\n return\n }\n onSettled(() => {\n const refresh = () => this.refresh()\n const attributeObserver = new MutationObserver(refresh)\n attributeObserver.observe(domElement, { attributeFilter: WATCHED_ATTRIBUTES })\n domElement.addEventListener(\"focusin\", refresh)\n this.refresh()\n return () => {\n attributeObserver.disconnect()\n this.labelObserver?.disconnect()\n this.watch?.remove(this)\n this.watch = undefined\n domElement.removeEventListener(\"focusin\", refresh)\n }\n })\n }\n\n /** Its DOM element's `id`: which `<label for>`s concern it (`LabelWatch`). */\n get id(): string {\n return this.domElement.id\n }\n\n /** Re-read the name now, and re-watch the current labels and root; call on connect. */\n refresh() {\n const { domElement } = this\n const watch = domElement.isConnected ? LabelWatch.of(domElement.getRootNode()) : undefined\n if (watch !== this.watch) {\n this.watch?.remove(this)\n watch?.add(this)\n this.watch = watch\n }\n const labels = this.labels()\n this.labelObserver?.disconnect()\n if (labels.length) {\n this.labelObserver ??= new MutationObserver(() => this.refresh())\n for (const label of labels) {\n this.labelObserver.observe(label, { childList: true, characterData: true, subtree: true })\n }\n }\n this.accessibleName = this.nameFor(labels)\n }\n\n ////////////////\n // ## Reading the name\n ////////////////\n\n /**\n * The `<label>`s naming the DOM element, in document order.\n * - `internals.labels`, checked against `label.control`, plus the root's `<label for>` this DOM element's `id`:\n * Firefox leaves `internals.labels` stale when a label's `for` changes (a retargeted label stays in it,\n * and one retargeted to the DOM element never joins it).\n */\n private labels(): HTMLLabelElement[] {\n const { domElement } = this\n const found = new Set(domElement.labels as NodeListOf<HTMLLabelElement>)\n if (domElement.id && domElement.isConnected) {\n const root = domElement.getRootNode() as Document | ShadowRoot\n const selector = `label[for=\"${CSS.escape(domElement.id)}\"]`\n for (const label of root.querySelectorAll<HTMLLabelElement>(selector)) found.add(label)\n }\n return [...found].filter((label) => label.control === domElement).sort(E.byDocumentOrder)\n }\n\n /**\n * `labels()` in a server render, where the DOM element is a linkedom element: no `internals.labels`,\n * no `label.control`, no `CSS.escape`.\n * - The `<label>` wrapping the DOM element (without a `for`, or `for` its id),\n * then the root's `<label for>` its `id`; in document order, as an ancestor comes first.\n */\n private serverLabels(): HTMLLabelElement[] {\n const { domElement } = this\n const found = new Set<HTMLLabelElement>()\n const wrapping = domElement.parentElement?.closest<HTMLLabelElement>(\"label\")\n const wrappingFor = wrapping?.getAttribute(\"for\")\n if (wrapping && (wrappingFor === null || wrappingFor === domElement.id)) found.add(wrapping)\n if (domElement.id) {\n const root = domElement.getRootNode() as Document | ShadowRoot\n const id = domElement.id.replace(/[\"\\\\]/g, \"\\\\$&\")\n const selector = `label[for=\"${id}\"]`\n for (const label of root.querySelectorAll?.<HTMLLabelElement>(selector) ?? []) found.add(label)\n }\n return [...found]\n }\n\n /** The name from the DOM element's attributes, else from `labels`. */\n private nameFor(labels: readonly HTMLLabelElement[]): string | undefined {\n const { domElement } = this\n const own = domElement.getAttribute(\"aria-label\")?.trim()\n if (own) return own\n const ids = domElement.getAttribute(\"aria-labelledby\")?.trim()\n if (ids) {\n const root = domElement.getRootNode() as Document | ShadowRoot\n const text = ids\n .split(/\\s+/)\n .map((id) => root.getElementById?.(id)?.textContent?.trim() ?? \"\")\n .filter(Boolean)\n .join(\" \")\n if (text) return text\n }\n const text = labels\n .map((label) => this.labelTextFor(label))\n .filter(Boolean)\n .join(\" \")\n return text || undefined\n }\n\n /** Text of `label`, minus anything inside the DOM element, whitespace collapsed. */\n private labelTextFor(label: HTMLLabelElement): string {\n return this.textFor(label).replace(/\\s+/g, \" \").trim()\n }\n\n /**\n * Text nodes' text under `node`, in order, skipping the DOM element's subtree.\n * - A walk over `childNodes`, not a `TreeWalker`: a server render's linkedom document has none.\n */\n private textFor(node: Node): string {\n if (node === this.domElement) return \"\"\n if (node.nodeType === E.NodeType.text) return node.textContent ?? \"\"\n let text = \"\"\n for (const child of node.childNodes) text += this.textFor(child)\n return text\n }\n}\n\n/** DOM element attributes that change the name (`id` changes which `<label for>`s match). */\nconst WATCHED_ATTRIBUTES = [\"aria-label\", \"aria-labelledby\", \"id\"]\n","/**\n * `forms` lib entry (`spell/ui/forms`): what only form controls with a VALUE need,\n * split from `core` so a page without one never loads it.\n * - `FormComponent` (form value, validity, reset) on a `DOMFormControl` (the form-control API)\n * - `Validator` (Fomantic's rules)\n * - `MenuOptions` (search, additions, keyboard navigation of an option list)\n * - `HighlightedOption` (the highlighted option of a list a control opens: dropdown, search, icon picker)\n * - `ControlLabels` (the DOM element's `<label>`s as the inner control's name)\n * - NOT `PopoverPanel`, the panel a control opens under itself: `core`'s, since a menu opens one too.\n * - Imported by the families with a value:\n * `checkbox`, `dropdown`, `form`, `input`, `select`, `search`, `calendar`, `rating` and `slider`.\n * - `ui-button` is form-associated too (submit / reset), but through `elementSetup.isAFormControl` alone:\n * it needs no value, validity or form API, so it stays on `core`.\n * - NOTE: re-exports `spell/ui/elements` leaves one by one, for the reason given in `core.ts`.\n * - NOTE: every `forms` file imports the element core through the `spell/ui/core` ENTRY (`E`), never its leaves,\n * or Rolldown hoists what `core` and `forms` share into a third, hashed chunk.\n * - They reach each other through `F`,\n * except what a class definition reads (`FormComponent`'s `DOMFormControl`, `Validator`):\n * that comes directly (WWOD §4 › \"Circular imports\").\n */\n\nexport * from \"spell/ui/elements/Validator\"\nexport * from \"spell/ui/elements/MenuOptions\"\nexport * from \"spell/ui/elements/HighlightedOption\"\nexport * from \"spell/ui/elements/DOMFormControl\"\nexport * from \"spell/ui/elements/FormComponent\"\nexport * from \"spell/ui/elements/ControlLabels\"\n\n/** The `forms` namespace: `import { F } from \"spell/ui/forms\"`, then `F.FormComponent` (`AGENTS.md`). */\nexport * as F from \"spell/ui/forms\"\n"],"mappings":";;;;;AAAA,IAAAmC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,KAuCE,CAACvC,CAAE,GAvCLD;AAwEE,IAAA,CAACC,CAAE,GAOH,IAAA,CAACA,CAAE,GAUH,IAAA,CAACA,CAAE,GAkBH,IAAA,CAACA,CAAE,GAoCH,IAAA,CAACA,CAAE;AA3HE,IAAM0C,IAAN,MAAM,WAAU;CAiQrB,SACE,GACA,GACA,IAA6B,CAAC,GACV;EACpB,IAAMC,IAAO,KAAK,UAAUC,GAAOC,CAAO,GACpCC,IAA8B,CAAC;EACrC,IAAI,EAAED,EAAQ,YAAYF,MAAS,KAAK;GACtC,IAAMI,IAAyB;IAAE,KAAKH;IAAO,aAAaC,EAAQ;GAAY;GAC9E,KAAA,IAAWG,KAAQC,GAAO;IACxB,I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AAC,CAAA,CACvC,OAAO,OAAO,CAAA,CACd,KAAK,GACD,KAAQ,KAAA;CACjB;CAGQ,aAAa,GAAiC;EACpD,OAAO,KAAK,QAAQA,CAAK,CAAA,CAAE,QAAQ,QAAQ,GAAG,CAAA,CAAE,KAAK;CACvD;CAMQ,QAAQ,GAAoB;EAClC,IAAIJ,MAAS,KAAK,YAAY,OAAO;EACrC,IAAIA,EAAK,aAAAC,EAAwB,MAAM,OAAOD,EAAK,eAAe;EAClE,IAAIlJ,IAAO;EACX,KAAA,IAAWwK,KAAStB,EAAK,YAAY,KAAQ,KAAK,QAAQsB,CAAK;EAC/D,OAAOxK;CACT;AACF;AAjJO,IAAAb,EAAA,IAAA,GAKa,oBAAA,IAAA,QAAA,GAATH,EAAAyK,GAAA,GAAS,kBAAlBD,IALWG,GAKOD,CAAA,GALbzK,EAAAwK,GAAME,CAAA,GAAc9K,EAAA8K,GAAA,eAAA;AAApB,IAAM5B,IAAN4B,GAoJDK,KAAqB;CAAC;CAAc;CAAmB;AAAI"}
1
+ {"version":3,"file":"forms.js","names":["_init","E.proto","E.suggest","__name","E.MenuSearchFields","E.clamp","E.withoutAccents","_init","__name","E.DOMElement","_init","E.UIComponent","E.protoMerged","E.onChange","E.proto","E.state","E.on","E.whileConnected","E.cssState","F.ControlLabels","E.AddressParameter","UIT.REQUIRED_RULE","__name","text","E.state","E.byDocumentOrder","__name","__exportAll","__name$1","__publicField","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","REQUIRED_RULE","__decoratorStart","_rules_dec","_flags_dec","_cards_dec","_regExp_dec","_text_dec","_prompts_dec","proto","_init$3","_Validator","text","value","options","errors","context","rule","rules","parsed","test","guess","suggest","flags","error","source","bracket","hasBracket","type","bracketValue","ruleValue","prompt","prompts","RANGE_PROMPT_RULES","min","max","RANGE_SUFFIX_RULES","suffix","bounds","range","pattern","subject","measure","number","trim","raw","regExp","flag","parts","length","otherValue","fieldValues","other","types","card","unionPay","sum","index","double","digit","LUHN_DOUBLED","count","Validator","MenuOptions","addition","keys","query","search","folding","term","fields","MenuSearchFields","option","field","fullTextSearch","selected","values","allowAdditions","ignoreCase","wanted","additionLabel","hideAdditions","list","additionPosition","from","delta","wrap","step","origin","target","clamp","tries","prefix","TYPE_AHEAD","repeated","REPEATED_CHARACTER","start","offset","at","folded","origins","ranges","position","char","found","end","last","ignoreDiacritics","withoutAccents","piece","unit","key","_index_dec","state","_init$2","_index","_HighlightedOption","HighlightedOption","DOMElement","_onDOMElementClick_dec","_onSettled_dec","_onAddressChanged_dec","_isReadOnly_dec","_refreshLabels_dec","_onInvalid_dec","_isTouched_dec","_onValidationChanged_dec","_invalidShows_dec","_onFormValueChanged_dec","_elementSetup_dec","_a","_init$1","_isTouched","_FormComponent","UIComponent","protoMerged","onChange","on","whileConnected","cssState","args","ControlLabels","AddressParameter","event","name","result","internals","INVALID_STATE","isShownInvalid","Reactive","parameter","isConnected","isReady","afterSolidUpdate","data","item","FormComponent","LabelWatch","root","member","records","ids","all","record","nodes","node","NodeType","element","labels","label","watch","_accessibleName_dec","_init","_accessibleName","_ControlLabels","domElement","isServer","refresh","attributeObserver","WATCHED_ATTRIBUTES","selector","byDocumentOrder","wrapping","wrappingFor","own","text2","id","child","forms_exports"],"sources":["../src/elements/Validator.ts","../src/elements/MenuOptions.ts","../src/elements/HighlightedOption.ts","../src/elements/DOMFormControl.ts","../src/elements/FormComponent.ts","../src/elements/LabelWatch.ts","../src/elements/ControlLabels.ts","../src/forms.ts"],"sourcesContent":["import { E } from \"spell/ui/core\"\n\n/****************\n * ### `Validator`\n * Fomantic's form validation rules (`form.js` `settings.rules`) as pure functions, with its English prompts.\n * - Why a port rather than native constraints alone: Fomantic's rule vocabulary (`minLength[6]`, `match[password]`,\n * `creditCard[visa,amex]`) is what `ui-form rules` and authors already speak.\n * - Output feeds `ElementInternals.setValidity(result.flags, result.message)` directly: each rule maps to a\n * Constraint Validation flag (`Validator.flags`), so `:invalid` / `:user-invalid` and `validity.*` just work.\n * - Rule semantics follow Fomantic exactly, quirks included (`number` accepts `\"\"`), except where noted:\n * - counts use the array length when the value IS an array, and `maxCount[0]` accepts an empty value\n * - `range[a..b]` prompts interpolate `{min}` / `{max}` (Fomantic leaves them literal)\n * - an empty range bound is open, so `minValue` / `maxValue` work (see `bounds()`)\n * - Data is `@proto static` so `UI.i18n` can swap `prompts` / `text` per instance, and a subclass can add rules.\n * - Fomantic's names stay where they're its API (`prompts`, `text`, `regExp`, `rules`, a rule's `(value, ruleValue)`);\n * the steps rules share (`range()`, `normalize()`, `count()`: `RuleValidator`) are ours.\n * - Library-neutral: no DOM, no Solid; of the core (`E`), it uses only `E.proto`, `E.suggest()`, `E.Warnings` and\n * the folder's types. Part of the `forms` entry: reaches the core through the `spell/ui/core` ENTRY, never its leaves\n * (`forms.ts`).\n ****************/\nexport class Validator {\n /** Prompt per rule type, `{name}` ... interpolated; see `@proto static prompts`. */\n declare prompts: Readonly<Record<string, string>>\n /** Words the prompts use; see `@proto static text`. */\n declare text: E.ValidatorText\n /** Patterns the rules test; see `@proto static regExp`. */\n declare regExp: E.ValidatorRegExps\n /** Card brands for `creditCard`; see `@proto static cards`. */\n declare cards: Readonly<Record<string, E.CreditCardSpec>>\n /** Constraint Validation flag per rule; see `@proto static flags`. */\n declare flags: E.ValidityFlagMap\n /** The rules by type; see `@proto static rules`. */\n declare rules: Readonly<Record<string, E.RuleFunction>>\n\n ////////////////\n // ## Data\n ////////////////\n\n /** Fomantic's `settings.prompt`, verbatim. `{name}`, `{value}`, `{ruleValue}`, `{min}`, `{max}`, `{identifier}`. */\n @E.proto static prompts: Readonly<Record<string, string>> = {\n range: \"{name} must be in a range from {min} to {max}\",\n maxValue: \"{name} must have a maximum value of {ruleValue}\",\n minValue: \"{name} must have a minimum value of {ruleValue}\",\n notEmpty: \"{name} must have a value\",\n checked: \"{name} must be checked\",\n email: \"{name} must be a valid e-mail\",\n url: \"{name} must be a valid url\",\n regExp: \"{name} is not formatted correctly\",\n integer: \"{name} must be an integer\",\n decimal: \"{name} must be a decimal number\",\n number: \"{name} must be set to a number\",\n is: '{name} must be \"{ruleValue}\"',\n isExactly: '{name} must be exactly \"{ruleValue}\"',\n not: '{name} cannot be set to \"{ruleValue}\"',\n notExactly: '{name} cannot be set to exactly \"{ruleValue}\"',\n contains: '{name} must contain \"{ruleValue}\"',\n containsExactly: '{name} must contain exactly \"{ruleValue}\"',\n doesntContain: '{name} cannot contain \"{ruleValue}\"',\n doesntContainExactly: '{name} cannot contain exactly \"{ruleValue}\"',\n minLength: \"{name} must be at least {ruleValue} characters\",\n exactLength: \"{name} must be exactly {ruleValue} characters\",\n maxLength: \"{name} cannot be longer than {ruleValue} characters\",\n size: \"{name} must have a length between {min} and {max} characters\",\n match: \"{name} must match {ruleValue} field\",\n different: \"{name} must have a different value than {ruleValue} field\",\n creditCard: \"{name} must be a valid credit card number\",\n minCount: \"{name} must have at least {ruleValue} choices\",\n exactCount: \"{name} must have exactly {ruleValue} choices\",\n maxCount: \"{name} must have {ruleValue} or less choices\"\n }\n\n /** Fomantic's `settings.text` entries prompts use. */\n @E.proto static text: E.ValidatorText = {\n and: \"and\",\n unspecifiedRule: \"Please enter a valid value\",\n unspecifiedField: \"This field\"\n }\n\n /** Fomantic's `settings.regExp`, verbatim. */\n @E.proto static regExp: E.ValidatorRegExps = {\n decimal: /^\\d+\\.?\\d*$/,\n email: /^[\\w!#$%&'*+./=?^`{|}~-]+@[\\da-z]([\\da-z-]*[\\da-z])?(\\.[\\da-z]([\\da-z-]*[\\da-z])?)*$/i,\n integer: /^-?\\d+$/,\n number: /^-?\\d*(\\.\\d+)?$/,\n url: /(https?:\\/\\/(?:www\\.|(?!www))[^\\s.]+\\.\\S{2,}|www\\.\\S+\\.\\S{2,})/i,\n flags: /^\\/(.*)\\/(.*)?/\n }\n\n /** Card brands for `creditCard[visa,amex]`, from Fomantic's `rules.creditCard`. */\n @E.proto static cards: Readonly<Record<string, E.CreditCardSpec>> = {\n visa: { pattern: /^4/, length: [16] },\n amex: { pattern: /^3[47]/, length: [15] },\n mastercard: { pattern: /^5[1-5]/, length: [16] },\n discover: { pattern: /^(6011|622(12[6-9]|1[3-9]\\d|[2-8]\\d{2}|9[01]\\d|92[0-5]|64[4-9])|65)/, length: [16] },\n unionPay: { pattern: /^(62|88)/, length: [16, 17, 18, 19] },\n jcb: { pattern: /^35(2[89]|[3-8]\\d)/, length: [16] },\n maestro: { pattern: /^(5018|5020|5038|6304|6759|676[1-3])/, length: [12, 13, 14, 15, 16, 17, 18, 19] },\n dinersClub: { pattern: /^(30[0-5]|^36)/, length: [14] },\n laser: { pattern: /^(6304|670[69]|6771)/, length: [16, 17, 18, 19] },\n visaElectron: { pattern: /^(4026|417500|4508|4844|491(3|7))/, length: [16] }\n }\n\n /**\n * Constraint Validation flag per rule, for `ElementInternals.setValidity()`.\n * - `\"auto\"` rules pick by value: type failure => `typeMismatch`, else under / over the range.\n * - Rules with no native equivalent (`is`, `match` ...) => `customError`.\n */\n @E.proto static flags: E.ValidityFlagMap = {\n notEmpty: \"valueMissing\",\n checked: \"valueMissing\",\n email: \"typeMismatch\",\n url: \"typeMismatch\",\n creditCard: \"typeMismatch\",\n regExp: \"patternMismatch\",\n minValue: \"auto\",\n maxValue: \"auto\",\n integer: \"auto\",\n range: \"auto\",\n decimal: \"auto\",\n number: \"auto\",\n minLength: \"tooShort\",\n maxLength: \"tooLong\",\n exactLength: \"auto\",\n size: \"auto\",\n minCount: \"rangeUnderflow\",\n maxCount: \"rangeOverflow\",\n exactCount: \"auto\",\n is: \"customError\",\n isExactly: \"customError\",\n not: \"customError\",\n notExactly: \"customError\",\n contains: \"customError\",\n containsExactly: \"customError\",\n doesntContain: \"customError\",\n doesntContainExactly: \"customError\",\n match: \"customError\",\n different: \"customError\"\n }\n\n /**\n * The rules, as methods called with `this` ~== the validator.\n * - `value` is normalized (see `normalize()`); `context.raw` has the original.\n */\n @E.proto static rules: Readonly<Record<string, E.RuleFunction>> = {\n /** Not blank; an empty array or unchecked (`false`) checkbox is blank. */\n notEmpty(value) {\n return value !== \"\"\n },\n /** Checkbox checked: `true`, or any value but `\"\"` / `\"false\"` (a checked checkbox's value, e.g. `on`). */\n checked(value, _, { raw }) {\n return raw === true || (raw !== false && value !== \"\" && value !== \"false\")\n },\n email(value) {\n return this.regExp.email.test(value)\n },\n url(value) {\n return this.regExp.url.test(value)\n },\n /** `regExp[/^\\d+$/i]`, a bare pattern `regExp[^\\d+$]`, or a real `RegExp`. */\n regExp(value, pattern) {\n if (pattern instanceof RegExp) return value.match(pattern) !== null\n const text = pattern ?? \"\"\n const parts = this.regExp.flags.exec(text)\n return value.match(parts ? new RegExp(parts[1], parts[2] ?? \"\") : new RegExp(text)) !== null\n },\n minValue(value, min) {\n return this.range(value, { range: `${String(min)}..`, pattern: this.regExp.number })\n },\n maxValue(value, max) {\n return this.range(value, { range: `..${String(max)}`, pattern: this.regExp.number })\n },\n /** Integer, optionally in `integer[min..max]`. */\n integer(value, range) {\n return this.range(value, { range, pattern: this.regExp.integer })\n },\n /** Integer in `range[min..max]`. */\n range(value, range) {\n return this.range(value, { range, pattern: this.regExp.integer })\n },\n /** Unsigned decimal, optionally in range. NOTE: Fomantic's pattern rejects negatives. */\n decimal(value, range) {\n return this.range(value, { range, pattern: this.regExp.decimal })\n },\n /** Number, optionally in range. NOTE: Fomantic's pattern accepts `\"\"`; pair with `notEmpty`. */\n number(value, range) {\n return this.range(value, { range, pattern: this.regExp.number })\n },\n is(value, text) {\n return value.toLowerCase() === String(text ?? \"\").toLowerCase()\n },\n isExactly(value, text) {\n return value === String(text ?? \"\")\n },\n not(value, text) {\n return value.toLowerCase() !== String(text ?? \"\").toLowerCase()\n },\n notExactly(value, text) {\n return value !== String(text ?? \"\")\n },\n contains(value, text) {\n return value.toLowerCase().includes(String(text ?? \"\").toLowerCase())\n },\n containsExactly(value, text) {\n return value.includes(String(text ?? \"\"))\n },\n doesntContain(value, text) {\n return !value.toLowerCase().includes(String(text ?? \"\").toLowerCase())\n },\n doesntContainExactly(value, text) {\n return !value.includes(String(text ?? \"\"))\n },\n minLength(value, min) {\n return this.range(value, { range: `${String(min)}..`, pattern: this.regExp.integer, measure: \"length\" })\n },\n exactLength(value, length) {\n const range = `${String(length)}..${String(length)}`\n return this.range(value, { range, pattern: this.regExp.integer, measure: \"length\" })\n },\n maxLength(value, max) {\n return this.range(value, { range: `..${String(max)}`, pattern: this.regExp.integer, measure: \"length\" })\n },\n /** Length in `size[min..max]`. */\n size(value, range) {\n return this.range(value, { range, pattern: this.regExp.integer, measure: \"length\" })\n },\n /** Equal to field `match[other]`; false when that field is missing. */\n match(value, other, { fieldValues }) {\n const otherValue = fieldValues?.[String(other)]\n return otherValue !== undefined && value === this.normalize(otherValue)\n },\n /** Differs from field `different[other]`; false when that field is missing, as Fomantic. */\n different(value, other, { fieldValues }) {\n const otherValue = fieldValues?.[String(other)]\n return otherValue !== undefined && value !== this.normalize(otherValue)\n },\n /**\n * Luhn-valid card number, optionally of `creditCard[visa,mastercard]` brands.\n * - Spaces and dashes allowed; UnionPay skips Luhn, as Fomantic.\n */\n creditCard(value, types) {\n const number = value.replace(/[\\s-]/g, \"\")\n if (!/^\\d+$/.test(number)) return false\n if (typeof types === \"string\" && types) {\n const brands = types.split(\",\").map((type) => this.cards[type.trim()])\n const known = brands.some((card) => card && card.length.includes(number.length) && card.pattern.test(number))\n if (!known) return false\n }\n const unionPay = this.cards.unionPay\n if (unionPay && unionPay.length.includes(number.length) && unionPay.pattern.test(number)) return true\n let sum = 0\n for (let index = number.length - 1, double = false; index >= 0; index--, double = !double) {\n const digit = number.charCodeAt(index) - 48\n sum += double ? LUHN_DOUBLED[digit] : digit\n }\n return sum % 10 === 0 && sum > 0\n },\n minCount(value, min, { raw }) {\n return this.count(value, raw) >= Number(min)\n },\n exactCount(value, count, { raw }) {\n return this.count(value, raw) === Number(count)\n },\n maxCount(value, max, { raw }) {\n return this.count(value, raw) <= Number(max)\n }\n }\n\n ////////////////\n // ## Validate\n ////////////////\n\n /**\n * Run `rules` against `value`; returns every failure with its prompt and Constraint Validation flag.\n * - Rules run in order and ALL run (Fomantic's default `errorLimit: 0`).\n * - `optional` skips everything when the value is blank.\n * - SIDE EFFECT (dev only): warns about unknown rule types, with a suggestion, and skips them.\n */\n validate(\n value: E.FieldValue,\n rules: readonly E.ValidationRule[],\n options: E.ValidateOptions = {}\n ): E.ValidationResult {\n const text = this.normalize(value, options)\n const errors: E.ValidationError[] = []\n if (!(options.optional && text === \"\")) {\n const context: E.RuleContext = { raw: value, fieldValues: options.fieldValues }\n for (const rule of rules) {\n const parsed = this.parseRule(rule)\n const test = this.rules[parsed.type]\n if (!test) {\n const guess = E.suggest(parsed.type, Object.keys(this.rules))\n E.Warnings.devWarn(\n \"Validator\",\n `unknown rule ${JSON.stringify(parsed.type)}${guess ? `; did you mean \"${guess}\"?` : \"\"}`\n )\n continue\n }\n if (test.call(this, text, parsed.value, context)) continue\n errors.push({\n type: parsed.type,\n ruleValue: parsed.value,\n message: this.prompt(parsed, text, options),\n flag: this.flagFor(parsed, text, value)\n })\n }\n }\n const flags: ValidityStateFlags = {}\n for (const error of errors) flags[error.flag] = true\n return { valid: errors.length === 0, errors, flags, message: errors[0]?.message ?? \"\" }\n }\n\n /**\n * True if `value` passes the single `rule`, e.g. `validator.test(\"minLength[6]\", \"secret\")`.\n * - Unknown rules pass.\n */\n test(rule: E.ValidationRule, value: E.FieldValue, fieldValues?: E.ValidateOptions[\"fieldValues\"]): boolean {\n return this.validate(value, [rule], { fieldValues }).valid\n }\n\n /**\n * `\"minLength[6]\"` => `{ type: \"minLength\", value: \"6\" }`; objects keep their `prompt`.\n * - Bracket runs from the FIRST `[` to the final `]`, so `regExp[/^[a-z]+$/]` keeps its inner brackets.\n * - An object's own `value` wins over a bracket in its `type`.\n */\n parseRule(rule: E.ValidationRule): E.ParsedRule {\n const source = typeof rule === \"string\" ? rule : rule.type\n const bracket = source.indexOf(\"[\")\n const hasBracket = bracket > 0 && source.endsWith(\"]\")\n const type = hasBracket ? source.slice(0, bracket) : source\n const bracketValue = hasBracket ? source.slice(bracket + 1, -1) : undefined\n if (typeof rule === \"string\") return { type, value: bracketValue }\n return { type, value: rule.value ?? bracketValue, prompt: rule.prompt }\n }\n\n /**\n * Interpolated message for a failed `rule`, as Fomantic's `get.prompt()`.\n * - `{name}` => label, `{identifier}` => name, `{value}` => the value, `{ruleValue}` => the bracket.\n * - Ranges (`integer[1..10]`) append Fomantic's range suffix to the default prompt:\n * \"Age must be an integer and must be in a range from 1 to 10\".\n * - `match` / `different` name the OTHER field by its label.\n */\n prompt(rule: E.ParsedRule, value: string, options: E.ValidateOptions = {}): string {\n const { prompts, text } = this\n const ruleValue = rule.value === undefined ? \"\" : String(rule.value)\n let prompt =\n typeof rule.prompt === \"function\"\n ? rule.prompt(value)\n : (rule.prompt ?? prompts[rule.type] ?? text.unspecifiedRule)\n if (ruleValue.includes(\"..\") && RANGE_PROMPT_RULES.has(rule.type)) {\n const [min, max] = ruleValue.split(\"..\", 2)\n if (!rule.prompt && RANGE_SUFFIX_RULES.has(rule.type)) {\n const suffix =\n min === \"\"\n ? prompts.maxValue.replaceAll(\"{ruleValue}\", \"{max}\")\n : max === \"\"\n ? prompts.minValue.replaceAll(\"{ruleValue}\", \"{min}\")\n : prompts.range\n prompt += suffix.replaceAll(\"{name}\", ` ${text.and}`)\n }\n prompt = prompt.replaceAll(\"{min}\", min).replaceAll(\"{max}\", max)\n }\n if (ruleValue && (rule.type === \"match\" || rule.type === \"different\")) {\n prompt = prompt.replaceAll(\"{ruleValue}\", options.fieldLabels?.[ruleValue] ?? ruleValue)\n }\n return prompt\n .replaceAll(\"{value}\", value)\n .replaceAll(\"{name}\", options.label ?? options.name ?? text.unspecifiedField)\n .replaceAll(\"{identifier}\", options.name ?? \"\")\n .replaceAll(\"{ruleValue}\", ruleValue)\n }\n\n ////////////////\n // ## Rule helpers\n ////////////////\n\n /**\n * `value` (or, `measure: \"length\"`, its length) matches `pattern` and lies within `range` (`\"min..max\"`, `\"n\"`,\n * `\"..max\"`): Fomantic's `rules.range()`, as a shared step.\n * - Ours: Fomantic's takes `(value, range, regExp, testLength)`, a positional boolean; rules call this one\n * with a `RangeTest`.\n * - Bounds that don't match `pattern` are ignored, as Fomantic.\n */\n range(value: string, { range, pattern, measure = \"value\" }: E.RangeTest): boolean {\n const bounds = this.bounds(range, pattern)\n const subject = measure === \"length\" ? String(value.length) : value\n const number = Number(subject)\n return (\n pattern.test(subject) &&\n (bounds.min === undefined || number >= bounds.min) &&\n (bounds.max === undefined || number <= bounds.max)\n )\n }\n\n /**\n * A field value as the rules see it: a string, trimmed unless `trim` is false (`ValidateOptions.trim`).\n * - `null` / `undefined` / `false` => `\"\"`; `true` => `\"true\"`; arrays comma-joined.\n */\n normalize(value: E.FieldValue, { trim = true }: Pick<E.ValidateOptions, \"trim\"> = {}): string {\n if (value == null || value === false) return \"\"\n const text = typeof value === \"string\" ? value : Array.isArray(value) ? value.join(\",\") : String(value)\n return trim ? text.trim() : text\n }\n\n /** Number of choices: the array's length, else comma-separated entries of `value`. */\n count(value: string, raw: E.FieldValue): number {\n if (Array.isArray(raw)) return raw.length\n return value === \"\" ? 0 : value.split(\",\").length\n }\n\n ////////////////\n // ## Internals\n ////////////////\n\n /**\n * Numeric `{ min, max }` of `range`; either may be `undefined` (open-ended).\n * - An EMPTY bound is open. Fomantic tests it against the pattern, and its `number` pattern matches `\"\"`,\n * so its `minValue[5]` (`\"5..\"`) gets `max = 0` and rejects everything positive.\n */\n private bounds(range: E.RuleValue, regExp: RegExp): { min?: number; max?: number } {\n const text = range === undefined ? \"\" : String(range)\n if (text === \"\" || text === \"..\") return {}\n if (!text.includes(\"..\")) return regExp.test(text) ? { min: Number(text), max: Number(text) } : {}\n const [min, max] = text.split(\"..\", 2)\n return {\n min: min !== \"\" && regExp.test(min) ? Number(min) : undefined,\n max: max !== \"\" && regExp.test(max) ? Number(max) : undefined\n }\n }\n\n /** Constraint Validation flag for a failed `rule`, resolving `\"auto\"` from the value. */\n private flagFor(rule: E.ParsedRule, value: string, raw: E.FieldValue): E.ValidityFlag {\n const flag = this.flags[rule.type] ?? \"customError\"\n if (flag !== \"auto\") return flag\n switch (rule.type) {\n case \"exactLength\":\n return value.length < Number(rule.value) ? \"tooShort\" : \"tooLong\"\n case \"size\":\n return value.length < (this.bounds(rule.value, this.regExp.integer).min ?? 0) ? \"tooShort\" : \"tooLong\"\n case \"exactCount\":\n return this.count(value, raw) < Number(rule.value) ? \"rangeUnderflow\" : \"rangeOverflow\"\n case \"minValue\":\n return this.regExp.number.test(value) ? \"rangeUnderflow\" : \"typeMismatch\"\n case \"maxValue\":\n return this.regExp.number.test(value) ? \"rangeOverflow\" : \"typeMismatch\"\n }\n const pattern =\n rule.type === \"decimal\" ? this.regExp.decimal : rule.type === \"number\" ? this.regExp.number : this.regExp.integer\n if (!pattern.test(value)) return \"typeMismatch\"\n return Number(value) < (this.bounds(rule.value, pattern).min ?? -Infinity) ? \"rangeUnderflow\" : \"rangeOverflow\"\n }\n}\n\n/** Rules whose `{min}` / `{max}` come from a `min..max` bracket. Fomantic's. */\nconst RANGE_PROMPT_RULES: ReadonlySet<string> = new Set([\"integer\", \"decimal\", \"number\", \"size\", \"range\"])\n\n/** Rules whose default prompt gets Fomantic's range suffix appended. */\nconst RANGE_SUFFIX_RULES: ReadonlySet<string> = new Set([\"integer\", \"decimal\", \"number\"])\n\n/** Luhn: digit => doubled digit's digit sum. */\nconst LUHN_DOUBLED: readonly number[] = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9]\n","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `MenuOptions`\n * The option model behind dropdown / select / search: filtering, additions, selection exclusion, keyboard\n * navigation, type-ahead and match highlighting. Pure data, NO DOM.\n * - Ported from SUI React's `getMenuOptions()` (filter => exclude selected => additions) with Fomantic's\n * dropdown `match` settings (`match`, `fullTextSearch`, `ignoreDiacritics`, `ignoreSearchCase`, `minCharacters`).\n * - Immutable: each step returns a NEW `MenuOptions`, so a render can keep the previous list, e.g.\n * `menu.excludeSelected(values).filter(query).withAdditions(query, { allowAdditions: true })`.\n * - Fast on 1000s of options: lower-cased (and, on demand, diacritic-stripped) search keys are computed\n * lazily ONCE per option object and shared by every derived list through a `WeakMap`.\n * - Library-neutral: no Solid, no element; of the core (`E`), it uses only the folder's types (`E.MenuOption` ...).\n ****************/\nexport class MenuOptions {\n /** The options in this list, in order. */\n readonly options: readonly (E.MenuOption | E.MenuAddition)[]\n\n /**\n * The pending addition from `withAdditions()` -- also set when `hideAdditions` keeps it out of `options`,\n * so Enter can still add it.\n */\n readonly addition: E.MenuAddition | undefined\n\n /** Search keys per option, shared with derived lists. */\n private readonly keys: WeakMap<E.MenuOption, MenuSearchKeys>\n\n /** A list of `options`; `addition` and `keys` are how a derived list carries its source's on. */\n constructor({ options = [], addition, keys = new WeakMap() }: MenuOptionsProps = {}) {\n this.options = options\n this.addition = addition\n this.keys = keys\n }\n\n /** Number of options. */\n get length() {\n return this.options.length\n }\n\n ////////////////\n // ## Filtering\n ////////////////\n\n /**\n * Options matching `query`, as Fomantic's `filterItems()`: prefix match always counts, then\n * `fullTextSearch` widens it (`\"exact\"` => substring, `true` => fuzzy).\n * - An empty query, or one shorter than `minCharacters`, filters nothing.\n * - `search: \"both\"` (default) matches text OR value.\n */\n filter(query: string, options: E.MenuFilterOptions = {}): MenuOptions {\n const { search = \"both\", fullTextSearch = \"exact\", ignoreDiacritics = false, ignoreCase = true } = options\n if (!query || query.length < (options.minCharacters ?? 0)) return this\n if (typeof search === \"function\") return this.derive(search(this.options, query))\n const folding = { ignoreCase, ignoreDiacritics }\n const term = this.normalize(query, folding)\n // `\"both\"` (or anything else) matches every field\n const fields: readonly E.MenuSearchField[] = search === \"text\" || search === \"value\" ? [search] : E.MenuSearchFields\n return this.derive(\n this.options.filter((option) =>\n fields.some((field) => MenuOptions.matches(this.key(option, field, folding), term, fullTextSearch))\n )\n )\n }\n\n /** Options whose value isn't in `values`, e.g. hide chosen labels in a multiple dropdown. */\n excludeSelected(values: Iterable<string>): MenuOptions {\n const selected = new Set(values)\n if (!selected.size) return this\n return this.derive(this.options.filter((option) => !selected.has(option.value)))\n }\n\n /**\n * Add `query` as a new option when additions are allowed and no option's text or value equals it.\n * - `additionPosition: \"top\"` (default) puts it first; `\"bottom\"` last.\n * - `hideAdditions` keeps it out of `options` but sets `addition`.\n * - NOTE: text / value equality is case-insensitive by default, so `Red` isn't offered next to `red`.\n */\n withAdditions(query: string, options: E.MenuAdditionOptions = {}): MenuOptions {\n const { allowAdditions = false, additionLabel = \"Add \", additionPosition = \"top\", hideAdditions = false } = options\n const term = query.trim()\n if (!allowAdditions || !term) return this\n const ignoreCase = options.ignoreCase ?? true\n const wanted = ignoreCase ? term.toLowerCase() : term\n const exists = this.options.some((option) => {\n const keys = this.keysFor(option)\n return ignoreCase\n ? keys.text === wanted || keys.value === wanted\n : option.text === wanted || option.value === wanted\n })\n if (exists) return this\n const addition: E.MenuAddition = { value: term, text: term, addition: true, label: additionLabel }\n if (hideAdditions) return new MenuOptions({ options: this.options, addition, keys: this.keys })\n const list = additionPosition === \"bottom\" ? [...this.options, addition] : [addition, ...this.options]\n return new MenuOptions({ options: list, addition, keys: this.keys })\n }\n\n ////////////////\n // ## Navigation\n ////////////////\n\n /**\n * Index of the enabled option `delta` steps from `from`, skipping disabled ones -- arrow keys, PageUp / Down.\n * - `from` may be `-1` (nothing active): `+1` lands on the first enabled option, `-1` on the last.\n * - Without `wrap`, stops at the ends: returns the last enabled option in that direction, or `from` if\n * there is none.\n * - `-1` when no option is enabled.\n * - The same steps over any list: `MenuOptions.nextEnabledIndexIn()`.\n */\n nextEnabledIndex(from: number, delta: number, options: E.MenuNavigateOptions = {}): number {\n return MenuOptions.nextEnabledIndexIn(this.options, from, delta, options)\n }\n\n /**\n * `nextEnabledIndex()`'s steps over `list`, any list of objects, each maybe `disabled`:\n * a search's results, an icon picker's cells (`HighlightedOption.move()`).\n * - STATIC: pure, needs no option model.\n */\n static nextEnabledIndexIn(\n list: readonly object[],\n from: number,\n delta: number,\n options: E.MenuNavigateOptions = {}\n ): number {\n const { length } = list\n const wrap = options.wrap ?? false\n const isDisabled = (index: number) => \"disabled\" in list[index] && !!list[index].disabled\n if (list.every((_option, index) => isDisabled(index))) return -1\n if (!delta) return from\n const step = delta > 0 ? 1 : -1\n const origin = from < 0 || from >= length ? (step > 0 ? -1 : length) : from\n const target = wrap ? MenuOptions.wrap(origin + delta, length) : E.clamp(origin + delta, 0, length - 1)\n for (let index = target, tries = 0; tries < length; tries++) {\n if (!isDisabled(index)) return index\n index += step\n if (wrap) index = MenuOptions.wrap(index, length)\n else if (index < 0 || index >= length) break\n }\n // Ran off an end without wrapping: take the furthest enabled option between `from` and that end.\n for (let index = target - step; index !== origin && index >= 0 && index < length; index -= step) {\n if (!isDisabled(index)) return index\n }\n return from\n }\n\n /**\n * Type-ahead: index of the next enabled option after `from` whose text starts with `prefix`, wrapping.\n * - Case- and diacritic-insensitive.\n * - Repeating one character (`\"aaa\"`) cycles through options starting with it, per the APG listbox pattern.\n * - `-1` when nothing matches. The element owns the keystroke buffer and its timeout.\n */\n selectionForKey(prefix: string, from = -1): number {\n const { length } = this.options\n if (!prefix || !length) return -1\n let term = this.normalize(prefix, TYPE_AHEAD)\n const repeated = REPEATED_CHARACTER.exec(term)\n if (repeated) term = repeated[1]\n // A multi-character buffer refines the CURRENT match, so start there; one character moves on.\n const start = term.length > 1 ? Math.max(from, 0) : from + 1\n for (let offset = 0; offset < length; offset++) {\n const index = (start + offset + length) % length\n const option = this.options[index]\n if (!option.disabled && this.key(option, \"text\", TYPE_AHEAD).startsWith(term)) return index\n }\n return -1\n }\n\n ////////////////\n // ## Highlighting\n ////////////////\n\n /**\n * Ranges of `option.text` matching `query`, for `highlightMatches`: one range for a contiguous match,\n * else one per fuzzy-matched character (adjacent ones merged).\n * - Indices are into the ORIGINAL text, even when diacritics or case were ignored.\n * - `[]` when nothing matches.\n */\n highlights(option: E.MenuOption, query: string, options: E.MenuFilterOptions = {}): E.HighlightRange[] {\n const { ignoreDiacritics = false, ignoreCase = true } = options\n if (!query) return []\n const folding = { ignoreCase, ignoreDiacritics }\n const term = this.normalize(query, folding)\n const { folded, origins } = this.fold(option.text, folding)\n const at = folded.indexOf(term)\n if (at >= 0) return [[origins[at], origins[at + term.length]]]\n const ranges: [number, number][] = []\n let position = 0\n for (const char of term) {\n const found = folded.indexOf(char, position)\n if (found < 0) return []\n const start = origins[found]\n const end = origins[found + char.length]\n const last = ranges.at(-1)\n if (last && last[1] === start) last[1] = end\n else ranges.push([start, end])\n position = found + char.length\n }\n return ranges\n }\n\n ////////////////\n // ## Internals\n ////////////////\n\n /** New list sharing this one's key cache. */\n private derive(options: readonly E.MenuOption[]) {\n return new MenuOptions({ options, keys: this.keys })\n }\n\n /** Cached keys for `option`, created on first use. */\n private keysFor(option: E.MenuOption): MenuSearchKeys {\n let keys = this.keys.get(option)\n if (!keys) {\n keys = { text: option.text.toLowerCase(), value: String(option.value).toLowerCase() }\n this.keys.set(option, keys)\n }\n return keys\n }\n\n /** `query` folded the same way as the keys it's compared with. */\n private normalize(query: string, { ignoreCase, ignoreDiacritics }: Folding) {\n const text = ignoreDiacritics ? E.withoutAccents(query) : query\n return ignoreCase ? text.toLowerCase() : text\n }\n\n /**\n * `text` folded char by char, with each folded index's origin in `text`, so highlight ranges map back.\n * - `origins` has one extra entry (`text.length`) so `origins[end]` works for a match at the very end.\n */\n private fold(text: string, { ignoreCase, ignoreDiacritics }: Folding) {\n let folded = \"\"\n const origins: number[] = []\n let index = 0\n for (const char of text) {\n let piece = ignoreDiacritics ? E.withoutAccents(char) : char\n if (ignoreCase) piece = piece.toLowerCase()\n for (let unit = 0; unit < piece.length; unit++) origins.push(index)\n folded += piece\n index += char.length\n }\n origins.push(index)\n return { folded, origins }\n }\n\n /**\n * `option`'s folded text or value for comparing with a folded query; the diacritic-free variant\n * is computed on first need and cached.\n */\n private key(option: E.MenuOption, field: E.MenuSearchField, { ignoreCase, ignoreDiacritics }: Folding) {\n if (!ignoreCase) {\n const raw = field === \"text\" ? option.text : String(option.value)\n return ignoreDiacritics ? E.withoutAccents(raw) : raw\n }\n const keys = this.keysFor(option)\n if (!ignoreDiacritics) return keys[field]\n if (field === \"text\") return (keys.plainText ??= E.withoutAccents(keys.text))\n return (keys.plainValue ??= E.withoutAccents(keys.value))\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /** `index` wrapped into `0 .. length - 1`. Static: pure arithmetic. */\n private static wrap(index: number, length: number) {\n return ((index % length) + length) % length\n }\n\n /**\n * Fomantic's match: prefix, else substring (`\"exact\"`) or in-order characters (`true`).\n * - Static: pure. `fullTextSearch` keeps Fomantic's shape (`MenuFilterOptions.fullTextSearch`).\n */\n private static matches(key: string, term: string, fullTextSearch: E.MenuFilterOptions[\"fullTextSearch\"]) {\n if (key.startsWith(term)) return true\n if (fullTextSearch === \"exact\") return key.includes(term)\n if (fullTextSearch === true) return MenuOptions.fuzzy(key, term)\n return false\n }\n\n /** Fomantic's `fuzzySearch()`: every character of `term` appears in `key`, in order. Static: pure. */\n private static fuzzy(key: string, term: string) {\n if (term.length > key.length) return false\n let position = 0\n for (let index = 0; index < term.length; index++) {\n position = key.indexOf(term[index], position) + 1\n if (!position) return false\n }\n return true\n }\n}\n\n/** Constructor props of `MenuOptions`. */\nexport type MenuOptionsProps = {\n /** the options, in order; default none */\n options?: readonly (E.MenuOption | E.MenuAddition)[]\n /** the pending addition (`withAdditions()`) */\n addition?: E.MenuAddition\n /** search keys per option, shared with derived lists; pass one to share it across lists made apart */\n keys?: WeakMap<E.MenuOption, MenuSearchKeys>\n}\n\n/** How a query and the keys it's compared with are folded (`MenuFilterOptions`' two switches, settled). */\ntype Folding = {\n /** lower-case both sides */\n ignoreCase: boolean\n /** strip diacritics from both sides */\n ignoreDiacritics: boolean\n}\n\n/** Lazily-filled search keys for one option (`MenuOptionsProps.keys`). */\nexport type MenuSearchKeys = {\n /** Lower-cased text. */\n text: string\n /** Lower-cased value. */\n value: string\n /** Lower-cased, diacritic-free text; computed on first `ignoreDiacritics` search. */\n plainText?: string\n /** Lower-cased, diacritic-free value. */\n plainValue?: string\n}\n\n/** How type-ahead folds: case- and diacritic-insensitive, whatever the filter says. */\nconst TYPE_AHEAD: Folding = { ignoreCase: true, ignoreDiacritics: true }\n\n/** One character typed more than once, e.g. `aaa`. */\nconst REPEATED_CHARACTER = /^(.)\\1+$/su\n","import { E } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\n// Import directly to avoid circular import: spell-element imports nothing of Spell UI, so it has always loaded first\nimport { state } from \"spell/element\"\n\n/****************\n * ### `HighlightedOption`\n * The ONE highlighted option of a list a control opens: what the arrows move, Enter picks,\n * and `aria-activedescendant` points at.\n * - Shared by `<ui-dropdown>`'s options, `<ui-search>`'s results and `<ui-icon-picker>`'s cells.\n * - Reactive (`index`), so a component draws from it and its effects follow it.\n * - Knows its list only through `list()`, read fresh each time: a filtered list keeps the highlight's index,\n * so the control says what a new list does to it (`clear()`, `index = 0` ...).\n * - Steps as `MenuOptions.nextEnabledIndexIn()` does: disabled options skipped, stopping at the ends unless `wrap`.\n ****************/\nexport class HighlightedOption<T extends object> {\n /** Index into `list()` of the highlighted option; `-1` for none. */\n @state accessor index = -1\n\n /** The list the highlight moves through, read fresh each time. */\n private readonly list: () => readonly T[]\n\n constructor(list: () => readonly T[]) {\n this.list = list\n }\n\n /** The highlighted option; `undefined` for none. */\n get option(): T | undefined {\n return this.list()[this.index]\n }\n\n /** Highlight `option`, when it's in the list (the pointer over a row). */\n highlight(option: T) {\n const at = this.list().indexOf(option)\n if (at >= 0 && at !== this.index) this.index = at\n }\n\n /**\n * Move the highlight `delta` enabled options (an arrow key, PageUp / Down): from none, `+1` is the first.\n * - `-1` for none when the list has no enabled option.\n */\n move(delta: number, options?: E.MenuNavigateOptions) {\n this.index = F.MenuOptions.nextEnabledIndexIn(this.list(), this.index, delta, options)\n }\n\n /** Highlight the first (`\"first\"`) or last (`\"last\"`) enabled option: Home / End. */\n moveTo(end: \"first\" | \"last\") {\n this.index = F.MenuOptions.nextEnabledIndexIn(this.list(), -1, end === \"first\" ? 1 : -1)\n }\n\n /** Nothing highlighted. */\n clear() {\n this.index = -1\n }\n}\n","import { E } from \"spell/ui/core\"\nimport type { F } from \"spell/ui/forms\"\n\n/****************\n * ### `DOMFormControl`\n * The DOM element of a form control (`<ui-dropdown>`, `<ui-input>`, `<ui-checkbox>` ...):\n * it adds the platform's form-control API (`form`, `validity`, `checkValidity()` ...), read from `internals`.\n * - Its component is a `FormComponent`, whose `elementSetup.DOMElement` names this class.\n * A control's own subclass names its component class (`DOMCheckElement extends F.DOMFormControl<CheckControl>`).\n * - Form association itself is `elementSetup.isAFormControl`\n * (DOM API `static formAssociated`, set per tag by `UIComponent.define()`).\n * - The browser's form callbacks reach the component as its methods (`onFormReset()`, `onFormDisabled()` ...),\n * through `DOMElement`.\n * - A reset clears the component's `isTouched` first: so no control's `onFormReset()` has to.\n * - `<ui-button type=\"submit|reset\">` is form-associated too, but keeps `DOMElement`: it needs no value or validity.\n * - Part of the `forms` entry: extends `E.DOMElement` through the `spell/ui/core` ENTRY, never its leaf.\n * Safe while this module evaluates, since the core never imports `forms` (see `FormComponent`).\n * - `null` where the platform says it (`form`): the same API as a native control.\n ****************/\nexport class DOMFormControl<C extends F.FormComponent<any> = F.FormComponent<any>> extends E.DOMElement<C> {\n /** Form owner; `null` outside a form, as a native control's. */\n get form(): HTMLFormElement | null {\n return this.internals.form\n }\n\n /** Constraint validation state. */\n get validity(): ValidityState {\n return this.internals.validity\n }\n\n /** Current validation message. */\n get validationMessage(): string {\n return this.internals.validationMessage\n }\n\n /** Takes part in constraint validation? */\n get willValidate(): boolean {\n return this.internals.willValidate\n }\n\n /** `<label>`s pointing at this element. */\n get labels(): NodeList {\n return this.internals.labels\n }\n\n /**\n * Its value reaches a form only as it SETTLES (`ui-changed`), never on each keystroke's `input`:\n * a `<ui-search>`, which waits for a pause in typing (`delay`). Read by the form's binding.\n */\n get settlesItself(): boolean {\n return this.component?.settlesItself ?? false\n }\n\n /** Valid? Fires `invalid` when not. */\n checkValidity(): boolean {\n return this.internals.checkValidity()\n }\n\n /** Valid? Shows the browser's message when not. */\n reportValidity(): boolean {\n return this.internals.reportValidity()\n }\n\n /**\n * DOM API: the form was reset.\n * - The component forgets the interaction (`isTouched`), then restores its starting value (`onFormReset()`).\n */\n formResetCallback() {\n if (this.component) this.component.isTouched = false\n super.formResetCallback()\n }\n}\n","import { E, UIT } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\n// Import directly to avoid circular import\nimport { DOMFormControl } from \"./DOMFormControl\"\nimport { Validator } from \"./Validator\"\n\n/****************\n * ### `FormComponent`\n * The base class of the form controls' components (`UIInput`, `UIDropdown`, `UICheckbox` ...):\n * the form value, validity, reset, and a `<fieldset disabled>` around it.\n * - `elementSetup.isAFormControl` makes the DOM element a form control (DOM API `static formAssociated`);\n * its DOM element class is a `DOMFormControl` (the form-control API).\n * - The browser's form callbacks arrive as methods (`UIComponent`, \"Lifecycle\"):\n * a reset as `onFormReset()`, a `<fieldset disabled>` as `formIsDisabled`.\n * - Pushes `formValue` into `ElementInternals.setFormValue()`:\n * a `string[]` becomes a `FormData` with one entry per value,\n * so `new FormData(form).getAll(name)` returns them all.\n * - Pushes `validationRules`, through `Validator`, into `setValidity()`.\n * - `:state(invalid)` follows `isShownInvalid`: at once, or only once someone has interacted (`invalidShows`).\n * The anchor for the browser's bubble is `validationAnchor`.\n *\n * - What every control gets from here, so it writes none of it:\n * - `isDisabled`: its `disabled` attribute, or a disabled fieldset (`isMarkedDisabled`);\n * the `disabled` class follows it, and `:state(disabled)` (`UIComponent`)\n * - `isReadOnly`: `readonly`, with `:state(readonly)`\n * - `labels` (`ControlLabels`): what names the DOM element (`<label for>`, `aria-label` ...),\n * as `accessibleName` for its inner control; read again each time it connects\n * - `isTouched`: someone has interacted; an `invalid` event (a submit, `reportValidity()`) sets it,\n * a form reset clears it (`DOMFormControl`)\n * - `formName`: `name`\n * - `validationRules`: `required` => Fomantic's `notEmpty`\n * - a click aimed at the DOM element itself (its `<label for>`, its `click()`) calls `activateControl()`\n * - Every form vocabulary has `disabled`, `name` and `required`: their getters are typed here once (`FormAttributes`).\n *\n * - Part of the `forms` entry: reaches the element core through the `spell/ui/core` ENTRY (`E`), never its leaves,\n * or the build splits what `core` and `forms` share into a third chunk.\n * - `E.UIComponent` and the decorators (`@E.proto`, `@E.onChange` ...) are safe while this module evaluates:\n * the core never imports `forms`, so it has always finished loading first.\n * - Its `forms` peers `DOMFormControl` / `Validator` come directly:\n * static initializers read them (WWOD §4 › \"Circular imports\").\n * - `ControlLabels` comes through `F`, as only an instance field reads it.\n ****************/\nexport abstract class FormComponent<V extends E.ComponentVocabulary = E.ComponentVocabulary> extends E.UIComponent<V> {\n @E.protoMerged static elementSetup: Partial<E.ElementSetup> = {\n // with the form-control API\n DOMElement: DOMFormControl,\n isAFormControl: true,\n // each control disables its native control: still in the accessibility tree, as a disabled control\n disabled: \"its own\"\n }\n\n /**\n * The DOM element, as the form control it is (`elementSetup.DOMElement`): `form`, `validity`, `internals` ...\n * - `declare`, a type only: the constructor (`UIComponent`) sets it.\n */\n declare readonly domElement: DOMFormControl\n\n constructor(...args: ConstructorParameters<typeof E.UIComponent>) {\n super(...args)\n // here, not in a field initializer: TypeScript refuses one reading `domElement`, `declare`d above (TS2729)\n this.labels = new F.ControlLabels(this.domElement)\n this.address = new E.AddressParameter({\n domElement: this.domElement,\n read: () => this.addressText,\n show: (text, event) => this.showAddressText(text, event)\n })\n }\n\n ////////////////\n // ## Value\n ////////////////\n\n /**\n * Hook: value to submit; tracked.\n * - `null` / `undefined` submits nothing.\n */\n abstract get formValue(): E.FieldValue\n\n /** Hook: field name for `FormData` entries of a multi-value control; default `name`. */\n protected get formName(): string | undefined {\n return this.name\n }\n\n /**\n * Hook: what `setFormValue()` gets for `value`; default `FormComponent.submission()`.\n * - A file input overrides it to submit its `File`s.\n */\n protected formSubmission(value: E.FieldValue, name: string | undefined): string | File | FormData | null {\n return FormComponent.submission(value, name)\n }\n\n /** The value (or its name) changed: hand the submission to the form. */\n @E.onChange(\"formValue\", \"formName\")\n protected onFormValueChanged(value: E.FieldValue, name: string | undefined) {\n this.domElement.internals.setFormValue(this.formSubmission(value, name))\n }\n\n /**\n * Hook: restore the starting value (DOM API `formResetCallback()`); every form control has one.\n * - `isTouched` is already cleared when it runs (`DOMFormControl`).\n */\n abstract onFormReset(): void\n\n ////////////////\n // ## Validity\n ////////////////\n\n /**\n * `validationRules` checked against `validationValue`.\n * - A plain getter for now: `brand`'s hooks still read `Cell`s and memos, which a `@derived` cache can't see change.\n * It becomes `@derived` once they read record members (`TextControl`'s override is one already).\n */\n get validation(): E.ValidationResult {\n return FormComponent.validator.validate(this.validationValue, this.validationRules, { label: this.validationLabel })\n }\n\n /**\n * Hook: validation rules; default: `required` => Fomantic's `notEmpty`, else none.\n * - `notEmpty` checks `validationValue`: a control with a default it shows before anyone chose\n * (a slider's `min`, a colour picker's colour) leaves it empty until a value is set.\n * - Not `rules`: the attribute of `<ui-input>`, `<ui-textarea>` and `<ui-form>`,\n * whose getter a base member of that name would hide (`UIComponent`'s doc).\n */\n protected get validationRules(): E.ValidationRule[] {\n return this.required ? [UIT.REQUIRED_RULE] : []\n }\n\n /**\n * Hook: value `validationRules` check; tracked.\n * - Default: `formValue`.\n * - A checkbox checks its chosen state alone: its `off-value` is submitted, yet never \"checked\".\n */\n protected get validationValue(): E.FieldValue {\n return this.formValue\n }\n\n /** Hook: label used in validation messages. */\n protected get validationLabel(): string | undefined {\n return undefined\n }\n\n /** Hook: element the browser anchors its validation bubble to. */\n protected get validationAnchor(): HTMLElement | undefined {\n return undefined\n }\n\n /**\n * When `:state(invalid)` shows: `\"at once\"` (as `:invalid` does), or `\"once touched\"` (as `:user-invalid` does).\n * - See `@proto static invalidShows`.\n */\n declare readonly invalidShows: E.InvalidTiming\n\n /**\n * Class setting: when `:state(invalid)` shows.\n * - Default `\"at once\"`.\n * - Text and check controls and the rating wait for the person: `\"once touched\"`.\n */\n @E.proto static invalidShows: E.InvalidTiming = \"at once\"\n\n /**\n * Shown as invalid? Invalid, and (`invalidShows: \"once touched\"`) touched; tracked.\n * - `:state(invalid)`, which every form vocabulary names.\n * Text and check controls and the rating hand it to their inner control as `aria-invalid`.\n * - Set by `onValidationChanged()`, NOT `@cssState`:\n * - the one `:state()` render effect also reads a radio's own `selected`,\n * and a group's validation reads every member's\n * - so it would draw a frame against a stale membership while the group unchooses the others\n * (`EFFECT_RELAY_TEAR`, `UICheckbox.test.tsx`)\n */\n get isShownInvalid(): boolean {\n return !this.validation.valid && (this.invalidShows === \"at once\" || this.isTouched)\n }\n\n /**\n * The validation changed: hand the result (and the bubble's anchor) to the form, and show it (`:state(invalid)`).\n */\n @E.onChange(\"validation\", \"isShownInvalid\")\n protected onValidationChanged(result: E.ValidationResult, isShownInvalid: boolean) {\n const { internals } = this.domElement\n if (result.valid) internals.setValidity({})\n else internals.setValidity(result.flags, result.message, this.validationAnchor)\n this.domElement.setState(INVALID_STATE, isShownInvalid)\n }\n\n ////////////////\n // ## Interaction\n ////////////////\n\n /**\n * Has someone interacted with it?\n * - Only then does a `\"once touched\"` control show `:state(invalid)`.\n * - Set here by an `invalid` event; a control sets it on its own interactions too (a choice, a committed edit).\n * - Cleared by a form reset, before `onFormReset()` (`DOMFormControl`).\n */\n @E.state accessor isTouched = false\n\n /** A submit or `reportValidity()` found it invalid: show it. */\n @E.on(\"invalid\")\n protected onInvalid() {\n this.isTouched = true\n }\n\n ////////////////\n // ## Name\n ////////////////\n\n /**\n * What names the DOM element (`<label for>`, a wrapping `<label>`, `aria-label`, `aria-labelledby`),\n * as `labels.accessibleName`: the name a control hands its inner control (its `<input>`, its group).\n * - Created by the constructor, under the component's owner, as `ControlLabels` needs.\n */\n readonly labels: F.ControlLabels\n\n /** Connected: read the labels again (they may be others now). */\n @E.whileConnected\n protected refreshLabels() {\n this.labels.refresh()\n }\n\n ////////////////\n // ## Disabled\n ////////////////\n\n /**\n * Disabled by its `disabled` attribute, or by a disabled fieldset / form (`isMarkedDisabled`).\n * - Unusable its own way (`elementSetup.disabled` is `\"its own\"`): each control disables its native control,\n * so it stays in the accessibility tree as a disabled control, where the base class would make it inert.\n */\n get isDisabled(): boolean {\n return this.isMarkedDisabled\n }\n\n /** The `disabled` class follows `isDisabled`: a disabled fieldset adds it too. */\n protected classValue(name: E.AttributeName<V>): unknown {\n if (name === \"disabled\") return this.isDisabled\n return super.classValue(name)\n }\n\n ////////////////\n // ## Read-only\n ////////////////\n\n /**\n * Is `readonly` set? `:state(readonly)`.\n * - It shows its value, can be focused, and is submitted, but people can't change it (unlike `disabled`).\n * - Every form control's vocabulary declares it (`property: \"readOnly\"`, as the platform's),\n * each saying what it does there; `false` where one doesn't.\n * - Each control refuses changes its own way (its native control's `readonly`, a click it ignores ...).\n */\n @E.cssState(\"readonly\")\n get isReadOnly(): boolean {\n return E.Reactive.attributeValue(this, \"readonly\") === true\n }\n\n ////////////////\n // ## The address\n ////////////////\n\n /**\n * `parameter`: the value kept in the page's address, as that query parameter (`AddressParameter`).\n * - Recorded each time the value SETTLES: its `ui-changed` (a choice made, a text left or committed,\n * a search's pause); never on every keystroke.\n * - Back, Forward and a page opened on the address show the value through `showAddressText()`.\n */\n readonly address: E.AddressParameter\n\n /** Where `parameter` keeps the value, if it has one. */\n get addressPlace(): E.AddressPlace | undefined {\n const parameter = this.parameter?.trim()\n return parameter ? { parameter } : undefined\n }\n\n /** Follow the address while there's a `parameter` and the element is in the page. */\n @E.onChange(\"parameter\", \"isConnected\", \"isReady\")\n protected onAddressChanged(_parameter: string | undefined, isConnected: boolean, isReady: boolean) {\n return isConnected && isReady ? this.address.follow(this.addressPlace) : undefined\n }\n\n /** It settled on a value (its own `ui-changed`, not one bubbling from a control inside it): record it. */\n @E.on(\"ui-changed\")\n protected onSettled(event: Event) {\n if (event.target === this.domElement) this.address.record(this.addressPlace)\n }\n\n /**\n * Hook: is the value written to a form only as it settles (`ui-changed`), never on each `input`?\n * Default no; a search waits for a pause in typing.\n */\n get settlesItself(): boolean {\n return false\n }\n\n /**\n * Hook: the value as the address holds it; `undefined` (or `\"\"`) for none.\n * - Default: `formValue` as text; a list joined with commas.\n */\n protected get addressText(): string | undefined {\n const value = this.formValue\n if (value == null || value === false || value === \"\") return undefined\n return Array.isArray(value) ? value.join(\",\") : String(value)\n }\n\n /**\n * Hook: show `text` from the address, as a person's change would: the value, then `ui-changed`,\n * so a form (and a Spell program) hears it.\n * - `undefined`: the address has none, and the element started with none.\n * - Default: the DOM element's `value` property, which each control converts.\n */\n protected showAddressText(text: string | undefined, originalEvent?: Event) {\n ;(this.domElement as unknown as { value: unknown }).value = text ?? \"\"\n E.afterSolidUpdate(() => this.send(\"ui-changed\" as never, { value: this.formValue, originalEvent }))\n }\n\n ////////////////\n // ## Activation\n ////////////////\n\n /**\n * A click aimed at the DOM element itself (its `<label for>`, its `click()`):\n * `activateControl()`, unless disabled.\n * - Clicks from inside the shadow root arrive retargeted, and are left alone.\n */\n @E.on(\"click\")\n protected onDOMElementClick(event: MouseEvent) {\n if (event.composedPath()[0] !== this.domElement || this.isDisabled) return\n this.activateControl()\n }\n\n /**\n * Hook: what a click aimed at the DOM element itself does; default nothing.\n * - A text control focuses its `<input>`, a rating its tab stop, a slider its first thumb.\n * - A checkbox clicks its input, as a native `<label>` does.\n */\n protected activateControl() {}\n\n ////////////////\n // ## Statics\n ////////////////\n\n /**\n * Fomantic's rules, for every form control (and `FormFields`, `UIRadio`'s group).\n * - Static: ONE for the page; it's stateless, its data on the prototype (`Validator`).\n */\n static validator = new Validator()\n\n /**\n * What `setFormValue()` takes for `value`: a string, a `FormData` of one entry per array item, or `null`.\n * - `null`: the platform's \"submit nothing\" (`setFormValue()` is a boundary that takes it).\n * - Static: pure; `formSubmission()` is the per-element hook over it.\n * - NOTE: a `FormData` needs `name`; unnamed controls submit nothing anyway.\n */\n static submission(value: E.FieldValue, name: string | undefined): string | FormData | null {\n if (value == null || value === false) return null\n if (!Array.isArray(value)) return String(value)\n if (!name) return null\n const data = new FormData()\n for (const item of value as readonly string[]) data.append(name, item)\n return data\n }\n}\n\n/**\n * The vocabulary getters every form control's vocabulary has, typed once for this base\n * (see \"Attributes\" in `UIComponent`).\n */\nexport interface FormComponent<V extends E.ComponentVocabulary = E.ComponentVocabulary> extends FormAttributes {}\n\n/** Getters of the attributes every form vocabulary declares. */\ntype FormAttributes = {\n /** the `disabled` attribute (a disabled fieldset is `formIsDisabled`) */\n disabled: boolean\n /** the form field's name */\n name: string | undefined\n /**\n * a value is needed\n * - A slider or colour picker set up with no value fails it, though it shows a default (`validationValue`).\n */\n required: boolean\n /** the query parameter that keeps the value in the page's address (`addressPlace`) */\n parameter: string | undefined\n}\n\n/**\n * `:state()` for failed validation.\n * - Every form vocabulary names it `invalid`: here, not per component, because the base sets it.\n */\nconst INVALID_STATE = \"invalid\"\n","import { E } from \"spell/ui/core\"\nimport type { F } from \"spell/ui/forms\"\n\n/****************\n * ### `LabelWatch`\n * One `MutationObserver` per root node (document or shadow root), shared by the `ControlLabels` in it: refreshes\n * the controls a `<label>` added, removed or re-pointed (`for`) there may name.\n * - Cheap by scope: exists only while a control is connected in that root; a batch without a `<label>` in it\n * costs one pass over its records.\n * - Targeted: a label with `for` refreshes the controls with that id (old and new `for`); one without (a wrapping\n * label) refreshes every control in the root.\n * - `ControlLabels`' helper, in a file of its own (WWOD §8 › \"One exported class per file\"): only it imports this,\n * so it's in neither the `spell/ui/elements` barrel nor the `forms` entry. Knows `ControlLabels` as a type only.\n ****************/\nexport class LabelWatch {\n /** Controls in this root. */\n private readonly members = new Set<F.ControlLabels>()\n\n /** The observer, while there are members. */\n private observer?: MutationObserver\n\n /** The root node watched. */\n private readonly root: Node\n\n /** A watch over `root`; callers go through `LabelWatch.of()`, so there's one per root. */\n constructor(root: Node) {\n this.root = root\n }\n\n /** Start refreshing `member`; observes from the first one. */\n add(member: F.ControlLabels) {\n this.members.add(member)\n if (this.observer) return\n this.observer = new MutationObserver((records) => this.changed(records))\n this.observer.observe(this.root, {\n childList: true,\n subtree: true,\n attributeFilter: [\"for\"],\n attributeOldValue: true\n })\n }\n\n /** Stop refreshing `member`; stops observing after the last one. */\n remove(member: F.ControlLabels) {\n this.members.delete(member)\n if (this.members.size) return\n this.observer?.disconnect()\n this.observer = undefined\n }\n\n /** Refresh the members `records` may concern. */\n private changed(records: MutationRecord[]) {\n const ids = new Set<string>()\n let all = false\n for (const record of records) {\n if (record.type === \"attributes\") {\n if (!LabelWatch.isLabel(record.target)) continue\n if (record.oldValue) ids.add(record.oldValue)\n ids.add(record.target.htmlFor)\n continue\n }\n for (const nodes of [record.addedNodes, record.removedNodes]) {\n for (const node of nodes) {\n if (node.nodeType !== E.NodeType.element) continue\n const element = node as Element\n const labels = LabelWatch.isLabel(element) ? [element] : element.getElementsByTagName(\"label\")\n for (const label of labels as Iterable<HTMLLabelElement>) {\n if (label.htmlFor) ids.add(label.htmlFor)\n else all = true\n }\n }\n }\n }\n if (!all && !ids.size) return\n for (const member of [...this.members]) if (all || ids.has(member.id)) member.refresh()\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /** The watch for `root`, created on first use. Static: the one registry of every root's watch. */\n static of(root: Node): LabelWatch {\n let watch = LabelWatch.watches.get(root)\n if (!watch) LabelWatch.watches.set(root, (watch = new LabelWatch(root)))\n return watch\n }\n\n /**\n * Forget every root's watch, for tests.\n * - NOTE: a watch already handed out keeps observing until its last member leaves.\n */\n static reset() {\n LabelWatch.watches = new WeakMap()\n }\n\n /** Watches by root node: page-wide, so every control in a root shares one observer. */\n private static watches = new WeakMap<Node, LabelWatch>()\n\n /** Is `node` a `<label>`? By `localName`: no `HTMLLabelElement` global in a server render. */\n private static isLabel(node: Node): node is HTMLLabelElement {\n return (node as Element).localName === \"label\"\n }\n}\n","import { onSettled } from \"solid-js\"\nimport { isServer } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport type { F } from \"spell/ui/forms\"\n// Not in the `forms` entry: `ControlLabels`' own helper\nimport { LabelWatch } from \"./LabelWatch\"\n\n/****************\n * ### `ControlLabels`\n * The accessible name of a form control's INNER element (the `<input>` in its shadow root), from whatever names\n * its DOM element.\n * - Why: `<label for=\"email\">` + `<ui-input id=\"email\">` labels the DOM element (`ElementInternals.labels`), but the\n * focusable element inside has no name of its own, and `aria-labelledby` can't point across the shadow boundary.\n * The element hands `accessibleName` to its inner control as `aria-label`.\n * - Sources, first wins:\n * - DOM element `aria-label`\n * - DOM element `aria-labelledby`: ids resolved in the DOM element's tree, their text joined\n * - the DOM element's `<label>`s (`internals.labels`), their text joined --\n * text inside the DOM element itself is skipped,\n * so a wrapping `<label>Name <ui-input></ui-input></label>` names it \"Name\"\n * - Watched (`MutationObserver`s), re-read on connect and on focus too:\n * - the DOM element's attributes\n * - the current labels' text\n * - `<label>`s added to / removed from the DOM element's tree, and their `for` changes: ONE observer per root node\n * (document or shadow root), shared by every control in it (`LabelWatch`)\n * - NOTE: `aria-labelledby` targets added later are not watched\n * - Server render (`spell/ui/static`): read ONCE, in the constructor, from the parsed page (`serverLabels()`);\n * nothing is watched. Why: a slider thumb, a rating's radio group, an inline calendar's group can't be named by\n * a `<label for>` on the static page either.\n * - MUST be created under the element's owner (it creates an `onSettled`).\n * - Part of the `forms` entry: reaches the core through the `spell/ui/core` ENTRY (`E`), never its leaves, and its\n * `forms` peers through `F` (`forms.ts`); `LabelWatch` directly, its own helper, in neither entry. `@E.state` is\n * safe while this module evaluates: the core never imports `forms`.\n ****************/\nexport class ControlLabels {\n /**\n * The inner control's accessible name (the platform's term); tracked.\n * - `undefined` when nothing names the DOM element.\n */\n @E.state accessor accessibleName: string | undefined = undefined\n\n /** The DOM element. */\n private readonly domElement: F.DOMFormControl\n\n /** Watches the labels found last. */\n private labelObserver?: MutationObserver\n\n /** Watches the DOM element's root node for `<label>`s coming and going. */\n private watch?: LabelWatch\n\n /** The name of `domElement`'s inner control; call it under the element's owner. */\n constructor(domElement: F.DOMFormControl) {\n this.domElement = domElement\n // a server render (`spell/ui/static`) reads the page once: nothing changes, nothing is watched\n if (isServer) {\n this.accessibleName = this.nameFor(this.serverLabels())\n return\n }\n onSettled(() => {\n const refresh = () => this.refresh()\n const attributeObserver = new MutationObserver(refresh)\n attributeObserver.observe(domElement, { attributeFilter: WATCHED_ATTRIBUTES })\n domElement.addEventListener(\"focusin\", refresh)\n this.refresh()\n return () => {\n attributeObserver.disconnect()\n this.labelObserver?.disconnect()\n this.watch?.remove(this)\n this.watch = undefined\n domElement.removeEventListener(\"focusin\", refresh)\n }\n })\n }\n\n /** Its DOM element's `id`: which `<label for>`s concern it (`LabelWatch`). */\n get id(): string {\n return this.domElement.id\n }\n\n /** Re-read the name now, and re-watch the current labels and root; call on connect. */\n refresh() {\n const { domElement } = this\n const watch = domElement.isConnected ? LabelWatch.of(domElement.getRootNode()) : undefined\n if (watch !== this.watch) {\n this.watch?.remove(this)\n watch?.add(this)\n this.watch = watch\n }\n const labels = this.labels()\n this.labelObserver?.disconnect()\n if (labels.length) {\n this.labelObserver ??= new MutationObserver(() => this.refresh())\n for (const label of labels) {\n this.labelObserver.observe(label, { childList: true, characterData: true, subtree: true })\n }\n }\n this.accessibleName = this.nameFor(labels)\n }\n\n ////////////////\n // ## Reading the name\n ////////////////\n\n /**\n * The `<label>`s naming the DOM element, in document order.\n * - `internals.labels`, checked against `label.control`, plus the root's `<label for>` this DOM element's `id`:\n * Firefox leaves `internals.labels` stale when a label's `for` changes (a retargeted label stays in it,\n * and one retargeted to the DOM element never joins it).\n */\n private labels(): HTMLLabelElement[] {\n const { domElement } = this\n const found = new Set(domElement.labels as NodeListOf<HTMLLabelElement>)\n if (domElement.id && domElement.isConnected) {\n const root = domElement.getRootNode() as Document | ShadowRoot\n const selector = `label[for=\"${CSS.escape(domElement.id)}\"]`\n for (const label of root.querySelectorAll<HTMLLabelElement>(selector)) found.add(label)\n }\n return [...found].filter((label) => label.control === domElement).sort(E.byDocumentOrder)\n }\n\n /**\n * `labels()` in a server render, where the DOM element is a linkedom element: no `internals.labels`,\n * no `label.control`, no `CSS.escape`.\n * - The `<label>` wrapping the DOM element (without a `for`, or `for` its id),\n * then the root's `<label for>` its `id`; in document order, as an ancestor comes first.\n */\n private serverLabels(): HTMLLabelElement[] {\n const { domElement } = this\n const found = new Set<HTMLLabelElement>()\n const wrapping = domElement.parentElement?.closest<HTMLLabelElement>(\"label\")\n const wrappingFor = wrapping?.getAttribute(\"for\")\n if (wrapping && (wrappingFor === null || wrappingFor === domElement.id)) found.add(wrapping)\n if (domElement.id) {\n const root = domElement.getRootNode() as Document | ShadowRoot\n const id = domElement.id.replace(/[\"\\\\]/g, \"\\\\$&\")\n const selector = `label[for=\"${id}\"]`\n for (const label of root.querySelectorAll?.<HTMLLabelElement>(selector) ?? []) found.add(label)\n }\n return [...found]\n }\n\n /** The name from the DOM element's attributes, else from `labels`. */\n private nameFor(labels: readonly HTMLLabelElement[]): string | undefined {\n const { domElement } = this\n const own = domElement.getAttribute(\"aria-label\")?.trim()\n if (own) return own\n const ids = domElement.getAttribute(\"aria-labelledby\")?.trim()\n if (ids) {\n const root = domElement.getRootNode() as Document | ShadowRoot\n const text = ids\n .split(/\\s+/)\n .map((id) => root.getElementById?.(id)?.textContent?.trim() ?? \"\")\n .filter(Boolean)\n .join(\" \")\n if (text) return text\n }\n const text = labels\n .map((label) => this.labelTextFor(label))\n .filter(Boolean)\n .join(\" \")\n return text || undefined\n }\n\n /** Text of `label`, minus anything inside the DOM element, whitespace collapsed. */\n private labelTextFor(label: HTMLLabelElement): string {\n return this.textFor(label).replace(/\\s+/g, \" \").trim()\n }\n\n /**\n * Text nodes' text under `node`, in order, skipping the DOM element's subtree.\n * - A walk over `childNodes`, not a `TreeWalker`: a server render's linkedom document has none.\n */\n private textFor(node: Node): string {\n if (node === this.domElement) return \"\"\n if (node.nodeType === E.NodeType.text) return node.textContent ?? \"\"\n let text = \"\"\n for (const child of node.childNodes) text += this.textFor(child)\n return text\n }\n}\n\n/** DOM element attributes that change the name (`id` changes which `<label for>`s match). */\nconst WATCHED_ATTRIBUTES = [\"aria-label\", \"aria-labelledby\", \"id\"]\n","/**\n * `forms` lib entry (`spell/ui/forms`): what only form controls with a VALUE need,\n * split from `core` so a page without one never loads it.\n * - `FormComponent` (form value, validity, reset) on a `DOMFormControl` (the form-control API)\n * - `Validator` (Fomantic's rules)\n * - `MenuOptions` (search, additions, keyboard navigation of an option list)\n * - `HighlightedOption` (the highlighted option of a list a control opens: dropdown, search, icon picker)\n * - `ControlLabels` (the DOM element's `<label>`s as the inner control's name)\n * - NOT `PopoverPanel`, the panel a control opens under itself: `core`'s, since a menu opens one too.\n * - Imported by the families with a value:\n * `checkbox`, `dropdown`, `form`, `input`, `select`, `search`, `calendar`, `rating` and `slider`.\n * - `ui-button` is form-associated too (submit / reset), but through `elementSetup.isAFormControl` alone:\n * it needs no value, validity or form API, so it stays on `core`.\n * - NOTE: re-exports `spell/ui/elements` leaves one by one, for the reason given in `core.ts`.\n * - NOTE: every `forms` file imports the element core through the `spell/ui/core` ENTRY (`E`), never its leaves,\n * or Rolldown hoists what `core` and `forms` share into a third, hashed chunk.\n * - They reach each other through `F`,\n * except what a class definition reads (`FormComponent`'s `DOMFormControl`, `Validator`):\n * that comes directly (WWOD §4 › \"Circular imports\").\n */\n\nexport * from \"spell/ui/elements/Validator\"\nexport * from \"spell/ui/elements/MenuOptions\"\nexport * from \"spell/ui/elements/HighlightedOption\"\nexport * from \"spell/ui/elements/DOMFormControl\"\nexport * from \"spell/ui/elements/FormComponent\"\nexport * from \"spell/ui/elements/ControlLabels\"\n\n/** The `forms` namespace: `import { F } from \"spell/ui/forms\"`, then `F.FormComponent` (`AGENTS.md`). */\nexport * as F from \"spell/ui/forms\"\n"],"mappings":";;;;;AAAA,IAAAoC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,KAuCE,CAACxC,CAAE,GAvCLD;AAwEE,IAAA,CAACC,CAAE,GAOH,IAAA,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IAAMH,IAAOiB,EAAW,YAAY,GAC9BzL,IAAO2K,EACV,MAAM,KAAK,CAAA,CACX,KAAK,MAAOH,EAAK,iBAAiB4B,CAAE,CAAA,EAAG,aAAa,KAAK,KAAK,EAAE,CAAA,CAChE,OAAO,OAAO,CAAA,CACd,KAAK,GAAG;GACX,IAAIpM,GAAM,OAAOA;EACnB;EAKA,OAJakL,EACV,KAAK,MAAU,KAAK,aAAaC,CAAK,CAAC,CAAA,CACvC,OAAO,OAAO,CAAA,CACd,KAAK,GACD,KAAQ,KAAA;CACjB;CAGQ,aAAa,GAAiC;EACpD,OAAO,KAAK,QAAQA,CAAK,CAAA,CAAE,QAAQ,QAAQ,GAAG,CAAA,CAAE,KAAK;CACvD;CAMQ,QAAQ,GAAoB;EAClC,IAAIJ,MAAS,KAAK,YAAY,OAAO;EACrC,IAAIA,EAAK,aAAAC,EAAwB,MAAM,OAAOD,EAAK,eAAe;EAClE,IAAIzJ,IAAO;EACX,KAAA,IAAW+K,KAAStB,EAAK,YAAY,KAAQ,KAAK,QAAQsB,CAAK;EAC/D,OAAO/K;CACT;AACF;AAjJO,IAAAV,EAAA,IAAA,GAKa,oBAAA,IAAA,QAAA,GAATL,EAAA+K,GAAA,GAAS,kBAAlBD,IALWG,GAKOD,CAAA,GALb/K,EAAA8K,GAAME,CAAA,GAAcrL,EAAAqL,GAAA,eAAA;AAApB,IAAMjC,IAANiC,GAoJDK,KAAqB;CAAC;CAAc;CAAmB;AAAI"}
@@ -0,0 +1,6 @@
1
+ //#region src/styles/themes/fruity.css?inline
2
+ var e = "@layer ui.theme{.ui:is(.red,.orange,.yellow,.olive,.green,.teal,.blue,.purple,.pink,.brown),.ui:is(.positive,.negative,.info,.warning,.success,.error),:is(.ui-red,.ui-orange,.ui-yellow,.ui-olive,.ui-green,.ui-teal,.ui-blue,.ui-purple,.ui-pink,.ui-brown),:is(.ui-positive,.ui-negative,.ui-info,.ui-warning,.ui-success,.ui-error){--ui-color-hover:light-dark(oklch(from var(--ui-color) calc(l - .05) calc(c * 1.1) h),oklch(from var(--ui-color) calc(l + .05) calc(c * 1.1) h));--ui-color-focus:light-dark(oklch(from var(--ui-color) calc(l - .08) calc(c * 1.2) h),oklch(from var(--ui-color) calc(l + .08) calc(c * 1.2) h));--ui-color-down:light-dark(oklch(from var(--ui-color) calc(l - .1) c h),oklch(from var(--ui-color) calc(l + .1) c h));--ui-color-active:light-dark(oklch(from var(--ui-color) calc(l - .05) calc(c * 1.15) h),oklch(from var(--ui-color) calc(l + .05) calc(c * 1.15) h))}:root{--ui-info-on-light:#0066d6;--ui-info-on-dark:#64d2ff;--ui-info-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-warning-on-light:#c93400;--ui-warning-on-dark:#ff9f0a;--ui-warning-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-red-on-light:#d70015;--ui-red-on-dark:#ff453a;--ui-red-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-orange-on-light:#c93400;--ui-orange-on-dark:#ff9f0a;--ui-orange-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-yellow-on-light:#fc0;--ui-yellow-on-dark:#ffd60a;--ui-yellow-on:var(--ui-ink-on-light);--ui-yellow-text:light-dark(oklch(from var(--ui-yellow) min(l, .5) c h),oklch(from var(--ui-yellow) max(l, .78) c h));--ui-olive-on-light:#5a7d00;--ui-olive-on-dark:#a8e05f;--ui-olive-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-olive-text:light-dark(oklch(from var(--ui-olive) min(l, .5) c h),oklch(from var(--ui-olive) max(l, .78) c h));--ui-green-on-light:#1f8338;--ui-green-on-dark:#30d158;--ui-green-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-green-text:light-dark(oklch(from var(--ui-green) min(l, .5) c h),oklch(from var(--ui-green) max(l, .78) c h));--ui-teal-on-light:#0071a4;--ui-teal-on-dark:#40c8e0;--ui-teal-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-teal-text:light-dark(oklch(from var(--ui-teal) min(l, .5) c h),oklch(from var(--ui-teal) max(l, .78) c h));--ui-blue-on-light:#0066d6;--ui-blue-on-dark:#0a84ff;--ui-blue-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-violet-on-light:#6a3fd6;--ui-violet-on-dark:#7c55e6;--ui-violet-on:oklch(100% 0 0);--ui-violet-inverted:#b79bff;--ui-violet-inverted-on:var(--ui-ink-on-light);--ui-purple-on-light:#8944ab;--ui-purple-on-dark:#bf5af2;--ui-purple-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-pink-on-light:#d30f45;--ui-pink-on-dark:#ff375f;--ui-pink-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-brown-on-light:#7f6545;--ui-brown-on-dark:#ac8e68;--ui-brown-on:light-dark(oklch(100% 0 0),var(--ui-ink-on-light));--ui-grey-on-light:#6e6e73;--ui-grey-on-dark:#636366;--ui-grey-on:oklch(100% 0 0);--ui-grey-inverted:#a1a1a6;--ui-grey-inverted-on:var(--ui-ink-on-light);--ui-black-on-light:#1d1d1f;--ui-black-on-dark:#3a3a3c;--ui-black-on:oklch(100% 0 0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:root :where(h1,h2,h3,h4,h5,h6,section,ui-section){scroll-margin-top:calc(var(--spell-site-header-height,0px) + 1em)}:is(.ui.table,:where(ui-table)>table),.ui.statistic,.ui.statistics{font-variant-numeric:tabular-nums}:where(a){text-underline-position:from-font;text-decoration-skip-ink:auto}@media (hover:hover){:where(.ui-typography) :where(a){-webkit-text-decoration-color:color-mix(in oklab, currentColor 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, currentColor 40%, transparent);text-decoration-color:color-mix(in oklab, currentColor 40%, transparent)}:where(.ui-typography) :where(a:hover){text-decoration-color:currentColor}}:where(img:not(.background)){outline-offset:-1px;outline:1px solid light-dark(#00000014,#ffffff14)}@media (prefers-reduced-motion:no-preference){.ui.button:not(.loading){transition-property:opacity,background-color,color,box-shadow,scale;transition-duration:var(--ui-button-duration,var(--ui-duration-fast)), var(--ui-button-duration,var(--ui-duration-fast)), var(--ui-button-duration,var(--ui-duration-fast)), var(--ui-button-duration,var(--ui-duration-fast)), .2s;transition-timing-function:var(--ui-ease), var(--ui-ease), var(--ui-ease), var(--ui-ease), ease-out}.ui.button:not(.disabled,:disabled,.loading):active{scale:.97}}:root.ui-scheme-switching{--spell-scheme-switching:on}@container style(--spell-scheme-switching:on){*,:before,:after{transition:none!important}}:root,:root :where(.ui-typography){background-color:var(--ui-background);background-image:var(--ui-wallpaper,var(--glass-wallpaper));background-attachment:fixed}.ui.secondary,.ui-secondary{--ui-color-hover:oklch(from var(--ui-color) calc(l - .05) c h);--ui-color-focus:oklch(from var(--ui-color) calc(l - .08) c h);--ui-color-down:oklch(from var(--ui-color) calc(l - .1) c h);--ui-color-active:oklch(from var(--ui-color) calc(l - .05) c h)}.ui.card,.ui.sidebar,.ui.section.panel:not(.sub,.loose,.pane),.ui.segment:not(.basic),.ui.section:is(.bordered,.styled),.ui.section:is(.block,.styled)>.title,.ui.menu:not(.secondary,.text,.tabular,.segmented.header),.ui.popup,.ui.dropdown .menu[role=listbox],.overflow-menu,.ui-tooltip-bubble,.panel[popover],.ui.modal,.ui.toast{backdrop-filter:var(--glass-blur)}.ui.inverted.segment:not(.basic){background-color:#100f16f5}ui-flyout ui-docs-nav{backdrop-filter:var(--glass-blur)}dialog.ui.flyout::backdrop{backdrop-filter:var(--ui-dimmer-blur)}:root:has(ui-root:state(app)){--ui-font-size:var(--glass-app-font-size);--ui-control-height:var(--glass-app-control-height);--ui-button-padding-block:0px;--ui-input-padding-block:0px;--ui-select-padding-block:0px;--ui-dropdown-padding-block:0px}:root:has(ui-root:state(app)) :where(.ui-content-size){--ui-font-size:var(--glass-content-font-size);--ui-control-height:0px;--ui-button-padding-block:initial;--ui-input-padding-block:initial;--ui-select-padding-block:initial;--ui-dropdown-padding-block:initial}@media (prefers-reduced-transparency:reduce){:root:root{--glass-blur:none;--glass-surface:light-dark(#f7f5fc,#24222d);--glass-surface-strong:light-dark(#fff,#1e1c26);--glass-surface-faint:light-dark(#f7f5fc,#2b2935);--glass-track:light-dark(#e9e9ee,#3a3846);--glass-bar:light-dark(#fff,#1e1c26);--ui-bar-rest-background:var(--glass-bar);--ui-bar-title-background:var(--glass-bar);--ui-bar-panel-background:var(--glass-bar);--ui-bar-wallpaper-tint:var(--glass-bar)}}@media (prefers-contrast:more){:root:root{--glass-edge:light-dark(#3c3c4399,#ffffff80);--glass-hairline:light-dark(#3c3c4399,#ffffff80);--ui-border-color:var(--glass-hairline);--ui-text-muted:light-dark(#3a3a40,#d1d1d6);--ui-text-light:light-dark(#3a3a40,#d1d1d6)}}.ui.header,:where(h1,h2,h3,h4,h5,h6){text-wrap-style:balance}.ui.segmented.menu{--_ui-menu-active-focus-color:var(--ui-focus-color)}:is(h1,h2).ui.header,.ui.header:is(.huge,.massive){font-weight:var(--ui-font-weight-bold);letter-spacing:-.02em}:where(.ui-typography) :where(h1,h2){letter-spacing:-.02em}:host(:state(in-header))>.header,.in-header.header{letter-spacing:normal;text-wrap-style:pretty}:where(.ui-typography){overflow-wrap:break-word}:root{--glass-accent-light:#6a3fd6;--glass-accent-dark:#b79bff;--glass-accent-wash:light-dark(#7a4fe01f,#b79bff33);--glass-accent-solid:light-dark(#6a3fd6,#7650e3);--glass-on-accent:#fff;--glass-accent-text:light-dark(#5a35c4,#d3c2ff);--glass-surface:light-dark(#ffffff73,#26243073);--glass-surface-strong:light-dark(#ffffff9e,#1e1c2694);--glass-surface-faint:light-dark(#fff6,#ffffff0d);--glass-edge:light-dark(#ffffffbf,#ffffff1f);--glass-hairline:light-dark(#3c3c431f,#ffffff14);--glass-track:light-dark(#7676801f,#7676803d);--glass-track-solid:light-dark(#e9e9ee,#3a3846);--glass-blur:blur(28px) saturate(1.7);--glass-app-font-size:13px;--glass-app-control-height:28px;--glass-content-font-size:15px;--glass-bar:light-dark(#fffffff2,#1e1c26f2);--glass-wallpaper:radial-gradient(at 12% 18%, light-dark(#c8b6ff,#4b2f8f) 0, transparent 46%), radial-gradient(at 88% 10%, light-dark(#ffd6e7,#6b2950) 0, transparent 42%), radial-gradient(at 72% 92%, light-dark(#b8e4ff,#1f4d7a) 0, transparent 46%);--ui-font-size:var(--glass-content-font-size);--ui-font-family:-apple-system, BlinkMacSystemFont, \"SF Pro Text\", system-ui, \"Segoe UI\", \"Noto Sans\", Cantarell, Ubuntu, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Noto Color Emoji\";--ui-font-family-heading:-apple-system, BlinkMacSystemFont, \"SF Pro Display\", system-ui, \"Segoe UI\", \"Noto Sans\", \"Helvetica Neue\", Arial, sans-serif;--ui-font-family-mono:\"SF Mono\", ui-monospace, Menlo, Consolas, \"Cascadia Mono\", \"DejaVu Sans Mono\", monospace;--ui-font-family-serif:\"New York\", ui-serif, Palatino, \"Palatino Linotype\", \"Book Antiqua\", P052, \"URW Palladio L\", Georgia, serif;--ui-font-family-sans:var(--ui-font-family);--ui-font-family-typewriter:\"American Typewriter\", \"Courier Prime\", \"Courier New\", Courier, monospace;--ui-font-family-subhead:var(--ui-font-family-heading);--ui-line-height:1.45;--ui-line-height-heading:1.2;--ui-size-mini:.625;--ui-size-tiny:.75;--ui-size-small:.875;--ui-size-large:1.125;--ui-size-big:1.25;--ui-size-huge:1.5;--ui-size-massive:2;--ui-radius-s:8px;--ui-radius-m:10px;--ui-radius-l:14px;--ui-ink-on-light:#1d1d1f;--ui-ink-on-dark:#f5f5f7;--ui-text-color:light-dark(#1d1d1f,#f5f5f7);--ui-text-dark:light-dark(#000,#fff);--ui-text-muted:light-dark(#5e5e66,#aeaeb6);--ui-text-light:light-dark(#6e6e76,#98989f);--ui-background:light-dark(#f2eefb,#15131c);--ui-surface:var(--glass-surface-strong);--ui-surface-muted:var(--glass-surface);--ui-surface-strong:light-dark(#ffffffe6,#3a3846cc);--ui-bar-background:var(--glass-bar);--ui-code-background:light-dark(#ffffff80,#00000040);--ui-highlight:var(--glass-accent-wash);--ui-border-color:var(--glass-hairline);--ui-border-color-strong:light-dark(#3c3c4338,#ffffff2e);--ui-border-color-internal:var(--glass-hairline);--ui-border-color-selected:light-dark(#3c3c4338,#ffffff2e);--ui-border-color-selected-strong:light-dark(#3c3c434d,#ffffff42);--ui-primary:var(--ui-violet);--ui-primary-on:var(--ui-violet-on);--ui-primary-text:var(--glass-accent-text);--ui-primary-background:var(--glass-accent-wash);--ui-primary-inverted:var(--ui-violet-inverted);--ui-primary-inverted-on:var(--ui-violet-inverted-on);--ui-secondary:var(--ui-grey);--ui-secondary-on:var(--ui-grey-on);--ui-secondary-inverted:var(--ui-grey-inverted);--ui-secondary-inverted-on:var(--ui-grey-inverted-on);--ui-link:light-dark(#0066d6,#4da3ff);--ui-link-hover:light-dark(#004fa8,#7dbcff);--ui-focus-width:3px;--ui-focus-offset:1px;--ui-focus-color:light-dark(#7c5ae0,var(--glass-accent-dark));--ui-focus-border:var(--glass-accent-dark);--ui-shadow-ink:light-dark(#281e50,#000);--ui-shadow-subtle:0 1px 2px light-dark(#0000000f,#0000004d);--ui-shadow-raised:inset 0 .5px 0 light-dark(#ffffffb3,#ffffff26), 0 1px 2px light-dark(#281e500f,#00000040), 0 8px 30px light-dark(#281e501f,#00000059);--ui-shadow-floating:inset 0 .5px 0 light-dark(#ffffffb3,#ffffff26), 0 2px 4px light-dark(#281e500f,#0000004d), 0 16px 40px light-dark(#281e5029,#00000073);--ui-shadow-floating-hover:0 2px 6px light-dark(#281e5014,#00000059), 0 24px 56px light-dark(#281e5038,#0000008c);--ui-shadow-overlay:var(--ui-shadow-floating-hover);--ui-ease-out:cubic-bezier(.25, 1, .5, 1);--ui-control-cursor:default;--ui-button-radius:var(--ui-radius-s);--ui-button-or-background:var(--glass-track-solid);--ui-button-or-color:var(--ui-text-muted);--ui-button-or-gap:.25em;--ui-button-padding-block:.4em;--ui-button-padding-inline:.9em;--ui-button-font-weight:500;--ui-button-background:light-dark(#ffffffd9,#ffffff1f);--ui-button-background-hover:light-dark(#fffffffa,#ffffff2e);--ui-button-background-down:light-dark(#ebebf0f2,#ffffff3d);--ui-button-background-active:light-dark(#ebebf0f2,#ffffff38);--ui-button-color:var(--ui-text-color);--ui-button-color-hover:var(--ui-text-color);--ui-label-radius:6px;--ui-label-font-weight:500;--ui-progress-radius:var(--ui-radius-pill);--ui-progress-background:var(--glass-track);--ui-progress-bar-background:var(--ui-primary);--ui-progress-text-color:var(--ui-primary-on);--ui-checkbox-radius:var(--ui-radius-circle);--ui-input-radius:var(--ui-radius-m);--ui-input-background:light-dark(#ffffffb3,#ffffff0f);--ui-input-border-color:var(--glass-hairline);--ui-input-border-color-hover:var(--ui-border-color-strong);--ui-input-border-color-focus:var(--ui-focus-color);--ui-dropdown-radius:var(--ui-radius-m);--ui-dropdown-background:light-dark(#ffffffb3,#ffffff0f);--ui-dropdown-border-color:var(--glass-hairline);--ui-dropdown-border-color-hover:var(--ui-border-color-strong);--ui-menu-radius:var(--ui-radius-m);--ui-menu-text-active-weight:600;--ui-menu-background:var(--glass-surface);--ui-menu-hover-background:light-dark(#0000000d,#ffffff12);--ui-menu-active-background:var(--glass-accent-wash);--ui-menu-active-color:var(--glass-accent-text);--ui-menu-active-fill:var(--glass-accent-solid);--ui-menu-active-fill-color:var(--glass-on-accent);--ui-menu-arrow-color:var(--glass-accent-solid);--ui-menu-capsule-background:var(--glass-track);--ui-menu-capsule-height:var(--glass-app-control-height);--ui-menu-segmented-background:var(--glass-track);--ui-menu-segmented-border:none;--ui-menu-segmented-padding:2px;--ui-menu-segmented-divider:transparent;--ui-menu-segmented-item-padding:.35em 1.5em;--ui-menu-segmented-radius:var(--ui-radius-pill);--ui-menu-segmented-item-radius:var(--ui-radius-pill);--ui-menu-segmented-active-background:light-dark(#fff,#fff3);--ui-menu-segmented-active-color:var(--ui-text-color);--ui-menu-segmented-active-shadow:0 1px 2px #00000026;--ui-menu-segmented-active-hover-background:var(--ui-menu-segmented-active-background);--ui-menu-active-focus-color:var(--ui-focus-color);--ui-card-radius:var(--ui-radius-l);--ui-card-background:var(--glass-surface-strong);--ui-card-border-color:var(--glass-edge);--ui-card-hover-border-color:var(--glass-edge);--ui-card-shadow:var(--ui-shadow-raised);--ui-card-hover-shadow:var(--ui-shadow-floating);--ui-segment-radius:var(--ui-radius-l);--ui-segment-background:var(--glass-surface);--ui-segment-border-color:var(--glass-edge);--ui-segment-shadow:var(--ui-shadow-raised);--ui-segment-raised-shadow:var(--ui-shadow-floating);--ui-section-radius:var(--ui-radius-l);--ui-section-background:var(--glass-surface);--ui-section-shadow:var(--ui-shadow-raised);--ui-section-title-background:var(--glass-surface);--ui-section-sticky-background:var(--glass-surface-strong);--ui-panel-radius:var(--ui-radius-l);--ui-panel-shadow:var(--ui-shadow-raised);--ui-panel-pane-background:light-dark(#ffffff38,var(--glass-surface));--ui-panel-pane-border-color:var(--glass-edge);--ui-panel-pane-filter:var(--glass-blur);--ui-panel-pane-header-background:light-dark(#fff9,color-mix(in oklab, var(--glass-accent-wash) 50%, transparent));--ui-message-radius:var(--ui-radius-m);--ui-toast-radius:var(--ui-radius-l);--ui-toast-background:var(--glass-surface-strong);--ui-toast-shadow:var(--ui-shadow-floating);--ui-popup-radius:var(--ui-radius-m);--ui-popup-background:light-dark(#fffffff2,#1e1c26f2);--ui-popup-border-color:var(--glass-edge);--ui-popup-shadow:var(--ui-shadow-floating);--ui-modal-radius:18px;--ui-modal-background:var(--glass-surface-strong);--ui-modal-shadow:var(--ui-shadow-floating-hover);--ui-modal-dimmer-filter:blur(8px) saturate(1.2);--ui-bar-filter:var(--glass-blur);--ui-bar-color:var(--ui-text-color);--ui-bar-rest-background:light-dark(#ffffff80,#1e1c2680);--ui-bar-title-background:light-dark(#ffffffbf,#1e1c26bf);--ui-bar-panel-background:light-dark(#ffffff80,#1e1c2680);--ui-bar-rest-filter:var(--glass-blur);--ui-bar-wallpaper:var(--glass-wallpaper);--ui-bar-wallpaper-color:var(--ui-background);--ui-bar-wallpaper-filter:none;--ui-bar-wallpaper-tint:light-dark(#ffffff80,#1e1c26d9);--ui-bar-tracked:1;--ui-bar-track:var(--glass-track-solid);--ui-bar-track-radius:var(--ui-radius-pill);--ui-bar-track-width:fit-content;--ui-bar-track-padding:2px;--ui-bar-item-padding:0 1.1em;--ui-bar-item-radius:calc(var(--ui-bar-track-radius) - var(--ui-bar-track-padding));--ui-bar-hover-background:light-dark(#0000000d,#ffffff12);--ui-bar-active-background:light-dark(#fff,#fff3);--ui-bar-active-shadow:0 1px 2px #00000026;--ui-bar-subtabs-border:none;--ui-bar-tip-background:#1816249e;--ui-bar-tip-filter:blur(14px) saturate(160%);--ui-toolbar-button-background:light-dark(#fff3,#ffffff1f);--ui-dimmer-background:light-dark(#0000002e,#00000073);--ui-dimmer-blur:blur(8px) saturate(1.2);--ui-flyout-dimmer-background:var(--ui-dimmer-background);--ui-select-background:var(--ui-input-background);--ui-select-border-color:var(--ui-input-border-color);--ui-select-border-color-hover:var(--ui-input-border-color-hover);--ui-select-border-color-focus:var(--ui-input-border-color-focus);--ui-docs-nav-background:light-dark(#ffffffc7,#1e1c26cc);--ui-docs-nav-header-background:transparent;--ui-docs-nav-band-background:transparent;--ui-docs-nav-band-color:var(--ui-text-muted);--ui-docs-nav-border-color:var(--glass-hairline);--ui-docs-nav-current-background:var(--glass-accent-solid);--ui-docs-nav-current-color:var(--glass-on-accent);--ui-example-frame-background:light-dark(#ffffff59,#1e1c2659);--ui-example-frame-border:1px solid var(--glass-edge);--ui-example-frame-filter:saturate(1.7);--ui-example-demo-background:light-dark(#ffffff8c,#ffffff0d);--ui-example-toggle-background:light-dark(#fffffff2,#ffffff2e);--ui-header-font-weight:var(--ui-font-weight-semibold);--ui-header-h1:2.25;--ui-header-h2:1.375;--ui-header-h3:1.125;--ui-header-h4:1.0625;--ui-header-sub-color:var(--ui-text-muted);--ui-code-color:light-dark(#2b2238,#efe8f7);--ui-code-heading:light-dark(#6f3cc4,#d3b8ff);--ui-code-comment:light-dark(#6e6285,#a99bc4);--ui-code-keyword:light-dark(#b8327a,#ff8fc8);--ui-code-type:light-dark(#5b3fb8,#c8b6ff);--ui-code-library:light-dark(#1f6fa8,#9fd8ff);--ui-code-name:light-dark(#2b2238,#efe8f7);--ui-code-member:light-dark(#1f6fa8,#8fd0ff);--ui-code-parameter:light-dark(#9a4a14,#ffc6a8);--ui-code-action:light-dark(#2357a8,#b8e4ff);--ui-code-constant:light-dark(#b0306a,#ffa3c7);--ui-code-string:light-dark(#2f7a3e,#b9f0c4);--ui-code-tag:light-dark(#8a37b5,#e2a8ff);--ui-code-punctuation:light-dark(#6e6285,#b3a6c9);--ui-code-attr:light-dark(#1f6fa8,#8fd0ff);--ui-code-meta:light-dark(#8a37b5,#e2a8ff);--ui-code-addition:light-dark(#2f7a3e,#b9f0c4);--ui-code-deletion:light-dark(#b3263a,#ff9aa8)}}";
3
+ //#endregion
4
+ export { e as default };
5
+
6
+ //# sourceMappingURL=fruity-BRVlgJZd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fruity-BRVlgJZd.js","names":["fruity_default"],"sources":["../src/styles/themes/fruity.css?inline"],"sourcesContent":["/* GENERATED by `yarn gen:styles` from `fruity.theme.json5`: edit that file, never this sheet. */\n\n@import \"./glass.css\";\n\n@layer ui.theme {\n :root {\n --glass-wallpaper:\n radial-gradient(at 12% 18%, light-dark(#c8b6ff, #4b2f8f) 0, transparent 46%),\n radial-gradient(at 88% 10%, light-dark(#ffd6e7, #6b2950) 0, transparent 42%),\n radial-gradient(at 72% 92%, light-dark(#b8e4ff, #1f4d7a) 0, transparent 46%);\n --ui-bar-track-radius: var(--ui-radius-pill);\n --ui-bar-wallpaper-tint: light-dark(#ffffff80, #1e1c26d9);\n --ui-code-color: light-dark(#2b2238, #efe8f7);\n --ui-code-heading: light-dark(#6f3cc4, #d3b8ff);\n --ui-code-comment: light-dark(#6e6285, #a99bc4);\n --ui-code-keyword: light-dark(#b8327a, #ff8fc8);\n --ui-code-type: light-dark(#5b3fb8, #c8b6ff);\n --ui-code-library: light-dark(#1f6fa8, #9fd8ff);\n --ui-code-name: light-dark(#2b2238, #efe8f7);\n --ui-code-member: light-dark(#1f6fa8, #8fd0ff);\n --ui-code-parameter: light-dark(#9a4a14, #ffc6a8);\n --ui-code-action: light-dark(#2357a8, #b8e4ff);\n --ui-code-constant: light-dark(#b0306a, #ffa3c7);\n --ui-code-string: light-dark(#2f7a3e, #b9f0c4);\n --ui-code-tag: light-dark(#8a37b5, #e2a8ff);\n --ui-code-punctuation: light-dark(#6e6285, #b3a6c9);\n --ui-code-attr: light-dark(#1f6fa8, #8fd0ff);\n --ui-code-meta: light-dark(#8a37b5, #e2a8ff);\n --ui-code-addition: light-dark(#2f7a3e, #b9f0c4);\n --ui-code-deletion: light-dark(#b3263a, #ff9aa8);\n }\n}\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  //#region src/styles/themes/fruity.theme.json5?raw
2
- var e = "// Fruity: the Glass theme on a soft pastel wallpaper, as a Spell UI theme.\n// - One of Spell's own themes, the set `UI.themes.own` lists; applied ON TOP of `classic.css`.\n// - Its sheet, `fruity.css`, is GENERATED from this file: `yarn gen:styles` (`ThemeFile`; epic `debut` P18).\n// - Glass with what Fruity adds ON TOP (epic `debut` P17, J88): it extends `glass`, and keeps only that.\n// - A fix to the glass is made once, in `glass.theme.json5` or its rules sheet.\n// - Its sheet imports Glass's, and Vite inlines the import: the theme is still ONE sheet (`UI.themes`).\n// - What it adds: the wallpaper behind the page, three blurred colour washes,\n// lavender, pink and sky in light; plum, wine and navy in dark.\n// - and what the wallpaper asks of the bars over it: pill tracks, title bands that hide it in dark\n// - Each wash a `light-dark()` colour, so the gradient follows the scheme.\n// - Drawn by Glass's page rule (`--glass-wallpaper`), over its solid page colour,\n// and under the bars that stick at a page's top (`--ui-bar-wallpaper`).\n// - The default theme of the Spell editor and the epic pages.\n{\n \"$schema\": \"./theme.schema.json\",\n \"extends\": \"glass\",\n \"own\": {\n \"glass-wallpaper\": \"radial-gradient(at 12% 18%, light-dark(#c8b6ff, #4b2f8f) 0, transparent 46%), radial-gradient(at 88% 10%, light-dark(#ffd6e7, #6b2950) 0, transparent 42%), radial-gradient(at 72% 92%, light-dark(#b8e4ff, #1f4d7a) 0, transparent 46%)\"\n },\n \"components\": {\n \"bar\": {\n // a titled toolbar's track and its keys: pills, as every Fruity tab bar\n // (Owen, 2026-10-23: \"All should be fully rounded pills\"); a key's corners follow the track's (`glass.css`)\n \"track-radius\": \"{radii.pill}\",\n // dark: the wallpaper under a section title, in place or stuck, mostly covered\n // - its wine and plum washes, under Glass's 50%, drew a red / purple seam along every title band\n // - only over the wallpaper: the editor's top bar keeps Glass's 50% at rest (`--ui-bar-rest-background`)\n \"wallpaper-tint\": { \"light\": \"#ffffff80\", \"dark\": \"#1e1c26d9\" }\n }\n }\n}\n";
2
+ var e = "// Fruity: the Glass theme on a soft pastel wallpaper, as a Spell UI theme.\n// - One of Spell's own themes, the set `UI.themes.own` lists; applied ON TOP of `classic.css`.\n// - Its sheet, `fruity.css`, is GENERATED from this file: `yarn gen:styles` (`ThemeFile`; epic `debut` P18).\n// - Glass with what Fruity adds ON TOP (epic `debut` P17, J88): it extends `glass`, and keeps only that.\n// - A fix to the glass is made once, in `glass.theme.json5` or its rules sheet.\n// - Its sheet imports Glass's, and Vite inlines the import: the theme is still ONE sheet (`UI.themes`).\n// - What it adds: the wallpaper behind the page, three blurred colour washes,\n// lavender, pink and sky in light; plum, wine and navy in dark.\n// - and what the wallpaper asks of the bars over it: pill tracks, title bands that hide it in dark\n// - Each wash a `light-dark()` colour, so the gradient follows the scheme.\n// - Drawn by Glass's page rule (`--glass-wallpaper`), over its solid page colour,\n// and under the bars that stick at a page's top (`--ui-bar-wallpaper`).\n// - The default theme of the Spell editor and the epic pages.\n{\n \"$schema\": \"./theme.schema.json\",\n \"extends\": \"glass\",\n \"own\": {\n \"glass-wallpaper\": \"radial-gradient(at 12% 18%, light-dark(#c8b6ff, #4b2f8f) 0, transparent 46%), radial-gradient(at 88% 10%, light-dark(#ffd6e7, #6b2950) 0, transparent 42%), radial-gradient(at 72% 92%, light-dark(#b8e4ff, #1f4d7a) 0, transparent 46%)\"\n },\n \"components\": {\n \"bar\": {\n // a titled toolbar's track and its keys: pills, as every Fruity tab bar\n // (Owen, 2026-10-23: \"All should be fully rounded pills\"); a key's corners follow the track's (`glass.css`)\n \"track-radius\": \"{radii.pill}\",\n // dark: the wallpaper under a section title, in place or stuck, mostly covered\n // - its wine and plum washes, under Glass's 50%, drew a red / purple seam along every title band\n // - only over the wallpaper: the editor's top bar keeps Glass's 50% at rest (`--ui-bar-rest-background`)\n \"wallpaper-tint\": { \"light\": \"#ffffff80\", \"dark\": \"#1e1c26d9\" }\n }\n },\n // The code's colours (epic `debut` P22): Fruity's own (Q41): pink and violet from its wallpaper, sky for names, a pastel green for text in quotes.\n // - Every role's light and dark; `editor` the editor's own (what's left out takes the recipe, `codeRoles`).\n \"code\": {\n \"text\": { \"light\": \"#2b2238\", \"dark\": \"#efe8f7\" },\n \"heading\": { \"light\": \"#6f3cc4\", \"dark\": \"#d3b8ff\" },\n \"comment\": { \"light\": \"#6e6285\", \"dark\": \"#a99bc4\" },\n \"keyword\": { \"light\": \"#b8327a\", \"dark\": \"#ff8fc8\" },\n \"type\": { \"light\": \"#5b3fb8\", \"dark\": \"#c8b6ff\" },\n \"library\": { \"light\": \"#1f6fa8\", \"dark\": \"#9fd8ff\" },\n \"name\": { \"light\": \"#2b2238\", \"dark\": \"#efe8f7\" },\n \"member\": { \"light\": \"#1f6fa8\", \"dark\": \"#8fd0ff\" },\n \"parameter\": { \"light\": \"#9a4a14\", \"dark\": \"#ffc6a8\" },\n \"action\": { \"light\": \"#2357a8\", \"dark\": \"#b8e4ff\" },\n \"constant\": { \"light\": \"#b0306a\", \"dark\": \"#ffa3c7\" },\n \"string\": { \"light\": \"#2f7a3e\", \"dark\": \"#b9f0c4\" },\n \"tag\": { \"light\": \"#8a37b5\", \"dark\": \"#e2a8ff\" },\n \"punctuation\": { \"light\": \"#6e6285\", \"dark\": \"#b3a6c9\" },\n \"attr\": { \"light\": \"#1f6fa8\", \"dark\": \"#8fd0ff\" },\n \"meta\": { \"light\": \"#8a37b5\", \"dark\": \"#e2a8ff\" },\n \"addition\": { \"light\": \"#2f7a3e\", \"dark\": \"#b9f0c4\" },\n \"deletion\": { \"light\": \"#b3263a\", \"dark\": \"#ff9aa8\" }\n }\n}\n";
3
3
  //#endregion
4
4
  export { e as default };
5
5
 
6
- //# sourceMappingURL=fruity.theme-BJcMiPl1.js.map
6
+ //# sourceMappingURL=fruity.theme-CbC7Jyvk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fruity.theme-CbC7Jyvk.js","names":["fruity_theme_default"],"sources":[],"mappings":""}