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
@@ -1 +1 @@
1
- {"version":3,"file":"ui-property-editor.js","names":["EDITOR_TAG","PROPERTY_TAG","GROUP_TAG","_init","_a","_init","_isChanged_dec","_isReadOnly_dec","_elementSetup_dec","_vocabulary_dec","_isChanged","E.untracked","__name","E.proto","E.protoMerged","E.state","E.whileConnected","E.cssState","E.onChange","propertyCSS","<Show when={this.hasTitle} fallback={this.body()}>\n <Dynamic component={SECTION_TAG} {...this.sectionAttributes}>\n <For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>\n {this.outputAndError()}\n {this.body()}\n </Dynamic>\n </Show>","this","<Dynamic component={SECTION_TAG} {...this.sectionAttributes}>\n <For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>\n {this.outputAndError()}\n {this.body()}\n </Dynamic>","component={SECTION_TAG}","<For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>","this.outputAndError()","this.body()","<div\n class={this.rootClass}\n part={`${this.partForName(OWN.editor)} ${this.partForName(OWN.form)}`}\n inert={this.disabled || this.loading}\n aria-busy={this.loading ? \"true\" : void 0}\n >\n <Show when={this.hasTitle} fallback={this.body()}>\n <Dynamic component={SECTION_TAG} {...this.sectionAttributes}>\n <For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>\n {this.outputAndError()}\n {this.body()}\n </Dynamic>\n </Show>\n {this.debugBox()}\n </div>","part={`${this.partForName(OWN.editor)} ${this.partForName(OWN.form)}`}","inert={this.disabled || this.loading}","aria-busy={this.loading ? \"true\" : void 0}","<Show when={!this.hasTitle}>{this.outputAndError()}</Show>","<Show when={this.apply === ON_SAVE}>\n <div class={FOOTER} part={this.partForName(OWN.footer)}>\n <Dynamic component={BUTTON_TAG} color=\"primary\" onClick={() => this.save()}>\n {this.translationForKey(OWN.save)}\n </Dynamic>\n <Dynamic component={BUTTON_TAG} onClick={() => this.cancel()}>\n {this.translationForKey(OWN.cancel)}\n </Dynamic>\n </div>\n </Show>","<Dynamic component={BUTTON_TAG} color=\"primary\" onClick={() => this.save()}>\n {this.translationForKey(OWN.save)}\n </Dynamic>","component={BUTTON_TAG}","color=\"primary\"","onClick={() => this.save()}","<div class={FOOTER} part={this.partForName(OWN.footer)}>\n <Dynamic component={BUTTON_TAG} color=\"primary\" onClick={() => this.save()}>\n {this.translationForKey(OWN.save)}\n </Dynamic>\n <Dynamic component={BUTTON_TAG} onClick={() => this.cancel()}>\n {this.translationForKey(OWN.cancel)}\n </Dynamic>\n </div>","<Dynamic component={BUTTON_TAG} onClick={() => this.cancel()}>\n {this.translationForKey(OWN.cancel)}\n </Dynamic>","onClick={() => this.cancel()}","part={this.partForName(OWN.footer)}","<Show when={output || this.slots.hasContent(this.slotForName(OWN.output))}>\n <span class={OUTPUT} part={this.partForName(OWN.output)} slot={this.hasTitle ? ACTIONS_SLOT : void 0}>\n <slot name={this.slotForName(OWN.output)}>{output}</slot>\n </span>\n </Show>","part={this.partForName(OWN.output)}","slot={this.hasTitle ? ACTIONS_SLOT : void 0}","name={this.slotForName(OWN.output)}","<span class={OUTPUT} part={this.partForName(OWN.output)} slot={this.hasTitle ? ACTIONS_SLOT : void 0}>\n <slot name={this.slotForName(OWN.output)}>{output}</slot>\n </span>","<Show when={error}>\n <div class={ERROR_LINE} part={this.partForName(OWN.errorLine)} role=\"alert\">\n {error}\n </div>\n </Show>","when={error}","part={this.partForName(OWN.errorLine)}","<div class={ERROR_LINE} part={this.partForName(OWN.errorLine)} role=\"alert\">\n {error}\n </div>","_tmpl$","_tmpl$2","_isReadOnly_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","E.proto","E.protoMerged","E.state","E.onChange","E.untracked","E.cssState","E.SlotContent","E.camelCase","_$createComponent","_$mergeProps","_$getOwner","_$memo","_$readShallow","_$setAttribute","OUTPUT","ERROR_LINE","__name","editorCSS","UIT.FormStates","<Show when={output || this.slots.hasContent(OUTPUT)}>\n <span class={OUTPUT} part={OUTPUT}>\n <slot name={OUTPUT}>{output}</slot>\n </span>\n </Show>","this","<span class={OUTPUT} part={OUTPUT}>\n <slot name={OUTPUT}>{output}</slot>\n </span>","<Show when={error}>\n <div class={ERROR_LINE} part={ERROR_LINE} role=\"alert\">\n {error}\n </div>\n </Show>","when={error}","<div class={ERROR_LINE} part={ERROR_LINE} role=\"alert\">\n {error}\n </div>","E.DOMLoadableBodyElement","E.proto","E.protoMerged","E.state","E.untracked","E.cssState","_$createComponent","_$getOwner","_$readShallow","__name","groupCSS","__publicField","__decorateElement","__decoratorMetadata","__decoratorStart","__name$1","FormStates","__runInitializers","__privateAdd","fieldVocabulary","formVocabulary","sectionVocabulary","getOwner$1","PropertySchemas","vocabulary","schema","name","block","spec","CHOICE_KINDS","words","kebabCase","attributes","property","_schema","type","KIND_FOR_TYPE","value","rules","each","PropertyEditorPages","editor","document","EDITOR_TAG$1","root","problems","named","PROPERTY_TAG$1","kind","problem","UI_MODULE","tag","className","NOT_COMPILED","layout","child","uiModule","found","GROUP_TAG$1","OTHER_ATTRIBUTE","group","OTHER","key","candidate","types","KIND_TYPES","LIST","CHOICE_LIST_KIND","indent","INDENT","depth","element","empty","end","children","taken","own","skip","names","base","bases","item","EDITOR_TAG","GROUP_TAG","PROPERTY_TAG","EDITOR_SELECTOR","GROUP_SELECTOR","PROPERTY_SELECTOR","MADE_ATTRIBUTE","MADE_FROM","VALUE_FROM_ATTRIBUTE","propertyVocabulary","UIProperty_default","_schemaRules_dec","_a$2","_init$2","_removeMadeControls_dec","_makeControl_dec","_onControlNeeded_dec","_onChoiceSourceChanged_dec","_loadedChoices_dec","_isButtonRow_dec","_isChanged_dec$1","_isReadOnly_dec$2","_isProperty_dec","_isInReadonly_dec","_watchEditor_dec","_editor_dec","_elementSetup_dec$2","_vocabulary_dec$2","_b","_init2","_editor","_isInReadonly","_isChanged$1","_loadedChoices","_DOMPropertyElement","DOMFieldElement","untracked","component","isChanged","DOMPropertyElement","_UIProperty","UIField","proto","protoMerged","state","whileConnected","cssState","onChange","readonly","NAMED","TEXT","UI","RADIOS","text","choice","set","ValueSets","source","isReady","isCurrent","choices","Warnings","error","control","made","radio","at","UIProperty","propertyEditorVocabulary","UIPropertyEditor_default","_tmpl$$1","_tmpl$2$1","_tmpl$3","_tmpl$4","_isReadOnly_dec$1","_isPropertyEditor_dec","_loadLayout_dec","_onSourceChanged_dec","_removeMadeProperties_dec","_onSchemaChanged_dec","_schemaTagsDefined_dec","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_schemaTagsDefined","DOMFormElement","_UIPropertyEditor","UIForm","SlotContent","Reactive","given","added","isConnected","from","url","isServer","selector","OWN","page","camelCase","part","around","FormBinding","result","passed","SECTION_ATTRIBUTES","_self$","_el$","_el$2","_el$3","insert","createComponent","Show","Dynamic","mergeProps","SECTION_TAG","For","_el$4","setAttribute","memo","effect","readShallow","_p$","t","a","o","FORWARDED_SLOTS","_self$2","_el$5","ON_SAVE","_el$6","_el$7","_el$8","BUTTON_TAG","FOOTER","output","_self$3","_el$9","_el$10","OUTPUT$1","ACTIONS_SLOT","_el$11","ERROR_LINE$1","e","CHANGE_EVENT","ruleName","rule","field","messages","INVALID_EVENT","held","properties","groups","SUCCESS_EVENT","UIPropertyEditor","slot","SOURCE_ONLY","propertyGroupVocabulary","UIPropertyGroup_default","_tmpl$","_tmpl$2","_isReadOnly_dec","_isChanged_dec","_isError_dec","_isPropertyGroup_dec","_markFieldFailed_dec","_failedFields_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_failedFields","_isChanged","DOMLoadableBodyElement","identifier","isFailed","_UIPropertyGroup","UIPanel","next","ERROR","loose","LOOSE","BAND","GROUP","OUTPUT","_v$","_$p","ERROR_LINE","UIPropertyGroup"],"sources":["../src/property/PropertySchemas.ts","../src/property/PropertyEditorPages.ts","../src/components/ui-property-editor/UIPropertyEditor.types.ts","../src/components/ui-property-editor/UIProperty.en.ts","../src/components/ui-property-editor/UIProperty.css?inline","../src/components/ui-property-editor/UIProperty.tsx","../src/components/ui-property-editor/UIPropertyEditor.en.ts","../src/components/ui-property-editor/UIPropertyEditor.css?inline","../src/components/ui-property-editor/UIPropertyEditor.tsx","../src/components/ui-property-editor/UIPropertyGroup.en.ts","../src/components/ui-property-editor/UIPropertyGroup.css?inline","../src/components/ui-property-editor/UIPropertyGroup.tsx","../src/components/ui-property-editor/index.ts"],"sourcesContent":["import { kebabCase } from \"spell/ui/util\"\n// the types-only leaf, as `V`: `spell/ui/api` would bring every element (and Solid's JSX) into a node tool's type check\nimport type * as V from \"spell/element/vocabulary.types\"\n\n/****************\n * ### `PropertySchemas`\n * Turns what a thing is described with into what `<ui-property-editor>` reads, a `V.PropertySchema`:\n * its name, and its attributes.\n * - Each attribute is an `AttributeSpec`: a component vocabulary's own shape, grown for forms.\n *\n * - The sources:\n * - a component's vocabulary: it IS one already (`fromVocabulary()`)\n * - a JSON block with a JSON Schema (`fromJSONSchema()`)\n * - a JSON block with none: guessed from the values it holds (`fromValues()`)\n * - a spell class: the app reads it (Spell UI never imports spell's packages; epic `property-editor` Q16)\n * - And what a form asks of any attribute: its value's type (`typeOf()`) and its label (`labelOf()`).\n * - Pure data, no DOM and no Solid: node tools and tests use it as they are.\n * - STATIC and instance-free on purpose: it keeps nothing between calls.\n ****************/\nexport class PropertySchemas {\n /** A component's vocabulary, as a property schema: its tag is the name. */\n static fromVocabulary(vocabulary: V.ComponentVocabulary): V.PropertySchema {\n return { name: vocabulary.tag, description: vocabulary.description, attributes: vocabulary.attributes }\n }\n\n /**\n * A JSON Schema (an `object` schema), as a property schema named `name` (else its `title`).\n * - What each property reads:\n * - its type, and `default`\n * - `title` as the label, `description` as the tip\n * - `minimum` / `maximum` / `multipleOf` / `pattern`\n * - `enum` as choices\n * - A nested object is a `thing` with its own attributes; an array, a `list` of its items' type.\n * - Keys starting with `$` are the file's own (`$type`, `$schema` ...): never a property.\n * - throws a `TypeError` for a schema that isn't an object's\n */\n static fromJSONSchema(schema: JSONSchema, name?: string): V.PropertySchema {\n if (!isObjectSchema(schema)) {\n throw new TypeError(\"PropertySchemas.fromJSONSchema(): not an object's schema; pass one with `properties`\")\n }\n return {\n name: name ?? schema.title ?? \"\",\n description: schema.description,\n attributes: PropertySchemas.attributesOfJSONSchema(schema)\n }\n }\n\n /**\n * A JSON block's properties, guessed from the values it holds: for a block with no schema.\n * - text, a number, yes / no\n * - an array is a `list` of its first item's type; an object, a nested `thing`\n * - `null` (or an empty array) says nothing of its type: `data`, edited as JSON text.\n */\n static fromValues(block: Record<string, unknown>, name = \"\"): V.PropertySchema {\n return { name, attributes: PropertySchemas.attributesOfValues(block) }\n }\n\n /**\n * What an attribute's value IS, as a form edits it: its own `type`, else what its `kind` says.\n * - `boolean` / `keyOnly`: `boolean`; `number`: `number`; `json`: `data`; `icon`: `icon`\n * - a kind with `values`: `choice`; any other: `text`\n */\n static typeOf(spec: V.AttributeSpec): V.ValueType {\n if (spec.type) return spec.type\n switch (spec.kind) {\n case \"boolean\":\n case \"keyOnly\":\n return \"boolean\"\n case \"number\":\n return \"number\"\n case \"json\":\n return \"data\"\n case \"icon\":\n return \"icon\"\n default:\n return spec.values || spec.choicesFrom || CHOICE_KINDS.has(spec.kind) ? \"choice\" : \"text\"\n }\n }\n\n /** An attribute's label, for people: its own, else made from its name (`listsStartAt` => `Lists start at`). */\n static labelOf(spec: V.AttributeSpec): string {\n if (spec.label) return spec.label\n const words = kebabCase(spec.name).replaceAll(\"-\", \" \")\n return words.charAt(0).toUpperCase() + words.slice(1)\n }\n\n ////////////////\n // ## JSON Schema\n ////////////////\n\n /** The attributes of an object's schema, in its own order. */\n private static attributesOfJSONSchema(schema: JSONSchema): V.AttributeSpec[] {\n const attributes: V.AttributeSpec[] = []\n for (const [name, property] of Object.entries(schema.properties ?? {})) {\n if (name.startsWith(\"$\")) continue\n attributes.push(PropertySchemas.attributeOfJSONSchema(name, property))\n }\n return attributes\n }\n\n /** One property's schema, as an attribute. */\n private static attributeOfJSONSchema(name: string, _schema: JSONSchema): V.AttributeSpec {\n const schema = PropertySchemas.withoutNull(_schema)\n const type = PropertySchemas.typeOfJSONSchema(schema)\n const spec: Writable<V.AttributeSpec> = { name, kind: KIND_FOR_TYPE[type], type, description: \"\" }\n if (schema.title) spec.label = schema.title\n if (schema.description) spec.tip = schema.description\n if (schema.enum) spec.values = schema.enum.filter((value) => value !== null).map(String)\n if (schema.minimum !== undefined) spec.min = schema.minimum\n if (schema.maximum !== undefined) spec.max = schema.maximum\n if (schema.multipleOf !== undefined) spec.step = schema.multipleOf\n if (schema.pattern && !schema.patternErrorMessage) spec.pattern = schema.pattern\n const rules = PropertySchemas.rulesOfJSONSchema(schema)\n if (rules.length) spec.rules = rules\n if (isPlainDefault(schema.default)) spec.default = schema.default\n if (type === \"list\" && schema.items)\n spec.of = PropertySchemas.typeOfJSONSchema(PropertySchemas.withoutNull(schema.items))\n if (type === \"thing\") spec.attributesOf = PropertySchemas.attributesOfJSONSchema(schema)\n return spec\n }\n\n /**\n * A property's checks, as the form's rules.\n * - What a spell type's rules write into its JSON Schema (epic `property-editor` P9), read back.\n * - `minLength` / `maxLength`, `format: \"email\"` / `\"uri\"`\n * - a `pattern` with VS Code's `patternErrorMessage`: the rule with those words (a bare `pattern` is `pattern`)\n */\n private static rulesOfJSONSchema(schema: JSONSchema): V.RuleSpec[] {\n const rules: V.RuleSpec[] = []\n if (schema.minLength)\n rules.push(schema.minLength === 1 ? { type: \"empty\" } : { type: \"minLength\", value: `${schema.minLength}` })\n if (schema.maxLength !== undefined) rules.push({ type: \"maxLength\", value: `${schema.maxLength}` })\n if (schema.format === \"email\") rules.push({ type: \"email\" })\n if (schema.format === \"uri\") rules.push({ type: \"url\" })\n if (schema.pattern && schema.patternErrorMessage)\n rules.push({ type: \"regExp\", value: `/${schema.pattern}/`, prompt: schema.patternErrorMessage })\n return rules\n }\n\n /** A schema's type, as a form edits it. */\n private static typeOfJSONSchema(schema: JSONSchema): V.ValueType {\n if (schema.enum) return \"choice\"\n const type = Array.isArray(schema.type) ? schema.type.find((each) => each !== \"null\") : schema.type\n switch (type) {\n case \"string\":\n return schema.format === \"date\" || schema.format === \"date-time\" ? \"date\" : \"text\"\n case \"number\":\n case \"integer\":\n return \"number\"\n case \"boolean\":\n return \"boolean\"\n case \"array\":\n return \"list\"\n case \"object\":\n return isObjectSchema(schema) ? \"thing\" : \"data\"\n default:\n return \"data\"\n }\n }\n\n /** `schema` without its \"or nothing\": the first of an `anyOf` that isn't `null`, else itself. */\n private static withoutNull(schema: JSONSchema): JSONSchema {\n return schema.anyOf?.find((each) => each.type !== \"null\") ?? schema\n }\n\n ////////////////\n // ## Guessed from values\n ////////////////\n\n /** The attributes of a JSON block, one per key, guessed from its values. */\n private static attributesOfValues(block: Record<string, unknown>): V.AttributeSpec[] {\n const attributes: V.AttributeSpec[] = []\n for (const [name, value] of Object.entries(block)) {\n if (name.startsWith(\"$\")) continue\n const type = PropertySchemas.typeOfValue(value)\n const spec: Writable<V.AttributeSpec> = { name, kind: KIND_FOR_TYPE[type], type, description: \"\" }\n if (type === \"list\") spec.of = PropertySchemas.typeOfValue((value as unknown[])[0])\n if (type === \"thing\") spec.attributesOf = PropertySchemas.attributesOfValues(value as Record<string, unknown>)\n attributes.push(spec)\n }\n return attributes\n }\n\n /** A value's type, as a form edits it. */\n private static typeOfValue(value: unknown): V.ValueType {\n if (typeof value === \"string\") return \"text\"\n if (typeof value === \"number\") return \"number\"\n if (typeof value === \"boolean\") return \"boolean\"\n if (Array.isArray(value)) return value.length ? \"list\" : \"data\"\n if (value && typeof value === \"object\") return \"thing\"\n return \"data\"\n }\n}\n\n////////////////\n// ## Types and helpers\n////////////////\n\n/**\n * The parts of a JSON Schema `PropertySchemas` reads.\n * - Anything else in it is left alone.\n */\nexport type JSONSchema = {\n type?: string | readonly string[]\n title?: string\n description?: string\n properties?: Record<string, JSONSchema>\n items?: JSONSchema\n enum?: readonly unknown[]\n anyOf?: readonly JSONSchema[]\n format?: string\n minimum?: number\n maximum?: number\n multipleOf?: number\n minLength?: number\n maxLength?: number\n pattern?: string\n /** VS Code's own: what to say when `pattern` fails. */\n patternErrorMessage?: string\n default?: unknown\n /** A fixed value (`\"$type\": { \"const\": \"Person\" }`): read by nothing here. */\n const?: unknown\n}\n\n/** An `AttributeSpec` being built: its fields writable. */\ntype Writable<T> = { -readonly [K in keyof T]: T[K] }\n\n/** Kinds that always take one of a set of values: their own (`size`), or `values`. */\nconst CHOICE_KINDS = new Set<V.AttributeKind>([\"enum\", \"valueOnly\", \"size\", \"color\", \"textAlign\", \"verticalAlign\"])\n\n/** The property-only kind an attribute read from JSON gets, by its value's type. */\nconst KIND_FOR_TYPE: Record<V.ValueType, V.AttributeKind> = {\n text: \"string\",\n number: \"number\",\n boolean: \"boolean\",\n date: \"string\",\n choice: \"enum\",\n icon: \"icon\",\n list: \"json\",\n thing: \"json\",\n data: \"json\"\n}\n\n/** An object's schema: `properties` to read. */\nfunction isObjectSchema(schema: JSONSchema): boolean {\n return !!schema.properties\n}\n\n/** A default an attribute can hold as it is: text, a number, yes / no. */\nfunction isPlainDefault(value: unknown): value is string | number | boolean {\n return typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\"\n}\n","// the types-only leaf, as `V`: `spell/ui/api` would bring every element (and Solid's JSX) into a node tool's type check\nimport type * as V from \"spell/element/vocabulary.types\"\nimport { kebabCase } from \"spell/ui/util\"\nimport { PropertySchemas } from \"./PropertySchemas\"\n\n/****************\n * ### `PropertyEditorPages`\n * EDITOR PAGES: a property editor's layout saved as a file of plain markup, `Card.editor.html`,\n * which `<ui-property-editor source>` loads as it is (epic `property-editor` P6).\n *\n * ```html\n * <ui-property-editor schema=\"Card\" label=\"Card\">\n * <ui-property name=\"rank\" as=\"buttons\"></ui-property>\n * <ui-property-group label=\"Other\">\n * <ui-property name=\"direction\"></ui-property>\n * </ui-property-group>\n * </ui-property-editor>\n * ```\n *\n * - `write()`: a schema's default page, one property per attribute, in order.\n * - `check()`: what's wrong with a page, against its schema as it is now.\n * - a property the page names that the schema dropped\n * - an attribute of the schema the page doesn't name\n * - a control (`as`) that no longer fits its type (`select` for a value that has no choices any more)\n * - `compile()`: the page as ONE javascript module defining `<card-editor>` (epic `property-editor` P7).\n * - Its layout and schema are inlined, so it needs Spell UI's property editor and nothing else:\n * no page loading, no spell parser.\n * - `spell compile` writes it beside a program's own output, `Card.editor.js`.\n * - `fix()`: the page put right:\n * - dropped properties taken away\n * - new ones added to an \"Other\" group\n * - a control that no longer fits back to its type's own\n * - DOM only, no Solid and no runtime: a browser's DOM, or linkedom's under node (`spell lint`).\n * - STATIC and instance-free: it keeps nothing between calls.\n ****************/\nexport class PropertyEditorPages {\n /** The text of `schema`'s default page: its editor, with one `<ui-property>` per attribute. */\n static write(schema: V.PropertySchema, document: Document): string {\n const editor = document.createElement(EDITOR_TAG)\n editor.setAttribute(\"schema\", schema.name)\n editor.setAttribute(\"label\", schema.label ?? schema.name)\n for (const spec of schema.attributes) editor.append(PropertyEditorPages.property(document, spec.name))\n return PropertyEditorPages.text(editor)\n }\n\n /** The editor in a page's markup: its `<ui-property-editor>`, else `undefined`. */\n static editorIn(root: ParentNode): Element | undefined {\n return root.querySelector(EDITOR_TAG) ?? undefined\n }\n\n /** What's wrong with the page whose editor is `editor`, against `schema`; `[]` when nothing is. */\n static check(editor: Element, schema: V.PropertySchema): PageProblem[] {\n const problems: PageProblem[] = []\n const named = new Set<string>()\n for (const property of editor.querySelectorAll(PROPERTY_TAG)) {\n const name = property.getAttribute(\"name\") ?? \"\"\n named.add(name.split(\".\")[0]!)\n const spec = PropertyEditorPages.specFor(schema, name)\n if (!spec) {\n problems.push({ kind: \"dropped\", name, message: `${schema.name} has no \\`${name}\\` any more` })\n continue\n }\n const kind = property.getAttribute(\"as\")\n if (kind && !PropertyEditorPages.fits(kind, spec)) {\n const type = PropertySchemas.typeOf(spec)\n problems.push({ kind: \"control\", name, message: `\\`as=\"${kind}\"\\` doesn't fit \\`${name}\\`, a ${type}` })\n }\n }\n for (const spec of schema.attributes) {\n if (named.has(spec.name)) continue\n problems.push({\n kind: \"missing\",\n name: spec.name,\n message: `${schema.name}'s \\`${spec.name}\\` isn't on the page`\n })\n }\n return problems\n }\n\n /**\n * Put the page whose editor is `editor` right, against `schema` (see the class doc); returns what it did.\n * - SIDE EFFECT: changes `editor` and what's in it.\n * `text()` writes it back.\n */\n static fix(editor: Element, schema: V.PropertySchema): PageProblem[] {\n const problems = PropertyEditorPages.check(editor, schema)\n const document = editor.ownerDocument\n for (const problem of problems) {\n const property = editor.querySelector(`${PROPERTY_TAG}[name=\"${problem.name}\"]`)\n if (problem.kind === \"dropped\") property?.remove()\n else if (problem.kind === \"control\") property?.removeAttribute(\"as\")\n else PropertyEditorPages.otherGroup(editor).append(PropertyEditorPages.property(document, problem.name))\n }\n return problems\n }\n\n /**\n * An editor's markup as a page's text: its start tag, then each child on its own lines, two spaces in.\n * - Built from the elements (`outerHTML`), not from strings.\n * - Every element with elements inside it (a group) is on lines of its own, each a level further in.\n */\n static text(editor: Element): string {\n return `${PropertyEditorPages.lines(editor, 0).join(\"\\n\")}\\n`\n }\n\n /**\n * The page whose editor is `editor`, compiled for `schema`: a javascript module defining `<card-editor>`.\n * - Its tag comes from the schema's name (`Card`'s).\n * - Returns the tag, its class's name and the module's text.\n * - The element draws a `<ui-property-editor>` in its light DOM, with:\n * - the page's editor's attributes (its own win)\n * - the schema, and the page's layout\n * - `value`, `save()`, `cancel()` and `validate()` reach it\n * - `uiModule`: what it imports for Spell UI's property editor.\n * A page that has it already passes another.\n * - Code made as text (as spell compiles programs), from the page's own markup (`text()`).\n */\n static compile(\n editor: Element,\n schema: V.PropertySchema,\n { uiModule = UI_MODULE }: CompileOptions = {}\n ): CompiledPage {\n const tag = `${kebabCase(schema.name).replace(/^-/, \"\")}-editor`\n const className = `${schema.name.replace(/\\W/g, \"\")}Editor`\n const attributes = Object.fromEntries(\n [...editor.attributes].filter(({ name }) => !NOT_COMPILED.has(name)).map(({ name, value }) => [name, value])\n )\n const layout = [...editor.children].map((child) => PropertyEditorPages.lines(child, 0).join(\"\\n\")).join(\"\\n\")\n const lines = [\n `// ${schema.name}'s property editor, <${tag}>: made by \\`spell compile\\` from its page (epic \\`property-editor\\` P7).`,\n `// NEVER edit: edit the page, then compile.`,\n `import ${JSON.stringify(uiModule)}`,\n ``,\n `/** ${schema.name}'s properties. */`,\n `const SCHEMA = ${JSON.stringify(schema, null, 2)}`,\n ``,\n `/** The page's editor's attributes: the element's own win. */`,\n `const ATTRIBUTES = ${JSON.stringify(attributes)}`,\n ``,\n `/** The page's layout: its groups and properties. */`,\n `const LAYOUT = ${JSON.stringify(layout)}`,\n ``,\n `/** <${tag}>: ${schema.name}'s property editor, as its page lays it out. */`,\n `export class ${className} extends HTMLElement {`,\n ` connectedCallback() {`,\n ` if (this.editor) return`,\n ` const editor = document.createElement(\"ui-property-editor\")`,\n ` for (const [name, value] of Object.entries(ATTRIBUTES)) editor.setAttribute(name, value)`,\n ` for (const { name, value } of this.attributes) editor.setAttribute(name, value)`,\n ` editor.schema = SCHEMA`,\n ` const template = document.createElement(\"template\")`,\n ` template.innerHTML = LAYOUT`,\n ` editor.append(template.content)`,\n ` if (this.pendingValue !== undefined) editor.value = this.pendingValue`,\n ` this.editor = editor`,\n ` this.append(editor)`,\n ` }`,\n ``,\n ` /** The thing it edits, or a list of things: its editor's. */`,\n ` get value() {`,\n ` return this.editor ? this.editor.value : this.pendingValue`,\n ` }`,\n ` set value(value) {`,\n ` if (this.editor) this.editor.value = value`,\n ` else this.pendingValue = value`,\n ` }`,\n ``,\n ` /** Its editor's \\`save()\\`, \\`cancel()\\` and \\`validate()\\`. */`,\n ` save() {`,\n ` return this.editor?.save() ?? false`,\n ` }`,\n ` cancel() {`,\n ` return this.editor?.cancel() ?? false`,\n ` }`,\n ` validate() {`,\n ` return this.editor?.validate() ?? true`,\n ` }`,\n `}`,\n ``,\n `if (!customElements.get(${JSON.stringify(tag)})) customElements.define(${JSON.stringify(tag)}, ${className})`,\n ``\n ]\n return { tag, className, text: lines.join(\"\\n\") }\n }\n\n ////////////////\n // ## Helpers\n ////////////////\n\n /** A `<ui-property name>`. */\n private static property(document: Document, name: string): Element {\n const property = document.createElement(PROPERTY_TAG)\n property.setAttribute(\"name\", name)\n return property\n }\n\n /** The page's \"Other\" group (`data-other`), made at the end if it has none. */\n private static otherGroup(editor: Element): Element {\n const found = editor.querySelector(`${GROUP_TAG}[${OTHER_ATTRIBUTE}]`)\n if (found) return found\n const group = editor.ownerDocument.createElement(GROUP_TAG)\n group.setAttribute(\"label\", OTHER)\n group.setAttribute(OTHER_ATTRIBUTE, \"\")\n editor.append(group)\n return group\n }\n\n /** What `schema` says of `name`; a dotted name reaches into a nested thing's attributes. */\n private static specFor(schema: V.PropertySchema, name: string): V.AttributeSpec | undefined {\n let attributes: readonly V.AttributeSpec[] | undefined = schema.attributes\n let spec: V.AttributeSpec | undefined\n for (const key of name.split(\".\")) {\n spec = attributes?.find((candidate) => candidate.name === key)\n attributes = spec?.attributesOf\n }\n return spec\n }\n\n /** Control kind `kind` fits `spec`: a kind made for some types takes only those; any other kind fits. */\n private static fits(kind: string, spec: V.AttributeSpec): boolean {\n const types = KIND_TYPES[kind]\n if (!types) return true\n const type = PropertySchemas.typeOf(spec)\n if (types.includes(type)) return true\n return type === LIST && !!(spec.values ?? spec.choicesFrom) && kind === CHOICE_LIST_KIND\n }\n\n /**\n * `element`'s lines, `depth` levels in:\n * - one line when it has no element inside it (a property, a button)\n * - else its start tag, each child a level further in, and its end tag\n */\n private static lines(element: Element, depth: number): string[] {\n const indent = INDENT.repeat(depth)\n if (!element.children.length) return [`${indent}${element.outerHTML}`]\n const empty = (element.cloneNode(false) as Element).outerHTML\n const end = `</${element.localName}>`\n const children = [...element.children].flatMap((child) => PropertyEditorPages.lines(child, depth + 1))\n return [`${indent}${empty.slice(0, -end.length)}`, ...children, `${indent}${end}`]\n }\n}\n\n/** What `compile()` takes. */\nexport type CompileOptions = {\n /** What the module imports for Spell UI's property editor; default `spell/ui/ui-property-editor`. */\n uiModule?: string\n}\n\n/** A page compiled: its element's tag and class, and the module's text. */\nexport type CompiledPage = {\n /** `card-editor`. */\n tag: string\n /** `CardEditor`. */\n className: string\n /** The javascript module. */\n text: string\n}\n\n/** One thing wrong with a page. */\nexport type PageProblem = {\n /**\n * What kind of wrong:\n * - `dropped`: the schema has no such property\n * - `missing`: the page doesn't name one\n * - `control`: `as` doesn't fit\n */\n kind: \"dropped\" | \"missing\" | \"control\"\n /** The property. */\n name: string\n /** What's wrong, in words. */\n message: string\n}\n\n/** The family's tags. */\nconst EDITOR_TAG = \"ui-property-editor\"\nconst GROUP_TAG = \"ui-property-group\"\nconst PROPERTY_TAG = \"ui-property\"\n\n/** The group `fix()` adds new properties to, and its marker. */\nconst OTHER = \"Other\"\nconst OTHER_ATTRIBUTE = \"data-other\"\n\n/** A list's type. */\nconst LIST = \"list\"\n\n/** The app's kind for picking several choices: it fits a list with choices. */\nconst CHOICE_LIST_KIND = \"choices\"\n\n/** Built-in control kinds that only fit some value types (any other kind fits any). */\nconst KIND_TYPES: Record<string, readonly V.ValueType[]> = {\n number: [\"number\"],\n range: [\"number\", \"choice\"],\n select: [\"choice\"],\n buttons: [\"choice\"],\n checkbox: [\"boolean\"],\n toggle: [\"boolean\"],\n date: [\"date\"],\n icon: [\"icon\", \"text\"],\n editor: [\"thing\"]\n}\n\n/** What a compiled page imports for Spell UI's property editor, by default. */\nconst UI_MODULE = \"spell/ui/ui-property-editor\"\n\n/** A page's editor's attributes a compiled page leaves out: the schema is inlined, and nothing is loaded. */\nconst NOT_COMPILED = new Set([\"schema\", \"source\", \"select\"])\n\n/** One level of a page's indent. */\nconst INDENT = \" \"\n","/**\n * The `ui-property-editor` family's shared pieces: what its three vocabularies and components share.\n * - Pure data, at the bottom of the folder's imports (`import type` only): node loads it (`yarn site:data`).\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/**\n * What an element PASSES THROUGH from the element it's built on:\n * a vocabulary's names, minus `skip`'s and those `own` names already.\n * - The editor passes through `<ui-section>`'s and `<ui-form>`'s; the group, `<ui-section>`'s.\n * - Its own come first, in their order; then each base's, in theirs.\n */\nexport function passThrough<T extends { name?: string; key?: string }>(\n own: readonly T[],\n bases: readonly (readonly T[])[],\n skip: readonly string[] = []\n): T[] {\n const taken = new Set([...own.map(nameOf), ...skip])\n const names: T[] = [...own]\n for (const base of bases) {\n for (const item of base) {\n if (taken.has(nameOf(item))) continue\n taken.add(nameOf(item))\n names.push(item)\n }\n }\n return names\n}\n\n/** An attribute's, event's, slot's, part's or state's `name`, or a text's `key`. */\nfunction nameOf(item: { name?: string; key?: string }): string {\n return item.name ?? item.key ?? \"\"\n}\n\n/** A vocabulary item list, as the vocabularies here build them. */\nexport type Names<K extends keyof E.ComponentVocabulary> = E.ComponentVocabulary[K]\n\n/** The tags of the family, for making one: `document.createElement(PROPERTY_TAG)`. */\nexport const EDITOR_TAG = \"ui-property-editor\"\nexport const GROUP_TAG = \"ui-property-group\"\nexport const PROPERTY_TAG = \"ui-property\"\n\n/**\n * Selectors for the family's elements, for `closest()` and `querySelectorAll()`:\n * the custom state each always carries, as `<ui-field>` carries `:state(field)`.\n * - So they find the elements whatever a translation calls their tags, e.g. `<es-editor-propiedades>`.\n * - Only once an element is drawn: before that, a property finds its editor by what it is (`UIProperty`).\n */\nexport const EDITOR_SELECTOR = \":state(property-editor)\"\nexport const GROUP_SELECTOR = \":state(property-group)\"\nexport const PROPERTY_SELECTOR = \":state(property)\"\n\n/** Marks what an editor or a property added to its own light DOM, so it can take it away again. */\nexport const MADE_ATTRIBUTE = \"data-ui-made\"\n\n/** `MADE_ATTRIBUTE`'s values on what an editor added: from its schema (empty, `\"\"`), or from its source page. */\nexport const MADE_FROM = { schema: \"\", source: \"source\" } as const\n\n/**\n * On a nested editor a property made (`as=\"editor\"`): the property, whose value (a thing) it edits.\n * - Read from the editor or row around it, as the outer form's binding would.\n */\nexport const VALUE_FROM_ATTRIBUTE = \"data-value-from\"\n","/**\n * The English vocabulary of `<ui-property>`: every name the tag uses.\n * - Its own names first, then `<ui-field>`'s, which it PASSES THROUGH (it is one), where they mean the same.\n * - The shape is `E.ComponentVocabulary`. Pure data.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport { fieldVocabulary } from \"spell/ui/components/ui-form/UIField.en\"\nimport { passThrough } from \"./UIPropertyEditor.types\"\n\n/****************\n * ### `propertyVocabulary`\n * The names of `<ui-property>`: one property of the thing a `<ui-property-editor>` edits,\n * drawn as a `<ui-field>` with the control its schema calls for.\n ****************/\nexport const propertyVocabulary = {\n ...fieldVocabulary,\n tag: \"ui-property\",\n topics: [\"forms\", \"inputs\"],\n aka: [\"property\", \"inspector row\", \"setting\", \"schema field\"],\n description:\n \"A property is one field of a property editor: its label, tip, choices and rules come from the editor's schema.\",\n attributes: passThrough<E.AttributeSpec>(\n [\n {\n name: \"name\",\n group: \"name\",\n kind: \"string\",\n description: \"The property it edits; a dotted path reaches into a nested thing (`font.size`). Required.\"\n },\n {\n name: \"as\",\n group: \"appearance\",\n kind: \"string\",\n description:\n \"Which control (a kind `UI.propertyControls` knows): `input`, `text`, `number`, `date`, `select`, `buttons`, \" +\n \"`range`, `checkbox`, `toggle`, `color`, `editor`, or one a page added. None: the default for its type.\"\n },\n {\n name: \"options\",\n group: \"form\",\n kind: \"string\",\n description:\n \"Where its choices come from, when not the schema's: a source the page added \" +\n \"(`UI.propertyControls.addChoices()`), or a list, `a, b, c`.\"\n }\n ] as const satisfies readonly E.AttributeSpec[],\n [fieldVocabulary.attributes]\n ),\n events: [\n {\n name: \"ui-changed\",\n detail: \"{ name: string, value: unknown }\",\n description: 'Its property was written (on Save, with `apply=\"on save\"`).'\n }\n ],\n slots: passThrough<E.SlotSpec>(\n [\n { name: \"\", description: \"Your own control, instead of the one it makes; or nothing.\" }\n ] as const satisfies readonly E.SlotSpec[],\n [fieldVocabulary.slots]\n ),\n states: passThrough<E.StateSpec>(\n [\n { name: \"changed\", description: 'Its edit is held, not saved yet (`apply=\"on save\"`).' },\n { name: \"buttons\", description: 'Its control is a row of choices, one each (`as=\"buttons\"`).' }\n ] as const satisfies readonly E.StateSpec[],\n [fieldVocabulary.states]\n )\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-property>`'s own look, adopted after the field's (`UIForm.css`, `UIField.css`).\n * - A property's radios (`as=\"buttons\"`, `:state(buttons)`) sit in a row that wraps, spaced.\n */\n\n@layer ui.components.property.content;\n\n@layer ui.components.property.content {\n :host(:state(buttons)) .field > .control {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5em 1.25em;\n }\n}\n","import { E, UI } from \"spell/ui/core\"\n// the family barrel, not the leaf: the lib build then imports `ui-form.js` instead of splitting a shared chunk\n// (SIDE EFFECT: defines the form family: a property is a field, in a form)\nimport { DOMFieldElement, UIField } from \"spell/ui/components/ui-form\"\nimport type { fieldVocabulary } from \"spell/ui/components/ui-form/UIField.en\"\nimport { PropertySchemas } from \"spell/ui/property\"\nimport type { AttributeSpec, PropertySchema, ValueType } from \"spell/ui/vocabulary\"\nimport type { Choice, PropertyControl } from \"spell/ui/runtime\"\nimport { propertyVocabulary } from \"./UIProperty.en\"\nimport {\n EDITOR_SELECTOR,\n EDITOR_TAG,\n GROUP_SELECTOR,\n GROUP_TAG,\n MADE_ATTRIBUTE,\n VALUE_FROM_ATTRIBUTE\n} from \"./UIPropertyEditor.types\"\n\nimport propertyCSS from \"./UIProperty.css?inline\"\n\n/****************\n * ### `DOMPropertyElement`\n * The DOM element of `<ui-property>`: a field's (`showErrors()`, `errors`), plus what its editor reads of it.\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMPropertyElement extends DOMFieldElement {\n /**\n * The schema's rules for it: its `rules`, and `min` / `max` / `pattern` as rules.\n * - `<ui-form>` adds them to the form's.\n */\n @E.untracked\n get schemaRules(): readonly E.ValidationRule[] | undefined {\n return (this.component as UIProperty | undefined)?.schemaRules\n }\n\n /** Show it as holding an edit not saved yet (`:state(changed)`); the editor says. */\n markChanged(isChanged: boolean) {\n const component = this.component as UIProperty | undefined\n if (component) component.isChanged = isChanged\n }\n}\n\n/****************\n * ### `UIProperty`\n * The component behind `<ui-property>`: one property of the thing its `<ui-property-editor>` edits.\n *\n * - It IS a `<ui-field>` (it extends `UIField`):\n * the label row, the tip, the hint, the error lines, `apply`, `mixed`, `rules`.\n * `<ui-form>` finds it as a field (`:state(field)`) and binds its control.\n * - What it knows of its property comes from the editor's SCHEMA (`spec`), found by `name`\n * (a dotted name reaches into a nested thing's attributes):\n * - the label (`labelOf()`: its own, else made from the name) and the tip, unless the field's own say otherwise\n * - its value's type, so its default control (`UI.propertyControls.kindFor()`)\n * - its choices (`values`, a `choicesFrom` source), limits and rules\n * - Its CONTROL: one it holds already (the author's),\n * else one it MAKES, of the kind `as` says (else the type's kind),\n * and adds to its own light DOM, as `<ui-repeat>` adds rows.\n * - Made with `name` = the property's name, so the editor's form binds it.\n * - Its choices go in as the control's children.\n * - Made again when the kind or the choices change; taken away when the author adds their own.\n * - SIDE EFFECT: adds and removes elements in its light DOM, marked `data-ui-made`.\n * - `readonly` nests: its own, or a `readonly` group or editor around it, makes the control readonly.\n * - `:state(changed)`: its edit is held, not saved yet (the editor says, `markChanged()`).\n ****************/\nexport class UIProperty extends UIField {\n // the field's names under the property's tag, and its own: TypeScript only knows the field's literals\n @E.proto static vocabulary = propertyVocabulary as unknown as typeof fieldVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { ...UIField.prototype.elementSetup.styleSheets, property: propertyCSS },\n DOMElement: DOMPropertyElement\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## Its own attributes\n ////////////////\n\n /** The property it edits: `name`. */\n get propertyName(): string {\n return this.attributes.name ?? \"\"\n }\n\n /** The control kind it was asked for: `as`. */\n get requestedKind(): string | undefined {\n return this.attributes.as ?? undefined\n }\n\n /** Where its choices come from, when not the schema's: `options`. */\n get optionsText(): string | undefined {\n return this.attributes.options ?? undefined\n }\n\n ////////////////\n // ## The editor and the schema\n ////////////////\n\n /** The `<ui-property-editor>` around it, while connected. */\n @E.state accessor editor: DOMEditorLike | undefined = undefined\n\n /**\n * Find the editor (and a `readonly` group or editor) on connect.\n * - The editor by what it is, the nearest element around us with a schema:\n * so a translated one is found too (`<es-editor-propiedades>`), before its state is drawn.\n */\n @E.whileConnected\n protected watchEditor() {\n this.editor = UIProperty.editorAround(this.domElement)\n const readonly = [GROUP_TAG, EDITOR_TAG].map((tag) => `${tag}[readonly]`)\n readonly.push(`${GROUP_SELECTOR}:state(readonly)`, `${EDITOR_SELECTOR}:state(readonly)`)\n this.isInReadonly = !!this.domElement.parentElement?.closest(readonly.join(\", \"))\n return () => {\n this.editor = undefined\n }\n }\n\n /** What the schema says of its property, if the editor has a schema that names it. */\n get spec(): AttributeSpec | undefined {\n const schema = this.editor?.currentSchema\n return schema ? UIProperty.specFor(schema, this.propertyName) : undefined\n }\n\n /** Its label: the field's own `label`, else the schema's (or one made from its name). */\n get labelText(): string | undefined {\n if (this.label) return this.label\n const spec = this.spec\n return spec ? PropertySchemas.labelOf(spec) : this.propertyName && PropertySchemas.labelOf(NAMED(this.propertyName))\n }\n\n /** Its tip: the field's own `description`, else the schema's `tip`. */\n get descriptionText(): string | undefined {\n return this.description ?? this.spec?.tip\n }\n\n /** Its value's type, as a form edits it: the schema's, else `text`. */\n get valueType(): ValueType {\n const spec = this.spec\n return spec ? PropertySchemas.typeOf(spec) : TEXT\n }\n\n /**\n * The schema's rules for it, as `<ui-form>` rules: its `rules`, then its pattern.\n * - A rule may be an object with its own words, as a spell type's are: `{ type: \"empty\", prompt: \"Name it\" }`.\n */\n get schemaRules(): readonly E.ValidationRule[] | undefined {\n const spec = this.spec\n if (!spec) return undefined\n const rules: E.ValidationRule[] =\n spec.rules === undefined ? [] : typeof spec.rules === \"string\" ? [spec.rules] : [...spec.rules]\n if (spec.pattern) rules.push(`regExp[/${spec.pattern}/]`)\n return rules.length ? rules : undefined\n }\n\n ////////////////\n // ## Readonly and changed\n ////////////////\n\n /** A `readonly` group or editor is around it. */\n @E.state accessor isInReadonly = false\n\n /** `:state(readonly)`: its own `readonly`, or a group's or the editor's. */\n /** Always `:state(property)`: how its family finds it, whatever its tag is called (`PROPERTY_SELECTOR`). */\n @E.cssState(\"property\")\n get isProperty(): boolean {\n return true\n }\n\n @E.cssState(\"readonly\")\n get isReadOnly(): boolean {\n return !!this.readonly || this.isInReadonly\n }\n\n /** `:state(changed)`: its edit is held, not saved yet. */\n @E.cssState(\"changed\")\n @E.state\n accessor isChanged = false\n\n ////////////////\n // ## The control it makes\n ////////////////\n\n /**\n * The kind of control it draws: `as`, else its type's default.\n * - `undefined` until the page's runtime has loaded.\n */\n get controlKind(): string | undefined {\n if (!this.isReady) return undefined\n return this.requestedKind ?? UI.propertyControls.kindFor(this.valueType)\n }\n\n /** `:state(buttons)`: its control is a row of choices (a kind drawn as `radios`). */\n @E.cssState(\"buttons\")\n get isButtonRow(): boolean {\n const kind = this.controlKind\n return !!kind && UI.propertyControls.get(kind)?.choices === RADIOS\n }\n\n /** Choices loaded from a source (`options`, `choicesFrom`), once they arrive. */\n @E.state accessor loadedChoices: readonly Choice[] | undefined = undefined\n\n /**\n * Its choices: `options` written as a list, else a source's (once loaded), else the schema's values.\n * - The schema's values: its own `values` (a list, or a value set's name), else its kind's set\n * (`ValueSets.setFor()`): a tag's `size` is the sizes, its `color` the hues.\n * Without the kind's set, a tag's own schema drew its selects with nothing to choose (Owen: \"dropdowns don't\n * have options\").\n */\n get choices(): readonly Choice[] | undefined {\n const text = this.optionsText\n if (text && text.includes(\",\")) return text.split(\",\").map((choice) => choice.trim())\n if (text || this.spec?.choicesFrom) return this.loadedChoices\n const set = this.spec && E.ValueSets.setFor(this.spec)\n return set ? E.ValueSets.get(set) : undefined\n }\n\n /** A choice source to load: `options` naming one, else the schema's `choicesFrom`. */\n @E.onChange(\"optionsText\", \"spec\", \"isReady\")\n protected onChoiceSourceChanged(text: string | undefined, spec: AttributeSpec | undefined, isReady: boolean) {\n const source = text && !text.includes(\",\") ? text : spec?.choicesFrom\n if (!isReady || !source) return\n let isCurrent = true\n void UI.propertyControls\n .choices(source)\n .then((choices) => {\n if (isCurrent) this.loadedChoices = choices ?? []\n })\n .catch((error) => E.Warnings.warn(\"<ui-property>\", `can't load the choices of \\`${source}\\`:`, error))\n return () => {\n isCurrent = false\n }\n }\n\n /** Make (or make again) its control as the kind, choices, name, readonly state or limits change. */\n @E.onChange(\"controlKind\", \"choices\", \"propertyName\", \"isReadOnly\", \"spec\")\n protected onControlNeeded(kind: string | undefined) {\n if (!kind || this.holdsOwnControl) return this.removeMadeControls()\n this.makeControl(kind)\n }\n\n /** The author put a control of their own in it: any element child it didn't make, outside the named slots. */\n private get holdsOwnControl(): boolean {\n return [...this.domElement.children].some((child) => !child.hasAttribute(MADE_ATTRIBUTE) && !child.slot)\n }\n\n /**\n * Replace the controls it made with one of `kind`.\n * - SIDE EFFECT: writes its light DOM.\n */\n @E.untracked\n private makeControl(kind: string) {\n const control = UI.propertyControls.get(kind)\n if (!control) {\n E.Warnings.warn(\"<ui-property>\", `no control kind \\`${kind}\\`: add it with UI.propertyControls.add()`)\n return\n }\n this.removeMadeControls()\n const made = control.choices === \"radios\" ? this.radios(control) : [this.controlElement(control)]\n for (const element of made) element.setAttribute(MADE_ATTRIBUTE, \"\")\n this.domElement.append(...made)\n }\n\n /** One control element of `control`'s kind: named, limited, readonly, its choices as `<ui-item>`s. */\n private controlElement(control: PropertyControl): HTMLElement {\n const element = document.createElement(control.tag)\n for (const [name, value] of Object.entries(control.attributes ?? {})) element.setAttribute(name, value)\n element.setAttribute(\"name\", this.propertyName)\n const spec = this.spec\n if (spec?.min !== undefined) element.setAttribute(\"min\", String(spec.min))\n if (spec?.max !== undefined) element.setAttribute(\"max\", String(spec.max))\n if (spec?.step !== undefined) element.setAttribute(\"step\", String(spec.step))\n if (this.isReadOnly) element.setAttribute(\"readonly\", \"\")\n if (control.choices === \"items\") {\n // no value and no default: it reads \"none\", never blank\n if (spec?.default === undefined) element.setAttribute(\"placeholder\", this.translationForKey(\"none\"))\n for (const choice of this.choices ?? []) element.append(UIProperty.item(choice))\n }\n if (control.tag === EDITOR_TAG) element.setAttribute(VALUE_FROM_ATTRIBUTE, this.propertyName)\n return element\n }\n\n /** One radio per choice, of one name: the `buttons` kind. */\n private radios(control: PropertyControl): HTMLElement[] {\n return (this.choices ?? []).map((choice) => {\n const radio = this.controlElement(control)\n const { value, text } = UIProperty.choiceParts(choice)\n radio.setAttribute(\"value\", value)\n radio.textContent = text\n return radio\n })\n }\n\n /**\n * Take away every control it made.\n * - SIDE EFFECT: writes its light DOM.\n */\n @E.untracked\n private removeMadeControls() {\n for (const child of [...this.domElement.children]) if (child.hasAttribute(MADE_ATTRIBUTE)) child.remove()\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /** The editor around `element`, the nearest with a schema (`currentSchema`) -- `undefined` if none. */\n static editorAround(element: Element): DOMEditorLike | undefined {\n for (let at = element.parentElement; at; at = at.parentElement) {\n if (\"currentSchema\" in at) return at as DOMEditorLike\n }\n return undefined\n }\n\n /**\n * What `schema` says of property `name`; a dotted name reaches into a nested thing's `attributesOf`.\n * - STATIC: pure.\n */\n static specFor(schema: PropertySchema, name: string): AttributeSpec | undefined {\n let attributes: readonly AttributeSpec[] | undefined = schema.attributes\n let spec: AttributeSpec | undefined\n for (const key of name.split(\".\")) {\n spec = attributes?.find((candidate) => candidate.name === key || candidate.property === key)\n attributes = spec?.attributesOf\n }\n return spec\n }\n\n /** A choice's value and text. */\n private static choiceParts(choice: Choice): { value: string; text: string } {\n return typeof choice === \"string\" ? { value: choice, text: choice } : choice\n }\n\n /** A `<ui-item value>` for a choice. */\n private static item(choice: Choice): HTMLElement {\n const { value, text } = UIProperty.choiceParts(choice)\n const item = document.createElement(\"ui-item\")\n item.setAttribute(\"value\", value)\n item.textContent = text\n return item\n }\n}\n\n/** What a property reads of its editor's DOM element. */\ntype DOMEditorLike = HTMLElement & { readonly currentSchema?: PropertySchema }\n\n/** A kind's choices drawn one control each. */\nconst RADIOS = \"radios\"\n\n/** The type of a property the schema doesn't name. */\nconst TEXT: ValueType = \"text\"\n\n/** A bare attribute named `name`, to make a label from. */\nconst NAMED = (name: string): AttributeSpec => ({ name, kind: \"string\", description: \"\" })\n","/**\n * The English vocabulary of `<ui-property-editor>`: every name the tag uses.\n * - Its own names first, then those it PASSES THROUGH, each only where it means the same:\n * - `<ui-form>`'s: it is one\n * - then `<ui-section>`'s: it draws one around its properties\n * - Not passed through:\n * - the section's `source` and `select`: the editor's own are its layout page's\n * - the form's `value`: the editor's own takes a thing or a list\n * - The shape is `E.ComponentVocabulary`. Pure data: `import type` only (`passThrough()` too).\n */\n\nimport type { E } from \"spell/ui/core\"\nimport { formVocabulary } from \"spell/ui/components/ui-form/UIForm.en\"\nimport { sectionVocabulary } from \"spell/ui/components/ui-section/UISection.en\"\nimport { passThrough } from \"./UIPropertyEditor.types\"\n\n/** The editor's own attributes. */\nconst OWN_ATTRIBUTES = [\n {\n name: \"schema\",\n kind: \"json\",\n reflect: false,\n description:\n \"What it edits, described: a tag (`ui-button`: its vocabulary), a schema the page added \" +\n \"(`UI.propertyControls.addSchema()`), or, as a property, a `PropertySchema` or a component vocabulary.\"\n },\n {\n name: \"value\",\n kind: \"json\",\n reflect: false,\n description: \"The thing it edits, or a LIST of things (edited at once: a property shows the value they agree on).\"\n },\n {\n name: \"source\",\n kind: \"string\",\n description: \"Its layout page: a spell path inside the spell editor, else a full URL (epic `property-editor` P6).\"\n },\n {\n name: \"selector\",\n kind: \"string\",\n replaces: [\"select\"],\n description:\n \"With `source`: a CSS selector; only its first match in the layout page is used. Its old name was `select`.\"\n },\n {\n name: \"readonly\",\n kind: \"boolean\",\n description: \"Shows every value; nothing can be changed. Reaches every property in it.\"\n },\n { name: \"output\", kind: \"string\", description: 'A value at the end of the title bar; `slot=\"output\"`.' },\n { name: \"error\", kind: \"string\", description: \"An error under the title, and the `error` state.\" }\n] as const satisfies readonly E.AttributeSpec[]\n\n/****************\n * ### `propertyEditorVocabulary`\n * The names of `<ui-property-editor>`: a titled, folding form of properties, drawn from a schema.\n ****************/\nexport const propertyEditorVocabulary = {\n tag: \"ui-property-editor\",\n topics: [\"forms\", \"inputs\", \"collections\"],\n aka: [\"inspector\", \"property sheet\", \"properties panel\", \"settings form\", \"object editor\"],\n skeleton: \"header, 3 line paragraph\",\n noun: \"form\",\n description:\n \"A property editor draws a form from a schema: one field per property, in folding groups, for one thing or many.\",\n attributes: passThrough<E.AttributeSpec>(\n OWN_ATTRIBUTES,\n [formVocabulary.attributes, sectionVocabulary.attributes],\n [\"source\", \"selector\"]\n ),\n events: passThrough<E.EventSpec>(\n [\n {\n name: \"ui-changed\",\n detail: \"{ name: string, value: unknown, things: object[] }\",\n description: \"A property was written to the thing (or things).\"\n },\n { name: \"ui-loading\", detail: \"{ source: string }\", description: \"Its `source` page is about to load (P6).\" },\n { name: \"ui-loaded\", detail: \"{ source: string, content: string }\", description: \"It arrived (P6).\" }\n ] as const satisfies readonly E.EventSpec[],\n [formVocabulary.events, sectionVocabulary.events],\n [\"ui-loaded\"]\n ),\n slots: passThrough<E.SlotSpec>(\n [\n { name: \"\", description: \"`<ui-property-group>`s and `<ui-property>`s. Empty: one property per attribute.\" },\n { name: \"output\", description: \"Rich output (instead of `output`).\" }\n ] as const satisfies readonly E.SlotSpec[],\n [sectionVocabulary.slots]\n ),\n parts: passThrough<E.PartSpec>(\n [\n { name: \"editor\", description: \"The editor's outer box.\" },\n { name: \"footer\", description: 'Under the properties: Save and Cancel, with `apply=\"on save\"`.' },\n { name: \"output\", description: \"The output.\" },\n { name: \"error-line\", description: \"The editor's own error, under its title.\" }\n ] as const satisfies readonly E.PartSpec[],\n [formVocabulary.parts, sectionVocabulary.parts]\n ),\n states: passThrough<E.StateSpec>(\n [\n { name: \"readonly\", description: \"Nothing can be changed (`readonly`).\" }\n ] as const satisfies readonly E.StateSpec[],\n [formVocabulary.states, sectionVocabulary.states]\n ),\n texts: passThrough<E.TextSpec>(\n [\n { key: \"save\", text: \"Save\", description: 'The Save button, with `apply=\"on save\"`.' },\n { key: \"cancel\", text: \"Cancel\", description: 'The Cancel button, with `apply=\"on save\"`.' },\n { key: \"other\", text: \"Other\", description: \"The group of properties a layout doesn't place (P6).\" }\n ] as const satisfies readonly E.TextSpec[],\n [formVocabulary.texts, sectionVocabulary.texts]\n )\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-property-editor>`'s own parts, adopted after the form's (`UIForm.css`).\n * - Its `<ui-section>` (when it has a title) is an element of its own, styled by itself.\n * - `.footer`: Save and Cancel under the properties, at the end of the line.\n * - `.output`: a value at the end of the title bar (mono, muted); `.error-line`: its own error under the title.\n */\n\n@layer ui.components.property-editor.content;\n\n@layer ui.components.property-editor.content {\n .footer {\n display: flex;\n justify-content: flex-end;\n gap: 0.5em;\n margin: 1em 0 0;\n }\n .output {\n color: var(--ui-text-muted);\n font-family: var(--ui-font-family-mono);\n font-size: 0.92em;\n font-variant-numeric: tabular-nums;\n }\n .error-line {\n margin: 0 0 0.75em;\n color: var(--ui-negative-text);\n font-size: 0.85714em;\n }\n}\n","import { For, Show } from \"solid-js\"\nimport { Dynamic, isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI } from \"spell/ui/core\"\n// the family barrels, not the leaves: the lib build then imports `ui-form.js` / `ui-section.js`\n// (SIDE EFFECT: defines the form and section families: the editor is a form, and draws a section)\nimport { DOMFormElement, FormBinding, UIForm } from \"spell/ui/components/ui-form\"\nimport \"spell/ui/components/ui-section\"\nimport type { formVocabulary } from \"spell/ui/components/ui-form/UIForm.en\"\nimport { sectionVocabulary } from \"spell/ui/components/ui-section/UISection.en\"\nimport { PropertyEditorPages, PropertySchemas } from \"spell/ui/property\"\nimport type { ComponentVocabulary, PropertySchema } from \"spell/ui/vocabulary\"\nimport { propertyEditorVocabulary } from \"./UIPropertyEditor.en\"\nimport {\n GROUP_SELECTOR,\n MADE_ATTRIBUTE,\n MADE_FROM,\n PROPERTY_SELECTOR,\n PROPERTY_TAG,\n VALUE_FROM_ATTRIBUTE\n} from \"./UIPropertyEditor.types\"\n\nimport editorCSS from \"./UIPropertyEditor.css?inline\"\n\n/****************\n * ### `DOMPropertyEditorElement`\n * The DOM element of `<ui-property-editor>`: a form's (`validate()`, `save()`, `cancel()`, `values` ...),\n * plus the schema its properties read.\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMPropertyEditorElement extends DOMFormElement {\n /** The schema it draws from, resolved (`schema`); each `<ui-property>` reads its own attribute's here. */\n get currentSchema(): PropertySchema | undefined {\n return (this.component as UIPropertyEditor | undefined)?.currentSchema\n }\n}\n\n/****************\n * ### `UIPropertyEditor`\n * The component behind `<ui-property-editor>`: a form of properties, drawn from a SCHEMA.\n *\n * - It IS a `<ui-form>` (it extends `UIForm`): bound to `value` (a thing, or a list of things), validation,\n * `apply=\"on save\"` with `save()` / `cancel()`, `validate`.\n * Its `<ui-property>`s are fields of it, in its light DOM.\n * - It DRAWS a `<ui-section>` in its shadow root, around them, when it has a title:\n * `label` or `slot=\"label\"`.\n * - Every section attribute it's given is passed on to the section, and the section's named slots too.\n * - The section's events (`ui-opening` / `ui-closing` ...) come out of it, from the editor.\n * - The SCHEMA (`schema`): what its properties are.\n * - A name: one the page added (`UI.propertyControls.addSchema()`), else a tag's vocabulary (`ui-button`).\n * - As a property: a `PropertySchema`, or a component vocabulary.\n * - Empty (no `<ui-property>` or group in it, and no `source`), it MAKES a `<ui-property>` per attribute,\n * in the schema's order.\n * SIDE EFFECT: writes its light DOM, the made ones marked `data-ui-made`.\n * - Its LAYOUT can come from a saved page (`source`, epic `property-editor` P6):\n * an editor page's markup (`PropertyEditorPages`), loaded through `UI.sources` (same-origin).\n * The spell editor hands it a `/spaces/` URL.\n * - The page's groups and properties come into its light DOM.\n * - So do the attributes of the page's editor that it doesn't have yet\n * (as an attribute, or as a property a script set).\n * - `select`: only the page's first match of that selector.\n * - A group's `select`: that group's own part of the page.\n * - `ui-loading`, then `ui-loaded`; a page that doesn't load warns, and nothing changes.\n * - SIDE EFFECT: writes its light DOM (marked `data-ui-made=\"source\"`) and its own missing attributes.\n * - When a property is written: `ui-changed` (from the editor and from the property), then the schema's\n * \"on change\" rules for it (`UI.propertyControls.rule()`).\n * - Its groups hear about their properties: `ui-invalid` and `:state(error)` when one fails,\n * `:state(changed)` while one holds an edit, `ui-saved` when a submit or a save passes.\n * - `apply=\"on save\"`: Save and Cancel under the properties (`part=\"footer\"`).\n * - `readonly`: every property in it is readonly (read as each connects).\n * - A NESTED editor, made by a property (`as=\"editor\"`), edits that property's thing: its `value` unless given.\n ****************/\nexport class UIPropertyEditor extends UIForm {\n // the form's names under the editor's tag, the section's and its own: TypeScript only knows the form's literals\n @E.proto static vocabulary = propertyEditorVocabulary as unknown as typeof formVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { ...UIForm.prototype.elementSetup.styleSheets, editor: editorCSS },\n DOMElement: DOMPropertyEditorElement\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## The schema\n ////////////////\n\n /** `schema` as given: a name, or an object. */\n private get schemaGiven(): unknown {\n return E.Reactive.attributeValue(this, \"schema\")\n }\n\n /**\n * The schema its properties read, resolved; `undefined` while there's none (or the runtime isn't in yet).\n * - A tag not defined yet, e.g. a program's `<task-list-task>` drawn after the editor:\n * read again once it is (`waitForSchemaTag()`), so the properties are remade with its kinds and values.\n */\n get currentSchema(): PropertySchema | undefined {\n const given = this.schemaGiven\n if (typeof given === \"string\") {\n if (!this.isReady) return undefined\n // tracked: it changes as a tag the schema names is defined\n void this.schemaTagsDefined\n const added = UI.propertyControls.schema(given)\n if (added) return added\n const vocabulary = UI.vocabulary.get(given)\n if (!vocabulary) this.waitForSchemaTag(given)\n return vocabulary ? PropertySchemas.fromVocabulary(vocabulary) : undefined\n }\n if (!given || typeof given !== \"object\" || !(\"attributes\" in given)) return undefined\n return \"tag\" in given ? PropertySchemas.fromVocabulary(given as ComponentVocabulary) : (given as PropertySchema)\n }\n\n /** How many tags `schema` named have been defined since it was read: `currentSchema` reads it, to read again. */\n @E.state private accessor schemaTagsDefined = 0\n\n /** The tags `waitForSchemaTag()` is waiting for: once each. */\n private readonly schemaTagsAwaited = new Set<string>()\n\n /** SIDE EFFECT: once `tag` is defined, `currentSchema` is read again -- its vocabulary is in by then. */\n private waitForSchemaTag(tag: string) {\n if (this.schemaTagsAwaited.has(tag) || !tag.includes(\"-\") || typeof customElements === \"undefined\") return\n this.schemaTagsAwaited.add(tag)\n void customElements.whenDefined(tag).then(() => this.schemaTagsDefined++)\n }\n\n /** Empty of the author's properties: make one per attribute of the schema (see the class doc). */\n @E.onChange(\"currentSchema\", \"isConnected\")\n protected onSchemaChanged(schema: PropertySchema | undefined, isConnected: boolean) {\n if (!isConnected || this.holdsOwnProperties || this.attributes.source) return\n this.removeMadeProperties(MADE_FROM.schema)\n for (const spec of schema?.attributes ?? []) {\n const property = document.createElement(PROPERTY_TAG)\n property.setAttribute(\"name\", spec.name)\n property.setAttribute(MADE_ATTRIBUTE, MADE_FROM.schema)\n this.domElement.append(property)\n }\n }\n\n /** The author laid out properties (or groups) of their own: any element child it didn't make. */\n private get holdsOwnProperties(): boolean {\n return [...this.domElement.children].some((child) => !child.hasAttribute(MADE_ATTRIBUTE) && !child.slot)\n }\n\n /**\n * Take away every property it made from `from` (its schema, or its source page).\n * - SIDE EFFECT: writes its light DOM.\n */\n @E.untracked\n private removeMadeProperties(from: string) {\n for (const child of [...this.domElement.children]) if (child.getAttribute(MADE_ATTRIBUTE) === from) child.remove()\n }\n\n ////////////////\n // ## Its layout from a page (`source`)\n ////////////////\n\n /** Load the layout page as `source` or `select` changes, while connected (see the class doc). */\n @E.onChange(\"sourceUrl\", \"sourceSelector\", \"isConnected\")\n protected onSourceChanged(url: string | undefined, selector: string | undefined, isConnected: boolean) {\n if (!url || !isConnected || isServer) return\n let isCurrent = true\n void this.loadLayout(url, selector, () => isCurrent)\n return () => {\n isCurrent = false\n }\n }\n\n /** `source`. */\n get sourceUrl(): string | undefined {\n return this.attributes.source ?? undefined\n }\n\n /** `select`. */\n get sourceSelector(): string | undefined {\n return this.attributes.selector ?? this.attributes.select ?? undefined\n }\n\n /**\n * Fetch the page at `url` and take its layout, unless `isCurrent()` says it's no longer wanted.\n * - NEVER throws: a page that doesn't load warns.\n */\n @E.untracked\n private async loadLayout(url: string, selector: string | undefined, isCurrent: () => boolean) {\n this.send(OWN.loading, { source: url })\n try {\n await UI.load()\n const { text } = await UI.sources.load(url)\n if (!isCurrent()) return\n const page = new DOMParser().parseFromString(text, \"text/html\")\n const root = selector ? page.querySelector(selector) : (PropertyEditorPages.editorIn(page) ?? page.body)\n if (!root) {\n E.Warnings.warn(\"<ui-property-editor>\", `${url} has nothing matching \\`${selector}\\``)\n return\n }\n this.takeLayout(root, page)\n this.send(OWN.loaded, { source: url, content: text })\n } catch (error) {\n E.Warnings.warn(\"<ui-property-editor>\", `can't load its layout from ${url}:`, error)\n }\n }\n\n /**\n * Take `root`'s children as its layout (and, a page's editor, the attributes it doesn't have);\n * then fill each group that has a `select` and nothing in it from `page`.\n * - SIDE EFFECT: writes its light DOM and its attributes.\n */\n private takeLayout(root: Element, page: Document) {\n this.removeMadeProperties(MADE_FROM.source)\n if (root.localName === this.domElement.localName) {\n for (const { name, value } of root.attributes) {\n // not over one it has, as an attribute or as a property (`schema` set by a script)\n const own = (this.domElement as unknown as Record<string, unknown>)[E.camelCase(name)]\n if (!this.domElement.hasAttribute(name) && own == null) this.domElement.setAttribute(name, value)\n }\n }\n for (const child of root.children) {\n const made = document.importNode(child, true)\n made.setAttribute(MADE_ATTRIBUTE, MADE_FROM.source)\n this.domElement.append(made)\n }\n for (const group of this.domElement.querySelectorAll(`${GROUP_SELECTOR}:is([selector], [select])`)) {\n if (group.children.length) continue\n const part = page.querySelector((group.getAttribute(\"selector\") ?? group.getAttribute(\"select\"))!)\n for (const child of part?.children ?? []) group.append(document.importNode(child, true))\n }\n }\n\n ////////////////\n // ## A nested editor's thing\n ////////////////\n\n /** The property a nested editor edits the thing of (`data-value-from`, set by the property that made it). */\n private get valueFrom(): string | undefined {\n return this.attributes[VALUE_FROM_ATTRIBUTE] ?? undefined\n }\n\n /** What it's bound to: `value`, else (nested) the thing its property holds, in the scope around it. */\n get boundValue(): unknown {\n const own = this.value\n if (own !== undefined || !this.valueFrom) return own\n const around = this.domElement.parentElement\n return around ? FormBinding.read(FormBinding.scopeAround(around), this.valueFrom) : undefined\n }\n\n /** Bound: there's a thing (or things) to edit. */\n get isBound(): boolean {\n return FormBinding.isObject(this.boundValue)\n }\n\n /** Hold `boundValue` as the scope its properties bind to (over the form's `value`). */\n onMount() {\n const result = super.onMount()\n FormBinding.hold(this.domElement, () => this.boundValue)\n return result\n }\n\n ////////////////\n // ## The section around it\n ////////////////\n\n /** Which of its named slots have light-DOM content: `slot=\"label\"`, `slot=\"output\"` ... */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** It has a title, so it draws a section: `label` or `slot=\"label\"`. */\n get hasTitle(): boolean {\n return !!this.attributes.label || this.slots.hasContent(this.slotForName(OWN.label))\n }\n\n /** The section attributes it was given, raw, to pass on. */\n private get sectionAttributes(): Record<string, string> {\n const passed: Record<string, string> = {}\n for (const name of SECTION_ATTRIBUTES) {\n const value = this.attributes[name]\n if (value != null) passed[name] = value\n }\n return passed\n }\n\n /** A section attribute isn't a class word of the form's box: the section draws it. */\n protected classValue(name: E.AttributeName<typeof formVocabulary>): unknown {\n if (SECTION_ATTRIBUTES.has(name)) return undefined\n return super.classValue(name)\n }\n\n ////////////////\n // ## States\n ////////////////\n\n /** `:state(readonly)`: `readonly`. */\n /** Always `:state(property-editor)`: how its family finds it, whatever its tag is called (`EDITOR_SELECTOR`). */\n @E.cssState(\"property-editor\")\n get isPropertyEditor(): boolean {\n return true\n }\n\n @E.cssState(\"readonly\")\n get isReadOnly(): boolean {\n return this.attributes.readonly != null && this.attributes.readonly !== \"false\"\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n render(): JSX.Element {\n return (\n <div\n class={this.rootClass}\n part={`${this.partForName(OWN.editor)} ${this.partForName(OWN.form)}`}\n inert={this.disabled || this.loading}\n aria-busy={this.loading ? \"true\" : undefined}\n >\n <Show when={this.hasTitle} fallback={this.body()}>\n <Dynamic component={SECTION_TAG} {...this.sectionAttributes}>\n <For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>\n {this.outputAndError()}\n {this.body()}\n </Dynamic>\n </Show>\n {this.debugBox()}\n </div>\n )\n }\n\n /**\n * The section's named slots it has content for, passed on: only those, so an empty one never hides the\n * section's own text (`label`) or draws an empty box (`actions`).\n */\n private get forwardedSlots(): string[] {\n return FORWARDED_SLOTS.filter((name) => this.slots.hasContent(name))\n }\n\n /** The properties, then Save and Cancel with `apply=\"on save\"`. */\n private body(): JSX.Element {\n return (\n <>\n <Show when={!this.hasTitle}>{this.outputAndError()}</Show>\n <slot />\n <Show when={this.apply === ON_SAVE}>\n <div class={FOOTER} part={this.partForName(OWN.footer)}>\n <Dynamic component={BUTTON_TAG} color=\"primary\" onClick={() => this.save()}>\n {this.translationForKey(OWN.save)}\n </Dynamic>\n <Dynamic component={BUTTON_TAG} onClick={() => this.cancel()}>\n {this.translationForKey(OWN.cancel)}\n </Dynamic>\n </div>\n </Show>\n </>\n )\n }\n\n /** Its `output` (in the title bar's actions) and `error` (a line under the title). */\n private outputAndError(): JSX.Element {\n const output = this.attributes.output\n const error = this.attributes.error\n return (\n <>\n <Show when={output || this.slots.hasContent(this.slotForName(OWN.output))}>\n <span class={OUTPUT} part={this.partForName(OWN.output)} slot={this.hasTitle ? ACTIONS_SLOT : undefined}>\n <slot name={this.slotForName(OWN.output)}>{output}</slot>\n </span>\n </Show>\n <Show when={error}>\n <div class={ERROR_LINE} part={this.partForName(OWN.errorLine)} role=\"alert\">\n {error}\n </div>\n </Show>\n </>\n )\n }\n\n ////////////////\n // ## Its properties and groups hear what happened\n ////////////////\n\n /** A property was written: `ui-changed` from the editor and the property, then its \"on change\" rules. */\n protected onWritten({ control, name, value, things }: WrittenProperty) {\n const property = control.closest(PROPERTY_SELECTOR)\n property?.dispatchEvent(new CustomEvent(CHANGE_EVENT, { detail: { name, value }, bubbles: false }))\n this.send(OWN.change, { name, value, things })\n const spec = this.currentSchema?.attributes.find((candidate) => candidate.name === name)\n for (const ruleName of spec?.onChange ?? []) {\n const rule = UI.propertyControls.rule(ruleName)\n if (!rule) {\n E.Warnings.warn(\"<ui-property-editor>\", `no rule \\`${ruleName}\\`: add it with UI.propertyControls.addRule()`)\n continue\n }\n try {\n rule({ things, property: spec!, value })\n } catch (error) {\n E.Warnings.warn(\"<ui-property-editor>\", `rule \\`${ruleName}\\` failed:`, error)\n }\n }\n }\n\n /** A field was checked: its group shows the error state, and hears `ui-invalid`. */\n protected onFieldChecked(field: { identifier: string; controls: Element[] }, messages: readonly string[]) {\n const group = field.controls[0]?.closest(GROUP_SELECTOR) as DOMGroupLike | null\n if (!group) return\n group.markFieldFailed?.(field.identifier, messages.length > 0)\n if (messages.length) {\n group.dispatchEvent(\n new CustomEvent(INVALID_EVENT, { detail: { field: field.identifier, errors: messages }, bubbles: false })\n )\n }\n }\n\n /** Held edits came or went: each property and group says whether it holds one. */\n protected onHeldChanged() {\n const held = new Set(this.heldControls)\n const properties = new Set<Element>()\n const groups = new Set<Element>()\n for (const control of held) {\n const property = control.closest(PROPERTY_SELECTOR)\n if (property) properties.add(property)\n const group = control.closest(GROUP_SELECTOR)\n if (group) groups.add(group)\n }\n for (const property of this.domElement.querySelectorAll(PROPERTY_SELECTOR)) {\n ;(property as PropertyLike).markChanged?.(properties.has(property))\n }\n for (const group of this.domElement.querySelectorAll(GROUP_SELECTOR)) {\n ;(group as DOMGroupLike).markChanged?.(groups.has(group))\n }\n }\n\n /** A submit or a save passed: each group hears `ui-saved`. */\n protected onSucceeded() {\n for (const group of this.domElement.querySelectorAll(GROUP_SELECTOR)) {\n group.dispatchEvent(new CustomEvent(SUCCESS_EVENT, { detail: { values: this.values }, bubbles: false }))\n }\n }\n}\n\n/** The section's attributes the editor passes on (all but those the editor has of its own). */\nconst SECTION_ATTRIBUTES = new Set(\n sectionVocabulary.attributes\n .map((spec) => spec.name as string)\n .filter((name) => ![\"source\", \"selector\", \"size\", \"inverted\", \"loading\", \"disabled\", \"parent\"].includes(name))\n)\n\n/** The section's named slots the editor passes on. */\nconst FORWARDED_SLOTS = sectionVocabulary.slots.map((slot) => slot.name as string).filter(Boolean)\n\n/** What a property's write tells the editor. */\ntype WrittenProperty = { control: Element; name: string; value: unknown; things: readonly object[] }\n\n/** What the editor calls on a group's DOM element. */\ntype DOMGroupLike = HTMLElement & {\n markFieldFailed?(identifier: string, isFailed: boolean): void\n markChanged?(isChanged: boolean): void\n}\n\n/** What the editor calls on a property's DOM element. */\ntype PropertyLike = Element & { markChanged?(isChanged: boolean): void }\n\n/**\n * The editor's own names (and the section's it uses), typed for `partForName()` and its kin:\n * TypeScript knows only the form's literals (the vocabulary's cast, above), so each is `never` to it.\n */\nconst OWN = {\n editor: \"editor\",\n form: \"form\",\n footer: \"footer\",\n output: \"output\",\n errorLine: \"error-line\",\n label: \"label\",\n save: \"save\",\n cancel: \"cancel\",\n change: \"ui-changed\",\n loading: \"ui-loading\",\n loaded: \"ui-loaded\"\n} as unknown as Record<string, never>\n\n/** The section it draws, and its buttons. */\nconst SECTION_TAG = \"ui-section\"\nconst BUTTON_TAG = \"ui-button\"\n\n/** The section's slot the output goes in: its title bar's end. */\nconst ACTIONS_SLOT = \"actions\"\n\n/** `apply`'s word for held edits. */\nconst ON_SAVE = \"on save\"\n\n/** Events it sends on its properties and groups (and on itself). */\nconst CHANGE_EVENT = \"ui-changed\"\nconst INVALID_EVENT = \"ui-invalid\"\nconst SUCCESS_EVENT = \"ui-saved\"\n\n/** Shadow classes. */\nconst FOOTER = \"footer\"\nconst OUTPUT = \"output\"\nconst ERROR_LINE = \"error-line\"\n","/**\n * The English vocabulary of `<ui-property-group>`: every name the tag uses.\n * - Its own names first, then `<ui-section>`'s, which it PASSES THROUGH (it is one), where they mean the same.\n * - Not passed through: `source`, and what only works with it (`ui-loaded`, `:state(loaded)`, the load texts).\n * - Its own `select` picks from the editor's `source` page instead.\n * - The shape is `E.ComponentVocabulary`. Pure data.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\nimport { sectionVocabulary } from \"spell/ui/components/ui-section/UISection.en\"\nimport { passThrough } from \"./UIPropertyEditor.types\"\n\n/** The section's names that only work with `source`: a group has none. */\nconst SOURCE_ONLY = [\n \"source\",\n \"ui-loaded\",\n \"loaded\",\n \"sourceLoadError\",\n \"sourceCrossOrigin\",\n \"sourceFileProtocol\",\n \"sourceRenderError\"\n]\n\n/****************\n * ### `propertyGroupVocabulary`\n * The names of `<ui-property-group>`: a folding band of properties in a `<ui-property-editor>`.\n ****************/\nexport const propertyGroupVocabulary = {\n ...sectionVocabulary,\n tag: \"ui-property-group\",\n topics: [\"forms\", \"layout\"],\n aka: [\"property group\", \"fieldset\", \"settings group\", \"inspector section\"],\n description:\n \"A property group is a band of properties that opens and closes, in a property editor. It takes `<ui-section>`'s attributes.\",\n attributes: passThrough<E.AttributeSpec>(\n [\n {\n name: \"selector\",\n group: \"appearance\",\n kind: \"string\",\n replaces: [\"select\"],\n description:\n \"A CSS selector: the group's properties are its first match in the editor's `source` page (P6). \" +\n \"Its old name was `select`.\"\n },\n {\n name: \"readonly\",\n group: \"form\",\n kind: \"boolean\",\n description: \"Shows every value; nothing can be changed. Reaches every property in it.\"\n },\n {\n name: \"state\",\n group: \"form\",\n kind: \"valueOnly\",\n values: UIT.FormStates,\n description: \"Its state: tints its title. A property in it failing validation shows `error` on top.\"\n },\n {\n name: \"output\",\n group: \"content\",\n kind: \"string\",\n description: 'A value at the end of the title bar; `slot=\"output\"`.'\n },\n { name: \"error\", group: \"form\", kind: \"string\", description: \"An error under the title, and the `error` state.\" }\n ] as const satisfies readonly E.AttributeSpec[],\n [sectionVocabulary.attributes],\n SOURCE_ONLY\n ),\n events: passThrough<E.EventSpec>(\n [\n {\n name: \"ui-invalid\",\n detail: \"{ field: string, value: FieldValue, errors: string[], values: Record<string, FieldValue> }\",\n description: \"A property in the group failed validation (the editor sends it on the group too).\"\n },\n {\n name: \"ui-saved\",\n detail: \"{ values: Record<string, FieldValue>, originalEvent?: Event }\",\n description: \"The editor's submit or Save passed validation (sent on each group too).\"\n }\n ] as const satisfies readonly E.EventSpec[],\n [sectionVocabulary.events],\n SOURCE_ONLY\n ),\n slots: passThrough<E.SlotSpec>(\n [{ name: \"output\", description: \"Rich output (instead of `output`).\" }] as const satisfies readonly E.SlotSpec[],\n [sectionVocabulary.slots]\n ),\n parts: passThrough<E.PartSpec>(\n [\n { name: \"output\", description: \"The output.\" },\n { name: \"error-line\", description: \"The group's own error, under its title.\" }\n ] as const satisfies readonly E.PartSpec[],\n [sectionVocabulary.parts]\n ),\n states: passThrough<E.StateSpec>(\n [\n { name: \"changed\", description: 'A property in it has an edit not saved yet (`apply=\"on save\"`).' },\n { name: \"readonly\", description: \"Nothing in it can be changed (`readonly`).\" },\n { name: \"error\", description: \"Its `error`, or a property in it failing validation.\" }\n ] as const satisfies readonly E.StateSpec[],\n [sectionVocabulary.states],\n SOURCE_ONLY\n ),\n texts: passThrough<E.TextSpec>([], [sectionVocabulary.texts], SOURCE_ONLY)\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-property-group>`'s own parts, adopted after the section's (`UISection.css`).\n * - `.output`: a value at the end of the title bar (mono, muted).\n * - `.error-line`: its own error, first in the content.\n * - `state` / an error tint the title (`.error`, `.info` ... on the box).\n */\n\n@layer ui.components.property-group.content, ui.components.property-group.states;\n\n@layer ui.components.property-group.content {\n .output {\n margin-inline-start: 0.5em;\n color: var(--ui-text-muted);\n font-family: var(--ui-font-family-mono);\n font-size: 0.92em;\n font-variant-numeric: tabular-nums;\n }\n .error-line {\n margin: 0 0 0.75em;\n color: var(--ui-negative-text);\n font-size: 0.85714em;\n }\n}\n\n@layer ui.components.property-group.states {\n .error.section > .title {\n color: var(--ui-negative-text);\n }\n .info.section > .title {\n color: var(--ui-info-text, var(--ui-blue-text));\n }\n .success.section > .title {\n color: var(--ui-positive-text);\n }\n .warning.section > .title {\n color: var(--ui-warning-text, var(--ui-yellow-text));\n }\n}\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\n// the family barrel, not the leaf: the lib build then imports `ui-panel.js` instead of splitting a shared chunk\n// (SIDE EFFECT: defines `<ui-panel>`, and `<ui-section>` / `<ui-sections>`: a group is a panel's band)\nimport { UIPanel } from \"spell/ui/components/ui-panel\"\nimport type { SectionVocabulary } from \"spell/ui/components/ui-section/UISection.types\"\nimport { propertyGroupVocabulary } from \"./UIPropertyGroup.en\"\n\nimport groupCSS from \"./UIPropertyGroup.css?inline\"\n\n/****************\n * ### `DOMPropertyGroupElement`\n * The DOM element of `<ui-property-group>`: a section's, plus what its editor tells it.\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMPropertyGroupElement extends E.DOMLoadableBodyElement {\n /** A property in it (`identifier`) failed validation, or passed again: `:state(error)` follows. */\n markFieldFailed(identifier: string, isFailed: boolean) {\n ;(this.component as UIPropertyGroup | undefined)?.markFieldFailed(identifier, isFailed)\n }\n\n /** A property in it holds an edit not saved yet, or none does: `:state(changed)`. */\n markChanged(isChanged: boolean) {\n const component = this.component as UIPropertyGroup | undefined\n if (component) component.isChanged = isChanged\n }\n}\n\n/****************\n * ### `UIPropertyGroup`\n * The component behind `<ui-property-group>`: a folding band of properties in a `<ui-property-editor>`.\n *\n * - It IS a `<ui-section>`, drawn as a panel's SUB-HEAD BAND (it extends `UIPanel`, which extends `UISection`):\n * the same attributes, slots, parts, events and folding.\n * - Its title a band across its editor (small capitals, tinted, a hairline above), the chevron at its far end:\n * the theme editor's bands (Owen: \"Property panels should have this styling for section headers\").\n * - The band reaches out through the panel padding around it (`--ui-panel-padding`), to its container's edges.\n * - All but `source`: a group's properties come from its editor.\n * - Its `select` picks its part of the editor's page (P6).\n * - Its own:\n * - `output`, at the end of the title bar\n * - `error`, a line under the title\n * - `state` tints its title\n * - `:state(error)`: its own `error`, or a property failing validation\n * - `readonly`: every property in it is readonly (each reads it as it connects)\n * - `:state(changed)`: a property in it holds an edit not saved yet\n * - The editor tells it about its properties (`markFieldFailed()`, `markChanged()`),\n * and sends it `ui-invalid` and `ui-saved`.\n ****************/\nexport class UIPropertyGroup extends UIPanel {\n // the section's names under the group's tag, and its own: TypeScript only knows the section's literals\n @E.proto static vocabulary = propertyGroupVocabulary as unknown as SectionVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { ...UIPanel.prototype.elementSetup.styleSheets, group: groupCSS },\n DOMElement: DOMPropertyGroupElement\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## Errors and changes\n ////////////////\n\n /** Its properties failing validation now, by identifier. */\n @E.state accessor failedFields: ReadonlySet<string> = new Set()\n\n /** Note a property failing validation, or passing again. */\n @E.untracked\n markFieldFailed(identifier: string, isFailed: boolean) {\n if (this.failedFields.has(identifier) === isFailed) return\n const next = new Set(this.failedFields)\n if (isFailed) next.add(identifier)\n else next.delete(identifier)\n this.failedFields = next\n }\n\n /** `:state(error)`: its `error`, a property in it failing validation, or (the section's) a failed load. */\n /** Always `:state(property-group)`: how its family finds it, whatever its tag is called (`GROUP_SELECTOR`). */\n @E.cssState(\"property-group\")\n get isPropertyGroup(): boolean {\n return true\n }\n\n @E.cssState(\"error\")\n get isError(): boolean {\n return !!this.attributes.error || this.failedFields.size > 0 || this.attributes.state === ERROR\n }\n\n /** `:state(changed)`: a property in it holds an edit not saved yet. */\n @E.cssState(\"changed\")\n @E.state\n accessor isChanged = false\n\n /** `:state(readonly)`: `readonly`. */\n @E.cssState(\"readonly\")\n get isReadOnly(): boolean {\n const readonly = this.attributes.readonly\n return readonly != null && readonly !== \"false\"\n }\n\n /**\n * Always a band (`sub`), in a panel or not: `loose` with no panel around it, so it takes `primary`'s colours\n * as a panel does (`UIPanel.css`); and `state`'s class word on the box (`error`, `info` ...), shown as an\n * error while one is.\n */\n protected get extraClass(): string | undefined {\n const state = this.isError ? ERROR : (this.attributes.state ?? undefined)\n const loose = this.enclosingSection instanceof UIPanel ? undefined : LOOSE\n const words = new Set([...(super.extraClass ?? \"\").split(\" \"), BAND, loose, GROUP, state])\n return [...words].filter(Boolean).join(\" \")\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** `output`, at the end of the title bar. */\n protected titleBarEnd(): JSX.Element {\n const output = this.attributes.output\n return (\n <Show when={output || this.slots.hasContent(OUTPUT)}>\n <span class={OUTPUT} part={OUTPUT}>\n <slot name={OUTPUT}>{output}</slot>\n </span>\n </Show>\n )\n }\n\n /** `error`, a line first in the content. */\n protected contentStart(): JSX.Element {\n const error = this.attributes.error\n return (\n <Show when={error}>\n <div class={ERROR_LINE} part={ERROR_LINE} role=\"alert\">\n {error}\n </div>\n </Show>\n )\n }\n}\n\n/** The panel's class word for a sub-head band (`UIPanel.css`): every group is one. */\nconst BAND = \"sub\"\n\n/** Class word of a band with no panel around it (`UIPanel.css`). */\nconst LOOSE = \"loose\"\n\n/** Class word before the section's noun: `ui … property-group section`. */\nconst GROUP = \"property-group\"\n\n/** The error state's word. */\nconst ERROR = \"error\"\n\n/** Its own parts and slot: plain names (the vocabulary's own; TypeScript knows only the section's). */\nconst OUTPUT = \"output\"\nconst ERROR_LINE = \"error-line\"\n","/**\n * The property editor family: defines `<ui-property-editor>`, `<ui-property-group>` and `<ui-property>`,\n * and exports their components.\n * - SIDE EFFECT: importing it defines the tags.\n * Its components import the form and section families first: the editor is a form and draws a section,\n * a group is a section, a property is a field.\n * - Also the library's `spell/ui/ui-property-editor` entry.\n */\n\nimport { DOMPropertyElement, UIProperty } from \"./UIProperty\"\nimport { DOMPropertyEditorElement, UIPropertyEditor } from \"./UIPropertyEditor\"\nimport { DOMPropertyGroupElement, UIPropertyGroup } from \"./UIPropertyGroup\"\n\nUIPropertyEditor.define()\nUIPropertyGroup.define()\nUIProperty.define()\n\nexport {\n UIPropertyEditor,\n UIPropertyGroup,\n UIProperty,\n DOMPropertyEditorElement,\n DOMPropertyGroupElement,\n DOMPropertyElement\n}\n"],"mappings":";;;;;;;;AAmBA,IAAayG,IAAb,MAAa,gBAAgB;CAE3B,OAAO,eAAe,GAAqD;EACzE,OAAO;GAAE,MAAMC,EAAW;GAAK,aAAaA,EAAW;GAAa,YAAYA,EAAW;EAAW;CACxG;CAaA,OAAO,eAAe,GAAoB,GAAiC;EACzE,IAAI,CAAC,eAAeC,CAAM,GACxB,MAAU,UAAU,wFAAwF;EAE9G,OAAO;GACL,MAAMC,KAAQD,EAAO,SAAS;GAC9B,aAAaA,EAAO;GACpB,YAAY,gBAAgB,uBAAuBA,CAAM;EAC3D;CACF;CAQA,OAAO,WAAW,GAAgC,IAAO,IAAsB;EAC7E,OAAO;GAAE;GAAM,YAAY,gBAAgB,mBAAmBE,CAAK;EAAE;CACvE;CAOA,OAAO,OAAO,GAAoC;EAChD,IAAIC,EAAK,MAAM,OAAOA,EAAK;EAC3B,QAAQA,EAAK,MAAb;GACE,KAAK;GACL,KAAK,WACH,OAAO;GACT,KAAK,UACH,OAAO;GACT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G","PROPERTY_TAG","GROUP_TAG","_init","text","<Show when={!this.origin?.mark} fallback={this.originMark()}>\n {this.originButton()}\n </Show>","this","<Show\n when={action()}\n fallback={<span class=\"origin mark\" part={this.partForName(\"origin\")} title={this.origin?.from}>\n {this.origin?.mark}\n </span>}\n >\n {(pressed) => <button\n type=\"button\"\n class=\"origin mark\"\n part={this.partForName(\"origin\")}\n title={this.origin?.from}\n onClick={() => this.send(ORIGIN_ACTIONS[pressed()].event, { name: this.propertyName })}\n >\n {this.origin?.mark}\n </button>}\n </Show>","title={this.origin?.from}","<span class=\"origin mark\" part={this.partForName(\"origin\")} title={this.origin?.from}>\n {this.origin?.mark}\n </span>","<Show when={this.origin?.action}>\n {(action) => {\n const { text, event } = ORIGIN_ACTIONS[action()];\n const words = /* @__PURE__ */ __name(() => this.translationForKey(text, { label: this.ownLabel ?? \"\" }), \"words\");\n return <button\n type=\"button\"\n class={[\"origin\", { reset: action() === \"reset\" }]}\n part={this.partForName(\"origin\")}\n title={words()}\n aria-label={words()}\n onClick={() => this.send(event, { name: this.propertyName })}\n >\n {this.originGlyph.svg}\n </button>;\n }}\n </Show>","part={this.partForName(\"origin\")}","title={words()}","aria-label={words()}","<button\n type=\"button\"\n class={[\"origin\", { reset: action() === \"reset\" }]}\n part={this.partForName(\"origin\")}\n title={words()}\n aria-label={words()}\n onClick={() => this.send(event, { name: this.propertyName })}\n >\n {this.originGlyph.svg}\n </button>","_tmpl$","_tmpl$2","_tmpl$3","_a","_init","_showsDefaults_dec","_isCompact_dec","_isChanged_dec","_isReadOnly_dec","_watchEditor_dec","_editor_dec","_elementSetup_dec","_vocabulary_dec","_editor","_isChanged","E.untracked","__name","E.proto","E.protoMerged","E.state","E.whileConnected","E.cssState","E.onChange","E.watches","E.on","E.IconGlyph","_$createComponent","_$setAttribute","propertyCSS","_$delegateEvents","<Show when={this.hasTitle} fallback={this.body()}>\n <Dynamic component={SECTION_TAG} {...this.sectionAttributes}>\n <For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>\n {this.outputAndError()}\n {this.body()}\n </Dynamic>\n </Show>","this","<Dynamic component={SECTION_TAG} {...this.sectionAttributes}>\n <For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>\n {this.outputAndError()}\n {this.body()}\n </Dynamic>","component={SECTION_TAG}","<For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>","this.outputAndError()","this.body()","<div\n class={this.rootClass}\n style={{ [COLUMNS_PROPERTY]: String(this.columnCount) }}\n part={`${this.partForName(OWN.editor)} ${this.partForName(OWN.form)}`}\n inert={this.disabled || this.loading}\n aria-busy={this.loading ? \"true\" : void 0}\n >\n <Show when={this.hasTitle} fallback={this.body()}>\n <Dynamic component={SECTION_TAG} {...this.sectionAttributes}>\n <For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>\n {this.outputAndError()}\n {this.body()}\n </Dynamic>\n </Show>\n {this.debugBox()}\n </div>","style={{ [COLUMNS_PROPERTY]: String(this.columnCount) }}","part={`${this.partForName(OWN.editor)} ${this.partForName(OWN.form)}`}","inert={this.disabled || this.loading}","aria-busy={this.loading ? \"true\" : void 0}","<Show when={!this.hasTitle}>{this.outputAndError()}</Show>","<Show when={this.apply === ON_SAVE}>\n <div class={FOOTER} part={this.partForName(OWN.footer)}>\n <Dynamic component={BUTTON_TAG} color=\"primary\" onClick={() => this.save()}>\n {this.translationForKey(OWN.save)}\n </Dynamic>\n <Dynamic component={BUTTON_TAG} onClick={() => this.cancel()}>\n {this.translationForKey(OWN.cancel)}\n </Dynamic>\n </div>\n </Show>","<Dynamic component={BUTTON_TAG} color=\"primary\" onClick={() => this.save()}>\n {this.translationForKey(OWN.save)}\n </Dynamic>","component={BUTTON_TAG}","color=\"primary\"","onClick={() => this.save()}","<div class={FOOTER} part={this.partForName(OWN.footer)}>\n <Dynamic component={BUTTON_TAG} color=\"primary\" onClick={() => this.save()}>\n {this.translationForKey(OWN.save)}\n </Dynamic>\n <Dynamic component={BUTTON_TAG} onClick={() => this.cancel()}>\n {this.translationForKey(OWN.cancel)}\n </Dynamic>\n </div>","<Dynamic component={BUTTON_TAG} onClick={() => this.cancel()}>\n {this.translationForKey(OWN.cancel)}\n </Dynamic>","onClick={() => this.cancel()}","part={this.partForName(OWN.footer)}","<Show when={output || this.slots.hasContent(this.slotForName(OWN.output))}>\n <span class={OUTPUT} part={this.partForName(OWN.output)} slot={this.hasTitle ? ACTIONS_SLOT : void 0}>\n <slot name={this.slotForName(OWN.output)}>{output}</slot>\n </span>\n </Show>","part={this.partForName(OWN.output)}","slot={this.hasTitle ? ACTIONS_SLOT : void 0}","name={this.slotForName(OWN.output)}","<span class={OUTPUT} part={this.partForName(OWN.output)} slot={this.hasTitle ? ACTIONS_SLOT : void 0}>\n <slot name={this.slotForName(OWN.output)}>{output}</slot>\n </span>","<Show when={error}>\n <div class={ERROR_LINE} part={this.partForName(OWN.errorLine)} role=\"alert\">\n {error}\n </div>\n </Show>","when={error}","part={this.partForName(OWN.errorLine)}","<div class={ERROR_LINE} part={this.partForName(OWN.errorLine)} role=\"alert\">\n {error}\n </div>","_tmpl$","_tmpl$2","_isGrid_dec","_isCompact_dec","_isReadOnly_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","E.proto","E.protoMerged","E.state","E.onChange","E.untracked","E.cssState","E.SlotContent","E.camelCase","_$createComponent","_$mergeProps","_$getOwner","_$memo","_$readShallow","_$setAttribute","OUTPUT","ERROR_LINE","__name","editorCSS","UIT.FormStates","<Show when={output || this.slots.hasContent(OUTPUT)}>\n <span class={OUTPUT} part={OUTPUT}>\n <slot name={OUTPUT}>{output}</slot>\n </span>\n </Show>","this","<span class={OUTPUT} part={OUTPUT}>\n <slot name={OUTPUT}>{output}</slot>\n </span>","<Show when={error}>\n <div class={ERROR_LINE} part={ERROR_LINE} role=\"alert\">\n {error}\n </div>\n </Show>","when={error}","<div class={ERROR_LINE} part={ERROR_LINE} role=\"alert\">\n {error}\n </div>","E.DOMLoadableBodyElement","E.proto","E.protoMerged","E.state","E.untracked","E.cssState","E.whileConnected","_$createComponent","_$getOwner","_$readShallow","__name","groupCSS","__name$1","__publicField","__decorateElement","__decoratorMetadata","FormStates","__runInitializers","__privateAdd","__decoratorStart","fieldVocabulary","formVocabulary","sectionVocabulary","getOwner$1","PropertySchemas","vocabulary","schema","name","block","spec","CHOICE_KINDS","words","kebabCase","attributes","property","_schema","type","KIND_FOR_TYPE","value","rules","each","PropertyEditorPages","editor","document","EDITOR_TAG$1","root","problems","named","PROPERTY_TAG$1","kind","problem","UI_MODULE","tag","className","NOT_COMPILED","layout","child","uiModule","found","GROUP_TAG$1","OTHER_ATTRIBUTE","group","OTHER","key","candidate","types","KIND_TYPES","LIST","CHOICE_LIST_KIND","indent","INDENT","depth","element","empty","end","children","taken","own","skip","names","base","bases","item","EDITOR_TAG","GROUP_TAG","PROPERTY_TAG","EDITOR_SELECTOR","GROUP_SELECTOR","PROPERTY_SELECTOR","MADE_ATTRIBUTE","MADE_FROM","VALUE_FROM_ATTRIBUTE","propertyVocabulary","UIProperty_default","_tmpl$$2","_tmpl$2$2","_tmpl$3$1","_schemaRules_dec","_a$2","_init$2","_onFlagsPicked_dec","_onChosenFlagsChanged_dec","_onFlagRunChanged_dec","_madeCheckbox_dec","_isFlagLead_dec","_isFlagMember_dec","_flagRun_dec","_isSet_dec","_onValueEdited_dec","_onControlsMutated_dec","_noteValueChanged_dec","_valueVersion_dec","_isInlineCheck_dec","_isHalf_dec","_showsDefaults_dec$1","_isCompact_dec$2","_removeMadeControls_dec","_makeControl_dec","_onControlNeeded_dec","_onChoiceSourceChanged_dec","_loadedChoices_dec","_isButtonRow_dec","_isChanged_dec$1","_isData_dec","_isInherited_dec","_isSetHere_dec","_isReadOnly_dec$2","_isProperty_dec","_isInReadonly_dec","_watchEditor_dec$1","_editor_dec$1","_elementSetup_dec$2","_vocabulary_dec$2","_b","_init2","_editor$1","_isInReadonly","_isChanged$1","_loadedChoices","_valueVersion","_flagRun","_isFlagMember","_DOMPropertyElement","DOMFieldElement","untracked","component","isChanged","DOMPropertyElement","VALUE_ATTRIBUTES","a","b","index","_UIProperty","UIField","proto","protoMerged","state","whileConnected","cssState","onChange","watches","on","IconGlyph","ORIGIN_ACTIONS","picked","Converters","event","checkbox","isOn","FormFields","readonly","FLAGS_TEXT","NAMED","TEXT","WORKED_OUT","_self$","createComponent","Show","action","_self$2","_el$","insert","effect","e","_p$","setAttribute","t","_el$2","pressed","_self$3","text","_el$3","o","choices","CHOICE","MOST_SEGMENTS","SEGMENTED_KIND","UI","RADIOS","choice","set","ValueSets","icons","labels","values","icon","text2","HUES","source","isReady","isCurrent","Warnings","error","control","made","FlagRun","SEGMENTED","isSegmented","iconsOnly","radio","FLAGS","width","columns","HALF","HALF_OF_GRID","controls","fallback","FALSE_TEXT","run","select","DROPDOWN_TAG","tip","chosen","at","image","iconOnly","probe","near","hue","color","svg","UIProperty","container","afterSolidUpdate","mode","least","PILLS","CHECKBOXES","LEAST_FLAGS","runs","leads","members","member","delegateEvents","propertyEditorVocabulary","UIPropertyEditor_default","_tmpl$$1","_tmpl$2$1","_tmpl$3","_tmpl$4","_showsDefaults_dec","_isGrid_dec$1","_isCompact_dec$1","_isReadOnly_dec$1","_isPropertyEditor_dec","_loadLayout_dec","_onSourceChanged_dec","_removeMadeProperties_dec","_onSchemaChanged_dec","_schemaTagsDefined_dec","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_schemaTagsDefined","DOMFormElement","_UIPropertyEditor","UIForm","SlotContent","Reactive","given","added","isConnected","from","url","isServer","selector","OWN","page","camelCase","part","around","FormBinding","result","passed","SECTION_ATTRIBUTES","count","Dynamic","mergeProps","SECTION_TAG","For","_el$4","memo","readShallow","COLUMNS_PROPERTY","style","i","FORWARDED_SLOTS","_el$5","ON_SAVE","_el$6","_el$7","_el$8","BUTTON_TAG","FOOTER","output","_el$9","_el$10","OUTPUT$1","ACTIONS_SLOT","_el$11","ERROR_LINE$1","writer","target","CHANGE_EVENT","ruleName","rule","field","messages","INVALID_EVENT","held","properties","groups","SUCCESS_EVENT","UIPropertyEditor","slot","SOURCE_ONLY","propertyGroupVocabulary","UIPropertyGroup_default","_tmpl$","_tmpl$2","_isReadOnly_dec","_isGrid_dec","_isCompact_dec","_watchEditor_dec","_editor_dec","_isChanged_dec","_isError_dec","_isPropertyGroup_dec","_markFieldFailed_dec","_failedFields_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_failedFields","_isChanged","_editor","DOMLoadableBodyElement","identifier","isFailed","_UIPropertyGroup","UIPanel","next","ERROR","loose","LOOSE","BAND","GROUP","OUTPUT","_v$","_$p","ERROR_LINE","UIPropertyGroup"],"sources":["../src/property/PropertySchemas.ts","../src/property/PropertyEditorPages.ts","../src/components/ui-property-editor/UIPropertyEditor.types.ts","../src/components/ui-property-editor/UIProperty.en.ts","../src/components/ui-property-editor/UIProperty.css?inline","../src/components/ui-property-editor/UIProperty.tsx","../src/components/ui-property-editor/UIPropertyEditor.en.ts","../src/components/ui-property-editor/UIPropertyEditor.css?inline","../src/components/ui-property-editor/UIPropertyEditor.tsx","../src/components/ui-property-editor/UIPropertyGroup.en.ts","../src/components/ui-property-editor/UIPropertyGroup.css?inline","../src/components/ui-property-editor/UIPropertyGroup.tsx","../src/components/ui-property-editor/index.ts"],"sourcesContent":["import { kebabCase } from \"spell/ui/util\"\n// the types-only leaf, as `V`: `spell/ui/api` would bring every element (and Solid's JSX) into a node tool's type check\nimport type * as V from \"spell/element/vocabulary.types\"\n\n/****************\n * ### `PropertySchemas`\n * Turns what a thing is described with into what `<ui-property-editor>` reads, a `V.PropertySchema`:\n * its name, and its attributes.\n * - Each attribute is an `AttributeSpec`: a component vocabulary's own shape, grown for forms.\n *\n * - The sources:\n * - a component's vocabulary: it IS one already (`fromVocabulary()`)\n * - a JSON block with a JSON Schema (`fromJSONSchema()`)\n * - a JSON block with none: guessed from the values it holds (`fromValues()`)\n * - a spell class: the app reads it (Spell UI never imports spell's packages; epic `property-editor` Q16)\n * - And what a form asks of any attribute: its value's type (`typeOf()`) and its label (`labelOf()`).\n * - Pure data, no DOM and no Solid: node tools and tests use it as they are.\n * - STATIC and instance-free on purpose: it keeps nothing between calls.\n ****************/\nexport class PropertySchemas {\n /** A component's vocabulary, as a property schema: its tag is the name. */\n static fromVocabulary(vocabulary: V.ComponentVocabulary): V.PropertySchema {\n return { name: vocabulary.tag, description: vocabulary.description, attributes: vocabulary.attributes }\n }\n\n /**\n * A JSON Schema (an `object` schema), as a property schema named `name` (else its `title`).\n * - What each property reads:\n * - its type, and `default`\n * - `title` as the label, `description` as the tip\n * - `minimum` / `maximum` / `multipleOf` / `pattern`\n * - `enum` as choices\n * - A nested object is a `thing` with its own attributes; an array, a `list` of its items' type.\n * - Keys starting with `$` are the file's own (`$type`, `$schema` ...): never a property.\n * - throws a `TypeError` for a schema that isn't an object's\n */\n static fromJSONSchema(schema: JSONSchema, name?: string): V.PropertySchema {\n if (!isObjectSchema(schema)) {\n throw new TypeError(\"PropertySchemas.fromJSONSchema(): not an object's schema; pass one with `properties`\")\n }\n return {\n name: name ?? schema.title ?? \"\",\n description: schema.description,\n attributes: PropertySchemas.attributesOfJSONSchema(schema)\n }\n }\n\n /**\n * A JSON block's properties, guessed from the values it holds: for a block with no schema.\n * - text, a number, yes / no\n * - an array is a `list` of its first item's type; an object, a nested `thing`\n * - `null` (or an empty array) says nothing of its type: `data`, edited as JSON text.\n */\n static fromValues(block: Record<string, unknown>, name = \"\"): V.PropertySchema {\n return { name, attributes: PropertySchemas.attributesOfValues(block) }\n }\n\n /**\n * What an attribute's value IS, as a form edits it: its own `type`, else what its `kind` says.\n * - `boolean` / `keyOnly`: `boolean`; `number`: `number`; `json`: `data`; `icon`: `icon`\n * - a kind with `values`: `choice`; any other: `text`\n */\n static typeOf(spec: V.AttributeSpec): V.ValueType {\n if (spec.type) return spec.type\n switch (spec.kind) {\n case \"boolean\":\n case \"keyOnly\":\n return \"boolean\"\n case \"number\":\n return \"number\"\n case \"json\":\n return \"data\"\n case \"icon\":\n return \"icon\"\n default:\n return spec.values || spec.choicesFrom || CHOICE_KINDS.has(spec.kind) ? \"choice\" : \"text\"\n }\n }\n\n /** An attribute's label, for people: its own, else made from its name (`listsStartAt` => `Lists start at`). */\n static labelOf(spec: V.AttributeSpec): string {\n if (spec.label) return spec.label\n const words = kebabCase(spec.name).replaceAll(\"-\", \" \")\n return words.charAt(0).toUpperCase() + words.slice(1)\n }\n\n ////////////////\n // ## JSON Schema\n ////////////////\n\n /** The attributes of an object's schema, in its own order. */\n private static attributesOfJSONSchema(schema: JSONSchema): V.AttributeSpec[] {\n const attributes: V.AttributeSpec[] = []\n for (const [name, property] of Object.entries(schema.properties ?? {})) {\n if (name.startsWith(\"$\")) continue\n attributes.push(PropertySchemas.attributeOfJSONSchema(name, property))\n }\n return attributes\n }\n\n /** One property's schema, as an attribute. */\n private static attributeOfJSONSchema(name: string, _schema: JSONSchema): V.AttributeSpec {\n const schema = PropertySchemas.withoutNull(_schema)\n const type = PropertySchemas.typeOfJSONSchema(schema)\n const spec: Writable<V.AttributeSpec> = { name, kind: KIND_FOR_TYPE[type], type, description: \"\" }\n if (schema.title) spec.label = schema.title\n if (schema.description) spec.tip = schema.description\n if (schema.enum) spec.values = schema.enum.filter((value) => value !== null).map(String)\n if (schema.minimum !== undefined) spec.min = schema.minimum\n if (schema.maximum !== undefined) spec.max = schema.maximum\n if (schema.multipleOf !== undefined) spec.step = schema.multipleOf\n if (schema.pattern && !schema.patternErrorMessage) spec.pattern = schema.pattern\n const rules = PropertySchemas.rulesOfJSONSchema(schema)\n if (rules.length) spec.rules = rules\n if (isPlainDefault(schema.default)) spec.default = schema.default\n if (type === \"list\" && schema.items)\n spec.of = PropertySchemas.typeOfJSONSchema(PropertySchemas.withoutNull(schema.items))\n if (type === \"thing\") spec.attributesOf = PropertySchemas.attributesOfJSONSchema(schema)\n return spec\n }\n\n /**\n * A property's checks, as the form's rules.\n * - What a spell type's rules write into its JSON Schema (epic `property-editor` P9), read back.\n * - `minLength` / `maxLength`, `format: \"email\"` / `\"uri\"`\n * - a `pattern` with VS Code's `patternErrorMessage`: the rule with those words (a bare `pattern` is `pattern`)\n */\n private static rulesOfJSONSchema(schema: JSONSchema): V.RuleSpec[] {\n const rules: V.RuleSpec[] = []\n if (schema.minLength)\n rules.push(schema.minLength === 1 ? { type: \"empty\" } : { type: \"minLength\", value: `${schema.minLength}` })\n if (schema.maxLength !== undefined) rules.push({ type: \"maxLength\", value: `${schema.maxLength}` })\n if (schema.format === \"email\") rules.push({ type: \"email\" })\n if (schema.format === \"uri\") rules.push({ type: \"url\" })\n if (schema.pattern && schema.patternErrorMessage)\n rules.push({ type: \"regExp\", value: `/${schema.pattern}/`, prompt: schema.patternErrorMessage })\n return rules\n }\n\n /** A schema's type, as a form edits it. */\n private static typeOfJSONSchema(schema: JSONSchema): V.ValueType {\n if (schema.enum) return \"choice\"\n const type = Array.isArray(schema.type) ? schema.type.find((each) => each !== \"null\") : schema.type\n switch (type) {\n case \"string\":\n return schema.format === \"date\" || schema.format === \"date-time\" ? \"date\" : \"text\"\n case \"number\":\n case \"integer\":\n return \"number\"\n case \"boolean\":\n return \"boolean\"\n case \"array\":\n return \"list\"\n case \"object\":\n return isObjectSchema(schema) ? \"thing\" : \"data\"\n default:\n return \"data\"\n }\n }\n\n /** `schema` without its \"or nothing\": the first of an `anyOf` that isn't `null`, else itself. */\n private static withoutNull(schema: JSONSchema): JSONSchema {\n return schema.anyOf?.find((each) => each.type !== \"null\") ?? schema\n }\n\n ////////////////\n // ## Guessed from values\n ////////////////\n\n /** The attributes of a JSON block, one per key, guessed from its values. */\n private static attributesOfValues(block: Record<string, unknown>): V.AttributeSpec[] {\n const attributes: V.AttributeSpec[] = []\n for (const [name, value] of Object.entries(block)) {\n if (name.startsWith(\"$\")) continue\n const type = PropertySchemas.typeOfValue(value)\n const spec: Writable<V.AttributeSpec> = { name, kind: KIND_FOR_TYPE[type], type, description: \"\" }\n if (type === \"list\") spec.of = PropertySchemas.typeOfValue((value as unknown[])[0])\n if (type === \"thing\") spec.attributesOf = PropertySchemas.attributesOfValues(value as Record<string, unknown>)\n attributes.push(spec)\n }\n return attributes\n }\n\n /** A value's type, as a form edits it. */\n private static typeOfValue(value: unknown): V.ValueType {\n if (typeof value === \"string\") return \"text\"\n if (typeof value === \"number\") return \"number\"\n if (typeof value === \"boolean\") return \"boolean\"\n if (Array.isArray(value)) return value.length ? \"list\" : \"data\"\n if (value && typeof value === \"object\") return \"thing\"\n return \"data\"\n }\n}\n\n////////////////\n// ## Types and helpers\n////////////////\n\n/**\n * The parts of a JSON Schema `PropertySchemas` reads.\n * - Anything else in it is left alone.\n */\nexport type JSONSchema = {\n type?: string | readonly string[]\n title?: string\n description?: string\n properties?: Record<string, JSONSchema>\n items?: JSONSchema\n enum?: readonly unknown[]\n anyOf?: readonly JSONSchema[]\n format?: string\n minimum?: number\n maximum?: number\n multipleOf?: number\n minLength?: number\n maxLength?: number\n pattern?: string\n /** VS Code's own: what to say when `pattern` fails. */\n patternErrorMessage?: string\n default?: unknown\n /** A fixed value (`\"$type\": { \"const\": \"Person\" }`): read by nothing here. */\n const?: unknown\n}\n\n/** An `AttributeSpec` being built: its fields writable. */\ntype Writable<T> = { -readonly [K in keyof T]: T[K] }\n\n/** Kinds that always take one of a set of values: their own (`size`), or `values`. */\nconst CHOICE_KINDS = new Set<V.AttributeKind>([\"enum\", \"valueOnly\", \"size\", \"color\", \"textAlign\", \"verticalAlign\"])\n\n/** The property-only kind an attribute read from JSON gets, by its value's type. */\nconst KIND_FOR_TYPE: Record<V.ValueType, V.AttributeKind> = {\n text: \"string\",\n number: \"number\",\n boolean: \"boolean\",\n date: \"string\",\n choice: \"enum\",\n icon: \"icon\",\n sides: \"json\",\n list: \"json\",\n thing: \"json\",\n data: \"json\"\n}\n\n/** An object's schema: `properties` to read. */\nfunction isObjectSchema(schema: JSONSchema): boolean {\n return !!schema.properties\n}\n\n/** A default an attribute can hold as it is: text, a number, yes / no. */\nfunction isPlainDefault(value: unknown): value is string | number | boolean {\n return typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\"\n}\n","// the types-only leaf, as `V`: `spell/ui/api` would bring every element (and Solid's JSX) into a node tool's type check\nimport type * as V from \"spell/element/vocabulary.types\"\nimport { kebabCase } from \"spell/ui/util\"\nimport { PropertySchemas } from \"./PropertySchemas\"\n\n/****************\n * ### `PropertyEditorPages`\n * EDITOR PAGES: a property editor's layout saved as a file of plain markup, `Card.editor.html`,\n * which `<ui-property-editor source>` loads as it is (epic `property-editor` P6).\n *\n * ```html\n * <ui-property-editor schema=\"Card\" label=\"Card\">\n * <ui-property name=\"rank\" as=\"buttons\"></ui-property>\n * <ui-property-group label=\"Other\">\n * <ui-property name=\"direction\"></ui-property>\n * </ui-property-group>\n * </ui-property-editor>\n * ```\n *\n * - `write()`: a schema's default page, one property per attribute, in order.\n * - `check()`: what's wrong with a page, against its schema as it is now.\n * - a property the page names that the schema dropped\n * - an attribute of the schema the page doesn't name\n * - a control (`as`) that no longer fits its type (`select` for a value that has no choices any more)\n * - `compile()`: the page as ONE javascript module defining `<card-editor>` (epic `property-editor` P7).\n * - Its layout and schema are inlined, so it needs Spell UI's property editor and nothing else:\n * no page loading, no spell parser.\n * - `spell compile` writes it beside a program's own output, `Card.editor.js`.\n * - `fix()`: the page put right:\n * - dropped properties taken away\n * - new ones added to an \"Other\" group\n * - a control that no longer fits back to its type's own\n * - DOM only, no Solid and no runtime: a browser's DOM, or linkedom's under node (`spell lint`).\n * - STATIC and instance-free: it keeps nothing between calls.\n ****************/\nexport class PropertyEditorPages {\n /** The text of `schema`'s default page: its editor, with one `<ui-property>` per attribute. */\n static write(schema: V.PropertySchema, document: Document): string {\n const editor = document.createElement(EDITOR_TAG)\n editor.setAttribute(\"schema\", schema.name)\n editor.setAttribute(\"label\", schema.label ?? schema.name)\n for (const spec of schema.attributes) editor.append(PropertyEditorPages.property(document, spec.name))\n return PropertyEditorPages.text(editor)\n }\n\n /** The editor in a page's markup: its `<ui-property-editor>`, else `undefined`. */\n static editorIn(root: ParentNode): Element | undefined {\n return root.querySelector(EDITOR_TAG) ?? undefined\n }\n\n /** What's wrong with the page whose editor is `editor`, against `schema`; `[]` when nothing is. */\n static check(editor: Element, schema: V.PropertySchema): PageProblem[] {\n const problems: PageProblem[] = []\n const named = new Set<string>()\n for (const property of editor.querySelectorAll(PROPERTY_TAG)) {\n const name = property.getAttribute(\"name\") ?? \"\"\n named.add(name.split(\".\")[0]!)\n const spec = PropertyEditorPages.specFor(schema, name)\n if (!spec) {\n problems.push({ kind: \"dropped\", name, message: `${schema.name} has no \\`${name}\\` any more` })\n continue\n }\n const kind = property.getAttribute(\"as\")\n if (kind && !PropertyEditorPages.fits(kind, spec)) {\n const type = PropertySchemas.typeOf(spec)\n problems.push({ kind: \"control\", name, message: `\\`as=\"${kind}\"\\` doesn't fit \\`${name}\\`, a ${type}` })\n }\n }\n for (const spec of schema.attributes) {\n if (named.has(spec.name)) continue\n problems.push({\n kind: \"missing\",\n name: spec.name,\n message: `${schema.name}'s \\`${spec.name}\\` isn't on the page`\n })\n }\n return problems\n }\n\n /**\n * Put the page whose editor is `editor` right, against `schema` (see the class doc); returns what it did.\n * - SIDE EFFECT: changes `editor` and what's in it.\n * `text()` writes it back.\n */\n static fix(editor: Element, schema: V.PropertySchema): PageProblem[] {\n const problems = PropertyEditorPages.check(editor, schema)\n const document = editor.ownerDocument\n for (const problem of problems) {\n const property = editor.querySelector(`${PROPERTY_TAG}[name=\"${problem.name}\"]`)\n if (problem.kind === \"dropped\") property?.remove()\n else if (problem.kind === \"control\") property?.removeAttribute(\"as\")\n else PropertyEditorPages.otherGroup(editor).append(PropertyEditorPages.property(document, problem.name))\n }\n return problems\n }\n\n /**\n * An editor's markup as a page's text: its start tag, then each child on its own lines, two spaces in.\n * - Built from the elements (`outerHTML`), not from strings.\n * - Every element with elements inside it (a group) is on lines of its own, each a level further in.\n */\n static text(editor: Element): string {\n return `${PropertyEditorPages.lines(editor, 0).join(\"\\n\")}\\n`\n }\n\n /**\n * The page whose editor is `editor`, compiled for `schema`: a javascript module defining `<card-editor>`.\n * - Its tag comes from the schema's name (`Card`'s).\n * - Returns the tag, its class's name and the module's text.\n * - The element draws a `<ui-property-editor>` in its light DOM, with:\n * - the page's editor's attributes (its own win)\n * - the schema, and the page's layout\n * - `value`, `save()`, `cancel()` and `validate()` reach it\n * - `uiModule`: what it imports for Spell UI's property editor.\n * A page that has it already passes another.\n * - Code made as text (as spell compiles programs), from the page's own markup (`text()`).\n */\n static compile(\n editor: Element,\n schema: V.PropertySchema,\n { uiModule = UI_MODULE }: CompileOptions = {}\n ): CompiledPage {\n const tag = `${kebabCase(schema.name).replace(/^-/, \"\")}-editor`\n const className = `${schema.name.replace(/\\W/g, \"\")}Editor`\n const attributes = Object.fromEntries(\n [...editor.attributes].filter(({ name }) => !NOT_COMPILED.has(name)).map(({ name, value }) => [name, value])\n )\n const layout = [...editor.children].map((child) => PropertyEditorPages.lines(child, 0).join(\"\\n\")).join(\"\\n\")\n const lines = [\n `// ${schema.name}'s property editor, <${tag}>: made by \\`spell compile\\` from its page (epic \\`property-editor\\` P7).`,\n `// NEVER edit: edit the page, then compile.`,\n `import ${JSON.stringify(uiModule)}`,\n ``,\n `/** ${schema.name}'s properties. */`,\n `const SCHEMA = ${JSON.stringify(schema, null, 2)}`,\n ``,\n `/** The page's editor's attributes: the element's own win. */`,\n `const ATTRIBUTES = ${JSON.stringify(attributes)}`,\n ``,\n `/** The page's layout: its groups and properties. */`,\n `const LAYOUT = ${JSON.stringify(layout)}`,\n ``,\n `/** <${tag}>: ${schema.name}'s property editor, as its page lays it out. */`,\n `export class ${className} extends HTMLElement {`,\n ` connectedCallback() {`,\n ` if (this.editor) return`,\n ` const editor = document.createElement(\"ui-property-editor\")`,\n ` for (const [name, value] of Object.entries(ATTRIBUTES)) editor.setAttribute(name, value)`,\n ` for (const { name, value } of this.attributes) editor.setAttribute(name, value)`,\n ` editor.schema = SCHEMA`,\n ` const template = document.createElement(\"template\")`,\n ` template.innerHTML = LAYOUT`,\n ` editor.append(template.content)`,\n ` if (this.pendingValue !== undefined) editor.value = this.pendingValue`,\n ` this.editor = editor`,\n ` this.append(editor)`,\n ` }`,\n ``,\n ` /** The thing it edits, or a list of things: its editor's. */`,\n ` get value() {`,\n ` return this.editor ? this.editor.value : this.pendingValue`,\n ` }`,\n ` set value(value) {`,\n ` if (this.editor) this.editor.value = value`,\n ` else this.pendingValue = value`,\n ` }`,\n ``,\n ` /** Its editor's \\`save()\\`, \\`cancel()\\` and \\`validate()\\`. */`,\n ` save() {`,\n ` return this.editor?.save() ?? false`,\n ` }`,\n ` cancel() {`,\n ` return this.editor?.cancel() ?? false`,\n ` }`,\n ` validate() {`,\n ` return this.editor?.validate() ?? true`,\n ` }`,\n `}`,\n ``,\n `if (!customElements.get(${JSON.stringify(tag)})) customElements.define(${JSON.stringify(tag)}, ${className})`,\n ``\n ]\n return { tag, className, text: lines.join(\"\\n\") }\n }\n\n ////////////////\n // ## Helpers\n ////////////////\n\n /** A `<ui-property name>`. */\n private static property(document: Document, name: string): Element {\n const property = document.createElement(PROPERTY_TAG)\n property.setAttribute(\"name\", name)\n return property\n }\n\n /** The page's \"Other\" group (`data-other`), made at the end if it has none. */\n private static otherGroup(editor: Element): Element {\n const found = editor.querySelector(`${GROUP_TAG}[${OTHER_ATTRIBUTE}]`)\n if (found) return found\n const group = editor.ownerDocument.createElement(GROUP_TAG)\n group.setAttribute(\"label\", OTHER)\n group.setAttribute(OTHER_ATTRIBUTE, \"\")\n editor.append(group)\n return group\n }\n\n /** What `schema` says of `name`; a dotted name reaches into a nested thing's attributes. */\n private static specFor(schema: V.PropertySchema, name: string): V.AttributeSpec | undefined {\n let attributes: readonly V.AttributeSpec[] | undefined = schema.attributes\n let spec: V.AttributeSpec | undefined\n for (const key of name.split(\".\")) {\n spec = attributes?.find((candidate) => candidate.name === key)\n attributes = spec?.attributesOf\n }\n return spec\n }\n\n /** Control kind `kind` fits `spec`: a kind made for some types takes only those; any other kind fits. */\n private static fits(kind: string, spec: V.AttributeSpec): boolean {\n const types = KIND_TYPES[kind]\n if (!types) return true\n const type = PropertySchemas.typeOf(spec)\n if (types.includes(type)) return true\n return type === LIST && !!(spec.values ?? spec.choicesFrom) && kind === CHOICE_LIST_KIND\n }\n\n /**\n * `element`'s lines, `depth` levels in:\n * - one line when it has no element inside it (a property, a button)\n * - else its start tag, each child a level further in, and its end tag\n */\n private static lines(element: Element, depth: number): string[] {\n const indent = INDENT.repeat(depth)\n if (!element.children.length) return [`${indent}${element.outerHTML}`]\n const empty = (element.cloneNode(false) as Element).outerHTML\n const end = `</${element.localName}>`\n const children = [...element.children].flatMap((child) => PropertyEditorPages.lines(child, depth + 1))\n return [`${indent}${empty.slice(0, -end.length)}`, ...children, `${indent}${end}`]\n }\n}\n\n/** What `compile()` takes. */\nexport type CompileOptions = {\n /** What the module imports for Spell UI's property editor; default `spell/ui/ui-property-editor`. */\n uiModule?: string\n}\n\n/** A page compiled: its element's tag and class, and the module's text. */\nexport type CompiledPage = {\n /** `card-editor`. */\n tag: string\n /** `CardEditor`. */\n className: string\n /** The javascript module. */\n text: string\n}\n\n/** One thing wrong with a page. */\nexport type PageProblem = {\n /**\n * What kind of wrong:\n * - `dropped`: the schema has no such property\n * - `missing`: the page doesn't name one\n * - `control`: `as` doesn't fit\n */\n kind: \"dropped\" | \"missing\" | \"control\"\n /** The property. */\n name: string\n /** What's wrong, in words. */\n message: string\n}\n\n/** The family's tags. */\nconst EDITOR_TAG = \"ui-property-editor\"\nconst GROUP_TAG = \"ui-property-group\"\nconst PROPERTY_TAG = \"ui-property\"\n\n/** The group `fix()` adds new properties to, and its marker. */\nconst OTHER = \"Other\"\nconst OTHER_ATTRIBUTE = \"data-other\"\n\n/** A list's type. */\nconst LIST = \"list\"\n\n/** The app's kind for picking several choices: it fits a list with choices. */\nconst CHOICE_LIST_KIND = \"choices\"\n\n/** Built-in control kinds that only fit some value types (any other kind fits any). */\nconst KIND_TYPES: Record<string, readonly V.ValueType[]> = {\n number: [\"number\"],\n range: [\"number\", \"choice\"],\n select: [\"choice\"],\n buttons: [\"choice\"],\n checkbox: [\"boolean\"],\n toggle: [\"boolean\"],\n date: [\"date\"],\n icon: [\"icon\", \"text\"],\n editor: [\"thing\"]\n}\n\n/** What a compiled page imports for Spell UI's property editor, by default. */\nconst UI_MODULE = \"spell/ui/ui-property-editor\"\n\n/** A page's editor's attributes a compiled page leaves out: the schema is inlined, and nothing is loaded. */\nconst NOT_COMPILED = new Set([\"schema\", \"source\", \"select\"])\n\n/** One level of a page's indent. */\nconst INDENT = \" \"\n","/**\n * The `ui-property-editor` family's shared pieces: what its three vocabularies and components share.\n * - Pure data, at the bottom of the folder's imports (`import type` only): node loads it (`yarn site:data`).\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/**\n * What an element PASSES THROUGH from the element it's built on:\n * a vocabulary's names, minus `skip`'s and those `own` names already.\n * - The editor passes through `<ui-section>`'s and `<ui-form>`'s; the group, `<ui-section>`'s.\n * - Its own come first, in their order; then each base's, in theirs.\n */\nexport function passThrough<T extends { name?: string; key?: string }>(\n own: readonly T[],\n bases: readonly (readonly T[])[],\n skip: readonly string[] = []\n): T[] {\n const taken = new Set([...own.map(nameOf), ...skip])\n const names: T[] = [...own]\n for (const base of bases) {\n for (const item of base) {\n if (taken.has(nameOf(item))) continue\n taken.add(nameOf(item))\n names.push(item)\n }\n }\n return names\n}\n\n/** An attribute's, event's, slot's, part's or state's `name`, or a text's `key`. */\nfunction nameOf(item: { name?: string; key?: string }): string {\n return item.name ?? item.key ?? \"\"\n}\n\n/** A vocabulary item list, as the vocabularies here build them. */\nexport type Names<K extends keyof E.ComponentVocabulary> = E.ComponentVocabulary[K]\n\n/**\n * Where a property's value comes from, as whoever holds the thing knows it: `<ui-property-editor origins>`.\n * - `kind`:\n * - `\"here\"`: set on this thing: a dot by its label, its value bold under `show-defaults`\n * - `\"inherited\"`: it comes from somewhere else, e.g. its type: a quieter label\n * - `\"worked out\"`: read only\n * - `\"data\"`: it's kept in a place outside the program, a back-end: a mark by its label (`mark`)\n * - `from`: the label's tooltip, saying where in words: \"From Card\"\n * - `action`: a small button at the row's end, which only says it was pressed (`ui-reset`, `ui-show-code`)\n * - `mark`: a few words shown at the row's end, saying where in short: \"Real data · family cookbook\"\n * - `readonly`: it can't be changed here, whatever its kind: `from` says why\n */\nexport type PropertyOrigin = {\n /** Where it comes from. */\n kind: \"here\" | \"inherited\" | \"worked out\" | \"data\"\n /** Where, in words. */\n from?: string\n /** The button it offers. */\n action?: \"reset\" | \"show code\"\n /** Where, in a few words, shown at the row's end: its button, when it offers one. */\n mark?: string\n /** Read only, whatever its kind. */\n readonly?: boolean\n}\n\n/**\n * Writes a property's value to its thing in place of the plain set: `<ui-property-editor writer>`.\n * - Answers whether it took the write: `false`, the editor sets the property itself.\n */\nexport type PropertyWriter = (write: { thing: object; name: string; value: unknown }) => boolean\n\n/** The tags of the family, for making one: `document.createElement(PROPERTY_TAG)`. */\nexport const EDITOR_TAG = \"ui-property-editor\"\nexport const GROUP_TAG = \"ui-property-group\"\nexport const PROPERTY_TAG = \"ui-property\"\n\n/**\n * Selectors for the family's elements, for `closest()` and `querySelectorAll()`:\n * the custom state each always carries, as `<ui-field>` carries `:state(field)`.\n * - So they find the elements whatever a translation calls their tags, e.g. `<es-editor-propiedades>`.\n * - Only once an element is drawn: before that, a property finds its editor by what it is (`UIProperty`).\n */\nexport const EDITOR_SELECTOR = \":state(property-editor)\"\nexport const GROUP_SELECTOR = \":state(property-group)\"\nexport const PROPERTY_SELECTOR = \":state(property)\"\n\n/** Marks what an editor or a property added to its own light DOM, so it can take it away again. */\nexport const MADE_ATTRIBUTE = \"data-ui-made\"\n\n/** `MADE_ATTRIBUTE`'s values on what an editor added: from its schema (empty, `\"\"`), or from its source page. */\nexport const MADE_FROM = { schema: \"\", source: \"source\" } as const\n\n/**\n * On a nested editor a property made (`as=\"editor\"`): the property, whose value (a thing) it edits.\n * - Read from the editor or row around it, as the outer form's binding would.\n */\nexport const VALUE_FROM_ATTRIBUTE = \"data-value-from\"\n","/**\n * The English vocabulary of `<ui-property>`: every name the tag uses.\n * - Its own names first, then `<ui-field>`'s, which it PASSES THROUGH (it is one), where they mean the same.\n * - The shape is `E.ComponentVocabulary`. Pure data.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport { fieldVocabulary } from \"spell/ui/components/ui-form/UIField.en\"\nimport { passThrough } from \"./UIPropertyEditor.types\"\n\n/****************\n * ### `propertyVocabulary`\n * The names of `<ui-property>`: one property of the thing a `<ui-property-editor>` edits,\n * drawn as a `<ui-field>` with the control its schema calls for.\n ****************/\nexport const propertyVocabulary = {\n ...fieldVocabulary,\n tag: \"ui-property\",\n icon: \"sliders horizontal\",\n topics: [\"forms\", \"inputs\"],\n aka: [\"property\", \"inspector row\", \"setting\", \"schema field\"],\n description:\n \"A property is one field of a property editor: its label, tip, choices and rules come from the editor's schema.\",\n attributes: passThrough<E.AttributeSpec>(\n [\n {\n name: \"name\",\n group: \"name\",\n kind: \"string\",\n description: \"The property it edits; a dotted path reaches into a nested thing (`font.size`). Required.\"\n },\n {\n name: \"as\",\n group: \"appearance\",\n kind: \"string\",\n description:\n \"Which control (a kind `UI.propertyControls` knows): `input`, `text`, `number`, `date`, `select`, \" +\n \"`buttons` (a segmented row), `radios`, `range`, `checkbox`, `toggle`, `color`, `sides`, `editor`, or one a \" +\n \"page added. None: the default for its type; four or fewer choices, all with icons: `buttons`.\"\n },\n {\n name: \"default\",\n group: \"form\",\n kind: \"string\",\n description:\n \"Its value when nothing's been set, if the schema doesn't say: a value other than it shows \" +\n \"`:state(set)`, bold under the editor's `show-defaults`.\"\n },\n {\n name: \"options\",\n group: \"form\",\n kind: \"string\",\n description:\n \"Where its choices come from, when not the schema's: a source the page added \" +\n \"(`UI.propertyControls.addChoices()`), or a list, `a, b, c`.\"\n }\n ] as const satisfies readonly E.AttributeSpec[],\n [fieldVocabulary.attributes]\n ),\n events: [\n {\n name: \"ui-changed\",\n detail: \"{ name: string, value: unknown }\",\n description: 'Its property was written (on Save, with `apply=\"on save\"`).'\n },\n {\n name: \"ui-reset\",\n detail: \"{ name: string }\",\n description: \"Its reset button was pressed (its editor's `origins`).\"\n },\n {\n name: \"ui-show-code\",\n detail: \"{ name: string }\",\n description: \"Its code button was pressed (its editor's `origins`).\"\n }\n ],\n parts: passThrough<E.PartSpec>(\n [\n { name: \"origin\", description: \"The small button its value's origin offers.\" }\n ] as const satisfies readonly E.PartSpec[],\n [fieldVocabulary.parts]\n ),\n slots: passThrough<E.SlotSpec>(\n [\n { name: \"\", description: \"Your own control, instead of the one it makes; or nothing.\" }\n ] as const satisfies readonly E.SlotSpec[],\n [fieldVocabulary.slots]\n ),\n states: passThrough<E.StateSpec>(\n [\n { name: \"changed\", description: 'Its edit is held, not saved yet (`apply=\"on save\"`).' },\n { name: \"buttons\", description: 'Its control is a row of radios, one each (`as=\"radios\"`).' },\n { name: \"compact\", description: \"Its editor is `compact`.\" },\n { name: \"show-defaults\", description: \"Its editor bolds a value other than its default (`show-defaults`).\" },\n {\n name: \"half\",\n description: \"Half a row on its editor's grid: its kind's width (a number, a select), or its `width`.\"\n },\n { name: \"inline-check\", description: \"A yes or no in a compact editor: the box, then its label, on one line.\" },\n { name: \"here\", description: \"Its value is set on this thing (its editor's `origins`): a dot by its label.\" },\n {\n name: \"inherited\",\n description: \"Its value comes from somewhere else (its editor's `origins`): a quieter label.\"\n },\n {\n name: \"data\",\n description:\n \"Its value is kept in a place outside the program, a back-end (its editor's `origins`): a mark by its label.\"\n },\n { name: \"set\", description: \"Its value isn't its default (`default`, else the schema's; none: any value).\" },\n { name: \"flags\", description: \"It heads a run of yes-or-no properties, drawn as one select of pills.\" },\n { name: \"flag\", description: \"It's in a run another property heads: hidden, its pill in that one's select.\" }\n ] as const satisfies readonly E.StateSpec[],\n [fieldVocabulary.states]\n ),\n texts: passThrough<E.TextSpec>(\n [\n { key: \"reset\", text: \"Reset {label}\", description: \"The reset button's name.\" },\n { key: \"showCode\", text: \"Show the code for {label}\", description: \"The code button's name.\" },\n {\n key: \"flags\",\n text: \"Options\",\n description: \"The label of a run of yes-or-no properties drawn as one select of pills.\"\n }\n ] as const satisfies readonly E.TextSpec[],\n [fieldVocabulary.texts]\n )\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-property>`'s own look, adopted after the field's (`UIForm.css`, `UIField.css`).\n * - A property's radios (`as=\"radios\"`, `:state(buttons)`) sit in a row that wraps, spaced.\n * - On its editor's grid (`:state(grid)` there; epic `debut` P31): a whole row, or one column while\n * `:state(half)`. `grid-column` is ignored outside a grid, so it needs no state of its own.\n * - Below about 18em of form, everything takes a whole row (the form root is the `ui-form` container).\n * - On a grid its width is the cell's (`--_property-editor-field-width`, set by the grid), not its `N wide`.\n * - `:state(inline-check)`: a compact editor's yes or no, the box then its label then its tip, on one line.\n * - `:state(set)` under `:state(show-defaults)`: its value bold, through the owner token every control reads\n * (`InputOwnerTokens.weight`).\n * - Where its value comes from (`PropertyOrigin`): `:state(here)`, a dot before its label; `:state(inherited)`,\n * a quieter label; `.origin`, its small button at the row's end: a reset only while it's hovered or focused.\n * - `:state(data)`, kept in a place outside the program: a square before its label, and `.origin.mark`, its few words.\n * - A run of yes-or-no properties (`FlagRun`): the one heading it shows only its pills' select; the rest hide.\n */\n\n@layer ui.components.property.content, ui.components.property.states;\n\n@layer ui.components.property.content {\n :host(:state(buttons)) .field > .control {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 0.5em 1.25em;\n }\n\n /* ## On the editor's grid */\n .field {\n grid-column: 1 / -1;\n width: var(--_property-editor-field-width, var(--_field-width, var(--_ui-fields-child-width, auto)));\n }\n :host(:state(half)) .field {\n grid-column: span 1;\n }\n @container ui-form (width < 18em) {\n :host(:state(half)) .field {\n grid-column: 1 / -1;\n }\n }\n}\n\n@layer ui.components.property.states {\n /* ## A compact editor's yes or no: \"[x] Label (i)\" */\n :host(:state(inline-check)) .inline.field:has(> .row) {\n flex-wrap: nowrap;\n column-gap: 0.5em;\n }\n :host(:state(inline-check)) .inline.field > .control {\n order: -1;\n flex: 0 0 auto;\n /* the box keeps no room for text of its own: its label is the field's, beside it */\n --ui-checkbox-label-distance: 0;\n }\n :host(:state(inline-check)) .inline.field > .row > .label {\n cursor: var(--ui-control-cursor);\n }\n\n /* ## Compact: the tip's icon at the text's size */\n :host(:state(compact)) .field > .row > .info {\n width: 12px;\n height: 12px;\n }\n\n /* ## A value other than its default, bold */\n :host(:state(set):state(show-defaults)) .field {\n --_ui-input-owner-weight: var(--ui-font-weight-bold, 700);\n }\n\n /* ## Where its value comes from */\n :host(:state(here)) .field > .row > .label::before {\n content: \"\";\n display: inline-block;\n width: 0.45em;\n height: 0.45em;\n margin-inline-end: 0.35em;\n vertical-align: 0.12em;\n border-radius: 50%;\n background: var(--ui-primary, currentColor);\n }\n :host(:state(inherited)) .field > .row > .label {\n color: var(--ui-text-muted);\n font-weight: var(--ui-font-weight-normal, 400);\n }\n .field > .row > .origin {\n display: inline-flex;\n align-items: center;\n flex: none;\n margin-inline-start: auto;\n padding: 0 0.15em;\n border: 0;\n background: none;\n color: var(--ui-text-muted);\n font-size: 0.85em;\n line-height: 1;\n cursor: var(--ui-control-cursor);\n }\n .field > .row > .origin > svg {\n display: block;\n width: 1em;\n height: 1em;\n }\n .field > .row > .origin:hover {\n color: var(--ui-text);\n }\n /* a value kept in a place outside the program: its mark says where, in short */\n :host(:state(data)) .field > .row > .label::before {\n content: \"\";\n display: inline-block;\n width: 0.45em;\n height: 0.45em;\n margin-inline-end: 0.35em;\n vertical-align: 0.12em;\n border-radius: 0.1em;\n background: var(--ui-warning, currentColor);\n }\n /* the label keeps its room: the mark gives way first */\n .field > .row:has(> .origin.mark) > .label {\n flex-shrink: 0;\n white-space: nowrap;\n }\n .field > .row > .origin.mark {\n flex: 0 100 auto;\n max-width: 60%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0.1em 0.4em;\n border-radius: 0.6em;\n background: var(--ui-surface-muted);\n }\n .field > .row > .origin.reset {\n opacity: 0;\n }\n :host(:hover) .field > .row > .origin.reset,\n .field > .row > .origin.reset:focus-visible {\n opacity: 1;\n }\n\n /* ## A run of yes-or-no properties, as pills */\n :host(:state(flag)) {\n display: none;\n }\n :host(:state(flags)) .field > .control > slot::slotted(:not([data-ui-made=\"flags\"])) {\n display: none;\n }\n}\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E, UI } from \"spell/ui/core\"\n// the family barrel, not the leaf: the lib build then imports `ui-form.js` instead of splitting a shared chunk\n// (SIDE EFFECT: defines the form family: a property is a field, in a form)\nimport { DOMFieldElement, FormFields, UIField } from \"spell/ui/components/ui-form\"\nimport type { fieldVocabulary } from \"spell/ui/components/ui-form/UIField.en\"\nimport { PropertySchemas } from \"spell/ui/property\"\nimport type { AttributeSpec, PropertySchema, ValueType } from \"spell/ui/vocabulary\"\nimport type { Choice, PropertyControl } from \"spell/ui/runtime\"\nimport { propertyVocabulary } from \"./UIProperty.en\"\nimport {\n EDITOR_SELECTOR,\n EDITOR_TAG,\n GROUP_SELECTOR,\n GROUP_TAG,\n MADE_ATTRIBUTE,\n VALUE_FROM_ATTRIBUTE,\n type PropertyOrigin\n} from \"./UIPropertyEditor.types\"\n\nimport propertyCSS from \"./UIProperty.css?inline\"\n\n/****************\n * ### `DOMPropertyElement`\n * The DOM element of `<ui-property>`: a field's (`showErrors()`, `errors`), plus what its editor reads of it.\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMPropertyElement extends DOMFieldElement {\n /**\n * The schema's rules for it: its `rules`, and `min` / `max` / `pattern` as rules.\n * - `<ui-form>` adds them to the form's.\n */\n @E.untracked\n get schemaRules(): readonly E.ValidationRule[] | undefined {\n return (this.component as UIProperty | undefined)?.schemaRules\n }\n\n /** Show it as holding an edit not saved yet (`:state(changed)`); the editor says. */\n markChanged(isChanged: boolean) {\n const component = this.component as UIProperty | undefined\n if (component) component.isChanged = isChanged\n }\n\n /** Its form showed a value in its control (`FormBinding`): `:state(set)` reads it again. */\n valueShown() {\n ;(this.component as UIProperty | undefined)?.noteValueChanged()\n }\n}\n\n/**\n * The attributes a control's value shows in, as a page sets them: `@E.watches` follows them.\n * - Above the class: `@E.watches` reads it while the class is defined.\n */\nconst VALUE_ATTRIBUTES = [\"value\", \"selected\", \"checked\"]\n\n/**\n * The same run, property by property (or both none): a property's `flagRun` doesn't change for an equal one.\n * - Above the class: `@state({ equals })` reads it while the class is defined.\n */\nfunction isSameRun(a: readonly unknown[] | undefined, b: readonly unknown[] | undefined): boolean {\n return a === b || (!!a && !!b && a.length === b.length && a.every((each, index) => each === b[index]))\n}\n\n/****************\n * ### `UIProperty`\n * The component behind `<ui-property>`: one property of the thing its `<ui-property-editor>` edits.\n *\n * - It IS a `<ui-field>` (it extends `UIField`):\n * the label row, the tip, the hint, the error lines, `apply`, `mixed`, `rules`.\n * `<ui-form>` finds it as a field (`:state(field)`) and binds its control.\n * - What it knows of its property comes from the editor's SCHEMA (`spec`), found by `name`\n * (a dotted name reaches into a nested thing's attributes):\n * - the label (`labelOf()`: its own, else made from the name) and the tip, unless the field's own say otherwise\n * - its value's type, so its default control (`UI.propertyControls.kindFor()`)\n * - its choices (`values`, a `choicesFrom` source), limits and rules\n * - Its CONTROL: one it holds already (the author's),\n * else one it MAKES, of the kind `as` says (else the type's kind),\n * and adds to its own light DOM, as `<ui-repeat>` adds rows.\n * - Made with `name` = the property's name, so the editor's form binds it.\n * - Its choices go in as the control's children.\n * - Made again when the kind or the choices change; taken away when the author adds their own.\n * - SIDE EFFECT: adds and removes elements in its light DOM, marked `data-ui-made`.\n * - `readonly` nests: its own, or a `readonly` group or editor around it, makes the control readonly.\n * - `:state(changed)`: its edit is held, not saved yet (the editor says, `markChanged()`).\n * - Its look in its editor (epic `debut` P31):\n * - `:state(half)`: half a row on the editor's grid, by its control's kind (a number, a select) or its `width`\n * - in a `compact` editor (`:state(compact)`): a yes or no on one line, the box then its label; its hint at the\n * label row's end\n * - `:state(set)`: its value isn't its default (`default`, else the schema's); bold under `show-defaults`\n * - where its value comes from, when its editor says (`PropertyOrigin`): `:state(here)`, a dot by its label;\n * `:state(inherited)`, a quieter label; `worked out`, read only; its label's tooltip says where, and a small\n * button at the row's end says it was pressed (`ui-reset`, `ui-show-code`)\n * - `data`: kept in a place outside the program, `:state(data)`; its `mark` at the row's end says where in short,\n * and is its button when it offers one; an origin's `readonly` makes it read only, whatever its kind\n * - a run of three or more yes-or-no properties in one group is ONE select of pills (`FlagRun`):\n * the first draws it (`:state(flags)`), the rest hide (`:state(flag)`), each still its own property\n * - choices carry their icons (`ValueSets.iconsFor()`), a hue its colour's chip; four or fewer, all with\n * icons, draw as a segmented row of icons (`buttons`)\n ****************/\nexport class UIProperty extends UIField {\n // the field's names under the property's tag, and its own: TypeScript only knows the field's literals\n @E.proto static vocabulary = propertyVocabulary as unknown as typeof fieldVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { ...UIField.prototype.elementSetup.styleSheets, property: propertyCSS },\n DOMElement: DOMPropertyElement\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## Its own attributes\n ////////////////\n\n /** The property it edits: `name`. */\n get propertyName(): string {\n return this.attributes.name ?? \"\"\n }\n\n /** The control kind it was asked for: `as`. */\n get requestedKind(): string | undefined {\n return this.attributes.as ?? undefined\n }\n\n /** Where its choices come from, when not the schema's: `options`. */\n get optionsText(): string | undefined {\n return this.attributes.options ?? undefined\n }\n\n ////////////////\n // ## The editor and the schema\n ////////////////\n\n /** The `<ui-property-editor>` around it, while connected. */\n @E.state accessor editor: DOMEditorLike | undefined = undefined\n\n /**\n * Find the editor (and a `readonly` group or editor) on connect.\n * - The editor by what it is, the nearest element around us with a schema:\n * so a translated one is found too (`<es-editor-propiedades>`), before its state is drawn.\n */\n @E.whileConnected\n protected watchEditor() {\n this.editor = UIProperty.editorAround(this.domElement)\n const readonly = [GROUP_TAG, EDITOR_TAG].map((tag) => `${tag}[readonly]`)\n readonly.push(`${GROUP_SELECTOR}:state(readonly)`, `${EDITOR_SELECTOR}:state(readonly)`)\n this.isInReadonly = !!this.domElement.parentElement?.closest(readonly.join(\", \"))\n return () => {\n this.editor = undefined\n }\n }\n\n /** Why a change here can't be saved: its own `unsaved`, else its editor's. */\n get unsavedText(): string | undefined {\n return this.unsaved || (this.editor as { unsaved?: string } | undefined)?.unsaved || undefined\n }\n\n /** What the schema says of its property, if the editor has a schema that names it. */\n get spec(): AttributeSpec | undefined {\n const schema = this.editor?.currentSchema\n return schema ? UIProperty.specFor(schema, this.propertyName) : undefined\n }\n\n /** Its label: its own (`ownLabel`); \"Options\" while it heads a run of pills. */\n get labelText(): string | undefined {\n return this.flagRun ? this.translationForKey(FLAGS_TEXT) : this.ownLabel\n }\n\n /** Its own label: the field's `label`, else the schema's (or one made from its name). */\n get ownLabel(): string | undefined {\n if (this.label) return this.label\n const spec = this.spec\n return spec ? PropertySchemas.labelOf(spec) : this.propertyName && PropertySchemas.labelOf(NAMED(this.propertyName))\n }\n\n /** Its tip: the field's own `description`, else the schema's `tip`; the pills' row has none of its own. */\n get descriptionText(): string | undefined {\n if (this.flagRun) return undefined\n return this.description ?? this.spec?.tip\n }\n\n /** Its hint: the field's own `hint`, else the schema's. */\n get hintText(): string | undefined {\n if (this.flagRun) return undefined\n return this.hint ?? this.spec?.hint\n }\n\n /** In a compact editor, its hint sits at the label row's end. */\n get hasHintInRow(): boolean {\n return this.isCompact\n }\n\n /** Its value's type, as a form edits it: the schema's, else `text`. */\n get valueType(): ValueType {\n const spec = this.spec\n return spec ? PropertySchemas.typeOf(spec) : TEXT\n }\n\n /**\n * The schema's rules for it, as `<ui-form>` rules: its `rules`, then its pattern.\n * - A rule may be an object with its own words, as a spell type's are: `{ type: \"empty\", prompt: \"Name it\" }`.\n */\n get schemaRules(): readonly E.ValidationRule[] | undefined {\n const spec = this.spec\n if (!spec) return undefined\n const rules: E.ValidationRule[] =\n spec.rules === undefined ? [] : typeof spec.rules === \"string\" ? [spec.rules] : [...spec.rules]\n if (spec.pattern) rules.push(`regExp[/${spec.pattern}/]`)\n return rules.length ? rules : undefined\n }\n\n ////////////////\n // ## Readonly and changed\n ////////////////\n\n /** A `readonly` group or editor is around it. */\n @E.state accessor isInReadonly = false\n\n /** `:state(readonly)`: its own `readonly`, or a group's or the editor's. */\n /** Always `:state(property)`: how its family finds it, whatever its tag is called (`PROPERTY_SELECTOR`). */\n @E.cssState(\"property\")\n get isProperty(): boolean {\n return true\n }\n\n @E.cssState(\"readonly\")\n get isReadOnly(): boolean {\n return !!this.readonly || this.isInReadonly || this.origin?.kind === WORKED_OUT || !!this.origin?.readonly\n }\n\n ////////////////\n // ## Where its value comes from\n ////////////////\n\n /** Where its editor says its value comes from; `undefined` when it doesn't say. */\n get origin(): PropertyOrigin | undefined {\n return this.editor?.currentOrigins?.[this.propertyName]\n }\n\n /** `:state(here)`: its value is set on this thing. */\n @E.cssState(\"here\")\n get isSetHere(): boolean {\n return this.origin?.kind === \"here\"\n }\n\n /** `:state(inherited)`: its value comes from somewhere else. */\n @E.cssState(\"inherited\")\n get isInherited(): boolean {\n return this.origin?.kind === \"inherited\"\n }\n\n /** `:state(data)`: its value is kept in a place outside the program, a back-end. */\n @E.cssState(\"data\")\n get isData(): boolean {\n return this.origin?.kind === \"data\"\n }\n\n /** The label's tooltip says where. */\n get labelTitle(): string | undefined {\n return this.origin?.from\n }\n\n /** Glyph of the button its origin offers. */\n private readonly originGlyph = new E.IconGlyph({\n owner: this,\n name: () => (this.origin?.action ? ORIGIN_ACTIONS[this.origin.action].icon : undefined)\n })\n\n /** What its origin shows at the row's end: its `mark`, else the small button it offers. */\n protected rowEnd(): JSX.Element {\n return (\n <Show when={!this.origin?.mark} fallback={this.originMark()}>\n {this.originButton()}\n </Show>\n )\n }\n\n /** Its origin's `mark`, at the row's end: its button, when it offers one, else plain words. */\n private originMark(): JSX.Element {\n const action = () => this.origin?.action\n return (\n <Show\n when={action()}\n fallback={\n <span class=\"origin mark\" part={this.partForName(\"origin\" as never)} title={this.origin?.from}>\n {this.origin?.mark}\n </span>\n }\n >\n {(pressed) => (\n <button\n type=\"button\"\n class=\"origin mark\"\n part={this.partForName(\"origin\" as never)}\n title={this.origin?.from}\n onClick={() => this.send(ORIGIN_ACTIONS[pressed()].event as never, { name: this.propertyName } as never)}\n >\n {this.origin?.mark}\n </button>\n )}\n </Show>\n )\n }\n\n /** The small button its origin offers. */\n private originButton(): JSX.Element {\n return (\n <Show when={this.origin?.action}>\n {(action) => {\n const { text, event } = ORIGIN_ACTIONS[action()]\n const words = () => this.translationForKey(text as never, { label: this.ownLabel ?? \"\" } as never)\n return (\n <button\n type=\"button\"\n class={[\"origin\", { reset: action() === \"reset\" }]}\n part={this.partForName(\"origin\" as never)}\n title={words()}\n aria-label={words()}\n onClick={() => this.send(event as never, { name: this.propertyName } as never)}\n >\n {this.originGlyph.svg}\n </button>\n )\n }}\n </Show>\n )\n }\n\n /** `:state(changed)`: its edit is held, not saved yet. */\n @E.cssState(\"changed\")\n @E.state\n accessor isChanged = false\n\n ////////////////\n // ## The control it makes\n ////////////////\n\n /**\n * The kind of control it draws: `as`, else its type's default.\n * - `undefined` until the page's runtime has loaded.\n */\n get controlKind(): string | undefined {\n if (!this.isReady) return undefined\n if (this.requestedKind) return this.requestedKind\n const choices = this.choices\n const isIconRow =\n this.valueType === CHOICE &&\n !!choices?.length &&\n choices.length <= MOST_SEGMENTS &&\n choices.every(UIProperty.hasIcon)\n return isIconRow ? SEGMENTED_KIND : UI.propertyControls.kindFor(this.valueType)\n }\n\n /** What its kind draws, while the runtime is in. */\n get control(): PropertyControl | undefined {\n const kind = this.controlKind\n return kind ? UI.propertyControls.get(kind) : undefined\n }\n\n /** `:state(buttons)`: its control is a row of choices (a kind drawn as `radios`). */\n @E.cssState(\"buttons\")\n get isButtonRow(): boolean {\n return this.control?.choices === RADIOS\n }\n\n /** Choices loaded from a source (`options`, `choicesFrom`), once they arrive. */\n @E.state accessor loadedChoices: readonly Choice[] | undefined = undefined\n\n /**\n * Its choices: `options` written as a list, else a source's (once loaded), else the schema's values.\n * - The schema's values: its own `values` (a list, or a value set's name), else its kind's set\n * (`ValueSets.setFor()`): a tag's `size` is the sizes, its `color` the hues.\n * Without the kind's set, a tag's own schema drew its selects with nothing to choose (Owen: \"dropdowns don't\n * have options\").\n * - Each shown by its words, `valueLabels`, when the schema gives them (`up` shows as `arriba`; epic `language` T73);\n * its value stays the value.\n */\n get choices(): readonly Choice[] | undefined {\n const text = this.optionsText\n if (text && text.includes(\",\")) return text.split(\",\").map((choice) => choice.trim())\n if (text || this.spec?.choicesFrom) return this.loadedChoices\n const spec = this.spec\n const set = spec && E.ValueSets.setFor(spec)\n if (!set) return undefined\n const icons = E.ValueSets.iconsFor(spec)\n const labels = spec.valueLabels\n const values = E.ValueSets.get(set)\n if (!icons && !labels) return values\n return values.map((value) => {\n const icon = icons?.[value]\n const text = labels?.[value] ?? value\n if (!icon) return text === value ? value : { value, text }\n return { value, text, icon }\n })\n }\n\n /** Its choices are colours: each drawn with a chip of its hue (`hueChip()`). */\n get isHueChoice(): boolean {\n return !!this.spec && E.ValueSets.setFor(this.spec) === HUES\n }\n\n /** A choice source to load: `options` naming one, else the schema's `choicesFrom`. */\n @E.onChange(\"optionsText\", \"spec\", \"isReady\")\n protected onChoiceSourceChanged(text: string | undefined, spec: AttributeSpec | undefined, isReady: boolean) {\n const source = text && !text.includes(\",\") ? text : spec?.choicesFrom\n if (!isReady || !source) return\n let isCurrent = true\n void UI.propertyControls\n .choices(source)\n .then((choices) => {\n if (isCurrent) this.loadedChoices = choices ?? []\n })\n .catch((error) => E.Warnings.warn(\"<ui-property>\", `can't load the choices of \\`${source}\\`:`, error))\n return () => {\n isCurrent = false\n }\n }\n\n /** Make (or make again) its control as the kind, choices, name, readonly state or limits change. */\n @E.onChange(\"controlKind\", \"choices\", \"propertyName\", \"isReadOnly\", \"spec\")\n protected onControlNeeded(kind: string | undefined) {\n if (!kind || this.holdsOwnControl) return this.removeMadeControls()\n this.makeControl(kind)\n }\n\n /** The author put a control of their own in it: any element child it didn't make, outside the named slots. */\n private get holdsOwnControl(): boolean {\n return [...this.domElement.children].some((child) => !child.hasAttribute(MADE_ATTRIBUTE) && !child.slot)\n }\n\n /**\n * Replace the controls it made with one of `kind`.\n * - SIDE EFFECT: writes its light DOM.\n */\n @E.untracked\n private makeControl(kind: string) {\n const control = UI.propertyControls.get(kind)\n if (!control) {\n E.Warnings.warn(\"<ui-property>\", `no control kind \\`${kind}\\`: add it with UI.propertyControls.add()`)\n return\n }\n this.removeMadeControls()\n const made = control.choices === \"radios\" ? this.radios(control) : [this.controlElement(control)]\n for (const element of made) element.setAttribute(MADE_ATTRIBUTE, \"\")\n this.domElement.append(...made)\n this.noteValueChanged()\n FlagRun.arrangeSoon(this.domElement.parentElement)\n }\n\n /** One control element of `control`'s kind: named, limited, readonly, its choices as `<ui-item>`s. */\n private controlElement(control: PropertyControl): HTMLElement {\n const element = document.createElement(control.tag)\n for (const [name, value] of Object.entries(control.attributes ?? {})) element.setAttribute(name, value)\n element.setAttribute(\"name\", this.propertyName)\n const spec = this.spec\n if (spec?.min !== undefined) element.setAttribute(\"min\", String(spec.min))\n if (spec?.max !== undefined) element.setAttribute(\"max\", String(spec.max))\n if (spec?.step !== undefined) element.setAttribute(\"step\", String(spec.step))\n if (this.isReadOnly) {\n element.setAttribute(\"readonly\", \"\")\n // a row of buttons has no read-only of its own: it looks the same, and takes no press\n if (control.attributes?.appearance === SEGMENTED) element.inert = true\n }\n if (control.choices === \"items\") {\n const choices = this.choices ?? []\n const isSegmented = control.attributes?.appearance === SEGMENTED\n // no value and no default: it reads \"none\", never blank (a segmented row always shows its choices)\n // (drawn again while its things disagree, it keeps saying \"Mixed\")\n if (spec?.default === undefined && !isSegmented && !this.domElement.hasAttribute(\"mixed\"))\n element.setAttribute(\"placeholder\", this.translationForKey(\"none\"))\n // every segment an icon: icons alone, each one's name its tooltip\n const iconsOnly = isSegmented && choices.length > 0 && choices.every(UIProperty.hasIcon)\n if (iconsOnly) element.setAttribute(\"icon\", \"\")\n for (const choice of choices) {\n const item = UIProperty.item(choice, iconsOnly)\n if (this.isHueChoice)\n item.setAttribute(\"image\", UIProperty.hueChip(item.getAttribute(\"value\")!, this.domElement))\n element.append(item)\n }\n }\n if (control.tag === EDITOR_TAG) element.setAttribute(VALUE_FROM_ATTRIBUTE, this.propertyName)\n return element\n }\n\n /** One radio per choice, of one name: the `buttons` kind. */\n private radios(control: PropertyControl): HTMLElement[] {\n return (this.choices ?? []).map((choice) => {\n const radio = this.controlElement(control)\n const { value, text } = UIProperty.choiceParts(choice)\n radio.setAttribute(\"value\", value)\n radio.textContent = text\n return radio\n })\n }\n\n /**\n * Take away every control it made.\n * - SIDE EFFECT: writes its light DOM.\n */\n @E.untracked\n private removeMadeControls() {\n for (const child of [...this.domElement.children]) {\n // the pills' select stays: it follows its run, not its kind\n if (child.hasAttribute(MADE_ATTRIBUTE) && child.getAttribute(MADE_ATTRIBUTE) !== FLAGS) child.remove()\n }\n }\n\n ////////////////\n // ## Its look in its editor (epic `debut` P31)\n ////////////////\n\n /** `:state(compact)`: its editor is `compact`. */\n @E.cssState(\"compact\")\n get isCompact(): boolean {\n return !!this.editor?.isCompact\n }\n\n /** `:state(show-defaults)`: its editor bolds a value other than its default. */\n @E.cssState(\"show-defaults\")\n get showsDefaults(): boolean {\n return !!this.editor?.showsDefaults\n }\n\n /**\n * `:state(half)`: half a row on its editor's grid (one column): its own `width` (`1/2`, `8` of 16 or less),\n * else its kind's (`PropertyControl.width`). The pills' row takes the whole.\n */\n @E.cssState(\"half\")\n get isHalf(): boolean {\n if (this.flagRun) return false\n const width = this.attributes.width\n const columns = width ? E.ValueSets.columns(width) : undefined\n if (columns !== undefined) return columns <= HALF_OF_GRID\n return this.control?.width === HALF\n }\n\n /** In a compact editor, a yes or no draws on one line: the field's `inline`, the box before its label. */\n @E.cssState(\"inline-check\")\n get isInlineCheck(): boolean {\n return this.isCompact && !!this.control?.inline && !this.flagRun\n }\n\n protected classValue(name: E.AttributeName<typeof fieldVocabulary>): unknown {\n if (name === \"inline\" && this.isInlineCheck) return true\n return super.classValue(name)\n }\n\n ////////////////\n // ## Set: a value other than its default\n ////////////////\n\n /** Moves each time its control's value may have: a person's edit, or its form showing one. */\n @E.state private accessor valueVersion = 0\n\n /** Its control's value may have changed: `:state(set)` reads it again. */\n @E.untracked\n noteValueChanged() {\n this.valueVersion++\n }\n\n /**\n * Its controls' values were set as attributes (a page drawing its own control, `value={...}`), or controls came\n * and went: read again.\n */\n @E.watches({ childList: true, subtree: true, attributes: true, attributeFilter: VALUE_ATTRIBUTES })\n protected onControlsMutated() {\n this.noteValueChanged()\n }\n\n /** A person edited its control. */\n @E.on(\"ui-changed\")\n @E.on(\"input\")\n @E.on(\"change\")\n protected onValueEdited() {\n this.noteValueChanged()\n }\n\n /** Its default: its own `default`, else the schema's; `undefined` for none. */\n get defaultValue(): string | number | boolean | undefined {\n return this.attributes.default ?? this.spec?.default\n }\n\n /**\n * `:state(set)`: its value isn't its default (any value at all, with none).\n * - Never while its things disagree (`mixed`), or it's readonly.\n * - Read from its control, the way its form reads it (`FormFields.valueFor()`).\n */\n @E.cssState(\"set\")\n get isSet(): boolean {\n void this.valueVersion\n if (this.isMixed || this.isReadOnly) return false\n // its editor knows better than a comparison: where it came from, not whether it differs\n if (this.origin) return this.isSetHere\n const controls = [...this.domElement.children].filter(\n (child) => !child.slot && child.getAttribute(MADE_ATTRIBUTE) !== FLAGS && FormFields.isControl(child)\n )\n return UIProperty.differs(FormFields.valueFor(controls), this.defaultValue)\n }\n\n /**\n * `value` isn't `fallback`: a yes or no compared as one, anything else as text.\n * - STATIC: pure.\n */\n static differs(value: E.FieldValue, fallback: string | number | boolean | undefined): boolean {\n // no default: any value, but \"false\" (an off switch a select shows as text, `fixed=\"false\"`) is none\n if (fallback === undefined) return !FormFields.isBlank(value) && value !== FALSE_TEXT\n if (typeof fallback === \"boolean\" || fallback === \"true\" || fallback === \"false\") {\n return !FormFields.isBlank(value) !== E.Converters.boolean(fallback)\n }\n const text = Array.isArray(value) ? value.join(\",\") : value == null ? \"\" : String(value)\n return text !== String(fallback)\n }\n\n ////////////////\n // ## A run of yes-or-no properties, as one select of pills\n ////////////////\n\n /** The properties its pills stand for, while it heads a run (`:state(flags)`); set by `FlagRun`. */\n @E.state({ equals: isSameRun }) accessor flagRun: readonly UIProperty[] | undefined = undefined\n\n /** The property heading its run, while it's in one and doesn't head it (`:state(flag)`, hidden). */\n @E.cssState(\"flag\")\n @E.state\n accessor isFlagMember = false\n\n /** `:state(flags)`: it heads a run, drawing its pills. */\n @E.cssState(\"flags\")\n get isFlagLead(): boolean {\n return !!this.flagRun\n }\n\n /** A yes or no that may join a run: its control is a checkbox kind, its own (not the author's). */\n get canJoinFlags(): boolean {\n return !!this.control?.inline && !this.holdsOwnControl && !this.requestedKind\n }\n\n /** Its checkbox's chosen state: read again with its value. */\n get isChosen(): boolean {\n void this.valueVersion\n const checkbox = this.madeCheckbox\n return !!checkbox && FormFields.isChosen(checkbox)\n }\n\n /** The checkbox it made. */\n @E.untracked\n private get madeCheckbox(): Element | undefined {\n return [...this.domElement.children].find((child) => child.getAttribute(MADE_ATTRIBUTE) === \"\" && !child.slot)\n }\n\n /** The names of its run's properties that are on: the pills shown. */\n get chosenFlags(): readonly string[] {\n return (this.flagRun ?? []).filter((property) => property.isChosen).map((property) => property.propertyName)\n }\n\n /** The pills' select, while it heads a run. */\n private flagsSelect: HTMLElement | undefined\n\n /** Heading a run, or no longer: make the pills' select, or take it away. */\n @E.onChange(\"flagRun\")\n protected onFlagRunChanged(run: readonly UIProperty[] | undefined) {\n this.flagsSelect?.remove()\n this.flagsSelect = undefined\n if (!run) return\n const select = document.createElement(DROPDOWN_TAG)\n select.setAttribute(MADE_ATTRIBUTE, FLAGS)\n select.setAttribute(\"multiple\", \"\")\n select.setAttribute(\"selection\", \"\")\n select.setAttribute(\"fluid\", \"\")\n select.setAttribute(\"aria-label\", this.translationForKey(FLAGS_TEXT))\n for (const property of run) {\n const item = UIProperty.item({ value: property.propertyName, text: property.ownLabel ?? property.propertyName })\n const tip = property.description ?? property.spec?.tip\n if (tip) item.setAttribute(\"title\", tip)\n select.append(item)\n }\n select.addEventListener(\"ui-changed\", this.onFlagsPicked)\n this.domElement.append(select)\n this.flagsSelect = select\n return () => select.removeEventListener(\"ui-changed\", this.onFlagsPicked)\n }\n\n /** The pills shown follow its run's checkboxes. */\n @E.onChange(\"chosenFlags\", \"flagRun\")\n protected onChosenFlagsChanged(chosen: readonly string[]) {\n const select = this.flagsSelect as (HTMLElement & { value?: unknown }) | undefined\n if (select) select.value = [...chosen]\n }\n\n /**\n * A pill added or removed: turn each of its run's checkboxes on or off to match, as a person's click would,\n * so its form writes each property back.\n * - Its own `ui-changed` stops here: the select is no control of the form's.\n */\n @E.untracked\n private readonly onFlagsPicked = (event: Event) => {\n event.stopPropagation()\n const picked = new Set(E.Converters.list((event as CustomEvent<{ value: unknown }>).detail?.value as string))\n for (const property of this.flagRun ?? []) {\n const checkbox = property.madeCheckbox as (Element & { checked: boolean }) | undefined\n const isOn = picked.has(property.propertyName)\n if (!checkbox || FormFields.isChosen(checkbox) === isOn) continue\n checkbox.checked = isOn\n checkbox.dispatchEvent(\n new CustomEvent(\"ui-changed\", { detail: { selected: isOn }, bubbles: true, composed: true })\n )\n }\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /** The editor around `element`, the nearest with a schema (`currentSchema`) -- `undefined` if none. */\n static editorAround(element: Element): DOMEditorLike | undefined {\n for (let at = element.parentElement; at; at = at.parentElement) {\n if (\"currentSchema\" in at) return at as DOMEditorLike\n }\n return undefined\n }\n\n /**\n * What `schema` says of property `name`; a dotted name reaches into a nested thing's `attributesOf`.\n * - STATIC: pure.\n */\n static specFor(schema: PropertySchema, name: string): AttributeSpec | undefined {\n let attributes: readonly AttributeSpec[] | undefined = schema.attributes\n let spec: AttributeSpec | undefined\n for (const key of name.split(\".\")) {\n spec = attributes?.find((candidate) => candidate.name === key || candidate.property === key)\n attributes = spec?.attributesOf\n }\n return spec\n }\n\n /** A choice's value and text (and its icon and image, if it has them). */\n private static choiceParts(choice: Choice): Exclude<Choice, string> {\n return typeof choice === \"string\" ? { value: choice, text: choice } : choice\n }\n\n /** A choice with an icon of its own. */\n private static hasIcon(choice: Choice): boolean {\n return typeof choice !== \"string\" && !!choice.icon\n }\n\n /**\n * A `<ui-item value>` for a choice, with its icon (and image);\n * `iconOnly`: its icon alone, its text its tooltip and name.\n */\n private static item(choice: Choice, iconOnly = false): HTMLElement {\n const { value, text, icon, image } = UIProperty.choiceParts(choice)\n const item = document.createElement(\"ui-item\")\n item.setAttribute(\"value\", value)\n if (icon) item.setAttribute(\"icon\", icon)\n if (image) item.setAttribute(\"image\", image)\n if (iconOnly) {\n item.setAttribute(\"title\", text)\n item.setAttribute(\"aria-label\", text)\n } else item.textContent = text\n return item\n }\n\n /**\n * A round chip of `hue`'s colour, as an SVG `data:` URL: a hue's choice shows it before its name.\n * - The colour is worked out on a probe inside `near`, so it's the colour the theme there paints;\n * grey where it can't be read.\n * - SIDE EFFECT: adds and removes the probe.\n */\n static hueChip(hue: string, near: Element): string {\n const probe = near.appendChild(document.createElement(\"span\"))\n probe.style.color = `var(--ui-${hue}, gray)`\n const color = getComputedStyle(probe).color\n probe.remove()\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><circle cx=\"8\" cy=\"8\" r=\"8\" fill=\"${color}\"/></svg>`\n return `data:image/svg+xml,${encodeURIComponent(svg)}`\n }\n}\n\n/** What a property reads of its editor's DOM element. */\ntype DOMEditorLike = HTMLElement & {\n readonly currentSchema?: PropertySchema\n readonly currentOrigins?: Readonly<Record<string, PropertyOrigin>>\n readonly isCompact?: boolean\n readonly showsDefaults?: boolean\n}\n\n/****************\n * ### `FlagRun`\n * Finds the runs of yes-or-no properties in a group (or an editor), and makes each run ONE select of pills:\n * its first property heads it (`flagRun`), the rest hide (`isFlagMember`).\n * - A run: three or more side by side, by themselves; a group's `flags` says otherwise\n * (`pills`: any run; `checkboxes`: none).\n * - Each property still has its checkbox, which its form binds: the pills only turn them on and off.\n * - Arranged a moment after any property in the group makes its control, so every one of them has.\n ****************/\nclass FlagRun {\n /** Arrange `container`'s runs once the current code is done: once, however many ask. */\n static arrangeSoon(container: Element | null) {\n if (!container || FlagRun.pending.has(container)) return\n FlagRun.pending.add(container)\n E.afterSolidUpdate(() => {\n FlagRun.pending.delete(container)\n FlagRun.arrange(container)\n })\n }\n\n /** Find `container`'s runs and tell each property its part in them. */\n static arrange(container: Element) {\n const mode = container.getAttribute(\"flags\")\n const least = mode === PILLS ? 1 : mode === CHECKBOXES ? Infinity : LEAST_FLAGS\n const runs: UIProperty[][] = []\n let run: UIProperty[] = []\n for (const child of container.children) {\n const property = (child as E.DOMElement).component\n if (property instanceof UIProperty && property.canJoinFlags) {\n run.push(property)\n continue\n }\n if (run.length) runs.push(run)\n run = []\n }\n if (run.length) runs.push(run)\n const leads = new Map<UIProperty, readonly UIProperty[]>()\n const members = new Set<UIProperty>()\n for (const each of runs) {\n if (each.length < least) continue\n leads.set(each[0], each)\n for (const member of each.slice(1)) members.add(member)\n }\n for (const child of container.children) {\n const property = (child as E.DOMElement).component\n if (!(property instanceof UIProperty)) continue\n property.flagRun = leads.get(property)\n property.isFlagMember = members.has(property)\n }\n }\n\n /** Containers waiting to be arranged. */\n private static readonly pending = new WeakSet<Element>()\n}\n\n/** `PropertyOrigin.kind` of a value that can't be changed here. */\nconst WORKED_OUT = \"worked out\"\n\n/** What each button a `PropertyOrigin` offers shows and says. */\nconst ORIGIN_ACTIONS = {\n reset: { icon: \"undo\", text: \"reset\", event: \"ui-reset\" },\n \"show code\": { icon: \"code\", text: \"showCode\", event: \"ui-show-code\" }\n} as const\n\n/** The label of the pills' select: the property's own text (TypeScript knows only the field's). */\nconst FLAGS_TEXT = \"flags\" as never\n\n/** An off switch, as a select shows it. */\nconst FALSE_TEXT = \"false\"\n\n/** The fewest yes-or-no properties side by side that make a select of pills. */\nconst LEAST_FLAGS = 3\n\n/** A group's `flags`: every run pills, or none. */\nconst PILLS = \"pills\"\nconst CHECKBOXES = \"checkboxes\"\n\n/** `MADE_ATTRIBUTE`'s value on the pills' select. */\nconst FLAGS = \"flags\"\n\n/** The pills' select. */\nconst DROPDOWN_TAG = \"ui-dropdown\"\n\n/** The value type of a choice, and the kind a row of icons draws as. */\nconst CHOICE: ValueType = \"choice\"\nconst SEGMENTED_KIND = \"buttons\"\n\n/** A segmented menu's look word. */\nconst SEGMENTED = \"segmented\"\n\n/** The most choices drawn as a segmented row by themselves. */\nconst MOST_SEGMENTS = 4\n\n/** The value set of colours. */\nconst HUES = \"hues\"\n\n/** `PropertyControl.width`'s half; half of the 16-column grid a `width` counts in. */\nconst HALF = \"half\"\nconst HALF_OF_GRID = 8\n\n/** A kind's choices drawn one control each. */\nconst RADIOS = \"radios\"\n\n/** The type of a property the schema doesn't name. */\nconst TEXT: ValueType = \"text\"\n\n/** A bare attribute named `name`, to make a label from. */\nconst NAMED = (name: string): AttributeSpec => ({ name, kind: \"string\", description: \"\" })\n","/**\n * The English vocabulary of `<ui-property-editor>`: every name the tag uses.\n * - Its own names first, then those it PASSES THROUGH, each only where it means the same:\n * - `<ui-form>`'s: it is one\n * - then `<ui-section>`'s: it draws one around its properties\n * - Not passed through:\n * - the section's `source` and `select`: the editor's own are its layout page's\n * - the form's `value`: the editor's own takes a thing or a list\n * - The shape is `E.ComponentVocabulary`. Pure data: `import type` only (`passThrough()` too).\n */\n\nimport type { E } from \"spell/ui/core\"\nimport { formVocabulary } from \"spell/ui/components/ui-form/UIForm.en\"\nimport { sectionVocabulary } from \"spell/ui/components/ui-section/UISection.en\"\nimport { passThrough } from \"./UIPropertyEditor.types\"\n\n/** The editor's own attributes. */\nconst OWN_ATTRIBUTES = [\n {\n name: \"schema\",\n kind: \"json\",\n reflect: false,\n description:\n \"What it edits, described: a tag (`ui-button`: its vocabulary), a schema the page added \" +\n \"(`UI.propertyControls.addSchema()`), or, as a property, a `PropertySchema` or a component vocabulary.\"\n },\n {\n name: \"value\",\n kind: \"json\",\n reflect: false,\n description: \"The thing it edits, or a LIST of things (edited at once: a property shows the value they agree on).\"\n },\n {\n name: \"source\",\n kind: \"string\",\n description: \"Its layout page: a spell path inside the spell editor, else a full URL (epic `property-editor` P6).\"\n },\n {\n name: \"selector\",\n kind: \"string\",\n replaces: [\"select\"],\n description:\n \"With `source`: a CSS selector; only its first match in the layout page is used. Its old name was `select`.\"\n },\n {\n name: \"readonly\",\n kind: \"boolean\",\n description: \"Shows every value; nothing can be changed. Reaches every property in it.\"\n },\n {\n name: \"compact\",\n kind: \"keyOnly\",\n description:\n \"Tight, as an inspector: smaller type, labels in regular weight, 8px between rows, two columns, \" +\n \"a yes or no on one line with its label, a hint at the label row's end, bands tightened (epic `debut` P31).\"\n },\n {\n name: \"columns\",\n kind: \"number\",\n description:\n \"How many columns its properties lay out on: a short one (a number, a select) takes one, the rest a whole \" +\n \"row. None: 2 when `compact`, else 1. A group's own `columns` wins in it.\"\n },\n {\n name: \"origins\",\n kind: \"json\",\n reflect: false,\n description:\n \"Where each property's value comes from, by name: `{ rank: { kind: 'inherited', from: 'From Card' } }`. \" +\n \"`here` shows a dot, `inherited` a quieter label, `worked out` is read only; `from` is the label's tooltip; \" +\n \"`action` adds a small button (`reset`, `show code`); `data` is kept in a back-end, its `mark` a few words at the row's end; \" +\n \"`readonly` makes it read only. A property it doesn't name looks as it always did.\"\n },\n {\n name: \"writer\",\n kind: \"json\",\n reflect: false,\n description:\n \"Who writes a property's value to its thing, in place of a plain set: `({ thing, name, value }) => boolean`, \" +\n \"`true` when it took the write. For a value kept somewhere that wants each change held, e.g. an inspector's \" +\n \"back-end data. None: each property is set on its thing.\"\n },\n {\n name: \"show-defaults\",\n kind: \"boolean\",\n description:\n \"A value other than its property's default shows bold, so what's been changed stands out \" +\n \"(`:state(set)` on each property shows it either way).\"\n },\n {\n name: \"unsaved\",\n kind: \"string\",\n description:\n \"Changes here can't be saved: each property shows a crossed-out save icon after its info icon, this text its \" +\n \"tip (`<ui-field unsaved>`). The values still change as they're edited.\"\n },\n { name: \"output\", kind: \"string\", description: 'A value at the end of the title bar; `slot=\"output\"`.' },\n { name: \"error\", kind: \"string\", description: \"An error under the title, and the `error` state.\" }\n] as const satisfies readonly E.AttributeSpec[]\n\n/****************\n * ### `propertyEditorVocabulary`\n * The names of `<ui-property-editor>`: a titled, folding form of properties, drawn from a schema.\n ****************/\nexport const propertyEditorVocabulary = {\n tag: \"ui-property-editor\",\n icon: \"sliders horizontal\",\n topics: [\"forms\", \"inputs\", \"collections\"],\n aka: [\"inspector\", \"property sheet\", \"properties panel\", \"settings form\", \"object editor\"],\n skeleton: \"header, 3 line paragraph\",\n noun: \"form\",\n description:\n \"A property editor draws a form from a schema: one field per property, in folding groups, for one thing or many.\",\n attributes: passThrough<E.AttributeSpec>(\n OWN_ATTRIBUTES,\n [formVocabulary.attributes, sectionVocabulary.attributes],\n [\"source\", \"selector\"]\n ),\n events: passThrough<E.EventSpec>(\n [\n {\n name: \"ui-changed\",\n detail: \"{ name: string, value: unknown, things: object[] }\",\n description: \"A property was written to the thing (or things).\"\n },\n {\n name: \"ui-reset\",\n detail: \"{ name: string }\",\n description: \"A property's reset button was pressed (`origins`): the page does what that means.\"\n },\n {\n name: \"ui-show-code\",\n detail: \"{ name: string }\",\n description: \"A property's code button was pressed (`origins`): the page shows it.\"\n },\n { name: \"ui-loading\", detail: \"{ source: string }\", description: \"Its `source` page is about to load (P6).\" },\n { name: \"ui-loaded\", detail: \"{ source: string, content: string }\", description: \"It arrived (P6).\" }\n ] as const satisfies readonly E.EventSpec[],\n [formVocabulary.events, sectionVocabulary.events],\n [\"ui-loaded\"]\n ),\n slots: passThrough<E.SlotSpec>(\n [\n { name: \"\", description: \"`<ui-property-group>`s and `<ui-property>`s. Empty: one property per attribute.\" },\n { name: \"output\", description: \"Rich output (instead of `output`).\" }\n ] as const satisfies readonly E.SlotSpec[],\n [sectionVocabulary.slots]\n ),\n parts: passThrough<E.PartSpec>(\n [\n { name: \"editor\", description: \"The editor's outer box.\" },\n { name: \"footer\", description: 'Under the properties: Save and Cancel, with `apply=\"on save\"`.' },\n { name: \"output\", description: \"The output.\" },\n { name: \"error-line\", description: \"The editor's own error, under its title.\" }\n ] as const satisfies readonly E.PartSpec[],\n [formVocabulary.parts, sectionVocabulary.parts]\n ),\n states: passThrough<E.StateSpec>(\n [\n { name: \"readonly\", description: \"Nothing can be changed (`readonly`).\" },\n { name: \"compact\", description: \"`compact`.\" },\n { name: \"grid\", description: \"Its properties lay out on columns (`columns`, or `compact`).\" },\n { name: \"show-defaults\", description: \"`show-defaults`.\" }\n ] as const satisfies readonly E.StateSpec[],\n [formVocabulary.states, sectionVocabulary.states]\n ),\n texts: passThrough<E.TextSpec>(\n [\n { key: \"save\", text: \"Save\", description: 'The Save button, with `apply=\"on save\"`.' },\n { key: \"cancel\", text: \"Cancel\", description: 'The Cancel button, with `apply=\"on save\"`.' },\n { key: \"other\", text: \"Other\", description: \"The group of properties a layout doesn't place (P6).\" }\n ] as const satisfies readonly E.TextSpec[],\n [formVocabulary.texts, sectionVocabulary.texts]\n )\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-property-editor>`'s own parts, adopted after the form's (`UIForm.css`).\n * - Its `<ui-section>` (when it has a title) is an element of its own, styled by itself.\n * - `.footer`: Save and Cancel under the properties, at the end of the line.\n * - `.output`: a value at the end of the title bar (mono, muted); `.error-line`: its own error under the title.\n * - `:state(grid)` (`columns`, or `compact`): its properties on a grid of `--_property-editor-columns` columns,\n * set on the root from `columns`; each property says how much of a row it takes (`UIProperty.css`), and\n * everything else here takes a whole row.\n * - `:state(compact)`: the tight look (epic `debut` P31), through private aliases its properties and groups read,\n * as custom properties inherit into what's slotted.\n * - `--ui-property-editor-font-size` (13px), `-row-gap` (8px), `-column-gap` (12px), `-label-distance` (3px)\n * - its controls tighter, set as the page would (`componentTokens.test.ts` lists each)\n */\n\n@layer ui.components.property-editor.content, ui.components.property-editor.variations;\n\n@layer ui.components.property-editor.content {\n .footer {\n display: flex;\n justify-content: flex-end;\n gap: 0.5em;\n margin: 1em 0 0;\n }\n .output {\n color: var(--ui-text-muted);\n font-family: var(--ui-font-family-mono);\n font-size: 0.92em;\n font-variant-numeric: tabular-nums;\n }\n .error-line {\n margin: 0 0 0.75em;\n color: var(--ui-negative-text);\n font-size: 0.85714em;\n }\n}\n\n@layer ui.components.property-editor.variations {\n /* ## On a grid: the properties' row gap is their own margin, so a field never sits on a gap and a margin both */\n :host(:state(grid)) .ui.form,\n :host(:state(grid)) .ui.form > ui-section::part(content) {\n --_property-editor-field-width: auto;\n display: grid;\n grid-template-columns: repeat(var(--_property-editor-columns, 1), minmax(0, 1fr));\n column-gap: var(--_ui-property-editor-column-gap, var(--ui-form-gutter, 1em));\n align-items: start;\n }\n :host(:state(grid)) .ui.form > :not(slot),\n :host(:state(grid)) :is(.output, .error-line, .footer) {\n grid-column: 1 / -1;\n }\n\n /* ## Compact: an inspector's density */\n :host(:state(compact)) .ui.form {\n --_ui-property-editor-font-size: var(--ui-property-editor-font-size, 13px);\n --_ui-property-editor-row-gap: var(--ui-property-editor-row-gap, 8px);\n --_ui-property-editor-column-gap: var(--ui-property-editor-column-gap, 12px);\n --_ui-property-editor-label-distance: var(--ui-property-editor-label-distance, 3px);\n /* the form's own aliases, which its fields read: regular labels (bold means \"changed\"), the text's size */\n --_ui-form-row-distance: var(--_ui-property-editor-row-gap);\n --_ui-form-label-distance: var(--_ui-property-editor-label-distance);\n --_ui-form-label-font-size: 1em;\n --_ui-form-label-font-weight: var(--ui-font-weight-normal, 400);\n /* its controls size their text from the base size: the editor's */\n --ui-font-size: var(--_ui-property-editor-font-size);\n /* controls about 26px tall */\n --ui-control-height: 0px;\n --ui-button-padding-block: 0.3em;\n --ui-input-padding-block: 0.3em;\n --ui-input-padding-inline: 0.6em;\n --ui-select-padding-block: 0.3em;\n --ui-select-padding-inline: 0.6em;\n --ui-dropdown-padding-block: 0.3em;\n --ui-dropdown-padding-inline: 0.6em;\n --ui-menu-segmented-item-padding: 0.4em 0.6em;\n font-size: var(--_ui-property-editor-font-size);\n }\n}\n","import { For, Show } from \"solid-js\"\nimport { Dynamic, isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI } from \"spell/ui/core\"\n// the family barrels, not the leaves: the lib build then imports `ui-form.js` / `ui-section.js`\n// (SIDE EFFECT: defines the form and section families: the editor is a form, and draws a section)\nimport { DOMFormElement, FormBinding, UIForm } from \"spell/ui/components/ui-form\"\nimport \"spell/ui/components/ui-section\"\nimport type { formVocabulary } from \"spell/ui/components/ui-form/UIForm.en\"\nimport { sectionVocabulary } from \"spell/ui/components/ui-section/UISection.en\"\nimport { PropertyEditorPages, PropertySchemas } from \"spell/ui/property\"\nimport type { ComponentVocabulary, PropertySchema } from \"spell/ui/vocabulary\"\nimport { propertyEditorVocabulary } from \"./UIPropertyEditor.en\"\nimport {\n GROUP_SELECTOR,\n MADE_ATTRIBUTE,\n MADE_FROM,\n PROPERTY_SELECTOR,\n PROPERTY_TAG,\n VALUE_FROM_ATTRIBUTE,\n type PropertyOrigin,\n type PropertyWriter\n} from \"./UIPropertyEditor.types\"\n\nimport editorCSS from \"./UIPropertyEditor.css?inline\"\n\n/****************\n * ### `DOMPropertyEditorElement`\n * The DOM element of `<ui-property-editor>`: a form's (`validate()`, `save()`, `cancel()`, `values` ...),\n * plus the schema its properties read.\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMPropertyEditorElement extends DOMFormElement {\n /** The schema it draws from, resolved (`schema`); each `<ui-property>` reads its own attribute's here. */\n get currentSchema(): PropertySchema | undefined {\n return (this.component as UIPropertyEditor | undefined)?.currentSchema\n }\n\n /** Compact (`compact`): its groups and properties draw tight. */\n get isCompact(): boolean {\n return !!(this.component as UIPropertyEditor | undefined)?.isCompact\n }\n\n /** Its properties lay out on columns (`columns`, or `compact`). */\n get isGrid(): boolean {\n return !!(this.component as UIPropertyEditor | undefined)?.isGrid\n }\n\n /** Its column count, for a group without `columns` of its own. */\n get columnCount(): number {\n return (this.component as UIPropertyEditor | undefined)?.columnCount ?? 1\n }\n\n /** A value other than its default shows bold (`show-defaults`). */\n get showsDefaults(): boolean {\n return !!(this.component as UIPropertyEditor | undefined)?.showsDefaults\n }\n\n /** Where each property's value comes from (`origins`); each `<ui-property>` reads its own here. */\n get currentOrigins(): Readonly<Record<string, PropertyOrigin>> | undefined {\n return (this.component as UIPropertyEditor | undefined)?.currentOrigins\n }\n}\n\n/****************\n * ### `UIPropertyEditor`\n * The component behind `<ui-property-editor>`: a form of properties, drawn from a SCHEMA.\n *\n * - It IS a `<ui-form>` (it extends `UIForm`): bound to `value` (a thing, or a list of things), validation,\n * `apply=\"on save\"` with `save()` / `cancel()`, `validate`.\n * Its `<ui-property>`s are fields of it, in its light DOM.\n * - It DRAWS a `<ui-section>` in its shadow root, around them, when it has a title:\n * `label` or `slot=\"label\"`.\n * - Every section attribute it's given is passed on to the section, and the section's named slots too.\n * - The section's events (`ui-opening` / `ui-closing` ...) come out of it, from the editor.\n * - The SCHEMA (`schema`): what its properties are.\n * - A name: one the page added (`UI.propertyControls.addSchema()`), else a tag's vocabulary (`ui-button`).\n * - As a property: a `PropertySchema`, or a component vocabulary.\n * - Empty (no `<ui-property>` or group in it, and no `source`), it MAKES a `<ui-property>` per attribute,\n * in the schema's order.\n * SIDE EFFECT: writes its light DOM, the made ones marked `data-ui-made`.\n * - Its LAYOUT can come from a saved page (`source`, epic `property-editor` P6):\n * an editor page's markup (`PropertyEditorPages`), loaded through `UI.sources` (same-origin).\n * The spell editor hands it a `/spaces/` URL.\n * - The page's groups and properties come into its light DOM.\n * - So do the attributes of the page's editor that it doesn't have yet\n * (as an attribute, or as a property a script set).\n * - `select`: only the page's first match of that selector.\n * - A group's `select`: that group's own part of the page.\n * - `ui-loading`, then `ui-loaded`; a page that doesn't load warns, and nothing changes.\n * - SIDE EFFECT: writes its light DOM (marked `data-ui-made=\"source\"`) and its own missing attributes.\n * - When a property is written: `ui-changed` (from the editor and from the property), then the schema's\n * \"on change\" rules for it (`UI.propertyControls.rule()`).\n * - Its groups hear about their properties: `ui-invalid` and `:state(error)` when one fails,\n * `:state(changed)` while one holds an edit, `ui-saved` when a submit or a save passes.\n * - `apply=\"on save\"`: Save and Cancel under the properties (`part=\"footer\"`).\n * - `readonly`: every property in it is readonly (read as each connects).\n * - A NESTED editor, made by a property (`as=\"editor\"`), edits that property's thing: its `value` unless given.\n * - `compact` (epic `debut` P31): the tight look of an inspector, which its groups and properties read from it.\n * - Its properties lay out on `columns` (2 when compact): a short one (a number, a select) one column, the rest\n * a row; a group's own `columns` wins in it.\n * - `show-defaults`: a value other than its property's default shows bold.\n * - `origins`: where each property's value comes from, handed in by whoever knows (`PropertyOrigin`):\n * each property shows it, and a button it offers only says it was pressed.\n * - `writer`: writes a property's value to its thing in place of the plain set, when it says it did (`PropertyWriter`):\n * for a value kept somewhere that wants each change held, as an inspector's back-end data does.\n ****************/\nexport class UIPropertyEditor extends UIForm {\n // the form's names under the editor's tag, the section's and its own: TypeScript only knows the form's literals\n @E.proto static vocabulary = propertyEditorVocabulary as unknown as typeof formVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { ...UIForm.prototype.elementSetup.styleSheets, editor: editorCSS },\n DOMElement: DOMPropertyEditorElement\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## The schema\n ////////////////\n\n /** `schema` as given: a name, or an object. */\n private get schemaGiven(): unknown {\n return E.Reactive.attributeValue(this, \"schema\")\n }\n\n /**\n * The schema its properties read, resolved; `undefined` while there's none (or the runtime isn't in yet).\n * - A tag not defined yet, e.g. a program's `<task-list-task>` drawn after the editor:\n * read again once it is (`waitForSchemaTag()`), so the properties are remade with its kinds and values.\n */\n get currentSchema(): PropertySchema | undefined {\n const given = this.schemaGiven\n if (typeof given === \"string\") {\n if (!this.isReady) return undefined\n // tracked: it changes as a tag the schema names is defined\n void this.schemaTagsDefined\n const added = UI.propertyControls.schema(given)\n if (added) return added\n const vocabulary = UI.vocabulary.get(given)\n if (!vocabulary) this.waitForSchemaTag(given)\n return vocabulary ? PropertySchemas.fromVocabulary(vocabulary) : undefined\n }\n if (!given || typeof given !== \"object\" || !(\"attributes\" in given)) return undefined\n return \"tag\" in given ? PropertySchemas.fromVocabulary(given as ComponentVocabulary) : (given as PropertySchema)\n }\n\n /** How many tags `schema` named have been defined since it was read: `currentSchema` reads it, to read again. */\n @E.state private accessor schemaTagsDefined = 0\n\n /** The tags `waitForSchemaTag()` is waiting for: once each. */\n private readonly schemaTagsAwaited = new Set<string>()\n\n /** SIDE EFFECT: once `tag` is defined, `currentSchema` is read again -- its vocabulary is in by then. */\n private waitForSchemaTag(tag: string) {\n if (this.schemaTagsAwaited.has(tag) || !tag.includes(\"-\") || typeof customElements === \"undefined\") return\n this.schemaTagsAwaited.add(tag)\n void customElements.whenDefined(tag).then(() => this.schemaTagsDefined++)\n }\n\n /** Empty of the author's properties: make one per attribute of the schema (see the class doc). */\n @E.onChange(\"currentSchema\", \"isConnected\")\n protected onSchemaChanged(schema: PropertySchema | undefined, isConnected: boolean) {\n if (!isConnected || this.holdsOwnProperties || this.attributes.source) return\n this.removeMadeProperties(MADE_FROM.schema)\n for (const spec of schema?.attributes ?? []) {\n const property = document.createElement(PROPERTY_TAG)\n property.setAttribute(\"name\", spec.name)\n property.setAttribute(MADE_ATTRIBUTE, MADE_FROM.schema)\n this.domElement.append(property)\n }\n }\n\n /** The author laid out properties (or groups) of their own: any element child it didn't make. */\n private get holdsOwnProperties(): boolean {\n return [...this.domElement.children].some((child) => !child.hasAttribute(MADE_ATTRIBUTE) && !child.slot)\n }\n\n /**\n * Take away every property it made from `from` (its schema, or its source page).\n * - SIDE EFFECT: writes its light DOM.\n */\n @E.untracked\n private removeMadeProperties(from: string) {\n for (const child of [...this.domElement.children]) if (child.getAttribute(MADE_ATTRIBUTE) === from) child.remove()\n }\n\n /** Where each property's value comes from: `origins`, as given. */\n get currentOrigins(): Readonly<Record<string, PropertyOrigin>> | undefined {\n const given = E.Reactive.attributeValue(this, \"origins\")\n return given && typeof given === \"object\" ? (given as Record<string, PropertyOrigin>) : undefined\n }\n\n ////////////////\n // ## Its layout from a page (`source`)\n ////////////////\n\n /** Load the layout page as `source` or `select` changes, while connected (see the class doc). */\n @E.onChange(\"sourceUrl\", \"sourceSelector\", \"isConnected\")\n protected onSourceChanged(url: string | undefined, selector: string | undefined, isConnected: boolean) {\n if (!url || !isConnected || isServer) return\n let isCurrent = true\n void this.loadLayout(url, selector, () => isCurrent)\n return () => {\n isCurrent = false\n }\n }\n\n /** `source`. */\n get sourceUrl(): string | undefined {\n return this.attributes.source ?? undefined\n }\n\n /** `select`. */\n get sourceSelector(): string | undefined {\n return this.attributes.selector ?? this.attributes.select ?? undefined\n }\n\n /**\n * Fetch the page at `url` and take its layout, unless `isCurrent()` says it's no longer wanted.\n * - NEVER throws: a page that doesn't load warns.\n */\n @E.untracked\n private async loadLayout(url: string, selector: string | undefined, isCurrent: () => boolean) {\n this.send(OWN.loading, { source: url })\n try {\n await UI.load()\n const { text } = await UI.sources.load(url)\n if (!isCurrent()) return\n const page = new DOMParser().parseFromString(text, \"text/html\")\n const root = selector ? page.querySelector(selector) : (PropertyEditorPages.editorIn(page) ?? page.body)\n if (!root) {\n E.Warnings.warn(\"<ui-property-editor>\", `${url} has nothing matching \\`${selector}\\``)\n return\n }\n this.takeLayout(root, page)\n this.send(OWN.loaded, { source: url, content: text })\n } catch (error) {\n E.Warnings.warn(\"<ui-property-editor>\", `can't load its layout from ${url}:`, error)\n }\n }\n\n /**\n * Take `root`'s children as its layout (and, a page's editor, the attributes it doesn't have);\n * then fill each group that has a `select` and nothing in it from `page`.\n * - SIDE EFFECT: writes its light DOM and its attributes.\n */\n private takeLayout(root: Element, page: Document) {\n this.removeMadeProperties(MADE_FROM.source)\n if (root.localName === this.domElement.localName) {\n for (const { name, value } of root.attributes) {\n // not over one it has, as an attribute or as a property (`schema` set by a script)\n const own = (this.domElement as unknown as Record<string, unknown>)[E.camelCase(name)]\n if (!this.domElement.hasAttribute(name) && own == null) this.domElement.setAttribute(name, value)\n }\n }\n for (const child of root.children) {\n const made = document.importNode(child, true)\n made.setAttribute(MADE_ATTRIBUTE, MADE_FROM.source)\n this.domElement.append(made)\n }\n for (const group of this.domElement.querySelectorAll(`${GROUP_SELECTOR}:is([selector], [select])`)) {\n if (group.children.length) continue\n const part = page.querySelector((group.getAttribute(\"selector\") ?? group.getAttribute(\"select\"))!)\n for (const child of part?.children ?? []) group.append(document.importNode(child, true))\n }\n }\n\n ////////////////\n // ## A nested editor's thing\n ////////////////\n\n /** The property a nested editor edits the thing of (`data-value-from`, set by the property that made it). */\n private get valueFrom(): string | undefined {\n return this.attributes[VALUE_FROM_ATTRIBUTE] ?? undefined\n }\n\n /** What it's bound to: `value`, else (nested) the thing its property holds, in the scope around it. */\n get boundValue(): unknown {\n const own = this.value\n if (own !== undefined || !this.valueFrom) return own\n const around = this.domElement.parentElement\n return around ? FormBinding.read(FormBinding.scopeAround(around), this.valueFrom) : undefined\n }\n\n /** Bound: there's a thing (or things) to edit. */\n get isBound(): boolean {\n return FormBinding.isObject(this.boundValue)\n }\n\n /** Hold `boundValue` as the scope its properties bind to (over the form's `value`). */\n onMount() {\n const result = super.onMount()\n FormBinding.hold(this.domElement, () => this.boundValue)\n return result\n }\n\n ////////////////\n // ## The section around it\n ////////////////\n\n /** Which of its named slots have light-DOM content: `slot=\"label\"`, `slot=\"output\"` ... */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** It has a title, so it draws a section: `label` or `slot=\"label\"`. */\n get hasTitle(): boolean {\n return !!this.attributes.label || this.slots.hasContent(this.slotForName(OWN.label))\n }\n\n /** The section attributes it was given, raw, to pass on. */\n private get sectionAttributes(): Record<string, string> {\n const passed: Record<string, string> = {}\n for (const name of SECTION_ATTRIBUTES) {\n const value = this.attributes[name]\n if (value != null) passed[name] = value\n }\n return passed\n }\n\n /** A section attribute isn't a class word of the form's box: the section draws it. */\n protected classValue(name: E.AttributeName<typeof formVocabulary>): unknown {\n if (SECTION_ATTRIBUTES.has(name)) return undefined\n return super.classValue(name)\n }\n\n ////////////////\n // ## States\n ////////////////\n\n /** `:state(readonly)`: `readonly`. */\n /** Always `:state(property-editor)`: how its family finds it, whatever its tag is called (`EDITOR_SELECTOR`). */\n @E.cssState(\"property-editor\")\n get isPropertyEditor(): boolean {\n return true\n }\n\n @E.cssState(\"readonly\")\n get isReadOnly(): boolean {\n return this.attributes.readonly != null && this.attributes.readonly !== \"false\"\n }\n\n ////////////////\n // ## Compact, columns and defaults (epic `debut` P31)\n ////////////////\n\n /** `:state(compact)`: `compact`, the tight look its groups and properties read too. */\n @E.cssState(\"compact\")\n get isCompact(): boolean {\n return E.Converters.boolean(this.attributes.compact)\n }\n\n /** How many columns its properties lay out on: `columns`, else 2 when compact, else 1. */\n get columnCount(): number {\n return UIPropertyEditor.columnsFrom(this.attributes.columns) ?? (this.isCompact ? 2 : 1)\n }\n\n /** `:state(grid)`: its properties lay out on columns. */\n @E.cssState(\"grid\")\n get isGrid(): boolean {\n return this.isCompact || this.columnCount > 1\n }\n\n /** `:state(show-defaults)`: a value other than its default shows bold. */\n @E.cssState(\"show-defaults\")\n get showsDefaults(): boolean {\n return E.Converters.boolean(this.attributes[\"show-defaults\"])\n }\n\n /** A `columns` attribute's count, `undefined` for none (or nonsense). */\n static columnsFrom(text: string | null | undefined): number | undefined {\n const count = Math.round(Number(text))\n return text && count >= 1 ? count : undefined\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n render(): JSX.Element {\n return (\n <div\n class={this.rootClass}\n style={{ [COLUMNS_PROPERTY]: String(this.columnCount) }}\n part={`${this.partForName(OWN.editor)} ${this.partForName(OWN.form)}`}\n inert={this.disabled || this.loading}\n aria-busy={this.loading ? \"true\" : undefined}\n >\n <Show when={this.hasTitle} fallback={this.body()}>\n <Dynamic component={SECTION_TAG} {...this.sectionAttributes}>\n <For each={this.forwardedSlots}>{(name) => <slot name={name} slot={name} />}</For>\n {this.outputAndError()}\n {this.body()}\n </Dynamic>\n </Show>\n {this.debugBox()}\n </div>\n )\n }\n\n /**\n * The section's named slots it has content for, passed on: only those, so an empty one never hides the\n * section's own text (`label`) or draws an empty box (`actions`).\n */\n private get forwardedSlots(): string[] {\n return FORWARDED_SLOTS.filter((name) => this.slots.hasContent(name))\n }\n\n /** The properties, then Save and Cancel with `apply=\"on save\"`. */\n private body(): JSX.Element {\n return (\n <>\n <Show when={!this.hasTitle}>{this.outputAndError()}</Show>\n <slot />\n <Show when={this.apply === ON_SAVE}>\n <div class={FOOTER} part={this.partForName(OWN.footer)}>\n <Dynamic component={BUTTON_TAG} color=\"primary\" onClick={() => this.save()}>\n {this.translationForKey(OWN.save)}\n </Dynamic>\n <Dynamic component={BUTTON_TAG} onClick={() => this.cancel()}>\n {this.translationForKey(OWN.cancel)}\n </Dynamic>\n </div>\n </Show>\n </>\n )\n }\n\n /** Its `output` (in the title bar's actions) and `error` (a line under the title). */\n private outputAndError(): JSX.Element {\n const output = this.attributes.output\n const error = this.attributes.error\n return (\n <>\n <Show when={output || this.slots.hasContent(this.slotForName(OWN.output))}>\n <span class={OUTPUT} part={this.partForName(OWN.output)} slot={this.hasTitle ? ACTIONS_SLOT : undefined}>\n <slot name={this.slotForName(OWN.output)}>{output}</slot>\n </span>\n </Show>\n <Show when={error}>\n <div class={ERROR_LINE} part={this.partForName(OWN.errorLine)} role=\"alert\">\n {error}\n </div>\n </Show>\n </>\n )\n }\n\n ////////////////\n // ## Its properties and groups hear what happened\n ////////////////\n\n /** `writer`, when it's given one: it writes a property's value to its thing, in place of the plain set. */\n protected writesItself(target: object, name: string, value: unknown): boolean {\n const writer = E.Reactive.attributeValue(this, \"writer\")\n return typeof writer === \"function\" && !!(writer as PropertyWriter)({ thing: target, name, value })\n }\n\n /** A property was written: `ui-changed` from the editor and the property, then its \"on change\" rules. */\n protected onWritten({ control, name, value, things }: WrittenProperty) {\n const property = control.closest(PROPERTY_SELECTOR)\n property?.dispatchEvent(new CustomEvent(CHANGE_EVENT, { detail: { name, value }, bubbles: false }))\n this.send(OWN.change, { name, value, things })\n const spec = this.currentSchema?.attributes.find((candidate) => candidate.name === name)\n for (const ruleName of spec?.onChange ?? []) {\n const rule = UI.propertyControls.rule(ruleName)\n if (!rule) {\n E.Warnings.warn(\"<ui-property-editor>\", `no rule \\`${ruleName}\\`: add it with UI.propertyControls.addRule()`)\n continue\n }\n try {\n rule({ things, property: spec!, value })\n } catch (error) {\n E.Warnings.warn(\"<ui-property-editor>\", `rule \\`${ruleName}\\` failed:`, error)\n }\n }\n }\n\n /** A field was checked: its group shows the error state, and hears `ui-invalid`. */\n protected onFieldChecked(field: { identifier: string; controls: Element[] }, messages: readonly string[]) {\n const group = field.controls[0]?.closest(GROUP_SELECTOR) as DOMGroupLike | null\n if (!group) return\n group.markFieldFailed?.(field.identifier, messages.length > 0)\n if (messages.length) {\n group.dispatchEvent(\n new CustomEvent(INVALID_EVENT, { detail: { field: field.identifier, errors: messages }, bubbles: false })\n )\n }\n }\n\n /** Held edits came or went: each property and group says whether it holds one. */\n protected onHeldChanged() {\n const held = new Set(this.heldControls)\n const properties = new Set<Element>()\n const groups = new Set<Element>()\n for (const control of held) {\n const property = control.closest(PROPERTY_SELECTOR)\n if (property) properties.add(property)\n const group = control.closest(GROUP_SELECTOR)\n if (group) groups.add(group)\n }\n for (const property of this.domElement.querySelectorAll(PROPERTY_SELECTOR)) {\n ;(property as PropertyLike).markChanged?.(properties.has(property))\n }\n for (const group of this.domElement.querySelectorAll(GROUP_SELECTOR)) {\n ;(group as DOMGroupLike).markChanged?.(groups.has(group))\n }\n }\n\n /** A submit or a save passed: each group hears `ui-saved`. */\n protected onSucceeded() {\n for (const group of this.domElement.querySelectorAll(GROUP_SELECTOR)) {\n group.dispatchEvent(new CustomEvent(SUCCESS_EVENT, { detail: { values: this.values }, bubbles: false }))\n }\n }\n}\n\n/** The section's attributes the editor passes on (all but those the editor has of its own). */\nconst SECTION_ATTRIBUTES = new Set(\n sectionVocabulary.attributes\n .map((spec) => spec.name as string)\n .filter((name) => ![\"source\", \"selector\", \"size\", \"inverted\", \"loading\", \"disabled\", \"parent\"].includes(name))\n)\n\n/** The section's named slots the editor passes on. */\nconst FORWARDED_SLOTS = sectionVocabulary.slots.map((slot) => slot.name as string).filter(Boolean)\n\n/** What a property's write tells the editor. */\ntype WrittenProperty = { control: Element; name: string; value: unknown; things: readonly object[] }\n\n/** What the editor calls on a group's DOM element. */\ntype DOMGroupLike = HTMLElement & {\n markFieldFailed?(identifier: string, isFailed: boolean): void\n markChanged?(isChanged: boolean): void\n}\n\n/** What the editor calls on a property's DOM element. */\ntype PropertyLike = Element & { markChanged?(isChanged: boolean): void }\n\n/**\n * The editor's own names (and the section's it uses), typed for `partForName()` and its kin:\n * TypeScript knows only the form's literals (the vocabulary's cast, above), so each is `never` to it.\n */\nconst OWN = {\n editor: \"editor\",\n form: \"form\",\n footer: \"footer\",\n output: \"output\",\n errorLine: \"error-line\",\n label: \"label\",\n save: \"save\",\n cancel: \"cancel\",\n change: \"ui-changed\",\n loading: \"ui-loading\",\n loaded: \"ui-loaded\"\n} as unknown as Record<string, never>\n\n/**\n * Where its column count reaches its grid, and its groups': inherited, so a group without `columns` takes it.\n * - Plumbing, never set by a page: `columns` is the API.\n */\nexport const COLUMNS_PROPERTY = \"--_property-editor-columns\"\n\n/** The section it draws, and its buttons. */\nconst SECTION_TAG = \"ui-section\"\nconst BUTTON_TAG = \"ui-button\"\n\n/** The section's slot the output goes in: its title bar's end. */\nconst ACTIONS_SLOT = \"actions\"\n\n/** `apply`'s word for held edits. */\nconst ON_SAVE = \"on save\"\n\n/** Events it sends on its properties and groups (and on itself). */\nconst CHANGE_EVENT = \"ui-changed\"\nconst INVALID_EVENT = \"ui-invalid\"\nconst SUCCESS_EVENT = \"ui-saved\"\n\n/** Shadow classes. */\nconst FOOTER = \"footer\"\nconst OUTPUT = \"output\"\nconst ERROR_LINE = \"error-line\"\n","/**\n * The English vocabulary of `<ui-property-group>`: every name the tag uses.\n * - Its own names first, then `<ui-section>`'s, which it PASSES THROUGH (it is one), where they mean the same.\n * - Not passed through: `source`, and what only works with it (`ui-loaded`, `:state(loaded)`, the load texts).\n * - Its own `select` picks from the editor's `source` page instead.\n * - The shape is `E.ComponentVocabulary`. Pure data.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\nimport { sectionVocabulary } from \"spell/ui/components/ui-section/UISection.en\"\nimport { passThrough } from \"./UIPropertyEditor.types\"\n\n/** The section's names that only work with `source`: a group has none. */\nconst SOURCE_ONLY = [\n \"source\",\n \"ui-loaded\",\n \"loaded\",\n \"sourceLoadError\",\n \"sourceCrossOrigin\",\n \"sourceFileProtocol\",\n \"sourceRenderError\"\n]\n\n/****************\n * ### `propertyGroupVocabulary`\n * The names of `<ui-property-group>`: a folding band of properties in a `<ui-property-editor>`.\n ****************/\nexport const propertyGroupVocabulary = {\n ...sectionVocabulary,\n tag: \"ui-property-group\",\n icon: \"layer group\",\n topics: [\"forms\", \"layout\"],\n aka: [\"property group\", \"fieldset\", \"settings group\", \"inspector section\"],\n description:\n \"A property group is a band of properties that opens and closes, in a property editor. It takes `<ui-section>`'s attributes.\",\n attributes: passThrough<E.AttributeSpec>(\n [\n {\n name: \"selector\",\n group: \"appearance\",\n kind: \"string\",\n replaces: [\"select\"],\n description:\n \"A CSS selector: the group's properties are its first match in the editor's `source` page (P6). \" +\n \"Its old name was `select`.\"\n },\n {\n name: \"readonly\",\n group: \"form\",\n kind: \"boolean\",\n description: \"Shows every value; nothing can be changed. Reaches every property in it.\"\n },\n {\n name: \"state\",\n group: \"form\",\n kind: \"valueOnly\",\n values: UIT.FormStates,\n description: \"Its state: tints its title. A property in it failing validation shows `error` on top.\"\n },\n {\n name: \"output\",\n group: \"content\",\n kind: \"string\",\n description: 'A value at the end of the title bar; `slot=\"output\"`.'\n },\n { name: \"error\", group: \"form\", kind: \"string\", description: \"An error under the title, and the `error` state.\" },\n {\n name: \"columns\",\n group: \"layout\",\n kind: \"number\",\n description:\n \"How many columns its properties lay out on (a short one takes one, the rest a whole row). \" +\n \"None: its editor's (2 when the editor is `compact`).\"\n },\n {\n name: \"flags\",\n group: \"appearance\",\n kind: \"valueOnly\",\n values: [\"pills\", \"checkboxes\"],\n description:\n \"Its yes-or-no properties: `pills`, every run of them one select of pills; `checkboxes`, never. \" +\n \"None: three or more side by side are pills, fewer stay checkboxes.\"\n }\n ] as const satisfies readonly E.AttributeSpec[],\n [sectionVocabulary.attributes],\n SOURCE_ONLY\n ),\n events: passThrough<E.EventSpec>(\n [\n {\n name: \"ui-invalid\",\n detail: \"{ field: string, value: FieldValue, errors: string[], values: Record<string, FieldValue> }\",\n description: \"A property in the group failed validation (the editor sends it on the group too).\"\n },\n {\n name: \"ui-saved\",\n detail: \"{ values: Record<string, FieldValue>, originalEvent?: Event }\",\n description: \"The editor's submit or Save passed validation (sent on each group too).\"\n }\n ] as const satisfies readonly E.EventSpec[],\n [sectionVocabulary.events],\n SOURCE_ONLY\n ),\n slots: passThrough<E.SlotSpec>(\n [{ name: \"output\", description: \"Rich output (instead of `output`).\" }] as const satisfies readonly E.SlotSpec[],\n [sectionVocabulary.slots]\n ),\n parts: passThrough<E.PartSpec>(\n [\n { name: \"output\", description: \"The output.\" },\n { name: \"error-line\", description: \"The group's own error, under its title.\" }\n ] as const satisfies readonly E.PartSpec[],\n [sectionVocabulary.parts]\n ),\n states: passThrough<E.StateSpec>(\n [\n { name: \"changed\", description: 'A property in it has an edit not saved yet (`apply=\"on save\"`).' },\n { name: \"readonly\", description: \"Nothing in it can be changed (`readonly`).\" },\n { name: \"error\", description: \"Its `error`, or a property in it failing validation.\" },\n { name: \"compact\", description: \"Its editor is `compact`: a tight band.\" },\n { name: \"grid\", description: \"Its properties lay out on columns (`columns`, or its editor's).\" }\n ] as const satisfies readonly E.StateSpec[],\n [sectionVocabulary.states],\n SOURCE_ONLY\n ),\n texts: passThrough<E.TextSpec>([], [sectionVocabulary.texts], SOURCE_ONLY)\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-property-group>`'s own parts, adopted after the section's (`UISection.css`).\n * - `.output`: a value at the end of the title bar (mono, muted).\n * - `.error-line`: its own error, first in the content.\n * - `state` / an error tint the title (`.error`, `.info` ... on the box).\n * - `:state(grid)`: its content a grid of `--_property-editor-columns` columns (its own `columns`, else its\n * editor's); its properties say how much of a row they take (`UIProperty.css`).\n * - `:state(compact)` (its editor's; epic `debut` P31): a tight band, 4px above and below its title, its look\n * the theme's: `--ui-property-editor-band-transform` (case), `-band-weight`, `-band-size`, `-band-background`.\n * Spell UI's own: Title Case as written, 13px bold, on the panel's quiet band.\n */\n\n@layer ui.components.property-group.content, ui.components.property-group.variations, ui.components.property-group.states;\n\n@layer ui.components.property-group.content {\n .output {\n margin-inline-start: 0.5em;\n color: var(--ui-text-muted);\n font-family: var(--ui-font-family-mono);\n font-size: 0.92em;\n font-variant-numeric: tabular-nums;\n }\n .error-line {\n margin: 0 0 0.75em;\n color: var(--ui-negative-text);\n font-size: 0.85714em;\n }\n}\n\n@layer ui.components.property-group.variations {\n /* ## In its editor's grid, a whole row; its own content a grid while `:state(grid)` */\n :host {\n grid-column: 1 / -1;\n }\n :host(:state(grid)) .section > .content {\n --_property-editor-field-width: auto;\n display: grid;\n /* the rows' gap is each field's own margin (the form's row distance), never the panel's gap on top of it */\n row-gap: 0;\n grid-template-columns: repeat(var(--_property-editor-columns, 1), minmax(0, 1fr));\n column-gap: var(--_ui-property-editor-column-gap, var(--ui-form-gutter, 1em));\n align-items: start;\n }\n :host(:state(grid)) .section > .content > :not(slot) {\n grid-column: 1 / -1;\n }\n\n /* ## A compact editor's band: tight, its look the theme's */\n :host(:state(compact)) .ui.section.panel.sub {\n --_ui-property-editor-band-transform: var(--ui-property-editor-band-transform, none);\n --_ui-property-editor-band-weight: var(--ui-property-editor-band-weight, var(--ui-font-weight-bold, 700));\n --_ui-property-editor-band-size: var(--ui-property-editor-band-size, 13px);\n --_ui-property-editor-band-background: var(\n --ui-property-editor-band-background,\n var(--_ui-panel-subhead-background)\n );\n --_ui-panel-band-space: 4px;\n --_ui-panel-gap: var(--_ui-property-editor-row-gap, 8px);\n /* its editor lays groups out with no gap between them (each field its own margin): so the band-space above a\n group is its own, not less a gap that isn't there, which pulled it up over the room under the group before */\n --_ui-panel-outer-gap: 0px;\n }\n /* its properties at the editor's size, not a sub-panel's smaller one */\n /* room under its last property, before the next band */\n :host(:state(compact)) .ui.section.panel.sub > .content {\n font-size: var(--_ui-property-editor-font-size, 1em);\n padding-block-end: var(--_ui-property-editor-row-gap, 8px);\n }\n :host(:state(compact)) .ui.section.panel.sub > .title {\n padding-block: 4px;\n background: var(--_ui-property-editor-band-background);\n }\n :host(:state(compact)) .ui.section.panel.sub > .title > .heading,\n :host(:state(compact)) .ui.section.panel.sub > .title > .heading > .toggle {\n font-size: var(--_ui-property-editor-band-size);\n font-weight: var(--_ui-property-editor-band-weight);\n letter-spacing: 0;\n text-transform: var(--_ui-property-editor-band-transform);\n }\n :host(:state(compact)) .ui.section.panel.sub > .title > .heading > .toggle {\n font-size: 1em;\n }\n}\n\n@layer ui.components.property-group.states {\n .error.section > .title {\n color: var(--ui-negative-text);\n }\n .info.section > .title {\n color: var(--ui-info-text, var(--ui-blue-text));\n }\n .success.section > .title {\n color: var(--ui-positive-text);\n }\n .warning.section > .title {\n color: var(--ui-warning-text, var(--ui-yellow-text));\n }\n}\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\n// the family barrel, not the leaf: the lib build then imports `ui-panel.js` instead of splitting a shared chunk\n// (SIDE EFFECT: defines `<ui-panel>`, and `<ui-section>` / `<ui-sections>`: a group is a panel's band)\nimport { UIPanel } from \"spell/ui/components/ui-panel\"\nimport type { SectionVocabulary } from \"spell/ui/components/ui-section/UISection.types\"\nimport { UIProperty } from \"./UIProperty\"\nimport { COLUMNS_PROPERTY, UIPropertyEditor } from \"./UIPropertyEditor\"\nimport { propertyGroupVocabulary } from \"./UIPropertyGroup.en\"\n\nimport groupCSS from \"./UIPropertyGroup.css?inline\"\n\n/****************\n * ### `DOMPropertyGroupElement`\n * The DOM element of `<ui-property-group>`: a section's, plus what its editor tells it.\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMPropertyGroupElement extends E.DOMLoadableBodyElement {\n /** A property in it (`identifier`) failed validation, or passed again: `:state(error)` follows. */\n markFieldFailed(identifier: string, isFailed: boolean) {\n ;(this.component as UIPropertyGroup | undefined)?.markFieldFailed(identifier, isFailed)\n }\n\n /** A property in it holds an edit not saved yet, or none does: `:state(changed)`. */\n markChanged(isChanged: boolean) {\n const component = this.component as UIPropertyGroup | undefined\n if (component) component.isChanged = isChanged\n }\n}\n\n/****************\n * ### `UIPropertyGroup`\n * The component behind `<ui-property-group>`: a folding band of properties in a `<ui-property-editor>`.\n *\n * - It IS a `<ui-section>`, drawn as a panel's SUB-HEAD BAND (it extends `UIPanel`, which extends `UISection`):\n * the same attributes, slots, parts, events and folding.\n * - Its title a band across its editor (small capitals, tinted, a hairline above), the chevron at its far end:\n * the theme editor's bands (Owen: \"Property panels should have this styling for section headers\").\n * - The band reaches out through the panel padding around it (`--ui-panel-padding`), to its container's edges.\n * - All but `source`: a group's properties come from its editor.\n * - Its `select` picks its part of the editor's page (P6).\n * - Its own:\n * - `output`, at the end of the title bar\n * - `error`, a line under the title\n * - `state` tints its title\n * - `:state(error)`: its own `error`, or a property failing validation\n * - `readonly`: every property in it is readonly (each reads it as it connects)\n * - `:state(changed)`: a property in it holds an edit not saved yet\n * - The editor tells it about its properties (`markFieldFailed()`, `markChanged()`),\n * and sends it `ui-invalid` and `ui-saved`.\n ****************/\nexport class UIPropertyGroup extends UIPanel {\n // the section's names under the group's tag, and its own: TypeScript only knows the section's literals\n @E.proto static vocabulary = propertyGroupVocabulary as unknown as SectionVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { ...UIPanel.prototype.elementSetup.styleSheets, group: groupCSS },\n DOMElement: DOMPropertyGroupElement\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## Errors and changes\n ////////////////\n\n /** Its properties failing validation now, by identifier. */\n @E.state accessor failedFields: ReadonlySet<string> = new Set()\n\n /** Note a property failing validation, or passing again. */\n @E.untracked\n markFieldFailed(identifier: string, isFailed: boolean) {\n if (this.failedFields.has(identifier) === isFailed) return\n const next = new Set(this.failedFields)\n if (isFailed) next.add(identifier)\n else next.delete(identifier)\n this.failedFields = next\n }\n\n /** `:state(error)`: its `error`, a property in it failing validation, or (the section's) a failed load. */\n /** Always `:state(property-group)`: how its family finds it, whatever its tag is called (`GROUP_SELECTOR`). */\n @E.cssState(\"property-group\")\n get isPropertyGroup(): boolean {\n return true\n }\n\n @E.cssState(\"error\")\n get isError(): boolean {\n return !!this.attributes.error || this.failedFields.size > 0 || this.attributes.state === ERROR\n }\n\n /** `:state(changed)`: a property in it holds an edit not saved yet. */\n @E.cssState(\"changed\")\n @E.state\n accessor isChanged = false\n\n ////////////////\n // ## Its editor's look (epic `debut` P31)\n ////////////////\n\n /** The editor around it, while connected. */\n @E.state private accessor editor: DOMEditorLike | undefined = undefined\n\n /** Find its editor on connect. */\n @E.whileConnected\n protected watchEditor() {\n this.editor = UIProperty.editorAround(this.domElement) as DOMEditorLike | undefined\n return () => {\n this.editor = undefined\n }\n }\n\n /** `:state(compact)`: its editor is `compact`, so its band is tight (`UIPropertyGroup.css`). */\n @E.cssState(\"compact\")\n get isCompact(): boolean {\n return !!this.editor?.isCompact\n }\n\n /** How many columns its properties lay out on: `columns`, else its editor's. */\n get columnCount(): number {\n return UIPropertyEditor.columnsFrom(this.attributes.columns) ?? this.editor?.columnCount ?? 1\n }\n\n /** `:state(grid)`: its properties lay out on columns. */\n @E.cssState(\"grid\")\n get isGrid(): boolean {\n return this.columnCount > 1 || !!this.editor?.isGrid\n }\n\n /** Its column count, where its grid reads it. */\n protected get contentStyle(): Record<string, string> | undefined {\n return { ...super.contentStyle, [COLUMNS_PROPERTY]: String(this.columnCount) }\n }\n\n /** `:state(readonly)`: `readonly`. */\n @E.cssState(\"readonly\")\n get isReadOnly(): boolean {\n const readonly = this.attributes.readonly\n return readonly != null && readonly !== \"false\"\n }\n\n /**\n * Always a band (`sub`), in a panel or not: `loose` with no panel around it, so it takes `primary`'s colours\n * as a panel does (`UIPanel.css`); and `state`'s class word on the box (`error`, `info` ...), shown as an\n * error while one is.\n */\n protected get extraClass(): string | undefined {\n const state = this.isError ? ERROR : (this.attributes.state ?? undefined)\n const loose = this.enclosingSection instanceof UIPanel ? undefined : LOOSE\n const words = new Set([...(super.extraClass ?? \"\").split(\" \"), BAND, loose, GROUP, state])\n return [...words].filter(Boolean).join(\" \")\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** `output`, at the end of the title bar. */\n protected titleBarEnd(): JSX.Element {\n const output = this.attributes.output\n return (\n <Show when={output || this.slots.hasContent(OUTPUT)}>\n <span class={OUTPUT} part={OUTPUT}>\n <slot name={OUTPUT}>{output}</slot>\n </span>\n </Show>\n )\n }\n\n /** `error`, a line first in the content. */\n protected contentStart(): JSX.Element {\n const error = this.attributes.error\n return (\n <Show when={error}>\n <div class={ERROR_LINE} part={ERROR_LINE} role=\"alert\">\n {error}\n </div>\n </Show>\n )\n }\n}\n\n/** What a group reads of its editor's DOM element. */\ntype DOMEditorLike = HTMLElement & {\n readonly isCompact: boolean\n readonly isGrid: boolean\n readonly columnCount: number\n}\n\n/** The panel's class word for a sub-head band (`UIPanel.css`): every group is one. */\nconst BAND = \"sub\"\n\n/** Class word of a band with no panel around it (`UIPanel.css`). */\nconst LOOSE = \"loose\"\n\n/** Class word before the section's noun: `ui … property-group section`. */\nconst GROUP = \"property-group\"\n\n/** The error state's word. */\nconst ERROR = \"error\"\n\n/** Its own parts and slot: plain names (the vocabulary's own; TypeScript knows only the section's). */\nconst OUTPUT = \"output\"\nconst ERROR_LINE = \"error-line\"\n","/**\n * The property editor family: defines `<ui-property-editor>`, `<ui-property-group>` and `<ui-property>`,\n * and exports their components.\n * - SIDE EFFECT: importing it defines the tags.\n * Its components import the form and section families first: the editor is a form and draws a section,\n * a group is a section, a property is a field.\n * - Also the library's `spell/ui/ui-property-editor` entry.\n */\n\nimport { DOMPropertyElement, UIProperty } from \"./UIProperty\"\nimport { DOMPropertyEditorElement, UIPropertyEditor } from \"./UIPropertyEditor\"\nimport { DOMPropertyGroupElement, UIPropertyGroup } from \"./UIPropertyGroup\"\n\nUIPropertyEditor.define()\nUIPropertyGroup.define()\nUIProperty.define()\n\nexport type { PropertyOrigin } from \"./UIPropertyEditor.types\"\nexport {\n UIPropertyEditor,\n UIPropertyGroup,\n UIProperty,\n DOMPropertyEditorElement,\n DOMPropertyGroupElement,\n DOMPropertyElement\n}\n"],"mappings":";;;;;;;;AAmBA,IAAasI,IAAb,MAAa,gBAAgB;CAE3B,OAAO,eAAe,GAAqD;EACzE,OAAO;GAAE,MAAMC,EAAW;GAAK,aAAaA,EAAW;GAAa,YAAYA,EAAW;EAAW;CACxG;CAaA,OAAO,eAAe,GAAoB,GAAiC;EACzE,IAAI,CAAC,eAAeC,CAAM,GACxB,MAAU,UAAU,wFAAwF;EAE9G,OAAO;GACL,MAAMC,KAAQD,EAAO,SAAS;GAC9B,aAAaA,EAAO;GACpB,YAAY,gBAAgB,uBAAuBA,CAAM;EAC3D;CACF;CAQA,OAAO,WAAW,GAAgC,IAAO,IAAsB;EAC7E,OAAO;GAAE;GAAM,YAAY,gBAAgB,mBAAmBE,CAAK;EAAE;CACvE;CAOA,OAAO,OAAO,GAAoC;EAChD,IAAIC,EAAK,MAAM,OAAOA,EAAK;EAC3B,QAAQA,EAAK,MAAb;GACE,KAAK;GACL,KAAK,WACH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