spell-ui 0.8.8 → 0.8.10
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.
- package/README-components.md +9 -3
- package/README-frameworks.md +5 -5
- package/README-migrating.md +2 -2
- package/README.md +5 -5
- package/dist/{CodeEngine-GL9EzwF1.js → CodeEngine-B684vKxR.js} +39 -100
- package/dist/{CodeEngine-GL9EzwF1.js.map → CodeEngine-B684vKxR.js.map} +1 -1
- package/dist/{Dragging-CMZoLEWQ.js → Dragging-B93hbRxF.js} +17 -15
- package/dist/Dragging-B93hbRxF.js.map +1 -0
- package/dist/{MarkdownEngine-CW1WGqNp.js → MarkdownEngine-D1jqcFeU.js} +11 -72
- package/dist/{MarkdownEngine-CW1WGqNp.js.map → MarkdownEngine-D1jqcFeU.js.map} +1 -1
- package/dist/MarkdownSanitizer-CqsWivYJ.js +866 -0
- package/dist/MarkdownSanitizer-CqsWivYJ.js.map +1 -0
- package/dist/{PrefStore-Qv0e5y04.js → PrefStore-Di83C0bY.js} +13 -9
- package/dist/PrefStore-Di83C0bY.js.map +1 -0
- package/dist/ScrollingRow-DkOtx2QK.js +89 -0
- package/dist/ScrollingRow-DkOtx2QK.js.map +1 -0
- package/dist/{SitePages-CciwREek.js → SitePages-B3zd5Zgu.js} +37 -10
- package/dist/SitePages-B3zd5Zgu.js.map +1 -0
- package/dist/SlottedItems-DWfAZYqM.js +88 -0
- package/dist/SlottedItems-DWfAZYqM.js.map +1 -0
- package/dist/{TemporalPolyfill-D9mr7_wA.js → TemporalPolyfill-Bv_c_xa0.js} +7 -12
- package/dist/{TemporalPolyfill-D9mr7_wA.js.map → TemporalPolyfill-Bv_c_xa0.js.map} +1 -1
- package/dist/{ThemeDraft-B7NPif4d.js → ThemeDraft-CyX3YA_L.js} +41 -43
- package/dist/{ThemeDraft-B7NPif4d.js.map → ThemeDraft-CyX3YA_L.js.map} +1 -1
- package/dist/{TreeMeasure-BVJeGb1L.js → TreeMeasure-BK74uexu.js} +3 -4
- package/dist/{TreeMeasure-BVJeGb1L.js.map → TreeMeasure-BK74uexu.js.map} +1 -1
- package/dist/UIButton-BmIiXYDC.js +5 -0
- package/dist/UIButton-BmIiXYDC.js.map +1 -0
- package/dist/UIGrid-2ZUA1YEc.js +200 -0
- package/dist/UIGrid-2ZUA1YEc.js.map +1 -0
- package/dist/{UIInput-BodVbUoQ.js → UIInput-B3K0w4ow.js} +2 -3
- package/dist/UIInput-B3K0w4ow.js.map +1 -0
- package/dist/{UIKeys-Rh_gUZjP.js → UIKeys-DmXvyJuU.js} +12 -12
- package/dist/UIKeys-DmXvyJuU.js.map +1 -0
- package/dist/{UILabel-DgJUBzB_.js → UILabel-pCjKxQlQ.js} +2 -3
- package/dist/UILabel-pCjKxQlQ.js.map +1 -0
- package/dist/UIMenu-CqURPocK.js +42 -0
- package/dist/UIMenu-CqURPocK.js.map +1 -0
- package/dist/{UIRuntime-KH309p5B.js → UIRuntime-BXutHphM.js} +253 -239
- package/dist/UIRuntime-BXutHphM.js.map +1 -0
- package/dist/{UISegment-CMMIW7cZ.js → UISegment-BF4Tgy2D.js} +2 -3
- package/dist/UISegment-BF4Tgy2D.js.map +1 -0
- package/dist/_spell-element/UIComponent.d.ts +8 -0
- package/dist/_spell-element/vocabulary.types.d.ts +20 -2
- package/dist/_util/Dragging.d.ts +14 -2
- package/dist/_util/dom.d.ts +12 -8
- package/dist/_util/measures/Dimension.d.ts +1 -1
- package/dist/_util/persist/PrefStore.d.ts +7 -2
- package/dist/_util/persist/persist.types.d.ts +6 -0
- package/dist/_util/platform.d.ts +54 -0
- package/dist/_util/string.d.ts +25 -0
- package/dist/api.js +2 -3
- package/dist/api.js.map +1 -1
- package/dist/{apple.palette-B4ivrNlM.js → apple.palette-YLjENwUt.js} +2 -3
- package/dist/apple.palette-YLjENwUt.js.map +1 -0
- package/dist/{classic-DCTQrteU.js → classic-BHyJFvQa.js} +2 -3
- package/dist/classic-BHyJFvQa.js.map +1 -0
- package/dist/components/ComponentDefinitions.d.ts +55 -8
- package/dist/components/components.es.d.ts +2 -1
- package/dist/components/components.planned.d.ts +1 -1
- package/dist/components/components.types.d.ts +22 -0
- package/dist/components/ui-accordion/UIAccordion.d.ts +1 -0
- package/dist/components/ui-accordion/UIAccordion.en.d.ts +1 -0
- package/dist/components/ui-action/UIAction.d.ts +38 -1
- package/dist/components/ui-action/UIAction.en.d.ts +17 -8
- package/dist/components/ui-action/UIAction.es.d.ts +1 -0
- package/dist/components/ui-ad/UIAd.d.ts +1 -0
- package/dist/components/ui-ad/UIAd.en.d.ts +1 -0
- package/dist/components/ui-app-menu/UIAppMenu.d.ts +41 -0
- package/dist/components/ui-app-menu/UIAppMenu.en.d.ts +294 -0
- package/dist/components/ui-app-menu/UIAppMenu.es.d.ts +35 -0
- package/dist/components/ui-app-menu/index.d.ts +2 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumb.en.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumbs.en.d.ts +1 -0
- package/dist/components/ui-button/UIButton.d.ts +5 -4
- package/dist/components/ui-button/UIButton.en.d.ts +4 -3
- package/dist/components/ui-button/UIButton.fallback.d.ts +4 -3
- package/dist/components/ui-button/UIButton.types.d.ts +1 -1
- package/dist/components/ui-button/UIButtons.d.ts +7 -5
- package/dist/components/ui-button/UIButtons.en.d.ts +5 -3
- package/dist/components/ui-button/UIButtons.es.d.ts +1 -0
- package/dist/components/ui-button/UIOr.d.ts +1 -0
- package/dist/components/ui-button/UIOr.en.d.ts +1 -0
- package/dist/components/ui-calendar/UICalendar.d.ts +1 -0
- package/dist/components/ui-calendar/UICalendar.en.d.ts +1 -0
- package/dist/components/ui-calendar/UICalendar.fallback.d.ts +1 -0
- package/dist/components/ui-card/UICard.d.ts +1 -0
- package/dist/components/ui-card/UICard.en.d.ts +1 -0
- package/dist/components/ui-card/UICards.d.ts +1 -0
- package/dist/components/ui-card/UICards.en.d.ts +1 -0
- package/dist/components/ui-checkbox/UICheckbox.d.ts +1 -0
- package/dist/components/ui-checkbox/UICheckbox.en.d.ts +1 -0
- package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +1 -0
- package/dist/components/ui-checkbox/UIRadio.d.ts +1 -0
- package/dist/components/ui-checkbox/UIRadio.en.d.ts +1 -0
- package/dist/components/ui-code/CodeHighlighter.d.ts +7 -3
- package/dist/components/ui-code/UICode.d.ts +12 -1
- package/dist/components/ui-code/UICode.en.d.ts +1 -0
- package/dist/components/ui-code/UICode.types.d.ts +9 -0
- package/dist/components/ui-comment/UIComment.d.ts +1 -0
- package/dist/components/ui-comment/UIComment.en.d.ts +1 -0
- package/dist/components/ui-comment/UIComments.d.ts +1 -0
- package/dist/components/ui-comment/UIComments.en.d.ts +1 -0
- package/dist/components/ui-components/UIComponents.d.ts +1 -0
- package/dist/components/ui-components/UIComponents.en.d.ts +1 -0
- package/dist/components/ui-container/UIContainer.d.ts +54 -1
- package/dist/components/ui-container/UIContainer.en.d.ts +40 -1
- package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
- package/dist/components/ui-device/UIDevice.d.ts +234 -0
- package/dist/components/ui-device/UIDevice.en.d.ts +126 -0
- package/dist/components/ui-device/UIDevice.es.d.ts +52 -0
- package/dist/components/ui-device/index.d.ts +1 -0
- package/dist/components/ui-diagram/UIDiagram.d.ts +1 -0
- package/dist/components/ui-diagram/UIDiagram.en.d.ts +1 -0
- package/dist/components/ui-diagram/UIDiagramNode.d.ts +1 -0
- package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +1 -0
- package/dist/components/ui-dimension/UIDimension.d.ts +1 -0
- package/dist/components/ui-dimension/UIDimension.en.d.ts +1 -0
- package/dist/components/ui-dimmer/UIDimmer.d.ts +1 -0
- package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
- package/dist/components/ui-divider/UIDivider.d.ts +1 -0
- package/dist/components/ui-divider/UIDivider.en.d.ts +1 -0
- package/dist/components/ui-dropdown/SlottedItems.d.ts +9 -1
- package/dist/components/ui-dropdown/UIDropdown.d.ts +1 -0
- package/dist/components/ui-dropdown/UIDropdown.en.d.ts +1 -0
- package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +1 -0
- package/dist/components/ui-embed/UIEmbed.d.ts +1 -0
- package/dist/components/ui-embed/UIEmbed.en.d.ts +1 -0
- package/dist/components/ui-emoji/UIEmoji.d.ts +1 -0
- package/dist/components/ui-emoji/UIEmoji.en.d.ts +1 -0
- package/dist/components/ui-example/UIExample.en.d.ts +1 -0
- package/dist/components/ui-feed/UIFeed.d.ts +1 -0
- package/dist/components/ui-feed/UIFeed.en.d.ts +1 -0
- package/dist/components/ui-feed/UIFeedEvent.d.ts +1 -0
- package/dist/components/ui-feed/UIFeedEvent.en.d.ts +1 -0
- package/dist/components/ui-flag/UIFlag.d.ts +1 -0
- package/dist/components/ui-flag/UIFlag.en.d.ts +1 -0
- package/dist/components/ui-flyout/UIFlyout.d.ts +1 -0
- package/dist/components/ui-flyout/UIFlyout.en.d.ts +1 -0
- package/dist/components/ui-form/UIField.d.ts +11 -4
- package/dist/components/ui-form/UIField.en.d.ts +3 -2
- package/dist/components/ui-form/UIFields.d.ts +1 -0
- package/dist/components/ui-form/UIFields.en.d.ts +1 -0
- package/dist/components/ui-form/UIForm.d.ts +1 -0
- package/dist/components/ui-form/UIForm.en.d.ts +1 -0
- package/dist/components/ui-form/UIRepeat.d.ts +1 -0
- package/dist/components/ui-form/UIRepeat.en.d.ts +1 -0
- package/dist/components/ui-grid/UIColumn.d.ts +4 -3
- package/dist/components/ui-grid/UIColumn.en.d.ts +4 -3
- package/dist/components/ui-grid/UIGrid.d.ts +1 -0
- package/dist/components/ui-grid/UIGrid.en.d.ts +1 -0
- package/dist/components/ui-grid/UIRow.d.ts +1 -0
- package/dist/components/ui-grid/UIRow.en.d.ts +1 -0
- package/dist/components/ui-icon/UIIcon.d.ts +1 -0
- package/dist/components/ui-icon/UIIcon.en.d.ts +1 -0
- package/dist/components/ui-icon/UIIcons.d.ts +1 -0
- package/dist/components/ui-icon/UIIcons.en.d.ts +1 -0
- package/dist/components/ui-icon-picker/UIIconPicker.d.ts +5 -1
- package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +1 -0
- package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +1 -0
- package/dist/components/ui-image/UIImage.d.ts +1 -0
- package/dist/components/ui-image/UIImage.en.d.ts +1 -0
- package/dist/components/ui-image/UIImages.d.ts +1 -0
- package/dist/components/ui-image/UIImages.en.d.ts +1 -0
- package/dist/components/ui-include/UIInclude.d.ts +1 -0
- package/dist/components/ui-include/UIInclude.en.d.ts +1 -0
- package/dist/components/ui-input/UIInput.d.ts +1 -0
- package/dist/components/ui-input/UIInput.en.d.ts +1 -0
- package/dist/components/ui-input/UIInput.fallback.d.ts +1 -0
- package/dist/components/ui-input/UITextarea.d.ts +1 -0
- package/dist/components/ui-input/UITextarea.en.d.ts +1 -0
- package/dist/components/ui-item/UIItem.d.ts +19 -8
- package/dist/components/ui-item/UIItem.en.d.ts +2 -1
- package/dist/components/ui-items/UIItems.d.ts +1 -0
- package/dist/components/ui-items/UIItems.en.d.ts +1 -0
- package/dist/components/ui-json/UIJson.d.ts +1 -0
- package/dist/components/ui-json/UIJson.en.d.ts +1 -0
- package/dist/components/ui-keys/UIKeys.d.ts +1 -0
- package/dist/components/ui-keys/UIKeys.en.d.ts +1 -0
- package/dist/components/ui-label/UILabel.d.ts +3 -2
- package/dist/components/ui-label/UILabel.en.d.ts +3 -2
- package/dist/components/ui-label/UILabels.d.ts +1 -0
- package/dist/components/ui-label/UILabels.en.d.ts +1 -0
- package/dist/components/ui-list/UIList.d.ts +1 -0
- package/dist/components/ui-list/UIList.en.d.ts +1 -0
- package/dist/components/ui-loader/UILoader.d.ts +1 -0
- package/dist/components/ui-loader/UILoader.en.d.ts +1 -0
- package/dist/components/ui-markdown/MarkdownBox.d.ts +7 -2
- package/dist/components/ui-markdown/MarkdownFormats.d.ts +9 -4
- package/dist/components/ui-markdown/UIMarkdown.en.d.ts +5 -0
- package/dist/components/ui-markdown/UIMarkdown.es.d.ts +1 -0
- package/dist/components/ui-menu/ScrollingRow.d.ts +19 -1
- package/dist/components/ui-menu/SegmentedThumb.d.ts +8 -1
- package/dist/components/ui-menu/SubMenuAim.d.ts +115 -0
- package/dist/components/ui-menu/TitleFit.d.ts +16 -1
- package/dist/components/ui-menu/UIMenu.d.ts +112 -9
- package/dist/components/ui-menu/UIMenu.en.d.ts +3 -2
- package/dist/components/ui-menu/UISubmenu.d.ts +261 -0
- package/dist/components/ui-menu/UISubmenu.en.d.ts +102 -0
- package/dist/components/ui-menu/UISubmenu.es.d.ts +21 -0
- package/dist/components/ui-menu/index.d.ts +3 -1
- package/dist/components/ui-message/UIMessage.d.ts +3 -2
- package/dist/components/ui-message/UIMessage.en.d.ts +4 -3
- package/dist/components/ui-modal/ModalDialogs.d.ts +36 -2
- package/dist/components/ui-modal/UIModal.d.ts +1 -0
- package/dist/components/ui-modal/UIModal.en.d.ts +1 -0
- package/dist/components/ui-nag/UINag.d.ts +1 -0
- package/dist/components/ui-nag/UINag.en.d.ts +1 -0
- package/dist/components/ui-page/UIPage.d.ts +1 -0
- package/dist/components/ui-page/UIPage.en.d.ts +1 -0
- package/dist/components/ui-page-layout/UIPageLayout.d.ts +311 -0
- package/dist/components/ui-page-layout/UIPageLayout.en.d.ts +99 -0
- package/dist/components/ui-page-layout/UIPageLayout.es.d.ts +38 -0
- package/dist/components/ui-page-layout/index.d.ts +1 -0
- package/dist/components/ui-panel/ScrollShades.d.ts +38 -0
- package/dist/components/ui-panel/UIPanel.d.ts +21 -2
- package/dist/components/ui-panel/UIPanel.en.d.ts +68 -61
- package/dist/components/ui-parts/UIActions.d.ts +1 -0
- package/dist/components/ui-parts/UIActions.en.d.ts +1 -0
- package/dist/components/ui-parts/UIAuthor.d.ts +1 -0
- package/dist/components/ui-parts/UIAuthor.en.d.ts +1 -0
- package/dist/components/ui-parts/UIAvatar.d.ts +11 -2
- package/dist/components/ui-parts/UIAvatar.en.d.ts +3 -2
- package/dist/components/ui-parts/UIContent.d.ts +1 -0
- package/dist/components/ui-parts/UIContent.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDate.d.ts +1 -0
- package/dist/components/ui-parts/UIDate.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDescription.d.ts +1 -0
- package/dist/components/ui-parts/UIDescription.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDetail.d.ts +1 -0
- package/dist/components/ui-parts/UIDetail.en.d.ts +1 -0
- package/dist/components/ui-parts/UIExtra.d.ts +1 -0
- package/dist/components/ui-parts/UIExtra.en.d.ts +1 -0
- package/dist/components/ui-parts/UIHeader.d.ts +16 -5
- package/dist/components/ui-parts/UIHeader.en.d.ts +9 -5
- package/dist/components/ui-parts/UIMeta.d.ts +1 -0
- package/dist/components/ui-parts/UIMeta.en.d.ts +1 -0
- package/dist/components/ui-parts/UIParts.types.d.ts +23 -7
- package/dist/components/ui-parts/UISummary.d.ts +1 -0
- package/dist/components/ui-parts/UISummary.en.d.ts +1 -0
- package/dist/components/ui-parts/UITitle.d.ts +1 -0
- package/dist/components/ui-parts/UITitle.en.d.ts +1 -0
- package/dist/components/ui-parts/UIValue.d.ts +1 -0
- package/dist/components/ui-parts/UIValue.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholder.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderHeader.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderImage.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderLine.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderParagraph.en.d.ts +1 -0
- package/dist/components/ui-popup/UIPopup.d.ts +21 -3
- package/dist/components/ui-popup/UIPopup.en.d.ts +1 -0
- package/dist/components/ui-progress/UIProgress.d.ts +3 -2
- package/dist/components/ui-progress/UIProgress.en.d.ts +4 -3
- package/dist/components/ui-property-editor/UIProperty.d.ts +47 -13
- package/dist/components/ui-property-editor/UIProperty.en.d.ts +1 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +14 -1
- package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +7 -1
- package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +15 -6
- package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +1 -0
- package/dist/components/ui-quote/UIQuote.d.ts +1 -0
- package/dist/components/ui-quote/UIQuote.en.d.ts +1 -0
- package/dist/components/ui-rail/UIRail.d.ts +4 -3
- package/dist/components/ui-rail/UIRail.en.d.ts +4 -3
- package/dist/components/ui-rating/UIRating.d.ts +1 -0
- package/dist/components/ui-rating/UIRating.en.d.ts +1 -0
- package/dist/components/ui-rating/UIRating.fallback.d.ts +1 -0
- package/dist/components/ui-reveal/UIReveal.d.ts +1 -0
- package/dist/components/ui-reveal/UIReveal.en.d.ts +1 -0
- package/dist/components/ui-root/UIRoot.en.d.ts +1 -0
- package/dist/components/ui-search/UISearch.d.ts +1 -0
- package/dist/components/ui-search/UISearch.en.d.ts +1 -0
- package/dist/components/ui-search/UISearch.fallback.d.ts +1 -0
- package/dist/components/ui-section/UISection.d.ts +3 -2
- package/dist/components/ui-section/UISection.en.d.ts +3 -2
- package/dist/components/ui-section/UISections.d.ts +1 -0
- package/dist/components/ui-section/UISections.en.d.ts +1 -0
- package/dist/components/ui-segment/UISegment.d.ts +9 -10
- package/dist/components/ui-segment/UISegment.en.d.ts +10 -11
- package/dist/components/ui-segment/UISegments.d.ts +1 -0
- package/dist/components/ui-segment/UISegments.en.d.ts +1 -0
- package/dist/components/ui-select/UISelect.d.ts +1 -0
- package/dist/components/ui-select/UISelect.en.d.ts +1 -0
- package/dist/components/ui-select/UISelect.fallback.d.ts +1 -0
- package/dist/components/ui-shape/UIShape.d.ts +1 -0
- package/dist/components/ui-shape/UIShape.en.d.ts +1 -0
- package/dist/components/ui-shape/UISide.d.ts +1 -0
- package/dist/components/ui-shape/UISide.en.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPushable.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPushable.en.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPusher.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPusher.en.d.ts +1 -0
- package/dist/components/ui-sidebar/UISidebar.d.ts +1 -0
- package/dist/components/ui-sidebar/UISidebar.en.d.ts +1 -0
- package/dist/components/ui-sides/UISides.d.ts +1 -0
- package/dist/components/ui-sides/UISides.en.d.ts +1 -0
- package/dist/components/ui-sides/UISides.fallback.d.ts +1 -0
- package/dist/components/ui-site-breadcrumbs/UISiteBreadcrumbs.d.ts +118 -0
- package/dist/components/ui-site-breadcrumbs/UISiteBreadcrumbs.en.d.ts +49 -0
- package/dist/components/ui-site-breadcrumbs/UISiteBreadcrumbs.es.d.ts +22 -0
- package/dist/components/ui-site-breadcrumbs/index.d.ts +1 -0
- package/dist/components/ui-site-nav/SitePages.d.ts +26 -3
- package/dist/components/ui-site-nav/UISiteNav.d.ts +43 -5
- package/dist/components/ui-site-nav/UISiteNav.en.d.ts +10 -1
- package/dist/components/ui-site-nav-button/UISiteNavButton.d.ts +63 -0
- package/dist/components/ui-site-nav-button/UISiteNavButton.en.d.ts +173 -0
- package/dist/components/ui-site-nav-button/UISiteNavButton.es.d.ts +20 -0
- package/dist/components/ui-site-nav-button/index.d.ts +1 -0
- package/dist/components/ui-site-tabs/UISiteTabs.d.ts +21 -6
- package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.en.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.fallback.d.ts +1 -0
- package/dist/components/ui-space/UISpace.d.ts +1 -0
- package/dist/components/ui-space/UISpace.en.d.ts +1 -0
- package/dist/components/ui-split-panel/UISplitPanel.d.ts +43 -7
- package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +2 -1
- package/dist/components/ui-stack/UIStack.d.ts +1 -0
- package/dist/components/ui-stack/UIStack.en.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistics.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistics.en.d.ts +1 -0
- package/dist/components/ui-step/UIStep.d.ts +1 -0
- package/dist/components/ui-step/UIStep.en.d.ts +1 -0
- package/dist/components/ui-step/UISteps.d.ts +3 -2
- package/dist/components/ui-step/UISteps.en.d.ts +3 -2
- package/dist/components/ui-sticky/UISticky.d.ts +1 -0
- package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
- package/dist/components/ui-tab/UITab.d.ts +3 -2
- package/dist/components/ui-tab/UITab.en.d.ts +4 -3
- package/dist/components/ui-tab/UITabs.d.ts +5 -4
- package/dist/components/ui-tab/UITabs.en.d.ts +4 -3
- package/dist/components/ui-table/TableGrammar.d.ts +2 -2
- package/dist/components/ui-table/UICell.d.ts +1 -0
- package/dist/components/ui-table/UICell.en.d.ts +1 -0
- package/dist/components/ui-table/UITable.d.ts +7 -6
- package/dist/components/ui-table/UITable.en.d.ts +7 -6
- package/dist/components/ui-terms/UITerm.d.ts +1 -0
- package/dist/components/ui-terms/UITerm.en.d.ts +1 -0
- package/dist/components/ui-terms/UITerms.d.ts +1 -0
- package/dist/components/ui-terms/UITerms.en.d.ts +1 -0
- package/dist/components/ui-text/UILink.d.ts +1 -0
- package/dist/components/ui-text/UILink.en.d.ts +1 -0
- package/dist/components/ui-text/UIText.d.ts +2 -1
- package/dist/components/ui-text/UIText.en.d.ts +2 -1
- package/dist/components/ui-theme-editor/BenchAddress.d.ts +9 -0
- package/dist/components/ui-theme-editor/UIColorChip.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIColorChip.en.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIThemeEditor.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIThemeToken.en.d.ts +1 -0
- package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +37 -15
- package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +3 -2
- package/dist/components/ui-toast/UIToast.d.ts +1 -0
- package/dist/components/ui-toast/UIToast.en.d.ts +1 -0
- package/dist/components/ui-toc/UIToc.d.ts +1 -0
- package/dist/components/ui-toc/UIToc.en.d.ts +1 -0
- package/dist/components/ui-toolbar/UIToolbar.d.ts +134 -1
- package/dist/components/ui-toolbar/UIToolbar.en.d.ts +75 -42
- package/dist/components/ui-toolbar/UIToolbar.es.d.ts +5 -0
- package/dist/components/ui-transition/UITransition.d.ts +1 -0
- package/dist/components/ui-transition/UITransition.en.d.ts +1 -0
- package/dist/components/ui-tree/UITree.d.ts +102 -2
- package/dist/components/ui-tree/UITree.en.d.ts +14 -1
- package/dist/components/ui-tree/UITree.es.d.ts +3 -0
- package/dist/components/ui-tree/UITreeItem.d.ts +21 -2
- package/dist/components/ui-tree/UITreeItem.en.d.ts +5 -1
- package/dist/components/ui-tree/UITreeItem.es.d.ts +1 -0
- package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +1 -0
- package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +1 -0
- package/dist/components/ui-tree-diagram/UITreeNode.d.ts +1 -0
- package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +1 -0
- package/dist/components/ui-video/UIAudio.d.ts +1 -0
- package/dist/components/ui-video/UIAudio.en.d.ts +1 -0
- package/dist/components/ui-video/UIVideo.d.ts +1 -0
- package/dist/components/ui-video/UIVideo.en.d.ts +1 -0
- package/dist/components/ui-visibility/UIVisibility.d.ts +1 -0
- package/dist/components/ui-visibility/UIVisibility.en.d.ts +1 -0
- package/dist/components/ui-zoom/UIZoom.d.ts +1 -0
- package/dist/components/ui-zoom/UIZoom.en.d.ts +1 -0
- package/dist/{components.es-BOa_7gFF.js → components.es-DEa8Ep42.js} +265 -77
- package/dist/components.es-DEa8Ep42.js.map +1 -0
- package/dist/core.js +884 -806
- package/dist/core.js.map +1 -1
- package/dist/{crisp-VfYZlTph.js → crisp-DIpY320U.js} +3 -4
- package/dist/crisp-DIpY320U.js.map +1 -0
- package/dist/crisp.theme-Ir9p4BDC.js +5 -0
- package/dist/crisp.theme-Ir9p4BDC.js.map +1 -0
- package/dist/{dark-CbUdPe0a.js → dark-B5s4QbmU.js} +2 -3
- package/dist/dark-B5s4QbmU.js.map +1 -0
- package/dist/{dist-BLYIGZVK.js → dist-BQT4KajA.js} +34 -80
- package/dist/dist-BQT4KajA.js.map +1 -0
- package/dist/docs-components/docs-components.types.d.ts +6 -0
- package/dist/docs-components/ui-docs-palette/UIDocsPalette.d.ts +180 -0
- package/dist/docs-components/ui-docs-palette/UIDocsPalette.en.d.ts +88 -0
- package/dist/docs-components/ui-docs-palette/UIDocsPalette.types.d.ts +5 -0
- package/dist/docs-components/ui-docs-palette/index.d.ts +2 -0
- package/dist/docs-components/ui-docs-tokens/UIDocsTokens.d.ts +23 -0
- package/dist/docs-components/ui-docs-tokens/UIDocsTokens.en.d.ts +5 -1
- package/dist/elements/PartComponent.d.ts +5 -0
- package/dist/elements/PopoverPanel.d.ts +12 -1
- package/dist/elements/Validator.d.ts +1 -1
- package/dist/emoji/cldr/{0-DSUpV2d7.js → 0-B6B0nyLW.js} +2 -3
- package/dist/emoji/cldr/0-B6B0nyLW.js.map +1 -0
- package/dist/emoji/cldr/{a-D_oB4vJ-.js → a-C12vpdzK.js} +2 -3
- package/dist/emoji/cldr/a-C12vpdzK.js.map +1 -0
- package/dist/emoji/cldr/{b-DX0W0Mda.js → b-BGkQUJ8v.js} +2 -3
- package/dist/emoji/cldr/b-BGkQUJ8v.js.map +1 -0
- package/dist/emoji/cldr/{c-DUHidpE9.js → c-DtqAfVnG.js} +2 -3
- package/dist/emoji/cldr/c-DtqAfVnG.js.map +1 -0
- package/dist/emoji/cldr/{d-CiCXZXay.js → d-B5SNGAad.js} +2 -3
- package/dist/emoji/cldr/d-B5SNGAad.js.map +1 -0
- package/dist/emoji/cldr/{e-DILJo3Ri.js → e-CMUDvE48.js} +2 -3
- package/dist/emoji/cldr/e-CMUDvE48.js.map +1 -0
- package/dist/emoji/cldr/{f-ByGFLyOq.js → f-Dfhd9bp8.js} +2 -3
- package/dist/emoji/cldr/f-Dfhd9bp8.js.map +1 -0
- package/dist/emoji/cldr/{g-BZ0FRsud.js → g-VpFllv6y.js} +2 -3
- package/dist/emoji/cldr/g-VpFllv6y.js.map +1 -0
- package/dist/emoji/cldr/{h-jtLdvRXQ.js → h-CE6GevC3.js} +2 -3
- package/dist/emoji/cldr/h-CE6GevC3.js.map +1 -0
- package/dist/emoji/cldr/{i-DcbJ5utE.js → i-BUPzV8pA.js} +2 -3
- package/dist/emoji/cldr/i-BUPzV8pA.js.map +1 -0
- package/dist/emoji/cldr/{j-BuEqP5nz.js → j-BFAg68Ig.js} +2 -3
- package/dist/emoji/cldr/j-BFAg68Ig.js.map +1 -0
- package/dist/emoji/cldr/{k-P1J6Gvze.js → k-jnBMfMlM.js} +2 -3
- package/dist/emoji/cldr/k-jnBMfMlM.js.map +1 -0
- package/dist/emoji/cldr/{l-28XcbsPr.js → l-ClLOCfnc.js} +2 -3
- package/dist/emoji/cldr/l-ClLOCfnc.js.map +1 -0
- package/dist/emoji/cldr/{m-DKgGJ8rW.js → m-p358YNne.js} +2 -3
- package/dist/emoji/cldr/m-p358YNne.js.map +1 -0
- package/dist/emoji/cldr/{n-DmPLP4F3.js → n-DOh1UxA2.js} +2 -3
- package/dist/emoji/cldr/n-DOh1UxA2.js.map +1 -0
- package/dist/emoji/cldr/{o-f98nt3s7.js → o-D_nTGMIR.js} +2 -3
- package/dist/emoji/cldr/o-D_nTGMIR.js.map +1 -0
- package/dist/emoji/cldr/{p-CxnsOTOt.js → p-BA8Ct3hE.js} +2 -3
- package/dist/emoji/cldr/p-BA8Ct3hE.js.map +1 -0
- package/dist/emoji/cldr/{r-D0GPRJ-Q.js → r-BFZ26mlC.js} +2 -3
- package/dist/emoji/cldr/r-BFZ26mlC.js.map +1 -0
- package/dist/emoji/cldr/{s-DcFuepnw.js → s-CIZH91hj.js} +2 -3
- package/dist/emoji/cldr/s-CIZH91hj.js.map +1 -0
- package/dist/emoji/cldr/{t-BvHgGpUr.js → t-qg9oQuYr.js} +2 -3
- package/dist/emoji/cldr/t-qg9oQuYr.js.map +1 -0
- package/dist/emoji/cldr/{u-ChFYHtUf.js → u-CN-QpqjC.js} +2 -3
- package/dist/emoji/cldr/u-CN-QpqjC.js.map +1 -0
- package/dist/emoji/cldr/{v-WmX3nWtZ.js → v-CO_76wOC.js} +2 -3
- package/dist/emoji/cldr/v-CO_76wOC.js.map +1 -0
- package/dist/emoji/cldr/{w-BPySQUWW.js → w-DOQn50Cw.js} +2 -3
- package/dist/emoji/cldr/w-DOQn50Cw.js.map +1 -0
- package/dist/emoji/cldr/x-DddFDGbR.js +5 -0
- package/dist/emoji/cldr/x-DddFDGbR.js.map +1 -0
- package/dist/emoji/cldr/{y-zB_yhTFg.js → y-auUWML2r.js} +2 -3
- package/dist/emoji/cldr/y-auUWML2r.js.map +1 -0
- package/dist/emoji/cldr/{z-BgJ94Cap.js → z-BYAp28d6.js} +2 -3
- package/dist/emoji/cldr/z-BYAp28d6.js.map +1 -0
- package/dist/emoji/fomantic/0-BdzcjXW3.js +9 -0
- package/dist/emoji/fomantic/0-BdzcjXW3.js.map +1 -0
- package/dist/emoji/fomantic/{a-CrqYlC21.js → a-R3ZJ-207.js} +2 -3
- package/dist/emoji/fomantic/a-R3ZJ-207.js.map +1 -0
- package/dist/emoji/fomantic/{b-DneVHRdQ.js → b-NF1y0dRD.js} +2 -3
- package/dist/emoji/fomantic/b-NF1y0dRD.js.map +1 -0
- package/dist/emoji/fomantic/{c-ClxKRuir.js → c-CuIzdNXI.js} +2 -3
- package/dist/emoji/fomantic/c-CuIzdNXI.js.map +1 -0
- package/dist/emoji/fomantic/{d-Djqs_y4s.js → d-CuS9uvGS.js} +2 -3
- package/dist/emoji/fomantic/d-CuS9uvGS.js.map +1 -0
- package/dist/emoji/fomantic/{e-CuF-jOQd.js → e-S2pyUDgP.js} +2 -3
- package/dist/emoji/fomantic/e-S2pyUDgP.js.map +1 -0
- package/dist/emoji/fomantic/{f-D8VglrJ4.js → f-DnHzZwKR.js} +2 -3
- package/dist/emoji/fomantic/f-DnHzZwKR.js.map +1 -0
- package/dist/emoji/fomantic/{g-Du_HFl6U.js → g-CdqbF8yB.js} +2 -3
- package/dist/emoji/fomantic/g-CdqbF8yB.js.map +1 -0
- package/dist/emoji/fomantic/{h-CLE5tHnM.js → h-Dgmy17VC.js} +2 -3
- package/dist/emoji/fomantic/h-Dgmy17VC.js.map +1 -0
- package/dist/emoji/fomantic/{i-BjOsrQDZ.js → i-BCe1z6Es.js} +2 -3
- package/dist/emoji/fomantic/i-BCe1z6Es.js.map +1 -0
- package/dist/emoji/fomantic/{j-CyUDXKCu.js → j-D39udLwj.js} +2 -3
- package/dist/emoji/fomantic/j-D39udLwj.js.map +1 -0
- package/dist/emoji/fomantic/{k-Clypg4R8.js → k-KDlJnEWX.js} +2 -3
- package/dist/emoji/fomantic/k-KDlJnEWX.js.map +1 -0
- package/dist/emoji/fomantic/{l-DvLPdBh-.js → l-rVE39-7Z.js} +2 -3
- package/dist/emoji/fomantic/l-rVE39-7Z.js.map +1 -0
- package/dist/emoji/fomantic/{m-B1lIb1kP.js → m-Bys5Cs9k.js} +2 -3
- package/dist/emoji/fomantic/m-Bys5Cs9k.js.map +1 -0
- package/dist/emoji/fomantic/{n-Bgpp_ht5.js → n-DzPz1atY.js} +2 -3
- package/dist/emoji/fomantic/n-DzPz1atY.js.map +1 -0
- package/dist/emoji/fomantic/{o-BhYZzpjp.js → o-lKtDGpuN.js} +2 -3
- package/dist/emoji/fomantic/o-lKtDGpuN.js.map +1 -0
- package/dist/emoji/fomantic/{p-VLL0GK3m.js → p-DUvy18Aa.js} +2 -3
- package/dist/emoji/fomantic/p-DUvy18Aa.js.map +1 -0
- package/dist/emoji/fomantic/q-WtSN0kE7.js +5 -0
- package/dist/emoji/fomantic/q-WtSN0kE7.js.map +1 -0
- package/dist/emoji/fomantic/{r-Bd1DjkkI.js → r-Dm_1szGZ.js} +2 -3
- package/dist/emoji/fomantic/r-Dm_1szGZ.js.map +1 -0
- package/dist/emoji/fomantic/{s-Bqatw1W7.js → s-LPRU4KZk.js} +2 -3
- package/dist/emoji/fomantic/s-LPRU4KZk.js.map +1 -0
- package/dist/emoji/fomantic/{t-Bs7IFhv3.js → t-iQksEIKb.js} +2 -3
- package/dist/emoji/fomantic/t-iQksEIKb.js.map +1 -0
- package/dist/emoji/fomantic/{u-M6GfYC-U.js → u-CkDd-u7Y.js} +2 -3
- package/dist/emoji/fomantic/u-CkDd-u7Y.js.map +1 -0
- package/dist/emoji/fomantic/{v-BKHNqkn0.js → v-C83uQ5pk.js} +2 -3
- package/dist/emoji/fomantic/v-C83uQ5pk.js.map +1 -0
- package/dist/emoji/fomantic/{w-B_XvIu7h.js → w-D_redhGe.js} +2 -3
- package/dist/emoji/fomantic/w-D_redhGe.js.map +1 -0
- package/dist/emoji/fomantic/x-eI_dPUEx.js +8 -0
- package/dist/emoji/fomantic/x-eI_dPUEx.js.map +1 -0
- package/dist/emoji/fomantic/{y-DPZaoIla.js → y-CO_6qz-J.js} +2 -3
- package/dist/emoji/fomantic/y-CO_6qz-J.js.map +1 -0
- package/dist/emoji/fomantic/{z-FH-kPXch.js → z-C-wWxD0a.js} +2 -3
- package/dist/emoji/fomantic/z-C-wWxD0a.js.map +1 -0
- package/dist/forms.js +65 -75
- package/dist/forms.js.map +1 -1
- package/dist/fruity-CsfZNeXb.js +5 -0
- package/dist/fruity-CsfZNeXb.js.map +1 -0
- package/dist/{fruity.theme-CbC7Jyvk.js → fruity.theme-BL7cCZUQ.js} +3 -4
- package/dist/fruity.theme-BL7cCZUQ.js.map +1 -0
- package/dist/glass-BCK30hpe.js +5 -0
- package/dist/glass-BCK30hpe.js.map +1 -0
- package/dist/glass.theme-C7QSRB7b.js +5 -0
- package/dist/glass.theme-C7QSRB7b.js.map +1 -0
- package/dist/hot.js +18 -32
- package/dist/hot.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +95 -90
- package/dist/jsx.d.ts +3869 -715
- package/dist/matrix-DEnqBfwC.js +5 -0
- package/dist/matrix-DEnqBfwC.js.map +1 -0
- package/dist/matrix.theme-YV6_nvXv.js +5 -0
- package/dist/matrix.theme-YV6_nvXv.js.map +1 -0
- package/dist/{merlot-DOXLuUaU.js → merlot-DFa6kDbA.js} +3 -4
- package/dist/merlot-DFa6kDbA.js.map +1 -0
- package/dist/merlot.theme-B1K8nn2u.js +5 -0
- package/dist/merlot.theme-B1K8nn2u.js.map +1 -0
- package/dist/{midnight-BxlTQSfw.js → midnight-q0-3-V6U.js} +3 -4
- package/dist/midnight-q0-3-V6U.js.map +1 -0
- package/dist/midnight.theme-C7M02wTD.js +5 -0
- package/dist/midnight.theme-C7M02wTD.js.map +1 -0
- package/dist/mockup-D0vovNO7.js +5 -0
- package/dist/mockup-D0vovNO7.js.map +1 -0
- package/dist/mockup.theme-C92r9NI0.js +5 -0
- package/dist/mockup.theme-C92r9NI0.js.map +1 -0
- package/dist/{paper-M61nUilz.js → paper-DPxolmdy.js} +3 -4
- package/dist/paper-DPxolmdy.js.map +1 -0
- package/dist/paper.theme-BAKk3DY1.js +5 -0
- package/dist/paper.theme-BAKk3DY1.js.map +1 -0
- package/dist/{persist.types-D2m6wD-S.js → persist.types-D7N7GewC.js} +2 -3
- package/dist/persist.types-D7N7GewC.js.map +1 -0
- package/dist/{pop-CxXfytjk.js → pop-Dw_6k177.js} +3 -4
- package/dist/pop-Dw_6k177.js.map +1 -0
- package/dist/pop.theme-Cw-yD0MO.js +5 -0
- package/dist/pop.theme-Cw-yD0MO.js.map +1 -0
- package/dist/property/PropertyEditorPages.d.ts +1 -1
- package/dist/property/PropertyLayouts.d.ts +119 -0
- package/dist/property/PropertySchemas.d.ts +5 -1
- package/dist/property/index.d.ts +2 -0
- package/dist/{rolldown-runtime-CYGlBXrH.js → rolldown-runtime-c6e9CmGy.js} +2 -3
- package/dist/runtime/Browser.d.ts +7 -0
- package/dist/runtime/DataTooltips.d.ts +2 -0
- package/dist/runtime/Keyboard.d.ts +4 -1
- package/dist/runtime/Toasts.d.ts +10 -0
- package/dist/runtime/runtime.types.d.ts +47 -0
- package/dist/{search-CzSzx7bX.js → search-C2Rq9HF1.js} +1 -2
- package/dist/search-C2Rq9HF1.js.map +1 -0
- package/dist/spell-CB-MivSX.js +5 -0
- package/dist/spell-CB-MivSX.js.map +1 -0
- package/dist/spell.theme-CUoc5rTq.js +5 -0
- package/dist/spell.theme-CUoc5rTq.js.map +1 -0
- package/dist/styles/StyleGenerator.d.ts +7 -0
- package/dist/styles/styles.en.d.ts +27 -18
- package/dist/{styles.en-CUUxNwHo.js → styles.en-DZlSJiOR.js} +21 -21
- package/dist/styles.en-DZlSJiOR.js.map +1 -0
- package/dist/styles.js +9 -10
- package/dist/styles.js.map +1 -1
- package/dist/ui-accordion.editor-BP8uQGGU.js +5 -0
- package/dist/ui-accordion.editor-BP8uQGGU.js.map +1 -0
- package/dist/ui-accordion.js +59 -60
- package/dist/ui-accordion.js.map +1 -1
- package/dist/ui-action.editor-m5R5N5Wy.js +5 -0
- package/dist/ui-action.editor-m5R5N5Wy.js.map +1 -0
- package/dist/ui-action.js +73 -45
- package/dist/ui-action.js.map +1 -1
- package/dist/ui-actions.editor-Buc3N2ik.js +5 -0
- package/dist/ui-actions.editor-Buc3N2ik.js.map +1 -0
- package/dist/ui-ad.editor-BHTDuSii.js +5 -0
- package/dist/ui-ad.editor-BHTDuSii.js.map +1 -0
- package/dist/ui-ad.js +8 -9
- package/dist/ui-ad.js.map +1 -1
- package/dist/ui-app-menu.editor-DxPPnMUT.js +5 -0
- package/dist/ui-app-menu.editor-DxPPnMUT.js.map +1 -0
- package/dist/ui-app-menu.js +89 -0
- package/dist/ui-app-menu.js.map +1 -0
- package/dist/ui-audio.editor-Y6WeqLRh.js +5 -0
- package/dist/ui-audio.editor-Y6WeqLRh.js.map +1 -0
- package/dist/ui-author.editor-Bmf-rEXY.js +5 -0
- package/dist/ui-author.editor-Bmf-rEXY.js.map +1 -0
- package/dist/ui-avatar.editor-CSU6snQz.js +5 -0
- package/dist/ui-avatar.editor-CSU6snQz.js.map +1 -0
- package/dist/ui-breadcrumb.editor-N1-8OzDq.js +5 -0
- package/dist/ui-breadcrumb.editor-N1-8OzDq.js.map +1 -0
- package/dist/ui-breadcrumbs.editor-Mml0fUR_.js +5 -0
- package/dist/ui-breadcrumbs.editor-Mml0fUR_.js.map +1 -0
- package/dist/ui-breadcrumbs.js +18 -17
- package/dist/ui-breadcrumbs.js.map +1 -1
- package/dist/ui-button.editor-BV9Bh_xf.js +5 -0
- package/dist/ui-button.editor-BV9Bh_xf.js.map +1 -0
- package/dist/ui-button.js +157 -156
- package/dist/ui-button.js.map +1 -1
- package/dist/ui-buttons.editor-CSsEIo2s.js +5 -0
- package/dist/ui-buttons.editor-CSsEIo2s.js.map +1 -0
- package/dist/ui-calendar.editor-TsP8a97s.js +5 -0
- package/dist/ui-calendar.editor-TsP8a97s.js.map +1 -0
- package/dist/ui-calendar.js +148 -157
- package/dist/ui-calendar.js.map +1 -1
- package/dist/ui-card.editor-BBZj9e03.js +5 -0
- package/dist/ui-card.editor-BBZj9e03.js.map +1 -0
- package/dist/ui-card.js +70 -70
- package/dist/ui-card.js.map +1 -1
- package/dist/ui-cards.editor-Hrmldr4q.js +5 -0
- package/dist/ui-cards.editor-Hrmldr4q.js.map +1 -0
- package/dist/ui-cell.editor-Dmz_mwJ0.js +5 -0
- package/dist/ui-cell.editor-Dmz_mwJ0.js.map +1 -0
- package/dist/ui-checkbox.editor-DnOz9r6d.js +5 -0
- package/dist/ui-checkbox.editor-DnOz9r6d.js.map +1 -0
- package/dist/ui-checkbox.js +49 -48
- package/dist/ui-checkbox.js.map +1 -1
- package/dist/ui-code.editor-Drr_FVB6.js +5 -0
- package/dist/ui-code.editor-Drr_FVB6.js.map +1 -0
- package/dist/ui-code.js +116 -79
- package/dist/ui-code.js.map +1 -1
- package/dist/ui-color-chip.editor-B3zV8FkB.js +5 -0
- package/dist/ui-color-chip.editor-B3zV8FkB.js.map +1 -0
- package/dist/ui-column.editor-hdUb-qwT.js +5 -0
- package/dist/ui-column.editor-hdUb-qwT.js.map +1 -0
- package/dist/ui-comment.editor-DJpE_8tz.js +5 -0
- package/dist/ui-comment.editor-DJpE_8tz.js.map +1 -0
- package/dist/ui-comment.js +15 -14
- package/dist/ui-comment.js.map +1 -1
- package/dist/ui-comments.editor-GFJN6l3Q.js +5 -0
- package/dist/ui-comments.editor-GFJN6l3Q.js.map +1 -0
- package/dist/ui-components.editor-BKFXnARt.js +5 -0
- package/dist/ui-components.editor-BKFXnARt.js.map +1 -0
- package/dist/ui-components.js +12 -13
- package/dist/ui-components.js.map +1 -1
- package/dist/ui-container.editor-CBNhNkRm.js +5 -0
- package/dist/ui-container.editor-CBNhNkRm.js.map +1 -0
- package/dist/ui-container.js +106 -21
- package/dist/ui-container.js.map +1 -1
- package/dist/ui-content.editor-B78lxK3P.js +5 -0
- package/dist/ui-content.editor-B78lxK3P.js.map +1 -0
- package/dist/ui-date.editor-PHEnU7QX.js +5 -0
- package/dist/ui-date.editor-PHEnU7QX.js.map +1 -0
- package/dist/ui-description.editor-DWFDJ9mV.js +5 -0
- package/dist/ui-description.editor-DWFDJ9mV.js.map +1 -0
- package/dist/ui-detail.editor-wliuVbx3.js +5 -0
- package/dist/ui-detail.editor-wliuVbx3.js.map +1 -0
- package/dist/ui-device.editor-kl48NVma.js +5 -0
- package/dist/ui-device.editor-kl48NVma.js.map +1 -0
- package/dist/ui-device.js +436 -0
- package/dist/ui-device.js.map +1 -0
- package/dist/ui-diagram-node.editor-6FyjT7oj.js +5 -0
- package/dist/ui-diagram-node.editor-6FyjT7oj.js.map +1 -0
- package/dist/ui-diagram.editor-Dn3ef-J9.js +5 -0
- package/dist/ui-diagram.editor-Dn3ef-J9.js.map +1 -0
- package/dist/ui-diagram.js +128 -129
- package/dist/ui-diagram.js.map +1 -1
- package/dist/ui-dimension.editor-BEXGKcCB.js +5 -0
- package/dist/ui-dimension.editor-BEXGKcCB.js.map +1 -0
- package/dist/ui-dimension.js +111 -12
- package/dist/ui-dimension.js.map +1 -1
- package/dist/ui-dimmer.editor-D14xzXIe.js +5 -0
- package/dist/ui-dimmer.editor-D14xzXIe.js.map +1 -0
- package/dist/ui-dimmer.js +29 -30
- package/dist/ui-dimmer.js.map +1 -1
- package/dist/ui-divider.editor-D6ozEXjx.js +5 -0
- package/dist/ui-divider.editor-D6ozEXjx.js.map +1 -0
- package/dist/ui-divider.js +9 -10
- package/dist/ui-divider.js.map +1 -1
- package/dist/ui-dropdown.editor-OFDGi1oz.js +5 -0
- package/dist/ui-dropdown.editor-OFDGi1oz.js.map +1 -0
- package/dist/ui-dropdown.js +155 -156
- package/dist/ui-dropdown.js.map +1 -1
- package/dist/ui-embed.editor-DHsrjw1j.js +5 -0
- package/dist/ui-embed.editor-DHsrjw1j.js.map +1 -0
- package/dist/ui-embed.js +23 -24
- package/dist/ui-embed.js.map +1 -1
- package/dist/ui-emoji.editor-DUL230Hi.js +5 -0
- package/dist/ui-emoji.editor-DUL230Hi.js.map +1 -0
- package/dist/ui-emoji.js +63 -64
- package/dist/ui-emoji.js.map +1 -1
- package/dist/ui-event.editor-Bk17y7wW.js +5 -0
- package/dist/ui-event.editor-Bk17y7wW.js.map +1 -0
- package/dist/ui-example.editor-D46Vnctp.js +5 -0
- package/dist/ui-example.editor-D46Vnctp.js.map +1 -0
- package/dist/ui-example.js +67 -74
- package/dist/ui-example.js.map +1 -1
- package/dist/ui-extra.editor-rX6sfH2e.js +5 -0
- package/dist/ui-extra.editor-rX6sfH2e.js.map +1 -0
- package/dist/ui-feed.editor-B7ycWh1b.js +5 -0
- package/dist/ui-feed.editor-B7ycWh1b.js.map +1 -0
- package/dist/ui-feed.js +26 -25
- package/dist/ui-feed.js.map +1 -1
- package/dist/ui-field.editor-Bz9xyCVv.js +5 -0
- package/dist/ui-field.editor-Bz9xyCVv.js.map +1 -0
- package/dist/ui-fields.editor-BUtW4NTk.js +5 -0
- package/dist/ui-fields.editor-BUtW4NTk.js.map +1 -0
- package/dist/ui-flag.editor-DNfdXo7y.js +5 -0
- package/dist/ui-flag.editor-DNfdXo7y.js.map +1 -0
- package/dist/ui-flag.js +13 -14
- package/dist/ui-flag.js.map +1 -1
- package/dist/ui-flyout.editor-b7UJYiV9.js +5 -0
- package/dist/ui-flyout.editor-b7UJYiV9.js.map +1 -0
- package/dist/ui-flyout.js +10 -11
- package/dist/ui-flyout.js.map +1 -1
- package/dist/ui-form.editor-BJC3WhNf.js +5 -0
- package/dist/ui-form.editor-BJC3WhNf.js.map +1 -0
- package/dist/ui-form.js +199 -195
- package/dist/ui-form.js.map +1 -1
- package/dist/ui-grid.editor-DVn2YIBW.js +5 -0
- package/dist/ui-grid.editor-DVn2YIBW.js.map +1 -0
- package/dist/ui-grid.js +43 -234
- package/dist/ui-grid.js.map +1 -1
- package/dist/ui-header.editor-meOjCASK.js +5 -0
- package/dist/ui-header.editor-meOjCASK.js.map +1 -0
- package/dist/ui-icon-picker.editor-vFPbT9Kh.js +5 -0
- package/dist/ui-icon-picker.editor-vFPbT9Kh.js.map +1 -0
- package/dist/ui-icon-picker.js +64 -69
- package/dist/ui-icon-picker.js.map +1 -1
- package/dist/ui-icon.editor-DoKK49PD.js +5 -0
- package/dist/ui-icon.editor-DoKK49PD.js.map +1 -0
- package/dist/ui-icon.js +15 -14
- package/dist/ui-icon.js.map +1 -1
- package/dist/ui-icons.editor-CSD6fOVt.js +5 -0
- package/dist/ui-icons.editor-CSD6fOVt.js.map +1 -0
- package/dist/ui-image.editor-D4ZUC_Ka.js +5 -0
- package/dist/ui-image.editor-D4ZUC_Ka.js.map +1 -0
- package/dist/ui-image.js +26 -26
- package/dist/ui-image.js.map +1 -1
- package/dist/ui-images.editor-Cb0D3vnI.js +5 -0
- package/dist/ui-images.editor-Cb0D3vnI.js.map +1 -0
- package/dist/ui-include.editor-CZcsVJbH.js +5 -0
- package/dist/ui-include.editor-CZcsVJbH.js.map +1 -0
- package/dist/ui-include.js +21 -22
- package/dist/ui-include.js.map +1 -1
- package/dist/ui-input.editor-budoNoB0.js +5 -0
- package/dist/ui-input.editor-budoNoB0.js.map +1 -0
- package/dist/ui-input.js +131 -130
- package/dist/ui-input.js.map +1 -1
- package/dist/ui-item.editor-BlWp1HXu.js +5 -0
- package/dist/ui-item.editor-BlWp1HXu.js.map +1 -0
- package/dist/ui-item.js +127 -113
- package/dist/ui-item.js.map +1 -1
- package/dist/ui-items.editor-GOul3Xss.js +5 -0
- package/dist/ui-items.editor-GOul3Xss.js.map +1 -0
- package/dist/ui-items.js +11 -12
- package/dist/ui-items.js.map +1 -1
- package/dist/ui-json.editor-BgZbrB_W.js +5 -0
- package/dist/ui-json.editor-BgZbrB_W.js.map +1 -0
- package/dist/ui-json.js +18 -19
- package/dist/ui-json.js.map +1 -1
- package/dist/ui-keys.editor-BI9EDtS4.js +5 -0
- package/dist/ui-keys.editor-BI9EDtS4.js.map +1 -0
- package/dist/ui-keys.js +2 -3
- package/dist/ui-label.editor-BVUYLSUs.js +5 -0
- package/dist/ui-label.editor-BVUYLSUs.js.map +1 -0
- package/dist/ui-label.js +22 -22
- package/dist/ui-label.js.map +1 -1
- package/dist/ui-labels.editor-BWJth86p.js +5 -0
- package/dist/ui-labels.editor-BWJth86p.js.map +1 -0
- package/dist/ui-link.editor-CpI53scP.js +5 -0
- package/dist/ui-link.editor-CpI53scP.js.map +1 -0
- package/dist/ui-list.editor-DhBZIkAa.js +5 -0
- package/dist/ui-list.editor-DhBZIkAa.js.map +1 -0
- package/dist/ui-list.js +9 -10
- package/dist/ui-list.js.map +1 -1
- package/dist/ui-loader.editor-BJlvmP7S.js +5 -0
- package/dist/ui-loader.editor-BJlvmP7S.js.map +1 -0
- package/dist/ui-loader.js +10 -11
- package/dist/ui-loader.js.map +1 -1
- package/dist/ui-markdown.editor-DPVKyxXa.js +5 -0
- package/dist/ui-markdown.editor-DPVKyxXa.js.map +1 -0
- package/dist/ui-markdown.js +208 -154
- package/dist/ui-markdown.js.map +1 -1
- package/dist/ui-menu.editor-DJ3PhWtK.js +5 -0
- package/dist/ui-menu.editor-DJ3PhWtK.js.map +1 -0
- package/dist/ui-menu.js +815 -223
- package/dist/ui-menu.js.map +1 -1
- package/dist/ui-message.editor-vfT0pyu5.js +5 -0
- package/dist/ui-message.editor-vfT0pyu5.js.map +1 -0
- package/dist/ui-message.js +32 -33
- package/dist/ui-message.js.map +1 -1
- package/dist/ui-meta.editor-Bk5m43-E.js +5 -0
- package/dist/ui-meta.editor-Bk5m43-E.js.map +1 -0
- package/dist/ui-modal.editor-CkkJRgab.js +5 -0
- package/dist/ui-modal.editor-CkkJRgab.js.map +1 -0
- package/dist/ui-modal.js +132 -96
- package/dist/ui-modal.js.map +1 -1
- package/dist/ui-nag.editor-BJ3Ia2Bi.js +5 -0
- package/dist/ui-nag.editor-BJ3Ia2Bi.js.map +1 -0
- package/dist/ui-nag.js +23 -24
- package/dist/ui-nag.js.map +1 -1
- package/dist/ui-or.editor-BfBLNVgm.js +5 -0
- package/dist/ui-or.editor-BfBLNVgm.js.map +1 -0
- package/dist/ui-page-layout.editor-xtQW0FZk.js +5 -0
- package/dist/ui-page-layout.editor-xtQW0FZk.js.map +1 -0
- package/dist/ui-page-layout.js +363 -0
- package/dist/ui-page-layout.js.map +1 -0
- package/dist/ui-page.editor-Bd5mzlj7.js +5 -0
- package/dist/ui-page.editor-Bd5mzlj7.js.map +1 -0
- package/dist/ui-page.js +11 -12
- package/dist/ui-page.js.map +1 -1
- package/dist/ui-panel.editor-BCUkdr4S.js +5 -0
- package/dist/ui-panel.editor-BCUkdr4S.js.map +1 -0
- package/dist/ui-panel.js +105 -27
- package/dist/ui-panel.js.map +1 -1
- package/dist/ui-parts.js +108 -66
- package/dist/ui-parts.js.map +1 -1
- package/dist/ui-placeholder-header.editor-CJNO08Ax.js +5 -0
- package/dist/ui-placeholder-header.editor-CJNO08Ax.js.map +1 -0
- package/dist/ui-placeholder-image.editor-DctJiCNv.js +5 -0
- package/dist/ui-placeholder-image.editor-DctJiCNv.js.map +1 -0
- package/dist/ui-placeholder-line.editor-DcxH7mOo.js +5 -0
- package/dist/ui-placeholder-line.editor-DcxH7mOo.js.map +1 -0
- package/dist/ui-placeholder-paragraph.editor-C4rww_tp.js +5 -0
- package/dist/ui-placeholder-paragraph.editor-C4rww_tp.js.map +1 -0
- package/dist/ui-placeholder.editor-Bc0CYlZZ.js +5 -0
- package/dist/ui-placeholder.editor-Bc0CYlZZ.js.map +1 -0
- package/dist/ui-placeholder.js +23 -19
- package/dist/ui-placeholder.js.map +1 -1
- package/dist/ui-popup.editor-ByUi4CYs.js +5 -0
- package/dist/ui-popup.editor-ByUi4CYs.js.map +1 -0
- package/dist/ui-popup.js +107 -100
- package/dist/ui-popup.js.map +1 -1
- package/dist/ui-progress.editor-DX0IjhxZ.js +5 -0
- package/dist/ui-progress.editor-DX0IjhxZ.js.map +1 -0
- package/dist/ui-progress.js +23 -24
- package/dist/ui-progress.js.map +1 -1
- package/dist/ui-property-editor.editor-pS6tCPPT.js +5 -0
- package/dist/ui-property-editor.editor-pS6tCPPT.js.map +1 -0
- package/dist/ui-property-editor.js +649 -277
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-property-group.editor-BlpUMVlr.js +5 -0
- package/dist/ui-property-group.editor-BlpUMVlr.js.map +1 -0
- package/dist/ui-property.editor-BC-jtjjt.js +5 -0
- package/dist/ui-property.editor-BC-jtjjt.js.map +1 -0
- package/dist/ui-pushable.editor-8_EmUD9x.js +5 -0
- package/dist/ui-pushable.editor-8_EmUD9x.js.map +1 -0
- package/dist/ui-pusher.editor-CiCX6-1J.js +5 -0
- package/dist/ui-pusher.editor-CiCX6-1J.js.map +1 -0
- package/dist/ui-quote.editor-BvmAjmo9.js +5 -0
- package/dist/ui-quote.editor-BvmAjmo9.js.map +1 -0
- package/dist/ui-quote.js +8 -9
- package/dist/ui-quote.js.map +1 -1
- package/dist/ui-radio.editor-DPzActfO.js +5 -0
- package/dist/ui-radio.editor-DPzActfO.js.map +1 -0
- package/dist/ui-rail.editor-DRfVH4P2.js +5 -0
- package/dist/ui-rail.editor-DRfVH4P2.js.map +1 -0
- package/dist/ui-rail.js +11 -12
- package/dist/ui-rail.js.map +1 -1
- package/dist/ui-rating.editor-C19syymj.js +5 -0
- package/dist/ui-rating.editor-C19syymj.js.map +1 -0
- package/dist/ui-rating.js +40 -49
- package/dist/ui-rating.js.map +1 -1
- package/dist/ui-repeat.editor-DEf-bFGj.js +5 -0
- package/dist/ui-repeat.editor-DEf-bFGj.js.map +1 -0
- package/dist/ui-reveal.editor-D7pDOaen.js +5 -0
- package/dist/ui-reveal.editor-D7pDOaen.js.map +1 -0
- package/dist/ui-reveal.js +10 -11
- package/dist/ui-reveal.js.map +1 -1
- package/dist/ui-root.editor-CAokPDVa.js +5 -0
- package/dist/ui-root.editor-CAokPDVa.js.map +1 -0
- package/dist/ui-root.js +205 -102
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-row.editor-C00Z6Jl5.js +5 -0
- package/dist/ui-row.editor-C00Z6Jl5.js.map +1 -0
- package/dist/ui-search.editor-CtzfYgNu.js +5 -0
- package/dist/ui-search.editor-CtzfYgNu.js.map +1 -0
- package/dist/ui-search.js +143 -146
- package/dist/ui-search.js.map +1 -1
- package/dist/ui-section.editor-DmNICxCs.js +5 -0
- package/dist/ui-section.editor-DmNICxCs.js.map +1 -0
- package/dist/ui-section.js +74 -73
- package/dist/ui-section.js.map +1 -1
- package/dist/ui-sections.editor-BxXECGv9.js +5 -0
- package/dist/ui-sections.editor-BxXECGv9.js.map +1 -0
- package/dist/ui-segment.editor-CebyLPFn.js +5 -0
- package/dist/ui-segment.editor-CebyLPFn.js.map +1 -0
- package/dist/ui-segment.js +43 -43
- package/dist/ui-segment.js.map +1 -1
- package/dist/ui-segments.editor-CSumzMa5.js +5 -0
- package/dist/ui-segments.editor-CSumzMa5.js.map +1 -0
- package/dist/ui-select.editor-wAcZzvU7.js +5 -0
- package/dist/ui-select.editor-wAcZzvU7.js.map +1 -0
- package/dist/ui-select.js +86 -87
- package/dist/ui-select.js.map +1 -1
- package/dist/ui-shape.editor-By9-8aD2.js +5 -0
- package/dist/ui-shape.editor-By9-8aD2.js.map +1 -0
- package/dist/ui-shape.js +39 -38
- package/dist/ui-shape.js.map +1 -1
- package/dist/ui-side.editor-CFSqGHGH.js +5 -0
- package/dist/ui-side.editor-CFSqGHGH.js.map +1 -0
- package/dist/ui-sidebar.editor-DWFPQcXv.js +5 -0
- package/dist/ui-sidebar.editor-DWFPQcXv.js.map +1 -0
- package/dist/ui-sidebar.js +79 -77
- package/dist/ui-sidebar.js.map +1 -1
- package/dist/ui-sides.editor-CONIJ1r3.js +5 -0
- package/dist/ui-sides.editor-CONIJ1r3.js.map +1 -0
- package/dist/ui-sides.js +25 -26
- package/dist/ui-sides.js.map +1 -1
- package/dist/ui-site-breadcrumbs.editor-Dmc4qziE.js +5 -0
- package/dist/ui-site-breadcrumbs.editor-Dmc4qziE.js.map +1 -0
- package/dist/ui-site-breadcrumbs.js +143 -0
- package/dist/ui-site-breadcrumbs.js.map +1 -0
- package/dist/ui-site-nav-button.editor-6J-zJLtZ.js +5 -0
- package/dist/ui-site-nav-button.editor-6J-zJLtZ.js.map +1 -0
- package/dist/ui-site-nav-button.js +113 -0
- package/dist/ui-site-nav-button.js.map +1 -0
- package/dist/ui-site-nav.editor-CKEsOGCX.js +5 -0
- package/dist/ui-site-nav.editor-CKEsOGCX.js.map +1 -0
- package/dist/ui-site-nav.js +133 -97
- package/dist/ui-site-nav.js.map +1 -1
- package/dist/ui-site-tabs.editor-DDvQfH6S.js +5 -0
- package/dist/ui-site-tabs.editor-DDvQfH6S.js.map +1 -0
- package/dist/ui-site-tabs.js +53 -48
- package/dist/ui-site-tabs.js.map +1 -1
- package/dist/ui-slider.editor-BEaasx5Q.js +5 -0
- package/dist/ui-slider.editor-BEaasx5Q.js.map +1 -0
- package/dist/ui-slider.js +37 -38
- package/dist/ui-slider.js.map +1 -1
- package/dist/ui-space.editor-s-XVWFBN.js +5 -0
- package/dist/ui-space.editor-s-XVWFBN.js.map +1 -0
- package/dist/ui-space.js +9 -10
- package/dist/ui-space.js.map +1 -1
- package/dist/ui-split-panel.editor-Cvy5W7nk.js +5 -0
- package/dist/ui-split-panel.editor-Cvy5W7nk.js.map +1 -0
- package/dist/ui-split-panel.js +107 -68
- package/dist/ui-split-panel.js.map +1 -1
- package/dist/ui-stack.editor-D69Fky6H.js +5 -0
- package/dist/ui-stack.editor-D69Fky6H.js.map +1 -0
- package/dist/ui-stack.js +12 -13
- package/dist/ui-stack.js.map +1 -1
- package/dist/ui-statistic.editor-CBzYqbQ5.js +5 -0
- package/dist/ui-statistic.editor-CBzYqbQ5.js.map +1 -0
- package/dist/ui-statistic.js +28 -27
- package/dist/ui-statistic.js.map +1 -1
- package/dist/ui-statistics.editor-fzh3uk_b.js +5 -0
- package/dist/ui-statistics.editor-fzh3uk_b.js.map +1 -0
- package/dist/ui-step.editor-CYmNXrk_.js +5 -0
- package/dist/ui-step.editor-CYmNXrk_.js.map +1 -0
- package/dist/ui-step.js +62 -61
- package/dist/ui-step.js.map +1 -1
- package/dist/ui-steps.editor-BkMIrUrj.js +5 -0
- package/dist/ui-steps.editor-BkMIrUrj.js.map +1 -0
- package/dist/ui-sticky.editor-D7R1AlJv.js +5 -0
- package/dist/ui-sticky.editor-D7R1AlJv.js.map +1 -0
- package/dist/ui-sticky.js +10 -11
- package/dist/ui-sticky.js.map +1 -1
- package/dist/ui-submenu.editor-NdjS0em-.js +5 -0
- package/dist/ui-submenu.editor-NdjS0em-.js.map +1 -0
- package/dist/ui-summary.editor-CCHS1mVz.js +5 -0
- package/dist/ui-summary.editor-CCHS1mVz.js.map +1 -0
- package/dist/ui-tab.editor-DCS-gCZV.js +5 -0
- package/dist/ui-tab.editor-DCS-gCZV.js.map +1 -0
- package/dist/ui-tab.js +115 -117
- package/dist/ui-tab.js.map +1 -1
- package/dist/ui-table.editor-DJvfg9oG.js +5 -0
- package/dist/ui-table.editor-DJvfg9oG.js.map +1 -0
- package/dist/ui-table.js +272 -272
- package/dist/ui-table.js.map +1 -1
- package/dist/ui-tabs.editor-waeMoFNM.js +5 -0
- package/dist/ui-tabs.editor-waeMoFNM.js.map +1 -0
- package/dist/ui-term.editor-BMCF3jBM.js +5 -0
- package/dist/ui-term.editor-BMCF3jBM.js.map +1 -0
- package/dist/ui-terms.editor-BLfVVsjI.js +5 -0
- package/dist/ui-terms.editor-BLfVVsjI.js.map +1 -0
- package/dist/ui-terms.js +13 -12
- package/dist/ui-terms.js.map +1 -1
- package/dist/ui-text.editor-B6AENK13.js +5 -0
- package/dist/ui-text.editor-B6AENK13.js.map +1 -0
- package/dist/ui-text.js +37 -36
- package/dist/ui-text.js.map +1 -1
- package/dist/ui-textarea.editor-C25lVwrF.js +5 -0
- package/dist/ui-textarea.editor-C25lVwrF.js.map +1 -0
- package/dist/ui-theme-editor.editor-CQGAgy-Q.js +5 -0
- package/dist/ui-theme-editor.editor-CQGAgy-Q.js.map +1 -0
- package/dist/ui-theme-editor.js +448 -461
- package/dist/ui-theme-editor.js.map +1 -1
- package/dist/{ui-theme-menu-CuIjr8Ou.js → ui-theme-menu-BZYUMrHe.js} +356 -352
- package/dist/ui-theme-menu-BZYUMrHe.js.map +1 -0
- package/dist/ui-theme-menu.editor-DNeI-hxN.js +5 -0
- package/dist/ui-theme-menu.editor-DNeI-hxN.js.map +1 -0
- package/dist/ui-theme-token.editor-C2YAdEye.js +5 -0
- package/dist/ui-theme-token.editor-C2YAdEye.js.map +1 -0
- package/dist/ui-title.editor-40PZSOpn.js +5 -0
- package/dist/ui-title.editor-40PZSOpn.js.map +1 -0
- package/dist/ui-toast.editor-BDmIUsU_.js +5 -0
- package/dist/ui-toast.editor-BDmIUsU_.js.map +1 -0
- package/dist/ui-toast.js +125 -128
- package/dist/ui-toast.js.map +1 -1
- package/dist/ui-toc.editor-D_S1KFY_.js +5 -0
- package/dist/ui-toc.editor-D_S1KFY_.js.map +1 -0
- package/dist/ui-toc.js +52 -53
- package/dist/ui-toc.js.map +1 -1
- package/dist/ui-toolbar.editor-CNQ8nJmR.js +5 -0
- package/dist/ui-toolbar.editor-CNQ8nJmR.js.map +1 -0
- package/dist/ui-toolbar.js +254 -50
- package/dist/ui-toolbar.js.map +1 -1
- package/dist/ui-transition.editor-8SQkDkZ6.js +5 -0
- package/dist/ui-transition.editor-8SQkDkZ6.js.map +1 -0
- package/dist/ui-transition.js +13 -14
- package/dist/ui-transition.js.map +1 -1
- package/dist/ui-tree-diagram.editor-DkEK8i7J.js +5 -0
- package/dist/ui-tree-diagram.editor-DkEK8i7J.js.map +1 -0
- package/dist/ui-tree-diagram.js +128 -127
- package/dist/ui-tree-diagram.js.map +1 -1
- package/dist/ui-tree-item.editor-C4fuAlbJ.js +5 -0
- package/dist/ui-tree-item.editor-C4fuAlbJ.js.map +1 -0
- package/dist/ui-tree-node.editor-CB1z_w9F.js +5 -0
- package/dist/ui-tree-node.editor-CB1z_w9F.js.map +1 -0
- package/dist/ui-tree.editor-BoQztwdz.js +5 -0
- package/dist/ui-tree.editor-BoQztwdz.js.map +1 -0
- package/dist/ui-tree.js +393 -134
- package/dist/ui-tree.js.map +1 -1
- package/dist/ui-value.editor-CYak24cr.js +5 -0
- package/dist/ui-value.editor-CYak24cr.js.map +1 -0
- package/dist/ui-video.editor-CuWtFVjR.js +5 -0
- package/dist/ui-video.editor-CuWtFVjR.js.map +1 -0
- package/dist/ui-video.js +15 -14
- package/dist/ui-video.js.map +1 -1
- package/dist/ui-visibility.editor-Crx0DTlv.js +5 -0
- package/dist/ui-visibility.editor-Crx0DTlv.js.map +1 -0
- package/dist/ui-visibility.js +25 -26
- package/dist/ui-visibility.js.map +1 -1
- package/dist/ui-zoom.editor-DZ3HsWV4.js +5 -0
- package/dist/ui-zoom.editor-DZ3HsWV4.js.map +1 -0
- package/dist/ui-zoom.js +82 -83
- package/dist/ui-zoom.js.map +1 -1
- package/dist/util/TopLayerTip.d.ts +11 -2
- package/dist/vocabulary/SharedVocabulary.d.ts +2 -0
- package/dist/vocabulary/SharedVocabulary.es.d.ts +1 -0
- package/dist/vocabulary/help.generated.d.ts +11 -0
- package/dist/vocabulary/partsOfSpeech.generated.d.ts +6 -0
- package/package.json +3 -3
- package/dist/Dragging-CMZoLEWQ.js.map +0 -1
- package/dist/MarkdownSanitizer-zTnnbrLe.js +0 -884
- package/dist/MarkdownSanitizer-zTnnbrLe.js.map +0 -1
- package/dist/PrefStore-Qv0e5y04.js.map +0 -1
- package/dist/ScrollingRow-7n7Z-HIE.js +0 -88
- package/dist/ScrollingRow-7n7Z-HIE.js.map +0 -1
- package/dist/SitePages-CciwREek.js.map +0 -1
- package/dist/SlottedItems-Du3aJwG1.js +0 -80
- package/dist/SlottedItems-Du3aJwG1.js.map +0 -1
- package/dist/UIButton-DFEds67r.js +0 -6
- package/dist/UIButton-DFEds67r.js.map +0 -1
- package/dist/UIInput-BodVbUoQ.js.map +0 -1
- package/dist/UIKeys-Rh_gUZjP.js.map +0 -1
- package/dist/UILabel-DgJUBzB_.js.map +0 -1
- package/dist/UIMenu-zdcAtwTa.js +0 -42
- package/dist/UIMenu-zdcAtwTa.js.map +0 -1
- package/dist/UIRuntime-KH309p5B.js.map +0 -1
- package/dist/UISegment-CMMIW7cZ.js.map +0 -1
- package/dist/apple.palette-B4ivrNlM.js.map +0 -1
- package/dist/classic-DCTQrteU.js.map +0 -1
- package/dist/components.es-BOa_7gFF.js.map +0 -1
- package/dist/crisp-VfYZlTph.js.map +0 -1
- package/dist/crisp.theme-DRiePRdf.js +0 -6
- package/dist/crisp.theme-DRiePRdf.js.map +0 -1
- package/dist/dark-CbUdPe0a.js.map +0 -1
- package/dist/dist-BLYIGZVK.js.map +0 -1
- package/dist/emoji/cldr/0-DSUpV2d7.js.map +0 -1
- package/dist/emoji/cldr/a-D_oB4vJ-.js.map +0 -1
- package/dist/emoji/cldr/b-DX0W0Mda.js.map +0 -1
- package/dist/emoji/cldr/c-DUHidpE9.js.map +0 -1
- package/dist/emoji/cldr/d-CiCXZXay.js.map +0 -1
- package/dist/emoji/cldr/e-DILJo3Ri.js.map +0 -1
- package/dist/emoji/cldr/f-ByGFLyOq.js.map +0 -1
- package/dist/emoji/cldr/g-BZ0FRsud.js.map +0 -1
- package/dist/emoji/cldr/h-jtLdvRXQ.js.map +0 -1
- package/dist/emoji/cldr/i-DcbJ5utE.js.map +0 -1
- package/dist/emoji/cldr/j-BuEqP5nz.js.map +0 -1
- package/dist/emoji/cldr/k-P1J6Gvze.js.map +0 -1
- package/dist/emoji/cldr/l-28XcbsPr.js.map +0 -1
- package/dist/emoji/cldr/m-DKgGJ8rW.js.map +0 -1
- package/dist/emoji/cldr/n-DmPLP4F3.js.map +0 -1
- package/dist/emoji/cldr/o-f98nt3s7.js.map +0 -1
- package/dist/emoji/cldr/p-CxnsOTOt.js.map +0 -1
- package/dist/emoji/cldr/r-D0GPRJ-Q.js.map +0 -1
- package/dist/emoji/cldr/s-DcFuepnw.js.map +0 -1
- package/dist/emoji/cldr/t-BvHgGpUr.js.map +0 -1
- package/dist/emoji/cldr/u-ChFYHtUf.js.map +0 -1
- package/dist/emoji/cldr/v-WmX3nWtZ.js.map +0 -1
- package/dist/emoji/cldr/w-BPySQUWW.js.map +0 -1
- package/dist/emoji/cldr/x-SC3r1n9O.js +0 -6
- package/dist/emoji/cldr/x-SC3r1n9O.js.map +0 -1
- package/dist/emoji/cldr/y-zB_yhTFg.js.map +0 -1
- package/dist/emoji/cldr/z-BgJ94Cap.js.map +0 -1
- package/dist/emoji/fomantic/0-CGf6gC3a.js +0 -10
- package/dist/emoji/fomantic/0-CGf6gC3a.js.map +0 -1
- package/dist/emoji/fomantic/a-CrqYlC21.js.map +0 -1
- package/dist/emoji/fomantic/b-DneVHRdQ.js.map +0 -1
- package/dist/emoji/fomantic/c-ClxKRuir.js.map +0 -1
- package/dist/emoji/fomantic/d-Djqs_y4s.js.map +0 -1
- package/dist/emoji/fomantic/e-CuF-jOQd.js.map +0 -1
- package/dist/emoji/fomantic/f-D8VglrJ4.js.map +0 -1
- package/dist/emoji/fomantic/g-Du_HFl6U.js.map +0 -1
- package/dist/emoji/fomantic/h-CLE5tHnM.js.map +0 -1
- package/dist/emoji/fomantic/i-BjOsrQDZ.js.map +0 -1
- package/dist/emoji/fomantic/j-CyUDXKCu.js.map +0 -1
- package/dist/emoji/fomantic/k-Clypg4R8.js.map +0 -1
- package/dist/emoji/fomantic/l-DvLPdBh-.js.map +0 -1
- package/dist/emoji/fomantic/m-B1lIb1kP.js.map +0 -1
- package/dist/emoji/fomantic/n-Bgpp_ht5.js.map +0 -1
- package/dist/emoji/fomantic/o-BhYZzpjp.js.map +0 -1
- package/dist/emoji/fomantic/p-VLL0GK3m.js.map +0 -1
- package/dist/emoji/fomantic/q-CKrtMwhc.js +0 -6
- package/dist/emoji/fomantic/q-CKrtMwhc.js.map +0 -1
- package/dist/emoji/fomantic/r-Bd1DjkkI.js.map +0 -1
- package/dist/emoji/fomantic/s-Bqatw1W7.js.map +0 -1
- package/dist/emoji/fomantic/t-Bs7IFhv3.js.map +0 -1
- package/dist/emoji/fomantic/u-M6GfYC-U.js.map +0 -1
- package/dist/emoji/fomantic/v-BKHNqkn0.js.map +0 -1
- package/dist/emoji/fomantic/w-B_XvIu7h.js.map +0 -1
- package/dist/emoji/fomantic/x-CG1_nzCF.js +0 -9
- package/dist/emoji/fomantic/x-CG1_nzCF.js.map +0 -1
- package/dist/emoji/fomantic/y-DPZaoIla.js.map +0 -1
- package/dist/emoji/fomantic/z-FH-kPXch.js.map +0 -1
- package/dist/fruity-BRVlgJZd.js +0 -6
- package/dist/fruity-BRVlgJZd.js.map +0 -1
- package/dist/fruity.theme-CbC7Jyvk.js.map +0 -1
- package/dist/glass-x9tbbwVq.js +0 -6
- package/dist/glass-x9tbbwVq.js.map +0 -1
- package/dist/glass.theme-24wY2wH9.js +0 -6
- package/dist/glass.theme-24wY2wH9.js.map +0 -1
- package/dist/matrix-QY2gWbJ0.js +0 -6
- package/dist/matrix-QY2gWbJ0.js.map +0 -1
- package/dist/matrix.theme-_8xtwhDq.js +0 -6
- package/dist/matrix.theme-_8xtwhDq.js.map +0 -1
- package/dist/merlot-DOXLuUaU.js.map +0 -1
- package/dist/merlot.theme-S-QnNGsw.js +0 -6
- package/dist/merlot.theme-S-QnNGsw.js.map +0 -1
- package/dist/midnight-BxlTQSfw.js.map +0 -1
- package/dist/midnight.theme-wXbqRYLy.js +0 -6
- package/dist/midnight.theme-wXbqRYLy.js.map +0 -1
- package/dist/mockup-83ELBuVr.js +0 -6
- package/dist/mockup-83ELBuVr.js.map +0 -1
- package/dist/mockup.theme-DmpBgGBl.js +0 -6
- package/dist/mockup.theme-DmpBgGBl.js.map +0 -1
- package/dist/paper-M61nUilz.js.map +0 -1
- package/dist/paper.theme-B8R5Jn5H.js +0 -6
- package/dist/paper.theme-B8R5Jn5H.js.map +0 -1
- package/dist/persist.types-D2m6wD-S.js.map +0 -1
- package/dist/pop-CxXfytjk.js.map +0 -1
- package/dist/pop.theme-CXzv8B9x.js +0 -6
- package/dist/pop.theme-CXzv8B9x.js.map +0 -1
- package/dist/search-CzSzx7bX.js.map +0 -1
- package/dist/spell-By5Y3jKP.js +0 -6
- package/dist/spell-By5Y3jKP.js.map +0 -1
- package/dist/spell.theme-DxGj7qHx.js +0 -6
- package/dist/spell.theme-DxGj7qHx.js.map +0 -1
- package/dist/styles.en-CUUxNwHo.js.map +0 -1
- package/dist/ui-theme-menu-CuIjr8Ou.js.map +0 -1
package/dist/ui-menu.js.map
CHANGED
|
@@ -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) => {\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,KAAK,OAAU;IAC7G,MAAMA;IACN,OAAOA;GACT,EAAE;GACF,aACE;EAUJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aACE;EAEJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM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,KAAQ,SACRoB,KAAQ,SACRJ,KAAS,UACTd,KAAQ,SACRR,KAAM,OACN4B,KAAiB,YACjBC,KAAiB,YAGjBlF,KAAO,aAAagF;;;0BCh+B1BmB,GAAO,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.hasOverflowMenu && !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 {\n /* by its item: a read of the rows makes new objects, and one row's change keeps the others' buttons */\n }\n <For each={this.folded} keyed={(row) => row.element}>\n {(row) => this.foldedRow(row)}\n </For>\n </div>\n </Show>","ref={(element) => this.overflowPanel = element}","<For each={this.folded} keyed={(row) => row.element}>\n {(row) => this.foldedRow(row)}\n </For>","keyed={(row) => row.element}","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 {\n /* by its item: a read of the rows makes new objects, and one row's change keeps the others' buttons */\n }\n <For each={this.folded} keyed={(row) => row.element}>\n {(row) => this.foldedRow(row)}\n </For>\n </div>","role={row().isSelected ? \"menuitemradio\" : \"menuitem\"}","aria-checked={row().isSelected ? \"true\" : void 0}","aria-disabled={row().isDisabled ? \"true\" : void 0}","class={TICK}","d={UIT.TICK_PATH}","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={TICK} aria-hidden=\"true\">\n <svg viewBox=\"0 0 16 16\">\n <path d={UIT.TICK_PATH} />\n </svg>\n </span>\n <span class={UIT.ICON} aria-hidden=\"true\">\n {icon()}\n </span>\n <span class={TITLE}>{row().text}</span>\n {badges()}\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.isAFlyout}>\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=\"menu\"\n aria-orientation=\"vertical\"\n aria-label={this.landmarkLabel}\n >\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 {this.boxContent()}\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 {this.boxContent()}\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.isAFlyout}>\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=\"menu\"\n aria-orientation=\"vertical\"\n aria-label={this.landmarkLabel}\n >\n <slot />\n </div>\n </Match>","ref={(element) => {\n this.bar = element;\n this.box = element;\n }}","aria-label={this.landmarkLabel}","<div\n ref={(element) => {\n this.bar = element;\n this.box = element;\n }}\n class={this.rootClass}\n part={this.partForName(\"menu\")}\n role=\"menu\"\n aria-orientation=\"vertical\"\n aria-label={this.landmarkLabel}\n >\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 {this.boxContent()}\n </div>\n </Match>","<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 {this.boxContent()}\n </div>","aria-orientation={this.isVertical ? \"vertical\" : void 0}","<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 {this.boxContent()}\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 {this.boxContent()}\n </nav>","role={this.isTabs ? \"tablist\" : void 0}","<slot />","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_elementSetup_dec","_vocabulary_dec","_a","_init","__name","E.UIComponent","E.proto","E.protoMerged","E.onChange","E.cssState","E.state","E.derived","E.on","E.untracked","E.watches","UIT.SELECTED","UIT.ACTIVE","E.lazy","E.PartContext","E.PopoverPanel","E.IconGlyph","E.Queued","E.afterSolidUpdate","_$readShallow","_$setAttribute","_$getOwner","UIT.ICON","TITLE","UIT.TICK_PATH","UIT.DISABLED_STATE","menuCSS","UIT.ITEM","MOUSE","E.after","<Show when={this.itemContext} fallback={<slot />}>\n {this.box()}\n <Show when={!this.namesAMenu && !isServer}>{this.flyoutPanel()}</Show>\n </Show>","this","<slot />","this.box()","<Show when={!this.namesAMenu && !isServer}>{this.flyoutPanel()}</Show>","part={this.partForName(\"title\")}","ref={(element) => this.chevron = element}","part={this.submenuPart(CHEVRON)}","title={this.split ? this.flyoutLabel ?? void 0 : void 0}","ref={(element) => this.panel = element}","ref={(element) => this.innerMenu = element}","part={this.submenuPart(FLYOUT)}","size={menu()?.size}","ticks={menu()?.ticks || this.hasOnOrOffItems ? \"\" : void 0}","icon-column={menu()?.iconColumn ? \"\" : void 0}","aria-label={this.flyoutLabel ?? this.label}","<div\n ref={(element) => this.panel = element}\n class={FLYOUT}\n part={this.submenuPart(FLYOUT)}\n popover=\"manual\"\n >\n <ui-menu\n ref={(element) => this.innerMenu = element}\n direction=\"vertical\"\n size={menu()?.size}\n ticks={menu()?.ticks || this.hasOnOrOffItems ? \"\" : void 0}\n icon-column={menu()?.iconColumn ? \"\" : void 0}\n aria-label={this.flyoutLabel ?? this.label}\n >\n <slot />\n </ui-menu>\n </div>","E.proto","E.protoMerged","E.cssState","E.state","E.untracked","E.watches","E.onChange","E.on","E.IconGlyph","E.PopoverPanel","E.after","UIT.ITEM","_$getOwner","_$readShallow","_$setAttribute","__name","submenuCSS","ICON","MenuAppearances","Key","__decoratorStart","__publicField","__name$1","ITEM","ItemAlignments","__decorateElement","__decoratorMetadata","__runInitializers","SELECTED","DISABLED_STATE","ACTIVE","__privateAdd","TICK_PATH","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","measured","holdBack","heldBack","sizes","HAIR","titlesRoom","sum","width","OVERFLOW$1","fitted","ICONS$1","style","fontSize","DEFAULT_FONT_SIZE","shown","gaps","padding","fitsWhole","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","index","isSegmented","answer","CUT","ICONS_ONLY_STATE","OVERFLOW_STATE","DROPDOWN_STATE","resizes","around","domElement","elements","cap","widths","min","sorted","a","b","left","share","match","LENGTH","text","fallback","value","EM","boxes","rects","rect","CONTENTS","NONE","SLOT","child","STYLE","_tmpl$$1","_tmpl$2$1","_tmpl$3$1","_tmpl$4$1","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_tmpl$10","_tmpl$11","_menuItems_dec","_onMenubarChanged_dec","_focusChosenItem_dec","_focusFirstItem_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","_lightElements_dec","_showValue_dec","_onValueChanged_dec","_onSubmissionChanged_dec","_onFormValueChanged_dec","_isAFormValue_dec","_onClick_dec","_nestedItemContext_dec","_ownItemContext_dec","_isAFlyout_dec","_isInPopup_dec","_isVertical_dec","_onReadyToRove_dec","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_isAFlyout","_fitAnswer","_folded","other","row","key","_UIMenu","UIComponent","proto","protoMerged","onChange","cssState","state","derived","on","untracked","watches","lazy","PartContext","WHOLE","PopoverPanel","reason","IconGlyph","MORE_ICON","CARET_ICON","event","container","UI","ROWS","afterSolidUpdate","isReady","SEGMENTED","MANY","VERTICAL","POPUP_TAG","isInteractive","isTabs","LINK_LOOK","top","untrack","item","isAFormValue","each","items","isOn","add","parent","hasThumb","thumb","stop","SELECTED_STATE","ITEM_BOX","ICONS","OVERFLOW","canFit","fit","DEFAULT_SLOT","hide","isOpen","isConnected","panel","ROWS_PER_COLUMN","opener","OVERFLOW_MENU_ROOM","perColumn","columns","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$1","_el$7","CARET","_self$4","_el$8","For","OVERFLOW_MENU_CLASS","copies","copy","glyph","icon","copied","_el$9","LETTER","badges","_el$10","BADGE","_self$5","_el$11","_el$12","_el$14","_el$15","_el$16","ROW","SELECTED_CLASS","DISABLED_CLASS","TICK","s","host","isRoving","orientation","bar","selected","_self$6","memo","_self$7","Switch","Match","_el$17","_el$18","_el$19","_el$20","_el$21","_el$22","_el$23","_el$24","_el$25","_el$26","_el$27","target","root","UIMenu","delegateEvents","SubMenuAim","document","from","MOUSE$1","SLACK_DEGREES","flip","dx","delta","edgeX","move","bottom","widen","slack","side","subMenu","now","here","CHECK_EVERY_MS","isAiming","MISSES_TO_GIVE_UP","path","resting","after","RESTING_SECONDS","error","submenuVocabulary","UISubmenu_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_onNamedMenuChoosing_dec","_onChoosing_dec","_onFlyoutKey_dec","_onRowKey_dec","_onRowClick_dec","_closeKey_dec","_openKey_dec","_isRightToLeft_dec","_giveUpTo_dec","_onFlyoutEnter_dec","_onFlyoutLeave_dec","_onMenuPointerOver_dec","_onPointerOver_dec","_focusChosen_dec","_onOpenChanged_dec","_close_dec","_open_dec","_prepareFlyout_dec","_onReadyForFlyout_dec","_flyoutMenu_dec","_flyoutBox_dec","_hasOnOrOffItems_dec","_namedMenu_dec","_isOpen_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_isOpen","CHOOSING","FLYOUT_STYLE","FLYOUT_SHEET","_UISubmenu","UIItem","CHEVRON_ICON","FLYOUT_POOL","MOUSE","to","owner","LEAVE_SECONDS","again","id","MANUAL","menu","byKeyboard","pointer","Warnings","unframe","listeners","rowWatch","component","RIGHT_TO_LEFT","TITLE","CHEVRON","FLYOUT","before","UISubmenu"],"sources":["../src/components/ui-menu/UIMenu.en.ts","../src/components/ui-menu/TitleFit.ts","../src/components/ui-menu/UIMenu.tsx","../src/components/ui-menu/SubMenuAim.ts","../src/components/ui-menu/UISubmenu.en.ts","../src/components/ui-menu/UISubmenu.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 partOfSpeech: \"structure\",\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-to\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"both\", \"top\", \"bottom\"],\n classes: { both: \"attached\", top: \"top attached\", bottom: \"bottom attached\" },\n replaces: [\"attach\", { 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 names were `attach` and `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, the menu's DOM element and the nearest box around it (`ResizeObserver`), the fonts loading;\n * the menu also asks when its items or their words change.\n * - So the titles come back as the room does: the box itself may not grow, being only as wide as what it shows.\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 measured = this.measure(rows, others)\n // HYSTERESIS (epic `editor` I189): from a smaller stage, the whole look must fit with the room that stage freed\n // (a toolbar's list button, hidden while it's the dropdown) given back; else each look's room chose the other,\n // every frame\n // asked every time, so the menu can measure what it holds back while it shows\n const holdBack = Math.max(0, this.setup.holdBack?.() ?? 0)\n const heldBack = this.answer === WHOLE ? 0 : holdBack\n const sizes = heldBack\n ? { ...measured, room: measured.room - heldBack, fitsWhole: measured.needed <= measured.room - heldBack + HAIR }\n : measured\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 * - `needed`: the items' width, titles whole\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 const needed = titles.reduce((sum, width, index) => sum + width + fixed[index]!, 0)\n return { fitsWhole, room, needed, 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 DOM element and the box around it too: the menu's box is only as wide as what it shows (a segmented\n // one's dropdown, a page's `flex: 0 1 auto`), so once its titles are gone it can't tell when there's room again\n const { domElement } = this.setup\n const around = TitleFit.boxAround(domElement)\n const next = new Set([this.box, ...TitleFit.boxesOf(domElement), ...(around ? [around] : []), ...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 /**\n * The nearest box around `element`, in the page as drawn: its slot's, its parent's or its shadow root's host's,\n * past any of `display: contents` (a `<ui-segment>`'s DOM element), which draws no box and so never resizes.\n */\n private static boxAround(element: Element): Element | undefined {\n let around = TitleFit.drawnParentOf(element)\n while (around && getComputedStyle(around).display === CONTENTS) around = TitleFit.drawnParentOf(around)\n return around\n }\n\n /** `element`'s parent in the page as drawn: its slot, else its parent, else its shadow root's host. */\n private static drawnParentOf(element: Element): Element | undefined {\n return element.assignedSlot ?? element.parentElement ?? (element.parentNode as ShadowRoot | null)?.host ?? undefined\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 /**\n * room a smaller stage frees, which the whole look takes back: a toolbar's list button, hidden while it's the\n * dropdown; coming back to whole needs this much more, so the two looks never take turns (epic `editor` I189)\n */\n holdBack?: () => number\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 /** the items' width, every title whole */\n needed: 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 * - FLY-OUT: the menu a `<ui-submenu>` row opens beside itself (`isAFlyout`, set by the row):\n * `<div role=\"menu\" aria-orientation=\"vertical\">`, its items `menuitem`s with the menubar's roving focus,\n * and no frame of its own (the fly-out's box is its frame, as a popup is).\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 * - Too many rows for the window's height, they lay out in columns, top to bottom, then across (`fitColumns()`;\n * epic `editor` T84: \"Files menu should go multi-column when it is long\").\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 /**\n * It's what a popup holds, a right click's menu, or a `<ui-submenu>`'s fly-out: `:state(in-popup)`.\n * - The popup (or the fly-out's box) is its frame, so it draws none of its own (no border, fill, shadow or blur)\n * and no line between items.\n */\n @E.cssState(\"in-popup\")\n get isInPopup(): boolean {\n return this.isAFlyout || (this.isConnected && !!this.domElement.closest(POPUP_TAG))\n }\n\n /**\n * It's the menu a `<ui-submenu>` row opens beside itself:\n * `role=\"menu\"`, its items `menuitem`s, one Tab stop and arrow keys between them, no frame of its own.\n * - Set by the row (`UISubmenu`): on the menu it draws round its items, or on the one its `menu` names.\n * Never an attribute: a menu is a fly-out because a row shows it as one.\n */\n @E.state accessor isAFlyout = false\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 || this.isAFlyout\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 // a fly-out's items are its own menu's to choose, and a click that opens a fly-out chooses nothing\n if (!this.itemsThatAsked.has(item) || UIMenu.componentOf(item)?.opensAMenuOn?.(event)) 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 protected static valueOf(item: Element): string {\n return UIMenu.componentOf(item)?.value ?? item.textContent?.trim() ?? \"\"\n }\n\n /** An item DOM element's component, as the menu reads it. */\n private static componentOf(item: Element): ItemComponent | undefined {\n return (item as E.DOMElement).component as ItemComponent | undefined\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 /**\n * Every element of its light DOM, in page order, a `<slot>` standing for what's assigned to it:\n * the menu a `<ui-submenu>` draws round its items holds only its `<slot>`.\n */\n @E.untracked\n private lightElements(): HTMLElement[] {\n const elements: HTMLElement[] = []\n const add = (parent: Element) => {\n for (const child of parent.children) {\n const isSlot = child.localName === \"slot\"\n const shown = isSlot ? (child as HTMLSlotElement).assignedElements({ flatten: true }) : [child]\n for (const element of shown) {\n elements.push(element as HTMLElement)\n add(element)\n }\n }\n }\n add(this.domElement)\n return elements\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.lightElements() as 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({\n track: box,\n chosenBox: () => this.chosenBox(),\n onPlaced: () => this.onThumbPlaced()\n })\n this.thumb = thumb\n const stop = thumb.start()\n return () => {\n stop()\n this.thumb = undefined\n }\n }\n\n /** The thumb just moved: for a subclass whose box scrolls, as the thumb is in what it scrolls (`<ui-toolbar>`). */\n protected onThumbPlaced() {}\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 this.onItemsChanged()\n }\n\n /** Its items, or which of them is chosen or shown, may have changed: for a subclass that follows them. */\n protected onItemsChanged() {}\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.lightElements()) {\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 holdBack: () => this.fitHoldBack,\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 /**\n * Room a smaller stage frees that the whole look takes back: none here (`TitleFit`'s `holdBack`);\n * a toolbar's list button (`<ui-toolbar>`).\n */\n protected get fitHoldBack(): number {\n return 0\n }\n\n /** Fit a `shrinkable` menu's titles again, soon: a subclass changed which items show (`<ui-toolbar max-visible>`). */\n protected refitTitles() {\n this.titleFit?.update()\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); never a hidden one\n * (epic `editor` I188: a project's 59 files, 57 put away, counted 58 gaps, and the 2 tabs left became a dropdown).\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 // a hidden item (a toolbar's `max-visible` puts the rest away) takes no room, and no gap\n if ((element as HTMLElement).hidden) continue\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 protected 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 ((element as HTMLElement).hidden) return undefined\n const item = this.itemOf(element)\n return item?.titleBox ? item : undefined\n }\n\n /** `element`'s component, when it's one of this menu's own items, drawn; hidden or not. */\n protected itemOf(element: Element): ItemComponent | undefined {\n if (!this.itemsThatAsked.has(element)) return undefined\n const item = (element as E.DOMElement).component as ItemComponent | undefined\n return item?.kind === UIT.ITEM && item.focusTarget ? item : undefined\n }\n\n /** `element` is hidden only to keep the row short, so its overflow menu still lists it. */\n protected isPutAway(_element: Element): boolean {\n return false\n }\n\n ////////////////\n // ## The overflow button and its menu\n ////////////////\n\n /** It draws the overflow menu: `shrinkable`; a toolbar's `max-visible` too. */\n protected get hasOverflowMenu(): boolean {\n return this.isShrinking\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.hasOverflowMenu) {\n this.folded = []\n return\n }\n const rows: FoldedItem[] = []\n for (const element of this.rowElements()) {\n if ((element as HTMLElement).hidden && !this.isPutAway(element)) continue\n const item = this.itemOf(element)\n // shrinkable: an item with no words stays in the row, so it isn't a row here\n if (!item || (this.isShrinking && !item.titleBox)) 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 /** What the overflow menu hangs from, and hands focus back to. */\n protected get overflowOpener(): HTMLButtonElement | undefined {\n return this.overflowButton\n }\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.fitColumns()\n this.focusRow(\n Math.max(\n 0,\n this.folded.findIndex((row) => row.isSelected)\n )\n )\n })\n return hide\n }\n\n /**\n * Lay the overflow menu's rows out in columns when they're too many for the window's height:\n * top to bottom, then across, as few columns as fit, the columns as even as can be (`data-columns`, `UIMenu.css`).\n * - The room is the window's, above or below its button, whichever is more, as the menu can open either way.\n * - Few enough to fit: one column, as ever.\n */\n private fitColumns() {\n const panel = this.overflowPanel\n if (!panel) return\n delete panel.dataset.columns\n panel.style.removeProperty(ROWS_PER_COLUMN)\n const rows = panel.querySelectorAll<HTMLElement>(ROWS)\n const opener = this.overflowOpener?.getBoundingClientRect()\n const room =\n (opener ? Math.max(window.innerHeight - opener.bottom, opener.top) : window.innerHeight) - OVERFLOW_MENU_ROOM\n const perColumn = () => Math.max(1, Math.floor(room / (rows[0]?.getBoundingClientRect().height || room)))\n if (rows.length <= perColumn()) return\n // in columns its rows are tighter (`UIMenu.css`): measured again in that look\n panel.dataset.columns = \"\"\n const columns = Math.ceil(rows.length / perColumn())\n panel.dataset.columns = String(columns)\n panel.style.setProperty(ROWS_PER_COLUMN, String(Math.ceil(rows.length / columns)))\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.overflowOpener?.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 protected 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.hasOverflowMenu && !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 {/* by its item: a read of the rows makes new objects, and one row's change keeps the others' buttons */}\n <For each={this.folded} keyed={(row) => row.element}>\n {(row) => this.foldedRow(row)}\n </For>\n </div>\n </Show>\n )\n }\n\n /**\n * One row of the overflow menu: a tick's gutter, 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 * - The tick first, as every ticked menu's (`<ui-menu ticks>`; epic `editor` I243):\n * every row keeps its gutter, so the icons line up.\n */\n private foldedRow(row: () => FoldedItem): JSX.Element {\n const copies = (name: \"icon\" | \"badge\") => {\n const item = (row().element as E.DOMElement).component as ItemComponent | undefined\n return (item?.slotted?.(name) ?? []).map((element) => {\n const copy = element.cloneNode(true) as Element\n copy.removeAttribute(\"slot\")\n return copy\n })\n }\n const glyph = new E.IconGlyph({ owner: this, name: () => row().icon })\n const icon = () => {\n if (row().icon) return glyph.svg\n const copied = copies(\"icon\")\n return copied.length ? copied : <span class={LETTER}>{row().letter}</span>\n }\n const badges = () => {\n const copied = copies(\"badge\")\n return copied.length ? <span class={BADGE}>{copied}</span> : undefined\n }\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={TICK} aria-hidden=\"true\">\n <svg viewBox=\"0 0 16 16\">\n <path d={UIT.TICK_PATH} />\n </svg>\n </span>\n <span class={UIT.ICON} aria-hidden=\"true\">\n {icon()}\n </span>\n <span class={TITLE}>{row().text}</span>\n {badges()}\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, tabs or fly-out, once rendered. */\n get isRoving(): boolean {\n return this.isMenubar || ((this.isTabs || this.isFlyoutMenu) && this.isReady)\n }\n\n /** A top-level fly-out: a sub-menu nested in one is still its parent's. */\n private get isFlyoutMenu(): boolean {\n return this.isAFlyout && !this.parentMenu\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 (and fly-outs) go up and down. */\n private get orientation(): E.RovingOrientation {\n return this.isVertical || this.isFlyoutMenu ? \"vertical\" : \"horizontal\"\n }\n\n /**\n * Focus its first item that can be chosen (shown, not disabled), as a fly-out opens by keyboard;\n * true when one took focus.\n */\n @E.untracked\n focusFirstItem(): boolean {\n const box = this.menuItems().find((each) => !(each.getRootNode() as ShadowRoot).host?.matches(UIT.DISABLED_STATE))\n box?.focus()\n return !!box && box.matches(\":focus\")\n }\n\n /**\n * Focus its chosen item (`selected`), shown and not disabled, as a fly-out opens by keyboard;\n * true when one took focus, false when none is chosen.\n */\n @E.untracked\n focusChosenItem(): boolean {\n const box = this.menuItems().find((each) => {\n const host = (each.getRootNode() as ShadowRoot).host\n return host?.matches(SELECTED_STATE) && !host.matches(UIT.DISABLED_STATE)\n })\n box?.focus()\n return !!box && box.matches(\":focus\")\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.lightElements()) {\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.isAFlyout}>\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=\"menu\"\n aria-orientation=\"vertical\"\n aria-label={this.landmarkLabel}\n >\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 {this.boxContent()}\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 {this.boxContent()}\n </nav>\n </Match>\n </Switch>\n )\n }\n\n /**\n * What a top-level menu's box holds after its overflow button: its items, through one `<slot>`.\n * - `<ui-app-menu>`'s is its three sections instead (`UIAppMenu`), each a box of its own around a slot.\n */\n protected boxContent(): JSX.Element {\n return <slot />\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/** The tag whose box a menu inside it takes as its frame: `isInPopup`. */\nconst POPUP_TAG = \"ui-popup\"\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 TICK = \"tick\"\nconst DISABLED_CLASS = \"disabled\"\n\n/** Selector of the overflow menu's rows, in its box. */\nconst ROWS = `:scope > .${ROW}`\n/** The overflow menu's rows in each column, while it has columns (`fitColumns()`). */\nconst ROWS_PER_COLUMN = \"--_ui-menu-overflow-rows\"\n/** Room the overflow menu keeps round its rows, top and bottom: its margin, padding and border, and some to spare. */\nconst OVERFLOW_MENU_ROOM = 24\n\n////////////////\n// ## Item types\n////////////////\n\n/** What the menu reads from an item's component (`UIItem`, not imported: another family). */\nexport type 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 * `event`, a click on it, opens a menu of its own (`<ui-submenu>`), so it chooses nothing:\n * anywhere on its row, or only its chevron end (`<ui-submenu split>`)\n */\n opensAMenuOn?(event: Event): boolean\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","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `SubMenuAim`\n * Keeps a menu's open sub-menu open while the pointer heads for it,\n * so a diagonal move from a row to its sub-menu doesn't open the sub-menus of the rows it crosses.\n * - The menu asks it before switching sub-menus on hover (`wantsToSwitch()`): \"no\" while the pointer is aiming.\n * - It hands the menu back the row under the pointer once the pointer stops aiming (`onGiveUp`):\n * - two moves in a row that don't head for the sub-menu\n * - or the pointer resting for `RESTING_SECONDS`, not over the open row and not in the sub-menu\n * - How it tells, on each mouse move (at most one check a frame, `CHECK_EVERY_MS`; `isAiming()`):\n * - the move's direction, from the last position checked\n * - against the directions from there to the sub-menu's two corners on the side facing the row,\n * widened by `SLACK_DEGREES` each way\n * - a move away from the sub-menu's side counts as missing it, with no angles worked out\n * - Mouse only: a touch or a pen has no hover to follow, so it never blocks one (`pointerType`).\n * - Either side: the sub-menu's box, right or left of its row's, says which way it opens.\n * - Tracks from `start()`, when a sub-menu opens, until `stop()`, when it closes, or the pointer reaches it.\n * - Plain DOM, no Solid, no element of its own: any menu that opens sub-menus beside rows can use it\n * (the editor's bar menus, `<BarMenu>`).\n * - A geometry check, as React Aria chose, not an invisible overlay or a clip-path over the gap.\n * SEE: https://react-aria.adobe.com/blog/creating-a-pointer-friendly-submenu-experience\n ****************/\nexport class SubMenuAim {\n /** the open sub-menu's row, its sub-menu, and who hears it give up */\n private readonly setup: SubMenuAimSetup\n\n constructor(setup: SubMenuAimSetup) {\n this.setup = setup\n }\n\n /** It's tracking a sub-menu just opened, and the pointer hasn't missed it twice yet. */\n get isTracking(): boolean {\n return this.moves !== undefined\n }\n\n ////////////////\n // ## Starting and stopping\n ////////////////\n\n /**\n * Start tracking the sub-menu just opened: call it every time one opens, the same one again too.\n * - `from`: where the pointer is now, if known (the event that opened it); else the next move's position.\n * - Measures the sub-menu's box now (it may have scrolled since), and again on the first move if it wasn't drawn yet.\n * - Restarts cleanly if already tracking.\n */\n start(from?: { clientX: number; clientY: number }): void {\n this.stop()\n const document = this.setup.row()?.ownerDocument\n if (!document) return\n this.moves = new AbortController()\n document.addEventListener(\"pointermove\", this.onMove, { capture: true, signal: this.moves.signal })\n this.target = this.measure()\n this.last = from ? { x: from.clientX, y: from.clientY } : undefined\n this.lastCheck = -Infinity\n }\n\n /**\n * Stop tracking: the sub-menu closed, or the pointer reached it.\n * - Safe to call when not tracking.\n */\n stop(): void {\n this.moves?.abort()\n this.moves = undefined\n this.resting?.cancel()\n this.resting = undefined\n this.target = undefined\n this.last = undefined\n this.misses = 0\n this.path = []\n }\n\n ////////////////\n // ## Asking\n ////////////////\n\n /**\n * May the menu switch to the row this pointer event is over (`pointerover`)?\n * - `false` while the pointer is aiming at the open sub-menu: keep it open, leave the row alone.\n * - `true` when it isn't tracking, and for a touch or a pen.\n */\n wantsToSwitch(event: PointerEvent): boolean {\n if (event.pointerType !== MOUSE) return true\n return !this.isTracking\n }\n\n /**\n * Is a move from `from` by `delta` heading for the sub-menu `target`?\n * - `true` when its direction is between the directions to the target's two near corners,\n * `slack` degrees wider each way.\n * - `false` at once for a move away from the target's side (right: `delta.x < 0`; left: `delta.x > 0`).\n * - Pure: no DOM.\n */\n static isAiming(from: Point, delta: Point, target: AimTarget, slack = SLACK_DEGREES): boolean {\n // Mirror a sub-menu on the left onto the right, so one comparison does both\n const flip = target.side === \"left\" ? -1 : 1\n const dx = delta.x * flip\n if (dx < 0) return false\n if (dx === 0 && delta.y === 0) return true\n // Already level with the edge (beside the sub-menu, above or below it): its corners straight up or down\n const edgeX = Math.max((target.edge - from.x) * flip, 1)\n const move = Math.atan2(delta.y, dx)\n const top = Math.atan2(target.top - from.y, edgeX)\n const bottom = Math.atan2(target.bottom - from.y, edgeX)\n const widen = (slack * Math.PI) / 180\n return move >= top - widen && move <= bottom + widen\n }\n\n /**\n * Where sub-menu `subMenu` sits beside `row`: which side, its near edge, its top and bottom.\n * - Its side is where its middle is, against the row's middle: right, else left.\n * - Pure: boxes in, no DOM read.\n */\n static targetFor(row: DOMRectReadOnly, subMenu: DOMRectReadOnly): AimTarget {\n const side: AimSide = subMenu.left + subMenu.width / 2 >= row.left + row.width / 2 ? \"right\" : \"left\"\n return { side, edge: side === \"right\" ? subMenu.left : subMenu.right, top: subMenu.top, bottom: subMenu.bottom }\n }\n\n ////////////////\n // ## Tracking\n ////////////////\n\n /** Each mouse move while tracking: reached the sub-menu, aiming at it, or missed it. */\n private readonly onMove = (event: PointerEvent) => {\n if (event.pointerType !== MOUSE) return\n const subMenu = this.setup.subMenu()\n const row = this.setup.row()\n this.path = event.composedPath()\n if (!subMenu || !row) return this.stop()\n if (this.path.includes(subMenu)) return this.stop()\n this.restartResting()\n\n const now = performance.now()\n const here = { x: event.clientX, y: event.clientY }\n if (!this.last) {\n this.last = here\n this.lastCheck = now\n return\n }\n if (now - this.lastCheck < CHECK_EVERY_MS) return\n if (!this.target || this.target.top === this.target.bottom) this.target = this.measure()\n if (!this.target) return\n\n const delta = { x: here.x - this.last.x, y: here.y - this.last.y }\n const isAiming = SubMenuAim.isAiming(this.last, delta, this.target)\n this.last = here\n this.lastCheck = now\n // Over its own row there's nothing else to switch to\n if (isAiming || this.path.includes(row)) this.misses = 0\n else if (++this.misses >= MISSES_TO_GIVE_UP) this.giveUp()\n }\n\n /** The pointer has rested: over its row or nowhere new, keep waiting; anywhere else, give up. */\n private onRest() {\n const row = this.setup.row()\n if (row && this.path.includes(row)) return\n this.giveUp()\n }\n\n /** Stop tracking, and hand the menu what the pointer is over now, to switch to. */\n private giveUp() {\n const path = this.path\n this.stop()\n this.setup.onGiveUp(path)\n }\n\n /** Wait `RESTING_SECONDS` again from this move. */\n private restartResting() {\n this.resting?.cancel()\n const resting = E.after(RESTING_SECONDS, () => this.onRest())\n // A cancel rejects with an `AbortError`, which is expected; anything else is `onGiveUp`'s own throw\n resting.catch((error: unknown) => {\n if (!(error instanceof DOMException && error.name === \"AbortError\")) console.error(error)\n })\n this.resting = resting\n }\n\n /** The sub-menu's place beside its row, read from their boxes now; `undefined` while either is missing. */\n private measure(): AimTarget | undefined {\n const row = this.setup.row()\n const subMenu = this.setup.subMenu()\n if (!row || !subMenu) return undefined\n return SubMenuAim.targetFor(row.getBoundingClientRect(), subMenu.getBoundingClientRect())\n }\n\n /** Stops the move listener; `undefined` while not tracking. */\n private moves: AbortController | undefined\n\n /** The rest timer, restarted on every move. */\n private resting: ReturnType<typeof E.after> | undefined\n\n /** The sub-menu's place, measured at `start()`. */\n private target: AimTarget | undefined\n\n /** Where the pointer was at the last check. */\n private last: Point | undefined\n\n /** When the last check ran (`performance.now()`), for the one-a-frame limit. */\n private lastCheck = -Infinity\n\n /** Moves in a row that missed the sub-menu. */\n private misses = 0\n\n /** The last move's event path: what the pointer is over, deepest first. */\n private path: EventTarget[] = []\n}\n\n/** What a `SubMenuAim` reads and tells. */\nexport type SubMenuAimSetup = {\n /** The row whose sub-menu is open, if one is. */\n row: () => Element | undefined\n /** The open sub-menu's box, if one is open. */\n subMenu: () => Element | undefined\n /**\n * The pointer stopped aiming: switch to what it's over now.\n * - `path`: the last move's `composedPath()`, deepest first, so a row inside a shadow root is found too;\n * empty when no move came after `start()`.\n * - Tracking has stopped: showing a sub-menu again calls `start()` again.\n */\n onGiveUp: (path: EventTarget[]) => void\n}\n\n/** A point on the page, in client coordinates. */\nexport type Point = { x: number; y: number }\n\n/** Which side of its row a sub-menu opens on. */\nexport type AimSide = \"right\" | \"left\"\n\n/** A sub-menu's place: its side, the x of its edge facing the row, and its top and bottom. */\nexport type AimTarget = { side: AimSide; edge: number; top: number; bottom: number }\n\n/** `pointerType` of a mouse: the only pointer that hovers. */\nconst MOUSE = \"mouse\"\n\n/** How much wider than the sub-menu's corners a move may head, each way: React Aria's. */\nconst SLACK_DEGREES = 15\n\n/** Moves in a row that miss the sub-menu before the row under the pointer takes over: React Aria's. */\nconst MISSES_TO_GIVE_UP = 2\n\n/** At most one check this often (a frame at 60Hz): closer moves are too short for a direction. */\nconst CHECK_EVERY_MS = 16\n\n/**\n * How long the pointer may rest before the row under it takes over, in seconds.\n * - The article gives no number.\n * - 0.4s: long enough for a slow, careful move to pause on the way without losing the sub-menu,\n * short enough that resting on a new row feels like hovering it, half the page's hover delay (0.8s).\n */\nconst RESTING_SECONDS = 0.4\n","/**\n * The English vocabulary of `<ui-submenu>`: every name the tag uses.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - A row of a menu, as `<ui-item>` is (the same noun, `item`, so its menu owns it as one of its items),\n * that opens a FLY-OUT, a menu beside it.\n * - Its names are `<ui-item>`'s where they mean the same:\n * `label` (its words), `icon`, `disabled`, the `icon` slot, the `item`, `icon` and `title` parts.\n * - Its own:\n * - `menu`, the id of a menu elsewhere on the page to show as its fly-out\n * - `split`: its title chooses, as a plain item's does; only its chevron end opens the fly-out\n * (`value`, what the choice reports; its `label` by default)\n * - `flyout-label`, the fly-out's own name, and a split row's chevron tooltip\n * - the `chevron` and `flyout` parts\n * - the `open` state\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `submenuVocabulary`\n * The names of `<ui-submenu>`, a menu's row opening a fly-out beside it: its label, its icon and a chevron;\n * the fly-out holds the items written inside it, or the menu its `menu` names.\n ****************/\nexport const submenuVocabulary = {\n tag: \"ui-submenu\",\n icon: \"caret right\",\n // no snippet: a row only inside a menu, never offered on its own\n topics: [\"menus\", \"navigation\"],\n aka: [\"submenu\", \"flyout menu\", \"cascading menu\", \"nested menu\", \"menu item with submenu\"],\n skeleton: \"inline 8 x 2.5\",\n noun: \"item\",\n partOfSpeech: \"structure\",\n ui: false,\n description: \"A menu's row that opens another menu beside it: its fly-out.\",\n attributes: [\n {\n name: \"label\",\n group: \"name\",\n kind: \"string\",\n description:\n \"The row's words, its title. As `<ui-item>`'s `label`: an attribute, since what's written inside is the \" +\n \"fly-out's items.\"\n },\n {\n name: \"icon\",\n group: \"content\",\n kind: \"icon\",\n description:\n \"Icon name: where the menu's items show theirs (its icon column, or after the words in a vertical menu).\"\n },\n {\n name: \"menu\",\n group: \"content\",\n kind: \"string\",\n description:\n \"Id of a `<ui-menu>` elsewhere on the page to show as the fly-out, in place of the items inside. It stays \" +\n \"where it is, shown beside the row while open; write `popover` on it, so it's hidden until then.\"\n },\n {\n name: \"flyout-label\",\n group: \"name\",\n kind: \"string\",\n description:\n \"The fly-out's own name, when it isn't the row's `label`: its menu's name for a screen reader, and with \" +\n '`split` the chevron end\\'s tooltip (\"Pick one of the parts under the mouse\"). Default: its `label`.'\n },\n {\n name: \"value\",\n group: \"behaviour\",\n kind: \"string\",\n description:\n \"With `split`: what its menu's `ui-choosing` reports when its title is chosen. Default: its `label`.\"\n },\n {\n name: \"split\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description:\n \"Two things in one row: its title is a plain item, which a click, Enter or Space chooses (the menu's \" +\n \"`ui-choosing`, as any item's); its chevron end, set off by a faint line, opens the fly-out, by the \" +\n \"pointer, a click or the arrow key toward it.\"\n },\n { name: \"disabled\", group: \"states\", kind: \"keyOnly\", description: \"Can't be opened.\" }\n ],\n events: [],\n slots: [\n {\n name: \"\",\n description:\n \"The fly-out's items: `<ui-item>`s, dividers, headers, other `<ui-submenu>`s. No `<ui-menu>` needed.\"\n },\n { name: \"icon\", description: \"Replaces the `icon` shorthand's glyph.\" }\n ],\n parts: [\n { name: \"item\", description: \"The row: a `<button>`, `aria-haspopup=menu`.\" },\n { name: \"icon\", description: \"The row's icon box.\" },\n { name: \"title\", description: \"The row's label.\" },\n {\n name: \"chevron\",\n description: \"The chevron at the row's end, pointing to the fly-out; with `split`, what opens it.\"\n },\n {\n name: \"flyout\",\n description: \"The fly-out's box, beside the row in the top layer, around the menu of the items inside.\"\n }\n ],\n states: [\n { name: \"open\", description: \"Its fly-out is showing.\" },\n { name: \"split\", description: \"Its title chooses; its chevron end opens the fly-out (`split`).\" },\n { name: \"disabled\", description: \"Can't be opened.\" }\n ],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","import { Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\n// the family barrel, not the leaf:\n// the lib build then imports `ui-item.js` instead of splitting a shared chunk\n// (SIDE EFFECT: defines `<ui-item>`, which a submenu extends)\nimport { UIItem } from \"spell/ui/components/ui-item\"\nimport type { itemVocabulary } from \"spell/ui/components/ui-item/UIItem.en\"\nimport { SubMenuAim } from \"./SubMenuAim\"\nimport type { UIMenu } from \"./UIMenu\"\nimport { submenuVocabulary } from \"./UISubmenu.en\"\n\nimport submenuCSS from \"./UISubmenu.css?inline\"\n\n/**\n * `ui-choosing`, a menu's choice: the `<ui-menu>` it draws round its items is always English.\n * - Above the class: `@E.on(CHOOSING)` reads it while the class is defined.\n */\nconst CHOOSING = \"ui-choosing\"\n\n/**\n * The fly-out's box, while open: a raised panel beside the row, its top level with the row's, on its other side\n * when it doesn't fit, framing the menu inside (which draws no frame of its own: `UIMenu.isInPopup`).\n * - `position-anchor: auto`: the row, its implicit anchor (`showPopover({ source })`).\n * - Tokens, so a theme restyles it:\n * - `--ui-popup-background` (else `--ui-surface`), `--ui-border-color`, `--ui-menu-radius`, `--ui-shadow-raised`\n * - inside a popup, the popup's own background (it inherits its token)\n * - As wide as what it holds (so it turns to the other side rather than squeezing), at most the window's width less\n * a margin; at most its height, scrolling inside.\n * - `--ui-menu-margin: 0`: the menu inside sits flush in its frame.\n * - The popover's own look (`inset`, `margin`, `padding`, `border`, `background`) is replaced, and a named menu\n * (`display: contents`, as every menu) gets a box.\n * - Above the class: `elementSetup`'s sheet (`FLYOUT_SHEET`) reads it while the class is defined.\n */\nconst FLYOUT_STYLE: Readonly<Record<string, string>> = {\n display: \"block\",\n position: \"fixed\",\n \"position-anchor\": \"auto\",\n \"position-area\": \"inline-end span-block-end\",\n \"position-try-fallbacks\": \"flip-inline, flip-block, flip-block flip-inline\",\n inset: \"auto\",\n margin: \"calc(-0.25em - var(--ui-border-width, 1px)) 0\",\n padding: \"0.25em 0\",\n \"box-sizing\": \"border-box\",\n width: \"max-content\",\n \"max-height\": \"100%\",\n \"max-width\": \"calc(100vw - 1em)\",\n \"overflow-y\": \"auto\",\n \"overscroll-behavior\": \"contain\",\n color: \"var(--ui-text-color)\",\n background: \"var(--ui-popup-background, var(--ui-surface))\",\n border: \"var(--ui-border-width) solid var(--ui-border-color)\",\n \"border-radius\": \"var(--ui-menu-radius, var(--ui-radius))\",\n \"box-shadow\": \"var(--ui-shadow-raised)\",\n \"--ui-menu-margin\": \"0\"\n}\n\n/**\n * The box drawn round the items inside, while open: `FLYOUT_STYLE`, as a rule of its own sheet, never inline.\n * - So a page's `::part(flyout)` rules win over it (a page's rule beats a shadow root's own):\n * its background, blur, padding, min-width.\n * - Above the class: `elementSetup` reads it while the class is defined.\n */\nconst FLYOUT_SHEET = `@layer ui.components.submenu.types { .flyout:popover-open { ${Object.entries(FLYOUT_STYLE)\n .map(([name, value]) => `${name}: ${value};`)\n .join(\" \")} } }`\n\n/****************\n * ### `<ui-submenu>`\n * The component behind `<ui-submenu>`: a row of a menu that opens a FLY-OUT, another menu beside it.\n *\n * <button class=\"item\" part=\"item\" role=\"menuitem\" aria-haspopup=\"menu\" aria-expanded> (`UIItem`'s box)\n * <span class=\"icon\" part=\"icon\"> <svg> </span> (with an icon)\n * <span class=\"title\" part=\"title\"> Theme </span> (its `label`)\n * <span class=\"chevron\" part=\"chevron\"> <svg> </span>\n * </button>\n * <div class=\"flyout\" part=\"flyout\" popover=\"manual\"> (the items inside: its own menu)\n * <ui-menu direction=\"vertical\" [size] [ticks] [icon-column]> <slot> </ui-menu>\n * </div>\n *\n * - It IS a `<ui-item>` (it extends `UIItem`): its menu owns it as one of its items, so its row sits in the menu's\n * icon column, ticks gutter and roving focus as any item's.\n * - Its fly-out, EITHER:\n * - the items written inside it, in a `<ui-menu>` it draws round them, sized as its own menu and with its ticks\n * and icon column; so no `<ui-menu>` is written inside\n * - or the `<ui-menu>` its `menu` names, elsewhere on the page, shown where it is: a popover anchored to the row,\n * NOT moved, so the page's tree stays as it was written\n * - Either way the fly-out's menu is a fly-out (`UIMenu.isAFlyout`):\n * `role=\"menu\"`, its items `menuitem`s, arrow keys between them, no frame of its own.\n * - The fly-out's box is the frame: a popover in the top layer, placed beside the row by CSS anchor positioning\n * (`FLYOUT_STYLE`), turned to the other side at the window's edge.\n * - Its anchor is the implicit one its row sets as it shows it (`showPopover({ source })`), as `<ui-popup>`'s is:\n * a menu elsewhere on the page can't name an anchor inside this element's shadow root.\n * - `split`: its row is two things at once (Owen, epic `editor` P31, Q35 C2):\n * - its title, a plain item: a click, Enter or Space chooses it (its menu's `ui-choosing`), and closes the menu\n * - its chevron end, set off by a faint line: the pointer over it, a click on it, or the arrow key opens the fly-out\n * - a screen reader still hears a row with a menu (`aria-haspopup`), which Enter chooses\n * - Opening:\n * - the pointer over its row; `SubMenuAim` keeps it open while the pointer heads for it, across other rows\n * - a click, Enter or Space\n * - the arrow key toward the fly-out: →, ← in a right-to-left page, ↓ in a menu whose items run sideways\n * - By keyboard, focus goes to its first item.\n * - Only one open per menu: opening one closes the one open beside it (`openByOwner`).\n * - Closing:\n * - the arrow key away from it, or Escape (`UI.overlays`): focus back on the row\n * - Tab, a click outside, the pointer settling on another row of its menu\n * - the pointer leaving the fly-out for anywhere but its menu, after 0.3s\n * - choosing one of its items: every fly-out closes, and the choice goes on up as a choice in the menu\n * (the `ui-choosing` its menu sends, through the row; a named menu's is sent again from the row)\n * - its menu closing: its row loses its box (a popup round the menu hid),\n * so the fly-out goes too (a `ResizeObserver`)\n ****************/\nexport class UISubmenu extends UIItem {\n // its own names, and the item's it shares: TypeScript only knows the item's literals\n @E.proto static vocabulary = submenuVocabulary as unknown as typeof itemVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { item: UIItem.elementSetup.styleSheets.item, submenu: submenuCSS, \"submenu-flyout\": FLYOUT_SHEET },\n // NOT a part, unlike an item: the `<ui-menu>` it draws round its items stops climbing here,\n // so it's a menu of its own, not a sub-menu of the row's menu\n isAPart: false,\n // the item's own, restated: its setup is typed as its literal\n disabled: \"its own\",\n // `:state(split)`, as its attribute says\n cssStates: [\"split\"]\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## The row\n ////////////////\n\n /**\n * A click that opens its fly-out chooses nothing (`UIMenu`'s `ui-choosing`): anywhere on its row;\n * `split`, only on its chevron end, so a click on its title is a choice, as a plain item's.\n */\n opensAMenuOn(event: Event): boolean {\n return !this.split || this.isOnChevron(event)\n }\n\n /** `event` went through its chevron end: with `split`, what opens its fly-out. */\n private isOnChevron(event: Event): boolean {\n return !!this.chevron && event.composedPath().includes(this.chevron)\n }\n\n /** Its chevron end, once drawn. */\n private chevron: HTMLElement | undefined\n\n /** Always a button: something to press, in any menu. */\n get rootTag(): \"a\" | \"button\" | \"div\" {\n return \"button\"\n }\n\n /** Always an item, never a header or divider: its vocabulary has no `kind`. */\n get kind(): \"item\" {\n return UIT.ITEM\n }\n\n /** Its title: its `label`; what's written inside it is the fly-out's. */\n get titleText(): string {\n return this.label?.trim() ?? \"\"\n }\n\n /** What its menu's `ui-choosing` reports when its title is chosen (`split`): its `value`, else its label. */\n get value(): string {\n return this.attributes.value ?? this.titleText\n }\n\n /** It draws its label and chevron beside its icon, always. */\n protected get hasMoreThanItsIcon(): boolean {\n return true\n }\n\n /** No title box to fit: a `shrinkable` menu leaves the row as it is. */\n get hasTitleBox(): boolean {\n return false\n }\n\n protected get boxHasPopup(): \"menu\" {\n return \"menu\"\n }\n\n protected get boxExpanded(): \"true\" | \"false\" {\n return this.flyout.ariaExpanded\n }\n\n /** The chevron at the row's end. */\n readonly chevronGlyph = new E.IconGlyph({ owner: this, name: () => (this.itemContext ? CHEVRON_ICON : undefined) })\n\n /** The row's menu: the component its row asked for its item context. */\n get ownerMenu(): UIMenu | undefined {\n return this.context.ownerComponent<UIMenu>()\n }\n\n /** The row's menu's DOM element: where the one fly-out open at a time is kept. */\n private get ownerElement(): Element | undefined {\n return this.context.owner?.owner\n }\n\n ////////////////\n // ## The fly-out\n ////////////////\n\n /** Its fly-out is showing: `:state(open)`. */\n @E.cssState(\"open\")\n @E.state\n accessor isOpen = false\n\n /** How many have been made: each fly-out's `UI.overlays` pool is its own (`flyout`, below, reads it). */\n private static made = 0\n\n /**\n * The fly-out: its open state, a popover beside the row, and its `UI.overlays` entry while open.\n * - A pool of its own, each fly-out: a click outside them all closes every one open, and a popup round the menu.\n * - Escape closes it, focus back on the row; a click outside closes it.\n */\n readonly flyout = new E.PopoverPanel({\n component: this,\n member: \"isOpen\",\n restoreFocus: false,\n pool: `${FLYOUT_POOL}-${++UISubmenu.made}`,\n alsoInside: () => (this.namesAMenu ? this.namedMenu() : undefined),\n onDismiss: (reason) => this.close({ refocus: reason === \"escape\" })\n })\n\n /** Its fly-out is the menu its `menu` names, elsewhere on the page. */\n get namesAMenu(): boolean {\n return !!this.attributes.menu\n }\n\n /** The `<ui-menu>` its `menu` names, in its own tree, if it's there. */\n @E.untracked\n private namedMenu(): HTMLElement | undefined {\n const id = this.attributes.menu\n if (!id || !this.domElement.isConnected) return undefined\n return (this.domElement.getRootNode() as Document | ShadowRoot).getElementById?.(id) ?? undefined\n }\n\n /**\n * An item written inside it says whether it's on or off (`selected` or `active`, written, `\"false\"` too):\n * its fly-out ticks what's on, in a menu of its own without `ticks` too (the ☰ menu's View ›).\n * - Watches the items' attributes: one ticked later gets its gutter then.\n */\n @E.watches({ childList: true, subtree: true, attributes: true })\n get hasOnOrOffItems(): boolean {\n return [...this.domElement.children].some((child) => UISubmenu.isOnOrOff(child))\n }\n\n /** The box drawn round the items inside, while drawn. */\n private panel: HTMLElement | undefined\n\n /** The `<ui-menu>` drawn round the items inside, while drawn. */\n private innerMenu: HTMLElement | undefined\n\n /** The fly-out's box: the named menu, else the box drawn round the items inside. */\n @E.untracked\n private get flyoutBox(): HTMLElement | undefined {\n return this.namesAMenu ? this.namedMenu() : this.panel\n }\n\n /** The fly-out's menu: the named one's component, else the one drawn round the items inside. */\n @E.untracked\n private get flyoutMenu(): UIMenu | undefined {\n const element = this.namesAMenu ? this.namedMenu() : this.innerMenu\n return (element as E.DOMElement | undefined)?.component as UIMenu | undefined\n }\n\n /**\n * Drawn: its fly-out's menu becomes a fly-out (`role=\"menu\"`), and a named menu a hidden popover,\n * so it's ready before it first opens.\n */\n @E.onChange(\"isReady\", \"isConnected\")\n protected onReadyForFlyout(isReady: boolean, isConnected: boolean) {\n if (isReady && isConnected) E.afterSolidUpdate(() => this.prepareFlyout())\n }\n\n /** Make the fly-out's menu a fly-out, and a named menu a popover, hidden until shown; its box, if it's there. */\n @E.untracked\n private prepareFlyout(): HTMLElement | undefined {\n const box = this.flyoutBox\n if (box && this.namesAMenu && box.popover !== MANUAL) box.popover = MANUAL\n const menu = this.flyoutMenu\n if (menu && !menu.isAFlyout) menu.isAFlyout = true\n return box\n }\n\n /**\n * Open its fly-out, as a person would; the one open beside it in its menu closes.\n * - `byKeyboard`: focus goes to its first item.\n * - `pointer`: the pointer event that opened it, where `SubMenuAim` starts from.\n * - Nothing while disabled, or outside a menu.\n */\n @E.untracked\n open({ byKeyboard = false, pointer }: OpenedBy = {}): void {\n if (this.isDisabled || !this.itemContext) return\n const owner = this.ownerElement\n const other = owner && UISubmenu.openByOwner.get(owner)\n if (other && other !== this) other.close()\n this.focusesOnShow = byKeyboard\n this.openedAt = pointer\n if (this.isOpen) {\n if (byKeyboard) this.focusFlyout()\n return\n }\n this.flyout.open()\n }\n\n /** Close its fly-out; `refocus`: focus back on its row (Escape, the arrow key away). */\n @E.untracked\n close({ refocus = false }: { refocus?: boolean } = {}): void {\n if (this.isOpen) this.flyout.close()\n if (refocus) this.focusTarget?.focus()\n }\n\n /** Open by keyboard: its first item takes focus once it shows. */\n private focusesOnShow = false\n\n /** Where the pointer was as it opened on hover. */\n private openedAt: PointerEvent | undefined\n\n /**\n * SIDE EFFECT: while open, the fly-out shows beside the row, framed and placed (`FLYOUT_STYLE`),\n * with what follows it: the pointer on its menu, its keys, a named menu's choices, the row's box, the aim.\n * - The cleanup hides it and stops them all.\n */\n @E.onChange(\"isOpen\", \"isConnected\", \"isReady\")\n protected onOpenChanged(isOpen: boolean, isConnected: boolean, isReady: boolean) {\n if (!isOpen || !isConnected || !isReady) return\n const row = this.focusTarget\n const box = this.prepareFlyout()\n if (!row || !box) {\n if (!box) E.Warnings.warn(\"<ui-submenu>\", `no menu with id ${JSON.stringify(this.attributes.menu)} to show`)\n E.afterSolidUpdate(() => this.close())\n return\n }\n // the box drawn round the items inside is framed by its own sheet (`FLYOUT_SHEET`)\n const unframe = this.namesAMenu ? UISubmenu.frame(box) : undefined\n const hide = this.flyout.follow(box, true, row)\n // `HTMLElement`'s event map, for `pointerover`\n const owner = this.ownerElement as HTMLElement | undefined\n if (owner) UISubmenu.openByOwner.set(owner, this)\n\n const listeners = new AbortController()\n const { signal } = listeners\n owner?.addEventListener(\"pointerover\", this.onMenuPointerOver, { signal })\n box.addEventListener(\"keydown\", this.onFlyoutKey, { signal })\n box.addEventListener(\"pointerleave\", this.onFlyoutLeave, { signal })\n box.addEventListener(\"pointerenter\", this.onFlyoutEnter, { signal })\n if (this.namesAMenu) box.addEventListener(this.choosingEventOf(box), this.onNamedMenuChoosing, { signal })\n // its menu closing (a popup round it hid): the row has no box any more\n const rowWatch = new ResizeObserver(() => {\n if (!row.checkVisibility()) this.close()\n })\n rowWatch.observe(row)\n this.aim.start(this.openedAt)\n if (this.focusesOnShow) E.afterSolidUpdate(() => this.focusFlyout())\n\n return () => {\n this.leaving?.cancel()\n listeners.abort()\n rowWatch.disconnect()\n this.aim.stop()\n hide?.()\n unframe?.()\n if (owner && UISubmenu.openByOwner.get(owner) === this) UISubmenu.openByOwner.delete(owner)\n }\n }\n\n /**\n * Focus the fly-out's chosen item, else its first, once it can take it\n * (a menu that just became a fly-out draws again first).\n */\n private focusFlyout() {\n if (this.focusChosen()) return\n E.beforeNextPaint(() => this.focusChosen())\n }\n\n /**\n * Focus what the fly-out opens to; true when something in it took focus:\n * - its chosen item (`selected`, `active`), as a menu's tab stop is\n * - else the first thing in it that takes focus: an item, or rich content that knows its own chosen row --\n * a component with a `focusChosen()` (`<ui-theme-menu show=\"menu\">`'s, which its host calls as it opens)\n */\n @E.untracked\n private focusChosen(): boolean {\n const menu = this.flyoutMenu\n if (!menu) return false\n if (menu.focusChosenItem()) return true\n for (const child of this.flyoutChildren()) {\n const component = (child as E.DOMElement).component as (object & { focusChosen?: () => void }) | undefined\n if (component instanceof UIItem && component.kind === UIT.ITEM && !component.isDisabled) break\n if (typeof component?.focusChosen !== \"function\") continue\n component.focusChosen()\n if (child.matches(\":focus-within\")) return true\n }\n return menu.focusFirstItem()\n }\n\n /** What its fly-out holds: the named menu's children, else the items written inside it. */\n private flyoutChildren(): Element[] {\n return [...((this.namesAMenu ? this.namedMenu() : this.domElement)?.children ?? [])]\n }\n\n ////////////////\n // ## The pointer\n ////////////////\n\n /** Keeps the fly-out open while the pointer heads for it; hands over to the row it settles on. */\n private readonly aim = new SubMenuAim({\n row: () => this.focusTarget,\n subMenu: () => (this.isOpen ? this.flyoutBox : undefined),\n onGiveUp: (path) => this.giveUpTo(path)\n })\n\n /**\n * The pointer over its row: its fly-out opens, unless the one open beside it is being aimed at.\n * - `split`: only over its chevron end, so a click on its title isn't beaten by a fly-out sliding open.\n */\n @E.on(\"pointerover\")\n protected onPointerOver(event: PointerEvent) {\n if (event.pointerType !== MOUSE || this.isInFlyout(event) || this.isOpen) return\n if (this.split && !this.isOnChevron(event)) return\n const owner = this.ownerElement\n const other = owner && UISubmenu.openByOwner.get(owner)\n if (other && other !== this && !other.aim.wantsToSwitch(event)) return\n this.open({ pointer: event })\n }\n\n /**\n * While open, the pointer over its menu: over another row, the fly-out closes,\n * unless the pointer is heading for it (`SubMenuAim`).\n * - Another `<ui-submenu>`'s row opens its own, closing this one (its `onPointerOver()`, first).\n */\n @E.untracked\n private readonly onMenuPointerOver = (event: PointerEvent) => {\n if (event.pointerType !== MOUSE || event.composedPath().includes(this.domElement)) return\n if (this.aim.wantsToSwitch(event)) this.close()\n }\n\n /**\n * The pointer left the fly-out, for somewhere that isn't its menu: it closes, after `LEAVE_SECONDS`.\n * - Back onto its menu, the menu's rows decide (`onMenuPointerOver()`).\n * - Coming back in before then keeps it open (`onFlyoutEnter()`).\n */\n @E.untracked\n private readonly onFlyoutLeave = (event: PointerEvent) => {\n if (event.pointerType !== MOUSE) return\n const to = event.relatedTarget as Node | null\n const owner = this.ownerElement\n if (to && owner && (owner === to || owner.contains(to))) return\n this.leaving?.cancel()\n this.leaving = E.after(LEAVE_SECONDS, () => this.close())\n }\n\n /** The pointer came back into the fly-out: it stays open. */\n @E.untracked\n private readonly onFlyoutEnter = () => {\n this.leaving?.cancel()\n this.leaving = undefined\n }\n\n /** Closing the fly-out once the pointer has left it (`onFlyoutLeave()`). */\n private leaving?: E.CancelablePromise<unknown>\n\n /** The pointer stopped aiming at the fly-out: it closes, and a `<ui-submenu>` the pointer is over opens. */\n @E.untracked\n private giveUpTo(path: EventTarget[]) {\n this.close()\n const owner = this.ownerElement\n for (const target of path) {\n const component = (target as E.DOMElement).component\n if (component === this) return\n if (component instanceof UISubmenu && component.ownerElement === owner) return component.open()\n }\n }\n\n /** The event came from inside its own fly-out (the box drawn round its items is in its shadow root). */\n private isInFlyout(event: Event): boolean {\n return !!this.panel && event.composedPath().includes(this.panel)\n }\n\n ////////////////\n // ## Keys and clicks\n ////////////////\n\n /** A right-to-left page: ← opens, → closes. */\n @E.untracked\n private get isRightToLeft(): boolean {\n return this.domElement.matches(RIGHT_TO_LEFT)\n }\n\n /** The key that opens the fly-out from the row: the arrow toward it; ↓ in a menu whose items run sideways. */\n @E.untracked\n private get openKey(): UIT.Key {\n const menu = this.ownerMenu\n if (menu && !menu.isVertical && !menu.isAFlyout) return UIT.Key.arrowDown\n return this.isRightToLeft ? UIT.Key.arrowLeft : UIT.Key.arrowRight\n }\n\n /** The key that closes the fly-out from inside it: the arrow away from it. */\n @E.untracked\n private get closeKey(): UIT.Key {\n return this.isRightToLeft ? UIT.Key.arrowRight : UIT.Key.arrowLeft\n }\n\n /**\n * A click on its row (Enter and Space click it too): its fly-out opens; by keyboard, focus goes in.\n * - `split`: only a click on its chevron end; one on its title is its menu's choice (`opensAMenuOn()`).\n */\n @E.on(\"click\")\n protected onRowClick(event: MouseEvent) {\n if (this.isInFlyout(event) || !this.opensAMenuOn(event)) return\n this.open({ byKeyboard: event.detail === 0 })\n }\n\n /** The arrow toward the fly-out, on its row: it opens, focus on its first item. */\n @E.on(\"keydown\")\n protected onRowKey(event: KeyboardEvent) {\n if (this.isInFlyout(event) || event.key !== this.openKey) return\n event.preventDefault()\n event.stopPropagation()\n this.open({ byKeyboard: true })\n }\n\n /**\n * Keys inside the fly-out: the arrow away from it closes it, focus back on its row; Tab closes it.\n * - Stops there: an outer fly-out's own keys don't hear it.\n */\n @E.untracked\n private readonly onFlyoutKey = (event: KeyboardEvent) => {\n if (event.key === this.closeKey) {\n event.preventDefault()\n event.stopPropagation()\n this.close({ refocus: true })\n } else if (event.key === UIT.Key.tab) this.close()\n }\n\n /** An item of its fly-out was chosen (its menu's `ui-choosing`, through the row): every fly-out closes. */\n @E.on(CHOOSING)\n protected onChoosing() {\n this.close()\n }\n\n /**\n * An item of the named menu was chosen: the choice is the row's menu's, as the items inside would be.\n * - It goes on up from the row, not from where the named menu sits in the page:\n * sent again, the same detail; cancelling it cancels the menu's.\n */\n @E.untracked\n private readonly onNamedMenuChoosing = (event: Event) => {\n event.stopPropagation()\n const { cancelable, detail } = event as CustomEvent\n const again = new CustomEvent(event.type, { bubbles: true, composed: true, cancelable, detail })\n if (!this.domElement.dispatchEvent(again)) event.preventDefault()\n this.close()\n }\n\n /** The `ui-choosing` event's name on `menu`'s tag: a translated one's own (`<es-menu>`). */\n private choosingEventOf(menu: Element): string {\n const component = (menu as E.DOMElement).component as UIMenu | undefined\n return component?.elementDefinition.event(CHOOSING) ?? CHOOSING\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** Outside a menu: its items as they are. In one: its row, and the fly-out round the items inside. */\n render(): JSX.Element {\n return (\n <Show when={this.itemContext} fallback={<slot />}>\n {this.box()}\n <Show when={!this.namesAMenu && !isServer}>{this.flyoutPanel()}</Show>\n </Show>\n )\n }\n\n /** The row's label, then its chevron. */\n protected boxContent(): JSX.Element {\n return (\n <>\n <span class={TITLE} part={this.partForName(\"title\")}>\n {this.label}\n </span>\n <span\n ref={(element: HTMLElement) => (this.chevron = element)}\n class={CHEVRON}\n part={this.submenuPart(CHEVRON)}\n title={this.split ? (this.flyoutLabel ?? undefined) : undefined}\n aria-hidden=\"true\"\n >\n {this.chevronGlyph.svg}\n </span>\n </>\n )\n }\n\n /**\n * The box round the items inside, and the menu it draws them in: the row's menu's size and icon column;\n * ticks when the row's menu has them, or an item inside is on or off (`hasOnOrOffItems`).\n * - As wide as its widest item (`UISubmenu.css`), not a vertical menu's fixed width.\n */\n private flyoutPanel(): JSX.Element {\n const menu = () => this.ownerMenu\n return (\n <div\n ref={(element: HTMLElement) => (this.panel = element)}\n class={FLYOUT}\n part={this.submenuPart(FLYOUT)}\n popover=\"manual\"\n >\n <ui-menu\n ref={(element: HTMLElement) => (this.innerMenu = element)}\n direction=\"vertical\"\n size={menu()?.size}\n ticks={menu()?.ticks || this.hasOnOrOffItems ? \"\" : undefined}\n icon-column={menu()?.iconColumn ? \"\" : undefined}\n aria-label={this.flyoutLabel ?? this.label}\n >\n <slot />\n </ui-menu>\n </div>\n )\n }\n\n /** A part of its own, beyond the item's (TypeScript knows only the item's). */\n private submenuPart(name: typeof CHEVRON | typeof FLYOUT): string {\n return this.partForName(name as never)\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /** The `<ui-submenu>` whose fly-out is open, by its menu's DOM element: one at a time per menu. */\n private static readonly openByOwner = new Map<Element, UISubmenu>()\n\n /** Forget which fly-outs are open: for tests. */\n static reset(): void {\n UISubmenu.openByOwner.clear()\n }\n\n /**\n * `child` is an item that says whether it's on or off: its `selected` or `active` written, true or false.\n * - Its component's word (`UIItem.saysOnOrOff`, a translated tag's own names);\n * the English attributes before it has a component.\n */\n private static isOnOrOff(child: Element): boolean {\n const component = (child as E.DOMElement).component\n if (component instanceof UISubmenu) return false\n if (component instanceof UIItem) return component.saysOnOrOff\n return child.hasAttribute(UIT.SELECTED) || child.hasAttribute(UIT.ACTIVE)\n }\n\n /**\n * Frame and place a NAMED menu as a fly-out (`FLYOUT_STYLE`), inline; returns what puts its own style back.\n * - Inline, and only while open: a named menu is the page's element, and no sheet of this one reaches it.\n * - The box drawn round the items inside has the same rules in its sheet instead (`FLYOUT_SHEET`).\n * - STATIC: needs no instance, only the box.\n */\n private static frame(box: HTMLElement): () => void {\n const { style } = box\n const before = Object.keys(FLYOUT_STYLE).map((name) => [name, style.getPropertyValue(name)] as const)\n for (const [name, value] of Object.entries(FLYOUT_STYLE)) style.setProperty(name, value)\n return () => {\n for (const [name, value] of before) {\n if (value) style.setProperty(name, value)\n else style.removeProperty(name)\n }\n }\n }\n}\n/**\n * The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`):\n * the item's it shares, and its own `split`.\n */\nexport interface UISubmenu\n extends\n E.AttributeValues<typeof itemVocabulary>,\n Pick<E.AttributeValues<typeof submenuVocabulary>, \"split\" | \"flyoutLabel\"> {}\n\n/** How a fly-out was opened. */\ntype OpenedBy = {\n /** by a key: focus goes to its first item */\n byKeyboard?: boolean\n /** by the pointer over the row: where the aim starts */\n pointer?: PointerEvent\n}\n\n/** How long the pointer may be out of the fly-out, not on its menu, before it closes: a slip of the hand comes back. */\nconst LEAVE_SECONDS = 0.3\n\n/** `pointerType` of a mouse: the only pointer whose hover opens a fly-out (a touch taps the row). */\nconst MOUSE = \"mouse\"\n\n/** The popover kind of the fly-out's box: it opens and closes only as the row says. */\nconst MANUAL = \"manual\"\n\n/**\n * The `UI.overlays` pools of the fly-outs, one each: only the topmost entry of a pool hears an outside click,\n * so the fly-outs open inside each other, and a popup round the menu, all hear it.\n */\nconst FLYOUT_POOL = \"ui-submenu\"\n\n/** Selector of an element in a right-to-left page. */\nconst RIGHT_TO_LEFT = \":dir(rtl)\"\n\n/** The chevron's icon, turned round in a right-to-left page (`UISubmenu.css`). */\nconst CHEVRON_ICON = \"chevron right\"\n\n/** Class words and parts of the row's pieces and the fly-out's box. */\nconst TITLE = \"title\"\nconst CHEVRON = \"chevron\"\nconst FLYOUT = \"flyout\"\n","/**\n * The menu family: defines `<ui-menu>` and `<ui-submenu>`, and exports their components, `UIMenu` and `UISubmenu`.\n * - SIDE EFFECT: importing it defines the tags, and `<ui-item>` first (through `spell/ui/components/ui-item`:\n * menus hold generic items, and a submenu is one).\n * 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 * - `<ui-submenu>`: a menu's row that opens a fly-out beside it, the items inside it or a menu named by id.\n * - `SubMenuAim`: keeps an open sub-menu open while the pointer heads for it, for menus that open sub-menus beside\n * their rows on hover (`<ui-submenu>`, the editor's bar menus).\n */\n\nimport { UIMenu } from \"./UIMenu\"\nimport { UISubmenu } from \"./UISubmenu\"\nimport { SubMenuAim, type SubMenuAimSetup } from \"./SubMenuAim\"\n\nimport \"spell/ui/components/ui-item\"\n\nUIMenu.define()\nUISubmenu.define()\n\nexport { UIMenu, UISubmenu, SubMenuAim, type SubMenuAimSetup }\n"],"mappings":";;;;;;;AA+BA,IAAasJ,KAAiB;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,cAAc;CACd,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,GAAGtJ;IAAqB;IAAQ;IAAc;IAAU;GAAS;GAE1E,SAAS,CAAC;GACV,UAAU;IAAC,GAAAoI,EAAuB,QAAQ,MAASmB,MAAS,WAAW;IAAG;IAAQ;GAAY,CAAC,CAAC,KAAK,OAAU;IAC7G,MAAMA;IACN,OAAOA;GACT,EAAE;GACF,aACE;EAUJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aACE;EAEJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aACE;EAEJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ,CAAC,OAAO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