spell-ui 0.8.6 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +13 -3
- 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 +22 -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 +530 -24
- 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 +124 -92
- 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-comment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-comment.js","names":["<Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>","this","part={this.partForName(\"reply\")}","name={this.slotForName(\"reply\")}","<div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>","part={this.partForName(\"comment\")}","<article class={this.rootClass} part={this.partForName(\"comment\")}>\n <slot />\n <Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>\n </article>","_tmpl$","_elementSetup_dec","_vocabulary_dec","_a","_init","E.UIComponent","E.proto","E.protoMerged","E.PartContext","E.SlotContent","_$getOwner","_$createComponent","_$readShallow","REPLY","_$setAttribute","__name","commentCSS","<Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>","this","part={this.partForName(\"reply\")}","name={this.slotForName(\"reply\")}","<div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>","part={this.partForName(\"comments\")}","<div class={this.isThread ? this.threadClasses : this.rootClass} part={this.partForName(\"comments\")}>\n <slot />\n <Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>\n </div>","E.UIComponent","E.proto","E.protoMerged","E.derived","E.PartContext","E.SlotContent","_$getOwner","_$createComponent","_$readShallow","_$setAttribute","UIT.DISABLED","__name","commentCSS","__publicField","__decorateElement","__decoratorMetadata","__decoratorStart","__name$1","__runInitializers","DISABLED","getOwner$1","commentVocabulary","UIComment_default","_tmpl$$1","_tmpl$2","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_UIComment","UIComponent","proto","protoMerged","PartContext","SlotContent","_self$","_el$","_el$2","insert","createComponent","Show","_el$3","_el$4","effect","readShallow","REPLY$1","className","_p$","t","setAttribute","a","UIComment","commentsVocabulary","_tmpl$","_threadClasses_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIComments","derived","REPLY","COLLAPSED","UIComments"],"sources":["../src/components/ui-comment/UIComment.en.ts","../src/components/ui-comment/UIComment.css?inline","../src/components/ui-comment/UIComment.tsx","../src/components/ui-comment/UIComments.en.ts","../src/components/ui-comment/UIComments.tsx","../src/components/ui-comment/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-comment>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots, parts and states.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-comments threaded appearance=\"minimal\" size=\"small\">` => `ui small minimal threaded comments`; a comment has no `ui`\n * (`<ui-comment collapsed>` => `collapsed comment`). `UIComment.css` keys on those.\n * - A comment owns the generic content parts (`ownsParts`): `<ui-avatar>`, `<ui-content>`, `<ui-author>`,\n * `<ui-meta>` (Fomantic's `.metadata`), `<ui-description>` (Fomantic's `.text`), `<ui-actions>` inside it get\n * `:state(in-comment)` (`UIParts.css`). It owns `comments` too: a `<ui-comments>` inside a comment is its thread\n * of replies.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `commentVocabulary`\n * The names of `<ui-comment>`, one comment: an `<article class=\"comment\">` of an avatar,\n * a content block and a thread of replies.\n ****************/\nexport const commentVocabulary = {\n tag: \"ui-comment\",\n topics: [\"social\", \"content parts\", \"views\"],\n aka: [\"reply\", \"post\", \"message\"],\n skeleton: \"header with image, 2 line paragraph\",\n noun: \"comment\",\n ui: false,\n description: \"One comment: who wrote it, when, what, and the replies to it.\",\n attributes: [\n { name: \"collapsed\", group: \"states\", kind: \"keyOnly\", description: \"Hidden: folded away.\" },\n { name: \"disabled\", group: \"states\", kind: \"keyOnly\", description: \"Faded and inert.\" }\n ],\n events: [],\n slots: [\n {\n name: \"\",\n description:\n \"`<ui-avatar>`, a `<ui-content>` (author, meta, description, actions) and a `<ui-comments>` thread of replies.\"\n },\n { name: \"reply\", description: \"A reply form (`<ui-form>`) below the comment.\" }\n ],\n parts: [\n { name: \"comment\", description: \"The comment box (`<article>`).\" },\n { name: \"reply\", description: \"The box around the `reply` slot.\" }\n ],\n states: [\n { name: \"in-comments\", description: \"In a comment list.\" },\n { name: \"collapsed\", description: \"`collapsed`.\" },\n { name: \"disabled\", description: \"`disabled`.\" }\n ],\n texts: [],\n ownsParts: [\"avatar\", \"content\", \"author\", \"meta\", \"description\", \"actions\", \"comments\"]\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-comments>` and `<ui-comment>`: a port of Fomantic's `comment.less` + `comment.variables`.\n * - ONE sheet for both elements; each adopts it after the foundation.\n * - Shadow markup contract (class grammar on semantic elements):\n * - `<ui-comments>`: `<div class=\"ui [size] [keyOnly ...] comments\" part=\"comments\"><slot></slot></div>`; inside\n * a comment (`:state(in-comment)`), its thread `<div class=\"[collapsed] [disabled] comments\">`, no `ui`\n * - `<ui-comment>`: `<article class=\"[keyOnly ...] comment\" part=\"comment\"><slot></slot></article>`\n * - both: the `reply` slot in `<div class=\"reply\" part=\"reply\">`, rendered while a reply form is slotted\n * - Rules pair the element's roots (`:host > .comment`, a thread's `:host(:state(in-comment)) > .comments`) with\n * Fomantic's static selectors (`.ui.comments .comment`, `.comment > .comments`).\n * The DOM element's position replaces `:first-child`.\n * - A comment owns its content parts: `<ui-avatar>`, `<ui-content>`, `<ui-author>`, `<ui-meta>`,\n * `<ui-description>`, `<ui-actions>` style themselves `:state(in-comment)` (`UIParts.css`), the content beside the\n * avatar; this sheet is the list, the comment box and the threads.\n * - Public tokens (`--ui-comments-*`, `--ui-comment-*`) are NEVER declared here: the top list reads each through a\n * private alias (`--_ui-comment-distance: var(--ui-comment-distance, 0.5em)`), which its comments and threads\n * inherit and read. So a value set on `:root`, an ancestor, the DOM element or `::part(comments)` reaches every\n * comment (`notes/theming.md` \"Component tokens\"). A comment in a list or a thread never re-declares them;\n * a LONE `<ui-comment>` outside a list (`:host(:not(:state(in-comments)))`) declares its own.\n * - the parts' look tokens (`--ui-comment-author-color` ...) are declared nowhere: `UIParts.css` reads them\n * - The top list declares the variation tokens its threads and parts read, and they inherit all the way down:\n * `--_ui-comments-minimal` (`UIParts.css`: actions hidden until the comment is hovered or holds focus),\n * `--_comments-threaded` (the line down each thread), `--ui-inverted` + `color-scheme`. A thread declares none\n * of them: it has no variations of its own.\n * - NOTE: left out, on purpose:\n * - the reply form's textarea height (`.reply.form textarea`): a `<ui-textarea>` sizes itself (`rows`)\n * - `.comment > .comments::before` (an empty positioned pseudo-element in Fomantic)\n */\n\n@layer ui.components.comment.types, ui.components.comment.content, ui.components.comment.variations, ui.components.comment.states;\n\n/*******************************\n Comments\n*******************************/\n\n@layer ui.components.comment.types {\n /* DOM elements: no box of their own; the roots are the list, the thread and the comment. */\n :host {\n display: contents;\n }\n\n /* Tokens: one private alias per `comment.variables` entry that still matters; threads inherit them.\n Declared on the top list AND on a LONE comment (outside a list), which has none to inherit from; a comment\n in a list declares none, so it keeps the list's. */\n .ui.comments,\n :host(:not(:state(in-comments))) {\n --_ui-comments-max-width: var(--ui-comments-max-width, calc(var(--ui-font-size) * 40.625));\n --_ui-comments-margin: var(--ui-comments-margin, 1.5em);\n --_ui-comment-distance: var(--ui-comment-distance, 0.5em);\n --_ui-comment-line-height: var(--ui-comment-line-height, 1.2);\n --_ui-comments-thread-margin: var(--ui-comments-thread-margin, 0 0 0.5em 0.5em);\n --_ui-comments-thread-padding: var(--ui-comments-thread-padding, 1em 0 1em 1em);\n --_ui-comments-threaded-margin: var(--ui-comments-threaded-margin, -1.5em 0 -1em 1.25em);\n --_ui-comments-threaded-padding: var(--ui-comments-threaded-padding, 3em 0 2em 2.25em);\n --_ui-comments-threaded-line: var(\n --ui-comments-threaded-line,\n calc(var(--ui-border-width) * -1) 0 0 var(--ui-border-color)\n );\n --_ui-comments-reply-distance: var(--ui-comments-reply-distance, 1em);\n --_ui-comments-disabled-opacity: var(--ui-comments-disabled-opacity, var(--ui-disabled-opacity));\n }\n .ui.comments {\n /* Variations, read by threads and parts. */\n --_ui-comments-minimal: 0;\n --_comments-threaded: 0;\n /* Owner token, ALWAYS declared: a plain list nested in an inverted one resets it. */\n --ui-inverted: 0;\n }\n\n /* Comments: a column no wider than a comfortable line. */\n .ui.comments {\n box-sizing: border-box;\n max-width: var(--_ui-comments-max-width);\n margin: var(--_comments-margin-top, var(--_ui-comments-margin)) 0\n var(--_comments-margin-bottom, var(--_ui-comments-margin));\n color: var(--ui-text-color);\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n }\n .ui.comments:first-child {\n --_comments-margin-top: 0;\n }\n .ui.comments:last-child {\n --_comments-margin-bottom: 0;\n }\n /* Shadow DOM: the root is always an only child, so the DOM element's position decides. */\n :host(:not(:first-child)) > .ui.comments {\n --_comments-margin-top: initial;\n }\n :host(:not(:last-child)) > .ui.comments {\n --_comments-margin-bottom: initial;\n }\n /* Components inside don't scale twice. */\n .ui.comments > slot {\n --ui-scale: initial;\n }\n\n /*******************************\n Comment\n *******************************/\n\n /* Comment: spaced from the one before; the box its minimal actions are placed in. */\n :host > .comment,\n .ui.comments .comment {\n position: relative;\n margin: var(--_ui-comment-distance) 0 0;\n padding: var(--_ui-comment-distance) 0 0;\n border: none;\n background: none;\n line-height: var(--_ui-comment-line-height);\n }\n :host(:first-child) > .comment,\n .ui.comments .comment:first-child {\n margin-top: 0;\n padding-top: 0;\n }\n\n /* A thread of replies inside a comment. */\n :host(:state(in-comment)) > .comments,\n .ui.comments .comment > .comments {\n margin: var(--_ui-comments-thread-margin);\n padding: var(--_ui-comments-thread-padding);\n }\n}\n\n/*******************************\n Content\n*******************************/\n\n@layer ui.components.comment.content {\n /* A reply form below the list, or below a comment. */\n :is(.comments, .comment) > .reply,\n .ui.comments > .reply.form {\n margin-top: var(--_ui-comments-reply-distance);\n }\n .comment > .reply,\n .ui.comments .comment .reply.form {\n width: 100%;\n }\n /* Static markup: the reply textarea. */\n .ui.comments .reply.form textarea {\n height: 12em;\n font-size: 1em;\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.comment.variations {\n /* Threaded: a line down the left of each thread of replies. */\n .ui.threaded.comments {\n --_comments-threaded: 1;\n }\n .ui.threaded.comments .comment > .comments {\n margin: var(--_ui-comments-threaded-margin);\n padding: var(--_ui-comments-threaded-padding);\n box-shadow: var(--_ui-comments-threaded-line);\n }\n @container style(--_comments-threaded: 1) {\n :host(:state(in-comment)) > .comments {\n margin: var(--_ui-comments-threaded-margin);\n padding: var(--_ui-comments-threaded-padding);\n box-shadow: var(--_ui-comments-threaded-line);\n }\n }\n\n /* Minimal: each comment's actions wait for hover or focus (`UIParts.css`). */\n .ui.minimal.comments {\n --_ui-comments-minimal: 1;\n }\n\n /* Inverted: the dark scheme, and a dark surface behind each comment. */\n .ui.inverted.comments {\n --ui-inverted: 1;\n --ui-scheme: dark;\n color-scheme: dark;\n }\n .ui.inverted.comments .comment {\n background-color: var(--ui-surface);\n }\n @container style(--ui-inverted: 1) {\n :host(:state(in-comments)) > .comment {\n background-color: var(--ui-surface);\n }\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.comment.states {\n /* Collapsed: folded away. */\n .ui.collapsed.comments,\n .ui.comments .collapsed:is(.comments, .comment),\n :host > .collapsed:is(.comments, .comment) {\n display: none;\n }\n\n /* Disabled: faded and inert. */\n .ui.disabled.comments,\n .ui.comments .disabled.comment,\n :host > .disabled:is(.comments, .comment) {\n opacity: var(--_ui-comments-disabled-opacity);\n pointer-events: none;\n }\n}\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { commentVocabulary } from \"./UIComment.en\"\n\nimport commentCSS from \"./UIComment.css?inline\"\n\n/****************\n * ### `UIComment`\n * The component behind `<ui-comment>`:\n * one comment, `<article class=\"[keyOnly ...] comment\" part=\"comment\"><slot></slot></article>`,\n * then the `reply` slot's box (`<div class=\"reply\" part=\"reply\">`) when a reply form is slotted.\n *\n * - Why `<article>`: HTML names \"a user-submitted comment\" as its example of a self-contained composition,\n * and nests the replies' articles inside the comment they answer, as a thread of `<ui-comments>` inside does.\n *\n * - It owns its content parts (`ownsParts`):\n * `<ui-avatar>`, `<ui-content>`, `<ui-author>`, `<ui-meta>`, `<ui-description>` and `<ui-actions>`\n * get `:state(in-comment)`; a `<ui-comments>` inside is its thread.\n *\n * - In a `<ui-comments>` (`PartContext`, noun `comment`): `:state(in-comments)`.\n *\n * - `disabled`: unusable, the base class's way (`elementSetup.disabled`):\n * faded, the article inert, `aria-disabled`.\n ****************/\nexport class UIComment extends E.UIComponent<typeof commentVocabulary> {\n @E.proto static vocabulary = commentVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { comment: commentCSS },\n cssStates: [\"collapsed\"],\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n /** Its comment list, if any. */\n readonly context = new E.PartContext({ domElement: this.domElement, noun: this.vocabulary.noun })\n\n /** Light-DOM slot occupancy. */\n readonly slots = new E.SlotContent(this.domElement)\n\n render(): JSX.Element {\n return (\n <article class={this.rootClass} part={this.partForName(\"comment\")}>\n <slot />\n <Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>\n </article>\n )\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIComment extends E.AttributeValues<typeof commentVocabulary> {}\n\n/** The class, part and slot of the reply box (`UIComments` draws one too). */\nconst REPLY = \"reply\"\n","/**\n * The English vocabulary of `<ui-comments>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), events, slots, parts, states and texts.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - The family's grammar notes are in `UIComment.en.ts`.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `commentsVocabulary`\n * The names of `<ui-comments>`, a comment list: `<div class=\"ui ... comments\">` of `<ui-comment>`s;\n * inside a comment, its thread of replies (`<div class=\"comments\">`).\n ****************/\nexport const commentsVocabulary = {\n tag: \"ui-comments\",\n topics: [\"social\", \"lists\", \"data display\", \"views\"],\n aka: [\"discussion\", \"thread\", \"replies\"],\n noun: \"comments\",\n description: \"A list of comments, or the thread of replies to one.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Text size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"threaded\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"A line down the left of each thread of replies.\"\n },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"minimal\"],\n // each word draws itself: no key after it\n classes: {},\n replaces: [{ from: \"minimal\", value: \"minimal\" }],\n description:\n \"The look: `minimal`, each comment's actions hidden until the comment is hovered (and shown to keyboard \" +\n \"focus). Old name: `minimal`.\"\n },\n { name: \"inverted\", group: \"appearance\", kind: \"keyOnly\", description: \"For dark backgrounds: the dark scheme.\" },\n { name: \"collapsed\", group: \"states\", kind: \"keyOnly\", description: \"Hidden: a thread of replies folded away.\" },\n { name: \"disabled\", group: \"states\", kind: \"keyOnly\", description: \"Faded and inert.\" }\n ],\n events: [],\n slots: [\n { name: \"\", description: \"`<ui-comment>`s, and a heading (`<ui-header dividing>`).\" },\n { name: \"reply\", description: \"A reply form (`<ui-form>`) below the comments.\" }\n ],\n parts: [\n { name: \"comments\", description: \"The comment list box.\" },\n { name: \"reply\", description: \"The box around the `reply` slot.\" }\n ],\n states: [\n { name: \"in-comment\", description: 'Inside a comment: its thread of replies (`class=\"comments\"`, no `ui`).' },\n { name: \"collapsed\", description: \"`collapsed`.\" }\n ],\n texts: [],\n ownsParts: [\"comment\"]\n} as const satisfies E.ComponentVocabulary\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\nimport { commentsVocabulary } from \"./UIComments.en\"\n\nimport commentCSS from \"./UIComment.css?inline\"\n\n/****************\n * ### `UIComments`\n * The component behind `<ui-comments>`:\n * a list of comments, `<div class=\"ui [size] [keyOnly ...] comments\" part=\"comments\"><slot></slot></div>`,\n * then the `reply` slot's box (`<div class=\"reply\" part=\"reply\">`) when a reply form is slotted.\n *\n * - It owns its comments (`ownsParts: comment`): each `<ui-comment>` gets `:state(in-comments)`.\n *\n * - Inside a `<ui-comment>` (`PartContext`, noun `comments`), it is that comment's THREAD of replies:\n * `<div class=\"[collapsed] comments\">`, no `ui`, no variations of its own.\n * It inherits the outer list's (`threaded`, `minimal`, `inverted` ...) as tokens,\n * as Fomantic's `.ui.threaded.comments .comment > .comments` has it.\n *\n * - No role: each comment is an `<article>`, which is the structure a reader moves through.\n *\n * - `disabled`: unusable, the base class's way (`elementSetup.disabled`):\n * faded, what's inside inert, `aria-disabled`.\n ****************/\nexport class UIComments extends E.UIComponent<typeof commentsVocabulary> {\n @E.proto static vocabulary = commentsVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { comment: commentCSS },\n cssStates: [\"collapsed\"],\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n /** The comment this is the thread of, if any. */\n readonly context = new E.PartContext({ domElement: this.domElement, noun: this.vocabulary.noun })\n\n /** Light-DOM slot occupancy. */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** A thread of replies inside a comment. */\n get isThread(): boolean {\n return !!this.context.owner\n }\n\n render(): JSX.Element {\n return (\n <div class={this.isThread ? this.threadClasses : this.rootClass} part={this.partForName(\"comments\")}>\n <slot />\n <Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>\n </div>\n )\n }\n\n /** A thread's classes: the noun, and `collapsed` / `disabled`, which a thread keeps. */\n @E.derived\n private get threadClasses(): string {\n return [this.collapsed ? COLLAPSED : \"\", this.disabled ? UIT.DISABLED : \"\", this.vocabulary.noun]\n .filter(Boolean)\n .join(\" \")\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIComments extends E.AttributeValues<typeof commentsVocabulary> {}\n\n/** The class, part and slot of the reply box (`UIComment` draws one too). */\nconst REPLY = \"reply\"\n\n/** The class word a thread of replies keeps (`collapsed comments`). */\nconst COLLAPSED = \"collapsed\"\n","/**\n * The comment family: defines `<ui-comments>` and `<ui-comment>`,\n * and exports their components, `UIComments` and `UIComment`.\n * - SIDE EFFECT: importing it defines the tags, and the generic content parts through the parts barrel,\n * so a page never has to import what its comments hold.\n * - Also the library's `spell/ui/ui-comment` entry (its size is in `notes/report.md`).\n */\n\nimport { UIComment } from \"./UIComment\"\nimport { UIComments } from \"./UIComments\"\n\nimport \"spell/ui/components/ui-parts\"\n\nUIComments.define()\nUIComment.define()\n\nexport { UIComment, UIComments }\n"],"mappings":";;;;;;AAoBA,IAAaoD,IAAoB;CAC/B,KAAK;CACL,QAAQ;EAAC;EAAU;EAAiB;CAAO;CAC3C,KAAK;EAAC;EAAS;EAAQ;CAAS;CAChC,UAAU;CACV,MAAM;CACN,IAAI;CACJ,aAAa;CACb,YAAY,CACV;EAAE,MAAM;EAAa,OAAO;EAAU,MAAM;EAAW,aAAa;CAAwB,GAC5F;EAAE,MAAM;EAAY,OAAO;EAAU,MAAM;EAAW,aAAa;CAAmB,CACxF;CACA,QAAQ,CAAC;CACT,OAAO,CACL;EACE,MAAM;EACN,aACE;CACJ,GACA;EAAE,MAAM;EAAS,aAAa;CAAgD,CAChF;CACA,OAAO,CACL;EAAE,MAAM;EAAW,aAAa;CAAiC,GACjE;EAAE,MAAM;EAAS,aAAa;CAAmC,CACnE;CACA,QAA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gBAAezC,EAAtBwC,GAAA,IAFJC,GAE0B;CACnC,aAAa,EAAE,SAAS/C,EAAW;CACnC,WAAW,CAAC,WAAW;CACvB,gBAAgB;AAClB,CAAA,CAAA,GAJeM,EAAAwC,GAAA,IAFJC,CAAA;AAAN,IAAMI,IAANJ,GA6CDE,IAAQ,SAGRC,IAAY;AC7DlBC,EAAW,OAAO,GAClBZ,EAAU,OAAO"}
|
|
1
|
+
{"version":3,"file":"ui-comment.js","names":["<Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>","this","part={this.partForName(\"reply\")}","name={this.slotForName(\"reply\")}","<div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>","part={this.partForName(\"comment\")}","<article class={this.rootClass} part={this.partForName(\"comment\")}>\n <slot />\n <Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>\n </article>","_tmpl$","_elementSetup_dec","_vocabulary_dec","_a","_init","E.UIComponent","E.proto","E.protoMerged","E.PartContext","E.SlotContent","_$getOwner","_$createComponent","_$readShallow","REPLY","_$setAttribute","__name","commentCSS","<Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>","this","part={this.partForName(\"reply\")}","name={this.slotForName(\"reply\")}","<div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>","part={this.partForName(\"comments\")}","<div class={this.isThread ? this.threadClasses : this.rootClass} part={this.partForName(\"comments\")}>\n <slot />\n <Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>\n </div>","E.UIComponent","E.proto","E.protoMerged","E.derived","E.PartContext","E.SlotContent","_$getOwner","_$createComponent","_$readShallow","_$setAttribute","UIT.DISABLED","__name","commentCSS","__name$1","__publicField","__decorateElement","__decoratorMetadata","__runInitializers","DISABLED","__decoratorStart","getOwner$1","commentVocabulary","UIComment_default","_tmpl$$1","_tmpl$2","_elementSetup_dec$1","_vocabulary_dec$1","_a$1","_init$1","_UIComment","UIComponent","proto","protoMerged","PartContext","SlotContent","_self$","_el$","_el$2","insert","createComponent","Show","_el$3","_el$4","effect","readShallow","REPLY$1","className","_p$","t","setAttribute","a","UIComment","commentsVocabulary","_tmpl$","_threadClasses_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIComments","derived","REPLY","COLLAPSED","UIComments"],"sources":["../src/components/ui-comment/UIComment.en.ts","../src/components/ui-comment/UIComment.css?inline","../src/components/ui-comment/UIComment.tsx","../src/components/ui-comment/UIComments.en.ts","../src/components/ui-comment/UIComments.tsx","../src/components/ui-comment/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-comment>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots, parts and states.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-comments threaded appearance=\"minimal\" size=\"small\">` => `ui small minimal threaded comments`; a comment has no `ui`\n * (`<ui-comment collapsed>` => `collapsed comment`). `UIComment.css` keys on those.\n * - A comment owns the generic content parts (`ownsParts`): `<ui-avatar>`, `<ui-content>`, `<ui-author>`,\n * `<ui-meta>` (Fomantic's `.metadata`), `<ui-description>` (Fomantic's `.text`), `<ui-actions>` inside it get\n * `:state(in-comment)` (`UIParts.css`). It owns `comments` too: a `<ui-comments>` inside a comment is its thread\n * of replies.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `commentVocabulary`\n * The names of `<ui-comment>`, one comment: an `<article class=\"comment\">` of an avatar,\n * a content block and a thread of replies.\n ****************/\nexport const commentVocabulary = {\n tag: \"ui-comment\",\n icon: \"comment outline\",\n topics: [\"social\", \"content parts\", \"views\"],\n aka: [\"reply\", \"post\", \"message\"],\n skeleton: \"header with image, 2 line paragraph\",\n noun: \"comment\",\n ui: false,\n description: \"One comment: who wrote it, when, what, and the replies to it.\",\n attributes: [\n { name: \"collapsed\", group: \"states\", kind: \"keyOnly\", description: \"Hidden: folded away.\" },\n { name: \"disabled\", group: \"states\", kind: \"keyOnly\", description: \"Faded and inert.\" }\n ],\n events: [],\n slots: [\n {\n name: \"\",\n description:\n \"`<ui-avatar>`, a `<ui-content>` (author, meta, description, actions) and a `<ui-comments>` thread of replies.\"\n },\n { name: \"reply\", description: \"A reply form (`<ui-form>`) below the comment.\" }\n ],\n parts: [\n { name: \"comment\", description: \"The comment box (`<article>`).\" },\n { name: \"reply\", description: \"The box around the `reply` slot.\" }\n ],\n states: [\n { name: \"in-comments\", description: \"In a comment list.\" },\n { name: \"collapsed\", description: \"`collapsed`.\" },\n { name: \"disabled\", description: \"`disabled`.\" }\n ],\n texts: [],\n ownsParts: [\"avatar\", \"content\", \"author\", \"meta\", \"description\", \"actions\", \"comments\"]\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-comments>` and `<ui-comment>`: a port of Fomantic's `comment.less` + `comment.variables`.\n * - ONE sheet for both elements; each adopts it after the foundation.\n * - Shadow markup contract (class grammar on semantic elements):\n * - `<ui-comments>`: `<div class=\"ui [size] [keyOnly ...] comments\" part=\"comments\"><slot></slot></div>`; inside\n * a comment (`:state(in-comment)`), its thread `<div class=\"[collapsed] [disabled] comments\">`, no `ui`\n * - `<ui-comment>`: `<article class=\"[keyOnly ...] comment\" part=\"comment\"><slot></slot></article>`\n * - both: the `reply` slot in `<div class=\"reply\" part=\"reply\">`, rendered while a reply form is slotted\n * - Rules pair the element's roots (`:host > .comment`, a thread's `:host(:state(in-comment)) > .comments`) with\n * Fomantic's static selectors (`.ui.comments .comment`, `.comment > .comments`).\n * The DOM element's position replaces `:first-child`.\n * - A comment owns its content parts: `<ui-avatar>`, `<ui-content>`, `<ui-author>`, `<ui-meta>`,\n * `<ui-description>`, `<ui-actions>` style themselves `:state(in-comment)` (`UIParts.css`), the content beside the\n * avatar; this sheet is the list, the comment box and the threads.\n * - Public tokens (`--ui-comments-*`, `--ui-comment-*`) are NEVER declared here: the top list reads each through a\n * private alias (`--_ui-comment-distance: var(--ui-comment-distance, 0.5em)`), which its comments and threads\n * inherit and read. So a value set on `:root`, an ancestor, the DOM element or `::part(comments)` reaches every\n * comment (`notes/theming.md` \"Component tokens\"). A comment in a list or a thread never re-declares them;\n * a LONE `<ui-comment>` outside a list (`:host(:not(:state(in-comments)))`) declares its own.\n * - the parts' look tokens (`--ui-comment-author-color` ...) are declared nowhere: `UIParts.css` reads them\n * - The top list declares the variation tokens its threads and parts read, and they inherit all the way down:\n * `--_ui-comments-minimal` (`UIParts.css`: actions hidden until the comment is hovered or holds focus),\n * `--_comments-threaded` (the line down each thread), `--ui-inverted` + `color-scheme`. A thread declares none\n * of them: it has no variations of its own.\n * - NOTE: left out, on purpose:\n * - the reply form's textarea height (`.reply.form textarea`): a `<ui-textarea>` sizes itself (`rows`)\n * - `.comment > .comments::before` (an empty positioned pseudo-element in Fomantic)\n */\n\n@layer ui.components.comment.types, ui.components.comment.content, ui.components.comment.variations, ui.components.comment.states;\n\n/*******************************\n Comments\n*******************************/\n\n@layer ui.components.comment.types {\n /* DOM elements: no box of their own; the roots are the list, the thread and the comment. */\n :host {\n display: contents;\n }\n\n /* Tokens: one private alias per `comment.variables` entry that still matters; threads inherit them.\n Declared on the top list AND on a LONE comment (outside a list), which has none to inherit from; a comment\n in a list declares none, so it keeps the list's. */\n .ui.comments,\n :host(:not(:state(in-comments))) {\n --_ui-comments-max-width: var(--ui-comments-max-width, calc(var(--ui-font-size) * 40.625));\n --_ui-comments-margin: var(--ui-comments-margin, 1.5em);\n --_ui-comment-distance: var(--ui-comment-distance, 0.5em);\n --_ui-comment-line-height: var(--ui-comment-line-height, 1.2);\n --_ui-comments-thread-margin: var(--ui-comments-thread-margin, 0 0 0.5em 0.5em);\n --_ui-comments-thread-padding: var(--ui-comments-thread-padding, 1em 0 1em 1em);\n --_ui-comments-threaded-margin: var(--ui-comments-threaded-margin, -1.5em 0 -1em 1.25em);\n --_ui-comments-threaded-padding: var(--ui-comments-threaded-padding, 3em 0 2em 2.25em);\n --_ui-comments-threaded-line: var(\n --ui-comments-threaded-line,\n calc(var(--ui-border-width) * -1) 0 0 var(--ui-border-color)\n );\n --_ui-comments-reply-distance: var(--ui-comments-reply-distance, 1em);\n --_ui-comments-disabled-opacity: var(--ui-comments-disabled-opacity, var(--ui-disabled-opacity));\n }\n .ui.comments {\n /* Variations, read by threads and parts. */\n --_ui-comments-minimal: 0;\n --_comments-threaded: 0;\n /* Owner token, ALWAYS declared: a plain list nested in an inverted one resets it. */\n --ui-inverted: 0;\n }\n\n /* Comments: a column no wider than a comfortable line. */\n .ui.comments {\n box-sizing: border-box;\n max-width: var(--_ui-comments-max-width);\n margin: var(--_comments-margin-top, var(--_ui-comments-margin)) 0\n var(--_comments-margin-bottom, var(--_ui-comments-margin));\n color: var(--ui-text-color);\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n }\n .ui.comments:first-child {\n --_comments-margin-top: 0;\n }\n .ui.comments:last-child {\n --_comments-margin-bottom: 0;\n }\n /* Shadow DOM: the root is always an only child, so the DOM element's position decides. */\n :host(:not(:first-child)) > .ui.comments {\n --_comments-margin-top: initial;\n }\n :host(:not(:last-child)) > .ui.comments {\n --_comments-margin-bottom: initial;\n }\n /* Components inside don't scale twice. */\n .ui.comments > slot {\n --ui-scale: initial;\n }\n\n /*******************************\n Comment\n *******************************/\n\n /* Comment: spaced from the one before; the box its minimal actions are placed in. */\n :host > .comment,\n .ui.comments .comment {\n position: relative;\n margin: var(--_ui-comment-distance) 0 0;\n padding: var(--_ui-comment-distance) 0 0;\n border: none;\n background: none;\n line-height: var(--_ui-comment-line-height);\n }\n :host(:first-child) > .comment,\n .ui.comments .comment:first-child {\n margin-top: 0;\n padding-top: 0;\n }\n\n /* A thread of replies inside a comment. */\n :host(:state(in-comment)) > .comments,\n .ui.comments .comment > .comments {\n margin: var(--_ui-comments-thread-margin);\n padding: var(--_ui-comments-thread-padding);\n }\n}\n\n/*******************************\n Content\n*******************************/\n\n@layer ui.components.comment.content {\n /* A reply form below the list, or below a comment. */\n :is(.comments, .comment) > .reply,\n .ui.comments > .reply.form {\n margin-top: var(--_ui-comments-reply-distance);\n }\n .comment > .reply,\n .ui.comments .comment .reply.form {\n width: 100%;\n }\n /* Static markup: the reply textarea. */\n .ui.comments .reply.form textarea {\n height: 12em;\n font-size: 1em;\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.comment.variations {\n /* Threaded: a line down the left of each thread of replies. */\n .ui.threaded.comments {\n --_comments-threaded: 1;\n }\n .ui.threaded.comments .comment > .comments {\n margin: var(--_ui-comments-threaded-margin);\n padding: var(--_ui-comments-threaded-padding);\n box-shadow: var(--_ui-comments-threaded-line);\n }\n @container style(--_comments-threaded: 1) {\n :host(:state(in-comment)) > .comments {\n margin: var(--_ui-comments-threaded-margin);\n padding: var(--_ui-comments-threaded-padding);\n box-shadow: var(--_ui-comments-threaded-line);\n }\n }\n\n /* Minimal: each comment's actions wait for hover or focus (`UIParts.css`). */\n .ui.minimal.comments {\n --_ui-comments-minimal: 1;\n }\n\n /* Inverted: the dark scheme, and a dark surface behind each comment. */\n .ui.inverted.comments {\n --ui-inverted: 1;\n --ui-scheme: dark;\n color-scheme: dark;\n }\n .ui.inverted.comments .comment {\n background-color: var(--ui-surface);\n }\n @container style(--ui-inverted: 1) {\n :host(:state(in-comments)) > .comment {\n background-color: var(--ui-surface);\n }\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.comment.states {\n /* Collapsed: folded away. */\n .ui.collapsed.comments,\n .ui.comments .collapsed:is(.comments, .comment),\n :host > .collapsed:is(.comments, .comment) {\n display: none;\n }\n\n /* Disabled: faded and inert. */\n .ui.disabled.comments,\n .ui.comments .disabled.comment,\n :host > .disabled:is(.comments, .comment) {\n opacity: var(--_ui-comments-disabled-opacity);\n pointer-events: none;\n }\n}\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { commentVocabulary } from \"./UIComment.en\"\n\nimport commentCSS from \"./UIComment.css?inline\"\n\n/****************\n * ### `UIComment`\n * The component behind `<ui-comment>`:\n * one comment, `<article class=\"[keyOnly ...] comment\" part=\"comment\"><slot></slot></article>`,\n * then the `reply` slot's box (`<div class=\"reply\" part=\"reply\">`) when a reply form is slotted.\n *\n * - Why `<article>`: HTML names \"a user-submitted comment\" as its example of a self-contained composition,\n * and nests the replies' articles inside the comment they answer, as a thread of `<ui-comments>` inside does.\n *\n * - It owns its content parts (`ownsParts`):\n * `<ui-avatar>`, `<ui-content>`, `<ui-author>`, `<ui-meta>`, `<ui-description>` and `<ui-actions>`\n * get `:state(in-comment)`; a `<ui-comments>` inside is its thread.\n *\n * - In a `<ui-comments>` (`PartContext`, noun `comment`): `:state(in-comments)`.\n *\n * - `disabled`: unusable, the base class's way (`elementSetup.disabled`):\n * faded, the article inert, `aria-disabled`.\n ****************/\nexport class UIComment extends E.UIComponent<typeof commentVocabulary> {\n @E.proto static vocabulary = commentVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { comment: commentCSS },\n cssStates: [\"collapsed\"],\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n /** Its comment list, if any. */\n readonly context = new E.PartContext({ domElement: this.domElement, noun: this.vocabulary.noun })\n\n /** Light-DOM slot occupancy. */\n readonly slots = new E.SlotContent(this.domElement)\n\n render(): JSX.Element {\n return (\n <article class={this.rootClass} part={this.partForName(\"comment\")}>\n <slot />\n <Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>\n </article>\n )\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIComment extends E.AttributeValues<typeof commentVocabulary> {}\n\n/** The class, part and slot of the reply box (`UIComments` draws one too). */\nconst REPLY = \"reply\"\n","/**\n * The English vocabulary of `<ui-comments>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), events, slots, parts, states and texts.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - The family's grammar notes are in `UIComment.en.ts`.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `commentsVocabulary`\n * The names of `<ui-comments>`, a comment list: `<div class=\"ui ... comments\">` of `<ui-comment>`s;\n * inside a comment, its thread of replies (`<div class=\"comments\">`).\n ****************/\nexport const commentsVocabulary = {\n tag: \"ui-comments\",\n icon: \"comments outline\",\n topics: [\"social\", \"lists\", \"data display\", \"views\"],\n aka: [\"discussion\", \"thread\", \"replies\"],\n noun: \"comments\",\n description: \"A list of comments, or the thread of replies to one.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Text size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"threaded\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"A line down the left of each thread of replies.\"\n },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"minimal\"],\n // each word draws itself: no key after it\n classes: {},\n replaces: [{ from: \"minimal\", value: \"minimal\" }],\n description:\n \"The look: `minimal`, each comment's actions hidden until the comment is hovered (and shown to keyboard \" +\n \"focus). Old name: `minimal`.\"\n },\n { name: \"inverted\", group: \"appearance\", kind: \"keyOnly\", description: \"For dark backgrounds: the dark scheme.\" },\n { name: \"collapsed\", group: \"states\", kind: \"keyOnly\", description: \"Hidden: a thread of replies folded away.\" },\n { name: \"disabled\", group: \"states\", kind: \"keyOnly\", description: \"Faded and inert.\" }\n ],\n events: [],\n slots: [\n { name: \"\", description: \"`<ui-comment>`s, and a heading (`<ui-header dividing>`).\" },\n { name: \"reply\", description: \"A reply form (`<ui-form>`) below the comments.\" }\n ],\n parts: [\n { name: \"comments\", description: \"The comment list box.\" },\n { name: \"reply\", description: \"The box around the `reply` slot.\" }\n ],\n states: [\n { name: \"in-comment\", description: 'Inside a comment: its thread of replies (`class=\"comments\"`, no `ui`).' },\n { name: \"collapsed\", description: \"`collapsed`.\" }\n ],\n texts: [],\n ownsParts: [\"comment\"]\n} as const satisfies E.ComponentVocabulary\n","import { Show } from \"solid-js\"\nimport type { JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\nimport { commentsVocabulary } from \"./UIComments.en\"\n\nimport commentCSS from \"./UIComment.css?inline\"\n\n/****************\n * ### `UIComments`\n * The component behind `<ui-comments>`:\n * a list of comments, `<div class=\"ui [size] [keyOnly ...] comments\" part=\"comments\"><slot></slot></div>`,\n * then the `reply` slot's box (`<div class=\"reply\" part=\"reply\">`) when a reply form is slotted.\n *\n * - It owns its comments (`ownsParts: comment`): each `<ui-comment>` gets `:state(in-comments)`.\n *\n * - Inside a `<ui-comment>` (`PartContext`, noun `comments`), it is that comment's THREAD of replies:\n * `<div class=\"[collapsed] comments\">`, no `ui`, no variations of its own.\n * It inherits the outer list's (`threaded`, `minimal`, `inverted` ...) as tokens,\n * as Fomantic's `.ui.threaded.comments .comment > .comments` has it.\n *\n * - No role: each comment is an `<article>`, which is the structure a reader moves through.\n *\n * - `disabled`: unusable, the base class's way (`elementSetup.disabled`):\n * faded, what's inside inert, `aria-disabled`.\n ****************/\nexport class UIComments extends E.UIComponent<typeof commentsVocabulary> {\n @E.proto static vocabulary = commentsVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { comment: commentCSS },\n cssStates: [\"collapsed\"],\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n /** The comment this is the thread of, if any. */\n readonly context = new E.PartContext({ domElement: this.domElement, noun: this.vocabulary.noun })\n\n /** Light-DOM slot occupancy. */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** A thread of replies inside a comment. */\n get isThread(): boolean {\n return !!this.context.owner\n }\n\n render(): JSX.Element {\n return (\n <div class={this.isThread ? this.threadClasses : this.rootClass} part={this.partForName(\"comments\")}>\n <slot />\n <Show when={this.slots.hasContent(this.slotForName(\"reply\"))}>\n <div class={REPLY} part={this.partForName(\"reply\")}>\n <slot name={this.slotForName(\"reply\")} />\n </div>\n </Show>\n </div>\n )\n }\n\n /** A thread's classes: the noun, and `collapsed` / `disabled`, which a thread keeps. */\n @E.derived\n private get threadClasses(): string {\n return [this.collapsed ? COLLAPSED : \"\", this.disabled ? UIT.DISABLED : \"\", this.vocabulary.noun]\n .filter(Boolean)\n .join(\" \")\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIComments extends E.AttributeValues<typeof commentsVocabulary> {}\n\n/** The class, part and slot of the reply box (`UIComment` draws one too). */\nconst REPLY = \"reply\"\n\n/** The class word a thread of replies keeps (`collapsed comments`). */\nconst COLLAPSED = \"collapsed\"\n","/**\n * The comment family: defines `<ui-comments>` and `<ui-comment>`,\n * and exports their components, `UIComments` and `UIComment`.\n * - SIDE EFFECT: importing it defines the tags, and the generic content parts through the parts barrel,\n * so a page never has to import what its comments hold.\n * - Also the library's `spell/ui/ui-comment` entry (its size is in `notes/report.md`).\n */\n\nimport { UIComment } from \"./UIComment\"\nimport { UIComments } from \"./UIComments\"\n\nimport \"spell/ui/components/ui-parts\"\n\nUIComments.define()\nUIComment.define()\n\nexport { UIComment, UIComments }\n"],"mappings":";;;;;;AAoBA,IAAaoD,IAAoB;CAC/B,KAAK;CACL,MAAM;CACN,QAAQ;EAAC;EAAU;EAAiB;CAAO;CAC3C,KAAK;EAAC;EAAS;EAAQ;CAAS;CAChC,UAAU;CACV,MAAM;CACN,IAAI;CACJ,aAAa;CACb,YAAY,CACV;EAAE,MAAM;EAAa,OAAO;EAAU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,GAjCWK,CAAA,GACF5C,EAAA2C,GAAA,IAAO,cAAhBF,GADWG,CAAA,GAEI5C,EAAA2C,GAAA,IAAO,gBAAtBH,GAFWI,CAAA,GAAN3C,EAAA0C,GAAMC,CAAA,GAA4DhD,EAAAgD,GAAA,YAAA,GAC9D7C,EADE6C,GACK,cAAa1C,EAApByC,GAAA,GADEC,GACkBP,CAAA,CAAA,GAApBnC,EAAAyC,GAAA,IADEC,CAAA,GAEI7C,EAFJ6C,GAEW,gBAAe1C,EAAtByC,GAAA,IAFJC,GAE0B;CACnC,aAAa,EAAE,SAAS/C,EAAW;CACnC,WAAW,CAAC,WAAW;CACvB,gBAAgB;AAClB,CAAA,CAAA,GAJeK,EAAAyC,GAAA,IAFJC,CAAA;AAAN,IAAMI,IAANJ,GA6CDE,IAAQ,SAGRC,IAAY;AC7DlBC,EAAW,OAAO,GAClBZ,EAAU,OAAO"}
|
package/dist/ui-components.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./rolldown-runtime-CYGlBXrH.js";
|
|
2
|
-
import { Bt as e,
|
|
2
|
+
import { Bt as e, Ht as t, LoadOnce as n, Lt as r, Rt as i, UIComponent as a, Ut as o, Warnings as s, proto as c, protoMerged as l, zt as u } from "./core.js";
|
|
3
3
|
//#region src/components/ui-components/ComponentPacks.ts
|
|
4
4
|
var d = class ComponentPacks {
|
|
5
5
|
static packs = /* @__PURE__ */ new Map();
|
|
6
6
|
static catalog = /* @__PURE__ */ new Map();
|
|
7
7
|
static prefixes = /* @__PURE__ */ new Set();
|
|
8
|
-
static loads = new
|
|
8
|
+
static loads = new n();
|
|
9
9
|
static pending = /* @__PURE__ */ new Set();
|
|
10
10
|
static reloading = /* @__PURE__ */ new Map();
|
|
11
11
|
static defining = /* @__PURE__ */ new Map();
|
|
@@ -19,7 +19,7 @@ var d = class ComponentPacks {
|
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
if (n) {
|
|
22
|
-
|
|
22
|
+
s.warn("registerPack()", `a pack named "${e.name}" is registered already; this one is ignored`), t?.resolve(n);
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
let i;
|
|
@@ -164,6 +164,7 @@ function registerPack(e) {
|
|
|
164
164
|
}
|
|
165
165
|
var f = "swap", p = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*-$/, m = "ui-", h = /(?:\.pack)?\.js$/, g = "source", _ = {
|
|
166
166
|
tag: "ui-components",
|
|
167
|
+
icon: "cubes",
|
|
167
168
|
topics: ["loading", "modules"],
|
|
168
169
|
aka: [
|
|
169
170
|
"component pack",
|
|
@@ -185,13 +186,13 @@ var f = "swap", p = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*-$/, m = "ui-", h = /(?:\.pac
|
|
|
185
186
|
parts: [],
|
|
186
187
|
states: [],
|
|
187
188
|
texts: []
|
|
188
|
-
}, v = "@layer ui.components.components.types{:host{display:none}}", y, b, x, S, C = class _UIComponents extends (x =
|
|
189
|
+
}, v = "@layer ui.components.components.types{:host{display:none}}", y, b, x, S, C = class _UIComponents extends (x = a, b = [c], y = [l], x) {
|
|
189
190
|
render() {}
|
|
190
191
|
};
|
|
191
|
-
S =
|
|
192
|
+
S = u(x), r(S, 13, "vocabulary", b, C), r(S, 13, "elementSetup", y, C), i(S, C), e(C, "UIComponents"), t(C, "vocabulary", o(S, 8, C, _)), o(S, 11, C), t(C, "elementSetup", o(S, 12, C, {
|
|
192
193
|
styleSheets: { components: v },
|
|
193
194
|
delegatesFocus: !1
|
|
194
|
-
})),
|
|
195
|
+
})), o(S, 15, C);
|
|
195
196
|
var w = C;
|
|
196
197
|
//#endregion
|
|
197
198
|
//#region src/components/ui-components/index.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-components.js","names":["E.LoadOnce","E.UIComponent","E.proto","E.protoMerged","__name","componentsCSS","__publicField","__decorateElement","__decoratorMetadata","__decoratorStart","__name$1","__runInitializers","ComponentPacks","LoadOnce","pack","pending","known","reload","Warnings","defined","error","tag","entry","url","source","name","script","reject","RELOAD_PARAM","defining","prefix","file","path","PACK_FILE_SUFFIX","scripts","next","changed","swap","folders","folder","message","running","byName","PACK_PREFIX","UI_PREFIX","catalog","strays","problem","SOURCE","componentsVocabulary","UIComponents_default","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIComponents","UIComponent","proto","protoMerged","UIComponents"],"sources":["../src/components/ui-components/ComponentPacks.ts","../src/components/ui-components/UIComponents.types.ts","../src/components/ui-components/UIComponents.en.ts","../src/components/ui-components/UIComponents.css?inline","../src/components/ui-components/UIComponents.ts","../src/components/ui-components/index.ts"],"sourcesContent":["import { E } from \"spell/ui/core\"\nimport type { RootCatalogEntry } from \"spell/ui/components/ui-root/UIRoot.types\"\nimport type { ComponentPack, PackSwap, PackSwapResult } from \"./UIComponents.types\"\n\n/****************\n * ### `ComponentPacks`\n * The page's component packs: their catalogs and tag prefixes, and the loads of their scripts, once per page.\n * - Static: one registry per page, shared by every `<ui-root>`, like `RootLoader`'s family loads.\n * - A pack is a CLASSIC script (`<script src>`, so it works from `file://`):\n * `load()` adds one, and the script calls `registerPack()` as it runs.\n * That finds the load by `document.currentScript` (else by the name its file implies),\n * defines the pack's tags and resolves it.\n * - A pack's script REBUILT (a merge): `reload()` runs it again in place, its changed families swapped into the live\n * elements by the page's hot replacement (`PackSwap`, Spell UI's `PackHotSwap`), so the page needn't reload.\n * - Plain DOM, no Solid: `<ui-root>` asks it what a tag is (`entryOf()`, `owns()`), and it knows nothing of roots.\n ****************/\nexport class ComponentPacks {\n /** Name => the registered pack. */\n private static readonly packs = new Map<string, ComponentPack>()\n\n /** Tag => its entry, from every registered pack's catalog. */\n private static readonly catalog = new Map<string, RootCatalogEntry>()\n\n /** Every registered pack's tag prefix. */\n private static readonly prefixes = new Set<string>()\n\n /** Resolved script URL => its load, started once per page; a failure is the answer for good. */\n private static readonly loads = new E.LoadOnce<string, ComponentPack>()\n\n /** Loads whose script hasn't registered its pack yet. */\n private static readonly pending = new Set<PendingPack>()\n\n /** Pack name => its reload under way (`reload()`): its script's `register()` swaps it in instead of being ignored. */\n private static readonly reloading = new Map<string, PackReload>()\n\n /** Pack name => its `define()` while it still runs (it loads its families first): its tags are listed, not yet defined. */\n private static readonly defining = new Map<string, Promise<unknown>>()\n\n ////////////////\n // ## Registering and loading\n ////////////////\n\n /**\n * Register `pack`: define its tags (`pack.define()`), add its catalog and prefix,\n * and resolve the load of the script calling this (if `load()` started it).\n * - A `define()` that returns a promise (it loads its families first) resolves the load once that settles,\n * or fails it; without a load to fail, a console error says why.\n * - A second pack with a registered name is ignored, with a console warning: its tags are defined already.\n * - Throws a `TypeError` on a malformed pack; rethrows what `define()` throws, after failing the load.\n */\n static register(pack: ComponentPack): void {\n ComponentPacks.check(pack)\n const pending = ComponentPacks.pendingFor(pack.name)\n if (pending) ComponentPacks.pending.delete(pending)\n const known = ComponentPacks.packs.get(pack.name)\n const reload = ComponentPacks.reloading.get(pack.name)\n if (known && reload) {\n ComponentPacks.reloading.delete(pack.name)\n ComponentPacks.swapIn(known, pack, reload)\n return\n }\n if (known) {\n E.Warnings.warn(\"registerPack()\", `a pack named \"${pack.name}\" is registered already; this one is ignored`)\n pending?.resolve(known)\n return\n }\n let defined: void | Promise<unknown>\n try {\n defined = pack.define()\n } catch (error) {\n pending?.reject(ComponentPacks.asError(error))\n throw error\n }\n ComponentPacks.packs.set(pack.name, pack)\n ComponentPacks.prefixes.add(pack.prefix)\n for (const [tag, entry] of Object.entries(pack.catalog)) ComponentPacks.catalog.set(tag, entry)\n if (!(defined instanceof Promise)) {\n pending?.resolve(pack)\n return\n }\n ComponentPacks.defining.set(pack.name, defined)\n const settled = () => ComponentPacks.defining.delete(pack.name)\n defined.then(settled, settled)\n defined.then(\n () => pending?.resolve(pack),\n (error: unknown) => {\n if (pending) pending.reject(ComponentPacks.asError(error))\n else console.error(`registerPack(): pack \"${pack.name}\" couldn't define its tags:`, error)\n }\n )\n }\n\n /**\n * Load the pack at `source` (relative to the page) as a classic script, ONCE per page;\n * resolves with the pack once its script registered it.\n * - A pack already registered under the name its file implies (a page's own `<script src>`, an ES import)\n * resolves at once, with no second script.\n * - Rejects when the script can't load, ran without registering a pack, or its `define()` failed. NEVER throws.\n */\n static load(source: string): Promise<ComponentPack> {\n let url: string\n try {\n url = new URL(source, document.baseURI).href\n } catch (error) {\n return Promise.reject(error instanceof Error ? error : new Error(String(error)))\n }\n return ComponentPacks.loads.get(url, () => {\n const known = ComponentPacks.packs.get(ComponentPacks.nameFor(url))\n return known ? Promise.resolve(known) : ComponentPacks.inject(url)\n })\n }\n\n /**\n * Run the REBUILT script of a registered pack, at `source`, in place: its `define()` runs again, and `swap` swaps\n * the families whose sources changed into the live elements; the others keep their classes.\n * - Resolves `\"swapped\"`; `\"reload\"` when only a page reload can show it:\n * - a tag the old pack didn't have (`<ui-root>` defines its catalog's tags before their families load)\n * - a change the platform can't take in place (`swap.finish()`: observed attributes ...)\n * - Resolves `\"none\"` for a pack that isn't on the page: nothing to swap.\n * - Which families changed: the pack's `families` hashes, old against new; a pack built without them: all of them.\n * - Rejects when the script can't load, or its `define()` throws. NEVER throws.\n */\n static reload(source: string, swap: PackSwap): Promise<PackSwapResult> {\n let url: URL\n try {\n url = new URL(source, document.baseURI)\n } catch (error) {\n return Promise.reject(ComponentPacks.asError(error))\n }\n const name = ComponentPacks.nameFor(url.href)\n if (!ComponentPacks.packs.has(name)) return Promise.resolve(\"none\")\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\")\n ComponentPacks.reloading.set(name, { swap, resolve, reject })\n script.onerror = () => {\n if (ComponentPacks.reloading.delete(name)) reject(new Error(`ComponentPacks.reload(): can't load ${url.href}`))\n }\n script.onload = () => {\n if (ComponentPacks.reloading.delete(name))\n reject(new Error(`ComponentPacks.reload(): ${url.href} registered no pack`))\n script.remove()\n }\n // a new URL, so the browser fetches the rebuilt file, not its cached copy\n url.searchParams.set(RELOAD_PARAM, String(Date.now()))\n script.src = url.href\n document.head.append(script)\n })\n }\n\n ////////////////\n // ## What a root asks\n ////////////////\n\n /** The catalog entry of `tag`, from the registered packs; `undefined` for a tag no pack lists. */\n static entryOf(tag: string): RootCatalogEntry | undefined {\n return ComponentPacks.catalog.get(tag)\n }\n\n /**\n * While `tag`'s pack is still defining its tags (an async `define()`): resolves once it's done; else `undefined`.\n * - So a root that finds one of them undefined in that time waits for it, rather than calling it failed.\n */\n static whileDefining(tag: string): Promise<void> | undefined {\n if (!ComponentPacks.catalog.has(tag)) return undefined\n for (const [name, defining] of ComponentPacks.defining) {\n const prefix = ComponentPacks.packs.get(name)?.prefix\n if (prefix && tag.startsWith(prefix)) return defining.then(() => undefined)\n }\n return undefined\n }\n\n /** Does `tag` have a registered pack's prefix? Then a root loads (or reports) it, as it does `ui-*` tags. */\n static owns(tag: string): boolean {\n for (const prefix of ComponentPacks.prefixes) if (tag.startsWith(prefix)) return true\n return false\n }\n\n /**\n * The URL a registered pack's script was loaded from, when changed file `path` (a served path, as the page server\n * reports it: `/_epic/pack/epics.pack.js`) is that script; else `undefined`.\n * - matched by the pack name its file implies (`nameFor()`): a worktree's page names its files by another path\n */\n static sourceOf(path: string): string | undefined {\n const file = path.split(\"/\").pop() ?? \"\"\n if (!PACK_FILE_SUFFIX.test(file)) return undefined\n const name = file.replace(PACK_FILE_SUFFIX, \"\")\n if (!ComponentPacks.packs.has(name)) return undefined\n const scripts = Array.from(document.querySelectorAll<HTMLScriptElement>(\"script[src]\"), (script) => script.src)\n return [...ComponentPacks.loads.keys(), ...scripts].find((url) => ComponentPacks.nameFor(url) === name)\n }\n\n /** The pack name a script URL implies: `.../epics/components/__pack/epics.pack.js` => `epics`, `x.js` => `x`. */\n static nameFor(url: string): string {\n const file = new URL(url).pathname.split(\"/\").pop() ?? \"\"\n return file.replace(PACK_FILE_SUFFIX, \"\")\n }\n\n ////////////////\n // ## Internal\n ////////////////\n\n /**\n * Swap pack `next`, the rebuilt script of `known`, into the page (`reload()`): its `define()` again, keeping the\n * families whose hashes didn't change (`swap.keep()`), then the live elements re-rendered (`swap.finish()`).\n */\n private static swapIn(known: ComponentPack, next: ComponentPack, { swap, resolve, reject }: PackReload) {\n try {\n ComponentPacks.check(next)\n } catch (error) {\n reject(ComponentPacks.asError(error))\n return\n }\n if (Object.keys(next.catalog).some((tag) => !(tag in known.catalog))) {\n resolve(\"reload\")\n return\n }\n const changed = ComponentPacks.changedFamilies(known, next)\n swap.keep((tag) => !!changed && !changed.has(known.catalog[tag]?.folder ?? \"\"))\n const done = () => swap.keep(undefined)\n Promise.resolve()\n .then(() => next.define())\n .then(\n () => {\n done()\n ComponentPacks.packs.set(next.name, next)\n for (const [tag, entry] of Object.entries(next.catalog)) ComponentPacks.catalog.set(tag, entry)\n resolve(swap.finish() ? \"swapped\" : \"reload\")\n },\n (error: unknown) => {\n done()\n reject(ComponentPacks.asError(error))\n }\n )\n }\n\n /**\n * The family folders whose sources differ between `known` and `next` (their `families` hashes);\n * `undefined` (every family) when either was built without them.\n */\n private static changedFamilies(known: ComponentPack, next: ComponentPack): Set<string> | undefined {\n if (!known.families || !next.families) return undefined\n const folders = new Set([...Object.keys(known.families), ...Object.keys(next.families)])\n return new Set([...folders].filter((folder) => known.families![folder] !== next.families![folder]))\n }\n\n /** Add a `<script>` for `url`; resolves when it registers its pack, rejects when it fails to. */\n private static inject(url: string): Promise<ComponentPack> {\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\")\n const pending: PendingPack = { script, name: ComponentPacks.nameFor(url), resolve, reject }\n // registering takes the load out of `pending` (the script runs before `load` fires),\n // so these only fail a script that never registered: NOT one whose `define()` is still loading its families\n const fail = (message: string) => {\n if (!ComponentPacks.pending.delete(pending)) return\n reject(new Error(`ComponentPacks.load(): ${message}`))\n }\n script.onload = () => fail(`${url} ran, but registered no pack; it must call SpellUI.registerPack()`)\n script.onerror = () => fail(`can't load ${url}`)\n script.src = url\n ComponentPacks.pending.add(pending)\n document.head.append(script)\n })\n }\n\n /** The load waiting for the script running now, else for a pack named `name`. */\n private static pendingFor(name: string): PendingPack | undefined {\n const running = document.currentScript\n let byName: PendingPack | undefined\n for (const pending of ComponentPacks.pending) {\n if (pending.script === running) return pending\n if (pending.name === name) byName ??= pending\n }\n return byName\n }\n\n /** `error` as an `Error`, to reject a load with. */\n private static asError(error: unknown): Error {\n return error instanceof Error ? error : new Error(String(error))\n }\n\n /** Throw a `TypeError` naming what's wrong with `pack`. */\n private static check(pack: ComponentPack) {\n if (typeof pack?.name !== \"string\" || !pack.name) fail(\"a pack needs a `name`\")\n const { name, prefix, catalog } = pack\n if (typeof prefix !== \"string\" || !PACK_PREFIX.test(prefix) || prefix === UI_PREFIX) {\n fail(`pack \"${name}\": \\`prefix\\` must be lowercase words ending in \"-\" (\\`epic-\\`), never \"${UI_PREFIX}\"`)\n }\n if (typeof pack.define !== \"function\") fail(`pack \"${name}\": \\`define()\\` must define its tags`)\n if (typeof catalog !== \"object\" || catalog === null) fail(`pack \"${name}\": \\`catalog\\` must map its tags`)\n const strays = Object.keys(catalog).filter((tag) => !tag.startsWith(prefix))\n if (strays.length) fail(`pack \"${name}\": every tag starts with \"${prefix}\", not ${strays.join(\", \")}`)\n\n function fail(problem: string): never {\n throw new TypeError(`registerPack(): ${problem}`)\n }\n }\n}\n\n/**\n * Register a component pack: `ComponentPacks.register()`, under the name packs call it by,\n * `SpellUI.registerPack(pack)` (the docs bundle) or `registerPack(pack)` from `spell/ui`.\n */\nexport function registerPack(pack: ComponentPack): void {\n ComponentPacks.register(pack)\n}\n\n/** A pack load waiting for its script to call `registerPack()`. */\ntype PendingPack = {\n /** The `<script>` loading it: `document.currentScript` while it runs. */\n readonly script: HTMLScriptElement\n /** The name its URL implies (`ComponentPacks.nameFor()`): the match when `document.currentScript` is gone. */\n readonly name: string\n /** Resolve the load with the registered pack. */\n readonly resolve: (pack: ComponentPack) => void\n /** Fail the load. */\n readonly reject: (error: Error) => void\n}\n\n/** A reload under way (`reload()`): how to swap the new pack in, and its promise's ends. */\ntype PackReload = {\n readonly swap: PackSwap\n readonly resolve: (result: PackSwapResult) => void\n readonly reject: (error: Error) => void\n}\n\n/** The query `reload()` adds to a pack's URL, so the browser fetches the rebuilt script: `epics.pack.js?swap=...`. */\nconst RELOAD_PARAM = \"swap\"\n\n/** A pack's tag prefix: lowercase words joined by `-`, ending in `-` (`epic-`, `x-`, `my-app-`). */\nconst PACK_PREFIX = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*-$/\n\n/** Spell UI's own prefix, which no pack may take. */\nconst UI_PREFIX = \"ui-\"\n\n/** What a pack's file name ends in, after its name: `epics.pack.js`, else plain `.js`. */\nconst PACK_FILE_SUFFIX = /(?:\\.pack)?\\.js$/\n","/**\n * The types and constants the `ui-components` family's files share:\n * - its component (`UIComponents`) and its vocabulary\n * - `ComponentPacks` (the page's registry of component packs)\n * - `<ui-root>`, which reads `source`\n *\n * - Pure data: `import type` only (a pack's catalog has the shape of `<ui-root>`'s own), so node can load it.\n */\n\nimport type { RootCatalogEntry } from \"spell/ui/components/ui-root/UIRoot.types\"\n\nimport type { componentsVocabulary } from \"./UIComponents.en\"\n\n/** `componentsVocabulary`'s type. */\nexport type ComponentsVocabulary = typeof componentsVocabulary\n\n/** The attribute naming a pack's script: `<ui-components source>`, which `<ui-root>` reads. */\nexport const SOURCE = \"source\"\n\n/**\n * A COMPONENT PACK: another package's custom elements (any tag prefix), loaded on demand by `<ui-root>`.\n * - A pack is a classic script calling `SpellUI.registerPack(pack)` as it runs (`ComponentPacks.register()`);\n * an ES module may call `registerPack()` from `spell/ui` itself.\n * - It shares the page's Solid and Spell UI (`SpellUI.packModules`), never bundling its own copy.\n */\nexport type ComponentPack = {\n /** Its name, unique on the page: `epics` for `epics.pack.js` (how a load finds its pack without `currentScript`). */\n readonly name: string\n /** The prefix of every tag it defines, ending in `-`: `epic-`. Never `ui-` (Spell UI's own). */\n readonly prefix: string\n /** Every tag it defines => what `<ui-root>` needs before it's ready (a skeleton); each tag starts with `prefix`. */\n readonly catalog: Readonly<Record<string, RootCatalogEntry>>\n /**\n * Define every tag of the pack; called once, by `registerPack()`.\n * - It may return a promise, when it loads its families first (`import()`):\n * the pack counts as loaded once that settles, so a `<ui-root>` waits for its tags.\n */\n define(): void | Promise<unknown>\n /**\n * Each family folder => a hash of the sources its script holds (`spell pack build`, epic `epic-engine` I116):\n * when the pack is rebuilt, `ComponentPacks.reload()` swaps in only the families whose hash changed.\n * - None (a pack built before): every family is swapped.\n */\n readonly families?: Readonly<Record<string, string>>\n}\n\n/**\n * How `ComponentPacks.reload()` swaps a rebuilt pack into the live elements: the page's hot replacement\n * (Spell UI's `PackHotSwap`, over the kit's `HotDefinitions`).\n */\nexport type PackSwap = {\n /** While its `define()` runs again: whether a tag KEEPS its live class (`true`: its family didn't change); `undefined` after. */\n keep(keeps: ((tag: string) => boolean) | undefined): void\n /** Re-render the swapped elements; `false` when a change needs a page reload (the platform can't take it in place). */\n finish(): boolean\n}\n\n/** What `ComponentPacks.reload()` did: swapped in place, needs a page reload, or no such pack on the page. */\nexport type PackSwapResult = \"swapped\" | \"reload\" | \"none\"\n","/**\n * Every name `<ui-components>` uses: tag, attributes (kind + allowed values), events, slots, parts, states, texts.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - No Fomantic counterpart and nothing to draw: one attribute, `source`, which the `<ui-root>` around it reads.\n * Its load and failures are the root's (`ui-ready`'s `failed`, `ui-error`), so it has no events of its own.\n * - No skeleton: it draws nothing.\n */\n\nimport type { E } from \"spell/ui/core\"\n\nimport { SOURCE } from \"./UIComponents.types\"\n\n/****************\n * ### `<ui-components>`\n * Names a COMPONENT PACK for the `<ui-root>` around it: another package's elements (`<epic-page>` ...), loaded on\n * demand like Spell UI's own. Draws nothing.\n ****************/\nexport const componentsVocabulary = {\n tag: \"ui-components\",\n topics: [\"loading\", \"modules\"],\n aka: [\"component pack\", \"plugin\", \"extension\", \"custom elements\", \"web components\", \"element library\"],\n noun: \"components\",\n description:\n \"Components name a pack of another package's elements, which the root around them loads on demand, once per page.\",\n attributes: [\n {\n name: SOURCE,\n kind: \"string\",\n description:\n \"URL of the pack's script (`epics.pack.js`), relative to the page. The root loads it once per page as a \" +\n \"classic script (so it works from `file://`) and waits for it before showing its content.\"\n }\n ],\n events: [],\n slots: [],\n parts: [],\n states: [],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","/*\n * `<ui-components>`: no Fomantic counterpart, and nothing to draw. It only names a component pack (`source`) for\n * the `<ui-root>` around it, so the DOM element never takes up space.\n */\n\n@layer ui.components.components.types;\n\n@layer ui.components.components.types {\n :host {\n display: none;\n }\n}\n","import type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { componentsVocabulary } from \"./UIComponents.en\"\nimport type { ComponentsVocabulary } from \"./UIComponents.types\"\n\nimport componentsCSS from \"./UIComponents.css?inline\"\n\n/****************\n * ### `UIComponents`\n * The component behind `<ui-components>`:\n * it names a component pack for the `<ui-root>` around it, `<ui-components source=\"epics.pack.js\">`.\n * Draws nothing.\n * - The ROOT does the work, reading `source` from the markup (defined or not):\n * it loads each distinct pack once per page (`ComponentPacks.load()`),\n * waits for it before it's ready, and draws skeletons from its catalog.\n * - Outside a root it does nothing: a page without one loads its pack with a plain `<script src>`.\n * - Defined with the root (its barrel imports this family), so it's never one of the tags a root waits for.\n ****************/\nexport class UIComponents extends E.UIComponent<ComponentsVocabulary> {\n @E.proto static vocabulary = componentsVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { components: componentsCSS },\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n render(): JSX.Element {\n return undefined\n }\n}\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIComponents extends E.AttributeValues<ComponentsVocabulary> {}\n","/**\n * The component-pack family: defines `<ui-components>` and exports its component, `UIComponents`, with\n * `ComponentPacks` (the page's registry and loader of packs) and `registerPack()` (what a pack's script calls).\n * - SIDE EFFECT: importing it defines `<ui-components>`.\n * - `<ui-root>`'s barrel imports this family, so a page with a root has all three.\n * - Also the library's `spell/ui/ui-components` entry.\n */\n\nimport { UIComponents } from \"./UIComponents\"\n\nUIComponents.define()\n\nexport { UIComponents }\nexport type { ComponentPack } from \"./UIComponents.types\"\nexport { ComponentPacks, registerPack } from \"./ComponentPacks\"\n"],"mappings":";;;AAgBA,IAAaY,IAAb,MAAa,eAAe;CAE1B,OAAwB,wBAAQ,IAAI,IAA2B;CAG/D,OAAwB,0BAAU,IAAI,IAA8B;CAGpE,OAAwB,2BAAW,IAAI,IAAY;CAGnD,OAAwB,QAAQ,IAAIZ,EAAkC;CAGtE,OAAwB,0BAAU,IAAI,IAAiB;CAGvD,OAAwB,4BAAY,IAAI,IAAwB;CAGhE,OAAwB,2BAAW,IAAI,IAA8B;CAcrE,OAAO,SAAS,GAA2B;EACzC,eAAe,MAAMc,CAAI;EACzB,IAAMC,IAAU,eAAe,WAAWD,EAAK,IAAI;EACnD,AAAIC,KAAS,eAAe,QAAQ,OAAOA,CAAO;EAClD,IAAMC,IAAQ,eAAe,MAAM,IAAIF,EAAK,IAAI,GAC1CG,IAAS,eAAe,UAAU,IAAIH,EAAK,IAAI;EACrD,IAAIE,KAASC,GAAQ;GAEnB,AADA,eAAe,UAAU,OAAOH,EAAK,IAAI,GACzC,eAAe,OAAOE,GAAOF,GAAMG,CAAM;GACzC;EACF;EACA,IAAID,GAAO;GAET,AADAE,EAAW,KAAK,kBAAkB,iBAAiBJ,EAAK,KAAK,8CAA8C,GAC3GC,GAAS,QAAQC,CAAK;GACtB;EACF;EACA,IAAIG;EACJ,IAAI;GACF,IAAUL,EAAK,OAAO;EACxB,SAASM,GAAO;GAEd,MADAL,GAAS,OAAO,eAAe,QAAQK,CAAK,CAAC,GACvCA;EACR;EAEA,AADA,eAAe,MAAM,IAAIN,EAAK,MAAMA,CAAI,GACxC,eAAe,SAAS,IAAIA,EAAK,MAAM;EACvC,KAAK,IAAM,CAACO,GAAKC,MAAU,OAAO,QAAQR,EAAK,OAAO,GA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GAApBtC,EAAA2C,GAAA,IADEC,CAAA,GAEIjD,EAFJiD,GAEW,gBAAe5C,EAAtB2C,GAAA,IAFJC,GAE0B;CACnC,aAAa,EAAE,YAAYlD,EAAc;CACzC,gBAAgB;AAClB,CAAA,CAAA,GAHeM,EAAA2C,GAAA,IAFJC,CAAA;AAAN,IAAMI,IAANJ;;;ACTPI,EAAa,OAAO"}
|
|
1
|
+
{"version":3,"file":"ui-components.js","names":["E.LoadOnce","E.UIComponent","E.proto","E.protoMerged","__name","componentsCSS","__name$1","__publicField","__decorateElement","__decoratorMetadata","__runInitializers","__decoratorStart","ComponentPacks","LoadOnce","pack","pending","known","reload","Warnings","defined","error","tag","entry","url","source","name","script","reject","RELOAD_PARAM","defining","prefix","file","path","PACK_FILE_SUFFIX","scripts","next","changed","swap","folders","folder","message","running","byName","PACK_PREFIX","UI_PREFIX","catalog","strays","problem","SOURCE","componentsVocabulary","UIComponents_default","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIComponents","UIComponent","proto","protoMerged","UIComponents"],"sources":["../src/components/ui-components/ComponentPacks.ts","../src/components/ui-components/UIComponents.types.ts","../src/components/ui-components/UIComponents.en.ts","../src/components/ui-components/UIComponents.css?inline","../src/components/ui-components/UIComponents.ts","../src/components/ui-components/index.ts"],"sourcesContent":["import { E } from \"spell/ui/core\"\nimport type { RootCatalogEntry } from \"spell/ui/components/ui-root/UIRoot.types\"\nimport type { ComponentPack, PackSwap, PackSwapResult } from \"./UIComponents.types\"\n\n/****************\n * ### `ComponentPacks`\n * The page's component packs: their catalogs and tag prefixes, and the loads of their scripts, once per page.\n * - Static: one registry per page, shared by every `<ui-root>`, like `RootLoader`'s family loads.\n * - A pack is a CLASSIC script (`<script src>`, so it works from `file://`):\n * `load()` adds one, and the script calls `registerPack()` as it runs.\n * That finds the load by `document.currentScript` (else by the name its file implies),\n * defines the pack's tags and resolves it.\n * - A pack's script REBUILT (a merge): `reload()` runs it again in place, its changed families swapped into the live\n * elements by the page's hot replacement (`PackSwap`, Spell UI's `PackHotSwap`), so the page needn't reload.\n * - Plain DOM, no Solid: `<ui-root>` asks it what a tag is (`entryOf()`, `owns()`), and it knows nothing of roots.\n ****************/\nexport class ComponentPacks {\n /** Name => the registered pack. */\n private static readonly packs = new Map<string, ComponentPack>()\n\n /** Tag => its entry, from every registered pack's catalog. */\n private static readonly catalog = new Map<string, RootCatalogEntry>()\n\n /** Every registered pack's tag prefix. */\n private static readonly prefixes = new Set<string>()\n\n /** Resolved script URL => its load, started once per page; a failure is the answer for good. */\n private static readonly loads = new E.LoadOnce<string, ComponentPack>()\n\n /** Loads whose script hasn't registered its pack yet. */\n private static readonly pending = new Set<PendingPack>()\n\n /** Pack name => its reload under way (`reload()`): its script's `register()` swaps it in instead of being ignored. */\n private static readonly reloading = new Map<string, PackReload>()\n\n /** Pack name => its `define()` while it still runs (it loads its families first): its tags are listed, not yet defined. */\n private static readonly defining = new Map<string, Promise<unknown>>()\n\n ////////////////\n // ## Registering and loading\n ////////////////\n\n /**\n * Register `pack`: define its tags (`pack.define()`), add its catalog and prefix,\n * and resolve the load of the script calling this (if `load()` started it).\n * - A `define()` that returns a promise (it loads its families first) resolves the load once that settles,\n * or fails it; without a load to fail, a console error says why.\n * - A second pack with a registered name is ignored, with a console warning: its tags are defined already.\n * - Throws a `TypeError` on a malformed pack; rethrows what `define()` throws, after failing the load.\n */\n static register(pack: ComponentPack): void {\n ComponentPacks.check(pack)\n const pending = ComponentPacks.pendingFor(pack.name)\n if (pending) ComponentPacks.pending.delete(pending)\n const known = ComponentPacks.packs.get(pack.name)\n const reload = ComponentPacks.reloading.get(pack.name)\n if (known && reload) {\n ComponentPacks.reloading.delete(pack.name)\n ComponentPacks.swapIn(known, pack, reload)\n return\n }\n if (known) {\n E.Warnings.warn(\"registerPack()\", `a pack named \"${pack.name}\" is registered already; this one is ignored`)\n pending?.resolve(known)\n return\n }\n let defined: void | Promise<unknown>\n try {\n defined = pack.define()\n } catch (error) {\n pending?.reject(ComponentPacks.asError(error))\n throw error\n }\n ComponentPacks.packs.set(pack.name, pack)\n ComponentPacks.prefixes.add(pack.prefix)\n for (const [tag, entry] of Object.entries(pack.catalog)) ComponentPacks.catalog.set(tag, entry)\n if (!(defined instanceof Promise)) {\n pending?.resolve(pack)\n return\n }\n ComponentPacks.defining.set(pack.name, defined)\n const settled = () => ComponentPacks.defining.delete(pack.name)\n defined.then(settled, settled)\n defined.then(\n () => pending?.resolve(pack),\n (error: unknown) => {\n if (pending) pending.reject(ComponentPacks.asError(error))\n else console.error(`registerPack(): pack \"${pack.name}\" couldn't define its tags:`, error)\n }\n )\n }\n\n /**\n * Load the pack at `source` (relative to the page) as a classic script, ONCE per page;\n * resolves with the pack once its script registered it.\n * - A pack already registered under the name its file implies (a page's own `<script src>`, an ES import)\n * resolves at once, with no second script.\n * - Rejects when the script can't load, ran without registering a pack, or its `define()` failed. NEVER throws.\n */\n static load(source: string): Promise<ComponentPack> {\n let url: string\n try {\n url = new URL(source, document.baseURI).href\n } catch (error) {\n return Promise.reject(error instanceof Error ? error : new Error(String(error)))\n }\n return ComponentPacks.loads.get(url, () => {\n const known = ComponentPacks.packs.get(ComponentPacks.nameFor(url))\n return known ? Promise.resolve(known) : ComponentPacks.inject(url)\n })\n }\n\n /**\n * Run the REBUILT script of a registered pack, at `source`, in place: its `define()` runs again, and `swap` swaps\n * the families whose sources changed into the live elements; the others keep their classes.\n * - Resolves `\"swapped\"`; `\"reload\"` when only a page reload can show it:\n * - a tag the old pack didn't have (`<ui-root>` defines its catalog's tags before their families load)\n * - a change the platform can't take in place (`swap.finish()`: observed attributes ...)\n * - Resolves `\"none\"` for a pack that isn't on the page: nothing to swap.\n * - Which families changed: the pack's `families` hashes, old against new; a pack built without them: all of them.\n * - Rejects when the script can't load, or its `define()` throws. NEVER throws.\n */\n static reload(source: string, swap: PackSwap): Promise<PackSwapResult> {\n let url: URL\n try {\n url = new URL(source, document.baseURI)\n } catch (error) {\n return Promise.reject(ComponentPacks.asError(error))\n }\n const name = ComponentPacks.nameFor(url.href)\n if (!ComponentPacks.packs.has(name)) return Promise.resolve(\"none\")\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\")\n ComponentPacks.reloading.set(name, { swap, resolve, reject })\n script.onerror = () => {\n if (ComponentPacks.reloading.delete(name)) reject(new Error(`ComponentPacks.reload(): can't load ${url.href}`))\n }\n script.onload = () => {\n if (ComponentPacks.reloading.delete(name))\n reject(new Error(`ComponentPacks.reload(): ${url.href} registered no pack`))\n script.remove()\n }\n // a new URL, so the browser fetches the rebuilt file, not its cached copy\n url.searchParams.set(RELOAD_PARAM, String(Date.now()))\n script.src = url.href\n document.head.append(script)\n })\n }\n\n ////////////////\n // ## What a root asks\n ////////////////\n\n /** The catalog entry of `tag`, from the registered packs; `undefined` for a tag no pack lists. */\n static entryOf(tag: string): RootCatalogEntry | undefined {\n return ComponentPacks.catalog.get(tag)\n }\n\n /**\n * While `tag`'s pack is still defining its tags (an async `define()`): resolves once it's done; else `undefined`.\n * - So a root that finds one of them undefined in that time waits for it, rather than calling it failed.\n */\n static whileDefining(tag: string): Promise<void> | undefined {\n if (!ComponentPacks.catalog.has(tag)) return undefined\n for (const [name, defining] of ComponentPacks.defining) {\n const prefix = ComponentPacks.packs.get(name)?.prefix\n if (prefix && tag.startsWith(prefix)) return defining.then(() => undefined)\n }\n return undefined\n }\n\n /** Does `tag` have a registered pack's prefix? Then a root loads (or reports) it, as it does `ui-*` tags. */\n static owns(tag: string): boolean {\n for (const prefix of ComponentPacks.prefixes) if (tag.startsWith(prefix)) return true\n return false\n }\n\n /**\n * The URL a registered pack's script was loaded from, when changed file `path` (a served path, as the page server\n * reports it: `/_epic/pack/epics.pack.js`) is that script; else `undefined`.\n * - matched by the pack name its file implies (`nameFor()`): a worktree's page names its files by another path\n */\n static sourceOf(path: string): string | undefined {\n const file = path.split(\"/\").pop() ?? \"\"\n if (!PACK_FILE_SUFFIX.test(file)) return undefined\n const name = file.replace(PACK_FILE_SUFFIX, \"\")\n if (!ComponentPacks.packs.has(name)) return undefined\n const scripts = Array.from(document.querySelectorAll<HTMLScriptElement>(\"script[src]\"), (script) => script.src)\n return [...ComponentPacks.loads.keys(), ...scripts].find((url) => ComponentPacks.nameFor(url) === name)\n }\n\n /** The pack name a script URL implies: `.../epics/components/__pack/epics.pack.js` => `epics`, `x.js` => `x`. */\n static nameFor(url: string): string {\n const file = new URL(url).pathname.split(\"/\").pop() ?? \"\"\n return file.replace(PACK_FILE_SUFFIX, \"\")\n }\n\n ////////////////\n // ## Internal\n ////////////////\n\n /**\n * Swap pack `next`, the rebuilt script of `known`, into the page (`reload()`): its `define()` again, keeping the\n * families whose hashes didn't change (`swap.keep()`), then the live elements re-rendered (`swap.finish()`).\n */\n private static swapIn(known: ComponentPack, next: ComponentPack, { swap, resolve, reject }: PackReload) {\n try {\n ComponentPacks.check(next)\n } catch (error) {\n reject(ComponentPacks.asError(error))\n return\n }\n if (Object.keys(next.catalog).some((tag) => !(tag in known.catalog))) {\n resolve(\"reload\")\n return\n }\n const changed = ComponentPacks.changedFamilies(known, next)\n swap.keep((tag) => !!changed && !changed.has(known.catalog[tag]?.folder ?? \"\"))\n const done = () => swap.keep(undefined)\n Promise.resolve()\n .then(() => next.define())\n .then(\n () => {\n done()\n ComponentPacks.packs.set(next.name, next)\n for (const [tag, entry] of Object.entries(next.catalog)) ComponentPacks.catalog.set(tag, entry)\n resolve(swap.finish() ? \"swapped\" : \"reload\")\n },\n (error: unknown) => {\n done()\n reject(ComponentPacks.asError(error))\n }\n )\n }\n\n /**\n * The family folders whose sources differ between `known` and `next` (their `families` hashes);\n * `undefined` (every family) when either was built without them.\n */\n private static changedFamilies(known: ComponentPack, next: ComponentPack): Set<string> | undefined {\n if (!known.families || !next.families) return undefined\n const folders = new Set([...Object.keys(known.families), ...Object.keys(next.families)])\n return new Set([...folders].filter((folder) => known.families![folder] !== next.families![folder]))\n }\n\n /** Add a `<script>` for `url`; resolves when it registers its pack, rejects when it fails to. */\n private static inject(url: string): Promise<ComponentPack> {\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\")\n const pending: PendingPack = { script, name: ComponentPacks.nameFor(url), resolve, reject }\n // registering takes the load out of `pending` (the script runs before `load` fires),\n // so these only fail a script that never registered: NOT one whose `define()` is still loading its families\n const fail = (message: string) => {\n if (!ComponentPacks.pending.delete(pending)) return\n reject(new Error(`ComponentPacks.load(): ${message}`))\n }\n script.onload = () => fail(`${url} ran, but registered no pack; it must call SpellUI.registerPack()`)\n script.onerror = () => fail(`can't load ${url}`)\n script.src = url\n ComponentPacks.pending.add(pending)\n document.head.append(script)\n })\n }\n\n /** The load waiting for the script running now, else for a pack named `name`. */\n private static pendingFor(name: string): PendingPack | undefined {\n const running = document.currentScript\n let byName: PendingPack | undefined\n for (const pending of ComponentPacks.pending) {\n if (pending.script === running) return pending\n if (pending.name === name) byName ??= pending\n }\n return byName\n }\n\n /** `error` as an `Error`, to reject a load with. */\n private static asError(error: unknown): Error {\n return error instanceof Error ? error : new Error(String(error))\n }\n\n /** Throw a `TypeError` naming what's wrong with `pack`. */\n private static check(pack: ComponentPack) {\n if (typeof pack?.name !== \"string\" || !pack.name) fail(\"a pack needs a `name`\")\n const { name, prefix, catalog } = pack\n if (typeof prefix !== \"string\" || !PACK_PREFIX.test(prefix) || prefix === UI_PREFIX) {\n fail(`pack \"${name}\": \\`prefix\\` must be lowercase words ending in \"-\" (\\`epic-\\`), never \"${UI_PREFIX}\"`)\n }\n if (typeof pack.define !== \"function\") fail(`pack \"${name}\": \\`define()\\` must define its tags`)\n if (typeof catalog !== \"object\" || catalog === null) fail(`pack \"${name}\": \\`catalog\\` must map its tags`)\n const strays = Object.keys(catalog).filter((tag) => !tag.startsWith(prefix))\n if (strays.length) fail(`pack \"${name}\": every tag starts with \"${prefix}\", not ${strays.join(\", \")}`)\n\n function fail(problem: string): never {\n throw new TypeError(`registerPack(): ${problem}`)\n }\n }\n}\n\n/**\n * Register a component pack: `ComponentPacks.register()`, under the name packs call it by,\n * `SpellUI.registerPack(pack)` (the docs bundle) or `registerPack(pack)` from `spell/ui`.\n */\nexport function registerPack(pack: ComponentPack): void {\n ComponentPacks.register(pack)\n}\n\n/** A pack load waiting for its script to call `registerPack()`. */\ntype PendingPack = {\n /** The `<script>` loading it: `document.currentScript` while it runs. */\n readonly script: HTMLScriptElement\n /** The name its URL implies (`ComponentPacks.nameFor()`): the match when `document.currentScript` is gone. */\n readonly name: string\n /** Resolve the load with the registered pack. */\n readonly resolve: (pack: ComponentPack) => void\n /** Fail the load. */\n readonly reject: (error: Error) => void\n}\n\n/** A reload under way (`reload()`): how to swap the new pack in, and its promise's ends. */\ntype PackReload = {\n readonly swap: PackSwap\n readonly resolve: (result: PackSwapResult) => void\n readonly reject: (error: Error) => void\n}\n\n/** The query `reload()` adds to a pack's URL, so the browser fetches the rebuilt script: `epics.pack.js?swap=...`. */\nconst RELOAD_PARAM = \"swap\"\n\n/** A pack's tag prefix: lowercase words joined by `-`, ending in `-` (`epic-`, `x-`, `my-app-`). */\nconst PACK_PREFIX = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*-$/\n\n/** Spell UI's own prefix, which no pack may take. */\nconst UI_PREFIX = \"ui-\"\n\n/** What a pack's file name ends in, after its name: `epics.pack.js`, else plain `.js`. */\nconst PACK_FILE_SUFFIX = /(?:\\.pack)?\\.js$/\n","/**\n * The types and constants the `ui-components` family's files share:\n * - its component (`UIComponents`) and its vocabulary\n * - `ComponentPacks` (the page's registry of component packs)\n * - `<ui-root>`, which reads `source`\n *\n * - Pure data: `import type` only (a pack's catalog has the shape of `<ui-root>`'s own), so node can load it.\n */\n\nimport type { RootCatalogEntry } from \"spell/ui/components/ui-root/UIRoot.types\"\n\nimport type { componentsVocabulary } from \"./UIComponents.en\"\n\n/** `componentsVocabulary`'s type. */\nexport type ComponentsVocabulary = typeof componentsVocabulary\n\n/** The attribute naming a pack's script: `<ui-components source>`, which `<ui-root>` reads. */\nexport const SOURCE = \"source\"\n\n/**\n * A COMPONENT PACK: another package's custom elements (any tag prefix), loaded on demand by `<ui-root>`.\n * - A pack is a classic script calling `SpellUI.registerPack(pack)` as it runs (`ComponentPacks.register()`);\n * an ES module may call `registerPack()` from `spell/ui` itself.\n * - It shares the page's Solid and Spell UI (`SpellUI.packModules`), never bundling its own copy.\n */\nexport type ComponentPack = {\n /** Its name, unique on the page: `epics` for `epics.pack.js` (how a load finds its pack without `currentScript`). */\n readonly name: string\n /** The prefix of every tag it defines, ending in `-`: `epic-`. Never `ui-` (Spell UI's own). */\n readonly prefix: string\n /** Every tag it defines => what `<ui-root>` needs before it's ready (a skeleton); each tag starts with `prefix`. */\n readonly catalog: Readonly<Record<string, RootCatalogEntry>>\n /**\n * Define every tag of the pack; called once, by `registerPack()`.\n * - It may return a promise, when it loads its families first (`import()`):\n * the pack counts as loaded once that settles, so a `<ui-root>` waits for its tags.\n */\n define(): void | Promise<unknown>\n /**\n * Each family folder => a hash of the sources its script holds (`spell pack build`, epic `epic-engine` I116):\n * when the pack is rebuilt, `ComponentPacks.reload()` swaps in only the families whose hash changed.\n * - None (a pack built before): every family is swapped.\n */\n readonly families?: Readonly<Record<string, string>>\n}\n\n/**\n * How `ComponentPacks.reload()` swaps a rebuilt pack into the live elements: the page's hot replacement\n * (Spell UI's `PackHotSwap`, over the kit's `HotDefinitions`).\n */\nexport type PackSwap = {\n /** While its `define()` runs again: whether a tag KEEPS its live class (`true`: its family didn't change); `undefined` after. */\n keep(keeps: ((tag: string) => boolean) | undefined): void\n /** Re-render the swapped elements; `false` when a change needs a page reload (the platform can't take it in place). */\n finish(): boolean\n}\n\n/** What `ComponentPacks.reload()` did: swapped in place, needs a page reload, or no such pack on the page. */\nexport type PackSwapResult = \"swapped\" | \"reload\" | \"none\"\n","/**\n * Every name `<ui-components>` uses: tag, attributes (kind + allowed values), events, slots, parts, states, texts.\n * Schema: `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - No Fomantic counterpart and nothing to draw: one attribute, `source`, which the `<ui-root>` around it reads.\n * Its load and failures are the root's (`ui-ready`'s `failed`, `ui-error`), so it has no events of its own.\n * - No skeleton: it draws nothing.\n */\n\nimport type { E } from \"spell/ui/core\"\n\nimport { SOURCE } from \"./UIComponents.types\"\n\n/****************\n * ### `<ui-components>`\n * Names a COMPONENT PACK for the `<ui-root>` around it: another package's elements (`<epic-page>` ...), loaded on\n * demand like Spell UI's own. Draws nothing.\n ****************/\nexport const componentsVocabulary = {\n tag: \"ui-components\",\n icon: \"cubes\",\n topics: [\"loading\", \"modules\"],\n aka: [\"component pack\", \"plugin\", \"extension\", \"custom elements\", \"web components\", \"element library\"],\n noun: \"components\",\n description:\n \"Components name a pack of another package's elements, which the root around them loads on demand, once per page.\",\n attributes: [\n {\n name: SOURCE,\n kind: \"string\",\n description:\n \"URL of the pack's script (`epics.pack.js`), relative to the page. The root loads it once per page as a \" +\n \"classic script (so it works from `file://`) and waits for it before showing its content.\"\n }\n ],\n events: [],\n slots: [],\n parts: [],\n states: [],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","/*\n * `<ui-components>`: no Fomantic counterpart, and nothing to draw. It only names a component pack (`source`) for\n * the `<ui-root>` around it, so the DOM element never takes up space.\n */\n\n@layer ui.components.components.types;\n\n@layer ui.components.components.types {\n :host {\n display: none;\n }\n}\n","import type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { componentsVocabulary } from \"./UIComponents.en\"\nimport type { ComponentsVocabulary } from \"./UIComponents.types\"\n\nimport componentsCSS from \"./UIComponents.css?inline\"\n\n/****************\n * ### `UIComponents`\n * The component behind `<ui-components>`:\n * it names a component pack for the `<ui-root>` around it, `<ui-components source=\"epics.pack.js\">`.\n * Draws nothing.\n * - The ROOT does the work, reading `source` from the markup (defined or not):\n * it loads each distinct pack once per page (`ComponentPacks.load()`),\n * waits for it before it's ready, and draws skeletons from its catalog.\n * - Outside a root it does nothing: a page without one loads its pack with a plain `<script src>`.\n * - Defined with the root (its barrel imports this family), so it's never one of the tags a root waits for.\n ****************/\nexport class UIComponents extends E.UIComponent<ComponentsVocabulary> {\n @E.proto static vocabulary = componentsVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { components: componentsCSS },\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n render(): JSX.Element {\n return undefined\n }\n}\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIComponents extends E.AttributeValues<ComponentsVocabulary> {}\n","/**\n * The component-pack family: defines `<ui-components>` and exports its component, `UIComponents`, with\n * `ComponentPacks` (the page's registry and loader of packs) and `registerPack()` (what a pack's script calls).\n * - SIDE EFFECT: importing it defines `<ui-components>`.\n * - `<ui-root>`'s barrel imports this family, so a page with a root has all three.\n * - Also the library's `spell/ui/ui-components` entry.\n */\n\nimport { UIComponents } from \"./UIComponents\"\n\nUIComponents.define()\n\nexport { UIComponents }\nexport type { ComponentPack } from \"./UIComponents.types\"\nexport { ComponentPacks, registerPack } from \"./ComponentPacks\"\n"],"mappings":";;;AAgBA,IAAaY,IAAb,MAAa,eAAe;CAE1B,OAAwB,wBAAQ,IAAI,IAA2B;CAG/D,OAAwB,0BAAU,IAAI,IAA8B;CAGpE,OAAwB,2BAAW,IAAI,IAAY;CAGnD,OAAwB,QAAQ,IAAIZ,EAAkC;CAGtE,OAAwB,0BAAU,IAAI,IAAiB;CAGvD,OAAwB,4BAAY,IAAI,IAAwB;CAGhE,OAAwB,2BAAW,IAAI,IAA8B;CAcrE,OAAO,SAAS,GAA2B;EACzC,eAAe,MAAMc,CAAI;EACzB,IAAMC,IAAU,eAAe,WAAWD,EAAK,IAAI;EACnD,AAAIC,KAAS,eAAe,QAAQ,OAAOA,CAAO;EAClD,IAAMC,IAAQ,eAAe,MAAM,IAAIF,EAAK,IAAI,GAC1CG,IAAS,eAAe,UAAU,IAAIH,EAAK,IAAI;EACrD,IAAIE,KAASC,GAAQ;GAEnB,AADA,eAAe,UAAU,OAAOH,EAAK,IAAI,GACzC,eAAe,OAAOE,GAAOF,G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C;AACV,qEEvCAG,GAAAC,GAAAC,GAAAC,GAmBaC,IAAN,MAAM,uBAAqB,IAAAtD,GAChC,IAAA,CAACC,CAAE,GACH,IAAA,CAACC,CAAE,GAF6BkD,EAAA,CAAoC;CAOpE,SAAsB,CAEtB;AACF;AAVO,IAAA1C,EAAA0C,CAAA,GACI7C,EAAA8C,GAAA,IAAO,cAAhBF,GADWG,CAAA,GAEI/C,EAAA8C,GAAA,IAAO,gBAAtBH,GAFWI,CAAA,GAAN9C,EAAA6C,GAAMC,CAAA,GAAyDnD,EAAAmD,GAAA,cAAA,GAC3DhD,EADEgD,GACK,cAAa7C,EAApB4C,GAAA,GADEC,GACkBN,CAAA,CAAA,GAApBvC,EAAA4C,GAAA,IADEC,CAAA,GAEIhD,EAFJgD,GAEW,gBAAe7C,EAAtB4C,GAAA,IAFJC,GAE0B;CACnC,aAAa,EAAE,YAAYlD,EAAc;CACzC,gBAAgB;AAClB,CAAA,CAAA,GAHeK,EAAA4C,GAAA,IAFJC,CAAA;AAAN,IAAMI,IAANJ;;;ACTPI,EAAa,OAAO"}
|
package/dist/ui-container.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import "./rolldown-runtime-CYGlBXrH.js";
|
|
2
|
-
import { Bt as e,
|
|
3
|
-
import { className as l, effect as u, getOwner as d, readShallow as f, setAttribute as p,
|
|
2
|
+
import { Bt as e, Ht as t, Lt as n, Rt as r, UIComponent as i, Ut as a, proto as o, protoMerged as s, zt as c } from "./core.js";
|
|
3
|
+
import { className as l, effect as u, getOwner as d, readShallow as f, setAttribute as p, style as m, template as h } from "@solidjs/web";
|
|
4
4
|
//#region src/components/ui-container/UIContainer.en.ts
|
|
5
|
-
var
|
|
5
|
+
var g = {
|
|
6
6
|
tag: "ui-container",
|
|
7
|
+
icon: "square outline",
|
|
8
|
+
snippet: "<ui-container></ui-container>",
|
|
7
9
|
topics: [
|
|
8
10
|
"layout",
|
|
9
11
|
"containers",
|
|
@@ -36,6 +38,12 @@ var h = {
|
|
|
36
38
|
kind: "keyOnly",
|
|
37
39
|
description: "A fifth wider than the default container."
|
|
38
40
|
},
|
|
41
|
+
{
|
|
42
|
+
name: "width",
|
|
43
|
+
group: "layout",
|
|
44
|
+
kind: "string",
|
|
45
|
+
description: "A width of its own, any CSS length (`20em`, `320px`): centred, never wider than the page. For content as wide as it needs, e.g. a calculator or a game board, with no CSS."
|
|
46
|
+
},
|
|
39
47
|
{
|
|
40
48
|
name: "grid",
|
|
41
49
|
group: "layout",
|
|
@@ -96,25 +104,29 @@ var h = {
|
|
|
96
104
|
}],
|
|
97
105
|
states: [],
|
|
98
106
|
texts: []
|
|
99
|
-
},
|
|
107
|
+
}, _ = "@layer ui.components.container.types{:host{display:contents}.ui.container{--_ui-container-mobile-gutter:var(--ui-container-mobile-gutter,1em);--_ui-container-width-tablet:var(--ui-container-width-tablet,723px);--_ui-container-width-computer:var(--ui-container-width-computer,933px);--_ui-container-width-large-monitor:var(--ui-container-width-large-monitor,1127px);--_ui-container-wide-ratio:var(--ui-container-wide-ratio,1.2);--_ui-container-grid-gutter:var(--ui-container-grid-gutter,2em);--_ui-container-relaxed-grid-gutter:var(--ui-container-relaxed-grid-gutter,3em);--_ui-container-very-relaxed-grid-gutter:var(--ui-container-very-relaxed-grid-gutter,5em);--_ui-container-text-width:var(--ui-container-text-width,700px);--_ui-container-text-font-ratio:var(--ui-container-text-font-ratio,var(--ui-size-large));--_ui-container-text-line-height:var(--ui-container-text-line-height,1.5);--_ui-container-scrolling-height:var(--ui-container-scrolling-height,15em);--_ui-container-scrolling-height-tablet:var(--ui-container-scrolling-height-tablet,18em);--_ui-container-scrolling-height-computer:var(--ui-container-scrolling-height-computer,24em);--_ui-container-scrolling-height-widescreen:var(--ui-container-scrolling-height-widescreen,30em);box-sizing:border-box;max-width:100%;display:block}.ui.container:not(.fluid){width:auto;margin-inline:var(--_ui-container-mobile-gutter)}@media (768px<=width<992px),(width>=992px){.ui.container{--_ui-container-width:var(--_ui-container-width-tablet)}.ui.container:not(.fluid){width:calc(var(--_ui-container-width) * var(--_container-wide,1) + var(--_container-grid-gutter,0px));margin-inline:auto}}@media (width>=992px){.ui.container{--_ui-container-width:var(--_ui-container-width-computer)}}@media (width>=1200px){.ui.container{--_ui-container-width:var(--_ui-container-width-large-monitor)}}.ui.text.container{max-width:var(--_ui-container-text-width);font-family:var(--ui-font-family);font-size:calc(var(--ui-font-size) * var(--_ui-container-text-font-ratio));line-height:var(--_ui-container-text-line-height)}.ui.wide.container{--_container-wide:var(--_ui-container-wide-ratio)}.ui.fluid.container{width:100%}.ui.grid.container{--_container-grid-gutter:var(--_ui-container-grid-gutter)}.ui.relaxed.grid.container{--_container-grid-gutter:var(--_ui-container-relaxed-grid-gutter)}.ui.very.relaxed.grid.container{--_container-grid-gutter:var(--_ui-container-very-relaxed-grid-gutter)}}@layer ui.components.container.content;@layer ui.components.container.variations{.ui.set-width.container{width:var(--_container-set-width);margin-inline:auto}.ui[class*=left\\ aligned].container{text-align:left}.ui[class*=center\\ aligned].container{text-align:center}.ui[class*=right\\ aligned].container{text-align:right}.ui.justified.container{text-align:justify;hyphens:auto}.ui.scrolling.container{--_container-scroll:calc(var(--_ui-container-scrolling-height) * var(--_container-scroll-ratio,1));max-height:var(--_container-scroll);overscroll-behavior:none;overflow:auto}.ui.short.scrolling.container{--_container-scroll-ratio:.75}.ui[class*=\"very short scrolling\"].short.container{--_container-scroll-ratio:.5}.ui.long.scrolling.container{--_container-scroll-ratio:2}.ui[class*=\"very long scrolling\"].long.container{--_container-scroll-ratio:3}@media (768px<=width<992px),(width>=992px){.ui.scrolling.container{--_ui-container-scrolling-height:var(--_ui-container-scrolling-height-tablet)}}@media (width>=992px){.ui.scrolling.container{--_ui-container-scrolling-height:var(--_ui-container-scrolling-height-computer)}}@media (width>=1920px){.ui.scrolling.container{--_ui-container-scrolling-height:var(--_ui-container-scrolling-height-widescreen)}}.ui.resizable.scrolling.container{height:var(--_container-scroll);resize:vertical;max-height:none}}@layer ui.components.container.states;", v = /* @__PURE__ */ h("<div><slot>"), y, b, x, S, C = class _UIContainer extends (x = i, b = [o], y = [s], x) {
|
|
108
|
+
get extraClass() {
|
|
109
|
+
return this.width ? T : void 0;
|
|
110
|
+
}
|
|
100
111
|
render() {
|
|
101
112
|
let e = this;
|
|
102
|
-
var t =
|
|
113
|
+
var t = v(), n = t.firstChild;
|
|
103
114
|
return n._$owner = d(), u(() => ({
|
|
104
115
|
e: f(e.rootClass),
|
|
105
116
|
t: e.partForName("container"),
|
|
106
|
-
a: e.scrolling ? 0 : void 0
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
a: e.scrolling ? 0 : void 0,
|
|
118
|
+
o: f(e.width ? { "--_container-set-width": e.width } : void 0)
|
|
119
|
+
}), ({ e, t: n, a: r, o: i }, a) => {
|
|
120
|
+
l(t, e, a?.e), n !== a?.t && p(t, "part", n), r !== a?.a && p(t, "tabindex", r), m(t, i, a?.o);
|
|
109
121
|
}), t;
|
|
110
122
|
}
|
|
111
123
|
};
|
|
112
|
-
|
|
113
|
-
var C =
|
|
124
|
+
S = c(x), n(S, 13, "vocabulary", b, C), n(S, 13, "elementSetup", y, C), r(S, C), e(C, "UIContainer"), t(C, "vocabulary", a(S, 8, C, g)), a(S, 11, C), t(C, "elementSetup", a(S, 12, C, { styleSheets: { container: _ } })), a(S, 15, C);
|
|
125
|
+
var w = C, T = "set-width";
|
|
114
126
|
//#endregion
|
|
115
127
|
//#region src/components/ui-container/index.ts
|
|
116
|
-
|
|
128
|
+
w.define();
|
|
117
129
|
//#endregion
|
|
118
|
-
export {
|
|
130
|
+
export { w as UIContainer };
|
|
119
131
|
|
|
120
132
|
//# sourceMappingURL=ui-container.js.map
|
package/dist/ui-container.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-container.js","names":["this","part={this.partForName(\"container\")}","tabindex={this.scrolling ? 0 : void 0}","<div class={this.rootClass} part={this.partForName(\"container\")} tabindex={this.scrolling ? 0 : void 0}>\n <slot />\n </div>","E.UIComponent","E.proto","E.protoMerged","_$getOwner","_$readShallow","_$setAttribute","__name","containerCSS","__publicField","__decorateElement","__decoratorMetadata","__decoratorStart","__name$1","__runInitializers","containerVocabulary","UIContainer_default","_tmpl$","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIContainer","UIComponent","proto","protoMerged","_self$","_el$","_el$2","getOwner","effect","readShallow","className","_p$","t","setAttribute","a","UIContainer"],"sources":["../src/components/ui-container/UIContainer.en.ts","../src/components/ui-container/UIContainer.css?inline","../src/components/ui-container/UIContainer.tsx","../src/components/ui-container/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-container>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots and parts.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - The attributes become Fomantic's class words, in Fomantic's order (`ClassBuilder`):\n * `<ui-container text align=\"justified\">` => `ui text justified container`.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `containerVocabulary`\n * The names of `<ui-container>`, a centred page-width column:\n * `<div class=\"ui … container\" part=\"container\">` around a slot.\n ****************/\nexport const containerVocabulary = {\n tag: \"ui-container\",\n topics: [\"layout\", \"containers\", \"basic\", \"elements\"],\n aka: [\"wrapper\", \"page width\", \"content width\"],\n noun: \"container\",\n description: \"A container limits content to a maximum width.\",\n attributes: [\n { name: \"text\", group: \"name\", kind: \"keyOnly\", description: \"A narrower reading column with larger type.\" },\n { name: \"fluid\", group: \"layout\", kind: \"keyOnly\", description: \"Always the full width of the page.\" },\n { name: \"wide\", group: \"layout\", kind: \"keyOnly\", description: \"A fifth wider than the default container.\" },\n {\n name: \"grid\",\n group: \"layout\",\n kind: \"keyOnly\",\n description: \"Holds a grid: widened by the grid's gutters so its columns line up with other containers.\"\n },\n {\n name: \"spacing\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"lg\", \"xl\"],\n classes: { lg: \"relaxed\", xl: \"very relaxed\" },\n replaces: [{ from: \"relaxed\", value: \"lg\", values: { very: \"xl\" } }],\n description:\n 'With `grid`: room for a grid\\'s wider gutters (`spacing=\"lg\"`, `xl` wider still). ' +\n \"Its old name was `relaxed`.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"textAlign\",\n values: \"alignments\",\n replaces: [\"text-align\"],\n description:\n \"Aligns its text `left`, `center`, `right`, or `justified` (with hyphenation). Its old name was `text-align`.\"\n },\n {\n name: \"scrolling\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"short\", \"very short\", \"long\", \"very long\"],\n description:\n \"A capped height (per breakpoint) that scrolls; `short` ... `very long` scale the cap. Heights are \" +\n \"tokens: `--ui-container-scrolling-height` (mobile, 15em), `--ui-container-scrolling-height-tablet` \" +\n \"(18em), `-computer` (24em), `-widescreen` (30em).\"\n },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"With `scrolling`: people can drag its height.\"\n }\n ],\n events: [],\n slots: [{ name: \"\", description: \"Content.\" }],\n parts: [{ name: \"container\", description: \"The container box.\" }],\n states: [],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-container>`: a port of Fomantic's `container.less` + `container.variables`.\n * - It styles the component's shadow DOM, in Fomantic's class names on a semantic element:\n * `<div class=\"ui [keyOnly ...] [text-align] container\" part=\"container\"><slot></slot></div>`\n * - The DOM element is `display: contents` (`:host`): the inner box IS the container,\n * so its auto margins centre it in the page.\n *\n * - Widths follow the PAGE (viewport) breakpoints, as in Fomantic: a container is page layout,\n * so this is the one component that uses `@media (--ui-*)` (`media.css`, inlined at build time)\n * instead of container queries.\n * - on a phone: full width with a `1em` gutter; tablet, computer, large monitor: a fixed width, centred\n * - the fixed widths are Fomantic's (the breakpoint minus gutters and a scrollbar), as `--ui-container-width-*`\n * - `wide` multiplies them by `--ui-container-wide-ratio`;\n * a `grid` container adds the grid's negative gutters back (wider ones for `relaxed` / `very relaxed`)\n * - `--_ui-container-width` is the private switch holding the current breakpoint's width;\n * theme the widths with `--ui-container-width-tablet` / `-computer` / `-large-monitor`\n * - `scrolling` heights step up per breakpoint: `--ui-container-scrolling-height` is the PHONE height,\n * and the wider breakpoints swap in `--ui-container-scrolling-height-tablet` / `-computer` / `-widescreen`\n * (18em / 24em / 30em), whatever `--ui-container-scrolling-height` the page sets\n *\n * - The public tokens (`--ui-container-*`) are NEVER declared here.\n * The token block gives each a private alias,\n * `--_ui-container-text-width: var(--ui-container-text-width, 700px)`, and every rule reads the alias.\n * So a value set on `:root`, an ancestor, the element, `::part(container)` or in the app's style sheet\n * reaches the box (`notes/theming.md`, \"Component tokens\").\n *\n * - No `:state()`s: this sheet keys on the box's classes.\n *\n * - Left out, on purpose:\n * - nothing structural; Fomantic's widths assume a 14px root, these keep its px values at the 16px default\n */\n\n@layer ui.components.container.types, ui.components.container.content, ui.components.container.variations, ui.components.container.states;\n\n/* Breakpoints (`@custom-media`), inlined at build time. */\n@import \"../../styles/media.css\";\n\n/*******************************\n Container\n*******************************/\n\n@layer ui.components.container.types {\n /* The DOM element: no box of its own; the inner box is the container. */\n :host {\n display: contents;\n }\n\n /* Tokens: one per `container.variables` entry that still matters, each the private alias of its public token. */\n .ui.container {\n --_ui-container-mobile-gutter: var(--ui-container-mobile-gutter, 1em);\n --_ui-container-width-tablet: var(--ui-container-width-tablet, 723px);\n --_ui-container-width-computer: var(--ui-container-width-computer, 933px);\n --_ui-container-width-large-monitor: var(--ui-container-width-large-monitor, 1127px);\n --_ui-container-wide-ratio: var(--ui-container-wide-ratio, 1.2);\n --_ui-container-grid-gutter: var(--ui-container-grid-gutter, 2em);\n --_ui-container-relaxed-grid-gutter: var(--ui-container-relaxed-grid-gutter, 3em);\n --_ui-container-very-relaxed-grid-gutter: var(--ui-container-very-relaxed-grid-gutter, 5em);\n --_ui-container-text-width: var(--ui-container-text-width, 700px);\n --_ui-container-text-font-ratio: var(--ui-container-text-font-ratio, var(--ui-size-large));\n --_ui-container-text-line-height: var(--ui-container-text-line-height, 1.5);\n --_ui-container-scrolling-height: var(--ui-container-scrolling-height, 15em);\n --_ui-container-scrolling-height-tablet: var(--ui-container-scrolling-height-tablet, 18em);\n --_ui-container-scrolling-height-computer: var(--ui-container-scrolling-height-computer, 24em);\n --_ui-container-scrolling-height-widescreen: var(--ui-container-scrolling-height-widescreen, 30em);\n }\n\n /* Container: mobile first -- the page width, less a gutter. */\n .ui.container {\n box-sizing: border-box;\n display: block;\n max-width: 100%;\n }\n .ui.container:not(.fluid) {\n width: auto;\n margin-inline: var(--_ui-container-mobile-gutter);\n }\n\n /* Tablet and up: a fixed width, centred. */\n @media (--ui-tablet), (--ui-computer) {\n .ui.container {\n --_ui-container-width: var(--_ui-container-width-tablet);\n }\n .ui.container:not(.fluid) {\n width: calc(var(--_ui-container-width) * var(--_container-wide, 1) + var(--_container-grid-gutter, 0px));\n margin-inline: auto;\n }\n }\n @media (--ui-computer) {\n .ui.container {\n --_ui-container-width: var(--_ui-container-width-computer);\n }\n }\n @media (--ui-large-monitor) {\n .ui.container {\n --_ui-container-width: var(--_ui-container-width-large-monitor);\n }\n }\n\n /* Text: a narrower reading column with larger type. */\n .ui.text.container {\n max-width: var(--_ui-container-text-width);\n font-family: var(--ui-font-family);\n font-size: calc(var(--ui-font-size) * var(--_ui-container-text-font-ratio));\n line-height: var(--_ui-container-text-line-height);\n }\n\n /* Wide: a fifth wider than the default. */\n .ui.wide.container {\n --_container-wide: var(--_ui-container-wide-ratio);\n }\n\n /* Fluid: always the full width. */\n .ui.fluid.container {\n width: 100%;\n }\n\n /* Grid: make room for a grid's negative gutters. */\n .ui.grid.container {\n --_container-grid-gutter: var(--_ui-container-grid-gutter);\n }\n .ui.relaxed.grid.container {\n --_container-grid-gutter: var(--_ui-container-relaxed-grid-gutter);\n }\n .ui.very.relaxed.grid.container {\n --_container-grid-gutter: var(--_ui-container-very-relaxed-grid-gutter);\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.container.variations {\n /* Aligned */\n .ui[class*=\"left aligned\"].container {\n text-align: left;\n }\n .ui[class*=\"center aligned\"].container {\n text-align: center;\n }\n .ui[class*=\"right aligned\"].container {\n text-align: right;\n }\n .ui.justified.container {\n text-align: justify;\n hyphens: auto;\n }\n\n /* Scrolling: a capped height (per breakpoint, `short` ... `very long`) that scrolls. */\n .ui.scrolling.container {\n --_container-scroll: calc(var(--_ui-container-scrolling-height) * var(--_container-scroll-ratio, 1));\n max-height: var(--_container-scroll);\n overflow: auto;\n overscroll-behavior: none;\n }\n .ui.short.scrolling.container {\n --_container-scroll-ratio: 0.75;\n }\n .ui[class*=\"very short scrolling\"].short.container {\n --_container-scroll-ratio: 0.5;\n }\n .ui.long.scrolling.container {\n --_container-scroll-ratio: 2;\n }\n .ui[class*=\"very long scrolling\"].long.container {\n --_container-scroll-ratio: 3;\n }\n @media (--ui-tablet), (--ui-computer) {\n .ui.scrolling.container {\n --_ui-container-scrolling-height: var(--_ui-container-scrolling-height-tablet);\n }\n }\n @media (--ui-computer) {\n .ui.scrolling.container {\n --_ui-container-scrolling-height: var(--_ui-container-scrolling-height-computer);\n }\n }\n @media (--ui-widescreen) {\n .ui.scrolling.container {\n --_ui-container-scrolling-height: var(--_ui-container-scrolling-height-widescreen);\n }\n }\n /* Resizable: starts at the capped height, the user drags it taller or shorter. */\n .ui.resizable.scrolling.container {\n height: var(--_container-scroll);\n max-height: none;\n resize: vertical;\n }\n}\n","import type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { containerVocabulary } from \"./UIContainer.en\"\n\nimport containerCSS from \"./UIContainer.css?inline\"\n\n/****************\n * ### `UIContainer`\n * The component behind `<ui-container>`: a centred column of page width that holds a page's content.\n *\n * - Its shadow DOM is one box, `<div class=\"ui … container\" part=\"container\">`, around a slot for the content.\n * - `scrolling`: the box is a keyboard stop (`tabindex=0`), as every scrollable region must be.\n ****************/\nexport class UIContainer extends E.UIComponent<typeof containerVocabulary> {\n @E.proto static vocabulary = containerVocabulary\n @E.protoMerged static elementSetup = { styleSheets: { container: containerCSS } } satisfies Partial<E.ElementSetup>\n\n render(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"container\")} tabindex={this.scrolling ? 0 : undefined}>\n <slot />\n </div>\n )\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIContainer extends E.AttributeValues<typeof containerVocabulary> {}\n","/**\n * The container family: defines `<ui-container>` and exports its component, `UIContainer`.\n * - SIDE EFFECT: importing it defines the tag.\n * - Also the library's `spell/ui/ui-container` entry (its size is in `notes/report.md`).\n */\n\nimport { UIContainer } from \"./UIContainer\"\n\nUIContainer.define()\n\nexport { UIContainer }\n"],"mappings":";;;;AAeA,IAAakB,IAAsB;CACjC,KAAK;CACL,QAAQ;EAAC;EAAU;EAAc;EAAS;CAAU;CACpD,KAAK;EAAC;EAAW;EAAc;CAAe;CAC9C,MAAM;CACN,aAAa;CACb,YAAY;EACV;GAAE,MAAM;GAAQ,OAAO;GAAQ,MAAM;GAAW,aAAa;EAA8C;EAC3G;GAAE,MAAM;GAAS,OAAO;GAAU,MAAM;GAAW,aAAa;EAAqC;EACrG;GAAE,MAAM;GAAQ,OAAO;GAAU,MAAM;GAAW,aAAa;EAA4C;EAC3G;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ,CAAC,MAAM,IAAI;GACnB,SAAS;IAAE,IAAI;IAAW,IAAI;GAAe;GAC7C,UAAU,CAAC;IAAE,MAAM;IAAW,OAAO;IAAM,QAAQ,EAAE,MAAM,KAAK;GAAE,CAAC;GACnE,aACE;EAEJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;GACR,UAAU,CAAC,YAAY;GACvB,aACE;EACJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;IAAC;IAAS;IAAc;IAAQ;GAAW;GAC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AAjEM,EAAAO,GAAA,IAFJC,CAAA;AAAN,IAAMe,IAANf;;;ACNPe,EAAY,OAAO"}
|
|
1
|
+
{"version":3,"file":"ui-container.js","names":["this","part={this.partForName(\"container\")}","tabindex={this.scrolling ? 0 : void 0}","style={this.width ? { \"--_container-set-width\": this.width } : void 0}","<div\n class={this.rootClass}\n part={this.partForName(\"container\")}\n tabindex={this.scrolling ? 0 : void 0}\n style={this.width ? { \"--_container-set-width\": this.width } : void 0}\n >\n <slot />\n </div>","E.UIComponent","E.proto","E.protoMerged","_$getOwner","_$readShallow","_$setAttribute","__name","containerCSS","__name$1","__publicField","__decorateElement","__decoratorMetadata","__runInitializers","__decoratorStart","containerVocabulary","UIContainer_default","_tmpl$","_elementSetup_dec","_vocabulary_dec","_a","_init","_UIContainer","UIComponent","proto","protoMerged","SET_WIDTH","_self$","_el$","_el$2","getOwner","effect","readShallow","className","_p$","t","setAttribute","a","style","o","UIContainer"],"sources":["../src/components/ui-container/UIContainer.en.ts","../src/components/ui-container/UIContainer.css?inline","../src/components/ui-container/UIContainer.tsx","../src/components/ui-container/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-container>`: every name the tag uses.\n * - Its tag, attributes (each with its kind and allowed values), slots and parts.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - The attributes become Fomantic's class words, in Fomantic's order (`ClassBuilder`):\n * `<ui-container text align=\"justified\">` => `ui text justified container`.\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `containerVocabulary`\n * The names of `<ui-container>`, a centred page-width column:\n * `<div class=\"ui … container\" part=\"container\">` around a slot.\n ****************/\nexport const containerVocabulary = {\n tag: \"ui-container\",\n icon: \"square outline\",\n snippet: \"<ui-container></ui-container>\",\n topics: [\"layout\", \"containers\", \"basic\", \"elements\"],\n aka: [\"wrapper\", \"page width\", \"content width\"],\n noun: \"container\",\n description: \"A container limits content to a maximum width.\",\n attributes: [\n { name: \"text\", group: \"name\", kind: \"keyOnly\", description: \"A narrower reading column with larger type.\" },\n { name: \"fluid\", group: \"layout\", kind: \"keyOnly\", description: \"Always the full width of the page.\" },\n { name: \"wide\", group: \"layout\", kind: \"keyOnly\", description: \"A fifth wider than the default container.\" },\n {\n name: \"width\",\n group: \"layout\",\n kind: \"string\",\n description:\n \"A width of its own, any CSS length (`20em`, `320px`): centred, never wider than the page. \" +\n \"For content as wide as it needs, e.g. a calculator or a game board, with no CSS.\"\n },\n {\n name: \"grid\",\n group: \"layout\",\n kind: \"keyOnly\",\n description: \"Holds a grid: widened by the grid's gutters so its columns line up with other containers.\"\n },\n {\n name: \"spacing\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"lg\", \"xl\"],\n classes: { lg: \"relaxed\", xl: \"very relaxed\" },\n replaces: [{ from: \"relaxed\", value: \"lg\", values: { very: \"xl\" } }],\n description:\n 'With `grid`: room for a grid\\'s wider gutters (`spacing=\"lg\"`, `xl` wider still). ' +\n \"Its old name was `relaxed`.\"\n },\n {\n name: \"align\",\n group: \"layout\",\n kind: \"textAlign\",\n values: \"alignments\",\n replaces: [\"text-align\"],\n description:\n \"Aligns its text `left`, `center`, `right`, or `justified` (with hyphenation). Its old name was `text-align`.\"\n },\n {\n name: \"scrolling\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"short\", \"very short\", \"long\", \"very long\"],\n description:\n \"A capped height (per breakpoint) that scrolls; `short` ... `very long` scale the cap. Heights are \" +\n \"tokens: `--ui-container-scrolling-height` (mobile, 15em), `--ui-container-scrolling-height-tablet` \" +\n \"(18em), `-computer` (24em), `-widescreen` (30em).\"\n },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"With `scrolling`: people can drag its height.\"\n }\n ],\n events: [],\n slots: [{ name: \"\", description: \"Content.\" }],\n parts: [{ name: \"container\", description: \"The container box.\" }],\n states: [],\n texts: []\n} as const satisfies E.ComponentVocabulary\n","/*\n * The style sheet of `<ui-container>`: a port of Fomantic's `container.less` + `container.variables`.\n * - It styles the component's shadow DOM, in Fomantic's class names on a semantic element:\n * `<div class=\"ui [keyOnly ...] [text-align] container\" part=\"container\"><slot></slot></div>`\n * - The DOM element is `display: contents` (`:host`): the inner box IS the container,\n * so its auto margins centre it in the page.\n *\n * - Widths follow the PAGE (viewport) breakpoints, as in Fomantic: a container is page layout,\n * so this is the one component that uses `@media (--ui-*)` (`media.css`, inlined at build time)\n * instead of container queries.\n * - on a phone: full width with a `1em` gutter; tablet, computer, large monitor: a fixed width, centred\n * - the fixed widths are Fomantic's (the breakpoint minus gutters and a scrollbar), as `--ui-container-width-*`\n * - `wide` multiplies them by `--ui-container-wide-ratio`;\n * a `grid` container adds the grid's negative gutters back (wider ones for `relaxed` / `very relaxed`)\n * - `--_ui-container-width` is the private switch holding the current breakpoint's width;\n * theme the widths with `--ui-container-width-tablet` / `-computer` / `-large-monitor`\n * - `scrolling` heights step up per breakpoint: `--ui-container-scrolling-height` is the PHONE height,\n * and the wider breakpoints swap in `--ui-container-scrolling-height-tablet` / `-computer` / `-widescreen`\n * (18em / 24em / 30em), whatever `--ui-container-scrolling-height` the page sets\n *\n * - The public tokens (`--ui-container-*`) are NEVER declared here.\n * The token block gives each a private alias,\n * `--_ui-container-text-width: var(--ui-container-text-width, 700px)`, and every rule reads the alias.\n * So a value set on `:root`, an ancestor, the element, `::part(container)` or in the app's style sheet\n * reaches the box (`notes/theming.md`, \"Component tokens\").\n *\n * - No `:state()`s: this sheet keys on the box's classes.\n *\n * - Left out, on purpose:\n * - nothing structural; Fomantic's widths assume a 14px root, these keep its px values at the 16px default\n */\n\n@layer ui.components.container.types, ui.components.container.content, ui.components.container.variations, ui.components.container.states;\n\n/* Breakpoints (`@custom-media`), inlined at build time. */\n@import \"../../styles/media.css\";\n\n/*******************************\n Container\n*******************************/\n\n@layer ui.components.container.types {\n /* The DOM element: no box of its own; the inner box is the container. */\n :host {\n display: contents;\n }\n\n /* Tokens: one per `container.variables` entry that still matters, each the private alias of its public token. */\n .ui.container {\n --_ui-container-mobile-gutter: var(--ui-container-mobile-gutter, 1em);\n --_ui-container-width-tablet: var(--ui-container-width-tablet, 723px);\n --_ui-container-width-computer: var(--ui-container-width-computer, 933px);\n --_ui-container-width-large-monitor: var(--ui-container-width-large-monitor, 1127px);\n --_ui-container-wide-ratio: var(--ui-container-wide-ratio, 1.2);\n --_ui-container-grid-gutter: var(--ui-container-grid-gutter, 2em);\n --_ui-container-relaxed-grid-gutter: var(--ui-container-relaxed-grid-gutter, 3em);\n --_ui-container-very-relaxed-grid-gutter: var(--ui-container-very-relaxed-grid-gutter, 5em);\n --_ui-container-text-width: var(--ui-container-text-width, 700px);\n --_ui-container-text-font-ratio: var(--ui-container-text-font-ratio, var(--ui-size-large));\n --_ui-container-text-line-height: var(--ui-container-text-line-height, 1.5);\n --_ui-container-scrolling-height: var(--ui-container-scrolling-height, 15em);\n --_ui-container-scrolling-height-tablet: var(--ui-container-scrolling-height-tablet, 18em);\n --_ui-container-scrolling-height-computer: var(--ui-container-scrolling-height-computer, 24em);\n --_ui-container-scrolling-height-widescreen: var(--ui-container-scrolling-height-widescreen, 30em);\n }\n\n /* Container: mobile first -- the page width, less a gutter. */\n .ui.container {\n box-sizing: border-box;\n display: block;\n max-width: 100%;\n }\n .ui.container:not(.fluid) {\n width: auto;\n margin-inline: var(--_ui-container-mobile-gutter);\n }\n\n /* Tablet and up: a fixed width, centred. */\n @media (--ui-tablet), (--ui-computer) {\n .ui.container {\n --_ui-container-width: var(--_ui-container-width-tablet);\n }\n .ui.container:not(.fluid) {\n width: calc(var(--_ui-container-width) * var(--_container-wide, 1) + var(--_container-grid-gutter, 0px));\n margin-inline: auto;\n }\n }\n @media (--ui-computer) {\n .ui.container {\n --_ui-container-width: var(--_ui-container-width-computer);\n }\n }\n @media (--ui-large-monitor) {\n .ui.container {\n --_ui-container-width: var(--_ui-container-width-large-monitor);\n }\n }\n\n /* Text: a narrower reading column with larger type. */\n .ui.text.container {\n max-width: var(--_ui-container-text-width);\n font-family: var(--ui-font-family);\n font-size: calc(var(--ui-font-size) * var(--_ui-container-text-font-ratio));\n line-height: var(--_ui-container-text-line-height);\n }\n\n /* Wide: a fifth wider than the default. */\n .ui.wide.container {\n --_container-wide: var(--_ui-container-wide-ratio);\n }\n\n /* Fluid: always the full width. */\n .ui.fluid.container {\n width: 100%;\n }\n\n /* Grid: make room for a grid's negative gutters. */\n .ui.grid.container {\n --_container-grid-gutter: var(--_ui-container-grid-gutter);\n }\n .ui.relaxed.grid.container {\n --_container-grid-gutter: var(--_ui-container-relaxed-grid-gutter);\n }\n .ui.very.relaxed.grid.container {\n --_container-grid-gutter: var(--_ui-container-very-relaxed-grid-gutter);\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.container.variations {\n /* A width of its own (`width=\"20em\"`, set on the box as `--_container-set-width`): centred, at most the page's. */\n .ui.set-width.container {\n width: var(--_container-set-width);\n margin-inline: auto;\n }\n\n /* Aligned */\n .ui[class*=\"left aligned\"].container {\n text-align: left;\n }\n .ui[class*=\"center aligned\"].container {\n text-align: center;\n }\n .ui[class*=\"right aligned\"].container {\n text-align: right;\n }\n .ui.justified.container {\n text-align: justify;\n hyphens: auto;\n }\n\n /* Scrolling: a capped height (per breakpoint, `short` ... `very long`) that scrolls. */\n .ui.scrolling.container {\n --_container-scroll: calc(var(--_ui-container-scrolling-height) * var(--_container-scroll-ratio, 1));\n max-height: var(--_container-scroll);\n overflow: auto;\n overscroll-behavior: none;\n }\n .ui.short.scrolling.container {\n --_container-scroll-ratio: 0.75;\n }\n .ui[class*=\"very short scrolling\"].short.container {\n --_container-scroll-ratio: 0.5;\n }\n .ui.long.scrolling.container {\n --_container-scroll-ratio: 2;\n }\n .ui[class*=\"very long scrolling\"].long.container {\n --_container-scroll-ratio: 3;\n }\n @media (--ui-tablet), (--ui-computer) {\n .ui.scrolling.container {\n --_ui-container-scrolling-height: var(--_ui-container-scrolling-height-tablet);\n }\n }\n @media (--ui-computer) {\n .ui.scrolling.container {\n --_ui-container-scrolling-height: var(--_ui-container-scrolling-height-computer);\n }\n }\n @media (--ui-widescreen) {\n .ui.scrolling.container {\n --_ui-container-scrolling-height: var(--_ui-container-scrolling-height-widescreen);\n }\n }\n /* Resizable: starts at the capped height, the user drags it taller or shorter. */\n .ui.resizable.scrolling.container {\n height: var(--_container-scroll);\n max-height: none;\n resize: vertical;\n }\n}\n","import type { JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { containerVocabulary } from \"./UIContainer.en\"\n\nimport containerCSS from \"./UIContainer.css?inline\"\n\n/****************\n * ### `UIContainer`\n * The component behind `<ui-container>`: a centred column of page width that holds a page's content.\n *\n * - Its shadow DOM is one box, `<div class=\"ui … container\" part=\"container\">`, around a slot for the content.\n * - `scrolling`: the box is a keyboard stop (`tabindex=0`), as every scrollable region must be.\n * - `width`: the box's width, a CSS length, through `--_container-set-width` and the class `set-width`\n * (its rule in the sheet, centred and never wider than the page; epic `language` T76).\n ****************/\nexport class UIContainer extends E.UIComponent<typeof containerVocabulary> {\n @E.proto static vocabulary = containerVocabulary\n @E.protoMerged static elementSetup = { styleSheets: { container: containerCSS } } satisfies Partial<E.ElementSetup>\n\n /** A width of its own (`width`): the class its rule keys on. */\n protected override get extraClass(): string | undefined {\n return this.width ? SET_WIDTH : undefined\n }\n\n render(): JSX.Element {\n return (\n <div\n class={this.rootClass}\n part={this.partForName(\"container\")}\n tabindex={this.scrolling ? 0 : undefined}\n style={this.width ? { \"--_container-set-width\": this.width } : undefined}\n >\n <slot />\n </div>\n )\n }\n}\n\n/** The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`). */\nexport interface UIContainer extends E.AttributeValues<typeof containerVocabulary> {}\n\n/** The box's class while it has a width of its own: `UIContainer.css` sizes it. */\nconst SET_WIDTH = \"set-width\"\n","/**\n * The container family: defines `<ui-container>` and exports its component, `UIContainer`.\n * - SIDE EFFECT: importing it defines the tag.\n * - Also the library's `spell/ui/ui-container` entry (its size is in `notes/report.md`).\n */\n\nimport { UIContainer } from \"./UIContainer\"\n\nUIContainer.define()\n\nexport { UIContainer }\n"],"mappings":";;;;AAeA,IAAamB,IAAsB;CACjC,KAAK;CACL,MAAM;CACN,SAAS;CACT,QAAQ;EAAC;EAAU;EAAc;EAAS;CAAU;CACpD,KAAK;EAAC;EAAW;EAAc;CAAe;CAC9C,MAAM;CACN,aAAa;CACb,YAAY;EACV;GAAE,MAAM;GAAQ,OAAO;GAAQ,MAAM;GAAW,aAAa;EAA8C;EAC3G;GAAE,MAAM;GAAS,OAAO;GAAU,MAAM;GAAW,aAAa;EAAqC;EACrG;GAAE,MAAM;GAAQ,OAAO;GAAU,MAAM;GAAW,aAAa;EAA4C;EAC3G;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aACE;EAEJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ,CAAC,MAAM,IAAI;GACnB,SAAS;IAAE,IAAI;IAAW,IAAI;GAAe;GAC7C,UAAU,CAAC;IAAE,MAAM;IAAW,OAAO;IAAM,QAAQ,EAAE,MAAM,KAAK;GAAE,CAAC;GACnE,aACE;EAEJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;GACR,UAAU,CAAC,YAAY;GACvB,aACE;EACJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;IAAC;IAAS;IAAc;IAAQ;GAAW;GACnD,aACE;EAGJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;CACF;CACA,QAAQ,CAAC;CACT,OAAO,CAAC;EAAE,MAAM;EAAI,aAAa;CAAW,CAAC;CAC7C,OAAO,CAAC;EAAE,MAAM;EAAa,aAAa;CAAqB,CAAC;CAChE,QAAQ,CAAC;CACT,OAAO,CAAC;AACV,kyHEnFAG,GAAAC,GAAAC,GAAAC,GAgBaC,IAAN,MAAM,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