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-menu.js","names":["UIT.MenuAppearances","UIT.ItemAlignments","WHOLE","E.Queued","E.beforeNextPaint","OVERFLOW","ICONS","<Show when={this.isShrinking && !isServer}>\n <button\n ref={(element) => this.overflowButton = element}\n type=\"button\"\n class={OVERFLOW_ITEM_CLASS}\n part={this.partForName(\"overflow\")}\n style={this.overflowMenu.anchorStyle}\n role={this.interactive ? \"menuitem\" : void 0}\n aria-haspopup=\"menu\"\n aria-expanded={this.overflowMenu.ariaExpanded}\n aria-controls={this.overflowMenuId}\n aria-label={this.isSegmented ? void 0 : this.moreText}\n title={this.isSegmented ? this.chosen?.text : this.moreText}\n onClick={() => this.isOverflowOpen ? this.closeOverflow() : this.openOverflow()}\n onKeyDown={this.onOverflowButtonKey}\n >\n <Show when={this.isSegmented} fallback={this.moreFace()}>\n {this.dropdownFace()}\n </Show>\n </button>\n </Show>","this","ref={(element) => this.overflowButton = element}","<Show when={this.isSegmented} fallback={this.moreFace()}>\n {this.dropdownFace()}\n </Show>","part={this.partForName(\"overflow\")}","style={this.overflowMenu.anchorStyle}","role={this.interactive ? \"menuitem\" : void 0}","aria-expanded={this.overflowMenu.ariaExpanded}","aria-controls={this.overflowMenuId}","aria-label={this.isSegmented ? void 0 : this.moreText}","title={this.isSegmented ? this.chosen?.text : this.moreText}","<button\n ref={(element) => this.overflowButton = element}\n type=\"button\"\n class={OVERFLOW_ITEM_CLASS}\n part={this.partForName(\"overflow\")}\n style={this.overflowMenu.anchorStyle}\n role={this.interactive ? \"menuitem\" : void 0}\n aria-haspopup=\"menu\"\n aria-expanded={this.overflowMenu.ariaExpanded}\n aria-controls={this.overflowMenuId}\n aria-label={this.isSegmented ? void 0 : this.moreText}\n title={this.isSegmented ? this.chosen?.text : this.moreText}\n onClick={() => this.isOverflowOpen ? this.closeOverflow() : this.openOverflow()}\n onKeyDown={this.onOverflowButtonKey}\n >\n <Show when={this.isSegmented} fallback={this.moreFace()}>\n {this.dropdownFace()}\n </Show>\n </button>","name={this.slotForName(\"overflow\")}","<Show when={this.hasFoldedBadge}>\n <span class={DOT} aria-hidden=\"true\" />\n </Show>","<span class={DOT} aria-hidden=\"true\" />","<Show when={this.chosenGlyph.svg}>\n <span class={UIT.ICON}>{this.chosenGlyph.svg}</span>\n </Show>","<span class={UIT.ICON}>{this.chosenGlyph.svg}</span>","<Show when={this.isShrinking && !isServer}>\n <div\n ref={(element) => this.overflowPanel = element}\n id={this.overflowMenuId}\n class={OVERFLOW_MENU_CLASS}\n part={this.partForName(\"overflow-menu\")}\n role=\"menu\"\n popover=\"manual\"\n style={this.overflowMenu.panelStyle}\n aria-label={this.moreText}\n onKeyDown={this.onOverflowMenuKey}\n >\n <For each={this.folded}>{(row) => this.foldedRow(row)}</For>\n </div>\n </Show>","ref={(element) => this.overflowPanel = element}","<For each={this.folded}>{(row) => this.foldedRow(row)}</For>","class={OVERFLOW_MENU_CLASS}","part={this.partForName(\"overflow-menu\")}","style={this.overflowMenu.panelStyle}","aria-label={this.moreText}","<div\n ref={(element) => this.overflowPanel = element}\n id={this.overflowMenuId}\n class={OVERFLOW_MENU_CLASS}\n part={this.partForName(\"overflow-menu\")}\n role=\"menu\"\n popover=\"manual\"\n style={this.overflowMenu.panelStyle}\n aria-label={this.moreText}\n onKeyDown={this.onOverflowMenuKey}\n >\n <For each={this.folded}>{(row) => this.foldedRow(row)}</For>\n </div>","role={row.isSelected ? \"menuitemradio\" : \"menuitem\"}","aria-checked={row.isSelected ? \"true\" : void 0}","aria-disabled={row.isDisabled ? \"true\" : void 0}","class={UIT.ICON}","class={TITLE}","<button\n type=\"button\"\n class={[ROW, { [SELECTED_CLASS]: row.isSelected, [DISABLED_CLASS]: row.isDisabled }]}\n role={row.isSelected ? \"menuitemradio\" : \"menuitem\"}\n aria-checked={row.isSelected ? \"true\" : void 0}\n aria-disabled={row.isDisabled ? \"true\" : void 0}\n tabindex=\"-1\"\n onClick={() => this.pickFolded(row)}\n >\n <span class={UIT.ICON} aria-hidden=\"true\">\n {glyph ? glyph.svg : icons.length ? icons : <span class={LETTER}>{row.letter}</span>}\n </span>\n <span class={TITLE}>{row.text}</span>\n {badges.length ? <span class={BADGE}>{badges}</span> : void 0}\n </button>","{this.menuBox()}","{this.overflowMenuBox()}","<Switch>\n <Match when={this.parentMenu}>\n <div class={this.subMenuClasses} part={this.partForName(\"menu\")}>\n <slot />\n </div>\n </Match>\n <Match when={this.interactive}>\n <div\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menubar\"\n aria-orientation={this.isVertical ? \"vertical\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </div>\n </Match>\n <Match when={true}>\n <nav\n ref={(element) => this.box = element}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </nav>\n </Match>\n </Switch>","<Match when={this.parentMenu}>\n <div class={this.subMenuClasses} part={this.partForName(\"menu\")}>\n <slot />\n </div>\n </Match>","part={this.partForName(\"menu\")}","<div class={this.subMenuClasses} part={this.partForName(\"menu\")}>\n <slot />\n </div>","<Match when={this.interactive}>\n <div\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menubar\"\n aria-orientation={this.isVertical ? \"vertical\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </div>\n </Match>","ref={(element) => {\n this.bar = element;\n this.box = element;\n }}","<div\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menubar\"\n aria-orientation={this.isVertical ? \"vertical\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </div>","aria-orientation={this.isVertical ? \"vertical\" : void 0}","aria-label={this.landmarkLabel}","<Match when={true}>\n <nav\n ref={(element) => this.box = element}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </nav>\n </Match>","when={true}","ref={(element) => this.box = element}","<nav\n ref={(element) => this.box = element}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </nav>","__name","E.UIComponent","E.proto","E.protoMerged","E.onChange","E.cssState","E.derived","E.on","E.watches","UIT.SELECTED","UIT.ACTIVE","E.untracked","E.state","E.lazy","E.PartContext","E.PopoverPanel","E.IconGlyph","E.Queued","E.afterSolidUpdate","_$createComponent","_$readShallow","_$setAttribute","_$getOwner","UIT.ICON","_$memo","menuCSS","UIT.ITEM","_$delegateEvents","ICON","__publicField","Key","__decorateElement","__decoratorMetadata","__decoratorStart","ITEM","ItemAlignments","__name$1","__runInitializers","SELECTED","ACTIVE","MenuAppearances","__privateAdd","SegmentedThumb","UIMenu_default","getOwner$1","menuVocabulary","word","TitleFit","setup","WHOLE$1","Queued","beforeNextPaint","fonts","FIT","TITLE_MAX","name","STAGE_STATES","next","rows","box","title","others","sizes","titlesRoom","sum","width","OVERFLOW$1","style","fontSize","DEFAULT_FONT_SIZE","shown","gaps","padding","fitsWhole","HAIR","othersWidth","element","room","titles","fixed","itemBox","titleMin","TITLE_MIN","DEFAULT_TITLE_MIN","itemMin","ITEM_MIN","DEFAULT_ITEM_MIN","icons","ICONS$1","isSegmented","answer","CUT","ICONS_ONLY_STATE","OVERFLOW_STATE","DROPDOWN_STATE","resizes","parent","elements","cap","widths","min","sorted","a","b","left","index","share","match","LENGTH","text","fallback","value","EM","boxes","rects","rect","CONTENTS","NONE","SLOT","child","STYLE","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_menuItems_dec","_onMenubarChanged_dec","_isInteractiveMenubar_dec","_pickFolded_dec","_onOverflowMenuKey_dec","_onOverflowButtonKey_dec","_closeOverflow_dec","_openOverflow_dec","_onOverflowOpenChanged_dec","_overflowMenuId_dec","_readFolded_dec","_folded_dec","_rowElements_dec","_fitChildren_dec","_onFitChanged_dec","_isDropdown_dec","_isFolded_dec","_isIconsOnly_dec","_fitAnswer_dec","_chosenBox_dec","_onChoiceChanged_dec","_onThumbChanged_dec","_onClick_dec","_nestedItemContext_dec","_ownItemContext_dec","_isVertical_dec","_onReadyToRove_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_fitAnswer","_folded","other","row","key","_UIMenu","UIComponent","proto","protoMerged","onChange","cssState","derived","on","watches","untracked","state","lazy","PartContext","WHOLE","PopoverPanel","reason","IconGlyph","MORE_ICON","CARET_ICON","event","container","UI","ROWS","afterSolidUpdate","isReady","SEGMENTED","VERTICAL","isInteractive","LINK_LOOK","top","untrack","item","hasThumb","thumb","stop","SELECTED_STATE","ITEM_BOX","ICONS","OVERFLOW","canFit","fit","DEFAULT_SLOT","hide","isOpen","isConnected","refocus","_self$","createComponent","Show","isServer","_el$","addEvent","ref","insert","effect","readShallow","OVERFLOW_ITEM_CLASS","className","_p$","t","setAttribute","o","i","n","h","_self$2","_el$2","_el$3","_el$4","DOT","_v$","_$p","_self$3","_el$5","_el$6","TITLE","_el$7","CARET","_self$4","_el$8","For","OVERFLOW_MENU_CLASS","copies","copy","badges","glyph","_self$5","_el$9","_el$10","_el$11","_el$12","LETTER","_c$","memo","_el$13","BADGE","ROW","SELECTED_CLASS","DISABLED_CLASS","isMenubar","orientation","bar","selected","_self$6","_self$7","Switch","Match","_el$14","_el$15","_el$16","_el$17","_el$18","_el$19","target","root","UIMenu","delegateEvents"],"sources":["../src/components/ui-menu/UIMenu.en.ts","../src/components/ui-menu/TitleFit.ts","../src/components/ui-menu/UIMenu.tsx","../src/components/ui-menu/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-menu>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), events, slots, parts, states and texts.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Pure data: node imports it (`yarn site:data`, `yarn gen:root`), so `spell/ui/core` for types only,\n * `UIT` by value straight from `components.types`.\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-menu appearance=\"secondary pointing\" size=\"large\" items=\"3\">` => `ui large three item secondary pointing menu`.\n * `UIMenu.css` keys on those words.\n * - Items are the generic `<ui-item>` (`spell/ui/components/ui-item`), styled by owner context: `ownsParts` has `item`.\n * A `<ui-menu>` inside a menu is a SUB-MENU (Fomantic's `<div class=\"right menu\">`), so `menu` is owned too;\n * a `<ui-header>` inside an item is a vertical menu's sub header.\n * - `tabular` is Fomantic's classic word; 2.9 renamed it `tabbed` (`@variationMenuTabbedLegacyTabular`).\n * - The look is `appearance`, several words at once (`UIT.MenuAppearances`, shared with `<ui-tabs>`, plus `link` and\n * `borderless`); the older booleans (`tabular`, `pointing`, `secondary`, `text`, `link`, `borderless`) are its\n * old names (`replaces`, epic `ui-gaps` P4), and draw the same class words.\n * - Item layout: `align` (`UIT.ItemAlignments`; its old name `alignment`) places the items, `equal` sizes them alike\n * from the items themselves; `items=\"3\"` / `items=\"equal\"` stay as the older count-based aliases.\n * - `shrinkable` fits the items' titles to the row (`TitleFit`, epic `ui-gaps` P13): cut, then icons only, then one\n * overflow button; its slot, parts, states and text are its own.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `menuVocabulary`\n * The names of `<ui-menu>`, a menu: a `<nav>` of items (links) by default,\n * a `role=\"menubar\"` with roving focus when `interactive`,\n * or a sub-menu `<div class=\"right menu\">` inside another menu.\n ****************/\nexport const menuVocabulary = {\n tag: \"ui-menu\",\n topics: [\"menus\", \"navigation\", \"basic\", \"collections\"],\n aka: [\"navbar\", \"nav\", \"tabs bar\", \"toolbar\", \"sidebar menu\", \"pagination\"],\n skeleton: \"3 tall\",\n noun: \"menu\",\n description: \"A menu displays grouped navigation actions.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Hue of the active item; with `inverted`, the menu's fill; `segmented`, the selected item's fill.\"\n },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [...UIT.MenuAppearances, \"link\", \"borderless\"],\n // its words are Fomantic's classes as they are\n classes: {},\n replaces: [...UIT.MenuAppearances.filter((word) => word !== \"segmented\"), \"link\", \"borderless\"].map((word) => ({\n from: word,\n value: word\n })),\n description:\n \"The look, several words at once: `tabular` (tabs on a rule), `pointing` (the active item points at the \" +\n \"content; an underline with `secondary`), `secondary` (no box, rounded items), `text` (plain words), \" +\n \"`segmented` (a segmented control: a bordered group of joined items, the selected one filled with `color`, \" +\n \"else the primary colour; it moves `selected` to the item chosen itself; `--ui-menu-segmented-*` restyle \" +\n \"it as a pill track with a raised thumb), `link` (every item interactive: a `<button>` with the link \" +\n \"hover), `borderless` (no dividers between items). Old names: the bare switches `tabular`, `pointing`, \" +\n \"`secondary`, `text`, `link`, `borderless`.\"\n },\n {\n name: \"position\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"left\", \"right\", \"center\"],\n description:\n \"Sub-menu: pushes it to the `right` / `left` end, or the `center`. A `vertical tabular` menu: `right` \" +\n \"opens its tabs to the left, for a menu on the content's right (`ui right vertical tabular menu`).\"\n },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"horizontal\", \"vertical\"],\n classes: { horizontal: \"\" },\n replaces: [{ from: \"vertical\", value: \"vertical\" }],\n description:\n \"Which way the items run: `horizontal` (the default) or `vertical`, stacked top to bottom. \" +\n \"Its old name was the bare `vertical` switch.\"\n },\n { name: \"pagination\", group: \"appearance\", kind: \"keyOnly\", description: \"Page links: compact, centred items.\" },\n { name: \"icon\", group: \"content\", kind: \"keyOnly\", description: \"Icon-only items.\" },\n {\n name: \"labeled\",\n group: \"appearance\",\n kind: \"keyOnly\",\n key: \"labeled icon\",\n description: \"Labeled icon items: a large icon above each item's text.\"\n },\n { name: \"fluid\", group: \"layout\", kind: \"keyOnly\", description: \"Takes the full width of its container.\" },\n { name: \"stackable\", group: \"layout\", kind: \"keyOnly\", description: \"Stacks its items on mobile.\" },\n { name: \"centered\", group: \"layout\", kind: \"keyOnly\", description: \"Centred in its container, items centred.\" },\n\n {\n name: \"wrapping\",\n group: \"layout\",\n kind: \"keyOnly\",\n description: \"Items wrap onto more lines when they don't fit.\"\n },\n {\n name: \"wrap\",\n group: \"appearance\",\n kind: \"keyOnly\",\n key: \"wrapped\",\n replaces: [\"wrapped\"],\n description: \"With `wrapping`: square corners where the lines meet. Its old name was `wrapped`.\"\n },\n {\n name: \"inverted\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"The dark scheme; with `color`, filled with the colour.\"\n },\n {\n name: \"padding\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"none\", \"none-x\", \"none-y\", \"compact\"],\n classes: { none: \"fitted\", \"none-x\": \"horizontally fitted\", \"none-y\": \"vertically fitted\" },\n replaces: [\n { from: \"fitted\", value: \"none\", values: { horizontally: \"none-x\", vertically: \"none-y\" } },\n { from: \"compact\", value: \"compact\" }\n ],\n description:\n \"`none`: no item padding; `none-x` / `none-y` keep only the top and bottom, or the left and right; \" +\n \"`compact`: only as wide as its items. Old names: `fitted` (`horizontally`, `vertically`), `compact`.\"\n },\n {\n name: \"attach\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"both\", \"top\", \"bottom\"],\n classes: { both: \"attached\", top: \"top attached\", bottom: \"bottom attached\" },\n replaces: [{ from: \"attached\", value: \"both\" }],\n description:\n \"Joined edge to edge with a segment above (`top`), below (`bottom`), or both (`both`, in the middle). \" +\n \"Its old name was `attached`.\"\n },\n {\n name: \"fixed\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"top\", \"bottom\", \"left\", \"right\"],\n description: \"Fixed to an edge of the viewport.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"valueAndKey\",\n key: \"aligned\",\n values: UIT.ItemAlignments,\n replaces: [\"alignment\"],\n description:\n \"Where the items sit: `fluid` -- they fill the bar; `left` / `center` / `right` -- packed at that end of \" +\n 'a full-width bar (a `segmented` menu moves as a whole). `align=\"center\"` => `center aligned`. ' +\n \"Its old name was `alignment`.\"\n },\n {\n name: \"equal\",\n group: \"layout\",\n kind: \"keyOnly\",\n description:\n 'Every item the same width, from the items themselves (no count): with `align=\"fluid\"` each takes an ' +\n \"equal share of the bar; otherwise each is as wide as the widest, packed.\"\n },\n {\n name: \"items\",\n group: \"content\",\n kind: \"width\",\n widthClass: \"item\",\n canEqual: true,\n description:\n 'Older, count-based alias of `equal`: divides the width evenly between N items (`items=\"3\"` => ' +\n '`three item`); `items=\"equal\"` => `equal width` (Fomantic\\'s, ~== `equal alignment=\"fluid\"`).'\n },\n {\n name: \"shrinkable\",\n group: \"layout\",\n kind: \"boolean\",\n description:\n \"Fits its items' titles to its width: every title whole while they fit; then the longest cut first, \" +\n \"each ending in `…`; once one would be cut under `--ui-menu-title-min`, icons only (`:state(icons-only)`, \" +\n \"each title its item's tooltip; an item with no icon shows its title's first letter); once a button \" +\n \"would be under `--ui-menu-item-min`, every item folds into one `…` button whose menu holds them all \" +\n \"(`:state(overflow)`). A `segmented` one becomes a dropdown instead (`:state(dropdown)`): one button \" +\n \"showing the chosen item. Items with no words (an icon button) stay as they are. Off by default.\"\n },\n {\n name: \"interactive\",\n group: \"behaviour\",\n kind: \"boolean\",\n description:\n \"An application menubar (`role=menubar`): one Tab stop, arrow keys between items, every item a \" +\n \"`menuitem`. Default: a `<nav>` landmark of links.\"\n }\n ],\n events: [\n {\n name: \"ui-choosing\",\n detail: \"{ value: string, item: Element, originalEvent?: Event }\",\n cancelable: true,\n description:\n \"An interactive item (a link or button) was activated. `value` is the item's `value`, else its text. \" +\n \"The menu doesn't move `selected` itself, except a `segmented` one (a single-choice control), which \" +\n \"selects the item and unselects the rest: `preventDefault()` keeps the old choice.\"\n }\n ],\n slots: [\n { name: \"\", description: \"`<ui-item>`s, sub-menus (`<ui-menu position>`), and other content.\" },\n {\n name: \"overflow\",\n description: '`shrinkable`: what the overflow button shows instead of its `…`, e.g. `<ui-icon name=\"bars\">`.'\n }\n ],\n parts: [\n { name: \"menu\", description: \"The menu box: `<nav>`, `<div role=menubar>`, or a sub-menu's `<div>`.\" },\n {\n name: \"overflow\",\n description:\n \"`shrinkable`: the overflow button, shown once the items fold into it (a `segmented` one's dropdown).\"\n },\n { name: \"overflow-menu\", description: \"`shrinkable`: the overflow button's menu, every item in a row.\" }\n ],\n states: [\n { name: \"interactive\", description: \"A menubar (`interactive`).\" },\n { name: \"vertical\", description: 'Items stacked (`direction=\"vertical\"`).' },\n { name: \"icons-only\", description: \"`shrinkable`: the titles are gone, the icons only.\" },\n { name: \"overflow\", description: \"`shrinkable`: every item folded into the overflow button.\" },\n { name: \"dropdown\", description: \"`shrinkable` and `segmented`: one button showing the chosen item, a dropdown.\" }\n ],\n texts: [\n {\n key: \"more\",\n text: \"More\",\n description: \"`shrinkable`: the overflow button's accessible name and tooltip, and its menu's name.\"\n }\n ],\n ownsParts: [\"item\", \"menu\", \"header\"]\n} as const satisfies E.ComponentVocabulary\n","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `TitleFit`\n * How a `shrinkable` menu (`<ui-menu shrinkable>`, `<ui-toolbar shrinkable>`) fits its items' titles to its row,\n * in four stages as it gets narrower (epic `ui-gaps` P13, from the docs toolbars' own; epic `epic-engine` Q29-Q38):\n * 1. every title whole, while they fit\n * 2. the longest titles cut first, down to one width, each ending in `…` (`cap()`)\n * 3. once any title would be cut under `--ui-menu-title-min` (50px): icons only, every title gone\n * 4. once even the icons don't fit (a button under `--ui-menu-item-min`, 34px): the items fold into ONE overflow\n * button, whose menu holds them all\n * - A `segmented` menu has two: whole, else a dropdown (its overflow button showing the chosen item).\n * - Plain DOM, no Solid, shaped like `SegmentedThumb`: `<ui-menu>` hands it its box and a way to find its items,\n * starts it, and hears each new answer (`onAnswer`).\n * - The maths are pure statics (`cap()`, `fit()`), tested on their own.\n * - What it writes, on the menu's box and DOM element (`present()`):\n * - `--_menu-fit`: `whole`, `cut`, `icons` or `overflow`, which the item rules query (`UIMenu.css`)\n * - `--_menu-title-max`: the widest a title may be now, while `cut`\n * - the DOM element's `:state(icons-only)`, `:state(overflow)` or `:state(dropdown)`\n * - It measures every stage for real, the same way whichever stage shows now (`measure()`):\n * - for each stage it writes that stage's look, reads the sizes, then writes back the stage that shows,\n * all before the next paint, so nothing flashes and a page's own CSS for `:state(icons-only)` counts\n * - so a width between two stages never flips back and forth\n * - It refits (`update()`) whenever a size could have changed: the box, an item's box or title, anything else in\n * the row (`ResizeObserver`), the fonts loading; the menu also asks when its items or their words change.\n * - It writes only when the answer changed, so the sizes it causes can't set it off again.\n ****************/\nexport class TitleFit {\n /** the menu's box its items sit in: where the stage is written */\n readonly box: HTMLElement\n\n /** what it measures and writes, from the menu */\n private readonly setup: TitleFitSetup\n\n constructor(setup: TitleFitSetup) {\n this.box = setup.box\n this.setup = setup\n }\n\n /** The stage showing now. */\n answer: FitAnswer = WHOLE\n\n /** Watches the sizes while started. */\n private resizes: ResizeObserver | undefined\n\n /** What the observer watches now. */\n private readonly watched = new Set<Element>()\n\n /** Stops the fonts' listener. */\n private fonts: AbortController | undefined\n\n /** `refit()` just before the next paint, once however often `update()` asks. */\n private readonly refits = new E.Queued({ when: E.beforeNextPaint, run: () => this.refit() })\n\n ////////////////\n // ## Starting and stopping\n ////////////////\n\n /**\n * Fit now, and refit whenever a size could have changed.\n * - Returns `stop()`, for an effect's cleanup.\n */\n start(): () => void {\n this.stop()\n this.resizes = new ResizeObserver(() => this.update())\n this.fonts = new AbortController()\n const fonts = document.fonts\n fonts?.addEventListener(\"loadingdone\", () => this.update(), { signal: this.fonts.signal })\n void fonts?.ready.then(() => this.update())\n this.refit()\n return () => this.stop()\n }\n\n /** Refit just before the next paint, once whatever changed has drawn. */\n update(): void {\n if (this.resizes) this.refits.ask()\n }\n\n /** Stop watching, and take its look away: every title whole again. */\n stop(): void {\n this.refits.cancel()\n this.resizes?.disconnect()\n this.resizes = undefined\n this.watched.clear()\n this.fonts?.abort()\n this.fonts = undefined\n this.answer = WHOLE\n this.box.style.removeProperty(FIT)\n this.box.style.removeProperty(TITLE_MAX)\n for (const name of STAGE_STATES) this.setup.domElement.setState(name, false)\n }\n\n ////////////////\n // ## Fitting\n ////////////////\n\n /** Measure every stage, and show the one that fits; tell the menu when that changed. */\n refit(): void {\n if (!this.resizes || !this.box.isConnected) return\n const next = this.fitNow()\n this.present(next)\n if (next === this.answer) return\n this.answer = next\n this.setup.onAnswer(next)\n }\n\n /** The stage that fits now, measured. */\n private fitNow(): FitAnswer {\n const { rows, others } = this.setup.children()\n this.watch([...rows.flatMap(({ box, title }) => [box, title]), ...others.flatMap(TitleFit.boxesOf)])\n if (!rows.length) return WHOLE\n const sizes = this.measure(rows, others)\n if (sizes.fitsWhole) return WHOLE\n const titlesRoom = sizes.room - sizes.fixed.reduce((sum, width) => sum + width, 0)\n if (this.setup.isSegmented()) return TitleFit.cap(sizes.titles, titlesRoom) === undefined ? WHOLE : OVERFLOW\n return TitleFit.fit(sizes.titles, titlesRoom, sizes.titleMin, {\n widths: sizes.icons,\n room: sizes.room,\n min: sizes.itemMin\n })\n }\n\n /**\n * The sizes each stage needs, each measured in its own look:\n * - `fitsWhole`: every title whole, nothing cut and nothing past the row's end: the rest needn't be read\n * - `room`: the row's width for its items, less its padding, its gaps and everything else in it\n * (with their margins: once the row is full, an `auto` margin has nothing left to take)\n * - `titles`: each title's natural width; `fixed`: the rest of each item (padding, icon, badge), titles whole\n * - `icons`: each item's width with its icon only\n * - `titleMin`, `itemMin`: the two minimums, read from the menu's tokens\n * - SIDE EFFECT: writes each look in turn, then writes back the one showing; no paint in between.\n */\n private measure(rows: readonly FitRow[], others: readonly Element[]): FitSizes {\n const { box } = this\n this.present(WHOLE)\n const style = getComputedStyle(box)\n const fontSize = parseFloat(style.fontSize) || DEFAULT_FONT_SIZE\n const shown = others.filter(TitleFit.isShown)\n const gaps = (parseFloat(style.columnGap) || 0) * Math.max(0, rows.length + shown.length - 1)\n const padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0)\n const fitsWhole =\n box.scrollWidth <= box.clientWidth &&\n rows.every(({ title }) => title.scrollWidth - title.getBoundingClientRect().width <= HAIR)\n const othersWidth = shown.reduce((sum, element) => sum + TitleFit.widthOf(element) + TitleFit.marginsOf(element), 0)\n const room = box.clientWidth - padding - gaps - othersWidth\n const titles = rows.map(({ title }) => title.scrollWidth)\n const fixed = rows.map(\n ({ box: itemBox, title }) => TitleFit.outerWidthOf(itemBox) - title.getBoundingClientRect().width\n )\n const titleMin = TitleFit.lengthOf(style.getPropertyValue(TITLE_MIN), fontSize, DEFAULT_TITLE_MIN)\n const itemMin = TitleFit.lengthOf(style.getPropertyValue(ITEM_MIN), fontSize, DEFAULT_ITEM_MIN)\n let icons: number[] = []\n if (!this.setup.isSegmented()) {\n this.present(ICONS)\n icons = rows.map(({ box: itemBox }) => TitleFit.outerWidthOf(itemBox))\n }\n this.present(this.answer)\n return { fitsWhole, room, titles, fixed, icons, titleMin, itemMin }\n }\n\n /** Write `answer`'s look: `--_menu-fit` and `--_menu-title-max` on the box, the stage's `:state()`. */\n private present(answer: FitAnswer): void {\n const { box, setup } = this\n const isSegmented = setup.isSegmented()\n box.style.setProperty(FIT, typeof answer === \"number\" ? CUT : answer)\n if (typeof answer === \"number\") box.style.setProperty(TITLE_MAX, `${answer}px`)\n else box.style.removeProperty(TITLE_MAX)\n setup.domElement.setState(ICONS_ONLY_STATE, answer === ICONS)\n setup.domElement.setState(OVERFLOW_STATE, answer === OVERFLOW && !isSegmented)\n setup.domElement.setState(DROPDOWN_STATE, answer === OVERFLOW && isSegmented)\n }\n\n /** Watch `elements`' sizes: the new ones from now, the gone ones no more. */\n private watch(elements: readonly Element[]): void {\n const resizes = this.resizes\n if (!resizes) return\n // the menu's parent too: a segmented one's dropdown is only as wide as its button, so its box can't tell\n // when there's room again\n const parent = this.setup.domElement.parentElement\n const next = new Set([this.box, ...(parent ? [parent] : []), ...elements])\n for (const element of this.watched) {\n if (!next.has(element)) {\n resizes.unobserve(element)\n this.watched.delete(element)\n }\n }\n for (const element of next) {\n if (this.watched.has(element)) continue\n resizes.observe(element)\n this.watched.add(element)\n }\n }\n\n ////////////////\n // ## The maths\n ////////////////\n\n /**\n * How titles of natural `widths` (px) fit `room`, and what to show:\n * - `\"whole\"`: every one, uncut\n * - a number: the widest a title may be (`cap()`), the longest giving way first\n * - `\"icons\"`: none, the icons only, once a title would be cut under `min`: a stub like \"6 W…\" says nothing\n * - `\"overflow\"`: not even the icons fit; needs `icons`, each item's width with its icon only, the row's room for\n * them and the smallest a button may be: they fit while every button, at least `icons.min` wide, adds up to no\n * more than `icons.room`\n * - e.g. `[30, 80, 120]`, `min` 50: in 230px `\"whole\"`, in 200px 90, in 120px `\"icons\"` (45 each)\n * - STATIC: pure, no DOM\n */\n static fit(widths: readonly number[], room: number, min: number, icons?: IconRow): FitAnswer {\n const cap = TitleFit.cap(widths, room)\n if (cap === undefined) return WHOLE\n if (cap >= min) return cap\n if (!icons) return ICONS\n const needed = icons.widths.reduce((sum, width) => sum + Math.max(width, icons.min), 0)\n return needed > icons.room ? OVERFLOW : ICONS\n }\n\n /**\n * The widest a title may be so `widths` fit in `room`, the longest giving way first; `undefined`: all fit whole.\n * - e.g. `[30, 80, 120]` in 200px: 90 (30 + 80 + 90)\n * - STATIC: pure, no DOM\n */\n static cap(widths: readonly number[], room: number): number | undefined {\n const sorted = [...widths].sort((a, b) => a - b)\n let left = room\n for (const [index, width] of sorted.entries()) {\n const share = left / (sorted.length - index)\n if (width > share) return Math.max(0, Math.floor(share))\n left -= width\n }\n return undefined\n }\n\n /**\n * A token's length in px: `50px`, `3em` (of `fontSize`), or a bare number of px; `fallback` for anything else.\n * - STATIC: pure, no DOM\n */\n static lengthOf(text: string, fontSize: number, fallback: number): number {\n const match = LENGTH.exec(text.trim())\n if (!match) return fallback\n const value = parseFloat(match[1]!)\n return match[2] === EM ? value * fontSize : value\n }\n\n ////////////////\n // ## Measuring\n ////////////////\n\n /**\n * The width `element` draws, whatever its own `display`: a `<ui-item>` or `<ui-menu>` is `display: contents`,\n * its box in its shadow root.\n * - Static: needs no instance.\n */\n static widthOf(element: Element): number {\n const boxes = TitleFit.boxesOf(element)\n if (!boxes.length) return 0\n const rects = boxes.map((box) => box.getBoundingClientRect())\n return Math.max(...rects.map((rect) => rect.right)) - Math.min(...rects.map((rect) => rect.left))\n }\n\n /**\n * A box's width with its inline margins (an item's, in a `secondary` menu).\n * - Static: needs no instance.\n */\n static outerWidthOf(box: Element): number {\n return box.getBoundingClientRect().width + TitleFit.marginsOf(box)\n }\n\n /** `element`'s inline margins, or its boxes' (`boxesOf()`) for one that draws none of its own. */\n private static marginsOf(element: Element): number {\n const style = getComputedStyle(element)\n if (style.display === CONTENTS) {\n const boxes = TitleFit.boxesOf(element)\n return boxes.length === 1 ? TitleFit.marginsOf(boxes[0]!) : 0\n }\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0)\n }\n\n /** The boxes `element` draws: itself, or for `display: contents` what's inside it (its shadow root's, its slot's). */\n private static boxesOf(element: Element): Element[] {\n const style = getComputedStyle(element)\n if (style.display === NONE) return []\n if (style.display !== CONTENTS) return [element]\n const inside =\n element.localName === SLOT\n ? (element as HTMLSlotElement).assignedElements()\n : [...(element.shadowRoot?.children ?? element.children)]\n return inside.filter((child) => child.localName !== STYLE).flatMap(TitleFit.boxesOf)\n }\n\n /** Does `element` draw anything (not hidden, not `display: none`)? */\n private static isShown(element: Element): boolean {\n return TitleFit.boxesOf(element).length > 0\n }\n}\n\n////////////////\n// ## Types\n////////////////\n\n/**\n * A stage of `TitleFit`: `\"whole\"`, the widest a title may be (px: cut), `\"icons\"` or `\"overflow\"`\n * (a segmented menu's dropdown).\n */\nexport type FitAnswer = \"whole\" | number | \"icons\" | \"overflow\"\n\n/** One item `TitleFit` fits: its box and its title box, in its shadow root. */\nexport type FitRow = {\n /** the item's box (`part=\"item\"`) */\n box: HTMLElement\n /** its title box (`part=\"title\"`) */\n title: HTMLElement\n}\n\n/** What `new TitleFit()` is handed. */\nexport type TitleFitSetup = {\n /** the menu's box its items sit in */\n box: HTMLElement\n /** the menu's DOM element, which shows the stage's `:state()` */\n domElement: E.DOMElement\n /** the items it fits, and everything else in the row (another button, a sub-menu, an item with no words) */\n children: () => { rows: FitRow[]; others: Element[] }\n /** a segmented menu: whole, else a dropdown */\n isSegmented: () => boolean\n /** the stage changed */\n onAnswer: (answer: FitAnswer) => void\n}\n\n/** The icons-only stage's sizes, for `fit()`'s last answer. */\nexport type IconRow = {\n /** each item's width with its icon only */\n widths: readonly number[]\n /** the row's room for its items */\n room: number\n /** the smallest a button may be before they fold into the overflow menu */\n min: number\n}\n\n/** What `measure()` reads. */\ntype FitSizes = {\n fitsWhole: boolean\n room: number\n titles: number[]\n fixed: number[]\n icons: number[]\n titleMin: number\n itemMin: number\n}\n\n////////////////\n// ## Constants\n////////////////\n\n/** The stages, as `--_menu-fit` writes them. */\nconst WHOLE = \"whole\"\nconst CUT = \"cut\"\nconst ICONS = \"icons\"\nconst OVERFLOW = \"overflow\"\n\n/** Custom property of the stage, on the box. */\nconst FIT = \"--_menu-fit\"\n\n/** Custom property of the widest a title may be, on the box. */\nconst TITLE_MAX = \"--_menu-title-max\"\n\n/** The two minimums' aliases, declared on the menu's box (`UIMenu.css`). */\nconst TITLE_MIN = \"--_ui-menu-title-min\"\nconst ITEM_MIN = \"--_ui-menu-item-min\"\n\n/** Their defaults, should a token not read as a length. */\nconst DEFAULT_TITLE_MIN = 50\nconst DEFAULT_ITEM_MIN = 34\n\n/** How far past its box a title may run, in px, and still count as whole: layout's rounding. */\nconst HAIR = 0.5\n\n/** A font size, should the box's not read. */\nconst DEFAULT_FONT_SIZE = 14\n\n/** The stages' states on the menu's DOM element. */\nconst ICONS_ONLY_STATE = \"icons-only\"\nconst OVERFLOW_STATE = \"overflow\"\nconst DROPDOWN_STATE = \"dropdown\"\nconst STAGE_STATES = [ICONS_ONLY_STATE, OVERFLOW_STATE, DROPDOWN_STATE] as const\n\n/** A length a token holds: a number, then `px`, `em` or nothing. */\nconst LENGTH = /^(-?\\d*\\.?\\d+)(px|em)?$/\n\n/** The `em` unit. */\nconst EM = \"em\"\n\n/** `display` values `widthOf()` looks through. */\nconst NONE = \"none\"\nconst CONTENTS = \"contents\"\n\n/** Tag names `boxesOf()` treats apart. */\nconst SLOT = \"slot\"\nconst STYLE = \"style\"\n","import { For, Match, Show, Switch, untrack } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { menuVocabulary } from \"./UIMenu.en\"\nimport { SegmentedThumb } from \"./SegmentedThumb\"\nimport { TitleFit, type FitAnswer, type FitRow } from \"./TitleFit\"\n\nimport menuCSS from \"./UIMenu.css?inline\"\n\n/**\n * Same item context, field by field: items don't re-render for an equal one (`ownItemContext`'s `equals`).\n * - Above the class: `@derived({ equals })` reads it while the class is defined.\n */\nfunction isSameContext(a: UIT.ItemContext, b: UIT.ItemContext): boolean {\n return (\n a.domElementRole === b.domElementRole &&\n a.role === b.role &&\n a.interactive === b.interactive &&\n a.current === b.current &&\n a.shrinkable === b.shrinkable &&\n a.iconsOnly === b.iconsOnly\n )\n}\n\n/**\n * Same overflow rows, row by row and field by field: the overflow menu doesn't redraw for an equal list.\n * - Above the class: `@state({ equals })` reads it while the class is defined.\n */\nfunction isSameFolded(a: readonly FoldedItem[], b: readonly FoldedItem[]): boolean {\n return (\n a.length === b.length &&\n a.every((row, index) => {\n const other = b[index]!\n return (Object.keys(row) as (keyof FoldedItem)[]).every((key) => row[key] === other[key])\n })\n )\n}\n\n/****************\n * ### `UIMenu`\n * The component behind `<ui-menu>`: a menu of generic `<ui-item>`s, in one of three shapes\n * (`UIMenu.css` has the markup of each).\n *\n * - DEFAULT, a navigation landmark: `<nav class=\"ui ... menu\" part=\"menu\" aria-label>` around the slot.\n * - Items with a `link` are links, the selected one `aria-current=\"page\"`;\n * `appearance=\"link\"` and `pagination` menus make every other item a `<button>`.\n * - The DOM element's `aria-label` names the landmark (two navs on a page need distinct names).\n *\n * - `interactive`, an application MENUBAR (WAI-ARIA APG): `<div role=\"menubar\" aria-orientation>`.\n * - Items are `role=\"menuitem\"` (their DOM elements `role=\"none\"`),\n * with ONE Tab stop, and arrow keys, Home and End between them.\n * - That's a roving tabindex (`UI.focus.roving`) over the items' BOXES (`UIItem.focusTarget`),\n * never their DOM elements:\n * a focusable DOM element without a visible role breaks the menubar's required-children pattern.\n * - Disabled items are skipped.\n *\n * - SUB-MENU: a `<ui-menu>` owned by a menu (`PartContext`: directly, or inside an item)\n * draws `<div class=\"[position] menu\" part=\"menu\">`, Fomantic's `.right.menu` or a vertical menu's `.item > .menu`,\n * and hands its items the TOP menu's `ItemContext`.\n *\n * - It owns its items (`ItemOwner`): they draw themselves as `itemContext()` says,\n * and adopt this component's `elementSetup.styleSheets` (the item rules live in `UIMenu.css`).\n * Items ASK for their context, which is also how the menu learns its items' DOM elements (the roving set),\n * after they upgrade in any order.\n *\n * - Events: `ui-select` (`{ value, item, originalEvent }`) when a link or button item is activated\n * (a click, or Enter or Space on it); only the TOP menu sends it.\n * - A menu never moves `selected` itself, EXCEPT a `segmented` one (a single-choice control):\n * it selects the activated item and unselects the rest, unless a listener cancels the `ui-select`.\n *\n * - A top-level `segmented` menu draws ONE sliding thumb under its items (`SegmentedThumb`),\n * moved to each new choice as Apple's segmented control slides.\n *\n * - `shrinkable`: it fits its items' titles to its row (`TitleFit`, epic `ui-gaps` P13):\n * whole, then cut with `…`, then icons only, then every item folded into ONE overflow button,\n * `<button part=\"overflow\">` first in its box, whose menu (`<div role=\"menu\" popover part=\"overflow-menu\">`)\n * holds a row per item; picking a row clicks the real item, so `selected` and the page's listeners work as ever.\n * - A `segmented` one has two stages: whole, else a dropdown, its button showing the chosen item.\n * - Its items draw their titles in a box of their own while it is (`ItemContext.shrinkable`).\n ****************/\nexport class UIMenu extends E.UIComponent<typeof menuVocabulary> implements UIT.ItemOwner {\n @E.proto static vocabulary = menuVocabulary\n // `Partial`: `<ui-toolbar>` extends the menu, stating other keys\n @E.protoMerged static elementSetup: Partial<E.ElementSetup> = {\n styleSheets: { menu: menuCSS },\n // a sub-menu is a part of its menu: an item's header looks past it to the menu\n isAPart: true,\n // nothing to delegate to: the items are the focus targets\n delegatesFocus: false\n }\n\n /** Once it has drawn (`isReady`): re-apply the roving tabindexes, over the items it drew. */\n @E.onChange(\"isReady\")\n protected onReadyToRove(isReady: boolean) {\n if (isReady) this.queueRefresh()\n }\n\n ////////////////\n // ## The menu tree\n ////////////////\n\n /**\n * Owning menu, when this is a sub-menu.\n * - A `segmented` menu is never one: a single-choice control keeps its own look and thumb,\n * even inside another menu (Owen: the editor's Run | Edit | Debug, in its top bar).\n */\n readonly context = new E.PartContext({\n domElement: this.domElement,\n noun: this.vocabulary.noun,\n barrier: (element) => this.isSegmented || E.PartContext.isBarrier(element)\n })\n\n /** `appearance` holds `word` (`segmented`, `link` ...): it takes several at once. */\n hasLook(word: string): boolean {\n return String(this.appearance ?? \"\")\n .split(\" \")\n .includes(word)\n }\n\n /** A segmented control (`appearance` holds `segmented`): it moves `selected` itself, and draws a thumb. */\n get isSegmented(): boolean {\n return this.hasLook(SEGMENTED)\n }\n\n /** Its items run top to bottom (`direction=\"vertical\"`): `:state(vertical)`. */\n @E.cssState(\"vertical\")\n get isVertical(): boolean {\n return this.direction === VERTICAL\n }\n\n /** The owning menu's component, when this is a sub-menu: only menus own `menu` parts. */\n get parentMenu(): UIMenu | undefined {\n return this.context.ownerComponent<UIMenu>()\n }\n\n /** Top menu of a sub-menu tree. */\n get topMenu(): UIMenu {\n return this.parentMenu?.topMenu ?? this\n }\n\n /** A sub-menu's classes: `[position] menu`, no `ui`. */\n private get subMenuClasses(): string {\n return [this.position, this.vocabulary.noun].filter(Boolean).join(\" \")\n }\n\n ////////////////\n // ## Items\n ////////////////\n\n /** Item DOM elements that asked THIS (top) menu for their context: the roving candidates. */\n private readonly itemsThatAsked = new WeakSet<Element>()\n\n /**\n * What this menu's items render as (only the top menu's is read), from its attributes.\n * - The same object while an equal one is computed (`isSameContext()`): items don't re-render for it.\n */\n @E.derived({ equals: isSameContext })\n get ownItemContext(): UIT.ItemContext {\n const isInteractive = this.interactive\n return {\n domElementRole: isInteractive ? \"none\" : undefined,\n role: isInteractive ? \"menuitem\" : undefined,\n interactive: isInteractive || this.hasLook(LINK_LOOK) || this.pagination,\n current: \"page\",\n shrinkable: this.isShrinking,\n iconsOnly: this.isIconsOnly\n }\n }\n\n /** What a sub-menu's items render as: the menu's context, but never fitted (only the row's own items are). */\n @E.derived({ equals: isSameContext })\n get nestedItemContext(): UIT.ItemContext {\n return { ...this.ownItemContext, shrinkable: false, iconsOnly: false }\n }\n\n /**\n * `ItemOwner`: what `item` renders as -- the TOP menu's published context. Tracked.\n * - SIDE EFFECT: records the item for the roving set,\n * and re-applies the roving tabindexes once the item has (re-)rendered its box.\n */\n itemContext(item: Element): UIT.ItemContext {\n // half-tracked on purpose: the item follows the top menu's context, never which menu is on top;\n // `@E.untracked` would untrack the whole method\n // oxlint-disable-next-line spell-ui/no-untrack -- half-tracked on purpose (above)\n const top = untrack(() => this.topMenu)\n top.itemsThatAsked.add(item)\n top.queueRefresh()\n return item.parentElement === top.domElement ? top.ownItemContext : top.nestedItemContext\n }\n\n /**\n * A click inside the menu: `ui-select` when it activated a link / button item\n * (Enter / Space on one click it too).\n * - Only the top menu dispatches; a sub-menu's clicks bubble to it.\n */\n @E.on(\"click\")\n protected onClick(event: MouseEvent) {\n if (this.parentMenu) return\n const item = UIMenu.activatedItem(event)\n if (!item || item.matches(UIT.DISABLED_STATE)) return\n const component = (item as E.DOMElement).component as ItemComponent | undefined\n const value = component?.value ?? item.textContent?.trim() ?? \"\"\n const isChosen = this.send(\"ui-choosing\", { value, item, originalEvent: event })\n if (isChosen && this.isSegmented) this.choose(item)\n }\n\n /**\n * A segmented menu's choice: `item` becomes the selected item, every other item of this menu tree drops it\n * (the `active` alias too).\n * - Only items that asked THIS menu for their context: a nested component's items stay alone.\n */\n private choose(item: Element) {\n for (const element of this.domElement.querySelectorAll<ChoosableItem>(\"*\")) {\n if (!this.itemsThatAsked.has(element)) continue\n if (element !== item) element.removeAttribute(UIT.ACTIVE)\n element.selected = element === item\n }\n }\n\n ////////////////\n // ## The sliding thumb\n ////////////////\n\n /** The top menu's box (its `nav`, or the menubar), while rendered: a segmented menu's track. */\n protected box: HTMLElement | undefined\n\n /** A segmented menu's sliding thumb, while drawn. */\n private thumb: SegmentedThumb | undefined\n\n /** A top-level `segmented` menu, rendered: it draws a sliding thumb. */\n get hasThumb(): boolean {\n return !this.parentMenu && this.isSegmented && this.isReady\n }\n\n /** SIDE EFFECT: the thumb, drawn on the menu's box while `hasThumb`; its cleanup takes it down. */\n @E.onChange(\"hasThumb\", \"interactive\")\n protected onThumbChanged(hasThumb: boolean) {\n const box = this.box\n if (!hasThumb || !box) return\n const thumb = new SegmentedThumb({ track: box, chosenBox: () => this.chosenBox() })\n this.thumb = thumb\n const stop = thumb.start()\n return () => {\n stop()\n this.thumb = undefined\n }\n }\n\n /**\n * An item's `selected` (or `active`) changed, items came and went, showed or hid, or their words changed:\n * the thumb moves to the chosen one, and a `shrinkable` menu fits again.\n */\n @E.watches({\n attributes: true,\n subtree: true,\n childList: true,\n characterData: true,\n attributeFilter: [UIT.SELECTED, UIT.ACTIVE, \"hidden\"]\n })\n protected onChoiceChanged() {\n this.thumb?.update()\n this.titleFit?.update()\n this.readFolded()\n }\n\n /** The chosen item's box (in its own shadow root), among the items this menu owns. */\n @E.untracked\n private chosenBox(): HTMLElement | undefined {\n for (const element of this.domElement.querySelectorAll<HTMLElement>(\"*\")) {\n if (!this.itemsThatAsked.has(element) || element.hidden || !element.matches(SELECTED_STATE)) continue\n return element.shadowRoot?.querySelector<HTMLElement>(ITEM_BOX) ?? undefined\n }\n return undefined\n }\n\n ////////////////\n // ## Fitting titles (`shrinkable`)\n ////////////////\n\n /** It fits its titles to its row: `shrinkable`, a top-level menu whose items run sideways. */\n get isShrinking(): boolean {\n return this.shrinkable && !this.parentMenu && !this.isVertical\n }\n\n /** The stage `TitleFit` found: `whole`, the widest a title may be (cut), `icons` or `overflow`. */\n @E.state accessor fitAnswer: FitAnswer = WHOLE\n\n /** The titles are gone, the icons only: `:state(icons-only)`. */\n @E.cssState(\"icons-only\")\n get isIconsOnly(): boolean {\n return this.isShrinking && this.fitAnswer === ICONS\n }\n\n /** Every item folded into the overflow button: `:state(overflow)`. */\n @E.cssState(\"overflow\")\n get isFolded(): boolean {\n return this.isShrinking && this.fitAnswer === OVERFLOW && !this.isSegmented\n }\n\n /** A `segmented` one shows as a dropdown, its overflow button showing the chosen item: `:state(dropdown)`. */\n @E.cssState(\"dropdown\")\n get isDropdown(): boolean {\n return this.isShrinking && this.fitAnswer === OVERFLOW && this.isSegmented\n }\n\n /** Shrinking, and drawn: `TitleFit` runs. */\n get canFit(): boolean {\n return this.isShrinking && this.isReady\n }\n\n /** The fitting, while it runs. */\n private titleFit: TitleFit | undefined\n\n /** SIDE EFFECT: fits the titles while `canFit`, on the box drawn now; its cleanup shows them whole again. */\n @E.onChange(\"canFit\", \"interactive\", \"appearance\")\n protected onFitChanged(canFit: boolean) {\n const box = this.box\n if (!canFit || !box) return\n const fit = new TitleFit({\n box,\n domElement: this.domElement,\n children: () => this.fitChildren(),\n isSegmented: () => this.isSegmented,\n onAnswer: (answer) => this.onFitAnswer(answer)\n })\n this.titleFit = fit\n const stop = fit.start()\n return () => {\n stop()\n this.titleFit = undefined\n this.fitAnswer = WHOLE\n }\n }\n\n /** A new stage: the thumb follows its choice's box, the overflow menu closes once it's gone. */\n private onFitAnswer(answer: FitAnswer) {\n this.fitAnswer = answer\n this.thumb?.update()\n this.readFolded()\n if (answer !== OVERFLOW) this.overflowMenu.close()\n }\n\n /**\n * What `TitleFit` fits: the box's own items with words (each its box and title box), and everything else in\n * the row (another button, a sub-menu, an item with only an icon).\n */\n @E.untracked\n private fitChildren(): { rows: FitRow[]; others: Element[] } {\n const rows: FitRow[] = []\n const others: Element[] = []\n for (const element of this.rowElements()) {\n const item = this.fittedItem(element)\n if (item) rows.push({ box: item.focusTarget!, title: item.titleBox! })\n else others.push(element)\n }\n return { rows, others }\n }\n\n /** The elements in the box's default slot: its row. */\n @E.untracked\n private rowElements(): Element[] {\n return this.box?.querySelector<HTMLSlotElement>(DEFAULT_SLOT)?.assignedElements() ?? []\n }\n\n /** `element`'s component, when it's an item this menu fits: its own, drawn with a title box, not hidden. */\n private fittedItem(element: Element): ItemComponent | undefined {\n if (!this.itemsThatAsked.has(element) || (element as HTMLElement).hidden) return undefined\n const item = (element as E.DOMElement).component as ItemComponent | undefined\n return item?.kind === UIT.ITEM && item.focusTarget && item.titleBox ? item : undefined\n }\n\n ////////////////\n // ## The overflow button and its menu\n ////////////////\n\n /** The items the overflow menu holds, a row each, read from the page's items (`readFolded()`). */\n @E.state({ equals: isSameFolded }) accessor folded: readonly FoldedItem[] = []\n\n /** The chosen item, among them: what a segmented one's dropdown shows. */\n get chosen(): FoldedItem | undefined {\n return this.folded.find((row) => row.isSelected)\n }\n\n /** Some item inside has a count: a dot on the overflow button (epic `epic-engine` Q37). */\n get hasFoldedBadge(): boolean {\n return this.folded.some((row) => row.hasBadge)\n }\n\n /** Read the overflow menu's rows from the fitted items, now. */\n @E.untracked\n private readFolded() {\n if (!this.isShrinking) {\n this.folded = []\n return\n }\n const rows: FoldedItem[] = []\n for (const element of this.rowElements()) {\n const item = this.fittedItem(element)\n if (!item) continue\n const text = item.titleText ?? \"\"\n rows.push({\n element,\n text,\n icon: item.icon || undefined,\n letter: item.firstLetter,\n isSelected: !!item.isSelected,\n isDisabled: !!item.isDisabled,\n hasBadge: !!item.hasBadge\n })\n }\n this.folded = rows\n }\n\n /**\n * The overflow menu: its own open state (the menu sends no open or close events), a popover hung from its button,\n * and its `UI.overlays` entry while open: Escape or a click outside closes it, focus back on its button for Escape.\n */\n readonly overflowMenu = new E.PopoverPanel({\n component: this,\n restoreFocus: false,\n onDismiss: (reason) => this.closeOverflow(reason === \"escape\")\n })\n\n /** The overflow menu is open. */\n get isOverflowOpen(): boolean {\n return this.overflowMenu.isOpen\n }\n\n /** The overflow button, while drawn. */\n private overflowButton: HTMLButtonElement | undefined\n\n /** The overflow menu's box, while drawn. */\n private overflowPanel: HTMLElement | undefined\n\n /** The overflow menu's `id`: its button's `aria-controls`. */\n @E.lazy\n get overflowMenuId(): string {\n return UI.ids.next(this.vocabulary.tag)\n }\n\n /** The overflow button's name and tooltip, and its menu's: \"More\". */\n get moreText(): string {\n return this.translationForKey(\"more\")\n }\n\n /** The `…` on the overflow button. */\n readonly moreGlyph = new E.IconGlyph({ owner: this, name: () => (this.isShrinking ? MORE_ICON : undefined) })\n\n /** A segmented one's dropdown: its caret, and the chosen item's icon. */\n readonly caretGlyph = new E.IconGlyph({\n owner: this,\n name: () => (this.isShrinking && this.isSegmented ? CARET_ICON : undefined)\n })\n readonly chosenGlyph = new E.IconGlyph({\n owner: this,\n name: () => (this.isShrinking && this.isSegmented ? this.chosen?.icon : undefined)\n })\n\n /**\n * SIDE EFFECT: the overflow menu shows in the top layer while open, with its `UI.overlays` entry\n * (`PopoverPanel.follow()`), its chosen row (else its first) focused; the cleanup hides it.\n */\n @E.onChange(\"isOverflowOpen\", \"isConnected\")\n protected onOverflowOpenChanged(isOpen: boolean, isConnected: boolean) {\n const hide = this.overflowMenu.follow(this.overflowPanel, isOpen && isConnected)\n if (hide)\n E.afterSolidUpdate(() =>\n this.focusRow(\n Math.max(\n 0,\n this.folded.findIndex((row) => row.isSelected)\n )\n )\n )\n return hide\n }\n\n /** Open the overflow menu, its rows read fresh. */\n @E.untracked\n openOverflow() {\n this.readFolded()\n this.overflowMenu.open()\n }\n\n /** Close the overflow menu; `refocus`: focus goes back to its button (Escape, Tab, a pick). */\n @E.untracked\n closeOverflow(refocus = false) {\n this.overflowMenu.close()\n if (refocus) this.overflowButton?.focus()\n }\n\n /** Focus row `index` of the overflow menu, as it opens. */\n private focusRow(index: number) {\n this.overflowPanel?.querySelectorAll<HTMLElement>(ROWS)[index]?.focus()\n }\n\n /** The overflow button's keys: ↓ opens it, as Enter and Space do (a click). */\n @E.untracked\n private readonly onOverflowButtonKey = (event: KeyboardEvent) => {\n if (event.key !== UIT.Key.arrowDown) return\n event.preventDefault()\n this.openOverflow()\n }\n\n /**\n * The overflow menu's keys: ↑ ↓ Home End move, wrapping, past disabled rows (`UI.focus.arrowKey()`);\n * Escape closes it, focus back on its button; Tab closes it.\n */\n @E.untracked\n private readonly onOverflowMenuKey = (event: KeyboardEvent) => {\n const container = event.currentTarget as HTMLElement\n if (UI.focus.arrowKey(event, { container, items: ROWS, orientation: \"vertical\", tabindex: \"left alone\" })) return\n if (event.key === UIT.Key.escape) {\n event.preventDefault()\n this.closeOverflow(true)\n } else if (event.key === UIT.Key.tab) this.closeOverflow(true)\n }\n\n /** A row was picked: the menu closes, focus goes back to its button, and the real item is clicked. */\n @E.untracked\n private pickFolded(row: FoldedItem) {\n if (row.isDisabled) return\n this.closeOverflow(true)\n const item = (row.element as E.DOMElement).component as ItemComponent | undefined\n item?.focusTarget?.click()\n }\n\n /** The overflow button, first in the box: it shows only once the items fold into it (`UIMenu.css`). */\n private overflowButtonBox(): JSX.Element {\n return (\n <Show when={this.isShrinking && !isServer}>\n <button\n ref={(element: HTMLButtonElement) => (this.overflowButton = element)}\n type=\"button\"\n class={OVERFLOW_ITEM_CLASS}\n part={this.partForName(\"overflow\")}\n style={this.overflowMenu.anchorStyle}\n role={this.interactive ? \"menuitem\" : undefined}\n aria-haspopup=\"menu\"\n aria-expanded={this.overflowMenu.ariaExpanded}\n aria-controls={this.overflowMenuId}\n aria-label={this.isSegmented ? undefined : this.moreText}\n title={this.isSegmented ? this.chosen?.text : this.moreText}\n onClick={() => (this.isOverflowOpen ? this.closeOverflow() : this.openOverflow())}\n onKeyDown={this.onOverflowButtonKey}\n >\n <Show when={this.isSegmented} fallback={this.moreFace()}>\n {this.dropdownFace()}\n </Show>\n </button>\n </Show>\n )\n }\n\n /** The overflow button's `…` (or the `overflow` slot's own), and a dot while an item inside has a count. */\n private moreFace(): JSX.Element {\n return (\n <>\n <span class={UIT.ICON}>\n <slot name={this.slotForName(\"overflow\")}>{this.moreGlyph.svg}</slot>\n </span>\n <Show when={this.hasFoldedBadge}>\n <span class={DOT} aria-hidden=\"true\" />\n </Show>\n </>\n )\n }\n\n /** A segmented one's dropdown: the chosen item's icon and title, and a caret. */\n private dropdownFace(): JSX.Element {\n return (\n <>\n <Show when={this.chosenGlyph.svg}>\n <span class={UIT.ICON}>{this.chosenGlyph.svg}</span>\n </Show>\n <span class={TITLE}>{this.chosen?.text}</span>\n <span class={CARET}>{this.caretGlyph.svg}</span>\n </>\n )\n }\n\n /** The overflow menu: a popover in the top layer, hanging from its button, a row per folded item. */\n private overflowMenuBox(): JSX.Element {\n return (\n <Show when={this.isShrinking && !isServer}>\n <div\n ref={(element: HTMLElement) => (this.overflowPanel = element)}\n id={this.overflowMenuId}\n class={OVERFLOW_MENU_CLASS}\n part={this.partForName(\"overflow-menu\")}\n role=\"menu\"\n popover=\"manual\"\n style={this.overflowMenu.panelStyle}\n aria-label={this.moreText}\n onKeyDown={this.onOverflowMenuKey}\n >\n <For each={this.folded}>{(row) => this.foldedRow(row)}</For>\n </div>\n </Show>\n )\n }\n\n /**\n * One row of the overflow menu: the item's icon (its `icon`, a copy of what's in its `icon` slot, else its first\n * letter), its title and a copy of its counts; the chosen one a `menuitemradio`, ticked.\n */\n private foldedRow(row: FoldedItem): JSX.Element {\n const item = (row.element as E.DOMElement).component as ItemComponent | undefined\n const copies = (name: \"icon\" | \"badge\") =>\n (item?.slotted?.(name) ?? []).map((element) => {\n const copy = element.cloneNode(true) as Element\n copy.removeAttribute(\"slot\")\n return copy\n })\n const icons = copies(\"icon\")\n const badges = copies(\"badge\")\n const glyph = row.icon ? new E.IconGlyph({ owner: this, name: () => row.icon }) : undefined\n return (\n <button\n type=\"button\"\n class={[ROW, { [SELECTED_CLASS]: row.isSelected, [DISABLED_CLASS]: row.isDisabled }]}\n role={row.isSelected ? \"menuitemradio\" : \"menuitem\"}\n aria-checked={row.isSelected ? \"true\" : undefined}\n aria-disabled={row.isDisabled ? \"true\" : undefined}\n tabindex=\"-1\"\n onClick={() => this.pickFolded(row)}\n >\n <span class={UIT.ICON} aria-hidden=\"true\">\n {glyph ? glyph.svg : icons.length ? icons : <span class={LETTER}>{row.letter}</span>}\n </span>\n <span class={TITLE}>{row.text}</span>\n {badges.length ? <span class={BADGE}>{badges}</span> : undefined}\n </button>\n )\n }\n\n ////////////////\n // ## The menubar\n ////////////////\n\n /** Top-level and `interactive`? `:state(interactive)`; not `isMenubar`, which also waits for `isReady`. */\n @E.cssState(\"interactive\")\n get isInteractiveMenubar(): boolean {\n return !this.parentMenu && this.interactive\n }\n\n /** The menubar is live: top-level, `interactive`, rendered. */\n get isMenubar(): boolean {\n return !this.parentMenu && this.interactive && this.isReady\n }\n\n /** The menubar's arrow-key axis: `vertical` menus go up and down. */\n private get orientation(): E.RovingOrientation {\n return this.isVertical ? \"vertical\" : \"horizontal\"\n }\n\n /** Live roving tabindex while `interactive`. */\n private rovingTabindex: E.RovingTabindex | undefined\n\n /** The menubar root, while rendered. */\n private bar: HTMLElement | undefined\n\n /** SIDE EFFECT: a roving tabindex over the item DOM elements while this is a menubar; returns its stop. */\n @E.onChange(\"isMenubar\", \"orientation\")\n protected onMenubarChanged(isMenubar: boolean, orientation: E.RovingOrientation) {\n if (!isMenubar) return\n E.afterSolidUpdate(() => this.startRoving(orientation))\n return () => this.stopRoving()\n }\n\n /** Start the roving tabindex on the menubar root, the selected item (or the first) as the tab stop. */\n private startRoving(orientation: E.RovingOrientation) {\n this.stopRoving()\n const bar = this.bar\n if (!bar || !this.domElement.isConnected) return\n const boxes = this.menuItems()\n const selected = boxes.findIndex((box) => (box.getRootNode() as ShadowRoot).host?.matches(SELECTED_STATE))\n this.rovingTabindex = UI.focus.roving({\n container: bar,\n items: () => this.menuItems(),\n orientation,\n activeIndex: Math.max(0, selected)\n })\n }\n\n /** Stop roving; the item boxes lose the `tabindex`es it set. */\n private stopRoving() {\n if (!this.rovingTabindex) return\n this.rovingTabindex.detach()\n this.rovingTabindex = undefined\n for (const box of this.menuItems()) box.removeAttribute(\"tabindex\")\n }\n\n /**\n * Re-apply the roving `tabindex`es once after Solid's update, however often asked,\n * after the item set may have changed (restarting before any focus); a `shrinkable` menu fits again.\n */\n private readonly rovingRefresh = new E.Queued({ when: E.afterSolidUpdate, run: () => this.refreshRoving() })\n\n /** Queue `refreshRoving()`. */\n private queueRefresh() {\n this.rovingRefresh.ask()\n }\n\n /** The item set may have changed: fit a `shrinkable` menu again, and re-apply the roving `tabindex`es. */\n private refreshRoving() {\n this.titleFit?.update()\n if (!this.rovingTabindex) return\n if (this.domElement.matches(\":focus-within\")) this.rovingTabindex.refresh()\n else this.startRoving(this.orientation)\n }\n\n /**\n * The roving set, in document order: the item BOXES (`UIItem.focusTarget`) of items owned by this menu tree,\n * `type=\"item\"`, not hidden. Untracked: called from handlers and effect cleanups.\n */\n @E.untracked\n private menuItems(): HTMLElement[] {\n const boxes: HTMLElement[] = []\n for (const element of this.domElement.querySelectorAll<HTMLElement>(\"*\")) {\n if (!this.itemsThatAsked.has(element) || element.hidden) continue\n const item = (element as E.DOMElement).component as ItemComponent | undefined\n const box = item?.focusTarget\n if (box && item.kind === UIT.ITEM) boxes.push(box)\n }\n return boxes\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /**\n * The root for this shape: sub-menu, menubar or landmark; the DOM element's `aria-label` names the last two.\n * - `shrinkable`: the overflow button first in the box, and its menu after it (outside a menubar, whose children\n * must all be its items).\n */\n render(): JSX.Element {\n return (\n <>\n {this.menuBox()}\n {this.overflowMenuBox()}\n </>\n )\n }\n\n /** The name of its landmark or menubar: its `aria-label`, else its `label`. */\n private get landmarkLabel(): string | undefined {\n return this.attributes[\"aria-label\"] ?? this.sharedLabel ?? undefined\n }\n\n /** The menu's box, for its shape. */\n private menuBox(): JSX.Element {\n return (\n <Switch>\n <Match when={this.parentMenu}>\n <div class={this.subMenuClasses} part={this.partForName(\"menu\")}>\n <slot />\n </div>\n </Match>\n <Match when={this.interactive}>\n <div\n ref={(element: HTMLElement) => {\n this.bar = element\n this.box = element\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menubar\"\n aria-orientation={this.isVertical ? \"vertical\" : undefined}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </div>\n </Match>\n <Match when={true}>\n <nav\n ref={(element: HTMLElement) => (this.box = element)}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </nav>\n </Match>\n </Switch>\n )\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /**\n * The item DOM element whose link / button root the event went through, if any.\n * - STATIC: needs no instance, only the event's path.\n * - `instanceof` is safe here: a click handler, which the static render (`spell/ui/static`) never runs.\n */\n private static activatedItem(event: Event): Element | undefined {\n for (const target of event.composedPath()) {\n if (!(target instanceof HTMLElement)) continue\n if ((target.localName === \"a\" || target.localName === \"button\") && target.part.contains(UIT.ITEM)) {\n const root = target.getRootNode()\n return root instanceof ShadowRoot ? root.host : undefined\n }\n }\n return undefined\n }\n}\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIMenu extends E.AttributeValues<typeof menuVocabulary> {}\n\n////////////////\n// ## Constants\n////////////////\n\n/** Selector of a selected item DOM element: the menubar's first tab stop. */\nconst SELECTED_STATE = \":state(selected)\"\n\n/** Selector of an item's box in its shadow root: what a segmented menu's thumb covers. */\nconst ITEM_BOX = `.${UIT.ITEM}`\n\n/** The `appearance` of a single-choice menu: it moves `selected` itself. */\nconst SEGMENTED: UIT.MenuAppearance = \"segmented\"\n\n/** The `appearance` word that makes every item interactive, with the link hover. */\nconst LINK_LOOK = \"link\"\n\n/** The `direction` of a menu whose items run top to bottom. */\nconst VERTICAL = \"vertical\"\n\n/** `TitleFit`'s stages the menu tells apart. */\nconst WHOLE = \"whole\"\nconst ICONS = \"icons\"\nconst OVERFLOW = \"overflow\"\n\n/** The box's default slot: its row. */\nconst DEFAULT_SLOT = \":scope > slot:not([name])\"\n\n/** Icons of the overflow button: `…`, and a segmented one's dropdown caret. */\nconst MORE_ICON = \"ellipsis horizontal\"\nconst CARET_ICON = \"caret down\"\n\n/** Class words of the overflow button (drawn as an item), its menu and their pieces (`UIMenu.css`, \"Shrinkable\"). */\nconst OVERFLOW_ITEM_CLASS = `${UIT.ITEM} overflow`\nconst OVERFLOW_MENU_CLASS = \"overflow-menu\"\nconst ROW = \"row\"\nconst TITLE = \"title\"\nconst BADGE = \"badge\"\nconst LETTER = \"letter\"\nconst CARET = \"caret\"\nconst DOT = \"dot\"\nconst SELECTED_CLASS = \"selected\"\nconst DISABLED_CLASS = \"disabled\"\n\n/** Selector of the overflow menu's rows, in its box. */\nconst ROWS = `:scope > .${ROW}`\n\n////////////////\n// ## Item types\n////////////////\n\n/** What the menu reads from an item's component (`UIItem`, not imported: another family). */\ntype ItemComponent = {\n /** `kind` (its vocabulary getter): `item`, `header` or `divider`; only `item`s join the roving set */\n readonly kind?: string\n /** `value` (its vocabulary getter): what `ui-select` reports for the item (default its text) */\n readonly value?: string\n /** the item's box that takes focus (its link or button), once rendered */\n focusTarget?: HTMLElement\n /** its title box, in a `shrinkable` menu */\n readonly titleBox?: HTMLElement\n /** its title, as a person reads it */\n readonly titleText?: string\n /** its `icon` attribute */\n readonly icon?: string\n /** selected (or `active`) */\n readonly isSelected?: boolean\n /** disabled */\n readonly isDisabled?: boolean\n /** something in its `badge` slot */\n readonly hasBadge?: boolean\n /** its title's first letter: what stands for it with no icon */\n readonly firstLetter?: string\n /** its light-DOM children in slot `name` */\n slotted?(name: \"icon\" | \"badge\"): Element[]\n}\n\n/** One row of a `shrinkable` menu's overflow menu: a fitted item, as read when it was (`readFolded()`). */\ntype FoldedItem = {\n /** the item's DOM element: what a pick clicks */\n readonly element: Element\n /** its title */\n readonly text: string\n /** its `icon` attribute */\n readonly icon: string | undefined\n /** its title's first letter: its icon when it has none */\n readonly letter: string | undefined\n /** selected: ticked */\n readonly isSelected: boolean\n /** disabled: can't be picked */\n readonly isDisabled: boolean\n /** has a count */\n readonly hasBadge: boolean\n}\n\n/** What the menu writes on an item's DOM element it chooses (`UIItem`'s reflected `selected`). */\ntype ChoosableItem = Element & {\n /** the item's `selected` property */\n selected?: boolean\n}\n","/**\n * The menu family: defines `<ui-menu>` and exports its component, `UIMenu`.\n * - SIDE EFFECT: importing it defines the tag, and `<ui-item>` first (through `spell/ui/components/ui-item`:\n * menus hold generic items). The menu registers as the owner of `item`, `menu` (sub-menus) and `header` parts.\n * - Also the library's `spell/ui/ui-menu` entry (its size is in `notes/report.md`).\n */\n\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AET,gBAAgB;AAClB,CAAA,CAAA,GANeY,EAAA2H,GAAA,IAHJM,CAAA;AAAN,IAAMmH,IAANnH,GAmuBDmC,KAAiB,oBAGjBC,KAAW,IAAIhL,KAGfqK,KAAgC,aAGhCG,KAAY,QAGZF,KAAW,YAGXb,KAAQ,SACRwB,KAAQ,SACRC,IAAW,YAGXG,KAAe,6BAGfxB,KAAY,uBACZC,KAAa,cAGbsC,KAAsB,GAAGpM,EAAQ,YACjC6N,KAAsB,iBACtBe,KAAM,OACNrB,KAAQ,SACRoB,KAAQ,SACRJ,KAAS,UACTd,KAAQ,SACRR,KAAM,OACN4B,KAAiB,YACjBC,KAAiB,YAGjB5E,KAAO,aAAa0E;;;0BCh1B1BmB,EAAO,OAAO"}
1
+ {"version":3,"file":"ui-menu.js","names":["UIT.MenuAppearances","UIT.ItemAlignments","WHOLE","E.Queued","E.beforeNextPaint","OVERFLOW","ICONS","<Show when={this.isShrinking && !isServer}>\n <button\n ref={(element) => this.overflowButton = element}\n type=\"button\"\n class={OVERFLOW_ITEM_CLASS}\n part={this.partForName(\"overflow\")}\n style={this.overflowMenu.anchorStyle}\n role={this.interactive ? \"menuitem\" : void 0}\n aria-haspopup=\"menu\"\n aria-expanded={this.overflowMenu.ariaExpanded}\n aria-controls={this.overflowMenuId}\n aria-label={this.isSegmented ? void 0 : this.moreText}\n title={this.isSegmented ? this.chosen?.text : this.moreText}\n onClick={() => this.isOverflowOpen ? this.closeOverflow() : this.openOverflow()}\n onKeyDown={this.onOverflowButtonKey}\n >\n <Show when={this.isSegmented} fallback={this.moreFace()}>\n {this.dropdownFace()}\n </Show>\n </button>\n </Show>","this","ref={(element) => this.overflowButton = element}","<Show when={this.isSegmented} fallback={this.moreFace()}>\n {this.dropdownFace()}\n </Show>","part={this.partForName(\"overflow\")}","style={this.overflowMenu.anchorStyle}","role={this.interactive ? \"menuitem\" : void 0}","aria-expanded={this.overflowMenu.ariaExpanded}","aria-controls={this.overflowMenuId}","aria-label={this.isSegmented ? void 0 : this.moreText}","title={this.isSegmented ? this.chosen?.text : this.moreText}","<button\n ref={(element) => this.overflowButton = element}\n type=\"button\"\n class={OVERFLOW_ITEM_CLASS}\n part={this.partForName(\"overflow\")}\n style={this.overflowMenu.anchorStyle}\n role={this.interactive ? \"menuitem\" : void 0}\n aria-haspopup=\"menu\"\n aria-expanded={this.overflowMenu.ariaExpanded}\n aria-controls={this.overflowMenuId}\n aria-label={this.isSegmented ? void 0 : this.moreText}\n title={this.isSegmented ? this.chosen?.text : this.moreText}\n onClick={() => this.isOverflowOpen ? this.closeOverflow() : this.openOverflow()}\n onKeyDown={this.onOverflowButtonKey}\n >\n <Show when={this.isSegmented} fallback={this.moreFace()}>\n {this.dropdownFace()}\n </Show>\n </button>","name={this.slotForName(\"overflow\")}","<Show when={this.hasFoldedBadge}>\n <span class={DOT} aria-hidden=\"true\" />\n </Show>","<span class={DOT} aria-hidden=\"true\" />","<Show when={this.chosenGlyph.svg}>\n <span class={UIT.ICON}>{this.chosenGlyph.svg}</span>\n </Show>","<span class={UIT.ICON}>{this.chosenGlyph.svg}</span>","<Show when={this.isShrinking && !isServer}>\n <div\n ref={(element) => this.overflowPanel = element}\n id={this.overflowMenuId}\n class={OVERFLOW_MENU_CLASS}\n part={this.partForName(\"overflow-menu\")}\n role=\"menu\"\n popover=\"manual\"\n style={this.overflowMenu.panelStyle}\n aria-label={this.moreText}\n onKeyDown={this.onOverflowMenuKey}\n >\n <For each={this.folded}>{(row) => this.foldedRow(row)}</For>\n </div>\n </Show>","ref={(element) => this.overflowPanel = element}","<For each={this.folded}>{(row) => this.foldedRow(row)}</For>","class={OVERFLOW_MENU_CLASS}","part={this.partForName(\"overflow-menu\")}","style={this.overflowMenu.panelStyle}","aria-label={this.moreText}","<div\n ref={(element) => this.overflowPanel = element}\n id={this.overflowMenuId}\n class={OVERFLOW_MENU_CLASS}\n part={this.partForName(\"overflow-menu\")}\n role=\"menu\"\n popover=\"manual\"\n style={this.overflowMenu.panelStyle}\n aria-label={this.moreText}\n onKeyDown={this.onOverflowMenuKey}\n >\n <For each={this.folded}>{(row) => this.foldedRow(row)}</For>\n </div>","role={row.isSelected ? \"menuitemradio\" : \"menuitem\"}","aria-checked={row.isSelected ? \"true\" : void 0}","aria-disabled={row.isDisabled ? \"true\" : void 0}","class={UIT.ICON}","class={TITLE}","<button\n type=\"button\"\n class={[ROW, { [SELECTED_CLASS]: row.isSelected, [DISABLED_CLASS]: row.isDisabled }]}\n role={row.isSelected ? \"menuitemradio\" : \"menuitem\"}\n aria-checked={row.isSelected ? \"true\" : void 0}\n aria-disabled={row.isDisabled ? \"true\" : void 0}\n tabindex=\"-1\"\n onClick={() => this.pickFolded(row)}\n >\n <span class={UIT.ICON} aria-hidden=\"true\">\n {glyph ? glyph.svg : icons.length ? icons : <span class={LETTER}>{row.letter}</span>}\n </span>\n <span class={TITLE}>{row.text}</span>\n {badges.length ? <span class={BADGE}>{badges}</span> : void 0}\n </button>","{this.menuBox()}","{this.overflowMenuBox()}","<Switch>\n <Match when={this.parentMenu}>\n <div class={this.subMenuClasses} part={this.partForName(\"menu\")}>\n <slot />\n </div>\n </Match>\n <Match when={this.interactive}>\n <div\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menubar\"\n aria-orientation={this.isVertical ? \"vertical\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </div>\n </Match>\n <Match when={true}>\n <nav\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role={this.isTabs ? \"tablist\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </nav>\n </Match>\n </Switch>","<Match when={this.parentMenu}>\n <div class={this.subMenuClasses} part={this.partForName(\"menu\")}>\n <slot />\n </div>\n </Match>","part={this.partForName(\"menu\")}","<div class={this.subMenuClasses} part={this.partForName(\"menu\")}>\n <slot />\n </div>","<Match when={this.interactive}>\n <div\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menubar\"\n aria-orientation={this.isVertical ? \"vertical\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </div>\n </Match>","ref={(element) => {\n this.bar = element;\n this.box = element;\n }}","<div\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menubar\"\n aria-orientation={this.isVertical ? \"vertical\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </div>","aria-orientation={this.isVertical ? \"vertical\" : void 0}","aria-label={this.landmarkLabel}","<Match when={true}>\n <nav\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role={this.isTabs ? \"tablist\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </nav>\n </Match>","when={true}","<nav\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role={this.isTabs ? \"tablist\" : void 0}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </nav>","role={this.isTabs ? \"tablist\" : void 0}","__name","E.UIComponent","E.proto","E.protoMerged","E.onChange","E.cssState","E.derived","E.on","E.untracked","E.watches","UIT.SELECTED","UIT.ACTIVE","E.state","E.lazy","E.PartContext","E.PopoverPanel","E.IconGlyph","E.Queued","E.afterSolidUpdate","_$createComponent","_$readShallow","_$setAttribute","_$getOwner","UIT.ICON","_$memo","menuCSS","UIT.ITEM","_$delegateEvents","ICON","__name$1","Key","__publicField","__decorateElement","ITEM","ItemAlignments","__decoratorMetadata","__runInitializers","__privateAdd","SELECTED","ACTIVE","MenuAppearances","__decoratorStart","SegmentedThumb","UIMenu_default","getOwner$1","menuVocabulary","word","TitleFit","setup","WHOLE$1","Queued","beforeNextPaint","fonts","FIT","TITLE_MAX","name","STAGE_STATES","next","rows","box","title","others","sizes","titlesRoom","sum","width","OVERFLOW$1","fitted","ICONS$1","style","fontSize","DEFAULT_FONT_SIZE","shown","gaps","padding","fitsWhole","HAIR","othersWidth","element","room","titles","fixed","itemBox","titleMin","TITLE_MIN","DEFAULT_TITLE_MIN","itemMin","ITEM_MIN","DEFAULT_ITEM_MIN","scrollMin","SCROLL_MIN","DEFAULT_SCROLL_MIN","icons","isSegmented","answer","CUT","ICONS_ONLY_STATE","OVERFLOW_STATE","DROPDOWN_STATE","resizes","parent","elements","cap","widths","min","sorted","a","b","left","index","share","match","LENGTH","text","fallback","value","EM","boxes","rects","rect","CONTENTS","NONE","SLOT","child","STYLE","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_menuItems_dec","_onMenubarChanged_dec","_isInteractiveMenubar_dec","_pickFolded_dec","_onOverflowMenuKey_dec","_onOverflowButtonKey_dec","_closeOverflow_dec","_openOverflow_dec","_onOverflowOpenChanged_dec","_overflowMenuId_dec","_readFolded_dec","_folded_dec","_rowElements_dec","_fitChildren_dec","_onFitChanged_dec","_isDropdown_dec","_isFolded_dec","_isIconsOnly_dec","_fitAnswer_dec","_chosenBox_dec","_onChoiceChanged_dec","_onThumbChanged_dec","_ownedItems_dec","_showValue_dec","_onValueChanged_dec","_onSubmissionChanged_dec","_onFormValueChanged_dec","_isAFormValue_dec","_onClick_dec","_nestedItemContext_dec","_ownItemContext_dec","_isVertical_dec","_onReadyToRove_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_fitAnswer","_folded","other","row","key","_UIMenu","UIComponent","proto","protoMerged","onChange","cssState","derived","on","untracked","watches","state","lazy","PartContext","WHOLE","PopoverPanel","reason","IconGlyph","MORE_ICON","CARET_ICON","event","container","UI","ROWS","afterSolidUpdate","isReady","SEGMENTED","MANY","VERTICAL","isInteractive","isTabs","LINK_LOOK","top","untrack","item","isAFormValue","each","items","isOn","hasThumb","thumb","stop","SELECTED_STATE","ITEM_BOX","ICONS","OVERFLOW","canFit","fit","DEFAULT_SLOT","hide","isOpen","isConnected","refocus","_self$","createComponent","Show","isServer","_el$","addEvent","ref","insert","effect","readShallow","OVERFLOW_ITEM_CLASS","className","_p$","t","setAttribute","o","i","n","h","_self$2","_el$2","_el$3","_el$4","DOT","_v$","_$p","_self$3","_el$5","_el$6","TITLE","_el$7","CARET","_self$4","_el$8","For","OVERFLOW_MENU_CLASS","copies","copy","badges","glyph","_self$5","_el$9","_el$10","_el$11","_el$12","LETTER","_c$","memo","_el$13","BADGE","ROW","SELECTED_CLASS","DISABLED_CLASS","isRoving","orientation","bar","selected","_self$6","_self$7","Switch","Match","_el$14","_el$15","_el$16","_el$17","_el$18","_el$19","target","root","UIMenu","delegateEvents"],"sources":["../src/components/ui-menu/UIMenu.en.ts","../src/components/ui-menu/TitleFit.ts","../src/components/ui-menu/UIMenu.tsx","../src/components/ui-menu/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-menu>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), events, slots, parts, states and texts.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Pure data: node imports it (`yarn site:data`, `yarn gen:root`), so `spell/ui/core` for types only,\n * `UIT` by value straight from `components.types`.\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-menu appearance=\"secondary pointing\" size=\"large\" items=\"3\">` => `ui large three item secondary pointing menu`.\n * `UIMenu.css` keys on those words.\n * - Items are the generic `<ui-item>` (`spell/ui/components/ui-item`), styled by owner context: `ownsParts` has `item`.\n * A `<ui-menu>` inside a menu is a SUB-MENU (Fomantic's `<div class=\"right menu\">`), so `menu` is owned too;\n * a `<ui-header>` inside an item is a vertical menu's sub header.\n * - `tabular` is Fomantic's classic word; 2.9 renamed it `tabbed` (`@variationMenuTabbedLegacyTabular`).\n * - The look is `appearance`, several words at once (`UIT.MenuAppearances`, shared with `<ui-tabs>`, plus `link` and\n * `borderless`); the older booleans (`tabular`, `pointing`, `secondary`, `text`, `link`, `borderless`) are its\n * old names (`replaces`, epic `ui-gaps` P4), and draw the same class words.\n * - Item layout: `align` (`UIT.ItemAlignments`; its old name `alignment`) places the items, `equal` sizes them alike\n * from the items themselves; `items=\"3\"` / `items=\"equal\"` stay as the older count-based aliases.\n * - `shrinkable` fits the items' titles to the row (`TitleFit`, epic `ui-gaps` P13): cut, then icons only, then one\n * overflow button; its slot, parts, states and text are its own.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `menuVocabulary`\n * The names of `<ui-menu>`, a menu: a `<nav>` of items (links) by default,\n * a `role=\"menubar\"` with roving focus when `interactive`,\n * or a sub-menu `<div class=\"right menu\">` inside another menu.\n ****************/\nexport const menuVocabulary = {\n tag: \"ui-menu\",\n icon: \"bars\",\n snippet: \"<ui-menu>\\n\\t<ui-item>One</ui-item>\\n\\t<ui-item>Two</ui-item>\\n</ui-menu>\",\n // a segmented menu with a `name` is a native form's field too (epic `debut` J166)\n formControl: true,\n topics: [\"menus\", \"navigation\", \"basic\", \"collections\"],\n aka: [\"navbar\", \"nav\", \"tabs bar\", \"toolbar\", \"sidebar menu\", \"pagination\"],\n skeleton: \"3 tall\",\n noun: \"menu\",\n description: \"A menu displays grouped navigation actions.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Hue of the active item; with `inverted`, the menu's fill; `segmented`, the selected item's fill.\"\n },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [...UIT.MenuAppearances, \"link\", \"borderless\", \"header\", \"capsule\"],\n // its words are Fomantic's classes as they are\n classes: {},\n replaces: [...UIT.MenuAppearances.filter((word) => word !== \"segmented\"), \"link\", \"borderless\"].map((word) => ({\n from: word,\n value: word\n })),\n description:\n \"The look, several words at once: `tabular` (tabs on a rule), `pointing` (the active item points at the \" +\n \"content; an underline with `secondary`), `secondary` (no box, rounded items), `text` (plain words), \" +\n \"`segmented` (a segmented control: a bordered group of joined items, the selected one filled with `color`, \" +\n \"else the primary colour; it moves `selected` to the item chosen itself; `--ui-menu-segmented-*` restyle \" +\n \"it as a pill track with a raised thumb), `link` (every item interactive: a `<button>` with the link \" +\n \"hover), `borderless` (no dividers between items), `header` (alone: a whole bar across the top of a window, flat \" +\n \"and short, 38px and 13px, over a hairline, in the theme's bar; with `segmented`: the row of a pane's bar, 13px, \" +\n \"with no track of its own, the bar behind it being the track, and its items sharing the row's width), `capsule` \" +\n \"(a nested menu of actions, grouped on one rounded piece of glass). Old names: the bare switches `tabular`, `pointing`, \" +\n \"`secondary`, `text`, `link`, `borderless`.\"\n },\n {\n name: \"name\",\n group: \"form\",\n kind: \"string\",\n description:\n \"A `segmented` menu's name in a form: the form reads its `value` and writes it back, as a select's \" +\n \"(epic `debut` P31).\"\n },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n description:\n \"A `segmented` menu's chosen item, by its `value` (else its text): setting it selects that item; \" +\n \"choosing one sets it, and sends `ui-changed` with `{ value }`.\"\n },\n {\n name: \"choose\",\n group: \"behaviour\",\n kind: \"valueOnly\",\n values: [\"one\", \"many\"],\n classes: { one: \"\", many: \"toggles\" },\n description:\n \"A `segmented` menu's choice: `one` (the default) selects the item chosen and unselects the rest; \" +\n \"`many` makes each item a toggle, pressed in while selected (`aria-pressed`), with no sliding thumb. \" +\n \"One stays on: turning off the only one on turns on the next, to its right or below (round to the first).\"\n },\n {\n name: \"position\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"left\", \"right\", \"center\"],\n description:\n \"Sub-menu: pushes it to the `right` / `left` end, or the `center`. A `vertical tabular` menu: `right` \" +\n \"opens its tabs to the left, for a menu on the content's right (`ui right vertical tabular menu`).\"\n },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"horizontal\", \"vertical\"],\n classes: { horizontal: \"\" },\n replaces: [{ from: \"vertical\", value: \"vertical\" }],\n description:\n \"Which way the items run: `horizontal` (the default) or `vertical`, stacked top to bottom. \" +\n \"Its old name was the bare `vertical` switch.\"\n },\n { name: \"pagination\", group: \"appearance\", kind: \"keyOnly\", description: \"Page links: compact, centred items.\" },\n { name: \"icon\", group: \"content\", kind: \"keyOnly\", description: \"Icon-only items.\" },\n {\n name: \"labeled\",\n group: \"appearance\",\n kind: \"keyOnly\",\n key: \"labeled icon\",\n description: \"Labeled icon items: a large icon above each item's text.\"\n },\n { name: \"fluid\", group: \"layout\", kind: \"keyOnly\", description: \"Takes the full width of its container.\" },\n { name: \"stackable\", group: \"layout\", kind: \"keyOnly\", description: \"Stacks its items on mobile.\" },\n { name: \"centered\", group: \"layout\", kind: \"keyOnly\", description: \"Centred in its container, items centred.\" },\n\n {\n name: \"wrapping\",\n group: \"layout\",\n kind: \"keyOnly\",\n description: \"Items wrap onto more lines when they don't fit.\"\n },\n {\n name: \"wrap\",\n group: \"appearance\",\n kind: \"keyOnly\",\n key: \"wrapped\",\n replaces: [\"wrapped\"],\n description: \"With `wrapping`: square corners where the lines meet. Its old name was `wrapped`.\"\n },\n {\n name: \"inverted\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"The dark scheme; with `color`, filled with the colour.\"\n },\n {\n name: \"padding\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"none\", \"none-x\", \"none-y\", \"compact\"],\n classes: { none: \"fitted\", \"none-x\": \"horizontally fitted\", \"none-y\": \"vertically fitted\" },\n replaces: [\n { from: \"fitted\", value: \"none\", values: { horizontally: \"none-x\", vertically: \"none-y\" } },\n { from: \"compact\", value: \"compact\" }\n ],\n description:\n \"`none`: no item padding; `none-x` / `none-y` keep only the top and bottom, or the left and right; \" +\n \"`compact`: only as wide as its items. Old names: `fitted` (`horizontally`, `vertically`), `compact`.\"\n },\n {\n name: \"attach\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"both\", \"top\", \"bottom\"],\n classes: { both: \"attached\", top: \"top attached\", bottom: \"bottom attached\" },\n replaces: [{ from: \"attached\", value: \"both\" }],\n description:\n \"Joined edge to edge with a segment above (`top`), below (`bottom`), or both (`both`, in the middle). \" +\n \"Its old name was `attached`.\"\n },\n {\n name: \"fixed\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"top\", \"bottom\", \"left\", \"right\"],\n description: \"Fixed to an edge of the viewport.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"valueAndKey\",\n key: \"aligned\",\n values: UIT.ItemAlignments,\n replaces: [\"alignment\"],\n description:\n \"Where the items sit: `fluid` -- they fill the bar; `left` / `center` / `right` -- packed at that end of \" +\n 'a full-width bar (a `segmented` menu moves as a whole). `align=\"center\"` => `center aligned`. ' +\n \"Its old name was `alignment`.\"\n },\n {\n name: \"equal\",\n group: \"layout\",\n kind: \"keyOnly\",\n description:\n 'Every item the same width, from the items themselves (no count): with `align=\"fluid\"` each takes an ' +\n \"equal share of the bar; otherwise each is as wide as the widest, packed.\"\n },\n {\n name: \"items\",\n group: \"content\",\n kind: \"width\",\n widthClass: \"item\",\n canEqual: true,\n description:\n 'Older, count-based alias of `equal`: divides the width evenly between N items (`items=\"3\"` => ' +\n '`three item`); `items=\"equal\"` => `equal width` (Fomantic\\'s, ~== `equal alignment=\"fluid\"`).'\n },\n {\n name: \"shrinkable\",\n group: \"layout\",\n kind: \"boolean\",\n description:\n \"Fits its items' titles to its width: every title whole while they fit; then the longest cut first, \" +\n \"each ending in `…`; once one would be cut under `--ui-menu-title-min`, icons only (`:state(icons-only)`, \" +\n \"each title its item's tooltip; an item with no icon shows its title's first letter); once a button \" +\n \"would be under `--ui-menu-item-min`, every item folds into one `…` button whose menu holds them all \" +\n \"(`:state(overflow)`). A `segmented` one becomes a dropdown instead (`:state(dropdown)`): one button \" +\n \"showing the chosen item. Items with no words (an icon button) stay as they are. Off by default.\"\n },\n {\n name: \"ticks\",\n group: \"behaviour\",\n kind: \"boolean\",\n description:\n \"A menu of things that are on or off: each item keeps a gutter before its words, and shows a tick there while \" +\n \"`selected`, in plain text. The solid accent fill is then only for the row under the pointer or the keyboard, \" +\n \"never for what's on. It moves nothing itself: the page says which are `selected`. \" +\n \"Set it on a menu with one of these rows, so its words stay put whichever are on. Off by default.\"\n },\n {\n name: \"icon-column\",\n group: \"appearance\",\n kind: \"boolean\",\n description:\n \"Each row keeps an icon box before its words, empty for a row with no icon, so every title starts at the \" +\n \"same place, as a Mac's menus do. With `ticks`, the tick comes first, then the icon. Off by default.\"\n },\n {\n name: \"tabs\",\n group: \"behaviour\",\n kind: \"boolean\",\n description:\n \"Its items are tabs, for a screen reader (`role=tablist`, each a `role=tab`, the chosen one `aria-selected`): \" +\n \"one Tab stop, arrow keys between them. For a row that switches what's shown under it. Off by default.\"\n },\n {\n name: \"interactive\",\n group: \"behaviour\",\n kind: \"boolean\",\n description:\n \"An application menubar (`role=menubar`): one Tab stop, arrow keys between items, every item a \" +\n \"`menuitem`. Default: a `<nav>` landmark of links.\"\n }\n ],\n events: [\n {\n name: \"ui-choosing\",\n detail: \"{ value: string, item: Element, originalEvent?: Event }\",\n cancelable: true,\n description:\n \"An interactive item (a link or button) was activated. `value` is the item's `value`, else its text. \" +\n \"The menu doesn't move `selected` itself, except a `segmented` one (a single-choice control), which \" +\n \"selects the item and unselects the rest: `preventDefault()` keeps the old choice.\"\n },\n {\n name: \"ui-changed\",\n detail: \"{ value?: string, values?: string[] }\",\n description:\n \"A `segmented` menu's choice changed: `value`, the item chosen; a `choose=\\\"many\\\"` menu's `values`, the \" +\n \"items now on, in order (each one's `value`, else its text).\"\n },\n {\n name: \"ui-form-value\",\n detail: \"{}\",\n description:\n \"A `segmented` menu with a `name` is drawn, so it holds a form value now: a `<ui-form>` around it binds it.\"\n }\n ],\n slots: [\n { name: \"\", description: \"`<ui-item>`s, sub-menus (`<ui-menu position>`), and other content.\" },\n {\n name: \"overflow\",\n description: '`shrinkable`: what the overflow button shows instead of its `…`, e.g. `<ui-icon name=\"bars\">`.'\n }\n ],\n parts: [\n { name: \"menu\", description: \"The menu box: `<nav>`, `<div role=menubar>`, or a sub-menu's `<div>`.\" },\n {\n name: \"overflow\",\n description:\n \"`shrinkable`: the overflow button, shown once the items fold into it (a `segmented` one's dropdown).\"\n },\n { name: \"overflow-menu\", description: \"`shrinkable`: the overflow button's menu, every item in a row.\" }\n ],\n states: [\n { name: \"interactive\", description: \"A menubar (`interactive`).\" },\n { name: \"vertical\", description: 'Items stacked (`direction=\"vertical\"`).' },\n { name: \"icons-only\", description: \"`shrinkable`: the titles are gone, the icons only.\" },\n { name: \"overflow\", description: \"`shrinkable`: every item folded into the overflow button.\" },\n { name: \"dropdown\", description: \"`shrinkable` and `segmented`: one button showing the chosen item, a dropdown.\" },\n {\n name: \"form-value\",\n description: \"A `segmented` menu with a `name`: a form reads and writes its `value`, as a select's.\"\n }\n ],\n texts: [\n {\n key: \"more\",\n text: \"More\",\n description: \"`shrinkable`: the overflow button's accessible name and tooltip, and its menu's name.\"\n }\n ],\n ownsParts: [\"item\", \"menu\", \"header\"]\n} as const satisfies E.ComponentVocabulary\n","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `TitleFit`\n * How a `shrinkable` menu (`<ui-menu shrinkable>`, `<ui-toolbar shrinkable>`) fits its items' titles to its row,\n * in four stages as it gets narrower (epic `ui-gaps` P13, from the docs toolbars' own; epic `epic-engine` Q29-Q38):\n * 1. every title whole, while they fit\n * 2. the longest titles cut first, down to one width, each ending in `…` (`cap()`)\n * 3. once any title would be cut under `--ui-menu-title-min` (50px): icons only, every title gone\n * 4. once even the icons don't fit (a button under `--ui-menu-item-min`, 34px): the items fold into ONE overflow\n * button, whose menu holds them all\n * - A `segmented` menu has two: whole, else a dropdown (its overflow button showing the chosen item).\n * - A toolbar's `scroll-first` puts one between them: the row scrolls while it has `--ui-toolbar-scroll-min`.\n * - Plain DOM, no Solid, shaped like `SegmentedThumb`: `<ui-menu>` hands it its box and a way to find its items,\n * starts it, and hears each new answer (`onAnswer`).\n * - The maths are pure statics (`cap()`, `fit()`), tested on their own.\n * - What it writes, on the menu's box and DOM element (`present()`):\n * - `--_menu-fit`: `whole`, `cut`, `icons` or `overflow`, which the item rules query (`UIMenu.css`)\n * - `--_menu-title-max`: the widest a title may be now, while `cut`\n * - the DOM element's `:state(icons-only)`, `:state(overflow)` or `:state(dropdown)`\n * - It measures every stage for real, the same way whichever stage shows now (`measure()`):\n * - for each stage it writes that stage's look, reads the sizes, then writes back the stage that shows,\n * all before the next paint, so nothing flashes and a page's own CSS for `:state(icons-only)` counts\n * - so a width between two stages never flips back and forth\n * - It refits (`update()`) whenever a size could have changed: the box, an item's box or title, anything else in\n * the row (`ResizeObserver`), the fonts loading; the menu also asks when its items or their words change.\n * - It writes only when the answer changed, so the sizes it causes can't set it off again.\n ****************/\nexport class TitleFit {\n /** the menu's box its items sit in: where the stage is written */\n readonly box: HTMLElement\n\n /** what it measures and writes, from the menu */\n private readonly setup: TitleFitSetup\n\n constructor(setup: TitleFitSetup) {\n this.box = setup.box\n this.setup = setup\n }\n\n /** The stage showing now. */\n answer: FitAnswer = WHOLE\n\n /** Watches the sizes while started. */\n private resizes: ResizeObserver | undefined\n\n /** What the observer watches now. */\n private readonly watched = new Set<Element>()\n\n /** Stops the fonts' listener. */\n private fonts: AbortController | undefined\n\n /** `refit()` just before the next paint, once however often `update()` asks. */\n private readonly refits = new E.Queued({ when: E.beforeNextPaint, run: () => this.refit() })\n\n ////////////////\n // ## Starting and stopping\n ////////////////\n\n /**\n * Fit now, and refit whenever a size could have changed.\n * - Returns `stop()`, for an effect's cleanup.\n */\n start(): () => void {\n this.stop()\n this.resizes = new ResizeObserver(() => this.update())\n this.fonts = new AbortController()\n const fonts = document.fonts\n fonts?.addEventListener(\"loadingdone\", () => this.update(), { signal: this.fonts.signal })\n void fonts?.ready.then(() => this.update())\n this.refit()\n return () => this.stop()\n }\n\n /** Refit just before the next paint, once whatever changed has drawn. */\n update(): void {\n if (this.resizes) this.refits.ask()\n }\n\n /** Stop watching, and take its look away: every title whole again. */\n stop(): void {\n this.refits.cancel()\n this.resizes?.disconnect()\n this.resizes = undefined\n this.watched.clear()\n this.fonts?.abort()\n this.fonts = undefined\n this.answer = WHOLE\n this.box.style.removeProperty(FIT)\n this.box.style.removeProperty(TITLE_MAX)\n for (const name of STAGE_STATES) this.setup.domElement.setState(name, false)\n }\n\n ////////////////\n // ## Fitting\n ////////////////\n\n /** Measure every stage, and show the one that fits; tell the menu when that changed. */\n refit(): void {\n if (!this.resizes || !this.box.isConnected) return\n const next = this.fitNow()\n this.present(next)\n if (next === this.answer) return\n this.answer = next\n this.setup.onAnswer(next)\n }\n\n /** The stage that fits now, measured. */\n private fitNow(): FitAnswer {\n const { rows, others } = this.setup.children()\n this.watch([...rows.flatMap(({ box, title }) => [box, title]), ...others.flatMap(TitleFit.boxesOf)])\n if (!rows.length) return WHOLE\n const sizes = this.measure(rows, others)\n if (sizes.fitsWhole) return WHOLE\n const titlesRoom = sizes.room - sizes.fixed.reduce((sum, width) => sum + width, 0)\n if (this.setup.isSegmented()) {\n if (TitleFit.cap(sizes.titles, titlesRoom) === undefined) return WHOLE\n return this.setup.scrollsFirst?.() && sizes.room >= sizes.scrollMin ? WHOLE : OVERFLOW\n }\n const fitted = TitleFit.fit(sizes.titles, titlesRoom, sizes.titleMin, {\n widths: sizes.icons,\n room: sizes.room,\n min: sizes.itemMin\n })\n // a row that scrolls first stops at its icons: its `‹` / `›` show the rest, no overflow button\n return fitted === OVERFLOW && this.setup.scrollsFirst?.() ? ICONS : fitted\n }\n\n /**\n * The sizes each stage needs, each measured in its own look:\n * - `fitsWhole`: every title whole, nothing cut and nothing past the row's end: the rest needn't be read\n * - `room`: the row's width for its items, less its padding, its gaps and everything else in it\n * (with their margins: once the row is full, an `auto` margin has nothing left to take)\n * - `titles`: each title's natural width; `fixed`: the rest of each item (padding, icon, badge), titles whole\n * - `icons`: each item's width with its icon only\n * - `titleMin`, `itemMin`: the two minimums, read from the menu's tokens\n * - SIDE EFFECT: writes each look in turn, then writes back the one showing; no paint in between.\n */\n private measure(rows: readonly FitRow[], others: readonly Element[]): FitSizes {\n const { box } = this\n this.present(WHOLE)\n const style = getComputedStyle(box)\n const fontSize = parseFloat(style.fontSize) || DEFAULT_FONT_SIZE\n const shown = others.filter(TitleFit.isShown)\n const gaps = (parseFloat(style.columnGap) || 0) * Math.max(0, rows.length + shown.length - 1)\n const padding = (parseFloat(style.paddingLeft) || 0) + (parseFloat(style.paddingRight) || 0)\n const fitsWhole =\n box.scrollWidth <= box.clientWidth &&\n rows.every(({ title }) => title.scrollWidth - title.getBoundingClientRect().width <= HAIR)\n const othersWidth = shown.reduce((sum, element) => sum + TitleFit.widthOf(element) + TitleFit.marginsOf(element), 0)\n const room = box.clientWidth - padding - gaps - othersWidth\n const titles = rows.map(({ title }) => title.scrollWidth)\n const fixed = rows.map(\n ({ box: itemBox, title }) => TitleFit.outerWidthOf(itemBox) - title.getBoundingClientRect().width\n )\n const titleMin = TitleFit.lengthOf(style.getPropertyValue(TITLE_MIN), fontSize, DEFAULT_TITLE_MIN)\n const itemMin = TitleFit.lengthOf(style.getPropertyValue(ITEM_MIN), fontSize, DEFAULT_ITEM_MIN)\n const scrollMin = TitleFit.lengthOf(style.getPropertyValue(SCROLL_MIN), fontSize, DEFAULT_SCROLL_MIN)\n let icons: number[] = []\n if (!this.setup.isSegmented()) {\n this.present(ICONS)\n icons = rows.map(({ box: itemBox }) => TitleFit.outerWidthOf(itemBox))\n }\n this.present(this.answer)\n return { fitsWhole, room, titles, fixed, icons, titleMin, itemMin, scrollMin }\n }\n\n /** Write `answer`'s look: `--_menu-fit` and `--_menu-title-max` on the box, the stage's `:state()`. */\n private present(answer: FitAnswer): void {\n const { box, setup } = this\n const isSegmented = setup.isSegmented()\n box.style.setProperty(FIT, typeof answer === \"number\" ? CUT : answer)\n if (typeof answer === \"number\") box.style.setProperty(TITLE_MAX, `${answer}px`)\n else box.style.removeProperty(TITLE_MAX)\n setup.domElement.setState(ICONS_ONLY_STATE, answer === ICONS)\n setup.domElement.setState(OVERFLOW_STATE, answer === OVERFLOW && !isSegmented)\n setup.domElement.setState(DROPDOWN_STATE, answer === OVERFLOW && isSegmented)\n }\n\n /** Watch `elements`' sizes: the new ones from now, the gone ones no more. */\n private watch(elements: readonly Element[]): void {\n const resizes = this.resizes\n if (!resizes) return\n // the menu's parent too: a segmented one's dropdown is only as wide as its button, so its box can't tell\n // when there's room again\n const parent = this.setup.domElement.parentElement\n const next = new Set([this.box, ...(parent ? [parent] : []), ...elements])\n for (const element of this.watched) {\n if (!next.has(element)) {\n resizes.unobserve(element)\n this.watched.delete(element)\n }\n }\n for (const element of next) {\n if (this.watched.has(element)) continue\n resizes.observe(element)\n this.watched.add(element)\n }\n }\n\n ////////////////\n // ## The maths\n ////////////////\n\n /**\n * How titles of natural `widths` (px) fit `room`, and what to show:\n * - `\"whole\"`: every one, uncut\n * - a number: the widest a title may be (`cap()`), the longest giving way first\n * - `\"icons\"`: none, the icons only, once a title would be cut under `min`: a stub like \"6 W…\" says nothing\n * - `\"overflow\"`: not even the icons fit; needs `icons`, each item's width with its icon only, the row's room for\n * them and the smallest a button may be: they fit while every button, at least `icons.min` wide, adds up to no\n * more than `icons.room`\n * - e.g. `[30, 80, 120]`, `min` 50: in 230px `\"whole\"`, in 200px 90, in 120px `\"icons\"` (45 each)\n * - STATIC: pure, no DOM\n */\n static fit(widths: readonly number[], room: number, min: number, icons?: IconRow): FitAnswer {\n const cap = TitleFit.cap(widths, room)\n if (cap === undefined) return WHOLE\n if (cap >= min) return cap\n if (!icons) return ICONS\n const needed = icons.widths.reduce((sum, width) => sum + Math.max(width, icons.min), 0)\n return needed > icons.room ? OVERFLOW : ICONS\n }\n\n /**\n * The widest a title may be so `widths` fit in `room`, the longest giving way first; `undefined`: all fit whole.\n * - e.g. `[30, 80, 120]` in 200px: 90 (30 + 80 + 90)\n * - STATIC: pure, no DOM\n */\n static cap(widths: readonly number[], room: number): number | undefined {\n const sorted = [...widths].sort((a, b) => a - b)\n let left = room\n for (const [index, width] of sorted.entries()) {\n const share = left / (sorted.length - index)\n if (width > share) return Math.max(0, Math.floor(share))\n left -= width\n }\n return undefined\n }\n\n /**\n * A token's length in px: `50px`, `3em` (of `fontSize`), or a bare number of px; `fallback` for anything else.\n * - STATIC: pure, no DOM\n */\n static lengthOf(text: string, fontSize: number, fallback: number): number {\n const match = LENGTH.exec(text.trim())\n if (!match) return fallback\n const value = parseFloat(match[1]!)\n return match[2] === EM ? value * fontSize : value\n }\n\n ////////////////\n // ## Measuring\n ////////////////\n\n /**\n * The width `element` draws, whatever its own `display`: a `<ui-item>` or `<ui-menu>` is `display: contents`,\n * its box in its shadow root.\n * - Static: needs no instance.\n */\n static widthOf(element: Element): number {\n const boxes = TitleFit.boxesOf(element)\n if (!boxes.length) return 0\n const rects = boxes.map((box) => box.getBoundingClientRect())\n return Math.max(...rects.map((rect) => rect.right)) - Math.min(...rects.map((rect) => rect.left))\n }\n\n /**\n * A box's width with its inline margins (an item's, in a `secondary` menu).\n * - Static: needs no instance.\n */\n static outerWidthOf(box: Element): number {\n return box.getBoundingClientRect().width + TitleFit.marginsOf(box)\n }\n\n /** `element`'s inline margins, or its boxes' (`boxesOf()`) for one that draws none of its own. */\n private static marginsOf(element: Element): number {\n const style = getComputedStyle(element)\n if (style.display === CONTENTS) {\n const boxes = TitleFit.boxesOf(element)\n return boxes.length === 1 ? TitleFit.marginsOf(boxes[0]!) : 0\n }\n return (parseFloat(style.marginLeft) || 0) + (parseFloat(style.marginRight) || 0)\n }\n\n /** The boxes `element` draws: itself, or for `display: contents` what's inside it (its shadow root's, its slot's). */\n private static boxesOf(element: Element): Element[] {\n const style = getComputedStyle(element)\n if (style.display === NONE) return []\n if (style.display !== CONTENTS) return [element]\n const inside =\n element.localName === SLOT\n ? (element as HTMLSlotElement).assignedElements()\n : [...(element.shadowRoot?.children ?? element.children)]\n return inside.filter((child) => child.localName !== STYLE).flatMap(TitleFit.boxesOf)\n }\n\n /** Does `element` draw anything (not hidden, not `display: none`)? */\n private static isShown(element: Element): boolean {\n return TitleFit.boxesOf(element).length > 0\n }\n}\n\n////////////////\n// ## Types\n////////////////\n\n/**\n * A stage of `TitleFit`: `\"whole\"`, the widest a title may be (px: cut), `\"icons\"` or `\"overflow\"`\n * (a segmented menu's dropdown).\n */\nexport type FitAnswer = \"whole\" | number | \"icons\" | \"overflow\"\n\n/** One item `TitleFit` fits: its box and its title box, in its shadow root. */\nexport type FitRow = {\n /** the item's box (`part=\"item\"`) */\n box: HTMLElement\n /** its title box (`part=\"title\"`) */\n title: HTMLElement\n}\n\n/** What `new TitleFit()` is handed. */\nexport type TitleFitSetup = {\n /** the menu's box its items sit in */\n box: HTMLElement\n /** the menu's DOM element, which shows the stage's `:state()` */\n domElement: E.DOMElement\n /** the items it fits, and everything else in the row (another button, a sub-menu, an item with no words) */\n children: () => { rows: FitRow[]; others: Element[] }\n /** a segmented menu: whole, else a dropdown */\n isSegmented: () => boolean\n /** a segmented menu scrolls while it has `--ui-toolbar-scroll-min`, rather than become a dropdown (`scroll-first`) */\n scrollsFirst?: () => boolean\n /** the stage changed */\n onAnswer: (answer: FitAnswer) => void\n}\n\n/** The icons-only stage's sizes, for `fit()`'s last answer. */\nexport type IconRow = {\n /** each item's width with its icon only */\n widths: readonly number[]\n /** the row's room for its items */\n room: number\n /** the smallest a button may be before they fold into the overflow menu */\n min: number\n}\n\n/** What `measure()` reads. */\ntype FitSizes = {\n fitsWhole: boolean\n room: number\n titles: number[]\n fixed: number[]\n icons: number[]\n titleMin: number\n itemMin: number\n /** the least room a `scroll-first` row scrolls in */\n scrollMin: number\n}\n\n////////////////\n// ## Constants\n////////////////\n\n/** The stages, as `--_menu-fit` writes them. */\nconst WHOLE = \"whole\"\nconst CUT = \"cut\"\nconst ICONS = \"icons\"\nconst OVERFLOW = \"overflow\"\n\n/** Custom property of the stage, on the box. */\nconst FIT = \"--_menu-fit\"\n\n/** Custom property of the widest a title may be, on the box. */\nconst TITLE_MAX = \"--_menu-title-max\"\n\n/** The two minimums' aliases, declared on the menu's box (`UIMenu.css`). */\nconst TITLE_MIN = \"--_ui-menu-title-min\"\nconst ITEM_MIN = \"--_ui-menu-item-min\"\n/** The token of the least room a `scroll-first` row scrolls in. */\nconst SCROLL_MIN = \"--ui-toolbar-scroll-min\"\n\n/** Their defaults, should a token not read as a length. */\nconst DEFAULT_TITLE_MIN = 50\nconst DEFAULT_ITEM_MIN = 34\n/** `SCROLL_MIN`, unset. */\nconst DEFAULT_SCROLL_MIN = 200\n\n/** How far past its box a title may run, in px, and still count as whole: layout's rounding. */\nconst HAIR = 0.5\n\n/** A font size, should the box's not read. */\nconst DEFAULT_FONT_SIZE = 14\n\n/** The stages' states on the menu's DOM element. */\nconst ICONS_ONLY_STATE = \"icons-only\"\nconst OVERFLOW_STATE = \"overflow\"\nconst DROPDOWN_STATE = \"dropdown\"\nconst STAGE_STATES = [ICONS_ONLY_STATE, OVERFLOW_STATE, DROPDOWN_STATE] as const\n\n/** A length a token holds: a number, then `px`, `em` or nothing. */\nconst LENGTH = /^(-?\\d*\\.?\\d+)(px|em)?$/\n\n/** The `em` unit. */\nconst EM = \"em\"\n\n/** `display` values `widthOf()` looks through. */\nconst NONE = \"none\"\nconst CONTENTS = \"contents\"\n\n/** Tag names `boxesOf()` treats apart. */\nconst SLOT = \"slot\"\nconst STYLE = \"style\"\n","import { For, Match, Show, Switch, untrack } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { menuVocabulary } from \"./UIMenu.en\"\nimport { SegmentedThumb } from \"./SegmentedThumb\"\nimport { TitleFit, type FitAnswer, type FitRow } from \"./TitleFit\"\n\nimport menuCSS from \"./UIMenu.css?inline\"\n\n/**\n * Same item context, field by field: items don't re-render for an equal one (`ownItemContext`'s `equals`).\n * - Above the class: `@derived({ equals })` reads it while the class is defined.\n */\nfunction isSameContext(a: UIT.ItemContext, b: UIT.ItemContext): boolean {\n return (\n a.domElementRole === b.domElementRole &&\n a.role === b.role &&\n a.interactive === b.interactive &&\n a.current === b.current &&\n a.shrinkable === b.shrinkable &&\n a.iconsOnly === b.iconsOnly &&\n a.pressed === b.pressed &&\n a.ticks === b.ticks &&\n a.iconColumn === b.iconColumn\n )\n}\n\n/**\n * Same overflow rows, row by row and field by field: the overflow menu doesn't redraw for an equal list.\n * - Above the class: `@state({ equals })` reads it while the class is defined.\n */\nfunction isSameFolded(a: readonly FoldedItem[], b: readonly FoldedItem[]): boolean {\n return (\n a.length === b.length &&\n a.every((row, index) => {\n const other = b[index]!\n return (Object.keys(row) as (keyof FoldedItem)[]).every((key) => row[key] === other[key])\n })\n )\n}\n\n/****************\n * ### `UIMenu`\n * The component behind `<ui-menu>`: a menu of generic `<ui-item>`s, in one of three shapes\n * (`UIMenu.css` has the markup of each).\n *\n * - DEFAULT, a navigation landmark: `<nav class=\"ui ... menu\" part=\"menu\" aria-label>` around the slot.\n * - Items with a `link` are links, the selected one `aria-current=\"page\"`;\n * `appearance=\"link\"` and `pagination` menus make every other item a `<button>`.\n * - The DOM element's `aria-label` names the landmark (two navs on a page need distinct names).\n *\n * - `interactive`, an application MENUBAR (WAI-ARIA APG): `<div role=\"menubar\" aria-orientation>`.\n * - Items are `role=\"menuitem\"` (their DOM elements `role=\"none\"`),\n * with ONE Tab stop, and arrow keys, Home and End between them.\n * - That's a roving tabindex (`UI.focus.roving`) over the items' BOXES (`UIItem.focusTarget`),\n * never their DOM elements:\n * a focusable DOM element without a visible role breaks the menubar's required-children pattern.\n * - Disabled items are skipped.\n *\n * - SUB-MENU: a `<ui-menu>` owned by a menu (`PartContext`: directly, or inside an item)\n * draws `<div class=\"[position] menu\" part=\"menu\">`, Fomantic's `.right.menu` or a vertical menu's `.item > .menu`,\n * and hands its items the TOP menu's `ItemContext`.\n *\n * - It owns its items (`ItemOwner`): they draw themselves as `itemContext()` says,\n * and adopt this component's `elementSetup.styleSheets` (the item rules live in `UIMenu.css`).\n * Items ASK for their context, which is also how the menu learns its items' DOM elements (the roving set),\n * after they upgrade in any order.\n *\n * - Events: `ui-select` (`{ value, item, originalEvent }`) when a link or button item is activated\n * (a click, or Enter or Space on it); only the TOP menu sends it.\n * - A menu never moves `selected` itself, EXCEPT a `segmented` one (a single-choice control):\n * it selects the activated item and unselects the rest, unless a listener cancels the `ui-select`.\n * - `segmented choose=\"many\"`: each item a toggle, turned on and off by itself (`aria-pressed`), then\n * `ui-changed` (`{ values }`, the items on); one always stays on (`toggle()`).\n *\n * - A top-level `segmented` menu draws ONE sliding thumb under its items (`SegmentedThumb`),\n * moved to each new choice as Apple's segmented control slides.\n *\n * - `shrinkable`: it fits its items' titles to its row (`TitleFit`, epic `ui-gaps` P13):\n * whole, then cut with `…`, then icons only, then every item folded into ONE overflow button,\n * `<button part=\"overflow\">` first in its box, whose menu (`<div role=\"menu\" popover part=\"overflow-menu\">`)\n * holds a row per item; picking a row clicks the real item, so `selected` and the page's listeners work as ever.\n * - A `segmented` one has two stages: whole, else a dropdown, its button showing the chosen item.\n * - Its items draw their titles in a box of their own while it is (`ItemContext.shrinkable`).\n ****************/\nexport class UIMenu extends E.UIComponent<typeof menuVocabulary> implements UIT.ItemOwner {\n @E.proto static vocabulary = menuVocabulary\n // `Partial`: `<ui-toolbar>` extends the menu, stating other keys\n @E.protoMerged static elementSetup: Partial<E.ElementSetup> = {\n styleSheets: { menu: menuCSS },\n // a sub-menu is a part of its menu: an item's header looks past it to the menu\n isAPart: true,\n // a native form sees a segmented menu's `value` (`FormData`, `form.elements`); any other menu sends nothing\n isAFormControl: true,\n // nothing to delegate to: the items are the focus targets\n delegatesFocus: false\n }\n\n /** Once it has drawn (`isReady`): re-apply the roving tabindexes, over the items it drew. */\n @E.onChange(\"isReady\")\n protected onReadyToRove(isReady: boolean) {\n if (isReady) this.queueRefresh()\n }\n\n ////////////////\n // ## The menu tree\n ////////////////\n\n /**\n * Owning menu, when this is a sub-menu.\n * - A `segmented` menu is never one: a single-choice control keeps its own look and thumb,\n * even inside another menu (Owen: the editor's Run | Edit | Debug, in its top bar).\n */\n readonly context = new E.PartContext({\n domElement: this.domElement,\n noun: this.vocabulary.noun,\n barrier: (element) => this.isSegmented || E.PartContext.isBarrier(element)\n })\n\n /** `appearance` holds `word` (`segmented`, `link` ...): it takes several at once. */\n hasLook(word: string): boolean {\n return String(this.appearance ?? \"\")\n .split(\" \")\n .includes(word)\n }\n\n /** A segmented control (`appearance` holds `segmented`): it moves `selected` itself, and draws a thumb. */\n get isSegmented(): boolean {\n return this.hasLook(SEGMENTED)\n }\n\n /** A segmented menu of toggles (`choose=\"many\"`): no thumb, each item pressed in while selected. */\n get choosesMany(): boolean {\n return this.isSegmented && this.choose === MANY\n }\n\n /** Its items run top to bottom (`direction=\"vertical\"`): `:state(vertical)`. */\n @E.cssState(\"vertical\")\n get isVertical(): boolean {\n return this.direction === VERTICAL\n }\n\n /** The owning menu's component, when this is a sub-menu: only menus own `menu` parts. */\n get parentMenu(): UIMenu | undefined {\n return this.context.ownerComponent<UIMenu>()\n }\n\n /** Top menu of a sub-menu tree. */\n get topMenu(): UIMenu {\n return this.parentMenu?.topMenu ?? this\n }\n\n /** A sub-menu's classes: `[position] menu`, no `ui`; `capsule` when it's one (`appearance`). */\n private get subMenuClasses(): string {\n return [this.position, this.hasLook(\"capsule\") && \"capsule\", this.vocabulary.noun].filter(Boolean).join(\" \")\n }\n\n ////////////////\n // ## Items\n ////////////////\n\n /** Item DOM elements that asked THIS (top) menu for their context: the roving candidates. */\n private readonly itemsThatAsked = new WeakSet<Element>()\n\n /**\n * What this menu's items render as (only the top menu's is read), from its attributes.\n * - The same object while an equal one is computed (`isSameContext()`): items don't re-render for it.\n */\n @E.derived({ equals: isSameContext })\n get ownItemContext(): UIT.ItemContext {\n const isInteractive = this.interactive\n const isTabs = this.isTabs\n return {\n domElementRole: isInteractive || isTabs ? \"none\" : undefined,\n role: isTabs ? \"tab\" : isInteractive ? (this.ticks ? \"menuitemcheckbox\" : \"menuitem\") : undefined,\n // a form's segmented control (`name`) chooses with a click, as a toggle row does\n interactive: isInteractive || this.hasLook(LINK_LOOK) || this.pagination || this.choosesMany || this.isAFormValue,\n current: \"page\",\n pressed: (this.choosesMany || this.ticks) && !isInteractive,\n ticks: this.ticks,\n iconColumn: this.iconColumn,\n shrinkable: this.isShrinking,\n iconsOnly: this.isIconsOnly\n }\n }\n\n /** What a sub-menu's items render as: the menu's context, but never fitted (only the row's own items are). */\n @E.derived({ equals: isSameContext })\n get nestedItemContext(): UIT.ItemContext {\n return { ...this.ownItemContext, shrinkable: false, iconsOnly: false }\n }\n\n /**\n * `ItemOwner`: what `item` renders as -- the TOP menu's published context. Tracked.\n * - SIDE EFFECT: records the item for the roving set,\n * and re-applies the roving tabindexes once the item has (re-)rendered its box.\n */\n itemContext(item: Element): UIT.ItemContext {\n // half-tracked on purpose: the item follows the top menu's context, never which menu is on top;\n // `@E.untracked` would untrack the whole method\n // oxlint-disable-next-line spell-ui/no-untrack -- half-tracked on purpose (above)\n const top = untrack(() => this.topMenu)\n top.itemsThatAsked.add(item)\n top.queueRefresh()\n return item.parentElement === top.domElement ? top.ownItemContext : top.nestedItemContext\n }\n\n /**\n * A click inside the menu: `ui-select` when it activated a link / button item\n * (Enter / Space on one click it too).\n * - Only the top menu dispatches; a sub-menu's clicks bubble to it.\n */\n @E.on(\"click\")\n protected onClick(event: MouseEvent) {\n if (this.parentMenu) return\n const item = UIMenu.activatedItem(event)\n if (!item || item.matches(UIT.DISABLED_STATE)) return\n const isChosen = this.send(\"ui-choosing\", { value: UIMenu.valueOf(item), item, originalEvent: event })\n if (!isChosen || !this.isSegmented) return\n if (this.choosesMany) this.toggle(item as ChoosableItem)\n else {\n this.chooseOnly(item)\n if (this.isAFormValue) this.chooseValue(UIMenu.valueOf(item))\n }\n }\n\n ////////////////\n // ## As a form's control\n ////////////////\n\n /**\n * `:state(form-value)`: a `segmented` menu choosing one, with a `name`: `<ui-form>` reads its `value` and writes\n * it back, as a select's (`FormFields`), so a property editor draws its `buttons` kind with one (epic `debut` P31).\n */\n @E.cssState(\"form-value\")\n get isAFormValue(): boolean {\n return this.isSegmented && !this.choosesMany && !!this.attributes.name\n }\n\n /** Now a form value: a `<ui-form>` around it binds it (`ui-form-value`). */\n @E.onChange(\"isAFormValue\", \"isReady\", { defer: true })\n protected onFormValueChanged(isAFormValue: boolean, isReady: boolean) {\n if (isAFormValue && isReady) E.afterSolidUpdate(() => this.send(\"ui-form-value\", {}))\n }\n\n /**\n * What a native form submits: the chosen item's `value` while it's a form value, else nothing.\n * - `null`: the platform's \"submit nothing\".\n */\n @E.onChange(\"isAFormValue\", \"valueText\")\n protected onSubmissionChanged(isAFormValue: boolean, value: string | undefined) {\n this.domElement.internals.setFormValue(isAFormValue && value != null ? value : null)\n }\n\n /** The value it started with: a form's reset chooses it again. */\n private readonly startingValue = this.attributes.value ?? undefined\n\n /** DOM API `formResetCallback()`: back to the value it started with. */\n override onFormReset() {\n if (this.isAFormValue && this.startingValue !== undefined) this.value = this.startingValue\n }\n\n /** A person chose the item of `value`: its `value` follows, then `ui-changed` with `{ value }`. */\n private chooseValue(value: string) {\n this.value = value\n this.send(\"ui-changed\", { value })\n }\n\n /** `value` set (by the page, or a form's binding): select its item, once the items have asked for their context. */\n @E.onChange(\"valueText\", \"isReady\")\n protected onValueChanged(value: string | undefined, isReady: boolean) {\n if (isReady && value != null && this.isSegmented && !this.choosesMany) E.afterSolidUpdate(() => this.showValue())\n }\n\n /** Select the item of `value`, if it has asked for its context yet. */\n @E.untracked\n private showValue() {\n const value = this.valueText\n if (value == null) return\n const item = this.ownedItems().find((each) => UIMenu.valueOf(each) === value)\n if (item && !item.selected) this.chooseOnly(item)\n }\n\n /** `value`'s text, raw. */\n get valueText(): string | undefined {\n return this.attributes.value ?? undefined\n }\n\n /** An item's `value`, else its text. */\n private static valueOf(item: Element): string {\n const component = (item as E.DOMElement).component as ItemComponent | undefined\n return component?.value ?? item.textContent?.trim() ?? \"\"\n }\n\n /**\n * A segmented menu's choice: `item` becomes the selected item, every other item of this menu tree drops it\n * (the `active` alias too).\n * - Only items that asked THIS menu for their context: a nested component's items stay alone.\n */\n private chooseOnly(item: Element) {\n for (const element of this.ownedItems()) {\n if (element !== item) element.removeAttribute(UIT.ACTIVE)\n element.selected = element === item\n }\n }\n\n /**\n * A toggle menu's press (`choose=\"many\"`): `item` turns on, or off; then `ui-changed` with the items on.\n * - One stays on: turning off the only one on turns on the next that can be (shown, not disabled),\n * to its right or below, round to the first (Owen: \"the stuck value is \\\"squirting over\\\" to the next one\").\n */\n private toggle(item: ChoosableItem) {\n const items = this.ownedItems().filter((each) => !each.hidden && !each.matches(UIT.DISABLED_STATE))\n // the property, fresh right after a write (its `:state(selected)` follows a moment later)\n const isOn = (each: ChoosableItem) => !!each.selected\n if (!isOn(item)) item.selected = true\n else {\n if (!items.some((each) => each !== item && isOn(each))) {\n const index = items.indexOf(item)\n const next = [...items.slice(index + 1), ...items.slice(0, Math.max(0, index))][0]\n if (!next) return\n next.selected = true\n }\n item.removeAttribute(UIT.ACTIVE)\n item.selected = false\n }\n this.send(\"ui-changed\", {\n values: this.ownedItems()\n .filter(isOn)\n .map((each) => UIMenu.valueOf(each))\n })\n }\n\n /** Item DOM elements that asked THIS menu for their context, in page order. */\n @E.untracked\n private ownedItems(): ChoosableItem[] {\n return [...this.domElement.querySelectorAll<ChoosableItem>(\"*\")].filter((each) => this.itemsThatAsked.has(each))\n }\n\n ////////////////\n // ## The sliding thumb\n ////////////////\n\n /** The top menu's box (its `nav`, or the menubar), while rendered: a segmented menu's track. */\n protected box: HTMLElement | undefined\n\n /** A segmented menu's sliding thumb, while drawn. */\n private thumb: SegmentedThumb | undefined\n\n /** A top-level `segmented` menu, rendered: it draws a sliding thumb. */\n get hasThumb(): boolean {\n return !this.parentMenu && this.isSegmented && !this.choosesMany && this.isReady\n }\n\n /** SIDE EFFECT: the thumb, drawn on the menu's box while `hasThumb`; its cleanup takes it down. */\n @E.onChange(\"hasThumb\", \"interactive\")\n protected onThumbChanged(hasThumb: boolean) {\n const box = this.box\n if (!hasThumb || !box) return\n const thumb = new SegmentedThumb({ track: box, chosenBox: () => this.chosenBox() })\n this.thumb = thumb\n const stop = thumb.start()\n return () => {\n stop()\n this.thumb = undefined\n }\n }\n\n /**\n * An item's `selected` (or `active`) changed, items came and went, showed or hid, or their words changed:\n * the thumb moves to the chosen one, and a `shrinkable` menu fits again.\n */\n @E.watches({\n attributes: true,\n subtree: true,\n childList: true,\n characterData: true,\n attributeFilter: [UIT.SELECTED, UIT.ACTIVE, \"hidden\"]\n })\n protected onChoiceChanged() {\n this.thumb?.update()\n this.titleFit?.update()\n this.readFolded()\n }\n\n /** The chosen item's box (in its own shadow root), among the items this menu owns. */\n @E.untracked\n private chosenBox(): HTMLElement | undefined {\n for (const element of this.domElement.querySelectorAll<HTMLElement>(\"*\")) {\n if (!this.itemsThatAsked.has(element) || element.hidden || !element.matches(SELECTED_STATE)) continue\n return element.shadowRoot?.querySelector<HTMLElement>(ITEM_BOX) ?? undefined\n }\n return undefined\n }\n\n ////////////////\n // ## Fitting titles (`shrinkable`)\n ////////////////\n\n /** A segmented row scrolls before it's a dropdown: a menu's never does (`UIToolbar`). */\n protected get scrollsFirst(): boolean {\n return false\n }\n\n /** It fits its titles to its row: `shrinkable`, a top-level menu whose items run sideways. */\n get isShrinking(): boolean {\n return this.shrinkable && !this.parentMenu && !this.isVertical\n }\n\n /** The stage `TitleFit` found: `whole`, the widest a title may be (cut), `icons` or `overflow`. */\n @E.state accessor fitAnswer: FitAnswer = WHOLE\n\n /** The titles are gone, the icons only: `:state(icons-only)`. */\n @E.cssState(\"icons-only\")\n get isIconsOnly(): boolean {\n return this.isShrinking && this.fitAnswer === ICONS\n }\n\n /** Every item folded into the overflow button: `:state(overflow)`. */\n @E.cssState(\"overflow\")\n get isFolded(): boolean {\n return this.isShrinking && this.fitAnswer === OVERFLOW && !this.isSegmented\n }\n\n /** A `segmented` one shows as a dropdown, its overflow button showing the chosen item: `:state(dropdown)`. */\n @E.cssState(\"dropdown\")\n get isDropdown(): boolean {\n return this.isShrinking && this.fitAnswer === OVERFLOW && this.isSegmented\n }\n\n /** Shrinking, and drawn: `TitleFit` runs. */\n get canFit(): boolean {\n return this.isShrinking && this.isReady\n }\n\n /** The fitting, while it runs. */\n private titleFit: TitleFit | undefined\n\n /** SIDE EFFECT: fits the titles while `canFit`, on the box drawn now; its cleanup shows them whole again. */\n @E.onChange(\"canFit\", \"interactive\", \"appearance\")\n protected onFitChanged(canFit: boolean) {\n const box = this.box\n if (!canFit || !box) return\n const fit = new TitleFit({\n box,\n domElement: this.domElement,\n children: () => this.fitChildren(),\n isSegmented: () => this.isSegmented,\n scrollsFirst: () => this.scrollsFirst,\n onAnswer: (answer) => this.onFitAnswer(answer)\n })\n this.titleFit = fit\n const stop = fit.start()\n return () => {\n stop()\n this.titleFit = undefined\n this.fitAnswer = WHOLE\n }\n }\n\n /** A new stage: the thumb follows its choice's box, the overflow menu closes once it's gone. */\n private onFitAnswer(answer: FitAnswer) {\n this.fitAnswer = answer\n this.thumb?.update()\n this.readFolded()\n if (answer !== OVERFLOW) this.overflowMenu.close()\n }\n\n /**\n * What `TitleFit` fits: the box's own items with words (each its box and title box), and everything else in\n * the row (another button, a sub-menu, an item with only an icon).\n */\n @E.untracked\n private fitChildren(): { rows: FitRow[]; others: Element[] } {\n const rows: FitRow[] = []\n const others: Element[] = []\n for (const element of this.rowElements()) {\n const item = this.fittedItem(element)\n if (item) rows.push({ box: item.focusTarget!, title: item.titleBox! })\n else others.push(element)\n }\n return { rows, others }\n }\n\n /** The elements in the box's default slot: its row. */\n @E.untracked\n private rowElements(): Element[] {\n return this.box?.querySelector<HTMLSlotElement>(DEFAULT_SLOT)?.assignedElements() ?? []\n }\n\n /** `element`'s component, when it's an item this menu fits: its own, drawn with a title box, not hidden. */\n private fittedItem(element: Element): ItemComponent | undefined {\n if (!this.itemsThatAsked.has(element) || (element as HTMLElement).hidden) return undefined\n const item = (element as E.DOMElement).component as ItemComponent | undefined\n return item?.kind === UIT.ITEM && item.focusTarget && item.titleBox ? item : undefined\n }\n\n ////////////////\n // ## The overflow button and its menu\n ////////////////\n\n /** The items the overflow menu holds, a row each, read from the page's items (`readFolded()`). */\n @E.state({ equals: isSameFolded }) accessor folded: readonly FoldedItem[] = []\n\n /** The chosen item, among them: what a segmented one's dropdown shows. */\n get chosen(): FoldedItem | undefined {\n return this.folded.find((row) => row.isSelected)\n }\n\n /** Some item inside has a count: a dot on the overflow button (epic `epic-engine` Q37). */\n get hasFoldedBadge(): boolean {\n return this.folded.some((row) => row.hasBadge)\n }\n\n /** Read the overflow menu's rows from the fitted items, now. */\n @E.untracked\n private readFolded() {\n if (!this.isShrinking) {\n this.folded = []\n return\n }\n const rows: FoldedItem[] = []\n for (const element of this.rowElements()) {\n const item = this.fittedItem(element)\n if (!item) continue\n const text = item.titleText ?? \"\"\n rows.push({\n element,\n text,\n icon: item.icon || undefined,\n letter: item.firstLetter,\n isSelected: !!item.isSelected,\n isDisabled: !!item.isDisabled,\n hasBadge: !!item.hasBadge\n })\n }\n this.folded = rows\n }\n\n /**\n * The overflow menu: its own open state (the menu sends no open or close events), a popover hung from its button,\n * and its `UI.overlays` entry while open: Escape or a click outside closes it, focus back on its button for Escape.\n */\n readonly overflowMenu = new E.PopoverPanel({\n component: this,\n restoreFocus: false,\n onDismiss: (reason) => this.closeOverflow(reason === \"escape\")\n })\n\n /** The overflow menu is open. */\n get isOverflowOpen(): boolean {\n return this.overflowMenu.isOpen\n }\n\n /** The overflow button, while drawn. */\n private overflowButton: HTMLButtonElement | undefined\n\n /** The overflow menu's box, while drawn. */\n private overflowPanel: HTMLElement | undefined\n\n /** The overflow menu's `id`: its button's `aria-controls`. */\n @E.lazy\n get overflowMenuId(): string {\n return UI.ids.next(this.vocabulary.tag)\n }\n\n /** The overflow button's name and tooltip, and its menu's: \"More\". */\n get moreText(): string {\n return this.translationForKey(\"more\")\n }\n\n /** The `…` on the overflow button. */\n readonly moreGlyph = new E.IconGlyph({ owner: this, name: () => (this.isShrinking ? MORE_ICON : undefined) })\n\n /** A segmented one's dropdown: its caret, and the chosen item's icon. */\n readonly caretGlyph = new E.IconGlyph({\n owner: this,\n name: () => (this.isShrinking && this.isSegmented ? CARET_ICON : undefined)\n })\n readonly chosenGlyph = new E.IconGlyph({\n owner: this,\n name: () => (this.isShrinking && this.isSegmented ? this.chosen?.icon : undefined)\n })\n\n /**\n * SIDE EFFECT: the overflow menu shows in the top layer while open, with its `UI.overlays` entry\n * (`PopoverPanel.follow()`), its chosen row (else its first) focused; the cleanup hides it.\n */\n @E.onChange(\"isOverflowOpen\", \"isConnected\")\n protected onOverflowOpenChanged(isOpen: boolean, isConnected: boolean) {\n const hide = this.overflowMenu.follow(this.overflowPanel, isOpen && isConnected)\n if (hide)\n E.afterSolidUpdate(() =>\n this.focusRow(\n Math.max(\n 0,\n this.folded.findIndex((row) => row.isSelected)\n )\n )\n )\n return hide\n }\n\n /** Open the overflow menu, its rows read fresh. */\n @E.untracked\n openOverflow() {\n this.readFolded()\n this.overflowMenu.open()\n }\n\n /** Close the overflow menu; `refocus`: focus goes back to its button (Escape, Tab, a pick). */\n @E.untracked\n closeOverflow(refocus = false) {\n this.overflowMenu.close()\n if (refocus) this.overflowButton?.focus()\n }\n\n /** Focus row `index` of the overflow menu, as it opens. */\n private focusRow(index: number) {\n this.overflowPanel?.querySelectorAll<HTMLElement>(ROWS)[index]?.focus()\n }\n\n /** The overflow button's keys: ↓ opens it, as Enter and Space do (a click). */\n @E.untracked\n private readonly onOverflowButtonKey = (event: KeyboardEvent) => {\n if (event.key !== UIT.Key.arrowDown) return\n event.preventDefault()\n this.openOverflow()\n }\n\n /**\n * The overflow menu's keys: ↑ ↓ Home End move, wrapping, past disabled rows (`UI.focus.arrowKey()`);\n * Escape closes it, focus back on its button; Tab closes it.\n */\n @E.untracked\n private readonly onOverflowMenuKey = (event: KeyboardEvent) => {\n const container = event.currentTarget as HTMLElement\n if (UI.focus.arrowKey(event, { container, items: ROWS, orientation: \"vertical\", tabindex: \"left alone\" })) return\n if (event.key === UIT.Key.escape) {\n event.preventDefault()\n this.closeOverflow(true)\n } else if (event.key === UIT.Key.tab) this.closeOverflow(true)\n }\n\n /** A row was picked: the menu closes, focus goes back to its button, and the real item is clicked. */\n @E.untracked\n private pickFolded(row: FoldedItem) {\n if (row.isDisabled) return\n this.closeOverflow(true)\n const item = (row.element as E.DOMElement).component as ItemComponent | undefined\n item?.focusTarget?.click()\n }\n\n /** The overflow button, first in the box: it shows only once the items fold into it (`UIMenu.css`). */\n private overflowButtonBox(): JSX.Element {\n return (\n <Show when={this.isShrinking && !isServer}>\n <button\n ref={(element: HTMLButtonElement) => (this.overflowButton = element)}\n type=\"button\"\n class={OVERFLOW_ITEM_CLASS}\n part={this.partForName(\"overflow\")}\n style={this.overflowMenu.anchorStyle}\n role={this.interactive ? \"menuitem\" : undefined}\n aria-haspopup=\"menu\"\n aria-expanded={this.overflowMenu.ariaExpanded}\n aria-controls={this.overflowMenuId}\n aria-label={this.isSegmented ? undefined : this.moreText}\n title={this.isSegmented ? this.chosen?.text : this.moreText}\n onClick={() => (this.isOverflowOpen ? this.closeOverflow() : this.openOverflow())}\n onKeyDown={this.onOverflowButtonKey}\n >\n <Show when={this.isSegmented} fallback={this.moreFace()}>\n {this.dropdownFace()}\n </Show>\n </button>\n </Show>\n )\n }\n\n /** The overflow button's `…` (or the `overflow` slot's own), and a dot while an item inside has a count. */\n private moreFace(): JSX.Element {\n return (\n <>\n <span class={UIT.ICON}>\n <slot name={this.slotForName(\"overflow\")}>{this.moreGlyph.svg}</slot>\n </span>\n <Show when={this.hasFoldedBadge}>\n <span class={DOT} aria-hidden=\"true\" />\n </Show>\n </>\n )\n }\n\n /** A segmented one's dropdown: the chosen item's icon and title, and a caret. */\n private dropdownFace(): JSX.Element {\n return (\n <>\n <Show when={this.chosenGlyph.svg}>\n <span class={UIT.ICON}>{this.chosenGlyph.svg}</span>\n </Show>\n <span class={TITLE}>{this.chosen?.text}</span>\n <span class={CARET}>{this.caretGlyph.svg}</span>\n </>\n )\n }\n\n /** The overflow menu: a popover in the top layer, hanging from its button, a row per folded item. */\n private overflowMenuBox(): JSX.Element {\n return (\n <Show when={this.isShrinking && !isServer}>\n <div\n ref={(element: HTMLElement) => (this.overflowPanel = element)}\n id={this.overflowMenuId}\n class={OVERFLOW_MENU_CLASS}\n part={this.partForName(\"overflow-menu\")}\n role=\"menu\"\n popover=\"manual\"\n style={this.overflowMenu.panelStyle}\n aria-label={this.moreText}\n onKeyDown={this.onOverflowMenuKey}\n >\n <For each={this.folded}>{(row) => this.foldedRow(row)}</For>\n </div>\n </Show>\n )\n }\n\n /**\n * One row of the overflow menu: the item's icon (its `icon`, a copy of what's in its `icon` slot, else its first\n * letter), its title and a copy of its counts; the chosen one a `menuitemradio`, ticked.\n */\n private foldedRow(row: FoldedItem): JSX.Element {\n const item = (row.element as E.DOMElement).component as ItemComponent | undefined\n const copies = (name: \"icon\" | \"badge\") =>\n (item?.slotted?.(name) ?? []).map((element) => {\n const copy = element.cloneNode(true) as Element\n copy.removeAttribute(\"slot\")\n return copy\n })\n const icons = copies(\"icon\")\n const badges = copies(\"badge\")\n const glyph = row.icon ? new E.IconGlyph({ owner: this, name: () => row.icon }) : undefined\n return (\n <button\n type=\"button\"\n class={[ROW, { [SELECTED_CLASS]: row.isSelected, [DISABLED_CLASS]: row.isDisabled }]}\n role={row.isSelected ? \"menuitemradio\" : \"menuitem\"}\n aria-checked={row.isSelected ? \"true\" : undefined}\n aria-disabled={row.isDisabled ? \"true\" : undefined}\n tabindex=\"-1\"\n onClick={() => this.pickFolded(row)}\n >\n <span class={UIT.ICON} aria-hidden=\"true\">\n {glyph ? glyph.svg : icons.length ? icons : <span class={LETTER}>{row.letter}</span>}\n </span>\n <span class={TITLE}>{row.text}</span>\n {badges.length ? <span class={BADGE}>{badges}</span> : undefined}\n </button>\n )\n }\n\n ////////////////\n // ## The menubar\n ////////////////\n\n /** Top-level and `interactive`? `:state(interactive)`; not `isMenubar`, which also waits for `isReady`. */\n @E.cssState(\"interactive\")\n get isInteractiveMenubar(): boolean {\n return !this.parentMenu && this.interactive\n }\n\n /** Top-level `tabs`: a `role=tablist` of `role=tab`s, one Tab stop, arrow keys between them; not while `interactive`. */\n get isTabs(): boolean {\n return !this.parentMenu && !!this.tabs && !this.interactive\n }\n\n /** Keys move between its items: a live menubar, or tabs once rendered. */\n get isRoving(): boolean {\n return this.isMenubar || (this.isTabs && this.isReady)\n }\n\n /** The menubar is live: top-level, `interactive`, rendered. */\n get isMenubar(): boolean {\n return !this.parentMenu && this.interactive && this.isReady\n }\n\n /** The menubar's arrow-key axis: `vertical` menus go up and down. */\n private get orientation(): E.RovingOrientation {\n return this.isVertical ? \"vertical\" : \"horizontal\"\n }\n\n /** Live roving tabindex while `interactive`. */\n private rovingTabindex: E.RovingTabindex | undefined\n\n /** The menubar root, while rendered. */\n private bar: HTMLElement | undefined\n\n /** SIDE EFFECT: a roving tabindex over the item DOM elements while this is a menubar; returns its stop. */\n @E.onChange(\"isRoving\", \"orientation\")\n protected onMenubarChanged(isRoving: boolean, orientation: E.RovingOrientation) {\n if (!isRoving) return\n E.afterSolidUpdate(() => this.startRoving(orientation))\n return () => this.stopRoving()\n }\n\n /** Start the roving tabindex on the menubar root, the selected item (or the first) as the tab stop. */\n private startRoving(orientation: E.RovingOrientation) {\n this.stopRoving()\n const bar = this.bar\n if (!bar || !this.domElement.isConnected) return\n const boxes = this.menuItems()\n const selected = boxes.findIndex((box) => (box.getRootNode() as ShadowRoot).host?.matches(SELECTED_STATE))\n this.rovingTabindex = UI.focus.roving({\n container: bar,\n items: () => this.menuItems(),\n orientation,\n activeIndex: Math.max(0, selected)\n })\n }\n\n /** Stop roving; the item boxes lose the `tabindex`es it set. */\n private stopRoving() {\n if (!this.rovingTabindex) return\n this.rovingTabindex.detach()\n this.rovingTabindex = undefined\n for (const box of this.menuItems()) box.removeAttribute(\"tabindex\")\n }\n\n /**\n * Re-apply the roving `tabindex`es once after Solid's update, however often asked,\n * after the item set may have changed (restarting before any focus); a `shrinkable` menu fits again.\n */\n private readonly rovingRefresh = new E.Queued({ when: E.afterSolidUpdate, run: () => this.refreshRoving() })\n\n /** Queue `refreshRoving()`. */\n private queueRefresh() {\n this.rovingRefresh.ask()\n }\n\n /** The item set may have changed: fit a `shrinkable` menu again, and re-apply the roving `tabindex`es. */\n private refreshRoving() {\n this.titleFit?.update()\n // items that asked since `value` was set: select its item now\n if (this.isAFormValue) this.showValue()\n if (!this.rovingTabindex) return\n if (this.domElement.matches(\":focus-within\")) this.rovingTabindex.refresh()\n else this.startRoving(this.orientation)\n }\n\n /**\n * The roving set, in document order: the item BOXES (`UIItem.focusTarget`) of items owned by this menu tree,\n * `type=\"item\"`, not hidden. Untracked: called from handlers and effect cleanups.\n */\n @E.untracked\n private menuItems(): HTMLElement[] {\n const boxes: HTMLElement[] = []\n for (const element of this.domElement.querySelectorAll<HTMLElement>(\"*\")) {\n if (!this.itemsThatAsked.has(element) || element.hidden) continue\n const item = (element as E.DOMElement).component as ItemComponent | undefined\n const box = item?.focusTarget\n if (box && item.kind === UIT.ITEM) boxes.push(box)\n }\n return boxes\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /**\n * The root for this shape: sub-menu, menubar or landmark; the DOM element's `aria-label` names the last two.\n * - `shrinkable`: the overflow button first in the box, and its menu after it (outside a menubar, whose children\n * must all be its items).\n */\n render(): JSX.Element {\n return (\n <>\n {this.menuBox()}\n {this.overflowMenuBox()}\n </>\n )\n }\n\n /** The name of its landmark or menubar: its `aria-label`, else its `label`. */\n private get landmarkLabel(): string | undefined {\n return this.attributes[\"aria-label\"] ?? this.sharedLabel ?? undefined\n }\n\n /** The menu's box, for its shape. */\n private menuBox(): JSX.Element {\n return (\n <Switch>\n <Match when={this.parentMenu}>\n <div class={this.subMenuClasses} part={this.partForName(\"menu\")}>\n <slot />\n </div>\n </Match>\n <Match when={this.interactive}>\n <div\n ref={(element: HTMLElement) => {\n this.bar = element\n this.box = element\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menubar\"\n aria-orientation={this.isVertical ? \"vertical\" : undefined}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </div>\n </Match>\n <Match when={true}>\n <nav\n ref={(element: HTMLElement) => {\n this.bar = element\n this.box = element\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role={this.isTabs ? \"tablist\" : undefined}\n aria-label={this.landmarkLabel}\n >\n {this.overflowButtonBox()}\n <slot />\n </nav>\n </Match>\n </Switch>\n )\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /**\n * The item DOM element whose link / button root the event went through, if any.\n * - STATIC: needs no instance, only the event's path.\n * - `instanceof` is safe here: a click handler, which the static render (`spell/ui/static`) never runs.\n */\n private static activatedItem(event: Event): Element | undefined {\n for (const target of event.composedPath()) {\n if (!(target instanceof HTMLElement)) continue\n if ((target.localName === \"a\" || target.localName === \"button\") && target.part.contains(UIT.ITEM)) {\n const root = target.getRootNode()\n return root instanceof ShadowRoot ? root.host : undefined\n }\n }\n return undefined\n }\n}\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIMenu extends E.AttributeValues<typeof menuVocabulary> {}\n\n////////////////\n// ## Constants\n////////////////\n\n/** Selector of a selected item DOM element: the menubar's first tab stop. */\nconst SELECTED_STATE = \":state(selected)\"\n\n/** Selector of an item's box in its shadow root: what a segmented menu's thumb covers. */\nconst ITEM_BOX = `.${UIT.ITEM}`\n\n/** The `appearance` of a single-choice menu: it moves `selected` itself. */\nconst SEGMENTED: UIT.MenuAppearance = \"segmented\"\n/** `choose` of a menu of toggles. */\nconst MANY = \"many\"\n\n/** The `appearance` word that makes every item interactive, with the link hover. */\nconst LINK_LOOK = \"link\"\n\n/** The `direction` of a menu whose items run top to bottom. */\nconst VERTICAL = \"vertical\"\n\n/** `TitleFit`'s stages the menu tells apart. */\nconst WHOLE = \"whole\"\nconst ICONS = \"icons\"\nconst OVERFLOW = \"overflow\"\n\n/** The box's default slot: its row. */\nconst DEFAULT_SLOT = \":scope > slot:not([name])\"\n\n/** Icons of the overflow button: `…`, and a segmented one's dropdown caret. */\nconst MORE_ICON = \"ellipsis horizontal\"\nconst CARET_ICON = \"caret down\"\n\n/** Class words of the overflow button (drawn as an item), its menu and their pieces (`UIMenu.css`, \"Shrinkable\"). */\nconst OVERFLOW_ITEM_CLASS = `${UIT.ITEM} overflow`\nconst OVERFLOW_MENU_CLASS = \"overflow-menu\"\nconst ROW = \"row\"\nconst TITLE = \"title\"\nconst BADGE = \"badge\"\nconst LETTER = \"letter\"\nconst CARET = \"caret\"\nconst DOT = \"dot\"\nconst SELECTED_CLASS = \"selected\"\nconst DISABLED_CLASS = \"disabled\"\n\n/** Selector of the overflow menu's rows, in its box. */\nconst ROWS = `:scope > .${ROW}`\n\n////////////////\n// ## Item types\n////////////////\n\n/** What the menu reads from an item's component (`UIItem`, not imported: another family). */\ntype ItemComponent = {\n /** `kind` (its vocabulary getter): `item`, `header` or `divider`; only `item`s join the roving set */\n readonly kind?: string\n /** `value` (its vocabulary getter): what `ui-select` reports for the item (default its text) */\n readonly value?: string\n /** the item's box that takes focus (its link or button), once rendered */\n focusTarget?: HTMLElement\n /** its title box, in a `shrinkable` menu */\n readonly titleBox?: HTMLElement\n /** its title, as a person reads it */\n readonly titleText?: string\n /** its `icon` attribute */\n readonly icon?: string\n /** selected (or `active`) */\n readonly isSelected?: boolean\n /** disabled */\n readonly isDisabled?: boolean\n /** something in its `badge` slot */\n readonly hasBadge?: boolean\n /** its title's first letter: what stands for it with no icon */\n readonly firstLetter?: string\n /** its light-DOM children in slot `name` */\n slotted?(name: \"icon\" | \"badge\"): Element[]\n}\n\n/** One row of a `shrinkable` menu's overflow menu: a fitted item, as read when it was (`readFolded()`). */\ntype FoldedItem = {\n /** the item's DOM element: what a pick clicks */\n readonly element: Element\n /** its title */\n readonly text: string\n /** its `icon` attribute */\n readonly icon: string | undefined\n /** its title's first letter: its icon when it has none */\n readonly letter: string | undefined\n /** selected: ticked */\n readonly isSelected: boolean\n /** disabled: can't be picked */\n readonly isDisabled: boolean\n /** has a count */\n readonly hasBadge: boolean\n}\n\n/** What the menu writes on an item's DOM element it chooses (`UIItem`'s reflected `selected`). */\ntype ChoosableItem = HTMLElement & {\n /** the item's `selected` property */\n selected?: boolean\n}\n","/**\n * The menu family: defines `<ui-menu>` and exports its component, `UIMenu`.\n * - SIDE EFFECT: importing it defines the tag, and `<ui-item>` first (through `spell/ui/components/ui-item`:\n * menus hold generic items). The menu registers as the owner of `item`, `menu` (sub-menus) and `header` parts.\n * - Also the library's `spell/ui/ui-menu` entry (its size is in `notes/report.md`).\n */\n\nimport { UIMenu } from \"./UIMenu\"\n\nimport \"spell/ui/components/ui-item\"\n\nUIMenu.define()\n\nexport { UIMenu }\n"],"mappings":";;;;;;;AA+BA,IAAakG,IAAiB;CAC5B,KAAK;CACL,MAAM;CACN,SAAS;CAET,aAAa;CACb,QAAQ;EAAC;EAAS;EAAc;EAAS;CAAa;CACtD,KAAK;EAAC;EAAU;EAAO;EAAY;EAAW;EAAgB;CAAY;CAC1E,UAAU;CACV,MAAM;CACN,aAAa;CACb,YAAY;EACV;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;IAAC,GAAGlG;IAAqB;IAAQ;IAAc;IAAU;GAAS;GAE1E,SAAS,CAAC;GACV,UAAU;IAAC,GAAA6F,EAAuB,QAAQ,MAASM,MAAS,WAAW;IAAG;IAAQ;GAAY,CAAC,CAAC,K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