@ebl-vue/editor-full 2.31.34 → 2.31.36
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/.postcssrc.yml +33 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +183 -182
- package/dist/index.mjs.map +1 -0
- package/package.json +1 -1
- package/postcss.config.js +15 -0
- package/src/components/Editor/Editor.vue +293 -0
- package/src/components/index.ts +27 -0
- package/src/constants/index.ts +1 -0
- package/src/i18n/zh-cn.ts +160 -0
- package/src/icons/index.ts +93 -0
- package/src/index.ts +21 -0
- package/src/installer.ts +21 -0
- package/src/plugins/alert/index.ts +455 -0
- package/src/plugins/block-alignment/index.ts +117 -0
- package/src/plugins/block-alignment/readme.md +1 -0
- package/src/plugins/code/LICENSE +21 -0
- package/src/plugins/code/index.ts +619 -0
- package/src/plugins/code/utils/string.ts +34 -0
- package/src/plugins/color-picker/index.ts +132 -0
- package/src/plugins/delimiter/index.ts +121 -0
- package/src/plugins/drag-drop/index.css +19 -0
- package/src/plugins/drag-drop/index.ts +151 -0
- package/src/plugins/drag-drop/readme.md +1 -0
- package/src/plugins/header/H1.ts +404 -0
- package/src/plugins/header/H2.ts +403 -0
- package/src/plugins/header/H3.ts +404 -0
- package/src/plugins/header/H4.ts +404 -0
- package/src/plugins/header/H5.ts +403 -0
- package/src/plugins/header/H6.ts +404 -0
- package/src/plugins/header/index.ts +15 -0
- package/src/plugins/header/types.d.ts +46 -0
- package/src/plugins/imageResizeCrop/ImageTune.ts +635 -0
- package/src/plugins/imageResizeCrop/index.css +230 -0
- package/src/plugins/imageResizeCrop/index.ts +5 -0
- package/src/plugins/imageResizeCrop/types.d.ts +23 -0
- package/src/plugins/imageTool/index.ts +510 -0
- package/src/plugins/imageTool/types/codexteam__ajax.d.ts +89 -0
- package/src/plugins/imageTool/types/types.ts +236 -0
- package/src/plugins/imageTool/ui.ts +313 -0
- package/src/plugins/imageTool/uploader.ts +287 -0
- package/src/plugins/imageTool/utils/dom.ts +24 -0
- package/src/plugins/imageTool/utils/index.ts +73 -0
- package/src/plugins/imageTool/utils/isPromise.ts +10 -0
- package/src/plugins/indent/index.ts +695 -0
- package/src/plugins/inline-code/index.ts +203 -0
- package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +208 -0
- package/src/plugins/list/ListRenderer/ListRenderer.ts +73 -0
- package/src/plugins/list/ListRenderer/OrderedListRenderer.ts +123 -0
- package/src/plugins/list/ListRenderer/UnorderedListRenderer.ts +123 -0
- package/src/plugins/list/ListRenderer/index.ts +6 -0
- package/src/plugins/list/ListTabulator/index.ts +1179 -0
- package/src/plugins/list/index.ts +488 -0
- package/src/plugins/list/styles/CssPrefix.ts +4 -0
- package/src/plugins/list/types/Elements.ts +14 -0
- package/src/plugins/list/types/ItemMeta.ts +40 -0
- package/src/plugins/list/types/ListParams.ts +102 -0
- package/src/plugins/list/types/ListRenderer.ts +6 -0
- package/src/plugins/list/types/OlCounterType.ts +63 -0
- package/src/plugins/list/types/index.ts +14 -0
- package/src/plugins/list/utils/focusItem.ts +18 -0
- package/src/plugins/list/utils/getChildItems.ts +40 -0
- package/src/plugins/list/utils/getItemChildWrapper.ts +10 -0
- package/src/plugins/list/utils/getItemContentElement.ts +10 -0
- package/src/plugins/list/utils/getSiblings.ts +52 -0
- package/src/plugins/list/utils/isLastItem.ts +9 -0
- package/src/plugins/list/utils/itemHasSublist.ts +10 -0
- package/src/plugins/list/utils/normalizeData.ts +83 -0
- package/src/plugins/list/utils/removeChildWrapperIfEmpty.ts +31 -0
- package/src/plugins/list/utils/renderToolboxInput.ts +113 -0
- package/src/plugins/list/utils/stripNumbers.ts +7 -0
- package/src/plugins/list/utils/type-guards.ts +8 -0
- package/src/plugins/marker/index.ts +199 -0
- package/src/plugins/outline/index.ts +62 -0
- package/src/plugins/outline/outline.css +52 -0
- package/src/plugins/paragraph/index.ts +384 -0
- package/src/plugins/paragraph/types/icons.d.ts +4 -0
- package/src/plugins/paragraph/utils/makeFragment.ts +17 -0
- package/src/plugins/quote/index.ts +203 -0
- package/src/plugins/table/index.ts +4 -0
- package/src/plugins/table/plugin.ts +255 -0
- package/src/plugins/table/table.ts +1202 -0
- package/src/plugins/table/toolbox.ts +166 -0
- package/src/plugins/table/utils/dom.ts +130 -0
- package/src/plugins/table/utils/popover.ts +185 -0
- package/src/plugins/table/utils/throttled.ts +22 -0
- package/src/plugins/underline/index.ts +214 -0
- package/src/plugins/undo/index.ts +526 -0
- package/src/plugins/undo/observer.ts +101 -0
- package/src/plugins/undo/vanilla-caret-js.ts +102 -0
- package/src/style.css +139 -0
- package/src/types.ts +3 -0
- package/src/utils/AxiosService.ts +87 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/install.ts +19 -0
- package/tsconfig.json +37 -0
- package/vite.config.ts +81 -0
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.appendChild(document.createTextNode(':root{--color-border: #EFF0F1}.ebl-editor{cursor:text;font-size:16px;font-weight:400;background-color:#fff;height:100%;overflow:auto;position:relative;padding-top:15px}.ebl-editor.outline{padding-right:280px}.ebl-editor.outline .codex-editor{-webkit-box-flex:1;-ms-flex:1;flex:1}@media (max-width:1240px){.ebl-outline{display:none}.ebl-editor.outline{padding-right:0}}@media (min-width:1240px){.ebl-editor.readonly .ce-block__content{max-width:100%;padding-left:100px;padding-right:100px}}.ce-toolbar,.ce-inline-toolbar{z-index:1000}.ce-toolbar__plus{border:1px solid #EFF0F1}.ce-toolbar .ce-popover__items{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.ce-toolbar .ce-popover__items .ce-popover-item{position:relative}.ce-toolbar .ce-popover__items .ce-popover-item__title{display:none}.ce-toolbar .ce-popover-item-html,.ce-toolbar .ce-popover-item-separator,.ce-toolbar .ce-popover-item[data-item-name=convert-to]{width:100%}.ce-toolbar .ce-popover-item-html[data-item-name=list-setting]{width:auto;overflow:hidden}.ce-toolbar .ce-popover-item-html[data-item-name=list-setting-start-with]{border-radius:6px;padding:3px}.ce-toolbar .ce-popover-item-html[data-item-name=list-setting-start-with]:hover{background-color:#f8f8f8}.ce-toolbar .ce-popover-item[data-item-name=convert-to] .ce-popover-item__title{display:block}.ce-toolbar .ce-popover-item[data-item-name=add-below]{width:100%}.ce-toolbar .ce-popover-item[data-item-name=add-below] .ce-popover-item__title{display:block}.ce-toolbar .ce-popover-item[data-item-name=list-setting]{width:100%}.ce-toolbar .ce-popover-item[data-item-name=list-setting] .ce-popover-item__title{display:block}.ce-inline-toolbar .ce-popover__items{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.ce-inline-toolbar .ce-popover__items{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.ce-inline-toolbar .ce-popover__items .ce-popover-item__title{display:none}.ebl-editor ::-webkit-scrollbar{width:6px;height:6px}.ebl-editor ::-webkit-scrollbar-track{background:#f1f1f1;border-radius:1px}.ebl-editor ::-webkit-scrollbar-thumb{background:silver;border-radius:10px;border:1px solid #fff}.ebl-editor ::-webkit-scrollbar-thumb:hover{background:#555}.ce-block--drop-target .ce-block__content:before{content:"";position:absolute;top:50%;left:-20px;margin-top:-1px;height:8px;width:8px;border:solid #a0a0a0;border-width:1px 1px 0 0;-webkit-transform-origin:right;transform-origin:right;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ce-block--drop-target .ce-block__content:after{background:none}.ce-header{padding:15px 0 3px;margin:0;line-height:1.25;outline:none}.ce-header p,.ce-header div{padding:0!important;margin:0!important}.ce-tune-alignment--right{text-align:right}.ce-tune-alignment--center{text-align:center}.ce-tune-alignment--left{text-align:left}.ce-paragraph{line-height:2!important}.ce-paragraph{outline:none}.ce-block:only-of-type .ce-paragraph[data-placeholder-active]:empty:before,.ce-block:only-of-type .ce-paragraph[data-placeholder-active][data-empty=true]:before{content:attr(data-placeholder-active)}.ce-paragraph p:first-of-type{margin-top:0}.ce-paragraph p:last-of-type{margin-bottom:0}.ce-editorjs-x-shiki{border-radius:10px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:10px 0;border:2px solid transparent;position:relative}.ce-editorjs-x-shiki.editable:hover{border:2px solid #C0C0C0}.ce-editorjs-x-shiki__lang{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:8px}.ce-editorjs-x-shiki__code{position:relative;float:left;min-width:100%;overflow:hidden;height:auto}.ce-editorjs-x-shiki__code__dragHandler{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translate(-50%);bottom:-5px;cursor:ns-resize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:8px;width:60px;background-color:silver;border-radius:5px;display:none}.ce-editorjs-x-shiki:hover .ce-editorjs-x-shiki__code__dragHandler{display:block}.ce-editorjs-x-shiki__selector{display:-webkit-box;display:-ms-flexbox;display:flex;gap:15px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;border-bottom-style:solid;border-color:#9ca3af0d;border-bottom-width:1px;padding:0 8px 8px}.ce-editorjs-x-shiki__selector-language,.ce-editorjs-x-shiki__selector-theme{font-size:13px;font-family:inherit}.ce-editorjs-x-shiki__selector-language{width:90px}.ce-editorjs-x-shiki__selector select{border:none;outline:none}.ce-editorjs-x-shiki__span{position:relative;z-index:0;padding:20px 20px 20px 55px;margin:0;white-space:pre;font-size:13px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.ce-editorjs-x-shiki__span code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.ce-editorjs-x-shiki__textarea{all:unset;white-space:pre;background-color:transparent;position:absolute;padding:20px 20px 20px 55px;inset:0;color:transparent;z-index:0;font-size:13px;caret-color:#999;resize:none;border:none;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.ce-editorjs-x-shiki__textarea::-moz-selection{background-color:#083ca9;color:#fff}.ce-editorjs-x-shiki__textarea::selection{background-color:#083ca9;color:#fff}.ce-editorjs-x-shiki__copy{width:24px;height:24px;cursor:pointer;position:relative;margin-right:0}.ce-editorjs-x-shiki__copy_tip{font-size:12px;width:60px;margin-left:-20px;background-color:#0c0c0c;color:#ececec;text-align:center;border-radius:6px;padding:5px 10px;position:absolute;z-index:1;top:125%;-webkit-transition:opacity .3s;transition:opacity .3s;visibility:hidden;opacity:0}.ce-editorjs-x-shiki__copy_tip:after{content:"";position:absolute;bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:transparent transparent #0c0c0c transparent}.ce-editorjs-x-shiki__copy_tip.visible{visibility:visible;opacity:1}.ce-editorjs-x-shiki__span.shiki .line:before{content:attr(data-line);width:40px;display:inline-block;text-align:right;color:#888;position:absolute;left:0}.ce-editorjs-x-shiki__code ::-webkit-scrollbar{width:8px;height:8px}.ce-editorjs-x-shiki__code ::-webkit-scrollbar-track{background:#22272e;border-radius:1px}.ce-editorjs-x-shiki__code ::-webkit-scrollbar-thumb{background:silver;border-radius:10px;border:2px solid #22272e}.ce-editorjs-x-shiki__code ::-webkit-scrollbar-thumb:hover{background:#555}.cdx-quote{overflow:hidden;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;word-break:break-all}.cdx-quote blockquote{margin:0}.cdx-block-quote{border:solid #acacac;border-width:0 0 0 3px;-webkit-box-shadow:none;box-shadow:none;color:#666;line-height:1.6em;padding:1px 0 0 12px;text-align:left}.ce-delimiter__line__wrapper{height:24px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ce-delimiter__line{-webkit-box-flex:1;-ms-flex:1;flex:1;height:2px;background-color:#eff0f1}.cdx-list{margin:0;padding:0;outline:none;display:grid;counter-reset:item;grid-gap:var(--spacing-s);padding:var(--spacing-xs);--spacing-s: 8px;--spacing-xs: 6px;--list-counter-type: numeric;--radius-border: 5px;--checkbox-background: #fff;--color-border: #C9C9C9;--color-bg-checked: #369FFF;--line-height: 1.45em;--color-bg-checked-hover: #0059AB;--color-tick: #fff;--size-checkbox: 1.2em}.cdx-list ol{padding-left:0}.cdx-list__item{line-height:var(--line-height);display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;grid-template-areas:"checkbox content" ". child"}.cdx-list__item-children{display:grid;grid-area:child;grid-gap:var(--spacing-s);padding-top:var(--spacing-s)}.cdx-list__item [contenteditable]{outline:none}.cdx-list__item-content{word-break:break-word;white-space:pre-wrap;grid-area:content;padding-left:var(--spacing-s)}.cdx-list__item:before{counter-increment:item;white-space:nowrap}.cdx-list-ordered .cdx-list__item:before{content:counters(item,".",var(--list-counter-type)) "."}.cdx-list-ordered{counter-reset:item}.cdx-list-unordered{padding-left:0}.cdx-list-unordered .cdx-list__item:before{content:"•"}.cdx-list-checklist .cdx-list__item:before{content:""}.cdx-list__settings .cdx-settings-button{width:50%}.cdx-list__checkbox{padding-top:calc((var(--line-height) - var(--size-checkbox)) / 2);grid-area:checkbox;width:var(--size-checkbox);height:var(--size-checkbox);display:-webkit-box;display:-ms-flexbox;display:flex;cursor:pointer}.cdx-list__checkbox svg{opacity:0;height:var(--size-checkbox);width:var(--size-checkbox);left:-1px;top:-1px;position:absolute}@media (hover: hover){.cdx-list__checkbox:not(.cdx-list__checkbox--no-hover):hover .cdx-list__checkbox-check svg{opacity:1}}.cdx-list__checkbox--checked{line-height:var(--line-height)}@media (hover: hover){.cdx-list__checkbox--checked:not(.cdx-list__checkbox--checked--no-hover):hover .cdx-checklist__checkbox-check{background:var(--color-bg-checked-hover);border-color:var(--color-bg-checked-hover)}}.cdx-list__checkbox--checked .cdx-list__checkbox-check{background:var(--color-bg-checked);border-color:var(--color-bg-checked)}.cdx-list__checkbox--checked .cdx-list__checkbox-check svg{opacity:1}.cdx-list__checkbox--checked .cdx-list__checkbox-check svg path{stroke:var(--color-tick)}.cdx-list__checkbox--checked .cdx-list__checkbox-check:before{opacity:0;visibility:visible;-webkit-transform:scale(2.5);transform:scale(2.5)}.cdx-list__checkbox-check{cursor:pointer;display:inline-block;position:relative;margin:0 auto;width:var(--size-checkbox);height:var(--size-checkbox);-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:var(--radius-border);border:1px solid var(--color-border);background:var(--checkbox-background)}.cdx-list__checkbox-check:before{content:"";position:absolute;inset:0;border-radius:100%;background-color:var(--color-bg-checked);visibility:hidden;pointer-events:none;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:opacity .4s,-webkit-transform .4s ease-out;transition:opacity .4s,-webkit-transform .4s ease-out;transition:transform .4s ease-out,opacity .4s;transition:transform .4s ease-out,opacity .4s,-webkit-transform .4s ease-out}.cdx-list__checkbox-check--disabled{pointer-events:none}.cdx-list-start-with-field{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;overflow:hidden;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.cdx-list-start-with-field--invalid{background:#ffeced;border:1px solid #E13F3F}.cdx-list-start-with-field:hover{background-color:#f8f8f8}.cdx-list-start-with-field--invalid .cdx-list-start-with-field__input{color:#e13f3f}.cdx-list-start-with-field__startlabel{width:70px;font-size:14px}.cdx-list-start-with-field__input-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden}.cdx-list-start-with-field__input{font-size:14px;outline:none;font-weight:500;font-family:inherit;border:0;background:transparent;margin:0;line-height:22px;-webkit-box-flex:1;-ms-flex:1;flex:1;border:1px solid rgba(226,226,229,1);border-radius:6px;padding:0 10px;width:50px;text-align:center}.cdx-list-start-with-field__input::-webkit-input-placeholder{color:var(--grayText);font-weight:500}.cdx-list-start-with-field__input::-moz-placeholder{color:var(--grayText);font-weight:500}.cdx-list-start-with-field__input:-ms-input-placeholder{color:var(--grayText);font-weight:500}.cdx-list-start-with-field__input::-ms-input-placeholder{color:var(--grayText);font-weight:500}.cdx-list-start-with-field__input::placeholder{color:var(--grayText);font-weight:500}.cdx-alert{position:relative;padding:10px;border-radius:5px;margin-bottom:10px;margin-top:10px}.cdx-alert-primary{background-color:#ebf8ff;border:1px solid #4299e1;color:#2b6cb0}.cdx-alert-secondary{background-color:#f7fafc;border:1px solid #cbd5e0;color:#222731}.cdx-alert-info{background-color:#e6fdff;border:1px solid #4cd4ce;color:#00727c}.cdx-alert-success{background-color:#f0fff4;border:1px solid #68d391;color:#2f855a}.cdx-alert-warning{background-color:#fffaf0;border:1px solid #ed8936;color:#c05621}.cdx-alert-danger{background-color:#fff5f5;border:1px solid #fc8181;color:#c53030}.cdx-alert-light{background-color:#fff;border:1px solid #edf2f7;color:#1a202c}.cdx-alert-dark{background-color:#2d3748;border:1px solid #1a202c;color:#d3d3d3}.cdx-alert-align-left{text-align:left}.cdx-alert-align-center{text-align:center}.cdx-alert-align-right{text-align:right}.cdx-alert__message{outline:none}.cdx-alert [contentEditable=true][data-placeholder]:before{position:absolute;content:attr(data-placeholder);color:#707684;font-weight:400;opacity:0}.cdx-alert [contentEditable=true][data-placeholder]:empty:before{opacity:1}.cdx-alert [contentEditable=true][data-placeholder]:empty:focus:before{opacity:0}.ce-popover__item[data-item-name=alert-primary] .ce-popover__item-icon svg #background{fill:#ebf8ff;stroke:#4299e1}.ce-popover__item[data-item-name=alert-primary] .ce-popover__item-icon svg #content{fill:#2b6cb0}.ce-popover__item[data-item-name=alert-secondary] .ce-popover__item-icon svg #background{fill:#f7fafc;stroke:#cbd5e0}.ce-popover__item[data-item-name=alert-secondary] .ce-popover__item-icon svg #content{fill:#222731}.ce-popover__item[data-item-name=alert-info] .ce-popover__item-icon svg #background{fill:#e6fdff;stroke:#4cd4ce}.ce-popover__item[data-item-name=alert-info] .ce-popover__item-icon svg #content{fill:#00727c}.ce-popover__item[data-item-name=alert-success] .ce-popover__item-icon svg #background{fill:#f0fff4;stroke:#68d391}.ce-popover__item[data-item-name=alert-success] .ce-popover__item-icon svg #content{fill:#2f855a}.ce-popover__item[data-item-name=alert-warning] .ce-popover__item-icon svg #background{fill:#fffaf0;stroke:#ed8936}.ce-popover__item[data-item-name=alert-warning] .ce-popover__item-icon svg #content{fill:#c05621}.ce-popover__item[data-item-name=alert-danger] .ce-popover__item-icon svg #background{fill:#fff5f5;stroke:#fc8181}.ce-popover__item[data-item-name=alert-danger] .ce-popover__item-icon svg #content{fill:#c53030}.ce-popover__item[data-item-name=alert-light] .ce-popover__item-icon svg #background{fill:#fff;stroke:#edf2f7}.ce-popover__item[data-item-name=alert-light] .ce-popover__item-icon svg #content{fill:#1a202c}.ce-popover__item[data-item-name=alert-dark] .ce-popover__item-icon svg #background{fill:#2d3748;stroke:#1a202c}.ce-popover__item[data-item-name=alert-dark] .ce-popover__item-icon svg #content{fill:#d3d3d3}.cdx-alert_setting__icon_wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:10px}.cdx-alert_setting__icon_wrapper_align{margin-top:10px}.cdx-alert_setting__icon{display:inline-block;width:24px;height:24px;text-align:center;line-height:24px;cursor:pointer}.cdx-alert_setting__icon_active{opacity:.3}.ce-popover-indent-item{cursor:default!important}.ce-popover-indent-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:3px}.ce-popover-indent-item[version^="2.26"]{gap:10px}.ce-popover-indent-item:hover{background-color:transparent!important}.ce-popover-indent-item .ce-popover-item__icon{width:26px;height:26px;cursor:pointer;will-change:background-color,color;transition:.3s background-color,.3s color;padding:0;border-width:0px;color:#000;background-color:#fff;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;-webkit-transition:.3s background-color,.3s color;-moz-transition:.3s background-color,.3s color;-ms-transition:.3s background-color,.3s color;-o-transition:.3s background-color,.3s color}.ce-popover-indent-item .ce-popover-item--disabled{color:#707684;opacity:.3;cursor:default}.ce-popover-indent-item .ce-popover-item__icon:focus{outline:none}.ce-popover-indent-item[version^="2.26"]:hover .ce-popover-item__icon,.ce-popover-indent-item[version^="2.27"]:hover .ce-popover-item__icon,.ce-popover-indent-item[version^="2.28"]:hover .ce-popover-item__icon,.ce-popover-indent-item[version^="2.29"]:hover .ce-popover-item__icon,.ce-popover-indent-item[version^="2.26"] .ce-popover-item__icon,.ce-popover-indent-item[version^="2.27"] .ce-popover-item__icon,.ce-popover-indent-item[version^="2.28"] .ce-popover-item__icon,.ce-popover-indent-item[version^="2.29"] .ce-popover-item__icon{box-shadow:0 0 0 1px #c9c9cc7a!important;-webkit-box-shadow:0 0 0 1px rgba(201,201,204,.48)!important}.ce-popover-indent-item[version^="2.26"] .ce-popover-item__icon:hover,.ce-popover-indent-item[version^="2.27"] .ce-popover-item__icon:hover,.ce-popover-indent-item[version^="2.28"] .ce-popover-item__icon:hover,.ce-popover-indent-item[version^="2.29"] .ce-popover-item__icon:hover{background-color:#eff2f5}.ce-highlight-indent{display:inline-block;height:1.6em;top:50%;position:absolute;transform:translateY(-50%);-webkit-transform:translate(0px,-50%);-moz-transform:translate(0px,-50%);-ms-transform:translate(0px,-50%);-o-transform:translate(0px,-50%)}.ce-popover-indent-item[version^="2.3"] .ce-popover-item__title{margin-left:4px}.cdx-marker{background:#f5eb6f4a;padding:3px 0}.ce-popover--inline .ce-popover--nested .ce-popover__container{width:-webkit-min-content!important;width:-moz-min-content!important;width:min-content!important;min-width:0!important;min-width:initial!important}.ce-popover--inline .ce-popover--nested .ce-popover__items{width:-webkit-max-content;width:-moz-max-content;width:max-content}.editorjs__color-selector-container{display:grid;grid-gap:10px;padding:4px}.editorjs__color-selector__container-item{width:30px;height:30px;display:block;cursor:pointer;border-radius:100%;-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;transition:transform .2s ease;transition:transform .2s ease,-webkit-transform .2s ease}.editorjs__color-selector__container-item:hover{-webkit-transform:scale(1.1);transform:scale(1.1)}.cdx-underline{-webkit-text-decoration:underline;text-decoration:underline}.inline-code{background:#faeff0c7;color:#b44437;padding:3px 4px;border-radius:5px;margin:0 1px;font-family:inherit;font-size:.86em;font-weight:500;letter-spacing:.3px}.tc-wrap{--color-background: #f9f9fb;--color-text-secondary: #7b7e89;--color-border: #e8e8eb;--cell-size: 34px;--toolbox-icon-size: 18px;--toolbox-padding: 6px;--toolbox-aiming-field-size: calc(var(--toolbox-icon-size) + var(--toolbox-padding)*2);--col-width: 100px 100px 100px;position:relative;height:100%;margin-top:var(--toolbox-icon-size);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-grid;z-index:0}.tc-wrap svg{vertical-align:top}@media print{.tc-wrap{border-left-color:var(--color-border);border-left-style:solid;border-left-width:1px}}@media print{.tc-wrap .tc-row:after{display:none}}.tc-table{position:relative;width:100%;height:100%;display:grid;font-size:14px;border-top:1px solid var(--color-border);border-left:1px solid var(--color-border);line-height:1.4;overflow-x:auto}.tc-table:after{width:calc(var(--cell-size));height:100%;left:calc(var(--cell-size)*-1);top:0}.tc-table:after,.tc-table:before{position:absolute;content:""}.tc-table:before{width:100%;height:var(--toolbox-aiming-field-size);top:calc(var(--toolbox-aiming-field-size)*-1);left:0}.tc-table--heading .tc-row:first-child{font-weight:600;border-bottom:2px solid var(--color-border);position:sticky;top:0;z-index:2;background:var(--color-background)}.tc-table--heading .tc-row:first-child [contenteditable]:empty:before{content:attr(heading);color:var(--color-text-secondary)}.tc-table--heading .tc-row:first-child:after{bottom:-2px;border-bottom:2px solid var(--color-border)}.tc-add-column,.tc-add-row{display:-webkit-box;display:-ms-flexbox;display:flex;color:var(--color-text-secondary)}@media print{.tc-add{display:none}}.tc-add-column{display:grid;border-top:1px solid var(--color-border);grid-auto-rows:var(--cell-size);-webkit-box-align:center;-ms-flex-align:center;align-items:center;justify-items:center}.tc-add-column svg{padding:5px;position:sticky;top:0;background-color:var(--color-background)}.tc-add-column--disabled{visibility:hidden}@media print{.tc-add-column{display:none}}.tc-add-row{height:var(--cell-size);-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:4px;position:relative}.tc-add-row--disabled{display:none}.tc-add-row:before{content:"";position:absolute;right:calc(var(--cell-size)*-1);width:var(--cell-size);height:100%}@media print{.tc-add-row{display:none}}.tc-add-column,.tc-add-row{-webkit-transition:0s;transition:0s;cursor:pointer;will-change:background-color}.tc-add-column:hover,.tc-add-row:hover{-webkit-transition:background-color .1s ease;transition:background-color .1s ease;background-color:var(--color-background)}.tc-add-row{margin-top:1px}.tc-add-row:hover:before{-webkit-transition:.1s;transition:.1s;background-color:var(--color-background)}.tc-row{display:grid;grid-template-columns:var(--col-width);position:relative;border-bottom:1px solid var(--color-border)}.tc-row--selected{background:var(--color-background)}.tc-row--selected:after{background:var(--color-background)}.tc-cell{border-right:1px solid var(--color-border);padding:6px 12px;overflow:hidden;outline:none;line-break:normal}.tc-cell--selected{background:var(--color-background)}.tc-wrap--readonly .tc-row:after{display:none}.tc-toolbox{--toolbox-padding: 6px;--popover-margin: 30px;--toggler-click-zone-size: 30px;--toggler-dots-color: #7b7e89;--toggler-dots-color-hovered: #1d202b;position:absolute;cursor:pointer;z-index:1;opacity:0;-webkit-transition:opacity .1s;transition:opacity .1s;will-change:left,opacity}.tc-toolbox--column{top:calc(var(--toggler-click-zone-size)*-1);-webkit-transform:translate(calc(var(--toggler-click-zone-size)*-1/2));transform:translate(calc(var(--toggler-click-zone-size)*-1/2));will-change:left,opacity}.tc-toolbox--row{left:calc(var(--popover-margin)*-1);-webkit-transform:translateY(calc(var(--toggler-click-zone-size)*-1/2));transform:translateY(calc(var(--toggler-click-zone-size)*-1/2));margin-top:-1px;will-change:top,opacity}.tc-toolbox--showed{opacity:1}.tc-toolbox .tc-popover{position:absolute;top:0;left:var(--popover-margin)}.tc-toolbox__toggler{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:var(--toggler-click-zone-size);height:var(--toggler-click-zone-size);color:var(--toggler-dots-color);opacity:0;-webkit-transition:opacity .15s ease;transition:opacity .15s ease;will-change:opacity}.tc-toolbox__toggler:hover{color:var(--toggler-dots-color-hovered)}.tc-toolbox__toggler svg{fill:currentColor}.tc-wrap:hover .tc-toolbox__toggler{opacity:1}.tc-settings .cdx-settings-button{width:50%;margin:0}.tc-popover{--color-border: #eaeaea;--color-background: #fff;--color-background-hover: rgba(232, 232, 235, .49);--color-background-confirm: #e24a4a;--color-background-confirm-hover: #d54040;--color-text-confirm: #fff;background:var(--color-background);border:1px solid var(--color-border);-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.12941);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;padding:6px;display:none;will-change:opacity,transform}.tc-popover--opened{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-animation:menuShowing .1s cubic-bezier(.215,.61,.355,1) forwards;animation:menuShowing .1s cubic-bezier(.215,.61,.355,1) forwards}.tc-popover__item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:2px 14px 2px 2px;border-radius:5px;cursor:pointer;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tc-popover__item:hover{background:var(--color-background-hover)}.tc-popover__item:not(:last-of-type){margin-bottom:2px}.tc-popover__item-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:26px;height:26px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;background:var(--color-background);border-radius:5px;border:1px solid var(--color-border);margin-right:8px}.tc-popover__item-label{line-height:22px;font-size:14px;font-weight:500}.tc-popover__item--confirm{background:var(--color-background-confirm);color:var(--color-text-confirm)}.tc-popover__item--confirm:hover{background-color:var(--color-background-confirm-hover)}.tc-popover__item--confirm .tc-popover__item-icon{background:var(--color-background-confirm);border-color:#0000001a}.tc-popover__item--confirm .tc-popover__item-icon svg{-webkit-transition:-webkit-transform .2s ease-in;transition:-webkit-transform .2s ease-in;transition:transform .2s ease-in;transition:transform .2s ease-in,-webkit-transform .2s ease-in;-webkit-transform:rotate(90deg) scale(1.2);transform:rotate(90deg) scale(1.2)}.tc-popover__item--hidden{display:none}@-webkit-keyframes menuShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes menuShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}.cell-resizable{cursor:col-resize}.image-tool{--bg-color: #cdd1e0;--front-color: #388ae5;--border-color: #e8e8eb;display:inline-block}.image-tool__image{border-radius:3px;overflow:hidden;margin-bottom:10px;padding-bottom:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.image-tool__image-picture{max-width:100%;vertical-align:bottom;display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}.image-tool__image-preloader{width:150px;height:150px;border-radius:50%;background-size:cover;margin:auto;position:relative;background-color:var(--bg-color);background-position:center center}.image-tool__image-preloader:after{content:"";position:absolute;z-index:3;width:60px;height:60px;border-radius:50%;border:2px solid var(--bg-color);border-top-color:var(--front-color);left:50%;top:50%;margin-top:-30px;margin-left:-30px;-webkit-animation:image-preloader-spin 2s infinite linear;animation:image-preloader-spin 2s infinite linear;-webkit-box-sizing:border-box;box-sizing:border-box}.image-tool__caption{visibility:hidden;position:absolute;bottom:0;left:0;margin-bottom:10px}.image-tool__caption[contentEditable=true][data-placeholder]:before{position:absolute!important}.image-tool__caption[contentEditable=true][data-placeholder]:before{content:attr(data-placeholder);color:#707684;font-weight:400;display:none}.image-tool__caption[contentEditable=true][data-placeholder]:empty:before{display:block}.image-tool__caption[contentEditable=true][data-placeholder]:empty:focus:before{display:none}.image-tool--empty .image-tool__image,.image-tool--empty .image-tool__image-preloader{display:none}.image-tool--empty .image-tool__caption,.image-tool--uploading .image-tool__caption{visibility:hidden!important}.image-tool .cdx-button{display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.image-tool .cdx-button svg{height:auto;margin:0 6px 0 0}.image-tool--filled .cdx-button,.image-tool--filled .image-tool__image-preloader{display:none}.image-tool--uploading{width:100%}.image-tool--uploading .resizable{display:none!important}.image-tool--uploading .image-tool__image{min-height:200px;display:-webkit-box;display:-ms-flexbox;display:flex;background-color:#fff}.image-tool--uploading .image-tool__image-picture,.image-tool--uploading .cdx-button{display:none}.image-tool--withBorder .image-tool__image{border:1px solid var(--border-color)}.image-tool--withBackground .image-tool__image{padding:15px;background:var(--bg-color)}.image-tool--withBackground .image-tool__image-picture{max-width:60%;margin:0 auto}.image-tool--stretched .image-tool__image-picture{width:100%}.image-tool--caption .image-tool__caption{visibility:visible}.image-tool--caption{padding-bottom:50px}@-webkit-keyframes image-preloader-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes image-preloader-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.cdx-image-tool-tune--floatLeft .cdx-block,.cdx-image-tool-tune--center .cdx-block,.cdx-image-tool-tune--floatRight .cdx-block,.cdx-image-tool-tune--floatLeft .image-tool__image,.cdx-image-tool-tune--center .image-tool__image,.cdx-image-tool-tune--floatRight .image-tool__image{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}:root{--primary: #2492F5;--primary-content: #E9F4FE}.cdx-settings-button--active{background:#e9f4fe;color:#2492f5}.cdx-settings-button:hover{background:#e9f4fe}.cdx-image-tool-tune--center{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}@media all and (min-width: 470px){.codex-editor:not(.read-only) .cdx-image-tool-tune--floatLeft.ce-block__content,.codex-editor:not(.read-only) .cdx-image-tool-tune--floatRight.ce-block__content{min-height:20px}.cdx-image-tool-tune--floatLeft.ce-block__content .image-tool__image,.cdx-image-tool-tune--floatRight.ce-block__content .image-tool__image{margin-top:40px}.cdx-image-tool-tune--floatLeft.ce-block__content .image-tool__image{margin-left:20px}.cdx-image-tool-tune--floatRight.ce-block__content .image-tool__image{margin-right:20px}.cdx-image-tool-tune--floatLeft.ce-block__content .cdx-input,.cdx-image-tool-tune--floatRight.ce-block__content .cdx-input{width:calc(100% - 20px)}.cdx-image-tool-tune--floatLeft.ce-block__content .cdx-input{margin-left:20px}.cdx-image-tool-tune--floatRight.ce-block__content .cdx-input{margin-right:20px}.cdx-image-tool-tune--floatLeft .cdx-block{float:left;margin-right:10px}.cdx-image-tool-tune--floatRight .cdx-block{float:right;margin-left:10px}.cdx-image-tool-tune--sizeSmall .cdx-block{max-width:25%!important}.cdx-image-tool-tune--sizeMiddle .cdx-block{max-width:50%!important}.cdx-image-tool-tune--sizeLarge .cdx-block{max-width:75%!important}}.cdx-image-tool-tune--sizeLarge img,.cdx-image-tool-tune--sizeSmall img,.cdx-image-tool-tune--sizeMiddle img{-o-object-fit:cover;object-fit:cover;max-width:100%}.codex-editor.read-only .cdx-input.image-tool__caption:empty,.read-only>.codex-editor .cdx-input.image-tool__caption:empty{display:none}.cdx-image-tool-tune--resize .cdx-block{position:relative;overflow:visible}.cdx-image-tool-tune--resize .cdx-block .resizable{display:none}.cdx-image-tool-tune--resize .image-tool__image-picture{width:100%!important}.cdx-image-tool-tune--resize .cdx-block:hover .resizable{display:block}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer{-webkit-box-sizing:border-box;box-sizing:border-box;width:14px;height:14px;border-radius:50%;background:#e9f4fe;border:3px solid #2492F5;position:absolute}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.top-left{left:-8px;top:2px;cursor:nwse-resize}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.top-right{right:-8px;top:1px;cursor:nesw-resize}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.bottom-left{left:-9px;bottom:10px;cursor:nesw-resize}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.bottom-right{right:-9px;bottom:10px;cursor:nwse-resize}.cdx-image-tool-tune--crop:hover,.cdx-image-tool-tune--crop.isCropping,.cdx-image-tool-tune--resize:hover{z-index:2}.cdx-image-tool-tune--crop .image-tool__image{position:relative}.cdx-image-tool-tune--crop .isCropping .image-tool__image{min-height:600px;min-width:100%}.cdx-image-tool-tune--crop .image-tool__image .crop-btn,.cdx-image-tool-tune--crop .image-tool__image .crop-save{position:absolute;top:0;left:0;padding:7px;background:#2492f5;color:#e9f4fe;text-align:center;line-height:20px;cursor:pointer;display:none}.cdx-image-tool-tune--crop .image-tool__image:hover .crop-btn,.cdx-image-tool-tune--crop .image-tool__image:hover .crop-save{display:block}.cdx-image-tool-tune--crop .image-tool__image img.isCropped{position:absolute;min-width:0;min-width:initial;max-width:none;max-width:initial;min-height:0;min-height:initial;max-height:none;max-height:initial}.cdx-image-tool-tune--crop .cdx-block.image-tool.isCropping{min-width:0!important;min-width:initial!important;max-width:none!important;max-width:initial!important;min-height:0!important;min-height:initial!important;max-height:none!important;max-height:initial!important}.image-tool__caption{background-color:#fff}.image-tool{position:relative;z-index:1}.cdx-image-tool-tune{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;gap:4px;width:100%}.ebl-outline{background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;position:fixed;top:84px;right:0;padding:15px 12px 50px;width:280px;overflow:hidden;font-family:Qihei Lenovo,Microsoft YaHei,微软雅黑,宋体,sans-serif;color:#606266;font-size:14px;max-height:calc(100vh - 84px)}.ebl-outline:hover{overflow:auto}.ebl-outline__item{cursor:pointer;height:36px;line-height:36px;padding:0 24px;word-break:break-word;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ebl-outline .level_1{padding-left:24px}.ebl-outline .level_2{padding-left:42px}.ebl-outline .level_3{padding-left:60px}.ebl-outline__item.active{color:#222;font-weight:700;background-color:#ebebeb}.ebl-outline__item:hover{background-color:#ebebeb}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { defineComponent as
|
|
2
|
+
import { defineComponent as Ut, inject as jt, toRaw as J, onMounted as qt, onUnmounted as Vt, watch as Kt, createElementBlock as Yt, openBlock as Gt } from "vue";
|
|
3
3
|
import Xt from "@ebl-vue/editorjs";
|
|
4
4
|
import { bundledLanguagesInfo as Zt, codeToHtml as Jt } from "shiki";
|
|
5
5
|
import * as V from "@editorjs/dom";
|
|
6
6
|
import { make as S, isEmpty as dt } from "@editorjs/dom";
|
|
7
7
|
import { focus as Qt, isCaretAtStartOfInput as te, getCaretNodeAndOffset as ee, getContenteditableSlice as ie } from "@editorjs/caret";
|
|
8
8
|
import K from "axios";
|
|
9
|
-
const
|
|
9
|
+
const pt = Symbol("INSTALLED_KEY"), se = (u, t) => (u.install = (e) => {
|
|
10
10
|
for (const i of [u, ...Object.values({})]) e.component(i.name, i);
|
|
11
11
|
}, u);
|
|
12
12
|
class ne {
|
|
@@ -79,7 +79,7 @@ class ne {
|
|
|
79
79
|
this.isTheOnlyBlock() || this.api.move(this.endBlock, this.startBlock);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const gt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M19 17V10.2135C19 10.1287 18.9011 10.0824 18.836 10.1367L16 12.5"/></svg>', mt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 11C16 10 19 9.5 19 12C19 13.9771 16.0684 13.9997 16.0012 16.8981C15.9999 16.9533 16.0448 17 16.1 17L19.3 17"/></svg>', ft = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 11C16 10.5 16.8323 10 17.6 10C18.3677 10 19.5 10.311 19.5 11.5C19.5 12.5315 18.7474 12.9022 18.548 12.9823C18.5378 12.9864 18.5395 13.0047 18.5503 13.0063C18.8115 13.0456 20 13.3065 20 14.8C20 16 19.5 17 17.8 17C17.8 17 16 17 16 16.3"/></svg>', Ct = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M18 10L15.2834 14.8511C15.246 14.9178 15.294 15 15.3704 15C16.8489 15 18.7561 15 20.2 15M19 17C19 15.7187 19 14.8813 19 13.6"/></svg>', vt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 15.9C16 15.9 16.3768 17 17.8 17C19.5 17 20 15.6199 20 14.7C20 12.7323 17.6745 12.0486 16.1635 12.9894C16.094 13.0327 16 12.9846 16 12.9027V10.1C16 10.0448 16.0448 10 16.1 10H19.8"/></svg>', kt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6 7L6 12M6 17L6 12M6 12L12 12M12 7V12M12 17L12 12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M19.5 10C16.5 10.5 16 13.3285 16 15M16 15V15C16 16.1046 16.8954 17 18 17H18.3246C19.3251 17 20.3191 16.3492 20.2522 15.3509C20.0612 12.4958 16 12.6611 16 15Z"/></svg>', wt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9.2 12L11.0586 13.8586C11.1367 13.9367 11.2633 13.9367 11.3414 13.8586L14.7 10.5"/><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/></svg>', bt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 8L12 12M12 12L16 16M12 12L16 8M12 12L8 16"/></svg>', yt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><line x1="9" x2="19" y1="7" y2="7" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="9" x2="19" y1="12" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="9" x2="19" y1="17" y2="17" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5.00001 17H4.99002"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5.00001 12H4.99002"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M5.00001 7H4.99002"/></svg>', St = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><line x1="12" x2="19" y1="7" y2="7" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="12" x2="19" y1="12" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="12" x2="19" y1="17" y2="17" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7.79999 14L7.79999 7.2135C7.79999 7.12872 7.7011 7.0824 7.63597 7.13668L4.79999 9.5"/></svg>', Lt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-width="2" d="M11.3535 9.31802L12.7678 7.90381C13.5488 7.12276 14.8151 7.12276 15.5962 7.90381C16.3772 8.68486 16.3772 9.95119 15.5962 10.7322L14.182 12.1464M11.3535 9.31802L7.96729 12.7043C7.40889 13.2627 7.02826 13.9739 6.87339 14.7482L6.69798 15.6253C6.55803 16.325 7.17495 16.942 7.87467 16.802L8.75175 16.6266C9.52612 16.4717 10.2373 16.0911 10.7957 15.5327L14.182 12.1464M11.3535 9.31802L14.182 12.1464"/><line x1="15" x2="19" y1="17" y2="17" stroke="currentColor" stroke-linecap="round" stroke-width="2"/></svg>', Pt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.13968 15.32L8.69058 11.5661C9.02934 11.2036 9.48873 11 9.96774 11C10.4467 11 10.9061 11.2036 11.2449 11.5661L15.3871 16M13.5806 14.0664L15.0132 12.533C15.3519 12.1705 15.8113 11.9668 16.2903 11.9668C16.7693 11.9668 17.2287 12.1705 17.5675 12.533L18.841 13.9634"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.7778 9.33331H13.7867"/></svg>', Wt = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 9V7.2C8 7.08954 8.08954 7 8.2 7L12 7M16 9V7.2C16 7.08954 15.9105 7 15.8 7L12 7M12 7L12 17M12 17H10M12 17H14"/></svg>', xt = '<svg t="1763708081701" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2604" width="24" height="24"><path d="M469.3330000000001 725.333H896V640H469.3330000000001v85.333zM128 512l170.667 170.667V341.3330000000001L128 512z m0 384h768v-85.333H128V896z m0-768v85.333h768V128H128z m341.333 256H896v-85.333H469.3330000000001V384z m0 170.667H896v-85.334H469.3330000000001v85.334z" p-id="2605" fill="#000000"></path></svg>', Tt = '<svg t="1763708124227" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2788" width="24" height="24"><path d="M128 896h768v-85.333H128V896z m0-554.667v341.334L298.667 512 128 341.333z m341.333 384H896V640H469.333v85.333zM128 128v85.333h768V128H128z m341.333 256H896v-85.333H469.333V384z m0 170.667H896v-85.334H469.333v85.334z" p-id="2789" fill="#000000"></path></svg>';
|
|
83
83
|
class re {
|
|
84
84
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
85
85
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H1" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
@@ -148,7 +148,7 @@ class re {
|
|
|
148
148
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
149
149
|
}
|
|
150
150
|
get defaultLevel() {
|
|
151
|
-
return { number: 1, tag: "H1", svg:
|
|
151
|
+
return { number: 1, tag: "H1", svg: gt };
|
|
152
152
|
}
|
|
153
153
|
onPaste(t) {
|
|
154
154
|
const e = t.detail;
|
|
@@ -161,7 +161,7 @@ class re {
|
|
|
161
161
|
return { tags: ["H1", "h1"] };
|
|
162
162
|
}
|
|
163
163
|
static get toolbox() {
|
|
164
|
-
return { icon:
|
|
164
|
+
return { icon: gt, title: "H1" };
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
class oe {
|
|
@@ -232,7 +232,7 @@ class oe {
|
|
|
232
232
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
233
233
|
}
|
|
234
234
|
get defaultLevel() {
|
|
235
|
-
return { number: 2, tag: "H2", svg:
|
|
235
|
+
return { number: 2, tag: "H2", svg: mt };
|
|
236
236
|
}
|
|
237
237
|
onPaste(t) {
|
|
238
238
|
const e = t.detail;
|
|
@@ -245,7 +245,7 @@ class oe {
|
|
|
245
245
|
return { tags: ["H2"] };
|
|
246
246
|
}
|
|
247
247
|
static get toolbox() {
|
|
248
|
-
return { icon:
|
|
248
|
+
return { icon: mt, title: "H2" };
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
class ae {
|
|
@@ -316,7 +316,7 @@ class ae {
|
|
|
316
316
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
317
317
|
}
|
|
318
318
|
get defaultLevel() {
|
|
319
|
-
return { number: 3, tag: "H3", svg:
|
|
319
|
+
return { number: 3, tag: "H3", svg: ft };
|
|
320
320
|
}
|
|
321
321
|
onPaste(t) {
|
|
322
322
|
const e = t.detail;
|
|
@@ -329,7 +329,7 @@ class ae {
|
|
|
329
329
|
return { tags: ["H3"] };
|
|
330
330
|
}
|
|
331
331
|
static get toolbox() {
|
|
332
|
-
return { icon:
|
|
332
|
+
return { icon: ft, title: "H3" };
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
class le {
|
|
@@ -400,7 +400,7 @@ class le {
|
|
|
400
400
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
401
401
|
}
|
|
402
402
|
get defaultLevel() {
|
|
403
|
-
return { number: 4, tag: "H4", svg:
|
|
403
|
+
return { number: 4, tag: "H4", svg: Ct };
|
|
404
404
|
}
|
|
405
405
|
onPaste(t) {
|
|
406
406
|
const e = t.detail;
|
|
@@ -413,7 +413,7 @@ class le {
|
|
|
413
413
|
return { tags: ["H4"] };
|
|
414
414
|
}
|
|
415
415
|
static get toolbox() {
|
|
416
|
-
return { icon:
|
|
416
|
+
return { icon: Ct, title: "H4" };
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
class de {
|
|
@@ -484,7 +484,7 @@ class de {
|
|
|
484
484
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
485
485
|
}
|
|
486
486
|
get defaultLevel() {
|
|
487
|
-
return { number: 5, tag: "H5", svg:
|
|
487
|
+
return { number: 5, tag: "H5", svg: vt };
|
|
488
488
|
}
|
|
489
489
|
onPaste(t) {
|
|
490
490
|
const e = t.detail;
|
|
@@ -497,7 +497,7 @@ class de {
|
|
|
497
497
|
return { tags: ["H5"] };
|
|
498
498
|
}
|
|
499
499
|
static get toolbox() {
|
|
500
|
-
return { icon:
|
|
500
|
+
return { icon: vt, title: "H5" };
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
class he {
|
|
@@ -568,7 +568,7 @@ class he {
|
|
|
568
568
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
569
569
|
}
|
|
570
570
|
get defaultLevel() {
|
|
571
|
-
return { number: 6, tag: "H6", svg:
|
|
571
|
+
return { number: 6, tag: "H6", svg: kt };
|
|
572
572
|
}
|
|
573
573
|
onPaste(t) {
|
|
574
574
|
const e = t.detail;
|
|
@@ -581,7 +581,7 @@ class he {
|
|
|
581
581
|
return { tags: ["H6"] };
|
|
582
582
|
}
|
|
583
583
|
static get toolbox() {
|
|
584
|
-
return { icon:
|
|
584
|
+
return { icon: kt, title: "H6" };
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
class ht {
|
|
@@ -677,7 +677,7 @@ class ct {
|
|
|
677
677
|
return { tags: ["P", "div", "br"] };
|
|
678
678
|
}
|
|
679
679
|
static get toolbox() {
|
|
680
|
-
return { icon:
|
|
680
|
+
return { icon: Wt, title: "Text" };
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
class q {
|
|
@@ -733,12 +733,12 @@ class q {
|
|
|
733
733
|
const e = t.target, i = t.shiftKey, s = e.selectionStart, n = e.value, r = " ";
|
|
734
734
|
let o;
|
|
735
735
|
if (i) {
|
|
736
|
-
const a = function(
|
|
736
|
+
const a = function(d, l) {
|
|
737
737
|
let p = "";
|
|
738
738
|
for (; p !== `
|
|
739
|
-
` &&
|
|
739
|
+
` && l > 0; ) l -= 1, p = d.substr(l, 1);
|
|
740
740
|
return p === `
|
|
741
|
-
` && (
|
|
741
|
+
` && (l += 1), l;
|
|
742
742
|
}(n, s);
|
|
743
743
|
if (n.substr(a, 2) !== r) return;
|
|
744
744
|
e.value = n.substring(0, a) + n.substring(a + 2), o = s - 2;
|
|
@@ -746,44 +746,44 @@ class q {
|
|
|
746
746
|
e.setSelectionRange(o, o);
|
|
747
747
|
}
|
|
748
748
|
drawView() {
|
|
749
|
-
const t = document.createElement("div"), e = document.createElement("div"), i = document.createElement("div"), s = document.createElement("div"), n = document.createElement("div"), r = document.createElement("div"), o = document.createElement("select"), a = document.createElement("select"),
|
|
750
|
-
return p.classList.add("ce-editorjs-x-shiki__code__dragHandler"), t.classList.add(this.CSS.baseClass, this.CSS.wrapper), this.readOnly ? t.classList.add("read-only") : t.classList.add("editable"), e.classList.add("ce-editorjs-x-shiki__code"), i.classList.add("ce-editorjs-x-shiki__selector"), s.classList.add("ce-editorjs-x-shiki__lang"), n.classList.add("ce-editorjs-x-shiki__copy"), r.classList.add("ce-editorjs-x-shiki__copy_tip"), o.classList.add(this.CSS.selectorLanguage),
|
|
749
|
+
const t = document.createElement("div"), e = document.createElement("div"), i = document.createElement("div"), s = document.createElement("div"), n = document.createElement("div"), r = document.createElement("div"), o = document.createElement("select"), a = document.createElement("select"), d = document.createElement("span"), l = document.createElement("textarea"), p = document.createElement("div");
|
|
750
|
+
return p.classList.add("ce-editorjs-x-shiki__code__dragHandler"), t.classList.add(this.CSS.baseClass, this.CSS.wrapper), this.readOnly ? t.classList.add("read-only") : t.classList.add("editable"), e.classList.add("ce-editorjs-x-shiki__code"), i.classList.add("ce-editorjs-x-shiki__selector"), s.classList.add("ce-editorjs-x-shiki__lang"), n.classList.add("ce-editorjs-x-shiki__copy"), r.classList.add("ce-editorjs-x-shiki__copy_tip"), o.classList.add(this.CSS.selectorLanguage), l.classList.add(this.CSS.textarea, this.CSS.input), s.innerHTML = this.data.lang, n.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.25 8.5H10.25C9.2835 8.5 8.5 9.2835 8.5 10.25V17.25C8.5 18.2165 9.2835 19 10.25 19H17.25C18.2165 19 19 18.2165 19 17.25V10.25C19 9.2835 18.2165 8.5 17.25 8.5Z"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.5 8.5V6.75C15.5 6.28587 15.3156 5.84075 14.9874 5.51256C14.6592 5.18437 14.2141 5 13.75 5H6.75C6.28587 5 5.84075 5.18437 5.51256 5.51256C5.18437 5.84075 5 6.28587 5 6.75V13.75C5 14.2141 5.18437 14.6592 5.51256 14.9874C5.84075 15.3156 6.28587 15.5 6.75 15.5H8.5"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 12L15.5 12"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15.5L15.5 15.5"/></svg>', r.innerText = this.api.i18n.t("Copied"), Zt.forEach((c) => {
|
|
751
751
|
const h = document.createElement("option");
|
|
752
752
|
h.value = c.id, h.text = c.name, o.appendChild(h);
|
|
753
|
-
}), o.value = this.data.lang,
|
|
754
|
-
|
|
753
|
+
}), o.value = this.data.lang, l.value = this.data.code, l.placeholder = this.placeholder, l.spellcheck = !1, l.autocomplete = "off", l.autocapitalize = "off", this.readOnly && (l.disabled = !0), e.appendChild(d), e.appendChild(l), t.appendChild(p), this.data.resizeSize && this.data.resizeSize > 0 && (e.style.height = this.data.resizeSize + "px"), this.readOnly ? i.appendChild(s) : i.appendChild(o), n.appendChild(r), i.appendChild(n), t.appendChild(i), t.appendChild(e), this.runShiki().then(({ html: c, preStyle: h }) => {
|
|
754
|
+
d.innerHTML = c, t == null || t.setAttribute("style", h), o.setAttribute("style", h), a.setAttribute("style", h);
|
|
755
755
|
}), o.addEventListener("change", (c) => {
|
|
756
756
|
const h = c.target.value;
|
|
757
757
|
this._selectorLanguage = h, this.runShiki().then(({ html: g, preStyle: m }) => {
|
|
758
|
-
|
|
758
|
+
d.innerHTML = g, s.innerHTML = h;
|
|
759
759
|
});
|
|
760
760
|
}), a.addEventListener("change", (c) => {
|
|
761
761
|
const h = c.target.value;
|
|
762
762
|
this._selectorTheme = h, this.runShiki().then(({ html: g, preStyle: m }) => {
|
|
763
|
-
|
|
763
|
+
d.innerHTML = g, t == null || t.setAttribute("style", m), o.setAttribute("style", m), a.setAttribute("style", m);
|
|
764
764
|
});
|
|
765
|
-
}),
|
|
766
|
-
this.data.code =
|
|
767
|
-
|
|
765
|
+
}), l.addEventListener("input", () => {
|
|
766
|
+
this.data.code = l.value, this.runShiki().then(({ html: c, preStyle: h }) => {
|
|
767
|
+
d.innerHTML = c, t == null || t.setAttribute("style", h), o.setAttribute("style", h), a.setAttribute("style", h);
|
|
768
768
|
});
|
|
769
|
-
}),
|
|
770
|
-
c.code === "Tab" && (this.tabHandler(c), this.data.code =
|
|
771
|
-
|
|
769
|
+
}), l.addEventListener("keydown", (c) => {
|
|
770
|
+
c.code === "Tab" && (this.tabHandler(c), this.data.code = l.value, this.runShiki().then(({ html: h, preStyle: g }) => {
|
|
771
|
+
d.innerHTML = h;
|
|
772
772
|
}));
|
|
773
|
-
}),
|
|
774
|
-
|
|
773
|
+
}), l.addEventListener("scroll", () => {
|
|
774
|
+
d.style = `display:block;transform: translateY(-${l.scrollTop}px)`;
|
|
775
775
|
}), n.addEventListener("click", (c) => {
|
|
776
776
|
this.copyCode(this.data.code, c);
|
|
777
777
|
}), p.addEventListener("mousedown", (c) => {
|
|
778
778
|
this.resizeClick(e, c);
|
|
779
|
-
}), this.nodes.textarea =
|
|
779
|
+
}), this.nodes.textarea = l, t;
|
|
780
780
|
}
|
|
781
781
|
resizeClick(t, e) {
|
|
782
782
|
let i = e.clientY, s = parseInt(window.getComputedStyle(t).height, 10);
|
|
783
783
|
const n = (o) => {
|
|
784
784
|
const a = o.clientY - i;
|
|
785
|
-
let
|
|
786
|
-
|
|
785
|
+
let d = s + a;
|
|
786
|
+
d < 100 && (d = 100), t.style.height = d + "px";
|
|
787
787
|
}, r = () => {
|
|
788
788
|
const o = parseInt(window.getComputedStyle(t).height, 10);
|
|
789
789
|
this.data.resizeSize = o, document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r);
|
|
@@ -1115,8 +1115,8 @@ class et {
|
|
|
1115
1115
|
s === "ordered" && (this.data.meta.counterType = "numeric", this.data.meta.start = 1);
|
|
1116
1116
|
const r = (o) => Array.from(o.querySelectorAll(":scope > li")).map((a) => {
|
|
1117
1117
|
var p;
|
|
1118
|
-
const
|
|
1119
|
-
return { content: (p = a.innerHTML) != null ? p : "", meta: {}, items:
|
|
1118
|
+
const d = a.querySelector(`:scope > ${i}`), l = d ? r(d) : [];
|
|
1119
|
+
return { content: (p = a.innerHTML) != null ? p : "", meta: {}, items: l };
|
|
1120
1120
|
});
|
|
1121
1121
|
return n.items = r(t), n;
|
|
1122
1122
|
}
|
|
@@ -1199,12 +1199,12 @@ class et {
|
|
|
1199
1199
|
o.insertAdjacentHTML("beforeend", r);
|
|
1200
1200
|
const a = _(t);
|
|
1201
1201
|
if (a.length === 0) return t.remove(), void tt(n);
|
|
1202
|
-
const
|
|
1202
|
+
const d = e || s, l = (p = H(d)) != null ? p : this.renderer.renderWrapper(!1);
|
|
1203
1203
|
e ? a.forEach((c) => {
|
|
1204
|
-
|
|
1204
|
+
l.appendChild(c);
|
|
1205
1205
|
}) : a.forEach((c) => {
|
|
1206
|
-
|
|
1207
|
-
}), H(
|
|
1206
|
+
l.prepend(c);
|
|
1207
|
+
}), H(d) === null && n.appendChild(l), t.remove();
|
|
1208
1208
|
}
|
|
1209
1209
|
addTab(t) {
|
|
1210
1210
|
var n;
|
|
@@ -1265,7 +1265,7 @@ class et {
|
|
|
1265
1265
|
});
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
|
-
const P = { wrapper: `${b}-start-with-field`, input: `${b}-start-with-field__input`, startWithElementWrapperInvalid: `${b}-start-with-field--invalid` }, j = /* @__PURE__ */ new Map([["Numeric", "numeric"], ["Lower Roman", "lower-roman"], ["Upper Roman", "upper-roman"], ["Lower Alpha", "lower-alpha"], ["Upper Alpha", "upper-alpha"]]),
|
|
1268
|
+
const P = { wrapper: `${b}-start-with-field`, input: `${b}-start-with-field__input`, startWithElementWrapperInvalid: `${b}-start-with-field--invalid` }, j = /* @__PURE__ */ new Map([["Numeric", "numeric"], ["Lower Roman", "lower-roman"], ["Upper Roman", "upper-roman"], ["Lower Alpha", "lower-alpha"], ["Upper Alpha", "upper-alpha"]]), Et = /* @__PURE__ */ new Map([["numeric", '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 14.2L10 7.4135C10 7.32872 9.90111 7.28241 9.83598 7.33668L7 9.7" stroke="black" stroke-width="1.6" stroke-linecap="round"/><path d="M13.2087 14.2H13.2" stroke="black" stroke-width="1.6" stroke-linecap="round"/></svg>'], ["lower-roman", '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.2087 14.2H13.2" stroke="black" stroke-width="1.6" stroke-linecap="round"/><path d="M10 14.2L10 9.5" stroke="black" stroke-width="1.6" stroke-linecap="round"/><path d="M10 7.01L10 7" stroke="black" stroke-width="1.8" stroke-linecap="round"/></svg>'], ["upper-roman", '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.2087 14.2H13.2" stroke="black" stroke-width="1.6" stroke-linecap="round"/><path d="M10 14.2L10 7.2" stroke="black" stroke-width="1.6" stroke-linecap="round"/></svg>'], ["lower-alpha", '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.2087 14.2H14.2" stroke="black" stroke-width="1.6" stroke-linecap="round"/><path d="M11.5 14.5C11.5 14.5 11 13.281 11 12.5M7 9.5C7 9.5 7.5 8.5 9 8.5C10.5 8.5 11 9.5 11 10.5L11 11.5M11 11.5L11 12.5M11 11.5C11 11.5 7 11 7 13C7 15.3031 11 15 11 12.5" stroke="black" stroke-width="1.6" stroke-linecap="round"/></svg>'], ["upper-alpha", '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.0087 14.2H16" stroke="black" stroke-width="1.6" stroke-linecap="round"/><path d="M7 14.2L7.78865 12M13 14.2L12.1377 12M7.78865 12C7.78865 12 9.68362 7 10 7C10.3065 7 12.1377 12 12.1377 12M7.78865 12L12.1377 12" stroke="black" stroke-width="1.6" stroke-linecap="round"/></svg>']]);
|
|
1269
1269
|
class X {
|
|
1270
1270
|
static get isReadOnlySupported() {
|
|
1271
1271
|
return !0;
|
|
@@ -1274,7 +1274,7 @@ class X {
|
|
|
1274
1274
|
return !0;
|
|
1275
1275
|
}
|
|
1276
1276
|
static get toolbox() {
|
|
1277
|
-
return [{ icon:
|
|
1277
|
+
return [{ icon: yt, title: "Unordered List", data: { style: "unordered" } }, { icon: St, title: "Ordered List", data: { style: "ordered" } }, { icon: wt, title: "Checklist", data: { style: "checklist" } }];
|
|
1278
1278
|
}
|
|
1279
1279
|
static get pasteConfig() {
|
|
1280
1280
|
return { tags: ["OL", "UL", "LI"] };
|
|
@@ -1296,17 +1296,17 @@ class X {
|
|
|
1296
1296
|
this.api = i, this.readOnly = s, this.config = e, this.block = n, this.defaultListStyle = ((o = this.config) == null ? void 0 : o.defaultStyle) || "unordered", this.defaultCounterTypes = this.config.counterTypes || Array.from(j.values());
|
|
1297
1297
|
const r = { style: this.defaultListStyle, meta: {}, items: [] };
|
|
1298
1298
|
this.data = Object.keys(t).length ? function(a) {
|
|
1299
|
-
const
|
|
1300
|
-
return function(
|
|
1301
|
-
return typeof
|
|
1302
|
-
}(a) ? (a.items.forEach((
|
|
1303
|
-
|
|
1304
|
-
}), { style: a.style, meta: {}, items:
|
|
1305
|
-
return typeof
|
|
1306
|
-
}(a) ? (a.items.forEach((
|
|
1307
|
-
|
|
1308
|
-
}), { style: "checklist", meta: {}, items:
|
|
1309
|
-
return !("meta" in
|
|
1299
|
+
const d = [];
|
|
1300
|
+
return function(l) {
|
|
1301
|
+
return typeof l.items[0] == "string";
|
|
1302
|
+
}(a) ? (a.items.forEach((l) => {
|
|
1303
|
+
d.push({ content: l, meta: {}, items: [] });
|
|
1304
|
+
}), { style: a.style, meta: {}, items: d }) : function(l) {
|
|
1305
|
+
return typeof l.items[0] != "string" && "text" in l.items[0] && "checked" in l.items[0] && typeof l.items[0].text == "string" && typeof l.items[0].checked == "boolean";
|
|
1306
|
+
}(a) ? (a.items.forEach((l) => {
|
|
1307
|
+
d.push({ content: l.text, meta: { checked: l.checked }, items: [] });
|
|
1308
|
+
}), { style: "checklist", meta: {}, items: d }) : function(l) {
|
|
1309
|
+
return !("meta" in l);
|
|
1310
1310
|
}(a) ? { style: a.style, meta: {}, items: a.items } : structuredClone(a);
|
|
1311
1311
|
}(t) : r, this.listStyle === "ordered" && this.data.meta.counterType === void 0 && (this.data.meta.counterType = "numeric"), this.changeTabulatorByStyle();
|
|
1312
1312
|
}
|
|
@@ -1324,17 +1324,17 @@ class X {
|
|
|
1324
1324
|
}
|
|
1325
1325
|
renderSettings() {
|
|
1326
1326
|
var e;
|
|
1327
|
-
const t = [{ label: this.api.i18n.t("Unordered"), icon:
|
|
1327
|
+
const t = [{ label: this.api.i18n.t("Unordered"), icon: yt, closeOnActivate: !0, isActive: this.listStyle == "unordered", onActivate: () => {
|
|
1328
1328
|
this.listStyle = "unordered";
|
|
1329
|
-
} }, { label: this.api.i18n.t("Ordered"), icon:
|
|
1329
|
+
} }, { label: this.api.i18n.t("Ordered"), icon: St, closeOnActivate: !0, isActive: this.listStyle == "ordered", onActivate: () => {
|
|
1330
1330
|
this.listStyle = "ordered";
|
|
1331
|
-
} }, { label: this.api.i18n.t("Checklist"), icon:
|
|
1331
|
+
} }, { label: this.api.i18n.t("Checklist"), icon: wt, closeOnActivate: !0, isActive: this.listStyle == "checklist", onActivate: () => {
|
|
1332
1332
|
this.listStyle = "checklist";
|
|
1333
1333
|
} }];
|
|
1334
1334
|
if (this.listStyle === "ordered") {
|
|
1335
|
-
const i = function(r, o, { value: a, placeholder:
|
|
1336
|
-
const c = V.make("div", P.wrapper), h = V.make("div", "cdx-list-start-with-field__startlabel", { innerText: r }), g = V.make("div", "cdx-list-start-with-field__input-wrapper"), m = V.make("input", P.input, { placeholder:
|
|
1337
|
-
for (const f in
|
|
1335
|
+
const i = function(r, o, { value: a, placeholder: d, attributes: l, sanitize: p }) {
|
|
1336
|
+
const c = V.make("div", P.wrapper), h = V.make("div", "cdx-list-start-with-field__startlabel", { innerText: r }), g = V.make("div", "cdx-list-start-with-field__input-wrapper"), m = V.make("input", P.input, { placeholder: d, tabIndex: -1, value: a, type: "number" });
|
|
1337
|
+
for (const f in l) m.setAttribute(f, l[f]);
|
|
1338
1338
|
return c.appendChild(h), g.appendChild(m), c.appendChild(g), m.addEventListener("input", () => {
|
|
1339
1339
|
p !== void 0 && (m.value = p(m.value));
|
|
1340
1340
|
const f = m.checkValidity();
|
|
@@ -1342,10 +1342,10 @@ class X {
|
|
|
1342
1342
|
}), c;
|
|
1343
1343
|
}(this.api.i18n.t("Start with"), (r) => this.changeStartWith(Number(r)), { value: String((e = this.data.meta.start) != null ? e : 1), placeholder: "", attributes: { required: "true" }, sanitize: (r) => function(o) {
|
|
1344
1344
|
return o.replace(/\D+/g, "");
|
|
1345
|
-
}(r) }), s = [{ label: this.api.i18n.t("Start with"), icon: '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 14.2L8 7.4135C8 7.32872 7.90111 7.28241 7.83598 7.33668L5 9.7" stroke="black" stroke-width="1.6" stroke-linecap="round"/><path d="M14 13L16.4167 10.7778M16.4167 10.7778L14 8.5M16.4167 10.7778H11.6562" stroke="black" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>', name: "list-setting-start-with", element: i, type: "html" }], n = { label: this.api.i18n.t("Counter type"), name: "list-setting", icon:
|
|
1345
|
+
}(r) }), s = [{ label: this.api.i18n.t("Start with"), icon: '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8 14.2L8 7.4135C8 7.32872 7.90111 7.28241 7.83598 7.33668L5 9.7" stroke="black" stroke-width="1.6" stroke-linecap="round"/><path d="M14 13L16.4167 10.7778M16.4167 10.7778L14 8.5M16.4167 10.7778H11.6562" stroke="black" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>', name: "list-setting-start-with", element: i, type: "html" }], n = { label: this.api.i18n.t("Counter type"), name: "list-setting", icon: Et.get(this.data.meta.counterType), children: { items: [] } };
|
|
1346
1346
|
j.forEach((r, o) => {
|
|
1347
1347
|
const a = j.get(o);
|
|
1348
|
-
this.defaultCounterTypes.includes(a) && n.children.items.push({ title: this.api.i18n.t(o), icon:
|
|
1348
|
+
this.defaultCounterTypes.includes(a) && n.children.items.push({ title: this.api.i18n.t(o), icon: Et.get(a), isActive: this.data.meta.counterType === j.get(o), closeOnActivate: !0, onActivate: () => {
|
|
1349
1349
|
this.changeCounters(j.get(o));
|
|
1350
1350
|
} });
|
|
1351
1351
|
}), n.children.items.length > 1 && s.push(n), t.push({ type: "separator" }, ...s);
|
|
@@ -1388,7 +1388,7 @@ class X {
|
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
1391
|
-
class
|
|
1391
|
+
class Mt {
|
|
1392
1392
|
constructor(t) {
|
|
1393
1393
|
this.target = t, this.isContentEditable = t && t.contentEditable;
|
|
1394
1394
|
}
|
|
@@ -1464,8 +1464,8 @@ class ge {
|
|
|
1464
1464
|
constructor({ editor: t, config: e = {}, onUpdate: i, maxLength: s }) {
|
|
1465
1465
|
this.position = 0;
|
|
1466
1466
|
const n = { maxLength: 30, onUpdate() {
|
|
1467
|
-
}, config: { debounceTimer: 200, shortcuts: { undo: ["CMD+Z"], redo: ["CMD+Y", "CMD+SHIFT+Z"] } } }, { blocks: r, caret: o } = t, { configuration: a } = t, { holder:
|
|
1468
|
-
this.holder = typeof
|
|
1467
|
+
}, config: { debounceTimer: 200, shortcuts: { undo: ["CMD+Z"], redo: ["CMD+Y", "CMD+SHIFT+Z"] } } }, { blocks: r, caret: o } = t, { configuration: a } = t, { holder: d, defaultBlock: l } = a, p = n.config.shortcuts, { shortcuts: c } = e, h = { ...p, ...c }, g = Array.isArray(h.undo) ? h.undo : [h.undo], m = Array.isArray(h.redo) ? h.redo : [h.redo], f = n.config.debounceTimer, { debounceTimer: v = f } = e;
|
|
1468
|
+
this.holder = typeof d == "string" ? document.getElementById(d) : d, this.editor = t, this.defaultBlock = l, this.blocks = r, this.caret = o, this.shouldSaveHistory = !0, this.readOnly = a.readOnly, this.maxLength = s || n.maxLength, this.onUpdate = i || n.onUpdate, this.config = { debounceTimer: v, shortcuts: { undo: g, redo: m } }, new pe(() => this.registerChange(), this.holder, this.config.debounceTimer).setMutationObserver(), this.setEventListeners(), this.initialItem = null, this.clear();
|
|
1469
1469
|
}
|
|
1470
1470
|
static get isReadOnlySupported() {
|
|
1471
1471
|
return !0;
|
|
@@ -1503,7 +1503,7 @@ class ge {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
getCaretIndex(t) {
|
|
1505
1505
|
const e = this.holder.getElementsByClassName("ce-block__content");
|
|
1506
|
-
return new
|
|
1506
|
+
return new Mt(e[t].firstChild).getPos();
|
|
1507
1507
|
}
|
|
1508
1508
|
insertDeletedBlock(t, e, i) {
|
|
1509
1509
|
for (let s = 0; s < t.length; s += 1) if (!e[s] || t[s].id !== e[s].id) {
|
|
@@ -1549,7 +1549,7 @@ class ge {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
setCaretIndex(t, e) {
|
|
1551
1551
|
if (e && e !== -1) {
|
|
1552
|
-
const i = this.holder.getElementsByClassName("ce-block__content"), s = new
|
|
1552
|
+
const i = this.holder.getElementsByClassName("ce-block__content"), s = new Mt(i[t].firstChild);
|
|
1553
1553
|
setTimeout(() => s.setPos(e), 50);
|
|
1554
1554
|
} else this.caret.setToBlock(t, "end");
|
|
1555
1555
|
}
|
|
@@ -1587,10 +1587,10 @@ class ge {
|
|
|
1587
1587
|
return i.push(s), i;
|
|
1588
1588
|
}
|
|
1589
1589
|
setEventListeners() {
|
|
1590
|
-
const { holder: t } = this, { shortcuts: e } = this.config, { undo: i, redo: s } = e, n = i.map((h) => h.replace(/ /g, "").split("+")), r = s.map((h) => h.replace(/ /g, "").split("+")), o = n.map((h) => this.parseKeys(h)), a = r.map((h) => this.parseKeys(h)),
|
|
1591
|
-
|
|
1590
|
+
const { holder: t } = this, { shortcuts: e } = this.config, { undo: i, redo: s } = e, n = i.map((h) => h.replace(/ /g, "").split("+")), r = s.map((h) => h.replace(/ /g, "").split("+")), o = n.map((h) => this.parseKeys(h)), a = r.map((h) => this.parseKeys(h)), d = (h, g) => g.reduce((m, f) => m || ((v, M) => M.length === 3 && v[M[0]] && v[M[1]] && v.key.toLowerCase() === M[2])(h, f), !1), l = (h, g, m) => !(!((f, v) => v.reduce((M, L) => M || ((D, U) => U.length === 2 && D[U[0]] && D.key.toLowerCase() === U[1])(f, L), !1))(h, g) || d(h, m)) || !!d(h, g), p = (h) => {
|
|
1591
|
+
l(h, o, a) && (h.preventDefault(), this.undo());
|
|
1592
1592
|
}, c = (h) => {
|
|
1593
|
-
|
|
1593
|
+
l(h, a, o) && (h.preventDefault(), this.redo());
|
|
1594
1594
|
};
|
|
1595
1595
|
t.addEventListener("keydown", p), t.addEventListener("keydown", c), t.addEventListener("destroy", () => {
|
|
1596
1596
|
t.removeEventListener("keydown", p), t.removeEventListener("keydown", c);
|
|
@@ -1671,9 +1671,9 @@ class I {
|
|
|
1671
1671
|
}).forEach((s, n, r) => {
|
|
1672
1672
|
const o = s.getAttribute("data-type") || "";
|
|
1673
1673
|
s.addEventListener("click", () => {
|
|
1674
|
-
this._changeAlertType(o), r.forEach((a,
|
|
1675
|
-
const
|
|
1676
|
-
a.classList.toggle("cdx-alert_setting__icon_active",
|
|
1674
|
+
this._changeAlertType(o), r.forEach((a, d) => {
|
|
1675
|
+
const l = a.getAttribute("data-type");
|
|
1676
|
+
a.classList.toggle("cdx-alert_setting__icon_active", l === this.data.type);
|
|
1677
1677
|
});
|
|
1678
1678
|
});
|
|
1679
1679
|
}), t.appendChild(e), t.appendChild(i), t;
|
|
@@ -1714,11 +1714,11 @@ class I {
|
|
|
1714
1714
|
return { message: !0, type: !1, alignType: !1 };
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
|
-
const
|
|
1717
|
+
const _t = { orientation: !1 }, w = class w {
|
|
1718
1718
|
constructor({ api: t, data: e, config: i, block: s, ...n }) {
|
|
1719
|
-
var o, a,
|
|
1719
|
+
var o, a, d, l, p, c;
|
|
1720
1720
|
this.wrapper = document.createElement("div"), this.DEFAULT_INDENT_KEY = "Tab", this.lastResizeTimeout = null, this.cachedMaxWidthForContent = null, this.api = t, this.block = s, !i && "settings" in n && (i = (o = n.settings) != null ? o : {}), this.config = { indentSize: 24, maxIndent: 8, minIndent: 0, multiblock: !1, autoIndent: !1, tuneName: null, orientation: "horizontal", customBlockIndentLimits: {}, handleShortcut: void 0, direction: "ltr", directionChangeHandler: null, version: "2.30", ...i != null ? i : {} }, this.changeConfigBasedOnVersionIfNeeded(), (a = this.config) != null && a.directionChangeHandler && this.config.directionChangeHandler(this.alignmentChangeListener.bind(this));
|
|
1721
|
-
const r = (c = (p = this.config.customBlockIndentLimits[(
|
|
1721
|
+
const r = (c = (p = this.config.customBlockIndentLimits[(l = (d = this.block) == null ? void 0 : d.name) != null ? l : ""]) == null ? void 0 : p.min) != null ? c : this.config.minIndent;
|
|
1722
1722
|
this.data = { indentLevel: r, ...e != null ? e : {} }, this.config.multiblock && this.config.tuneName, window.addEventListener("resize", (h) => this.onResize.call(this, h)), this.api.events.on("block changed", ({ event: h }) => {
|
|
1723
1723
|
var f;
|
|
1724
1724
|
const g = h.detail.target.id;
|
|
@@ -1747,18 +1747,18 @@ const Ht = { orientation: !1 }, w = class w {
|
|
|
1747
1747
|
if (queueMicrotask(() => {
|
|
1748
1748
|
t() && setTimeout(t, 300);
|
|
1749
1749
|
}), this.config.orientation === "vertical") {
|
|
1750
|
-
const a = `${this.TuneNames.indentLeft}-${(r = this.block) == null ? void 0 : r.id}`,
|
|
1751
|
-
return [{ title: this.rightText, hint: { title: this.api.i18n.t(this.rightText) }, onActivate: (
|
|
1752
|
-
this.handleIndentRight(),
|
|
1753
|
-
}, icon:
|
|
1754
|
-
this.handleIndentLeft(),
|
|
1755
|
-
}, icon:
|
|
1750
|
+
const a = `${this.TuneNames.indentLeft}-${(r = this.block) == null ? void 0 : r.id}`, d = `${this.TuneNames.indentRight}-${(o = this.block) == null ? void 0 : o.id}`;
|
|
1751
|
+
return [{ title: this.rightText, hint: { title: this.api.i18n.t(this.rightText) }, onActivate: (l, p) => {
|
|
1752
|
+
this.handleIndentRight(), l.title = this.rightText;
|
|
1753
|
+
}, icon: Tt, name: d }, { title: this.leftText, hint: { title: this.api.i18n.t(this.leftText) }, onActivate: (l, p) => {
|
|
1754
|
+
this.handleIndentLeft(), l.title = this.leftText;
|
|
1755
|
+
}, icon: xt, name: a }];
|
|
1756
1756
|
}
|
|
1757
1757
|
const e = `
|
|
1758
1758
|
<div class="${this.CSS.popoverItem} ${this.CSS.customPopoverItem}" data-item-name='indent' version=${this.config.version}>
|
|
1759
|
-
<button type="button" class="${this.CSS.popoverItemIcon}" data-${this.TuneNames.indentLeft}>${
|
|
1759
|
+
<button type="button" class="${this.CSS.popoverItemIcon}" data-${this.TuneNames.indentLeft}>${xt}</button>
|
|
1760
1760
|
<span class="${this.CSS.popoverItemTitle}">${this.api.sanitizer.clean(this.api.i18n.t("Indent"), {})}</span>
|
|
1761
|
-
<button type="button" class="${this.CSS.popoverItemIcon}" data-${this.TuneNames.indentRight} style="margin-left:10px;">${
|
|
1761
|
+
<button type="button" class="${this.CSS.popoverItemIcon}" data-${this.TuneNames.indentRight} style="margin-left:10px;">${Tt}</button>
|
|
1762
1762
|
</div>
|
|
1763
1763
|
`, i = this.createElementFromTemplate(e), s = i.querySelector(`[data-${this.TuneNames.indentRight}]`), n = i.querySelector(`[data-${this.TuneNames.indentLeft}]`);
|
|
1764
1764
|
return s && (s.addEventListener("click", () => this.handleIndentRight()), this.api.tooltip.onHover(s, this.api.i18n.t("Indent right"), { placement: "top" })), n && (n.addEventListener("click", () => this.handleIndentLeft()), this.api.tooltip.onHover(n, this.api.i18n.t("Indent left"), { placement: "top" })), i;
|
|
@@ -1771,8 +1771,8 @@ const Ht = { orientation: !1 }, w = class w {
|
|
|
1771
1771
|
const a = this.createElementFromTemplate(`
|
|
1772
1772
|
<div class="${(o = (r = this.config.highlightIndent) == null ? void 0 : r.className) != null ? o : ""} ${this.CSS.highlightIndent}">
|
|
1773
1773
|
</div>
|
|
1774
|
-
`),
|
|
1775
|
-
|
|
1774
|
+
`), d = t.classList.contains(this.EditorCSS.content) ? t : t.querySelector(`.${this.EditorCSS.content}`);
|
|
1775
|
+
d == null || d.appendChild(a);
|
|
1776
1776
|
}
|
|
1777
1777
|
return this.applyStylesToWrapper(this.wrapper, this.data.indentLevel), this.wrapper.addEventListener("keydown", (...a) => this.onKeyDown.apply(this, a), { capture: !0 }), this.wrapper.addEventListener("focus", (a) => this.onFocus.call(this, a), { capture: !0 }), this.wrapper.addEventListener("blur", (a) => this.onBlur.call(this, a), { capture: !0 }), this.wrapper;
|
|
1778
1778
|
}
|
|
@@ -1852,13 +1852,13 @@ const Ht = { orientation: !1 }, w = class w {
|
|
|
1852
1852
|
if (!this.config.multiblock || s.length < 2) return i ? this.indentBlock() : this.unIndentBlock(), void ((o = (r = this.block).dispatchChange) == null ? void 0 : o.call(r));
|
|
1853
1853
|
this.config.tuneName && s.forEach(async (a) => {
|
|
1854
1854
|
var c, h, g, m;
|
|
1855
|
-
const
|
|
1856
|
-
if (!
|
|
1857
|
-
const
|
|
1858
|
-
if (!
|
|
1859
|
-
|
|
1855
|
+
const d = await a.save();
|
|
1856
|
+
if (!d || !("tunes" in d) || typeof d.tunes != "object" || !d.tunes) return;
|
|
1857
|
+
const l = d.tunes[(c = this.config.tuneName) != null ? c : ""];
|
|
1858
|
+
if (!l) return;
|
|
1859
|
+
l.indentLevel = i ? Math.min(this.config.maxIndent, ((h = l.indentLevel) != null ? h : 0) + 1) : Math.max(0, ((g = l.indentLevel) != null ? g : 0) - 1), (m = a.dispatchChange) == null || m.call(a);
|
|
1860
1860
|
const p = this.getWrapperBlockById(a.id);
|
|
1861
|
-
p instanceof HTMLElement && this.applyStylesToWrapper(p,
|
|
1861
|
+
p instanceof HTMLElement && this.applyStylesToWrapper(p, l.indentLevel);
|
|
1862
1862
|
});
|
|
1863
1863
|
}
|
|
1864
1864
|
handleIndentLeft() {
|
|
@@ -1905,10 +1905,10 @@ const Ht = { orientation: !1 }, w = class w {
|
|
|
1905
1905
|
if (!(s instanceof HTMLElement && n)) return;
|
|
1906
1906
|
const r = n.getBoundingClientRect().width;
|
|
1907
1907
|
if (r === 0) return void queueMicrotask(() => this.applyStylesToWrapper.bind(this)(t, e));
|
|
1908
|
-
const o = (r - this.maxWidthForContent(t)) / 2, a = Math.max(0, Math.min(o, i)),
|
|
1909
|
-
this.isDirectionInverted ? (t.style.paddingLeft = "0px", t.style.paddingRight =
|
|
1908
|
+
const o = (r - this.maxWidthForContent(t)) / 2, a = Math.max(0, Math.min(o, i)), d = 2 * a + "px", l = `${a}px`;
|
|
1909
|
+
this.isDirectionInverted ? (t.style.paddingLeft = "0px", t.style.paddingRight = d) : (t.style.paddingLeft = d, t.style.paddingRight = "0px");
|
|
1910
1910
|
const p = t.querySelector(`.${this.CSS.highlightIndent}`);
|
|
1911
|
-
p instanceof HTMLElement && (this.isDirectionInverted ? (p.style.width =
|
|
1911
|
+
p instanceof HTMLElement && (this.isDirectionInverted ? (p.style.width = l, p.style.left = "100%", p.style.right = "") : (p.style.width = l, p.style.left = "", p.style.right = "100%"));
|
|
1912
1912
|
}
|
|
1913
1913
|
onFocus(t) {
|
|
1914
1914
|
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.setAttribute(w.DATA_FOCUSED, "");
|
|
@@ -1952,7 +1952,7 @@ const Ht = { orientation: !1 }, w = class w {
|
|
|
1952
1952
|
return new DOMParser().parseFromString(t, "text/html").body.firstChild;
|
|
1953
1953
|
}
|
|
1954
1954
|
changeConfigBasedOnVersionIfNeeded() {
|
|
1955
|
-
this.config.version && this.config.version < "2.27" && this.config.orientation === "vertical" && (this.config.orientation = "horizontal",
|
|
1955
|
+
this.config.version && this.config.version < "2.27" && this.config.orientation === "vertical" && (this.config.orientation = "horizontal", _t.orientation, _t.orientation = !0);
|
|
1956
1956
|
}
|
|
1957
1957
|
maxWidthForContent(t) {
|
|
1958
1958
|
const e = t.querySelector(`.${this.EditorCSS.content}`);
|
|
@@ -1967,7 +1967,7 @@ w.DATA_WRAPPER_NAME = "data-block-indent-wrapper", w.DATA_FOCUSED = "data-focuse
|
|
|
1967
1967
|
let at = w;
|
|
1968
1968
|
class $ {
|
|
1969
1969
|
static get toolboxIcon() {
|
|
1970
|
-
return
|
|
1970
|
+
return Lt;
|
|
1971
1971
|
}
|
|
1972
1972
|
static get CSS() {
|
|
1973
1973
|
return "cdx-marker";
|
|
@@ -2002,7 +2002,7 @@ class $ {
|
|
|
2002
2002
|
(e = this.button) == null || e.classList.toggle(this.iconClasses.active, !!t);
|
|
2003
2003
|
}
|
|
2004
2004
|
get toolboxIcon() {
|
|
2005
|
-
return
|
|
2005
|
+
return Lt;
|
|
2006
2006
|
}
|
|
2007
2007
|
static get sanitize() {
|
|
2008
2008
|
return { mark: { class: $.CSS } };
|
|
@@ -2143,19 +2143,19 @@ function x(u, t, e = {}) {
|
|
|
2143
2143
|
for (const s in e) Object.prototype.hasOwnProperty.call(e, s) && (i[s] = e[s]);
|
|
2144
2144
|
return i;
|
|
2145
2145
|
}
|
|
2146
|
-
function
|
|
2146
|
+
function Ht(u) {
|
|
2147
2147
|
const t = u.getBoundingClientRect();
|
|
2148
2148
|
return { y1: Math.floor(t.top + window.pageYOffset), x1: Math.floor(t.left + window.pageXOffset), x2: Math.floor(t.right + window.pageXOffset), y2: Math.floor(t.bottom + window.pageYOffset) };
|
|
2149
2149
|
}
|
|
2150
2150
|
function it(u, t) {
|
|
2151
|
-
const e =
|
|
2151
|
+
const e = Ht(u), i = Ht(t);
|
|
2152
2152
|
return { fromTopBorder: i.y1 - e.y1, fromLeftBorder: i.x1 - e.x1, fromRightBorder: e.x2 - i.x2, fromBottomBorder: e.y2 - i.y2 };
|
|
2153
2153
|
}
|
|
2154
|
-
function
|
|
2154
|
+
function It(u, t) {
|
|
2155
2155
|
var e;
|
|
2156
2156
|
return (e = t == null ? void 0 : t.parentNode) == null ? void 0 : e.insertBefore(u, t);
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function At(u, t = !0) {
|
|
2159
2159
|
const e = document.createRange(), i = window.getSelection();
|
|
2160
2160
|
e.selectNodeContents(u), e.collapse(t), i == null || i.removeAllRanges(), i == null || i.addRange(e);
|
|
2161
2161
|
}
|
|
@@ -2249,7 +2249,7 @@ class A {
|
|
|
2249
2249
|
(t = this.popover) == null || t.close(), this.wrapper.classList.remove(A.CSS.toolboxShowed);
|
|
2250
2250
|
}
|
|
2251
2251
|
}
|
|
2252
|
-
const
|
|
2252
|
+
const Bt = "tc-wrap", fe = "tc-wrap--readonly", Rt = "tc-table", R = "tc-row", Ot = "tc-table--heading", st = "tc-row--selected", O = "tc-cell", nt = "tc-cell--selected", rt = "tc-add-row", zt = "tc-add-row--disabled", ot = "tc-add-column", Dt = "tc-add-column--disabled";
|
|
2253
2253
|
class Ce {
|
|
2254
2254
|
constructor(t, e, i, s) {
|
|
2255
2255
|
this.minCellWidhth = 50, this.defaultCellWidth = 100, this.handleDocumentMousedown = (n) => {
|
|
@@ -2262,10 +2262,10 @@ class Ce {
|
|
|
2262
2262
|
this.updateToolboxesPosition(), this.isDragging = !1, this.table.classList.remove("table-resizing"), document.removeEventListener("mousemove", this.handleDocumentMousemove), document.removeEventListener("mouseup", this.handleDocumentMouseup);
|
|
2263
2263
|
}, this.readOnly = t, this.api = e, this.data = i, this.config = s, this.wrapper = null, this.table = null, this.hoveredCell = null, this.isDragging = !1, this.draggingColumn = 0, this.startWidth = 0, this.mouseStartX = 0, this.colWidthArr = [], this.focusedCell = { row: 0, col: 0 }, this.toolboxColumn = this.createColumnToolbox(), this.toolboxRow = this.createRowToolbox(), this.createTableWrapper(), this.hoveredRow = 0, this.hoveredColumn = 0, this.selectedRow = 0, this.selectedColumn = 0, this.tunes = { withHeadings: !1 }, this.resize(), this.data.colWidth && this.data.colWidth.length > 0 && (this.colWidthArr = this.data.colWidth), this.updateColWidth(), this.fill(), this.focusedCell = { row: 0, column: 0 }, this.documentClicked = (n) => {
|
|
2264
2264
|
let r = n.target;
|
|
2265
|
-
const o = r.closest(`.${
|
|
2265
|
+
const o = r.closest(`.${Rt}`) !== null, a = r.closest(`.${Bt}`) === null;
|
|
2266
2266
|
(o || a) && this.hideToolboxes();
|
|
2267
|
-
const
|
|
2268
|
-
|
|
2267
|
+
const d = r.closest(`.${rt}`), l = r.closest(`.${ot}`);
|
|
2268
|
+
d && d.parentNode === this.wrapper ? (this.addRow(void 0, !0), this.hideToolboxes()) : l && l.parentNode === this.wrapper && (this.addColumn(void 0, !0), this.hideToolboxes());
|
|
2269
2269
|
}, this.readOnly || this.bindEvents();
|
|
2270
2270
|
}
|
|
2271
2271
|
getWrapper() {
|
|
@@ -2292,7 +2292,7 @@ class Ce {
|
|
|
2292
2292
|
this.addColumn(this.selectedColumn, !0), this.hideToolboxes(), this.updateColWidth();
|
|
2293
2293
|
} }, { label: this.api.i18n.t("Add column to right"), icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.13333 14.9167L12.4667 18.25M12.4667 18.25L15.8 14.9167M12.4667 18.25L12.4667 10.0833C12.4667 9.19928 12.1155 8.35143 11.4904 7.72631C10.8652 7.10119 10.0174 6.75 9.13333 6.75"/></svg>', hideIf: () => this.numberOfColumns === this.config.maxcols, onClick: () => {
|
|
2294
2294
|
this.addColumn(this.selectedColumn + 1, !0), this.hideToolboxes(), this.updateColWidth();
|
|
2295
|
-
} }, { label: this.api.i18n.t("Delete column"), icon:
|
|
2295
|
+
} }, { label: this.api.i18n.t("Delete column"), icon: bt, hideIf: () => this.numberOfColumns === 1, confirmationRequired: !0, onClick: () => {
|
|
2296
2296
|
this.deleteColumn(this.selectedColumn), this.hideToolboxes(), this.updateColWidth();
|
|
2297
2297
|
} }], onOpen: () => {
|
|
2298
2298
|
this.selectColumn(this.hoveredColumn), this.hideRowToolbox();
|
|
@@ -2305,7 +2305,7 @@ class Ce {
|
|
|
2305
2305
|
this.addRow(this.selectedRow, !0), this.hideToolboxes();
|
|
2306
2306
|
} }, { label: this.api.i18n.t("Add row below"), icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.8833 9.16666L18.2167 12.5M18.2167 12.5L14.8833 15.8333M18.2167 12.5H10.05C9.16594 12.5 8.31809 12.1488 7.69297 11.5237C7.06785 10.8986 6.71666 10.0507 6.71666 9.16666"/></svg>', hideIf: () => this.numberOfRows === this.config.maxrows, onClick: () => {
|
|
2307
2307
|
this.addRow(this.selectedRow + 1, !0), this.hideToolboxes();
|
|
2308
|
-
} }, { label: this.api.i18n.t("Delete row"), icon:
|
|
2308
|
+
} }, { label: this.api.i18n.t("Delete row"), icon: bt, hideIf: () => this.numberOfRows === 1, confirmationRequired: !0, onClick: () => {
|
|
2309
2309
|
this.deleteRow(this.selectedRow), this.hideToolboxes();
|
|
2310
2310
|
} }], onOpen: () => {
|
|
2311
2311
|
this.selectRow(this.hoveredRow), this.hideColumnToolbox();
|
|
@@ -2338,24 +2338,24 @@ class Ce {
|
|
|
2338
2338
|
for (let r = 1; r <= this.numberOfRows; r++) {
|
|
2339
2339
|
let o;
|
|
2340
2340
|
const a = this.createCell();
|
|
2341
|
-
if (t > 0 && t <= i ? (o = this.getCell(r, t),
|
|
2342
|
-
const
|
|
2343
|
-
|
|
2341
|
+
if (t > 0 && t <= i ? (o = this.getCell(r, t), It(a, o)) : o = this.getRow(r).appendChild(a), r === 1) {
|
|
2342
|
+
const d = this.getCell(r, t > 0 ? t : i + 1);
|
|
2343
|
+
d && e && At(d);
|
|
2344
2344
|
}
|
|
2345
2345
|
}
|
|
2346
2346
|
const s = this.wrapper.querySelector(`.${ot}`);
|
|
2347
|
-
(n = this.config) != null && n.maxcols && this.numberOfColumns > this.config.maxcols - 1 && s && s.classList.add(
|
|
2347
|
+
(n = this.config) != null && n.maxcols && this.numberOfColumns > this.config.maxcols - 1 && s && s.classList.add(Dt), this.addHeadingAttrToFirstRow(), this.colWidthArr.splice(t - 1, 0, this.defaultCellWidth);
|
|
2348
2348
|
}
|
|
2349
2349
|
addRow(t = -1, e = !1) {
|
|
2350
2350
|
let i, s = x("div", R);
|
|
2351
2351
|
this.tunes.withHeadings && this.removeHeadingAttrFromFirstRow();
|
|
2352
2352
|
let n = this.numberOfColumns;
|
|
2353
2353
|
if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows) return;
|
|
2354
|
-
t > 0 && t <= this.numberOfRows ? i =
|
|
2354
|
+
t > 0 && t <= this.numberOfRows ? i = It(s, this.getRow(t)) : i = this.table.appendChild(s), this.fillRow(i, n), this.tunes.withHeadings && this.addHeadingAttrToFirstRow();
|
|
2355
2355
|
const r = this.getRowFirstCell(i);
|
|
2356
|
-
r && e &&
|
|
2356
|
+
r && e && At(r);
|
|
2357
2357
|
const o = this.wrapper.querySelector(`.${rt}`);
|
|
2358
|
-
return this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && o && o.classList.add(
|
|
2358
|
+
return this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && o && o.classList.add(zt), i;
|
|
2359
2359
|
}
|
|
2360
2360
|
deleteColumn(t) {
|
|
2361
2361
|
for (let i = 1; i <= this.numberOfRows; i++) {
|
|
@@ -2364,19 +2364,19 @@ class Ce {
|
|
|
2364
2364
|
s.remove();
|
|
2365
2365
|
}
|
|
2366
2366
|
const e = this.wrapper.querySelector(`.${ot}`);
|
|
2367
|
-
e && e.classList.remove(
|
|
2367
|
+
e && e.classList.remove(Dt), this.colWidthArr.splice(t - 1, 1);
|
|
2368
2368
|
}
|
|
2369
2369
|
deleteRow(t) {
|
|
2370
2370
|
this.getRow(t).remove();
|
|
2371
2371
|
const e = this.wrapper.querySelector(`.${rt}`);
|
|
2372
|
-
e && e.classList.remove(
|
|
2372
|
+
e && e.classList.remove(zt), this.addHeadingAttrToFirstRow();
|
|
2373
2373
|
}
|
|
2374
2374
|
createTableWrapper() {
|
|
2375
|
-
this.wrapper = x("div",
|
|
2375
|
+
this.wrapper = x("div", Bt), this.table = x("div", Rt), this.readOnly && this.wrapper.classList.add(fe), this.wrapper.appendChild(this.toolboxRow.element), this.wrapper.appendChild(this.toolboxColumn.element), this.wrapper.appendChild(this.table);
|
|
2376
2376
|
}
|
|
2377
2377
|
computeInitialSize() {
|
|
2378
|
-
const t = this.data && this.data.content, e = Array.isArray(t), i = !!e && t.length, s = e ? t.length : void 0, n = i ? t[0].length : void 0, r = Number.parseInt(this.config && this.config.rows), o = Number.parseInt(this.config && this.config.cols), a = !isNaN(r) && r > 0 ? r : void 0,
|
|
2379
|
-
return { rows: s || a || 2, cols: n ||
|
|
2378
|
+
const t = this.data && this.data.content, e = Array.isArray(t), i = !!e && t.length, s = e ? t.length : void 0, n = i ? t[0].length : void 0, r = Number.parseInt(this.config && this.config.rows), o = Number.parseInt(this.config && this.config.cols), a = !isNaN(r) && r > 0 ? r : void 0, d = !isNaN(o) && o > 0 ? o : void 0;
|
|
2379
|
+
return { rows: s || a || 2, cols: n || d || 2 };
|
|
2380
2380
|
}
|
|
2381
2381
|
resize() {
|
|
2382
2382
|
const { rows: t, cols: e } = this.computeInitialSize();
|
|
@@ -2461,7 +2461,7 @@ class Ce {
|
|
|
2461
2461
|
});
|
|
2462
2462
|
}
|
|
2463
2463
|
setHeadingsSetting(t) {
|
|
2464
|
-
this.tunes.withHeadings = t, t ? (this.table.classList.add(
|
|
2464
|
+
this.tunes.withHeadings = t, t ? (this.table.classList.add(Ot), this.addHeadingAttrToFirstRow()) : (this.table.classList.remove(Ot), this.removeHeadingAttrFromFirstRow());
|
|
2465
2465
|
}
|
|
2466
2466
|
addHeadingAttrToFirstRow() {
|
|
2467
2467
|
for (let t = 1; t <= this.numberOfColumns; t++) {
|
|
@@ -2512,8 +2512,8 @@ class Ce {
|
|
|
2512
2512
|
const c = ({ fromTopBorder: g }) => o < g, h = ({ fromBottomBorder: g }) => o > n - g;
|
|
2513
2513
|
e = this.binSearch(this.numberOfRows, (g) => this.getCell(g, 1), c, h);
|
|
2514
2514
|
}
|
|
2515
|
-
const a = e || this.hoveredRow,
|
|
2516
|
-
return { row: a, column:
|
|
2515
|
+
const a = e || this.hoveredRow, d = i || this.hoveredColumn, { deltaXCell: l, deltaYCell: p } = this.getMousePositionRelateToCell(a, d, r, o);
|
|
2516
|
+
return { row: a, column: d, deltaXCell: l, deltaYCell: p };
|
|
2517
2517
|
}
|
|
2518
2518
|
getMousePositionRelateToCell(t, e, i, s) {
|
|
2519
2519
|
const n = this.getCell(t, e), { fromTopBorder: r, fromLeftBorder: o } = it(this.table, n);
|
|
@@ -2523,10 +2523,10 @@ class Ce {
|
|
|
2523
2523
|
let n, r = 0, o = t + 1, a = 0;
|
|
2524
2524
|
for (; r < o - 1 && a < 10; ) {
|
|
2525
2525
|
n = Math.ceil((r + o) / 2);
|
|
2526
|
-
const
|
|
2527
|
-
if (i(
|
|
2526
|
+
const d = e(n), l = it(this.table, d);
|
|
2527
|
+
if (i(l)) o = n;
|
|
2528
2528
|
else {
|
|
2529
|
-
if (!s(
|
|
2529
|
+
if (!s(l)) break;
|
|
2530
2530
|
r = n;
|
|
2531
2531
|
}
|
|
2532
2532
|
a++;
|
|
@@ -2634,7 +2634,7 @@ class ke {
|
|
|
2634
2634
|
createFileButton() {
|
|
2635
2635
|
var e;
|
|
2636
2636
|
const t = W("div", [this.CSS.button]);
|
|
2637
|
-
return t.innerHTML = (e = this.config.buttonContent) != null ? e : `${
|
|
2637
|
+
return t.innerHTML = (e = this.config.buttonContent) != null ? e : `${Pt} ${this.api.i18n.t("Select an Image")}`, t.addEventListener("click", () => {
|
|
2638
2638
|
this.onSelectFile();
|
|
2639
2639
|
}), t;
|
|
2640
2640
|
}
|
|
@@ -2669,15 +2669,15 @@ class we {
|
|
|
2669
2669
|
};
|
|
2670
2670
|
})(n[0]);
|
|
2671
2671
|
const r = n[0], o = this.config.types ? this.config.types.split(",") : [];
|
|
2672
|
-
let a = r.name.lastIndexOf("."),
|
|
2673
|
-
if (!o.includes(
|
|
2674
|
-
let
|
|
2672
|
+
let a = r.name.lastIndexOf("."), d = r.name.slice(a);
|
|
2673
|
+
if (!o.includes(d.toLowerCase())) return void this.onError("文件类型不支持");
|
|
2674
|
+
let l = {};
|
|
2675
2675
|
if (this.config.userStore) {
|
|
2676
2676
|
const m = this.config.userStore.token, f = this.config.userStore.tokenName, v = this.config.userStore.tokenPrefix;
|
|
2677
|
-
m && f && (
|
|
2677
|
+
m && f && (l[f] = v + " " + m);
|
|
2678
2678
|
}
|
|
2679
|
-
|
|
2680
|
-
const p = K.create({ timeout: 18e5, headers:
|
|
2679
|
+
l["Content-Type"] = "application/json";
|
|
2680
|
+
const p = K.create({ timeout: 18e5, headers: l }), c = await p.post(this.config.endpoints.byFile, { fileName: r.name, contentType: r.type });
|
|
2681
2681
|
if (c.status !== 200) return void this.onError(c.statusText);
|
|
2682
2682
|
const h = c.data;
|
|
2683
2683
|
if (!h.success) return void this.onError(h.message);
|
|
@@ -2715,12 +2715,12 @@ class we {
|
|
|
2715
2715
|
r["Content-Type"] = "application/json";
|
|
2716
2716
|
const a = await o.post(this.config.endpoints.byFile, { fileName: t.name, contentType: t.type });
|
|
2717
2717
|
if (a.status !== 200) return void this.onError(a.statusText);
|
|
2718
|
-
const
|
|
2719
|
-
if (!
|
|
2720
|
-
let
|
|
2721
|
-
r["Content-Type"] = t.type, o.put(
|
|
2718
|
+
const d = a.data;
|
|
2719
|
+
if (!d.success) return void this.onError(d.message);
|
|
2720
|
+
let l = d.data.cdn, p = d.data.objectKey;
|
|
2721
|
+
r["Content-Type"] = t.type, o.put(d.data.presignedUrl, t).then((c) => {
|
|
2722
2722
|
let h = {};
|
|
2723
|
-
h = c.status === 200 ? { success: 1, file: { url:
|
|
2723
|
+
h = c.status === 200 ? { success: 1, file: { url: l + p } } : { success: 0, message: c.statusText }, this.onUpload(h);
|
|
2724
2724
|
}).catch((c) => {
|
|
2725
2725
|
this.onError(c);
|
|
2726
2726
|
});
|
|
@@ -2747,7 +2747,7 @@ class Z {
|
|
|
2747
2747
|
return !0;
|
|
2748
2748
|
}
|
|
2749
2749
|
static get toolbox() {
|
|
2750
|
-
return { icon:
|
|
2750
|
+
return { icon: Pt, title: "Image" };
|
|
2751
2751
|
}
|
|
2752
2752
|
static get tunes() {
|
|
2753
2753
|
return [{ name: "withBorder", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.9919 9.5H19.0015"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.5 5H14.5096"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M14.625 5H15C17.2091 5 19 6.79086 19 9V9.375"/><path stroke="currentColor" stroke-width="2" d="M9.375 5L9 5C6.79086 5 5 6.79086 5 9V9.375"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.3725 5H9.38207"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 9.5H5.00957"/><path stroke="currentColor" stroke-width="2" d="M9.375 19H9C6.79086 19 5 17.2091 5 15V14.625"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.3725 19H9.38207"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 14.55H5.00957"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 13V16M16 19V16M19 16H16M16 16H13"/></svg>', title: "With border", toggle: !0 }, { name: "stretched", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 9L20 12L17 15"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 12H20"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 9L4 12L7 15"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 12H10"/></svg>', title: "Stretch image", toggle: !0 }, { name: "withBackground", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19V19C9.13623 19 8.20435 19 7.46927 18.6955C6.48915 18.2895 5.71046 17.5108 5.30448 16.5307C5 15.7956 5 14.8638 5 13V12C5 9.19108 5 7.78661 5.67412 6.77772C5.96596 6.34096 6.34096 5.96596 6.77772 5.67412C7.78661 5 9.19108 5 12 5H13.5C14.8956 5 15.5933 5 16.1611 5.17224C17.4395 5.56004 18.44 6.56046 18.8278 7.83886C19 8.40666 19 9.10444 19 10.5V10.5"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 13V16M16 19V16M19 16H16M16 16H13"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6.5 17.5L17.5 6.5"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.9919 10.5H19.0015"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.9919 19H11.0015"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13L13 5"/></svg>', title: "With background", toggle: !0 }];
|
|
@@ -2766,11 +2766,11 @@ class Z {
|
|
|
2766
2766
|
renderSettings() {
|
|
2767
2767
|
var n;
|
|
2768
2768
|
const t = Z.tunes.concat(this.config.actions || []), e = { border: "withBorder", background: "withBackground", stretch: "stretched", caption: "caption" };
|
|
2769
|
-
((n = this.config.features) == null ? void 0 : n.caption) === "optional" && t.push({ name: "caption", icon:
|
|
2769
|
+
((n = this.config.features) == null ? void 0 : n.caption) === "optional" && t.push({ name: "caption", icon: Wt, title: "With caption", toggle: !0 });
|
|
2770
2770
|
const i = t.filter((r) => {
|
|
2771
|
-
var a,
|
|
2772
|
-
const o = Object.keys(e).find((
|
|
2773
|
-
return o === "caption" ? ((a = this.config.features) == null ? void 0 : a.caption) !== !1 : o == null || ((
|
|
2771
|
+
var a, d;
|
|
2772
|
+
const o = Object.keys(e).find((l) => e[l] === r.name);
|
|
2773
|
+
return o === "caption" ? ((a = this.config.features) == null ? void 0 : a.caption) !== !1 : o == null || ((d = this.config.features) == null ? void 0 : d[o]) !== !1;
|
|
2774
2774
|
}), s = (r) => {
|
|
2775
2775
|
var a;
|
|
2776
2776
|
let o = this.data[r.name];
|
|
@@ -2847,8 +2847,8 @@ class Z {
|
|
|
2847
2847
|
}
|
|
2848
2848
|
class be {
|
|
2849
2849
|
constructor({ api: t, data: e, config: i, block: s }) {
|
|
2850
|
-
var n, r, o, a,
|
|
2851
|
-
this.settings = [], this.api = t, this.block = s, this.data = { floatLeft: (n = e == null ? void 0 : e.floatLeft) != null ? n : !1, floatRight: (r = e == null ? void 0 : e.floatRight) != null ? r : !1, center: (o = e == null ? void 0 : e.center) != null ? o : !1, sizeSmall: (a = e == null ? void 0 : e.sizeSmall) != null ? a : !1, sizeMiddle: (
|
|
2850
|
+
var n, r, o, a, d, l, p, c, h;
|
|
2851
|
+
this.settings = [], this.api = t, this.block = s, this.data = { floatLeft: (n = e == null ? void 0 : e.floatLeft) != null ? n : !1, floatRight: (r = e == null ? void 0 : e.floatRight) != null ? r : !1, center: (o = e == null ? void 0 : e.center) != null ? o : !1, sizeSmall: (a = e == null ? void 0 : e.sizeSmall) != null ? a : !1, sizeMiddle: (d = e == null ? void 0 : e.sizeMiddle) != null ? d : !1, sizeLarge: (l = e == null ? void 0 : e.sizeLarge) != null ? l : !1, resize: (c = (p = e == null ? void 0 : e.resize) != null ? p : i == null ? void 0 : i.resize) != null ? c : !1, resizeSize: (h = e == null ? void 0 : e.resizeSize) != null ? h : 0 }, this.wrapper = void 0, this.buttons = [], this.styles = { settingsButton: "cdx-settings-button", settingsButtonActive: "cdx-settings-button--active", settingsButtonModifier: "", settingsButtonModifierActive: "" };
|
|
2852
2852
|
}
|
|
2853
2853
|
static get isTune() {
|
|
2854
2854
|
return !0;
|
|
@@ -2930,13 +2930,13 @@ class be {
|
|
|
2930
2930
|
resizeClick(t, e, i) {
|
|
2931
2931
|
const s = document.getElementsByClassName("ce-block__content")[0].clientWidth;
|
|
2932
2932
|
let n = 0, r = 0;
|
|
2933
|
-
const o = (
|
|
2934
|
-
const
|
|
2933
|
+
const o = (d) => {
|
|
2934
|
+
const l = d.clientX - n;
|
|
2935
2935
|
let p = r;
|
|
2936
|
-
e === "right" && (p +=
|
|
2936
|
+
e === "right" && (p += l), e === "left" && (p -= l), p > 50 && p < s && (t.style.width = p + "px");
|
|
2937
2937
|
}, a = () => {
|
|
2938
|
-
const
|
|
2939
|
-
|
|
2938
|
+
const d = parseInt(window.getComputedStyle(t).width, 10);
|
|
2939
|
+
d > 0 && (this.data.resizeSize = d), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", a), this.block.dispatchChange();
|
|
2940
2940
|
};
|
|
2941
2941
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", a), n = i.clientX, r = parseInt(window.getComputedStyle(t).width, 10);
|
|
2942
2942
|
}
|
|
@@ -3022,49 +3022,50 @@ class ye {
|
|
|
3022
3022
|
}), e;
|
|
3023
3023
|
}
|
|
3024
3024
|
}
|
|
3025
|
-
const Se = { class: "ebl-editor", id: "holder" }, Le =
|
|
3026
|
-
const i =
|
|
3027
|
-
let
|
|
3028
|
-
const
|
|
3029
|
-
let
|
|
3030
|
-
const
|
|
3025
|
+
const Se = { class: "ebl-editor", id: "holder" }, Le = Ut({ name: "EblEditor", inheritAttrs: !1, __name: "Editor", props: { readOnly: { type: Boolean, default: !1 }, placeholder: { default: "Enter something" }, data: { default: () => ({ blocks: [] }) }, locale: { default: {} }, userStore: {}, showOutline: { type: Boolean, default: !1 } }, emits: ["onReady", "onChange"], setup(u, { expose: t, emit: e }) {
|
|
3026
|
+
const i = jt("EblEditorSettings");
|
|
3027
|
+
let s = e;
|
|
3028
|
+
const n = u;
|
|
3029
|
+
let r = J(n.data), o = !1, a = null, d = null, l = null;
|
|
3030
|
+
const p = ["indent", "blockAlignment"];
|
|
3031
3031
|
return qt(() => {
|
|
3032
|
-
|
|
3033
|
-
|
|
3032
|
+
a = new Xt({ minHeight: 300, holder: "holder", autofocus: !0, defaultBlock: "paragraph", placeholder: n.placeholder, tunes: p, tools: { inlineCode: F, underline: lt, Color: { class: me }, marker: { class: $ }, indent: { class: at }, alert: { class: I, inlineToolbar: !0 }, List: { class: X, inlineToolbar: !0, config: { defaultStyle: "checklist", maxLevel: 4 } }, h1: { class: re, inlineToolbar: !0 }, h2: { class: oe, inlineToolbar: !0 }, h3: { class: ae, inlineToolbar: !0 }, h4: { class: le, inlineToolbar: !0 }, h5: { class: de, inlineToolbar: !0 }, h6: { class: he, inlineToolbar: !0 }, paragraph: { class: ct, inlineToolbar: !0 }, blockAlignment: { class: ht, inlineToolbar: !0 }, code: { class: q, config: { lang: "javascript", theme: "github-dark-dimmed" } }, quote: { class: ce, inlineToolbar: !0 }, delimiter: ue, table: { class: ve, inlineToolbar: !0, config: { rows: 2, cols: 3 } }, image: { class: Z, inlineToolbar: !0, tunes: p.concat(["imageResize"]), config: { types: ".png,.jpeg,.jpg,.gif,.webp", userStore: n.userStore, endpoints: { byFile: i == null ? void 0 : i.fileUploadEndpoint }, features: { caption: !1, stretch: !1, border: !1, background: !1 } } }, imageResize: { class: be, config: { resize: !0, crop: !1 } } }, data: r, readOnly: n.readOnly, i18n: n.locale, onChange: (c, h) => {
|
|
3033
|
+
s("onChange", c, h);
|
|
3034
3034
|
}, onReady: () => {
|
|
3035
|
-
|
|
3036
|
-
} }),
|
|
3035
|
+
o = !0, new ne("holder", n.readOnly, a, "1px solid #999"), d = new ge({ editor: a, config: { debounceTimer: 200, maxLength: 100 }, onUpdate: () => {
|
|
3036
|
+
} }), r = J(n.data), d.initialize(r), n.data && n.data.blocks && n.data.blocks.length > 0 && a.render(r), n.showOutline && (l = new ye("holder", a), l.render(r)), s("onReady");
|
|
3037
3037
|
} });
|
|
3038
3038
|
}), Vt(() => {
|
|
3039
|
-
|
|
3040
|
-
}), Kt(() =>
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
}), d != null && (d.clear(), d.initialize(
|
|
3039
|
+
a !== null && (a.destroy(), a = null);
|
|
3040
|
+
}), Kt(() => n.data, (c, h) => {
|
|
3041
|
+
r = J(c), a != null && o && a.render(r).then(() => {
|
|
3042
|
+
l != null && n.showOutline && l.render(r);
|
|
3043
|
+
}), d != null && (d.clear(), d.initialize(r));
|
|
3044
3044
|
}, { deep: !0 }), t({ validate: function() {
|
|
3045
|
-
return new Promise((
|
|
3046
|
-
if (
|
|
3047
|
-
|
|
3045
|
+
return new Promise((c, h) => {
|
|
3046
|
+
if (a === null) return c(!1);
|
|
3047
|
+
a.save().then((g) => g.blocks.length > 0 ? c(!0) : c(!1));
|
|
3048
3048
|
});
|
|
3049
3049
|
}, getData: function() {
|
|
3050
|
-
return new Promise((
|
|
3051
|
-
if (
|
|
3052
|
-
|
|
3050
|
+
return new Promise((c, h) => {
|
|
3051
|
+
if (a === null) return c(null);
|
|
3052
|
+
a.save().then((g) => c(g));
|
|
3053
3053
|
});
|
|
3054
|
-
} }), (
|
|
3055
|
-
} }),
|
|
3056
|
-
let
|
|
3057
|
-
for (let u in
|
|
3058
|
-
const t = se(
|
|
3059
|
-
|
|
3054
|
+
} }), (c, h) => (Gt(), Yt("div", Se));
|
|
3055
|
+
} }), Nt = [Le];
|
|
3056
|
+
let $t = [];
|
|
3057
|
+
for (let u in Nt) {
|
|
3058
|
+
const t = se(Nt[u]);
|
|
3059
|
+
$t.push(t);
|
|
3060
3060
|
}
|
|
3061
|
-
const Ie = { messages: { ui: { blockTunes: { toggler: { "Click to tune": "可拖拽和点击" } }, toolbar: { toolbox: { Add: "添加", Filter: "过滤", "Nothing found": "无内容" }, popover: { Filter: "过滤", "Nothing found": "无内容" } }, popover: { Filter: "筛选", "Nothing found": "未找到任何内容", "Convert to": "转化为", "Add below": "在下方插入" } }, toolNames: { Text: "段落", H1: "一级标题", H2: "二级标题", H3: "三级标题", H4: "四级标题", H5: "五级标题", H6: "六级标题", "Ordered List": "有序列表", "Unordered List": "无序列表", Checklist: "任务列表", Quote: "引用", Code: "代码块", Delimiter: "分割线", Link: "链接", Bold: "加粗", Italic: "倾斜", Alert: "高亮块", indent: "缩进", Marker: "突出显示", Color: "文本颜色", Underline: "下划线", InlineCode: "行内代码", Table: "表格", Image: "图片" }, tools: { image: { "Couldn’t upload image. Please try another.": "上传图片失败,请稍后重试。" }, table: { "Add row above": "在上面插入行", "Add row below": "在下面插入行", "Delete row": "删除行", "Add column to left": "在左边插入列", "Add column to right": "在右边插入列", "Delete column": "删除列", "With headings": "使用标题行", "Without headings": "不使用标题行" }, marker: { Marker: "突出显示" }, link: { "Add a link": "添加链接", Save: "确定", "Pasted link is not valid.": "链接地址无效" }, List: { Unordered: "无序", Ordered: "有序", Checklist: "任务列表", "Counter type": "计数器类型", Numeric: "阿拉伯数字", "Lower Roman": "小写罗马数字", "Upper Roman": "大写罗马数字", "Lower Alpha": "小写字母", "Upper Alpha": "大写字母", "Start with": "开始序号" }, paragraph: { "Enter something": "请输入内容" }, stub: { "The block can not be displayed correctly.": "该模块不能放置在这里" }, code: { "Enter your code": "输入代码", Copied: "已复制", "Unable to copy": "复制失败" }, convertTo: { "Convert to": "转化为" }, alert: { "alert-primary": "主要样式", "alert-secondary": "次要样式", "alert-info": "信息", "alert-success": "成功", "alert-warning": "警告", "alert-danger": "危险", "alert-light": "浅色", "alert-dark": "深色", "align-left": "左对齐", "align-center": "居中", "align-right": "右对齐", "Type here...": "输入内容" } }, blockTunes: { delete: { Delete: "删除", "Click to delete": "点击删除" }, moveUp: { "Move up": "向上移" }, moveDown: { "Move down": "向下移" }, filter: { Filter: "过滤" }, blockAlignment: { "left align": "左对齐", "center align": "居中对齐", "right align": "右对齐", "justify align": "两端对齐" }, indent: { "Indent right": "向右缩进", "Indent left": "向左缩进" } } } },
|
|
3062
|
-
t[
|
|
3063
|
-
} }))(
|
|
3061
|
+
const Ie = { messages: { ui: { blockTunes: { toggler: { "Click to tune": "可拖拽和点击" } }, toolbar: { toolbox: { Add: "添加", Filter: "过滤", "Nothing found": "无内容" }, popover: { Filter: "过滤", "Nothing found": "无内容" } }, popover: { Filter: "筛选", "Nothing found": "未找到任何内容", "Convert to": "转化为", "Add below": "在下方插入" } }, toolNames: { Text: "段落", H1: "一级标题", H2: "二级标题", H3: "三级标题", H4: "四级标题", H5: "五级标题", H6: "六级标题", "Ordered List": "有序列表", "Unordered List": "无序列表", Checklist: "任务列表", Quote: "引用", Code: "代码块", Delimiter: "分割线", Link: "链接", Bold: "加粗", Italic: "倾斜", Alert: "高亮块", indent: "缩进", Marker: "突出显示", Color: "文本颜色", Underline: "下划线", InlineCode: "行内代码", Table: "表格", Image: "图片" }, tools: { image: { "Couldn’t upload image. Please try another.": "上传图片失败,请稍后重试。" }, table: { "Add row above": "在上面插入行", "Add row below": "在下面插入行", "Delete row": "删除行", "Add column to left": "在左边插入列", "Add column to right": "在右边插入列", "Delete column": "删除列", "With headings": "使用标题行", "Without headings": "不使用标题行" }, marker: { Marker: "突出显示" }, link: { "Add a link": "添加链接", Save: "确定", "Pasted link is not valid.": "链接地址无效" }, List: { Unordered: "无序", Ordered: "有序", Checklist: "任务列表", "Counter type": "计数器类型", Numeric: "阿拉伯数字", "Lower Roman": "小写罗马数字", "Upper Roman": "大写罗马数字", "Lower Alpha": "小写字母", "Upper Alpha": "大写字母", "Start with": "开始序号" }, paragraph: { "Enter something": "请输入内容" }, stub: { "The block can not be displayed correctly.": "该模块不能放置在这里" }, code: { "Enter your code": "输入代码", Copied: "已复制", "Unable to copy": "复制失败" }, convertTo: { "Convert to": "转化为" }, alert: { "alert-primary": "主要样式", "alert-secondary": "次要样式", "alert-info": "信息", "alert-success": "成功", "alert-warning": "警告", "alert-danger": "危险", "alert-light": "浅色", "alert-dark": "深色", "align-left": "左对齐", "align-center": "居中", "align-right": "右对齐", "Type here...": "输入内容" } }, blockTunes: { delete: { Delete: "删除", "Click to delete": "点击删除" }, moveUp: { "Move up": "向上移" }, moveDown: { "Move down": "向下移" }, filter: { Filter: "过滤" }, blockAlignment: { "left align": "左对齐", "center align": "居中对齐", "right align": "右对齐", "justify align": "两端对齐" }, indent: { "Indent right": "向右缩进", "Indent left": "向左缩进" } } } }, Ft = /* @__PURE__ */ ((u = []) => ({ version: "2.31.36", install: (t, e) => {
|
|
3062
|
+
t[pt] || (t[pt] = !0, u.forEach((i) => t.use(i)), t.provide("EblEditorSettings", e));
|
|
3063
|
+
} }))($t), Ae = Ft.install, Be = Ft.version;
|
|
3064
3064
|
export {
|
|
3065
3065
|
Le as EblEditor,
|
|
3066
|
-
|
|
3066
|
+
Ft as default,
|
|
3067
3067
|
Ae as install,
|
|
3068
3068
|
Be as version,
|
|
3069
3069
|
Ie as zhCn
|
|
3070
3070
|
};
|
|
3071
|
+
//# sourceMappingURL=index.mjs.map
|