spell-ui 0.8.6 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-components.md +14 -6
- package/README-frameworks.md +22 -12
- package/README-migrating.md +7 -6
- package/README-runtime.md +14 -13
- package/README-site.md +11 -11
- package/README-themes.md +38 -11
- package/README.md +61 -73
- package/dist/Dragging-CMZoLEWQ.js +169 -0
- package/dist/Dragging-CMZoLEWQ.js.map +1 -0
- package/dist/{MarkdownEngine-CbuT9Mjc.js → MarkdownEngine-CW1WGqNp.js} +122 -100
- package/dist/MarkdownEngine-CW1WGqNp.js.map +1 -0
- package/dist/{PrefStore-CeaTtjTz.js → PrefStore-Qv0e5y04.js} +22 -22
- package/dist/PrefStore-Qv0e5y04.js.map +1 -0
- package/dist/ScrollingRow-7n7Z-HIE.js +88 -0
- package/dist/ScrollingRow-7n7Z-HIE.js.map +1 -0
- package/dist/SitePages-CciwREek.js +51 -0
- package/dist/SitePages-CciwREek.js.map +1 -0
- package/dist/{SlottedItems-Ch0tzzlL.js → SlottedItems-Du3aJwG1.js} +22 -22
- package/dist/{SlottedItems-Ch0tzzlL.js.map → SlottedItems-Du3aJwG1.js.map} +1 -1
- package/dist/ThemeDraft-B7NPif4d.js +805 -0
- package/dist/ThemeDraft-B7NPif4d.js.map +1 -0
- package/dist/TreeMeasure-BVJeGb1L.js +42 -0
- package/dist/TreeMeasure-BVJeGb1L.js.map +1 -0
- package/dist/UIButton-DFEds67r.js +6 -0
- package/dist/UIButton-DFEds67r.js.map +1 -0
- package/dist/UIInput-BodVbUoQ.js +6 -0
- package/dist/UIInput-BodVbUoQ.js.map +1 -0
- package/dist/{UIKeys-DJF2TIKE.js → UIKeys-Rh_gUZjP.js} +10 -9
- package/dist/UIKeys-Rh_gUZjP.js.map +1 -0
- package/dist/UILabel-DgJUBzB_.js +6 -0
- package/dist/UILabel-DgJUBzB_.js.map +1 -0
- package/dist/UIMenu-zdcAtwTa.js +42 -0
- package/dist/UIMenu-zdcAtwTa.js.map +1 -0
- package/dist/{UIRuntime-BBuehGly.js → UIRuntime-KH309p5B.js} +398 -207
- package/dist/UIRuntime-KH309p5B.js.map +1 -0
- package/dist/_spell-element/DOMElement.d.ts +62 -5
- package/dist/_spell-element/MoveAndResize.d.ts +75 -0
- package/dist/_spell-element/UIComponent.d.ts +42 -0
- package/dist/_spell-element/elements.types.d.ts +47 -0
- package/dist/_spell-element/index.d.ts +1 -0
- package/dist/_spell-element/vocabulary.types.d.ts +34 -2
- package/dist/{runtime → _util}/Api.d.ts +14 -4
- package/dist/_util/Dragging.d.ts +148 -0
- package/dist/_util/ListSelection.d.ts +46 -0
- package/dist/{util → _util}/LoadOnce.d.ts +9 -1
- package/dist/_util/ReconnectingSocket.d.ts +51 -0
- package/dist/_util/diagram/DiagramColumns.d.ts +14 -0
- package/dist/_util/diagram/DiagramLayout.d.ts +119 -0
- package/dist/_util/diagram/DiagramSVG.d.ts +17 -0
- package/dist/_util/dom.d.ts +10 -0
- package/dist/_util/fetching.d.ts +92 -0
- package/dist/_util/measures/Dimension.d.ts +63 -0
- package/dist/_util/measures/MeasureSystem.d.ts +66 -0
- package/dist/_util/measures/dimensions.generated.d.ts +16 -0
- package/dist/_util/persist/ColorScheme.d.ts +6 -0
- package/dist/_util/persist/ServerPlace.d.ts +42 -0
- package/dist/_util/persist/WaitedOnPlace.d.ts +27 -0
- package/dist/_util/persist/persist.types.d.ts +21 -2
- package/dist/_util/timing.d.ts +10 -1
- package/dist/api.js +8 -7
- package/dist/api.js.map +1 -1
- package/dist/components/ComponentDefinitions.d.ts +29 -0
- package/dist/components/components.es.d.ts +13 -0
- package/dist/components/components.types.d.ts +113 -8
- package/dist/components/ui-accordion/UIAccordion.d.ts +1 -0
- package/dist/components/ui-accordion/UIAccordion.en.d.ts +1 -0
- package/dist/components/ui-action/UIAction.en.d.ts +5 -1
- package/dist/components/ui-ad/UIAd.d.ts +1 -0
- package/dist/components/ui-ad/UIAd.en.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumb.en.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
- package/dist/components/ui-breadcrumbs/UIBreadcrumbs.en.d.ts +1 -0
- package/dist/components/ui-button/UIButton.d.ts +8 -3
- package/dist/components/ui-button/UIButton.en.d.ts +9 -4
- package/dist/components/ui-button/UIButton.es.d.ts +6 -0
- package/dist/components/ui-button/UIButton.fallback.d.ts +8 -3
- package/dist/components/ui-button/UIButtons.d.ts +1 -0
- package/dist/components/ui-button/UIButtons.en.d.ts +1 -0
- package/dist/components/ui-button/UIOr.d.ts +1 -0
- package/dist/components/ui-button/UIOr.en.d.ts +1 -0
- package/dist/components/ui-calendar/UICalendar.d.ts +6 -0
- package/dist/components/ui-calendar/UICalendar.en.d.ts +6 -0
- package/dist/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
- package/dist/components/ui-card/CardClicks.d.ts +40 -0
- package/dist/components/ui-card/UICard.d.ts +41 -0
- package/dist/components/ui-card/UICard.en.d.ts +49 -0
- package/dist/components/ui-card/UICard.es.d.ts +1 -0
- package/dist/components/ui-card/UICards.d.ts +31 -0
- package/dist/components/ui-card/UICards.en.d.ts +31 -0
- package/dist/components/ui-card/UICards.es.d.ts +8 -0
- package/dist/components/ui-checkbox/CheckControl.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.en.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.es.d.ts +1 -0
- package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
- package/dist/components/ui-checkbox/UICheckbox.types.d.ts +5 -0
- package/dist/components/ui-checkbox/UIRadio.d.ts +8 -0
- package/dist/components/ui-checkbox/UIRadio.en.d.ts +6 -0
- package/dist/components/ui-code/UICode.en.d.ts +1 -0
- package/dist/components/ui-comment/UIComment.d.ts +1 -0
- package/dist/components/ui-comment/UIComment.en.d.ts +1 -0
- package/dist/components/ui-comment/UIComments.d.ts +1 -0
- package/dist/components/ui-comment/UIComments.en.d.ts +1 -0
- package/dist/components/ui-components/PackHotSwap.d.ts +13 -3
- package/dist/components/ui-components/UIComponents.d.ts +1 -0
- package/dist/components/ui-components/UIComponents.en.d.ts +1 -0
- package/dist/components/ui-container/UIContainer.d.ts +11 -0
- package/dist/components/ui-container/UIContainer.en.d.ts +7 -0
- package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
- package/dist/components/ui-diagram/UIDiagram.d.ts +268 -0
- package/dist/components/ui-diagram/UIDiagram.en.d.ts +106 -0
- package/dist/components/ui-diagram/UIDiagram.es.d.ts +37 -0
- package/dist/components/ui-diagram/UIDiagramNode.d.ts +98 -0
- package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +38 -0
- package/dist/components/ui-diagram/UIDiagramNode.es.d.ts +16 -0
- package/dist/components/ui-diagram/index.d.ts +8 -0
- package/dist/components/ui-dimension/UIDimension.d.ts +81 -0
- package/dist/components/ui-dimension/UIDimension.en.d.ts +54 -0
- package/dist/components/ui-dimension/UIDimension.es.d.ts +22 -0
- package/dist/components/ui-dimension/index.d.ts +2 -0
- package/dist/components/ui-dimmer/UIDimmer.d.ts +6 -1
- package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
- package/dist/components/ui-dimmer/UIDimmer.es.d.ts +1 -1
- package/dist/components/ui-divider/UIDivider.d.ts +2 -0
- package/dist/components/ui-divider/UIDivider.en.d.ts +2 -0
- package/dist/components/ui-divider/UIDivider.es.d.ts +1 -0
- package/dist/components/ui-dropdown/UIDropdown.d.ts +6 -0
- package/dist/components/ui-dropdown/UIDropdown.en.d.ts +6 -0
- package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
- package/dist/components/ui-embed/UIEmbed.d.ts +1 -0
- package/dist/components/ui-embed/UIEmbed.en.d.ts +1 -0
- package/dist/components/ui-emoji/UIEmoji.d.ts +1 -0
- package/dist/components/ui-emoji/UIEmoji.en.d.ts +1 -0
- package/dist/components/ui-example/UIExample.en.d.ts +4 -2
- package/dist/components/ui-example/UIExample.es.d.ts +3 -2
- package/dist/components/ui-feed/UIFeed.d.ts +1 -0
- package/dist/components/ui-feed/UIFeed.en.d.ts +1 -0
- package/dist/components/ui-feed/UIFeedEvent.d.ts +1 -0
- package/dist/components/ui-feed/UIFeedEvent.en.d.ts +1 -0
- package/dist/components/ui-flag/UIFlag.d.ts +1 -0
- package/dist/components/ui-flag/UIFlag.en.d.ts +1 -0
- package/dist/components/ui-flyout/UIFlyout.d.ts +1 -0
- package/dist/components/ui-flyout/UIFlyout.en.d.ts +1 -0
- package/dist/components/ui-form/FormBinding.d.ts +13 -1
- package/dist/components/ui-form/FormFields.d.ts +4 -4
- package/dist/components/ui-form/UIField.d.ts +30 -3
- package/dist/components/ui-form/UIField.en.d.ts +9 -0
- package/dist/components/ui-form/UIField.es.d.ts +6 -0
- package/dist/components/ui-form/UIFields.d.ts +1 -0
- package/dist/components/ui-form/UIFields.en.d.ts +1 -0
- package/dist/components/ui-form/UIForm.d.ts +15 -0
- package/dist/components/ui-form/UIForm.en.d.ts +6 -0
- package/dist/components/ui-form/UIRepeat.d.ts +1 -0
- package/dist/components/ui-form/UIRepeat.en.d.ts +1 -0
- package/dist/components/ui-form/index.d.ts +2 -1
- package/dist/components/ui-grid/UIColumn.d.ts +1 -0
- package/dist/components/ui-grid/UIColumn.en.d.ts +1 -0
- package/dist/components/ui-grid/UIGrid.d.ts +1 -0
- package/dist/components/ui-grid/UIGrid.en.d.ts +1 -0
- package/dist/components/ui-grid/UIRow.d.ts +1 -0
- package/dist/components/ui-grid/UIRow.en.d.ts +1 -0
- package/dist/components/ui-icon/UIIcon.d.ts +3 -2
- package/dist/components/ui-icon/UIIcon.en.d.ts +3 -2
- package/dist/components/ui-icon/UIIcons.d.ts +1 -0
- package/dist/components/ui-icon/UIIcons.en.d.ts +1 -0
- package/dist/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
- package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +6 -0
- package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
- package/dist/components/ui-image/UIImage.d.ts +34 -0
- package/dist/components/ui-image/UIImage.en.d.ts +23 -0
- package/dist/components/ui-image/UIImage.es.d.ts +2 -0
- package/dist/components/ui-image/UIImages.d.ts +1 -0
- package/dist/components/ui-image/UIImages.en.d.ts +1 -0
- package/dist/components/ui-include/UIInclude.d.ts +1 -0
- package/dist/components/ui-include/UIInclude.en.d.ts +1 -0
- package/dist/components/ui-input/TextControl.d.ts +7 -0
- package/dist/components/ui-input/UIInput.d.ts +22 -3
- package/dist/components/ui-input/UIInput.en.d.ts +9 -2
- package/dist/components/ui-input/UIInput.es.d.ts +2 -0
- package/dist/components/ui-input/UIInput.fallback.d.ts +9 -2
- package/dist/components/ui-input/UITextarea.d.ts +20 -0
- package/dist/components/ui-input/UITextarea.en.d.ts +15 -0
- package/dist/components/ui-input/UITextarea.es.d.ts +4 -0
- package/dist/components/ui-item/UIItem.d.ts +27 -4
- package/dist/components/ui-item/UIItem.en.d.ts +5 -1
- package/dist/components/ui-items/UIItems.d.ts +1 -0
- package/dist/components/ui-items/UIItems.en.d.ts +1 -0
- package/dist/components/ui-json/JsonChild.d.ts +30 -0
- package/dist/components/ui-json/UIJson.d.ts +128 -0
- package/dist/components/ui-json/UIJson.en.d.ts +71 -0
- package/dist/components/ui-json/UIJson.es.d.ts +12 -0
- package/dist/components/ui-json/index.d.ts +3 -0
- package/dist/components/ui-keys/UIKeys.d.ts +1 -0
- package/dist/components/ui-keys/UIKeys.en.d.ts +1 -0
- package/dist/components/ui-label/UILabel.d.ts +2 -0
- package/dist/components/ui-label/UILabel.en.d.ts +2 -0
- package/dist/components/ui-label/UILabel.es.d.ts +1 -0
- package/dist/components/ui-label/UILabels.d.ts +1 -0
- package/dist/components/ui-label/UILabels.en.d.ts +1 -0
- package/dist/components/ui-list/UIList.d.ts +2 -0
- package/dist/components/ui-list/UIList.en.d.ts +2 -0
- package/dist/components/ui-list/UIList.es.d.ts +1 -0
- package/dist/components/ui-loader/UILoader.d.ts +1 -0
- package/dist/components/ui-loader/UILoader.en.d.ts +1 -0
- package/dist/components/ui-markdown/MarkdownBox.d.ts +143 -0
- package/dist/components/ui-markdown/MarkdownEngine.d.ts +14 -2
- package/dist/components/ui-markdown/MarkdownFormats.d.ts +95 -0
- package/dist/components/ui-markdown/MarkdownSource.d.ts +57 -0
- package/dist/components/ui-markdown/UIMarkdown.d.ts +126 -6
- package/dist/components/ui-markdown/UIMarkdown.en.d.ts +111 -8
- package/dist/components/ui-markdown/UIMarkdown.es.d.ts +29 -1
- package/dist/components/ui-markdown/UIMarkdown.types.d.ts +26 -0
- package/dist/components/ui-menu/ScrollingRow.d.ts +79 -0
- package/dist/components/ui-menu/TitleFit.d.ts +3 -0
- package/dist/components/ui-menu/UIMenu.d.ts +97 -4
- package/dist/components/ui-menu/UIMenu.en.d.ts +50 -1
- package/dist/components/ui-menu/UIMenu.es.d.ts +4 -0
- package/dist/components/ui-message/UIMessage.d.ts +2 -0
- package/dist/components/ui-message/UIMessage.en.d.ts +2 -0
- package/dist/components/ui-message/UIMessage.es.d.ts +1 -0
- package/dist/components/ui-modal/UIModal.d.ts +1 -0
- package/dist/components/ui-modal/UIModal.en.d.ts +1 -0
- package/dist/components/ui-nag/UINag.d.ts +1 -0
- package/dist/components/ui-nag/UINag.en.d.ts +1 -0
- package/dist/components/ui-page/UIPage.d.ts +15 -0
- package/dist/components/ui-page/UIPage.en.d.ts +15 -0
- package/dist/components/ui-page/UIPage.es.d.ts +1 -0
- package/dist/components/ui-panel/UIPanel.d.ts +6 -0
- package/dist/components/ui-panel/UIPanel.en.d.ts +33 -20
- package/dist/components/ui-parts/UIActions.d.ts +1 -0
- package/dist/components/ui-parts/UIActions.en.d.ts +1 -0
- package/dist/components/ui-parts/UIAuthor.d.ts +1 -0
- package/dist/components/ui-parts/UIAuthor.en.d.ts +1 -0
- package/dist/components/ui-parts/UIAvatar.d.ts +1 -0
- package/dist/components/ui-parts/UIAvatar.en.d.ts +1 -0
- package/dist/components/ui-parts/UIContent.d.ts +1 -0
- package/dist/components/ui-parts/UIContent.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDate.d.ts +1 -0
- package/dist/components/ui-parts/UIDate.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDescription.d.ts +1 -0
- package/dist/components/ui-parts/UIDescription.en.d.ts +1 -0
- package/dist/components/ui-parts/UIDetail.d.ts +1 -0
- package/dist/components/ui-parts/UIDetail.en.d.ts +1 -0
- package/dist/components/ui-parts/UIExtra.d.ts +1 -0
- package/dist/components/ui-parts/UIExtra.en.d.ts +1 -0
- package/dist/components/ui-parts/UIHeader.d.ts +3 -1
- package/dist/components/ui-parts/UIHeader.en.d.ts +3 -1
- package/dist/components/ui-parts/UIMeta.d.ts +1 -0
- package/dist/components/ui-parts/UIMeta.en.d.ts +1 -0
- package/dist/components/ui-parts/UIParts.types.d.ts +15 -1
- package/dist/components/ui-parts/UISummary.d.ts +1 -0
- package/dist/components/ui-parts/UISummary.en.d.ts +1 -0
- package/dist/components/ui-parts/UITitle.d.ts +1 -0
- package/dist/components/ui-parts/UITitle.en.d.ts +1 -0
- package/dist/components/ui-parts/UIValue.d.ts +1 -0
- package/dist/components/ui-parts/UIValue.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholder.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderHeader.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderImage.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderLine.en.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
- package/dist/components/ui-placeholder/UIPlaceholderParagraph.en.d.ts +1 -0
- package/dist/components/ui-popup/UIPopup.d.ts +30 -3
- package/dist/components/ui-popup/UIPopup.en.d.ts +7 -0
- package/dist/components/ui-popup/UIPopup.es.d.ts +1 -0
- package/dist/components/ui-progress/UIProgress.d.ts +2 -0
- package/dist/components/ui-progress/UIProgress.en.d.ts +2 -0
- package/dist/components/ui-progress/UIProgress.es.d.ts +1 -0
- package/dist/components/ui-property-editor/UIProperty.d.ts +132 -5
- package/dist/components/ui-property-editor/UIProperty.en.d.ts +11 -44
- package/dist/components/ui-property-editor/UIProperty.es.d.ts +4 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +38 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.es.d.ts +4 -0
- package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +33 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +12 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +2 -0
- package/dist/components/ui-property-editor/UIPropertyGroup.es.d.ts +9 -0
- package/dist/components/ui-property-editor/index.d.ts +1 -0
- package/dist/components/ui-quote/UIQuote.d.ts +1 -0
- package/dist/components/ui-quote/UIQuote.en.d.ts +1 -0
- package/dist/components/ui-rail/UIRail.d.ts +1 -0
- package/dist/components/ui-rail/UIRail.en.d.ts +1 -0
- package/dist/components/ui-rating/UIRating.d.ts +6 -0
- package/dist/components/ui-rating/UIRating.en.d.ts +6 -0
- package/dist/components/ui-rating/UIRating.fallback.d.ts +6 -0
- package/dist/components/ui-reveal/UIReveal.d.ts +1 -0
- package/dist/components/ui-reveal/UIReveal.en.d.ts +1 -0
- package/dist/components/ui-root/UIRoot.d.ts +18 -3
- package/dist/components/ui-root/UIRoot.en.d.ts +15 -0
- package/dist/components/ui-root/UIRoot.es.d.ts +1 -0
- package/dist/components/ui-search/UISearch.d.ts +48 -7
- package/dist/components/ui-search/UISearch.en.d.ts +13 -1
- package/dist/components/ui-search/UISearch.es.d.ts +1 -0
- package/dist/components/ui-search/UISearch.fallback.d.ts +13 -1
- package/dist/components/ui-section/UISection.d.ts +22 -1
- package/dist/components/ui-section/UISection.en.d.ts +10 -0
- package/dist/components/ui-section/UISection.es.d.ts +1 -0
- package/dist/components/ui-section/UISections.d.ts +1 -0
- package/dist/components/ui-section/UISections.en.d.ts +1 -0
- package/dist/components/ui-segment/UISegment.d.ts +2 -0
- package/dist/components/ui-segment/UISegment.en.d.ts +2 -0
- package/dist/components/ui-segment/UISegment.es.d.ts +1 -0
- package/dist/components/ui-segment/UISegments.d.ts +1 -0
- package/dist/components/ui-segment/UISegments.en.d.ts +1 -0
- package/dist/components/ui-select/UISelect.d.ts +6 -0
- package/dist/components/ui-select/UISelect.en.d.ts +6 -0
- package/dist/components/ui-select/UISelect.fallback.d.ts +6 -0
- package/dist/components/ui-shape/UIShape.d.ts +23 -2
- package/dist/components/ui-shape/UIShape.en.d.ts +8 -0
- package/dist/components/ui-shape/UIShape.es.d.ts +1 -0
- package/dist/components/ui-shape/UISide.d.ts +4 -0
- package/dist/components/ui-shape/UISide.en.d.ts +4 -0
- package/dist/components/ui-sidebar/UIPushable.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPushable.en.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPusher.d.ts +1 -0
- package/dist/components/ui-sidebar/UIPusher.en.d.ts +1 -0
- package/dist/components/ui-sidebar/UISidebar.d.ts +1 -0
- package/dist/components/ui-sidebar/UISidebar.en.d.ts +1 -0
- package/dist/components/ui-sides/UISides.d.ts +209 -0
- package/dist/components/ui-sides/UISides.en.d.ts +122 -0
- package/dist/components/ui-sides/UISides.es.d.ts +30 -0
- package/dist/components/ui-sides/UISides.fallback.d.ts +134 -0
- package/dist/components/ui-sides/index.d.ts +2 -0
- package/dist/components/ui-site-nav/SitePages.d.ts +53 -0
- package/dist/components/ui-site-nav/UISiteNav.d.ts +207 -0
- package/dist/components/ui-site-nav/UISiteNav.en.d.ts +87 -0
- package/dist/components/ui-site-nav/UISiteNav.es.d.ts +29 -0
- package/dist/components/ui-site-nav/index.d.ts +1 -0
- package/dist/components/ui-site-tabs/UISiteTabs.d.ts +126 -0
- package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +49 -0
- package/dist/components/ui-site-tabs/UISiteTabs.es.d.ts +18 -0
- package/dist/components/ui-site-tabs/index.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.d.ts +7 -0
- package/dist/components/ui-slider/UISlider.en.d.ts +7 -0
- package/dist/components/ui-slider/UISlider.es.d.ts +1 -0
- package/dist/components/ui-slider/UISlider.fallback.d.ts +7 -0
- package/dist/components/ui-space/UISpace.d.ts +1 -0
- package/dist/components/ui-space/UISpace.en.d.ts +1 -0
- package/dist/components/ui-split-panel/UISplitPanel.d.ts +175 -0
- package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +74 -0
- package/dist/components/ui-split-panel/UISplitPanel.es.d.ts +25 -0
- package/dist/components/ui-split-panel/index.d.ts +2 -0
- package/dist/components/ui-stack/UIStack.d.ts +31 -5
- package/dist/components/ui-stack/UIStack.en.d.ts +15 -3
- package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistics.d.ts +1 -0
- package/dist/components/ui-statistic/UIStatistics.en.d.ts +1 -0
- package/dist/components/ui-step/UIStep.d.ts +1 -0
- package/dist/components/ui-step/UIStep.en.d.ts +1 -0
- package/dist/components/ui-step/UISteps.d.ts +1 -0
- package/dist/components/ui-step/UISteps.en.d.ts +1 -0
- package/dist/components/ui-sticky/UISticky.d.ts +4 -0
- package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
- package/dist/components/ui-tab/UITab.d.ts +8 -0
- package/dist/components/ui-tab/UITab.en.d.ts +1 -0
- package/dist/components/ui-tab/UITabs.d.ts +107 -16
- package/dist/components/ui-tab/UITabs.en.d.ts +40 -1
- package/dist/components/ui-tab/UITabs.es.d.ts +4 -0
- package/dist/components/ui-table/TableEditing.d.ts +77 -0
- package/dist/components/ui-table/UICell.d.ts +1 -0
- package/dist/components/ui-table/UICell.en.d.ts +1 -0
- package/dist/components/ui-table/UITable.d.ts +145 -5
- package/dist/components/ui-table/UITable.en.d.ts +19 -0
- package/dist/components/ui-table/UITable.es.d.ts +3 -0
- package/dist/components/ui-terms/UITerm.d.ts +1 -0
- package/dist/components/ui-terms/UITerm.en.d.ts +1 -0
- package/dist/components/ui-terms/UITerms.d.ts +1 -0
- package/dist/components/ui-terms/UITerms.en.d.ts +1 -0
- package/dist/components/ui-text/UILink.d.ts +11 -0
- package/dist/components/ui-text/UILink.en.d.ts +4 -0
- package/dist/components/ui-text/UIText.d.ts +7 -0
- package/dist/components/ui-text/UIText.en.d.ts +7 -0
- package/dist/components/ui-text/UIText.es.d.ts +2 -0
- package/dist/components/ui-theme-editor/SavedTheme.d.ts +55 -43
- package/dist/components/ui-theme-editor/ThemeDraft.d.ts +15 -0
- package/dist/components/ui-theme-editor/UIColorChip.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIColorChip.en.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIThemeEditor.d.ts +157 -26
- package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +79 -6
- package/dist/components/ui-theme-editor/UIThemeEditor.es.d.ts +20 -2
- package/dist/components/ui-theme-editor/UIThemeEditor.types.d.ts +0 -2
- package/dist/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
- package/dist/components/ui-theme-editor/UIThemeToken.en.d.ts +1 -0
- package/dist/components/ui-theme-menu/HueDropdown.d.ts +47 -0
- package/dist/components/ui-theme-menu/ThemeMenu.d.ts +18 -7
- package/dist/components/ui-theme-menu/ThemePreference.d.ts +145 -36
- package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +118 -7
- package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +82 -2
- package/dist/components/ui-theme-menu/UIThemeMenu.es.d.ts +21 -1
- package/dist/components/ui-theme-menu/UIThemeMenu.types.d.ts +36 -8
- package/dist/components/ui-theme-menu/index.d.ts +2 -1
- package/dist/components/ui-toast/UIToast.d.ts +1 -0
- package/dist/components/ui-toast/UIToast.en.d.ts +1 -0
- package/dist/components/ui-toc/UIToc.d.ts +1 -0
- package/dist/components/ui-toc/UIToc.en.d.ts +1 -0
- package/dist/components/ui-toolbar/UIToolbar.d.ts +13 -10
- package/dist/components/ui-toolbar/UIToolbar.en.d.ts +138 -84
- package/dist/components/ui-toolbar/UIToolbar.es.d.ts +2 -0
- package/dist/components/ui-transition/UITransition.d.ts +1 -0
- package/dist/components/ui-transition/UITransition.en.d.ts +1 -0
- package/dist/components/ui-tree/UITree.d.ts +162 -0
- package/dist/components/ui-tree/UITree.en.d.ts +88 -0
- package/dist/components/ui-tree/UITree.es.d.ts +35 -0
- package/dist/components/ui-tree/UITreeItem.d.ts +204 -0
- package/dist/components/ui-tree/UITreeItem.en.d.ts +142 -0
- package/dist/components/ui-tree/UITreeItem.es.d.ts +32 -0
- package/dist/components/ui-tree/index.d.ts +3 -0
- package/dist/components/ui-tree-diagram/TreeData.d.ts +3 -12
- package/dist/components/ui-tree-diagram/TreeLayout.d.ts +54 -21
- package/dist/components/ui-tree-diagram/TreeMeasure.d.ts +36 -0
- package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +152 -27
- package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +47 -7
- package/dist/components/ui-tree-diagram/UITreeDiagram.es.d.ts +12 -1
- package/dist/components/ui-tree-diagram/UITreeDiagram.types.d.ts +66 -21
- package/dist/components/ui-tree-diagram/UITreeNode.d.ts +148 -0
- package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +69 -0
- package/dist/components/ui-tree-diagram/UITreeNode.es.d.ts +21 -0
- package/dist/components/ui-tree-diagram/index.d.ts +4 -2
- package/dist/components/ui-video/UIAudio.d.ts +1 -0
- package/dist/components/ui-video/UIAudio.en.d.ts +1 -0
- package/dist/components/ui-video/UIVideo.d.ts +1 -0
- package/dist/components/ui-video/UIVideo.en.d.ts +1 -0
- package/dist/components/ui-visibility/UIVisibility.d.ts +1 -0
- package/dist/components/ui-visibility/UIVisibility.en.d.ts +1 -0
- package/dist/components/ui-zoom/UIZoom.d.ts +1 -0
- package/dist/components/ui-zoom/UIZoom.en.d.ts +1 -0
- package/dist/{components.es-DmLzT-Bq.js → components.es-BOa_7gFF.js} +498 -109
- package/dist/components.es-BOa_7gFF.js.map +1 -0
- package/dist/core.d.ts +3 -1
- package/dist/core.js +1082 -511
- package/dist/core.js.map +1 -1
- package/dist/crisp-VfYZlTph.js +6 -0
- package/dist/{crisp-CoZRRDuQ.js.map → crisp-VfYZlTph.js.map} +1 -1
- package/dist/docs-components/index.d.ts +1 -0
- package/dist/docs-components/ui-docs-index/UIDocsIndex.d.ts +89 -0
- package/dist/docs-components/ui-docs-index/UIDocsIndex.en.d.ts +43 -0
- package/dist/docs-components/ui-docs-index/index.d.ts +2 -0
- package/dist/docs-components/ui-docs-nav/UIDocsNav.d.ts +54 -87
- package/dist/docs-components/ui-docs-nav/UIDocsNav.types.d.ts +2 -29
- package/dist/docs-components/ui-docs-search/SearchIndex.d.ts +8 -2
- package/dist/docs-components/ui-docs-search/UIDocsSearch.d.ts +10 -0
- package/dist/docs-components/ui-docs-search/UIDocsSearch.en.d.ts +5 -0
- package/dist/elements/AddressParameter.d.ts +87 -0
- package/dist/elements/DOMFormControl.d.ts +5 -0
- package/dist/elements/FormComponent.d.ts +32 -0
- package/dist/elements/LoadableBody.d.ts +6 -1
- package/dist/elements/LoadableComponent.d.ts +10 -1
- package/dist/elements/RootSettings.d.ts +43 -6
- package/dist/elements/SpellUISettings.d.ts +1 -0
- package/dist/elements/StickyWatch.d.ts +20 -0
- package/dist/elements/elements.types.d.ts +15 -0
- package/dist/elements/index.d.ts +2 -0
- package/dist/forms.js +93 -63
- package/dist/forms.js.map +1 -1
- package/dist/fruity-BRVlgJZd.js +6 -0
- package/dist/fruity-BRVlgJZd.js.map +1 -0
- package/dist/{fruity.theme-BJcMiPl1.js → fruity.theme-CbC7Jyvk.js} +2 -2
- package/dist/fruity.theme-CbC7Jyvk.js.map +1 -0
- package/dist/glass-x9tbbwVq.js +6 -0
- package/dist/glass-x9tbbwVq.js.map +1 -0
- package/dist/glass.theme-24wY2wH9.js +6 -0
- package/dist/glass.theme-24wY2wH9.js.map +1 -0
- package/dist/hot.js +530 -24
- package/dist/hot.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +91 -81
- package/dist/jsx.d.ts +21149 -10377
- package/dist/matrix-QY2gWbJ0.js +6 -0
- package/dist/{matrix-CqA59hiF.js.map → matrix-QY2gWbJ0.js.map} +1 -1
- package/dist/{matrix.theme-jqQZjcq3.js → matrix.theme-_8xtwhDq.js} +2 -2
- package/dist/matrix.theme-_8xtwhDq.js.map +1 -0
- package/dist/midnight-BxlTQSfw.js +6 -0
- package/dist/{midnight-BnoVOrhC.js.map → midnight-BxlTQSfw.js.map} +1 -1
- package/dist/mockup-83ELBuVr.js +6 -0
- package/dist/mockup-83ELBuVr.js.map +1 -0
- package/dist/mockup.theme-DmpBgGBl.js +6 -0
- package/dist/mockup.theme-DmpBgGBl.js.map +1 -0
- package/dist/paper-M61nUilz.js +6 -0
- package/dist/{paper-CynH8ZuT.js.map → paper-M61nUilz.js.map} +1 -1
- package/dist/persist.types-D2m6wD-S.js +9 -0
- package/dist/persist.types-D2m6wD-S.js.map +1 -0
- package/dist/pop-CxXfytjk.js +6 -0
- package/dist/{pop-D2i9V_rG.js.map → pop-CxXfytjk.js.map} +1 -1
- package/dist/runtime/DataTooltips.d.ts +75 -0
- package/dist/runtime/PropertyControls.d.ts +15 -1
- package/dist/runtime/Sources.d.ts +16 -4
- package/dist/runtime/Styles.d.ts +11 -0
- package/dist/runtime/Themes.d.ts +10 -4
- package/dist/runtime/UIRuntime.d.ts +4 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/runtime.types.d.ts +18 -85
- package/dist/spell-By5Y3jKP.js +6 -0
- package/dist/{spell-BFtLICm7.js.map → spell-By5Y3jKP.js.map} +1 -1
- package/dist/{spell.theme-B7AU7SQX.js → spell.theme-DxGj7qHx.js} +2 -2
- package/dist/spell.theme-DxGj7qHx.js.map +1 -0
- package/dist/styles/CodeThemeFile.d.ts +73 -0
- package/dist/styles/StyleGenerator.d.ts +6 -0
- package/dist/styles/styles.en.d.ts +141 -3
- package/dist/styles/styles.types.d.ts +2 -0
- package/dist/{styles.en-RLpYiO5_.js → styles.en-CUUxNwHo.js} +71 -14
- package/dist/styles.en-CUUxNwHo.js.map +1 -0
- package/dist/styles.js +13 -13
- package/dist/styles.js.map +1 -1
- package/dist/ui-accordion.js +54 -53
- package/dist/ui-accordion.js.map +1 -1
- package/dist/ui-action.js +20 -19
- package/dist/ui-action.js.map +1 -1
- package/dist/ui-ad.js +5 -4
- package/dist/ui-ad.js.map +1 -1
- package/dist/ui-breadcrumbs.js +15 -13
- package/dist/ui-breadcrumbs.js.map +1 -1
- package/dist/ui-button.js +132 -125
- package/dist/ui-button.js.map +1 -1
- package/dist/ui-calendar.js +208 -206
- package/dist/ui-calendar.js.map +1 -1
- package/dist/ui-card.js +260 -98
- package/dist/ui-card.js.map +1 -1
- package/dist/ui-checkbox.js +95 -81
- package/dist/ui-checkbox.js.map +1 -1
- package/dist/ui-code.js +25 -24
- package/dist/ui-code.js.map +1 -1
- package/dist/ui-comment.js +14 -12
- package/dist/ui-comment.js.map +1 -1
- package/dist/ui-components.js +7 -6
- package/dist/ui-components.js.map +1 -1
- package/dist/ui-container.js +24 -12
- package/dist/ui-container.js.map +1 -1
- package/dist/ui-diagram.js +1328 -0
- package/dist/ui-diagram.js.map +1 -0
- package/dist/ui-dimension.js +779 -0
- package/dist/ui-dimension.js.map +1 -0
- package/dist/ui-dimmer.js +36 -34
- package/dist/ui-dimmer.js.map +1 -1
- package/dist/ui-divider.js +7 -5
- package/dist/ui-divider.js.map +1 -1
- package/dist/ui-dropdown.js +107 -105
- package/dist/ui-dropdown.js.map +1 -1
- package/dist/ui-embed.js +36 -35
- package/dist/ui-embed.js.map +1 -1
- package/dist/ui-emoji.js +10 -9
- package/dist/ui-emoji.js.map +1 -1
- package/dist/ui-example.js +63 -61
- package/dist/ui-example.js.map +1 -1
- package/dist/ui-feed.js +12 -10
- package/dist/ui-feed.js.map +1 -1
- package/dist/ui-flag.js +10 -9
- package/dist/ui-flag.js.map +1 -1
- package/dist/ui-flyout.js +7 -6
- package/dist/ui-flyout.js.map +1 -1
- package/dist/ui-form.js +244 -162
- package/dist/ui-form.js.map +1 -1
- package/dist/ui-grid.js +21 -18
- package/dist/ui-grid.js.map +1 -1
- package/dist/ui-icon-picker.js +46 -44
- package/dist/ui-icon-picker.js.map +1 -1
- package/dist/ui-icon.js +17 -14
- package/dist/ui-icon.js.map +1 -1
- package/dist/ui-image.js +93 -55
- package/dist/ui-image.js.map +1 -1
- package/dist/ui-include.js +18 -17
- package/dist/ui-include.js.map +1 -1
- package/dist/ui-input.js +154 -112
- package/dist/ui-input.js.map +1 -1
- package/dist/ui-item.js +152 -102
- package/dist/ui-item.js.map +1 -1
- package/dist/ui-items.js +9 -8
- package/dist/ui-items.js.map +1 -1
- package/dist/ui-json.js +115 -0
- package/dist/ui-json.js.map +1 -0
- package/dist/ui-keys.js +1 -1
- package/dist/ui-label.js +18 -15
- package/dist/ui-label.js.map +1 -1
- package/dist/ui-list.js +7 -5
- package/dist/ui-list.js.map +1 -1
- package/dist/ui-loader.js +7 -6
- package/dist/ui-loader.js.map +1 -1
- package/dist/ui-markdown.js +975 -83
- package/dist/ui-markdown.js.map +1 -1
- package/dist/ui-menu.js +329 -196
- package/dist/ui-menu.js.map +1 -1
- package/dist/ui-message.js +20 -18
- package/dist/ui-message.js.map +1 -1
- package/dist/ui-modal.js +46 -45
- package/dist/ui-modal.js.map +1 -1
- package/dist/ui-nag.js +19 -18
- package/dist/ui-nag.js.map +1 -1
- package/dist/ui-page.js +8 -7
- package/dist/ui-page.js.map +1 -1
- package/dist/ui-panel.js +28 -17
- package/dist/ui-panel.js.map +1 -1
- package/dist/ui-parts.js +66 -52
- package/dist/ui-parts.js.map +1 -1
- package/dist/ui-placeholder.js +21 -16
- package/dist/ui-placeholder.js.map +1 -1
- package/dist/ui-popup.js +113 -84
- package/dist/ui-popup.js.map +1 -1
- package/dist/ui-progress.js +9 -7
- package/dist/ui-progress.js.map +1 -1
- package/dist/ui-property-editor.js +706 -203
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-quote.js +5 -4
- package/dist/ui-quote.js.map +1 -1
- package/dist/ui-rail.js +5 -4
- package/dist/ui-rail.js.map +1 -1
- package/dist/ui-rating.js +31 -29
- package/dist/ui-rating.js.map +1 -1
- package/dist/ui-reveal.js +7 -6
- package/dist/ui-reveal.js.map +1 -1
- package/dist/ui-root.js +324 -158
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-search.js +210 -168
- package/dist/ui-search.js.map +1 -1
- package/dist/ui-section.js +124 -92
- package/dist/ui-section.js.map +1 -1
- package/dist/ui-segment.js +15 -12
- package/dist/ui-segment.js.map +1 -1
- package/dist/ui-select.js +83 -81
- package/dist/ui-select.js.map +1 -1
- package/dist/ui-shape.js +86 -58
- package/dist/ui-shape.js.map +1 -1
- package/dist/ui-sidebar.js +59 -56
- package/dist/ui-sidebar.js.map +1 -1
- package/dist/ui-sides.js +325 -0
- package/dist/ui-sides.js.map +1 -0
- package/dist/ui-site-nav.js +329 -0
- package/dist/ui-site-nav.js.map +1 -0
- package/dist/ui-site-tabs.js +177 -0
- package/dist/ui-site-tabs.js.map +1 -0
- package/dist/ui-slider.js +84 -81
- package/dist/ui-slider.js.map +1 -1
- package/dist/ui-space.js +7 -6
- package/dist/ui-space.js.map +1 -1
- package/dist/ui-split-panel.js +298 -0
- package/dist/ui-split-panel.js.map +1 -0
- package/dist/ui-stack.js +47 -23
- package/dist/ui-stack.js.map +1 -1
- package/dist/ui-statistic.js +15 -13
- package/dist/ui-statistic.js.map +1 -1
- package/dist/ui-step.js +31 -29
- package/dist/ui-step.js.map +1 -1
- package/dist/ui-sticky.js +7 -6
- package/dist/ui-sticky.js.map +1 -1
- package/dist/ui-tab.js +230 -138
- package/dist/ui-tab.js.map +1 -1
- package/dist/ui-table.js +724 -162
- package/dist/ui-table.js.map +1 -1
- package/dist/ui-terms.js +12 -10
- package/dist/ui-terms.js.map +1 -1
- package/dist/ui-text.js +53 -28
- package/dist/ui-text.js.map +1 -1
- package/dist/ui-theme-editor.js +1018 -1545
- package/dist/ui-theme-editor.js.map +1 -1
- package/dist/ui-theme-menu-CuIjr8Ou.js +1493 -0
- package/dist/ui-theme-menu-CuIjr8Ou.js.map +1 -0
- package/dist/ui-toast.js +45 -44
- package/dist/ui-toast.js.map +1 -1
- package/dist/ui-toc.js +75 -74
- package/dist/ui-toc.js.map +1 -1
- package/dist/ui-toolbar.js +51 -73
- package/dist/ui-toolbar.js.map +1 -1
- package/dist/ui-transition.js +12 -11
- package/dist/ui-transition.js.map +1 -1
- package/dist/ui-tree-diagram.js +676 -197
- package/dist/ui-tree-diagram.js.map +1 -1
- package/dist/ui-tree.js +625 -0
- package/dist/ui-tree.js.map +1 -0
- package/dist/ui-video.js +13 -11
- package/dist/ui-video.js.map +1 -1
- package/dist/ui-visibility.js +26 -25
- package/dist/ui-visibility.js.map +1 -1
- package/dist/ui-zoom.js +79 -78
- package/dist/ui-zoom.js.map +1 -1
- package/dist/util/TopLayerTip.d.ts +28 -0
- package/dist/util/index.d.ts +5 -2
- package/dist/vocabulary/DefaultValues.d.ts +34 -0
- package/dist/vocabulary/SharedVocabulary.d.ts +4 -0
- package/dist/vocabulary/SharedVocabulary.es.d.ts +7 -0
- package/dist/vocabulary/ValueSets.d.ts +18 -0
- package/dist/vocabulary/Vocabulary.d.ts +1 -0
- package/dist/vocabulary/defaults.generated.d.ts +6 -0
- package/dist/vocabulary/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/MarkdownEngine-CbuT9Mjc.js.map +0 -1
- package/dist/PrefStore-CeaTtjTz.js.map +0 -1
- package/dist/UIButton-XkfGqgh6.js +0 -6
- package/dist/UIButton-XkfGqgh6.js.map +0 -1
- package/dist/UIInput-BUudZstW.js +0 -6
- package/dist/UIInput-BUudZstW.js.map +0 -1
- package/dist/UIKeys-DJF2TIKE.js.map +0 -1
- package/dist/UILabel-C1jy3Yl8.js +0 -6
- package/dist/UILabel-C1jy3Yl8.js.map +0 -1
- package/dist/UIMenu-Btd-8V3A.js +0 -42
- package/dist/UIMenu-Btd-8V3A.js.map +0 -1
- package/dist/UIRuntime-BBuehGly.js.map +0 -1
- package/dist/components.es-DmLzT-Bq.js.map +0 -1
- package/dist/crisp-CoZRRDuQ.js +0 -6
- package/dist/fruity-CQFYeRlh.js +0 -6
- package/dist/fruity-CQFYeRlh.js.map +0 -1
- package/dist/fruity.theme-BJcMiPl1.js.map +0 -1
- package/dist/glass-CAfW11kL.js +0 -6
- package/dist/glass-CAfW11kL.js.map +0 -1
- package/dist/glass.theme-DQcBbtCW.js +0 -6
- package/dist/glass.theme-DQcBbtCW.js.map +0 -1
- package/dist/matrix-CqA59hiF.js +0 -6
- package/dist/matrix.theme-jqQZjcq3.js.map +0 -1
- package/dist/midnight-BnoVOrhC.js +0 -6
- package/dist/paper-CynH8ZuT.js +0 -6
- package/dist/persist.types-CsZxS8TG.js +0 -9
- package/dist/persist.types-CsZxS8TG.js.map +0 -1
- package/dist/pop-D2i9V_rG.js +0 -6
- package/dist/spell-BFtLICm7.js +0 -6
- package/dist/spell.theme-B7AU7SQX.js.map +0 -1
- package/dist/styles.en-RLpYiO5_.js.map +0 -1
- package/dist/ui-theme-menu-DyKZygpV.js +0 -921
- package/dist/ui-theme-menu-DyKZygpV.js.map +0 -1
package/dist/ui-markdown.js
CHANGED
|
@@ -1,14 +1,476 @@
|
|
|
1
1
|
import "./rolldown-runtime-CYGlBXrH.js";
|
|
2
|
-
import { Bt as e, DOMLoadableElement as t,
|
|
2
|
+
import { Bt as e, DOMLoadableElement as t, Ht as n, LoadableComponent as r, Lt as i, NodeType as a, Rt as o, SourceEvent as s, UI as c, Ut as l, Vt as u, after as d, cssState as f, dt as ee, ht as te, mt as ne, onChange as p, once as re, ot as ie, proto as ae, protoMerged as oe, pt as se, state as m, untracked as h, whileConnected as ce, zt as g } from "./core.js";
|
|
3
|
+
import "./ui-button.js";
|
|
4
|
+
import { t as _ } from "./PrefStore-Qv0e5y04.js";
|
|
3
5
|
import "./ui-loader.js";
|
|
4
6
|
import "./ui-message.js";
|
|
7
|
+
import "./ui-select.js";
|
|
5
8
|
import "./ui-code.js";
|
|
6
|
-
import { For as
|
|
7
|
-
import { addEvent as
|
|
8
|
-
//#region src/components/ui-markdown/
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
import { For as le, Show as ue } from "solid-js";
|
|
10
|
+
import { addEvent as v, className as de, createComponent as y, delegateEvents as fe, effect as b, insert as pe, memo as me, readShallow as he, ref as x, setAttribute as S, template as C } from "@solidjs/web";
|
|
11
|
+
//#region src/components/ui-markdown/MarkdownFormats.ts
|
|
12
|
+
var w = class MarkdownFormats {
|
|
13
|
+
static toggle(e, t) {
|
|
14
|
+
let { text: n } = e, { start: r, end: i } = e.start === e.end ? MarkdownFormats.wordAt(e) : e;
|
|
15
|
+
if (r === i) return {
|
|
16
|
+
text: n.slice(0, r) + t + t + n.slice(i),
|
|
17
|
+
start: r + t.length,
|
|
18
|
+
end: r + t.length
|
|
19
|
+
};
|
|
20
|
+
let a = t.length, isWrapped = (e, r) => n.slice(e - a, e) === t && n.slice(r, r + a) === t && (t !== "*" || n[e - a - 1] !== "*" && n[r + a] !== "*" || MarkdownFormats.isTriple(n, e, r));
|
|
21
|
+
if (isWrapped(r, i)) return {
|
|
22
|
+
text: n.slice(0, r - a) + n.slice(r, i) + n.slice(i + a),
|
|
23
|
+
start: r - a,
|
|
24
|
+
end: i - a
|
|
25
|
+
};
|
|
26
|
+
let o = n.slice(r, i);
|
|
27
|
+
if (o.length > 2 * a && o.startsWith(t) && o.endsWith(t)) {
|
|
28
|
+
let e = o.slice(a, -a);
|
|
29
|
+
return {
|
|
30
|
+
text: n.slice(0, r) + e + n.slice(i),
|
|
31
|
+
start: r,
|
|
32
|
+
end: r + e.length
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
for (; r < i && /\s/.test(n[r]);) r++;
|
|
36
|
+
for (; i > r && /\s/.test(n[i - 1]);) i--;
|
|
37
|
+
let s = t + n.slice(r, i) + t;
|
|
38
|
+
return {
|
|
39
|
+
text: n.slice(0, r) + s + n.slice(i),
|
|
40
|
+
start: r + a,
|
|
41
|
+
end: i + a
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static link(e, t) {
|
|
45
|
+
let { text: n } = e, r = MarkdownFormats.linkAt(n, e.start);
|
|
46
|
+
if (r) {
|
|
47
|
+
let e = t ? `[${r.words}](${t})` : r.words, i = r.start + +!!t;
|
|
48
|
+
return {
|
|
49
|
+
text: n.slice(0, r.start) + e + n.slice(r.end),
|
|
50
|
+
start: i,
|
|
51
|
+
end: i + r.words.length
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (!t) return e;
|
|
55
|
+
let i = n.slice(e.start, e.end) || t, a = `[${i}](${t})`;
|
|
56
|
+
return {
|
|
57
|
+
text: n.slice(0, e.start) + a + n.slice(e.end),
|
|
58
|
+
start: e.start + 1,
|
|
59
|
+
end: e.start + 1 + i.length
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
static linkAt(e, t) {
|
|
63
|
+
for (let n of e.matchAll(T)) {
|
|
64
|
+
let e = n.index, r = e + n[0].length;
|
|
65
|
+
if (t >= e && t <= r) return {
|
|
66
|
+
start: e,
|
|
67
|
+
end: r,
|
|
68
|
+
words: n[1],
|
|
69
|
+
address: n[2]
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
static clear(e) {
|
|
74
|
+
let t = e.start === e.end, n = t ? 0 : e.start, r = t ? e.text.length : e.end, i = e.text.slice(n, r);
|
|
75
|
+
i = i.replace(T, "$1").replace(E, "$1").replace(D, "$1").replace(O, "$1");
|
|
76
|
+
let a = {
|
|
77
|
+
text: e.text.slice(0, n) + i + e.text.slice(r),
|
|
78
|
+
start: n,
|
|
79
|
+
end: n + i.length
|
|
80
|
+
};
|
|
81
|
+
for (let e of ge) {
|
|
82
|
+
let n = a.text.slice(a.start - e.length, a.start) === e;
|
|
83
|
+
!t && n && a.text.slice(a.end, a.end + e.length) === e && (a = MarkdownFormats.toggle(a, e));
|
|
84
|
+
}
|
|
85
|
+
return a;
|
|
86
|
+
}
|
|
87
|
+
static formatsAt(e, t) {
|
|
88
|
+
let n = /* @__PURE__ */ new Set(), inside = (r, i) => {
|
|
89
|
+
for (let a of e.matchAll(r)) t > a.index && t < a.index + a[0].length && n.add(i);
|
|
90
|
+
};
|
|
91
|
+
return inside(E, "bold"), inside(O, "italic"), inside(D, "strikethrough"), inside(T, "link"), n;
|
|
92
|
+
}
|
|
93
|
+
static shapeOf(e, t) {
|
|
94
|
+
if (t.kind === "cell") return;
|
|
95
|
+
let n = e.slice(e.lastIndexOf("\n", t.start - 1) + 1, t.start), r = /^ {0,3}(#{1,6})[ \t]/.exec(n);
|
|
96
|
+
return r ? `h${r[1].length}` : /^\s*\d{1,9}[.)][ \t]/.test(n) ? "numbered" : /^\s*[*+-][ \t]/.test(n) ? "bullet" : "paragraph";
|
|
97
|
+
}
|
|
98
|
+
static reshape(e, t, n, r) {
|
|
99
|
+
let i = e.lastIndexOf("\n", t.start - 1) + 1, a = /^\s*/.exec(e.slice(i, t.start))[0], o = r.startsWith("h") ? n.replace(/\s*\n\s*/g, " ").trim() : n.replace(/\s+$/, ""), s = a + _e[r], c = e.slice(0, i) + s + o + e.slice(t.end), l = r === "paragraph" ? "paragraph" : r.startsWith("h") ? "heading" : "item", u = i + s.length;
|
|
100
|
+
return {
|
|
101
|
+
text: c,
|
|
102
|
+
place: {
|
|
103
|
+
kind: l,
|
|
104
|
+
start: u,
|
|
105
|
+
end: u + o.length
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
static runsOf(e) {
|
|
110
|
+
let t = [];
|
|
111
|
+
return MarkdownFormats.cut(e, [], t), t;
|
|
112
|
+
}
|
|
113
|
+
static markdownOf(e) {
|
|
114
|
+
let t = "";
|
|
115
|
+
for (let n of e.childNodes) {
|
|
116
|
+
if (n.nodeType === ye) {
|
|
117
|
+
t += (n.textContent ?? "").replace(/[\\*]/g, "\\$&");
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (n.nodeType !== be) continue;
|
|
121
|
+
let e = n, r = MarkdownFormats.markdownOf(e), i = e.localName;
|
|
122
|
+
i === "br" ? t += "\n" : i === "code" ? t += `\`${e.textContent ?? ""}\`` : i === "a" ? t += `[${r}](${e.getAttribute("href") ?? ""})` : k[i] && r.trim() ? t += k[i] + r + k[i] : t += r;
|
|
123
|
+
}
|
|
124
|
+
return t;
|
|
125
|
+
}
|
|
126
|
+
static wordAt({ text: e, start: t }) {
|
|
127
|
+
let n = t, r = t;
|
|
128
|
+
for (; n > 0 && A.test(e[n - 1]);) n--;
|
|
129
|
+
for (; r < e.length && A.test(e[r]);) r++;
|
|
130
|
+
return {
|
|
131
|
+
start: n,
|
|
132
|
+
end: r
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
static isTriple(e, t, n) {
|
|
136
|
+
return e.slice(t - 3, t) === "***" && e.slice(n, n + 3) === "***";
|
|
137
|
+
}
|
|
138
|
+
static cut(e, t, n) {
|
|
139
|
+
let r;
|
|
140
|
+
for (let [t, n, i] of ve) {
|
|
141
|
+
t.lastIndex = 0;
|
|
142
|
+
let a = t.exec(e);
|
|
143
|
+
a && (!r || a.index < r.match.index) && (r = {
|
|
144
|
+
match: a,
|
|
145
|
+
format: n,
|
|
146
|
+
mark: i
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (!r) {
|
|
150
|
+
e && n.push({
|
|
151
|
+
text: e,
|
|
152
|
+
formats: t,
|
|
153
|
+
isMark: !1
|
|
154
|
+
});
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
let { match: i, format: a, mark: o } = r, s = i[1].match(/(?<!\*)\*(?!\*)/g)?.length ?? 0;
|
|
158
|
+
a === "bold" && s % 2 && e[i.index + i[0].length] === "*" && (i[1] += "*", i[0] += "*"), i.index && n.push({
|
|
159
|
+
text: e.slice(0, i.index),
|
|
160
|
+
formats: t,
|
|
161
|
+
isMark: !1
|
|
162
|
+
});
|
|
163
|
+
let c = [...t, a];
|
|
164
|
+
a === "link" ? (n.push({
|
|
165
|
+
text: "[",
|
|
166
|
+
formats: c,
|
|
167
|
+
isMark: !0
|
|
168
|
+
}), MarkdownFormats.cut(i[1], c, n), n.push({
|
|
169
|
+
text: `](${i[2]})`,
|
|
170
|
+
formats: c,
|
|
171
|
+
isMark: !0
|
|
172
|
+
})) : (n.push({
|
|
173
|
+
text: o,
|
|
174
|
+
formats: c,
|
|
175
|
+
isMark: !0
|
|
176
|
+
}), MarkdownFormats.cut(i[1], c, n), n.push({
|
|
177
|
+
text: o,
|
|
178
|
+
formats: c,
|
|
179
|
+
isMark: !0
|
|
180
|
+
})), MarkdownFormats.cut(e.slice(i.index + i[0].length), t, n);
|
|
181
|
+
}
|
|
182
|
+
}, ge = [
|
|
183
|
+
"**",
|
|
184
|
+
"~~",
|
|
185
|
+
"*"
|
|
186
|
+
], _e = {
|
|
187
|
+
paragraph: "",
|
|
188
|
+
h1: "# ",
|
|
189
|
+
h2: "## ",
|
|
190
|
+
h3: "### ",
|
|
191
|
+
h4: "#### ",
|
|
192
|
+
h5: "##### ",
|
|
193
|
+
h6: "###### ",
|
|
194
|
+
bullet: "- ",
|
|
195
|
+
numbered: "1. "
|
|
196
|
+
}, T = /\[([^\]\n]*)\]\(([^)\s]*)\)/g, E = /\*\*(?=\S)([^\n]*?\S)\*\*/g, D = /~~(?=\S)([^\n]*?\S)~~/g, O = /(?<!\*)\*(?=[^\s*])([^\n*]*?[^\s*])\*/g, ve = [
|
|
197
|
+
[
|
|
198
|
+
new RegExp(T.source, "g"),
|
|
199
|
+
"link",
|
|
200
|
+
""
|
|
201
|
+
],
|
|
202
|
+
[
|
|
203
|
+
new RegExp(E.source, "g"),
|
|
204
|
+
"bold",
|
|
205
|
+
"**"
|
|
206
|
+
],
|
|
207
|
+
[
|
|
208
|
+
new RegExp(D.source, "g"),
|
|
209
|
+
"strikethrough",
|
|
210
|
+
"~~"
|
|
211
|
+
],
|
|
212
|
+
[
|
|
213
|
+
new RegExp(O.source, "g"),
|
|
214
|
+
"italic",
|
|
215
|
+
"*"
|
|
216
|
+
]
|
|
217
|
+
], k = {
|
|
218
|
+
strong: "**",
|
|
219
|
+
b: "**",
|
|
220
|
+
em: "*",
|
|
221
|
+
i: "*",
|
|
222
|
+
del: "~~",
|
|
223
|
+
s: "~~",
|
|
224
|
+
strike: "~~"
|
|
225
|
+
}, A = /[\p{L}\p{N}_'’-]/u, ye = 3, be = 1, xe = class MarkdownBox {
|
|
226
|
+
props;
|
|
227
|
+
field;
|
|
228
|
+
bar;
|
|
229
|
+
view;
|
|
230
|
+
shape;
|
|
231
|
+
unformattable;
|
|
232
|
+
buttons = /* @__PURE__ */ new Map();
|
|
233
|
+
shapes;
|
|
234
|
+
address;
|
|
235
|
+
linkFor;
|
|
236
|
+
constructor(e) {
|
|
237
|
+
this.props = e;
|
|
238
|
+
let { document: t } = e;
|
|
239
|
+
this.shape = e.shape;
|
|
240
|
+
let n = !!e.renderInline && MarkdownBox.comesBack(e.raw, e.renderInline, t);
|
|
241
|
+
this.unformattable = n ? void 0 : e.texts(e.renderInline ? "formattedOff" : "noFormattedView"), this.view = e.view === "formatted" && !this.unformattable ? "formatted" : "marks", this.field = t.createElement("span"), this.field.setAttribute("role", "textbox"), this.field.setAttribute("aria-label", e.label), this.field.setAttribute("part", e.parts.box), e.kind === "paragraph" && this.field.setAttribute("aria-multiline", "true"), this.field.addEventListener("keydown", this.onKey), this.field.addEventListener("input", this.onInput), this.field.addEventListener("paste", this.onPaste), this.field.addEventListener("focusout", e.onLeave), this.field.ownerDocument.addEventListener("selectionchange", this.onSelectionChange), this.shapes = t.createElement("ui-select"), this.address = t.createElement("input"), this.bar = this.drawBar(), this.draw(e.raw);
|
|
242
|
+
}
|
|
243
|
+
get raw() {
|
|
244
|
+
return this.view === "formatted" ? w.markdownOf(this.field).replace(/\n$/, "") : (this.field.textContent ?? "").replace(/\n$/, "");
|
|
245
|
+
}
|
|
246
|
+
set raw(e) {
|
|
247
|
+
this.draw(e), this.caret = e.length;
|
|
248
|
+
}
|
|
249
|
+
get selection() {
|
|
250
|
+
let e = MarkdownBox.rangeIn(this.field);
|
|
251
|
+
if (e) return {
|
|
252
|
+
start: this.offsetOf(e.startContainer, e.startOffset),
|
|
253
|
+
end: this.offsetOf(e.endContainer, e.endOffset)
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
set caret(e) {
|
|
257
|
+
this.select(e, e);
|
|
258
|
+
}
|
|
259
|
+
focus(e) {
|
|
260
|
+
this.field.focus(), this.caret = e ?? (this.field.textContent ?? "").length, this.showPressed();
|
|
261
|
+
}
|
|
262
|
+
remove() {
|
|
263
|
+
this.field.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange), this.field.removeEventListener("focusout", this.props.onLeave), this.bar.remove();
|
|
264
|
+
}
|
|
265
|
+
act(e) {
|
|
266
|
+
if (e === "view") return this.switchView();
|
|
267
|
+
if (e === "link") return this.askAddress();
|
|
268
|
+
if (e === "bullet" || e === "numbered") return this.reshape(this.shape === e ? "paragraph" : e);
|
|
269
|
+
if (this.view === "formatted") this.field.ownerDocument.execCommand(De[e]), e === "clear" && this.field.ownerDocument.execCommand("unlink");
|
|
270
|
+
else {
|
|
271
|
+
let t = this.edit();
|
|
272
|
+
this.apply(e === "clear" ? w.clear(t) : w.toggle(t, Ee[e]));
|
|
273
|
+
}
|
|
274
|
+
this.changed();
|
|
275
|
+
}
|
|
276
|
+
reshape(e) {
|
|
277
|
+
this.shape && (this.shape = e, this.shapes.setAttribute("value", e.startsWith("h") ? e : "paragraph"), this.changed());
|
|
278
|
+
}
|
|
279
|
+
switchView() {
|
|
280
|
+
if (this.unformattable) return;
|
|
281
|
+
let e = this.raw;
|
|
282
|
+
this.view = this.view === "marks" ? "formatted" : "marks", this.draw(e), this.field.focus(), this.caret = (this.field.textContent ?? "").length, this.props.onView(this.view), this.showPressed();
|
|
283
|
+
}
|
|
284
|
+
askAddress() {
|
|
285
|
+
let e = this.edit();
|
|
286
|
+
this.linkFor = e;
|
|
287
|
+
let t = this.view === "marks" ? w.linkAt(e.text, e.start) : void 0, n = this.view === "formatted" ? MarkdownBox.rangeIn(this.field)?.startContainer.parentElement?.closest("a") : void 0;
|
|
288
|
+
this.address.value = t?.address ?? n?.getAttribute("href") ?? "", this.address.hidden = !1, this.address.focus(), this.address.select();
|
|
289
|
+
}
|
|
290
|
+
onAddressKey = (e) => {
|
|
291
|
+
if (e.stopPropagation(), e.key !== "Enter" && e.key !== "Escape") return;
|
|
292
|
+
e.preventDefault();
|
|
293
|
+
let t = this.linkFor;
|
|
294
|
+
if (this.linkFor = void 0, this.address.hidden = !0, this.field.focus(), !t) return;
|
|
295
|
+
if (e.key === "Escape") return this.select(t.start, t.end);
|
|
296
|
+
let n = this.address.value.trim();
|
|
297
|
+
this.view === "formatted" ? (this.select(t.start, t.end), this.field.ownerDocument.execCommand(n ? "createLink" : "unlink", !1, n)) : this.apply(w.link(t, n)), this.changed();
|
|
298
|
+
};
|
|
299
|
+
onKey = (e) => {
|
|
300
|
+
let t = (e.metaKey || e.ctrlKey) && !e.altKey ? ke[`${e.shiftKey ? "shift+" : ""}${e.code}`] : void 0;
|
|
301
|
+
if (t) return e.preventDefault(), e.stopPropagation(), this.act(t);
|
|
302
|
+
if (e.key === "Enter" && e.shiftKey && this.props.kind === "paragraph") {
|
|
303
|
+
e.preventDefault(), e.stopPropagation(), this.field.ownerDocument.execCommand("insertText", !1, "\n");
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
this.props.onKey(e);
|
|
307
|
+
};
|
|
308
|
+
onInput = (e) => {
|
|
309
|
+
if (this.view === "marks" && !e.isComposing) {
|
|
310
|
+
let e = this.selection;
|
|
311
|
+
this.draw(this.field.textContent ?? ""), e && this.select(e.start, e.end);
|
|
312
|
+
}
|
|
313
|
+
this.props.onInput(), this.showPressed();
|
|
314
|
+
};
|
|
315
|
+
onPaste = (e) => {
|
|
316
|
+
e.preventDefault();
|
|
317
|
+
let t = e.clipboardData?.getData("text/plain") ?? "";
|
|
318
|
+
this.field.ownerDocument.execCommand("insertText", !1, t);
|
|
319
|
+
};
|
|
320
|
+
onSelectionChange = () => {
|
|
321
|
+
this.field.isConnected && this.showPressed();
|
|
322
|
+
};
|
|
323
|
+
changed() {
|
|
324
|
+
this.props.onInput(), this.showPressed();
|
|
325
|
+
}
|
|
326
|
+
draw(e) {
|
|
327
|
+
let t = this.field.ownerDocument;
|
|
328
|
+
if (this.field.contentEditable = this.view === "marks" ? "plaintext-only" : "true", this.field.dataset.view = this.view, this.view === "formatted") {
|
|
329
|
+
this.field.innerHTML = this.props.renderInline(e);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
this.field.replaceChildren(...w.runsOf(e).map((e) => {
|
|
333
|
+
if (!e.isMark && !e.formats.length) return t.createTextNode(e.text);
|
|
334
|
+
let n = t.createElement("span");
|
|
335
|
+
return n.className = [e.isMark ? "md-mark" : "", ...e.formats.map((e) => `md-${e}`)].join(" ").trim(), n.textContent = e.text, n;
|
|
336
|
+
}));
|
|
337
|
+
}
|
|
338
|
+
drawBar() {
|
|
339
|
+
let { document: e, texts: t, parts: n } = this.props, r = e.createElement("span");
|
|
340
|
+
r.setAttribute("part", n.bar), r.setAttribute("role", "toolbar"), r.popover = "manual", r.setAttribute("aria-label", t("formatBar")), r.addEventListener("mousedown", (e) => {
|
|
341
|
+
!e.composedPath().includes(this.shapes) && e.target !== this.address && e.preventDefault();
|
|
342
|
+
});
|
|
343
|
+
for (let n of Se) {
|
|
344
|
+
if (n === "shape") {
|
|
345
|
+
this.shape && r.append(this.drawShapes());
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if ((n === "bullet" || n === "numbered") && !this.shape) continue;
|
|
349
|
+
let i = e.createElement("ui-button");
|
|
350
|
+
i.setAttribute("appearance", "basic"), i.setAttribute("size", "small"), i.setAttribute("icon", Te[n]);
|
|
351
|
+
let a = n === "view" && this.unformattable ? this.unformattable : t(n);
|
|
352
|
+
i.setAttribute("title", a), i.setAttribute("aria-label", a), n === "view" && this.unformattable && i.setAttribute("disabled", ""), i.addEventListener("click", () => this.act(n)), this.buttons.set(n, i), r.append(i);
|
|
353
|
+
}
|
|
354
|
+
return this.address.type = "url", this.address.hidden = !0, this.address.placeholder = t("linkAddress"), this.address.setAttribute("aria-label", t("linkAddress")), this.address.addEventListener("keydown", this.onAddressKey), r.append(this.address), r;
|
|
355
|
+
}
|
|
356
|
+
drawShapes() {
|
|
357
|
+
let { document: e, texts: t } = this.props;
|
|
358
|
+
for (let n of Ce) {
|
|
359
|
+
let r = e.createElement("ui-item");
|
|
360
|
+
r.setAttribute("value", n), r.textContent = t(we[n]), this.shapes.append(r);
|
|
361
|
+
}
|
|
362
|
+
return this.shapes.setAttribute("size", "small"), this.shapes.style.setProperty("--ui-select-picker-background", "var(--_ui-markdown-bar-background)"), this.shapes.setAttribute("value", this.shape?.startsWith("h") ? this.shape : "paragraph"), this.shapes.setAttribute("aria-label", t("shape")), this.shapes.title = t("shape"), this.shapes.addEventListener("ui-changed", (e) => {
|
|
363
|
+
let { value: t } = e.detail;
|
|
364
|
+
t !== this.shape && (this.reshape(t), this.field.focus());
|
|
365
|
+
}), this.shapes;
|
|
366
|
+
}
|
|
367
|
+
showPressed() {
|
|
368
|
+
let e = this.formatsNow();
|
|
369
|
+
for (let [t, n] of this.buttons) {
|
|
370
|
+
let r = t === "view" ? this.view === "formatted" : t === "bullet" || t === "numbered" ? this.shape === t : e.has(t);
|
|
371
|
+
n.toggleAttribute("active", r);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
formatsNow() {
|
|
375
|
+
if (this.view === "marks") {
|
|
376
|
+
let e = this.selection;
|
|
377
|
+
return e ? w.formatsAt(this.field.textContent ?? "", e.start) : /* @__PURE__ */ new Set();
|
|
378
|
+
}
|
|
379
|
+
let e = this.field.ownerDocument, t = /* @__PURE__ */ new Set();
|
|
380
|
+
for (let [n, r] of Object.entries(Oe)) r && e.queryCommandState(r) && t.add(n);
|
|
381
|
+
let n = MarkdownBox.rangeIn(this.field)?.startContainer;
|
|
382
|
+
return (n?.nodeType === 1 ? n : n?.parentElement)?.closest("a") && t.add("link"), t;
|
|
383
|
+
}
|
|
384
|
+
edit() {
|
|
385
|
+
let e = this.field.textContent ?? "";
|
|
386
|
+
return {
|
|
387
|
+
text: e,
|
|
388
|
+
...this.selection ?? {
|
|
389
|
+
start: e.length,
|
|
390
|
+
end: e.length
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
apply(e) {
|
|
395
|
+
this.draw(e.text), this.select(e.start, e.end);
|
|
396
|
+
}
|
|
397
|
+
select(e, t) {
|
|
398
|
+
let [n, r] = this.pointAt(e), [i, a] = this.pointAt(t);
|
|
399
|
+
this.field.ownerDocument.getSelection()?.setBaseAndExtent(n, r, i, a);
|
|
400
|
+
}
|
|
401
|
+
pointAt(e) {
|
|
402
|
+
let t = this.field.ownerDocument.createTreeWalker(this.field, NodeFilter.SHOW_TEXT), n = e, r;
|
|
403
|
+
for (let e = t.nextNode(); e; e = t.nextNode()) {
|
|
404
|
+
if (n <= e.data.length) return [e, n];
|
|
405
|
+
n -= e.data.length, r = e;
|
|
406
|
+
}
|
|
407
|
+
return r ? [r, r.data.length] : [this.field, this.field.childNodes.length];
|
|
408
|
+
}
|
|
409
|
+
offsetOf(e, t) {
|
|
410
|
+
let n = this.field.ownerDocument.createRange();
|
|
411
|
+
return n.setStart(this.field, 0), n.setEnd(e, t), n.toString().length;
|
|
412
|
+
}
|
|
413
|
+
static rangeIn(e) {
|
|
414
|
+
let t = e.getRootNode().getSelection?.() ?? e.ownerDocument.getSelection();
|
|
415
|
+
if (!t?.rangeCount) return;
|
|
416
|
+
let n = t.getRangeAt(0);
|
|
417
|
+
return e.contains(n.startContainer) ? n : void 0;
|
|
418
|
+
}
|
|
419
|
+
static comesBack(e, t, n) {
|
|
420
|
+
let r = n.createElement("span");
|
|
421
|
+
return r.innerHTML = t(e), w.markdownOf(r) === e;
|
|
422
|
+
}
|
|
423
|
+
}, Se = [
|
|
424
|
+
"bold",
|
|
425
|
+
"italic",
|
|
426
|
+
"strikethrough",
|
|
427
|
+
"link",
|
|
428
|
+
"shape",
|
|
429
|
+
"bullet",
|
|
430
|
+
"numbered",
|
|
431
|
+
"clear",
|
|
432
|
+
"view"
|
|
433
|
+
], Ce = [
|
|
434
|
+
"paragraph",
|
|
435
|
+
"h2",
|
|
436
|
+
"h3",
|
|
437
|
+
"h4"
|
|
438
|
+
], we = {
|
|
439
|
+
paragraph: "shapeParagraph",
|
|
440
|
+
h2: "shapeH2",
|
|
441
|
+
h3: "shapeH3",
|
|
442
|
+
h4: "shapeH4"
|
|
443
|
+
}, Te = {
|
|
444
|
+
bold: "bold",
|
|
445
|
+
italic: "italic",
|
|
446
|
+
strikethrough: "strikethrough",
|
|
447
|
+
link: "link",
|
|
448
|
+
bullet: "list ul",
|
|
449
|
+
numbered: "list ol",
|
|
450
|
+
clear: "eraser",
|
|
451
|
+
view: "eye"
|
|
452
|
+
}, Ee = {
|
|
453
|
+
bold: "**",
|
|
454
|
+
italic: "*",
|
|
455
|
+
strikethrough: "~~"
|
|
456
|
+
}, De = {
|
|
457
|
+
bold: "bold",
|
|
458
|
+
italic: "italic",
|
|
459
|
+
strikethrough: "strikeThrough",
|
|
460
|
+
clear: "removeFormat"
|
|
461
|
+
}, Oe = {
|
|
462
|
+
bold: "bold",
|
|
463
|
+
italic: "italic",
|
|
464
|
+
strikethrough: "strikeThrough",
|
|
465
|
+
link: ""
|
|
466
|
+
}, ke = {
|
|
467
|
+
KeyB: "bold",
|
|
468
|
+
KeyI: "italic",
|
|
469
|
+
KeyK: "link",
|
|
470
|
+
"shift+KeyX": "strikethrough"
|
|
471
|
+
}, j, Ae = [re], M;
|
|
472
|
+
j = [re];
|
|
473
|
+
var N = class _MarkdownRenderer {
|
|
12
474
|
static load() {
|
|
13
475
|
return _MarkdownRenderer.engineLoader().then((e) => e.MarkdownEngine.instance);
|
|
14
476
|
}
|
|
@@ -16,9 +478,119 @@ var O = class _MarkdownRenderer {
|
|
|
16
478
|
return _MarkdownRenderer.sanitizerLoader().then((e) => e.MarkdownSanitizer.instance);
|
|
17
479
|
}
|
|
18
480
|
};
|
|
19
|
-
|
|
20
|
-
var
|
|
481
|
+
M = g(null), i(M, 9, "load", Ae, N), i(M, 9, "loadSanitizer", j, N), o(M, N), l(M, 3, N), e(N, "MarkdownRenderer"), n(N, "engineLoader", /* @__PURE__ */ e(() => import("./MarkdownEngine-CW1WGqNp.js"), "engineLoader")), n(N, "sanitizerLoader", /* @__PURE__ */ e(() => import("./MarkdownSanitizer-zTnnbrLe.js"), "sanitizerLoader"));
|
|
482
|
+
var P = N, F = class MarkdownSource {
|
|
483
|
+
static placesOf(e, t) {
|
|
484
|
+
let n = [], add = (e, t, r, i) => {
|
|
485
|
+
e[I] = n.length, n.push({
|
|
486
|
+
kind: t,
|
|
487
|
+
start: r,
|
|
488
|
+
end: i
|
|
489
|
+
});
|
|
490
|
+
}, r = 0;
|
|
491
|
+
for (let n of e) {
|
|
492
|
+
let e = t.startsWith(n.raw, r) ? r : t.indexOf(n.raw, r);
|
|
493
|
+
if (e < 0) break;
|
|
494
|
+
MarkdownSource.visit(n, t, e, add), r = e + n.raw.length;
|
|
495
|
+
}
|
|
496
|
+
return n;
|
|
497
|
+
}
|
|
498
|
+
static placeOf(e) {
|
|
499
|
+
return e[I];
|
|
500
|
+
}
|
|
501
|
+
static replace(e, t, n) {
|
|
502
|
+
let r = t.kind === "paragraph" ? n.replace(/\s+$/, "") : n.replace(/\s*\n\s*/g, " ").trim(), i = t.kind === "cell" ? r.replace(Pe, "\\|") : r;
|
|
503
|
+
return e.slice(0, t.start) + i + e.slice(t.end);
|
|
504
|
+
}
|
|
505
|
+
static visit(e, t, n, r) {
|
|
506
|
+
e.type === "paragraph" ? MarkdownSource.paragraph(e, n, r) : e.type === "heading" ? MarkdownSource.heading(e, n, r) : e.type === "table" ? MarkdownSource.table(e, n, r) : e.type === "list" && MarkdownSource.list(e, t, n, n + e.raw.length, r);
|
|
507
|
+
}
|
|
508
|
+
static paragraph(e, t, n) {
|
|
509
|
+
let { from: r, to: i } = MarkdownSource.trimmed(e.raw);
|
|
510
|
+
i > r && n(e, "paragraph", t + r, t + i);
|
|
511
|
+
}
|
|
512
|
+
static heading(e, t, n) {
|
|
513
|
+
let r = je.exec(e.raw.split("\n")[0]);
|
|
514
|
+
if (r) {
|
|
515
|
+
let i = r[2];
|
|
516
|
+
i && n(e, "heading", t + r[1].length, t + r[1].length + i.length);
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
let i = Me.exec(e.raw);
|
|
520
|
+
if (!i) return;
|
|
521
|
+
let { from: a, to: o } = MarkdownSource.trimmed(e.raw.slice(0, i.index));
|
|
522
|
+
o > a && n(e, "heading", t + a, t + o);
|
|
523
|
+
}
|
|
524
|
+
static table(e, t, n) {
|
|
525
|
+
let r = MarkdownSource.linesOf(e.raw), i = [
|
|
526
|
+
e.header,
|
|
527
|
+
null,
|
|
528
|
+
...e.rows
|
|
529
|
+
];
|
|
530
|
+
for (let [e, a] of r.entries()) {
|
|
531
|
+
let r = i[e];
|
|
532
|
+
if (r) for (let [e, i] of MarkdownSource.cellsOf(a.text).entries()) {
|
|
533
|
+
let o = r[e];
|
|
534
|
+
o && n(o, "cell", t + a.start + i.from, t + a.start + i.to);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
static list(e, t, n, r, i) {
|
|
539
|
+
let a = n;
|
|
540
|
+
for (let n of e.items) {
|
|
541
|
+
let e = n.raw.split("\n")[0].trim(), o = t.indexOf(e, a);
|
|
542
|
+
if (o < 0 || o >= r) return;
|
|
543
|
+
a = o + e.length;
|
|
544
|
+
let [s, ...c] = n.tokens.filter((e) => e.type !== "space" && e.type !== "checkbox"), l = Ne.exec(e), u = !!s && !s.raw.trim().includes("\n"), d = c.every((e) => e.type === "list");
|
|
545
|
+
if (l && u && d && (s.type === "text" || s.type === "paragraph")) {
|
|
546
|
+
let t = e.slice(l[0].length).replace(/\s+$/, "");
|
|
547
|
+
t && i(n, "item", o + l[0].length, o + l[0].length + t.length);
|
|
548
|
+
}
|
|
549
|
+
for (let e of c) {
|
|
550
|
+
if (e.type !== "list") break;
|
|
551
|
+
MarkdownSource.list(e, t, a, r, i);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
static trimmed(e) {
|
|
556
|
+
return {
|
|
557
|
+
from: e.length - e.trimStart().length,
|
|
558
|
+
to: e.trimEnd().length
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
static linesOf(e) {
|
|
562
|
+
let t = [], n = 0;
|
|
563
|
+
for (let r of e.split("\n")) r.trim() && t.push({
|
|
564
|
+
text: r,
|
|
565
|
+
start: n
|
|
566
|
+
}), n += r.length + 1;
|
|
567
|
+
return t;
|
|
568
|
+
}
|
|
569
|
+
static cellsOf(e) {
|
|
570
|
+
let t = [];
|
|
571
|
+
for (let n = 0; n < e.length; n++) e[n] === "\\" ? n++ : e[n] === "|" && t.push(n);
|
|
572
|
+
let n = [
|
|
573
|
+
-1,
|
|
574
|
+
...t,
|
|
575
|
+
e.length
|
|
576
|
+
], r = [];
|
|
577
|
+
for (let i = 0; i < n.length - 1; i++) {
|
|
578
|
+
let a = n[i] + 1, o = n[i + 1], s = e.slice(a, o);
|
|
579
|
+
if ((i === 0 || i === n.length - 2) && !s.trim() && t.length) continue;
|
|
580
|
+
let c = s.length - s.trimStart().length, l = s.trim().length;
|
|
581
|
+
r.push(l ? {
|
|
582
|
+
from: a + c,
|
|
583
|
+
to: a + c + l
|
|
584
|
+
} : {
|
|
585
|
+
from: a + Math.min(1, s.length),
|
|
586
|
+
to: a + Math.min(1, s.length)
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
return r;
|
|
590
|
+
}
|
|
591
|
+
}, I = "uiPlace", je = /^( {0,3}#{1,6}(?:[ \t]+|$))(.*?)(?:[ \t]+#+)?[ \t]*$/, Me = /\n {0,3}(?:=+|-+)[ \t]*\n*$/, Ne = /^(?:[*+-]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/, Pe = /(?<!\\)\|/g, Fe = {
|
|
21
592
|
tag: "ui-markdown",
|
|
593
|
+
icon: "markdown",
|
|
22
594
|
topics: [
|
|
23
595
|
"text",
|
|
24
596
|
"typography",
|
|
@@ -36,7 +608,7 @@ var k = O, A = {
|
|
|
36
608
|
noun: "markdown",
|
|
37
609
|
description: "Markdown renders GitHub-flavoured markdown -- tables, task lists, code blocks -- from the element's own text or a file on this site.",
|
|
38
610
|
attributes: [
|
|
39
|
-
...
|
|
611
|
+
...ie,
|
|
40
612
|
{
|
|
41
613
|
name: "size",
|
|
42
614
|
group: "appearance",
|
|
@@ -66,8 +638,9 @@ var k = O, A = {
|
|
|
66
638
|
{
|
|
67
639
|
name: "editable",
|
|
68
640
|
group: "behaviour",
|
|
69
|
-
kind: "
|
|
70
|
-
|
|
641
|
+
kind: "keyOrValueAndKey",
|
|
642
|
+
values: ["tabs"],
|
|
643
|
+
description: "Edit the text where it's drawn: ⌥-click (Alt-click) a paragraph, a heading, a list item or a table cell, and it becomes a box holding its markdown; Enter or a click away keeps it, Tab moves to the next, Escape puts it back, and 5 seconds without typing keeps it too. Holding ⌥ outlines what can be edited. `editable=\"tabs\"`: Write / Preview tabs instead, a text box for the whole markdown and its preview. Each edit is a `ui-changed`, and `save()` writes it: in place, each edit is saved as it's kept."
|
|
71
644
|
},
|
|
72
645
|
{
|
|
73
646
|
name: "sanitized",
|
|
@@ -76,53 +649,181 @@ var k = O, A = {
|
|
|
76
649
|
description: "Sanitize the rendered markup with DOMPurify (its own lazy chunk, loaded only then): no scripts, event handlers or `javascript:` links. Set it for text you didn't write; without it, raw HTML is kept as written."
|
|
77
650
|
}
|
|
78
651
|
],
|
|
79
|
-
events: [...
|
|
652
|
+
events: [...ee, {
|
|
80
653
|
name: "ui-drawn",
|
|
81
654
|
detail: "{ headings: { level: number, text: string, id: string }[] }",
|
|
82
655
|
description: "Rendered; `headings` (also the `headings` property) lists its headings, e.g. for a table of contents."
|
|
83
656
|
}],
|
|
84
657
|
slots: [],
|
|
85
658
|
parts: [
|
|
86
|
-
...
|
|
659
|
+
...se,
|
|
87
660
|
{
|
|
88
661
|
name: "body",
|
|
89
662
|
description: "The `<article>` holding the rendered markdown."
|
|
90
663
|
},
|
|
91
664
|
{
|
|
92
665
|
name: "tabs",
|
|
93
|
-
description: "`editable`: the Write / Preview tab list."
|
|
666
|
+
description: "`editable=\"tabs\"`: the Write / Preview tab list."
|
|
94
667
|
},
|
|
95
668
|
{
|
|
96
669
|
name: "tab",
|
|
97
|
-
description: "`editable`: each tab button."
|
|
670
|
+
description: "`editable=\"tabs\"`: each tab button."
|
|
98
671
|
},
|
|
99
672
|
{
|
|
100
673
|
name: "editor",
|
|
101
|
-
description: "`editable`: the `<textarea>` holding the markdown."
|
|
674
|
+
description: "`editable=\"tabs\"`: the `<textarea>` holding the markdown."
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
name: "edit-bar",
|
|
678
|
+
description: "`editable`: the formatting bar above the open box."
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
name: "edit-box",
|
|
682
|
+
description: "`editable`: the box a piece becomes while it's edited in place, holding its markdown."
|
|
102
683
|
}
|
|
103
684
|
],
|
|
104
|
-
states: [
|
|
105
|
-
texts: [
|
|
685
|
+
states: [
|
|
106
686
|
...ne,
|
|
687
|
+
{
|
|
688
|
+
name: "placing",
|
|
689
|
+
description: "`editable`: ⌥ is held, so what can be edited in place is outlined."
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
name: "editing",
|
|
693
|
+
description: "`editable`: a piece is being edited in place."
|
|
694
|
+
}
|
|
695
|
+
],
|
|
696
|
+
texts: [
|
|
697
|
+
...te,
|
|
107
698
|
{
|
|
108
699
|
key: "write",
|
|
109
700
|
text: "Write",
|
|
110
|
-
description: "`editable`: the editing tab."
|
|
701
|
+
description: "`editable=\"tabs\"`: the editing tab."
|
|
111
702
|
},
|
|
112
703
|
{
|
|
113
704
|
key: "preview",
|
|
114
705
|
text: "Preview",
|
|
115
|
-
description: "`editable`: the preview tab."
|
|
706
|
+
description: "`editable=\"tabs\"`: the preview tab."
|
|
116
707
|
},
|
|
117
708
|
{
|
|
118
709
|
key: "editor",
|
|
119
710
|
text: "Markdown",
|
|
120
|
-
description: "`editable`: accessible name of the text box."
|
|
711
|
+
description: "`editable=\"tabs\"`: accessible name of the text box."
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
key: "editBox",
|
|
715
|
+
text: "Edit {kind}",
|
|
716
|
+
description: "`editable`: accessible name of the box a piece becomes."
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
key: "paragraph",
|
|
720
|
+
text: "paragraph",
|
|
721
|
+
description: "`editable`: a paragraph, in `editBox`."
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
key: "heading",
|
|
725
|
+
text: "heading",
|
|
726
|
+
description: "`editable`: a heading, in `editBox`."
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
key: "item",
|
|
730
|
+
text: "list item",
|
|
731
|
+
description: "`editable`: a list item, in `editBox`."
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
key: "cell",
|
|
735
|
+
text: "table cell",
|
|
736
|
+
description: "`editable`: a table cell, in `editBox`."
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
key: "formatBar",
|
|
740
|
+
text: "Formatting",
|
|
741
|
+
description: "`editable`: accessible name of the formatting bar."
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
key: "bold",
|
|
745
|
+
text: "Bold (⌘B)",
|
|
746
|
+
description: "`editable`: the bar's bold button."
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
key: "italic",
|
|
750
|
+
text: "Italic (⌘I)",
|
|
751
|
+
description: "`editable`: the bar's italic button."
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
key: "strikethrough",
|
|
755
|
+
text: "Strikethrough (⌘⇧X)",
|
|
756
|
+
description: "`editable`: the bar's strikethrough button."
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
key: "link",
|
|
760
|
+
text: "Link (⌘K)",
|
|
761
|
+
description: "`editable`: the bar's link button."
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
key: "linkAddress",
|
|
765
|
+
text: "Link address: Enter puts it on, empty takes it off",
|
|
766
|
+
description: "`editable`: the link's address field."
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
key: "shape",
|
|
770
|
+
text: "Paragraph or heading",
|
|
771
|
+
description: "`editable`: the bar's shape menu."
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
key: "shapeParagraph",
|
|
775
|
+
text: "Paragraph",
|
|
776
|
+
description: "`editable`: the shape menu's paragraph."
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
key: "shapeH2",
|
|
780
|
+
text: "Heading 2",
|
|
781
|
+
description: "`editable`: the shape menu's `##`."
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
key: "shapeH3",
|
|
785
|
+
text: "Heading 3",
|
|
786
|
+
description: "`editable`: the shape menu's `###`."
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
key: "shapeH4",
|
|
790
|
+
text: "Heading 4",
|
|
791
|
+
description: "`editable`: the shape menu's `####`."
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
key: "bullet",
|
|
795
|
+
text: "Bulleted list",
|
|
796
|
+
description: "`editable`: the bar's bulleted list button."
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
key: "numbered",
|
|
800
|
+
text: "Numbered list",
|
|
801
|
+
description: "`editable`: the bar's numbered list button."
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
key: "clear",
|
|
805
|
+
text: "Clear formatting",
|
|
806
|
+
description: "`editable`: the bar's clear formatting button."
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
key: "view",
|
|
810
|
+
text: "Show it formatted, without its marks",
|
|
811
|
+
description: "`editable`: the bar's view switch."
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
key: "formattedOff",
|
|
815
|
+
text: "This text can't show formatted: written back, it wouldn't be the same",
|
|
816
|
+
description: "`editable`: the switch's tooltip, for a piece whose markdown wouldn't come back exactly."
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
key: "noFormattedView",
|
|
820
|
+
text: "This markdown's engine has no formatted view",
|
|
821
|
+
description: "`editable`: the switch's tooltip, for a subclass's engine without `renderInline()`."
|
|
121
822
|
}
|
|
122
823
|
]
|
|
123
|
-
},
|
|
824
|
+
}, Ie = "@layer ui.components.markdown.types{:host{--_ui-markdown-editor-border:var(--ui-markdown-editor-border,var(--ui-border-color));--_ui-markdown-editor-background:var(--ui-markdown-editor-background,var(--ui-surface));--_ui-markdown-color:var(--ui-markdown-color,var(--ui-text-color));--_ui-markdown-muted:var(--ui-markdown-muted,var(--ui-text-muted));--_ui-markdown-radius:var(--ui-markdown-radius,var(--ui-radius));--_ui-markdown-measure:var(--ui-markdown-measure,none);display:block}.ui.markdown{--_ui-markdown-color:var(--ui-markdown-color,var(--ui-text-color));--_ui-markdown-muted:var(--ui-markdown-muted,var(--ui-text-muted));--_ui-markdown-line-height:var(--ui-markdown-line-height,1.6);--_ui-markdown-heading-color:var(--ui-markdown-heading-color,var(--ui-text-color));--_ui-markdown-heading-font-family:var(--ui-markdown-heading-font-family,initial);--_ui-markdown-heading-weight:var(--ui-markdown-heading-weight,600);--_ui-markdown-heading-line-height:var(--ui-markdown-heading-line-height,1.25);--_ui-markdown-heading-margin:var(--ui-markdown-heading-margin,1.5em 1em);--_ui-markdown-heading-rule:var(--ui-markdown-heading-rule,1px solid var(--_ui-markdown-rule-color));--_ui-markdown-heading-rule-gap:var(--ui-markdown-heading-rule-gap,.3em);--_ui-markdown-heading-scroll-margin:var(--ui-markdown-heading-scroll-margin,0);--_ui-markdown-h1-size:var(--ui-markdown-h1-size,2em);--_ui-markdown-h2-size:var(--ui-markdown-h2-size,1.5em);--_ui-markdown-h3-size:var(--ui-markdown-h3-size,1.25em);--_ui-markdown-strong-color:var(--ui-markdown-strong-color,initial);--_ui-markdown-code-color:var(--ui-markdown-code-color,initial);--_ui-markdown-link-color:var(--ui-markdown-link-color,var(--ui-link));--_ui-markdown-rule-color:var(--ui-markdown-rule-color,var(--ui-border-color));--_ui-markdown-hr-height:var(--ui-markdown-hr-height,.25em);--_ui-markdown-table-border:var(--ui-markdown-table-border,var(--ui-border-color));--_ui-markdown-stripe:var(--ui-markdown-stripe,var(--ui-surface-muted));--_ui-markdown-blockquote-color:var(--ui-markdown-blockquote-color,var(--ui-text-muted));--_ui-markdown-blockquote-border:var(--ui-markdown-blockquote-border,var(--ui-border-color-strong));--_ui-markdown-code-background:var(--ui-markdown-code-background,var(--ui-surface-strong));--_ui-markdown-radius:var(--ui-markdown-radius,var(--ui-radius));--_ui-markdown-measure:var(--ui-markdown-measure,none);color:var(--_ui-markdown-color);font-size:calc(var(--ui-font-size) * var(--ui-scale,1));line-height:var(--_ui-markdown-line-height);overflow-wrap:break-word;display:block}}@layer ui.components.markdown.content{.ui.markdown :is(p,ul,ol,blockquote,table,pre,ui-code,details,hr){margin-block:0 1em}.ui.markdown>:is(p,ul,ol,blockquote){max-width:var(--_ui-markdown-measure)}.ui.markdown :is(h1,h2,h3,h4,h5,h6){margin-block:var(--_ui-markdown-heading-margin);color:var(--_ui-markdown-heading-color);font-family:var(--_ui-markdown-heading-font-family,inherit);font-weight:var(--_ui-markdown-heading-weight);line-height:var(--_ui-markdown-heading-line-height);scroll-margin-top:var(--_ui-markdown-heading-scroll-margin)}.ui.markdown :is(h1,h2){border-block-end:var(--_ui-markdown-heading-rule);padding-block-end:var(--_ui-markdown-heading-rule-gap)}.ui.markdown h1{font-size:var(--_ui-markdown-h1-size)}.ui.markdown h2{font-size:var(--_ui-markdown-h2-size)}.ui.markdown h3{font-size:var(--_ui-markdown-h3-size)}.ui.markdown h4{font-size:1em}.ui.markdown h5{font-size:.875em}.ui.markdown h6{color:var(--_ui-markdown-muted);font-size:.85em}.ui.markdown a{color:var(--_ui-markdown-link-color);text-underline-offset:.15em;text-decoration:underline}.ui.markdown :is(ul,ol){padding-inline-start:2em}.ui.markdown :is(ul,ol) :is(ul,ol){margin-block-end:0}.ui.markdown li+li{margin-block-start:.25em}.ui.markdown li:has(>input[type=checkbox]){list-style:none}.ui.markdown li>input[type=checkbox]{vertical-align:middle;margin-inline:-1.4em .4em}.ui.markdown blockquote{border-inline-start:.25em solid var(--_ui-markdown-blockquote-border);color:var(--_ui-markdown-blockquote-color);margin-inline:0;padding:0 1em}.ui.markdown hr{height:var(--_ui-markdown-hr-height);background:var(--_ui-markdown-rule-color);border:0;margin-block:1.5em}.ui.markdown table:not(ui-table>table){border-collapse:collapse;width:max-content;max-width:100%;display:block;overflow:auto}.ui.markdown :is(th,td):not(ui-table *){border:1px solid var(--_ui-markdown-table-border);padding:.4em .8em}.ui.markdown th:not(ui-table *){font-weight:600}.ui.markdown tbody tr:nth-child(2n):not(ui-table *){background:var(--_ui-markdown-stripe)}.ui.markdown :is(strong,b){color:var(--_ui-markdown-strong-color,inherit)}.ui.markdown :not(pre)>code{border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-code-background);color:var(--_ui-markdown-code-color,inherit);font-family:var(--ui-font-family-mono);padding:.125em .375em;font-size:.85em}.ui.markdown :not(pre)>code.short{white-space:nowrap}.ui.markdown img{max-width:100%;height:auto}.ui.markdown del{color:var(--_ui-markdown-muted)}.ui.markdown ui-code{display:block}.ui.markdown :is(ui-header,ui-list,ui-message,ui-segment,ui-table,ui-divider){margin-block:0 1em;display:block}.ui.markdown ui-header{margin-block-start:1.5em}.ui.markdown ui-list ui-list{margin-block-end:0}.ui.markdown>:first-child{margin-block-start:0}.ui.markdown>:last-child{margin-block-end:0}[part~=tabs]{border-block-end:1px solid var(--_ui-markdown-editor-border);gap:.25em;display:flex}[part~=tab]{color:var(--_ui-markdown-muted);font:inherit;cursor:pointer;background:0 0;border:1px solid #0000;border-start-start-radius:var(--_ui-markdown-radius);border-start-end-radius:var(--_ui-markdown-radius);margin-block-end:-1px;padding:.5em 1em}[part~=tab][aria-selected=true]{border-color:var(--_ui-markdown-editor-border);border-block-end-color:var(--_ui-markdown-editor-background);background:var(--_ui-markdown-editor-background);color:var(--_ui-markdown-color)}[part~=editor]{box-sizing:border-box;border:1px solid var(--_ui-markdown-editor-border);border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-editor-background);width:100%;min-height:12em;color:var(--_ui-markdown-color);font-family:var(--ui-font-family-mono);resize:vertical;padding:.75em;font-size:.875em;line-height:1.5;display:block}.ui.tabs.editable.markdown{margin-block-start:.75em}}@layer ui.components.markdown.variations;@layer ui.components.markdown.states{:host{--_ui-markdown-edit-color:var(--ui-markdown-edit-color,var(--ui-primary));--_ui-markdown-bar-background:var(--ui-markdown-bar-background,var(--ui-background))}:host(:state(placing)) .ui.editable.markdown [data-ui-place]{outline:1px dashed color-mix(in oklch, var(--_ui-markdown-edit-color) 70%, transparent);outline-offset:-1px;cursor:text}.ui.editable.markdown [part~=edit-box]{outline:2px solid var(--_ui-markdown-edit-color);outline-offset:1px;background:color-mix(in oklch, var(--_ui-markdown-edit-color) 6%, transparent);font-family:var(--ui-font-family-mono);white-space:pre-wrap;overflow-wrap:anywhere;anchor-name:--ui-markdown-box;border-radius:2px;font-size:.92em}.ui.editable.markdown [part~=edit-box][data-view=formatted]{font-family:inherit;font-size:inherit}[part~=edit-box] .md-mark{opacity:.4;font-style:normal;font-weight:400}[part~=edit-box] .md-bold{font-weight:700}[part~=edit-box] .md-italic{font-style:italic}[part~=edit-box] .md-strikethrough{text-decoration:line-through}[part~=edit-box] .md-link{color:var(--_ui-markdown-link-color,var(--ui-link))}[part~=edit-bar]{color:inherit;position-anchor:--ui-markdown-box;position-area:block-start span-inline-end;position-try-fallbacks:flip-block;z-index:10;border:1px solid var(--_ui-markdown-editor-border);border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-bar-background);backdrop-filter:blur(12px);align-items:center;gap:2px;margin-block:6px;margin-inline:0;padding:3px;font-size:.875em;display:flex;position:fixed;inset:auto;overflow:visible;box-shadow:0 2px 8px oklch(0% none none/.12)}[part~=edit-bar] input{font:inherit;border:1px solid var(--_ui-markdown-editor-border);border-radius:var(--_ui-markdown-radius);background:var(--_ui-markdown-editor-background);color:var(--_ui-markdown-color);inline-size:18em;padding:.2em .4em}}", Le = /* @__PURE__ */ C("<section><article>"), Re = /* @__PURE__ */ C("<nav>"), ze = /* @__PURE__ */ C("<button type=button>"), Be = /* @__PURE__ */ C("<section><textarea>"), L, R, z, Ve, He, Ue, We, Ge, Ke, qe, Je, Ye, Xe, Ze, Qe, $e, et, tt, nt, B, V, H, U, W, G, K = class _DOMMarkdownElement extends (R = t, L = [h], R) {
|
|
124
825
|
constructor() {
|
|
125
|
-
super(...arguments), l(
|
|
826
|
+
super(...arguments), l(z, 5, this);
|
|
126
827
|
}
|
|
127
828
|
get headings() {
|
|
128
829
|
return this.component?.headings ?? [];
|
|
@@ -131,73 +832,103 @@ var k = O, A = {
|
|
|
131
832
|
return this.component?.reveal(e) ?? !1;
|
|
132
833
|
}
|
|
133
834
|
};
|
|
134
|
-
|
|
135
|
-
var
|
|
835
|
+
z = g(R), i(z, 2, "headings", L, K), o(z, K), e(K, "DOMMarkdownElement");
|
|
836
|
+
var rt = K, q = class _UIMarkdown extends (B = r, nt = [ae], tt = [oe], et = [p("textToShow", "skipTitle", "loadStatus", "editable", "shownTab", "breaks", "headingOffset", "sanitized")], $e = [m], Qe = [h], Ze = [p("textToShow")], Xe = [m], Ye = [f("placing")], Je = [m], qe = [f("editing")], Ke = [ce], Ge = [h], We = [h], Ue = [h], He = [m], Ve = [ce], B) {
|
|
136
837
|
constructor() {
|
|
137
|
-
super(...arguments), l(
|
|
838
|
+
super(...arguments), l(V, 5, this), n(this, "body"), n(this, "ticket", 0), n(this, "rendered", /* @__PURE__ */ new WeakMap()), u(this, H, l(V, 8, this, X)), l(V, 11, this), n(this, "textBox"), n(this, "tabButtons", /* @__PURE__ */ new Map()), n(this, "keepTextBox", l(V, 32, this, /* @__PURE__ */ e((e) => {
|
|
138
839
|
this.textBox = e, e.value = this.textToShow;
|
|
139
|
-
}, "keepTextBox"))), l(
|
|
840
|
+
}, "keepTextBox"))), l(V, 35, this), n(this, "onInput", /* @__PURE__ */ e((e) => {
|
|
140
841
|
this.content = e.currentTarget.value;
|
|
141
|
-
}, "onInput")),
|
|
142
|
-
c.focus.arrowKey(
|
|
143
|
-
container:
|
|
144
|
-
items: /* @__PURE__ */
|
|
842
|
+
}, "onInput")), n(this, "onTabKeyDown", /* @__PURE__ */ e((t) => {
|
|
843
|
+
c.focus.arrowKey(t, {
|
|
844
|
+
container: t.currentTarget,
|
|
845
|
+
items: /* @__PURE__ */ e(() => Q.map((e) => this.tabButtons.get(e)), "items"),
|
|
145
846
|
orientation: "horizontal",
|
|
146
847
|
tabindex: "left alone",
|
|
147
|
-
onChange: /* @__PURE__ */
|
|
848
|
+
onChange: /* @__PURE__ */ e((e, t) => this.shownTab = Q[t], "onChange")
|
|
148
849
|
});
|
|
149
|
-
}, "onTabKeyDown")),
|
|
150
|
-
|
|
850
|
+
}, "onTabKeyDown")), u(this, U, l(V, 12, this, !1)), l(V, 15, this), u(this, W, l(V, 16, this)), l(V, 19, this), n(this, "places", []), n(this, "placesOffset", 0), n(this, "isRenderWaiting", !1), n(this, "keepTimer"), n(this, "engine"), n(this, "saves", Promise.resolve()), n(this, "onBoxKey", l(V, 36, this, /* @__PURE__ */ e((e) => {
|
|
851
|
+
e.stopPropagation();
|
|
852
|
+
let t = this.box;
|
|
853
|
+
if (!t) return;
|
|
854
|
+
let n = e.key === "Enter" && e.shiftKey && t.place.kind === "paragraph", r = e.shiftKey ? void 0 : ct[e.key];
|
|
855
|
+
if (r !== void 0) t.editor.caret = r === "start" ? 0 : (t.editor.field.textContent ?? "").length;
|
|
856
|
+
else if (e.key === "Escape") this.putBack();
|
|
857
|
+
else if (e.key === "Enter" && !n) this.keep("close");
|
|
858
|
+
else if (e.key === "Tab") this.keep(e.shiftKey ? "previous" : "next");
|
|
859
|
+
else return;
|
|
860
|
+
e.preventDefault();
|
|
861
|
+
}, "onBoxKey"))), l(V, 39, this), n(this, "onBoxInput", l(V, 40, this, /* @__PURE__ */ e(() => {
|
|
862
|
+
this.keepTimer?.cancel(), this.keepTimer = d(st, () => void this.keep("open"));
|
|
863
|
+
}, "onBoxInput"))), l(V, 43, this), n(this, "onBoxLeft", l(V, 44, this, /* @__PURE__ */ e((e) => {
|
|
864
|
+
let t = this.box, n = e.relatedTarget;
|
|
865
|
+
t && !t.editor.field.contains(n) && !t.editor.bar.contains(n) && this.keep("close");
|
|
866
|
+
}, "onBoxLeft"))), l(V, 47, this), u(this, G, l(V, 20, this, [])), l(V, 23, this), n(this, "hasRendered", !1), n(this, "onClick", /* @__PURE__ */ e((e) => {
|
|
867
|
+
if (this.editsInPlace && e.altKey && this.openAt(e)) return e.preventDefault();
|
|
868
|
+
let t = e.target.closest?.(St), n = t && _UIMarkdown.idForHash(t.getAttribute("href"));
|
|
151
869
|
n && this.reveal(n) && e.preventDefault();
|
|
152
870
|
}, "onClick"));
|
|
153
871
|
}
|
|
154
872
|
onMarkdownChanged() {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
873
|
+
this.renderNow();
|
|
874
|
+
}
|
|
875
|
+
renderNow() {
|
|
876
|
+
let e = !this.hasTabs || this.shownTab === Z;
|
|
877
|
+
if (this.loadStatus !== "loaded" || !e) return;
|
|
878
|
+
if (this.box) {
|
|
879
|
+
this.isRenderWaiting = !0;
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
let t = this.textToShow, n = this.skipTitle ? t.replace(dt, "") : t;
|
|
883
|
+
return this.placesOffset = t.length - n.length, this.renderMarkdown({
|
|
884
|
+
text: n,
|
|
885
|
+
isEditable: !!this.editable,
|
|
159
886
|
options: {
|
|
160
887
|
breaks: !!this.breaks,
|
|
161
888
|
headingOffset: Number(this.headingOffset) || 0,
|
|
162
|
-
sanitized: !!this.sanitized
|
|
889
|
+
sanitized: !!this.sanitized,
|
|
890
|
+
places: this.editsInPlace
|
|
163
891
|
}
|
|
164
892
|
});
|
|
165
893
|
}
|
|
166
894
|
renderContent() {
|
|
167
895
|
let e = this;
|
|
168
|
-
return [
|
|
896
|
+
return [y(ue, {
|
|
169
897
|
get when() {
|
|
170
|
-
return e.
|
|
898
|
+
return e.hasTabs;
|
|
171
899
|
},
|
|
172
900
|
get children() {
|
|
173
|
-
return [
|
|
901
|
+
return [me(() => e.tabs()), me(() => e.editor())];
|
|
174
902
|
}
|
|
175
903
|
}), (() => {
|
|
176
|
-
var t =
|
|
177
|
-
return
|
|
904
|
+
var t = Le(), n = t.firstChild;
|
|
905
|
+
return v(n, "click", e.onClick, !0), x(() => (t) => {
|
|
178
906
|
e.body = t;
|
|
179
|
-
}, n),
|
|
907
|
+
}, n), b(() => ({
|
|
180
908
|
e: _UIMarkdown.panelId(Z),
|
|
181
|
-
t: e.
|
|
182
|
-
a: e.
|
|
183
|
-
o: e.
|
|
184
|
-
i:
|
|
909
|
+
t: e.hasTabs ? $.panel : void 0,
|
|
910
|
+
a: e.hasTabs ? _UIMarkdown.tabId(Z) : void 0,
|
|
911
|
+
o: e.hasTabs && e.shownTab !== Z ? !0 : void 0,
|
|
912
|
+
i: he(e.rootClass),
|
|
185
913
|
n: e.partForName("body")
|
|
186
914
|
}), ({ e, t: r, a: i, o: a, i: o, n: s }, c) => {
|
|
187
|
-
e !== c?.e &&
|
|
915
|
+
e !== c?.e && S(t, "id", e), r !== c?.t && S(t, "role", r), i !== c?.a && S(t, "aria-labelledby", i), a !== c?.o && S(t, "hidden", a), de(n, o, c?.i), s !== c?.n && S(n, "part", s);
|
|
188
916
|
}), t;
|
|
189
917
|
})()];
|
|
190
918
|
}
|
|
919
|
+
get hasTabs() {
|
|
920
|
+
return this.editable === ot;
|
|
921
|
+
}
|
|
191
922
|
tabs() {
|
|
192
923
|
let e = this;
|
|
193
|
-
var t =
|
|
194
|
-
return
|
|
924
|
+
var t = Re();
|
|
925
|
+
return v(t, "keydown", e.onTabKeyDown, !0), pe(t, y(le, {
|
|
195
926
|
each: Q,
|
|
196
927
|
children: (t) => (() => {
|
|
197
|
-
var n =
|
|
198
|
-
return n._$$click = () => e.shownTab = t,
|
|
928
|
+
var n = ze();
|
|
929
|
+
return n._$$click = () => e.shownTab = t, x(() => (n) => {
|
|
199
930
|
e.tabButtons.set(t, n);
|
|
200
|
-
}, n),
|
|
931
|
+
}, n), pe(n, () => e.translationForKey(t)), b(() => ({
|
|
201
932
|
e: _UIMarkdown.tabId(t),
|
|
202
933
|
t: $.tab,
|
|
203
934
|
a: e.partForName("tab"),
|
|
@@ -205,22 +936,22 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
|
|
|
205
936
|
i: _UIMarkdown.panelId(t),
|
|
206
937
|
n: e.shownTab === t ? 0 : -1
|
|
207
938
|
}), ({ e, t, a: r, o: i, i: a, n: o }, s) => {
|
|
208
|
-
e !== s?.e &&
|
|
939
|
+
e !== s?.e && S(n, "id", e), t !== s?.t && S(n, "role", t), r !== s?.a && S(n, "part", r), i !== s?.o && S(n, "aria-selected", i), a !== s?.i && S(n, "aria-controls", a), o !== s?.n && S(n, "tabindex", o);
|
|
209
940
|
}), n;
|
|
210
941
|
})()
|
|
211
|
-
})),
|
|
942
|
+
})), b(() => ({
|
|
212
943
|
e: e.partForName("tabs"),
|
|
213
944
|
t: $.list
|
|
214
945
|
}), ({ e, t: n }, r) => {
|
|
215
|
-
e !== r?.e &&
|
|
946
|
+
e !== r?.e && S(t, "part", e), n !== r?.t && S(t, "role", n);
|
|
216
947
|
}), t;
|
|
217
948
|
}
|
|
218
949
|
editor() {
|
|
219
950
|
let e = this;
|
|
220
|
-
var t =
|
|
221
|
-
|
|
951
|
+
var t = Be(), n = t.firstChild;
|
|
952
|
+
v(n, "input", e.onInput, !0);
|
|
222
953
|
var r = e.keepTextBox;
|
|
223
|
-
return typeof r == "function" || Array.isArray(r) ?
|
|
954
|
+
return typeof r == "function" || Array.isArray(r) ? x(() => r, n) : e.keepTextBox = n, b(() => ({
|
|
224
955
|
e: _UIMarkdown.panelId(X),
|
|
225
956
|
t: $.panel,
|
|
226
957
|
a: _UIMarkdown.tabId(X),
|
|
@@ -228,12 +959,157 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
|
|
|
228
959
|
i: e.partForName("editor"),
|
|
229
960
|
n: e.translationForKey("editor")
|
|
230
961
|
}), ({ e, t: r, a: i, o: a, i: o, n: s }, c) => {
|
|
231
|
-
e !== c?.e &&
|
|
962
|
+
e !== c?.e && S(t, "id", e), r !== c?.t && S(t, "role", r), i !== c?.a && S(t, "aria-labelledby", i), a !== c?.o && S(t, "hidden", a), o !== c?.i && S(n, "part", o), s !== c?.n && S(n, "aria-label", s);
|
|
232
963
|
}), t;
|
|
233
964
|
}
|
|
234
965
|
onTextChanged(e) {
|
|
235
966
|
this.textBox && this.textBox.value !== e && (this.textBox.value = e);
|
|
236
967
|
}
|
|
968
|
+
get editsInPlace() {
|
|
969
|
+
return this.editable === !0;
|
|
970
|
+
}
|
|
971
|
+
get isPlacing() {
|
|
972
|
+
return this.editsInPlace && this.isOptionHeld;
|
|
973
|
+
}
|
|
974
|
+
get isEditingInPlace() {
|
|
975
|
+
return !!this.box;
|
|
976
|
+
}
|
|
977
|
+
followOptionKey() {
|
|
978
|
+
let t = new AbortController(), n = { signal: t.signal }, r = /* @__PURE__ */ e((e) => this.isOptionHeld = e.altKey, "follow");
|
|
979
|
+
return window.addEventListener("keydown", r, n), window.addEventListener("keyup", r, n), window.addEventListener("blur", () => this.isOptionHeld = !1, n), () => t.abort();
|
|
980
|
+
}
|
|
981
|
+
openAt(e) {
|
|
982
|
+
let t = e.target;
|
|
983
|
+
if (this.box?.editor.field.contains(t)) return !1;
|
|
984
|
+
let n = t.closest?.(Y);
|
|
985
|
+
return !n || !this.body?.contains(n) ? !1 : (this.open(n, {
|
|
986
|
+
x: e.clientX,
|
|
987
|
+
y: e.clientY
|
|
988
|
+
}), !0);
|
|
989
|
+
}
|
|
990
|
+
async open(e, t) {
|
|
991
|
+
this.box && await this.keep("close");
|
|
992
|
+
let n = this.places[Number(e.getAttribute(J))];
|
|
993
|
+
if (!n || !e.isConnected) return;
|
|
994
|
+
let r = this.textToShow, i = n.start + this.placesOffset, a = n.end + this.placesOffset, o = r.slice(i, a), s = _UIMarkdown.holderOf(e), c = _UIMarkdown.ownNodes(s), l = t ? this.caretFor(s, o, t) : o.length, u = w.shapeOf(r, {
|
|
995
|
+
...n,
|
|
996
|
+
start: i,
|
|
997
|
+
end: a
|
|
998
|
+
}), d = this.boxFor(n.kind, o, u);
|
|
999
|
+
s.insertBefore(d.field, c[0] ?? null);
|
|
1000
|
+
for (let e of c) e.remove();
|
|
1001
|
+
this.domElement.shadowRoot?.append(d.bar), d.bar.showPopover(), this.box = {
|
|
1002
|
+
piece: e,
|
|
1003
|
+
editor: d,
|
|
1004
|
+
own: c,
|
|
1005
|
+
place: {
|
|
1006
|
+
...n,
|
|
1007
|
+
start: i,
|
|
1008
|
+
end: a
|
|
1009
|
+
},
|
|
1010
|
+
raw: o,
|
|
1011
|
+
opened: o,
|
|
1012
|
+
shape: u,
|
|
1013
|
+
openedShape: u,
|
|
1014
|
+
base: r
|
|
1015
|
+
}, d.focus(d.view === "marks" ? l : void 0);
|
|
1016
|
+
}
|
|
1017
|
+
boxFor(t, n, r) {
|
|
1018
|
+
let i = this.engine;
|
|
1019
|
+
return new xe({
|
|
1020
|
+
document: this.domElement.ownerDocument,
|
|
1021
|
+
kind: t,
|
|
1022
|
+
raw: n,
|
|
1023
|
+
shape: r,
|
|
1024
|
+
label: this.translationForKey("editBox", { kind: this.translationForKey(t) }),
|
|
1025
|
+
parts: {
|
|
1026
|
+
box: this.partForName("edit-box"),
|
|
1027
|
+
bar: this.partForName("edit-bar")
|
|
1028
|
+
},
|
|
1029
|
+
texts: /* @__PURE__ */ e((e) => this.translationForKey(e), "texts"),
|
|
1030
|
+
view: _UIMarkdown.chosenView,
|
|
1031
|
+
renderInline: i?.renderInline ? (e) => i.renderInline(e) : void 0,
|
|
1032
|
+
onKey: this.onBoxKey,
|
|
1033
|
+
onInput: this.onBoxInput,
|
|
1034
|
+
onLeave: this.onBoxLeft,
|
|
1035
|
+
onView: /* @__PURE__ */ e((e) => _UIMarkdown.chosenView = e, "onView")
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
static get chosenView() {
|
|
1039
|
+
return _.getAt(at) === "formatted" ? "formatted" : "marks";
|
|
1040
|
+
}
|
|
1041
|
+
static set chosenView(e) {
|
|
1042
|
+
_.setAt(at, e);
|
|
1043
|
+
}
|
|
1044
|
+
async keep(e) {
|
|
1045
|
+
let t = this.box;
|
|
1046
|
+
if (!t) return;
|
|
1047
|
+
this.keepTimer?.cancel();
|
|
1048
|
+
let n = t.editor.raw, r = this.textToShow, i = t.place.start;
|
|
1049
|
+
if (r !== t.base) {
|
|
1050
|
+
let e = r.indexOf(t.raw);
|
|
1051
|
+
if (e < 0 || r.includes(t.raw, e + 1)) return this.onKeepConflict();
|
|
1052
|
+
i = e;
|
|
1053
|
+
}
|
|
1054
|
+
let a = {
|
|
1055
|
+
...t.place,
|
|
1056
|
+
start: i,
|
|
1057
|
+
end: i + t.raw.length
|
|
1058
|
+
}, o = t.editor.shape, s = o && o !== t.shape ? w.reshape(r, a, n, o) : void 0, c = s?.text ?? F.replace(r, a, n), l = e === "next" || e === "previous" ? this.neighbourOf(t.piece, e) : void 0, u = l && this.startInNext(l, a, c.length - r.length);
|
|
1059
|
+
if (c !== r && (t.place = s?.place ?? {
|
|
1060
|
+
...a,
|
|
1061
|
+
end: c.length - (r.length - a.end)
|
|
1062
|
+
}, t.raw = c.slice(t.place.start, t.place.end), t.shape = o, t.base = c, this.content = c, this.saveInTurn()), e === "open") return;
|
|
1063
|
+
let d = this.close(t) ?? (c === r ? void 0 : this.renderNow());
|
|
1064
|
+
if (u === void 0) return;
|
|
1065
|
+
await d;
|
|
1066
|
+
let f = [...this.body?.querySelectorAll(Y) ?? []].find((e) => this.places[Number(e.getAttribute(J))]?.start === u);
|
|
1067
|
+
f && await this.open(f);
|
|
1068
|
+
}
|
|
1069
|
+
saveInTurn() {
|
|
1070
|
+
this.saves = this.saves.then(() => this.save()).catch(() => !1);
|
|
1071
|
+
}
|
|
1072
|
+
async putBack() {
|
|
1073
|
+
let e = this.box;
|
|
1074
|
+
if (e) {
|
|
1075
|
+
if (e.raw === e.opened && e.shape === e.openedShape) return void this.close(e);
|
|
1076
|
+
e.editor.raw = e.opened, e.openedShape && e.editor.reshape(e.openedShape), await this.keep("close");
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
close(e) {
|
|
1080
|
+
if (this.keepTimer?.cancel(), this.box = void 0, e.editor.remove(), e.editor.field.replaceWith(...e.own), this.isRenderWaiting) return this.isRenderWaiting = !1, this.renderNow();
|
|
1081
|
+
}
|
|
1082
|
+
onKeepConflict() {
|
|
1083
|
+
let e = /* @__PURE__ */ Error("<ui-markdown>: this text changed while it was edited; copy what you typed, and reload");
|
|
1084
|
+
this.sendSourceEvent(s.error, {
|
|
1085
|
+
kind: "conflict",
|
|
1086
|
+
source: this.source || void 0,
|
|
1087
|
+
error: e
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
neighbourOf(e, t) {
|
|
1091
|
+
let n = [...this.body?.querySelectorAll(Y) ?? []];
|
|
1092
|
+
return n[n.indexOf(e) + (t === "next" ? 1 : -1)];
|
|
1093
|
+
}
|
|
1094
|
+
startInNext(e, t, n) {
|
|
1095
|
+
let r = this.places[Number(e.getAttribute(J))];
|
|
1096
|
+
if (!r) return;
|
|
1097
|
+
let i = r.start + this.placesOffset;
|
|
1098
|
+
return (i >= t.end ? i + n : i) - this.placesOffset;
|
|
1099
|
+
}
|
|
1100
|
+
caretFor(e, t, n) {
|
|
1101
|
+
let r = this.domElement.shadowRoot, i = this.domElement.ownerDocument.caretPositionFromPoint?.(n.x, n.y, { shadowRoots: r ? [r] : [] });
|
|
1102
|
+
if (!i || !e.contains(i.offsetNode)) return t.length;
|
|
1103
|
+
let a = this.domElement.ownerDocument.createRange();
|
|
1104
|
+
a.setStart(e, 0), a.setEnd(i.offsetNode, i.offset);
|
|
1105
|
+
let o = 0;
|
|
1106
|
+
for (let e of a.toString()) {
|
|
1107
|
+
let n = t.indexOf(e, o);
|
|
1108
|
+
if (n < 0) return t.length;
|
|
1109
|
+
o = n + 1;
|
|
1110
|
+
}
|
|
1111
|
+
return o;
|
|
1112
|
+
}
|
|
237
1113
|
reveal(e) {
|
|
238
1114
|
return this.scrollTo(e) ? (history.replaceState(history.state, "", `#${e}`), !0) : !1;
|
|
239
1115
|
}
|
|
@@ -250,31 +1126,32 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
|
|
|
250
1126
|
return t?.scrollIntoView(), !!t;
|
|
251
1127
|
}
|
|
252
1128
|
loadEngine() {
|
|
253
|
-
return
|
|
1129
|
+
return P.load();
|
|
254
1130
|
}
|
|
255
1131
|
async renderMarkdown({ text: e, options: t, isEditable: n }) {
|
|
256
1132
|
let r = ++this.ticket;
|
|
257
1133
|
try {
|
|
258
1134
|
await c.load();
|
|
259
|
-
let [i, a] = await Promise.all([this.loadEngine(), t.sanitized ?
|
|
1135
|
+
let [i, a] = await Promise.all([this.loadEngine(), t.sanitized ? P.loadSanitizer() : void 0]);
|
|
260
1136
|
if (r !== this.ticket || !this.body) return;
|
|
261
|
-
|
|
262
|
-
|
|
1137
|
+
this.engine = i;
|
|
1138
|
+
let { html: o, headings: s, places: l } = i.render(e, t), u = a ? a.sanitize(o, { uiTags: !!i.drawsUITags }) : this.domElement.ownerDocument.createRange().createContextualFragment(o);
|
|
1139
|
+
this.upgradeCode(u), this.keepShortCode(u), this.labelTaskItems(u), this.resolveUrls(u), n ? this.patchBody(this.body, u) : this.body.replaceChildren(u), this.places = l ?? [], this.headings = s, this.send("ui-drawn", { headings: s }), this.hasRendered || (this.hasRendered = !0, this.onHashChange());
|
|
263
1140
|
} catch (e) {
|
|
264
1141
|
r === this.ticket && this.onLoadError(e, "render");
|
|
265
1142
|
}
|
|
266
1143
|
}
|
|
267
1144
|
upgradeCode(e) {
|
|
268
|
-
for (let t of e.querySelectorAll(
|
|
269
|
-
let e = t.parentElement, n = this.domElement.ownerDocument.createElement(
|
|
270
|
-
r && n.setAttribute(
|
|
1145
|
+
for (let t of e.querySelectorAll(ft)) {
|
|
1146
|
+
let e = t.parentElement, n = this.domElement.ownerDocument.createElement(_t), r = gt.exec(t.className)?.[1];
|
|
1147
|
+
r && n.setAttribute(vt, r), n.setAttribute(yt, ""), n.textContent = (t.textContent ?? "").replace(/\n$/, ""), e.replaceWith(n);
|
|
271
1148
|
}
|
|
272
1149
|
}
|
|
273
1150
|
keepShortCode(e) {
|
|
274
|
-
for (let t of e.querySelectorAll(
|
|
1151
|
+
for (let t of e.querySelectorAll(pt)) (t.textContent ?? "").length <= mt && t.classList.add(ht);
|
|
275
1152
|
}
|
|
276
1153
|
labelTaskItems(e) {
|
|
277
|
-
for (let t of e.querySelectorAll(
|
|
1154
|
+
for (let t of e.querySelectorAll(bt)) {
|
|
278
1155
|
let e = t.parentElement.textContent?.trim();
|
|
279
1156
|
e && t.setAttribute("aria-label", e);
|
|
280
1157
|
}
|
|
@@ -283,7 +1160,7 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
|
|
|
283
1160
|
let t = this.source || void 0;
|
|
284
1161
|
if (!t) return;
|
|
285
1162
|
let n = new URL(t, this.domElement.ownerDocument.baseURI);
|
|
286
|
-
for (let t of
|
|
1163
|
+
for (let t of xt) for (let r of e.querySelectorAll(`[${t}]`)) {
|
|
287
1164
|
let e = r.getAttribute(t);
|
|
288
1165
|
if (!e.startsWith("#")) try {
|
|
289
1166
|
r.setAttribute(t, new URL(e, n).href);
|
|
@@ -306,8 +1183,20 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
|
|
|
306
1183
|
return;
|
|
307
1184
|
}
|
|
308
1185
|
}
|
|
1186
|
+
static holderOf(e) {
|
|
1187
|
+
let t = e.firstElementChild;
|
|
1188
|
+
return e.localName === "li" && t?.localName === "p" ? t : e;
|
|
1189
|
+
}
|
|
1190
|
+
static ownNodes(e) {
|
|
1191
|
+
let t = [];
|
|
1192
|
+
for (let n of e.childNodes) {
|
|
1193
|
+
if (n.nodeType === a.element && lt.test(n.localName)) break;
|
|
1194
|
+
n.nodeType === a.element && n.matches(ut) || t.push(n);
|
|
1195
|
+
}
|
|
1196
|
+
return t;
|
|
1197
|
+
}
|
|
309
1198
|
static markupFor(e) {
|
|
310
|
-
let t = e.nodeType ===
|
|
1199
|
+
let t = e.nodeType === a.element ? e.outerHTML : e.textContent;
|
|
311
1200
|
return `${e.nodeType}:${t}`;
|
|
312
1201
|
}
|
|
313
1202
|
static tabId(e) {
|
|
@@ -317,24 +1206,27 @@ var q = K, J = class _UIMarkdown extends (H = i, V = [re], B = [f], z = [u("text
|
|
|
317
1206
|
return `ui-markdown-${e}-panel`;
|
|
318
1207
|
}
|
|
319
1208
|
};
|
|
320
|
-
|
|
321
|
-
styleSheets: { markdown:
|
|
322
|
-
DOMElement:
|
|
1209
|
+
V = g(B), H = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), i(V, 1, "onMarkdownChanged", et, q), i(V, 4, "shownTab", $e, q, H), i(V, 1, "onTextChanged", Ze, q), i(V, 4, "isOptionHeld", Xe, q, U), i(V, 2, "isPlacing", Ye, q), i(V, 4, "box", Je, q, W), i(V, 2, "isEditingInPlace", qe, q), i(V, 1, "followOptionKey", Ke, q), i(V, 4, "headings", He, q, G), i(V, 1, "followHash", Ve, q), i(V, 13, "vocabulary", nt, q), i(V, 13, "elementSetup", tt, q), i(V, 5, "keepTextBox", Qe, q), i(V, 5, "onBoxKey", Ge, q), i(V, 5, "onBoxInput", We, q), i(V, 5, "onBoxLeft", Ue, q), o(V, q), e(q, "UIMarkdown"), n(q, "vocabulary", l(V, 24, q, Fe)), l(V, 27, q), n(q, "elementSetup", l(V, 28, q, {
|
|
1210
|
+
styleSheets: { markdown: Ie },
|
|
1211
|
+
DOMElement: rt,
|
|
323
1212
|
delegatesFocus: !1
|
|
324
|
-
})), l(
|
|
325
|
-
var
|
|
1213
|
+
})), l(V, 31, q);
|
|
1214
|
+
var it = q, at = "ui-markdown:edit-view", ot = "tabs", J = "data-ui-place", Y = `[${J}]`, st = 5, ct = {
|
|
1215
|
+
Home: "start",
|
|
1216
|
+
End: "end"
|
|
1217
|
+
}, lt = /^(ul|ol)$/, ut = "input[type=checkbox]", X = "write", Z = "preview", Q = [X, Z], $ = {
|
|
326
1218
|
list: "tablist",
|
|
327
1219
|
tab: "tab",
|
|
328
1220
|
panel: "tabpanel"
|
|
329
|
-
},
|
|
1221
|
+
}, dt = /^(?:[ \t]*\n)*[ ]{0,3}(?:#(?=[ \t\n]|$)[^\n]*|[^\s][^\n]*\n[ ]{0,3}=+[ \t]*)(?:\n|$)/, ft = "pre > code", pt = ":not(pre) > code", mt = 28, ht = "short", gt = /\blanguage-(\S+)/, _t = "ui-code", vt = "language", yt = "copy", bt = "li > input[type=checkbox], ui-item > ui-checkbox", xt = ["href", "src"], St = "a[href^='#']";
|
|
330
1222
|
//#endregion
|
|
331
1223
|
//#region src/components/ui-markdown/index.ts
|
|
332
|
-
|
|
1224
|
+
fe([
|
|
333
1225
|
"click",
|
|
334
1226
|
"keydown",
|
|
335
1227
|
"input"
|
|
336
|
-
]),
|
|
1228
|
+
]), it.define();
|
|
337
1229
|
//#endregion
|
|
338
|
-
export {
|
|
1230
|
+
export { rt as DOMMarkdownElement, P as MarkdownRenderer, it as UIMarkdown, F as t };
|
|
339
1231
|
|
|
340
1232
|
//# sourceMappingURL=ui-markdown.js.map
|