@ebl-vue/editor-full 2.31.25 → 2.31.28
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/dist/index.d.ts +1 -28
- package/dist/index.mjs +549 -727
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/types/index.d.ts +5 -1
- package/.postcssrc.yml +0 -33
- package/postcss.config.js +0 -15
- package/src/components/Editor/Editor.vue +0 -293
- package/src/components/Editor/EditorRender.vue +0 -274
- package/src/components/index.ts +0 -29
- package/src/constants/index.ts +0 -1
- package/src/i18n/zh-cn.ts +0 -158
- package/src/icons/index.ts +0 -93
- package/src/index.ts +0 -22
- package/src/installer.ts +0 -21
- package/src/plugins/alert/index.css +0 -150
- package/src/plugins/alert/index.ts +0 -456
- package/src/plugins/block-alignment/index.css +0 -9
- package/src/plugins/block-alignment/index.ts +0 -117
- package/src/plugins/block-alignment/readme.md +0 -1
- package/src/plugins/code/LICENSE +0 -21
- package/src/plugins/code/index.css +0 -214
- package/src/plugins/code/index.ts +0 -621
- package/src/plugins/code/utils/string.ts +0 -34
- package/src/plugins/color-picker/index.ts +0 -130
- package/src/plugins/color-picker/styles.css +0 -27
- package/src/plugins/delimiter/index.css +0 -14
- package/src/plugins/delimiter/index.ts +0 -121
- package/src/plugins/drag-drop/index.css +0 -19
- package/src/plugins/drag-drop/index.ts +0 -151
- package/src/plugins/drag-drop/readme.md +0 -1
- package/src/plugins/header/H1.ts +0 -404
- package/src/plugins/header/H2.ts +0 -403
- package/src/plugins/header/H3.ts +0 -404
- package/src/plugins/header/H4.ts +0 -404
- package/src/plugins/header/H5.ts +0 -403
- package/src/plugins/header/H6.ts +0 -404
- package/src/plugins/header/index.css +0 -20
- package/src/plugins/header/index.ts +0 -15
- package/src/plugins/header/types.d.ts +0 -46
- package/src/plugins/imageResizeCrop/ImageTune.ts +0 -916
- package/src/plugins/imageResizeCrop/index.css +0 -230
- package/src/plugins/imageResizeCrop/index.ts +0 -5
- package/src/plugins/imageResizeCrop/types.d.ts +0 -23
- package/src/plugins/imageTool/index.css +0 -156
- package/src/plugins/imageTool/index.ts +0 -538
- package/src/plugins/imageTool/types/codexteam__ajax.d.ts +0 -89
- package/src/plugins/imageTool/types/types.ts +0 -236
- package/src/plugins/imageTool/ui.ts +0 -313
- package/src/plugins/imageTool/uploader.ts +0 -272
- package/src/plugins/imageTool/utils/dom.ts +0 -24
- package/src/plugins/imageTool/utils/index.ts +0 -73
- package/src/plugins/imageTool/utils/isPromise.ts +0 -10
- package/src/plugins/indent/index.css +0 -86
- package/src/plugins/indent/index.ts +0 -695
- package/src/plugins/inline-code/index.css +0 -11
- package/src/plugins/inline-code/index.ts +0 -202
- package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +0 -208
- package/src/plugins/list/ListRenderer/ListRenderer.ts +0 -73
- package/src/plugins/list/ListRenderer/OrderedListRenderer.ts +0 -123
- package/src/plugins/list/ListRenderer/UnorderedListRenderer.ts +0 -123
- package/src/plugins/list/ListRenderer/index.ts +0 -6
- package/src/plugins/list/ListTabulator/index.ts +0 -1179
- package/src/plugins/list/index.ts +0 -480
- package/src/plugins/list/styles/CssPrefix.ts +0 -4
- package/src/plugins/list/styles/input.css +0 -36
- package/src/plugins/list/styles/list.css +0 -165
- package/src/plugins/list/types/Elements.ts +0 -14
- package/src/plugins/list/types/ItemMeta.ts +0 -40
- package/src/plugins/list/types/ListParams.ts +0 -102
- package/src/plugins/list/types/ListRenderer.ts +0 -6
- package/src/plugins/list/types/OlCounterType.ts +0 -63
- package/src/plugins/list/types/index.ts +0 -14
- package/src/plugins/list/utils/focusItem.ts +0 -18
- package/src/plugins/list/utils/getChildItems.ts +0 -40
- package/src/plugins/list/utils/getItemChildWrapper.ts +0 -10
- package/src/plugins/list/utils/getItemContentElement.ts +0 -10
- package/src/plugins/list/utils/getSiblings.ts +0 -52
- package/src/plugins/list/utils/isLastItem.ts +0 -9
- package/src/plugins/list/utils/itemHasSublist.ts +0 -10
- package/src/plugins/list/utils/normalizeData.ts +0 -83
- package/src/plugins/list/utils/removeChildWrapperIfEmpty.ts +0 -31
- package/src/plugins/list/utils/renderToolboxInput.ts +0 -105
- package/src/plugins/list/utils/stripNumbers.ts +0 -7
- package/src/plugins/list/utils/type-guards.ts +0 -8
- package/src/plugins/marker/index.css +0 -4
- package/src/plugins/marker/index.ts +0 -199
- package/src/plugins/outline/index.css +0 -52
- package/src/plugins/outline/index.ts +0 -63
- package/src/plugins/paragraph/index.css +0 -23
- package/src/plugins/paragraph/index.ts +0 -381
- package/src/plugins/paragraph/types/icons.d.ts +0 -4
- package/src/plugins/paragraph/utils/makeFragment.ts +0 -17
- package/src/plugins/quote/index.css +0 -26
- package/src/plugins/quote/index.ts +0 -203
- package/src/plugins/table/index.ts +0 -4
- package/src/plugins/table/plugin.ts +0 -254
- package/src/plugins/table/style.css +0 -388
- package/src/plugins/table/table.ts +0 -1195
- package/src/plugins/table/toolbox.ts +0 -166
- package/src/plugins/table/utils/dom.ts +0 -130
- package/src/plugins/table/utils/popover.ts +0 -185
- package/src/plugins/table/utils/throttled.ts +0 -22
- package/src/plugins/underline/index.css +0 -3
- package/src/plugins/underline/index.ts +0 -214
- package/src/plugins/undo/index.ts +0 -524
- package/src/plugins/undo/observer.ts +0 -101
- package/src/style.css +0 -114
- package/src/types.ts +0 -3
- package/src/utils/AxiosService.ts +0 -87
- package/src/utils/index.ts +0 -15
- package/src/utils/install.ts +0 -19
- package/tsconfig.json +0 -37
- package/vite.config.ts +0 -81
package/dist/index.mjs
CHANGED
|
@@ -1,29 +1,21 @@
|
|
|
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:hidden;position:relative}.codex-editor{height:100%;overflow:auto}.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[data-item-name=convert-to] .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:#C0C0C0;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;z-index:12;border-bottom-style:solid;border-color:#9ca3af0d;border-bottom-width:1px;padding: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:#C0C0C0;border-radius:10px;border:2px solid #22272e}.ce-editorjs-x-shiki__code ::-webkit-scrollbar-thumb:hover{background:#555555}.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{background:#F8F8F8;border:1px solid rgba(226,226,229,.2);border-radius:6px;padding:2px;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:auto}.cdx-list-start-with-field--invalid{background:#FFECED;border:1px solid #E13F3F}.cdx-list-start-with-field--invalid .cdx-list-start-with-field__input{color:#e13f3f}.cdx-list-start-with-field__input{font-size:14px;outline:none;font-weight:500;font-family:inherit;border:0;background:transparent;margin:0;padding:0;line-height:22px;min-width:calc(100% - var(--toolbox-buttons-size) - var(--icon-margin-right))}.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}.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:rgba(245,235,111,.29);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:rgba(250,239,240,.78);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
|
|
3
|
-
import
|
|
4
|
-
import { bundledLanguagesInfo as
|
|
5
|
-
import * as
|
|
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:hidden;position:relative;padding-top:15px}.codex-editor{height:100%;overflow:auto}.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;z-index:12;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 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
|
+
import Xt from "@ebl-vue/editorjs";
|
|
4
|
+
import { bundledLanguagesInfo as Zt, codeToHtml as Jt } from "shiki";
|
|
5
|
+
import * as V from "@editorjs/dom";
|
|
6
6
|
import { make as S, isEmpty as dt } from "@editorjs/dom";
|
|
7
|
-
import { focus as
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
e.component(i.name, i);
|
|
14
|
-
}, t)
|
|
15
|
-
for (const [e, i] of Object.entries(t))
|
|
16
|
-
p[e] = i;
|
|
17
|
-
return p;
|
|
18
|
-
};
|
|
19
|
-
class we {
|
|
7
|
+
import { focus as Qt, isCaretAtStartOfInput as te, getCaretNodeAndOffset as ee, getContenteditableSlice as ie } from "@editorjs/caret";
|
|
8
|
+
import K from "axios";
|
|
9
|
+
const pt = Symbol("INSTALLED_KEY"), se = (u, t) => (u.install = (e) => {
|
|
10
|
+
for (const i of [u, ...Object.values({})]) e.component(i.name, i);
|
|
11
|
+
}, u);
|
|
12
|
+
class ne {
|
|
20
13
|
constructor(t, e, i, s) {
|
|
21
14
|
const { blocks: n, toolbar: r } = i;
|
|
22
15
|
this.toolbar = r, this.borderStyle = s || "1px dashed #aaa", this.api = n, this.holder = document.getElementById(t), this.readOnly = e, this.startBlock = null, this.endBlock = null, this.setDragListener(), this.setDropListener();
|
|
23
16
|
}
|
|
24
17
|
setElementCursor(t) {
|
|
25
|
-
if (!t)
|
|
26
|
-
return;
|
|
18
|
+
if (!t) return;
|
|
27
19
|
const e = document.createRange(), i = window.getSelection();
|
|
28
20
|
e.setStart(t.childNodes[0], 0), e.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(e), t.focus();
|
|
29
21
|
}
|
|
@@ -51,8 +43,7 @@ class we {
|
|
|
51
43
|
setBorderBlocks(t, e) {
|
|
52
44
|
Object.values(t).forEach((i) => {
|
|
53
45
|
const s = i.querySelector(".ce-block__content");
|
|
54
|
-
if (i !== e)
|
|
55
|
-
s == null || s.style.removeProperty("border-top"), s == null || s.style.removeProperty("border-bottom");
|
|
46
|
+
if (i !== e) s == null || s.style.removeProperty("border-top"), s == null || s.style.removeProperty("border-bottom");
|
|
56
47
|
else {
|
|
57
48
|
const n = Object.keys(t).find((r) => t[Number(r)] === e);
|
|
58
49
|
n && Number(n) > this.startBlock ? s.style.borderBottom = this.borderStyle : s.style.borderTop = this.borderStyle;
|
|
@@ -88,8 +79,8 @@ class we {
|
|
|
88
79
|
this.isTheOnlyBlock() || this.api.move(this.endBlock, this.startBlock);
|
|
89
80
|
}
|
|
90
81
|
}
|
|
91
|
-
const
|
|
92
|
-
class
|
|
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
|
+
class re {
|
|
93
84
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
94
85
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H1" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
95
86
|
}
|
|
@@ -157,7 +148,7 @@ class Gt {
|
|
|
157
148
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
158
149
|
}
|
|
159
150
|
get defaultLevel() {
|
|
160
|
-
return { number: 1, tag: "H1", svg:
|
|
151
|
+
return { number: 1, tag: "H1", svg: gt };
|
|
161
152
|
}
|
|
162
153
|
onPaste(t) {
|
|
163
154
|
const e = t.detail;
|
|
@@ -170,10 +161,10 @@ class Gt {
|
|
|
170
161
|
return { tags: ["H1", "h1"] };
|
|
171
162
|
}
|
|
172
163
|
static get toolbox() {
|
|
173
|
-
return { icon:
|
|
164
|
+
return { icon: gt, title: "H1" };
|
|
174
165
|
}
|
|
175
166
|
}
|
|
176
|
-
class
|
|
167
|
+
class oe {
|
|
177
168
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
178
169
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H2" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
179
170
|
}
|
|
@@ -241,7 +232,7 @@ class Xt {
|
|
|
241
232
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
242
233
|
}
|
|
243
234
|
get defaultLevel() {
|
|
244
|
-
return { number: 2, tag: "H2", svg:
|
|
235
|
+
return { number: 2, tag: "H2", svg: mt };
|
|
245
236
|
}
|
|
246
237
|
onPaste(t) {
|
|
247
238
|
const e = t.detail;
|
|
@@ -254,10 +245,10 @@ class Xt {
|
|
|
254
245
|
return { tags: ["H2"] };
|
|
255
246
|
}
|
|
256
247
|
static get toolbox() {
|
|
257
|
-
return { icon:
|
|
248
|
+
return { icon: mt, title: "H2" };
|
|
258
249
|
}
|
|
259
250
|
}
|
|
260
|
-
class
|
|
251
|
+
class ae {
|
|
261
252
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
262
253
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H3" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
263
254
|
}
|
|
@@ -325,7 +316,7 @@ class Jt {
|
|
|
325
316
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
326
317
|
}
|
|
327
318
|
get defaultLevel() {
|
|
328
|
-
return { number: 3, tag: "H3", svg:
|
|
319
|
+
return { number: 3, tag: "H3", svg: ft };
|
|
329
320
|
}
|
|
330
321
|
onPaste(t) {
|
|
331
322
|
const e = t.detail;
|
|
@@ -338,10 +329,10 @@ class Jt {
|
|
|
338
329
|
return { tags: ["H3"] };
|
|
339
330
|
}
|
|
340
331
|
static get toolbox() {
|
|
341
|
-
return { icon:
|
|
332
|
+
return { icon: ft, title: "H3" };
|
|
342
333
|
}
|
|
343
334
|
}
|
|
344
|
-
class
|
|
335
|
+
class le {
|
|
345
336
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
346
337
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H4" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
347
338
|
}
|
|
@@ -409,7 +400,7 @@ class Qt {
|
|
|
409
400
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
410
401
|
}
|
|
411
402
|
get defaultLevel() {
|
|
412
|
-
return { number: 4, tag: "H4", svg:
|
|
403
|
+
return { number: 4, tag: "H4", svg: Ct };
|
|
413
404
|
}
|
|
414
405
|
onPaste(t) {
|
|
415
406
|
const e = t.detail;
|
|
@@ -422,10 +413,10 @@ class Qt {
|
|
|
422
413
|
return { tags: ["H4"] };
|
|
423
414
|
}
|
|
424
415
|
static get toolbox() {
|
|
425
|
-
return { icon:
|
|
416
|
+
return { icon: Ct, title: "H4" };
|
|
426
417
|
}
|
|
427
418
|
}
|
|
428
|
-
class
|
|
419
|
+
class de {
|
|
429
420
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
430
421
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H5" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
431
422
|
}
|
|
@@ -493,7 +484,7 @@ class Zt {
|
|
|
493
484
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
494
485
|
}
|
|
495
486
|
get defaultLevel() {
|
|
496
|
-
return { number: 5, tag: "H5", svg:
|
|
487
|
+
return { number: 5, tag: "H5", svg: vt };
|
|
497
488
|
}
|
|
498
489
|
onPaste(t) {
|
|
499
490
|
const e = t.detail;
|
|
@@ -506,10 +497,10 @@ class Zt {
|
|
|
506
497
|
return { tags: ["H5"] };
|
|
507
498
|
}
|
|
508
499
|
static get toolbox() {
|
|
509
|
-
return { icon:
|
|
500
|
+
return { icon: vt, title: "H5" };
|
|
510
501
|
}
|
|
511
502
|
}
|
|
512
|
-
class
|
|
503
|
+
class he {
|
|
513
504
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
514
505
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H6" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
515
506
|
}
|
|
@@ -577,7 +568,7 @@ class te {
|
|
|
577
568
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
578
569
|
}
|
|
579
570
|
get defaultLevel() {
|
|
580
|
-
return { number: 6, tag: "H6", svg:
|
|
571
|
+
return { number: 6, tag: "H6", svg: kt };
|
|
581
572
|
}
|
|
582
573
|
onPaste(t) {
|
|
583
574
|
const e = t.detail;
|
|
@@ -590,10 +581,10 @@ class te {
|
|
|
590
581
|
return { tags: ["H6"] };
|
|
591
582
|
}
|
|
592
583
|
static get toolbox() {
|
|
593
|
-
return { icon:
|
|
584
|
+
return { icon: kt, title: "H6" };
|
|
594
585
|
}
|
|
595
586
|
}
|
|
596
|
-
class
|
|
587
|
+
class ht {
|
|
597
588
|
static get DEFAULT_ALIGNMENT() {
|
|
598
589
|
return "left";
|
|
599
590
|
}
|
|
@@ -602,10 +593,10 @@ class Z {
|
|
|
602
593
|
}
|
|
603
594
|
getAlignment() {
|
|
604
595
|
var t, e;
|
|
605
|
-
return (t = this.settings) != null && t.blocks && this.settings.blocks.hasOwnProperty(this.block.name) ? this.settings.blocks[this.block.name] : (e = this.settings) != null && e.default ? this.settings.default :
|
|
596
|
+
return (t = this.settings) != null && t.blocks && this.settings.blocks.hasOwnProperty(this.block.name) ? this.settings.blocks[this.block.name] : (e = this.settings) != null && e.default ? this.settings.default : ht.DEFAULT_ALIGNMENT;
|
|
606
597
|
}
|
|
607
598
|
constructor({ api: t, data: e, config: i, block: s }) {
|
|
608
|
-
this.api = t, this.block = s, this.settings = i, this.data = e || { alignment: this.getAlignment() }, this.alignmentSettings = [{ name: "left", icon:
|
|
599
|
+
this.api = t, this.block = s, this.settings = i, this.data = e || { alignment: this.getAlignment() }, this.alignmentSettings = [{ name: "left", 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-width="2" d="M17 7L5 7"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M17 17H5"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M13 12L5 12"/></svg>' }, { name: "center", 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-width="2" d="M18 7L6 7"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M18 17H6"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16 12L8 12"/></svg>' }, { name: "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-width="2" d="M19 7L7 7"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M19 17H7"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M19 12L11 12"/></svg>' }], this._CSS = { alignment: { left: "ce-tune-alignment--left", center: "ce-tune-alignment--center", right: "ce-tune-alignment--right" } };
|
|
609
600
|
}
|
|
610
601
|
wrap(t) {
|
|
611
602
|
return this.wrapper = document.createElement("div"), this.wrapper.classList.toggle(this._CSS.alignment[this.data.alignment]), this.wrapper.append(t), this.wrapper;
|
|
@@ -630,17 +621,16 @@ class Z {
|
|
|
630
621
|
return this.data;
|
|
631
622
|
}
|
|
632
623
|
}
|
|
633
|
-
class
|
|
624
|
+
class ct {
|
|
634
625
|
static get DEFAULT_PLACEHOLDER() {
|
|
635
626
|
return "";
|
|
636
627
|
}
|
|
637
628
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
638
629
|
var n;
|
|
639
|
-
this.api = i, this.readOnly = s, this._CSS = { block: this.api.styles.block, wrapper: "ce-paragraph" }, this.readOnly || (this.onKeyUp = this.onKeyUp.bind(this)), this._placeholder = e.placeholder ? e.placeholder :
|
|
630
|
+
this.api = i, this.readOnly = s, this._CSS = { block: this.api.styles.block, wrapper: "ce-paragraph" }, this.readOnly || (this.onKeyUp = this.onKeyUp.bind(this)), this._placeholder = e.placeholder ? e.placeholder : ct.DEFAULT_PLACEHOLDER, this._data = t != null ? t : {}, this._element = null, this._preserveBlank = (n = e.preserveBlank) != null ? n : !1;
|
|
640
631
|
}
|
|
641
632
|
onKeyUp(t) {
|
|
642
|
-
if (t.code !== "Backspace" && t.code !== "Delete" || !this._element)
|
|
643
|
-
return;
|
|
633
|
+
if (t.code !== "Backspace" && t.code !== "Delete" || !this._element) return;
|
|
644
634
|
const { textContent: e } = this._element;
|
|
645
635
|
e === "" && (this._element.innerHTML = "");
|
|
646
636
|
}
|
|
@@ -652,8 +642,7 @@ class tt {
|
|
|
652
642
|
return this._element = this.drawView(), this._element;
|
|
653
643
|
}
|
|
654
644
|
merge(t) {
|
|
655
|
-
if (!this._element)
|
|
656
|
-
return;
|
|
645
|
+
if (!this._element) return;
|
|
657
646
|
this._data.text += t.text;
|
|
658
647
|
const e = function(i) {
|
|
659
648
|
const s = document.createElement("div");
|
|
@@ -688,13 +677,13 @@ class tt {
|
|
|
688
677
|
return { tags: ["P", "div", "br"] };
|
|
689
678
|
}
|
|
690
679
|
static get toolbox() {
|
|
691
|
-
return { icon:
|
|
680
|
+
return { icon: Wt, title: "Text" };
|
|
692
681
|
}
|
|
693
682
|
}
|
|
694
|
-
class
|
|
683
|
+
class q {
|
|
695
684
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
696
685
|
var n;
|
|
697
|
-
this._selectorLanguage = "", this._selectorTheme = "", this.api = i, this.readOnly = s, this.placeholder = this.api.i18n.t(e.placeholder ||
|
|
686
|
+
this._selectorLanguage = "", this._selectorTheme = "", this.api = i, this.readOnly = s, this.placeholder = this.api.i18n.t(e.placeholder || q.DEFAULT_PLACEHOLDER), this._selectorLanguage = t.lang || e.lang || q.DEFAULT_LANGUAGE, this._selectorTheme = t.theme || e.theme || q.DEFAULT_THEME, this.CSS = { baseClass: this.api.styles.block, input: this.api.styles.input, wrapper: "ce-editorjs-x-shiki", textarea: "ce-editorjs-x-shiki__textarea", span: "ce-editorjs-x-shiki__span", selectorLanguage: "ce-editorjs-x-shiki__selector-language", selectorTheme: "ce-editorjs-x-shiki__selector-theme" }, this.nodes = { holder: null, textarea: null }, this.data = { code: (n = t.code) != null ? n : "", lang: this._selectorLanguage, theme: this._selectorTheme, resizeSize: t.resizeSize || 0 }, this.nodes.holder = this.drawView();
|
|
698
687
|
}
|
|
699
688
|
static get isReadOnlySupported() {
|
|
700
689
|
return !0;
|
|
@@ -745,51 +734,48 @@ class U {
|
|
|
745
734
|
let o;
|
|
746
735
|
if (i) {
|
|
747
736
|
const a = function(d, l) {
|
|
748
|
-
let
|
|
749
|
-
for (;
|
|
750
|
-
` && l > 0; )
|
|
751
|
-
|
|
752
|
-
return u === `
|
|
737
|
+
let p = "";
|
|
738
|
+
for (; p !== `
|
|
739
|
+
` && l > 0; ) l -= 1, p = d.substr(l, 1);
|
|
740
|
+
return p === `
|
|
753
741
|
` && (l += 1), l;
|
|
754
742
|
}(n, s);
|
|
755
|
-
if (n.substr(a, 2) !== r)
|
|
756
|
-
return;
|
|
743
|
+
if (n.substr(a, 2) !== r) return;
|
|
757
744
|
e.value = n.substring(0, a) + n.substring(a + 2), o = s - 2;
|
|
758
|
-
} else
|
|
759
|
-
o = s + 2, e.value = n.substring(0, s) + r + n.substring(s);
|
|
745
|
+
} else o = s + 2, e.value = n.substring(0, s) + r + n.substring(s);
|
|
760
746
|
e.setSelectionRange(o, o);
|
|
761
747
|
}
|
|
762
748
|
drawView() {
|
|
763
|
-
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"),
|
|
764
|
-
return
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
}), 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(
|
|
768
|
-
d.innerHTML =
|
|
769
|
-
}), o.addEventListener("change", (
|
|
770
|
-
const
|
|
771
|
-
this._selectorLanguage =
|
|
772
|
-
d.innerHTML = g, s.innerHTML =
|
|
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
|
+
const h = document.createElement("option");
|
|
752
|
+
h.value = c.id, h.text = c.name, o.appendChild(h);
|
|
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
|
+
}), o.addEventListener("change", (c) => {
|
|
756
|
+
const h = c.target.value;
|
|
757
|
+
this._selectorLanguage = h, this.runShiki().then(({ html: g, preStyle: m }) => {
|
|
758
|
+
d.innerHTML = g, s.innerHTML = h;
|
|
773
759
|
});
|
|
774
|
-
}), a.addEventListener("change", (
|
|
775
|
-
const
|
|
776
|
-
this._selectorTheme =
|
|
760
|
+
}), a.addEventListener("change", (c) => {
|
|
761
|
+
const h = c.target.value;
|
|
762
|
+
this._selectorTheme = h, this.runShiki().then(({ html: g, preStyle: m }) => {
|
|
777
763
|
d.innerHTML = g, t == null || t.setAttribute("style", m), o.setAttribute("style", m), a.setAttribute("style", m);
|
|
778
764
|
});
|
|
779
765
|
}), l.addEventListener("input", () => {
|
|
780
|
-
this.data.code = l.value, this.runShiki().then(({ html:
|
|
781
|
-
d.innerHTML =
|
|
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);
|
|
782
768
|
});
|
|
783
|
-
}), l.addEventListener("keydown", (
|
|
784
|
-
|
|
785
|
-
d.innerHTML =
|
|
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;
|
|
786
772
|
}));
|
|
787
773
|
}), l.addEventListener("scroll", () => {
|
|
788
774
|
d.style = `display:block;transform: translateY(-${l.scrollTop}px)`;
|
|
789
|
-
}), n.addEventListener("click", (
|
|
790
|
-
this.copyCode(this.data.code,
|
|
791
|
-
}),
|
|
792
|
-
this.resizeClick(e,
|
|
775
|
+
}), n.addEventListener("click", (c) => {
|
|
776
|
+
this.copyCode(this.data.code, c);
|
|
777
|
+
}), p.addEventListener("mousedown", (c) => {
|
|
778
|
+
this.resizeClick(e, c);
|
|
793
779
|
}), this.nodes.textarea = l, t;
|
|
794
780
|
}
|
|
795
781
|
resizeClick(t, e) {
|
|
@@ -806,7 +792,7 @@ class U {
|
|
|
806
792
|
}
|
|
807
793
|
async runShiki() {
|
|
808
794
|
let t = "";
|
|
809
|
-
return { html: await
|
|
795
|
+
return { html: await Jt(this.data.code, { lang: this._selectorLanguage, theme: this._selectorTheme, transformers: [{ preprocess: (e) => `${e}
|
|
810
796
|
`, pre(e) {
|
|
811
797
|
var i;
|
|
812
798
|
this.addClassToHast(e, "ce-editorjs-x-shiki__span"), t = ((i = e.properties) == null ? void 0 : i.style) || "";
|
|
@@ -827,29 +813,27 @@ class U {
|
|
|
827
813
|
}
|
|
828
814
|
}
|
|
829
815
|
copyCode(t, e) {
|
|
830
|
-
if (this.data.code)
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
} catch (s) {
|
|
847
|
-
this.showCopyTip("Unable to copy", e), document.body.removeChild(i);
|
|
848
|
-
}
|
|
816
|
+
if (this.data.code) if (navigator.clipboard && window.isSecureContext) try {
|
|
817
|
+
navigator.clipboard.writeText(t).then(() => {
|
|
818
|
+
this.showCopyTip("Copied", e);
|
|
819
|
+
}).catch((i) => {
|
|
820
|
+
this.showCopyTip("Unable to copy", e);
|
|
821
|
+
});
|
|
822
|
+
} catch (i) {
|
|
823
|
+
this.showCopyTip("Unable to copy", e);
|
|
824
|
+
}
|
|
825
|
+
else {
|
|
826
|
+
const i = document.createElement("textarea");
|
|
827
|
+
i.value = t, i.style.top = "0", i.style.left = "0", i.style.position = "fixed", i.style.opacity = "0", i.style.pointerEvents = "none", i.style.zIndex = "-1000", document.body.appendChild(i), i.focus(), i.select();
|
|
828
|
+
try {
|
|
829
|
+
document.execCommand("copy"), document.body.removeChild(i), this.showCopyTip("Copied", e);
|
|
830
|
+
} catch (s) {
|
|
831
|
+
this.showCopyTip("Unable to copy", e), document.body.removeChild(i);
|
|
849
832
|
}
|
|
833
|
+
}
|
|
850
834
|
}
|
|
851
835
|
}
|
|
852
|
-
class
|
|
836
|
+
class ce {
|
|
853
837
|
constructor({ data: t, api: e, readOnly: i }) {
|
|
854
838
|
this.api = e, this.readOnly = i, this._data = { text: t.text || "" }, this._CSS = { baseClass: this.api.styles.block, wrapper: "cdx-quote", text: "cdx-quote__text", input: this.api.styles.input };
|
|
855
839
|
}
|
|
@@ -902,7 +886,7 @@ class ee {
|
|
|
902
886
|
return { text: { br: !0 } };
|
|
903
887
|
}
|
|
904
888
|
}
|
|
905
|
-
class
|
|
889
|
+
class ue {
|
|
906
890
|
static get isReadOnlySupported() {
|
|
907
891
|
return !0;
|
|
908
892
|
}
|
|
@@ -933,7 +917,7 @@ class ie {
|
|
|
933
917
|
}
|
|
934
918
|
}
|
|
935
919
|
const b = "cdx-list", k = { wrapper: b, item: `${b}__item`, itemContent: `${b}__item-content`, itemChildren: `${b}__item-children` };
|
|
936
|
-
class
|
|
920
|
+
class T {
|
|
937
921
|
static get CSS() {
|
|
938
922
|
return { ...k, orderedList: `${b}-ordered` };
|
|
939
923
|
}
|
|
@@ -942,14 +926,14 @@ class E {
|
|
|
942
926
|
}
|
|
943
927
|
renderWrapper(t) {
|
|
944
928
|
let e;
|
|
945
|
-
return e = S("ol", t === !0 ? [
|
|
929
|
+
return e = S("ol", t === !0 ? [T.CSS.wrapper, T.CSS.orderedList] : [T.CSS.orderedList, T.CSS.itemChildren]), e;
|
|
946
930
|
}
|
|
947
931
|
renderItem(t, e) {
|
|
948
|
-
const i = S("li",
|
|
932
|
+
const i = S("li", T.CSS.item), s = S("div", T.CSS.itemContent, { innerHTML: t, contentEditable: (!this.readOnly).toString() });
|
|
949
933
|
return i.appendChild(s), i;
|
|
950
934
|
}
|
|
951
935
|
getItemContent(t) {
|
|
952
|
-
const e = t.querySelector(`.${
|
|
936
|
+
const e = t.querySelector(`.${T.CSS.itemContent}`);
|
|
953
937
|
return e ? dt(e) ? "" : e.innerHTML : "";
|
|
954
938
|
}
|
|
955
939
|
getItemMeta() {
|
|
@@ -959,7 +943,7 @@ class E {
|
|
|
959
943
|
return {};
|
|
960
944
|
}
|
|
961
945
|
}
|
|
962
|
-
class
|
|
946
|
+
class E {
|
|
963
947
|
static get CSS() {
|
|
964
948
|
return { ...k, unorderedList: `${b}-unordered` };
|
|
965
949
|
}
|
|
@@ -968,14 +952,14 @@ class M {
|
|
|
968
952
|
}
|
|
969
953
|
renderWrapper(t) {
|
|
970
954
|
let e;
|
|
971
|
-
return e = S("ul", t === !0 ? [
|
|
955
|
+
return e = S("ul", t === !0 ? [E.CSS.wrapper, E.CSS.unorderedList] : [E.CSS.unorderedList, E.CSS.itemChildren]), e;
|
|
972
956
|
}
|
|
973
957
|
renderItem(t, e) {
|
|
974
|
-
const i = S("li",
|
|
958
|
+
const i = S("li", E.CSS.item), s = S("div", E.CSS.itemContent, { innerHTML: t, contentEditable: (!this.readOnly).toString() });
|
|
975
959
|
return i.appendChild(s), i;
|
|
976
960
|
}
|
|
977
961
|
getItemContent(t) {
|
|
978
|
-
const e = t.querySelector(`.${
|
|
962
|
+
const e = t.querySelector(`.${E.CSS.itemContent}`);
|
|
979
963
|
return e ? dt(e) ? "" : e.innerHTML : "";
|
|
980
964
|
}
|
|
981
965
|
getItemMeta() {
|
|
@@ -985,8 +969,8 @@ class M {
|
|
|
985
969
|
return {};
|
|
986
970
|
}
|
|
987
971
|
}
|
|
988
|
-
function
|
|
989
|
-
return
|
|
972
|
+
function B(u) {
|
|
973
|
+
return u.nodeType === Node.ELEMENT_NODE;
|
|
990
974
|
}
|
|
991
975
|
class C {
|
|
992
976
|
static get CSS() {
|
|
@@ -1027,7 +1011,7 @@ class C {
|
|
|
1027
1011
|
t.classList.remove(C.CSS.noHover);
|
|
1028
1012
|
}
|
|
1029
1013
|
}
|
|
1030
|
-
function
|
|
1014
|
+
function Q(u, t = "after") {
|
|
1031
1015
|
const e = [];
|
|
1032
1016
|
let i;
|
|
1033
1017
|
function s(n) {
|
|
@@ -1038,43 +1022,39 @@ function et(p, t = "after") {
|
|
|
1038
1022
|
return n.previousElementSibling;
|
|
1039
1023
|
}
|
|
1040
1024
|
}
|
|
1041
|
-
for (i = s(
|
|
1042
|
-
e.push(i), i = s(i);
|
|
1025
|
+
for (i = s(u); i !== null; ) e.push(i), i = s(i);
|
|
1043
1026
|
return e.length !== 0 ? e : null;
|
|
1044
1027
|
}
|
|
1045
|
-
function
|
|
1046
|
-
let e =
|
|
1047
|
-
return
|
|
1028
|
+
function _(u, t = !0) {
|
|
1029
|
+
let e = u;
|
|
1030
|
+
return u.classList.contains(k.item) && (e = u.querySelector(`.${k.itemChildren}`)), e === null ? [] : t ? Array.from(e.querySelectorAll(`:scope > .${k.item}`)) : Array.from(e.querySelectorAll(`.${k.item}`));
|
|
1048
1031
|
}
|
|
1049
|
-
function
|
|
1050
|
-
return
|
|
1032
|
+
function H(u) {
|
|
1033
|
+
return u.querySelector(`.${k.itemChildren}`);
|
|
1051
1034
|
}
|
|
1052
|
-
function
|
|
1053
|
-
let t =
|
|
1054
|
-
|
|
1035
|
+
function tt(u) {
|
|
1036
|
+
let t = u;
|
|
1037
|
+
u.classList.contains(k.item) && (t = H(u)), t !== null && _(t).length === 0 && t.remove();
|
|
1055
1038
|
}
|
|
1056
|
-
function
|
|
1057
|
-
return
|
|
1039
|
+
function Y(u) {
|
|
1040
|
+
return u.querySelector(`.${k.itemContent}`);
|
|
1058
1041
|
}
|
|
1059
|
-
function
|
|
1060
|
-
const e =
|
|
1061
|
-
e &&
|
|
1042
|
+
function N(u, t = !0) {
|
|
1043
|
+
const e = Y(u);
|
|
1044
|
+
e && Qt(e, t);
|
|
1062
1045
|
}
|
|
1063
|
-
class
|
|
1046
|
+
class et {
|
|
1064
1047
|
get currentItem() {
|
|
1065
1048
|
const t = window.getSelection();
|
|
1066
|
-
if (!t)
|
|
1067
|
-
return null;
|
|
1049
|
+
if (!t) return null;
|
|
1068
1050
|
let e = t.anchorNode;
|
|
1069
|
-
return e ? (
|
|
1051
|
+
return e ? (B(e) || (e = e.parentNode), e && B(e) ? e.closest(`.${k.item}`) : null) : null;
|
|
1070
1052
|
}
|
|
1071
1053
|
get currentItemLevel() {
|
|
1072
1054
|
const t = this.currentItem;
|
|
1073
|
-
if (t === null)
|
|
1074
|
-
return null;
|
|
1055
|
+
if (t === null) return null;
|
|
1075
1056
|
let e = t.parentNode, i = 0;
|
|
1076
|
-
for (; e !== null && e !== this.listWrapper; )
|
|
1077
|
-
z(e) && e.classList.contains(k.item) && (i += 1), e = e.parentNode;
|
|
1057
|
+
for (; e !== null && e !== this.listWrapper; ) B(e) && e.classList.contains(k.item) && (i += 1), e = e.parentNode;
|
|
1078
1058
|
return i + 1;
|
|
1079
1059
|
}
|
|
1080
1060
|
constructor({ data: t, config: e, api: i, readOnly: s, block: n }, r) {
|
|
@@ -1095,8 +1075,8 @@ class st {
|
|
|
1095
1075
|
}, !1), "start" in this.data.meta && this.data.meta.start !== void 0 && this.changeStartWith(this.data.meta.start), "counterType" in this.data.meta && this.data.meta.counterType !== void 0 && this.changeCounters(this.data.meta.counterType), this.listWrapper;
|
|
1096
1076
|
}
|
|
1097
1077
|
save(t) {
|
|
1098
|
-
const e = t != null ? t : this.listWrapper, i = (r) =>
|
|
1099
|
-
const a =
|
|
1078
|
+
const e = t != null ? t : this.listWrapper, i = (r) => _(r).map((o) => {
|
|
1079
|
+
const a = H(o);
|
|
1100
1080
|
return { content: this.renderer.getItemContent(o), meta: this.renderer.getItemMeta(o), items: a ? i(a) : [] };
|
|
1101
1081
|
}), s = e ? i(e) : [];
|
|
1102
1082
|
let n = { style: this.data.style, meta: {}, items: s };
|
|
@@ -1106,13 +1086,11 @@ class st {
|
|
|
1106
1086
|
return { tags: ["OL", "UL", "LI"] };
|
|
1107
1087
|
}
|
|
1108
1088
|
merge(t) {
|
|
1109
|
-
const e = this.block.holder.querySelectorAll(`.${k.item}`), i = e[e.length - 1], s =
|
|
1110
|
-
if (i === null || s === null || (s.insertAdjacentHTML("beforeend", t.items[0].content), this.listWrapper === void 0))
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
return;
|
|
1115
|
-
let r = A(n[n.length - 1]);
|
|
1089
|
+
const e = this.block.holder.querySelectorAll(`.${k.item}`), i = e[e.length - 1], s = Y(i);
|
|
1090
|
+
if (i === null || s === null || (s.insertAdjacentHTML("beforeend", t.items[0].content), this.listWrapper === void 0)) return;
|
|
1091
|
+
const n = _(this.listWrapper);
|
|
1092
|
+
if (n.length === 0) return;
|
|
1093
|
+
let r = H(n[n.length - 1]);
|
|
1116
1094
|
const o = t.items.shift();
|
|
1117
1095
|
o !== void 0 && (o.items.length !== 0 && (r === null && (r = this.renderer.renderWrapper(!1)), this.appendItems(o.items, r)), t.items.length > 0 && this.appendItems(t.items, this.listWrapper));
|
|
1118
1096
|
}
|
|
@@ -1136,9 +1114,9 @@ class st {
|
|
|
1136
1114
|
const n = { style: s, meta: {}, items: [] };
|
|
1137
1115
|
s === "ordered" && (this.data.meta.counterType = "numeric", this.data.meta.start = 1);
|
|
1138
1116
|
const r = (o) => Array.from(o.querySelectorAll(":scope > li")).map((a) => {
|
|
1139
|
-
var
|
|
1117
|
+
var p;
|
|
1140
1118
|
const d = a.querySelector(`:scope > ${i}`), l = d ? r(d) : [];
|
|
1141
|
-
return { content: (
|
|
1119
|
+
return { content: (p = a.innerHTML) != null ? p : "", meta: {}, items: l };
|
|
1142
1120
|
});
|
|
1143
1121
|
return n.items = r(t), n;
|
|
1144
1122
|
}
|
|
@@ -1151,48 +1129,41 @@ class st {
|
|
|
1151
1129
|
enterPressed(t) {
|
|
1152
1130
|
var o;
|
|
1153
1131
|
const e = this.currentItem;
|
|
1154
|
-
if (t.stopPropagation(), t.preventDefault(), t.isComposing || e === null)
|
|
1155
|
-
return;
|
|
1132
|
+
if (t.stopPropagation(), t.preventDefault(), t.isComposing || e === null) return;
|
|
1156
1133
|
const i = ((o = this.renderer) == null ? void 0 : o.getItemContent(e).trim().length) === 0, s = e.parentNode === this.listWrapper, n = e.previousElementSibling === null, r = this.api.blocks.getCurrentBlockIndex();
|
|
1157
|
-
if (s && i)
|
|
1158
|
-
return
|
|
1159
|
-
|
|
1160
|
-
}(e) ? void this.splitList(e) : void (n ? this.convertItemToDefaultBlock(r, !0) : this.convertItemToDefaultBlock());
|
|
1134
|
+
if (s && i) return e.nextElementSibling !== null || function(a) {
|
|
1135
|
+
return a.querySelector(`.${k.itemChildren}`) !== null;
|
|
1136
|
+
}(e) ? void this.splitList(e) : void (n ? this.convertItemToDefaultBlock(r, !0) : this.convertItemToDefaultBlock());
|
|
1161
1137
|
i ? this.unshiftItem(e) : this.splitItem(e);
|
|
1162
1138
|
}
|
|
1163
1139
|
backspace(t) {
|
|
1164
1140
|
var i;
|
|
1165
1141
|
const e = this.currentItem;
|
|
1166
|
-
e !== null &&
|
|
1142
|
+
e !== null && te(e) && ((i = window.getSelection()) == null ? void 0 : i.isCollapsed) !== !1 && (t.stopPropagation(), e.parentNode !== this.listWrapper || e.previousElementSibling !== null ? (t.preventDefault(), this.mergeItemWithPrevious(e)) : this.convertFirstItemToDefaultBlock());
|
|
1167
1143
|
}
|
|
1168
1144
|
shiftTab(t) {
|
|
1169
1145
|
t.stopPropagation(), t.preventDefault(), this.currentItem !== null && this.unshiftItem(this.currentItem);
|
|
1170
1146
|
}
|
|
1171
1147
|
unshiftItem(t) {
|
|
1172
|
-
if (!t.parentNode || !
|
|
1173
|
-
return;
|
|
1148
|
+
if (!t.parentNode || !B(t.parentNode)) return;
|
|
1174
1149
|
const e = t.parentNode.closest(`.${k.item}`);
|
|
1175
|
-
if (!e)
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
return;
|
|
1180
|
-
const s = et(t);
|
|
1150
|
+
if (!e) return;
|
|
1151
|
+
let i = H(t);
|
|
1152
|
+
if (t.parentElement === null) return;
|
|
1153
|
+
const s = Q(t);
|
|
1181
1154
|
s !== null && (i === null && (i = this.renderer.renderWrapper(!1)), s.forEach((n) => {
|
|
1182
1155
|
i.appendChild(n);
|
|
1183
|
-
}), t.appendChild(i)), e.after(t),
|
|
1156
|
+
}), t.appendChild(i)), e.after(t), N(t, !1), tt(e);
|
|
1184
1157
|
}
|
|
1185
1158
|
splitList(t) {
|
|
1186
|
-
const e =
|
|
1159
|
+
const e = _(t), i = this.block, s = this.api.blocks.getCurrentBlockIndex();
|
|
1187
1160
|
if (e.length !== 0) {
|
|
1188
1161
|
const a = e[0];
|
|
1189
|
-
this.unshiftItem(a),
|
|
1162
|
+
this.unshiftItem(a), N(t, !1);
|
|
1190
1163
|
}
|
|
1191
|
-
if (t.previousElementSibling === null && t.parentNode === this.listWrapper)
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
if (n === null)
|
|
1195
|
-
return;
|
|
1164
|
+
if (t.previousElementSibling === null && t.parentNode === this.listWrapper) return void this.convertItemToDefaultBlock(s);
|
|
1165
|
+
const n = Q(t);
|
|
1166
|
+
if (n === null) return;
|
|
1196
1167
|
const r = this.renderer.renderWrapper(!0);
|
|
1197
1168
|
n.forEach((a) => {
|
|
1198
1169
|
r.appendChild(a);
|
|
@@ -1201,73 +1172,63 @@ class st {
|
|
|
1201
1172
|
o.meta.start = this.data.style == "ordered" ? 1 : void 0, this.api.blocks.insert(i == null ? void 0 : i.name, o, this.config, s + 1), this.convertItemToDefaultBlock(s + 1), r.remove();
|
|
1202
1173
|
}
|
|
1203
1174
|
splitItem(t) {
|
|
1204
|
-
const [e, i] =
|
|
1205
|
-
if (e === null)
|
|
1206
|
-
|
|
1207
|
-
const s = X(t);
|
|
1175
|
+
const [e, i] = ee();
|
|
1176
|
+
if (e === null) return;
|
|
1177
|
+
const s = Y(t);
|
|
1208
1178
|
let n;
|
|
1209
|
-
n = s === null ? "" :
|
|
1210
|
-
const r =
|
|
1211
|
-
t == null || t.after(o), r && o.appendChild(r),
|
|
1179
|
+
n = s === null ? "" : ie(s, e, i, "right", !0);
|
|
1180
|
+
const r = H(t), o = this.renderItem(n);
|
|
1181
|
+
t == null || t.after(o), r && o.appendChild(r), N(o);
|
|
1212
1182
|
}
|
|
1213
1183
|
mergeItemWithPrevious(t) {
|
|
1214
|
-
var
|
|
1184
|
+
var p;
|
|
1215
1185
|
const e = t.previousElementSibling, i = t.parentNode;
|
|
1216
|
-
if (i === null || !
|
|
1217
|
-
return;
|
|
1186
|
+
if (i === null || !B(i)) return;
|
|
1218
1187
|
const s = i.closest(`.${k.item}`);
|
|
1219
|
-
if (!e && !s || e && !
|
|
1220
|
-
return;
|
|
1188
|
+
if (!e && !s || e && !B(e)) return;
|
|
1221
1189
|
let n;
|
|
1222
1190
|
if (e) {
|
|
1223
|
-
const
|
|
1224
|
-
n =
|
|
1225
|
-
} else
|
|
1226
|
-
n = s;
|
|
1191
|
+
const c = _(e, !1);
|
|
1192
|
+
n = c.length !== 0 && c.length !== 0 ? c[c.length - 1] : e;
|
|
1193
|
+
} else n = s;
|
|
1227
1194
|
const r = this.renderer.getItemContent(t);
|
|
1228
|
-
if (!n)
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
if (o === null)
|
|
1233
|
-
return;
|
|
1195
|
+
if (!n) return;
|
|
1196
|
+
N(n, !1);
|
|
1197
|
+
const o = Y(n);
|
|
1198
|
+
if (o === null) return;
|
|
1234
1199
|
o.insertAdjacentHTML("beforeend", r);
|
|
1235
|
-
const a =
|
|
1236
|
-
if (a.length === 0)
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
}), A(d) === null && n.appendChild(l), t.remove();
|
|
1200
|
+
const a = _(t);
|
|
1201
|
+
if (a.length === 0) return t.remove(), void tt(n);
|
|
1202
|
+
const d = e || s, l = (p = H(d)) != null ? p : this.renderer.renderWrapper(!1);
|
|
1203
|
+
e ? a.forEach((c) => {
|
|
1204
|
+
l.appendChild(c);
|
|
1205
|
+
}) : a.forEach((c) => {
|
|
1206
|
+
l.prepend(c);
|
|
1207
|
+
}), H(d) === null && n.appendChild(l), t.remove();
|
|
1244
1208
|
}
|
|
1245
1209
|
addTab(t) {
|
|
1246
1210
|
var n;
|
|
1247
1211
|
t.stopPropagation(), t.preventDefault();
|
|
1248
1212
|
const e = this.currentItem;
|
|
1249
|
-
if (!e)
|
|
1250
|
-
return;
|
|
1213
|
+
if (!e) return;
|
|
1251
1214
|
if (((n = this.config) == null ? void 0 : n.maxLevel) !== void 0) {
|
|
1252
1215
|
const r = this.currentItemLevel;
|
|
1253
|
-
if (r !== null && r === this.config.maxLevel)
|
|
1254
|
-
return;
|
|
1216
|
+
if (r !== null && r === this.config.maxLevel) return;
|
|
1255
1217
|
}
|
|
1256
1218
|
const i = e.previousSibling;
|
|
1257
|
-
if (i === null || !
|
|
1258
|
-
|
|
1259
|
-
const s = A(i);
|
|
1219
|
+
if (i === null || !B(i)) return;
|
|
1220
|
+
const s = H(i);
|
|
1260
1221
|
if (s)
|
|
1261
|
-
s.appendChild(e),
|
|
1222
|
+
s.appendChild(e), _(e).forEach((r) => {
|
|
1262
1223
|
s.appendChild(r);
|
|
1263
1224
|
});
|
|
1264
1225
|
else {
|
|
1265
1226
|
const r = this.renderer.renderWrapper(!1);
|
|
1266
|
-
r.appendChild(e),
|
|
1227
|
+
r.appendChild(e), _(e).forEach((o) => {
|
|
1267
1228
|
r.appendChild(o);
|
|
1268
1229
|
}), i.appendChild(r);
|
|
1269
1230
|
}
|
|
1270
|
-
|
|
1231
|
+
tt(e), N(e, !1);
|
|
1271
1232
|
}
|
|
1272
1233
|
convertItemToDefaultBlock(t, e) {
|
|
1273
1234
|
let i;
|
|
@@ -1276,21 +1237,20 @@ class st {
|
|
|
1276
1237
|
}
|
|
1277
1238
|
convertFirstItemToDefaultBlock() {
|
|
1278
1239
|
const t = this.currentItem;
|
|
1279
|
-
if (t === null)
|
|
1280
|
-
|
|
1281
|
-
const e = H(t);
|
|
1240
|
+
if (t === null) return;
|
|
1241
|
+
const e = _(t);
|
|
1282
1242
|
if (e.length !== 0) {
|
|
1283
1243
|
const r = e[0];
|
|
1284
|
-
this.unshiftItem(r),
|
|
1244
|
+
this.unshiftItem(r), N(t);
|
|
1285
1245
|
}
|
|
1286
|
-
const i =
|
|
1246
|
+
const i = Q(t), s = this.api.blocks.getCurrentBlockIndex(), n = i === null;
|
|
1287
1247
|
this.convertItemToDefaultBlock(s, n);
|
|
1288
1248
|
}
|
|
1289
1249
|
renderItem(t, e) {
|
|
1290
1250
|
const i = e != null ? e : this.renderer.composeDefaultMeta();
|
|
1291
1251
|
switch (!0) {
|
|
1252
|
+
case this.renderer instanceof T:
|
|
1292
1253
|
case this.renderer instanceof E:
|
|
1293
|
-
case this.renderer instanceof M:
|
|
1294
1254
|
}
|
|
1295
1255
|
return this.renderer.renderItem(t, i);
|
|
1296
1256
|
}
|
|
@@ -1305,8 +1265,8 @@ class st {
|
|
|
1305
1265
|
});
|
|
1306
1266
|
}
|
|
1307
1267
|
}
|
|
1308
|
-
const P = { wrapper: `${b}-start-with-field`, input: `${b}-start-with-field__input`, startWithElementWrapperInvalid: `${b}-start-with-field--invalid` },
|
|
1309
|
-
class
|
|
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
|
+
class X {
|
|
1310
1270
|
static get isReadOnlySupported() {
|
|
1311
1271
|
return !0;
|
|
1312
1272
|
}
|
|
@@ -1314,13 +1274,13 @@ class K {
|
|
|
1314
1274
|
return !0;
|
|
1315
1275
|
}
|
|
1316
1276
|
static get toolbox() {
|
|
1317
|
-
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" } }];
|
|
1318
1278
|
}
|
|
1319
1279
|
static get pasteConfig() {
|
|
1320
1280
|
return { tags: ["OL", "UL", "LI"] };
|
|
1321
1281
|
}
|
|
1322
1282
|
static get conversionConfig() {
|
|
1323
|
-
return { export: (t) =>
|
|
1283
|
+
return { export: (t) => X.joinRecursive(t), import: (t, e) => ({ meta: {}, items: [{ content: t, meta: {}, items: [] }], style: (e == null ? void 0 : e.defaultStyle) !== void 0 ? e.defaultStyle : "unordered" }) };
|
|
1324
1284
|
}
|
|
1325
1285
|
get listStyle() {
|
|
1326
1286
|
return this.data.style || this.defaultListStyle;
|
|
@@ -1333,7 +1293,7 @@ class K {
|
|
|
1333
1293
|
}
|
|
1334
1294
|
constructor({ data: t, config: e, api: i, readOnly: s, block: n }) {
|
|
1335
1295
|
var o;
|
|
1336
|
-
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(
|
|
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());
|
|
1337
1297
|
const r = { style: this.defaultListStyle, meta: {}, items: [] };
|
|
1338
1298
|
this.data = Object.keys(t).length ? function(a) {
|
|
1339
1299
|
const d = [];
|
|
@@ -1351,7 +1311,7 @@ class K {
|
|
|
1351
1311
|
}(t) : r, this.listStyle === "ordered" && this.data.meta.counterType === void 0 && (this.data.meta.counterType = "numeric"), this.changeTabulatorByStyle();
|
|
1352
1312
|
}
|
|
1353
1313
|
static joinRecursive(t) {
|
|
1354
|
-
return t.items.map((e) => `${e.content} ${
|
|
1314
|
+
return t.items.map((e) => `${e.content} ${X.joinRecursive(e)}`).join("");
|
|
1355
1315
|
}
|
|
1356
1316
|
render() {
|
|
1357
1317
|
return this.listElement = this.list.render(), this.listElement;
|
|
@@ -1364,30 +1324,29 @@ class K {
|
|
|
1364
1324
|
}
|
|
1365
1325
|
renderSettings() {
|
|
1366
1326
|
var e;
|
|
1367
|
-
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: () => {
|
|
1368
1328
|
this.listStyle = "unordered";
|
|
1369
|
-
} }, { label: this.api.i18n.t("Ordered"), icon:
|
|
1329
|
+
} }, { label: this.api.i18n.t("Ordered"), icon: St, closeOnActivate: !0, isActive: this.listStyle == "ordered", onActivate: () => {
|
|
1370
1330
|
this.listStyle = "ordered";
|
|
1371
|
-
} }, { label: this.api.i18n.t("Checklist"), icon:
|
|
1331
|
+
} }, { label: this.api.i18n.t("Checklist"), icon: wt, closeOnActivate: !0, isActive: this.listStyle == "checklist", onActivate: () => {
|
|
1372
1332
|
this.listStyle = "checklist";
|
|
1373
1333
|
} }];
|
|
1374
1334
|
if (this.listStyle === "ordered") {
|
|
1375
|
-
const i = function(r, { value:
|
|
1376
|
-
const
|
|
1377
|
-
for (const
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
}((r) => this.changeStartWith(Number(r)), { value: String((e = this.data.meta.start) != null ? e : 1), placeholder: "", attributes: { required: "true" }, sanitize: (r) => function(o) {
|
|
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
|
+
return c.appendChild(h), g.appendChild(m), c.appendChild(g), m.addEventListener("input", () => {
|
|
1339
|
+
p !== void 0 && (m.value = p(m.value));
|
|
1340
|
+
const f = m.checkValidity();
|
|
1341
|
+
f || c.classList.contains(P.startWithElementWrapperInvalid) || c.classList.add(P.startWithElementWrapperInvalid), f && c.classList.contains(P.startWithElementWrapperInvalid) && c.classList.remove(P.startWithElementWrapperInvalid), f && o(m.value);
|
|
1342
|
+
}), c;
|
|
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) {
|
|
1385
1344
|
return o.replace(/\D+/g, "");
|
|
1386
|
-
}(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>',
|
|
1387
|
-
|
|
1388
|
-
const a =
|
|
1389
|
-
this.defaultCounterTypes.includes(a) && n.children.items.push({ title: this.api.i18n.t(o), icon:
|
|
1390
|
-
this.changeCounters(
|
|
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
|
+
j.forEach((r, o) => {
|
|
1347
|
+
const a = j.get(o);
|
|
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
|
+
this.changeCounters(j.get(o));
|
|
1391
1350
|
} });
|
|
1392
1351
|
}), n.children.items.length > 1 && s.push(n), t.push({ type: "separator" }, ...s);
|
|
1393
1352
|
}
|
|
@@ -1419,17 +1378,49 @@ class K {
|
|
|
1419
1378
|
changeTabulatorByStyle() {
|
|
1420
1379
|
switch (this.listStyle) {
|
|
1421
1380
|
case "ordered":
|
|
1422
|
-
this.list = new
|
|
1381
|
+
this.list = new et({ data: this.data, readOnly: this.readOnly, api: this.api, config: this.config, block: this.block }, new T(this.readOnly, this.config));
|
|
1423
1382
|
break;
|
|
1424
1383
|
case "unordered":
|
|
1425
|
-
this.list = new
|
|
1384
|
+
this.list = new et({ data: this.data, readOnly: this.readOnly, api: this.api, config: this.config, block: this.block }, new E(this.readOnly, this.config));
|
|
1426
1385
|
break;
|
|
1427
1386
|
case "checklist":
|
|
1428
|
-
this.list = new
|
|
1387
|
+
this.list = new et({ data: this.data, readOnly: this.readOnly, api: this.api, config: this.config, block: this.block }, new C(this.readOnly, this.config));
|
|
1429
1388
|
}
|
|
1430
1389
|
}
|
|
1431
1390
|
}
|
|
1432
|
-
class
|
|
1391
|
+
class Mt {
|
|
1392
|
+
constructor(t) {
|
|
1393
|
+
this.target = t, this.isContentEditable = t && t.contentEditable;
|
|
1394
|
+
}
|
|
1395
|
+
getPos() {
|
|
1396
|
+
if (document.activeElement !== this.target) return -1;
|
|
1397
|
+
if (this.isContentEditable === "true") {
|
|
1398
|
+
this.target.focus();
|
|
1399
|
+
const t = document.getSelection();
|
|
1400
|
+
if (!t) return -1;
|
|
1401
|
+
let e = t.getRangeAt(0), i = e.cloneRange();
|
|
1402
|
+
return i.selectNodeContents(this.target), i.setEnd(e.endContainer, e.endOffset), i.toString().length;
|
|
1403
|
+
}
|
|
1404
|
+
return this.target.selectionStart;
|
|
1405
|
+
}
|
|
1406
|
+
setPos(t) {
|
|
1407
|
+
if (this.isContentEditable === "true") {
|
|
1408
|
+
if (t >= 0) {
|
|
1409
|
+
const e = window.getSelection();
|
|
1410
|
+
if (!e) return;
|
|
1411
|
+
const i = this.createRange(this.target, { count: t });
|
|
1412
|
+
i && (i.collapse(!1), e.removeAllRanges(), e.addRange(i));
|
|
1413
|
+
}
|
|
1414
|
+
} else this.target.focus(), this.target.setSelectionRange(t, t);
|
|
1415
|
+
}
|
|
1416
|
+
createRange(t, e, i) {
|
|
1417
|
+
if (i || ((i = document.createRange()).selectNode(t), i.setStart(t, 0)), e.count === 0) i.setEnd(t, e.count);
|
|
1418
|
+
else if (t && e.count > 0) if (t.nodeType === Node.TEXT_NODE) t.textContent && t.textContent.length < e.count ? e.count -= t.textContent.length : (i.setEnd(t, e.count), e.count = 0);
|
|
1419
|
+
else for (let s = 0; s < t.childNodes.length && (i = this.createRange(t.childNodes[s], e, i), e.count !== 0); s++) ;
|
|
1420
|
+
return i;
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
class pe {
|
|
1433
1424
|
constructor(t, e, i) {
|
|
1434
1425
|
this.holder = e, this.observer = null, this.debounceTimer = i, this.mutationDebouncer = this.debounce(() => {
|
|
1435
1426
|
t();
|
|
@@ -1469,19 +1460,18 @@ class be {
|
|
|
1469
1460
|
document.dispatchEvent(t), (e = this.observer) == null || e.disconnect();
|
|
1470
1461
|
}
|
|
1471
1462
|
}
|
|
1472
|
-
class
|
|
1463
|
+
class ge {
|
|
1473
1464
|
constructor({ editor: t, config: e = {}, onUpdate: i, maxLength: s }) {
|
|
1474
1465
|
this.position = 0;
|
|
1475
1466
|
const n = { maxLength: 30, onUpdate() {
|
|
1476
|
-
}, 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,
|
|
1477
|
-
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
|
|
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();
|
|
1478
1469
|
}
|
|
1479
1470
|
static get isReadOnlySupported() {
|
|
1480
1471
|
return !0;
|
|
1481
1472
|
}
|
|
1482
1473
|
truncate(t, e) {
|
|
1483
|
-
for (; t.length > e; )
|
|
1484
|
-
t.shift();
|
|
1474
|
+
for (; t.length > e; ) t.shift();
|
|
1485
1475
|
}
|
|
1486
1476
|
initialize(t) {
|
|
1487
1477
|
const e = "blocks" in t ? t.blocks : t, i = { index: e.length - 1, state: e };
|
|
@@ -1513,14 +1503,13 @@ class ye {
|
|
|
1513
1503
|
}
|
|
1514
1504
|
getCaretIndex(t) {
|
|
1515
1505
|
const e = this.holder.getElementsByClassName("ce-block__content");
|
|
1516
|
-
return new
|
|
1506
|
+
return new Mt(e[t].firstChild).getPos();
|
|
1517
1507
|
}
|
|
1518
1508
|
insertDeletedBlock(t, e, i) {
|
|
1519
|
-
for (let s = 0; s < t.length; s += 1)
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
}
|
|
1509
|
+
for (let s = 0; s < t.length; s += 1) if (!e[s] || t[s].id !== e[s].id) {
|
|
1510
|
+
this.blocks.insert(t[s].type, t[s].data, {}, s, !0), this.caret.setToBlock(i, "end");
|
|
1511
|
+
break;
|
|
1512
|
+
}
|
|
1524
1513
|
}
|
|
1525
1514
|
blockWasDropped(t, e) {
|
|
1526
1515
|
return t.length === e.length && t.some((i, s) => i.id !== e[s].id);
|
|
@@ -1535,7 +1524,7 @@ class ye {
|
|
|
1535
1524
|
return t.length > e.length;
|
|
1536
1525
|
}
|
|
1537
1526
|
contentWasCopied(t, e, i) {
|
|
1538
|
-
return Object.keys(t[i].data).length === 0 && JSON.stringify(e[i + 1]) !== JSON.stringify(t[i + 1]);
|
|
1527
|
+
return t[i] && t[i].data && Object.keys(t[i].data).length === 0 && JSON.stringify(e[i + 1]) !== JSON.stringify(t[i + 1]);
|
|
1539
1528
|
}
|
|
1540
1529
|
async undo() {
|
|
1541
1530
|
if (this.canUndo()) {
|
|
@@ -1545,19 +1534,14 @@ class ye {
|
|
|
1545
1534
|
const { state: s, caretIndex: n } = this.stack[this.position];
|
|
1546
1535
|
this.onUpdate();
|
|
1547
1536
|
const r = this.blocks.getBlocksCount();
|
|
1548
|
-
if (s[i] || (i -= 1, this.stack[this.position].index = i), this.blockWasDeleted(s, e))
|
|
1549
|
-
|
|
1550
|
-
else if (this.
|
|
1551
|
-
|
|
1552
|
-
else if (
|
|
1553
|
-
await this.blocks.delete(t), this.caret.setToBlock(i, "end");
|
|
1554
|
-
else if (r > s.length)
|
|
1555
|
-
await this.blocks.render({ blocks: s }), this.setCaretIndex(i, n);
|
|
1556
|
-
else if (this.blockWasDropped(s, e))
|
|
1557
|
-
await this.blocks.render({ blocks: s }), this.caret.setToBlock(i, "end");
|
|
1537
|
+
if (s[i] || (i -= 1, this.stack[this.position].index = i), this.blockWasDeleted(s, e)) this.insertDeletedBlock(s, e, i);
|
|
1538
|
+
else if (this.contentWasCopied(s, e, i)) await this.blocks.render({ blocks: s }), this.caret.setToBlock(i, "end");
|
|
1539
|
+
else if (i < t && this.blockWasSkipped(s, e)) await this.blocks.delete(t), this.caret.setToBlock(i, "end");
|
|
1540
|
+
else if (r > s.length) await this.blocks.render({ blocks: s }), this.setCaretIndex(i, n);
|
|
1541
|
+
else if (this.blockWasDropped(s, e)) await this.blocks.render({ blocks: s }), this.caret.setToBlock(i, "end");
|
|
1558
1542
|
else if (this.contentChangedInNoFocusBlock(i, t)) {
|
|
1559
|
-
const
|
|
1560
|
-
await this.blocks.update(a, s[t].data), this.setCaretIndex(i, n);
|
|
1543
|
+
const a = this.blocks.getBlockByIndex(t);
|
|
1544
|
+
a.id && (await this.blocks.update(a.id, s[t].data), this.setCaretIndex(i, n));
|
|
1561
1545
|
}
|
|
1562
1546
|
const o = this.blocks.getBlockByIndex(i);
|
|
1563
1547
|
o && (await this.blocks.update(o.id, s[i].data), this.setCaretIndex(i, n));
|
|
@@ -1565,17 +1549,15 @@ class ye {
|
|
|
1565
1549
|
}
|
|
1566
1550
|
setCaretIndex(t, e) {
|
|
1567
1551
|
if (e && e !== -1) {
|
|
1568
|
-
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);
|
|
1569
1553
|
setTimeout(() => s.setPos(e), 50);
|
|
1570
|
-
} else
|
|
1571
|
-
this.caret.setToBlock(t, "end");
|
|
1554
|
+
} else this.caret.setToBlock(t, "end");
|
|
1572
1555
|
}
|
|
1573
1556
|
async insertBlock(t, e) {
|
|
1574
1557
|
await this.blocks.insert(t[e].type, t[e].data, {}, e, !0);
|
|
1575
1558
|
}
|
|
1576
1559
|
async insertSkippedBlocks(t, e, i) {
|
|
1577
|
-
for (let s = t.length; s < e.length; s += 1)
|
|
1578
|
-
this.insertBlock(e, s);
|
|
1560
|
+
for (let s = t.length; s < e.length; s += 1) this.insertBlock(e, s);
|
|
1579
1561
|
JSON.stringify(t[i - 1]) !== JSON.stringify(e[i - 1]) && await this.updateModifiedBlock(e, i);
|
|
1580
1562
|
}
|
|
1581
1563
|
async updateModifiedBlock(t, e) {
|
|
@@ -1605,17 +1587,17 @@ class ye {
|
|
|
1605
1587
|
return i.push(s), i;
|
|
1606
1588
|
}
|
|
1607
1589
|
setEventListeners() {
|
|
1608
|
-
const { holder: t } = this, { shortcuts: e } = this.config, { undo: i, redo: s } = e, n = i.map((
|
|
1609
|
-
l(
|
|
1610
|
-
},
|
|
1611
|
-
l(
|
|
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
|
+
}, c = (h) => {
|
|
1593
|
+
l(h, a, o) && (h.preventDefault(), this.redo());
|
|
1612
1594
|
};
|
|
1613
|
-
t.addEventListener("keydown",
|
|
1614
|
-
t.removeEventListener("keydown",
|
|
1595
|
+
t.addEventListener("keydown", p), t.addEventListener("keydown", c), t.addEventListener("destroy", () => {
|
|
1596
|
+
t.removeEventListener("keydown", p), t.removeEventListener("keydown", c);
|
|
1615
1597
|
});
|
|
1616
1598
|
}
|
|
1617
1599
|
}
|
|
1618
|
-
class
|
|
1600
|
+
class I {
|
|
1619
1601
|
static get toolbox() {
|
|
1620
1602
|
return { icon: '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M83.2 147.2V448c0 25.6 19.2 44.8 44.8 44.8h768c25.6 0 44.8-19.2 44.8-44.8V147.2c0-25.6-19.2-44.8-44.8-44.8H128c-25.6 6.4-44.8 25.6-44.8 44.8z m89.6 256V192h684.8v211.2H172.8zM810.24 642.56c0-25.6-19.2-44.8-44.8-44.8h-640c-25.6 0-44.8 19.2-44.8 44.8 0 25.6 19.2 44.8 44.8 44.8h640c25.6 6.4 44.8-12.8 44.8-44.8zM554.56 866.24c0-25.6-19.2-44.8-44.8-44.8h-384c-25.6 0-44.8 19.2-44.8 44.8 0 25.6 19.2 44.8 44.8 44.8h384c25.6 6.4 44.8-12.8 44.8-44.8z" fill="#000000" ></path></svg>', title: "Alert" };
|
|
1621
1603
|
}
|
|
@@ -1641,13 +1623,13 @@ class _ {
|
|
|
1641
1623
|
return { wrapper: "cdx-alert", wrapperForType: (t) => `cdx-alert-${t}`, wrapperForAlignType: (t) => `cdx-alert-align-${t}`, message: "cdx-alert__message" };
|
|
1642
1624
|
}
|
|
1643
1625
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
1644
|
-
this.api = i, this.alertTypes = e.alertTypes ||
|
|
1626
|
+
this.api = i, this.alertTypes = e.alertTypes || I.ALERT_TYPES, this.defaultType = e.defaultType || I.DEFAULT_TYPE, this.defaultAlign = e.defaultAlign || I.DEFAULT_ALIGN_TYPE, this.messagePlaceholder = this.api.i18n.t(e.messagePlaceholder || I.DEFAULT_MESSAGE_PLACEHOLDER), this.data = { type: this.alertTypes.includes(t.type) ? t.type : this.defaultType, align: I.ALIGN_TYPES.includes(t.align) ? t.align : this.defaultAlign, message: t.message || "" }, this.container = void 0, this.readOnly = s;
|
|
1645
1627
|
}
|
|
1646
1628
|
static get isReadOnlySupported() {
|
|
1647
1629
|
return !0;
|
|
1648
1630
|
}
|
|
1649
1631
|
render() {
|
|
1650
|
-
const t = [this.CSS.wrapper, this.CSS.wrapperForType(this.data.type)
|
|
1632
|
+
const t = [this.CSS.wrapper, this.CSS.wrapperForType(this.data.type)];
|
|
1651
1633
|
this.container = this._make("div", t);
|
|
1652
1634
|
const e = this._make("div", [this.CSS.message], { contentEditable: !this.readOnly, innerHTML: this.data.message });
|
|
1653
1635
|
return e.dataset.placeholder = this.messagePlaceholder, this.container.appendChild(e), this.container;
|
|
@@ -1694,17 +1676,6 @@ class _ {
|
|
|
1694
1676
|
a.classList.toggle("cdx-alert_setting__icon_active", l === this.data.type);
|
|
1695
1677
|
});
|
|
1696
1678
|
});
|
|
1697
|
-
}), _.ALIGN_TYPES.map((s) => {
|
|
1698
|
-
let n;
|
|
1699
|
-
return s === "left" && (n = document.createElement("div"), n.classList.add("cdx-alert_setting__icon"), n.innerHTML = qt), s === "right" && (n = document.createElement("div"), n.classList.add("cdx-alert_setting__icon"), n.innerHTML = Vt), s === "center" && (n = document.createElement("div"), n.classList.add("cdx-alert_setting__icon"), n.innerHTML = Ut), n == null || n.setAttribute("data-align", s), this.api.tooltip.onHover(n, this.api.i18n.t(`align-${s}`), { placement: "top" }), i.appendChild(n), n;
|
|
1700
|
-
}).forEach((s, n, r) => {
|
|
1701
|
-
const o = s.getAttribute("data-align") || "";
|
|
1702
|
-
s.addEventListener("click", () => {
|
|
1703
|
-
this._changeAlignType(o), r.forEach((a, d) => {
|
|
1704
|
-
const l = a == null ? void 0 : a.getAttribute("data-align");
|
|
1705
|
-
a == null || a.classList.toggle("cdx-alert_setting__icon_active", l === this.data.align);
|
|
1706
|
-
});
|
|
1707
|
-
});
|
|
1708
1679
|
}), t.appendChild(e), t.appendChild(i), t;
|
|
1709
1680
|
}
|
|
1710
1681
|
_getFormattedName(t) {
|
|
@@ -1717,7 +1688,7 @@ class _ {
|
|
|
1717
1688
|
});
|
|
1718
1689
|
}
|
|
1719
1690
|
_changeAlignType(t) {
|
|
1720
|
-
this.data.align = t,
|
|
1691
|
+
this.data.align = t, I.ALIGN_TYPES.forEach((e) => {
|
|
1721
1692
|
const i = this.CSS.wrapperForAlignType(e);
|
|
1722
1693
|
this.container.classList.remove(i), t === e && this.container.classList.add(i);
|
|
1723
1694
|
});
|
|
@@ -1729,8 +1700,7 @@ class _ {
|
|
|
1729
1700
|
_make(t, e, i = {}) {
|
|
1730
1701
|
let s = document.createElement(t);
|
|
1731
1702
|
Array.isArray(e) ? s.classList.add(...e) : e && s.classList.add(e);
|
|
1732
|
-
for (let n in i)
|
|
1733
|
-
s[n] = i[n];
|
|
1703
|
+
for (let n in i) s[n] = i[n];
|
|
1734
1704
|
return s;
|
|
1735
1705
|
}
|
|
1736
1706
|
onPaste(t) {
|
|
@@ -1744,14 +1714,14 @@ class _ {
|
|
|
1744
1714
|
return { message: !0, type: !1, alignType: !1 };
|
|
1745
1715
|
}
|
|
1746
1716
|
}
|
|
1747
|
-
const
|
|
1717
|
+
const _t = { orientation: !1 }, w = class w {
|
|
1748
1718
|
constructor({ api: t, data: e, config: i, block: s, ...n }) {
|
|
1749
|
-
var o, a, d, l,
|
|
1719
|
+
var o, a, d, l, p, c;
|
|
1750
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));
|
|
1751
|
-
const r = (
|
|
1752
|
-
this.data = { indentLevel: r, ...e != null ? e : {} }, this.config.multiblock && this.config.tuneName, window.addEventListener("resize", (
|
|
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
|
+
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 }) => {
|
|
1753
1723
|
var f;
|
|
1754
|
-
const g =
|
|
1724
|
+
const g = h.detail.target.id;
|
|
1755
1725
|
((f = this.block) == null ? void 0 : f.id) === g && this.shouldApplyAutoIndent && queueMicrotask(() => this.autoIndentBlock());
|
|
1756
1726
|
});
|
|
1757
1727
|
}
|
|
@@ -1767,37 +1737,35 @@ const Et = { orientation: !1 }, J = class x {
|
|
|
1767
1737
|
const t = () => {
|
|
1768
1738
|
if (this.data.indentLevel == this.maxIndent) {
|
|
1769
1739
|
const a = this.getTuneButton("indent");
|
|
1770
|
-
if (a == null || a.classList.add(this.CSS.disabledItem), !a)
|
|
1771
|
-
return !0;
|
|
1740
|
+
if (a == null || a.classList.add(this.CSS.disabledItem), !a) return !0;
|
|
1772
1741
|
}
|
|
1773
1742
|
if (this.data.indentLevel == this.minIndent) {
|
|
1774
1743
|
const a = this.getTuneButton("unindent");
|
|
1775
|
-
if (a == null || a.classList.add(this.CSS.disabledItem), !a)
|
|
1776
|
-
return !0;
|
|
1744
|
+
if (a == null || a.classList.add(this.CSS.disabledItem), !a) return !0;
|
|
1777
1745
|
}
|
|
1778
1746
|
};
|
|
1779
1747
|
if (queueMicrotask(() => {
|
|
1780
1748
|
t() && setTimeout(t, 300);
|
|
1781
1749
|
}), this.config.orientation === "vertical") {
|
|
1782
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}`;
|
|
1783
|
-
return [{ title: this.rightText, hint: { title: this.api.i18n.t(this.rightText) }, onActivate: (l,
|
|
1751
|
+
return [{ title: this.rightText, hint: { title: this.api.i18n.t(this.rightText) }, onActivate: (l, p) => {
|
|
1784
1752
|
this.handleIndentRight(), l.title = this.rightText;
|
|
1785
|
-
}, icon:
|
|
1753
|
+
}, icon: Tt, name: d }, { title: this.leftText, hint: { title: this.api.i18n.t(this.leftText) }, onActivate: (l, p) => {
|
|
1786
1754
|
this.handleIndentLeft(), l.title = this.leftText;
|
|
1787
|
-
}, icon:
|
|
1755
|
+
}, icon: xt, name: a }];
|
|
1788
1756
|
}
|
|
1789
1757
|
const e = `
|
|
1790
1758
|
<div class="${this.CSS.popoverItem} ${this.CSS.customPopoverItem}" data-item-name='indent' version=${this.config.version}>
|
|
1791
|
-
<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>
|
|
1792
1760
|
<span class="${this.CSS.popoverItemTitle}">${this.api.sanitizer.clean(this.api.i18n.t("Indent"), {})}</span>
|
|
1793
|
-
<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>
|
|
1794
1762
|
</div>
|
|
1795
1763
|
`, i = this.createElementFromTemplate(e), s = i.querySelector(`[data-${this.TuneNames.indentRight}]`), n = i.querySelector(`[data-${this.TuneNames.indentLeft}]`);
|
|
1796
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;
|
|
1797
1765
|
}
|
|
1798
1766
|
wrap(t) {
|
|
1799
1767
|
var i, s, n, r, o;
|
|
1800
|
-
this.wrapper.appendChild(t), this.wrapper.setAttribute(
|
|
1768
|
+
this.wrapper.appendChild(t), this.wrapper.setAttribute(w.DATA_WRAPPER_NAME, "");
|
|
1801
1769
|
let e = !!this.config.highlightIndent;
|
|
1802
1770
|
if ((i = this.config.highlightIndent) != null && i.tuneNames && !this.config.highlightIndent.tuneNames.includes((n = (s = this.block) == null ? void 0 : s.name) != null ? n : "") && (e = !1), e) {
|
|
1803
1771
|
const a = this.createElementFromTemplate(`
|
|
@@ -1843,29 +1811,22 @@ const Et = { orientation: !1 }, J = class x {
|
|
|
1843
1811
|
}
|
|
1844
1812
|
get shouldApplyAutoIndent() {
|
|
1845
1813
|
var s;
|
|
1846
|
-
if (!this.config.autoIndent)
|
|
1847
|
-
|
|
1848
|
-
if (typeof this.config.autoIndent == "boolean")
|
|
1849
|
-
return this.config.autoIndent;
|
|
1814
|
+
if (!this.config.autoIndent) return !1;
|
|
1815
|
+
if (typeof this.config.autoIndent == "boolean") return this.config.autoIndent;
|
|
1850
1816
|
const t = this.api.blocks.getCurrentBlockIndex();
|
|
1851
|
-
if (t < 0)
|
|
1852
|
-
return !1;
|
|
1817
|
+
if (t < 0) return !1;
|
|
1853
1818
|
const e = this.api.blocks.getBlockByIndex(t);
|
|
1854
|
-
if (!e)
|
|
1855
|
-
return !1;
|
|
1819
|
+
if (!e) return !1;
|
|
1856
1820
|
const i = e.name;
|
|
1857
1821
|
return !((s = this.config.autoIndent.tuneNames) != null && s.length) || this.config.autoIndent.tuneNames.includes(i);
|
|
1858
1822
|
}
|
|
1859
1823
|
handlePropagationForKeyEvent(t) {
|
|
1860
1824
|
var r, o, a;
|
|
1861
|
-
if (!((r = this.block) != null && r.id) || this.config.handleShortcut === !1)
|
|
1862
|
-
return null;
|
|
1825
|
+
if (!((r = this.block) != null && r.id) || this.config.handleShortcut === !1) return null;
|
|
1863
1826
|
const e = t.key == this.DEFAULT_INDENT_KEY, i = typeof this.config.handleShortcut == "function";
|
|
1864
|
-
if (!i && !e)
|
|
1865
|
-
return null;
|
|
1827
|
+
if (!i && !e) return null;
|
|
1866
1828
|
const s = (a = (o = this.config).handleShortcut) == null ? void 0 : a.call(o, t, this.block.id);
|
|
1867
|
-
if (!s && i)
|
|
1868
|
-
return null;
|
|
1829
|
+
if (!s && i) return null;
|
|
1869
1830
|
let n;
|
|
1870
1831
|
switch (s) {
|
|
1871
1832
|
case "indent":
|
|
@@ -1875,35 +1836,29 @@ const Et = { orientation: !1 }, J = class x {
|
|
|
1875
1836
|
n = !1;
|
|
1876
1837
|
break;
|
|
1877
1838
|
default:
|
|
1878
|
-
if (!e)
|
|
1879
|
-
return null;
|
|
1839
|
+
if (!e) return null;
|
|
1880
1840
|
n = !t.shiftKey;
|
|
1881
1841
|
}
|
|
1882
1842
|
return t.stopPropagation(), t.preventDefault(), { isIndent: n };
|
|
1883
1843
|
}
|
|
1884
1844
|
onKeyDown(t) {
|
|
1885
1845
|
var n, r, o;
|
|
1886
|
-
if (!((n = this.block) != null && n.id))
|
|
1887
|
-
return;
|
|
1846
|
+
if (!((n = this.block) != null && n.id)) return;
|
|
1888
1847
|
const e = this.handlePropagationForKeyEvent(t);
|
|
1889
|
-
if (!e)
|
|
1890
|
-
return;
|
|
1848
|
+
if (!e) return;
|
|
1891
1849
|
const { isIndent: i } = e;
|
|
1892
1850
|
this.api.inlineToolbar.close();
|
|
1893
1851
|
const s = this.getGlobalSelectedBlocks();
|
|
1894
|
-
if (!this.config.multiblock || s.length < 2)
|
|
1895
|
-
return i ? this.indentBlock() : this.unIndentBlock(), void ((o = (r = this.block).dispatchChange) == null ? void 0 : o.call(r));
|
|
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));
|
|
1896
1853
|
this.config.tuneName && s.forEach(async (a) => {
|
|
1897
|
-
var
|
|
1854
|
+
var c, h, g, m;
|
|
1898
1855
|
const d = await a.save();
|
|
1899
|
-
if (!d || !("tunes" in d) || typeof d.tunes != "object" || !d.tunes)
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
const u = this.getWrapperBlockById(a.id);
|
|
1906
|
-
u instanceof HTMLElement && this.applyStylesToWrapper(u, l.indentLevel);
|
|
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
|
+
const p = this.getWrapperBlockById(a.id);
|
|
1861
|
+
p instanceof HTMLElement && this.applyStylesToWrapper(p, l.indentLevel);
|
|
1907
1862
|
});
|
|
1908
1863
|
}
|
|
1909
1864
|
handleIndentLeft() {
|
|
@@ -1923,9 +1878,8 @@ const Et = { orientation: !1 }, J = class x {
|
|
|
1923
1878
|
autoIndentBlock() {
|
|
1924
1879
|
var r, o;
|
|
1925
1880
|
const t = this.api.blocks.getBlockIndex(this.block.id), e = this.api.blocks.getBlockByIndex(t - 1);
|
|
1926
|
-
if (!e)
|
|
1927
|
-
|
|
1928
|
-
const i = (o = (r = e.holder) == null ? void 0 : r.querySelector(`[${x.DATA_WRAPPER_NAME}]`)) == null ? void 0 : o.getAttribute(x.DATA_INDENT_LEVEL), s = Number(i != null ? i : 0), n = Math.min(Math.max(s, this.minIndent), this.maxIndent);
|
|
1881
|
+
if (!e) return;
|
|
1882
|
+
const i = (o = (r = e.holder) == null ? void 0 : r.querySelector(`[${w.DATA_WRAPPER_NAME}]`)) == null ? void 0 : o.getAttribute(w.DATA_INDENT_LEVEL), s = Number(i != null ? i : 0), n = Math.min(Math.max(s, this.minIndent), this.maxIndent);
|
|
1929
1883
|
this.data.indentLevel = n, this.applyStylesToWrapper(this.wrapper, this.data.indentLevel);
|
|
1930
1884
|
}
|
|
1931
1885
|
toggleDisableStateForButtons() {
|
|
@@ -1944,29 +1898,27 @@ const Et = { orientation: !1 }, J = class x {
|
|
|
1944
1898
|
var e;
|
|
1945
1899
|
return (e = this.getTuneByName(t)) == null ? void 0 : e.querySelector(`.${this.CSS.popoverItemTitle}`);
|
|
1946
1900
|
}
|
|
1947
|
-
applyStylesToWrapper(t, e = parseInt(t.getAttribute(
|
|
1901
|
+
applyStylesToWrapper(t, e = parseInt(t.getAttribute(w.DATA_INDENT_LEVEL) || "0")) {
|
|
1948
1902
|
const i = e * this.config.indentSize;
|
|
1949
|
-
t.setAttribute(
|
|
1903
|
+
t.setAttribute(w.DATA_INDENT_LEVEL, e.toString());
|
|
1950
1904
|
const s = t.querySelector(`.${this.EditorCSS.content}`), n = this.getBlockForWrapper(t) || document.querySelector(`.${this.EditorCSS.redactor}`);
|
|
1951
|
-
if (!(s instanceof HTMLElement && n))
|
|
1952
|
-
return;
|
|
1905
|
+
if (!(s instanceof HTMLElement && n)) return;
|
|
1953
1906
|
const r = n.getBoundingClientRect().width;
|
|
1954
|
-
if (r === 0)
|
|
1955
|
-
return void queueMicrotask(() => this.applyStylesToWrapper.bind(this)(t, e));
|
|
1907
|
+
if (r === 0) return void queueMicrotask(() => this.applyStylesToWrapper.bind(this)(t, e));
|
|
1956
1908
|
const o = (r - this.maxWidthForContent(t)) / 2, a = Math.max(0, Math.min(o, i)), d = 2 * a + "px", l = `${a}px`;
|
|
1957
1909
|
this.isDirectionInverted ? (t.style.paddingLeft = "0px", t.style.paddingRight = d) : (t.style.paddingLeft = d, t.style.paddingRight = "0px");
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1910
|
+
const p = t.querySelector(`.${this.CSS.highlightIndent}`);
|
|
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%"));
|
|
1960
1912
|
}
|
|
1961
1913
|
onFocus(t) {
|
|
1962
|
-
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.setAttribute(
|
|
1914
|
+
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.setAttribute(w.DATA_FOCUSED, "");
|
|
1963
1915
|
}
|
|
1964
1916
|
onBlur(t) {
|
|
1965
|
-
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.removeAttribute(
|
|
1917
|
+
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.removeAttribute(w.DATA_FOCUSED);
|
|
1966
1918
|
}
|
|
1967
1919
|
onResize(t) {
|
|
1968
1920
|
this.lastResizeTimeout && clearTimeout(this.lastResizeTimeout), this.lastResizeTimeout = setTimeout(() => {
|
|
1969
|
-
document.querySelectorAll(`[${
|
|
1921
|
+
document.querySelectorAll(`[${w.DATA_WRAPPER_NAME}]`).forEach((e) => {
|
|
1970
1922
|
e instanceof HTMLElement && this.applyStylesToWrapper(e);
|
|
1971
1923
|
});
|
|
1972
1924
|
}, 500);
|
|
@@ -1976,14 +1928,13 @@ const Et = { orientation: !1 }, J = class x {
|
|
|
1976
1928
|
}
|
|
1977
1929
|
getWrapperBlockById(t) {
|
|
1978
1930
|
var i, s, n;
|
|
1979
|
-
const e = `.${this.EditorCSS.block}[data-id="${t}"] [${
|
|
1980
|
-
return (n = (s = document.querySelector(e)) != null ? s : (i = this.api.blocks.getById(t)) == null ? void 0 : i.holder.querySelector(`[${
|
|
1931
|
+
const e = `.${this.EditorCSS.block}[data-id="${t}"] [${w.DATA_WRAPPER_NAME}]`;
|
|
1932
|
+
return (n = (s = document.querySelector(e)) != null ? s : (i = this.api.blocks.getById(t)) == null ? void 0 : i.holder.querySelector(`[${w.DATA_WRAPPER_NAME}]`)) != null ? n : null;
|
|
1981
1933
|
}
|
|
1982
1934
|
getBlockForWrapper(t) {
|
|
1983
1935
|
let e = t;
|
|
1984
1936
|
for (; !e.classList.contains(this.EditorCSS.block); ) {
|
|
1985
|
-
if (!e.parentElement || e instanceof HTMLHtmlElement)
|
|
1986
|
-
return null;
|
|
1937
|
+
if (!e.parentElement || e instanceof HTMLHtmlElement) return null;
|
|
1987
1938
|
e = e.parentElement;
|
|
1988
1939
|
}
|
|
1989
1940
|
return e;
|
|
@@ -2001,23 +1952,22 @@ const Et = { orientation: !1 }, J = class x {
|
|
|
2001
1952
|
return new DOMParser().parseFromString(t, "text/html").body.firstChild;
|
|
2002
1953
|
}
|
|
2003
1954
|
changeConfigBasedOnVersionIfNeeded() {
|
|
2004
|
-
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);
|
|
2005
1956
|
}
|
|
2006
1957
|
maxWidthForContent(t) {
|
|
2007
1958
|
const e = t.querySelector(`.${this.EditorCSS.content}`);
|
|
2008
1959
|
if (e instanceof HTMLElement) {
|
|
2009
1960
|
const { maxWidth: i } = window.getComputedStyle(e);
|
|
2010
|
-
if (i)
|
|
2011
|
-
return this.cachedMaxWidthForContent = parseInt(i), this.cachedMaxWidthForContent;
|
|
1961
|
+
if (i) return this.cachedMaxWidthForContent = parseInt(i), this.cachedMaxWidthForContent;
|
|
2012
1962
|
}
|
|
2013
1963
|
return this.cachedMaxWidthForContent !== null || (this.cachedMaxWidthForContent = 650), this.cachedMaxWidthForContent;
|
|
2014
1964
|
}
|
|
2015
1965
|
};
|
|
2016
|
-
|
|
2017
|
-
let
|
|
2018
|
-
class
|
|
1966
|
+
w.DATA_WRAPPER_NAME = "data-block-indent-wrapper", w.DATA_FOCUSED = "data-focused", w.DATA_INDENT_LEVEL = "data-indent-level";
|
|
1967
|
+
let at = w;
|
|
1968
|
+
class $ {
|
|
2019
1969
|
static get toolboxIcon() {
|
|
2020
|
-
return
|
|
1970
|
+
return Lt;
|
|
2021
1971
|
}
|
|
2022
1972
|
static get CSS() {
|
|
2023
1973
|
return "cdx-marker";
|
|
@@ -2032,14 +1982,13 @@ class N {
|
|
|
2032
1982
|
return this.button = document.createElement("button"), this.button.setAttribute("type", "button"), this.button.classList.add(this.iconClasses.base), this.button.innerHTML = this.toolboxIcon, this.button;
|
|
2033
1983
|
}
|
|
2034
1984
|
surround(t) {
|
|
2035
|
-
if (!t)
|
|
2036
|
-
|
|
2037
|
-
let e = this.api.selection.findParentTag(this.tag, N.CSS);
|
|
1985
|
+
if (!t) return;
|
|
1986
|
+
let e = this.api.selection.findParentTag(this.tag, $.CSS);
|
|
2038
1987
|
e ? this.unwrap(e) : this.wrap(t);
|
|
2039
1988
|
}
|
|
2040
1989
|
wrap(t) {
|
|
2041
1990
|
let e = document.createElement(this.tag);
|
|
2042
|
-
e.classList.add(
|
|
1991
|
+
e.classList.add($.CSS), e.appendChild(t.extractContents()), t.insertNode(e), this.api.selection.expandToTag(e);
|
|
2043
1992
|
}
|
|
2044
1993
|
unwrap(t) {
|
|
2045
1994
|
var n;
|
|
@@ -2049,17 +1998,17 @@ class N {
|
|
|
2049
1998
|
}
|
|
2050
1999
|
checkState() {
|
|
2051
2000
|
var e;
|
|
2052
|
-
const t = this.api.selection.findParentTag(this.tag,
|
|
2001
|
+
const t = this.api.selection.findParentTag(this.tag, $.CSS);
|
|
2053
2002
|
(e = this.button) == null || e.classList.toggle(this.iconClasses.active, !!t);
|
|
2054
2003
|
}
|
|
2055
2004
|
get toolboxIcon() {
|
|
2056
|
-
return
|
|
2005
|
+
return Lt;
|
|
2057
2006
|
}
|
|
2058
2007
|
static get sanitize() {
|
|
2059
|
-
return { mark: { class:
|
|
2008
|
+
return { mark: { class: $.CSS } };
|
|
2060
2009
|
}
|
|
2061
2010
|
}
|
|
2062
|
-
class
|
|
2011
|
+
class ut {
|
|
2063
2012
|
constructor(t) {
|
|
2064
2013
|
this.tag = "SPAN", this.class = "cdx-text-color", this.defaultColor = "#2644FF", this.lastRange = null, this.colors = ["#182a4e", "#0055cc", "#1f6a83", "#206e4e", "#e56910", "#ae2e24", "#5e4db2", "#758195", "#1e7afd", "#2998bd", "#23a06b", "#fea363", "#c9372c", "#8270db"], this.columns = 7;
|
|
2065
2014
|
const { api: e, config: i } = t;
|
|
@@ -2081,8 +2030,7 @@ class Se {
|
|
|
2081
2030
|
this.lastRange = t;
|
|
2082
2031
|
}
|
|
2083
2032
|
wrapAndColor(t, e) {
|
|
2084
|
-
if (!t)
|
|
2085
|
-
return;
|
|
2033
|
+
if (!t) return;
|
|
2086
2034
|
const i = t.extractContents(), s = document.createElement(this.tag);
|
|
2087
2035
|
s.classList.add(this.class), s.appendChild(i), s.style.color = e, s.innerHTML = s.textContent || "", t.insertNode(s), this.api.selection.expandToTag(s);
|
|
2088
2036
|
}
|
|
@@ -2095,15 +2043,16 @@ class Se {
|
|
|
2095
2043
|
}, t.append(i);
|
|
2096
2044
|
}), t;
|
|
2097
2045
|
}
|
|
2098
|
-
static get
|
|
2099
|
-
return
|
|
2046
|
+
static get CSS() {
|
|
2047
|
+
return ut.CSS;
|
|
2100
2048
|
}
|
|
2101
|
-
}
|
|
2102
|
-
class ne extends Se {
|
|
2103
2049
|
static get sanitize() {
|
|
2050
|
+
return { span: { style: !0, class: !0 } };
|
|
2104
2051
|
}
|
|
2105
2052
|
}
|
|
2106
|
-
|
|
2053
|
+
class me extends ut {
|
|
2054
|
+
}
|
|
2055
|
+
const z = class z {
|
|
2107
2056
|
constructor(t) {
|
|
2108
2057
|
this.tag = "U", this.api = t.api, this.iconClasses = { base: this.api.styles.inlineToolButton, active: this.api.styles.inlineToolButtonActive };
|
|
2109
2058
|
}
|
|
@@ -2114,42 +2063,39 @@ const re = class V {
|
|
|
2114
2063
|
return this.button = document.createElement("button"), this.button.type = "button", this.button.classList.add(this.iconClasses.base), this.button.innerHTML = this.toolboxIcon, this.button;
|
|
2115
2064
|
}
|
|
2116
2065
|
surround(t) {
|
|
2117
|
-
if (!t)
|
|
2118
|
-
|
|
2119
|
-
const e = this.api.selection.findParentTag(this.tag, V.CSS);
|
|
2066
|
+
if (!t) return;
|
|
2067
|
+
const e = this.api.selection.findParentTag(this.tag, z.CSS);
|
|
2120
2068
|
e ? this.unwrap(e) : this.wrap(t);
|
|
2121
2069
|
}
|
|
2122
2070
|
wrap(t) {
|
|
2123
2071
|
const e = document.createElement(this.tag);
|
|
2124
|
-
e.classList.add(
|
|
2072
|
+
e.classList.add(z.CSS), e.appendChild(t.extractContents()), t.insertNode(e), this.api.selection.expandToTag(e);
|
|
2125
2073
|
}
|
|
2126
2074
|
unwrap(t) {
|
|
2127
2075
|
var n;
|
|
2128
2076
|
this.api.selection.expandToTag(t);
|
|
2129
2077
|
const e = window.getSelection();
|
|
2130
|
-
if (!e)
|
|
2131
|
-
return;
|
|
2078
|
+
if (!e) return;
|
|
2132
2079
|
const i = e.getRangeAt(0);
|
|
2133
|
-
if (!i)
|
|
2134
|
-
return;
|
|
2080
|
+
if (!i) return;
|
|
2135
2081
|
const s = i.extractContents();
|
|
2136
2082
|
s && ((n = t.parentNode) == null || n.removeChild(t), i.insertNode(s), e.removeAllRanges(), e.addRange(i));
|
|
2137
2083
|
}
|
|
2138
2084
|
checkState() {
|
|
2139
2085
|
var e;
|
|
2140
|
-
const t = this.api.selection.findParentTag(this.tag,
|
|
2086
|
+
const t = this.api.selection.findParentTag(this.tag, z.CSS);
|
|
2141
2087
|
return (e = this.button) == null || e.classList.toggle(this.iconClasses.active, !!t), !!t;
|
|
2142
2088
|
}
|
|
2143
2089
|
get toolboxIcon() {
|
|
2144
2090
|
return '<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 7.5V11.5C9 12.2956 9.31607 13.0587 9.87868 13.6213C10.4413 14.1839 11.2044 14.5 12 14.5C12.7956 14.5 13.5587 14.1839 14.1213 13.6213C14.6839 13.0587 15 12.2956 15 11.5V7.5"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7.71429 18H16.2857"/></svg>';
|
|
2145
2091
|
}
|
|
2146
2092
|
static get sanitize() {
|
|
2147
|
-
return { u: { class:
|
|
2093
|
+
return { u: { class: z.CSS } };
|
|
2148
2094
|
}
|
|
2149
2095
|
};
|
|
2150
|
-
|
|
2151
|
-
let
|
|
2152
|
-
class
|
|
2096
|
+
z.isInline = !0;
|
|
2097
|
+
let lt = z;
|
|
2098
|
+
class F {
|
|
2153
2099
|
constructor({ api: t }) {
|
|
2154
2100
|
this.tag = "CODE", this.api = t, this.button = null, this.iconClasses = { base: this.api.styles.inlineToolButton, active: this.api.styles.inlineToolButtonActive };
|
|
2155
2101
|
}
|
|
@@ -2164,57 +2110,54 @@ class W {
|
|
|
2164
2110
|
}
|
|
2165
2111
|
surround(t) {
|
|
2166
2112
|
var i;
|
|
2167
|
-
if (!t)
|
|
2168
|
-
|
|
2169
|
-
let e = this.api.selection.findParentTag(this.tag, W.CSS);
|
|
2113
|
+
if (!t) return;
|
|
2114
|
+
let e = this.api.selection.findParentTag(this.tag, F.CSS);
|
|
2170
2115
|
e ? this.unwrap(e) : (i = t.commonAncestorContainer.parentElement) != null && i.querySelector(this.tag) || this.wrap(t);
|
|
2171
2116
|
}
|
|
2172
2117
|
wrap(t) {
|
|
2173
2118
|
let e = document.createElement(this.tag);
|
|
2174
|
-
e.classList.add(
|
|
2119
|
+
e.classList.add(F.CSS), e.appendChild(t.extractContents()), t.insertNode(e), this.api.selection.expandToTag(e);
|
|
2175
2120
|
}
|
|
2176
2121
|
unwrap(t) {
|
|
2177
2122
|
var n;
|
|
2178
2123
|
this.api.selection.expandToTag(t);
|
|
2179
2124
|
const e = window.getSelection();
|
|
2180
|
-
if (!e)
|
|
2181
|
-
return;
|
|
2125
|
+
if (!e) return;
|
|
2182
2126
|
const i = e.getRangeAt(0), s = i.extractContents();
|
|
2183
2127
|
(n = t.parentNode) == null || n.removeChild(t), i.insertNode(s), e.removeAllRanges(), e.addRange(i);
|
|
2184
2128
|
}
|
|
2185
2129
|
checkState() {
|
|
2186
|
-
const t = this.api.selection.findParentTag(this.tag,
|
|
2130
|
+
const t = this.api.selection.findParentTag(this.tag, F.CSS);
|
|
2187
2131
|
return this.button && this.button.classList.toggle(this.iconClasses.active, !!t), !!t;
|
|
2188
2132
|
}
|
|
2189
2133
|
get toolboxIcon() {
|
|
2190
2134
|
return '<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 8L5 12L9 16"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 8L19 12L15 16"/></svg>';
|
|
2191
2135
|
}
|
|
2192
2136
|
static get sanitize() {
|
|
2193
|
-
return { code: { class:
|
|
2137
|
+
return { code: { class: F.CSS } };
|
|
2194
2138
|
}
|
|
2195
2139
|
}
|
|
2196
|
-
function
|
|
2197
|
-
const i = document.createElement(
|
|
2140
|
+
function x(u, t, e = {}) {
|
|
2141
|
+
const i = document.createElement(u);
|
|
2198
2142
|
Array.isArray(t) ? i.classList.add(...t) : t && i.classList.add(t);
|
|
2199
|
-
for (const s in e)
|
|
2200
|
-
Object.prototype.hasOwnProperty.call(e, s) && (i[s] = e[s]);
|
|
2143
|
+
for (const s in e) Object.prototype.hasOwnProperty.call(e, s) && (i[s] = e[s]);
|
|
2201
2144
|
return i;
|
|
2202
2145
|
}
|
|
2203
|
-
function
|
|
2204
|
-
const t =
|
|
2146
|
+
function Ht(u) {
|
|
2147
|
+
const t = u.getBoundingClientRect();
|
|
2205
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) };
|
|
2206
2149
|
}
|
|
2207
|
-
function
|
|
2208
|
-
const e =
|
|
2150
|
+
function it(u, t) {
|
|
2151
|
+
const e = Ht(u), i = Ht(t);
|
|
2209
2152
|
return { fromTopBorder: i.y1 - e.y1, fromLeftBorder: i.x1 - e.x1, fromRightBorder: e.x2 - i.x2, fromBottomBorder: e.y2 - i.y2 };
|
|
2210
2153
|
}
|
|
2211
|
-
function
|
|
2154
|
+
function It(u, t) {
|
|
2212
2155
|
var e;
|
|
2213
|
-
return (e = t == null ? void 0 : t.parentNode) == null ? void 0 : e.insertBefore(
|
|
2156
|
+
return (e = t == null ? void 0 : t.parentNode) == null ? void 0 : e.insertBefore(u, t);
|
|
2214
2157
|
}
|
|
2215
|
-
function
|
|
2158
|
+
function At(u, t = !0) {
|
|
2216
2159
|
const e = document.createRange(), i = window.getSelection();
|
|
2217
|
-
e.selectNodeContents(
|
|
2160
|
+
e.selectNodeContents(u), e.collapse(t), i == null || i.removeAllRanges(), i == null || i.addRange(e);
|
|
2218
2161
|
}
|
|
2219
2162
|
class y {
|
|
2220
2163
|
constructor({ items: t }) {
|
|
@@ -2224,9 +2167,9 @@ class y {
|
|
|
2224
2167
|
return { popover: "tc-popover", popoverOpened: "tc-popover--opened", item: "tc-popover__item", itemHidden: "tc-popover__item--hidden", itemConfirmState: "tc-popover__item--confirm", itemIcon: "tc-popover__item-icon", itemLabel: "tc-popover__item-label" };
|
|
2225
2168
|
}
|
|
2226
2169
|
render() {
|
|
2227
|
-
return this.wrapper =
|
|
2170
|
+
return this.wrapper = x("div", y.CSS.popover), this.items.forEach((t, e) => {
|
|
2228
2171
|
var r;
|
|
2229
|
-
const i =
|
|
2172
|
+
const i = x("div", y.CSS.item), s = x("div", y.CSS.itemIcon, { innerHTML: t.icon }), n = x("div", y.CSS.itemLabel, { textContent: t.label });
|
|
2230
2173
|
i.dataset.index = e + "", i.appendChild(s), i.appendChild(n), (r = this.wrapper) == null || r.appendChild(i), this.itemEls.push(i);
|
|
2231
2174
|
}), this.wrapper.addEventListener("click", (t) => {
|
|
2232
2175
|
this.popoverClicked(t);
|
|
@@ -2234,11 +2177,9 @@ class y {
|
|
|
2234
2177
|
}
|
|
2235
2178
|
popoverClicked(t) {
|
|
2236
2179
|
const e = t.target.closest(`.${y.CSS.item}`);
|
|
2237
|
-
if (!e)
|
|
2238
|
-
return;
|
|
2180
|
+
if (!e) return;
|
|
2239
2181
|
const i = e.dataset.index;
|
|
2240
|
-
if (!i)
|
|
2241
|
-
return;
|
|
2182
|
+
if (!i) return;
|
|
2242
2183
|
const s = this.items[parseInt(i)];
|
|
2243
2184
|
!s.confirmationRequired || this.hasConfirmationState(e) ? s.onClick() : this.setConfirmationState(e);
|
|
2244
2185
|
}
|
|
@@ -2268,7 +2209,7 @@ class y {
|
|
|
2268
2209
|
});
|
|
2269
2210
|
}
|
|
2270
2211
|
}
|
|
2271
|
-
class
|
|
2212
|
+
class A {
|
|
2272
2213
|
constructor({ items: t, onOpen: e, onClose: i, cssModifier: s = "" }) {
|
|
2273
2214
|
this.items = t, this.onOpen = e, this.onClose = i, this.cssModifier = s, this.popover = null, this.wrapper = this.createToolbox();
|
|
2274
2215
|
}
|
|
@@ -2279,13 +2220,13 @@ class O {
|
|
|
2279
2220
|
return this.wrapper;
|
|
2280
2221
|
}
|
|
2281
2222
|
createToolbox() {
|
|
2282
|
-
const t =
|
|
2223
|
+
const t = x("div", [A.CSS.toolbox, this.cssModifier ? `${A.CSS.toolbox}--${this.cssModifier}` : ""]);
|
|
2283
2224
|
t.dataset.mutationFree = "true";
|
|
2284
2225
|
const e = this.createPopover(), i = this.createToggler();
|
|
2285
2226
|
return t.appendChild(i), t.appendChild(e), t;
|
|
2286
2227
|
}
|
|
2287
2228
|
createToggler() {
|
|
2288
|
-
const t =
|
|
2229
|
+
const t = x("div", A.CSS.toggler, { 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-width="2.6" d="M9.41 9.66H9.4"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 9.66H14.59"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.31 14.36H9.3"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 14.36H14.59"/></svg>' });
|
|
2289
2230
|
return t.addEventListener("click", () => {
|
|
2290
2231
|
this.togglerClicked();
|
|
2291
2232
|
}), t;
|
|
@@ -2301,30 +2242,29 @@ class O {
|
|
|
2301
2242
|
const e = t();
|
|
2302
2243
|
Object.entries(e).forEach(([i, s]) => {
|
|
2303
2244
|
this.wrapper.style.setProperty(i, s);
|
|
2304
|
-
}), this.wrapper.classList.add(
|
|
2245
|
+
}), this.wrapper.classList.add(A.CSS.toolboxShowed);
|
|
2305
2246
|
}
|
|
2306
2247
|
hide() {
|
|
2307
2248
|
var t;
|
|
2308
|
-
(t = this.popover) == null || t.close(), this.wrapper.classList.remove(
|
|
2249
|
+
(t = this.popover) == null || t.close(), this.wrapper.classList.remove(A.CSS.toolboxShowed);
|
|
2309
2250
|
}
|
|
2310
2251
|
}
|
|
2311
|
-
const
|
|
2312
|
-
class
|
|
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
|
+
class Ce {
|
|
2313
2254
|
constructor(t, e, i, s) {
|
|
2314
2255
|
this.minCellWidhth = 50, this.defaultCellWidth = 100, this.handleDocumentMousedown = (n) => {
|
|
2315
2256
|
this.wrapper.contains(n.target) && n.target.classList.contains("cell-resizable") && (n.preventDefault(), this.isDragging = !0, this.table.classList.add("table-resizing"), document.addEventListener("mousemove", this.handleDocumentMousemove), document.addEventListener("mouseup", this.handleDocumentMouseup), this.draggingColumn = this.hoveredColumn, this.startWidth = this.colWidthArr[this.draggingColumn - 1], this.mouseStartX = n.clientX);
|
|
2316
2257
|
}, this.handleDocumentMousemove = (n) => {
|
|
2317
|
-
if (!this.isDragging)
|
|
2318
|
-
return;
|
|
2258
|
+
if (!this.isDragging) return;
|
|
2319
2259
|
const r = n.clientX - this.mouseStartX, o = Math.max(this.startWidth + r, this.minCellWidhth);
|
|
2320
2260
|
this.colWidthArr[this.draggingColumn - 1] = o, this.updateColWidth();
|
|
2321
2261
|
}, this.handleDocumentMouseup = () => {
|
|
2322
2262
|
this.updateToolboxesPosition(), this.isDragging = !1, this.table.classList.remove("table-resizing"), document.removeEventListener("mousemove", this.handleDocumentMousemove), document.removeEventListener("mouseup", this.handleDocumentMouseup);
|
|
2323
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) => {
|
|
2324
2264
|
let r = n.target;
|
|
2325
|
-
const o = r.closest(`.${
|
|
2265
|
+
const o = r.closest(`.${Rt}`) !== null, a = r.closest(`.${Bt}`) === null;
|
|
2326
2266
|
(o || a) && this.hideToolboxes();
|
|
2327
|
-
const d = r.closest(`.${
|
|
2267
|
+
const d = r.closest(`.${rt}`), l = r.closest(`.${ot}`);
|
|
2328
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());
|
|
2329
2269
|
}, this.readOnly || this.bindEvents();
|
|
2330
2270
|
}
|
|
@@ -2332,28 +2272,27 @@ class xe {
|
|
|
2332
2272
|
return this.wrapper;
|
|
2333
2273
|
}
|
|
2334
2274
|
bindEvents() {
|
|
2335
|
-
document.addEventListener("click", this.documentClicked), document.addEventListener("mousedown", (t) => this.handleDocumentMousedown(t)), this.table.addEventListener("mousemove", function(t, e) {
|
|
2275
|
+
document.addEventListener("click", this.documentClicked), document.addEventListener("mousedown", (t) => this.handleDocumentMousedown(t)), this.table.addEventListener("mousemove", /* @__PURE__ */ function(t, e) {
|
|
2336
2276
|
let i = 0;
|
|
2337
2277
|
return function(...s) {
|
|
2338
2278
|
const n = (/* @__PURE__ */ new Date()).getTime();
|
|
2339
|
-
if (!(n - i < t))
|
|
2340
|
-
return i = n, e(...s);
|
|
2279
|
+
if (!(n - i < t)) return i = n, e(...s);
|
|
2341
2280
|
};
|
|
2342
2281
|
}(150, (t) => this.onMouseMoveInTable(t)), { passive: !0 }), this.table.onkeypress = (t) => this.onKeyPressListener(t), this.table.addEventListener("keydown", (t) => this.onKeyDownListener(t)), this.table.addEventListener("focusin", (t) => this.focusInTableListener(t));
|
|
2343
2282
|
}
|
|
2344
2283
|
getCellInCol(t) {
|
|
2345
2284
|
const e = [];
|
|
2346
2285
|
return this.table.querySelectorAll(`.${R}`).forEach((i) => {
|
|
2347
|
-
const s = i.querySelector(`.${
|
|
2286
|
+
const s = i.querySelector(`.${O}:nth-child(${t})`);
|
|
2348
2287
|
s && e.push(s);
|
|
2349
2288
|
}), e;
|
|
2350
2289
|
}
|
|
2351
2290
|
createColumnToolbox() {
|
|
2352
|
-
return new
|
|
2291
|
+
return new A({ api: this.api, cssModifier: "column", items: [{ label: this.api.i18n.t("Add column to left"), 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.9167 14.9167L11.5833 18.25M11.5833 18.25L8.25 14.9167M11.5833 18.25L11.5833 10.0833C11.5833 9.19928 11.9345 8.35143 12.5596 7.72631C13.1848 7.10119 14.0326 6.75 14.9167 6.75"/></svg>', hideIf: () => this.numberOfColumns === this.config.maxcols, onClick: () => {
|
|
2353
2292
|
this.addColumn(this.selectedColumn, !0), this.hideToolboxes(), this.updateColWidth();
|
|
2354
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: () => {
|
|
2355
2294
|
this.addColumn(this.selectedColumn + 1, !0), this.hideToolboxes(), this.updateColWidth();
|
|
2356
|
-
} }, { 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: () => {
|
|
2357
2296
|
this.deleteColumn(this.selectedColumn), this.hideToolboxes(), this.updateColWidth();
|
|
2358
2297
|
} }], onOpen: () => {
|
|
2359
2298
|
this.selectColumn(this.hoveredColumn), this.hideRowToolbox();
|
|
@@ -2362,11 +2301,11 @@ class xe {
|
|
|
2362
2301
|
} });
|
|
2363
2302
|
}
|
|
2364
2303
|
createRowToolbox() {
|
|
2365
|
-
return new
|
|
2304
|
+
return new A({ api: this.api, cssModifier: "row", items: [{ label: this.api.i18n.t("Add row above"), 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 15.8333L18.2167 12.5M18.2167 12.5L14.8833 9.16667M18.2167 12.5L10.05 12.5C9.16595 12.5 8.31811 12.8512 7.69299 13.4763C7.06787 14.1014 6.71667 14.9493 6.71667 15.8333"/></svg>', hideIf: () => this.numberOfRows === this.config.maxrows, onClick: () => {
|
|
2366
2305
|
this.addRow(this.selectedRow, !0), this.hideToolboxes();
|
|
2367
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: () => {
|
|
2368
2307
|
this.addRow(this.selectedRow + 1, !0), this.hideToolboxes();
|
|
2369
|
-
} }, { 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: () => {
|
|
2370
2309
|
this.deleteRow(this.selectedRow), this.hideToolboxes();
|
|
2371
2310
|
} }], onOpen: () => {
|
|
2372
2311
|
this.selectRow(this.hoveredRow), this.hideColumnToolbox();
|
|
@@ -2378,7 +2317,7 @@ class xe {
|
|
|
2378
2317
|
this.focusedCell.row !== this.numberOfRows ? (this.focusedCell.row += 1, this.focusCell()) : (this.addRow(), this.focusedCell.row += 1, this.focusCell(), this.updateToolboxesPosition(0, 0));
|
|
2379
2318
|
}
|
|
2380
2319
|
getCell(t, e) {
|
|
2381
|
-
return this.table.querySelectorAll(`.${R}:nth-child(${t}) .${
|
|
2320
|
+
return this.table.querySelectorAll(`.${R}:nth-child(${t}) .${O}`)[e - 1];
|
|
2382
2321
|
}
|
|
2383
2322
|
getRow(t) {
|
|
2384
2323
|
return this.table.querySelector(`.${R}:nth-child(${t})`);
|
|
@@ -2387,7 +2326,7 @@ class xe {
|
|
|
2387
2326
|
return t.parentElement;
|
|
2388
2327
|
}
|
|
2389
2328
|
getRowFirstCell(t) {
|
|
2390
|
-
return t.querySelector(`.${
|
|
2329
|
+
return t.querySelector(`.${O}:first-child`);
|
|
2391
2330
|
}
|
|
2392
2331
|
setCellContent(t, e, i) {
|
|
2393
2332
|
this.getCell(t, e).innerHTML = i;
|
|
@@ -2395,48 +2334,45 @@ class xe {
|
|
|
2395
2334
|
addColumn(t = -1, e = !1) {
|
|
2396
2335
|
var n;
|
|
2397
2336
|
let i = this.numberOfColumns;
|
|
2398
|
-
if (this.config && this.config.maxcols && this.numberOfColumns >= this.config.maxcols)
|
|
2399
|
-
return;
|
|
2337
|
+
if (this.config && this.config.maxcols && this.numberOfColumns >= this.config.maxcols) return;
|
|
2400
2338
|
for (let r = 1; r <= this.numberOfRows; r++) {
|
|
2401
2339
|
let o;
|
|
2402
2340
|
const a = this.createCell();
|
|
2403
|
-
if (t > 0 && t <= i ? (o = this.getCell(r, t),
|
|
2341
|
+
if (t > 0 && t <= i ? (o = this.getCell(r, t), It(a, o)) : o = this.getRow(r).appendChild(a), r === 1) {
|
|
2404
2342
|
const d = this.getCell(r, t > 0 ? t : i + 1);
|
|
2405
|
-
d && e &&
|
|
2343
|
+
d && e && At(d);
|
|
2406
2344
|
}
|
|
2407
2345
|
}
|
|
2408
|
-
const s = this.wrapper.querySelector(`.${
|
|
2409
|
-
(n = this.config) != null && n.maxcols && this.numberOfColumns > this.config.maxcols - 1 && s && s.classList.add(
|
|
2346
|
+
const s = this.wrapper.querySelector(`.${ot}`);
|
|
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);
|
|
2410
2348
|
}
|
|
2411
2349
|
addRow(t = -1, e = !1) {
|
|
2412
|
-
let i, s =
|
|
2350
|
+
let i, s = x("div", R);
|
|
2413
2351
|
this.tunes.withHeadings && this.removeHeadingAttrFromFirstRow();
|
|
2414
2352
|
let n = this.numberOfColumns;
|
|
2415
|
-
if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows)
|
|
2416
|
-
|
|
2417
|
-
t > 0 && t <= this.numberOfRows ? i = _t(s, this.getRow(t)) : i = this.table.appendChild(s), this.fillRow(i, n), this.tunes.withHeadings && this.addHeadingAttrToFirstRow();
|
|
2353
|
+
if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows) return;
|
|
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();
|
|
2418
2355
|
const r = this.getRowFirstCell(i);
|
|
2419
|
-
r && e &&
|
|
2420
|
-
const o = this.wrapper.querySelector(`.${
|
|
2421
|
-
return this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && o && o.classList.add(
|
|
2356
|
+
r && e && At(r);
|
|
2357
|
+
const o = this.wrapper.querySelector(`.${rt}`);
|
|
2358
|
+
return this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && o && o.classList.add(zt), i;
|
|
2422
2359
|
}
|
|
2423
2360
|
deleteColumn(t) {
|
|
2424
2361
|
for (let i = 1; i <= this.numberOfRows; i++) {
|
|
2425
2362
|
const s = this.getCell(i, t);
|
|
2426
|
-
if (!s)
|
|
2427
|
-
return;
|
|
2363
|
+
if (!s) return;
|
|
2428
2364
|
s.remove();
|
|
2429
2365
|
}
|
|
2430
|
-
const e = this.wrapper.querySelector(`.${
|
|
2431
|
-
e && e.classList.remove(
|
|
2366
|
+
const e = this.wrapper.querySelector(`.${ot}`);
|
|
2367
|
+
e && e.classList.remove(Dt), this.colWidthArr.splice(t - 1, 1);
|
|
2432
2368
|
}
|
|
2433
2369
|
deleteRow(t) {
|
|
2434
2370
|
this.getRow(t).remove();
|
|
2435
|
-
const e = this.wrapper.querySelector(`.${
|
|
2436
|
-
e && e.classList.remove(
|
|
2371
|
+
const e = this.wrapper.querySelector(`.${rt}`);
|
|
2372
|
+
e && e.classList.remove(zt), this.addHeadingAttrToFirstRow();
|
|
2437
2373
|
}
|
|
2438
2374
|
createTableWrapper() {
|
|
2439
|
-
this.wrapper =
|
|
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);
|
|
2440
2376
|
}
|
|
2441
2377
|
computeInitialSize() {
|
|
2442
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;
|
|
@@ -2444,24 +2380,17 @@ class xe {
|
|
|
2444
2380
|
}
|
|
2445
2381
|
resize() {
|
|
2446
2382
|
const { rows: t, cols: e } = this.computeInitialSize();
|
|
2447
|
-
for (let i = 0; i < t; i++)
|
|
2448
|
-
|
|
2449
|
-
for (let i = 0; i < e; i++)
|
|
2450
|
-
this.addColumn();
|
|
2383
|
+
for (let i = 0; i < t; i++) this.addRow();
|
|
2384
|
+
for (let i = 0; i < e; i++) this.addColumn();
|
|
2451
2385
|
}
|
|
2452
2386
|
updateColWidth() {
|
|
2453
2387
|
let t = "";
|
|
2454
|
-
if (this.colWidthArr && this.colWidthArr.length > 0)
|
|
2455
|
-
for (let e = 0; e < this.colWidthArr.length; e++)
|
|
2456
|
-
t += " " + this.colWidthArr[e] + "px";
|
|
2388
|
+
if (this.colWidthArr && this.colWidthArr.length > 0) for (let e = 0; e < this.colWidthArr.length; e++) t += " " + this.colWidthArr[e] + "px";
|
|
2457
2389
|
t && this.wrapper.style.setProperty("--col-width", t);
|
|
2458
2390
|
}
|
|
2459
2391
|
fill() {
|
|
2460
2392
|
const t = this.data;
|
|
2461
|
-
if (t && t.content)
|
|
2462
|
-
for (let e = 0; e < t.content.length; e++)
|
|
2463
|
-
for (let i = 0; i < t.content[e].length; i++)
|
|
2464
|
-
this.setCellContent(e + 1, i + 1, t.content[e][i]);
|
|
2393
|
+
if (t && t.content) for (let e = 0; e < t.content.length; e++) for (let i = 0; i < t.content[e].length; i++) this.setCellContent(e + 1, i + 1, t.content[e][i]);
|
|
2465
2394
|
}
|
|
2466
2395
|
fillRow(t, e) {
|
|
2467
2396
|
for (let i = 1; i <= e; i++) {
|
|
@@ -2470,13 +2399,13 @@ class xe {
|
|
|
2470
2399
|
}
|
|
2471
2400
|
}
|
|
2472
2401
|
createCell() {
|
|
2473
|
-
return
|
|
2402
|
+
return x("div", O, { contentEditable: !this.readOnly });
|
|
2474
2403
|
}
|
|
2475
2404
|
get numberOfRows() {
|
|
2476
2405
|
return this.table.childElementCount;
|
|
2477
2406
|
}
|
|
2478
2407
|
get numberOfColumns() {
|
|
2479
|
-
return this.numberOfRows ? this.table.querySelectorAll(`.${R}:first-child .${
|
|
2408
|
+
return this.numberOfRows ? this.table.querySelectorAll(`.${R}:first-child .${O}`).length : 0;
|
|
2480
2409
|
}
|
|
2481
2410
|
get isColumnMenuShowing() {
|
|
2482
2411
|
return this.selectedColumn !== 0;
|
|
@@ -2493,8 +2422,7 @@ class xe {
|
|
|
2493
2422
|
}
|
|
2494
2423
|
onKeyPressListener(t) {
|
|
2495
2424
|
if (t.key === "Enter") {
|
|
2496
|
-
if (t.shiftKey)
|
|
2497
|
-
return !0;
|
|
2425
|
+
if (t.shiftKey) return !0;
|
|
2498
2426
|
this.moveCursorToNextRow();
|
|
2499
2427
|
}
|
|
2500
2428
|
return t.key !== "Enter";
|
|
@@ -2504,7 +2432,7 @@ class xe {
|
|
|
2504
2432
|
}
|
|
2505
2433
|
focusInTableListener(t) {
|
|
2506
2434
|
const e = t.target, i = this.getRowByCell(e);
|
|
2507
|
-
i && (this.focusedCell = { row: Array.from(this.table.querySelectorAll(`.${R}`)).indexOf(i) + 1, column: Array.from(i.querySelectorAll(`.${
|
|
2435
|
+
i && (this.focusedCell = { row: Array.from(this.table.querySelectorAll(`.${R}`)).indexOf(i) + 1, column: Array.from(i.querySelectorAll(`.${O}`)).indexOf(e) + 1 });
|
|
2508
2436
|
}
|
|
2509
2437
|
hideToolboxes() {
|
|
2510
2438
|
this.hideRowToolbox(), this.hideColumnToolbox(), this.updateToolboxesPosition();
|
|
@@ -2523,13 +2451,17 @@ class xe {
|
|
|
2523
2451
|
return this.getCell(t, e);
|
|
2524
2452
|
}
|
|
2525
2453
|
updateToolboxesPosition(t = this.hoveredRow, e = this.hoveredColumn) {
|
|
2526
|
-
this.isColumnMenuShowing || e > 0 && e <= this.numberOfColumns && this.toolboxColumn.show(() =>
|
|
2527
|
-
|
|
2454
|
+
this.isColumnMenuShowing || e > 0 && e <= this.numberOfColumns && this.toolboxColumn.show(() => {
|
|
2455
|
+
let i = 0;
|
|
2456
|
+
for (var s = 0; s < e - 1; s++) i += this.colWidthArr[s];
|
|
2457
|
+
return i += this.colWidthArr[e - 1] / 2, { left: `${i}px` };
|
|
2458
|
+
}), this.isRowMenuShowing || t > 0 && t <= this.numberOfRows && this.toolboxRow.show(() => {
|
|
2459
|
+
const i = this.getRow(t), { fromTopBorder: s } = it(this.table, i), { height: n } = i.getBoundingClientRect();
|
|
2528
2460
|
return { top: `${Math.ceil(s + n / 2)}px` };
|
|
2529
2461
|
});
|
|
2530
2462
|
}
|
|
2531
2463
|
setHeadingsSetting(t) {
|
|
2532
|
-
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());
|
|
2533
2465
|
}
|
|
2534
2466
|
addHeadingAttrToFirstRow() {
|
|
2535
2467
|
for (let t = 1; t <= this.numberOfColumns; t++) {
|
|
@@ -2545,60 +2477,56 @@ class xe {
|
|
|
2545
2477
|
}
|
|
2546
2478
|
selectRow(t) {
|
|
2547
2479
|
const e = this.getRow(t);
|
|
2548
|
-
e && (this.selectedRow = t, e.classList.add(
|
|
2480
|
+
e && (this.selectedRow = t, e.classList.add(st));
|
|
2549
2481
|
}
|
|
2550
2482
|
unselectRow() {
|
|
2551
|
-
if (this.selectedRow <= 0)
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
t && t.classList.remove(rt), this.selectedRow = 0;
|
|
2483
|
+
if (this.selectedRow <= 0) return;
|
|
2484
|
+
const t = this.table.querySelector(`.${st}`);
|
|
2485
|
+
t && t.classList.remove(st), this.selectedRow = 0;
|
|
2555
2486
|
}
|
|
2556
2487
|
selectColumn(t) {
|
|
2557
2488
|
for (let e = 1; e <= this.numberOfRows; e++) {
|
|
2558
2489
|
const i = this.getCell(e, t);
|
|
2559
|
-
i && i.classList.add(
|
|
2490
|
+
i && i.classList.add(nt);
|
|
2560
2491
|
}
|
|
2561
2492
|
this.selectedColumn = t;
|
|
2562
2493
|
}
|
|
2563
2494
|
unselectColumn() {
|
|
2564
|
-
if (this.selectedColumn <= 0)
|
|
2565
|
-
|
|
2566
|
-
let t = this.table.querySelectorAll(`.${ot}`);
|
|
2495
|
+
if (this.selectedColumn <= 0) return;
|
|
2496
|
+
let t = this.table.querySelectorAll(`.${nt}`);
|
|
2567
2497
|
Array.from(t).forEach((e) => {
|
|
2568
|
-
e.classList.remove(
|
|
2498
|
+
e.classList.remove(nt);
|
|
2569
2499
|
}), this.selectedColumn = 0;
|
|
2570
2500
|
}
|
|
2571
2501
|
getHoveredCell(t) {
|
|
2572
2502
|
let e = this.hoveredRow, i = this.hoveredColumn;
|
|
2573
|
-
const { width: s, height: n, x: r, y: o } = function(
|
|
2574
|
-
const g =
|
|
2575
|
-
return { width: m, height: f, x:
|
|
2503
|
+
const { width: s, height: n, x: r, y: o } = function(c, h) {
|
|
2504
|
+
const g = c.getBoundingClientRect(), { width: m, height: f, x: v, y: M } = g, { clientX: L, clientY: D } = h;
|
|
2505
|
+
return { width: m, height: f, x: L - v, y: D - M };
|
|
2576
2506
|
}(this.table, t);
|
|
2577
2507
|
if (r >= 0) {
|
|
2578
|
-
const
|
|
2579
|
-
i = this.binSearch(this.numberOfColumns, (g) => this.getCell(1, g),
|
|
2508
|
+
const c = ({ fromLeftBorder: g }) => r < g, h = ({ fromRightBorder: g }) => r > s - g;
|
|
2509
|
+
i = this.binSearch(this.numberOfColumns, (g) => this.getCell(1, g), c, h);
|
|
2580
2510
|
}
|
|
2581
2511
|
if (o >= 0) {
|
|
2582
|
-
const
|
|
2583
|
-
e = this.binSearch(this.numberOfRows, (g) => this.getCell(g, 1),
|
|
2512
|
+
const c = ({ fromTopBorder: g }) => o < g, h = ({ fromBottomBorder: g }) => o > n - g;
|
|
2513
|
+
e = this.binSearch(this.numberOfRows, (g) => this.getCell(g, 1), c, h);
|
|
2584
2514
|
}
|
|
2585
|
-
const a = e || this.hoveredRow, d = i || this.hoveredColumn, { deltaXCell: l, deltaYCell:
|
|
2586
|
-
return { row: a, column: d, deltaXCell: l, deltaYCell:
|
|
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 };
|
|
2587
2517
|
}
|
|
2588
2518
|
getMousePositionRelateToCell(t, e, i, s) {
|
|
2589
|
-
const n = this.getCell(t, e), { fromTopBorder: r, fromLeftBorder: o } =
|
|
2519
|
+
const n = this.getCell(t, e), { fromTopBorder: r, fromLeftBorder: o } = it(this.table, n);
|
|
2590
2520
|
return { deltaXCell: i - o, deltaYCell: s - r };
|
|
2591
2521
|
}
|
|
2592
2522
|
binSearch(t, e, i, s) {
|
|
2593
2523
|
let n, r = 0, o = t + 1, a = 0;
|
|
2594
2524
|
for (; r < o - 1 && a < 10; ) {
|
|
2595
2525
|
n = Math.ceil((r + o) / 2);
|
|
2596
|
-
const d = e(n), l =
|
|
2597
|
-
if (i(l))
|
|
2598
|
-
o = n;
|
|
2526
|
+
const d = e(n), l = it(this.table, d);
|
|
2527
|
+
if (i(l)) o = n;
|
|
2599
2528
|
else {
|
|
2600
|
-
if (!s(l))
|
|
2601
|
-
break;
|
|
2529
|
+
if (!s(l)) break;
|
|
2602
2530
|
r = n;
|
|
2603
2531
|
}
|
|
2604
2532
|
a++;
|
|
@@ -2608,7 +2536,7 @@ class xe {
|
|
|
2608
2536
|
getData() {
|
|
2609
2537
|
const t = [];
|
|
2610
2538
|
for (let e = 1; e <= this.numberOfRows; e++) {
|
|
2611
|
-
const i = this.table.querySelector(`.${R}:nth-child(${e})`), s = Array.from(i.querySelectorAll(`.${
|
|
2539
|
+
const i = this.table.querySelector(`.${R}:nth-child(${e})`), s = Array.from(i.querySelectorAll(`.${O}`));
|
|
2612
2540
|
s.every((n) => !n.textContent.trim()) || t.push(s.map((n) => n.innerHTML));
|
|
2613
2541
|
}
|
|
2614
2542
|
return t;
|
|
@@ -2617,7 +2545,7 @@ class xe {
|
|
|
2617
2545
|
document.removeEventListener("click", this.documentClicked);
|
|
2618
2546
|
}
|
|
2619
2547
|
}
|
|
2620
|
-
class
|
|
2548
|
+
class ve {
|
|
2621
2549
|
static get isReadOnlySupported() {
|
|
2622
2550
|
return !0;
|
|
2623
2551
|
}
|
|
@@ -2631,7 +2559,7 @@ class ae {
|
|
|
2631
2559
|
return { icon: '<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="M10 5V18.5"/><path stroke="currentColor" stroke-width="2" d="M5 10H19"/><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/></svg>', title: "Table" };
|
|
2632
2560
|
}
|
|
2633
2561
|
render() {
|
|
2634
|
-
return this.table = new
|
|
2562
|
+
return this.table = new Ce(this.readOnly, this.api, this.data, this.config), this.container = x("div", this.api.styles.block), this.container.appendChild(this.table.getWrapper()), this.table.setHeadingsSetting(this.data.withHeadings), this.container;
|
|
2635
2563
|
}
|
|
2636
2564
|
renderSettings() {
|
|
2637
2565
|
return [{ label: this.api.i18n.t("With headings"), icon: '<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="M5 10H19"/><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/></svg>', isActive: this.data.withHeadings, closeOnActivate: !0, toggle: !0, hint: { title: this.api.i18n.t("With headings") }, onActivate: () => {
|
|
@@ -2642,7 +2570,7 @@ class ae {
|
|
|
2642
2570
|
}
|
|
2643
2571
|
save() {
|
|
2644
2572
|
const t = this.table.getData();
|
|
2645
|
-
return { withHeadings: this.data.withHeadings, stretched: this.data.stretched, content: t };
|
|
2573
|
+
return { withHeadings: this.data.withHeadings, stretched: this.data.stretched, content: t, colWidth: this.table.colWidthArr };
|
|
2646
2574
|
}
|
|
2647
2575
|
destroy() {
|
|
2648
2576
|
this.table.destroy();
|
|
@@ -2661,17 +2589,16 @@ class ae {
|
|
|
2661
2589
|
}
|
|
2662
2590
|
}
|
|
2663
2591
|
}
|
|
2664
|
-
function
|
|
2665
|
-
const i = document.createElement(
|
|
2592
|
+
function W(u, t = null, e = {}) {
|
|
2593
|
+
const i = document.createElement(u);
|
|
2666
2594
|
Array.isArray(t) ? i.classList.add(...t) : t !== null && i.classList.add(t);
|
|
2667
|
-
for (const s in e)
|
|
2668
|
-
e.hasOwnProperty(s) && (i[s] = e[s]);
|
|
2595
|
+
for (const s in e) e.hasOwnProperty(s) && (i[s] = e[s]);
|
|
2669
2596
|
return i;
|
|
2670
2597
|
}
|
|
2671
|
-
var
|
|
2672
|
-
class
|
|
2598
|
+
var G = ((u) => (u.Empty = "empty", u.Uploading = "uploading", u.Filled = "filled", u))(G || {});
|
|
2599
|
+
class ke {
|
|
2673
2600
|
constructor({ api: t, config: e, onSelectFile: i, readOnly: s }) {
|
|
2674
|
-
this.api = t, this.config = e, this.onSelectFile = i, this.readOnly = s, this.nodes = { wrapper:
|
|
2601
|
+
this.api = t, this.config = e, this.onSelectFile = i, this.readOnly = s, this.nodes = { wrapper: W("div", [this.CSS.baseClass, this.CSS.wrapper]), imageContainer: W("div", [this.CSS.imageContainer]), fileButton: this.createFileButton(), imageEl: void 0, imagePreloader: W("div", this.CSS.imagePreloader), caption: W("div", [this.CSS.input, this.CSS.caption], { contentEditable: !this.readOnly }) }, this.nodes.caption.dataset.placeholder = this.config.captionPlaceholder, this.nodes.imageContainer.appendChild(this.nodes.imagePreloader), this.nodes.wrapper.appendChild(this.nodes.imageContainer), this.nodes.wrapper.appendChild(this.nodes.caption), this.nodes.wrapper.appendChild(this.nodes.fileButton);
|
|
2675
2602
|
}
|
|
2676
2603
|
applyTune(t, e) {
|
|
2677
2604
|
this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${t}`, e);
|
|
@@ -2688,7 +2615,7 @@ class Te {
|
|
|
2688
2615
|
fillImage(t) {
|
|
2689
2616
|
const e = /\.mp4$/.test(t) ? "VIDEO" : "IMG", i = { src: t };
|
|
2690
2617
|
let s = "load";
|
|
2691
|
-
e === "VIDEO" && (i.autoplay = !0, i.loop = !0, i.muted = !0, i.playsinline = !0, s = "loadeddata"), this.nodes.imageEl =
|
|
2618
|
+
e === "VIDEO" && (i.autoplay = !0, i.loop = !0, i.muted = !0, i.playsinline = !0, s = "loadeddata"), this.nodes.imageEl = W(e, this.CSS.imageEl, i), this.nodes.imageEl.addEventListener(s, () => {
|
|
2692
2619
|
this.toggleStatus("filled"), this.nodes.imagePreloader !== void 0 && (this.nodes.imagePreloader.style.backgroundImage = "");
|
|
2693
2620
|
}), this.nodes.imageContainer.appendChild(this.nodes.imageEl);
|
|
2694
2621
|
}
|
|
@@ -2696,24 +2623,23 @@ class Te {
|
|
|
2696
2623
|
this.nodes.caption !== void 0 && (this.nodes.caption.innerHTML = t);
|
|
2697
2624
|
}
|
|
2698
2625
|
toggleStatus(t) {
|
|
2699
|
-
for (const e in
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
}
|
|
2626
|
+
for (const e in G) if (Object.prototype.hasOwnProperty.call(G, e)) {
|
|
2627
|
+
const i = G[e];
|
|
2628
|
+
this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${i}`, i === t);
|
|
2629
|
+
}
|
|
2704
2630
|
}
|
|
2705
2631
|
get CSS() {
|
|
2706
2632
|
return { baseClass: this.api.styles.block, loading: this.api.styles.loader, input: this.api.styles.input, button: this.api.styles.button, wrapper: "image-tool", imageContainer: "image-tool__image", imagePreloader: "image-tool__image-preloader", imageEl: "image-tool__image-picture", caption: "image-tool__caption" };
|
|
2707
2633
|
}
|
|
2708
2634
|
createFileButton() {
|
|
2709
2635
|
var e;
|
|
2710
|
-
const t =
|
|
2711
|
-
return t.innerHTML = (e = this.config.buttonContent) != null ? e : `${
|
|
2636
|
+
const t = W("div", [this.CSS.button]);
|
|
2637
|
+
return t.innerHTML = (e = this.config.buttonContent) != null ? e : `${Pt} ${this.api.i18n.t("Select an Image")}`, t.addEventListener("click", () => {
|
|
2712
2638
|
this.onSelectFile();
|
|
2713
2639
|
}), t;
|
|
2714
2640
|
}
|
|
2715
2641
|
}
|
|
2716
|
-
class
|
|
2642
|
+
class we {
|
|
2717
2643
|
constructor({ config: t, onUpload: e, onError: i }) {
|
|
2718
2644
|
this.config = t, this.onUpload = e, this.onError = i;
|
|
2719
2645
|
}
|
|
@@ -2722,45 +2648,42 @@ class Ee {
|
|
|
2722
2648
|
let i = "", s = "";
|
|
2723
2649
|
const n = await function(m = {}) {
|
|
2724
2650
|
let f = !0;
|
|
2725
|
-
return new Promise((v,
|
|
2726
|
-
let
|
|
2727
|
-
|
|
2651
|
+
return new Promise((v, M) => {
|
|
2652
|
+
let L = document.createElement("INPUT");
|
|
2653
|
+
L.type = "file", m.multiple && L.setAttribute("multiple", "multiple"), m.accept && L.setAttribute("accept", m.accept), L.style.display = "none", document.body.appendChild(L), L.addEventListener("change", (D) => {
|
|
2728
2654
|
f = !1;
|
|
2729
|
-
const
|
|
2730
|
-
v(
|
|
2655
|
+
const U = D.target.files;
|
|
2656
|
+
v(U), document.body.removeChild(L);
|
|
2731
2657
|
}, !1), window.addEventListener("focus", () => {
|
|
2732
2658
|
setTimeout(() => {
|
|
2733
2659
|
f && v([]);
|
|
2734
2660
|
}, 1e3);
|
|
2735
|
-
}, { once: !0 }),
|
|
2661
|
+
}, { once: !0 }), L.click();
|
|
2736
2662
|
});
|
|
2737
2663
|
}({ accept: (g = this.config.types) != null ? g : "image/*" });
|
|
2738
|
-
if (!(n && n.length > 0))
|
|
2739
|
-
return void e();
|
|
2664
|
+
if (!(n && n.length > 0)) return void e();
|
|
2740
2665
|
(function(m) {
|
|
2741
2666
|
const f = new FileReader();
|
|
2742
2667
|
f.readAsDataURL(m), f.onload = (v) => {
|
|
2743
2668
|
t(v.target.result);
|
|
2744
2669
|
};
|
|
2745
2670
|
})(n[0]);
|
|
2746
|
-
const r = n[0], o = this.config.types.split(",");
|
|
2671
|
+
const r = n[0], o = this.config.types ? this.config.types.split(",") : [];
|
|
2747
2672
|
let a = r.name.lastIndexOf("."), d = r.name.slice(a);
|
|
2748
|
-
if (!o.includes(d.toLowerCase()))
|
|
2749
|
-
return void this.onError("文件类型不支持");
|
|
2673
|
+
if (!o.includes(d.toLowerCase())) return void this.onError("文件类型不支持");
|
|
2750
2674
|
let l = {};
|
|
2751
2675
|
if (this.config.userStore) {
|
|
2752
2676
|
const m = this.config.userStore.token, f = this.config.userStore.tokenName, v = this.config.userStore.tokenPrefix;
|
|
2753
2677
|
m && f && (l[f] = v + " " + m);
|
|
2754
2678
|
}
|
|
2755
2679
|
l["Content-Type"] = "application/json";
|
|
2756
|
-
const
|
|
2757
|
-
if (
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
m.status === 200 && (m = { success: 1, file: { url: i + s } }), this.onUpload(m);
|
|
2680
|
+
const p = K.create({ timeout: 18e5, headers: l }), c = await p.post(this.config.endpoints.byFile, { fileName: r.name, contentType: r.type });
|
|
2681
|
+
if (c.status !== 200) return void this.onError(c.statusText);
|
|
2682
|
+
const h = c.data;
|
|
2683
|
+
if (!h.success) return void this.onError(h.message);
|
|
2684
|
+
i = h.data.cdn, s = h.data.objectKey, K.create({ timeout: 18e5, headers: { "Content-Type": r.type } }).put(h.data.presignedUrl, r).then((m) => {
|
|
2685
|
+
let f = {};
|
|
2686
|
+
f = m.status === 200 ? { success: 1, file: { url: i + s } } : { success: 0, message: m.statusText }, this.onUpload(f);
|
|
2764
2687
|
}).catch((m) => {
|
|
2765
2688
|
this.onError(m);
|
|
2766
2689
|
});
|
|
@@ -2771,9 +2694,8 @@ class Ee {
|
|
|
2771
2694
|
const s = this.config.userStore.token, n = this.config.userStore.tokenName, r = this.config.userStore.tokenPrefix;
|
|
2772
2695
|
s && n && (i[n] = r + " " + s);
|
|
2773
2696
|
}
|
|
2774
|
-
e =
|
|
2775
|
-
if (s.status !== 200 || s.data.success === !1)
|
|
2776
|
-
return void this.onError(s.data.message);
|
|
2697
|
+
e = K.create({ timeout: 18e5, headers: i }).post(this.config.endpoints.byUrl, { url: t, accept: ".jpg,.jpeg,.gif,.png,.webp" }), e.then((s) => {
|
|
2698
|
+
if (s.status !== 200 || s.data.success === !1) return void this.onError(s.data.message);
|
|
2777
2699
|
let n = { success: 1, file: { url: s.data.data.cdn + s.data.data.objectKey } };
|
|
2778
2700
|
this.onUpload(n);
|
|
2779
2701
|
}).catch((s) => {
|
|
@@ -2781,35 +2703,33 @@ class Ee {
|
|
|
2781
2703
|
});
|
|
2782
2704
|
}
|
|
2783
2705
|
async uploadByFile(t, { onPreview: e }) {
|
|
2784
|
-
const i = this.config.types.split(",");
|
|
2706
|
+
const i = this.config.types ? this.config.types.split(",") : [];
|
|
2785
2707
|
let s = t.name.lastIndexOf("."), n = t.name.slice(s);
|
|
2786
|
-
if (!i.includes(n.toLowerCase()))
|
|
2787
|
-
return void this.onError("文件类型不支持");
|
|
2708
|
+
if (!i.includes(n.toLowerCase())) return void this.onError("文件类型不支持");
|
|
2788
2709
|
let r = {};
|
|
2789
2710
|
if (this.config.userStore) {
|
|
2790
|
-
const
|
|
2791
|
-
|
|
2711
|
+
const c = this.config.userStore.token, h = this.config.userStore.tokenName, g = this.config.userStore.tokenPrefix;
|
|
2712
|
+
c && h && (r[h] = g + " " + c);
|
|
2792
2713
|
}
|
|
2793
|
-
const o =
|
|
2714
|
+
const o = K.create({ timeout: 18e5, headers: r });
|
|
2794
2715
|
r["Content-Type"] = "application/json";
|
|
2795
2716
|
const a = await o.post(this.config.endpoints.byFile, { fileName: t.name, contentType: t.type });
|
|
2796
|
-
if (a.status !== 200)
|
|
2797
|
-
return void this.onError(a.statusText);
|
|
2717
|
+
if (a.status !== 200) return void this.onError(a.statusText);
|
|
2798
2718
|
const d = a.data;
|
|
2799
|
-
if (!d.success)
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
h.status === 200
|
|
2804
|
-
}).catch((
|
|
2805
|
-
this.onError(
|
|
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
|
+
let h = {};
|
|
2723
|
+
h = c.status === 200 ? { success: 1, file: { url: l + p } } : { success: 0, message: c.statusText }, this.onUpload(h);
|
|
2724
|
+
}).catch((c) => {
|
|
2725
|
+
this.onError(c);
|
|
2806
2726
|
});
|
|
2807
2727
|
}
|
|
2808
2728
|
}
|
|
2809
|
-
class
|
|
2729
|
+
class Z {
|
|
2810
2730
|
constructor({ data: t, config: e, api: i, readOnly: s, block: n }) {
|
|
2811
2731
|
var r;
|
|
2812
|
-
this.isCaptionEnabled = null, this.api = i, this.block = n, this.
|
|
2732
|
+
this.isCaptionEnabled = null, this.api = i, this.block = n, this.config = { endpoints: e.endpoints, additionalRequestData: e.additionalRequestData, additionalRequestHeaders: e.additionalRequestHeaders, field: e.field, types: e.types, captionPlaceholder: this.api.i18n.t((r = e.captionPlaceholder) != null ? r : "Caption"), buttonContent: e.buttonContent, uploader: e.uploader, actions: e.actions, features: e.features || {}, userStore: e.userStore }, this.uploader = new we({ config: this.config, onUpload: (o) => this.onUpload(o), onError: (o) => this.uploadingFailed(o) }), this.ui = new ke({ api: i, config: this.config, onSelectFile: () => {
|
|
2813
2733
|
this.uploader.uploadSelectedFile({ onPreview: (o) => {
|
|
2814
2734
|
this.ui.showPreloader(o);
|
|
2815
2735
|
}, noSelectedFile: () => {
|
|
@@ -2827,7 +2747,7 @@ class Y {
|
|
|
2827
2747
|
return !0;
|
|
2828
2748
|
}
|
|
2829
2749
|
static get toolbox() {
|
|
2830
|
-
return { icon:
|
|
2750
|
+
return { icon: Pt, title: "Image" };
|
|
2831
2751
|
}
|
|
2832
2752
|
static get tunes() {
|
|
2833
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 }];
|
|
@@ -2845,8 +2765,8 @@ class Y {
|
|
|
2845
2765
|
}
|
|
2846
2766
|
renderSettings() {
|
|
2847
2767
|
var n;
|
|
2848
|
-
const t =
|
|
2849
|
-
((n = this.config.features) == null ? void 0 : n.caption) === "optional" && t.push({ name: "caption", icon:
|
|
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: Wt, title: "With caption", toggle: !0 });
|
|
2850
2770
|
const i = t.filter((r) => {
|
|
2851
2771
|
var a, d;
|
|
2852
2772
|
const o = Object.keys(e).find((l) => e[l] === r.name);
|
|
@@ -2857,8 +2777,7 @@ class Y {
|
|
|
2857
2777
|
return r.name === "caption" && (o = (a = this.isCaptionEnabled) != null ? a : o), o;
|
|
2858
2778
|
};
|
|
2859
2779
|
return i.map((r) => ({ icon: r.icon, label: this.api.i18n.t(r.title), name: r.name, toggle: r.toggle, isActive: s(r), onActivate: () => {
|
|
2860
|
-
if (typeof r.action == "function")
|
|
2861
|
-
return void r.action(r.name);
|
|
2780
|
+
if (typeof r.action == "function") return void r.action(r.name);
|
|
2862
2781
|
let o = !s(r);
|
|
2863
2782
|
r.name === "caption" && (this.isCaptionEnabled = !this.isCaptionEnabled, o = this.isCaptionEnabled), this.tuneToggled(r.name, o);
|
|
2864
2783
|
} }));
|
|
@@ -2890,7 +2809,7 @@ class Y {
|
|
|
2890
2809
|
}
|
|
2891
2810
|
set data(t) {
|
|
2892
2811
|
var e;
|
|
2893
|
-
this.image = t.file, this._data.caption = t.caption || "", this.ui.fillCaption(this._data.caption),
|
|
2812
|
+
this.image = t.file, this._data.caption = t.caption || "", this.ui.fillCaption(this._data.caption), Z.tunes.forEach(({ name: i }) => {
|
|
2894
2813
|
const s = t[i] !== void 0 && (t[i] === !0 || t[i] === "true");
|
|
2895
2814
|
this.setTune(i, s);
|
|
2896
2815
|
}), (t.caption || ((e = this.config.features) == null ? void 0 : e.caption) === !0) && this.setTune("caption", !0);
|
|
@@ -2926,19 +2845,19 @@ class Y {
|
|
|
2926
2845
|
this.ui.showPreloader(t), this.uploader.uploadByUrl(t);
|
|
2927
2846
|
}
|
|
2928
2847
|
}
|
|
2929
|
-
class
|
|
2848
|
+
class be {
|
|
2930
2849
|
constructor({ api: t, data: e, config: i, block: s }) {
|
|
2931
|
-
var n, r, o, a, d, l,
|
|
2932
|
-
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: (
|
|
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: "" };
|
|
2933
2852
|
}
|
|
2934
2853
|
static get isTune() {
|
|
2935
2854
|
return !0;
|
|
2936
2855
|
}
|
|
2937
2856
|
static get sanitize() {
|
|
2938
|
-
return { floatLeft: {}, floatRight: {}, center: {}, sizeSmall: {}, sizeMiddle: {}, sizeLarge: {}, resize: {}, resizeSize: {}
|
|
2857
|
+
return { floatLeft: {}, floatRight: {}, center: {}, sizeSmall: {}, sizeMiddle: {}, sizeLarge: {}, resize: {}, resizeSize: {} };
|
|
2939
2858
|
}
|
|
2940
2859
|
get CSS() {
|
|
2941
|
-
return { wrapper: "cdx-image-tool-tune", button: this.styles.settingsButton, buttonActive: this.styles.settingsButtonActive, buttonModifier: this.styles.settingsButtonModifier || "", buttonModifierActive: this.styles.settingsButtonModifierActive || "", isFloatLeft: "cdx-image-tool-tune--floatLeft", isFloatRight: "cdx-image-tool-tune--floatRight", isCenter: "cdx-image-tool-tune--center", isSizeSmall: "cdx-image-tool-tune--sizeSmall", isSizeMiddle: "cdx-image-tool-tune--sizeMiddle", isSizeLarge: "cdx-image-tool-tune--sizeLarge", isResize: "cdx-image-tool-tune--resize"
|
|
2860
|
+
return { wrapper: "cdx-image-tool-tune", button: this.styles.settingsButton, buttonActive: this.styles.settingsButtonActive, buttonModifier: this.styles.settingsButtonModifier || "", buttonModifierActive: this.styles.settingsButtonModifierActive || "", isFloatLeft: "cdx-image-tool-tune--floatLeft", isFloatRight: "cdx-image-tool-tune--floatRight", isCenter: "cdx-image-tool-tune--center", isSizeSmall: "cdx-image-tool-tune--sizeSmall", isSizeMiddle: "cdx-image-tool-tune--sizeMiddle", isSizeLarge: "cdx-image-tool-tune--sizeLarge", isResize: "cdx-image-tool-tune--resize" };
|
|
2942
2861
|
}
|
|
2943
2862
|
get view() {
|
|
2944
2863
|
return this.wrapper || (this.wrapper = this.createView()), this.wrapper;
|
|
@@ -2964,93 +2883,29 @@ class le {
|
|
|
2964
2883
|
this.data.center = !this.data.center, this.data.floatLeft = !1, this.data.floatRight = !1;
|
|
2965
2884
|
break;
|
|
2966
2885
|
case "sizeSmall":
|
|
2967
|
-
this.data.sizeSmall = !this.data.sizeSmall, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !1
|
|
2886
|
+
this.data.sizeSmall = !this.data.sizeSmall, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !1;
|
|
2968
2887
|
break;
|
|
2969
2888
|
case "sizeMiddle":
|
|
2970
|
-
this.data.sizeSmall = !1, this.data.sizeMiddle = !this.data.sizeMiddle, this.data.sizeLarge = !1, this.data.resize = !1
|
|
2889
|
+
this.data.sizeSmall = !1, this.data.sizeMiddle = !this.data.sizeMiddle, this.data.sizeLarge = !1, this.data.resize = !1;
|
|
2971
2890
|
break;
|
|
2972
2891
|
case "sizeLarge":
|
|
2973
|
-
this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !this.data.sizeLarge, this.data.resize = !1
|
|
2892
|
+
this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !this.data.sizeLarge, this.data.resize = !1;
|
|
2974
2893
|
break;
|
|
2975
2894
|
case "resize":
|
|
2976
|
-
this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !this.data.resize
|
|
2977
|
-
break;
|
|
2978
|
-
case "crop":
|
|
2979
|
-
this.data.crop = !this.data.crop, this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !1, this.data.resizeSize = 0;
|
|
2895
|
+
this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !this.data.resize;
|
|
2980
2896
|
break;
|
|
2981
2897
|
default:
|
|
2982
|
-
this.data.floatLeft = !1, this.data.floatRight = !1, this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !1
|
|
2898
|
+
this.data.floatLeft = !1, this.data.floatRight = !1, this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !1;
|
|
2983
2899
|
}
|
|
2984
|
-
this.data.resize || (this.data.resizeSize = 0)
|
|
2900
|
+
this.data.resize || (this.data.resizeSize = 0);
|
|
2985
2901
|
const e = this.block.holder.querySelector(".ce-block__content");
|
|
2986
2902
|
this.apply(e), this.block.dispatchChange();
|
|
2987
2903
|
}
|
|
2988
2904
|
apply(t) {
|
|
2989
|
-
this.data.floatLeft ? t.classList.add(this.CSS.isFloatLeft) : t.classList.remove(this.CSS.isFloatLeft), this.data.floatRight ? t.classList.add(this.CSS.isFloatRight) : t.classList.remove(this.CSS.isFloatRight), this.data.center ? t.classList.add(this.CSS.isCenter) : t.classList.remove(this.CSS.isCenter), this.data.sizeSmall ? t.classList.add(this.CSS.isSizeSmall) : t.classList.remove(this.CSS.isSizeSmall), this.data.sizeMiddle ? t.classList.add(this.CSS.isSizeMiddle) : t.classList.remove(this.CSS.isSizeMiddle), this.data.sizeLarge ? t.classList.add(this.CSS.isSizeLarge) : t.classList.remove(this.CSS.isSizeLarge), this.data.resize ? (t.classList.add(this.CSS.isResize), this.data.resizeSize > 0 && (t.getElementsByClassName("cdx-block")[0].style.width = this.data.resizeSize + "px"), this.resize(t)) : (t.classList.remove(this.CSS.isResize), this.unresize(t))
|
|
2990
|
-
}
|
|
2991
|
-
crop(t) {
|
|
2992
|
-
if (this.api.readOnly.isEnabled)
|
|
2993
|
-
return;
|
|
2994
|
-
const e = t.getElementsByClassName("image-tool__image")[0], i = document.createElement("div");
|
|
2995
|
-
i.classList.add("crop-btn", "btn-crop-action"), i.innerHTML = this.api.i18n.t("Crop"), i.addEventListener("click", () => {
|
|
2996
|
-
e.removeChild(i), this.appendCrop(t);
|
|
2997
|
-
}), e.appendChild(i);
|
|
2998
|
-
}
|
|
2999
|
-
appendCrop(t) {
|
|
3000
|
-
if (this.api.readOnly.isEnabled)
|
|
3001
|
-
return;
|
|
3002
|
-
this.uncrop(t);
|
|
3003
|
-
const e = t.getElementsByClassName("cdx-block")[0], i = e.getElementsByTagName("img")[0];
|
|
3004
|
-
e.classList.add("isCropping"), this.data.cropperInterface = new Cropper(i);
|
|
3005
|
-
const s = document.createElement("div");
|
|
3006
|
-
s.classList.add("crop-save", "btn-crop-action"), s.innerHTML = this.api.i18n.t("Apply"), s.addEventListener("click", () => {
|
|
3007
|
-
this.data.cropperInterface && (this.data.cropperFrameHeight = this.data.cropperInterface.getCropBoxData().height, this.data.cropperFrameWidth = this.data.cropperInterface.getCropBoxData().width, this.data.cropperFrameLeft = this.data.cropperInterface.getCanvasData().left - this.data.cropperInterface.getCropBoxData().left, this.data.cropperFrameTop = this.data.cropperInterface.getCanvasData().top - this.data.cropperInterface.getCropBoxData().top, this.data.cropperImageHeight = this.data.cropperInterface.getImageData().height, this.data.cropperImageWidth = this.data.cropperInterface.getImageData().width), this.applyCrop(t);
|
|
3008
|
-
}), t.getElementsByClassName("image-tool__image")[0].appendChild(s), t.classList.add("isCropping");
|
|
3009
|
-
}
|
|
3010
|
-
applyCrop(t) {
|
|
3011
|
-
const e = t.getElementsByClassName("cdx-block")[0];
|
|
3012
|
-
if (e) {
|
|
3013
|
-
e.style.minWidth = this.data.cropperFrameWidth + "px", e.style.maxWidth = this.data.cropperFrameWidth + "px";
|
|
3014
|
-
const n = e.getElementsByTagName("img")[0];
|
|
3015
|
-
n.style.width = this.data.cropperImageWidth + "px", n.style.height = this.data.cropperImageHeight + "px";
|
|
3016
|
-
const r = t.getElementsByClassName("image-tool__image")[0];
|
|
3017
|
-
r.style.width = this.data.cropperFrameWidth + "px", r.style.height = this.data.cropperFrameHeight + "px";
|
|
3018
|
-
const o = r.getElementsByTagName("img")[0];
|
|
3019
|
-
o && (o.style.left = this.data.cropperFrameLeft + "px", o.style.top = this.data.cropperFrameTop + "px", o.classList.add("isCropped")), e.classList.remove("isCropping");
|
|
3020
|
-
const a = t.getElementsByClassName("btn-crop-action")[0];
|
|
3021
|
-
a && r.removeChild(a);
|
|
3022
|
-
}
|
|
3023
|
-
if (this.data.cropperInterface && (this.data.cropperInterface.destroy(), this.data.cropperInterface = void 0), this.api.readOnly.isEnabled)
|
|
3024
|
-
return;
|
|
3025
|
-
const i = document.createElement("div");
|
|
3026
|
-
i.classList.add("crop-btn", "btn-crop-action"), i.innerHTML = this.api.i18n.t("Crop");
|
|
3027
|
-
const s = t.getElementsByClassName("image-tool__image")[0];
|
|
3028
|
-
s && (i.addEventListener("click", () => {
|
|
3029
|
-
s.removeChild(i), this.appendCrop(t);
|
|
3030
|
-
}), s.appendChild(i)), t.classList.remove("isCropping"), this.block.dispatchChange();
|
|
3031
|
-
}
|
|
3032
|
-
uncrop(t) {
|
|
3033
|
-
if (this.api.readOnly.isEnabled)
|
|
3034
|
-
return;
|
|
3035
|
-
const e = t.getElementsByClassName("image-tool__image")[0], i = t.getElementsByClassName("btn-crop-action")[0];
|
|
3036
|
-
i && e && e.removeChild(i);
|
|
3037
|
-
const s = t.getElementsByClassName("btn-crop-action")[0];
|
|
3038
|
-
s && e && e.removeChild(s);
|
|
3039
|
-
const n = t.getElementsByClassName("cdx-block")[0];
|
|
3040
|
-
if (n) {
|
|
3041
|
-
const r = n.getElementsByTagName("img")[0];
|
|
3042
|
-
r && r.classList.remove("isCropped"), n.classList.remove("isCropping"), n.style.minWidth = "", n.style.maxWidth = "";
|
|
3043
|
-
}
|
|
3044
|
-
if (e) {
|
|
3045
|
-
e.style.width = "", e.style.height = "";
|
|
3046
|
-
const r = e.getElementsByTagName("img")[0];
|
|
3047
|
-
r && (r.style.left = "", r.style.top = "", r.style.width = "", r.style.height = "");
|
|
3048
|
-
}
|
|
3049
|
-
t.classList.remove("isCropping"), this.data.cropperInterface && (this.data.cropperInterface.destroy(), this.data.cropperInterface = void 0), this.data.cropperFrameHeight = 0, this.data.cropperFrameWidth = 0, this.data.cropperFrameLeft = 0, this.data.cropperFrameTop = 0, this.data.cropperImageHeight = 0, this.data.cropperImageWidth = 0;
|
|
2905
|
+
this.data.floatLeft ? t.classList.add(this.CSS.isFloatLeft) : t.classList.remove(this.CSS.isFloatLeft), this.data.floatRight ? t.classList.add(this.CSS.isFloatRight) : t.classList.remove(this.CSS.isFloatRight), this.data.center ? t.classList.add(this.CSS.isCenter) : t.classList.remove(this.CSS.isCenter), this.data.sizeSmall ? t.classList.add(this.CSS.isSizeSmall) : t.classList.remove(this.CSS.isSizeSmall), this.data.sizeMiddle ? t.classList.add(this.CSS.isSizeMiddle) : t.classList.remove(this.CSS.isSizeMiddle), this.data.sizeLarge ? t.classList.add(this.CSS.isSizeLarge) : t.classList.remove(this.CSS.isSizeLarge), this.data.resize ? (t.classList.add(this.CSS.isResize), this.data.resizeSize > 0 && (t.getElementsByClassName("cdx-block")[0].style.width = this.data.resizeSize + "px"), this.resize(t)) : (t.classList.remove(this.CSS.isResize), this.unresize(t));
|
|
3050
2906
|
}
|
|
3051
2907
|
resize(t) {
|
|
3052
|
-
if (this.api.readOnly.isEnabled)
|
|
3053
|
-
return;
|
|
2908
|
+
if (this.api.readOnly.isEnabled) return;
|
|
3054
2909
|
const e = document.createElement("div");
|
|
3055
2910
|
e.classList.add("resizable");
|
|
3056
2911
|
const i = document.createElement("div");
|
|
@@ -3077,8 +2932,8 @@ class le {
|
|
|
3077
2932
|
let n = 0, r = 0;
|
|
3078
2933
|
const o = (d) => {
|
|
3079
2934
|
const l = d.clientX - n;
|
|
3080
|
-
let
|
|
3081
|
-
e === "right" && (
|
|
2935
|
+
let p = r;
|
|
2936
|
+
e === "right" && (p += l), e === "left" && (p -= l), p > 50 && p < s && (t.style.width = p + "px");
|
|
3082
2937
|
}, a = () => {
|
|
3083
2938
|
const d = parseInt(window.getComputedStyle(t).width, 10);
|
|
3084
2939
|
d > 0 && (this.data.resizeSize = d), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", a), this.block.dispatchChange();
|
|
@@ -3092,13 +2947,13 @@ class le {
|
|
|
3092
2947
|
unwrap(t) {
|
|
3093
2948
|
this.buttons.forEach((n) => {
|
|
3094
2949
|
n.classList.remove(this.CSS.buttonActive);
|
|
3095
|
-
}), t.classList.remove(this.CSS.isFloatLeft), t.classList.remove(this.CSS.isFloatRight), t.classList.remove(this.CSS.isCenter), t.classList.remove(this.CSS.isSizeSmall), t.classList.remove(this.CSS.isSizeMiddle), t.classList.remove(this.CSS.isSizeLarge), t.classList.remove(this.CSS.isResize)
|
|
2950
|
+
}), t.classList.remove(this.CSS.isFloatLeft), t.classList.remove(this.CSS.isFloatRight), t.classList.remove(this.CSS.isCenter), t.classList.remove(this.CSS.isSizeSmall), t.classList.remove(this.CSS.isSizeMiddle), t.classList.remove(this.CSS.isSizeLarge), t.classList.remove(this.CSS.isResize);
|
|
3096
2951
|
const e = t.getElementsByClassName("cdx-block")[0];
|
|
3097
|
-
e.
|
|
2952
|
+
e.style.minWidth = "", e.style.maxWidth = "";
|
|
3098
2953
|
const i = t.getElementsByClassName("image-tool__image")[0];
|
|
3099
2954
|
i.style.width = "", i.style.height = "";
|
|
3100
2955
|
const s = i.getElementsByTagName("img")[0];
|
|
3101
|
-
return s.style.left = "", s.style.top = "", s.style.width = "", s.style.height = "", this.unresize(t),
|
|
2956
|
+
return s.style.left = "", s.style.top = "", s.style.width = "", s.style.height = "", this.unresize(t), t;
|
|
3102
2957
|
}
|
|
3103
2958
|
save() {
|
|
3104
2959
|
return this.data;
|
|
@@ -3107,7 +2962,7 @@ class le {
|
|
|
3107
2962
|
return this.wrapper || (this.wrapper = this.createView()), this.apply(t), t;
|
|
3108
2963
|
}
|
|
3109
2964
|
tuneNameToI18nKey(t) {
|
|
3110
|
-
return {
|
|
2965
|
+
return { resize: "Resize" }[t];
|
|
3111
2966
|
}
|
|
3112
2967
|
createView() {
|
|
3113
2968
|
this.buttons = this.settings.map((e) => {
|
|
@@ -3135,9 +2990,9 @@ class le {
|
|
|
3135
2990
|
this.setTune(t);
|
|
3136
2991
|
}
|
|
3137
2992
|
}
|
|
3138
|
-
class
|
|
2993
|
+
class ye {
|
|
3139
2994
|
constructor(t, e) {
|
|
3140
|
-
this.
|
|
2995
|
+
this.holder = document.getElementById(t);
|
|
3141
2996
|
}
|
|
3142
2997
|
render(t) {
|
|
3143
2998
|
var i;
|
|
@@ -3167,83 +3022,50 @@ class de {
|
|
|
3167
3022
|
}), e;
|
|
3168
3023
|
}
|
|
3169
3024
|
}
|
|
3170
|
-
const
|
|
3171
|
-
const i =
|
|
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");
|
|
3172
3027
|
let s = e;
|
|
3173
|
-
const n =
|
|
3174
|
-
let r =
|
|
3175
|
-
const
|
|
3176
|
-
return
|
|
3177
|
-
a = new
|
|
3178
|
-
s("onChange",
|
|
3028
|
+
const n = u;
|
|
3029
|
+
let r = J(n.data), o = !1, a = null, d = null, l = null;
|
|
3030
|
+
const p = ["indent", "blockAlignment"];
|
|
3031
|
+
return qt(() => {
|
|
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);
|
|
3179
3034
|
}, onReady: () => {
|
|
3180
|
-
o = !0, new
|
|
3181
|
-
} }), r =
|
|
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");
|
|
3182
3037
|
} });
|
|
3183
|
-
}),
|
|
3038
|
+
}), Vt(() => {
|
|
3184
3039
|
a !== null && (a.destroy(), a = null);
|
|
3185
|
-
}),
|
|
3186
|
-
r =
|
|
3040
|
+
}), Kt(() => n.data, (c, h) => {
|
|
3041
|
+
r = J(c), a != null && o && a.render(r).then(() => {
|
|
3187
3042
|
l != null && n.showOutline && l.render(r);
|
|
3188
3043
|
}), d != null && (d.clear(), d.initialize(r));
|
|
3189
3044
|
}, { deep: !0 }), t({ validate: function() {
|
|
3190
|
-
return new Promise((
|
|
3191
|
-
if (a === null)
|
|
3192
|
-
|
|
3193
|
-
a.save().then((g) => g.blocks.length > 0 ? h(!0) : h(!1));
|
|
3194
|
-
});
|
|
3195
|
-
}, getData: function() {
|
|
3196
|
-
return new Promise((h, c) => {
|
|
3197
|
-
if (a === null)
|
|
3198
|
-
return h(null);
|
|
3199
|
-
a.save().then((g) => h(g));
|
|
3200
|
-
});
|
|
3201
|
-
} }), (h, c) => (Pt(), $t("div", Me));
|
|
3202
|
-
} }), Ie = { class: "ebl-editor readonly", id: "holder" }, He = Dt({ name: "EblEditorRender", inheritAttrs: !1, __name: "EditorRender", props: { data: { default: () => ({ blocks: [] }) }, locale: { default: {} }, showOutline: { type: Boolean, default: !1 } }, emits: ["onReady", "onChange"], setup(p, { expose: t, emit: e }) {
|
|
3203
|
-
let i = e;
|
|
3204
|
-
const s = p;
|
|
3205
|
-
let n = j(s.data), r = !1, o = null, a = null;
|
|
3206
|
-
const d = ["indent", "blockAlignment"];
|
|
3207
|
-
return Nt(() => {
|
|
3208
|
-
o = new jt({ minHeight: 50, holder: "holder", autofocus: !0, defaultBlock: "paragraph", placeholder: s.placeholder, tunes: d, tools: { inlineCode: W, underline: oe, Color: { class: ne }, marker: { class: N }, indent: { class: se }, alert: { class: _, inlineToolbar: !0 }, List: { class: K, inlineToolbar: !0, config: { defaultStyle: "checklist", maxLevel: 4 } }, h1: { class: Gt, inlineToolbar: !0 }, h2: { class: Xt, inlineToolbar: !0 }, h3: { class: Jt, inlineToolbar: !0 }, h4: { class: Qt, inlineToolbar: !0 }, h5: { class: Zt, inlineToolbar: !0 }, h6: { class: te, inlineToolbar: !0 }, paragraph: { class: tt, inlineToolbar: !0 }, blockAlignment: { class: Z, inlineToolbar: !0 }, code: { class: U, config: { lang: "javascript", theme: "github-dark-dimmed" } }, quote: { class: ee, inlineToolbar: !0 }, delimiter: ie, table: { class: ae, inlineToolbar: !0, config: { rows: 2, cols: 3 } }, image: { class: Y, inlineToolbar: !0, tunes: d.concat(["imageResize"]), config: { types: ".png,.jpeg,.jpg,.gif,.webp", endpoints: { byFile: "" }, features: { caption: !1, stretch: !1, border: !1, background: !1 } } }, imageResize: { class: le, config: { resize: !0, crop: !1 } } }, data: n, readOnly: !0, i18n: s.locale, onChange: (l, u) => {
|
|
3209
|
-
i("onChange", l, u);
|
|
3210
|
-
}, onReady: () => {
|
|
3211
|
-
r = !0, n = j(s.data), s.data && s.data.blocks && s.data.blocks.length > 0 && o.render(n), s.showOutline && (a = new de("holder", o), a.render(n)), i("onReady");
|
|
3212
|
-
} });
|
|
3213
|
-
}), Wt(() => {
|
|
3214
|
-
o !== null && (o.destroy(), o = null);
|
|
3215
|
-
}), Ft(() => s.data, (l, u) => {
|
|
3216
|
-
n = j(l), o != null && r && o.render(n).then(() => {
|
|
3217
|
-
a != null && s.showOutline && a.render(n);
|
|
3218
|
-
});
|
|
3219
|
-
}, { deep: !0 }), t({ validate: function() {
|
|
3220
|
-
return new Promise((l, u) => {
|
|
3221
|
-
if (o === null)
|
|
3222
|
-
return l(!1);
|
|
3223
|
-
o.save().then((h) => h.blocks.length > 0 ? l(!0) : l(!1));
|
|
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));
|
|
3224
3048
|
});
|
|
3225
3049
|
}, getData: function() {
|
|
3226
|
-
return new Promise((
|
|
3227
|
-
if (
|
|
3228
|
-
|
|
3229
|
-
o.save().then((h) => l(h));
|
|
3050
|
+
return new Promise((c, h) => {
|
|
3051
|
+
if (a === null) return c(null);
|
|
3052
|
+
a.save().then((g) => c(g));
|
|
3230
3053
|
});
|
|
3231
|
-
} }), (
|
|
3232
|
-
} }),
|
|
3233
|
-
let
|
|
3234
|
-
for (let
|
|
3235
|
-
const t =
|
|
3236
|
-
|
|
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);
|
|
3237
3060
|
}
|
|
3238
|
-
const
|
|
3239
|
-
t[pt] || (t[pt] = !0,
|
|
3240
|
-
} }))(
|
|
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.28", 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;
|
|
3241
3064
|
export {
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
We as zhCn
|
|
3065
|
+
Le as EblEditor,
|
|
3066
|
+
Ft as default,
|
|
3067
|
+
Ae as install,
|
|
3068
|
+
Be as version,
|
|
3069
|
+
Ie as zhCn
|
|
3248
3070
|
};
|
|
3249
3071
|
//# sourceMappingURL=index.mjs.map
|