spell-ui 0.8.5 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-components.md +14 -6
- package/README-frameworks.md +22 -12
- package/README-migrating.md +7 -6
- package/README-runtime.md +14 -13
- package/README-site.md +11 -11
- package/README-themes.md +38 -11
- package/README.md +61 -73
- package/dist/Dragging-CMZoLEWQ.js +169 -0
- package/dist/Dragging-CMZoLEWQ.js.map +1 -0
- package/dist/{MarkdownEngine-CbuT9Mjc.js → MarkdownEngine-CW1WGqNp.js} +122 -100
- package/dist/MarkdownEngine-CW1WGqNp.js.map +1 -0
- package/dist/{PrefStore-CeaTtjTz.js → PrefStore-Qv0e5y04.js} +22 -22
- package/dist/PrefStore-Qv0e5y04.js.map +1 -0
- package/dist/ScrollingRow-7n7Z-HIE.js +88 -0
- package/dist/ScrollingRow-7n7Z-HIE.js.map +1 -0
- package/dist/SitePages-CciwREek.js +51 -0
- package/dist/SitePages-CciwREek.js.map +1 -0
- package/dist/{SlottedItems-Ch0tzzlL.js → SlottedItems-Du3aJwG1.js} +22 -22
- package/dist/{SlottedItems-Ch0tzzlL.js.map → SlottedItems-Du3aJwG1.js.map} +1 -1
- package/dist/ThemeDraft-B7NPif4d.js +805 -0
- package/dist/ThemeDraft-B7NPif4d.js.map +1 -0
- package/dist/TreeMeasure-BVJeGb1L.js +42 -0
- package/dist/TreeMeasure-BVJeGb1L.js.map +1 -0
- package/dist/UIButton-DFEds67r.js +6 -0
- package/dist/UIButton-DFEds67r.js.map +1 -0
- package/dist/UIInput-BodVbUoQ.js +6 -0
- package/dist/UIInput-BodVbUoQ.js.map +1 -0
- package/dist/{UIKeys-DJF2TIKE.js → UIKeys-Rh_gUZjP.js} +10 -9
- package/dist/UIKeys-Rh_gUZjP.js.map +1 -0
- package/dist/UILabel-DgJUBzB_.js +6 -0
- package/dist/UILabel-DgJUBzB_.js.map +1 -0
- package/dist/UIMenu-zdcAtwTa.js +42 -0
- package/dist/UIMenu-zdcAtwTa.js.map +1 -0
- package/dist/{UIRuntime-BBuehGly.js → UIRuntime-KH309p5B.js} +398 -207
- package/dist/UIRuntime-KH309p5B.js.map +1 -0
- package/dist/_spell-element/DOMElement.d.ts +62 -5
- package/dist/_spell-element/MoveAndResize.d.ts +75 -0
- package/dist/_spell-element/UIComponent.d.ts +42 -0
- package/dist/_spell-element/elements.types.d.ts +47 -0
- package/dist/_spell-element/index.d.ts +1 -0
- package/dist/_spell-element/vocabulary.types.d.ts +34 -2
- package/dist/{runtime → _util}/Api.d.ts +14 -4
- package/dist/_util/Dragging.d.ts +148 -0
- package/dist/_util/ListSelection.d.ts +46 -0
- package/dist/{util → _util}/LoadOnce.d.ts +9 -1
- package/dist/_util/ReconnectingSocket.d.ts +51 -0
- package/dist/_util/diagram/DiagramColumns.d.ts +14 -0
- package/dist/_util/diagram/DiagramLayout.d.ts +119 -0
- package/dist/_util/diagram/DiagramSVG.d.ts +17 -0
- package/dist/_util/dom.d.ts +10 -0
- package/dist/_util/fetching.d.ts +92 -0
- package/dist/_util/measures/Dimension.d.ts +63 -0
- package/dist/_util/measures/MeasureSystem.d.ts +66 -0
- package/dist/_util/measures/dimensions.generated.d.ts +16 -0
- package/dist/_util/persist/ColorScheme.d.ts +6 -0
- package/dist/_util/persist/ServerPlace.d.ts +42 -0
- package/dist/_util/persist/WaitedOnPlace.d.ts +27 -0
- package/dist/_util/persist/persist.types.d.ts +21 -2
- package/dist/_util/timing.d.ts +10 -1
- package/dist/api.js +8 -7
- package/dist/api.js.map +1 -1
- package/dist/components/ComponentDefinitions.d.ts +29 -0
- package/dist/components/components.es.d.ts +13 -0
- package/dist/components/components.types.d.ts +113 -8
- package/dist/components/ui-accordion/UIAccordion.d.ts +1 -0
- package/dist/components/ui-accordion/UIAccordion.en.d.ts +1 -0
- package/dist/components/ui-action/UIAction.en.d.ts +5 -1
- package/dist/components/ui-ad/UIAd.d.ts +1 -0
- package/dist/components/ui-ad/UIAd.en.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumb.en.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumbs.en.d.ts +1 -0
- package/dist/components/ui-button/UIButton.d.ts +8 -3
- package/dist/components/ui-button/UIButton.en.d.ts +9 -4
- package/dist/components/ui-button/UIButton.es.d.ts +6 -0
- package/dist/components/ui-button/UIButton.fallback.d.ts +8 -3
- package/dist/components/ui-button/UIButtons.d.ts +1 -0
- package/dist/components/ui-button/UIButtons.en.d.ts +1 -0
- package/dist/components/ui-button/UIOr.d.ts +1 -0
- package/dist/components/ui-button/UIOr.en.d.ts +1 -0
- package/dist/components/ui-calendar/UICalendar.d.ts +6 -0
- package/dist/components/ui-calendar/UICalendar.en.d.ts +6 -0
- package/dist/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
- package/dist/components/ui-card/CardClicks.d.ts +40 -0
- package/dist/components/ui-card/UICard.d.ts +41 -0
- package/dist/components/ui-card/UICard.en.d.ts +49 -0
- package/dist/components/ui-card/UICard.es.d.ts +1 -0
- package/dist/components/ui-card/UICards.d.ts +31 -0
- package/dist/components/ui-card/UICards.en.d.ts +31 -0
- package/dist/components/ui-card/UICards.es.d.ts +8 -0
- package/dist/components/ui-checkbox/CheckControl.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.en.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.es.d.ts +1 -0
- package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.types.d.ts +5 -0
- package/dist/components/ui-checkbox/UIRadio.d.ts +8 -0
- package/dist/components/ui-checkbox/UIRadio.en.d.ts +6 -0
- package/dist/components/ui-code/UICode.en.d.ts +1 -0
- package/dist/components/ui-comment/UIComment.d.ts +1 -0
- package/dist/components/ui-comment/UIComment.en.d.ts +1 -0
- package/dist/components/ui-comment/UIComments.d.ts +1 -0
- package/dist/components/ui-comment/UIComments.en.d.ts +1 -0
- package/dist/components/ui-components/PackHotSwap.d.ts +17 -1
- package/dist/components/ui-components/UIComponents.d.ts +1 -0
- package/dist/components/ui-components/UIComponents.en.d.ts +1 -0
- package/dist/components/ui-container/UIContainer.d.ts +11 -0
- package/dist/components/ui-container/UIContainer.en.d.ts +7 -0
- package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
- package/dist/components/ui-diagram/UIDiagram.d.ts +268 -0
- package/dist/components/ui-diagram/UIDiagram.en.d.ts +106 -0
- package/dist/components/ui-diagram/UIDiagram.es.d.ts +37 -0
- package/dist/components/ui-diagram/UIDiagramNode.d.ts +98 -0
- package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +38 -0
- package/dist/components/ui-diagram/UIDiagramNode.es.d.ts +16 -0
- package/dist/components/ui-diagram/index.d.ts +8 -0
- package/dist/components/ui-dimension/UIDimension.d.ts +81 -0
- package/dist/components/ui-dimension/UIDimension.en.d.ts +54 -0
- package/dist/components/ui-dimension/UIDimension.es.d.ts +22 -0
- package/dist/components/ui-dimension/index.d.ts +2 -0
- package/dist/components/ui-dimmer/UIDimmer.d.ts +6 -1
- package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
- package/dist/components/ui-dimmer/UIDimmer.es.d.ts +1 -1
- package/dist/components/ui-divider/UIDivider.d.ts +2 -0
- package/dist/components/ui-divider/UIDivider.en.d.ts +2 -0
- package/dist/components/ui-divider/UIDivider.es.d.ts +1 -0
- package/dist/components/ui-dropdown/UIDropdown.d.ts +6 -0
- package/dist/components/ui-dropdown/UIDropdown.en.d.ts +6 -0
- package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
- package/dist/components/ui-embed/UIEmbed.d.ts +1 -0
- package/dist/components/ui-embed/UIEmbed.en.d.ts +1 -0
- package/dist/components/ui-emoji/UIEmoji.d.ts +1 -0
- package/dist/components/ui-emoji/UIEmoji.en.d.ts +1 -0
- package/dist/components/ui-example/UIExample.en.d.ts +4 -2
- package/dist/components/ui-example/UIExample.es.d.ts +3 -2
- package/dist/components/ui-feed/UIFeed.d.ts +1 -0
- package/dist/components/ui-feed/UIFeed.en.d.ts +1 -0
- package/dist/components/ui-feed/UIFeedEvent.d.ts +1 -0
- package/dist/components/ui-feed/UIFeedEvent.en.d.ts +1 -0
- package/dist/components/ui-flag/UIFlag.d.ts +1 -0
- package/dist/components/ui-flag/UIFlag.en.d.ts +1 -0
- package/dist/components/ui-flyout/UIFlyout.d.ts +1 -0
- package/dist/components/ui-flyout/UIFlyout.en.d.ts +1 -0
- package/dist/components/ui-form/FormBinding.d.ts +13 -1
- package/dist/components/ui-form/FormFields.d.ts +4 -4
- package/dist/components/ui-form/UIField.d.ts +30 -3
- package/dist/components/ui-form/UIField.en.d.ts +9 -0
- package/dist/components/ui-form/UIField.es.d.ts +6 -0
- package/dist/components/ui-form/UIFields.d.ts +1 -0
- package/dist/components/ui-form/UIFields.en.d.ts +1 -0
- package/dist/components/ui-form/UIForm.d.ts +15 -0
- package/dist/components/ui-form/UIForm.en.d.ts +6 -0
- package/dist/components/ui-form/UIRepeat.d.ts +1 -0
- package/dist/components/ui-form/UIRepeat.en.d.ts +1 -0
- package/dist/components/ui-form/index.d.ts +2 -1
- package/dist/components/ui-grid/UIColumn.d.ts +1 -0
- package/dist/components/ui-grid/UIColumn.en.d.ts +1 -0
- package/dist/components/ui-grid/UIGrid.d.ts +1 -0
- package/dist/components/ui-grid/UIGrid.en.d.ts +1 -0
- package/dist/components/ui-grid/UIRow.d.ts +1 -0
- package/dist/components/ui-grid/UIRow.en.d.ts +1 -0
- package/dist/components/ui-icon/UIIcon.d.ts +3 -2
- package/dist/components/ui-icon/UIIcon.en.d.ts +3 -2
- package/dist/components/ui-icon/UIIcons.d.ts +1 -0
- package/dist/components/ui-icon/UIIcons.en.d.ts +1 -0
- package/dist/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
- package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +6 -0
- package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
- package/dist/components/ui-image/UIImage.d.ts +34 -0
- package/dist/components/ui-image/UIImage.en.d.ts +23 -0
- package/dist/components/ui-image/UIImage.es.d.ts +2 -0
- package/dist/components/ui-image/UIImages.d.ts +1 -0
- package/dist/components/ui-image/UIImages.en.d.ts +1 -0
- package/dist/components/ui-include/UIInclude.d.ts +1 -0
- package/dist/components/ui-include/UIInclude.en.d.ts +1 -0
- package/dist/components/ui-input/TextControl.d.ts +7 -0
- package/dist/components/ui-input/UIInput.d.ts +22 -3
- package/dist/components/ui-input/UIInput.en.d.ts +9 -2
- package/dist/components/ui-input/UIInput.es.d.ts +2 -0
- package/dist/components/ui-input/UIInput.fallback.d.ts +9 -2
- package/dist/components/ui-input/UITextarea.d.ts +20 -0
- package/dist/components/ui-input/UITextarea.en.d.ts +15 -0
- package/dist/components/ui-input/UITextarea.es.d.ts +4 -0
- package/dist/components/ui-item/UIItem.d.ts +27 -4
- package/dist/components/ui-item/UIItem.en.d.ts +5 -1
- package/dist/components/ui-items/UIItems.d.ts +1 -0
- package/dist/components/ui-items/UIItems.en.d.ts +1 -0
- package/dist/components/ui-json/JsonChild.d.ts +30 -0
- package/dist/components/ui-json/UIJson.d.ts +128 -0
- package/dist/components/ui-json/UIJson.en.d.ts +71 -0
- package/dist/components/ui-json/UIJson.es.d.ts +12 -0
- package/dist/components/ui-json/index.d.ts +3 -0
- package/dist/components/ui-keys/UIKeys.d.ts +1 -0
- package/dist/components/ui-keys/UIKeys.en.d.ts +1 -0
- package/dist/components/ui-label/UILabel.d.ts +2 -0
- package/dist/components/ui-label/UILabel.en.d.ts +2 -0
- package/dist/components/ui-label/UILabel.es.d.ts +1 -0
- package/dist/components/ui-label/UILabels.d.ts +1 -0
- package/dist/components/ui-label/UILabels.en.d.ts +1 -0
- package/dist/components/ui-list/UIList.d.ts +2 -0
- package/dist/components/ui-list/UIList.en.d.ts +2 -0
- package/dist/components/ui-list/UIList.es.d.ts +1 -0
- package/dist/components/ui-loader/UILoader.d.ts +1 -0
- package/dist/components/ui-loader/UILoader.en.d.ts +1 -0
- package/dist/components/ui-markdown/MarkdownBox.d.ts +143 -0
- package/dist/components/ui-markdown/MarkdownEngine.d.ts +14 -2
- package/dist/components/ui-markdown/MarkdownFormats.d.ts +95 -0
- package/dist/components/ui-markdown/MarkdownSource.d.ts +57 -0
- package/dist/components/ui-markdown/UIMarkdown.d.ts +126 -6
- package/dist/components/ui-markdown/UIMarkdown.en.d.ts +111 -8
- package/dist/components/ui-markdown/UIMarkdown.es.d.ts +29 -1
- package/dist/components/ui-markdown/UIMarkdown.types.d.ts +26 -0
- package/dist/components/ui-menu/ScrollingRow.d.ts +79 -0
- package/dist/components/ui-menu/TitleFit.d.ts +3 -0
- package/dist/components/ui-menu/UIMenu.d.ts +97 -4
- package/dist/components/ui-menu/UIMenu.en.d.ts +50 -1
- package/dist/components/ui-menu/UIMenu.es.d.ts +4 -0
- package/dist/components/ui-message/UIMessage.d.ts +2 -0
- package/dist/components/ui-message/UIMessage.en.d.ts +2 -0
- package/dist/components/ui-message/UIMessage.es.d.ts +1 -0
- package/dist/components/ui-modal/UIModal.d.ts +1 -0
- package/dist/components/ui-modal/UIModal.en.d.ts +1 -0
- package/dist/components/ui-nag/UINag.d.ts +1 -0
- package/dist/components/ui-nag/UINag.en.d.ts +1 -0
- package/dist/components/ui-page/UIPage.d.ts +15 -0
- package/dist/components/ui-page/UIPage.en.d.ts +15 -0
- package/dist/components/ui-page/UIPage.es.d.ts +1 -0
- package/dist/components/ui-panel/UIPanel.d.ts +6 -0
- package/dist/components/ui-panel/UIPanel.en.d.ts +33 -20
- package/dist/components/ui-parts/UIActions.d.ts +1 -0
- package/dist/components/ui-parts/UIActions.en.d.ts +1 -0
- package/dist/components/ui-parts/UIAuthor.d.ts +1 -0
- package/dist/components/ui-parts/UIAuthor.en.d.ts +1 -0
- package/dist/components/ui-parts/UIAvatar.d.ts +1 -0
- package/dist/components/ui-parts/UIAvatar.en.d.ts +1 -0
- package/dist/components/ui-parts/UIContent.d.ts +1 -0
- package/dist/components/ui-parts/UIContent.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDate.d.ts +1 -0
- package/dist/components/ui-parts/UIDate.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDescription.d.ts +1 -0
- package/dist/components/ui-parts/UIDescription.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDetail.d.ts +1 -0
- package/dist/components/ui-parts/UIDetail.en.d.ts +1 -0
- package/dist/components/ui-parts/UIExtra.d.ts +1 -0
- package/dist/components/ui-parts/UIExtra.en.d.ts +1 -0
- package/dist/components/ui-parts/UIHeader.d.ts +3 -1
- package/dist/components/ui-parts/UIHeader.en.d.ts +3 -1
- package/dist/components/ui-parts/UIMeta.d.ts +1 -0
- package/dist/components/ui-parts/UIMeta.en.d.ts +1 -0
- package/dist/components/ui-parts/UIParts.types.d.ts +15 -1
- package/dist/components/ui-parts/UISummary.d.ts +1 -0
- package/dist/components/ui-parts/UISummary.en.d.ts +1 -0
- package/dist/components/ui-parts/UITitle.d.ts +1 -0
- package/dist/components/ui-parts/UITitle.en.d.ts +1 -0
- package/dist/components/ui-parts/UIValue.d.ts +1 -0
- package/dist/components/ui-parts/UIValue.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholder.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderHeader.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderImage.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderLine.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderParagraph.en.d.ts +1 -0
- package/dist/components/ui-popup/UIPopup.d.ts +30 -3
- package/dist/components/ui-popup/UIPopup.en.d.ts +7 -0
- package/dist/components/ui-popup/UIPopup.es.d.ts +1 -0
- package/dist/components/ui-progress/UIProgress.d.ts +2 -0
- package/dist/components/ui-progress/UIProgress.en.d.ts +2 -0
- package/dist/components/ui-progress/UIProgress.es.d.ts +1 -0
- package/dist/components/ui-property-editor/UIProperty.d.ts +132 -5
- package/dist/components/ui-property-editor/UIProperty.en.d.ts +11 -44
- package/dist/components/ui-property-editor/UIProperty.es.d.ts +4 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +38 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.es.d.ts +4 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +33 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +12 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +2 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.es.d.ts +9 -0
- package/dist/components/ui-property-editor/index.d.ts +1 -0
- package/dist/components/ui-quote/UIQuote.d.ts +1 -0
- package/dist/components/ui-quote/UIQuote.en.d.ts +1 -0
- package/dist/components/ui-rail/UIRail.d.ts +1 -0
- package/dist/components/ui-rail/UIRail.en.d.ts +1 -0
- package/dist/components/ui-rating/UIRating.d.ts +6 -0
- package/dist/components/ui-rating/UIRating.en.d.ts +6 -0
- package/dist/components/ui-rating/UIRating.fallback.d.ts +6 -0
- package/dist/components/ui-reveal/UIReveal.d.ts +1 -0
- package/dist/components/ui-reveal/UIReveal.en.d.ts +1 -0
- package/dist/components/ui-root/UIRoot.d.ts +18 -3
- package/dist/components/ui-root/UIRoot.en.d.ts +15 -0
- package/dist/components/ui-root/UIRoot.es.d.ts +1 -0
- package/dist/components/ui-search/UISearch.d.ts +48 -7
- package/dist/components/ui-search/UISearch.en.d.ts +13 -1
- package/dist/components/ui-search/UISearch.es.d.ts +1 -0
- package/dist/components/ui-search/UISearch.fallback.d.ts +13 -1
- package/dist/components/ui-section/UISection.d.ts +30 -1
- package/dist/components/ui-section/UISection.en.d.ts +10 -0
- package/dist/components/ui-section/UISection.es.d.ts +1 -0
- package/dist/components/ui-section/UISections.d.ts +1 -0
- package/dist/components/ui-section/UISections.en.d.ts +1 -0
- package/dist/components/ui-segment/UISegment.d.ts +2 -0
- package/dist/components/ui-segment/UISegment.en.d.ts +2 -0
- package/dist/components/ui-segment/UISegment.es.d.ts +1 -0
- package/dist/components/ui-segment/UISegments.d.ts +1 -0
- package/dist/components/ui-segment/UISegments.en.d.ts +1 -0
- package/dist/components/ui-select/UISelect.d.ts +6 -0
- package/dist/components/ui-select/UISelect.en.d.ts +6 -0
- package/dist/components/ui-select/UISelect.fallback.d.ts +6 -0
- package/dist/components/ui-shape/UIShape.d.ts +23 -2
- package/dist/components/ui-shape/UIShape.en.d.ts +8 -0
- package/dist/components/ui-shape/UIShape.es.d.ts +1 -0
- package/dist/components/ui-shape/UISide.d.ts +4 -0
- package/dist/components/ui-shape/UISide.en.d.ts +4 -0
- package/dist/components/ui-sidebar/UIPushable.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPushable.en.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPusher.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPusher.en.d.ts +1 -0
- package/dist/components/ui-sidebar/UISidebar.d.ts +1 -0
- package/dist/components/ui-sidebar/UISidebar.en.d.ts +1 -0
- package/dist/components/ui-sides/UISides.d.ts +209 -0
- package/dist/components/ui-sides/UISides.en.d.ts +122 -0
- package/dist/components/ui-sides/UISides.es.d.ts +30 -0
- package/dist/components/ui-sides/UISides.fallback.d.ts +134 -0
- package/dist/components/ui-sides/index.d.ts +2 -0
- package/dist/components/ui-site-nav/SitePages.d.ts +53 -0
- package/dist/components/ui-site-nav/UISiteNav.d.ts +207 -0
- package/dist/components/ui-site-nav/UISiteNav.en.d.ts +87 -0
- package/dist/components/ui-site-nav/UISiteNav.es.d.ts +29 -0
- package/dist/components/ui-site-nav/index.d.ts +1 -0
- package/dist/components/ui-site-tabs/UISiteTabs.d.ts +126 -0
- package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +49 -0
- package/dist/components/ui-site-tabs/UISiteTabs.es.d.ts +18 -0
- package/dist/components/ui-site-tabs/index.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.d.ts +7 -0
- package/dist/components/ui-slider/UISlider.en.d.ts +7 -0
- package/dist/components/ui-slider/UISlider.es.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.fallback.d.ts +7 -0
- package/dist/components/ui-space/UISpace.d.ts +1 -0
- package/dist/components/ui-space/UISpace.en.d.ts +1 -0
- package/dist/components/ui-split-panel/UISplitPanel.d.ts +175 -0
- package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +74 -0
- package/dist/components/ui-split-panel/UISplitPanel.es.d.ts +25 -0
- package/dist/components/ui-split-panel/index.d.ts +2 -0
- package/dist/components/ui-stack/UIStack.d.ts +31 -5
- package/dist/components/ui-stack/UIStack.en.d.ts +15 -3
- package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistics.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistics.en.d.ts +1 -0
- package/dist/components/ui-step/UIStep.d.ts +1 -0
- package/dist/components/ui-step/UIStep.en.d.ts +1 -0
- package/dist/components/ui-step/UISteps.d.ts +1 -0
- package/dist/components/ui-step/UISteps.en.d.ts +1 -0
- package/dist/components/ui-sticky/UISticky.d.ts +4 -0
- package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
- package/dist/components/ui-tab/UITab.d.ts +8 -0
- package/dist/components/ui-tab/UITab.en.d.ts +1 -0
- package/dist/components/ui-tab/UITabs.d.ts +107 -16
- package/dist/components/ui-tab/UITabs.en.d.ts +40 -1
- package/dist/components/ui-tab/UITabs.es.d.ts +4 -0
- package/dist/components/ui-table/TableEditing.d.ts +77 -0
- package/dist/components/ui-table/UICell.d.ts +1 -0
- package/dist/components/ui-table/UICell.en.d.ts +1 -0
- package/dist/components/ui-table/UITable.d.ts +145 -5
- package/dist/components/ui-table/UITable.en.d.ts +19 -0
- package/dist/components/ui-table/UITable.es.d.ts +3 -0
- package/dist/components/ui-terms/UITerm.d.ts +1 -0
- package/dist/components/ui-terms/UITerm.en.d.ts +1 -0
- package/dist/components/ui-terms/UITerms.d.ts +1 -0
- package/dist/components/ui-terms/UITerms.en.d.ts +1 -0
- package/dist/components/ui-text/UILink.d.ts +11 -0
- package/dist/components/ui-text/UILink.en.d.ts +4 -0
- package/dist/components/ui-text/UIText.d.ts +7 -0
- package/dist/components/ui-text/UIText.en.d.ts +7 -0
- package/dist/components/ui-text/UIText.es.d.ts +2 -0
- package/dist/components/ui-theme-editor/SavedTheme.d.ts +55 -43
- package/dist/components/ui-theme-editor/ThemeDraft.d.ts +15 -0
- package/dist/components/ui-theme-editor/UIColorChip.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIColorChip.en.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIThemeEditor.d.ts +157 -26
- package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +79 -6
- package/dist/components/ui-theme-editor/UIThemeEditor.es.d.ts +20 -2
- package/dist/components/ui-theme-editor/UIThemeEditor.types.d.ts +0 -2
- package/dist/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIThemeToken.en.d.ts +1 -0
- package/dist/components/ui-theme-menu/HueDropdown.d.ts +47 -0
- package/dist/components/ui-theme-menu/ThemeMenu.d.ts +18 -7
- package/dist/components/ui-theme-menu/ThemePreference.d.ts +145 -36
- package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +118 -7
- package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +82 -2
- package/dist/components/ui-theme-menu/UIThemeMenu.es.d.ts +21 -1
- package/dist/components/ui-theme-menu/UIThemeMenu.types.d.ts +36 -8
- package/dist/components/ui-theme-menu/index.d.ts +2 -1
- package/dist/components/ui-toast/UIToast.d.ts +1 -0
- package/dist/components/ui-toast/UIToast.en.d.ts +1 -0
- package/dist/components/ui-toc/UIToc.d.ts +1 -0
- package/dist/components/ui-toc/UIToc.en.d.ts +1 -0
- package/dist/components/ui-toolbar/UIToolbar.d.ts +13 -10
- package/dist/components/ui-toolbar/UIToolbar.en.d.ts +138 -84
- package/dist/components/ui-toolbar/UIToolbar.es.d.ts +2 -0
- package/dist/components/ui-transition/UITransition.d.ts +1 -0
- package/dist/components/ui-transition/UITransition.en.d.ts +1 -0
- package/dist/components/ui-tree/UITree.d.ts +162 -0
- package/dist/components/ui-tree/UITree.en.d.ts +88 -0
- package/dist/components/ui-tree/UITree.es.d.ts +35 -0
- package/dist/components/ui-tree/UITreeItem.d.ts +204 -0
- package/dist/components/ui-tree/UITreeItem.en.d.ts +142 -0
- package/dist/components/ui-tree/UITreeItem.es.d.ts +32 -0
- package/dist/components/ui-tree/index.d.ts +3 -0
- package/dist/components/ui-tree-diagram/TreeData.d.ts +3 -12
- package/dist/components/ui-tree-diagram/TreeLayout.d.ts +54 -21
- package/dist/components/ui-tree-diagram/TreeMeasure.d.ts +36 -0
- package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +152 -27
- package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +47 -7
- package/dist/components/ui-tree-diagram/UITreeDiagram.es.d.ts +12 -1
- package/dist/components/ui-tree-diagram/UITreeDiagram.types.d.ts +66 -21
- package/dist/components/ui-tree-diagram/UITreeNode.d.ts +148 -0
- package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +69 -0
- package/dist/components/ui-tree-diagram/UITreeNode.es.d.ts +21 -0
- package/dist/components/ui-tree-diagram/index.d.ts +4 -2
- package/dist/components/ui-video/UIAudio.d.ts +1 -0
- package/dist/components/ui-video/UIAudio.en.d.ts +1 -0
- package/dist/components/ui-video/UIVideo.d.ts +1 -0
- package/dist/components/ui-video/UIVideo.en.d.ts +1 -0
- package/dist/components/ui-visibility/UIVisibility.d.ts +1 -0
- package/dist/components/ui-visibility/UIVisibility.en.d.ts +1 -0
- package/dist/components/ui-zoom/UIZoom.d.ts +1 -0
- package/dist/components/ui-zoom/UIZoom.en.d.ts +1 -0
- package/dist/{components.es-DmLzT-Bq.js → components.es-BOa_7gFF.js} +498 -109
- package/dist/components.es-BOa_7gFF.js.map +1 -0
- package/dist/core.d.ts +3 -1
- package/dist/core.js +1082 -511
- package/dist/core.js.map +1 -1
- package/dist/crisp-VfYZlTph.js +6 -0
- package/dist/{crisp-CoZRRDuQ.js.map → crisp-VfYZlTph.js.map} +1 -1
- package/dist/docs-components/index.d.ts +1 -0
- package/dist/docs-components/ui-docs-index/UIDocsIndex.d.ts +89 -0
- package/dist/docs-components/ui-docs-index/UIDocsIndex.en.d.ts +43 -0
- package/dist/docs-components/ui-docs-index/index.d.ts +2 -0
- package/dist/docs-components/ui-docs-nav/UIDocsNav.d.ts +54 -87
- package/dist/docs-components/ui-docs-nav/UIDocsNav.types.d.ts +2 -29
- package/dist/docs-components/ui-docs-search/SearchIndex.d.ts +8 -2
- package/dist/docs-components/ui-docs-search/UIDocsSearch.d.ts +10 -0
- package/dist/docs-components/ui-docs-search/UIDocsSearch.en.d.ts +5 -0
- package/dist/elements/AddressParameter.d.ts +87 -0
- package/dist/elements/DOMFormControl.d.ts +5 -0
- package/dist/elements/FormComponent.d.ts +32 -0
- package/dist/elements/LoadableBody.d.ts +6 -1
- package/dist/elements/LoadableComponent.d.ts +10 -1
- package/dist/elements/RootSettings.d.ts +43 -6
- package/dist/elements/SpellUISettings.d.ts +1 -0
- package/dist/elements/StickyWatch.d.ts +20 -0
- package/dist/elements/elements.types.d.ts +15 -0
- package/dist/elements/index.d.ts +2 -0
- package/dist/forms.js +93 -63
- package/dist/forms.js.map +1 -1
- package/dist/fruity-BRVlgJZd.js +6 -0
- package/dist/fruity-BRVlgJZd.js.map +1 -0
- package/dist/{fruity.theme-BJcMiPl1.js → fruity.theme-CbC7Jyvk.js} +2 -2
- package/dist/fruity.theme-CbC7Jyvk.js.map +1 -0
- package/dist/glass-x9tbbwVq.js +6 -0
- package/dist/glass-x9tbbwVq.js.map +1 -0
- package/dist/glass.theme-24wY2wH9.js +6 -0
- package/dist/glass.theme-24wY2wH9.js.map +1 -0
- package/dist/hot.js +536 -26
- package/dist/hot.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +91 -81
- package/dist/jsx.d.ts +21149 -10377
- package/dist/matrix-QY2gWbJ0.js +6 -0
- package/dist/{matrix-CqA59hiF.js.map → matrix-QY2gWbJ0.js.map} +1 -1
- package/dist/{matrix.theme-jqQZjcq3.js → matrix.theme-_8xtwhDq.js} +2 -2
- package/dist/matrix.theme-_8xtwhDq.js.map +1 -0
- package/dist/midnight-BxlTQSfw.js +6 -0
- package/dist/{midnight-BnoVOrhC.js.map → midnight-BxlTQSfw.js.map} +1 -1
- package/dist/mockup-83ELBuVr.js +6 -0
- package/dist/mockup-83ELBuVr.js.map +1 -0
- package/dist/mockup.theme-DmpBgGBl.js +6 -0
- package/dist/mockup.theme-DmpBgGBl.js.map +1 -0
- package/dist/paper-M61nUilz.js +6 -0
- package/dist/{paper-CynH8ZuT.js.map → paper-M61nUilz.js.map} +1 -1
- package/dist/persist.types-D2m6wD-S.js +9 -0
- package/dist/persist.types-D2m6wD-S.js.map +1 -0
- package/dist/pop-CxXfytjk.js +6 -0
- package/dist/{pop-D2i9V_rG.js.map → pop-CxXfytjk.js.map} +1 -1
- package/dist/runtime/DataTooltips.d.ts +75 -0
- package/dist/runtime/PropertyControls.d.ts +15 -1
- package/dist/runtime/Sources.d.ts +16 -4
- package/dist/runtime/Styles.d.ts +11 -0
- package/dist/runtime/Themes.d.ts +10 -4
- package/dist/runtime/UIRuntime.d.ts +4 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/runtime.types.d.ts +18 -85
- package/dist/spell-By5Y3jKP.js +6 -0
- package/dist/{spell-BFtLICm7.js.map → spell-By5Y3jKP.js.map} +1 -1
- package/dist/{spell.theme-B7AU7SQX.js → spell.theme-DxGj7qHx.js} +2 -2
- package/dist/spell.theme-DxGj7qHx.js.map +1 -0
- package/dist/styles/CodeThemeFile.d.ts +73 -0
- package/dist/styles/StyleGenerator.d.ts +6 -0
- package/dist/styles/styles.en.d.ts +141 -3
- package/dist/styles/styles.types.d.ts +2 -0
- package/dist/{styles.en-RLpYiO5_.js → styles.en-CUUxNwHo.js} +71 -14
- package/dist/styles.en-CUUxNwHo.js.map +1 -0
- package/dist/styles.js +13 -13
- package/dist/styles.js.map +1 -1
- package/dist/ui-accordion.js +54 -53
- package/dist/ui-accordion.js.map +1 -1
- package/dist/ui-action.js +20 -19
- package/dist/ui-action.js.map +1 -1
- package/dist/ui-ad.js +5 -4
- package/dist/ui-ad.js.map +1 -1
- package/dist/ui-breadcrumbs.js +15 -13
- package/dist/ui-breadcrumbs.js.map +1 -1
- package/dist/ui-button.js +132 -125
- package/dist/ui-button.js.map +1 -1
- package/dist/ui-calendar.js +208 -206
- package/dist/ui-calendar.js.map +1 -1
- package/dist/ui-card.js +260 -98
- package/dist/ui-card.js.map +1 -1
- package/dist/ui-checkbox.js +95 -81
- package/dist/ui-checkbox.js.map +1 -1
- package/dist/ui-code.js +25 -24
- package/dist/ui-code.js.map +1 -1
- package/dist/ui-comment.js +14 -12
- package/dist/ui-comment.js.map +1 -1
- package/dist/ui-components.js +7 -6
- package/dist/ui-components.js.map +1 -1
- package/dist/ui-container.js +24 -12
- package/dist/ui-container.js.map +1 -1
- package/dist/ui-diagram.js +1328 -0
- package/dist/ui-diagram.js.map +1 -0
- package/dist/ui-dimension.js +779 -0
- package/dist/ui-dimension.js.map +1 -0
- package/dist/ui-dimmer.js +36 -34
- package/dist/ui-dimmer.js.map +1 -1
- package/dist/ui-divider.js +7 -5
- package/dist/ui-divider.js.map +1 -1
- package/dist/ui-dropdown.js +107 -105
- package/dist/ui-dropdown.js.map +1 -1
- package/dist/ui-embed.js +36 -35
- package/dist/ui-embed.js.map +1 -1
- package/dist/ui-emoji.js +10 -9
- package/dist/ui-emoji.js.map +1 -1
- package/dist/ui-example.js +63 -61
- package/dist/ui-example.js.map +1 -1
- package/dist/ui-feed.js +12 -10
- package/dist/ui-feed.js.map +1 -1
- package/dist/ui-flag.js +10 -9
- package/dist/ui-flag.js.map +1 -1
- package/dist/ui-flyout.js +7 -6
- package/dist/ui-flyout.js.map +1 -1
- package/dist/ui-form.js +244 -162
- package/dist/ui-form.js.map +1 -1
- package/dist/ui-grid.js +21 -18
- package/dist/ui-grid.js.map +1 -1
- package/dist/ui-icon-picker.js +46 -44
- package/dist/ui-icon-picker.js.map +1 -1
- package/dist/ui-icon.js +17 -14
- package/dist/ui-icon.js.map +1 -1
- package/dist/ui-image.js +93 -55
- package/dist/ui-image.js.map +1 -1
- package/dist/ui-include.js +18 -17
- package/dist/ui-include.js.map +1 -1
- package/dist/ui-input.js +154 -112
- package/dist/ui-input.js.map +1 -1
- package/dist/ui-item.js +152 -102
- package/dist/ui-item.js.map +1 -1
- package/dist/ui-items.js +9 -8
- package/dist/ui-items.js.map +1 -1
- package/dist/ui-json.js +115 -0
- package/dist/ui-json.js.map +1 -0
- package/dist/ui-keys.js +1 -1
- package/dist/ui-label.js +18 -15
- package/dist/ui-label.js.map +1 -1
- package/dist/ui-list.js +7 -5
- package/dist/ui-list.js.map +1 -1
- package/dist/ui-loader.js +7 -6
- package/dist/ui-loader.js.map +1 -1
- package/dist/ui-markdown.js +975 -83
- package/dist/ui-markdown.js.map +1 -1
- package/dist/ui-menu.js +329 -196
- package/dist/ui-menu.js.map +1 -1
- package/dist/ui-message.js +20 -18
- package/dist/ui-message.js.map +1 -1
- package/dist/ui-modal.js +46 -45
- package/dist/ui-modal.js.map +1 -1
- package/dist/ui-nag.js +19 -18
- package/dist/ui-nag.js.map +1 -1
- package/dist/ui-page.js +8 -7
- package/dist/ui-page.js.map +1 -1
- package/dist/ui-panel.js +28 -17
- package/dist/ui-panel.js.map +1 -1
- package/dist/ui-parts.js +66 -52
- package/dist/ui-parts.js.map +1 -1
- package/dist/ui-placeholder.js +21 -16
- package/dist/ui-placeholder.js.map +1 -1
- package/dist/ui-popup.js +113 -84
- package/dist/ui-popup.js.map +1 -1
- package/dist/ui-progress.js +9 -7
- package/dist/ui-progress.js.map +1 -1
- package/dist/ui-property-editor.js +706 -203
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-quote.js +5 -4
- package/dist/ui-quote.js.map +1 -1
- package/dist/ui-rail.js +5 -4
- package/dist/ui-rail.js.map +1 -1
- package/dist/ui-rating.js +31 -29
- package/dist/ui-rating.js.map +1 -1
- package/dist/ui-reveal.js +7 -6
- package/dist/ui-reveal.js.map +1 -1
- package/dist/ui-root.js +324 -158
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-search.js +210 -168
- package/dist/ui-search.js.map +1 -1
- package/dist/ui-section.js +167 -130
- package/dist/ui-section.js.map +1 -1
- package/dist/ui-segment.js +15 -12
- package/dist/ui-segment.js.map +1 -1
- package/dist/ui-select.js +83 -81
- package/dist/ui-select.js.map +1 -1
- package/dist/ui-shape.js +86 -58
- package/dist/ui-shape.js.map +1 -1
- package/dist/ui-sidebar.js +59 -56
- package/dist/ui-sidebar.js.map +1 -1
- package/dist/ui-sides.js +325 -0
- package/dist/ui-sides.js.map +1 -0
- package/dist/ui-site-nav.js +329 -0
- package/dist/ui-site-nav.js.map +1 -0
- package/dist/ui-site-tabs.js +177 -0
- package/dist/ui-site-tabs.js.map +1 -0
- package/dist/ui-slider.js +84 -81
- package/dist/ui-slider.js.map +1 -1
- package/dist/ui-space.js +7 -6
- package/dist/ui-space.js.map +1 -1
- package/dist/ui-split-panel.js +298 -0
- package/dist/ui-split-panel.js.map +1 -0
- package/dist/ui-stack.js +47 -23
- package/dist/ui-stack.js.map +1 -1
- package/dist/ui-statistic.js +15 -13
- package/dist/ui-statistic.js.map +1 -1
- package/dist/ui-step.js +31 -29
- package/dist/ui-step.js.map +1 -1
- package/dist/ui-sticky.js +7 -6
- package/dist/ui-sticky.js.map +1 -1
- package/dist/ui-tab.js +230 -138
- package/dist/ui-tab.js.map +1 -1
- package/dist/ui-table.js +724 -162
- package/dist/ui-table.js.map +1 -1
- package/dist/ui-terms.js +12 -10
- package/dist/ui-terms.js.map +1 -1
- package/dist/ui-text.js +53 -28
- package/dist/ui-text.js.map +1 -1
- package/dist/ui-theme-editor.js +1018 -1545
- package/dist/ui-theme-editor.js.map +1 -1
- package/dist/ui-theme-menu-CuIjr8Ou.js +1493 -0
- package/dist/ui-theme-menu-CuIjr8Ou.js.map +1 -0
- package/dist/ui-toast.js +45 -44
- package/dist/ui-toast.js.map +1 -1
- package/dist/ui-toc.js +75 -74
- package/dist/ui-toc.js.map +1 -1
- package/dist/ui-toolbar.js +51 -73
- package/dist/ui-toolbar.js.map +1 -1
- package/dist/ui-transition.js +12 -11
- package/dist/ui-transition.js.map +1 -1
- package/dist/ui-tree-diagram.js +676 -197
- package/dist/ui-tree-diagram.js.map +1 -1
- package/dist/ui-tree.js +625 -0
- package/dist/ui-tree.js.map +1 -0
- package/dist/ui-video.js +13 -11
- package/dist/ui-video.js.map +1 -1
- package/dist/ui-visibility.js +26 -25
- package/dist/ui-visibility.js.map +1 -1
- package/dist/ui-zoom.js +79 -78
- package/dist/ui-zoom.js.map +1 -1
- package/dist/util/TopLayerTip.d.ts +28 -0
- package/dist/util/index.d.ts +5 -2
- package/dist/vocabulary/DefaultValues.d.ts +34 -0
- package/dist/vocabulary/SharedVocabulary.d.ts +4 -0
- package/dist/vocabulary/SharedVocabulary.es.d.ts +7 -0
- package/dist/vocabulary/ValueSets.d.ts +18 -0
- package/dist/vocabulary/Vocabulary.d.ts +1 -0
- package/dist/vocabulary/defaults.generated.d.ts +6 -0
- package/dist/vocabulary/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/MarkdownEngine-CbuT9Mjc.js.map +0 -1
- package/dist/PrefStore-CeaTtjTz.js.map +0 -1
- package/dist/UIButton-XkfGqgh6.js +0 -6
- package/dist/UIButton-XkfGqgh6.js.map +0 -1
- package/dist/UIInput-BUudZstW.js +0 -6
- package/dist/UIInput-BUudZstW.js.map +0 -1
- package/dist/UIKeys-DJF2TIKE.js.map +0 -1
- package/dist/UILabel-C1jy3Yl8.js +0 -6
- package/dist/UILabel-C1jy3Yl8.js.map +0 -1
- package/dist/UIMenu-Btd-8V3A.js +0 -42
- package/dist/UIMenu-Btd-8V3A.js.map +0 -1
- package/dist/UIRuntime-BBuehGly.js.map +0 -1
- package/dist/components.es-DmLzT-Bq.js.map +0 -1
- package/dist/crisp-CoZRRDuQ.js +0 -6
- package/dist/fruity-CQFYeRlh.js +0 -6
- package/dist/fruity-CQFYeRlh.js.map +0 -1
- package/dist/fruity.theme-BJcMiPl1.js.map +0 -1
- package/dist/glass-CAfW11kL.js +0 -6
- package/dist/glass-CAfW11kL.js.map +0 -1
- package/dist/glass.theme-DQcBbtCW.js +0 -6
- package/dist/glass.theme-DQcBbtCW.js.map +0 -1
- package/dist/matrix-CqA59hiF.js +0 -6
- package/dist/matrix.theme-jqQZjcq3.js.map +0 -1
- package/dist/midnight-BnoVOrhC.js +0 -6
- package/dist/paper-CynH8ZuT.js +0 -6
- package/dist/persist.types-CsZxS8TG.js +0 -9
- package/dist/persist.types-CsZxS8TG.js.map +0 -1
- package/dist/pop-D2i9V_rG.js +0 -6
- package/dist/spell-BFtLICm7.js +0 -6
- package/dist/spell.theme-B7AU7SQX.js.map +0 -1
- package/dist/styles.en-RLpYiO5_.js.map +0 -1
- package/dist/ui-theme-menu-DyKZygpV.js +0 -921
- package/dist/ui-theme-menu-DyKZygpV.js.map +0 -1
package/dist/ui-code.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./rolldown-runtime-CYGlBXrH.js";
|
|
2
|
-
import { Bt as e, CODE_LANGUAGES_EVENT as t, ClipboardCopy as n, DOMLoadableElement as r,
|
|
2
|
+
import { Bt as e, CODE_LANGUAGES_EVENT as t, ClipboardCopy as n, DOMLoadableElement as r, Ht as i, IconGlyph as a, LoadOnce as o, LoadableComponent as s, Lt as c, Rt as l, SourceError as u, UI as d, Ut as f, Vt as p, cssState as m, derived as h, dt as ee, escapeHTML as te, ht as ne, mt as re, onChange as ie, once as ae, ot as oe, proto as se, protoMerged as ce, pt as le, state as g, untracked as _, zt as v } from "./core.js";
|
|
3
3
|
import "./ui-loader.js";
|
|
4
4
|
import "./ui-message.js";
|
|
5
5
|
import { Show as ue } from "solid-js";
|
|
@@ -7,6 +7,7 @@ import { addEvent as de, className as y, createComponent as fe, delegateEvents a
|
|
|
7
7
|
//#region src/components/ui-code/UICode.en.ts
|
|
8
8
|
var ge = {
|
|
9
9
|
tag: "ui-code",
|
|
10
|
+
icon: "code",
|
|
10
11
|
topics: [
|
|
11
12
|
"text",
|
|
12
13
|
"typography",
|
|
@@ -25,7 +26,7 @@ var ge = {
|
|
|
25
26
|
noun: "code",
|
|
26
27
|
description: "Code shows a block of source code coloured by its language, from the element's own text or a file on this site.",
|
|
27
28
|
attributes: [
|
|
28
|
-
...
|
|
29
|
+
...oe,
|
|
29
30
|
{
|
|
30
31
|
name: "language",
|
|
31
32
|
group: "appearance",
|
|
@@ -62,7 +63,7 @@ var ge = {
|
|
|
62
63
|
}
|
|
63
64
|
],
|
|
64
65
|
events: [
|
|
65
|
-
...
|
|
66
|
+
...ee,
|
|
66
67
|
{
|
|
67
68
|
name: "ui-coloured",
|
|
68
69
|
detail: "{ language?: string, detected: boolean }",
|
|
@@ -76,7 +77,7 @@ var ge = {
|
|
|
76
77
|
],
|
|
77
78
|
slots: [],
|
|
78
79
|
parts: [
|
|
79
|
-
...
|
|
80
|
+
...le,
|
|
80
81
|
{
|
|
81
82
|
name: "box",
|
|
82
83
|
description: "The box around the code and the copy button."
|
|
@@ -94,12 +95,12 @@ var ge = {
|
|
|
94
95
|
description: "The copy button."
|
|
95
96
|
}
|
|
96
97
|
],
|
|
97
|
-
states: [...
|
|
98
|
+
states: [...re, {
|
|
98
99
|
name: "copied",
|
|
99
100
|
description: "The copy button just copied the code."
|
|
100
101
|
}],
|
|
101
102
|
texts: [
|
|
102
|
-
...
|
|
103
|
+
...ne,
|
|
103
104
|
{
|
|
104
105
|
key: "codeCopy",
|
|
105
106
|
text: "Copy",
|
|
@@ -148,10 +149,10 @@ var ge = {
|
|
|
148
149
|
html: T.escape(e),
|
|
149
150
|
detected: !1
|
|
150
151
|
};
|
|
151
|
-
let n = t ?
|
|
152
|
+
let n = t ? d.code.find(t) : void 0;
|
|
152
153
|
if (n) return _CodeHighlighter.withRegistered(e, n.language, n.variant);
|
|
153
154
|
let r = await _CodeHighlighter.load();
|
|
154
|
-
for (let e of
|
|
155
|
+
for (let e of d.code.detectable()) r.register(e.name, e.grammar, {
|
|
155
156
|
aliases: e.aliases,
|
|
156
157
|
detect: !0
|
|
157
158
|
});
|
|
@@ -164,7 +165,7 @@ var ge = {
|
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
167
|
let i = await r.ensure(t);
|
|
167
|
-
if (!i) throw new
|
|
168
|
+
if (!i) throw new u(`CodeHighlighter.highlight(): no highlighting for "${t}"; \`UI.code.register()\` it`, { cause: { kind: "render" } });
|
|
168
169
|
return {
|
|
169
170
|
html: r.highlight(e, i),
|
|
170
171
|
language: i,
|
|
@@ -178,7 +179,7 @@ var ge = {
|
|
|
178
179
|
language: r,
|
|
179
180
|
detected: !1
|
|
180
181
|
};
|
|
181
|
-
if (!i.grammar) throw new
|
|
182
|
+
if (!i.grammar) throw new u(`CodeHighlighter.highlight(): "${r}" has neither a grammar nor a highlighter; give it one`, { cause: { kind: "render" } });
|
|
182
183
|
let a = await _CodeHighlighter.load();
|
|
183
184
|
return a.register(r, i.grammar, {
|
|
184
185
|
aliases: t.aliases,
|
|
@@ -191,31 +192,31 @@ var ge = {
|
|
|
191
192
|
}
|
|
192
193
|
static loadLanguage(e, t, n) {
|
|
193
194
|
return _CodeHighlighter.loaded.get(e, () => t.load(n).catch((t) => {
|
|
194
|
-
if (t instanceof
|
|
195
|
+
if (t instanceof u) throw t;
|
|
195
196
|
let n = t instanceof Error ? t.message : String(t);
|
|
196
|
-
throw new
|
|
197
|
+
throw new u(`CodeHighlighter.highlight(): "${e}" didn't load (${n}); check its \`load()\``, { cause: {
|
|
197
198
|
kind: "render",
|
|
198
199
|
error: t
|
|
199
200
|
} });
|
|
200
201
|
}));
|
|
201
202
|
}
|
|
202
203
|
};
|
|
203
|
-
D =
|
|
204
|
-
var k = O, A = "@layer ui.components.code.types{:host{display:block}.ui.code{--_ui-code-background:var(--ui-code-background,var(--ui-surface-muted));--_ui-code-color:var(--ui-code-color,var(--ui-text-color));--_ui-code-font:var(--ui-code-font,var(--ui-font-family-mono));--_ui-code-font-size:var(--ui-code-font-size,.875em);--_ui-code-line-height:var(--ui-code-line-height,1.5);--_ui-code-padding:var(--ui-code-padding,.75em 1em);--_ui-code-radius:var(--ui-code-radius,var(--ui-radius));--_ui-code-border:var(--ui-code-border,var(--ui-border-width) solid var(--ui-border-color));--_ui-code-gutter-color:var(--ui-code-gutter-color,var(--ui-text-muted));--_ui-code-keyword:var(--ui-code-keyword,light-dark(#a626a4,#c678dd));--_ui-code-string:var(--ui-code-string,light-dark(#387a37,#98c379));--_ui-code-number:var(--ui-code-number,light-dark(#986801,#d19a66));--_ui-code-comment:var(--ui-code-comment,light-dark(#696969,#8b919c));--_ui-code-title:var(--ui-code-title,light-dark(#2f5fd0,#61afef));--_ui-code-type:var(--ui-code-type,light-dark(#8a5a00,#e5c07b));--_ui-code-attr:var(--ui-code-attr,light-dark(#b8322a,#e06c75));--_ui-code-meta:var(--ui-code-meta,light-dark(#2f5fd0,#61afef));--_ui-code-addition:var(--ui-code-addition,light-dark(#387a37,#98c379));--_ui-code-deletion:var(--ui-code-deletion,light-dark(#b8322a,#e06c75));border:var(--_ui-code-border);border-radius:var(--_ui-code-radius);background:var(--_ui-code-background);color:var(--_ui-code-color);margin:0;position:relative}.ui.code pre{padding:var(--_ui-code-padding);border-radius:inherit;font-family:var(--_ui-code-font);font-size:var(--_ui-code-font-size);line-height:var(--_ui-code-line-height);tab-size:2;margin:0;overflow-x:auto}.ui.code pre:focus-visible{outline:2px solid var(--ui-focus-color,Highlight);outline-offset:-2px}.ui.code code{font:inherit;white-space:pre;display:block}.ui.code .line{min-height:1lh;display:block}}@layer ui.components.code.content{.ui.code .copy{z-index:1;box-sizing:border-box;border-radius:var(--ui-radius-s,6px);width:1.75em;height:1.75em;color:var(--_ui-code-gutter-color);font:inherit;cursor:
|
|
204
|
+
D = v(null), c(D, 9, "load", xe, O), l(D, O), f(D, 3, O), e(O, "CodeHighlighter"), i(O, "engineLoader", /* @__PURE__ */ e(() => import("./CodeEngine-GL9EzwF1.js"), "engineLoader")), i(O, "loaded", new o({ failures: "forgotten" }));
|
|
205
|
+
var k = O, A = "@layer ui.components.code.types{:host{display:block}.ui.code{--_ui-code-background:var(--ui-code-background,var(--ui-surface-muted));--_ui-code-color:var(--ui-code-color,var(--ui-text-color));--_ui-code-font:var(--ui-code-font,var(--ui-font-family-mono));--_ui-code-font-size:var(--ui-code-font-size,.875em);--_ui-code-line-height:var(--ui-code-line-height,1.5);--_ui-code-padding:var(--ui-code-padding,.75em 1em);--_ui-code-radius:var(--ui-code-radius,var(--ui-radius));--_ui-code-border:var(--ui-code-border,var(--ui-border-width) solid var(--ui-border-color));--_ui-code-gutter-color:var(--ui-code-gutter-color,var(--ui-text-muted));--_ui-code-keyword:var(--ui-code-keyword,light-dark(#a626a4,#c678dd));--_ui-code-string:var(--ui-code-string,light-dark(#387a37,#98c379));--_ui-code-number:var(--ui-code-number,var(--ui-code-constant,light-dark(#986801,#d19a66)));--_ui-code-comment:var(--ui-code-comment,light-dark(#696969,#8b919c));--_ui-code-title:var(--ui-code-title,var(--ui-code-action,light-dark(#2f5fd0,#61afef)));--_ui-code-type:var(--ui-code-type,light-dark(#8a5a00,#e5c07b));--_ui-code-attr:var(--ui-code-attr,light-dark(#b8322a,#e06c75));--_ui-code-meta:var(--ui-code-meta,light-dark(#2f5fd0,#61afef));--_ui-code-addition:var(--ui-code-addition,light-dark(#387a37,#98c379));--_ui-code-deletion:var(--ui-code-deletion,light-dark(#b8322a,#e06c75));border:var(--_ui-code-border);border-radius:var(--_ui-code-radius);background:var(--_ui-code-background);color:var(--_ui-code-color);margin:0;position:relative}.ui.code pre{padding:var(--_ui-code-padding);border-radius:inherit;font-family:var(--_ui-code-font);font-size:var(--_ui-code-font-size);line-height:var(--_ui-code-line-height);tab-size:2;margin:0;overflow-x:auto}.ui.code pre:focus-visible{outline:2px solid var(--ui-focus-color,Highlight);outline-offset:-2px}.ui.code code{font:inherit;white-space:pre;display:block}.ui.code .line{min-height:1lh;display:block}}@layer ui.components.code.content{.ui.code .copy{z-index:1;box-sizing:border-box;border-radius:var(--ui-radius-s,6px);width:1.75em;height:1.75em;color:var(--_ui-code-gutter-color);font:inherit;cursor:var(--ui-control-cursor);background:0 0;border:0;place-items:center;margin:0;padding:0;font-size:.875em;display:inline-grid;position:absolute;inset-block-start:.5em;inset-inline-end:.5em}.ui.code .copy>svg{fill:currentColor;width:1em;height:1em}.ui.code .copy:hover,.ui.code .copy:focus-visible{background:color-mix(in oklab, var(--_ui-code-color) 8%, transparent);color:var(--_ui-code-color)}.hljs-keyword,.hljs-built_in,.hljs-literal,.hljs-selector-tag{color:var(--_ui-code-keyword)}.hljs-string,.hljs-regexp,.hljs-subst,.hljs-symbol,.hljs-template-tag{color:var(--_ui-code-string)}.hljs-number{color:var(--_ui-code-number)}.hljs-comment,.hljs-quote{color:var(--_ui-code-comment);font-style:italic}.hljs-title,.hljs-section,.hljs-name{color:var(--_ui-code-title)}.hljs-title.class_,.hljs-type{color:var(--_ui-code-type)}.hljs-attr,.hljs-attribute,.hljs-property,.hljs-variable.language_,.hljs-selector-class,.hljs-selector-id{color:var(--_ui-code-attr)}.hljs-meta,.hljs-tag{color:var(--_ui-code-meta)}.hljs-addition{color:var(--_ui-code-addition)}.hljs-deletion{color:var(--_ui-code-deletion)}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}}@layer ui.components.code.variations{.ui.numbered.code .line{--_ui-code-gutter:4ch;counter-increment:line;text-indent:calc(-1 * var(--_ui-code-gutter));padding-inline-start:var(--_ui-code-gutter)}.ui.numbered.code .line:before{content:counter(line);box-sizing:border-box;width:var(--_ui-code-gutter);color:var(--_ui-code-gutter-color);text-align:end;text-indent:0;-webkit-user-select:none;user-select:none;padding-inline-end:1.5ch;display:inline-block}.ui.wrapping.code code{white-space:pre-wrap;overflow-wrap:anywhere}}@layer ui.components.code.states;", j = /* @__PURE__ */ w("<button type=button>"), M = /* @__PURE__ */ w("<div><pre tabindex=0><code>"), N, P, F, I, L, R, z, B, V, H, U, W, G, K, q, J, Y = class _DOMCodeElement extends (P = r, N = [_], P) {
|
|
205
206
|
constructor() {
|
|
206
|
-
super(...arguments),
|
|
207
|
+
super(...arguments), f(F, 5, this);
|
|
207
208
|
}
|
|
208
209
|
get detectedLanguage() {
|
|
209
210
|
return this.component?.detectedLanguage;
|
|
210
211
|
}
|
|
211
212
|
};
|
|
212
|
-
F =
|
|
213
|
-
var X = Y, Z = class _UICode extends (G =
|
|
213
|
+
F = v(P), c(F, 2, "detectedLanguage", N, Y), l(F, Y), e(Y, "DOMCodeElement");
|
|
214
|
+
var X = Y, Z = class _UICode extends (G = s, W = [se], U = [ce], H = [g], V = [g], B = [h], z = [h], R = [ie("textToShow", "language", "loadStatus", "languageCount")], L = [_], I = [m("copied")], G) {
|
|
214
215
|
constructor(...r) {
|
|
215
|
-
super(...r),
|
|
216
|
+
super(...r), f(K, 5, this), p(this, q, f(K, 8, this)), f(K, 11, this), p(this, J, f(K, 12, this, 0)), f(K, 15, this), i(this, "ticket", 0), i(this, "clipboard", new n()), i(this, "copyGlyph", new a({
|
|
216
217
|
owner: this,
|
|
217
|
-
name: /* @__PURE__ */
|
|
218
|
-
})),
|
|
218
|
+
name: /* @__PURE__ */ e(() => this.copy ? this.wasJustCopied ? Ee : Te : void 0, "name")
|
|
219
|
+
})), i(this, "onCopy", /* @__PURE__ */ e(async () => {
|
|
219
220
|
let { content: e } = this;
|
|
220
221
|
await this.clipboard.copy(e) && this.send("ui-copied", { content: e });
|
|
221
222
|
}, "onCopy")), me || this.on(t, () => this.languageCount += 1, { target: document });
|
|
@@ -244,7 +245,7 @@ var X = Y, Z = class _UICode extends (G = c, W = [oe], U = [se], H = [g], V = [g
|
|
|
244
245
|
async highlight(e, t) {
|
|
245
246
|
let n = ++this.ticket;
|
|
246
247
|
try {
|
|
247
|
-
await
|
|
248
|
+
await d.load();
|
|
248
249
|
let r = await k.highlight(e, t);
|
|
249
250
|
if (n !== this.ticket) return;
|
|
250
251
|
this.highlighted = {
|
|
@@ -257,7 +258,7 @@ var X = Y, Z = class _UICode extends (G = c, W = [oe], U = [se], H = [g], V = [g
|
|
|
257
258
|
} catch (e) {
|
|
258
259
|
if (n !== this.ticket) return;
|
|
259
260
|
this.highlighted = void 0;
|
|
260
|
-
let t =
|
|
261
|
+
let t = u.kindFor(e, "render");
|
|
261
262
|
this.sendSourceEvent("ui-error", {
|
|
262
263
|
kind: t,
|
|
263
264
|
source: this.source || void 0,
|
|
@@ -303,11 +304,11 @@ var X = Y, Z = class _UICode extends (G = c, W = [oe], U = [se], H = [g], V = [g
|
|
|
303
304
|
}), t;
|
|
304
305
|
}
|
|
305
306
|
};
|
|
306
|
-
K =
|
|
307
|
+
K = v(G), q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), c(K, 4, "highlighted", H, Z, q), c(K, 4, "languageCount", V, Z, J), c(K, 2, "lines", B, Z), c(K, 2, "markup", z, Z), c(K, 1, "onCodeChanged", R, Z), c(K, 1, "highlight", L, Z), c(K, 2, "wasJustCopied", I, Z), c(K, 13, "vocabulary", W, Z), c(K, 13, "elementSetup", U, Z), l(K, Z), e(Z, "UICode"), i(Z, "vocabulary", f(K, 16, Z, ge)), f(K, 19, Z), i(Z, "elementSetup", f(K, 20, Z, {
|
|
307
308
|
styleSheets: { code: A },
|
|
308
309
|
DOMElement: X,
|
|
309
310
|
delegatesFocus: !1
|
|
310
|
-
})),
|
|
311
|
+
})), f(K, 23, Z);
|
|
311
312
|
var Q = Z, Se = "line", Ce = "line", $ = "hljs", we = "copy", Te = "copy outline", Ee = "check";
|
|
312
313
|
//#endregion
|
|
313
314
|
//#region src/components/ui-code/index.ts
|
package/dist/ui-code.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-code.js","names":["UIT.SourceAttributes","UIT.SourceEvents","UIT.SourceParts","UIT.SourceStates","UIT.SourceTexts","E.escapeHTML","_init","E.once","E.SourceError","__name","E.LoadOnce","_init","<Show when={this.copy}>\n <button\n type=\"button\"\n class={COPY_CLASS}\n part={this.partForName(\"copy\")}\n aria-label={this.copyLabel}\n title={this.copyLabel}\n onClick={this.onCopy}\n >\n {this.copyGlyph.svg}\n </button>\n </Show>","this","part={this.partForName(\"copy\")}","aria-label={this.copyLabel}","title={this.copyLabel}","<button\n type=\"button\"\n class={COPY_CLASS}\n part={this.partForName(\"copy\")}\n aria-label={this.copyLabel}\n title={this.copyLabel}\n onClick={this.onCopy}\n >\n {this.copyGlyph.svg}\n </button>","<div class={this.rootClass} part={this.partForName(\"box\")}>\n <Show when={this.copy}>\n <button\n type=\"button\"\n class={COPY_CLASS}\n part={this.partForName(\"copy\")}\n aria-label={this.copyLabel}\n title={this.copyLabel}\n onClick={this.onCopy}\n >\n {this.copyGlyph.svg}\n </button>\n </Show>\n <pre\n part={this.partForName(\"pre\")}\n tabindex=\"0\"\n aria-label={this.shownLanguage ? this.translationForKey(\"codeLabel\", { language: this.shownLanguage }) : this.translationForKey(\"codeLabelPlain\")}\n style={{ \"counter-reset\": `${LINE_COUNTER} ${(this.start ?? 1) - 1}` }}\n >\n <code part={this.partForName(\"code\")} class={this.codeClass} innerHTML={this.markup} />\n </pre>\n </div>","part={this.partForName(\"box\")}","part={this.partForName(\"pre\")}","aria-label={this.shownLanguage ? this.translationForKey(\"codeLabel\", { language: this.shownLanguage }) : this.translationForKey(\"codeLabelPlain\")}","\"counter-reset\": `${LINE_COUNTER} ${(this.start ?? 1) - 1}`","part={this.partForName(\"code\")}","class={this.codeClass}","innerHTML={this.markup}","E.DOMLoadableElement","E.untracked","__name","E.LoadableComponent","E.proto","E.protoMerged","E.state","E.derived","E.onChange","E.cssState","E.ClipboardCopy","E.IconGlyph","E.CODE_LANGUAGES_EVENT","_$createComponent","_$readShallow","_$setAttribute","_$setStyleProperty","codeCSS","_$delegateEvents","__publicField","__decorateElement","__decoratorMetadata","__decoratorStart","__name$1","__runInitializers","SourceAttributes","SourceParts","SourceTexts","SourceStates","SourceEvents","__privateAdd","codeVocabulary","CodeLines","escapeHTML","text","first","rest","kind","HLJS_PREFIX","piece","index","html","at","spans","a","b","start","end","code","lines","open","line","token","TOKENS","NEWLINE","CLOSE","OPEN","_load_dec","once","_init$1","_CodeHighlighter","module","language","registered","UI","engine","extra","guess","name","SourceError","variant","ready","error","said","LoadOnce","CodeHighlighter","UICode_default","_tmpl$","_tmpl$2","_detectedLanguage_dec","_a","_init","_wasJustCopied_dec","_highlight_dec","_onCodeChanged_dec","_markup_dec","_lines_dec","_languageCount_dec","_highlighted_dec","_elementSetup_dec","_vocabulary_dec","_b","_init2","_highlighted","_languageCount","_DOMCodeElement","DOMLoadableElement","untracked","DOMCodeElement","_UICode","LoadableComponent","proto","protoMerged","state","derived","onChange","cssState","args","ClipboardCopy","IconGlyph","CHECK_ICON","COPY_ICON","content","isServer","CODE_LANGUAGES_EVENT","highlighted","LINE_CLASS","HLJS_CLASS","loadStatus","ticket","result","_self$","_el$","_el$3","_el$4","insert","createComponent","Show","_el$2","addEvent","effect","readShallow","COPY_CLASS","className","_p$","t","setAttribute","o","LINE_COUNTER","i","setStyleProperty","n","s","h","UICode","delegateEvents"],"sources":["../src/components/ui-code/UICode.en.ts","../src/components/ui-code/CodeLines.ts","../src/components/ui-code/CodeHighlighter.ts","../src/components/ui-code/UICode.css?inline","../src/components/ui-code/UICode.tsx","../src/components/ui-code/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-code>`: 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 source pieces (`source`, `load`, `ui-loaded` ... `ui-error`, the loader and error parts, the states and texts)\n * are shared with `<ui-include>` and `<ui-markdown>`: `UIT.Source*`, which `LoadableComponent` reads.\n * - Class words: `line-numbers` => `numbered`, `wrap` => `wrapping` (`ui numbered wrapping code`).\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `codeVocabulary`\n * The names of `<ui-code>`, a block of code coloured by language: inline text or a `source` file, in `<pre><code>`.\n ****************/\nexport const codeVocabulary = {\n tag: \"ui-code\",\n topics: [\"text\", \"typography\", \"data display\"],\n aka: [\"code block\", \"syntax highlighting\", \"highlighter\", \"pre\", \"snippet\", \"source code\", \"listing\"],\n skeleton: \"5 line paragraph\",\n noun: \"code\",\n description:\n \"Code shows a block of source code coloured by its language, from the element's own text or a file on this site.\",\n attributes: [\n ...UIT.SourceAttributes,\n {\n name: \"language\",\n group: \"appearance\",\n kind: \"string\",\n description:\n \"Language to colour it as: a highlight.js name or alias (`ts`, `html`, `css`, `json`, `bash` ...), one the \" +\n \"page registered with `UI.code` (e.g. `spell`, once the app's `<spell-code>` is loaded), or `text` for none. \" +\n \"Absent: guessed from the code.\"\n },\n {\n name: \"line-numbers\",\n group: \"appearance\",\n kind: \"keyOnly\",\n key: \"numbered\",\n property: \"lineNumbers\",\n description: \"Number the lines, in a gutter that wrapped lines don't run under.\"\n },\n {\n name: \"start\",\n group: \"appearance\",\n kind: \"number\",\n default: 1,\n description: \"Number of the first line, with `line-numbers`.\"\n },\n {\n name: \"wrap\",\n group: \"layout\",\n kind: \"keyOnly\",\n key: \"wrapping\",\n description: \"Wrap long lines; default: they scroll sideways.\"\n },\n { name: \"copy\", group: \"appearance\", kind: \"boolean\", description: \"A button that copies the code.\" }\n ],\n events: [\n ...UIT.SourceEvents,\n {\n name: \"ui-coloured\",\n detail: \"{ language?: string, detected: boolean }\",\n description:\n \"Coloured: `language` is what it was coloured as (`undefined`: plain text), `detected` when it was guessed.\"\n },\n { name: \"ui-copied\", detail: \"{ content: string }\", description: \"The copy button copied `content`.\" }\n ],\n slots: [],\n parts: [\n ...UIT.SourceParts,\n { name: \"box\", description: \"The box around the code and the copy button.\" },\n { name: \"pre\", description: \"The `<pre>`.\" },\n { name: \"code\", description: \"The `<code>`, holding one `.line` span per line.\" },\n { name: \"copy\", description: \"The copy button.\" }\n ],\n states: [...UIT.SourceStates, { name: \"copied\", description: \"The copy button just copied the code.\" }],\n texts: [\n ...UIT.SourceTexts,\n { key: \"codeCopy\", text: \"Copy\", description: \"The copy button.\" },\n { key: \"codeCopied\", text: \"Copied\", description: \"The copy button, just after a copy.\" },\n { key: \"codeLabel\", text: \"{language} code\", description: \"Accessible name of the code, by its language.\" },\n { key: \"codeLabelPlain\", text: \"Code\", description: \"Accessible name of the code, language unknown.\" }\n ]\n} as const satisfies E.ComponentVocabulary\n","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `CodeLines`\n * Highlighted code as lines: `<ui-code>` wraps each line in its own `<span class=\"line\">`, so line numbers (CSS\n * counters) and wrapping work per line.\n * - `split()` cuts highlighted HTML at its newlines, closing the spans open at the cut and reopening them on the\n * next line: a multi-line comment stays coloured on every line.\n * - `fromSpans()` turns a highlighter of our own's spans (spell's) into the same HTML highlight.js makes.\n * - Input HTML is ONLY what these make or highlight.js makes: escaped text and `<span class=\"...\">`.\n * - STATIC and instance-free: pure functions over strings.\n ****************/\nexport class CodeLines {\n /** `text` safe as HTML text: the kit's `escapeHTML()`, kept here as the family's API. */\n static escape(text: string): string {\n return E.escapeHTML(text)\n }\n\n /**\n * highlight.js's class for scope `kind`.\n * - `keyword` => `hljs-keyword`, `title.function` => `hljs-title function_`\n */\n static classNameFor(kind: string): string {\n const [first, ...rest] = kind.split(\".\")\n return [HLJS_PREFIX + first, ...rest.map((piece, index) => piece + \"_\".repeat(index + 1))].join(\" \")\n }\n\n /** `code` as HTML, each span in `spans` (in order, not overlapping) coloured by its `kind`. */\n static fromSpans(code: string, spans: readonly E.CodeSpan[]): string {\n let html = \"\"\n let at = 0\n for (const { start, end, kind } of [...spans].sort((a, b) => a.start - b.start)) {\n if (start < at || end <= start) continue\n html += CodeLines.escape(code.slice(at, start))\n html += `<span class=\"${CodeLines.classNameFor(kind)}\">${CodeLines.escape(code.slice(start, end))}</span>`\n at = end\n }\n return html + CodeLines.escape(code.slice(at))\n }\n\n /**\n * `html` cut into lines, each closing the spans still open at its end; the next line reopens them.\n * - A final newline makes no empty last line (files end with one).\n */\n static split(html: string): string[] {\n const lines: string[] = []\n const open: string[] = []\n let line = \"\"\n for (const token of html.split(TOKENS)) {\n if (!token) continue\n if (token === NEWLINE) {\n lines.push(line + CLOSE.repeat(open.length))\n line = open.join(\"\")\n } else if (token === CLOSE) {\n open.pop()\n line += token\n } else {\n if (token.startsWith(OPEN)) open.push(token)\n line += token\n }\n }\n if (line !== open.join(\"\") || !lines.length) lines.push(line + CLOSE.repeat(open.length))\n return lines\n }\n}\n\n/** The tokens `split()` cares about: span tags and newlines. */\nconst TOKENS = /(<span[^>]*>|<\\/span>|\\n)/\n\n/** Start of a span's opening tag. */\nconst OPEN = \"<span\"\n\n/** A span's closing tag. */\nconst CLOSE = \"</span>\"\n\n/** Where `split()` cuts. */\nconst NEWLINE = \"\\n\"\n\n/** highlight.js's class prefix: `hljs-keyword`. */\nconst HLJS_PREFIX = \"hljs-\"\n","import { E, UI, UIT } from \"spell/ui/core\"\nimport { CodeLines } from \"./CodeLines\"\nimport type { CodeEngine } from \"./CodeEngine\"\nimport type { Highlighted } from \"./UICode.types\"\n\n/****************\n * ### `CodeHighlighter`\n * What `<ui-code>` asks to colour code: picks the highlighter, loading what it needs on first use.\n * - `text`: plain, escaped; nothing loads.\n * - A language registered with `UI.code` (spell, an app's own): its `highlight()` function (no highlight.js at all),\n * or its highlight.js `grammar`; a `load()`ed language is fetched once per name + variant.\n * - Anything else: highlight.js (`CodeEngine`, the lazy chunk), by name, or guessed when `language` is absent.\n * - Fails with a `render` `SourceError` for a language nobody knows (or a variant that won't load).\n * - STATIC and instance-free: ONE engine and one cache of loaded languages per page, shared by every `<ui-code>`.\n ****************/\nexport class CodeHighlighter {\n /**\n * Imports the engine module; replaceable, e.g. by a bundle that can't keep `import()`s\n * (the docs' classic script loads it as a script of its own).\n * - Read once, on the first highlight.\n */\n static engineLoader: () => Promise<{ CodeEngine: { instance: CodeEngine } }> = () => import(\"./CodeEngine\")\n\n /** `load()`ed `UI.code` languages, by `name/variant`: page-wide, so each loads once. */\n private static readonly loaded = new E.LoadOnce<string, Omit<E.CodeLanguage, \"load\">>({ failures: \"forgotten\" })\n\n /** highlight.js, loaded on first use; the import starts once per page. */\n @E.once static load(): Promise<CodeEngine> {\n return CodeHighlighter.engineLoader().then((module) => module.CodeEngine.instance)\n }\n\n /** `code` as HTML, coloured as `language`, or as its best guess when `language` is absent. */\n static async highlight(code: string, language?: string): Promise<Highlighted> {\n if (language?.toLowerCase() === UIT.TEXT) return { html: CodeLines.escape(code), detected: false }\n const registered = language ? UI.code.find(language) : undefined\n if (registered) return CodeHighlighter.withRegistered(code, registered.language, registered.variant)\n const engine = await CodeHighlighter.load()\n for (const extra of UI.code.detectable()) {\n engine.register(extra.name, extra.grammar!, { aliases: extra.aliases, detect: true })\n }\n if (!language) {\n const guess = engine.detect(code)\n return { html: guess.html, language: guess.language, detected: true }\n }\n const name = await engine.ensure(language)\n if (!name) {\n throw new E.SourceError(\n `CodeHighlighter.highlight(): no highlighting for \"${language}\"; \\`UI.code.register()\\` it`,\n { cause: { kind: \"render\" } }\n )\n }\n return { html: engine.highlight(code, name), language: name, detected: false }\n }\n\n /** `code` coloured by a `UI.code` language. */\n private static async withRegistered(\n code: string,\n language: E.CodeLanguage & { name: string },\n variant: string | undefined\n ): Promise<Highlighted> {\n const name = variant ? `${language.name}/${variant}` : language.name\n const ready = language.load ? await CodeHighlighter.loadLanguage(name, language, variant) : language\n if (ready.highlight)\n return { html: CodeLines.fromSpans(code, await ready.highlight(code)), language: name, detected: false }\n if (!ready.grammar) {\n throw new E.SourceError(\n `CodeHighlighter.highlight(): \"${name}\" has neither a grammar nor a highlighter; give it one`,\n { cause: { kind: \"render\" } }\n )\n }\n const engine = await CodeHighlighter.load()\n engine.register(name, ready.grammar, { aliases: language.aliases, detect: language.detect })\n return { html: engine.highlight(code, name), language: name, detected: false }\n }\n\n /** `language.load(variant)`, once per `name`; a failure isn't cached, and becomes a `render` error. */\n private static loadLanguage(\n name: string,\n language: E.CodeLanguage,\n variant: string | undefined\n ): Promise<Omit<E.CodeLanguage, \"load\">> {\n return CodeHighlighter.loaded.get(name, () =>\n language.load!(variant).catch((error: unknown) => {\n if (error instanceof E.SourceError) throw error\n const said = error instanceof Error ? error.message : String(error)\n throw new E.SourceError(\n `CodeHighlighter.highlight(): \"${name}\" didn't load (${said}); check its \\`load()\\``,\n {\n cause: { kind: \"render\", error }\n }\n )\n })\n )\n }\n}\n","/*\n * The style sheet of `<ui-code>`: ours, not Fomantic's.\n * - It styles the component's shadow DOM, in class names:\n * `<div class=\"ui [numbered] [wrapping] code\" part=\"box\">`\n * `[<button class=\"copy\" part=\"copy\">`, an icon`]`\n * `<pre part=\"pre\"><code class=\"hljs language-x\" part=\"code\">` + one `<span class=\"line\">` per line\n * - the line spans hold highlight.js's `hljs-*` spans (or spell's, which use the same names)\n * - before them, the source parts: `<ui-loader part=\"loader\">` while loading, `<ui-message part=\"error\">`\n * - Line numbers are a CSS counter per `.line` (`counter-reset` on the `<pre>` sets the start).\n * Wrapped lines hang indented past the number, so a long line never runs under the gutter.\n * - Colours: the docs' palette (Atom One, light / dark by `light-dark()`;\n * light colours darkened to pass WCAG AA on the code background), one private alias per highlight.js group.\n * The public tokens `--ui-code-<group>` (`keyword`, `string`, `number`, `comment`, `title`, `type`, `attr`,\n * `meta`, `addition`, `deletion`) reach them from the page, an ancestor, the DOM element or `::part()`.\n * - Public tokens are NEVER declared here: each is read through its private alias (`notes/theming.md`).\n */\n\n@layer ui.components.code.types, ui.components.code.content, ui.components.code.variations, ui.components.code.states;\n\n/*******************************\n Code\n*******************************/\n\n@layer ui.components.code.types {\n :host {\n display: block;\n }\n\n .ui.code {\n --_ui-code-background: var(--ui-code-background, var(--ui-surface-muted));\n --_ui-code-color: var(--ui-code-color, var(--ui-text-color));\n --_ui-code-font: var(--ui-code-font, var(--ui-font-family-mono));\n --_ui-code-font-size: var(--ui-code-font-size, 0.875em);\n --_ui-code-line-height: var(--ui-code-line-height, 1.5);\n --_ui-code-padding: var(--ui-code-padding, 0.75em 1em);\n --_ui-code-radius: var(--ui-code-radius, var(--ui-radius));\n --_ui-code-border: var(--ui-code-border, var(--ui-border-width) solid var(--ui-border-color));\n --_ui-code-gutter-color: var(--ui-code-gutter-color, var(--ui-text-muted));\n --_ui-code-keyword: var(--ui-code-keyword, light-dark(#a626a4, #c678dd));\n --_ui-code-string: var(--ui-code-string, light-dark(#387a37, #98c379));\n --_ui-code-number: var(--ui-code-number, light-dark(#986801, #d19a66));\n --_ui-code-comment: var(--ui-code-comment, light-dark(#696969, #8b919c));\n --_ui-code-title: var(--ui-code-title, light-dark(#2f5fd0, #61afef));\n --_ui-code-type: var(--ui-code-type, light-dark(#8a5a00, #e5c07b));\n --_ui-code-attr: var(--ui-code-attr, light-dark(#b8322a, #e06c75));\n --_ui-code-meta: var(--ui-code-meta, light-dark(#2f5fd0, #61afef));\n --_ui-code-addition: var(--ui-code-addition, light-dark(#387a37, #98c379));\n --_ui-code-deletion: var(--ui-code-deletion, light-dark(#b8322a, #e06c75));\n position: relative;\n margin: 0;\n border: var(--_ui-code-border);\n border-radius: var(--_ui-code-radius);\n background: var(--_ui-code-background);\n color: var(--_ui-code-color);\n }\n\n .ui.code pre {\n margin: 0;\n padding: var(--_ui-code-padding);\n overflow-x: auto;\n border-radius: inherit;\n font-family: var(--_ui-code-font);\n font-size: var(--_ui-code-font-size);\n line-height: var(--_ui-code-line-height);\n tab-size: 2;\n }\n\n .ui.code pre:focus-visible {\n outline: 2px solid var(--ui-focus-color, Highlight);\n outline-offset: -2px;\n }\n\n .ui.code code {\n display: block;\n font: inherit;\n white-space: pre;\n }\n\n .ui.code .line {\n display: block;\n min-height: 1lh;\n }\n}\n\n@layer ui.components.code.content {\n /*\n * the copy button: a quiet icon, top right, over the code, no border or fill until hovered\n * (Owen: \"Change \"Copy\" to copy icon, no border\"); its words are its name and tooltip\n */\n .ui.code .copy {\n position: absolute;\n inset-block-start: 0.5em;\n inset-inline-end: 0.5em;\n z-index: 1;\n display: inline-grid;\n place-items: center;\n box-sizing: border-box;\n width: 1.75em;\n height: 1.75em;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: var(--ui-radius-s, 6px);\n background: transparent;\n color: var(--_ui-code-gutter-color);\n font: inherit;\n font-size: 0.875em;\n cursor: pointer;\n }\n .ui.code .copy > svg {\n width: 1em;\n height: 1em;\n fill: currentColor;\n }\n\n .ui.code .copy:hover,\n .ui.code .copy:focus-visible {\n background: color-mix(in oklab, var(--_ui-code-color) 8%, transparent);\n color: var(--_ui-code-color);\n }\n\n /* highlight.js groups, as the docs colour them */\n .hljs-keyword,\n .hljs-built_in,\n .hljs-literal,\n .hljs-selector-tag {\n color: var(--_ui-code-keyword);\n }\n\n .hljs-string,\n .hljs-regexp,\n .hljs-subst,\n .hljs-symbol,\n .hljs-template-tag {\n color: var(--_ui-code-string);\n }\n\n .hljs-number {\n color: var(--_ui-code-number);\n }\n\n .hljs-comment,\n .hljs-quote {\n color: var(--_ui-code-comment);\n font-style: italic;\n }\n\n .hljs-title,\n .hljs-section,\n .hljs-name {\n color: var(--_ui-code-title);\n }\n\n .hljs-title.class_,\n .hljs-type {\n color: var(--_ui-code-type);\n }\n\n .hljs-attr,\n .hljs-attribute,\n .hljs-property,\n .hljs-variable.language_,\n .hljs-selector-class,\n .hljs-selector-id {\n color: var(--_ui-code-attr);\n }\n\n .hljs-meta,\n .hljs-tag {\n color: var(--_ui-code-meta);\n }\n\n .hljs-addition {\n color: var(--_ui-code-addition);\n }\n\n .hljs-deletion {\n color: var(--_ui-code-deletion);\n }\n\n .hljs-emphasis {\n font-style: italic;\n }\n\n .hljs-strong {\n font-weight: bold;\n }\n}\n\n@layer ui.components.code.variations {\n /* line numbers: a counter per line, in a gutter wrapped lines hang past */\n .ui.numbered.code .line {\n --_ui-code-gutter: 4ch;\n counter-increment: line;\n padding-inline-start: var(--_ui-code-gutter);\n text-indent: calc(-1 * var(--_ui-code-gutter));\n }\n\n .ui.numbered.code .line::before {\n content: counter(line);\n display: inline-block;\n box-sizing: border-box;\n width: var(--_ui-code-gutter);\n padding-inline-end: 1.5ch;\n color: var(--_ui-code-gutter-color);\n text-align: end;\n text-indent: 0;\n user-select: none;\n }\n\n /* wrapping: long lines wrap instead of scrolling */\n .ui.wrapping.code code {\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n}\n","import { Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI } from \"spell/ui/core\"\nimport { codeVocabulary } from \"./UICode.en\"\nimport { CodeHighlighter } from \"./CodeHighlighter\"\nimport { CodeLines } from \"./CodeLines\"\nimport type { Highlighted } from \"./UICode.types\"\n\nimport codeCSS from \"./UICode.css?inline\"\n\n/****************\n * ### `DOMCodeElement`\n * The DOM element of `<ui-code>`:\n * it adds `detectedLanguage` to the source API it inherits from `DOMLoadableElement` (`content`, `save()` ...).\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMCodeElement extends E.DOMLoadableElement<UICode> {\n /**\n * What auto-detection picked (when no `language` is given);\n * `undefined` otherwise, or before the colours arrive (`ui-coloured` says when).\n * - Untracked: it's for scripts.\n */\n @E.untracked\n get detectedLanguage(): string | undefined {\n return this.component?.detectedLanguage\n }\n}\n\n/****************\n * ### `UICode`\n * The component behind `<ui-code>`: a block of code, coloured by language.\n *\n * - Its shadow DOM:\n * `<div class=\"ui [numbered] [wrapping] code\" part=\"box\">`\n * around an optional copy `<button>` and `<pre><code class=\"hljs language-x\">`, one `<span class=\"line\">` per line.\n * - The copy button is an icon (a check for a moment once it has copied); its words (\"Copy\", \"Copied\")\n * are its name and tooltip.\n * - The text: the element's own (`<script type=\"text/plain\">` keeps `<` and `&` exact),\n * or a `source` file (see `LoadableComponent`).\n * - The colours come from highlight.js, loaded with the first highlight\n * (`CodeHighlighter` -> `CodeEngine`, the lazy chunk):\n * - no `language`: guessed among the detect set\n * - `text`: none\n * - a language `UI.code` knows (a page's own, e.g. spell's): its own highlighter\n * - The code shows plain until the colours arrive.\n * An unknown language stays plain, with a `render` `ui-error` (no message: the code is still there).\n * - `line-numbers` (from `start`) and `wrap` are CSS: counters, and a hanging indent per `.line`.\n * - The `<pre>` is a tab stop, named \"`<language>` code\", so a keyboard can scroll it.\n ****************/\nexport class UICode extends E.LoadableComponent<typeof codeVocabulary> {\n // typed wide, as `UIRoot`'s: a subclass names its own (the app's `<spell-code>`)\n @E.proto static vocabulary: E.ComponentVocabulary = codeVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { code: codeCSS },\n DOMElement: DOMCodeElement,\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## Colouring\n ////////////////\n\n /** The latest colouring, and the code it's for. */\n @E.state accessor highlighted: (Highlighted & { code: string }) | undefined = undefined\n\n /** Bumped when `UI.code` gets a language: highlight again. */\n @E.state accessor languageCount = 0\n\n /** Highlights started; only the latest one's result is shown. */\n private ticket = 0\n\n /** The lines as HTML: coloured once the colours for THIS text arrive, escaped plain text until then. */\n @E.derived\n get lines(): string[] {\n const text = this.textToShow\n const highlighted = this.highlighted\n return CodeLines.split(highlighted?.code === text ? highlighted.html : CodeLines.escape(text))\n }\n\n /** `<code>`'s HTML: a `.line` span per line. */\n @E.derived\n get markup(): string {\n return this.lines.map((line) => `<span class=\"${LINE_CLASS}\">${line}</span>`).join(\"\")\n }\n\n /** The language shown: as asked for (`language`), or guessed. */\n get shownLanguage(): string | undefined {\n return this.highlighted?.language ?? (this.language || undefined)\n }\n\n /** `hljs language-<name>`, or `hljs` for plain text. */\n private get codeClass(): string {\n const language = this.shownLanguage\n return language ? `${HLJS_CLASS} language-${language.replace(\"/\", \"-\")}` : HLJS_CLASS\n }\n\n /** What auto-detection picked, when it ran (`DOMCodeElement.detectedLanguage`). */\n get detectedLanguage(): string | undefined {\n const highlighted = this.highlighted\n return highlighted?.detected ? highlighted.language : undefined\n }\n\n /** Counts `UI.code`'s new languages (`languageCount`), for the element's whole life (`this.on()` on the document). */\n constructor(...args: ConstructorParameters<typeof E.UIComponent>) {\n super(...args)\n if (!isServer) this.on(E.CODE_LANGUAGES_EVENT, () => (this.languageCount += 1), { target: document })\n }\n\n /** Highlight whenever the text, `language` or `UI.code`'s languages change, once the text has loaded. */\n @E.onChange(\"textToShow\", \"language\", \"loadStatus\", \"languageCount\")\n protected onCodeChanged(code: string, language: string | undefined, loadStatus: E.SourceStatus) {\n if (loadStatus === \"loaded\") void this.highlight(code, language || undefined)\n }\n\n /** Colour `code` as `language`; `ui-coloured` when done, a `render` `ui-error` (code left plain) when not. */\n @E.untracked\n private async highlight(code: string, language: string | undefined) {\n const ticket = ++this.ticket\n try {\n await UI.load()\n const result = await CodeHighlighter.highlight(code, language)\n if (ticket !== this.ticket) return\n this.highlighted = { ...result, code }\n this.send(\"ui-coloured\", { language: result.language, detected: result.detected })\n } catch (error) {\n if (ticket !== this.ticket) return\n this.highlighted = undefined\n const kind = E.SourceError.kindFor(error, \"render\")\n this.sendSourceEvent(\"ui-error\", { kind, source: this.source || undefined, error })\n }\n }\n\n ////////////////\n // ## Copying\n ////////////////\n\n /** The copy button's copy: \"Copied\" for a moment after. */\n readonly clipboard = new E.ClipboardCopy()\n\n /** The copy button just copied: it says \"Copied\", with a check. `:state(copied)`. */\n @E.cssState(\"copied\")\n get wasJustCopied(): boolean {\n return this.clipboard.isCopied\n }\n\n /** The copy button's icon: a copy, a check for a moment once it has copied; none without the button. */\n readonly copyGlyph = new E.IconGlyph({\n owner: this,\n name: () => (this.copy ? (this.wasJustCopied ? CHECK_ICON : COPY_ICON) : undefined)\n })\n\n /** The copy button's name and tooltip: \"Copy\", or \"Copied\" for a moment. */\n private get copyLabel(): string {\n return this.wasJustCopied ? this.translationForKey(\"codeCopied\") : this.translationForKey(\"codeCopy\")\n }\n\n /** The copy button: the code to the clipboard, `ui-copied`, \"Copied\" for a moment. */\n private readonly onCopy = async () => {\n const { content } = this\n if (await this.clipboard.copy(content)) this.send(\"ui-copied\", { content })\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n protected renderContent(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"box\")}>\n <Show when={this.copy}>\n <button\n type=\"button\"\n class={COPY_CLASS}\n part={this.partForName(\"copy\")}\n aria-label={this.copyLabel}\n title={this.copyLabel}\n onClick={this.onCopy}\n >\n {this.copyGlyph.svg}\n </button>\n </Show>\n <pre\n part={this.partForName(\"pre\")}\n tabindex=\"0\"\n aria-label={\n this.shownLanguage\n ? this.translationForKey(\"codeLabel\", { language: this.shownLanguage })\n : this.translationForKey(\"codeLabelPlain\")\n }\n style={{ \"counter-reset\": `${LINE_COUNTER} ${(this.start ?? 1) - 1}` }}\n >\n <code part={this.partForName(\"code\")} class={this.codeClass} innerHTML={this.markup} />\n </pre>\n </div>\n )\n }\n}\n\n/** The vocabulary getters, typed (`UIComponent`'s doc). */\nexport interface UICode extends E.AttributeValues<typeof codeVocabulary> {}\n\n/** Class of each line's span inside `<code>`. */\nconst LINE_CLASS = \"line\"\n\n/** The CSS counter that numbers the lines (`UICode.css`); `start` sets where it begins. */\nconst LINE_COUNTER = \"line\"\n\n/** highlight.js's class on `<code>`. */\nconst HLJS_CLASS = \"hljs\"\n\n/** Class of the copy button. */\nconst COPY_CLASS = \"copy\"\n\n/** The copy button's icon. */\nconst COPY_ICON = \"copy outline\"\n\n/** The copy button's icon for a moment once it has copied. */\nconst CHECK_ICON = \"check\"\n","/**\n * The code family: defines `<ui-code>` and exports its component, `UICode`, its DOM element class,\n * `DOMCodeElement`, and its helpers (`CodeHighlighter`, `CodeLines`).\n * - SIDE EFFECTS: importing it defines the tag, and `<ui-loader>` and `<ui-message>` (its loading and error looks).\n * - Also the library's `spell/ui/ui-code` entry (its size is in `notes/report.md`).\n * - highlight.js is NOT in this chunk: `CodeEngine` loads on the first highlight.\n * - A language of a page's own joins `UI.code` (`UI.code.register()`):\n * spell's is the app's `<spell-code>` family, which Spell UI knows nothing of.\n */\n\nimport { DOMCodeElement, UICode } from \"./UICode\"\nimport { CodeHighlighter } from \"./CodeHighlighter\"\nimport { CodeLines } from \"./CodeLines\"\n\nimport \"spell/ui/components/ui-loader\"\nimport \"spell/ui/components/ui-message\"\n\nUICode.define()\n\nexport { UICode, DOMCodeElement, CodeHighlighter, CodeLines }\n"],"mappings":";;;;;;;AAgBA,IAAayD,KAAiB;CAC5B,KAAK;CACL,QAAQ;EAAC;EAAQ;EAAc;CAAc;CAC7C,KAAK;EAAC;EAAc;EAAuB;EAAe;EAAO;EAAW;EAAe;CAAS;CACpG,UAAU;CACV,MAAM;CACN,aACE;CACF,YAAY;EACV,GAAGzD;EACH;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aACE;EAGJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,KAAK;GACL,UAAU;GACV,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EACf;EACA;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F,GAGW,gBAAe3E,EAAtBvC,GAAA,IAHJkH,GAG0B;CACnC,aAAa,EAAE,MAAMlF,EAAQ;CAC7B,YAAYiF;CACZ,gBAAgB;AAClB,CAAA,CAAA,GAJe1E,EAAAvC,GAAA,IAHJkH,CAAA;AAAN,IAAM6C,IAAN7C,GAyJDiB,KAAa,QAGbsB,KAAe,QAGfrB,IAAa,QAGbe,KAAa,QAGbrB,KAAY,gBAGZD,KAAa;;;eCzMnBkC,EAAO,OAAO"}
|
|
1
|
+
{"version":3,"file":"ui-code.js","names":["UIT.SourceAttributes","UIT.SourceEvents","UIT.SourceParts","UIT.SourceStates","UIT.SourceTexts","E.escapeHTML","_init","E.once","E.SourceError","__name","E.LoadOnce","_init","<Show when={this.copy}>\n <button\n type=\"button\"\n class={COPY_CLASS}\n part={this.partForName(\"copy\")}\n aria-label={this.copyLabel}\n title={this.copyLabel}\n onClick={this.onCopy}\n >\n {this.copyGlyph.svg}\n </button>\n </Show>","this","part={this.partForName(\"copy\")}","aria-label={this.copyLabel}","title={this.copyLabel}","<button\n type=\"button\"\n class={COPY_CLASS}\n part={this.partForName(\"copy\")}\n aria-label={this.copyLabel}\n title={this.copyLabel}\n onClick={this.onCopy}\n >\n {this.copyGlyph.svg}\n </button>","<div class={this.rootClass} part={this.partForName(\"box\")}>\n <Show when={this.copy}>\n <button\n type=\"button\"\n class={COPY_CLASS}\n part={this.partForName(\"copy\")}\n aria-label={this.copyLabel}\n title={this.copyLabel}\n onClick={this.onCopy}\n >\n {this.copyGlyph.svg}\n </button>\n </Show>\n <pre\n part={this.partForName(\"pre\")}\n tabindex=\"0\"\n aria-label={this.shownLanguage ? this.translationForKey(\"codeLabel\", { language: this.shownLanguage }) : this.translationForKey(\"codeLabelPlain\")}\n style={{ \"counter-reset\": `${LINE_COUNTER} ${(this.start ?? 1) - 1}` }}\n >\n <code part={this.partForName(\"code\")} class={this.codeClass} innerHTML={this.markup} />\n </pre>\n </div>","part={this.partForName(\"box\")}","part={this.partForName(\"pre\")}","aria-label={this.shownLanguage ? this.translationForKey(\"codeLabel\", { language: this.shownLanguage }) : this.translationForKey(\"codeLabelPlain\")}","\"counter-reset\": `${LINE_COUNTER} ${(this.start ?? 1) - 1}`","part={this.partForName(\"code\")}","class={this.codeClass}","innerHTML={this.markup}","E.DOMLoadableElement","E.untracked","__name","E.LoadableComponent","E.proto","E.protoMerged","E.state","E.derived","E.onChange","E.cssState","E.ClipboardCopy","E.IconGlyph","E.CODE_LANGUAGES_EVENT","_$createComponent","_$readShallow","_$setAttribute","_$setStyleProperty","codeCSS","_$delegateEvents","__name$1","__publicField","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","SourceEvents","SourceTexts","SourceStates","SourceAttributes","SourceParts","__decoratorStart","codeVocabulary","CodeLines","escapeHTML","text","first","rest","kind","HLJS_PREFIX","piece","index","html","at","spans","a","b","start","end","code","lines","open","line","token","TOKENS","NEWLINE","CLOSE","OPEN","_load_dec","once","_init$1","_CodeHighlighter","module","language","registered","UI","engine","extra","guess","name","SourceError","variant","ready","error","said","LoadOnce","CodeHighlighter","UICode_default","_tmpl$","_tmpl$2","_detectedLanguage_dec","_a","_init","_wasJustCopied_dec","_highlight_dec","_onCodeChanged_dec","_markup_dec","_lines_dec","_languageCount_dec","_highlighted_dec","_elementSetup_dec","_vocabulary_dec","_b","_init2","_highlighted","_languageCount","_DOMCodeElement","DOMLoadableElement","untracked","DOMCodeElement","_UICode","LoadableComponent","proto","protoMerged","state","derived","onChange","cssState","args","ClipboardCopy","IconGlyph","CHECK_ICON","COPY_ICON","content","isServer","CODE_LANGUAGES_EVENT","highlighted","LINE_CLASS","HLJS_CLASS","loadStatus","ticket","result","_self$","_el$","_el$3","_el$4","insert","createComponent","Show","_el$2","addEvent","effect","readShallow","COPY_CLASS","className","_p$","t","setAttribute","o","LINE_COUNTER","i","setStyleProperty","n","s","h","UICode","delegateEvents"],"sources":["../src/components/ui-code/UICode.en.ts","../src/components/ui-code/CodeLines.ts","../src/components/ui-code/CodeHighlighter.ts","../src/components/ui-code/UICode.css?inline","../src/components/ui-code/UICode.tsx","../src/components/ui-code/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-code>`: 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 source pieces (`source`, `load`, `ui-loaded` ... `ui-error`, the loader and error parts, the states and texts)\n * are shared with `<ui-include>` and `<ui-markdown>`: `UIT.Source*`, which `LoadableComponent` reads.\n * - Class words: `line-numbers` => `numbered`, `wrap` => `wrapping` (`ui numbered wrapping code`).\n */\n\nimport type { E } from \"spell/ui/core\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `codeVocabulary`\n * The names of `<ui-code>`, a block of code coloured by language: inline text or a `source` file, in `<pre><code>`.\n ****************/\nexport const codeVocabulary = {\n tag: \"ui-code\",\n icon: \"code\",\n topics: [\"text\", \"typography\", \"data display\"],\n aka: [\"code block\", \"syntax highlighting\", \"highlighter\", \"pre\", \"snippet\", \"source code\", \"listing\"],\n skeleton: \"5 line paragraph\",\n noun: \"code\",\n description:\n \"Code shows a block of source code coloured by its language, from the element's own text or a file on this site.\",\n attributes: [\n ...UIT.SourceAttributes,\n {\n name: \"language\",\n group: \"appearance\",\n kind: \"string\",\n description:\n \"Language to colour it as: a highlight.js name or alias (`ts`, `html`, `css`, `json`, `bash` ...), one the \" +\n \"page registered with `UI.code` (e.g. `spell`, once the app's `<spell-code>` is loaded), or `text` for none. \" +\n \"Absent: guessed from the code.\"\n },\n {\n name: \"line-numbers\",\n group: \"appearance\",\n kind: \"keyOnly\",\n key: \"numbered\",\n property: \"lineNumbers\",\n description: \"Number the lines, in a gutter that wrapped lines don't run under.\"\n },\n {\n name: \"start\",\n group: \"appearance\",\n kind: \"number\",\n default: 1,\n description: \"Number of the first line, with `line-numbers`.\"\n },\n {\n name: \"wrap\",\n group: \"layout\",\n kind: \"keyOnly\",\n key: \"wrapping\",\n description: \"Wrap long lines; default: they scroll sideways.\"\n },\n { name: \"copy\", group: \"appearance\", kind: \"boolean\", description: \"A button that copies the code.\" }\n ],\n events: [\n ...UIT.SourceEvents,\n {\n name: \"ui-coloured\",\n detail: \"{ language?: string, detected: boolean }\",\n description:\n \"Coloured: `language` is what it was coloured as (`undefined`: plain text), `detected` when it was guessed.\"\n },\n { name: \"ui-copied\", detail: \"{ content: string }\", description: \"The copy button copied `content`.\" }\n ],\n slots: [],\n parts: [\n ...UIT.SourceParts,\n { name: \"box\", description: \"The box around the code and the copy button.\" },\n { name: \"pre\", description: \"The `<pre>`.\" },\n { name: \"code\", description: \"The `<code>`, holding one `.line` span per line.\" },\n { name: \"copy\", description: \"The copy button.\" }\n ],\n states: [...UIT.SourceStates, { name: \"copied\", description: \"The copy button just copied the code.\" }],\n texts: [\n ...UIT.SourceTexts,\n { key: \"codeCopy\", text: \"Copy\", description: \"The copy button.\" },\n { key: \"codeCopied\", text: \"Copied\", description: \"The copy button, just after a copy.\" },\n { key: \"codeLabel\", text: \"{language} code\", description: \"Accessible name of the code, by its language.\" },\n { key: \"codeLabelPlain\", text: \"Code\", description: \"Accessible name of the code, language unknown.\" }\n ]\n} as const satisfies E.ComponentVocabulary\n","import { E } from \"spell/ui/core\"\n\n/****************\n * ### `CodeLines`\n * Highlighted code as lines: `<ui-code>` wraps each line in its own `<span class=\"line\">`, so line numbers (CSS\n * counters) and wrapping work per line.\n * - `split()` cuts highlighted HTML at its newlines, closing the spans open at the cut and reopening them on the\n * next line: a multi-line comment stays coloured on every line.\n * - `fromSpans()` turns a highlighter of our own's spans (spell's) into the same HTML highlight.js makes.\n * - Input HTML is ONLY what these make or highlight.js makes: escaped text and `<span class=\"...\">`.\n * - STATIC and instance-free: pure functions over strings.\n ****************/\nexport class CodeLines {\n /** `text` safe as HTML text: the kit's `escapeHTML()`, kept here as the family's API. */\n static escape(text: string): string {\n return E.escapeHTML(text)\n }\n\n /**\n * highlight.js's class for scope `kind`.\n * - `keyword` => `hljs-keyword`, `title.function` => `hljs-title function_`\n */\n static classNameFor(kind: string): string {\n const [first, ...rest] = kind.split(\".\")\n return [HLJS_PREFIX + first, ...rest.map((piece, index) => piece + \"_\".repeat(index + 1))].join(\" \")\n }\n\n /** `code` as HTML, each span in `spans` (in order, not overlapping) coloured by its `kind`. */\n static fromSpans(code: string, spans: readonly E.CodeSpan[]): string {\n let html = \"\"\n let at = 0\n for (const { start, end, kind } of [...spans].sort((a, b) => a.start - b.start)) {\n if (start < at || end <= start) continue\n html += CodeLines.escape(code.slice(at, start))\n html += `<span class=\"${CodeLines.classNameFor(kind)}\">${CodeLines.escape(code.slice(start, end))}</span>`\n at = end\n }\n return html + CodeLines.escape(code.slice(at))\n }\n\n /**\n * `html` cut into lines, each closing the spans still open at its end; the next line reopens them.\n * - A final newline makes no empty last line (files end with one).\n */\n static split(html: string): string[] {\n const lines: string[] = []\n const open: string[] = []\n let line = \"\"\n for (const token of html.split(TOKENS)) {\n if (!token) continue\n if (token === NEWLINE) {\n lines.push(line + CLOSE.repeat(open.length))\n line = open.join(\"\")\n } else if (token === CLOSE) {\n open.pop()\n line += token\n } else {\n if (token.startsWith(OPEN)) open.push(token)\n line += token\n }\n }\n if (line !== open.join(\"\") || !lines.length) lines.push(line + CLOSE.repeat(open.length))\n return lines\n }\n}\n\n/** The tokens `split()` cares about: span tags and newlines. */\nconst TOKENS = /(<span[^>]*>|<\\/span>|\\n)/\n\n/** Start of a span's opening tag. */\nconst OPEN = \"<span\"\n\n/** A span's closing tag. */\nconst CLOSE = \"</span>\"\n\n/** Where `split()` cuts. */\nconst NEWLINE = \"\\n\"\n\n/** highlight.js's class prefix: `hljs-keyword`. */\nconst HLJS_PREFIX = \"hljs-\"\n","import { E, UI, UIT } from \"spell/ui/core\"\nimport { CodeLines } from \"./CodeLines\"\nimport type { CodeEngine } from \"./CodeEngine\"\nimport type { Highlighted } from \"./UICode.types\"\n\n/****************\n * ### `CodeHighlighter`\n * What `<ui-code>` asks to colour code: picks the highlighter, loading what it needs on first use.\n * - `text`: plain, escaped; nothing loads.\n * - A language registered with `UI.code` (spell, an app's own): its `highlight()` function (no highlight.js at all),\n * or its highlight.js `grammar`; a `load()`ed language is fetched once per name + variant.\n * - Anything else: highlight.js (`CodeEngine`, the lazy chunk), by name, or guessed when `language` is absent.\n * - Fails with a `render` `SourceError` for a language nobody knows (or a variant that won't load).\n * - STATIC and instance-free: ONE engine and one cache of loaded languages per page, shared by every `<ui-code>`.\n ****************/\nexport class CodeHighlighter {\n /**\n * Imports the engine module; replaceable, e.g. by a bundle that can't keep `import()`s\n * (the docs' classic script loads it as a script of its own).\n * - Read once, on the first highlight.\n */\n static engineLoader: () => Promise<{ CodeEngine: { instance: CodeEngine } }> = () => import(\"./CodeEngine\")\n\n /** `load()`ed `UI.code` languages, by `name/variant`: page-wide, so each loads once. */\n private static readonly loaded = new E.LoadOnce<string, Omit<E.CodeLanguage, \"load\">>({ failures: \"forgotten\" })\n\n /** highlight.js, loaded on first use; the import starts once per page. */\n @E.once static load(): Promise<CodeEngine> {\n return CodeHighlighter.engineLoader().then((module) => module.CodeEngine.instance)\n }\n\n /** `code` as HTML, coloured as `language`, or as its best guess when `language` is absent. */\n static async highlight(code: string, language?: string): Promise<Highlighted> {\n if (language?.toLowerCase() === UIT.TEXT) return { html: CodeLines.escape(code), detected: false }\n const registered = language ? UI.code.find(language) : undefined\n if (registered) return CodeHighlighter.withRegistered(code, registered.language, registered.variant)\n const engine = await CodeHighlighter.load()\n for (const extra of UI.code.detectable()) {\n engine.register(extra.name, extra.grammar!, { aliases: extra.aliases, detect: true })\n }\n if (!language) {\n const guess = engine.detect(code)\n return { html: guess.html, language: guess.language, detected: true }\n }\n const name = await engine.ensure(language)\n if (!name) {\n throw new E.SourceError(\n `CodeHighlighter.highlight(): no highlighting for \"${language}\"; \\`UI.code.register()\\` it`,\n { cause: { kind: \"render\" } }\n )\n }\n return { html: engine.highlight(code, name), language: name, detected: false }\n }\n\n /** `code` coloured by a `UI.code` language. */\n private static async withRegistered(\n code: string,\n language: E.CodeLanguage & { name: string },\n variant: string | undefined\n ): Promise<Highlighted> {\n const name = variant ? `${language.name}/${variant}` : language.name\n const ready = language.load ? await CodeHighlighter.loadLanguage(name, language, variant) : language\n if (ready.highlight)\n return { html: CodeLines.fromSpans(code, await ready.highlight(code)), language: name, detected: false }\n if (!ready.grammar) {\n throw new E.SourceError(\n `CodeHighlighter.highlight(): \"${name}\" has neither a grammar nor a highlighter; give it one`,\n { cause: { kind: \"render\" } }\n )\n }\n const engine = await CodeHighlighter.load()\n engine.register(name, ready.grammar, { aliases: language.aliases, detect: language.detect })\n return { html: engine.highlight(code, name), language: name, detected: false }\n }\n\n /** `language.load(variant)`, once per `name`; a failure isn't cached, and becomes a `render` error. */\n private static loadLanguage(\n name: string,\n language: E.CodeLanguage,\n variant: string | undefined\n ): Promise<Omit<E.CodeLanguage, \"load\">> {\n return CodeHighlighter.loaded.get(name, () =>\n language.load!(variant).catch((error: unknown) => {\n if (error instanceof E.SourceError) throw error\n const said = error instanceof Error ? error.message : String(error)\n throw new E.SourceError(\n `CodeHighlighter.highlight(): \"${name}\" didn't load (${said}); check its \\`load()\\``,\n {\n cause: { kind: \"render\", error }\n }\n )\n })\n )\n }\n}\n","/*\n * The style sheet of `<ui-code>`: ours, not Fomantic's.\n * - It styles the component's shadow DOM, in class names:\n * `<div class=\"ui [numbered] [wrapping] code\" part=\"box\">`\n * `[<button class=\"copy\" part=\"copy\">`, an icon`]`\n * `<pre part=\"pre\"><code class=\"hljs language-x\" part=\"code\">` + one `<span class=\"line\">` per line\n * - the line spans hold highlight.js's `hljs-*` spans (or spell's, which use the same names)\n * - before them, the source parts: `<ui-loader part=\"loader\">` while loading, `<ui-message part=\"error\">`\n * - Line numbers are a CSS counter per `.line` (`counter-reset` on the `<pre>` sets the start).\n * Wrapped lines hang indented past the number, so a long line never runs under the gutter.\n * - Colours: the THEME's code colours (epic `debut` P22), one private alias per highlight.js group:\n * the public tokens `--ui-code-<group>` (`keyword`, `string`, `number`, `comment`, `title`, `type`, `attr`,\n * `meta`, `addition`, `deletion`), which every theme sets (`colors.css`'s recipe, or its own `code` group),\n * the same the editor's code reads; `number` and `title` take the theme's `constant` and `action`.\n * - They reach the box from the page, an ancestor, the DOM element or `::part()`.\n * - A page without Spell UI's foundation sheets: Atom One, light / dark, its light colours darkened to pass AA.\n * - Public tokens are NEVER declared here: each is read through its private alias (`notes/theming.md`).\n */\n\n@layer ui.components.code.types, ui.components.code.content, ui.components.code.variations, ui.components.code.states;\n\n/*******************************\n Code\n*******************************/\n\n@layer ui.components.code.types {\n :host {\n display: block;\n }\n\n .ui.code {\n --_ui-code-background: var(--ui-code-background, var(--ui-surface-muted));\n --_ui-code-color: var(--ui-code-color, var(--ui-text-color));\n --_ui-code-font: var(--ui-code-font, var(--ui-font-family-mono));\n --_ui-code-font-size: var(--ui-code-font-size, 0.875em);\n --_ui-code-line-height: var(--ui-code-line-height, 1.5);\n --_ui-code-padding: var(--ui-code-padding, 0.75em 1em);\n --_ui-code-radius: var(--ui-code-radius, var(--ui-radius));\n --_ui-code-border: var(--ui-code-border, var(--ui-border-width) solid var(--ui-border-color));\n --_ui-code-gutter-color: var(--ui-code-gutter-color, var(--ui-text-muted));\n --_ui-code-keyword: var(--ui-code-keyword, light-dark(#a626a4, #c678dd));\n --_ui-code-string: var(--ui-code-string, light-dark(#387a37, #98c379));\n --_ui-code-number: var(--ui-code-number, var(--ui-code-constant, light-dark(#986801, #d19a66)));\n --_ui-code-comment: var(--ui-code-comment, light-dark(#696969, #8b919c));\n --_ui-code-title: var(--ui-code-title, var(--ui-code-action, light-dark(#2f5fd0, #61afef)));\n --_ui-code-type: var(--ui-code-type, light-dark(#8a5a00, #e5c07b));\n --_ui-code-attr: var(--ui-code-attr, light-dark(#b8322a, #e06c75));\n --_ui-code-meta: var(--ui-code-meta, light-dark(#2f5fd0, #61afef));\n --_ui-code-addition: var(--ui-code-addition, light-dark(#387a37, #98c379));\n --_ui-code-deletion: var(--ui-code-deletion, light-dark(#b8322a, #e06c75));\n position: relative;\n margin: 0;\n border: var(--_ui-code-border);\n border-radius: var(--_ui-code-radius);\n background: var(--_ui-code-background);\n color: var(--_ui-code-color);\n }\n\n .ui.code pre {\n margin: 0;\n padding: var(--_ui-code-padding);\n overflow-x: auto;\n border-radius: inherit;\n font-family: var(--_ui-code-font);\n font-size: var(--_ui-code-font-size);\n line-height: var(--_ui-code-line-height);\n tab-size: 2;\n }\n\n .ui.code pre:focus-visible {\n outline: 2px solid var(--ui-focus-color, Highlight);\n outline-offset: -2px;\n }\n\n .ui.code code {\n display: block;\n font: inherit;\n white-space: pre;\n }\n\n .ui.code .line {\n display: block;\n min-height: 1lh;\n }\n}\n\n@layer ui.components.code.content {\n /*\n * the copy button: a quiet icon, top right, over the code, no border or fill until hovered\n * (Owen: \"Change \"Copy\" to copy icon, no border\"); its words are its name and tooltip\n */\n .ui.code .copy {\n position: absolute;\n inset-block-start: 0.5em;\n inset-inline-end: 0.5em;\n z-index: 1;\n display: inline-grid;\n place-items: center;\n box-sizing: border-box;\n width: 1.75em;\n height: 1.75em;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: var(--ui-radius-s, 6px);\n background: transparent;\n color: var(--_ui-code-gutter-color);\n font: inherit;\n font-size: 0.875em;\n cursor: var(--ui-control-cursor);\n }\n .ui.code .copy > svg {\n width: 1em;\n height: 1em;\n fill: currentColor;\n }\n\n .ui.code .copy:hover,\n .ui.code .copy:focus-visible {\n background: color-mix(in oklab, var(--_ui-code-color) 8%, transparent);\n color: var(--_ui-code-color);\n }\n\n /* highlight.js groups, as the docs colour them */\n .hljs-keyword,\n .hljs-built_in,\n .hljs-literal,\n .hljs-selector-tag {\n color: var(--_ui-code-keyword);\n }\n\n .hljs-string,\n .hljs-regexp,\n .hljs-subst,\n .hljs-symbol,\n .hljs-template-tag {\n color: var(--_ui-code-string);\n }\n\n .hljs-number {\n color: var(--_ui-code-number);\n }\n\n .hljs-comment,\n .hljs-quote {\n color: var(--_ui-code-comment);\n font-style: italic;\n }\n\n .hljs-title,\n .hljs-section,\n .hljs-name {\n color: var(--_ui-code-title);\n }\n\n .hljs-title.class_,\n .hljs-type {\n color: var(--_ui-code-type);\n }\n\n .hljs-attr,\n .hljs-attribute,\n .hljs-property,\n .hljs-variable.language_,\n .hljs-selector-class,\n .hljs-selector-id {\n color: var(--_ui-code-attr);\n }\n\n .hljs-meta,\n .hljs-tag {\n color: var(--_ui-code-meta);\n }\n\n .hljs-addition {\n color: var(--_ui-code-addition);\n }\n\n .hljs-deletion {\n color: var(--_ui-code-deletion);\n }\n\n .hljs-emphasis {\n font-style: italic;\n }\n\n .hljs-strong {\n font-weight: bold;\n }\n}\n\n@layer ui.components.code.variations {\n /* line numbers: a counter per line, in a gutter wrapped lines hang past */\n .ui.numbered.code .line {\n --_ui-code-gutter: 4ch;\n counter-increment: line;\n padding-inline-start: var(--_ui-code-gutter);\n text-indent: calc(-1 * var(--_ui-code-gutter));\n }\n\n .ui.numbered.code .line::before {\n content: counter(line);\n display: inline-block;\n box-sizing: border-box;\n width: var(--_ui-code-gutter);\n padding-inline-end: 1.5ch;\n color: var(--_ui-code-gutter-color);\n text-align: end;\n text-indent: 0;\n user-select: none;\n }\n\n /* wrapping: long lines wrap instead of scrolling */\n .ui.wrapping.code code {\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n}\n","import { Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI } from \"spell/ui/core\"\nimport { codeVocabulary } from \"./UICode.en\"\nimport { CodeHighlighter } from \"./CodeHighlighter\"\nimport { CodeLines } from \"./CodeLines\"\nimport type { Highlighted } from \"./UICode.types\"\n\nimport codeCSS from \"./UICode.css?inline\"\n\n/****************\n * ### `DOMCodeElement`\n * The DOM element of `<ui-code>`:\n * it adds `detectedLanguage` to the source API it inherits from `DOMLoadableElement` (`content`, `save()` ...).\n * - Above the component: its `elementSetup` reads this class while the component is defined.\n ****************/\nexport class DOMCodeElement extends E.DOMLoadableElement<UICode> {\n /**\n * What auto-detection picked (when no `language` is given);\n * `undefined` otherwise, or before the colours arrive (`ui-coloured` says when).\n * - Untracked: it's for scripts.\n */\n @E.untracked\n get detectedLanguage(): string | undefined {\n return this.component?.detectedLanguage\n }\n}\n\n/****************\n * ### `UICode`\n * The component behind `<ui-code>`: a block of code, coloured by language.\n *\n * - Its shadow DOM:\n * `<div class=\"ui [numbered] [wrapping] code\" part=\"box\">`\n * around an optional copy `<button>` and `<pre><code class=\"hljs language-x\">`, one `<span class=\"line\">` per line.\n * - The copy button is an icon (a check for a moment once it has copied); its words (\"Copy\", \"Copied\")\n * are its name and tooltip.\n * - The text: the element's own (`<script type=\"text/plain\">` keeps `<` and `&` exact),\n * or a `source` file (see `LoadableComponent`).\n * - The colours come from highlight.js, loaded with the first highlight\n * (`CodeHighlighter` -> `CodeEngine`, the lazy chunk):\n * - no `language`: guessed among the detect set\n * - `text`: none\n * - a language `UI.code` knows (a page's own, e.g. spell's): its own highlighter\n * - The code shows plain until the colours arrive.\n * An unknown language stays plain, with a `render` `ui-error` (no message: the code is still there).\n * - `line-numbers` (from `start`) and `wrap` are CSS: counters, and a hanging indent per `.line`.\n * - The `<pre>` is a tab stop, named \"`<language>` code\", so a keyboard can scroll it.\n ****************/\nexport class UICode extends E.LoadableComponent<typeof codeVocabulary> {\n // typed wide, as `UIRoot`'s: a subclass names its own (the app's `<spell-code>`)\n @E.proto static vocabulary: E.ComponentVocabulary = codeVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { code: codeCSS },\n DOMElement: DOMCodeElement,\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## Colouring\n ////////////////\n\n /** The latest colouring, and the code it's for. */\n @E.state accessor highlighted: (Highlighted & { code: string }) | undefined = undefined\n\n /** Bumped when `UI.code` gets a language: highlight again. */\n @E.state accessor languageCount = 0\n\n /** Highlights started; only the latest one's result is shown. */\n private ticket = 0\n\n /** The lines as HTML: coloured once the colours for THIS text arrive, escaped plain text until then. */\n @E.derived\n get lines(): string[] {\n const text = this.textToShow\n const highlighted = this.highlighted\n return CodeLines.split(highlighted?.code === text ? highlighted.html : CodeLines.escape(text))\n }\n\n /** `<code>`'s HTML: a `.line` span per line. */\n @E.derived\n get markup(): string {\n return this.lines.map((line) => `<span class=\"${LINE_CLASS}\">${line}</span>`).join(\"\")\n }\n\n /** The language shown: as asked for (`language`), or guessed. */\n get shownLanguage(): string | undefined {\n return this.highlighted?.language ?? (this.language || undefined)\n }\n\n /** `hljs language-<name>`, or `hljs` for plain text. */\n private get codeClass(): string {\n const language = this.shownLanguage\n return language ? `${HLJS_CLASS} language-${language.replace(\"/\", \"-\")}` : HLJS_CLASS\n }\n\n /** What auto-detection picked, when it ran (`DOMCodeElement.detectedLanguage`). */\n get detectedLanguage(): string | undefined {\n const highlighted = this.highlighted\n return highlighted?.detected ? highlighted.language : undefined\n }\n\n /** Counts `UI.code`'s new languages (`languageCount`), for the element's whole life (`this.on()` on the document). */\n constructor(...args: ConstructorParameters<typeof E.UIComponent>) {\n super(...args)\n if (!isServer) this.on(E.CODE_LANGUAGES_EVENT, () => (this.languageCount += 1), { target: document })\n }\n\n /** Highlight whenever the text, `language` or `UI.code`'s languages change, once the text has loaded. */\n @E.onChange(\"textToShow\", \"language\", \"loadStatus\", \"languageCount\")\n protected onCodeChanged(code: string, language: string | undefined, loadStatus: E.SourceStatus) {\n if (loadStatus === \"loaded\") void this.highlight(code, language || undefined)\n }\n\n /** Colour `code` as `language`; `ui-coloured` when done, a `render` `ui-error` (code left plain) when not. */\n @E.untracked\n private async highlight(code: string, language: string | undefined) {\n const ticket = ++this.ticket\n try {\n await UI.load()\n const result = await CodeHighlighter.highlight(code, language)\n if (ticket !== this.ticket) return\n this.highlighted = { ...result, code }\n this.send(\"ui-coloured\", { language: result.language, detected: result.detected })\n } catch (error) {\n if (ticket !== this.ticket) return\n this.highlighted = undefined\n const kind = E.SourceError.kindFor(error, \"render\")\n this.sendSourceEvent(\"ui-error\", { kind, source: this.source || undefined, error })\n }\n }\n\n ////////////////\n // ## Copying\n ////////////////\n\n /** The copy button's copy: \"Copied\" for a moment after. */\n readonly clipboard = new E.ClipboardCopy()\n\n /** The copy button just copied: it says \"Copied\", with a check. `:state(copied)`. */\n @E.cssState(\"copied\")\n get wasJustCopied(): boolean {\n return this.clipboard.isCopied\n }\n\n /** The copy button's icon: a copy, a check for a moment once it has copied; none without the button. */\n readonly copyGlyph = new E.IconGlyph({\n owner: this,\n name: () => (this.copy ? (this.wasJustCopied ? CHECK_ICON : COPY_ICON) : undefined)\n })\n\n /** The copy button's name and tooltip: \"Copy\", or \"Copied\" for a moment. */\n private get copyLabel(): string {\n return this.wasJustCopied ? this.translationForKey(\"codeCopied\") : this.translationForKey(\"codeCopy\")\n }\n\n /** The copy button: the code to the clipboard, `ui-copied`, \"Copied\" for a moment. */\n private readonly onCopy = async () => {\n const { content } = this\n if (await this.clipboard.copy(content)) this.send(\"ui-copied\", { content })\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n protected renderContent(): JSX.Element {\n return (\n <div class={this.rootClass} part={this.partForName(\"box\")}>\n <Show when={this.copy}>\n <button\n type=\"button\"\n class={COPY_CLASS}\n part={this.partForName(\"copy\")}\n aria-label={this.copyLabel}\n title={this.copyLabel}\n onClick={this.onCopy}\n >\n {this.copyGlyph.svg}\n </button>\n </Show>\n <pre\n part={this.partForName(\"pre\")}\n tabindex=\"0\"\n aria-label={\n this.shownLanguage\n ? this.translationForKey(\"codeLabel\", { language: this.shownLanguage })\n : this.translationForKey(\"codeLabelPlain\")\n }\n style={{ \"counter-reset\": `${LINE_COUNTER} ${(this.start ?? 1) - 1}` }}\n >\n <code part={this.partForName(\"code\")} class={this.codeClass} innerHTML={this.markup} />\n </pre>\n </div>\n )\n }\n}\n\n/** The vocabulary getters, typed (`UIComponent`'s doc). */\nexport interface UICode extends E.AttributeValues<typeof codeVocabulary> {}\n\n/** Class of each line's span inside `<code>`. */\nconst LINE_CLASS = \"line\"\n\n/** The CSS counter that numbers the lines (`UICode.css`); `start` sets where it begins. */\nconst LINE_COUNTER = \"line\"\n\n/** highlight.js's class on `<code>`. */\nconst HLJS_CLASS = \"hljs\"\n\n/** Class of the copy button. */\nconst COPY_CLASS = \"copy\"\n\n/** The copy button's icon. */\nconst COPY_ICON = \"copy outline\"\n\n/** The copy button's icon for a moment once it has copied. */\nconst CHECK_ICON = \"check\"\n","/**\n * The code family: defines `<ui-code>` and exports its component, `UICode`, its DOM element class,\n * `DOMCodeElement`, and its helpers (`CodeHighlighter`, `CodeLines`).\n * - SIDE EFFECTS: importing it defines the tag, and `<ui-loader>` and `<ui-message>` (its loading and error looks).\n * - Also the library's `spell/ui/ui-code` entry (its size is in `notes/report.md`).\n * - highlight.js is NOT in this chunk: `CodeEngine` loads on the first highlight.\n * - A language of a page's own joins `UI.code` (`UI.code.register()`):\n * spell's is the app's `<spell-code>` family, which Spell UI knows nothing of.\n */\n\nimport { DOMCodeElement, UICode } from \"./UICode\"\nimport { CodeHighlighter } from \"./CodeHighlighter\"\nimport { CodeLines } from \"./CodeLines\"\n\nimport \"spell/ui/components/ui-loader\"\nimport \"spell/ui/components/ui-message\"\n\nUICode.define()\n\nexport { UICode, DOMCodeElement, CodeHighlighter, CodeLines }\n"],"mappings":";;;;;;;AAgBA,IAAayD,KAAiB;CAC5B,KAAK;CACL,MAAM;CACN,QAAQ;EAAC;EAAQ;EAAc;CAAc;CAC7C,KAAK;EAAC;EAAc;EAAuB;EAAe;EAAO;EAAW;EAAe;CAAS;CACpG,UAAU;CACV,MAAM;CACN,aACE;CACF,YAAY;EACV,GAAGzD;EACH;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aACE;EAGJ;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,KAAK;GACL,UAAU;GACV,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;GACT,aAAa;EAC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GW,gBAAe5E,EAAtBtC,GAAA,IAHJkH,GAG0B;CACnC,aAAa,EAAE,MAAMlF,EAAQ;CAC7B,YAAYiF;CACZ,gBAAgB;AAClB,CAAA,CAAA,GAJe3E,EAAAtC,GAAA,IAHJkH,CAAA;AAAN,IAAM6C,IAAN7C,GAyJDiB,KAAa,QAGbsB,KAAe,QAGfrB,IAAa,QAGbe,KAAa,QAGbrB,KAAY,gBAGZD,KAAa;;;eCzMnBkC,EAAO,OAAO"}
|
package/dist/ui-comment.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "./rolldown-runtime-CYGlBXrH.js";
|
|
2
|
-
import { Bt as e,
|
|
2
|
+
import { Bt as e, Ht as t, Lt as n, PartContext as r, Rt as i, SlotContent as a, UIComponent as o, Ut as s, derived as c, h as l, proto as u, protoMerged as d, zt as f } from "./core.js";
|
|
3
3
|
import "./ui-parts.js";
|
|
4
4
|
import { Show as p } from "solid-js";
|
|
5
5
|
import { className as m, createComponent as h, effect as g, getOwner as _, insert as v, readShallow as y, setAttribute as b, template as x } from "@solidjs/web";
|
|
6
6
|
//#region src/components/ui-comment/UIComment.en.ts
|
|
7
7
|
var S = {
|
|
8
8
|
tag: "ui-comment",
|
|
9
|
+
icon: "comment outline",
|
|
9
10
|
topics: [
|
|
10
11
|
"social",
|
|
11
12
|
"content parts",
|
|
@@ -70,12 +71,12 @@ var S = {
|
|
|
70
71
|
"actions",
|
|
71
72
|
"comments"
|
|
72
73
|
]
|
|
73
|
-
}, C = "@layer ui.components.comment.types{:host{display:contents}.ui.comments,:host(:not(:state(in-comments))){--_ui-comments-max-width:var(--ui-comments-max-width,calc(var(--ui-font-size) * 40.625));--_ui-comments-margin:var(--ui-comments-margin,1.5em);--_ui-comment-distance:var(--ui-comment-distance,.5em);--_ui-comment-line-height:var(--ui-comment-line-height,1.2);--_ui-comments-thread-margin:var(--ui-comments-thread-margin,0 0 .5em .5em);--_ui-comments-thread-padding:var(--ui-comments-thread-padding,1em 0 1em 1em);--_ui-comments-threaded-margin:var(--ui-comments-threaded-margin,-1.5em 0 -1em 1.25em);--_ui-comments-threaded-padding:var(--ui-comments-threaded-padding,3em 0 2em 2.25em);--_ui-comments-threaded-line:var(--ui-comments-threaded-line,calc(var(--ui-border-width) * -1) 0 0 var(--ui-border-color));--_ui-comments-reply-distance:var(--ui-comments-reply-distance,1em);--_ui-comments-disabled-opacity:var(--ui-comments-disabled-opacity,var(--ui-disabled-opacity))}.ui.comments{--_ui-comments-minimal:0;--_comments-threaded:0;--ui-inverted:0;box-sizing:border-box;max-width:var(--_ui-comments-max-width);margin:var(--_comments-margin-top,var(--_ui-comments-margin)) 0 var(--_comments-margin-bottom,var(--_ui-comments-margin));color:var(--ui-text-color);font-size:calc(var(--ui-font-size) * var(--ui-scale,1))}.ui.comments:first-child{--_comments-margin-top:0}.ui.comments:last-child{--_comments-margin-bottom:0}:host(:not(:first-child))>.ui.comments{--_comments-margin-top:initial}:host(:not(:last-child))>.ui.comments{--_comments-margin-bottom:initial}.ui.comments>slot{--ui-scale:initial}:host>.comment,.ui.comments .comment{margin:var(--_ui-comment-distance) 0 0;padding:var(--_ui-comment-distance) 0 0;line-height:var(--_ui-comment-line-height);background:0 0;border:none;position:relative}:host(:first-child)>.comment,.ui.comments .comment:first-child{margin-top:0;padding-top:0}:host(:state(in-comment))>.comments,.ui.comments .comment>.comments{margin:var(--_ui-comments-thread-margin);padding:var(--_ui-comments-thread-padding)}}@layer ui.components.comment.content{:is(.comments,.comment)>.reply,.ui.comments>.reply.form{margin-top:var(--_ui-comments-reply-distance)}.comment>.reply,.ui.comments .comment .reply.form{width:100%}.ui.comments .reply.form textarea{height:12em;font-size:1em}}@layer ui.components.comment.variations{.ui.threaded.comments{--_comments-threaded:1}.ui.threaded.comments .comment>.comments{margin:var(--_ui-comments-threaded-margin);padding:var(--_ui-comments-threaded-padding);box-shadow:var(--_ui-comments-threaded-line)}@container style(--_comments-threaded:1){:host(:state(in-comment))>.comments{margin:var(--_ui-comments-threaded-margin);padding:var(--_ui-comments-threaded-padding);box-shadow:var(--_ui-comments-threaded-line)}}.ui.minimal.comments{--_ui-comments-minimal:1}.ui.inverted.comments{--ui-inverted:1;--ui-scheme:dark;color-scheme:dark}.ui.inverted.comments .comment{background-color:var(--ui-surface)}@container style(--ui-inverted:1){:host(:state(in-comments))>.comment{background-color:var(--ui-surface)}}}@layer ui.components.comment.states{.ui.collapsed.comments,.ui.comments .collapsed:is(.comments,.comment),:host>.collapsed:is(.comments,.comment){display:none}.ui.disabled.comments,.ui.comments .disabled.comment,:host>.disabled:is(.comments,.comment){opacity:var(--_ui-comments-disabled-opacity);pointer-events:none}}", w = /* @__PURE__ */ x("<div><slot>"), T = /* @__PURE__ */ x("<article><slot>"), E, D, O, k, A = class _UIComment extends (O =
|
|
74
|
+
}, C = "@layer ui.components.comment.types{:host{display:contents}.ui.comments,:host(:not(:state(in-comments))){--_ui-comments-max-width:var(--ui-comments-max-width,calc(var(--ui-font-size) * 40.625));--_ui-comments-margin:var(--ui-comments-margin,1.5em);--_ui-comment-distance:var(--ui-comment-distance,.5em);--_ui-comment-line-height:var(--ui-comment-line-height,1.2);--_ui-comments-thread-margin:var(--ui-comments-thread-margin,0 0 .5em .5em);--_ui-comments-thread-padding:var(--ui-comments-thread-padding,1em 0 1em 1em);--_ui-comments-threaded-margin:var(--ui-comments-threaded-margin,-1.5em 0 -1em 1.25em);--_ui-comments-threaded-padding:var(--ui-comments-threaded-padding,3em 0 2em 2.25em);--_ui-comments-threaded-line:var(--ui-comments-threaded-line,calc(var(--ui-border-width) * -1) 0 0 var(--ui-border-color));--_ui-comments-reply-distance:var(--ui-comments-reply-distance,1em);--_ui-comments-disabled-opacity:var(--ui-comments-disabled-opacity,var(--ui-disabled-opacity))}.ui.comments{--_ui-comments-minimal:0;--_comments-threaded:0;--ui-inverted:0;box-sizing:border-box;max-width:var(--_ui-comments-max-width);margin:var(--_comments-margin-top,var(--_ui-comments-margin)) 0 var(--_comments-margin-bottom,var(--_ui-comments-margin));color:var(--ui-text-color);font-size:calc(var(--ui-font-size) * var(--ui-scale,1))}.ui.comments:first-child{--_comments-margin-top:0}.ui.comments:last-child{--_comments-margin-bottom:0}:host(:not(:first-child))>.ui.comments{--_comments-margin-top:initial}:host(:not(:last-child))>.ui.comments{--_comments-margin-bottom:initial}.ui.comments>slot{--ui-scale:initial}:host>.comment,.ui.comments .comment{margin:var(--_ui-comment-distance) 0 0;padding:var(--_ui-comment-distance) 0 0;line-height:var(--_ui-comment-line-height);background:0 0;border:none;position:relative}:host(:first-child)>.comment,.ui.comments .comment:first-child{margin-top:0;padding-top:0}:host(:state(in-comment))>.comments,.ui.comments .comment>.comments{margin:var(--_ui-comments-thread-margin);padding:var(--_ui-comments-thread-padding)}}@layer ui.components.comment.content{:is(.comments,.comment)>.reply,.ui.comments>.reply.form{margin-top:var(--_ui-comments-reply-distance)}.comment>.reply,.ui.comments .comment .reply.form{width:100%}.ui.comments .reply.form textarea{height:12em;font-size:1em}}@layer ui.components.comment.variations{.ui.threaded.comments{--_comments-threaded:1}.ui.threaded.comments .comment>.comments{margin:var(--_ui-comments-threaded-margin);padding:var(--_ui-comments-threaded-padding);box-shadow:var(--_ui-comments-threaded-line)}@container style(--_comments-threaded:1){:host(:state(in-comment))>.comments{margin:var(--_ui-comments-threaded-margin);padding:var(--_ui-comments-threaded-padding);box-shadow:var(--_ui-comments-threaded-line)}}.ui.minimal.comments{--_ui-comments-minimal:1}.ui.inverted.comments{--ui-inverted:1;--ui-scheme:dark;color-scheme:dark}.ui.inverted.comments .comment{background-color:var(--ui-surface)}@container style(--ui-inverted:1){:host(:state(in-comments))>.comment{background-color:var(--ui-surface)}}}@layer ui.components.comment.states{.ui.collapsed.comments,.ui.comments .collapsed:is(.comments,.comment),:host>.collapsed:is(.comments,.comment){display:none}.ui.disabled.comments,.ui.comments .disabled.comment,:host>.disabled:is(.comments,.comment){opacity:var(--_ui-comments-disabled-opacity);pointer-events:none}}", w = /* @__PURE__ */ x("<div><slot>"), T = /* @__PURE__ */ x("<article><slot>"), E, D, O, k, A = class _UIComment extends (O = o, D = [u], E = [d], O) {
|
|
74
75
|
constructor() {
|
|
75
|
-
super(...arguments),
|
|
76
|
+
super(...arguments), t(this, "context", new r({
|
|
76
77
|
domElement: this.domElement,
|
|
77
78
|
noun: this.vocabulary.noun
|
|
78
|
-
})),
|
|
79
|
+
})), t(this, "slots", new a(this.domElement));
|
|
79
80
|
}
|
|
80
81
|
render() {
|
|
81
82
|
let e = this;
|
|
@@ -102,13 +103,14 @@ var S = {
|
|
|
102
103
|
}), t;
|
|
103
104
|
}
|
|
104
105
|
};
|
|
105
|
-
k =
|
|
106
|
+
k = f(O), n(k, 13, "vocabulary", D, A), n(k, 13, "elementSetup", E, A), i(k, A), e(A, "UIComment"), t(A, "vocabulary", s(k, 8, A, S)), s(k, 11, A), t(A, "elementSetup", s(k, 12, A, {
|
|
106
107
|
styleSheets: { comment: C },
|
|
107
108
|
cssStates: ["collapsed"],
|
|
108
109
|
delegatesFocus: !1
|
|
109
|
-
})),
|
|
110
|
+
})), s(k, 15, A);
|
|
110
111
|
var j = A, M = "reply", N = {
|
|
111
112
|
tag: "ui-comments",
|
|
113
|
+
icon: "comments outline",
|
|
112
114
|
topics: [
|
|
113
115
|
"social",
|
|
114
116
|
"lists",
|
|
@@ -190,12 +192,12 @@ var j = A, M = "reply", N = {
|
|
|
190
192
|
}],
|
|
191
193
|
texts: [],
|
|
192
194
|
ownsParts: ["comment"]
|
|
193
|
-
}, P = /* @__PURE__ */ x("<div><slot>"), F, I, L, R, z, B = class _UIComments extends (R =
|
|
195
|
+
}, P = /* @__PURE__ */ x("<div><slot>"), F, I, L, R, z, B = class _UIComments extends (R = o, L = [u], I = [d], F = [c], R) {
|
|
194
196
|
constructor() {
|
|
195
|
-
super(...arguments),
|
|
197
|
+
super(...arguments), s(z, 5, this), t(this, "context", new r({
|
|
196
198
|
domElement: this.domElement,
|
|
197
199
|
noun: this.vocabulary.noun
|
|
198
|
-
})),
|
|
200
|
+
})), t(this, "slots", new a(this.domElement));
|
|
199
201
|
}
|
|
200
202
|
get isThread() {
|
|
201
203
|
return !!this.context.owner;
|
|
@@ -227,16 +229,16 @@ var j = A, M = "reply", N = {
|
|
|
227
229
|
get threadClasses() {
|
|
228
230
|
return [
|
|
229
231
|
this.collapsed ? U : "",
|
|
230
|
-
this.disabled ?
|
|
232
|
+
this.disabled ? l : "",
|
|
231
233
|
this.vocabulary.noun
|
|
232
234
|
].filter(Boolean).join(" ");
|
|
233
235
|
}
|
|
234
236
|
};
|
|
235
|
-
z =
|
|
237
|
+
z = f(R), n(z, 2, "threadClasses", F, B), n(z, 13, "vocabulary", L, B), n(z, 13, "elementSetup", I, B), i(z, B), e(B, "UIComments"), t(B, "vocabulary", s(z, 8, B, N)), s(z, 11, B), t(B, "elementSetup", s(z, 12, B, {
|
|
236
238
|
styleSheets: { comment: C },
|
|
237
239
|
cssStates: ["collapsed"],
|
|
238
240
|
delegatesFocus: !1
|
|
239
|
-
})),
|
|
241
|
+
})), s(z, 15, B);
|
|
240
242
|
var V = B, H = "reply", U = "collapsed";
|
|
241
243
|
V.define(), j.define();
|
|
242
244
|
//#endregion
|