spell-ui 0.8.5 → 0.8.7
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 +14 -6
- package/README-frameworks.md +22 -12
- package/README-migrating.md +7 -6
- package/README-runtime.md +14 -13
- package/README-site.md +11 -11
- package/README-themes.md +38 -11
- package/README.md +61 -73
- package/dist/Dragging-CMZoLEWQ.js +169 -0
- package/dist/Dragging-CMZoLEWQ.js.map +1 -0
- package/dist/{MarkdownEngine-CbuT9Mjc.js → MarkdownEngine-CW1WGqNp.js} +122 -100
- package/dist/MarkdownEngine-CW1WGqNp.js.map +1 -0
- package/dist/{PrefStore-CeaTtjTz.js → PrefStore-Qv0e5y04.js} +22 -22
- package/dist/PrefStore-Qv0e5y04.js.map +1 -0
- package/dist/ScrollingRow-7n7Z-HIE.js +88 -0
- package/dist/ScrollingRow-7n7Z-HIE.js.map +1 -0
- package/dist/SitePages-CciwREek.js +51 -0
- package/dist/SitePages-CciwREek.js.map +1 -0
- package/dist/{SlottedItems-Ch0tzzlL.js → SlottedItems-Du3aJwG1.js} +22 -22
- package/dist/{SlottedItems-Ch0tzzlL.js.map → SlottedItems-Du3aJwG1.js.map} +1 -1
- package/dist/ThemeDraft-B7NPif4d.js +805 -0
- package/dist/ThemeDraft-B7NPif4d.js.map +1 -0
- package/dist/TreeMeasure-BVJeGb1L.js +42 -0
- package/dist/TreeMeasure-BVJeGb1L.js.map +1 -0
- package/dist/UIButton-DFEds67r.js +6 -0
- package/dist/UIButton-DFEds67r.js.map +1 -0
- package/dist/UIInput-BodVbUoQ.js +6 -0
- package/dist/UIInput-BodVbUoQ.js.map +1 -0
- package/dist/{UIKeys-DJF2TIKE.js → UIKeys-Rh_gUZjP.js} +10 -9
- package/dist/UIKeys-Rh_gUZjP.js.map +1 -0
- package/dist/UILabel-DgJUBzB_.js +6 -0
- package/dist/UILabel-DgJUBzB_.js.map +1 -0
- package/dist/UIMenu-zdcAtwTa.js +42 -0
- package/dist/UIMenu-zdcAtwTa.js.map +1 -0
- package/dist/{UIRuntime-BBuehGly.js → UIRuntime-KH309p5B.js} +398 -207
- package/dist/UIRuntime-KH309p5B.js.map +1 -0
- package/dist/_spell-element/DOMElement.d.ts +62 -5
- package/dist/_spell-element/MoveAndResize.d.ts +75 -0
- package/dist/_spell-element/UIComponent.d.ts +42 -0
- package/dist/_spell-element/elements.types.d.ts +47 -0
- package/dist/_spell-element/index.d.ts +1 -0
- package/dist/_spell-element/vocabulary.types.d.ts +34 -2
- package/dist/{runtime → _util}/Api.d.ts +14 -4
- package/dist/_util/Dragging.d.ts +148 -0
- package/dist/_util/ListSelection.d.ts +46 -0
- package/dist/{util → _util}/LoadOnce.d.ts +9 -1
- package/dist/_util/ReconnectingSocket.d.ts +51 -0
- package/dist/_util/diagram/DiagramColumns.d.ts +14 -0
- package/dist/_util/diagram/DiagramLayout.d.ts +119 -0
- package/dist/_util/diagram/DiagramSVG.d.ts +17 -0
- package/dist/_util/dom.d.ts +10 -0
- package/dist/_util/fetching.d.ts +92 -0
- package/dist/_util/measures/Dimension.d.ts +63 -0
- package/dist/_util/measures/MeasureSystem.d.ts +66 -0
- package/dist/_util/measures/dimensions.generated.d.ts +16 -0
- package/dist/_util/persist/ColorScheme.d.ts +6 -0
- package/dist/_util/persist/ServerPlace.d.ts +42 -0
- package/dist/_util/persist/WaitedOnPlace.d.ts +27 -0
- package/dist/_util/persist/persist.types.d.ts +21 -2
- package/dist/_util/timing.d.ts +10 -1
- package/dist/api.js +8 -7
- package/dist/api.js.map +1 -1
- package/dist/components/ComponentDefinitions.d.ts +29 -0
- package/dist/components/components.es.d.ts +13 -0
- package/dist/components/components.types.d.ts +113 -8
- 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.en.d.ts +5 -1
- 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-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 +8 -3
- package/dist/components/ui-button/UIButton.en.d.ts +9 -4
- package/dist/components/ui-button/UIButton.es.d.ts +6 -0
- package/dist/components/ui-button/UIButton.fallback.d.ts +8 -3
- package/dist/components/ui-button/UIButtons.d.ts +1 -0
- package/dist/components/ui-button/UIButtons.en.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 +6 -0
- package/dist/components/ui-calendar/UICalendar.en.d.ts +6 -0
- package/dist/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
- package/dist/components/ui-card/CardClicks.d.ts +40 -0
- package/dist/components/ui-card/UICard.d.ts +41 -0
- package/dist/components/ui-card/UICard.en.d.ts +49 -0
- package/dist/components/ui-card/UICard.es.d.ts +1 -0
- package/dist/components/ui-card/UICards.d.ts +31 -0
- package/dist/components/ui-card/UICards.en.d.ts +31 -0
- package/dist/components/ui-card/UICards.es.d.ts +8 -0
- package/dist/components/ui-checkbox/CheckControl.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.en.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.es.d.ts +1 -0
- package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.types.d.ts +5 -0
- package/dist/components/ui-checkbox/UIRadio.d.ts +8 -0
- package/dist/components/ui-checkbox/UIRadio.en.d.ts +6 -0
- package/dist/components/ui-code/UICode.en.d.ts +1 -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/PackHotSwap.d.ts +17 -1
- 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 +11 -0
- package/dist/components/ui-container/UIContainer.en.d.ts +7 -0
- package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
- package/dist/components/ui-diagram/UIDiagram.d.ts +268 -0
- package/dist/components/ui-diagram/UIDiagram.en.d.ts +106 -0
- package/dist/components/ui-diagram/UIDiagram.es.d.ts +37 -0
- package/dist/components/ui-diagram/UIDiagramNode.d.ts +98 -0
- package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +38 -0
- package/dist/components/ui-diagram/UIDiagramNode.es.d.ts +16 -0
- package/dist/components/ui-diagram/index.d.ts +8 -0
- package/dist/components/ui-dimension/UIDimension.d.ts +81 -0
- package/dist/components/ui-dimension/UIDimension.en.d.ts +54 -0
- package/dist/components/ui-dimension/UIDimension.es.d.ts +22 -0
- package/dist/components/ui-dimension/index.d.ts +2 -0
- package/dist/components/ui-dimmer/UIDimmer.d.ts +6 -1
- package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
- package/dist/components/ui-dimmer/UIDimmer.es.d.ts +1 -1
- package/dist/components/ui-divider/UIDivider.d.ts +2 -0
- package/dist/components/ui-divider/UIDivider.en.d.ts +2 -0
- package/dist/components/ui-divider/UIDivider.es.d.ts +1 -0
- package/dist/components/ui-dropdown/UIDropdown.d.ts +6 -0
- package/dist/components/ui-dropdown/UIDropdown.en.d.ts +6 -0
- package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -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 +4 -2
- package/dist/components/ui-example/UIExample.es.d.ts +3 -2
- 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/FormBinding.d.ts +13 -1
- package/dist/components/ui-form/FormFields.d.ts +4 -4
- package/dist/components/ui-form/UIField.d.ts +30 -3
- package/dist/components/ui-form/UIField.en.d.ts +9 -0
- package/dist/components/ui-form/UIField.es.d.ts +6 -0
- 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 +15 -0
- package/dist/components/ui-form/UIForm.en.d.ts +6 -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-form/index.d.ts +2 -1
- package/dist/components/ui-grid/UIColumn.d.ts +1 -0
- package/dist/components/ui-grid/UIColumn.en.d.ts +1 -0
- 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 +3 -2
- package/dist/components/ui-icon/UIIcon.en.d.ts +3 -2
- 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 +6 -0
- package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +6 -0
- package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
- package/dist/components/ui-image/UIImage.d.ts +34 -0
- package/dist/components/ui-image/UIImage.en.d.ts +23 -0
- package/dist/components/ui-image/UIImage.es.d.ts +2 -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/TextControl.d.ts +7 -0
- package/dist/components/ui-input/UIInput.d.ts +22 -3
- package/dist/components/ui-input/UIInput.en.d.ts +9 -2
- package/dist/components/ui-input/UIInput.es.d.ts +2 -0
- package/dist/components/ui-input/UIInput.fallback.d.ts +9 -2
- package/dist/components/ui-input/UITextarea.d.ts +20 -0
- package/dist/components/ui-input/UITextarea.en.d.ts +15 -0
- package/dist/components/ui-input/UITextarea.es.d.ts +4 -0
- package/dist/components/ui-item/UIItem.d.ts +27 -4
- package/dist/components/ui-item/UIItem.en.d.ts +5 -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/JsonChild.d.ts +30 -0
- package/dist/components/ui-json/UIJson.d.ts +128 -0
- package/dist/components/ui-json/UIJson.en.d.ts +71 -0
- package/dist/components/ui-json/UIJson.es.d.ts +12 -0
- package/dist/components/ui-json/index.d.ts +3 -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 +2 -0
- package/dist/components/ui-label/UILabel.en.d.ts +2 -0
- package/dist/components/ui-label/UILabel.es.d.ts +1 -0
- 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 +2 -0
- package/dist/components/ui-list/UIList.en.d.ts +2 -0
- package/dist/components/ui-list/UIList.es.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 +143 -0
- package/dist/components/ui-markdown/MarkdownEngine.d.ts +14 -2
- package/dist/components/ui-markdown/MarkdownFormats.d.ts +95 -0
- package/dist/components/ui-markdown/MarkdownSource.d.ts +57 -0
- package/dist/components/ui-markdown/UIMarkdown.d.ts +126 -6
- package/dist/components/ui-markdown/UIMarkdown.en.d.ts +111 -8
- package/dist/components/ui-markdown/UIMarkdown.es.d.ts +29 -1
- package/dist/components/ui-markdown/UIMarkdown.types.d.ts +26 -0
- package/dist/components/ui-menu/ScrollingRow.d.ts +79 -0
- package/dist/components/ui-menu/TitleFit.d.ts +3 -0
- package/dist/components/ui-menu/UIMenu.d.ts +97 -4
- package/dist/components/ui-menu/UIMenu.en.d.ts +50 -1
- package/dist/components/ui-menu/UIMenu.es.d.ts +4 -0
- package/dist/components/ui-message/UIMessage.d.ts +2 -0
- package/dist/components/ui-message/UIMessage.en.d.ts +2 -0
- package/dist/components/ui-message/UIMessage.es.d.ts +1 -0
- 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 +15 -0
- package/dist/components/ui-page/UIPage.en.d.ts +15 -0
- package/dist/components/ui-page/UIPage.es.d.ts +1 -0
- package/dist/components/ui-panel/UIPanel.d.ts +6 -0
- package/dist/components/ui-panel/UIPanel.en.d.ts +33 -20
- 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 +1 -0
- package/dist/components/ui-parts/UIAvatar.en.d.ts +1 -0
- 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 +3 -1
- package/dist/components/ui-parts/UIHeader.en.d.ts +3 -1
- 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 +15 -1
- 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 +30 -3
- package/dist/components/ui-popup/UIPopup.en.d.ts +7 -0
- package/dist/components/ui-popup/UIPopup.es.d.ts +1 -0
- package/dist/components/ui-progress/UIProgress.d.ts +2 -0
- package/dist/components/ui-progress/UIProgress.en.d.ts +2 -0
- package/dist/components/ui-progress/UIProgress.es.d.ts +1 -0
- package/dist/components/ui-property-editor/UIProperty.d.ts +132 -5
- package/dist/components/ui-property-editor/UIProperty.en.d.ts +11 -44
- package/dist/components/ui-property-editor/UIProperty.es.d.ts +4 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +38 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.es.d.ts +4 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +33 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +12 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +2 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.es.d.ts +9 -0
- package/dist/components/ui-property-editor/index.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 +1 -0
- package/dist/components/ui-rail/UIRail.en.d.ts +1 -0
- package/dist/components/ui-rating/UIRating.d.ts +6 -0
- package/dist/components/ui-rating/UIRating.en.d.ts +6 -0
- package/dist/components/ui-rating/UIRating.fallback.d.ts +6 -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.d.ts +18 -3
- package/dist/components/ui-root/UIRoot.en.d.ts +15 -0
- package/dist/components/ui-root/UIRoot.es.d.ts +1 -0
- package/dist/components/ui-search/UISearch.d.ts +48 -7
- package/dist/components/ui-search/UISearch.en.d.ts +13 -1
- package/dist/components/ui-search/UISearch.es.d.ts +1 -0
- package/dist/components/ui-search/UISearch.fallback.d.ts +13 -1
- package/dist/components/ui-section/UISection.d.ts +30 -1
- package/dist/components/ui-section/UISection.en.d.ts +10 -0
- package/dist/components/ui-section/UISection.es.d.ts +1 -0
- 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 +2 -0
- package/dist/components/ui-segment/UISegment.en.d.ts +2 -0
- package/dist/components/ui-segment/UISegment.es.d.ts +1 -0
- 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 +6 -0
- package/dist/components/ui-select/UISelect.en.d.ts +6 -0
- package/dist/components/ui-select/UISelect.fallback.d.ts +6 -0
- package/dist/components/ui-shape/UIShape.d.ts +23 -2
- package/dist/components/ui-shape/UIShape.en.d.ts +8 -0
- package/dist/components/ui-shape/UIShape.es.d.ts +1 -0
- package/dist/components/ui-shape/UISide.d.ts +4 -0
- package/dist/components/ui-shape/UISide.en.d.ts +4 -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 +209 -0
- package/dist/components/ui-sides/UISides.en.d.ts +122 -0
- package/dist/components/ui-sides/UISides.es.d.ts +30 -0
- package/dist/components/ui-sides/UISides.fallback.d.ts +134 -0
- package/dist/components/ui-sides/index.d.ts +2 -0
- package/dist/components/ui-site-nav/SitePages.d.ts +53 -0
- package/dist/components/ui-site-nav/UISiteNav.d.ts +207 -0
- package/dist/components/ui-site-nav/UISiteNav.en.d.ts +87 -0
- package/dist/components/ui-site-nav/UISiteNav.es.d.ts +29 -0
- package/dist/components/ui-site-nav/index.d.ts +1 -0
- package/dist/components/ui-site-tabs/UISiteTabs.d.ts +126 -0
- package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +49 -0
- package/dist/components/ui-site-tabs/UISiteTabs.es.d.ts +18 -0
- package/dist/components/ui-site-tabs/index.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.d.ts +7 -0
- package/dist/components/ui-slider/UISlider.en.d.ts +7 -0
- package/dist/components/ui-slider/UISlider.es.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.fallback.d.ts +7 -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 +175 -0
- package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +74 -0
- package/dist/components/ui-split-panel/UISplitPanel.es.d.ts +25 -0
- package/dist/components/ui-split-panel/index.d.ts +2 -0
- package/dist/components/ui-stack/UIStack.d.ts +31 -5
- package/dist/components/ui-stack/UIStack.en.d.ts +15 -3
- 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 +1 -0
- package/dist/components/ui-step/UISteps.en.d.ts +1 -0
- package/dist/components/ui-sticky/UISticky.d.ts +4 -0
- package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
- package/dist/components/ui-tab/UITab.d.ts +8 -0
- package/dist/components/ui-tab/UITab.en.d.ts +1 -0
- package/dist/components/ui-tab/UITabs.d.ts +107 -16
- package/dist/components/ui-tab/UITabs.en.d.ts +40 -1
- package/dist/components/ui-tab/UITabs.es.d.ts +4 -0
- package/dist/components/ui-table/TableEditing.d.ts +77 -0
- 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 +145 -5
- package/dist/components/ui-table/UITable.en.d.ts +19 -0
- package/dist/components/ui-table/UITable.es.d.ts +3 -0
- 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 +11 -0
- package/dist/components/ui-text/UILink.en.d.ts +4 -0
- package/dist/components/ui-text/UIText.d.ts +7 -0
- package/dist/components/ui-text/UIText.en.d.ts +7 -0
- package/dist/components/ui-text/UIText.es.d.ts +2 -0
- package/dist/components/ui-theme-editor/SavedTheme.d.ts +55 -43
- package/dist/components/ui-theme-editor/ThemeDraft.d.ts +15 -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 +157 -26
- package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +79 -6
- package/dist/components/ui-theme-editor/UIThemeEditor.es.d.ts +20 -2
- package/dist/components/ui-theme-editor/UIThemeEditor.types.d.ts +0 -2
- 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/HueDropdown.d.ts +47 -0
- package/dist/components/ui-theme-menu/ThemeMenu.d.ts +18 -7
- package/dist/components/ui-theme-menu/ThemePreference.d.ts +145 -36
- package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +118 -7
- package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +82 -2
- package/dist/components/ui-theme-menu/UIThemeMenu.es.d.ts +21 -1
- package/dist/components/ui-theme-menu/UIThemeMenu.types.d.ts +36 -8
- package/dist/components/ui-theme-menu/index.d.ts +2 -1
- 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 +13 -10
- package/dist/components/ui-toolbar/UIToolbar.en.d.ts +138 -84
- package/dist/components/ui-toolbar/UIToolbar.es.d.ts +2 -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 +162 -0
- package/dist/components/ui-tree/UITree.en.d.ts +88 -0
- package/dist/components/ui-tree/UITree.es.d.ts +35 -0
- package/dist/components/ui-tree/UITreeItem.d.ts +204 -0
- package/dist/components/ui-tree/UITreeItem.en.d.ts +142 -0
- package/dist/components/ui-tree/UITreeItem.es.d.ts +32 -0
- package/dist/components/ui-tree/index.d.ts +3 -0
- package/dist/components/ui-tree-diagram/TreeData.d.ts +3 -12
- package/dist/components/ui-tree-diagram/TreeLayout.d.ts +54 -21
- package/dist/components/ui-tree-diagram/TreeMeasure.d.ts +36 -0
- package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +152 -27
- package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +47 -7
- package/dist/components/ui-tree-diagram/UITreeDiagram.es.d.ts +12 -1
- package/dist/components/ui-tree-diagram/UITreeDiagram.types.d.ts +66 -21
- package/dist/components/ui-tree-diagram/UITreeNode.d.ts +148 -0
- package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +69 -0
- package/dist/components/ui-tree-diagram/UITreeNode.es.d.ts +21 -0
- package/dist/components/ui-tree-diagram/index.d.ts +4 -2
- 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-DmLzT-Bq.js → components.es-BOa_7gFF.js} +498 -109
- package/dist/components.es-BOa_7gFF.js.map +1 -0
- package/dist/core.d.ts +3 -1
- package/dist/core.js +1082 -511
- package/dist/core.js.map +1 -1
- package/dist/crisp-VfYZlTph.js +6 -0
- package/dist/{crisp-CoZRRDuQ.js.map → crisp-VfYZlTph.js.map} +1 -1
- package/dist/docs-components/index.d.ts +1 -0
- package/dist/docs-components/ui-docs-index/UIDocsIndex.d.ts +89 -0
- package/dist/docs-components/ui-docs-index/UIDocsIndex.en.d.ts +43 -0
- package/dist/docs-components/ui-docs-index/index.d.ts +2 -0
- package/dist/docs-components/ui-docs-nav/UIDocsNav.d.ts +54 -87
- package/dist/docs-components/ui-docs-nav/UIDocsNav.types.d.ts +2 -29
- package/dist/docs-components/ui-docs-search/SearchIndex.d.ts +8 -2
- package/dist/docs-components/ui-docs-search/UIDocsSearch.d.ts +10 -0
- package/dist/docs-components/ui-docs-search/UIDocsSearch.en.d.ts +5 -0
- package/dist/elements/AddressParameter.d.ts +87 -0
- package/dist/elements/DOMFormControl.d.ts +5 -0
- package/dist/elements/FormComponent.d.ts +32 -0
- package/dist/elements/LoadableBody.d.ts +6 -1
- package/dist/elements/LoadableComponent.d.ts +10 -1
- package/dist/elements/RootSettings.d.ts +43 -6
- package/dist/elements/SpellUISettings.d.ts +1 -0
- package/dist/elements/StickyWatch.d.ts +20 -0
- package/dist/elements/elements.types.d.ts +15 -0
- package/dist/elements/index.d.ts +2 -0
- package/dist/forms.js +93 -63
- package/dist/forms.js.map +1 -1
- package/dist/fruity-BRVlgJZd.js +6 -0
- package/dist/fruity-BRVlgJZd.js.map +1 -0
- package/dist/{fruity.theme-BJcMiPl1.js → fruity.theme-CbC7Jyvk.js} +2 -2
- package/dist/fruity.theme-CbC7Jyvk.js.map +1 -0
- package/dist/glass-x9tbbwVq.js +6 -0
- package/dist/glass-x9tbbwVq.js.map +1 -0
- package/dist/glass.theme-24wY2wH9.js +6 -0
- package/dist/glass.theme-24wY2wH9.js.map +1 -0
- package/dist/hot.js +536 -26
- package/dist/hot.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +91 -81
- package/dist/jsx.d.ts +21149 -10377
- package/dist/matrix-QY2gWbJ0.js +6 -0
- package/dist/{matrix-CqA59hiF.js.map → matrix-QY2gWbJ0.js.map} +1 -1
- package/dist/{matrix.theme-jqQZjcq3.js → matrix.theme-_8xtwhDq.js} +2 -2
- package/dist/matrix.theme-_8xtwhDq.js.map +1 -0
- package/dist/midnight-BxlTQSfw.js +6 -0
- package/dist/{midnight-BnoVOrhC.js.map → midnight-BxlTQSfw.js.map} +1 -1
- package/dist/mockup-83ELBuVr.js +6 -0
- package/dist/mockup-83ELBuVr.js.map +1 -0
- package/dist/mockup.theme-DmpBgGBl.js +6 -0
- package/dist/mockup.theme-DmpBgGBl.js.map +1 -0
- package/dist/paper-M61nUilz.js +6 -0
- package/dist/{paper-CynH8ZuT.js.map → paper-M61nUilz.js.map} +1 -1
- package/dist/persist.types-D2m6wD-S.js +9 -0
- package/dist/persist.types-D2m6wD-S.js.map +1 -0
- package/dist/pop-CxXfytjk.js +6 -0
- package/dist/{pop-D2i9V_rG.js.map → pop-CxXfytjk.js.map} +1 -1
- package/dist/runtime/DataTooltips.d.ts +75 -0
- package/dist/runtime/PropertyControls.d.ts +15 -1
- package/dist/runtime/Sources.d.ts +16 -4
- package/dist/runtime/Styles.d.ts +11 -0
- package/dist/runtime/Themes.d.ts +10 -4
- package/dist/runtime/UIRuntime.d.ts +4 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/runtime.types.d.ts +18 -85
- package/dist/spell-By5Y3jKP.js +6 -0
- package/dist/{spell-BFtLICm7.js.map → spell-By5Y3jKP.js.map} +1 -1
- package/dist/{spell.theme-B7AU7SQX.js → spell.theme-DxGj7qHx.js} +2 -2
- package/dist/spell.theme-DxGj7qHx.js.map +1 -0
- package/dist/styles/CodeThemeFile.d.ts +73 -0
- package/dist/styles/StyleGenerator.d.ts +6 -0
- package/dist/styles/styles.en.d.ts +141 -3
- package/dist/styles/styles.types.d.ts +2 -0
- package/dist/{styles.en-RLpYiO5_.js → styles.en-CUUxNwHo.js} +71 -14
- package/dist/styles.en-CUUxNwHo.js.map +1 -0
- package/dist/styles.js +13 -13
- package/dist/styles.js.map +1 -1
- package/dist/ui-accordion.js +54 -53
- package/dist/ui-accordion.js.map +1 -1
- package/dist/ui-action.js +20 -19
- package/dist/ui-action.js.map +1 -1
- package/dist/ui-ad.js +5 -4
- package/dist/ui-ad.js.map +1 -1
- package/dist/ui-breadcrumbs.js +15 -13
- package/dist/ui-breadcrumbs.js.map +1 -1
- package/dist/ui-button.js +132 -125
- package/dist/ui-button.js.map +1 -1
- package/dist/ui-calendar.js +208 -206
- package/dist/ui-calendar.js.map +1 -1
- package/dist/ui-card.js +260 -98
- package/dist/ui-card.js.map +1 -1
- package/dist/ui-checkbox.js +95 -81
- package/dist/ui-checkbox.js.map +1 -1
- package/dist/ui-code.js +25 -24
- package/dist/ui-code.js.map +1 -1
- package/dist/ui-comment.js +14 -12
- package/dist/ui-comment.js.map +1 -1
- package/dist/ui-components.js +7 -6
- package/dist/ui-components.js.map +1 -1
- package/dist/ui-container.js +24 -12
- package/dist/ui-container.js.map +1 -1
- package/dist/ui-diagram.js +1328 -0
- package/dist/ui-diagram.js.map +1 -0
- package/dist/ui-dimension.js +779 -0
- package/dist/ui-dimension.js.map +1 -0
- package/dist/ui-dimmer.js +36 -34
- package/dist/ui-dimmer.js.map +1 -1
- package/dist/ui-divider.js +7 -5
- package/dist/ui-divider.js.map +1 -1
- package/dist/ui-dropdown.js +107 -105
- package/dist/ui-dropdown.js.map +1 -1
- package/dist/ui-embed.js +36 -35
- package/dist/ui-embed.js.map +1 -1
- package/dist/ui-emoji.js +10 -9
- package/dist/ui-emoji.js.map +1 -1
- package/dist/ui-example.js +63 -61
- package/dist/ui-example.js.map +1 -1
- package/dist/ui-feed.js +12 -10
- package/dist/ui-feed.js.map +1 -1
- package/dist/ui-flag.js +10 -9
- package/dist/ui-flag.js.map +1 -1
- package/dist/ui-flyout.js +7 -6
- package/dist/ui-flyout.js.map +1 -1
- package/dist/ui-form.js +244 -162
- package/dist/ui-form.js.map +1 -1
- package/dist/ui-grid.js +21 -18
- package/dist/ui-grid.js.map +1 -1
- package/dist/ui-icon-picker.js +46 -44
- package/dist/ui-icon-picker.js.map +1 -1
- package/dist/ui-icon.js +17 -14
- package/dist/ui-icon.js.map +1 -1
- package/dist/ui-image.js +93 -55
- package/dist/ui-image.js.map +1 -1
- package/dist/ui-include.js +18 -17
- package/dist/ui-include.js.map +1 -1
- package/dist/ui-input.js +154 -112
- package/dist/ui-input.js.map +1 -1
- package/dist/ui-item.js +152 -102
- package/dist/ui-item.js.map +1 -1
- package/dist/ui-items.js +9 -8
- package/dist/ui-items.js.map +1 -1
- package/dist/ui-json.js +115 -0
- package/dist/ui-json.js.map +1 -0
- package/dist/ui-keys.js +1 -1
- package/dist/ui-label.js +18 -15
- package/dist/ui-label.js.map +1 -1
- package/dist/ui-list.js +7 -5
- package/dist/ui-list.js.map +1 -1
- package/dist/ui-loader.js +7 -6
- package/dist/ui-loader.js.map +1 -1
- package/dist/ui-markdown.js +975 -83
- package/dist/ui-markdown.js.map +1 -1
- package/dist/ui-menu.js +329 -196
- package/dist/ui-menu.js.map +1 -1
- package/dist/ui-message.js +20 -18
- package/dist/ui-message.js.map +1 -1
- package/dist/ui-modal.js +46 -45
- package/dist/ui-modal.js.map +1 -1
- package/dist/ui-nag.js +19 -18
- package/dist/ui-nag.js.map +1 -1
- package/dist/ui-page.js +8 -7
- package/dist/ui-page.js.map +1 -1
- package/dist/ui-panel.js +28 -17
- package/dist/ui-panel.js.map +1 -1
- package/dist/ui-parts.js +66 -52
- package/dist/ui-parts.js.map +1 -1
- package/dist/ui-placeholder.js +21 -16
- package/dist/ui-placeholder.js.map +1 -1
- package/dist/ui-popup.js +113 -84
- package/dist/ui-popup.js.map +1 -1
- package/dist/ui-progress.js +9 -7
- package/dist/ui-progress.js.map +1 -1
- package/dist/ui-property-editor.js +706 -203
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-quote.js +5 -4
- package/dist/ui-quote.js.map +1 -1
- package/dist/ui-rail.js +5 -4
- package/dist/ui-rail.js.map +1 -1
- package/dist/ui-rating.js +31 -29
- package/dist/ui-rating.js.map +1 -1
- package/dist/ui-reveal.js +7 -6
- package/dist/ui-reveal.js.map +1 -1
- package/dist/ui-root.js +324 -158
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-search.js +210 -168
- package/dist/ui-search.js.map +1 -1
- package/dist/ui-section.js +167 -130
- package/dist/ui-section.js.map +1 -1
- package/dist/ui-segment.js +15 -12
- package/dist/ui-segment.js.map +1 -1
- package/dist/ui-select.js +83 -81
- package/dist/ui-select.js.map +1 -1
- package/dist/ui-shape.js +86 -58
- package/dist/ui-shape.js.map +1 -1
- package/dist/ui-sidebar.js +59 -56
- package/dist/ui-sidebar.js.map +1 -1
- package/dist/ui-sides.js +325 -0
- package/dist/ui-sides.js.map +1 -0
- package/dist/ui-site-nav.js +329 -0
- package/dist/ui-site-nav.js.map +1 -0
- package/dist/ui-site-tabs.js +177 -0
- package/dist/ui-site-tabs.js.map +1 -0
- package/dist/ui-slider.js +84 -81
- package/dist/ui-slider.js.map +1 -1
- package/dist/ui-space.js +7 -6
- package/dist/ui-space.js.map +1 -1
- package/dist/ui-split-panel.js +298 -0
- package/dist/ui-split-panel.js.map +1 -0
- package/dist/ui-stack.js +47 -23
- package/dist/ui-stack.js.map +1 -1
- package/dist/ui-statistic.js +15 -13
- package/dist/ui-statistic.js.map +1 -1
- package/dist/ui-step.js +31 -29
- package/dist/ui-step.js.map +1 -1
- package/dist/ui-sticky.js +7 -6
- package/dist/ui-sticky.js.map +1 -1
- package/dist/ui-tab.js +230 -138
- package/dist/ui-tab.js.map +1 -1
- package/dist/ui-table.js +724 -162
- package/dist/ui-table.js.map +1 -1
- package/dist/ui-terms.js +12 -10
- package/dist/ui-terms.js.map +1 -1
- package/dist/ui-text.js +53 -28
- package/dist/ui-text.js.map +1 -1
- package/dist/ui-theme-editor.js +1018 -1545
- package/dist/ui-theme-editor.js.map +1 -1
- package/dist/ui-theme-menu-CuIjr8Ou.js +1493 -0
- package/dist/ui-theme-menu-CuIjr8Ou.js.map +1 -0
- package/dist/ui-toast.js +45 -44
- package/dist/ui-toast.js.map +1 -1
- package/dist/ui-toc.js +75 -74
- package/dist/ui-toc.js.map +1 -1
- package/dist/ui-toolbar.js +51 -73
- package/dist/ui-toolbar.js.map +1 -1
- package/dist/ui-transition.js +12 -11
- package/dist/ui-transition.js.map +1 -1
- package/dist/ui-tree-diagram.js +676 -197
- package/dist/ui-tree-diagram.js.map +1 -1
- package/dist/ui-tree.js +625 -0
- package/dist/ui-tree.js.map +1 -0
- package/dist/ui-video.js +13 -11
- package/dist/ui-video.js.map +1 -1
- package/dist/ui-visibility.js +26 -25
- package/dist/ui-visibility.js.map +1 -1
- package/dist/ui-zoom.js +79 -78
- package/dist/ui-zoom.js.map +1 -1
- package/dist/util/TopLayerTip.d.ts +28 -0
- package/dist/util/index.d.ts +5 -2
- package/dist/vocabulary/DefaultValues.d.ts +34 -0
- package/dist/vocabulary/SharedVocabulary.d.ts +4 -0
- package/dist/vocabulary/SharedVocabulary.es.d.ts +7 -0
- package/dist/vocabulary/ValueSets.d.ts +18 -0
- package/dist/vocabulary/Vocabulary.d.ts +1 -0
- package/dist/vocabulary/defaults.generated.d.ts +6 -0
- package/dist/vocabulary/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/MarkdownEngine-CbuT9Mjc.js.map +0 -1
- package/dist/PrefStore-CeaTtjTz.js.map +0 -1
- package/dist/UIButton-XkfGqgh6.js +0 -6
- package/dist/UIButton-XkfGqgh6.js.map +0 -1
- package/dist/UIInput-BUudZstW.js +0 -6
- package/dist/UIInput-BUudZstW.js.map +0 -1
- package/dist/UIKeys-DJF2TIKE.js.map +0 -1
- package/dist/UILabel-C1jy3Yl8.js +0 -6
- package/dist/UILabel-C1jy3Yl8.js.map +0 -1
- package/dist/UIMenu-Btd-8V3A.js +0 -42
- package/dist/UIMenu-Btd-8V3A.js.map +0 -1
- package/dist/UIRuntime-BBuehGly.js.map +0 -1
- package/dist/components.es-DmLzT-Bq.js.map +0 -1
- package/dist/crisp-CoZRRDuQ.js +0 -6
- package/dist/fruity-CQFYeRlh.js +0 -6
- package/dist/fruity-CQFYeRlh.js.map +0 -1
- package/dist/fruity.theme-BJcMiPl1.js.map +0 -1
- package/dist/glass-CAfW11kL.js +0 -6
- package/dist/glass-CAfW11kL.js.map +0 -1
- package/dist/glass.theme-DQcBbtCW.js +0 -6
- package/dist/glass.theme-DQcBbtCW.js.map +0 -1
- package/dist/matrix-CqA59hiF.js +0 -6
- package/dist/matrix.theme-jqQZjcq3.js.map +0 -1
- package/dist/midnight-BnoVOrhC.js +0 -6
- package/dist/paper-CynH8ZuT.js +0 -6
- package/dist/persist.types-CsZxS8TG.js +0 -9
- package/dist/persist.types-CsZxS8TG.js.map +0 -1
- package/dist/pop-D2i9V_rG.js +0 -6
- package/dist/spell-BFtLICm7.js +0 -6
- package/dist/spell.theme-B7AU7SQX.js.map +0 -1
- package/dist/styles.en-RLpYiO5_.js.map +0 -1
- package/dist/ui-theme-menu-DyKZygpV.js +0 -921
- package/dist/ui-theme-menu-DyKZygpV.js.map +0 -1
package/dist/ui-nag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-nag.js","names":["ref={(element) => this.root = element}","this","part={this.partForName(\"nag\")}","<div ref={(element) => this.root = element} class={this.rootClass} part={this.partForName(\"nag\")}>\n <slot />\n {this.closeButton.draw()}\n </div>","E.DOMElement","E.UIComponent","E.proto","E.protoMerged","E.cssState","E.state","E.untracked","E.onChange","E.on","E.Disclosure","E.CloseButton","E.after","_$getOwner","_$readShallow","_$setAttribute","__name","nagCSS","__publicField","__decorateElement","__decoratorMetadata","__decoratorStart","__name$1","__runInitializers","ToggleCommands","__privateAdd","nagVocabulary","storage","key","value","expires","cookie","store","expiry","EXPIRATION_SUFFIX","expiration","pair","COOKIE_SEPARATOR","name","rest","char","text","DEFAULT_PATH","options","path","domain","secure","sameSite","days","DAY","UINag_default","_tmpl$","_onCommand_dec","_appear_dec","_onConnectedChanged_dec","_dismissalStore_dec","_isHiddenByDismissal_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_isHiddenByDismissal","DOMElement","_UINag","UIComponent","proto","protoMerged","cssState","state","untracked","onChange","on","args","Disclosure","open","event","CloseButton","isServer","DEFAULT_STORAGE","DEFAULT_VALUE","DEFAULT_EXPIRES","samesite","isConnected","isReady","time","after","root","UI","SLIDE","reason","originalEvent","action","_self$","_el$","_el$2","ref","element","getOwner","insert","effect","readShallow","className","_p$","t","setAttribute","UINag"],"sources":["../src/components/ui-nag/UINag.en.ts","../src/components/ui-nag/DismissalStore.ts","../src/components/ui-nag/UINag.css?inline","../src/components/ui-nag/UINag.tsx","../src/components/ui-nag/index.ts"],"sourcesContent":["/**\n * Every name `<ui-nag>` uses: tag, attributes (kind + allowed values), events, slots, parts, states, texts.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-nag size=\"small\" bottom fixed inverted>` => `ui small bottom fixed inverted nag`.\n * - Persistence is opt-in: only a nag with a `key` reads or writes `storage`.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `<ui-nag>`\n * A nag: `<div class=\"ui ... nag\" part=\"nag\">` around the slot, with a close icon.\n ****************/\nexport const nagVocabulary = {\n tag: \"ui-nag\",\n topics: [\"notifications\", \"messages\", \"overlays\", \"modules\"],\n aka: [\"banner\", \"cookie notice\", \"announcement bar\", \"sticky banner\"],\n noun: \"nag\",\n description: \"A nag is a persistent message that stays until dismissed, and can remember the dismissal.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Text size, `mini` ... `massive`; `medium` is the default.\"\n },\n { name: \"color\", group: \"appearance\", kind: \"color\", description: \"Hue: a filled bar in that colour.\" },\n {\n name: \"inverted\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Light instead of dark; a coloured one takes its tint.\"\n },\n { name: \"fixed\", group: \"layout\", kind: \"keyOnly\", description: \"Fixed to the viewport edge, over the page.\" },\n {\n name: \"overlay\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Over the page content at its edge (absolute), instead of pushing it down.\"\n },\n { name: \"bottom\", group: \"appearance\", kind: \"keyOnly\", description: \"At the bottom edge instead of the top.\" },\n {\n name: \"closable\",\n group: \"behaviour\",\n kind: \"boolean\",\n default: true,\n description: 'Shows the close icon; `closable=\"false\"` for a nag only script (or `display-time`) closes.'\n },\n {\n name: \"key\",\n group: \"behaviour\",\n kind: \"string\",\n description: \"Remembers the dismissal under this name, in `storage`; without one nothing is stored.\"\n },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n default: \"dismiss\",\n description: \"What a dismissal stores; a stored `key` with another value doesn't count.\"\n },\n {\n name: \"storage\",\n group: \"behaviour\",\n kind: \"enum\",\n values: [\"local\", \"session\", \"cookie\"],\n default: \"cookie\",\n description: \"Where the dismissal is stored: `localStorage`, `sessionStorage` or a cookie (Fomantic's default).\"\n },\n {\n name: \"expires\",\n group: \"advanced\",\n kind: \"number\",\n default: 30,\n description: \"Days a dismissal lasts (`local` and `cookie`); `0` never expires.\"\n },\n {\n name: \"persistent\",\n group: \"advanced\",\n kind: \"boolean\",\n replaces: [\"persist\"],\n description: \"Shows even when dismissed before (stores nothing new either). Old name: `persist`.\"\n },\n {\n name: \"display-time\",\n group: \"behaviour\",\n kind: \"number\",\n description: \"Milliseconds before it hides itself (not a dismissal: nothing is stored); absent / `0`: stays.\"\n },\n { name: \"path\", group: \"advanced\", kind: \"string\", default: \"/\", description: \"Cookie `path`.\" },\n { name: \"domain\", group: \"advanced\", kind: \"string\", description: \"Cookie `domain`.\" },\n { name: \"secure\", group: \"advanced\", kind: \"boolean\", description: \"Cookie `secure`.\" },\n {\n name: \"samesite\",\n group: \"advanced\",\n kind: \"enum\",\n values: [\"lax\", \"strict\", \"none\"],\n property: \"sameSite\",\n description: \"Cookie `samesite`.\"\n }\n ],\n events: [\n { name: \"ui-opening\", detail: \"{}\", description: \"Shown, its entry animation finished (Fomantic's `onVisible`).\" },\n {\n name: \"ui-closing\",\n detail: \"{ reason: NagCloseReason, originalEvent?: Event }\",\n cancelable: true,\n description:\n \"About to close: the close icon (`close`), the display time (`timeout`) or `host.close()` (`dismiss`). \" +\n \"`preventDefault()` keeps it and stores nothing (Fomantic's `onHide` returning `false`).\"\n },\n {\n name: \"ui-closed\",\n detail: \"{ reason: NagCloseReason }\",\n description: \"Closed, its exit animation finished (Fomantic's `onHidden`); the host is `hidden` now.\"\n }\n ],\n slots: [{ name: \"\", description: 'The text; a `<span class=\"title\">` is set off in the title colour.' }],\n parts: [\n { name: \"nag\", description: \"The nag bar.\" },\n { name: \"close\", description: \"The close icon.\" }\n ],\n states: [{ name: \"dismissed\", description: \"Dismissed now or before (stored), so hidden.\" }],\n texts: [{ key: \"close\", text: \"Close\", description: \"Accessible name of the close icon.\" }]\n} as const satisfies E.ComponentVocabulary\n","import type { UIT } from \"spell/ui/core\"\n\n/****************\n * ### `DismissalStore`\n * Where a `<ui-nag>` remembers that it was dismissed (Fomantic's nag `storage`):\n * `localStorage`, `sessionStorage` or a cookie, holding `value` under `key`.\n * - Plain DOM, no Solid: `UINag` makes one per access, from its current attributes.\n * - EVERY access is guarded: storage can be missing (SSR), blocked or full.\n * - blocked: privacy settings throw a `SecurityError` on the mere `localStorage` getter\n * - a failed read counts as \"not dismissed\", a failed write is dropped:\n * the nag still renders and still closes, it just won't remember\n * - Expiry (`expires`, days; `0` never):\n * - a cookie: its own `expires`\n * - `localStorage`: a second item, `<key>ExpirationDate` (Fomantic's `expirationKey`), holding the UTC date,\n * checked (and the pair removed) on read\n * - `sessionStorage` ends with the tab anyway\n * - Cookies: Fomantic's RFC 6265 encoding; `path` (default `/`), `domain`, `secure`, `samesite`.\n * - NOT on `spell/util`'s `PrefStore`, on purpose:\n * its keys are the page author's, whole and with no store name (Fomantic's), and it keeps cookies too.\n ****************/\nexport class DismissalStore {\n /** Where. */\n readonly storage: UIT.NagStorage\n\n /** Item / cookie name. */\n readonly key: string\n\n /** What a dismissal stores. */\n readonly value: string\n\n /** Days a dismissal lasts; `0` for no expiry. */\n readonly expires: number\n\n /** Cookie options. */\n private readonly cookie: DismissalCookieOptions\n\n constructor({ storage, key, value, expires, cookie = {} }: DismissalStoreProps) {\n this.storage = storage\n this.key = key\n this.value = value\n this.expires = expires\n this.cookie = cookie\n }\n\n /**\n * Was it dismissed (and not expired)?\n * - `false` when the storage can't be read.\n * - Reads the storage on every access.\n */\n get isDismissed(): boolean {\n try {\n return this.read() === this.value\n } catch {\n return false\n }\n }\n\n /** Remember the dismissal; false when the storage refused. NEVER throws. */\n dismiss(): boolean {\n try {\n if (this.storage === \"cookie\") {\n this.writeCookie(this.value, this.expiryDate(this.expires))\n return true\n }\n const store = this.webStorage()\n if (!store) return false\n const expiry = this.expiryDate(this.expires)\n if (this.storage === \"local\" && expiry) store.setItem(this.key + EXPIRATION_SUFFIX, expiry)\n store.setItem(this.key, this.value)\n return true\n } catch {\n return false\n }\n }\n\n /** Forget the dismissal (Fomantic's `clear`). NEVER throws. */\n clear() {\n try {\n if (this.storage === \"cookie\") return this.writeCookie(\"\", this.expiryDate(-1))\n const store = this.webStorage()\n store?.removeItem(this.key)\n store?.removeItem(this.key + EXPIRATION_SUFFIX)\n } catch {\n // nothing stored that we could reach\n }\n }\n\n ////////////////\n // ## Reading\n ////////////////\n\n /** The stored value, `undefined` when absent or expired. MAY throw (blocked storage). */\n private read(): string | undefined {\n if (this.storage === \"cookie\") return this.readCookie()\n const store = this.webStorage()\n if (!store) return undefined\n if (this.storage === \"local\") {\n const expiration = store.getItem(this.key + EXPIRATION_SUFFIX)\n if (expiration && new Date(expiration) < new Date()) {\n store.removeItem(this.key)\n store.removeItem(this.key + EXPIRATION_SUFFIX)\n return undefined\n }\n }\n return store.getItem(this.key) ?? undefined\n }\n\n /** `localStorage` / `sessionStorage`, or `undefined` outside a browser. MAY throw (blocked storage). */\n private webStorage(): Storage | undefined {\n if (typeof window === \"undefined\") return undefined\n return this.storage === \"session\" ? window.sessionStorage : window.localStorage\n }\n\n /** The cookie's decoded value. MAY throw (a sandboxed document). */\n private readCookie(): string | undefined {\n if (typeof document === \"undefined\") return undefined\n for (const pair of document.cookie.split(COOKIE_SEPARATOR)) {\n const [name = \"\", ...rest] = pair.split(\"=\")\n if (name.replace(/(%[\\da-f]{2})+/gi, decodeURIComponent) === this.key) {\n return decodeURIComponent(rest.join(\"=\"))\n }\n }\n return undefined\n }\n\n ////////////////\n // ## Writing\n ////////////////\n\n /** Set the cookie to `value`, expiring at `expires` (a UTC date) or with the session. MAY throw. */\n private writeCookie(value: string, expires: string | undefined) {\n if (typeof document === \"undefined\") return\n // RFC 6265 encoding, as Fomantic's nag\n const name = encodeURIComponent(this.key)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`)\n const text = encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[B-D])/g, decodeURIComponent)\n const { path = DEFAULT_PATH, domain, secure, sameSite } = this.cookie\n const options = [\n expires && `expires=${expires}`,\n path && `path=${path}`,\n domain && `domain=${domain}`,\n secure && \"secure\",\n sameSite && `samesite=${sameSite}`\n ].filter(Boolean)\n document.cookie = [`${name}=${text}`, ...options].join(COOKIE_SEPARATOR)\n }\n\n /** UTC date `days` from now, or `undefined` for `0` (no expiry). */\n private expiryDate(days: number): string | undefined {\n if (!days || !Number.isFinite(days)) return undefined\n return new Date(Date.now() + days * DAY).toUTCString()\n }\n}\n\n/** Constructor props for `DismissalStore`. */\nexport type DismissalStoreProps = {\n /** where: `localStorage`, `sessionStorage` or a cookie */\n storage: UIT.NagStorage\n /** item / cookie name */\n key: string\n /** what a dismissal stores */\n value: string\n /** days; `0` for no expiry */\n expires: number\n /** cookie options; read only with `storage: \"cookie\"` */\n cookie?: DismissalCookieOptions\n}\n\n/** Cookie options of a `DismissalStore`. */\nexport type DismissalCookieOptions = {\n /** cookie path. Default: `/` */\n path?: string\n /** cookie domain; default the page's host */\n domain?: string\n /** HTTPS only */\n secure?: boolean\n /** `samesite` value, as written (`lax`, `strict`, `none`) */\n sameSite?: string\n}\n\n/** Suffix of the expiry item in `localStorage` (Fomantic's `expirationKey`). */\nconst EXPIRATION_SUFFIX = \"ExpirationDate\"\n\n/** Default cookie path. */\nconst DEFAULT_PATH = \"/\"\n\n/** Separator of `document.cookie`'s pairs, and of a cookie's options. */\nconst COOKIE_SEPARATOR = \"; \"\n\n/** ms in a day. */\nconst DAY = 864e5\n","/*\n * `<ui-nag>`: port of Fomantic's `nag.less` + `nag.variables`.\n * - Shadow markup contract (class grammar; a nag has no better element than `<div>`):\n * `<div class=\"ui [size] [color] [bottom] [fixed] [inverted] [overlay] nag\" part=\"nag\">`,\n * holding the default `<slot>` and, when `closable`,\n * `<button type=\"button\" class=\"close icon\" part=\"close\" aria-label=\"...\">svg`.\n * - The DOM element is `display: contents`: the root IS the bar,\n * so `fixed` / `overlay` position it against the viewport / the nearest positioned ancestor,\n * exactly as Fomantic's markup.\n * `hidden` on the DOM element hides it.\n * - Public tokens (`--ui-nag-*`, the theming surface) are NEVER declared here:\n * the token block reads each through a private alias, and every rule reads the alias:\n * `--_ui-nag-radius: var(--ui-nag-radius, var(--ui-radius))`.\n * So a value set on `:root`, an ancestor, the DOM element, `::part(nag)` or in the app stylesheet\n * reaches the bar (`notes/theming.md` \"Component tokens\").\n * - Colours by remap (`colors.css`): a hue fills the bar (`--ui-color`, text `--ui-color-on`).\n * `inverted` is light; a coloured inverted one takes the hue's tint (`--ui-color-background`, `--ui-color-text`).\n * - Sizes by `--ui-scale` (`sizes.css`); `huge` and `massive` tighten the line height, as Fomantic's.\n * - NOTE: deviations, for contrast (WCAG 1.4.3 / 1.4.11):\n * - Fomantic's `#909090` bar with dark text and a WHITE title (3.2:1) is a dark grey bar with light text here\n * - the close icon rests at 0.7 opacity, not 0.4\n * - NOTE: left out: the `.ui.nags` group (several nags stacked in one bar); `a.ui.nag` links (slot a link).\n */\n\n@layer ui.components.nag.types, ui.components.nag.content, ui.components.nag.variations, ui.components.nag.states;\n\n/*******************************\n Nag\n*******************************/\n\n@layer ui.components.nag.types {\n :host {\n display: contents;\n }\n\n /* Tokens: one private alias per `nag.variables` entry that still matters, from the global tokens. */\n .ui.nag {\n --_ui-nag-background: var(--ui-nag-background, oklch(0.42 0 0));\n --_ui-nag-color: var(--ui-nag-color, var(--ui-text-inverted-color));\n --_ui-nag-title-color: var(--ui-nag-title-color, oklch(1 0 0));\n --_ui-nag-close-color: var(--ui-nag-close-color, oklch(1 0 0));\n --_ui-nag-inverted-background: var(--ui-nag-inverted-background, var(--ui-surface-strong));\n --_ui-nag-inverted-color: var(--ui-nag-inverted-color, var(--ui-text-color));\n --_ui-nag-inverted-title-color: var(--ui-nag-inverted-title-color, var(--ui-text-muted));\n --_ui-nag-opacity: var(--ui-nag-opacity, 0.95);\n --_ui-nag-padding: var(--ui-nag-padding, 0.75em 1em);\n --_ui-nag-shadow: var(--ui-nag-shadow, 0 1px 2px 0 oklch(0 0 0 / 0.2));\n --_ui-nag-radius: var(--ui-nag-radius, var(--ui-radius));\n --_ui-nag-z-index: var(--ui-nag-z-index, 999);\n --_ui-nag-title-margin: var(--ui-nag-title-margin, 0 0.5em);\n --_ui-nag-close-right: var(--ui-nag-close-right, 1em);\n --_ui-nag-close-opacity: var(--ui-nag-close-opacity, 0.7);\n --_ui-nag-duration: var(--ui-nag-duration, var(--ui-duration-normal));\n --ui-animation-duration: var(--ui-duration-slower);\n position: relative;\n top: 0;\n left: 0;\n z-index: var(--_ui-nag-z-index);\n box-sizing: border-box;\n display: block;\n width: 100%;\n min-height: 0;\n margin: 0;\n padding: var(--_ui-nag-padding);\n border-radius: 0 0 var(--_ui-nag-radius) var(--_ui-nag-radius);\n background: var(--ui-color, var(--_ui-nag-background));\n box-shadow: var(--_ui-nag-shadow);\n color: var(--ui-color-on, var(--_ui-nag-color));\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n line-height: var(--ui-line-height);\n text-align: center;\n opacity: var(--_ui-nag-opacity);\n transition: background var(--_ui-nag-duration) var(--ui-ease);\n }\n /* Neither fixed nor over the page: rounded all round. */\n .ui.nag:not(.overlay, .fixed) {\n border-radius: var(--_ui-nag-radius);\n }\n}\n\n/*******************************\n Content\n*******************************/\n\n@layer ui.components.nag.content {\n /* Title: set off in its own colour. */\n .ui.nag > .title,\n .ui.nag ::slotted(.title) {\n display: inline-block;\n margin: var(--_ui-nag-title-margin);\n color: var(--ui-color-on, var(--_ui-nag-title-color));\n }\n\n /* Close icon: a bare button, vertically centred at the end. */\n .ui.nag > .close.icon {\n position: absolute;\n top: 50%;\n right: var(--_ui-nag-close-right);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.5em;\n height: 1.5em;\n margin: -0.75em 0 0;\n padding: 0.25em;\n border: 0;\n border-radius: var(--ui-radius-s);\n background: none;\n color: var(--ui-color-on, var(--_ui-nag-close-color));\n font: inherit;\n opacity: var(--_ui-nag-close-opacity);\n cursor: pointer;\n transition: opacity var(--_ui-nag-duration) var(--ui-ease);\n }\n .ui.nag > .close.icon > svg {\n width: 1em;\n height: 1em;\n }\n .ui.nag:has(> .close.icon) {\n padding-inline-end: calc(var(--_ui-nag-close-right) + 2em);\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.nag.variations {\n /* Overlay: over the page content at its edge. */\n .ui.overlay.nag {\n position: absolute;\n }\n\n /* Fixed: to the viewport edge. */\n .ui.fixed.nag {\n position: fixed;\n }\n\n /* Bottom. */\n .ui.bottom.nag {\n top: auto;\n bottom: 0;\n border-radius: var(--_ui-nag-radius) var(--_ui-nag-radius) 0 0;\n }\n .ui.bottom.nag:not(.overlay, .fixed) {\n border-radius: var(--_ui-nag-radius);\n }\n\n /* Inverted: light, with muted title and close icon. */\n .ui.inverted.nag {\n background: var(--ui-color-background, var(--_ui-nag-inverted-background));\n color: var(--ui-color-text, var(--_ui-nag-inverted-color));\n }\n .ui.inverted.nag > .title,\n .ui.inverted.nag ::slotted(.title),\n .ui.inverted.nag > .close.icon {\n color: var(--ui-color-text, var(--_ui-nag-inverted-title-color));\n }\n\n /* Big sizes: a tight line. */\n .ui.huge.nag,\n .ui.massive.nag {\n line-height: 1;\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.nag.states {\n .ui.nag:hover {\n opacity: 1;\n }\n .ui.nag > .close.icon:hover,\n .ui.nag > .close.icon:focus-visible {\n opacity: 1;\n }\n}\n","import { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { nagVocabulary } from \"./UINag.en\"\nimport { DismissalStore } from \"./DismissalStore\"\n\nimport nagCSS from \"./UINag.css?inline\"\n\n/****************\n * ### `DOMNagElement`\n * The DOM element of `<ui-nag>`: it adds the nag's script API,\n * `close()`, `show()`, `clear()` and `dismissed`, which its component does.\n *\n * - NOTE: `DOMElement` checks its members against the attributes' property names; none of these is one.\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMNagElement extends E.DOMElement<UINag> {\n /**\n * Dismiss it now, reason `dismiss` (the cancelable `ui-closing` first), storing the dismissal; true when it closes.\n */\n close(): boolean {\n return this.component?.close() ?? false\n }\n\n /** Show it again, unless a dismissal is stored (and it isn't `persistent`); true when it shows. */\n show(): boolean {\n return this.component?.show() ?? false\n }\n\n /** Forget a stored dismissal (Fomantic's `clear`). */\n clear() {\n this.component?.clearDismissal()\n }\n\n /** A dismissal is stored (and not expired); `false` without a `key`. */\n get dismissed(): boolean {\n return this.component?.isDismissed ?? false\n }\n}\n\n/****************\n * ### `UINag`\n * The component behind `<ui-nag>`: a bar at the top (or `bottom`) of the page or its container\n * that stays until dismissed, and can remember the dismissal.\n * Its shadow DOM: `<div class=\"ui … nag\" part=\"nag\">` around the slot, with a close icon.\n *\n * - Remembering (opt-in, with `key`): closing it from its icon (or `domElement.close()`)\n * stores `value` under `key` in `storage` (`DismissalStore`: local / session / cookie, `expires` days).\n * - A nag whose dismissal is stored is `hidden` from the start (set on the DOM element as it first connects,\n * before anything paints), unless it's `persistent`.\n * - Storage that is blocked or missing just doesn't remember: the nag still shows and closes.\n *\n * - Closing: the cancelable `ui-closing` (with a `reason`) first,\n * then the exit animation (Fomantic's `slide`), `hidden` on the DOM element, and `ui-closed`.\n * - It never removes itself.\n * - `display-time` hides it without storing anything.\n *\n * - Invoker commands (`UIT.ToggleCommands`):\n * - a `<button commandfor command=\"--show\">` shows it (`show()`)\n * - `--close` closes it (`close()`, so a `key` remembers it)\n * - `--toggle` picks by `hidden`\n *\n * - No role: a banner that must be announced gets `role` / `aria-live` from the page.\n * The close icon is a real `<button>` with a translated label.\n ****************/\nexport class UINag extends E.UIComponent<Vocabulary> {\n @E.proto static vocabulary = nagVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { nag: nagCSS },\n DOMElement: DOMNagElement\n } satisfies Partial<E.ElementSetup>\n\n constructor(...args: ConstructorParameters<typeof E.UIComponent>) {\n super(...args)\n // SIDE EFFECT: a stored dismissal hides the DOM element before it first paints\n if (!isServer && this.isHiddenByDismissal) this.domElement.hidden = true\n this.domElement.addReleaseCallback(() => this.displayTimer?.cancel())\n }\n\n ////////////////\n // ## Dismissal\n ////////////////\n\n /** Hidden because it was dismissed, now or before (stored): `:state(dismissed)`. */\n @E.cssState(\"dismissed\")\n @E.state\n accessor isHiddenByDismissal = this.isHiddenByStorage\n\n /** A dismissal is stored (and not expired). `false` without a `key`. */\n get isDismissed(): boolean {\n return this.dismissalStore?.isDismissed ?? false\n }\n\n /** Forget a stored dismissal. */\n clearDismissal() {\n this.dismissalStore?.clear()\n }\n\n /** A stored dismissal hides it: dismissed, and not `persistent`. */\n private get isHiddenByStorage(): boolean {\n return !this.persistent && this.isDismissed\n }\n\n /**\n * The dismissal store for the current attributes, or `undefined` without a `key`.\n * - A new one per read, untracked: nothing renders from it.\n */\n @E.untracked\n private get dismissalStore(): DismissalStore | undefined {\n const { key, value, storage, expires, path, domain, secure, samesite } = this\n if (!key) return undefined\n return new DismissalStore({\n storage: (storage ?? DEFAULT_STORAGE) as UIT.NagStorage,\n key,\n value: value ?? DEFAULT_VALUE,\n expires: expires ?? DEFAULT_EXPIRES,\n cookie: {\n path: path ?? undefined,\n domain: domain ?? undefined,\n secure: !!secure,\n sameSite: samesite ?? undefined\n }\n })\n }\n\n ////////////////\n // ## Showing\n ////////////////\n\n /** The nag bar. */\n private root?: HTMLDivElement\n\n /** Pending `display-time`. */\n private displayTimer?: E.CancelablePromise<unknown>\n\n /** Appeared (entry animation, `ui-opening`, timer) since it last showed. */\n private hasShown = false\n\n /**\n * Appear once connected (and not hidden), waiting for the runtime (`isReady`) too, as the render does:\n * appearing animates the rendered bar.\n * - The cleanup drops a pending `display-time`.\n */\n @E.onChange(\"isConnected\", \"isReady\")\n protected onConnectedChanged(isConnected: boolean, isReady: boolean) {\n if (isConnected && isReady) this.appear()\n return () => this.displayTimer?.cancel()\n }\n\n /** Entry animation, `ui-opening` and the display time -- once per showing. */\n @E.untracked\n private appear() {\n if (this.hasShown || this.domElement.hidden) return\n this.hasShown = true\n const time = this.displayTime ?? 0\n if (time > 0) this.displayTimer = E.after(time / 1000, () => this.close(\"timeout\"))\n const root = this.root\n const entered = root\n ? UI.transitions.animate({ element: root, name: SLIDE, direction: UIT.IN })\n : Promise.resolve(true)\n void entered.then(() => {\n if (!this.isClosing) this.send(\"ui-opening\", {})\n })\n }\n\n /** Show again, unless a stored dismissal says not (and it isn't `persistent`). True when it shows. */\n show(): boolean {\n if (this.isHiddenByStorage || this.isClosing || (!this.domElement.hidden && this.hasShown)) return false\n this.isHiddenByDismissal = false\n this.domElement.hidden = false\n this.appear()\n return true\n }\n\n ////////////////\n // ## Closing\n ////////////////\n\n /** Closing: no second close until it has hidden. */\n private isClosing = false\n\n /**\n * Shown until it closes: the cancelable `ui-closing` as it's asked to close, `ui-closed` once it has gone.\n * - Its `ui-opening` comes as it has slid in (`appear()`), not as a request: `show()` is the page's.\n */\n readonly disclosure = new E.Disclosure({\n component: this,\n kept: {\n isOpen: () => !this.isClosing && !this.domElement.hidden,\n setOpen: (open) => {\n if (!open) this.startClosing()\n }\n },\n detail: (_open, originalEvent): UIT.NagCloseDetail => ({ reason: this.closeReason, originalEvent }),\n afterDetail: (): UIT.NagCloseDetail => ({ reason: this.closeReason })\n })\n\n /** Why it was asked to close: `ui-closing`'s and `ui-closed`'s `reason`. */\n private closeReason: UIT.NagCloseReason = \"dismiss\"\n\n /**\n * Close for `reason`: the cancelable `ui-closing`, the dismissal stored (not for `timeout`),\n * then the exit animation, `hidden` on the DOM element and `ui-closed`. True when it closes.\n */\n close(reason: UIT.NagCloseReason = \"dismiss\", originalEvent?: Event): boolean {\n this.closeReason = reason\n return this.disclosure.close(originalEvent)\n }\n\n /** `ui-closing` wasn't cancelled: the dismissal stored, the exit animation, `hidden`, `ui-closed`. */\n private startClosing() {\n const reason = this.closeReason\n this.isClosing = true\n this.displayTimer?.cancel()\n if (reason !== \"timeout\") {\n this.dismissalStore?.dismiss()\n this.isHiddenByDismissal = true\n }\n const root = this.root\n const exited = root\n ? UI.transitions.animate({ element: root, name: SLIDE, direction: UIT.OUT })\n : Promise.resolve(true)\n void exited.then(() => {\n this.isClosing = false\n this.hasShown = false\n this.domElement.hidden = true\n this.disclosure.sendAfter(false)\n })\n }\n\n /** An invoker command aimed at the DOM element (`UIT.ToggleCommands`): open means not `hidden`. */\n @E.on(\"command\")\n protected onCommand(event: Event) {\n const action = UIT.ToggleCommands.action(event, !this.domElement.hidden)\n if (action === \"show\") this.show()\n else if (action === \"close\") this.close(\"dismiss\", event)\n }\n\n /** Close icon: dismiss (and remember). */\n private readonly onCloseIcon = (event: MouseEvent) => {\n event.stopPropagation()\n this.close(\"close\", event)\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** The close icon, while `closable`. */\n readonly closeButton = new E.CloseButton({\n owner: this,\n shows: () => !!this.closable,\n label: () => this.translationForKey(\"close\"),\n part: this.partForName(\"close\"),\n onClick: (event) => this.onCloseIcon(event)\n })\n\n render(): JSX.Element {\n return (\n <div ref={(element) => (this.root = element)} class={this.rootClass} part={this.partForName(\"nag\")}>\n <slot />\n {this.closeButton.draw()}\n </div>\n )\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UINag extends E.AttributeValues<Vocabulary> {}\n\n/** `UI.transitions` animation in and out (Fomantic's `slide`). */\nconst SLIDE = \"slide-down\"\n\n/** Storage of a nag that names none: Fomantic's default. */\nconst DEFAULT_STORAGE: UIT.NagStorage = \"cookie\"\n\n/** Value a dismissal stores by default. */\nconst DEFAULT_VALUE = \"dismiss\"\n\n/** Days a dismissal lasts by default. */\nconst DEFAULT_EXPIRES = 30\n\n/** The vocabulary type, for brevity. */\ntype Vocabulary = typeof nagVocabulary\n","/**\n * The nag family: defines `<ui-nag>` and exports its component, `UINag`, its DOM element, `DOMNagElement`,\n * and `DismissalStore`, where a nag remembers it was dismissed.\n * - SIDE EFFECT: importing it defines the tag.\n * - Also the library's `spell/ui/ui-nag` entry (its size is in `notes/report.md`).\n */\n\nimport { DOMNagElement, UINag } from \"./UINag\"\nimport { DismissalStore } from \"./DismissalStore\"\n\nUINag.define()\n\nexport { UINag, DOMNagElement, DismissalStore }\n"],"mappings":";;;;AAcA,IAAa6B,IAAgB;CAC3B,KAAK;CACL,QAAQ;EAAC;EAAiB;EAAY;EAAY;CAAS;CAC3D,KAAK;EAAC;EAAU;EAAiB;EAAoB;CAAe;CACpE,MAAM;CACN,aAAa;CACb,YAAY;EACV;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAS,OAAO;GAAc,MAAM;GAAS,aAAa;EAAqC;EACvG;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAS,OAAO;GAAU,MAAM;GAAW,aAAa;EAA6C;EAC7G;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAU,OAAO;GAAc,MAAM;GAAW,aAAa;EAAyC;EAC9G;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;IAAC;IAAS;IAAW;GAAQ;GACrC,SAAS;GACT,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,UAAU,CAAC,SAAS;GACpB,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAQ,OAAO;GAAY,MAAM;GAAU,SAAS;GAAK,aAAa;EAAiB;EAC/F;GAAE,MAAM;GAAU,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;AAxMO,IAAAqB,EAAAsC,CAAA,GAqBI,oBAAA,IAAA,QAAA,GAATxC,EAAAyC,GAAA,GAAS,uBAFTJ,GAnBWO,GAqBFF,CAAA,GAsBT1C,EAAAyC,GAAA,GAAY,kBADZL,GA1CWQ,CAAA,GA+EX5C,EAAAyC,GAAA,GAAU,sBADVN,GA9EWS,CAAA,GAsFX5C,EAAAyC,GAAA,GAAQ,UADRP,GArFWU,CAAA,GAuKX5C,EAAAyC,GAAA,GAAU,aADVR,GAtKWW,CAAA,GACF5C,EAAAyC,GAAA,IAAO,cAAhBF,GADWK,CAAA,GAEI5C,EAAAyC,GAAA,IAAO,gBAAtBH,GAFWM,CAAA,GAAN3C,EAAAwC,GAAMG,CAAA,GAAwC/C,EAAA+C,GAAA,OAAA,GAC1C7C,EADE6C,GACK,cAAaxC,EAApBqC,GAAA,IADEG,GACkBrC,CAAA,CAAA,GAApBH,EAAAqC,GAAA,IADEG,CAAA,GAEI7C,EAFJ6C,GAEW,gBAAexC,EAAtBqC,GAAA,IAFJG,GAE0B;CACnC,aAAa,EAAE,KAAK9C,EAAO;CAC3B,YAAY;AACd,CAAA,CAAA,GAHeM,EAAAqC,GAAA,IAFJG,CAAA;AAAN,IAAM0C,IAAN1C,GA8MDyB,IAAQ,cAGRV,IAAkC,UAGlCC,IAAgB,WAGhBC,IAAkB;;;AC9QxByB,EAAM,OAAO"}
|
|
1
|
+
{"version":3,"file":"ui-nag.js","names":["ref={(element) => this.root = element}","this","part={this.partForName(\"nag\")}","<div ref={(element) => this.root = element} class={this.rootClass} part={this.partForName(\"nag\")}>\n <slot />\n {this.closeButton.draw()}\n </div>","E.DOMElement","E.UIComponent","E.proto","E.protoMerged","E.cssState","E.state","E.untracked","E.onChange","E.on","E.Disclosure","E.CloseButton","E.after","_$getOwner","_$readShallow","_$setAttribute","__name","nagCSS","__name$1","__publicField","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","ToggleCommands","__decoratorStart","nagVocabulary","storage","key","value","expires","cookie","store","expiry","EXPIRATION_SUFFIX","expiration","pair","COOKIE_SEPARATOR","name","rest","char","text","DEFAULT_PATH","options","path","domain","secure","sameSite","days","DAY","UINag_default","_tmpl$","_onCommand_dec","_appear_dec","_onConnectedChanged_dec","_dismissalStore_dec","_isHiddenByDismissal_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_isHiddenByDismissal","DOMElement","_UINag","UIComponent","proto","protoMerged","cssState","state","untracked","onChange","on","args","Disclosure","open","event","CloseButton","isServer","DEFAULT_STORAGE","DEFAULT_VALUE","DEFAULT_EXPIRES","samesite","isConnected","isReady","time","after","root","UI","SLIDE","reason","originalEvent","action","_self$","_el$","_el$2","ref","element","getOwner","insert","effect","readShallow","className","_p$","t","setAttribute","UINag"],"sources":["../src/components/ui-nag/UINag.en.ts","../src/components/ui-nag/DismissalStore.ts","../src/components/ui-nag/UINag.css?inline","../src/components/ui-nag/UINag.tsx","../src/components/ui-nag/index.ts"],"sourcesContent":["/**\n * Every name `<ui-nag>` uses: tag, attributes (kind + allowed values), events, slots, parts, states, texts.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-nag size=\"small\" bottom fixed inverted>` => `ui small bottom fixed inverted nag`.\n * - Persistence is opt-in: only a nag with a `key` reads or writes `storage`.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `<ui-nag>`\n * A nag: `<div class=\"ui ... nag\" part=\"nag\">` around the slot, with a close icon.\n ****************/\nexport const nagVocabulary = {\n tag: \"ui-nag\",\n icon: \"bell outline\",\n topics: [\"notifications\", \"messages\", \"overlays\", \"modules\"],\n aka: [\"banner\", \"cookie notice\", \"announcement bar\", \"sticky banner\"],\n noun: \"nag\",\n description: \"A nag is a persistent message that stays until dismissed, and can remember the dismissal.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Text size, `mini` ... `massive`; `medium` is the default.\"\n },\n { name: \"color\", group: \"appearance\", kind: \"color\", description: \"Hue: a filled bar in that colour.\" },\n {\n name: \"inverted\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Light instead of dark; a coloured one takes its tint.\"\n },\n { name: \"fixed\", group: \"layout\", kind: \"keyOnly\", description: \"Fixed to the viewport edge, over the page.\" },\n {\n name: \"overlay\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Over the page content at its edge (absolute), instead of pushing it down.\"\n },\n { name: \"bottom\", group: \"appearance\", kind: \"keyOnly\", description: \"At the bottom edge instead of the top.\" },\n {\n name: \"closable\",\n group: \"behaviour\",\n kind: \"boolean\",\n default: true,\n description: 'Shows the close icon; `closable=\"false\"` for a nag only script (or `display-time`) closes.'\n },\n {\n name: \"key\",\n group: \"behaviour\",\n kind: \"string\",\n description: \"Remembers the dismissal under this name, in `storage`; without one nothing is stored.\"\n },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n default: \"dismiss\",\n description: \"What a dismissal stores; a stored `key` with another value doesn't count.\"\n },\n {\n name: \"storage\",\n group: \"behaviour\",\n kind: \"enum\",\n values: [\"local\", \"session\", \"cookie\"],\n default: \"cookie\",\n description: \"Where the dismissal is stored: `localStorage`, `sessionStorage` or a cookie (Fomantic's default).\"\n },\n {\n name: \"expires\",\n group: \"advanced\",\n kind: \"number\",\n default: 30,\n description: \"Days a dismissal lasts (`local` and `cookie`); `0` never expires.\"\n },\n {\n name: \"persistent\",\n group: \"advanced\",\n kind: \"boolean\",\n replaces: [\"persist\"],\n description: \"Shows even when dismissed before (stores nothing new either). Old name: `persist`.\"\n },\n {\n name: \"display-time\",\n group: \"behaviour\",\n kind: \"number\",\n description: \"Milliseconds before it hides itself (not a dismissal: nothing is stored); absent / `0`: stays.\"\n },\n { name: \"path\", group: \"advanced\", kind: \"string\", default: \"/\", description: \"Cookie `path`.\" },\n { name: \"domain\", group: \"advanced\", kind: \"string\", description: \"Cookie `domain`.\" },\n { name: \"secure\", group: \"advanced\", kind: \"boolean\", description: \"Cookie `secure`.\" },\n {\n name: \"samesite\",\n group: \"advanced\",\n kind: \"enum\",\n values: [\"lax\", \"strict\", \"none\"],\n property: \"sameSite\",\n description: \"Cookie `samesite`.\"\n }\n ],\n events: [\n { name: \"ui-opening\", detail: \"{}\", description: \"Shown, its entry animation finished (Fomantic's `onVisible`).\" },\n {\n name: \"ui-closing\",\n detail: \"{ reason: NagCloseReason, originalEvent?: Event }\",\n cancelable: true,\n description:\n \"About to close: the close icon (`close`), the display time (`timeout`) or `host.close()` (`dismiss`). \" +\n \"`preventDefault()` keeps it and stores nothing (Fomantic's `onHide` returning `false`).\"\n },\n {\n name: \"ui-closed\",\n detail: \"{ reason: NagCloseReason }\",\n description: \"Closed, its exit animation finished (Fomantic's `onHidden`); the host is `hidden` now.\"\n }\n ],\n slots: [{ name: \"\", description: 'The text; a `<span class=\"title\">` is set off in the title colour.' }],\n parts: [\n { name: \"nag\", description: \"The nag bar.\" },\n { name: \"close\", description: \"The close icon.\" }\n ],\n states: [{ name: \"dismissed\", description: \"Dismissed now or before (stored), so hidden.\" }],\n texts: [{ key: \"close\", text: \"Close\", description: \"Accessible name of the close icon.\" }]\n} as const satisfies E.ComponentVocabulary\n","import type { UIT } from \"spell/ui/core\"\n\n/****************\n * ### `DismissalStore`\n * Where a `<ui-nag>` remembers that it was dismissed (Fomantic's nag `storage`):\n * `localStorage`, `sessionStorage` or a cookie, holding `value` under `key`.\n * - Plain DOM, no Solid: `UINag` makes one per access, from its current attributes.\n * - EVERY access is guarded: storage can be missing (SSR), blocked or full.\n * - blocked: privacy settings throw a `SecurityError` on the mere `localStorage` getter\n * - a failed read counts as \"not dismissed\", a failed write is dropped:\n * the nag still renders and still closes, it just won't remember\n * - Expiry (`expires`, days; `0` never):\n * - a cookie: its own `expires`\n * - `localStorage`: a second item, `<key>ExpirationDate` (Fomantic's `expirationKey`), holding the UTC date,\n * checked (and the pair removed) on read\n * - `sessionStorage` ends with the tab anyway\n * - Cookies: Fomantic's RFC 6265 encoding; `path` (default `/`), `domain`, `secure`, `samesite`.\n * - NOT on `spell/util`'s `PrefStore`, on purpose:\n * its keys are the page author's, whole and with no store name (Fomantic's), and it keeps cookies too.\n ****************/\nexport class DismissalStore {\n /** Where. */\n readonly storage: UIT.NagStorage\n\n /** Item / cookie name. */\n readonly key: string\n\n /** What a dismissal stores. */\n readonly value: string\n\n /** Days a dismissal lasts; `0` for no expiry. */\n readonly expires: number\n\n /** Cookie options. */\n private readonly cookie: DismissalCookieOptions\n\n constructor({ storage, key, value, expires, cookie = {} }: DismissalStoreProps) {\n this.storage = storage\n this.key = key\n this.value = value\n this.expires = expires\n this.cookie = cookie\n }\n\n /**\n * Was it dismissed (and not expired)?\n * - `false` when the storage can't be read.\n * - Reads the storage on every access.\n */\n get isDismissed(): boolean {\n try {\n return this.read() === this.value\n } catch {\n return false\n }\n }\n\n /** Remember the dismissal; false when the storage refused. NEVER throws. */\n dismiss(): boolean {\n try {\n if (this.storage === \"cookie\") {\n this.writeCookie(this.value, this.expiryDate(this.expires))\n return true\n }\n const store = this.webStorage()\n if (!store) return false\n const expiry = this.expiryDate(this.expires)\n if (this.storage === \"local\" && expiry) store.setItem(this.key + EXPIRATION_SUFFIX, expiry)\n store.setItem(this.key, this.value)\n return true\n } catch {\n return false\n }\n }\n\n /** Forget the dismissal (Fomantic's `clear`). NEVER throws. */\n clear() {\n try {\n if (this.storage === \"cookie\") return this.writeCookie(\"\", this.expiryDate(-1))\n const store = this.webStorage()\n store?.removeItem(this.key)\n store?.removeItem(this.key + EXPIRATION_SUFFIX)\n } catch {\n // nothing stored that we could reach\n }\n }\n\n ////////////////\n // ## Reading\n ////////////////\n\n /** The stored value, `undefined` when absent or expired. MAY throw (blocked storage). */\n private read(): string | undefined {\n if (this.storage === \"cookie\") return this.readCookie()\n const store = this.webStorage()\n if (!store) return undefined\n if (this.storage === \"local\") {\n const expiration = store.getItem(this.key + EXPIRATION_SUFFIX)\n if (expiration && new Date(expiration) < new Date()) {\n store.removeItem(this.key)\n store.removeItem(this.key + EXPIRATION_SUFFIX)\n return undefined\n }\n }\n return store.getItem(this.key) ?? undefined\n }\n\n /** `localStorage` / `sessionStorage`, or `undefined` outside a browser. MAY throw (blocked storage). */\n private webStorage(): Storage | undefined {\n if (typeof window === \"undefined\") return undefined\n return this.storage === \"session\" ? window.sessionStorage : window.localStorage\n }\n\n /** The cookie's decoded value. MAY throw (a sandboxed document). */\n private readCookie(): string | undefined {\n if (typeof document === \"undefined\") return undefined\n for (const pair of document.cookie.split(COOKIE_SEPARATOR)) {\n const [name = \"\", ...rest] = pair.split(\"=\")\n if (name.replace(/(%[\\da-f]{2})+/gi, decodeURIComponent) === this.key) {\n return decodeURIComponent(rest.join(\"=\"))\n }\n }\n return undefined\n }\n\n ////////////////\n // ## Writing\n ////////////////\n\n /** Set the cookie to `value`, expiring at `expires` (a UTC date) or with the session. MAY throw. */\n private writeCookie(value: string, expires: string | undefined) {\n if (typeof document === \"undefined\") return\n // RFC 6265 encoding, as Fomantic's nag\n const name = encodeURIComponent(this.key)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`)\n const text = encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[B-D])/g, decodeURIComponent)\n const { path = DEFAULT_PATH, domain, secure, sameSite } = this.cookie\n const options = [\n expires && `expires=${expires}`,\n path && `path=${path}`,\n domain && `domain=${domain}`,\n secure && \"secure\",\n sameSite && `samesite=${sameSite}`\n ].filter(Boolean)\n document.cookie = [`${name}=${text}`, ...options].join(COOKIE_SEPARATOR)\n }\n\n /** UTC date `days` from now, or `undefined` for `0` (no expiry). */\n private expiryDate(days: number): string | undefined {\n if (!days || !Number.isFinite(days)) return undefined\n return new Date(Date.now() + days * DAY).toUTCString()\n }\n}\n\n/** Constructor props for `DismissalStore`. */\nexport type DismissalStoreProps = {\n /** where: `localStorage`, `sessionStorage` or a cookie */\n storage: UIT.NagStorage\n /** item / cookie name */\n key: string\n /** what a dismissal stores */\n value: string\n /** days; `0` for no expiry */\n expires: number\n /** cookie options; read only with `storage: \"cookie\"` */\n cookie?: DismissalCookieOptions\n}\n\n/** Cookie options of a `DismissalStore`. */\nexport type DismissalCookieOptions = {\n /** cookie path. Default: `/` */\n path?: string\n /** cookie domain; default the page's host */\n domain?: string\n /** HTTPS only */\n secure?: boolean\n /** `samesite` value, as written (`lax`, `strict`, `none`) */\n sameSite?: string\n}\n\n/** Suffix of the expiry item in `localStorage` (Fomantic's `expirationKey`). */\nconst EXPIRATION_SUFFIX = \"ExpirationDate\"\n\n/** Default cookie path. */\nconst DEFAULT_PATH = \"/\"\n\n/** Separator of `document.cookie`'s pairs, and of a cookie's options. */\nconst COOKIE_SEPARATOR = \"; \"\n\n/** ms in a day. */\nconst DAY = 864e5\n","/*\n * `<ui-nag>`: port of Fomantic's `nag.less` + `nag.variables`.\n * - Shadow markup contract (class grammar; a nag has no better element than `<div>`):\n * `<div class=\"ui [size] [color] [bottom] [fixed] [inverted] [overlay] nag\" part=\"nag\">`,\n * holding the default `<slot>` and, when `closable`,\n * `<button type=\"button\" class=\"close icon\" part=\"close\" aria-label=\"...\">svg`.\n * - The DOM element is `display: contents`: the root IS the bar,\n * so `fixed` / `overlay` position it against the viewport / the nearest positioned ancestor,\n * exactly as Fomantic's markup.\n * `hidden` on the DOM element hides it.\n * - Public tokens (`--ui-nag-*`, the theming surface) are NEVER declared here:\n * the token block reads each through a private alias, and every rule reads the alias:\n * `--_ui-nag-radius: var(--ui-nag-radius, var(--ui-radius))`.\n * So a value set on `:root`, an ancestor, the DOM element, `::part(nag)` or in the app stylesheet\n * reaches the bar (`notes/theming.md` \"Component tokens\").\n * - Colours by remap (`colors.css`): a hue fills the bar (`--ui-color`, text `--ui-color-on`).\n * `inverted` is light; a coloured inverted one takes the hue's tint (`--ui-color-background`, `--ui-color-text`).\n * - Sizes by `--ui-scale` (`sizes.css`); `huge` and `massive` tighten the line height, as Fomantic's.\n * - NOTE: deviations, for contrast (WCAG 1.4.3 / 1.4.11):\n * - Fomantic's `#909090` bar with dark text and a WHITE title (3.2:1) is a dark grey bar with light text here\n * - the close icon rests at 0.7 opacity, not 0.4\n * - NOTE: left out: the `.ui.nags` group (several nags stacked in one bar); `a.ui.nag` links (slot a link).\n */\n\n@layer ui.components.nag.types, ui.components.nag.content, ui.components.nag.variations, ui.components.nag.states;\n\n/*******************************\n Nag\n*******************************/\n\n@layer ui.components.nag.types {\n :host {\n display: contents;\n }\n\n /* Tokens: one private alias per `nag.variables` entry that still matters, from the global tokens. */\n .ui.nag {\n --_ui-nag-background: var(--ui-nag-background, oklch(0.42 0 0));\n --_ui-nag-color: var(--ui-nag-color, var(--ui-text-inverted-color));\n --_ui-nag-title-color: var(--ui-nag-title-color, oklch(1 0 0));\n --_ui-nag-close-color: var(--ui-nag-close-color, oklch(1 0 0));\n --_ui-nag-inverted-background: var(--ui-nag-inverted-background, var(--ui-surface-strong));\n --_ui-nag-inverted-color: var(--ui-nag-inverted-color, var(--ui-text-color));\n --_ui-nag-inverted-title-color: var(--ui-nag-inverted-title-color, var(--ui-text-muted));\n --_ui-nag-opacity: var(--ui-nag-opacity, 0.95);\n --_ui-nag-padding: var(--ui-nag-padding, 0.75em 1em);\n --_ui-nag-shadow: var(--ui-nag-shadow, 0 1px 2px 0 oklch(0 0 0 / 0.2));\n --_ui-nag-radius: var(--ui-nag-radius, var(--ui-radius));\n --_ui-nag-z-index: var(--ui-nag-z-index, 999);\n --_ui-nag-title-margin: var(--ui-nag-title-margin, 0 0.5em);\n --_ui-nag-close-right: var(--ui-nag-close-right, 1em);\n --_ui-nag-close-opacity: var(--ui-nag-close-opacity, 0.7);\n --_ui-nag-duration: var(--ui-nag-duration, var(--ui-duration-normal));\n --ui-animation-duration: var(--ui-duration-slower);\n position: relative;\n top: 0;\n left: 0;\n z-index: var(--_ui-nag-z-index);\n box-sizing: border-box;\n display: block;\n width: 100%;\n min-height: 0;\n margin: 0;\n padding: var(--_ui-nag-padding);\n border-radius: 0 0 var(--_ui-nag-radius) var(--_ui-nag-radius);\n background: var(--ui-color, var(--_ui-nag-background));\n box-shadow: var(--_ui-nag-shadow);\n color: var(--ui-color-on, var(--_ui-nag-color));\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n line-height: var(--ui-line-height);\n text-align: center;\n opacity: var(--_ui-nag-opacity);\n transition: background var(--_ui-nag-duration) var(--ui-ease);\n }\n /* Neither fixed nor over the page: rounded all round. */\n .ui.nag:not(.overlay, .fixed) {\n border-radius: var(--_ui-nag-radius);\n }\n}\n\n/*******************************\n Content\n*******************************/\n\n@layer ui.components.nag.content {\n /* Title: set off in its own colour. */\n .ui.nag > .title,\n .ui.nag ::slotted(.title) {\n display: inline-block;\n margin: var(--_ui-nag-title-margin);\n color: var(--ui-color-on, var(--_ui-nag-title-color));\n }\n\n /* Close icon: a bare button, vertically centred at the end. */\n .ui.nag > .close.icon {\n position: absolute;\n top: 50%;\n right: var(--_ui-nag-close-right);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.5em;\n height: 1.5em;\n margin: -0.75em 0 0;\n padding: 0.25em;\n border: 0;\n border-radius: var(--ui-radius-s);\n background: none;\n color: var(--ui-color-on, var(--_ui-nag-close-color));\n font: inherit;\n opacity: var(--_ui-nag-close-opacity);\n cursor: var(--ui-control-cursor);\n transition: opacity var(--_ui-nag-duration) var(--ui-ease);\n }\n .ui.nag > .close.icon > svg {\n width: 1em;\n height: 1em;\n }\n .ui.nag:has(> .close.icon) {\n padding-inline-end: calc(var(--_ui-nag-close-right) + 2em);\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.nag.variations {\n /* Overlay: over the page content at its edge. */\n .ui.overlay.nag {\n position: absolute;\n }\n\n /* Fixed: to the viewport edge. */\n .ui.fixed.nag {\n position: fixed;\n }\n\n /* Bottom. */\n .ui.bottom.nag {\n top: auto;\n bottom: 0;\n border-radius: var(--_ui-nag-radius) var(--_ui-nag-radius) 0 0;\n }\n .ui.bottom.nag:not(.overlay, .fixed) {\n border-radius: var(--_ui-nag-radius);\n }\n\n /* Inverted: light, with muted title and close icon. */\n .ui.inverted.nag {\n background: var(--ui-color-background, var(--_ui-nag-inverted-background));\n color: var(--ui-color-text, var(--_ui-nag-inverted-color));\n }\n .ui.inverted.nag > .title,\n .ui.inverted.nag ::slotted(.title),\n .ui.inverted.nag > .close.icon {\n color: var(--ui-color-text, var(--_ui-nag-inverted-title-color));\n }\n\n /* Big sizes: a tight line. */\n .ui.huge.nag,\n .ui.massive.nag {\n line-height: 1;\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.nag.states {\n .ui.nag:hover {\n opacity: 1;\n }\n .ui.nag > .close.icon:hover,\n .ui.nag > .close.icon:focus-visible {\n opacity: 1;\n }\n}\n","import { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { nagVocabulary } from \"./UINag.en\"\nimport { DismissalStore } from \"./DismissalStore\"\n\nimport nagCSS from \"./UINag.css?inline\"\n\n/****************\n * ### `DOMNagElement`\n * The DOM element of `<ui-nag>`: it adds the nag's script API,\n * `close()`, `show()`, `clear()` and `dismissed`, which its component does.\n *\n * - NOTE: `DOMElement` checks its members against the attributes' property names; none of these is one.\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMNagElement extends E.DOMElement<UINag> {\n /**\n * Dismiss it now, reason `dismiss` (the cancelable `ui-closing` first), storing the dismissal; true when it closes.\n */\n close(): boolean {\n return this.component?.close() ?? false\n }\n\n /** Show it again, unless a dismissal is stored (and it isn't `persistent`); true when it shows. */\n show(): boolean {\n return this.component?.show() ?? false\n }\n\n /** Forget a stored dismissal (Fomantic's `clear`). */\n clear() {\n this.component?.clearDismissal()\n }\n\n /** A dismissal is stored (and not expired); `false` without a `key`. */\n get dismissed(): boolean {\n return this.component?.isDismissed ?? false\n }\n}\n\n/****************\n * ### `UINag`\n * The component behind `<ui-nag>`: a bar at the top (or `bottom`) of the page or its container\n * that stays until dismissed, and can remember the dismissal.\n * Its shadow DOM: `<div class=\"ui … nag\" part=\"nag\">` around the slot, with a close icon.\n *\n * - Remembering (opt-in, with `key`): closing it from its icon (or `domElement.close()`)\n * stores `value` under `key` in `storage` (`DismissalStore`: local / session / cookie, `expires` days).\n * - A nag whose dismissal is stored is `hidden` from the start (set on the DOM element as it first connects,\n * before anything paints), unless it's `persistent`.\n * - Storage that is blocked or missing just doesn't remember: the nag still shows and closes.\n *\n * - Closing: the cancelable `ui-closing` (with a `reason`) first,\n * then the exit animation (Fomantic's `slide`), `hidden` on the DOM element, and `ui-closed`.\n * - It never removes itself.\n * - `display-time` hides it without storing anything.\n *\n * - Invoker commands (`UIT.ToggleCommands`):\n * - a `<button commandfor command=\"--show\">` shows it (`show()`)\n * - `--close` closes it (`close()`, so a `key` remembers it)\n * - `--toggle` picks by `hidden`\n *\n * - No role: a banner that must be announced gets `role` / `aria-live` from the page.\n * The close icon is a real `<button>` with a translated label.\n ****************/\nexport class UINag extends E.UIComponent<Vocabulary> {\n @E.proto static vocabulary = nagVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { nag: nagCSS },\n DOMElement: DOMNagElement\n } satisfies Partial<E.ElementSetup>\n\n constructor(...args: ConstructorParameters<typeof E.UIComponent>) {\n super(...args)\n // SIDE EFFECT: a stored dismissal hides the DOM element before it first paints\n if (!isServer && this.isHiddenByDismissal) this.domElement.hidden = true\n this.domElement.addReleaseCallback(() => this.displayTimer?.cancel())\n }\n\n ////////////////\n // ## Dismissal\n ////////////////\n\n /** Hidden because it was dismissed, now or before (stored): `:state(dismissed)`. */\n @E.cssState(\"dismissed\")\n @E.state\n accessor isHiddenByDismissal = this.isHiddenByStorage\n\n /** A dismissal is stored (and not expired). `false` without a `key`. */\n get isDismissed(): boolean {\n return this.dismissalStore?.isDismissed ?? false\n }\n\n /** Forget a stored dismissal. */\n clearDismissal() {\n this.dismissalStore?.clear()\n }\n\n /** A stored dismissal hides it: dismissed, and not `persistent`. */\n private get isHiddenByStorage(): boolean {\n return !this.persistent && this.isDismissed\n }\n\n /**\n * The dismissal store for the current attributes, or `undefined` without a `key`.\n * - A new one per read, untracked: nothing renders from it.\n */\n @E.untracked\n private get dismissalStore(): DismissalStore | undefined {\n const { key, value, storage, expires, path, domain, secure, samesite } = this\n if (!key) return undefined\n return new DismissalStore({\n storage: (storage ?? DEFAULT_STORAGE) as UIT.NagStorage,\n key,\n value: value ?? DEFAULT_VALUE,\n expires: expires ?? DEFAULT_EXPIRES,\n cookie: {\n path: path ?? undefined,\n domain: domain ?? undefined,\n secure: !!secure,\n sameSite: samesite ?? undefined\n }\n })\n }\n\n ////////////////\n // ## Showing\n ////////////////\n\n /** The nag bar. */\n private root?: HTMLDivElement\n\n /** Pending `display-time`. */\n private displayTimer?: E.CancelablePromise<unknown>\n\n /** Appeared (entry animation, `ui-opening`, timer) since it last showed. */\n private hasShown = false\n\n /**\n * Appear once connected (and not hidden), waiting for the runtime (`isReady`) too, as the render does:\n * appearing animates the rendered bar.\n * - The cleanup drops a pending `display-time`.\n */\n @E.onChange(\"isConnected\", \"isReady\")\n protected onConnectedChanged(isConnected: boolean, isReady: boolean) {\n if (isConnected && isReady) this.appear()\n return () => this.displayTimer?.cancel()\n }\n\n /** Entry animation, `ui-opening` and the display time -- once per showing. */\n @E.untracked\n private appear() {\n if (this.hasShown || this.domElement.hidden) return\n this.hasShown = true\n const time = this.displayTime ?? 0\n if (time > 0) this.displayTimer = E.after(time / 1000, () => this.close(\"timeout\"))\n const root = this.root\n const entered = root\n ? UI.transitions.animate({ element: root, name: SLIDE, direction: UIT.IN })\n : Promise.resolve(true)\n void entered.then(() => {\n if (!this.isClosing) this.send(\"ui-opening\", {})\n })\n }\n\n /** Show again, unless a stored dismissal says not (and it isn't `persistent`). True when it shows. */\n show(): boolean {\n if (this.isHiddenByStorage || this.isClosing || (!this.domElement.hidden && this.hasShown)) return false\n this.isHiddenByDismissal = false\n this.domElement.hidden = false\n this.appear()\n return true\n }\n\n ////////////////\n // ## Closing\n ////////////////\n\n /** Closing: no second close until it has hidden. */\n private isClosing = false\n\n /**\n * Shown until it closes: the cancelable `ui-closing` as it's asked to close, `ui-closed` once it has gone.\n * - Its `ui-opening` comes as it has slid in (`appear()`), not as a request: `show()` is the page's.\n */\n readonly disclosure = new E.Disclosure({\n component: this,\n kept: {\n isOpen: () => !this.isClosing && !this.domElement.hidden,\n setOpen: (open) => {\n if (!open) this.startClosing()\n }\n },\n detail: (_open, originalEvent): UIT.NagCloseDetail => ({ reason: this.closeReason, originalEvent }),\n afterDetail: (): UIT.NagCloseDetail => ({ reason: this.closeReason })\n })\n\n /** Why it was asked to close: `ui-closing`'s and `ui-closed`'s `reason`. */\n private closeReason: UIT.NagCloseReason = \"dismiss\"\n\n /**\n * Close for `reason`: the cancelable `ui-closing`, the dismissal stored (not for `timeout`),\n * then the exit animation, `hidden` on the DOM element and `ui-closed`. True when it closes.\n */\n close(reason: UIT.NagCloseReason = \"dismiss\", originalEvent?: Event): boolean {\n this.closeReason = reason\n return this.disclosure.close(originalEvent)\n }\n\n /** `ui-closing` wasn't cancelled: the dismissal stored, the exit animation, `hidden`, `ui-closed`. */\n private startClosing() {\n const reason = this.closeReason\n this.isClosing = true\n this.displayTimer?.cancel()\n if (reason !== \"timeout\") {\n this.dismissalStore?.dismiss()\n this.isHiddenByDismissal = true\n }\n const root = this.root\n const exited = root\n ? UI.transitions.animate({ element: root, name: SLIDE, direction: UIT.OUT })\n : Promise.resolve(true)\n void exited.then(() => {\n this.isClosing = false\n this.hasShown = false\n this.domElement.hidden = true\n this.disclosure.sendAfter(false)\n })\n }\n\n /** An invoker command aimed at the DOM element (`UIT.ToggleCommands`): open means not `hidden`. */\n @E.on(\"command\")\n protected onCommand(event: Event) {\n const action = UIT.ToggleCommands.action(event, !this.domElement.hidden)\n if (action === \"show\") this.show()\n else if (action === \"close\") this.close(\"dismiss\", event)\n }\n\n /** Close icon: dismiss (and remember). */\n private readonly onCloseIcon = (event: MouseEvent) => {\n event.stopPropagation()\n this.close(\"close\", event)\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** The close icon, while `closable`. */\n readonly closeButton = new E.CloseButton({\n owner: this,\n shows: () => !!this.closable,\n label: () => this.translationForKey(\"close\"),\n part: this.partForName(\"close\"),\n onClick: (event) => this.onCloseIcon(event)\n })\n\n render(): JSX.Element {\n return (\n <div ref={(element) => (this.root = element)} class={this.rootClass} part={this.partForName(\"nag\")}>\n <slot />\n {this.closeButton.draw()}\n </div>\n )\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UINag extends E.AttributeValues<Vocabulary> {}\n\n/** `UI.transitions` animation in and out (Fomantic's `slide`). */\nconst SLIDE = \"slide-down\"\n\n/** Storage of a nag that names none: Fomantic's default. */\nconst DEFAULT_STORAGE: UIT.NagStorage = \"cookie\"\n\n/** Value a dismissal stores by default. */\nconst DEFAULT_VALUE = \"dismiss\"\n\n/** Days a dismissal lasts by default. */\nconst DEFAULT_EXPIRES = 30\n\n/** The vocabulary type, for brevity. */\ntype Vocabulary = typeof nagVocabulary\n","/**\n * The nag family: defines `<ui-nag>` and exports its component, `UINag`, its DOM element, `DOMNagElement`,\n * and `DismissalStore`, where a nag remembers it was dismissed.\n * - SIDE EFFECT: importing it defines the tag.\n * - Also the library's `spell/ui/ui-nag` entry (its size is in `notes/report.md`).\n */\n\nimport { DOMNagElement, UINag } from \"./UINag\"\nimport { DismissalStore } from \"./DismissalStore\"\n\nUINag.define()\n\nexport { UINag, DOMNagElement, DismissalStore }\n"],"mappings":";;;;AAcA,IAAa6B,IAAgB;CAC3B,KAAK;CACL,MAAM;CACN,QAAQ;EAAC;EAAiB;EAAY;EAAY;CAAS;CAC3D,KAAK;EAAC;EAAU;EAAiB;EAAoB;CAAe;CACpE,MAAM;CACN,aAAa;CACb,YAAY;EACV;GACE,MAAM;GACN,OAAO;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wC,GAAA,IAAO,cAAhBF,GADWK,CAAA,GAEI3C,EAAAwC,GAAA,IAAO,gBAAtBH,GAFWM,CAAA,GAAN1C,EAAAuC,GAAMG,CAAA,GAAwC/C,EAAA+C,GAAA,OAAA,GAC1C5C,EADE4C,GACK,cAAazC,EAApBsC,GAAA,IADEG,GACkBrC,CAAA,CAAA,GAApBJ,EAAAsC,GAAA,IADEG,CAAA,GAEI5C,EAFJ4C,GAEW,gBAAezC,EAAtBsC,GAAA,IAFJG,GAE0B;CACnC,aAAa,EAAE,KAAK9C,EAAO;CAC3B,YAAY;AACd,CAAA,CAAA,GAHeK,EAAAsC,GAAA,IAFJG,CAAA;AAAN,IAAM0C,IAAN1C,GA8MDyB,IAAQ,cAGRV,IAAkC,UAGlCC,IAAgB,WAGhBC,IAAkB;;;AC9QxByB,EAAM,OAAO"}
|
package/dist/ui-page.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "./rolldown-runtime-CYGlBXrH.js";
|
|
2
|
-
import { Bt as e,
|
|
2
|
+
import { Bt as e, Ht as t, Lt as n, Rt as r, SlotContent as i, UI as a, Ut as o, Warnings as s, proto as c, protoMerged as l, whileConnected as u, zt as d } from "./core.js";
|
|
3
3
|
import { UIRoot as f, t as p } from "./ui-root.js";
|
|
4
4
|
import { Show as m } from "solid-js";
|
|
5
5
|
import { claimElement as h, className as g, createComponent as _, delegateEvents as v, effect as y, getOwner as b, insert as x, isServer as S, memo as C, readShallow as w, ref as T, setAttribute as E, style as D, template as O } from "@solidjs/web";
|
|
6
6
|
//#region src/components/ui-page/UIPage.en.ts
|
|
7
7
|
var k = {
|
|
8
8
|
tag: "ui-page",
|
|
9
|
+
icon: "file outline",
|
|
9
10
|
topics: [
|
|
10
11
|
"layout",
|
|
11
12
|
"containers",
|
|
@@ -85,9 +86,9 @@ var k = {
|
|
|
85
86
|
slots: k.slots,
|
|
86
87
|
parts: [...p.parts, ...k.parts],
|
|
87
88
|
texts: [...p.texts, ...k.texts]
|
|
88
|
-
}, j = "@layer ui.components.page.types{:host{min-block-size:var(--ui-page-min-height,100dvh);background:var(--ui-background);color:var(--ui-text-color);display:block;container-type:inline-size}:host(:not(:state(light),:state(dark))){color-scheme:light dark}.ui.page{--_ui-page-gap:var(--ui-page-gap,var(--ui-space-l));--_ui-page-padding:var(--ui-page-padding,var(--ui-space-l));--_ui-page-nav-width:var(--ui-page-nav-width,16em);--_ui-page-aside-width:var(--ui-page-aside-width,16em);--_ui-page-max-width:var(--ui-page-max-width,none);box-sizing:border-box;gap:var(--_ui-page-gap);min-block-size:var(--ui-page-min-height,100dvh);max-inline-size:var(--_ui-page-max-width);padding:var(--_ui-page-padding);grid-template:\"header header header\"\"nav main aside\"1fr\"footer footer footer\"/auto minmax(0,1fr) auto;margin-inline:auto;display:grid;position:relative}.ui.page>header{grid-area:header}.ui.page>nav{inline-size:var(--_ui-page-nav-width);grid-area:nav}.ui.page>main{grid-area:main;min-inline-size:0}.ui.page>main:focus{outline:none}.ui.page>aside{inline-size:var(--_ui-page-aside-width);grid-area:aside}.ui.page>footer{grid-area:footer}.skip:not(:focus-visible){clip-path:inset(50%);white-space:nowrap;block-size:1px;inline-size:1px;position:absolute;overflow:hidden}.skip{z-index:var(--ui-z-sticky,10);padding:var(--ui-space-xs) var(--ui-space-s);border-radius:var(--ui-radius);background:var(--ui-surface);color:var(--ui-link);box-shadow:var(--ui-shadow-floating);position:absolute;inset-block-start:var(--ui-space-xs);inset-inline-start:var(--ui-space-xs)}@container (width<768px){.ui.page{grid-template:\"header\"\"nav\"\"main\"1fr\"aside\"\"footer\"/minmax(0,1fr)}.ui.page>:is(nav,aside){inline-size:auto}}}", M = "@layer ui.components.page.types{body:has(>ui-page){margin:0}}", N = /* @__PURE__ */ O("<header><slot>"), P = /* @__PURE__ */ O("<nav><slot>"), F = /* @__PURE__ */ O("<aside><slot>"), I = /* @__PURE__ */ O("<footer><slot>"), L = /* @__PURE__ */ O("<div><a href=#></a><!><main tabindex=-1><slot></slot></main><!><!>"), R, z, B, V, H, U = class _UIPage extends (V = f, B = [
|
|
89
|
+
}, j = "@layer ui.components.page.types{:host{min-block-size:var(--ui-page-min-height,100dvh);background:var(--ui-background);color:var(--ui-text-color);display:block;container-type:inline-size}:host(:not(:state(light),:state(dark))){color-scheme:light dark}.ui.page{--_ui-page-gap:var(--ui-page-gap,var(--ui-space-l));--_ui-page-padding:var(--ui-page-padding,var(--ui-space-l));--_ui-page-nav-width:var(--ui-page-nav-width,16em);--_ui-page-aside-width:var(--ui-page-aside-width,16em);--_ui-page-max-width:var(--ui-page-max-width,none);box-sizing:border-box;gap:var(--_ui-page-gap);min-block-size:var(--ui-page-min-height,100dvh);max-inline-size:var(--_ui-page-max-width);padding:var(--_ui-page-padding);grid-template:\"header header header\"\"nav main aside\"1fr\"footer footer footer\"/auto minmax(0,1fr) auto;margin-inline:auto;display:grid;position:relative}.ui.page>header{grid-area:header}.ui.page>nav{inline-size:var(--_ui-page-nav-width);grid-area:nav}.ui.page>main{grid-area:main;min-inline-size:0}.ui.page>main:focus{outline:none}.ui.page>aside{inline-size:var(--_ui-page-aside-width);grid-area:aside}.ui.page>footer{grid-area:footer}.skip:not(:focus-visible){clip-path:inset(50%);white-space:nowrap;block-size:1px;inline-size:1px;position:absolute;overflow:hidden}.skip{z-index:var(--ui-z-sticky,10);padding:var(--ui-space-xs) var(--ui-space-s);border-radius:var(--ui-radius);background:var(--ui-surface);color:var(--ui-link);box-shadow:var(--ui-shadow-floating);position:absolute;inset-block-start:var(--ui-space-xs);inset-inline-start:var(--ui-space-xs)}@container (width<768px){.ui.page{grid-template:\"header\"\"nav\"\"main\"1fr\"aside\"\"footer\"/minmax(0,1fr)}.ui.page>:is(nav,aside){inline-size:auto}}}", M = "@layer ui.components.page.types{body:has(>ui-page){margin:0}}", N = /* @__PURE__ */ O("<header><slot>"), P = /* @__PURE__ */ O("<nav><slot>"), F = /* @__PURE__ */ O("<aside><slot>"), I = /* @__PURE__ */ O("<footer><slot>"), L = /* @__PURE__ */ O("<div><a href=#></a><!><main tabindex=-1><slot></slot></main><!><!>"), R, z, B, V, H, U = class _UIPage extends (V = f, B = [c], z = [l], R = [u], V) {
|
|
89
90
|
constructor() {
|
|
90
|
-
super(...arguments),
|
|
91
|
+
super(...arguments), o(H, 5, this), t(this, "slots", new i(this.domElement)), t(this, "main");
|
|
91
92
|
}
|
|
92
93
|
has(e) {
|
|
93
94
|
return this.slots.hasContent(this.slotForName(e));
|
|
@@ -166,18 +167,18 @@ var k = {
|
|
|
166
167
|
}
|
|
167
168
|
watchPage() {
|
|
168
169
|
if (S) return;
|
|
169
|
-
|
|
170
|
+
a.load().then(() => a.styles.register(K, M, { page: !0 })).catch((e) => s.warn("<ui-page>", "can't add its page sheet:", e));
|
|
170
171
|
let e = _UIPage.connected;
|
|
171
|
-
return e.size &&
|
|
172
|
+
return e.size && s.warn("<ui-page>", "a second page frame on this page; one <ui-page> frames a window"), e.add(this), () => e.delete(this);
|
|
172
173
|
}
|
|
173
174
|
static reset() {
|
|
174
175
|
_UIPage.connected.clear();
|
|
175
176
|
}
|
|
176
177
|
};
|
|
177
|
-
H =
|
|
178
|
+
H = d(V), n(H, 1, "watchPage", R, U), n(H, 13, "vocabulary", B, U), n(H, 13, "elementSetup", z, U), r(H, U), e(U, "UIPage"), t(U, "vocabulary", o(H, 8, U, A)), o(H, 11, U), t(U, "elementSetup", o(H, 12, U, { styleSheets: {
|
|
178
179
|
...f.prototype.elementSetup.styleSheets,
|
|
179
180
|
page: j
|
|
180
|
-
} })),
|
|
181
|
+
} })), o(H, 15, U), t(U, "connected", /* @__PURE__ */ new Set());
|
|
181
182
|
var W = U, G = "skip", K = "page-frame";
|
|
182
183
|
//#endregion
|
|
183
184
|
//#region src/components/ui-page/index.ts
|
package/dist/ui-page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-page.js","names":["this","<Show when={this.has(\"header\")}>\n <header part={this.partForName(\"header\")}>\n <slot name={this.slotForName(\"header\")} />\n </header>\n </Show>","name={this.slotForName(\"header\")}","<header part={this.partForName(\"header\")}>\n <slot name={this.slotForName(\"header\")} />\n </header>","<div class={this.rootClass} part={this.partForName(\"page\")} style={this.contentStyle}>\n <a class={SKIP} part={this.partForName(\"skip\")} href=\"#\" onClick={(event) => this.skipToContent(event)}>\n {this.isReady ? this.translationForKey(\"skip\") : \"\"}\n </a>\n <Show when={this.has(\"header\")}>\n <header part={this.partForName(\"header\")}>\n <slot name={this.slotForName(\"header\")} />\n </header>\n </Show>\n <Show when={this.has(\"nav\")}>\n <nav part={this.partForName(\"nav\")}>\n <slot name={this.slotForName(\"nav\")} />\n </nav>\n </Show>\n <main ref={(main) => this.main = main} part={this.partForName(\"main\")} tabindex=\"-1\">\n <slot />\n </main>\n <Show when={this.has(\"aside\")}>\n <aside part={this.partForName(\"aside\")}>\n <slot name={this.slotForName(\"aside\")} />\n </aside>\n </Show>\n <Show when={this.has(\"footer\")}>\n <footer part={this.partForName(\"footer\")}>\n <slot name={this.slotForName(\"footer\")} />\n </footer>\n </Show>\n </div>","<Show when={this.has(\"nav\")}>\n <nav part={this.partForName(\"nav\")}>\n <slot name={this.slotForName(\"nav\")} />\n </nav>\n </Show>","name={this.slotForName(\"nav\")}","<nav part={this.partForName(\"nav\")}>\n <slot name={this.slotForName(\"nav\")} />\n </nav>","ref={(main) => this.main = main}","<Show when={this.has(\"aside\")}>\n <aside part={this.partForName(\"aside\")}>\n <slot name={this.slotForName(\"aside\")} />\n </aside>\n </Show>","name={this.slotForName(\"aside\")}","<aside part={this.partForName(\"aside\")}>\n <slot name={this.slotForName(\"aside\")} />\n </aside>","<Show when={this.has(\"footer\")}>\n <footer part={this.partForName(\"footer\")}>\n <slot name={this.slotForName(\"footer\")} />\n </footer>\n </Show>","name={this.slotForName(\"footer\")}","<footer part={this.partForName(\"footer\")}>\n <slot name={this.slotForName(\"footer\")} />\n </footer>","part={this.partForName(\"page\")}","style={this.contentStyle}","class={SKIP}","part={this.partForName(\"skip\")}","part={this.partForName(\"main\")}","E.proto","E.protoMerged","E.whileConnected","E.SlotContent","_$getOwner","_$memo","_$createComponent","_$setAttribute","_$readShallow","pagePageCSS","__name","pageCSS","_$delegateEvents","__publicField","__decorateElement","__decoratorMetadata","__decoratorStart","__name$1","__runInitializers","rootVocabulary","getOwner$1","pageOwnVocabulary","pageVocabulary","UIPage_default","UIPage_page_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_watchPage_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIPage","UIRoot","proto","protoMerged","whileConnected","SlotContent","name","_self$","_el$","_el$2","_el$5","_el$8","_el$9","_el$12","_el$15","_o$","event","insert","_c$","memo","createComponent","Show","_el$3","_el$4","effect","_p$","setAttribute","t","_el$6","_el$7","ref","main","_el$10","_el$11","_el$13","_el$14","readShallow","SKIP","className","style","i","n","claimElement","isServer","UI","PAGE_SHEET","Warnings","error","pages","UIPage","delegateEvents"],"sources":["../src/components/ui-page/UIPage.en.ts","../src/components/ui-page/UIPage.css?inline","../src/components/ui-page/UIPage.page.css?inline","../src/components/ui-page/UIPage.tsx","../src/components/ui-page/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-page>`: every name the tag uses.\n * - A page is a ROOT (`UIRoot`): its whole vocabulary is `<ui-root>`'s names, then these.\n * - The page frame (epic `ui-gaps` P10): header, nav, main content, aside and footer, each the landmark screen\n * readers jump between, for a drawing, which holds no native HTML.\n * - Pure data: node reads it (`yarn site:data`, `yarn gen:root`).\n */\n\nimport type { E } from \"spell/ui/core\"\nimport { rootVocabulary } from \"spell/ui/components/ui-root/UIRoot.en\"\n\n/****************\n * ### `pageOwnVocabulary`\n * The names `<ui-page>` adds to a root's.\n ****************/\nconst pageOwnVocabulary = {\n tag: \"ui-page\",\n topics: [\"layout\", \"containers\", \"navigation\"],\n aka: [\"page\", \"app shell\", \"body\", \"layout\", \"frame\", \"landmarks\", \"holy grail layout\"],\n noun: \"page\",\n description:\n \"A page frames a whole window: a header, navigation, the main content, a side column and a footer, each a \" +\n \"landmark screen readers jump between. It's a root too: it loads the components inside it.\",\n slots: [\n { name: \"\", description: \"The main content (`<main>`).\" },\n { name: \"header\", description: \"The page's header, across the top (`<header>`): a title, a logo, a search.\" },\n { name: \"nav\", description: \"The site's navigation (`<nav>`): a column beside the content, on the start side.\" },\n { name: \"aside\", description: \"Related content (`<aside>`): a column on the end side.\" },\n { name: \"footer\", description: \"The page's footer, across the bottom (`<footer>`).\" }\n ],\n parts: [\n { name: \"page\", description: \"The grid of regions.\" },\n { name: \"skip\", description: 'The \"Skip to content\" link, shown only while it has the keyboard\\'s focus.' },\n { name: \"header\", description: \"The header region.\" },\n { name: \"nav\", description: \"The navigation region.\" },\n { name: \"main\", description: \"The main content region.\" },\n { name: \"aside\", description: \"The side region.\" },\n { name: \"footer\", description: \"The footer region.\" }\n ],\n texts: [{ key: \"skip\", text: \"Skip to content\", description: \"The first link of the page, for keyboards.\" }]\n} as const\n\n/****************\n * ### `pageVocabulary`\n * `<ui-page>`'s whole vocabulary: a root's names, then its own.\n ****************/\nexport const pageVocabulary = {\n ...rootVocabulary,\n ...pageOwnVocabulary,\n slots: pageOwnVocabulary.slots,\n parts: [...rootVocabulary.parts, ...pageOwnVocabulary.parts],\n texts: [...rootVocabulary.texts, ...pageOwnVocabulary.texts]\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-page>`: the page frame, on top of `<ui-root>`'s sheet.\n * - Shadow markup: `<div class=\"ui page\" part=\"page\">` around\n * `<a class=\"skip\" part=\"skip\">`, then `<header>`, `<nav>`, `<main>`, `<aside>`, `<footer>`, each round its slot;\n * a region with nothing slotted into it isn't drawn.\n * - A CSS grid: the header and footer across, the nav, main content and aside in a row between;\n * at a phone's width (the page's own, a container query), every region stacked in reading order.\n * - The whole window: at least the viewport's height (`--ui-page-min-height`), the page's background and text\n * colour.\n * With no `theme`, it follows the system's light or dark setting.\n * - Public tokens (`--ui-page-*`) are NEVER declared here: each is read through its private alias.\n * - The body's margin is cleared by the page sheet the component registers (`UIPage.page.css`).\n */\n\n@layer ui.components.page.types {\n :host {\n display: block;\n /* its own width decides the phone layout: a page in a narrow box stacks too */\n container-type: inline-size;\n min-block-size: var(--ui-page-min-height, 100dvh);\n background: var(--ui-background);\n color: var(--ui-text-color);\n }\n /* no `theme`: the system's light or dark */\n :host(:not(:state(light), :state(dark))) {\n color-scheme: light dark;\n }\n .ui.page {\n --_ui-page-gap: var(--ui-page-gap, var(--ui-space-l));\n --_ui-page-padding: var(--ui-page-padding, var(--ui-space-l));\n --_ui-page-nav-width: var(--ui-page-nav-width, 16em);\n --_ui-page-aside-width: var(--ui-page-aside-width, 16em);\n --_ui-page-max-width: var(--ui-page-max-width, none);\n position: relative;\n box-sizing: border-box;\n display: grid;\n grid-template:\n \"header header header\" auto\n \"nav main aside\" 1fr\n \"footer footer footer\" auto\n / auto minmax(0, 1fr) auto;\n gap: var(--_ui-page-gap);\n min-block-size: var(--ui-page-min-height, 100dvh);\n max-inline-size: var(--_ui-page-max-width);\n margin-inline: auto;\n padding: var(--_ui-page-padding);\n }\n .ui.page > header {\n grid-area: header;\n }\n .ui.page > nav {\n grid-area: nav;\n inline-size: var(--_ui-page-nav-width);\n }\n .ui.page > main {\n grid-area: main;\n min-inline-size: 0;\n }\n .ui.page > main:focus {\n outline: none;\n }\n .ui.page > aside {\n grid-area: aside;\n inline-size: var(--_ui-page-aside-width);\n }\n .ui.page > footer {\n grid-area: footer;\n }\n\n /* Skip to content: hidden until the keyboard reaches it, then over the page's top-left corner. */\n .skip:not(:focus-visible) {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n .skip {\n position: absolute;\n inset-block-start: var(--ui-space-xs);\n inset-inline-start: var(--ui-space-xs);\n z-index: var(--ui-z-sticky, 10);\n padding: var(--ui-space-xs) var(--ui-space-s);\n border-radius: var(--ui-radius);\n background: var(--ui-surface);\n color: var(--ui-link);\n box-shadow: var(--ui-shadow-floating);\n }\n\n /* A phone's width (the page's own): every region stacked, in reading order. */\n @container (width < 768px) {\n .ui.page {\n grid-template: \"header\" auto \"nav\" auto \"main\" 1fr \"aside\" auto \"footer\" auto / minmax(0, 1fr);\n }\n .ui.page > :is(nav, aside) {\n inline-size: auto;\n }\n }\n}\n","/*\n * `<ui-page>`'s PAGE sheet: registered into the document by the component (`UI.styles.register(..., { page: true })`).\n * - A page frame is the whole window: the body round it loses its margin.\n */\n\n@layer ui.components.page.types {\n body:has(> ui-page) {\n margin: 0;\n }\n}\n","import { Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI } from \"spell/ui/core\"\nimport { UIRoot } from \"spell/ui/components/ui-root\"\nimport { pageVocabulary } from \"./UIPage.en\"\n\nimport pageCSS from \"./UIPage.css?inline\"\nimport pagePageCSS from \"./UIPage.page.css?inline\"\n\n/****************\n * ### `<ui-page>`\n * The component behind `<ui-page>`: a whole window's frame, and a root (epic `ui-gaps` P10).\n *\n * - Its regions are the HTML landmarks screen readers jump between:\n * `<header>`, `<nav>`, `<main>` (the unnamed slot), `<aside>` and `<footer>`, laid out in a CSS grid.\n * - A region with nothing slotted into it isn't drawn.\n * - \"Skip to content\" comes first, hidden until the keyboard reaches it: it moves focus to the main content.\n * - The whole window: the page's background, the body's margin cleared (a page sheet), the system's light or dark\n * when no `theme` is set.\n * - A root too, as `<ui-root>`: it loads the components inside it, and shows them once they're ready.\n * - ONE per page: a second still draws, and says so in the console.\n ****************/\nexport class UIPage extends UIRoot<typeof pageVocabulary> {\n @E.proto static vocabulary = pageVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { ...UIRoot.prototype.elementSetup.styleSheets, page: pageCSS }\n } satisfies Partial<E.ElementSetup>\n\n /** Which named slots have content. */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** The main region, once drawn. */\n private main: HTMLElement | undefined\n\n /** Has slot `name` content? */\n private has(name: \"header\" | \"nav\" | \"aside\" | \"footer\"): boolean {\n return this.slots.hasContent(this.slotForName(name))\n }\n\n protected override content(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"page\")} style={this.contentStyle}>\n <a class={SKIP} part={this.partForName(\"skip\")} href=\"#\" onClick={(event) => this.skipToContent(event)}>\n {this.isReady ? this.translationForKey(\"skip\") : \"\"}\n </a>\n <Show when={this.has(\"header\")}>\n <header part={this.partForName(\"header\")}>\n <slot name={this.slotForName(\"header\")} />\n </header>\n </Show>\n <Show when={this.has(\"nav\")}>\n <nav part={this.partForName(\"nav\")}>\n <slot name={this.slotForName(\"nav\")} />\n </nav>\n </Show>\n <main ref={(main: HTMLElement) => (this.main = main)} part={this.partForName(\"main\")} tabindex=\"-1\">\n <slot />\n </main>\n <Show when={this.has(\"aside\")}>\n <aside part={this.partForName(\"aside\")}>\n <slot name={this.slotForName(\"aside\")} />\n </aside>\n </Show>\n <Show when={this.has(\"footer\")}>\n <footer part={this.partForName(\"footer\")}>\n <slot name={this.slotForName(\"footer\")} />\n </footer>\n </Show>\n </div>\n )\n }\n\n /** \"Skip to content\": focus the main region (a link's `#id` can't reach into a shadow root). */\n private skipToContent(event: MouseEvent) {\n event.preventDefault()\n this.main?.focus()\n }\n\n /**\n * While connected: its page sheet in the document, and one page per document.\n * - SIDE EFFECT: a console warning when another page is already there; this one still draws.\n */\n @E.whileConnected\n protected watchPage() {\n if (isServer) return undefined\n // the runtime loads as the root connects: register once it's there\n void UI.load()\n .then(() => UI.styles.register(PAGE_SHEET, pagePageCSS, { page: true }))\n .catch((error: unknown) => E.Warnings.warn(\"<ui-page>\", \"can't add its page sheet:\", error))\n const pages = UIPage.connected\n if (pages.size) E.Warnings.warn(\"<ui-page>\", \"a second page frame on this page; one <ui-page> frames a window\")\n pages.add(this)\n return () => pages.delete(this)\n }\n\n /** The pages in the document now. */\n private static readonly connected = new Set<UIPage>()\n\n /** Forget the connected pages, for tests. */\n static reset() {\n UIPage.connected.clear()\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIPage extends E.AttributeValues<typeof pageVocabulary> {}\n\n/** The skip link's class. */\nconst SKIP = \"skip\"\n\n/** The page sheet's name in `UI.styles`. */\nconst PAGE_SHEET = \"page-frame\"\n","/**\n * The page family: defines `<ui-page>` and exports its component, `UIPage`.\n * - SIDE EFFECT: importing it defines the tag (and `<ui-root>`'s family, which a page is built on).\n * - Also the library's `spell/ui/ui-page` entry (its size is in `notes/report.md`).\n */\n\nimport { UIPage } from \"./UIPage\"\n\nUIPage.define()\n\nexport { UIPage }\n"],"mappings":";;;;;;AAeA,IAAMyC,IAAoB;CACxB,KAAK;CACL,QAAQ;EAAC;EAAU;EAAc;CAAY;CAC7C,KAAK;EAAC;EAAQ;EAAa;EAAQ;EAAU;EAAS;EAAa;CAAmB;CACtF,MAAM;CACN,aACE;CAEF,OAAO;EACL;GAAE,MAAM;GAAI,aAAa;EAA+B;EACxD;GAAE,MAAM;GAAU,aAAa;EAA8E;EAC7G;GAAE,MAAM;GAAO,aAAa;EAAoF;EAChH;GAAE,MAAM;GAAS,aAAa;EAA0D;EACxF;GAAE,MAAM;GAAU,aAAa;EAAqD;CACtF;CACA,OAAO;EACL;GAAE,MAAM;GAAQ,aAAa;EAAuB;EACpD;GAAE,MAAM;GAAQ,aAAa;EAA6E;EAC1G;GAAE,MAAM;GAAU,aAAa;EAAqB;EACpD;GAAE,MAAM;GAAO,aAAa;EAAyB;EACrD;GAAE,MAAM;GAAQ,aAAa;EAA2B;EACxD;GAAE,MAAM;GAAS,aAAa;EAAmB;EACjD;GAAE,MAAM;GAAU,aAAa;EAAqB;CACtD;CACA,OAAO,CAAC;EAAE,KAAK;EAAQ,MAAM;EAAmB,aAAa;CAA6C,CAAC;AAC7G,GAMaC,IAAiB;CAC5B,GAAGH;CACH,GAAGE;CACH,OAAOA,EAAkB;CACzB,OAAO,CAAC,GAAGF,EAAe,OAAO,GAAGE,EAAkB,KAAK;CA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AAa,6BAA6BC,CAAK,CAAC;EAC7F,IAAMC,IAAQ,QAAO;EAGrB,OAFIA,EAAM,QAAMF,EAAW,KAAK,aAAa,kEAAkE,GAC/GE,EAAM,IAAI,IAAI,SACDA,EAAM,OAAO,IAAI;CAChC;CAMA,OAAO,QAAQ;EACb,QAAO,UAAU,MAAM;CACzB;AACF;AAhFO,IAAAnE,EAAAiB,CAAA,GA6DLnB,EAAAoB,GAAA,GAAU,aADVJ,GA5DWK,CAAA,GACFrB,EAAAoB,GAAA,IAAO,cAAhBF,GADWG,CAAA,GAEIrB,EAAAoB,GAAA,IAAO,gBAAtBH,GAFWI,CAAA,GAANpB,EAAAmB,GAAMC,CAAA,GAA6CzB,EAAAyB,GAAA,QAAA,GAC/CtB,EADEsB,GACK,cAAajB,EAApBgB,GAAA,GADEC,GACkBb,CAAA,CAAA,GAApBJ,EAAAgB,GAAA,IADEC,CAAA,GAEItB,EAFJsB,GAEW,gBAAejB,EAAtBgB,GAAA,IAFJC,GAE0B,EACnC,aAAa;CAAE,GAAGC,EAAO,UAAU,aAAa;CAAa,MAAMzB;AAAQ,EAC7E,CAAA,CAAA,GAFeO,EAAAgB,GAAA,IAFJC,CAAA,GA0EXtB,EA1EWsB,GA0Ea,6BAAY,IAAI,IAAY,CAAA;AA1E/C,IAAMiD,IAANjD,GAsFDqC,IAAO,QAGPQ,IAAa;;;cCxGnBI,EAAO,OAAO"}
|
|
1
|
+
{"version":3,"file":"ui-page.js","names":["this","<Show when={this.has(\"header\")}>\n <header part={this.partForName(\"header\")}>\n <slot name={this.slotForName(\"header\")} />\n </header>\n </Show>","name={this.slotForName(\"header\")}","<header part={this.partForName(\"header\")}>\n <slot name={this.slotForName(\"header\")} />\n </header>","<div class={this.rootClass} part={this.partForName(\"page\")} style={this.contentStyle}>\n <a class={SKIP} part={this.partForName(\"skip\")} href=\"#\" onClick={(event) => this.skipToContent(event)}>\n {this.isReady ? this.translationForKey(\"skip\") : \"\"}\n </a>\n <Show when={this.has(\"header\")}>\n <header part={this.partForName(\"header\")}>\n <slot name={this.slotForName(\"header\")} />\n </header>\n </Show>\n <Show when={this.has(\"nav\")}>\n <nav part={this.partForName(\"nav\")}>\n <slot name={this.slotForName(\"nav\")} />\n </nav>\n </Show>\n <main ref={(main) => this.main = main} part={this.partForName(\"main\")} tabindex=\"-1\">\n <slot />\n </main>\n <Show when={this.has(\"aside\")}>\n <aside part={this.partForName(\"aside\")}>\n <slot name={this.slotForName(\"aside\")} />\n </aside>\n </Show>\n <Show when={this.has(\"footer\")}>\n <footer part={this.partForName(\"footer\")}>\n <slot name={this.slotForName(\"footer\")} />\n </footer>\n </Show>\n </div>","<Show when={this.has(\"nav\")}>\n <nav part={this.partForName(\"nav\")}>\n <slot name={this.slotForName(\"nav\")} />\n </nav>\n </Show>","name={this.slotForName(\"nav\")}","<nav part={this.partForName(\"nav\")}>\n <slot name={this.slotForName(\"nav\")} />\n </nav>","ref={(main) => this.main = main}","<Show when={this.has(\"aside\")}>\n <aside part={this.partForName(\"aside\")}>\n <slot name={this.slotForName(\"aside\")} />\n </aside>\n </Show>","name={this.slotForName(\"aside\")}","<aside part={this.partForName(\"aside\")}>\n <slot name={this.slotForName(\"aside\")} />\n </aside>","<Show when={this.has(\"footer\")}>\n <footer part={this.partForName(\"footer\")}>\n <slot name={this.slotForName(\"footer\")} />\n </footer>\n </Show>","name={this.slotForName(\"footer\")}","<footer part={this.partForName(\"footer\")}>\n <slot name={this.slotForName(\"footer\")} />\n </footer>","part={this.partForName(\"page\")}","style={this.contentStyle}","class={SKIP}","part={this.partForName(\"skip\")}","part={this.partForName(\"main\")}","E.proto","E.protoMerged","E.whileConnected","E.SlotContent","_$getOwner","_$memo","_$createComponent","_$setAttribute","_$readShallow","pagePageCSS","__name","pageCSS","_$delegateEvents","__name$1","__publicField","__decorateElement","__decoratorMetadata","__runInitializers","__decoratorStart","rootVocabulary","getOwner$1","pageOwnVocabulary","pageVocabulary","UIPage_default","UIPage_page_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_watchPage_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIPage","UIRoot","proto","protoMerged","whileConnected","SlotContent","name","_self$","_el$","_el$2","_el$5","_el$8","_el$9","_el$12","_el$15","_o$","event","insert","_c$","memo","createComponent","Show","_el$3","_el$4","effect","_p$","setAttribute","t","_el$6","_el$7","ref","main","_el$10","_el$11","_el$13","_el$14","readShallow","SKIP","className","style","i","n","claimElement","isServer","UI","PAGE_SHEET","Warnings","error","pages","UIPage","delegateEvents"],"sources":["../src/components/ui-page/UIPage.en.ts","../src/components/ui-page/UIPage.css?inline","../src/components/ui-page/UIPage.page.css?inline","../src/components/ui-page/UIPage.tsx","../src/components/ui-page/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-page>`: every name the tag uses.\n * - A page is a ROOT (`UIRoot`): its whole vocabulary is `<ui-root>`'s names, then these.\n * - The page frame (epic `ui-gaps` P10): header, nav, main content, aside and footer, each the landmark screen\n * readers jump between, for a drawing, which holds no native HTML.\n * - Pure data: node reads it (`yarn site:data`, `yarn gen:root`).\n */\n\nimport type { E } from \"spell/ui/core\"\nimport { rootVocabulary } from \"spell/ui/components/ui-root/UIRoot.en\"\n\n/****************\n * ### `pageOwnVocabulary`\n * The names `<ui-page>` adds to a root's.\n ****************/\nconst pageOwnVocabulary = {\n tag: \"ui-page\",\n icon: \"file outline\",\n topics: [\"layout\", \"containers\", \"navigation\"],\n aka: [\"page\", \"app shell\", \"body\", \"layout\", \"frame\", \"landmarks\", \"holy grail layout\"],\n noun: \"page\",\n description:\n \"A page frames a whole window: a header, navigation, the main content, a side column and a footer, each a \" +\n \"landmark screen readers jump between. It's a root too: it loads the components inside it.\",\n slots: [\n { name: \"\", description: \"The main content (`<main>`).\" },\n { name: \"header\", description: \"The page's header, across the top (`<header>`): a title, a logo, a search.\" },\n { name: \"nav\", description: \"The site's navigation (`<nav>`): a column beside the content, on the start side.\" },\n { name: \"aside\", description: \"Related content (`<aside>`): a column on the end side.\" },\n { name: \"footer\", description: \"The page's footer, across the bottom (`<footer>`).\" }\n ],\n parts: [\n { name: \"page\", description: \"The grid of regions.\" },\n { name: \"skip\", description: 'The \"Skip to content\" link, shown only while it has the keyboard\\'s focus.' },\n { name: \"header\", description: \"The header region.\" },\n { name: \"nav\", description: \"The navigation region.\" },\n { name: \"main\", description: \"The main content region.\" },\n { name: \"aside\", description: \"The side region.\" },\n { name: \"footer\", description: \"The footer region.\" }\n ],\n texts: [{ key: \"skip\", text: \"Skip to content\", description: \"The first link of the page, for keyboards.\" }]\n} as const\n\n/****************\n * ### `pageVocabulary`\n * `<ui-page>`'s whole vocabulary: a root's names, then its own.\n ****************/\nexport const pageVocabulary = {\n ...rootVocabulary,\n ...pageOwnVocabulary,\n slots: pageOwnVocabulary.slots,\n parts: [...rootVocabulary.parts, ...pageOwnVocabulary.parts],\n texts: [...rootVocabulary.texts, ...pageOwnVocabulary.texts]\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-page>`: the page frame, on top of `<ui-root>`'s sheet.\n * - Shadow markup: `<div class=\"ui page\" part=\"page\">` around\n * `<a class=\"skip\" part=\"skip\">`, then `<header>`, `<nav>`, `<main>`, `<aside>`, `<footer>`, each round its slot;\n * a region with nothing slotted into it isn't drawn.\n * - A CSS grid: the header and footer across, the nav, main content and aside in a row between;\n * at a phone's width (the page's own, a container query), every region stacked in reading order.\n * - The whole window: at least the viewport's height (`--ui-page-min-height`), the page's background and text\n * colour.\n * With no `theme`, it follows the system's light or dark setting.\n * - Public tokens (`--ui-page-*`) are NEVER declared here: each is read through its private alias.\n * - The body's margin is cleared by the page sheet the component registers (`UIPage.page.css`).\n */\n\n@layer ui.components.page.types {\n :host {\n display: block;\n /* its own width decides the phone layout: a page in a narrow box stacks too */\n container-type: inline-size;\n min-block-size: var(--ui-page-min-height, 100dvh);\n background: var(--ui-background);\n color: var(--ui-text-color);\n }\n /* no `theme`: the system's light or dark */\n :host(:not(:state(light), :state(dark))) {\n color-scheme: light dark;\n }\n .ui.page {\n --_ui-page-gap: var(--ui-page-gap, var(--ui-space-l));\n --_ui-page-padding: var(--ui-page-padding, var(--ui-space-l));\n --_ui-page-nav-width: var(--ui-page-nav-width, 16em);\n --_ui-page-aside-width: var(--ui-page-aside-width, 16em);\n --_ui-page-max-width: var(--ui-page-max-width, none);\n position: relative;\n box-sizing: border-box;\n display: grid;\n grid-template:\n \"header header header\" auto\n \"nav main aside\" 1fr\n \"footer footer footer\" auto\n / auto minmax(0, 1fr) auto;\n gap: var(--_ui-page-gap);\n min-block-size: var(--ui-page-min-height, 100dvh);\n max-inline-size: var(--_ui-page-max-width);\n margin-inline: auto;\n padding: var(--_ui-page-padding);\n }\n .ui.page > header {\n grid-area: header;\n }\n .ui.page > nav {\n grid-area: nav;\n inline-size: var(--_ui-page-nav-width);\n }\n .ui.page > main {\n grid-area: main;\n min-inline-size: 0;\n }\n .ui.page > main:focus {\n outline: none;\n }\n .ui.page > aside {\n grid-area: aside;\n inline-size: var(--_ui-page-aside-width);\n }\n .ui.page > footer {\n grid-area: footer;\n }\n\n /* Skip to content: hidden until the keyboard reaches it, then over the page's top-left corner. */\n .skip:not(:focus-visible) {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n .skip {\n position: absolute;\n inset-block-start: var(--ui-space-xs);\n inset-inline-start: var(--ui-space-xs);\n z-index: var(--ui-z-sticky, 10);\n padding: var(--ui-space-xs) var(--ui-space-s);\n border-radius: var(--ui-radius);\n background: var(--ui-surface);\n color: var(--ui-link);\n box-shadow: var(--ui-shadow-floating);\n }\n\n /* A phone's width (the page's own): every region stacked, in reading order. */\n @container (width < 768px) {\n .ui.page {\n grid-template: \"header\" auto \"nav\" auto \"main\" 1fr \"aside\" auto \"footer\" auto / minmax(0, 1fr);\n }\n .ui.page > :is(nav, aside) {\n inline-size: auto;\n }\n }\n}\n","/*\n * `<ui-page>`'s PAGE sheet: registered into the document by the component (`UI.styles.register(..., { page: true })`).\n * - A page frame is the whole window: the body round it loses its margin.\n */\n\n@layer ui.components.page.types {\n body:has(> ui-page) {\n margin: 0;\n }\n}\n","import { Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI } from \"spell/ui/core\"\nimport { UIRoot } from \"spell/ui/components/ui-root\"\nimport { pageVocabulary } from \"./UIPage.en\"\n\nimport pageCSS from \"./UIPage.css?inline\"\nimport pagePageCSS from \"./UIPage.page.css?inline\"\n\n/****************\n * ### `<ui-page>`\n * The component behind `<ui-page>`: a whole window's frame, and a root (epic `ui-gaps` P10).\n *\n * - Its regions are the HTML landmarks screen readers jump between:\n * `<header>`, `<nav>`, `<main>` (the unnamed slot), `<aside>` and `<footer>`, laid out in a CSS grid.\n * - A region with nothing slotted into it isn't drawn.\n * - \"Skip to content\" comes first, hidden until the keyboard reaches it: it moves focus to the main content.\n * - The whole window: the page's background, the body's margin cleared (a page sheet), the system's light or dark\n * when no `theme` is set.\n * - A root too, as `<ui-root>`: it loads the components inside it, and shows them once they're ready.\n * - ONE per page: a second still draws, and says so in the console.\n ****************/\nexport class UIPage extends UIRoot<typeof pageVocabulary> {\n @E.proto static vocabulary = pageVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { ...UIRoot.prototype.elementSetup.styleSheets, page: pageCSS }\n } satisfies Partial<E.ElementSetup>\n\n /** Which named slots have content. */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** The main region, once drawn. */\n private main: HTMLElement | undefined\n\n /** Has slot `name` content? */\n private has(name: \"header\" | \"nav\" | \"aside\" | \"footer\"): boolean {\n return this.slots.hasContent(this.slotForName(name))\n }\n\n protected override content(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"page\")} style={this.contentStyle}>\n <a class={SKIP} part={this.partForName(\"skip\")} href=\"#\" onClick={(event) => this.skipToContent(event)}>\n {this.isReady ? this.translationForKey(\"skip\") : \"\"}\n </a>\n <Show when={this.has(\"header\")}>\n <header part={this.partForName(\"header\")}>\n <slot name={this.slotForName(\"header\")} />\n </header>\n </Show>\n <Show when={this.has(\"nav\")}>\n <nav part={this.partForName(\"nav\")}>\n <slot name={this.slotForName(\"nav\")} />\n </nav>\n </Show>\n <main ref={(main: HTMLElement) => (this.main = main)} part={this.partForName(\"main\")} tabindex=\"-1\">\n <slot />\n </main>\n <Show when={this.has(\"aside\")}>\n <aside part={this.partForName(\"aside\")}>\n <slot name={this.slotForName(\"aside\")} />\n </aside>\n </Show>\n <Show when={this.has(\"footer\")}>\n <footer part={this.partForName(\"footer\")}>\n <slot name={this.slotForName(\"footer\")} />\n </footer>\n </Show>\n </div>\n )\n }\n\n /** \"Skip to content\": focus the main region (a link's `#id` can't reach into a shadow root). */\n private skipToContent(event: MouseEvent) {\n event.preventDefault()\n this.main?.focus()\n }\n\n /**\n * While connected: its page sheet in the document, and one page per document.\n * - SIDE EFFECT: a console warning when another page is already there; this one still draws.\n */\n @E.whileConnected\n protected watchPage() {\n if (isServer) return undefined\n // the runtime loads as the root connects: register once it's there\n void UI.load()\n .then(() => UI.styles.register(PAGE_SHEET, pagePageCSS, { page: true }))\n .catch((error: unknown) => E.Warnings.warn(\"<ui-page>\", \"can't add its page sheet:\", error))\n const pages = UIPage.connected\n if (pages.size) E.Warnings.warn(\"<ui-page>\", \"a second page frame on this page; one <ui-page> frames a window\")\n pages.add(this)\n return () => pages.delete(this)\n }\n\n /** The pages in the document now. */\n private static readonly connected = new Set<UIPage>()\n\n /** Forget the connected pages, for tests. */\n static reset() {\n UIPage.connected.clear()\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIPage extends E.AttributeValues<typeof pageVocabulary> {}\n\n/** The skip link's class. */\nconst SKIP = \"skip\"\n\n/** The page sheet's name in `UI.styles`. */\nconst PAGE_SHEET = \"page-frame\"\n","/**\n * The page family: defines `<ui-page>` and exports its component, `UIPage`.\n * - SIDE EFFECT: importing it defines the tag (and `<ui-root>`'s family, which a page is built on).\n * - Also the library's `spell/ui/ui-page` entry (its size is in `notes/report.md`).\n */\n\nimport { UIPage } from \"./UIPage\"\n\nUIPage.define()\n\nexport { UIPage }\n"],"mappings":";;;;;;AAeA,IAAMyC,IAAoB;CACxB,KAAK;CACL,MAAM;CACN,QAAQ;EAAC;EAAU;EAAc;CAAY;CAC7C,KAAK;EAAC;EAAQ;EAAa;EAAQ;EAAU;EAAS;EAAa;CAAmB;CACtF,MAAM;CACN,aACE;CAEF,OAAO;EACL;GAAE,MAAM;GAAI,aAAa;EAA+B;EACxD;GAAE,MAAM;GAAU,aAAa;EAA8E;EAC7G;GAAE,MAAM;GAAO,aAAa;EAAoF;EAChH;GAAE,MAAM;GAAS,aAAa;EAA0D;EACxF;GAAE,MAAM;GAAU,aAAa;EAAqD;CACtF;CACA,OAAO;EACL;GAAE,MAAM;GAAQ,aAAa;EAAuB;EACpD;GAAE,MAAM;GAAQ,aAAa;EAA6E;EAC1G;GAAE,MAAM;GAAU,aAAa;EAAqB;EACpD;GAAE,MAAM;GAAO,aAAa;EAAyB;EACrD;GAAE,MAAM;GAAQ,aAAa;EAA2B;EACxD;GAAE,MAAM;GAAS,aAAa;EAAmB;EACjD;GAAE,MAAM;GAAU,aAAa;EAAqB;CACtD;CACA,OAAO,CAAC;EAAE,KAAK;EAAQ,MAAM;EAAmB,aAAa;CAA6C,CAAC;AAC7G,GAMaC,IAAiB;CAC5B,GAAGH;CACH,GAAGE;CACH,OAAOA,EAAkB;CACzB,OAAO,CAAC,GAAGF,EAAe,OAAO,GAAGE,EAAkB,KAAK;CAC3D,OAAO,CAAC,GAAGF,EAAe,OAAO,GAAGE,EAAkB,KAAK;AAC7D,6/DGrDAS,GAAAC,GAAAC,GAAAC,GAAAC,GAuBaC,IAAN,MAAM,iBAAe,IAAAC,GAC1B,IAAA,CAACpC,CAAE,GACH,IAAA,CAACC,CAAE,GA0DH,IAAA,CAACC,CAAE,GA5DuB+B,EAAA,CAA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,EAAAe,CAAA,GA6DLlB,EAAAmB,GAAA,GAAU,aADVJ,GA5DWK,CAAA,GACFpB,EAAAmB,GAAA,IAAO,cAAhBF,GADWG,CAAA,GAEIpB,EAAAmB,GAAA,IAAO,gBAAtBH,GAFWI,CAAA,GAANnB,EAAAkB,GAAMC,CAAA,GAA6CzB,EAAAyB,GAAA,QAAA,GAC/CrB,EADEqB,GACK,cAAalB,EAApBiB,GAAA,GADEC,GACkBb,CAAA,CAAA,GAApBL,EAAAiB,GAAA,IADEC,CAAA,GAEIrB,EAFJqB,GAEW,gBAAelB,EAAtBiB,GAAA,IAFJC,GAE0B,EACnC,aAAa;CAAE,GAAGC,EAAO,UAAU,aAAa;CAAa,MAAMzB;AAAQ,EAC7E,CAAA,CAAA,GAFeM,EAAAiB,GAAA,IAFJC,CAAA,GA0EXrB,EA1EWqB,GA0Ea,6BAAY,IAAI,IAAY,CAAA;AA1E/C,IAAMiD,IAANjD,GAsFDqC,IAAO,QAGPQ,IAAa;;;cCxGnBI,EAAO,OAAO"}
|
package/dist/ui-panel.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "./rolldown-runtime-CYGlBXrH.js";
|
|
2
|
-
import { Bt as e,
|
|
3
|
-
import { UISection as
|
|
2
|
+
import { Bt as e, Ht as t, Lt as n, Rt as r, Ut as i, cssState as a, proto as o, protoMerged as s, zt as c } from "./core.js";
|
|
3
|
+
import { UISection as l, n as u, t as d } from "./ui-section.js";
|
|
4
4
|
//#region src/components/ui-panel/UIPanel.en.ts
|
|
5
|
-
var
|
|
6
|
-
...
|
|
5
|
+
var f = "pane", p = "Hue of the whole panel: the header band, the box, the border and the sub-head bands (sub-panels follow it). None: `primary`. Any hue, including one a theme adds (`spell-brand`'s `accent`, Polished Ivory).", m = "Where each band's open / close chevron sits: `end`, at the far end of the band after any actions (the panel's default), or `start`, before the title.", h = "The look: `pane`, a whole pane under one flat bar, with no box or padding of its own: its title is the bar and its content fills what's left, so it can scroll by itself. Put a toolbar in its `slot=\"actions\"`, and the bar's chevron, the toolbar's items and its actions read as one row. Closed, only the bar is left. The section's words too: `bordered`, `styled`, `raised`, `basic`, `drawer`.", g = {
|
|
6
|
+
...u,
|
|
7
7
|
tag: "ui-panel",
|
|
8
|
+
icon: "window maximize outline",
|
|
8
9
|
topics: ["layout", "containers"],
|
|
9
10
|
aka: [
|
|
10
11
|
"inspector",
|
|
@@ -15,32 +16,42 @@ var d = "Hue of the whole panel: the header band, the box, the border and the s
|
|
|
15
16
|
"property sheet"
|
|
16
17
|
],
|
|
17
18
|
description: "A panel is an inspector: a tinted box of fields under a header band, with sub-head bands that open and close. It takes every `<ui-section>` attribute.",
|
|
18
|
-
attributes:
|
|
19
|
+
attributes: u.attributes.map((e) => e.name === "color" ? {
|
|
19
20
|
...e,
|
|
20
|
-
description:
|
|
21
|
+
description: p
|
|
21
22
|
} : e.name === "fold-icon" ? {
|
|
22
23
|
...e,
|
|
23
|
-
description:
|
|
24
|
+
description: m
|
|
25
|
+
} : e.name === "appearance" ? {
|
|
26
|
+
...e,
|
|
27
|
+
values: [...e.values, f],
|
|
28
|
+
description: h
|
|
24
29
|
} : e)
|
|
25
|
-
},
|
|
30
|
+
}, _ = "@layer ui.components.panel.types{.ui.section.panel:is(:not(.sub),.loose):not(:is(.primary,.secondary,.red,.orange,.yellow,.olive,.green,.teal,.blue,.violet,.purple,.pink,.brown,.grey,.black,.accent)){--_ui-panel-hue-box:color-mix(in oklab, var(--ui-primary-background) 35%, var(--ui-surface));--_ui-panel-hue-border:color-mix(in oklab, var(--ui-primary) 28%, var(--ui-surface));--_ui-panel-hue-header:var(--ui-primary-background);--_ui-panel-hue-header-color:var(--ui-primary-header);--_ui-panel-hue-subhead:color-mix(in oklab, var(--ui-primary-background) 65%, var(--ui-surface));--_ui-panel-hue-subhead-color:var(--ui-primary-text)}.ui.section.panel:is(.primary,.secondary,.red,.orange,.yellow,.olive,.green,.teal,.blue,.violet,.purple,.pink,.brown,.grey,.black,.accent){--_ui-panel-hue-box:color-mix(in oklab, var(--ui-color-background) 35%, var(--ui-surface));--_ui-panel-hue-border:color-mix(in oklab, var(--ui-color) 28%, var(--ui-surface));--_ui-panel-hue-header:var(--ui-color-background);--_ui-panel-hue-header-color:var(--ui-color-header);--_ui-panel-hue-subhead:color-mix(in oklab, var(--ui-color-background) 65%, var(--ui-surface));--_ui-panel-hue-subhead-color:var(--ui-color-text)}.ui.section.panel{--_ui-panel-background:var(--ui-panel-background,var(--_ui-panel-hue-box,light-dark(var(--spell-accent-25,var(--ui-surface)),var(--ui-surface))));--_ui-panel-border-color:var(--ui-panel-border-color,var(--_ui-panel-hue-border,light-dark(var(--spell-accent-150,var(--ui-border-color)),var(--ui-border-color))));--_ui-panel-header-background:var(--ui-panel-header-background,var(--_ui-panel-hue-header,light-dark(var(--spell-accent-100,var(--ui-surface-strong)),var(--ui-surface-strong))));--_ui-panel-header-color:var(--ui-panel-header-color,var(--_ui-panel-hue-header-color,var(--spell-text-strong,var(--ui-text-dark))));--_ui-panel-subhead-background:var(--ui-panel-subhead-background,var(--_ui-panel-hue-subhead,light-dark(var(--spell-accent-75,var(--ui-surface-muted)),var(--ui-surface-muted))));--_ui-panel-subhead-color:var(--ui-panel-subhead-color,var(--_ui-panel-hue-subhead-color,light-dark(var(--spell-accent-800,var(--ui-text-muted)),var(--ui-text-muted))));--_ui-panel-radius:var(--ui-panel-radius,var(--ui-radius-l,16px));--_ui-panel-padding:var(--ui-panel-padding,var(--ui-font-size,16px));--_ui-panel-gap:var(--ui-panel-gap,8px);--_ui-panel-band-space:var(--ui-panel-band-space,20px);--_ui-panel-shadow:var(--ui-panel-shadow,var(--spell-shadow-sm,var(--ui-shadow-raised)))}.ui.section.panel:not(.sub){padding:var(--_ui-panel-padding);border:1px solid var(--_ui-panel-border-color);border-radius:var(--_ui-panel-radius);background:var(--_ui-panel-background);box-shadow:var(--_ui-panel-shadow);font-family:var(--ui-font-family);margin-block:0}.ui.section.panel.sub{margin-block:0;margin-inline:calc(-1 * var(--_ui-panel-padding));box-shadow:none;background:0 0;border:none;padding:0}}@layer ui.components.panel.content{.ui.section.panel>.title{border-bottom:none}.ui.section.panel:not(.sub)>.title{margin:calc(-1 * var(--_ui-panel-padding));padding:.75em var(--_ui-panel-padding);border-radius:calc(var(--_ui-panel-radius) - 1px) calc(var(--_ui-panel-radius) - 1px) 0 0;background:var(--_ui-panel-header-background);color:var(--_ui-panel-header-color);margin-block-end:0}.ui.section.panel:not(.sub)>.title>.heading{font-family:var(--ui-font-family);letter-spacing:-.01em;font-size:1.0625em;font-weight:700;line-height:1}.ui.section.panel.sub>.title{padding:.25em var(--_ui-panel-padding);border-top:1px solid var(--_ui-panel-border-color);background:var(--_ui-panel-subhead-background);color:var(--_ui-panel-subhead-color);border-radius:0;margin:0}.ui.section.panel.sub>.title>.heading,.ui.section.panel.sub>.title>.heading>.toggle{font-family:var(--ui-font-family);letter-spacing:.06em;text-transform:uppercase;font-weight:700;line-height:1.5}.ui.section.panel.sub>.title>.heading{font-size:.75em}.ui.section.panel>.title>.fold.icon,.ui.section.panel>.title>.heading>.toggle>.fold.icon{opacity:.55;width:.6875em;height:.6875em;transition:rotate var(--_ui-section-duration) var(--ui-ease), opacity var(--ui-duration-fast) var(--ui-ease)}.ui.section.panel>.title:has(>.heading:hover)>.fold.icon,.ui.section.panel>.title>.fold.icon:hover,.ui.section.panel>.title>.heading>.toggle:hover>.fold.icon{opacity:1}.ui.section.panel.sub>.title>.heading>.toggle>.fold.icon{width:.9166em;height:.9166em}.ui.section.panel>.subhead{padding:.5em 0 0;font-size:.8125em}.ui.section.panel.sub>.subhead{padding-inline:var(--_ui-panel-padding)}.ui.section.panel>.content{--_ui-panel-outer-gap:var(--_ui-panel-gap);gap:var(--_ui-panel-gap);flex-direction:column;font-size:.875em;display:flex}.ui.section.panel>.content:not([hidden]){padding:.75em 0 0}.ui.section.panel.sub>.content:not([hidden]){padding:.75em var(--_ui-panel-padding) .25em}:host(:state(pane)){flex-direction:column;min-width:0;height:100%;min-height:0;display:flex}.ui.pane.section.panel:not(.sub){min-height:0;box-shadow:none;background:0 0;border:0;border-radius:0;flex-direction:column;flex:auto;padding:0;display:flex}.ui.pane.section.panel>.sentinel{display:none}.ui.pane.section.panel:not(.sub)>.title{box-sizing:border-box;height:var(--ui-panel-pane-bar-height,max(40px, calc(var(--ui-control-height,0px) + 12px)));padding-block:0;padding-inline:var(--ui-panel-pane-bar-padding,6px 8px);border-bottom:1px solid var(--ui-border-color);background:var(--ui-panel-pane-bar-background,none);color:var(--ui-text-color);border-radius:0;flex:none;align-items:center;gap:0;margin:0}.ui.pane.section.panel>.title>.heading{flex:none;margin:0;font-size:13px}.ui.pane.section.panel:not(:has(>.title>.heading>button.toggle))>.title{padding-inline:var(--ui-panel-pane-bar-padding,8px)}.ui.pane.section.panel:not(:has(>.title>.heading>button.toggle))>.title>.heading{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.ui.pane.section.panel>.title>.heading>.toggle{border-radius:var(--ui-radius-pill,9999px);width:14px;min-width:14px;height:16px;color:var(--ui-text-muted);grid-auto-flow:column;justify-content:center;place-items:center;gap:0;padding:0;display:inline-grid}.ui.pane.section.panel>.title>.heading>.toggle:hover{background:oklch(from var(--ui-ink) l c h / .08);color:var(--ui-text-color)}.ui.pane.section.panel>.title>.heading>.toggle>.fold.icon{opacity:1;width:10px;height:10px;margin:0}.ui.pane.section.panel>.title>.heading>.toggle>.header{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.ui.pane.section.panel>.title>.actions{flex:auto;align-items:center;min-width:0;margin-inline-start:2px;display:flex}.ui.pane.section.panel>.title>.actions ::slotted(*){flex:auto;min-width:0}.ui.pane.section.panel>.content{flex-direction:column;flex:auto;min-height:0;font-size:1em;display:flex}.ui.pane.section.panel>.content:not([hidden]){padding:0}:host(:state(pane):state(collapsed))>.ui.pane.section.panel:not(.sub)>.title{border-bottom:0;border-radius:0}}@layer ui.components.panel.states{:host(:state(collapsed))>.ui.section.panel:not(.sub){padding-block-end:0}:host(:state(collapsed))>.ui.section.panel:not(.sub)>.title{border-radius:calc(var(--_ui-panel-radius) - 1px);margin-block-end:0}:host(:not(:first-child))>.ui.section.panel.sub{margin-block-start:calc(var(--_ui-panel-band-space) - var(--_ui-panel-outer-gap,0px))}:host(:state(collapsed):not(:last-child))>.ui.section.panel.sub{margin-block-end:calc(-1 * var(--_ui-panel-band-space))}:host(:last-child:state(collapsed))>.ui.section.panel.sub{margin-block-end:calc(-1 * var(--_ui-panel-padding))}@media (prefers-reduced-motion:no-preference){:host(:state(animated))>.ui.section.panel:not(.sub):not(.scrolling)>.content{overflow-clip-margin:var(--_ui-panel-padding);overflow:clip}}:host(:last-child:state(collapsed))>.ui.section.panel.sub>.title{border-radius:0 0 calc(var(--_ui-panel-radius) - 1px) calc(var(--_ui-panel-radius) - 1px)}}", v, y, b, x, S, C, w = class _UIPanel extends (S = l, x = [o], b = [s], y = [o], v = [a("pane")], S) {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments), i(C, 5, this);
|
|
33
|
+
}
|
|
34
|
+
get isPane() {
|
|
35
|
+
return String(this.appearance ?? "").split(/\s+/).includes(f);
|
|
36
|
+
}
|
|
26
37
|
get extraClass() {
|
|
27
|
-
let e = this.enclosingSection instanceof _UIPanel ?
|
|
38
|
+
let e = this.enclosingSection instanceof _UIPanel ? D : void 0;
|
|
28
39
|
return [
|
|
29
40
|
super.extraClass,
|
|
30
|
-
|
|
41
|
+
E,
|
|
31
42
|
e
|
|
32
43
|
].filter(Boolean).join(" ");
|
|
33
44
|
}
|
|
34
45
|
};
|
|
35
|
-
|
|
36
|
-
...
|
|
37
|
-
panel:
|
|
38
|
-
} })),
|
|
39
|
-
var
|
|
46
|
+
C = c(S), n(C, 2, "isPane", v, w), n(C, 13, "vocabulary", x, w), n(C, 13, "elementSetup", b, w), n(C, 13, "defaultFoldIcon", y, w), r(C, w), e(w, "UIPanel"), t(w, "vocabulary", i(C, 8, w, g)), i(C, 11, w), t(w, "elementSetup", i(C, 12, w, { styleSheets: {
|
|
47
|
+
...l.prototype.elementSetup.styleSheets,
|
|
48
|
+
panel: _
|
|
49
|
+
} })), i(C, 15, w), t(w, "defaultFoldIcon", i(C, 16, w, d.end)), i(C, 19, w);
|
|
50
|
+
var T = w, E = "panel", D = "sub";
|
|
40
51
|
//#endregion
|
|
41
52
|
//#region src/components/ui-panel/index.ts
|
|
42
|
-
|
|
53
|
+
T.define();
|
|
43
54
|
//#endregion
|
|
44
|
-
export {
|
|
55
|
+
export { T as UIPanel };
|
|
45
56
|
|
|
46
57
|
//# sourceMappingURL=ui-panel.js.map
|