@sps-woodland/core 8.56.2 → 8.56.3
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/lib/action-bar/action-bar/ActionBar.js +44 -59
- package/lib/action-bar/action-bar/ActionBar.ve.js +4 -11
- package/lib/action-bar/action-bar-additional-content/ActionBarAdditionalContent.js +14 -22
- package/lib/action-bar/index.js +54 -74
- package/lib/action-bar/index.umd.cjs +1 -1
- package/lib/action-bar/style.css +2 -1
- package/lib/add-to-list/add-to-list/AddToList.js +220 -302
- package/lib/add-to-list/add-to-list/AddToList.ve.js +79 -24
- package/lib/add-to-list/add-to-list/ItemsList.js +42 -67
- package/lib/add-to-list/add-to-list/ListItem.js +24 -50
- package/lib/add-to-list/index.js +393 -453
- package/lib/add-to-list/index.umd.cjs +1 -1
- package/lib/add-to-list/style.css +2 -1
- package/lib/buttons/button/Button.js +95 -121
- package/lib/buttons/button/Button.ve.js +150 -9
- package/lib/buttons/index.js +281 -171
- package/lib/buttons/index.umd.cjs +1 -1
- package/lib/buttons/style.css +2 -1
- package/lib/cards/card/Card.js +19 -27
- package/lib/cards/card/Card.ve.js +4 -4
- package/lib/cards/card-footer/CardFooter.js +12 -13
- package/lib/cards/card-footer/CardFooter.ve.js +4 -4
- package/lib/cards/card-header/CardHeader.js +12 -13
- package/lib/cards/card-header/CardHeader.ve.js +4 -4
- package/lib/cards/card-title/CardTitle.js +11 -12
- package/lib/cards/card-title/CardTitle.ve.js +4 -4
- package/lib/cards/index.js +52 -52
- package/lib/cards/index.umd.cjs +1 -1
- package/lib/cards/style.css +2 -1
- package/lib/column-manager/column-manager/ColumnManager.js +95 -112
- package/lib/column-manager/column-manager/useColumnManager.js +59 -48
- package/lib/column-manager/index.js +2 -5
- package/lib/components/icon/Icon.ve.js +15 -5
- package/lib/components/icon/icons/sprite.svg.js +4 -4
- package/lib/content-row/content-row/ContentRow.js +146 -173
- package/lib/content-row/content-row/ContentRow.ve.js +105 -18
- package/lib/content-row/content-row-col/ContentRowCol.js +37 -48
- package/lib/content-row/content-row-col/ContentRowCol.ve.js +49 -6
- package/lib/content-row/content-row-expansion/ContentRowExpansion.js +16 -24
- package/lib/content-row/index.js +407 -318
- package/lib/content-row/index.umd.cjs +1 -1
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.js +24 -39
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +13 -5
- package/lib/content-row/style.css +2 -1
- package/lib/content-tiles/content-tile/ContentTile.js +71 -60
- package/lib/content-tiles/content-tile/ContentTile.ve.js +36 -14
- package/lib/content-tiles/content-tile-list/ContentTileList.js +12 -13
- package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +4 -5
- package/lib/content-tiles/index.js +156 -118
- package/lib/content-tiles/index.umd.cjs +1 -1
- package/lib/content-tiles/style.css +2 -1
- package/lib/core.css +2 -1
- package/lib/dropdowns/dropdown/Dropdown.js +56 -68
- package/lib/dropdowns/dropdown/Dropdown.ve.js +37 -8
- package/lib/dropdowns/index.js +171 -171
- package/lib/dropdowns/index.umd.cjs +1 -1
- package/lib/dropdowns/option-list/Option.js +14 -18
- package/lib/dropdowns/option-list/Option.ve.js +4 -5
- package/lib/dropdowns/option-list/OptionList.js +28 -44
- package/lib/dropdowns/option-list/OptionList.ve.js +4 -5
- package/lib/dropdowns/style.css +2 -1
- package/lib/editable-table/EditableTable.js +68 -85
- package/lib/editable-table/index.js +1 -4
- package/lib/feedback-block/FeedbackBlock.js +40 -35
- package/lib/feedback-block/FeedbackBlock.ve.js +56 -7
- package/lib/feedback-block/index.js +132 -85
- package/lib/feedback-block/index.umd.cjs +1 -1
- package/lib/feedback-block/style.css +2 -1
- package/lib/file-upload/file-upload/FileUpload.js +164 -202
- package/lib/file-upload/file-upload/FileUpload.ve.js +84 -18
- package/lib/file-upload/file-upload/mime-type.enum.js +106 -106
- package/lib/file-upload/index.js +390 -353
- package/lib/file-upload/index.umd.cjs +1 -1
- package/lib/file-upload/style.css +2 -1
- package/lib/filter-tiles/filter-tile/FilterTile.js +41 -46
- package/lib/filter-tiles/filter-tile/FilterTile.ve.js +51 -9
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.js +12 -15
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +4 -4
- package/lib/filter-tiles/index.js +142 -107
- package/lib/filter-tiles/index.umd.cjs +1 -1
- package/lib/filter-tiles/style.css +2 -1
- package/lib/focused-task/focused-task/FocusedTask.js +52 -74
- package/lib/focused-task/focused-task/FocusedTask.ve.js +13 -12
- package/lib/focused-task/focused-task/useFocusedTask.js +20 -18
- package/lib/focused-task/focused-task-actions/FocusedTaskActions.js +12 -13
- package/lib/focused-task/index.js +127 -144
- package/lib/focused-task/index.umd.cjs +1 -1
- package/lib/focused-task/style.css +2 -1
- package/lib/growler/Growler.js +78 -90
- package/lib/growler/Growler.ve.js +23 -12
- package/lib/growler/GrowlerListProvider.js +38 -39
- package/lib/growler/Sonner.ve.js +17 -12
- package/lib/growler/index.js +249 -274
- package/lib/growler/index.umd.cjs +1 -1
- package/lib/growler/sonner.js +73 -102
- package/lib/growler/style.css +2 -1
- package/lib/index.js +520 -501
- package/lib/index.umd.cjs +4 -4
- package/lib/insight-card/InsightCard.js +90 -84
- package/lib/insight-card/InsightCard.ve.js +148 -15
- package/lib/insight-card/InsightCardSet.js +12 -12
- package/lib/insight-card/index.js +269 -141
- package/lib/insight-card/index.umd.cjs +1 -1
- package/lib/insight-card/style.css +2 -1
- package/lib/key-value-set/index.js +97 -87
- package/lib/key-value-set/index.umd.cjs +1 -1
- package/lib/key-value-set/key-value-set/KeyValueSet.js +17 -21
- package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +10 -5
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.js +25 -21
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +13 -6
- package/lib/key-value-set/style.css +2 -1
- package/lib/list-bar/advanced-search/AdvancedSearch.js +51 -54
- package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +30 -8
- package/lib/list-bar/index.js +305 -301
- package/lib/list-bar/index.umd.cjs +1 -1
- package/lib/list-bar/list-bar/InputGroupWrapper.js +10 -19
- package/lib/list-bar/list-bar/ListBar.js +105 -121
- package/lib/list-bar/list-bar/ListBar.ve.js +13 -17
- package/lib/list-bar/list-bar/ListBarSearch.js +20 -21
- package/lib/list-bar/list-bar/ListBarSearchInfo.js +8 -12
- package/lib/list-bar/list-bar/ListBarSortBy.js +28 -38
- package/lib/list-bar/search-results-bar/SearchResultsBar.js +38 -28
- package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +4 -11
- package/lib/list-bar/style.css +2 -1
- package/lib/matrix/index.js +79 -87
- package/lib/matrix/index.umd.cjs +1 -1
- package/lib/matrix/matrix/Matrix.js +18 -26
- package/lib/matrix/matrix/Matrix.ve.js +4 -7
- package/lib/matrix/matrix-body/MatrixBody.js +10 -13
- package/lib/matrix/matrix-cell/MatrixCell.js +23 -18
- package/lib/matrix/matrix-head/MatrixHead.js +10 -13
- package/lib/matrix/matrix-header/MatrixHeader.js +20 -23
- package/lib/matrix/matrix-row/MatrixRow.js +10 -13
- package/lib/matrix/style.css +2 -1
- package/lib/modal/index.js +197 -187
- package/lib/modal/index.umd.cjs +1 -1
- package/lib/modal/modal/Modal.js +90 -108
- package/lib/modal/modal/Modal.ve.js +43 -13
- package/lib/modal/modal/useModal.js +19 -24
- package/lib/modal/modal-footer/ModalFooter.js +11 -12
- package/lib/modal/style.css +2 -1
- package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +49 -0
- package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/index.browser.js +8 -10
- package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/url-alphabet/index.js +4 -4
- package/lib/page-title/heading-level/HeadingLevel.js +8 -12
- package/lib/page-title/index.js +33 -40
- package/lib/page-title/index.umd.cjs +1 -1
- package/lib/page-title/page-subtitle/PageSubtitle.js +13 -18
- package/lib/page-title/page-subtitle/PageSubtitle.ve.js +4 -5
- package/lib/page-title/page-title/PageTitle.js +15 -19
- package/lib/page-title/page-title/PageTitle.ve.js +4 -7
- package/lib/page-title/style.css +2 -1
- package/lib/photo/index.js +174 -177
- package/lib/photo/index.umd.cjs +1 -1
- package/lib/photo/photo/Photo.js +72 -81
- package/lib/photo/photo/Photo.ve.js +21 -7
- package/lib/photo/photo-carousel/PhotoCarousel.js +36 -51
- package/lib/photo/photo-carousel/PhotoCarousel.ve.js +13 -9
- package/lib/photo/style.css +2 -1
- package/lib/product-bar/hooks/usePriorityPlus.js +88 -104
- package/lib/product-bar/index.js +372 -395
- package/lib/product-bar/index.umd.cjs +1 -1
- package/lib/product-bar/product-bar/ProductBar.js +77 -103
- package/lib/product-bar/product-bar/ProductBar.ve.js +46 -15
- package/lib/product-bar/product-bar-name/ProductBarName.js +37 -40
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.js +48 -70
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +4 -8
- package/lib/product-bar/product-bar-tab/ProductBarTab.js +28 -26
- package/lib/product-bar/slack-link/SlackLink.js +26 -30
- package/lib/product-bar/slack-link/SlackLink.ve.js +4 -5
- package/lib/product-bar/style.css +2 -1
- package/lib/product-bar-vertical/index.js +240 -251
- package/lib/product-bar-vertical/index.umd.cjs +1 -1
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.js +42 -61
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +53 -23
- package/lib/product-bar-vertical/product-bar-vertical-header/ProductBarVerticalHeader.js +30 -42
- package/lib/product-bar-vertical/product-bar-vertical-item/ProductBarVerticalItem.js +71 -89
- package/lib/product-bar-vertical/product-bar-vertical-section/ProductBarVerticalSection.js +22 -29
- package/lib/product-bar-vertical/style.css +2 -1
- package/lib/progress-indicators/index.js +372 -255
- package/lib/progress-indicators/index.umd.cjs +1 -1
- package/lib/progress-indicators/progress-bar/ProgressBar.js +66 -110
- package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +66 -13
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.js +34 -54
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +136 -8
- package/lib/progress-indicators/progress-ring/ProgressRing.js +45 -52
- package/lib/progress-indicators/style.css +2 -1
- package/lib/rich-text-editor/index.js +556 -582
- package/lib/rich-text-editor/index.umd.cjs +11 -11
- package/lib/rich-text-editor/rich-text-editor/RTELinkModal.js +29 -33
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.js +23 -37
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +13 -6
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.js +68 -77
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +21 -8
- package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.js +14 -20
- package/lib/rich-text-editor/rich-text-editor/hooks/useMdToHtml.js +14 -20
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEContent.js +33 -27
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEObserver.js +79 -88
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTESelectionListener.js +28 -36
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEToolbarButtons.js +195 -211
- package/lib/rich-text-editor/rich-text-editor/icons/BOLD.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/INDENT.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/ITALICS.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/LINK.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/ORDERED_LIST.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/OUTDENT.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/REDO.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNDO.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNLINK.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNORDERED_LIST.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/utils/flattenListItemParagraphs.js +12 -12
- package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.js +20 -19
- package/lib/rich-text-editor/rich-text-editor/utils/utils.js +11 -15
- package/lib/rich-text-editor/style.css +2 -1
- package/lib/scrollable-container/ScrollableContainer.js +18 -27
- package/lib/scrollable-container/ScrollableContainer.ve.js +4 -4
- package/lib/scrollable-container/index.js +20 -27
- package/lib/scrollable-container/index.umd.cjs +1 -1
- package/lib/scrollable-container/style.css +2 -1
- package/lib/side-nav/index.js +190 -228
- package/lib/side-nav/index.umd.cjs +1 -1
- package/lib/side-nav/side-nav/SideNav.js +43 -60
- package/lib/side-nav/side-nav/SideNav.ve.js +22 -16
- package/lib/side-nav/side-nav/navContext.js +7 -7
- package/lib/side-nav/side-nav-header/SideNavHeader.js +14 -15
- package/lib/side-nav/side-nav-item/SideNavItem.js +68 -94
- package/lib/side-nav/side-nav-section/SideNavSection.js +16 -26
- package/lib/side-nav/style.css +2 -1
- package/lib/sorting-header/caret/caret.ve.js +13 -5
- package/lib/sorting-header/index.js +269 -251
- package/lib/sorting-header/index.umd.cjs +1 -1
- package/lib/sorting-header/sorting-header/SortingHeader.js +110 -124
- package/lib/sorting-header/sorting-header/SortingHeader.ve.js +30 -6
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.js +69 -83
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +21 -7
- package/lib/sorting-header/style.css +2 -1
- package/lib/style.css +2 -1
- package/lib/tabs/index.js +255 -201
- package/lib/tabs/index.umd.cjs +1 -1
- package/lib/tabs/style.css +2 -1
- package/lib/tabs/tab/Tab.js +24 -27
- package/lib/tabs/tab/Tab.ve.js +76 -6
- package/lib/tabs/tab-panel/TabPanel.js +16 -25
- package/lib/tabs/tabs/Tabs.js +101 -112
- package/lib/tabs/tabs/Tabs.ve.js +13 -11
- package/lib/tags/clickable-tag/ClickableTag.js +86 -90
- package/lib/tags/clickable-tag/ClickableTag.ve.js +66 -9
- package/lib/tags/index.js +342 -199
- package/lib/tags/index.umd.cjs +1 -1
- package/lib/tags/split-tag/SplitTag.js +49 -30
- package/lib/tags/split-tag/SplitTag.ve.js +35 -9
- package/lib/tags/style.css +2 -1
- package/lib/tags/tag/Tag.js +42 -38
- package/lib/tags/tag/Tag.ve.js +41 -6
- package/lib/utils/cl.js +5 -5
- package/lib/zero-state/ZeroState.js +36 -29
- package/lib/zero-state/ZeroState.ve.js +29 -11
- package/lib/zero-state/index.js +103 -78
- package/lib/zero-state/index.umd.cjs +1 -1
- package/lib/zero-state/style.css +2 -1
- package/package.json +12 -12
- package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +0 -57
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(f,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("@sps-woodland/core"),require("react"),require("@spscommerce/ds-react"),require("@sps-woodland/core/button"),require("@spscommerce/i18n"),require("@sps-woodland/tokens"),require("remark-parse"),require("remark-rehype"),require("rehype-sanitize"),require("rehype-stringify"),require("unified"),require("unist-util-visit"),require("rehype-parse"),require("rehype-remark"),require("remark-stringify")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core","react","@spscommerce/ds-react","@sps-woodland/core/button","@spscommerce/i18n","@sps-woodland/tokens","remark-parse","remark-rehype","rehype-sanitize","rehype-stringify","unified","unist-util-visit","rehype-parse","rehype-remark","remark-stringify"],w):(f=typeof globalThis<"u"?globalThis:f||self,w(f.RichTextEditor={},f.spsWoodlandCore,f.react,f.spscommerceDsReact,f.spsWoodlandCoreButton,f.spscommerceI18n,f.spsWoodlandTokens,f.remarkParse,f.remarkRehype,f.rehypeSanitize,f.rehypeStringify,f.unified,f.unistUtilVisit,f.rehypeParse,f.rehypeRemark,f.remarkStringify))})(this,(function(f,w,u,v,D,U,x,P,V,H,F,T,q,$,j,Z){"use strict";function G(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const d=G(u);function z({onClose:t,selectionDOMContextFind:n,selectionRange:e}){const{t:r}=U.useWoodlandLanguage(),o=d.useRef(e),s=d.useRef(!1),{formValue:i,formMeta:c,updateForm:a}=v.useSpsForm({text:e?.toString()||"",link:""});return d.useEffect(()=>{if(!s.current){const l=n(m=>m.tagName==="A");l&&(a({text:l.textContent||"",link:l.getAttribute("href")||""}),s.current=!0)}},[n]),d.createElement(v.SpsModal,{title:"Add Link",onClose:()=>t(o.current)},d.createElement("div",{className:"sg-row"},d.createElement("div",{className:"sg-col-12"},d.createElement(v.SpsLabel,{for:c.fields.text},r("richTextEditor.linkModal.text",{defaultValue:"Text"})),d.createElement(v.SpsTextInput,{formMeta:c.fields.text,value:i.text}))),d.createElement("div",{className:"sg-row"},d.createElement("div",{className:"sg-col-12"},d.createElement(v.SpsLabel,{for:c.fields.link},r("richTextEditor.linkModal.link",{defaultValue:"Link"})),d.createElement(v.SpsTextInput,{formMeta:c.fields.link,value:i.link}))),d.createElement(v.SpsModalFooter,null,d.createElement(D.Button,{onClick:()=>t(o.current,i)},r("richTextEditor.linkModal.ok",{defaultValue:"OK"}))))}function K(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function S(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),e.push.apply(e,r)}return e}function M(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?S(Object(e),!0).forEach(function(r){K(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):S(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}var W=(t,n,e)=>{for(var r of Object.keys(t)){var o;if(t[r]!==((o=n[r])!==null&&o!==void 0?o:e[r]))return!1}return!0},E=t=>n=>{var e=t.defaultClassName,r=M(M({},t.defaultVariants),n);for(var o in r){var s,i=(s=r[o])!==null&&s!==void 0?s:t.defaultVariants[o];if(i!=null){var c=i;typeof c=="boolean"&&(c=c===!0?"true":"false");var a=t.variantClassNames[o][c];a&&(e+=" "+a)}}for(var[l,m]of t.compoundVariants)W(l,r,t.defaultVariants)&&(e+=" "+m);return e},J=E({defaultClassName:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1903a6n0",variantClassNames:{active:{true:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1903a6n1",false:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1903a6n2"}},defaultVariants:{},compoundVariants:[]}),Q={icon:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1903a6n3"};function X({icon:t,onClick:n,selectionDOMContextFind:e,activeTest:r,isSimpleToggle:o=!1,...s}){const[i,c]=d.useState(!1);d.useEffect(()=>{r&&c(!!e(r))},[e]);const a=d.useCallback(()=>{n&&n(i),o&&c(!i)},[n,i]);return d.createElement("button",{className:J({active:i}),onClick:a,onMouseDown:l=>l.preventDefault(),...s},d.createElement("span",{className:Q.icon,style:{backgroundImage:`url("${t}")`},"aria-hidden":"true"}))}var Y=E({defaultClassName:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss0",variantClassNames:{disabled:{true:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss1",false:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss2"}},defaultVariants:{disabled:!1},compoundVariants:[]}),e0=E({defaultClassName:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss3",variantClassNames:{disabled:{true:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss4",false:"pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss5"}},defaultVariants:{},compoundVariants:[]}),t0="pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss6",n0="pkg_sps-woodland_core__family_rich-text-editor__version_8_56_2__hash_1f3v2ss7";function r0(){return t=>(q.visit(t,"listItem",n=>{const e=Array.from(n.children);if(e.length>0&&e[0].type==="paragraph"){const r=e[0],s=Array.from(r.children).concat(e.slice(1));n.children=s}}),t)}function o0(){const t=u.useMemo(()=>T.unified().use(P).use(r0).use(V).use(H).use(F),[]);return u.useMemo(()=>function(e){return t.process(e).then(String)},[t])}const b=new Set(["strong","emphasis","delete","link","linkReference"]),i0=new Set([...b,"paragraph"]);function I(t){return"children"in t}function s0(){return t=>{function n(e){for(const r of e.children)I(r)&&n(r);if(e.children=e.children.filter(r=>!(i0.has(r.type)&&I(r)&&r.children.length===0)),b.has(e.type))for(;e.children.at(-1)?.type==="break";)e.children.pop()}return n(t),t}}function c0(){const t=u.useMemo(()=>T.unified().use($).use(j).use(s0).use(Z),[]);return u.useMemo(()=>function(e){return t.process(e).then(String)},[t])}function a0(t="",n=""){const[e,r]=u.useState(),[o,s]=u.useState({html:n}),i=c0(),c=o0(),a=u.useCallback(async g=>{const h=await c(g),p={md:g,html:h};return r(p),p},[c]),l=u.useCallback(async g=>{const p={md:await i(g),html:g};return r(p),p},[i]);u.useEffect(()=>{!n&&t!==e?.md?a(t).then(({html:g})=>{s({html:g})}):!t&&n&&n!==e?.html&&l(n)},[t,n]);function m(g){g.current&&l(g.current.innerHTML)}return{aggValue:e,editableDivInnerHtml:o,updateStateFromDiv:m}}function l0(t){if(t instanceof HTMLElement){for(const n of Array.from(t.attributes))/(style|class|data-[^=]+)/.test(n.name)&&t.removeAttribute(n.name);t.innerHTML=t.innerHTML.replace(/(style|class|data-[^=]+)="[^"]+"/g,"")}}const d0=[{regex:/\*\*([^*]+)\*\*/,command:"bold"},{regex:new RegExp("(?<!\\*)\\*([^*]+)\\*"),command:"italic"},{regex:/^\*[ \u00a0]/,command:"insertUnorderedList"},{regex:/^1\.[ \u00a0]/,command:"insertOrderedList"},{regex:/\[([^\]]+)\]\(([^)]+)\)/,command:"createLink",getCommandArg:([,,t])=>/^https?:\/\//.test(t)?t:`https://${t}`}];function m0(t,n,e){const r=document.createRange();r.setStart(t,n),r.setEnd(t,e);const o=window.getSelection();o?.removeAllRanges(),o?.addRange(r)}function _(t){const n=document.createRange();n.setStartAfter(t),n.setEndAfter(t);const e=window.getSelection();e?.removeAllRanges(),e?.addRange(n)}function g0(t){const n=document.createRange();n.setStartBefore(t),n.setEndBefore(t);const e=window.getSelection();e?.removeAllRanges(),e?.addRange(n)}function f0(t){const n=u.useRef(null),e=u.useMemo(()=>new MutationObserver(([r])=>{if(r.type==="characterData"&&r.oldValue&&r.target.textContent){for(const o of d0)if(!o.regex.test(r.oldValue)&&o.regex.test(r.target.textContent)){const s=o.regex.exec(r.target.textContent),[i,c=""]=s,a=r.target.textContent.indexOf(i);r.target.textContent=r.target.textContent.replace(i,c);const l=a+c.length;m0(r.target,a,l);const m=o.getCommandArg?o.getCommandArg(s):void 0;document.execCommand(o.command,void 0,m),c&&(_(r.target.parentNode),document.execCommand(o.command))}}else r.type==="childList"&&Array.from(r.addedNodes).forEach(o=>{let s;if(o instanceof HTMLElement&&o.tagName==="LI"?s=o:o?.parentElement?.tagName==="LI"&&(s=o?.parentElement),s){const i=s.nextElementSibling,c=i?.childNodes?.[0];if(c instanceof HTMLElement&&["UL","OL"].includes(c.tagName)){const l=document.createElement("br");i.insertBefore(l,c),g0(l)}}l0(o)});t(n)}),[]);return u.useEffect(()=>()=>{e&&e.disconnect()},[]),u.useEffect(()=>{n.current!==null&&e.observe(n.current,{childList:!0,subtree:!0,characterDataOldValue:!0})},[e,n]),n}function u0(t){const[n,e]=u.useState();u.useEffect(()=>{function o(){const s=window.getSelection();Number(s?.rangeCount)>0&&e(s?.getRangeAt(0))}return document.addEventListener("selectionchange",o),()=>{document.removeEventListener("selectionchange",o)}},[]);const r=u.useCallback(o=>{if(!n)return null;const s=n.commonAncestorContainer;if(!t.current||!t.current.contains(s))return null;let i=s instanceof HTMLElement?s:s.parentElement;for(;i&&i!==t.current;){if(o(i))return i;i=i.parentElement}return null},[n]);return{selectionRange:n,selectionDOMContextFind:r}}const h0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eBold%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-103.000000)'%20fill='%234B5356'%20fill-rule='nonzero'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%202.000000)'%20id='B'%3e%3cg%20transform='translate(3.550000,%202.130000)'%3e%3cpath%20d='M0,0%20L4.014,0%20C4.626,0%205.193,0.045%205.715,0.135%20C6.237,0.225%206.693,0.384%207.083,0.612%20C7.473,0.84%207.779,1.14%208.001,1.512%20C8.223,1.884%208.334,2.352%208.334,2.916%20C8.334,3.18%208.295,3.444%208.217,3.708%20C8.139,3.972%208.022,4.218%207.866,4.446%20C7.71,4.674%207.506,4.878%207.254,5.058%20C7.002,5.238%206.708,5.37%206.372,5.454%20L6.372,5.526%20C7.212,5.682%207.845,5.982%208.271,6.426%20C8.697,6.87%208.91,7.488%208.91,8.28%20C8.91,8.88%208.793,9.396%208.559,9.828%20C8.325,10.26%208.001,10.617%207.587,10.899%20C7.173,11.181%206.69,11.391%206.138,11.529%20C5.586,11.667%204.992,11.736%204.356,11.736%20L0,11.736%20L0,0%20Z%20M3.888,4.734%20C4.536,4.734%205.007,4.605%205.301,4.347%20C5.595,4.089%205.742,3.738%205.742,3.294%20C5.742,2.85%205.592,2.532%205.292,2.34%20C4.992,2.148%204.53,2.052%203.906,2.052%20L2.646,2.052%20L2.646,4.734%20L3.888,4.734%20Z%20M4.14,9.684%20C5.592,9.684%206.318,9.15%206.318,8.082%20C6.318,7.566%206.138,7.191%205.778,6.957%20C5.418,6.723%204.872,6.606%204.14,6.606%20L2.646,6.606%20L2.646,9.684%20L4.14,9.684%20Z'%20id='Shape'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",p0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIndent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-282.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20182.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.20857552,7.99286089%20C5.20857552,8.06428955%205.18178977,8.14464678%205.12821828,8.19821828%20L2.27107201,11.0553645%20C2.21750052,11.108936%202.13714328,11.1357218%202.06571463,11.1357218%20C1.91392873,11.1357218%201.78,11.001793%201.78,10.85%20L1.78,5.13571463%20C1.78,4.97500015%201.90500015,4.85%202.06571463,4.85%20C2.14607186,4.85%202.21750052,4.88571433%202.28,4.93928582%20L5.12821828,7.7875035%20C5.18178977,7.84107499%205.20857552,7.92143223%205.20857552,7.99286089%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",C0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eItalics%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-148.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2047.000000)'%3e%3cg%20id='I'%20transform='translate(5.600000,%202.130000)'%20fill-rule='nonzero'%3e%3cpolygon%20id='Path'%20points='2.358%200%204.824%200%202.484%2011.736%200%2011.736'%3e%3c/polygon%3e%3c/g%3e%3crect%20id='Rectangle'%20x='5.5'%20y='2'%20width='7'%20height='1.5'%3e%3c/rect%3e%3crect%20id='Rectangle-Copy'%20x='3.5'%20y='12.5'%20width='7'%20height='1.5'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",w0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-401.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Icon/icon-link'%20transform='translate(254.000000,%2032.000000)'%3e%3cpath%20d='M9.28515625,6.03125%20C9.33984402,6.06770852%209.39908822,6.11328098%209.46289062,6.16796875%20C9.52669303,6.22265652%209.58593723,6.26822898%209.640625,6.3046875%20L9.6953125,6.359375%20C10.3333365,7.01562828%2010.6523438,7.79947461%2010.6523438,8.7109375%20C10.6523438,9.62240039%2010.3333365,10.4062467%209.6953125,11.0625%20L6.6875,14.0429688%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429688%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367188%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.0625,7.20703125%20C4.04427074,7.51692863%204.06249973,7.82682137%204.1171875,8.13671875%20C4.17187527,8.44661613%204.2630202,8.73827988%204.390625,9.01171875%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367188%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492188%20C3.45182465,13.3138039%203.87109129,13.4960938%204.36328125,13.4960938%20C4.85547121,13.4960938%205.27473785,13.3138039%205.62109375,12.9492188%20L8.6015625,9.96875%20C8.9479184,9.6223941%209.12109375,9.20312746%209.12109375,8.7109375%20C9.12109375,8.21874754%208.9479184,7.7994809%208.6015625,7.453125%20L8.546875,7.3984375%20C8.49218723,7.34374973%208.43750027,7.29362002%208.3828125,7.24804688%20C8.32812473,7.20247373%208.26432328,7.16145852%208.19140625,7.125%20L9.28515625,6.03125%20Z%20M11.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882812,1.95703125%20L14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.9375,8.79296875%20C11.9557293,8.48307137%2011.9375003,8.17317863%2011.8828125,7.86328125%20C11.8281247,7.55338387%2011.7369798,7.26172012%2011.609375,6.98828125%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945312,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789062,3.05078125%20L7.3984375,6.03125%20C7.0520816,6.3776059%206.87890625,6.79687254%206.87890625,7.2890625%20C6.87890625,7.78125246%207.0520816,8.2005191%207.3984375,8.546875%20L7.453125,8.6015625%20C7.50781277,8.65625027%207.56249973,8.70637998%207.6171875,8.75195312%20C7.67187527,8.79752627%207.73567672,8.83854148%207.80859375,8.875%20L6.71484375,9.96875%20C6.66015598,9.93229148%206.60091178,9.88671902%206.53710938,9.83203125%20C6.47330697,9.77734348%206.41406277,9.73177102%206.359375,9.6953125%20L6.3046875,9.640625%20C5.66666348,8.98437172%205.34765625,8.20052539%205.34765625,7.2890625%20C5.34765625,6.37759961%205.66666348,5.59375328%206.3046875,4.9375%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",v0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='14px'%20viewBox='0%200%2015%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOrdered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-192.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2092.000000)'%3e%3crect%20id='Rectangle-223-Copy-3'%20x='5'%20y='2.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy-2'%20x='5'%20y='7'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy'%20x='5'%20y='11.5'%20width='11'%20height='2'%3e%3c/rect%3e%3cg%20id='1'%20transform='translate(1.500000,%201.900000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0,2.58%20L0.69,2.58%20L0.69,0.745%20L0.095,0.745%20L0.095,0.29%20C0.268333333,0.256666667%200.415,0.216666667%200.535,0.17%20C0.655,0.123333333%200.771666667,0.0666666667%200.885,0%20L1.425,0%20L1.425,2.58%20L2.02,2.58%20L2.02,3.175%20L0,3.175%20L0,2.58%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='2'%20transform='translate(1.355000,%206.400000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.035,2.815%20C0.238333333,2.625%200.424166667,2.4475%200.5925,2.2825%20C0.760833333,2.1175%200.905833333,1.9625%201.0275,1.8175%20C1.14916667,1.6725%201.24416667,1.5375%201.3125,1.4125%20C1.38083333,1.2875%201.415,1.16833333%201.415,1.055%20C1.415,0.898333333%201.375,0.779166667%201.295,0.6975%20C1.215,0.615833333%201.105,0.575%200.965,0.575%20C0.848333333,0.575%200.745,0.6075%200.655,0.6725%20C0.565,0.7375%200.48,0.813333333%200.4,0.9%20L0,0.505%20C0.156666667,0.338333333%200.316666667,0.2125%200.48,0.1275%20C0.643333333,0.0425%200.838333333,0%201.065,0%20C1.22166667,0%201.36416667,0.0241666667%201.4925,0.0725%20C1.62083333,0.120833333%201.73166667,0.189166667%201.825,0.2775%20C1.91833333,0.365833333%201.99,0.471666667%202.04,0.595%20C2.09,0.718333333%202.115,0.856666667%202.115,1.01%20C2.115,1.14333333%202.08666667,1.27916667%202.03,1.4175%20C1.97333333,1.55583333%201.8975,1.69416667%201.8025,1.8325%20C1.7075,1.97083333%201.59916667,2.10916667%201.4775,2.2475%20C1.35583333,2.38583333%201.23,2.52166667%201.1,2.655%20C1.18,2.645%201.26916667,2.63583333%201.3675,2.6275%20C1.46583333,2.61916667%201.55333333,2.615%201.63,2.615%20L2.27,2.615%20L2.27,3.235%20L0.035,3.235%20L0.035,2.815%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='3'%20transform='translate(1.350000,%2010.800000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.34,2.38%20C0.436666667,2.47333333%200.5425,2.55%200.6575,2.61%20C0.7725,2.67%200.898333333,2.7%201.035,2.7%20C1.19166667,2.7%201.31666667,2.6675%201.41,2.6025%20C1.50333333,2.5375%201.55,2.445%201.55,2.325%20C1.55,2.255%201.5375,2.19166667%201.5125,2.135%20C1.4875,2.07833333%201.44333333,2.03083333%201.38,1.9925%20C1.31666667,1.95416667%201.23,1.92416667%201.12,1.9025%20C1.01,1.88083333%200.868333333,1.87%200.695,1.87%20L0.695,1.35%20C0.838333333,1.35%200.9575,1.34%201.0525,1.32%20C1.1475,1.3%201.22416667,1.27083333%201.2825,1.2325%20C1.34083333,1.19416667%201.3825,1.14916667%201.4075,1.0975%20C1.4325,1.04583333%201.445,0.988333333%201.445,0.925%20C1.445,0.815%201.41166667,0.729166667%201.345,0.6675%20C1.27833333,0.605833333%201.18166667,0.575%201.055,0.575%20C0.941666667,0.575%200.839166667,0.6%200.7475,0.65%20C0.655833333,0.7%200.56,0.768333333%200.46,0.855%20L0.09,0.405%20C0.236666667,0.278333333%200.390833333,0.179166667%200.5525,0.1075%20C0.714166667,0.0358333333%200.893333333,0%201.09,0%20C1.25333333,0%201.4025,0.0191666667%201.5375,0.0575%20C1.6725,0.0958333333%201.7875,0.1525%201.8825,0.2275%20C1.9775,0.3025%202.05166667,0.393333333%202.105,0.5%20C2.15833333,0.606666667%202.185,0.73%202.185,0.87%20C2.185,1.03666667%202.13916667,1.1775%202.0475,1.2925%20C1.95583333,1.4075%201.825,1.50166667%201.655,1.575%20L1.655,1.595%20C1.83833333,1.64833333%201.98916667,1.73916667%202.1075,1.8675%20C2.22583333,1.99583333%202.285,2.16333333%202.285,2.37%20C2.285,2.51666667%202.25333333,2.6475%202.19,2.7625%20C2.12666667,2.8775%202.04166667,2.97416667%201.935,3.0525%20C1.82833333,3.13083333%201.70333333,3.19083333%201.56,3.2325%20C1.41666667,3.27416667%201.265,3.295%201.105,3.295%20C0.845,3.295%200.625,3.25416667%200.445,3.1725%20C0.265,3.09083333%200.116666667,2.98166667%200,2.845%20L0.34,2.38%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",x0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOutdent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-327.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20227.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.21357552,10.85%20C5.21357552,11.001793%205.08857537,11.1357218%204.92786089,11.1357218%20C4.84750365,11.1357218%204.77607499,11.1000075%204.71357492,11.046436%20L1.86535724,8.1892897%20C1.81178575,8.1357182%201.785,8.06428955%201.785,7.99286089%20C1.785,7.91250365%201.81178575,7.84107499%201.86535724,7.7875035%20L4.7225035,4.93035724%20C4.77607499,4.87678575%204.85643223,4.85%204.92786089,4.85%20C5.07964678,4.85%205.21357552,4.97500015%205.21357552,5.13571463%20L5.21357552,10.85%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",L0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-520.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-8'%20transform='translate(363.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",E0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-484.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-9'%20transform='translate(345.000000,%2040.000000)%20scale(-1,%201)%20translate(-345.000000,%20-40.000000)%20translate(327.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",_0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='16px'%20viewBox='0%200%2014%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnlink%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-371.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20272.000000)'%3e%3cpath%20d='M14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.1027446,9.58420181%20L10.3518996,8.27890801%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945313,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789063,3.05078125%20L8.41457939,4.92175579%20L7.64047964,3.57621944%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882813,1.95703125%20L14.0429688,2.01171875%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M8.02641916,12.7072184%20L6.6875,14.0429687%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429687%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367187%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.57246065,6.71787083%20L5.34566408,8.05009655%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367187%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492187%20C3.45182465,13.3138039%203.87109129,13.4960937%204.36328125,13.4960937%20C4.85547121,13.4960937%205.27473785,13.3138039%205.62109375,12.9492187%20L7.2646265,11.388324%20L8.02641916,12.7072184%20Z'%20id='Path'%3e%3c/path%3e%3crect%20id='Rectangle'%20transform='translate(7.750000,%208.000000)%20rotate(-30.000000)%20translate(-7.750000,%20-8.000000)%20'%20x='7'%20y='0'%20width='1.5'%20height='16'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",k0="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='12px'%20viewBox='0%200%2015%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnordered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-238.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20137.000000)'%3e%3cg%20transform='translate(1.000000,%202.000000)'%3e%3crect%20id='Rectangle-223'%20x='4'%20y='0.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='9.5'%20width='11'%20height='2'%3e%3c/rect%3e%3ccircle%20id='Oval'%20cx='1.5'%20cy='1.5'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy'%20cx='1.5'%20cy='6'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy-2'%20cx='1.5'%20cy='10.5'%20r='1.5'%3e%3c/circle%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",L=(t,n)=>{let e=t;for(;e.parentElement&&!n.includes(e.parentElement.tagName);)e=e.parentElement;return e.parentElement&&n.includes(e.parentElement.tagName)?e.parentElement:null},O=t=>{const n=[];let e=t;for(;e.nextElementSibling;)n.push(e.nextElementSibling),e=e.nextElementSibling;return n},y0={key:"bold",icon:h0,onClick:()=>document.execCommand("bold"),activeTest:t=>["B","STRONG"].includes(t.tagName),isSimpleToggle:!0},N0={key:"italics",icon:C0,onClick:()=>document.execCommand("italic"),activeTest:t=>["I","EM"].includes(t.tagName),isSimpleToggle:!0},T0={key:"ul",icon:k0,onClick:()=>document.execCommand("insertUnorderedList"),activeTest:t=>t.tagName==="UL"},S0={key:"ol",icon:v0,onClick:()=>document.execCommand("insertOrderedList"),activeTest:t=>t.tagName==="OL"},M0={key:"indent",icon:p0,onClick:()=>{try{const t=window.getSelection();if(t?.type==="Range"){const n=t.getRangeAt(0),e=n.commonAncestorContainer;if(!(e instanceof HTMLElement)||(e.tagName==="UL"||e.tagName==="OL"||e.tagName==="LI")&&e.firstElementChild&&n.intersectsNode(e.firstElementChild))return;const r=[];let o;if(e.childNodes.forEach(s=>{n.intersectsNode(s)&&s instanceof HTMLElement&&s.tagName==="LI"&&(r.length===0&&(o=s.previousSibling),r.push(s))}),o instanceof HTMLElement&&o.tagName==="LI"){r.forEach(i=>i.remove());const s=o.parentElement?.tagName.toLowerCase();if(s){const i=document.createElement(s);r.forEach(c=>i.appendChild(c)),o.appendChild(i)}return}}else if(t){const{anchorNode:n}=t;let e;if(n instanceof HTMLElement&&n.tagName==="LI"?e=n:n&&(e=L(n,["LI"])),e){const r=e.previousElementSibling,o=e.parentElement.tagName.toLowerCase();if(r&&r.tagName==="LI"){e.remove();const s=r.querySelector(o);if(s)s.appendChild(e);else{const i=document.createElement(o);i.appendChild(e),r.appendChild(i)}n&&_(n.childNodes?.[0]||n)}return}}}catch{}document.execCommand("indent")}},b0={key:"outdent",icon:x0,onClick:()=>{try{const t=window.getSelection();if(t?.type==="Range"){const n=t.getRangeAt(0),e=n.commonAncestorContainer;if(!(e instanceof HTMLElement))return;const r=[];let o;if(e.tagName==="UL"||e.tagName==="OL"?o=e:e.tagName==="LI"&&(o=e.parentElement),o){o.childNodes.forEach(i=>{n.intersectsNode(i)&&i instanceof HTMLElement&&i.tagName==="LI"&&r.push(i)});const s=o.parentElement;s?.tagName==="LI"&&(r.forEach((i,c)=>{if(c===r.length-1){const a=O(i);if(a.length>0){const l=o.tagName.toLowerCase(),m=i.querySelector(l);if(m)for(const g of a)g.remove(),m.appendChild(g);else{const g=document.createElement(l);i.appendChild(g);for(const h of a)h.remove(),g.appendChild(h)}}}i.remove()}),o.childElementCount===0&&o.remove(),r.reverse().forEach(i=>s.after(i)));return}}else if(t){const{anchorNode:n}=t;let e=null,r=null;n instanceof HTMLElement&&(n.tagName==="UL"||n.tagName==="OL")?(e=n,r=n.querySelector("li")):n&&(e=L(n,["UL","OL"]),r=n instanceof HTMLElement&&n.tagName==="LI"?n:L(n,["LI"]));const o=e?L(e,["UL","OL"]):null;if(e&&o){const s=L(e,["LI"]);if(e.childElementCount===1&&e.remove(),r){const i=O(r);if(i.length>0){const c=document.createElement(e.tagName.toLowerCase());r.appendChild(c);for(const a of i)a.remove(),c.appendChild(a)}s?.after(r),r.lastChild&&_(r.lastChild)}return}}}catch{}document.execCommand("outdent")}},I0={key:"undo",icon:E0,onClick:()=>document.execCommand("undo")},O0={key:"redo",icon:L0,onClick:()=>document.execCommand("redo")};function R0(t,n){const[e,r]=u.useState(!1),o=u.useCallback((a,l)=>{r(!1);const m=a.cloneRange(),g=window.getSelection();if((g?.rangeCount??0)>0&&g?.removeAllRanges(),g?.addRange(m),!m?.toString()&&l?.text&&g){const h=document.createTextNode(l.text),{anchorNode:p}=g;if(p instanceof HTMLElement){const C=p.lastElementChild;C&&C.tagName==="BR"?p.insertBefore(h,C):p.appendChild(h)}else if(p){const C=m.cloneRange();C.selectNodeContents(p),C.setEnd(m.endContainer,m.endOffset);const k=C.toString().length;p.parentElement?.insertBefore(h,p.splitText(k))}m.setStart(h,0),m.setEnd(h,l.text.length)}if(l){const h=m?.startContainer?.parentElement;h&&h.tagName==="A"?(h.setAttribute("href",l.link),h.textContent=l.text,window.getSelection()?.getRangeAt(0)?.selectNodeContents(h)):document.execCommand("createLink",void 0,l.link)}},[]),s=u.useMemo(()=>({key:"link",icon:w0,onClick:()=>{const a=window.getSelection(),l=(a?.rangeCount??0)>0?a?.getRangeAt(0).commonAncestorContainer:null;n.current&&l&&n.current.contains(l)&&r(!0)},activeTest:a=>a.tagName==="A"}),[]),i=u.useMemo(()=>({key:"unlink",icon:_0,onClick:()=>{const a=t(s.activeTest);a&&(window.getSelection()?.getRangeAt(0).selectNodeContents(a),document.execCommand("unlink"))}}),[t]);return{toolbarButtons:[y0,N0,"vr",T0,S0,M0,b0,"vr",s,i,"vr",I0,O0],showLinkModal:e,handleLinkModalClose:o}}function R({className:t,md:n,html:e,disabled:r,onChange:o,...s}){const i=w.useChildTestIdAttrBuilder(s),{aggValue:c,editableDivInnerHtml:a,updateStateFromDiv:l}=a0(n,e);d.useEffect(()=>{o&&c&&o(c)},[c]);const m=f0(l);d.useEffect(()=>{a&&m.current&&(m.current.innerHTML=a.html)},[a]);const{selectionRange:g,selectionDOMContextFind:h}=u0(m),{toolbarButtons:p,showLinkModal:C,handleLinkModalClose:k}=R0(h,m),{height:A,minHeight:B}=s.style??{},y={};return A?y.height=`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@sps-woodland/core"),require("react"),require("@spscommerce/ds-react"),require("@sps-woodland/core/button"),require("@spscommerce/i18n"),require("@sps-woodland/tokens"),require("remark-parse"),require("remark-rehype"),require("rehype-sanitize"),require("rehype-stringify"),require("unified"),require("unist-util-visit"),require("rehype-parse"),require("rehype-remark"),require("remark-stringify")):typeof define==`function`&&define.amd?define([`exports`,`@sps-woodland/core`,`react`,`@spscommerce/ds-react`,`@sps-woodland/core/button`,`@spscommerce/i18n`,`@sps-woodland/tokens`,`remark-parse`,`remark-rehype`,`rehype-sanitize`,`rehype-stringify`,`unified`,`unist-util-visit`,`rehype-parse`,`rehype-remark`,`remark-stringify`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.RichTextEditor={},e.spsWoodlandCore,e.react,e.spscommerceDsReact,e.spsWoodlandCoreButton,e.spscommerceI18n,e.spsWoodlandTokens,e.remarkParse,e.remarkRehype,e.rehypeSanitize,e.rehypeStringify,e.unified,e.unistUtilVisit,e.rehypeParse,e.rehypeRemark,e.remarkStringify))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var g=Object.create,_=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,S=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=y(t),a=0,o=i.length,s;a<o;a++)s=i[a],!x.call(e,s)&&s!==n&&_(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=v(t,s))||r.enumerable});return e},C=(e,t,n)=>(n=e==null?{}:g(b(e)),S(t||!e||!e.__esModule||!x.call(e,`default`)?_(n,`default`,{value:e,enumerable:!0}):n,e));n=C(n,1),s=C(s,1),c=C(c,1),l=C(l,1),u=C(u,1),p=C(p,1),m=C(m,1),h=C(h,1);function w({onClose:e,selectionDOMContextFind:t,selectionRange:o}){let{t:s}=(0,a.useWoodlandLanguage)(),c=n.useRef(o),l=n.useRef(!1),{formValue:u,formMeta:d,updateForm:f}=(0,r.useSpsForm)({text:o?.toString()||``,link:``});return n.useEffect(()=>{if(!l.current){let e=t(e=>e.tagName===`A`);e&&(f({text:e.textContent||``,link:e.getAttribute(`href`)||``}),l.current=!0)}},[t]),n.createElement(r.SpsModal,{title:`Add Link`,onClose:()=>e(c.current)},n.createElement(`div`,{className:`sg-row`},n.createElement(`div`,{className:`sg-col-12`},n.createElement(r.SpsLabel,{for:d.fields.text},s(`richTextEditor.linkModal.text`,{defaultValue:`Text`})),n.createElement(r.SpsTextInput,{formMeta:d.fields.text,value:u.text}))),n.createElement(`div`,{className:`sg-row`},n.createElement(`div`,{className:`sg-col-12`},n.createElement(r.SpsLabel,{for:d.fields.link},s(`richTextEditor.linkModal.link`,{defaultValue:`Link`})),n.createElement(r.SpsTextInput,{formMeta:d.fields.link,value:u.link}))),n.createElement(r.SpsModalFooter,null,n.createElement(i.Button,{onClick:()=>e(c.current,u)},s(`richTextEditor.linkModal.ok`,{defaultValue:`OK`}))))}function ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?T(Object(n),!0).forEach(function(t){ee(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var D=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},O=e=>t=>{var n=e.defaultClassName,r=E(E({},e.defaultVariants),t);for(var i in r){var a=r[i]??e.defaultVariants[i];if(a!=null){var o=a;typeof o==`boolean`&&(o=o===!0?`true`:`false`);var s=e.variantClassNames[i][o];s&&(n+=` `+s)}}for(var[c,l]of e.compoundVariants)D(c,r,e.defaultVariants)&&(n+=` `+l);return n},te=O({defaultClassName:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n0`,variantClassNames:{active:{true:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n1`,false:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n2`}},defaultVariants:{},compoundVariants:[]}),ne={icon:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n3`};function re({icon:e,onClick:t,selectionDOMContextFind:r,activeTest:i,isSimpleToggle:a=!1,...o}){let[s,c]=n.useState(!1);n.useEffect(()=>{i&&c(!!r(i))},[r]);let l=n.useCallback(()=>{t&&t(s),a&&c(!s)},[t,s]);return n.createElement(`button`,{className:te({active:s}),onClick:l,onMouseDown:e=>e.preventDefault(),...o},n.createElement(`span`,{className:ne.icon,style:{backgroundImage:`url("${e}")`},"aria-hidden":`true`}))}var k=O({defaultClassName:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss0`,variantClassNames:{disabled:{true:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss1`,false:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss2`}},defaultVariants:{disabled:!1},compoundVariants:[]}),A=O({defaultClassName:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss3`,variantClassNames:{disabled:{true:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss4`,false:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss5`}},defaultVariants:{},compoundVariants:[]});function j(){return e=>((0,f.visit)(e,`listItem`,e=>{let t=Array.from(e.children);if(t.length>0&&t[0].type===`paragraph`){let n=t[0];e.children=Array.from(n.children).concat(t.slice(1))}}),e)}function M(){let e=(0,n.useMemo)(()=>(0,d.unified)().use(s.default).use(j).use(c.default).use(l.default).use(u.default),[]);return(0,n.useMemo)(()=>function(t){return e.process(t).then(String)},[e])}var N=new Set([`strong`,`emphasis`,`delete`,`link`,`linkReference`]),P=new Set([...N,`paragraph`]);function F(e){return`children`in e}function I(){return e=>{function t(e){for(let n of e.children)F(n)&&t(n);if(e.children=e.children.filter(e=>!(P.has(e.type)&&F(e)&&e.children.length===0)),N.has(e.type))for(;e.children.at(-1)?.type===`break`;)e.children.pop()}return t(e),e}}function L(){let e=(0,n.useMemo)(()=>(0,d.unified)().use(p.default).use(m.default).use(I).use(h.default),[]);return(0,n.useMemo)(()=>function(t){return e.process(t).then(String)},[e])}function R(e=``,t=``){let[r,i]=(0,n.useState)(),[a,o]=(0,n.useState)({html:t}),s=L(),c=M(),l=(0,n.useCallback)(async e=>{let t={md:e,html:await c(e)};return i(t),t},[c]),u=(0,n.useCallback)(async e=>{let t={md:await s(e),html:e};return i(t),t},[s]);(0,n.useEffect)(()=>{!t&&e!==r?.md?l(e).then(({html:e})=>{o({html:e})}):!e&&t&&t!==r?.html&&u(t)},[e,t]);function d(e){e.current&&u(e.current.innerHTML)}return{aggValue:r,editableDivInnerHtml:a,updateStateFromDiv:d}}function z(e){if(e instanceof HTMLElement){for(let t of Array.from(e.attributes))/(style|class|data-[^=]+)/.test(t.name)&&e.removeAttribute(t.name);e.innerHTML=e.innerHTML.replace(/(style|class|data-[^=]+)="[^"]+"/g,``)}}var B=[{regex:/\*\*([^*]+)\*\*/,command:`bold`},{regex:/(?<!\*)\*([^*]+)\*/,command:`italic`},{regex:/^\*[ \u00a0]/,command:`insertUnorderedList`},{regex:/^1\.[ \u00a0]/,command:`insertOrderedList`},{regex:/\[([^\]]+)\]\(([^)]+)\)/,command:`createLink`,getCommandArg:([,,e])=>/^https?:\/\//.test(e)?e:`https://${e}`}];function V(e,t,n){let r=document.createRange();r.setStart(e,t),r.setEnd(e,n);let i=window.getSelection();i?.removeAllRanges(),i?.addRange(r)}function H(e){let t=document.createRange();t.setStartAfter(e),t.setEndAfter(e);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)}function U(e){let t=document.createRange();t.setStartBefore(e),t.setEndBefore(e);let n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)}function W(e){let t=(0,n.useRef)(null),r=(0,n.useMemo)(()=>new MutationObserver(([n])=>{if(n.type===`characterData`&&n.oldValue&&n.target.textContent){for(let e of B)if(!e.regex.test(n.oldValue)&&e.regex.test(n.target.textContent)){let t=e.regex.exec(n.target.textContent),[r,i=``]=t,a=n.target.textContent.indexOf(r);n.target.textContent=n.target.textContent.replace(r,i);let o=a+i.length;V(n.target,a,o);let s=e.getCommandArg?e.getCommandArg(t):void 0;document.execCommand(e.command,void 0,s),i&&(H(n.target.parentNode),document.execCommand(e.command))}}else n.type===`childList`&&Array.from(n.addedNodes).forEach(e=>{let t;if(e instanceof HTMLElement&&e.tagName===`LI`?t=e:e?.parentElement?.tagName===`LI`&&(t=e?.parentElement),t){let e=t.nextElementSibling,n=e?.childNodes?.[0];if(n instanceof HTMLElement&&[`UL`,`OL`].includes(n.tagName)){let t=document.createElement(`br`);e.insertBefore(t,n),U(t)}}z(e)});e(t)}),[]);return(0,n.useEffect)(()=>()=>{r&&r.disconnect()},[]),(0,n.useEffect)(()=>{t.current!==null&&r.observe(t.current,{childList:!0,subtree:!0,characterDataOldValue:!0})},[r,t]),t}function ie(e){let[t,r]=(0,n.useState)();return(0,n.useEffect)(()=>{function e(){let e=window.getSelection();Number(e?.rangeCount)>0&&r(e?.getRangeAt(0))}return document.addEventListener(`selectionchange`,e),()=>{document.removeEventListener(`selectionchange`,e)}},[]),{selectionRange:t,selectionDOMContextFind:(0,n.useCallback)(n=>{if(!t)return null;let r=t.commonAncestorContainer;if(!e.current||!e.current.contains(r))return null;let i=r instanceof HTMLElement?r:r.parentElement;for(;i&&i!==e.current;){if(n(i))return i;i=i.parentElement}return null},[t])}}var G=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eBold%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-103.000000)'%20fill='%234B5356'%20fill-rule='nonzero'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%202.000000)'%20id='B'%3e%3cg%20transform='translate(3.550000,%202.130000)'%3e%3cpath%20d='M0,0%20L4.014,0%20C4.626,0%205.193,0.045%205.715,0.135%20C6.237,0.225%206.693,0.384%207.083,0.612%20C7.473,0.84%207.779,1.14%208.001,1.512%20C8.223,1.884%208.334,2.352%208.334,2.916%20C8.334,3.18%208.295,3.444%208.217,3.708%20C8.139,3.972%208.022,4.218%207.866,4.446%20C7.71,4.674%207.506,4.878%207.254,5.058%20C7.002,5.238%206.708,5.37%206.372,5.454%20L6.372,5.526%20C7.212,5.682%207.845,5.982%208.271,6.426%20C8.697,6.87%208.91,7.488%208.91,8.28%20C8.91,8.88%208.793,9.396%208.559,9.828%20C8.325,10.26%208.001,10.617%207.587,10.899%20C7.173,11.181%206.69,11.391%206.138,11.529%20C5.586,11.667%204.992,11.736%204.356,11.736%20L0,11.736%20L0,0%20Z%20M3.888,4.734%20C4.536,4.734%205.007,4.605%205.301,4.347%20C5.595,4.089%205.742,3.738%205.742,3.294%20C5.742,2.85%205.592,2.532%205.292,2.34%20C4.992,2.148%204.53,2.052%203.906,2.052%20L2.646,2.052%20L2.646,4.734%20L3.888,4.734%20Z%20M4.14,9.684%20C5.592,9.684%206.318,9.15%206.318,8.082%20C6.318,7.566%206.138,7.191%205.778,6.957%20C5.418,6.723%204.872,6.606%204.14,6.606%20L2.646,6.606%20L2.646,9.684%20L4.14,9.684%20Z'%20id='Shape'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,K=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIndent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-282.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20182.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.20857552,7.99286089%20C5.20857552,8.06428955%205.18178977,8.14464678%205.12821828,8.19821828%20L2.27107201,11.0553645%20C2.21750052,11.108936%202.13714328,11.1357218%202.06571463,11.1357218%20C1.91392873,11.1357218%201.78,11.001793%201.78,10.85%20L1.78,5.13571463%20C1.78,4.97500015%201.90500015,4.85%202.06571463,4.85%20C2.14607186,4.85%202.21750052,4.88571433%202.28,4.93928582%20L5.12821828,7.7875035%20C5.18178977,7.84107499%205.20857552,7.92143223%205.20857552,7.99286089%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,q=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eItalics%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-148.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2047.000000)'%3e%3cg%20id='I'%20transform='translate(5.600000,%202.130000)'%20fill-rule='nonzero'%3e%3cpolygon%20id='Path'%20points='2.358%200%204.824%200%202.484%2011.736%200%2011.736'%3e%3c/polygon%3e%3c/g%3e%3crect%20id='Rectangle'%20x='5.5'%20y='2'%20width='7'%20height='1.5'%3e%3c/rect%3e%3crect%20id='Rectangle-Copy'%20x='3.5'%20y='12.5'%20width='7'%20height='1.5'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,J=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-401.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Icon/icon-link'%20transform='translate(254.000000,%2032.000000)'%3e%3cpath%20d='M9.28515625,6.03125%20C9.33984402,6.06770852%209.39908822,6.11328098%209.46289062,6.16796875%20C9.52669303,6.22265652%209.58593723,6.26822898%209.640625,6.3046875%20L9.6953125,6.359375%20C10.3333365,7.01562828%2010.6523438,7.79947461%2010.6523438,8.7109375%20C10.6523438,9.62240039%2010.3333365,10.4062467%209.6953125,11.0625%20L6.6875,14.0429688%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429688%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367188%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.0625,7.20703125%20C4.04427074,7.51692863%204.06249973,7.82682137%204.1171875,8.13671875%20C4.17187527,8.44661613%204.2630202,8.73827988%204.390625,9.01171875%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367188%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492188%20C3.45182465,13.3138039%203.87109129,13.4960938%204.36328125,13.4960938%20C4.85547121,13.4960938%205.27473785,13.3138039%205.62109375,12.9492188%20L8.6015625,9.96875%20C8.9479184,9.6223941%209.12109375,9.20312746%209.12109375,8.7109375%20C9.12109375,8.21874754%208.9479184,7.7994809%208.6015625,7.453125%20L8.546875,7.3984375%20C8.49218723,7.34374973%208.43750027,7.29362002%208.3828125,7.24804688%20C8.32812473,7.20247373%208.26432328,7.16145852%208.19140625,7.125%20L9.28515625,6.03125%20Z%20M11.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882812,1.95703125%20L14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.9375,8.79296875%20C11.9557293,8.48307137%2011.9375003,8.17317863%2011.8828125,7.86328125%20C11.8281247,7.55338387%2011.7369798,7.26172012%2011.609375,6.98828125%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945312,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789062,3.05078125%20L7.3984375,6.03125%20C7.0520816,6.3776059%206.87890625,6.79687254%206.87890625,7.2890625%20C6.87890625,7.78125246%207.0520816,8.2005191%207.3984375,8.546875%20L7.453125,8.6015625%20C7.50781277,8.65625027%207.56249973,8.70637998%207.6171875,8.75195312%20C7.67187527,8.79752627%207.73567672,8.83854148%207.80859375,8.875%20L6.71484375,9.96875%20C6.66015598,9.93229148%206.60091178,9.88671902%206.53710938,9.83203125%20C6.47330697,9.77734348%206.41406277,9.73177102%206.359375,9.6953125%20L6.3046875,9.640625%20C5.66666348,8.98437172%205.34765625,8.20052539%205.34765625,7.2890625%20C5.34765625,6.37759961%205.66666348,5.59375328%206.3046875,4.9375%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,Y=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='14px'%20viewBox='0%200%2015%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOrdered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-192.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2092.000000)'%3e%3crect%20id='Rectangle-223-Copy-3'%20x='5'%20y='2.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy-2'%20x='5'%20y='7'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy'%20x='5'%20y='11.5'%20width='11'%20height='2'%3e%3c/rect%3e%3cg%20id='1'%20transform='translate(1.500000,%201.900000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0,2.58%20L0.69,2.58%20L0.69,0.745%20L0.095,0.745%20L0.095,0.29%20C0.268333333,0.256666667%200.415,0.216666667%200.535,0.17%20C0.655,0.123333333%200.771666667,0.0666666667%200.885,0%20L1.425,0%20L1.425,2.58%20L2.02,2.58%20L2.02,3.175%20L0,3.175%20L0,2.58%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='2'%20transform='translate(1.355000,%206.400000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.035,2.815%20C0.238333333,2.625%200.424166667,2.4475%200.5925,2.2825%20C0.760833333,2.1175%200.905833333,1.9625%201.0275,1.8175%20C1.14916667,1.6725%201.24416667,1.5375%201.3125,1.4125%20C1.38083333,1.2875%201.415,1.16833333%201.415,1.055%20C1.415,0.898333333%201.375,0.779166667%201.295,0.6975%20C1.215,0.615833333%201.105,0.575%200.965,0.575%20C0.848333333,0.575%200.745,0.6075%200.655,0.6725%20C0.565,0.7375%200.48,0.813333333%200.4,0.9%20L0,0.505%20C0.156666667,0.338333333%200.316666667,0.2125%200.48,0.1275%20C0.643333333,0.0425%200.838333333,0%201.065,0%20C1.22166667,0%201.36416667,0.0241666667%201.4925,0.0725%20C1.62083333,0.120833333%201.73166667,0.189166667%201.825,0.2775%20C1.91833333,0.365833333%201.99,0.471666667%202.04,0.595%20C2.09,0.718333333%202.115,0.856666667%202.115,1.01%20C2.115,1.14333333%202.08666667,1.27916667%202.03,1.4175%20C1.97333333,1.55583333%201.8975,1.69416667%201.8025,1.8325%20C1.7075,1.97083333%201.59916667,2.10916667%201.4775,2.2475%20C1.35583333,2.38583333%201.23,2.52166667%201.1,2.655%20C1.18,2.645%201.26916667,2.63583333%201.3675,2.6275%20C1.46583333,2.61916667%201.55333333,2.615%201.63,2.615%20L2.27,2.615%20L2.27,3.235%20L0.035,3.235%20L0.035,2.815%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='3'%20transform='translate(1.350000,%2010.800000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.34,2.38%20C0.436666667,2.47333333%200.5425,2.55%200.6575,2.61%20C0.7725,2.67%200.898333333,2.7%201.035,2.7%20C1.19166667,2.7%201.31666667,2.6675%201.41,2.6025%20C1.50333333,2.5375%201.55,2.445%201.55,2.325%20C1.55,2.255%201.5375,2.19166667%201.5125,2.135%20C1.4875,2.07833333%201.44333333,2.03083333%201.38,1.9925%20C1.31666667,1.95416667%201.23,1.92416667%201.12,1.9025%20C1.01,1.88083333%200.868333333,1.87%200.695,1.87%20L0.695,1.35%20C0.838333333,1.35%200.9575,1.34%201.0525,1.32%20C1.1475,1.3%201.22416667,1.27083333%201.2825,1.2325%20C1.34083333,1.19416667%201.3825,1.14916667%201.4075,1.0975%20C1.4325,1.04583333%201.445,0.988333333%201.445,0.925%20C1.445,0.815%201.41166667,0.729166667%201.345,0.6675%20C1.27833333,0.605833333%201.18166667,0.575%201.055,0.575%20C0.941666667,0.575%200.839166667,0.6%200.7475,0.65%20C0.655833333,0.7%200.56,0.768333333%200.46,0.855%20L0.09,0.405%20C0.236666667,0.278333333%200.390833333,0.179166667%200.5525,0.1075%20C0.714166667,0.0358333333%200.893333333,0%201.09,0%20C1.25333333,0%201.4025,0.0191666667%201.5375,0.0575%20C1.6725,0.0958333333%201.7875,0.1525%201.8825,0.2275%20C1.9775,0.3025%202.05166667,0.393333333%202.105,0.5%20C2.15833333,0.606666667%202.185,0.73%202.185,0.87%20C2.185,1.03666667%202.13916667,1.1775%202.0475,1.2925%20C1.95583333,1.4075%201.825,1.50166667%201.655,1.575%20L1.655,1.595%20C1.83833333,1.64833333%201.98916667,1.73916667%202.1075,1.8675%20C2.22583333,1.99583333%202.285,2.16333333%202.285,2.37%20C2.285,2.51666667%202.25333333,2.6475%202.19,2.7625%20C2.12666667,2.8775%202.04166667,2.97416667%201.935,3.0525%20C1.82833333,3.13083333%201.70333333,3.19083333%201.56,3.2325%20C1.41666667,3.27416667%201.265,3.295%201.105,3.295%20C0.845,3.295%200.625,3.25416667%200.445,3.1725%20C0.265,3.09083333%200.116666667,2.98166667%200,2.845%20L0.34,2.38%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,ae=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOutdent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-327.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20227.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.21357552,10.85%20C5.21357552,11.001793%205.08857537,11.1357218%204.92786089,11.1357218%20C4.84750365,11.1357218%204.77607499,11.1000075%204.71357492,11.046436%20L1.86535724,8.1892897%20C1.81178575,8.1357182%201.785,8.06428955%201.785,7.99286089%20C1.785,7.91250365%201.81178575,7.84107499%201.86535724,7.7875035%20L4.7225035,4.93035724%20C4.77607499,4.87678575%204.85643223,4.85%204.92786089,4.85%20C5.07964678,4.85%205.21357552,4.97500015%205.21357552,5.13571463%20L5.21357552,10.85%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,oe=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-520.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-8'%20transform='translate(363.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,se=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-484.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-9'%20transform='translate(345.000000,%2040.000000)%20scale(-1,%201)%20translate(-345.000000,%20-40.000000)%20translate(327.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,ce=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='16px'%20viewBox='0%200%2014%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnlink%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-371.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20272.000000)'%3e%3cpath%20d='M14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.1027446,9.58420181%20L10.3518996,8.27890801%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945313,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789063,3.05078125%20L8.41457939,4.92175579%20L7.64047964,3.57621944%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882813,1.95703125%20L14.0429688,2.01171875%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M8.02641916,12.7072184%20L6.6875,14.0429687%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429687%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367187%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.57246065,6.71787083%20L5.34566408,8.05009655%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367187%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492187%20C3.45182465,13.3138039%203.87109129,13.4960937%204.36328125,13.4960937%20C4.85547121,13.4960937%205.27473785,13.3138039%205.62109375,12.9492187%20L7.2646265,11.388324%20L8.02641916,12.7072184%20Z'%20id='Path'%3e%3c/path%3e%3crect%20id='Rectangle'%20transform='translate(7.750000,%208.000000)%20rotate(-30.000000)%20translate(-7.750000,%20-8.000000)%20'%20x='7'%20y='0'%20width='1.5'%20height='16'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,le=`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='12px'%20viewBox='0%200%2015%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnordered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-238.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20137.000000)'%3e%3cg%20transform='translate(1.000000,%202.000000)'%3e%3crect%20id='Rectangle-223'%20x='4'%20y='0.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='9.5'%20width='11'%20height='2'%3e%3c/rect%3e%3ccircle%20id='Oval'%20cx='1.5'%20cy='1.5'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy'%20cx='1.5'%20cy='6'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy-2'%20cx='1.5'%20cy='10.5'%20r='1.5'%3e%3c/circle%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e`,X=(e,t)=>{let n=e;for(;n.parentElement&&!t.includes(n.parentElement.tagName);)n=n.parentElement;return n.parentElement&&t.includes(n.parentElement.tagName)?n.parentElement:null},Z=e=>{let t=[],n=e;for(;n.nextElementSibling;)t.push(n.nextElementSibling),n=n.nextElementSibling;return t},ue={key:`bold`,icon:G,onClick:()=>document.execCommand(`bold`),activeTest:e=>[`B`,`STRONG`].includes(e.tagName),isSimpleToggle:!0},de={key:`italics`,icon:q,onClick:()=>document.execCommand(`italic`),activeTest:e=>[`I`,`EM`].includes(e.tagName),isSimpleToggle:!0},fe={key:`ul`,icon:le,onClick:()=>document.execCommand(`insertUnorderedList`),activeTest:e=>e.tagName===`UL`},pe={key:`ol`,icon:Y,onClick:()=>document.execCommand(`insertOrderedList`),activeTest:e=>e.tagName===`OL`},me={key:`indent`,icon:K,onClick:()=>{try{let e=window.getSelection();if(e?.type===`Range`){let t=e.getRangeAt(0),n=t.commonAncestorContainer;if(!(n instanceof HTMLElement)||(n.tagName===`UL`||n.tagName===`OL`||n.tagName===`LI`)&&n.firstElementChild&&t.intersectsNode(n.firstElementChild))return;let r=[],i;if(n.childNodes.forEach(e=>{t.intersectsNode(e)&&e instanceof HTMLElement&&e.tagName===`LI`&&(r.length===0&&(i=e.previousSibling),r.push(e))}),i instanceof HTMLElement&&i.tagName===`LI`){r.forEach(e=>e.remove());let e=i.parentElement?.tagName.toLowerCase();if(e){let t=document.createElement(e);r.forEach(e=>t.appendChild(e)),i.appendChild(t)}return}}else if(e){let{anchorNode:t}=e,n;if(t instanceof HTMLElement&&t.tagName===`LI`?n=t:t&&(n=X(t,[`LI`])),n){let e=n.previousElementSibling,r=n.parentElement.tagName.toLowerCase();if(e&&e.tagName===`LI`){n.remove();let i=e.querySelector(r);if(i)i.appendChild(n);else{let t=document.createElement(r);t.appendChild(n),e.appendChild(t)}t&&H(t.childNodes?.[0]||t)}return}}}catch{}document.execCommand(`indent`)}},Q={key:`outdent`,icon:ae,onClick:()=>{try{let e=window.getSelection();if(e?.type===`Range`){let t=e.getRangeAt(0),n=t.commonAncestorContainer;if(!(n instanceof HTMLElement))return;let r=[],i;if(n.tagName===`UL`||n.tagName===`OL`?i=n:n.tagName===`LI`&&(i=n.parentElement),i){i.childNodes.forEach(e=>{t.intersectsNode(e)&&e instanceof HTMLElement&&e.tagName===`LI`&&r.push(e)});let e=i.parentElement;e?.tagName===`LI`&&(r.forEach((e,t)=>{if(t===r.length-1){let t=Z(e);if(t.length>0){let n=i.tagName.toLowerCase(),r=e.querySelector(n);if(r)for(let e of t)e.remove(),r.appendChild(e);else{let r=document.createElement(n);e.appendChild(r);for(let e of t)e.remove(),r.appendChild(e)}}}e.remove()}),i.childElementCount===0&&i.remove(),r.reverse().forEach(t=>e.after(t)));return}}else if(e){let{anchorNode:t}=e,n=null,r=null;t instanceof HTMLElement&&(t.tagName===`UL`||t.tagName===`OL`)?(n=t,r=t.querySelector(`li`)):t&&(n=X(t,[`UL`,`OL`]),r=t instanceof HTMLElement&&t.tagName===`LI`?t:X(t,[`LI`]));let i=n?X(n,[`UL`,`OL`]):null;if(n&&i){let e=X(n,[`LI`]);if(n.childElementCount===1&&n.remove(),r){let t=Z(r);if(t.length>0){let e=document.createElement(n.tagName.toLowerCase());r.appendChild(e);for(let n of t)n.remove(),e.appendChild(n)}e?.after(r),r.lastChild&&H(r.lastChild)}return}}}catch{}document.execCommand(`outdent`)}},he={key:`undo`,icon:se,onClick:()=>document.execCommand(`undo`)},ge={key:`redo`,icon:oe,onClick:()=>document.execCommand(`redo`)};function _e(e,t){let[r,i]=(0,n.useState)(!1),a=(0,n.useCallback)((e,t)=>{i(!1);let n=e.cloneRange(),r=window.getSelection();if((r?.rangeCount??0)>0&&r?.removeAllRanges(),r?.addRange(n),!n?.toString()&&t?.text&&r){let e=document.createTextNode(t.text),{anchorNode:i}=r;if(i instanceof HTMLElement){let t=i.lastElementChild;t&&t.tagName===`BR`?i.insertBefore(e,t):i.appendChild(e)}else if(i){let t=n.cloneRange();t.selectNodeContents(i),t.setEnd(n.endContainer,n.endOffset);let r=t.toString().length;i.parentElement?.insertBefore(e,i.splitText(r))}n.setStart(e,0),n.setEnd(e,t.text.length)}if(t){let e=n?.startContainer?.parentElement;e&&e.tagName===`A`?(e.setAttribute(`href`,t.link),e.textContent=t.text,(window.getSelection()?.getRangeAt(0))?.selectNodeContents(e)):document.execCommand(`createLink`,void 0,t.link)}},[]),o=(0,n.useMemo)(()=>({key:`link`,icon:J,onClick:()=>{let e=window.getSelection(),n=(e?.rangeCount??0)>0?e?.getRangeAt(0).commonAncestorContainer:null;t.current&&n&&t.current.contains(n)&&i(!0)},activeTest:e=>e.tagName===`A`}),[]);return{toolbarButtons:[ue,de,`vr`,fe,pe,me,Q,`vr`,o,(0,n.useMemo)(()=>({key:`unlink`,icon:ce,onClick:()=>{let t=e(o.activeTest);t&&(window.getSelection()?.getRangeAt(0).selectNodeContents(t),document.execCommand(`unlink`))}}),[e]),`vr`,he,ge],showLinkModal:r,handleLinkModalClose:a}}function $({className:e,md:r,html:i,disabled:a,onChange:s,...c}){let l=(0,t.useChildTestIdAttrBuilder)(c),{aggValue:u,editableDivInnerHtml:d,updateStateFromDiv:f}=R(r,i);n.useEffect(()=>{s&&u&&s(u)},[u]);let p=W(f);n.useEffect(()=>{d&&p.current&&(p.current.innerHTML=d.html)},[d]);let{selectionRange:m,selectionDOMContextFind:h}=ie(p),{toolbarButtons:g,showLinkModal:_,handleLinkModalClose:v}=_e(h,p),{height:y,minHeight:b}=c.style??{},x={};return y?x.height=`
|
|
2
2
|
calc(
|
|
3
|
-
${
|
|
4
|
-
- ${
|
|
5
|
-
- (2 * ${
|
|
6
|
-
- (2 * ${
|
|
7
|
-
)`:
|
|
3
|
+
${y}
|
|
4
|
+
- ${o.Tokens.component[`rich-text-editor`].vr.height}
|
|
5
|
+
- (2 * ${o.Tokens.component[`rich-text-editor`].border.width})
|
|
6
|
+
- (2 * ${o.Tokens.component[`rich-text-editor`].padding.input.y})
|
|
7
|
+
)`:b&&(x.minHeight=`
|
|
8
8
|
calc(
|
|
9
|
-
${
|
|
10
|
-
- ${
|
|
11
|
-
- (2 * ${
|
|
12
|
-
- (2 * ${
|
|
13
|
-
)`),
|
|
9
|
+
${b}
|
|
10
|
+
- ${o.Tokens.component[`rich-text-editor`].vr.height}
|
|
11
|
+
- (2 * ${o.Tokens.component[`rich-text-editor`].border.width})
|
|
12
|
+
- (2 * ${o.Tokens.component[`rich-text-editor`].padding.input.y})
|
|
13
|
+
)`),n.createElement(`div`,{className:(0,t.cl)(k({disabled:a}),e),...c},!a&&n.createElement(n.Fragment,null,n.createElement(`div`,{className:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss6`,...l(`toolbar`)},g.map((e,t)=>e===`vr`?n.createElement(`div`,{className:`pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss7`,key:`vr-${t}`}):n.createElement(re,{...e,selectionDOMContextFind:h,...l(`button-${e.key}`)}))),_&&n.createElement(w,{onClose:v,selectionDOMContextFind:h,selectionRange:m})),n.createElement(`div`,{className:A({disabled:a}),ref:p,contentEditable:!a,...l(`input`),style:x}))}t.Metadata.set($,{name:`RichTextEditor`,props:{md:`string`,html:`string`,disabled:{type:`boolean`,default:`false`},onChange:`(newValue: RichTextEditorAggregateValue) => void`}}),e.RichTextEditor=$});
|
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import { useSpsForm as E, SpsModal as k, SpsLabel as c, SpsTextInput as u, SpsModalFooter as x } from "@spscommerce/ds-react";
|
|
2
|
-
import { Button as p } from "@sps-woodland/core/button";
|
|
3
|
-
import { useWoodlandLanguage as g } from "@spscommerce/i18n";
|
|
4
1
|
import * as e from "react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
import { useWoodlandLanguage as t } from "@spscommerce/i18n";
|
|
3
|
+
import { Button as n } from "@sps-woodland/core/button";
|
|
4
|
+
import { SpsLabel as r, SpsModal as i, SpsModalFooter as a, SpsTextInput as o, useSpsForm as s } from "@spscommerce/ds-react";
|
|
5
|
+
//#region src/rich-text-editor/rich-text-editor/RTELinkModal.tsx
|
|
6
|
+
function c({ onClose: c, selectionDOMContextFind: l, selectionRange: u }) {
|
|
7
|
+
let { t: d } = t(), f = e.useRef(u), p = e.useRef(!1), { formValue: m, formMeta: h, updateForm: g } = s({
|
|
8
|
+
text: u?.toString() || "",
|
|
9
|
+
link: ""
|
|
10
|
+
});
|
|
11
|
+
return e.useEffect(() => {
|
|
12
|
+
if (!p.current) {
|
|
13
|
+
let e = l((e) => e.tagName === "A");
|
|
14
|
+
e && (g({
|
|
15
|
+
text: e.textContent || "",
|
|
16
|
+
link: e.getAttribute("href") || ""
|
|
17
|
+
}), p.current = !0);
|
|
18
|
+
}
|
|
19
|
+
}, [l]), /* @__PURE__ */ e.createElement(i, {
|
|
20
|
+
title: "Add Link",
|
|
21
|
+
onClose: () => c(f.current)
|
|
22
|
+
}, /* @__PURE__ */ e.createElement("div", { className: "sg-row" }, /* @__PURE__ */ e.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ e.createElement(r, { for: h.fields.text }, d("richTextEditor.linkModal.text", { defaultValue: "Text" })), /* @__PURE__ */ e.createElement(o, {
|
|
23
|
+
formMeta: h.fields.text,
|
|
24
|
+
value: m.text
|
|
25
|
+
}))), /* @__PURE__ */ e.createElement("div", { className: "sg-row" }, /* @__PURE__ */ e.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ e.createElement(r, { for: h.fields.link }, d("richTextEditor.linkModal.link", { defaultValue: "Link" })), /* @__PURE__ */ e.createElement(o, {
|
|
26
|
+
formMeta: h.fields.link,
|
|
27
|
+
value: m.link
|
|
28
|
+
}))), /* @__PURE__ */ e.createElement(a, null, /* @__PURE__ */ e.createElement(n, { onClick: () => c(f.current, m) }, d("richTextEditor.linkModal.ok", { defaultValue: "OK" }))));
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { c as RTELinkModal };
|
|
@@ -1,38 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onClick: u,
|
|
23
|
-
onMouseDown: (f) => f.preventDefault(),
|
|
24
|
-
...l
|
|
25
|
-
},
|
|
26
|
-
/* @__PURE__ */ e.createElement(
|
|
27
|
-
"span",
|
|
28
|
-
{
|
|
29
|
-
className: m.icon,
|
|
30
|
-
style: { backgroundImage: `url("${r}")` },
|
|
31
|
-
"aria-hidden": "true"
|
|
32
|
-
}
|
|
33
|
-
)
|
|
34
|
-
);
|
|
1
|
+
import { button as e, className as t } from "./RTEToolbarButton.ve.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
//#region src/rich-text-editor/rich-text-editor/RTEToolbarButton.tsx
|
|
4
|
+
function r({ icon: r, onClick: i, selectionDOMContextFind: a, activeTest: o, isSimpleToggle: s = !1, ...c }) {
|
|
5
|
+
let [l, u] = n.useState(!1);
|
|
6
|
+
n.useEffect(() => {
|
|
7
|
+
o && u(!!a(o));
|
|
8
|
+
}, [a]);
|
|
9
|
+
let d = n.useCallback(() => {
|
|
10
|
+
i && i(l), s && u(!l);
|
|
11
|
+
}, [i, l]);
|
|
12
|
+
return /* @__PURE__ */ n.createElement("button", {
|
|
13
|
+
className: e({ active: l }),
|
|
14
|
+
onClick: d,
|
|
15
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
16
|
+
...c
|
|
17
|
+
}, /* @__PURE__ */ n.createElement("span", {
|
|
18
|
+
className: t.icon,
|
|
19
|
+
style: { backgroundImage: `url("${r}")` },
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}));
|
|
35
22
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as RTEToolbarButton };
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { createRuntimeFn as e } from "../../node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js";
|
|
1
2
|
/* empty css */
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
//#region src/rich-text-editor/rich-text-editor/RTEToolbarButton.css.ts
|
|
4
|
+
var t = e({
|
|
5
|
+
defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n0",
|
|
6
|
+
variantClassNames: { active: {
|
|
7
|
+
true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n1",
|
|
8
|
+
false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n2"
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: {},
|
|
11
|
+
compoundVariants: []
|
|
12
|
+
}), n = { icon: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1903a6n3" };
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as button, n as className };
|
|
@@ -1,81 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const o = N(g);
|
|
24
|
-
e.useEffect(() => {
|
|
25
|
-
a && o.current && (o.current.innerHTML = a.html);
|
|
26
|
-
}, [a]);
|
|
27
|
-
const { selectionRange: T, selectionDOMContextFind: l } = F(o), { toolbarButtons: v, showLinkModal: x, handleLinkModalClose: R } = I(
|
|
28
|
-
l,
|
|
29
|
-
o
|
|
30
|
-
), { height: h, minHeight: p } = r.style ?? {}, m = {};
|
|
31
|
-
return h ? m.height = `
|
|
1
|
+
import { RTELinkModal as e } from "./RTELinkModal.js";
|
|
2
|
+
import { RTEToolbarButton as t } from "./RTEToolbarButton.js";
|
|
3
|
+
import { richTextEditor as n, rteEditableDiv as r } from "./RichTextEditor.ve.js";
|
|
4
|
+
import { useRTEContent as i } from "./hooks/useRTEContent.js";
|
|
5
|
+
import { useRTEObserver as a } from "./hooks/useRTEObserver.js";
|
|
6
|
+
import { useRTESelectionListener as o } from "./hooks/useRTESelectionListener.js";
|
|
7
|
+
import { useRTEToolbarButtons as s } from "./hooks/useRTEToolbarButtons.js";
|
|
8
|
+
import { Metadata as c, cl as l, useChildTestIdAttrBuilder as u } from "@sps-woodland/core";
|
|
9
|
+
import * as d from "react";
|
|
10
|
+
import { Tokens as f } from "@sps-woodland/tokens";
|
|
11
|
+
//#region src/rich-text-editor/rich-text-editor/RichTextEditor.tsx
|
|
12
|
+
function p({ className: c, md: p, html: m, disabled: h, onChange: g, ..._ }) {
|
|
13
|
+
let v = u(_), { aggValue: y, editableDivInnerHtml: b, updateStateFromDiv: x } = i(p, m);
|
|
14
|
+
d.useEffect(() => {
|
|
15
|
+
g && y && g(y);
|
|
16
|
+
}, [y]);
|
|
17
|
+
let S = a(x);
|
|
18
|
+
d.useEffect(() => {
|
|
19
|
+
b && S.current && (S.current.innerHTML = b.html);
|
|
20
|
+
}, [b]);
|
|
21
|
+
let { selectionRange: C, selectionDOMContextFind: w } = o(S), { toolbarButtons: T, showLinkModal: E, handleLinkModalClose: D } = s(w, S), { height: O, minHeight: k } = _.style ?? {}, A = {};
|
|
22
|
+
return O ? A.height = `
|
|
32
23
|
calc(
|
|
33
|
-
${
|
|
34
|
-
- ${
|
|
35
|
-
- (2 * ${
|
|
36
|
-
- (2 * ${
|
|
37
|
-
)` :
|
|
24
|
+
${O}
|
|
25
|
+
- ${f.component["rich-text-editor"].vr.height}
|
|
26
|
+
- (2 * ${f.component["rich-text-editor"].border.width})
|
|
27
|
+
- (2 * ${f.component["rich-text-editor"].padding.input.y})
|
|
28
|
+
)` : k && (A.minHeight = `
|
|
38
29
|
calc(
|
|
39
|
-
${
|
|
40
|
-
- ${
|
|
41
|
-
- (2 * ${
|
|
42
|
-
- (2 * ${
|
|
43
|
-
)`), /* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
));
|
|
30
|
+
${k}
|
|
31
|
+
- ${f.component["rich-text-editor"].vr.height}
|
|
32
|
+
- (2 * ${f.component["rich-text-editor"].border.width})
|
|
33
|
+
- (2 * ${f.component["rich-text-editor"].padding.input.y})
|
|
34
|
+
)`), /* @__PURE__ */ d.createElement("div", {
|
|
35
|
+
className: l(n({ disabled: h }), c),
|
|
36
|
+
..._
|
|
37
|
+
}, !h && /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", {
|
|
38
|
+
className: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss6",
|
|
39
|
+
...v("toolbar")
|
|
40
|
+
}, T.map((e, n) => e === "vr" ? /* @__PURE__ */ d.createElement("div", {
|
|
41
|
+
className: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss7",
|
|
42
|
+
key: `vr-${n}`
|
|
43
|
+
}) : /* @__PURE__ */ d.createElement(t, {
|
|
44
|
+
...e,
|
|
45
|
+
selectionDOMContextFind: w,
|
|
46
|
+
...v(`button-${e.key}`)
|
|
47
|
+
}))), E && /* @__PURE__ */ d.createElement(e, {
|
|
48
|
+
onClose: D,
|
|
49
|
+
selectionDOMContextFind: w,
|
|
50
|
+
selectionRange: C
|
|
51
|
+
})), /* @__PURE__ */ d.createElement("div", {
|
|
52
|
+
className: r({ disabled: h }),
|
|
53
|
+
ref: S,
|
|
54
|
+
contentEditable: !h,
|
|
55
|
+
...v("input"),
|
|
56
|
+
style: A
|
|
57
|
+
}));
|
|
69
58
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
c.set(p, {
|
|
60
|
+
name: "RichTextEditor",
|
|
61
|
+
props: {
|
|
62
|
+
md: "string",
|
|
63
|
+
html: "string",
|
|
64
|
+
disabled: {
|
|
65
|
+
type: "boolean",
|
|
66
|
+
default: "false"
|
|
67
|
+
},
|
|
68
|
+
onChange: "(newValue: RichTextEditorAggregateValue) => void"
|
|
69
|
+
}
|
|
78
70
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { p as RichTextEditor };
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
import { createRuntimeFn as e } from "../../node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js";
|
|
1
2
|
/* empty css */
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
3
|
+
//#region src/rich-text-editor/rich-text-editor/RichTextEditor.css.ts
|
|
4
|
+
var t = e({
|
|
5
|
+
defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss0",
|
|
6
|
+
variantClassNames: { disabled: {
|
|
7
|
+
true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss1",
|
|
8
|
+
false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss2"
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: { disabled: !1 },
|
|
11
|
+
compoundVariants: []
|
|
12
|
+
}), n = e({
|
|
13
|
+
defaultClassName: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss3",
|
|
14
|
+
variantClassNames: { disabled: {
|
|
15
|
+
true: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss4",
|
|
16
|
+
false: "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss5"
|
|
17
|
+
} },
|
|
18
|
+
defaultVariants: {},
|
|
19
|
+
compoundVariants: []
|
|
20
|
+
}), r = "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss6", i = "pkg_sps-woodland_core__family_rich-text-editor__version_8_56_3__hash_1f3v2ss7";
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as richTextEditor, n as rteEditableDiv, r as rteToolbar, i as vr };
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
() => function(o) {
|
|
14
|
-
return r.process(o).then(String);
|
|
15
|
-
},
|
|
16
|
-
[r]
|
|
17
|
-
);
|
|
1
|
+
import { removeUnrepresentableBreaks as e } from "../utils/removeUnrepresentableBreaks.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { unified as n } from "unified";
|
|
4
|
+
import r from "rehype-parse";
|
|
5
|
+
import i from "rehype-remark";
|
|
6
|
+
import a from "remark-stringify";
|
|
7
|
+
//#region src/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.ts
|
|
8
|
+
function o() {
|
|
9
|
+
let o = t(() => n().use(r).use(i).use(e).use(a), []);
|
|
10
|
+
return t(() => function(e) {
|
|
11
|
+
return o.process(e).then(String);
|
|
12
|
+
}, [o]);
|
|
18
13
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { o as useHtmlToMd };
|