@ebl-vue/editor-full 1.0.12 → 1.1.1
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 +6 -0
- package/dist/index.mjs +860 -445
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/Editor/Editor.vue +47 -12
- package/src/i18n/zh-cn.ts +6 -1
- package/src/icons/index.ts +15 -0
- package/src/installer.ts +4 -3
- package/src/plugins/alert/index.ts +19 -27
- package/src/plugins/block-alignment/index.ts +4 -3
- package/src/plugins/code/index.ts +3 -2
- package/src/plugins/color-picker/index.ts +3 -11
- package/src/plugins/delimiter/index.ts +5 -6
- package/src/plugins/header/H1.ts +1 -1
- package/src/plugins/header/H2.ts +1 -1
- package/src/plugins/header/H3.ts +1 -1
- package/src/plugins/header/H4.ts +1 -2
- package/src/plugins/header/H5.ts +1 -3
- package/src/plugins/header/H6.ts +1 -3
- package/src/plugins/imageResizeCrop/ImageTune.ts +900 -0
- package/src/plugins/imageResizeCrop/index.css +234 -0
- package/src/plugins/imageResizeCrop/index.ts +5 -0
- package/src/plugins/imageResizeCrop/types.d.ts +23 -0
- package/src/plugins/imageTool/index.css +145 -0
- package/src/plugins/imageTool/index.ts +538 -0
- package/src/plugins/imageTool/types/codexteam__ajax.d.ts +89 -0
- package/src/plugins/imageTool/types/types.ts +236 -0
- package/src/plugins/imageTool/ui.ts +313 -0
- package/src/plugins/imageTool/uploader.ts +268 -0
- package/src/plugins/imageTool/utils/dom.ts +24 -0
- package/src/plugins/imageTool/utils/index.ts +73 -0
- package/src/plugins/imageTool/utils/isPromise.ts +10 -0
- package/src/plugins/indent/index.ts +5 -7
- package/src/plugins/inline-code/index.ts +2 -5
- package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +1 -4
- package/src/plugins/list/index.ts +20 -37
- package/src/plugins/list/types/OlCounterType.ts +1 -1
- package/src/plugins/marker/index.ts +28 -16
- package/src/plugins/paragraph/index.ts +3 -2
- package/src/plugins/quote/index.ts +1 -4
- package/src/plugins/table/plugin.ts +1 -1
- package/src/plugins/table/table.ts +40 -38
- package/src/plugins/table/toolbox.ts +5 -4
- package/src/plugins/table/utils/dom.ts +15 -14
- package/src/plugins/table/utils/popover.ts +28 -15
- package/src/plugins/underline/index.ts +2 -4
- package/src/plugins/undo/index.ts +48 -33
- package/src/plugins/undo/observer.ts +3 -3
- package/src/utils/AxiosService.ts +87 -0
- package/types/index.d.ts +6 -0
- package/vite.config.ts +3 -1
- package/src/plugins/list/styles/icons/index.ts +0 -10
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
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}.ebl-editor-title{min-height:55px}.ebl-editor-title-wrap{min-height:55px;margin:0 auto}.ebl-editor-title-input{min-height:55px;width:100%;font-weight:600;border:none;background-color:transparent;font-size:34px}.ebl-editor-title-input:focus{outline:none}.ebl-editor-title-input:active{outline:none}.ebl-editor-time-wrap{white-space:nowrap;font-size:14px;font-weight:400;line-height:22px;padding-top:12px;padding-bottom:8px;color:#646a73}.ce-block__content{max-width:650px}@media (min-width: 1050px){.ce-block__content,.ce-toolbar__content{max-width:700px}}.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}.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:.6em 0 3px;margin:0;line-height:1.25em;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:1.6em;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}.ce-editorjs-x-shiki__code{position:relative;float:left;min-width:100%;overflow-x:auto}.ce-editorjs-x-shiki__selector{display:-webkit-box;display:-ms-flexbox;display:flex;gap:.25rem;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;z-index:12;border-bottom-style:solid;border-color:#9ca3af0d;padding:.5rem}.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;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__textarea{white-space:pre;overflow:hidden;background-color:transparent;position:absolute;padding:20px;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__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}.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:#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:block;-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}')),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 { make as
|
|
6
|
-
import { focus as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
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}.ebl-editor-title{min-height:55px}.ebl-editor-title-wrap{min-height:55px;margin:0 auto}.ebl-editor-title-input{min-height:55px;width:100%;font-weight:600;border:none;background-color:transparent;font-size:34px}.ebl-editor-title-input:focus{outline:none}.ebl-editor-title-input:active{outline:none}.ebl-editor-time-wrap{white-space:nowrap;font-size:14px;font-weight:400;line-height:22px;padding-top:12px;padding-bottom:8px;color:#646a73}.ce-block__content{max-width:650px}@media (min-width: 1050px){.ce-block__content,.ce-toolbar__content{max-width:700px}}.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}.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:.6em 0 3px;margin:0;line-height:1.25em;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:1.6em;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}.ce-editorjs-x-shiki__code{position:relative;float:left;min-width:100%;overflow-x:auto}.ce-editorjs-x-shiki__selector{display:-webkit-box;display:-ms-flexbox;display:flex;gap:.25rem;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;z-index:12;border-bottom-style:solid;border-color:#9ca3af0d;padding:.5rem}.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;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__textarea{white-space:pre;overflow:hidden;background-color:transparent;position:absolute;padding:20px;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__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}.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:#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:block;-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 }.image-tool__image{border-radius:3px;overflow:hidden;margin-bottom:10px;padding-bottom:0}.image-tool__image-picture{max-width:100%;vertical-align:bottom;display:inline-block}.image-tool__image-preloader{width:50px;height:50px;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 .image-tool__image{min-height:200px;display:-webkit-box;display:-ms-flexbox;display:flex;border:1px solid var(--border-color);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{width:12px;height:12px;border-radius:50%;background:#e9f4fe;border:3px solid #2492F5;position:absolute}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.top-left{left:-5px;top:-5px;cursor:nwse-resize}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.top-right{right:-5px;top:-5px;cursor:nesw-resize}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.bottom-left{left:-5px;bottom:-5px;cursor:nesw-resize}.cdx-image-tool-tune--resize .cdx-block .resizable .resizers .resizer.bottom-right{right:-5px;bottom:-5px;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}.ce-block{margin:.8em 0}.ce-toolbar{z-index:3}.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%}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import { defineComponent as zt, inject as Ft, ref as Pt, onMounted as Wt, toRaw as $t, onUnmounted as Ut, createElementBlock as jt, openBlock as qt, createElementVNode as U, withDirectives as Vt, vModelText as Kt, toDisplayString as Yt } from "vue";
|
|
3
|
+
import Gt from "@ebl-vue/editorjs";
|
|
4
|
+
import { bundledLanguagesInfo as Xt, codeToHtml as Jt } from "shiki";
|
|
5
|
+
import { make as S, isEmpty as ot } from "@editorjs/dom";
|
|
6
|
+
import { focus as Zt, isCaretAtStartOfInput as Qt, getCaretNodeAndOffset as te, getContenteditableSlice as ee } from "@editorjs/caret";
|
|
7
|
+
import dt from "vanilla-caret-js";
|
|
8
|
+
import G from "axios";
|
|
9
|
+
const ht = Symbol("INSTALLED_KEY"), ie = (c, t) => (c.install = (e) => {
|
|
10
|
+
for (const i of [c, ...Object.values({})]) e.component(i.name, i);
|
|
11
|
+
}, c);
|
|
12
|
+
class se {
|
|
12
13
|
constructor(t, e, i, s) {
|
|
13
14
|
const { blocks: n, toolbar: r } = i;
|
|
14
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();
|
|
@@ -78,8 +79,8 @@ class Yt {
|
|
|
78
79
|
this.isTheOnlyBlock() || this.api.move(this.endBlock, this.startBlock);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
|
-
const
|
|
82
|
-
class
|
|
82
|
+
const 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="M19 17V10.2135C19 10.1287 18.9011 10.0824 18.836 10.1367L16 12.5"/></svg>', pt = '<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>', ut = '<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>', 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="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>', 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 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>', 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="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>', _t = '<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>', 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="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>', At = '<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>', 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="M8 8L12 12M12 12L16 16M12 12L16 8M12 12L8 16"/></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-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>', Ot = '<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>', Rt = '<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>', kt = '<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>', wt = '<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 ne {
|
|
83
84
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
84
85
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H1" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
85
86
|
}
|
|
@@ -147,7 +148,7 @@ class Gt {
|
|
|
147
148
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
148
149
|
}
|
|
149
150
|
get defaultLevel() {
|
|
150
|
-
return { number: 1, tag: "H1", svg:
|
|
151
|
+
return { number: 1, tag: "H1", svg: ct };
|
|
151
152
|
}
|
|
152
153
|
onPaste(t) {
|
|
153
154
|
const e = t.detail;
|
|
@@ -160,11 +161,10 @@ class Gt {
|
|
|
160
161
|
return { tags: ["H1"] };
|
|
161
162
|
}
|
|
162
163
|
static get toolbox() {
|
|
163
|
-
return { icon:
|
|
164
|
+
return { icon: ct, title: "H1" };
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
-
class Kt {
|
|
167
|
+
class re {
|
|
168
168
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
169
169
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H2" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
170
170
|
}
|
|
@@ -232,7 +232,7 @@ class Kt {
|
|
|
232
232
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
233
233
|
}
|
|
234
234
|
get defaultLevel() {
|
|
235
|
-
return { number: 2, tag: "H2", svg:
|
|
235
|
+
return { number: 2, tag: "H2", svg: pt };
|
|
236
236
|
}
|
|
237
237
|
onPaste(t) {
|
|
238
238
|
const e = t.detail;
|
|
@@ -245,11 +245,10 @@ class Kt {
|
|
|
245
245
|
return { tags: ["H2"] };
|
|
246
246
|
}
|
|
247
247
|
static get toolbox() {
|
|
248
|
-
return { icon:
|
|
248
|
+
return { icon: pt, title: "H2" };
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
|
|
252
|
-
class Xt {
|
|
251
|
+
class oe {
|
|
253
252
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
254
253
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H3" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
255
254
|
}
|
|
@@ -317,7 +316,7 @@ class Xt {
|
|
|
317
316
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
318
317
|
}
|
|
319
318
|
get defaultLevel() {
|
|
320
|
-
return { number: 3, tag: "H3", svg:
|
|
319
|
+
return { number: 3, tag: "H3", svg: ut };
|
|
321
320
|
}
|
|
322
321
|
onPaste(t) {
|
|
323
322
|
const e = t.detail;
|
|
@@ -330,11 +329,10 @@ class Xt {
|
|
|
330
329
|
return { tags: ["H3"] };
|
|
331
330
|
}
|
|
332
331
|
static get toolbox() {
|
|
333
|
-
return { icon:
|
|
332
|
+
return { icon: ut, title: "H3" };
|
|
334
333
|
}
|
|
335
334
|
}
|
|
336
|
-
|
|
337
|
-
class Jt {
|
|
335
|
+
class ae {
|
|
338
336
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
339
337
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H4" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
340
338
|
}
|
|
@@ -402,7 +400,7 @@ class Jt {
|
|
|
402
400
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
403
401
|
}
|
|
404
402
|
get defaultLevel() {
|
|
405
|
-
return { number: 4, tag: "H4", svg:
|
|
403
|
+
return { number: 4, tag: "H4", svg: gt };
|
|
406
404
|
}
|
|
407
405
|
onPaste(t) {
|
|
408
406
|
const e = t.detail;
|
|
@@ -415,11 +413,10 @@ class Jt {
|
|
|
415
413
|
return { tags: ["H4"] };
|
|
416
414
|
}
|
|
417
415
|
static get toolbox() {
|
|
418
|
-
return { icon:
|
|
416
|
+
return { icon: gt, title: "H4" };
|
|
419
417
|
}
|
|
420
418
|
}
|
|
421
|
-
|
|
422
|
-
class Zt {
|
|
419
|
+
class le {
|
|
423
420
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
424
421
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H5" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
425
422
|
}
|
|
@@ -487,7 +484,7 @@ class Zt {
|
|
|
487
484
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
488
485
|
}
|
|
489
486
|
get defaultLevel() {
|
|
490
|
-
return { number: 5, tag: "H5", svg:
|
|
487
|
+
return { number: 5, tag: "H5", svg: mt };
|
|
491
488
|
}
|
|
492
489
|
onPaste(t) {
|
|
493
490
|
const e = t.detail;
|
|
@@ -500,11 +497,10 @@ class Zt {
|
|
|
500
497
|
return { tags: ["H5"] };
|
|
501
498
|
}
|
|
502
499
|
static get toolbox() {
|
|
503
|
-
return { icon:
|
|
500
|
+
return { icon: mt, title: "H5" };
|
|
504
501
|
}
|
|
505
502
|
}
|
|
506
|
-
|
|
507
|
-
class Qt {
|
|
503
|
+
class de {
|
|
508
504
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
509
505
|
this.api = i, this.readOnly = s, this._settings = { placeholder: "H6" }, this._data = this.normalizeData(t), this._element = this.getTag();
|
|
510
506
|
}
|
|
@@ -572,7 +568,7 @@ class Qt {
|
|
|
572
568
|
t.dataset.placeholder = this.api.i18n.t(this._settings.placeholder || "");
|
|
573
569
|
}
|
|
574
570
|
get defaultLevel() {
|
|
575
|
-
return { number: 6, tag: "H6", svg:
|
|
571
|
+
return { number: 6, tag: "H6", svg: ft };
|
|
576
572
|
}
|
|
577
573
|
onPaste(t) {
|
|
578
574
|
const e = t.detail;
|
|
@@ -585,10 +581,10 @@ class Qt {
|
|
|
585
581
|
return { tags: ["H6"] };
|
|
586
582
|
}
|
|
587
583
|
static get toolbox() {
|
|
588
|
-
return { icon:
|
|
584
|
+
return { icon: ft, title: "H6" };
|
|
589
585
|
}
|
|
590
586
|
}
|
|
591
|
-
class
|
|
587
|
+
class at {
|
|
592
588
|
static get DEFAULT_ALIGNMENT() {
|
|
593
589
|
return "left";
|
|
594
590
|
}
|
|
@@ -597,10 +593,10 @@ class st {
|
|
|
597
593
|
}
|
|
598
594
|
getAlignment() {
|
|
599
595
|
var t, e;
|
|
600
|
-
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 : at.DEFAULT_ALIGNMENT;
|
|
601
597
|
}
|
|
602
598
|
constructor({ api: t, data: e, config: i, block: s }) {
|
|
603
|
-
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: Bt }, { name: "center", icon: _t }, { name: "right", icon: At }], this._CSS = { alignment: { left: "ce-tune-alignment--left", center: "ce-tune-alignment--center", right: "ce-tune-alignment--right" } };
|
|
604
600
|
}
|
|
605
601
|
wrap(t) {
|
|
606
602
|
return this.wrapper = document.createElement("div"), this.wrapper.classList.toggle(this._CSS.alignment[this.data.alignment]), this.wrapper.append(t), this.wrapper;
|
|
@@ -625,13 +621,13 @@ class st {
|
|
|
625
621
|
return this.data;
|
|
626
622
|
}
|
|
627
623
|
}
|
|
628
|
-
class
|
|
624
|
+
class lt {
|
|
629
625
|
static get DEFAULT_PLACEHOLDER() {
|
|
630
626
|
return "";
|
|
631
627
|
}
|
|
632
628
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
633
629
|
var n;
|
|
634
|
-
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 : lt.DEFAULT_PLACEHOLDER, this._data = t != null ? t : {}, this._element = null, this._preserveBlank = (n = e.preserveBlank) != null ? n : !1;
|
|
635
631
|
}
|
|
636
632
|
onKeyUp(t) {
|
|
637
633
|
if (t.code !== "Backspace" && t.code !== "Delete" || !this._element) return;
|
|
@@ -681,13 +677,13 @@ class nt {
|
|
|
681
677
|
return { tags: ["P"] };
|
|
682
678
|
}
|
|
683
679
|
static get toolbox() {
|
|
684
|
-
return { icon:
|
|
680
|
+
return { icon: Rt, title: "Text" };
|
|
685
681
|
}
|
|
686
682
|
}
|
|
687
|
-
class
|
|
683
|
+
class j {
|
|
688
684
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
689
685
|
var n;
|
|
690
|
-
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 || j.DEFAULT_PLACEHOLDER), this._selectorLanguage = t.lang || e.lang || j.DEFAULT_LANGUAGE, this._selectorTheme = t.theme || e.theme || j.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 }, this.nodes.holder = this.drawView();
|
|
691
687
|
}
|
|
692
688
|
static get isReadOnlySupported() {
|
|
693
689
|
return !0;
|
|
@@ -737,11 +733,11 @@ class $ {
|
|
|
737
733
|
const e = t.target, i = t.shiftKey, s = e.selectionStart, n = e.value, r = " ";
|
|
738
734
|
let o;
|
|
739
735
|
if (i) {
|
|
740
|
-
const a = function(
|
|
741
|
-
let
|
|
742
|
-
for (;
|
|
743
|
-
` && l > 0; ) l -= 1,
|
|
744
|
-
return
|
|
736
|
+
const a = function(d, l) {
|
|
737
|
+
let h = "";
|
|
738
|
+
for (; h !== `
|
|
739
|
+
` && l > 0; ) l -= 1, h = d.substr(l, 1);
|
|
740
|
+
return h === `
|
|
745
741
|
` && (l += 1), l;
|
|
746
742
|
}(n, s);
|
|
747
743
|
if (n.substr(a, 2) !== r) return;
|
|
@@ -750,37 +746,37 @@ class $ {
|
|
|
750
746
|
e.setSelectionRange(o, o);
|
|
751
747
|
}
|
|
752
748
|
drawView() {
|
|
753
|
-
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"),
|
|
754
|
-
return t.classList.add(this.CSS.baseClass, this.CSS.wrapper), 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"),
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
}), 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(
|
|
758
|
-
|
|
759
|
-
}), o.addEventListener("change", (
|
|
760
|
-
const
|
|
761
|
-
this._selectorLanguage =
|
|
762
|
-
|
|
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");
|
|
750
|
+
return t.classList.add(this.CSS.baseClass, this.CSS.wrapper), 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"), Xt.forEach((h) => {
|
|
751
|
+
const p = document.createElement("option");
|
|
752
|
+
p.value = h.id, p.text = h.name, o.appendChild(p);
|
|
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), this.readOnly ? i.appendChild(s) : i.appendChild(o), n.appendChild(r), i.appendChild(n), t.appendChild(i), t.appendChild(e), this.runShiki().then(({ html: h, preStyle: p }) => {
|
|
754
|
+
d.innerHTML = h, t == null || t.setAttribute("style", p), o.setAttribute("style", p), a.setAttribute("style", p);
|
|
755
|
+
}), o.addEventListener("change", (h) => {
|
|
756
|
+
const p = h.target.value;
|
|
757
|
+
this._selectorLanguage = p, this.runShiki().then(({ html: u, preStyle: g }) => {
|
|
758
|
+
d.innerHTML = u, s.innerHTML = p;
|
|
763
759
|
});
|
|
764
|
-
}), a.addEventListener("change", (
|
|
765
|
-
const
|
|
766
|
-
this._selectorTheme =
|
|
767
|
-
|
|
760
|
+
}), a.addEventListener("change", (h) => {
|
|
761
|
+
const p = h.target.value;
|
|
762
|
+
this._selectorTheme = p, this.runShiki().then(({ html: u, preStyle: g }) => {
|
|
763
|
+
d.innerHTML = u, t == null || t.setAttribute("style", g), o.setAttribute("style", g), a.setAttribute("style", g);
|
|
768
764
|
});
|
|
769
765
|
}), l.addEventListener("input", () => {
|
|
770
|
-
this.data.code = l.value, this.runShiki().then(({ html:
|
|
771
|
-
|
|
766
|
+
this.data.code = l.value, this.runShiki().then(({ html: h, preStyle: p }) => {
|
|
767
|
+
d.innerHTML = h, t == null || t.setAttribute("style", p), o.setAttribute("style", p), a.setAttribute("style", p);
|
|
772
768
|
});
|
|
773
|
-
}), l.addEventListener("keydown", (
|
|
774
|
-
|
|
775
|
-
|
|
769
|
+
}), l.addEventListener("keydown", (h) => {
|
|
770
|
+
h.code === "Tab" && (this.tabHandler(h), this.data.code = l.value, this.runShiki().then(({ html: p, preStyle: u }) => {
|
|
771
|
+
d.innerHTML = p;
|
|
776
772
|
}));
|
|
777
|
-
}), n.addEventListener("click", (
|
|
778
|
-
this.copyCode(this.data.code,
|
|
773
|
+
}), n.addEventListener("click", (h) => {
|
|
774
|
+
this.copyCode(this.data.code, h);
|
|
779
775
|
}), this.nodes.textarea = l, t;
|
|
780
776
|
}
|
|
781
777
|
async runShiki() {
|
|
782
778
|
let t = "";
|
|
783
|
-
return { html: await
|
|
779
|
+
return { html: await Jt(this.data.code, { lang: this._selectorLanguage, theme: this._selectorTheme, transformers: [{ preprocess: (e) => `${e}
|
|
784
780
|
`, pre(e) {
|
|
785
781
|
var i;
|
|
786
782
|
this.addClassToHast(e, "ce-editorjs-x-shiki__span"), t = ((i = e.properties) == null ? void 0 : i.style) || "";
|
|
@@ -802,7 +798,7 @@ class $ {
|
|
|
802
798
|
});
|
|
803
799
|
}
|
|
804
800
|
}
|
|
805
|
-
class
|
|
801
|
+
class he {
|
|
806
802
|
constructor({ data: t, api: e, readOnly: i }) {
|
|
807
803
|
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 };
|
|
808
804
|
}
|
|
@@ -810,10 +806,7 @@ class te {
|
|
|
810
806
|
return !0;
|
|
811
807
|
}
|
|
812
808
|
static get toolbox() {
|
|
813
|
-
return { icon:
|
|
814
|
-
<path d="M10 10.8182L9 10.8182C8.80222 10.8182 8.60888 10.7649 8.44443 10.665C8.27998 10.5651 8.15181 10.4231 8.07612 10.257C8.00043 10.0909 7.98063 9.90808 8.01922 9.73174C8.0578 9.55539 8.15304 9.39341 8.29289 9.26627C8.43275 9.13913 8.61093 9.05255 8.80491 9.01747C8.99889 8.98239 9.19996 9.00039 9.38268 9.0692C9.56541 9.13801 9.72159 9.25453 9.83147 9.40403C9.94135 9.55353 10 9.72929 10 9.90909L10 12.1818C10 12.664 9.78929 13.1265 9.41421 13.4675C9.03914 13.8084 8.53043 14 8 14" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
815
|
-
<path d="M16 10.8182L15 10.8182C14.8022 10.8182 14.6089 10.7649 14.4444 10.665C14.28 10.5651 14.1518 10.4231 14.0761 10.257C14.0004 10.0909 13.9806 9.90808 14.0192 9.73174C14.0578 9.55539 14.153 9.39341 14.2929 9.26627C14.4327 9.13913 14.6109 9.05255 14.8049 9.01747C14.9989 8.98239 15.2 9.00039 15.3827 9.0692C15.5654 9.13801 15.7216 9.25453 15.8315 9.40403C15.9414 9.55353 16 9.72929 16 9.90909L16 12.1818C16 12.664 15.7893 13.1265 15.4142 13.4675C15.0391 13.8084 14.5304 14 14 14" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
816
|
-
</svg>`, title: "Quote" };
|
|
809
|
+
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-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 10.8182L9 10.8182C8.80222 10.8182 8.60888 10.7649 8.44443 10.665C8.27998 10.5651 8.15181 10.4231 8.07612 10.257C8.00043 10.0909 7.98063 9.90808 8.01922 9.73174C8.0578 9.55539 8.15304 9.39341 8.29289 9.26627C8.43275 9.13913 8.61093 9.05255 8.80491 9.01747C8.99889 8.98239 9.19996 9.00039 9.38268 9.0692C9.56541 9.13801 9.72159 9.25453 9.83147 9.40403C9.94135 9.55353 10 9.72929 10 9.90909L10 12.1818C10 12.664 9.78929 13.1265 9.41421 13.4675C9.03914 13.8084 8.53043 14 8 14"/><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 10.8182L15 10.8182C14.8022 10.8182 14.6089 10.7649 14.4444 10.665C14.28 10.5651 14.1518 10.4231 14.0761 10.257C14.0004 10.0909 13.9806 9.90808 14.0192 9.73174C14.0578 9.55539 14.153 9.39341 14.2929 9.26627C14.4327 9.13913 14.6109 9.05255 14.8049 9.01747C14.9989 8.98239 15.2 9.00039 15.3827 9.0692C15.5654 9.13801 15.7216 9.25453 15.8315 9.40403C15.9414 9.55353 16 9.72929 16 9.90909L16 12.1818C16 12.664 15.7893 13.1265 15.4142 13.4675C15.0391 13.8084 14.5304 14 14 14"/></svg>', title: "Quote" };
|
|
817
810
|
}
|
|
818
811
|
static get contentless() {
|
|
819
812
|
return !0;
|
|
@@ -830,8 +823,8 @@ class te {
|
|
|
830
823
|
return { baseClass: this.api.styles.block, wrapper: "cdx-quote", text: "cdx-quote__text", input: this.api.styles.input };
|
|
831
824
|
}
|
|
832
825
|
render() {
|
|
833
|
-
const t =
|
|
834
|
-
return this._quoteElement =
|
|
826
|
+
const t = S("div", [this._CSS.baseClass, this._CSS.wrapper]);
|
|
827
|
+
return this._quoteElement = S("blockquote", [this._CSS.input, this._CSS.text, "cdx-block-quote"], { contentEditable: !this.readOnly, innerHTML: this._data.text }), this._quoteElement.addEventListener("keydown", (e) => this.handleKeydown(e)), t.appendChild(this._quoteElement), t;
|
|
835
828
|
}
|
|
836
829
|
get currentItem() {
|
|
837
830
|
let t = window.getSelection().anchorNode;
|
|
@@ -858,7 +851,7 @@ class te {
|
|
|
858
851
|
return { text: { br: !0 } };
|
|
859
852
|
}
|
|
860
853
|
}
|
|
861
|
-
class
|
|
854
|
+
class ce {
|
|
862
855
|
static get isReadOnlySupported() {
|
|
863
856
|
return !0;
|
|
864
857
|
}
|
|
@@ -866,7 +859,7 @@ class ee {
|
|
|
866
859
|
return !0;
|
|
867
860
|
}
|
|
868
861
|
constructor({ data: t, config: e, api: i }) {
|
|
869
|
-
this.api = i, this._CSS = { block: this.api.styles.block, wrapper: "ce-delimiter" }, this._element = this.drawView();
|
|
862
|
+
this.api = i, this._CSS = { block: this.api.styles.block, wrapper: "ce-delimiter" }, this._element = this.drawView(), this.data = t;
|
|
870
863
|
}
|
|
871
864
|
drawView() {
|
|
872
865
|
let t = document.createElement("div"), e = document.createElement("div"), i = document.createElement("div");
|
|
@@ -879,11 +872,7 @@ class ee {
|
|
|
879
872
|
return {};
|
|
880
873
|
}
|
|
881
874
|
static get toolbox() {
|
|
882
|
-
return { icon:
|
|
883
|
-
<line x1="6" y1="12" x2="10" y2="12" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
884
|
-
<line x1="14" y1="12" x2="18" y2="12" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
885
|
-
</svg>
|
|
886
|
-
`, title: "Delimiter" };
|
|
875
|
+
return { icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><line x1="6" x2="10" y1="12" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><line x1="14" x2="18" y1="12" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/></svg>', title: "Delimiter" };
|
|
887
876
|
}
|
|
888
877
|
static get pasteConfig() {
|
|
889
878
|
return { tags: ["HR"] };
|
|
@@ -892,25 +881,25 @@ class ee {
|
|
|
892
881
|
this.data = {};
|
|
893
882
|
}
|
|
894
883
|
}
|
|
895
|
-
const
|
|
896
|
-
class
|
|
884
|
+
const x = "cdx-list", k = { wrapper: x, item: `${x}__item`, itemContent: `${x}__item-content`, itemChildren: `${x}__item-children` };
|
|
885
|
+
class E {
|
|
897
886
|
static get CSS() {
|
|
898
|
-
return { ...
|
|
887
|
+
return { ...k, orderedList: `${x}-ordered` };
|
|
899
888
|
}
|
|
900
889
|
constructor(t, e) {
|
|
901
890
|
this.config = e, this.readOnly = t;
|
|
902
891
|
}
|
|
903
892
|
renderWrapper(t) {
|
|
904
893
|
let e;
|
|
905
|
-
return e =
|
|
894
|
+
return e = S("ol", t === !0 ? [E.CSS.wrapper, E.CSS.orderedList] : [E.CSS.orderedList, E.CSS.itemChildren]), e;
|
|
906
895
|
}
|
|
907
896
|
renderItem(t, e) {
|
|
908
|
-
const i =
|
|
897
|
+
const i = S("li", E.CSS.item), s = S("div", E.CSS.itemContent, { innerHTML: t, contentEditable: (!this.readOnly).toString() });
|
|
909
898
|
return i.appendChild(s), i;
|
|
910
899
|
}
|
|
911
900
|
getItemContent(t) {
|
|
912
|
-
const e = t.querySelector(`.${
|
|
913
|
-
return e ?
|
|
901
|
+
const e = t.querySelector(`.${E.CSS.itemContent}`);
|
|
902
|
+
return e ? ot(e) ? "" : e.innerHTML : "";
|
|
914
903
|
}
|
|
915
904
|
getItemMeta() {
|
|
916
905
|
return {};
|
|
@@ -919,24 +908,24 @@ class S {
|
|
|
919
908
|
return {};
|
|
920
909
|
}
|
|
921
910
|
}
|
|
922
|
-
class
|
|
911
|
+
class M {
|
|
923
912
|
static get CSS() {
|
|
924
|
-
return { ...
|
|
913
|
+
return { ...k, unorderedList: `${x}-unordered` };
|
|
925
914
|
}
|
|
926
915
|
constructor(t, e) {
|
|
927
916
|
this.config = e, this.readOnly = t;
|
|
928
917
|
}
|
|
929
918
|
renderWrapper(t) {
|
|
930
919
|
let e;
|
|
931
|
-
return e =
|
|
920
|
+
return e = S("ul", t === !0 ? [M.CSS.wrapper, M.CSS.unorderedList] : [M.CSS.unorderedList, M.CSS.itemChildren]), e;
|
|
932
921
|
}
|
|
933
922
|
renderItem(t, e) {
|
|
934
|
-
const i =
|
|
923
|
+
const i = S("li", M.CSS.item), s = S("div", M.CSS.itemContent, { innerHTML: t, contentEditable: (!this.readOnly).toString() });
|
|
935
924
|
return i.appendChild(s), i;
|
|
936
925
|
}
|
|
937
926
|
getItemContent(t) {
|
|
938
|
-
const e = t.querySelector(`.${
|
|
939
|
-
return e ?
|
|
927
|
+
const e = t.querySelector(`.${M.CSS.itemContent}`);
|
|
928
|
+
return e ? ot(e) ? "" : e.innerHTML : "";
|
|
940
929
|
}
|
|
941
930
|
getItemMeta() {
|
|
942
931
|
return {};
|
|
@@ -945,52 +934,49 @@ class x {
|
|
|
945
934
|
return {};
|
|
946
935
|
}
|
|
947
936
|
}
|
|
948
|
-
function
|
|
949
|
-
return
|
|
937
|
+
function R(c) {
|
|
938
|
+
return c.nodeType === Node.ELEMENT_NODE;
|
|
950
939
|
}
|
|
951
|
-
class
|
|
940
|
+
class C {
|
|
952
941
|
static get CSS() {
|
|
953
|
-
return { ...
|
|
942
|
+
return { ...k, checklist: `${x}-checklist`, itemChecked: `${x}__checkbox--checked`, noHover: `${x}__checkbox--no-hover`, checkbox: `${x}__checkbox-check`, checkboxContainer: `${x}__checkbox`, checkboxCheckDisabled: `${x}__checkbox-check--disabled` };
|
|
954
943
|
}
|
|
955
944
|
constructor(t, e) {
|
|
956
945
|
this.config = e, this.readOnly = t;
|
|
957
946
|
}
|
|
958
947
|
renderWrapper(t) {
|
|
959
948
|
let e;
|
|
960
|
-
return t === !0 ? (e =
|
|
949
|
+
return t === !0 ? (e = S("ul", [C.CSS.wrapper, C.CSS.checklist]), e.addEventListener("click", (i) => {
|
|
961
950
|
const s = i.target;
|
|
962
951
|
if (s) {
|
|
963
|
-
const n = s.closest(`.${
|
|
952
|
+
const n = s.closest(`.${C.CSS.checkboxContainer}`);
|
|
964
953
|
n && n.contains(s) && this.toggleCheckbox(n);
|
|
965
954
|
}
|
|
966
|
-
})) : e =
|
|
955
|
+
})) : e = S("ul", [C.CSS.checklist, C.CSS.itemChildren]), e;
|
|
967
956
|
}
|
|
968
957
|
renderItem(t, e) {
|
|
969
|
-
const i =
|
|
970
|
-
return e.checked === !0 && r.classList.add(
|
|
971
|
-
<path d="M7 12L10.4884 15.8372C10.5677 15.9245 10.705 15.9245 10.7844 15.8372L17 9" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
972
|
-
</svg>
|
|
973
|
-
`, r.appendChild(n), i.appendChild(r), i.appendChild(s), i;
|
|
958
|
+
const i = S("li", [C.CSS.item, C.CSS.item]), s = S("div", C.CSS.itemContent, { innerHTML: t, contentEditable: (!this.readOnly).toString() }), n = S("span", C.CSS.checkbox), r = S("div", C.CSS.checkboxContainer);
|
|
959
|
+
return e.checked === !0 && r.classList.add(C.CSS.itemChecked), this.readOnly && r.classList.add(C.CSS.checkboxCheckDisabled), 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-width="2" d="M7 12L10.4884 15.8372C10.5677 15.9245 10.705 15.9245 10.7844 15.8372L17 9"/></svg>', r.appendChild(n), i.appendChild(r), i.appendChild(s), i;
|
|
974
960
|
}
|
|
975
961
|
getItemContent(t) {
|
|
976
|
-
const e = t.querySelector(`.${
|
|
977
|
-
return e ?
|
|
962
|
+
const e = t.querySelector(`.${C.CSS.itemContent}`);
|
|
963
|
+
return e ? ot(e) ? "" : e.innerHTML : "";
|
|
978
964
|
}
|
|
979
965
|
getItemMeta(t) {
|
|
980
|
-
const e = t.querySelector(`.${
|
|
981
|
-
return { checked: !!e && e.classList.contains(
|
|
966
|
+
const e = t.querySelector(`.${C.CSS.checkboxContainer}`);
|
|
967
|
+
return { checked: !!e && e.classList.contains(C.CSS.itemChecked) };
|
|
982
968
|
}
|
|
983
969
|
composeDefaultMeta() {
|
|
984
970
|
return { checked: !1 };
|
|
985
971
|
}
|
|
986
972
|
toggleCheckbox(t) {
|
|
987
|
-
t.classList.toggle(
|
|
973
|
+
t.classList.toggle(C.CSS.itemChecked), t.classList.add(C.CSS.noHover), t.addEventListener("mouseleave", () => this.removeSpecialHoverBehavior(t), { once: !0 });
|
|
988
974
|
}
|
|
989
975
|
removeSpecialHoverBehavior(t) {
|
|
990
|
-
t.classList.remove(
|
|
976
|
+
t.classList.remove(C.CSS.noHover);
|
|
991
977
|
}
|
|
992
978
|
}
|
|
993
|
-
function
|
|
979
|
+
function X(c, t = "after") {
|
|
994
980
|
const e = [];
|
|
995
981
|
let i;
|
|
996
982
|
function s(n) {
|
|
@@ -1001,39 +987,39 @@ function j(d, t = "after") {
|
|
|
1001
987
|
return n.previousElementSibling;
|
|
1002
988
|
}
|
|
1003
989
|
}
|
|
1004
|
-
for (i = s(
|
|
990
|
+
for (i = s(c); i !== null; ) e.push(i), i = s(i);
|
|
1005
991
|
return e.length !== 0 ? e : null;
|
|
1006
992
|
}
|
|
1007
|
-
function
|
|
1008
|
-
let e =
|
|
1009
|
-
return
|
|
993
|
+
function H(c, t = !0) {
|
|
994
|
+
let e = c;
|
|
995
|
+
return c.classList.contains(k.item) && (e = c.querySelector(`.${k.itemChildren}`)), e === null ? [] : t ? Array.from(e.querySelectorAll(`:scope > .${k.item}`)) : Array.from(e.querySelectorAll(`.${k.item}`));
|
|
1010
996
|
}
|
|
1011
|
-
function
|
|
1012
|
-
return
|
|
997
|
+
function A(c) {
|
|
998
|
+
return c.querySelector(`.${k.itemChildren}`);
|
|
1013
999
|
}
|
|
1014
|
-
function
|
|
1015
|
-
let t =
|
|
1016
|
-
|
|
1000
|
+
function J(c) {
|
|
1001
|
+
let t = c;
|
|
1002
|
+
c.classList.contains(k.item) && (t = A(c)), t !== null && H(t).length === 0 && t.remove();
|
|
1017
1003
|
}
|
|
1018
|
-
function
|
|
1019
|
-
return
|
|
1004
|
+
function q(c) {
|
|
1005
|
+
return c.querySelector(`.${k.itemContent}`);
|
|
1020
1006
|
}
|
|
1021
|
-
function
|
|
1022
|
-
const e =
|
|
1023
|
-
e &&
|
|
1007
|
+
function F(c, t = !0) {
|
|
1008
|
+
const e = q(c);
|
|
1009
|
+
e && Zt(e, t);
|
|
1024
1010
|
}
|
|
1025
|
-
class
|
|
1011
|
+
class Z {
|
|
1026
1012
|
get currentItem() {
|
|
1027
1013
|
const t = window.getSelection();
|
|
1028
1014
|
if (!t) return null;
|
|
1029
1015
|
let e = t.anchorNode;
|
|
1030
|
-
return e ? (
|
|
1016
|
+
return e ? (R(e) || (e = e.parentNode), e && R(e) ? e.closest(`.${k.item}`) : null) : null;
|
|
1031
1017
|
}
|
|
1032
1018
|
get currentItemLevel() {
|
|
1033
1019
|
const t = this.currentItem;
|
|
1034
1020
|
if (t === null) return null;
|
|
1035
1021
|
let e = t.parentNode, i = 0;
|
|
1036
|
-
for (; e !== null && e !== this.listWrapper; )
|
|
1022
|
+
for (; e !== null && e !== this.listWrapper; ) R(e) && e.classList.contains(k.item) && (i += 1), e = e.parentNode;
|
|
1037
1023
|
return i + 1;
|
|
1038
1024
|
}
|
|
1039
1025
|
constructor({ data: t, config: e, api: i, readOnly: s, block: n }, r) {
|
|
@@ -1054,8 +1040,8 @@ class G {
|
|
|
1054
1040
|
}, !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;
|
|
1055
1041
|
}
|
|
1056
1042
|
save(t) {
|
|
1057
|
-
const e = t != null ? t : this.listWrapper, i = (r) =>
|
|
1058
|
-
const a =
|
|
1043
|
+
const e = t != null ? t : this.listWrapper, i = (r) => H(r).map((o) => {
|
|
1044
|
+
const a = A(o);
|
|
1059
1045
|
return { content: this.renderer.getItemContent(o), meta: this.renderer.getItemMeta(o), items: a ? i(a) : [] };
|
|
1060
1046
|
}), s = e ? i(e) : [];
|
|
1061
1047
|
let n = { style: this.data.style, meta: {}, items: s };
|
|
@@ -1065,11 +1051,11 @@ class G {
|
|
|
1065
1051
|
return { tags: ["OL", "UL", "LI"] };
|
|
1066
1052
|
}
|
|
1067
1053
|
merge(t) {
|
|
1068
|
-
const e = this.block.holder.querySelectorAll(`.${
|
|
1054
|
+
const e = this.block.holder.querySelectorAll(`.${k.item}`), i = e[e.length - 1], s = q(i);
|
|
1069
1055
|
if (i === null || s === null || (s.insertAdjacentHTML("beforeend", t.items[0].content), this.listWrapper === void 0)) return;
|
|
1070
|
-
const n =
|
|
1056
|
+
const n = H(this.listWrapper);
|
|
1071
1057
|
if (n.length === 0) return;
|
|
1072
|
-
let r =
|
|
1058
|
+
let r = A(n[n.length - 1]);
|
|
1073
1059
|
const o = t.items.shift();
|
|
1074
1060
|
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));
|
|
1075
1061
|
}
|
|
@@ -1093,9 +1079,9 @@ class G {
|
|
|
1093
1079
|
const n = { style: s, meta: {}, items: [] };
|
|
1094
1080
|
s === "ordered" && (this.data.meta.counterType = "numeric", this.data.meta.start = 1);
|
|
1095
1081
|
const r = (o) => Array.from(o.querySelectorAll(":scope > li")).map((a) => {
|
|
1096
|
-
var
|
|
1097
|
-
const
|
|
1098
|
-
return { content: (
|
|
1082
|
+
var h;
|
|
1083
|
+
const d = a.querySelector(`:scope > ${i}`), l = d ? r(d) : [];
|
|
1084
|
+
return { content: (h = a.innerHTML) != null ? h : "", meta: {}, items: l };
|
|
1099
1085
|
});
|
|
1100
1086
|
return n.items = r(t), n;
|
|
1101
1087
|
}
|
|
@@ -1111,37 +1097,37 @@ class G {
|
|
|
1111
1097
|
if (t.stopPropagation(), t.preventDefault(), t.isComposing || e === null) return;
|
|
1112
1098
|
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();
|
|
1113
1099
|
if (s && i) return e.nextElementSibling !== null || function(a) {
|
|
1114
|
-
return a.querySelector(`.${
|
|
1100
|
+
return a.querySelector(`.${k.itemChildren}`) !== null;
|
|
1115
1101
|
}(e) ? void this.splitList(e) : void (n ? this.convertItemToDefaultBlock(r, !0) : this.convertItemToDefaultBlock());
|
|
1116
1102
|
i ? this.unshiftItem(e) : this.splitItem(e);
|
|
1117
1103
|
}
|
|
1118
1104
|
backspace(t) {
|
|
1119
1105
|
var i;
|
|
1120
1106
|
const e = this.currentItem;
|
|
1121
|
-
e !== null &&
|
|
1107
|
+
e !== null && Qt(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());
|
|
1122
1108
|
}
|
|
1123
1109
|
shiftTab(t) {
|
|
1124
1110
|
t.stopPropagation(), t.preventDefault(), this.currentItem !== null && this.unshiftItem(this.currentItem);
|
|
1125
1111
|
}
|
|
1126
1112
|
unshiftItem(t) {
|
|
1127
|
-
if (!t.parentNode || !
|
|
1128
|
-
const e = t.parentNode.closest(`.${
|
|
1113
|
+
if (!t.parentNode || !R(t.parentNode)) return;
|
|
1114
|
+
const e = t.parentNode.closest(`.${k.item}`);
|
|
1129
1115
|
if (!e) return;
|
|
1130
|
-
let i =
|
|
1116
|
+
let i = A(t);
|
|
1131
1117
|
if (t.parentElement === null) return;
|
|
1132
|
-
const s =
|
|
1118
|
+
const s = X(t);
|
|
1133
1119
|
s !== null && (i === null && (i = this.renderer.renderWrapper(!1)), s.forEach((n) => {
|
|
1134
1120
|
i.appendChild(n);
|
|
1135
|
-
}), t.appendChild(i)), e.after(t),
|
|
1121
|
+
}), t.appendChild(i)), e.after(t), F(t, !1), J(e);
|
|
1136
1122
|
}
|
|
1137
1123
|
splitList(t) {
|
|
1138
|
-
const e =
|
|
1124
|
+
const e = H(t), i = this.block, s = this.api.blocks.getCurrentBlockIndex();
|
|
1139
1125
|
if (e.length !== 0) {
|
|
1140
1126
|
const a = e[0];
|
|
1141
|
-
this.unshiftItem(a),
|
|
1127
|
+
this.unshiftItem(a), F(t, !1);
|
|
1142
1128
|
}
|
|
1143
1129
|
if (t.previousElementSibling === null && t.parentNode === this.listWrapper) return void this.convertItemToDefaultBlock(s);
|
|
1144
|
-
const n =
|
|
1130
|
+
const n = X(t);
|
|
1145
1131
|
if (n === null) return;
|
|
1146
1132
|
const r = this.renderer.renderWrapper(!0);
|
|
1147
1133
|
n.forEach((a) => {
|
|
@@ -1151,39 +1137,39 @@ class G {
|
|
|
1151
1137
|
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();
|
|
1152
1138
|
}
|
|
1153
1139
|
splitItem(t) {
|
|
1154
|
-
const [e, i] =
|
|
1140
|
+
const [e, i] = te();
|
|
1155
1141
|
if (e === null) return;
|
|
1156
|
-
const s =
|
|
1142
|
+
const s = q(t);
|
|
1157
1143
|
let n;
|
|
1158
|
-
n = s === null ? "" :
|
|
1159
|
-
const r =
|
|
1160
|
-
t == null || t.after(o), r && o.appendChild(r),
|
|
1144
|
+
n = s === null ? "" : ee(s, e, i, "right", !0);
|
|
1145
|
+
const r = A(t), o = this.renderItem(n);
|
|
1146
|
+
t == null || t.after(o), r && o.appendChild(r), F(o);
|
|
1161
1147
|
}
|
|
1162
1148
|
mergeItemWithPrevious(t) {
|
|
1163
|
-
var
|
|
1149
|
+
var h;
|
|
1164
1150
|
const e = t.previousElementSibling, i = t.parentNode;
|
|
1165
|
-
if (i === null || !
|
|
1166
|
-
const s = i.closest(`.${
|
|
1167
|
-
if (!e && !s || e && !
|
|
1151
|
+
if (i === null || !R(i)) return;
|
|
1152
|
+
const s = i.closest(`.${k.item}`);
|
|
1153
|
+
if (!e && !s || e && !R(e)) return;
|
|
1168
1154
|
let n;
|
|
1169
1155
|
if (e) {
|
|
1170
|
-
const
|
|
1171
|
-
n =
|
|
1156
|
+
const p = H(e, !1);
|
|
1157
|
+
n = p.length !== 0 && p.length !== 0 ? p[p.length - 1] : e;
|
|
1172
1158
|
} else n = s;
|
|
1173
1159
|
const r = this.renderer.getItemContent(t);
|
|
1174
1160
|
if (!n) return;
|
|
1175
|
-
|
|
1176
|
-
const o =
|
|
1161
|
+
F(n, !1);
|
|
1162
|
+
const o = q(n);
|
|
1177
1163
|
if (o === null) return;
|
|
1178
1164
|
o.insertAdjacentHTML("beforeend", r);
|
|
1179
|
-
const a =
|
|
1180
|
-
if (a.length === 0) return t.remove(), void
|
|
1181
|
-
const
|
|
1182
|
-
e ? a.forEach((
|
|
1183
|
-
l.appendChild(
|
|
1184
|
-
}) : a.forEach((
|
|
1185
|
-
l.prepend(
|
|
1186
|
-
}),
|
|
1165
|
+
const a = H(t);
|
|
1166
|
+
if (a.length === 0) return t.remove(), void J(n);
|
|
1167
|
+
const d = e || s, l = (h = A(d)) != null ? h : this.renderer.renderWrapper(!1);
|
|
1168
|
+
e ? a.forEach((p) => {
|
|
1169
|
+
l.appendChild(p);
|
|
1170
|
+
}) : a.forEach((p) => {
|
|
1171
|
+
l.prepend(p);
|
|
1172
|
+
}), A(d) === null && n.appendChild(l), t.remove();
|
|
1187
1173
|
}
|
|
1188
1174
|
addTab(t) {
|
|
1189
1175
|
var n;
|
|
@@ -1195,19 +1181,19 @@ class G {
|
|
|
1195
1181
|
if (r !== null && r === this.config.maxLevel) return;
|
|
1196
1182
|
}
|
|
1197
1183
|
const i = e.previousSibling;
|
|
1198
|
-
if (i === null || !
|
|
1199
|
-
const s =
|
|
1184
|
+
if (i === null || !R(i)) return;
|
|
1185
|
+
const s = A(i);
|
|
1200
1186
|
if (s)
|
|
1201
|
-
s.appendChild(e),
|
|
1187
|
+
s.appendChild(e), H(e).forEach((r) => {
|
|
1202
1188
|
s.appendChild(r);
|
|
1203
1189
|
});
|
|
1204
1190
|
else {
|
|
1205
1191
|
const r = this.renderer.renderWrapper(!1);
|
|
1206
|
-
r.appendChild(e),
|
|
1192
|
+
r.appendChild(e), H(e).forEach((o) => {
|
|
1207
1193
|
r.appendChild(o);
|
|
1208
1194
|
}), i.appendChild(r);
|
|
1209
1195
|
}
|
|
1210
|
-
|
|
1196
|
+
J(e), F(e, !1);
|
|
1211
1197
|
}
|
|
1212
1198
|
convertItemToDefaultBlock(t, e) {
|
|
1213
1199
|
let i;
|
|
@@ -1217,19 +1203,19 @@ class G {
|
|
|
1217
1203
|
convertFirstItemToDefaultBlock() {
|
|
1218
1204
|
const t = this.currentItem;
|
|
1219
1205
|
if (t === null) return;
|
|
1220
|
-
const e =
|
|
1206
|
+
const e = H(t);
|
|
1221
1207
|
if (e.length !== 0) {
|
|
1222
1208
|
const r = e[0];
|
|
1223
|
-
this.unshiftItem(r),
|
|
1209
|
+
this.unshiftItem(r), F(t);
|
|
1224
1210
|
}
|
|
1225
|
-
const i =
|
|
1211
|
+
const i = X(t), s = this.api.blocks.getCurrentBlockIndex(), n = i === null;
|
|
1226
1212
|
this.convertItemToDefaultBlock(s, n);
|
|
1227
1213
|
}
|
|
1228
1214
|
renderItem(t, e) {
|
|
1229
1215
|
const i = e != null ? e : this.renderer.composeDefaultMeta();
|
|
1230
1216
|
switch (!0) {
|
|
1231
|
-
case this.renderer instanceof
|
|
1232
|
-
case this.renderer instanceof
|
|
1217
|
+
case this.renderer instanceof E:
|
|
1218
|
+
case this.renderer instanceof M:
|
|
1233
1219
|
}
|
|
1234
1220
|
return this.renderer.renderItem(t, i);
|
|
1235
1221
|
}
|
|
@@ -1244,8 +1230,8 @@ class G {
|
|
|
1244
1230
|
});
|
|
1245
1231
|
}
|
|
1246
1232
|
}
|
|
1247
|
-
const
|
|
1248
|
-
class
|
|
1233
|
+
const pe = /* @__PURE__ */ new Map([["Numeric", "numeric"], ["Lower Roman", "lower-roman"], ["Upper Roman", "upper-roman"], ["Lower Alpha", "lower-alpha"], ["Upper Alpha", "upper-alpha"]]);
|
|
1234
|
+
class K {
|
|
1249
1235
|
static get isReadOnlySupported() {
|
|
1250
1236
|
return !0;
|
|
1251
1237
|
}
|
|
@@ -1253,31 +1239,13 @@ class q {
|
|
|
1253
1239
|
return !0;
|
|
1254
1240
|
}
|
|
1255
1241
|
static get toolbox() {
|
|
1256
|
-
return [{ icon:
|
|
1257
|
-
<line x1="9" y1="7" x2="19" y2="7" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1258
|
-
<line x1="9" y1="12" x2="19" y2="12" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1259
|
-
<line x1="9" y1="17" x2="19" y2="17" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1260
|
-
<path d="M5.00001 17H4.99002" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1261
|
-
<path d="M5.00001 12H4.99002" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1262
|
-
<path d="M5.00001 7H4.99002" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1263
|
-
</svg>
|
|
1264
|
-
`, title: "Unordered List", data: { style: "unordered" } }, { icon: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1265
|
-
<line x1="12" y1="7" x2="19" y2="7" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1266
|
-
<line x1="12" y1="12" x2="19" y2="12" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1267
|
-
<line x1="12" y1="17" x2="19" y2="17" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1268
|
-
<path d="M7.79999 14L7.79999 7.2135C7.79999 7.12872 7.7011 7.0824 7.63597 7.13668L4.79999 9.5" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1269
|
-
</svg>
|
|
1270
|
-
`, title: "Ordered List", data: { style: "ordered" } }, { icon: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1271
|
-
<path d="M9.2 12L11.0586 13.8586C11.1367 13.9367 11.2633 13.9367 11.3414 13.8586L14.7 10.5" stroke="black" stroke-width="2" stroke-linecap="round"/>
|
|
1272
|
-
<rect x="5" y="5" width="14" height="14" rx="4" stroke="black" stroke-width="2"/>
|
|
1273
|
-
</svg>
|
|
1274
|
-
`, title: "Checklist", data: { style: "checklist" } }];
|
|
1242
|
+
return [{ icon: '<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>', title: "Unordered List", data: { style: "unordered" } }, { icon: '<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>', title: "Ordered List", data: { style: "ordered" } }, { 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="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>', title: "Checklist", data: { style: "checklist" } }];
|
|
1275
1243
|
}
|
|
1276
1244
|
static get pasteConfig() {
|
|
1277
1245
|
return { tags: ["OL", "UL", "LI"] };
|
|
1278
1246
|
}
|
|
1279
1247
|
static get conversionConfig() {
|
|
1280
|
-
return { export: (t) =>
|
|
1248
|
+
return { export: (t) => K.joinRecursive(t), import: (t, e) => ({ meta: {}, items: [{ content: t, meta: {}, items: [] }], style: (e == null ? void 0 : e.defaultStyle) !== void 0 ? e.defaultStyle : "unordered" }) };
|
|
1281
1249
|
}
|
|
1282
1250
|
get listStyle() {
|
|
1283
1251
|
return this.data.style || this.defaultListStyle;
|
|
@@ -1290,25 +1258,25 @@ class q {
|
|
|
1290
1258
|
}
|
|
1291
1259
|
constructor({ data: t, config: e, api: i, readOnly: s, block: n }) {
|
|
1292
1260
|
var o;
|
|
1293
|
-
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(
|
|
1261
|
+
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(pe.values());
|
|
1294
1262
|
const r = { style: this.defaultListStyle, meta: {}, items: [] };
|
|
1295
1263
|
this.data = Object.keys(t).length ? function(a) {
|
|
1296
|
-
const
|
|
1264
|
+
const d = [];
|
|
1297
1265
|
return function(l) {
|
|
1298
1266
|
return typeof l.items[0] == "string";
|
|
1299
1267
|
}(a) ? (a.items.forEach((l) => {
|
|
1300
|
-
|
|
1301
|
-
}), { style: a.style, meta: {}, items:
|
|
1268
|
+
d.push({ content: l, meta: {}, items: [] });
|
|
1269
|
+
}), { style: a.style, meta: {}, items: d }) : function(l) {
|
|
1302
1270
|
return typeof l.items[0] != "string" && "text" in l.items[0] && "checked" in l.items[0] && typeof l.items[0].text == "string" && typeof l.items[0].checked == "boolean";
|
|
1303
1271
|
}(a) ? (a.items.forEach((l) => {
|
|
1304
|
-
|
|
1305
|
-
}), { style: "checklist", meta: {}, items:
|
|
1272
|
+
d.push({ content: l.text, meta: { checked: l.checked }, items: [] });
|
|
1273
|
+
}), { style: "checklist", meta: {}, items: d }) : function(l) {
|
|
1306
1274
|
return !("meta" in l);
|
|
1307
1275
|
}(a) ? { style: a.style, meta: {}, items: a.items } : structuredClone(a);
|
|
1308
1276
|
}(t) : r, this.listStyle === "ordered" && this.data.meta.counterType === void 0 && (this.data.meta.counterType = "numeric"), this.changeTabulatorByStyle();
|
|
1309
1277
|
}
|
|
1310
1278
|
static joinRecursive(t) {
|
|
1311
|
-
return t.items.map((e) => `${e.content} ${
|
|
1279
|
+
return t.items.map((e) => `${e.content} ${K.joinRecursive(e)}`).join("");
|
|
1312
1280
|
}
|
|
1313
1281
|
render() {
|
|
1314
1282
|
return this.listElement = this.list.render(), this.listElement;
|
|
@@ -1334,28 +1302,20 @@ class q {
|
|
|
1334
1302
|
pasteHandler(t) {
|
|
1335
1303
|
return this.list.pasteHandler(t);
|
|
1336
1304
|
}
|
|
1337
|
-
changeCounters(t) {
|
|
1338
|
-
var e;
|
|
1339
|
-
(e = this.list) == null || e.changeCounters(t), this.data.meta.counterType = t;
|
|
1340
|
-
}
|
|
1341
|
-
changeStartWith(t) {
|
|
1342
|
-
var e;
|
|
1343
|
-
(e = this.list) == null || e.changeStartWith(t), this.data.meta.start = t;
|
|
1344
|
-
}
|
|
1345
1305
|
changeTabulatorByStyle() {
|
|
1346
1306
|
switch (this.listStyle) {
|
|
1347
1307
|
case "ordered":
|
|
1348
|
-
this.list = new
|
|
1308
|
+
this.list = new Z({ data: this.data, readOnly: this.readOnly, api: this.api, config: this.config, block: this.block }, new E(this.readOnly, this.config));
|
|
1349
1309
|
break;
|
|
1350
1310
|
case "unordered":
|
|
1351
|
-
this.list = new
|
|
1311
|
+
this.list = new Z({ data: this.data, readOnly: this.readOnly, api: this.api, config: this.config, block: this.block }, new M(this.readOnly, this.config));
|
|
1352
1312
|
break;
|
|
1353
1313
|
case "checklist":
|
|
1354
|
-
this.list = new
|
|
1314
|
+
this.list = new Z({ data: this.data, readOnly: this.readOnly, api: this.api, config: this.config, block: this.block }, new C(this.readOnly, this.config));
|
|
1355
1315
|
}
|
|
1356
1316
|
}
|
|
1357
1317
|
}
|
|
1358
|
-
class
|
|
1318
|
+
class ue {
|
|
1359
1319
|
constructor(t, e, i) {
|
|
1360
1320
|
this.holder = e, this.observer = null, this.debounceTimer = i, this.mutationDebouncer = this.debounce(() => {
|
|
1361
1321
|
t();
|
|
@@ -1395,11 +1355,12 @@ class se {
|
|
|
1395
1355
|
document.dispatchEvent(t), (e = this.observer) == null || e.disconnect();
|
|
1396
1356
|
}
|
|
1397
1357
|
}
|
|
1398
|
-
class
|
|
1358
|
+
class ge {
|
|
1399
1359
|
constructor({ editor: t, config: e = {}, onUpdate: i, maxLength: s }) {
|
|
1360
|
+
this.position = 0;
|
|
1400
1361
|
const n = { maxLength: 30, onUpdate() {
|
|
1401
|
-
}, config: { debounceTimer: 200, shortcuts: { undo: ["CMD+Z"], redo: ["CMD+Y", "CMD+SHIFT+Z"] } } }, { blocks: r, caret: o } = t, { configuration: a } = t, { holder:
|
|
1402
|
-
this.holder = typeof
|
|
1362
|
+
}, 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, h = n.config.shortcuts, { shortcuts: p } = e, u = { ...h, ...p }, g = Array.isArray(u.undo) ? u.undo : [u.undo], m = Array.isArray(u.redo) ? u.redo : [u.redo], f = n.config.debounceTimer, { debounceTimer: v = f } = e;
|
|
1363
|
+
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 ue(() => this.registerChange(), this.holder, this.config.debounceTimer).setMutationObserver(), this.setEventListeners(), this.initialItem = null, this.clear();
|
|
1403
1364
|
}
|
|
1404
1365
|
static get isReadOnlySupported() {
|
|
1405
1366
|
return !0;
|
|
@@ -1437,7 +1398,7 @@ class ne {
|
|
|
1437
1398
|
}
|
|
1438
1399
|
getCaretIndex(t) {
|
|
1439
1400
|
const e = this.holder.getElementsByClassName("ce-block__content");
|
|
1440
|
-
return new
|
|
1401
|
+
return new dt(e[t].firstChild).getPos();
|
|
1441
1402
|
}
|
|
1442
1403
|
insertDeletedBlock(t, e, i) {
|
|
1443
1404
|
for (let s = 0; s < t.length; s += 1) if (!e[s] || t[s].id !== e[s].id) {
|
|
@@ -1483,7 +1444,7 @@ class ne {
|
|
|
1483
1444
|
}
|
|
1484
1445
|
setCaretIndex(t, e) {
|
|
1485
1446
|
if (e && e !== -1) {
|
|
1486
|
-
const i = this.holder.getElementsByClassName("ce-block__content"), s = new
|
|
1447
|
+
const i = this.holder.getElementsByClassName("ce-block__content"), s = new dt(i[t].firstChild);
|
|
1487
1448
|
setTimeout(() => s.setPos(e), 50);
|
|
1488
1449
|
} else this.caret.setToBlock(t, "end");
|
|
1489
1450
|
}
|
|
@@ -1521,17 +1482,17 @@ class ne {
|
|
|
1521
1482
|
return i.push(s), i;
|
|
1522
1483
|
}
|
|
1523
1484
|
setEventListeners() {
|
|
1524
|
-
const { holder: t } = this, { shortcuts: e } = this.config, { undo: i, redo: s } = e, n = i.map((
|
|
1525
|
-
l(
|
|
1526
|
-
},
|
|
1527
|
-
l(
|
|
1485
|
+
const { holder: t } = this, { shortcuts: e } = this.config, { undo: i, redo: s } = e, n = i.map((u) => u.replace(/ /g, "").split("+")), r = s.map((u) => u.replace(/ /g, "").split("+")), o = n.map((u) => this.parseKeys(u)), a = r.map((u) => this.parseKeys(u)), d = (u, g) => g.reduce((m, f) => m || ((v, L) => L.length === 3 && v[L[0]] && v[L[1]] && v.key.toLowerCase() === L[2])(u, f), !1), l = (u, g, m) => !(!((f, v) => v.reduce((L, w) => L || ((I, B) => B.length === 2 && I[B[0]] && I.key.toLowerCase() === B[1])(f, w), !1))(u, g) || d(u, m)) || !!d(u, g), h = (u) => {
|
|
1486
|
+
l(u, o, a) && (u.preventDefault(), this.undo());
|
|
1487
|
+
}, p = (u) => {
|
|
1488
|
+
l(u, a, o) && (u.preventDefault(), this.redo());
|
|
1528
1489
|
};
|
|
1529
|
-
t.addEventListener("keydown",
|
|
1530
|
-
t.removeEventListener("keydown",
|
|
1490
|
+
t.addEventListener("keydown", h), t.addEventListener("keydown", p), t.addEventListener("destroy", () => {
|
|
1491
|
+
t.removeEventListener("keydown", h), t.removeEventListener("keydown", p);
|
|
1531
1492
|
});
|
|
1532
1493
|
}
|
|
1533
1494
|
}
|
|
1534
|
-
class
|
|
1495
|
+
class _ {
|
|
1535
1496
|
static get toolbox() {
|
|
1536
1497
|
return { icon: '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763693072662" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2633" id="mx_n_1763693072663" 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="#262626" p-id="2634"></path></svg>', title: "Alert" };
|
|
1537
1498
|
}
|
|
@@ -1557,7 +1518,7 @@ class M {
|
|
|
1557
1518
|
return { wrapper: "cdx-alert", wrapperForType: (t) => `cdx-alert-${t}`, wrapperForAlignType: (t) => `cdx-alert-align-${t}`, message: "cdx-alert__message" };
|
|
1558
1519
|
}
|
|
1559
1520
|
constructor({ data: t, config: e, api: i, readOnly: s }) {
|
|
1560
|
-
this.api = i, this.alertTypes = e.alertTypes ||
|
|
1521
|
+
this.api = i, this.alertTypes = e.alertTypes || _.ALERT_TYPES, this.defaultType = e.defaultType || _.DEFAULT_TYPE, this.defaultAlign = e.defaultAlign || _.DEFAULT_ALIGN_TYPE, this.messagePlaceholder = e.messagePlaceholder || _.DEFAULT_MESSAGE_PLACEHOLDER, this.data = { type: this.alertTypes.includes(t.type) ? t.type : this.defaultType, align: _.ALIGN_TYPES.includes(t.align) ? t.align : this.defaultAlign, message: t.message || "" }, this.container = void 0, this.readOnly = s;
|
|
1561
1522
|
}
|
|
1562
1523
|
static get isReadOnlySupported() {
|
|
1563
1524
|
return !0;
|
|
@@ -1603,20 +1564,20 @@ class M {
|
|
|
1603
1564
|
let n = this._getSettingIconStyle(s);
|
|
1604
1565
|
return n.setAttribute("data-type", s), this.api.tooltip.onHover(n, this.api.i18n.t(`alert-${s}`), { placement: "top" }), n.innerText = "A", e.appendChild(n), n;
|
|
1605
1566
|
}).forEach((s, n, r) => {
|
|
1606
|
-
const o = s.getAttribute("data-type");
|
|
1567
|
+
const o = s.getAttribute("data-type") || "";
|
|
1607
1568
|
s.addEventListener("click", () => {
|
|
1608
|
-
this._changeAlertType(o), r.forEach((a,
|
|
1569
|
+
this._changeAlertType(o), r.forEach((a, d) => {
|
|
1609
1570
|
const l = a.getAttribute("data-type");
|
|
1610
1571
|
a.classList.toggle("cdx-alert_setting__icon_active", l === this.data.type);
|
|
1611
1572
|
});
|
|
1612
1573
|
});
|
|
1613
|
-
}),
|
|
1574
|
+
}), _.ALIGN_TYPES.map((s) => {
|
|
1614
1575
|
let n;
|
|
1615
|
-
return s === "left" && (n = document.createElement("div"), n.classList.add("cdx-alert_setting__icon"), n.innerHTML =
|
|
1576
|
+
return s === "left" && (n = document.createElement("div"), n.classList.add("cdx-alert_setting__icon"), n.innerHTML = Bt), s === "right" && (n = document.createElement("div"), n.classList.add("cdx-alert_setting__icon"), n.innerHTML = At), s === "center" && (n = document.createElement("div"), n.classList.add("cdx-alert_setting__icon"), n.innerHTML = _t), n == null || n.setAttribute("data-align", s), this.api.tooltip.onHover(n, this.api.i18n.t(`align-${s}`), { placement: "top" }), i.appendChild(n), n;
|
|
1616
1577
|
}).forEach((s, n, r) => {
|
|
1617
|
-
const o = s.getAttribute("data-align");
|
|
1578
|
+
const o = s.getAttribute("data-align") || "";
|
|
1618
1579
|
s.addEventListener("click", () => {
|
|
1619
|
-
this._changeAlignType(o), r.forEach((a,
|
|
1580
|
+
this._changeAlignType(o), r.forEach((a, d) => {
|
|
1620
1581
|
const l = a == null ? void 0 : a.getAttribute("data-align");
|
|
1621
1582
|
a == null || a.classList.toggle("cdx-alert_setting__icon_active", l === this.data.align);
|
|
1622
1583
|
});
|
|
@@ -1633,19 +1594,19 @@ class M {
|
|
|
1633
1594
|
});
|
|
1634
1595
|
}
|
|
1635
1596
|
_changeAlignType(t) {
|
|
1636
|
-
this.data.align = t,
|
|
1597
|
+
this.data.align = t, _.ALIGN_TYPES.forEach((e) => {
|
|
1637
1598
|
const i = this.CSS.wrapperForAlignType(e);
|
|
1638
1599
|
this.container.classList.remove(i), t === e && this.container.classList.add(i);
|
|
1639
1600
|
});
|
|
1640
1601
|
}
|
|
1641
1602
|
save(t) {
|
|
1642
1603
|
const e = t.querySelector(`.${this.CSS.message}`);
|
|
1643
|
-
return { ...this.data, message: e.innerHTML };
|
|
1604
|
+
return { ...this.data, message: (e == null ? void 0 : e.innerHTML) || "" };
|
|
1644
1605
|
}
|
|
1645
|
-
_make(t, e
|
|
1606
|
+
_make(t, e, i = {}) {
|
|
1646
1607
|
let s = document.createElement(t);
|
|
1647
1608
|
Array.isArray(e) ? s.classList.add(...e) : e && s.classList.add(e);
|
|
1648
|
-
for (let n in i) s
|
|
1609
|
+
for (let n in i) s.setAttribute(n, i[n]);
|
|
1649
1610
|
return s;
|
|
1650
1611
|
}
|
|
1651
1612
|
onPaste(t) {
|
|
@@ -1659,15 +1620,15 @@ class M {
|
|
|
1659
1620
|
return { message: !0, type: !1, alignType: !1 };
|
|
1660
1621
|
}
|
|
1661
1622
|
}
|
|
1662
|
-
const
|
|
1623
|
+
const bt = { orientation: !1 }, b = class b {
|
|
1663
1624
|
constructor({ api: t, data: e, config: i, block: s, ...n }) {
|
|
1664
|
-
var o, a,
|
|
1625
|
+
var o, a, d, l, h, p;
|
|
1665
1626
|
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));
|
|
1666
|
-
const r = (
|
|
1667
|
-
this.data = { indentLevel: r, ...e != null ? e : {} }, this.config.multiblock && this.config.tuneName, window.addEventListener("resize", (
|
|
1668
|
-
var
|
|
1669
|
-
const g =
|
|
1670
|
-
((
|
|
1627
|
+
const r = (p = (h = this.config.customBlockIndentLimits[(l = (d = this.block) == null ? void 0 : d.name) != null ? l : ""]) == null ? void 0 : h.min) != null ? p : this.config.minIndent;
|
|
1628
|
+
this.data = { indentLevel: r, ...e != null ? e : {} }, this.config.multiblock && this.config.tuneName, window.addEventListener("resize", (u) => this.onResize.call(this, u)), this.api.events.on("block changed", ({ event: u }) => {
|
|
1629
|
+
var f;
|
|
1630
|
+
const g = u.detail.target.id;
|
|
1631
|
+
((f = this.block) == null ? void 0 : f.id) === g && this.shouldApplyAutoIndent && queueMicrotask(() => this.autoIndentBlock());
|
|
1671
1632
|
});
|
|
1672
1633
|
}
|
|
1673
1634
|
static get isTune() {
|
|
@@ -1692,32 +1653,32 @@ const pt = '<svg t="1763708081701" class="icon" viewBox="0 0 1024 1024" version=
|
|
|
1692
1653
|
if (queueMicrotask(() => {
|
|
1693
1654
|
t() && setTimeout(t, 300);
|
|
1694
1655
|
}), this.config.orientation === "vertical") {
|
|
1695
|
-
const a = `${this.TuneNames.indentLeft}-${(r = this.block) == null ? void 0 : r.id}`,
|
|
1696
|
-
return [{ title: this.rightText, hint: { title: this.api.i18n.t(this.rightText) }, onActivate: (l,
|
|
1656
|
+
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}`;
|
|
1657
|
+
return [{ title: this.rightText, hint: { title: this.api.i18n.t(this.rightText) }, onActivate: (l, h) => {
|
|
1697
1658
|
this.handleIndentRight(), l.title = this.rightText;
|
|
1698
|
-
}, icon:
|
|
1659
|
+
}, icon: wt, name: d }, { title: this.leftText, hint: { title: this.api.i18n.t(this.leftText) }, onActivate: (l, h) => {
|
|
1699
1660
|
this.handleIndentLeft(), l.title = this.leftText;
|
|
1700
|
-
}, icon:
|
|
1661
|
+
}, icon: kt, name: a }];
|
|
1701
1662
|
}
|
|
1702
1663
|
const e = `
|
|
1703
1664
|
<div class="${this.CSS.popoverItem} ${this.CSS.customPopoverItem}" data-item-name='indent' version=${this.config.version}>
|
|
1704
|
-
<button type="button" class="${this.CSS.popoverItemIcon}" data-${this.TuneNames.indentLeft}>${
|
|
1665
|
+
<button type="button" class="${this.CSS.popoverItemIcon}" data-${this.TuneNames.indentLeft}>${kt}</button>
|
|
1705
1666
|
<span class="${this.CSS.popoverItemTitle}">${this.api.sanitizer.clean(this.api.i18n.t("Indent"), {})}</span>
|
|
1706
|
-
<button type="button" class="${this.CSS.popoverItemIcon}" data-${this.TuneNames.indentRight} style="margin-left:10px;">${
|
|
1667
|
+
<button type="button" class="${this.CSS.popoverItemIcon}" data-${this.TuneNames.indentRight} style="margin-left:10px;">${wt}</button>
|
|
1707
1668
|
</div>
|
|
1708
1669
|
`, i = this.createElementFromTemplate(e), s = i.querySelector(`[data-${this.TuneNames.indentRight}]`), n = i.querySelector(`[data-${this.TuneNames.indentLeft}]`);
|
|
1709
1670
|
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;
|
|
1710
1671
|
}
|
|
1711
1672
|
wrap(t) {
|
|
1712
1673
|
var i, s, n, r, o;
|
|
1713
|
-
this.wrapper.appendChild(t), this.wrapper.setAttribute(
|
|
1674
|
+
this.wrapper.appendChild(t), this.wrapper.setAttribute(b.DATA_WRAPPER_NAME, "");
|
|
1714
1675
|
let e = !!this.config.highlightIndent;
|
|
1715
1676
|
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) {
|
|
1716
1677
|
const a = this.createElementFromTemplate(`
|
|
1717
1678
|
<div class="${(o = (r = this.config.highlightIndent) == null ? void 0 : r.className) != null ? o : ""} ${this.CSS.highlightIndent}">
|
|
1718
1679
|
</div>
|
|
1719
|
-
`),
|
|
1720
|
-
|
|
1680
|
+
`), d = t.classList.contains(this.EditorCSS.content) ? t : t.querySelector(`.${this.EditorCSS.content}`);
|
|
1681
|
+
d == null || d.appendChild(a);
|
|
1721
1682
|
}
|
|
1722
1683
|
return this.applyStylesToWrapper(this.wrapper, this.data.indentLevel), this.wrapper.addEventListener("keydown", (...a) => this.onKeyDown.apply(this, a), { capture: !0 }), this.wrapper.addEventListener("focus", (a) => this.onFocus.call(this, a), { capture: !0 }), this.wrapper.addEventListener("blur", (a) => this.onBlur.call(this, a), { capture: !0 }), this.wrapper;
|
|
1723
1684
|
}
|
|
@@ -1796,14 +1757,14 @@ const pt = '<svg t="1763708081701" class="icon" viewBox="0 0 1024 1024" version=
|
|
|
1796
1757
|
const s = this.getGlobalSelectedBlocks();
|
|
1797
1758
|
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));
|
|
1798
1759
|
this.config.tuneName && s.forEach(async (a) => {
|
|
1799
|
-
var
|
|
1800
|
-
const
|
|
1801
|
-
if (!
|
|
1802
|
-
const l =
|
|
1760
|
+
var p, u, g, m;
|
|
1761
|
+
const d = await a.save();
|
|
1762
|
+
if (!d || !("tunes" in d) || typeof d.tunes != "object" || !d.tunes) return;
|
|
1763
|
+
const l = d.tunes[(p = this.config.tuneName) != null ? p : ""];
|
|
1803
1764
|
if (!l) return;
|
|
1804
|
-
l.indentLevel = i ? Math.min(this.config.maxIndent, ((
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1765
|
+
l.indentLevel = i ? Math.min(this.config.maxIndent, ((u = l.indentLevel) != null ? u : 0) + 1) : Math.max(0, ((g = l.indentLevel) != null ? g : 0) - 1), (m = a.dispatchChange) == null || m.call(a);
|
|
1766
|
+
const h = this.getWrapperBlockById(a.id);
|
|
1767
|
+
h instanceof HTMLElement && this.applyStylesToWrapper(h, l.indentLevel);
|
|
1807
1768
|
});
|
|
1808
1769
|
}
|
|
1809
1770
|
handleIndentLeft() {
|
|
@@ -1824,7 +1785,7 @@ const pt = '<svg t="1763708081701" class="icon" viewBox="0 0 1024 1024" version=
|
|
|
1824
1785
|
var r, o;
|
|
1825
1786
|
const t = this.api.blocks.getBlockIndex(this.block.id), e = this.api.blocks.getBlockByIndex(t - 1);
|
|
1826
1787
|
if (!e) return;
|
|
1827
|
-
const i = (o = (r = e.holder) == null ? void 0 : r.querySelector(`[${
|
|
1788
|
+
const i = (o = (r = e.holder) == null ? void 0 : r.querySelector(`[${b.DATA_WRAPPER_NAME}]`)) == null ? void 0 : o.getAttribute(b.DATA_INDENT_LEVEL), s = Number(i != null ? i : 0), n = Math.min(Math.max(s, this.minIndent), this.maxIndent);
|
|
1828
1789
|
this.data.indentLevel = n, this.applyStylesToWrapper(this.wrapper, this.data.indentLevel);
|
|
1829
1790
|
}
|
|
1830
1791
|
toggleDisableStateForButtons() {
|
|
@@ -1843,27 +1804,27 @@ const pt = '<svg t="1763708081701" class="icon" viewBox="0 0 1024 1024" version=
|
|
|
1843
1804
|
var e;
|
|
1844
1805
|
return (e = this.getTuneByName(t)) == null ? void 0 : e.querySelector(`.${this.CSS.popoverItemTitle}`);
|
|
1845
1806
|
}
|
|
1846
|
-
applyStylesToWrapper(t, e = parseInt(t.getAttribute(
|
|
1807
|
+
applyStylesToWrapper(t, e = parseInt(t.getAttribute(b.DATA_INDENT_LEVEL) || "0")) {
|
|
1847
1808
|
const i = e * this.config.indentSize;
|
|
1848
|
-
t.setAttribute(
|
|
1809
|
+
t.setAttribute(b.DATA_INDENT_LEVEL, e.toString());
|
|
1849
1810
|
const s = t.querySelector(`.${this.EditorCSS.content}`), n = this.getBlockForWrapper(t) || document.querySelector(`.${this.EditorCSS.redactor}`);
|
|
1850
1811
|
if (!(s instanceof HTMLElement && n)) return;
|
|
1851
1812
|
const r = n.getBoundingClientRect().width;
|
|
1852
1813
|
if (r === 0) return void queueMicrotask(() => this.applyStylesToWrapper.bind(this)(t, e));
|
|
1853
|
-
const o = (r - this.maxWidthForContent(t)) / 2, a = Math.max(0, Math.min(o, i)),
|
|
1854
|
-
this.isDirectionInverted ? (t.style.paddingLeft = "0px", t.style.paddingRight =
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1814
|
+
const o = (r - this.maxWidthForContent(t)) / 2, a = Math.max(0, Math.min(o, i)), d = 2 * a + "px", l = `${a}px`;
|
|
1815
|
+
this.isDirectionInverted ? (t.style.paddingLeft = "0px", t.style.paddingRight = d) : (t.style.paddingLeft = d, t.style.paddingRight = "0px");
|
|
1816
|
+
const h = t.querySelector(`.${this.CSS.highlightIndent}`);
|
|
1817
|
+
h instanceof HTMLElement && (this.isDirectionInverted ? (h.style.width = l, h.style.left = "100%", h.style.right = "") : (h.style.width = l, h.style.left = "", h.style.right = "100%"));
|
|
1857
1818
|
}
|
|
1858
1819
|
onFocus(t) {
|
|
1859
|
-
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.setAttribute(
|
|
1820
|
+
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.setAttribute(b.DATA_FOCUSED, "");
|
|
1860
1821
|
}
|
|
1861
1822
|
onBlur(t) {
|
|
1862
|
-
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.removeAttribute(
|
|
1823
|
+
t.target instanceof HTMLElement && this.wrapper.contains(t.target) && this.wrapper.removeAttribute(b.DATA_FOCUSED);
|
|
1863
1824
|
}
|
|
1864
1825
|
onResize(t) {
|
|
1865
1826
|
this.lastResizeTimeout && clearTimeout(this.lastResizeTimeout), this.lastResizeTimeout = setTimeout(() => {
|
|
1866
|
-
document.querySelectorAll(`[${
|
|
1827
|
+
document.querySelectorAll(`[${b.DATA_WRAPPER_NAME}]`).forEach((e) => {
|
|
1867
1828
|
e instanceof HTMLElement && this.applyStylesToWrapper(e);
|
|
1868
1829
|
});
|
|
1869
1830
|
}, 500);
|
|
@@ -1873,8 +1834,8 @@ const pt = '<svg t="1763708081701" class="icon" viewBox="0 0 1024 1024" version=
|
|
|
1873
1834
|
}
|
|
1874
1835
|
getWrapperBlockById(t) {
|
|
1875
1836
|
var i, s, n;
|
|
1876
|
-
const e = `.${this.EditorCSS.block}[data-id="${t}"] [${
|
|
1877
|
-
return (n = (s = document.querySelector(e)) != null ? s : (i = this.api.blocks.getById(t)) == null ? void 0 : i.holder.querySelector(`[${
|
|
1837
|
+
const e = `.${this.EditorCSS.block}[data-id="${t}"] [${b.DATA_WRAPPER_NAME}]`;
|
|
1838
|
+
return (n = (s = document.querySelector(e)) != null ? s : (i = this.api.blocks.getById(t)) == null ? void 0 : i.holder.querySelector(`[${b.DATA_WRAPPER_NAME}]`)) != null ? n : null;
|
|
1878
1839
|
}
|
|
1879
1840
|
getBlockForWrapper(t) {
|
|
1880
1841
|
let e = t;
|
|
@@ -1897,7 +1858,7 @@ const pt = '<svg t="1763708081701" class="icon" viewBox="0 0 1024 1024" version=
|
|
|
1897
1858
|
return new DOMParser().parseFromString(t, "text/html").body.firstChild;
|
|
1898
1859
|
}
|
|
1899
1860
|
changeConfigBasedOnVersionIfNeeded() {
|
|
1900
|
-
this.config.version && this.config.version < "2.27" && this.config.orientation === "vertical" && (this.config.orientation = "horizontal",
|
|
1861
|
+
this.config.version && this.config.version < "2.27" && this.config.orientation === "vertical" && (this.config.orientation = "horizontal", bt.orientation, bt.orientation = !0);
|
|
1901
1862
|
}
|
|
1902
1863
|
maxWidthForContent(t) {
|
|
1903
1864
|
const e = t.querySelector(`.${this.EditorCSS.content}`);
|
|
@@ -1908,9 +1869,12 @@ const pt = '<svg t="1763708081701" class="icon" viewBox="0 0 1024 1024" version=
|
|
|
1908
1869
|
return this.cachedMaxWidthForContent !== null || (this.cachedMaxWidthForContent = 650), this.cachedMaxWidthForContent;
|
|
1909
1870
|
}
|
|
1910
1871
|
};
|
|
1911
|
-
|
|
1912
|
-
let
|
|
1913
|
-
class
|
|
1872
|
+
b.DATA_WRAPPER_NAME = "data-block-indent-wrapper", b.DATA_FOCUSED = "data-focused", b.DATA_INDENT_LEVEL = "data-indent-level";
|
|
1873
|
+
let nt = b;
|
|
1874
|
+
class W {
|
|
1875
|
+
static get toolboxIcon() {
|
|
1876
|
+
return vt;
|
|
1877
|
+
}
|
|
1914
1878
|
static get CSS() {
|
|
1915
1879
|
return "cdx-marker";
|
|
1916
1880
|
}
|
|
@@ -1921,34 +1885,36 @@ class N {
|
|
|
1921
1885
|
return !0;
|
|
1922
1886
|
}
|
|
1923
1887
|
render() {
|
|
1924
|
-
return this.button = document.createElement("button"), this.button.type
|
|
1888
|
+
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;
|
|
1925
1889
|
}
|
|
1926
1890
|
surround(t) {
|
|
1927
1891
|
if (!t) return;
|
|
1928
|
-
let e = this.api.selection.findParentTag(this.tag,
|
|
1892
|
+
let e = this.api.selection.findParentTag(this.tag, W.CSS);
|
|
1929
1893
|
e ? this.unwrap(e) : this.wrap(t);
|
|
1930
1894
|
}
|
|
1931
1895
|
wrap(t) {
|
|
1932
1896
|
let e = document.createElement(this.tag);
|
|
1933
|
-
e.classList.add(
|
|
1897
|
+
e.classList.add(W.CSS), e.appendChild(t.extractContents()), t.insertNode(e), this.api.selection.expandToTag(e);
|
|
1934
1898
|
}
|
|
1935
1899
|
unwrap(t) {
|
|
1900
|
+
var n;
|
|
1936
1901
|
this.api.selection.expandToTag(t);
|
|
1937
|
-
let e = window.getSelection(), i = e.getRangeAt(0), s = i.extractContents();
|
|
1938
|
-
t.parentNode.removeChild(t), i.insertNode(s), e.removeAllRanges(), e.addRange(i);
|
|
1902
|
+
let e = window.getSelection(), i = e == null ? void 0 : e.getRangeAt(0), s = i == null ? void 0 : i.extractContents();
|
|
1903
|
+
(n = t == null ? void 0 : t.parentNode) == null || n.removeChild(t), s && (i == null || i.insertNode(s)), e == null || e.removeAllRanges(), i && (e == null || e.addRange(i));
|
|
1939
1904
|
}
|
|
1940
1905
|
checkState() {
|
|
1941
|
-
|
|
1942
|
-
this.
|
|
1906
|
+
var e;
|
|
1907
|
+
const t = this.api.selection.findParentTag(this.tag, W.CSS);
|
|
1908
|
+
(e = this.button) == null || e.classList.toggle(this.iconClasses.active, !!t);
|
|
1943
1909
|
}
|
|
1944
1910
|
get toolboxIcon() {
|
|
1945
|
-
return
|
|
1911
|
+
return vt;
|
|
1946
1912
|
}
|
|
1947
1913
|
static get sanitize() {
|
|
1948
|
-
return { mark: { class:
|
|
1914
|
+
return { mark: { class: W.CSS } };
|
|
1949
1915
|
}
|
|
1950
1916
|
}
|
|
1951
|
-
class
|
|
1917
|
+
class me {
|
|
1952
1918
|
constructor(t) {
|
|
1953
1919
|
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;
|
|
1954
1920
|
const { api: e, config: i } = t;
|
|
@@ -1962,8 +1928,7 @@ class re {
|
|
|
1962
1928
|
}
|
|
1963
1929
|
render() {
|
|
1964
1930
|
const t = document.createElement("button");
|
|
1965
|
-
return t.type = "button", t.innerHTML =
|
|
1966
|
-
<path d="M20 17.4615C20 18.3112 19.3284 19 18.5 19C17.6716 19 17 18.3112 17 17.4615C17 16.6119 17.9 15.6154 18.5 15C19.1 15.6154 20 16.6119 20 17.4615Z" stroke="black" stroke-width="2"/></svg>`, t.classList.add(this.api.styles.inlineToolButton), t.addEventListener("mousedown", (e) => {
|
|
1931
|
+
return t.type = "button", t.innerHTML = '<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.24296 11.4075C5.23167 10.6253 5.52446 9.8395 6.12132 9.24264L9.65686 5.70711C10.0474 5.31658 10.6809 5.31693 11.0714 5.70745L16.0205 10.6565C16.2268 10.8629 16.3243 11.1371 16.3126 11.4075M5.24296 11.4075C5.25382 12.1607 5.54661 12.9106 6.12132 13.4853L8 15.364M5.24296 11.4075H11.9565M16.3126 11.4075C16.3022 11.6487 16.205 11.8869 16.0208 12.0711L12.4853 15.6066C11.3137 16.7782 9.41421 16.7782 8.24264 15.6066L8 15.364M16.3126 11.4075H11.9565M8 15.364L11.9565 11.4075"/><path stroke="currentColor" stroke-width="2" d="M20 17.4615C20 18.3112 19.3284 19 18.5 19C17.6716 19 17 18.3112 17 17.4615C17 16.6119 17.9 15.6154 18.5 15C19.1 15.6154 20 16.6119 20 17.4615Z"/></svg>', t.classList.add(this.api.styles.inlineToolButton), t.addEventListener("mousedown", (e) => {
|
|
1967
1932
|
e.preventDefault();
|
|
1968
1933
|
}), t;
|
|
1969
1934
|
}
|
|
@@ -1988,11 +1953,11 @@ class re {
|
|
|
1988
1953
|
return { span: { style: { color: !0 } } };
|
|
1989
1954
|
}
|
|
1990
1955
|
}
|
|
1991
|
-
class
|
|
1956
|
+
class fe extends me {
|
|
1992
1957
|
static get sanitize() {
|
|
1993
1958
|
}
|
|
1994
1959
|
}
|
|
1995
|
-
const
|
|
1960
|
+
const z = class z {
|
|
1996
1961
|
constructor(t) {
|
|
1997
1962
|
this.tag = "U", this.api = t.api, this.iconClasses = { base: this.api.styles.inlineToolButton, active: this.api.styles.inlineToolButtonActive };
|
|
1998
1963
|
}
|
|
@@ -2004,12 +1969,12 @@ const O = class O {
|
|
|
2004
1969
|
}
|
|
2005
1970
|
surround(t) {
|
|
2006
1971
|
if (!t) return;
|
|
2007
|
-
const e = this.api.selection.findParentTag(this.tag,
|
|
1972
|
+
const e = this.api.selection.findParentTag(this.tag, z.CSS);
|
|
2008
1973
|
e ? this.unwrap(e) : this.wrap(t);
|
|
2009
1974
|
}
|
|
2010
1975
|
wrap(t) {
|
|
2011
1976
|
const e = document.createElement(this.tag);
|
|
2012
|
-
e.classList.add(
|
|
1977
|
+
e.classList.add(z.CSS), e.appendChild(t.extractContents()), t.insertNode(e), this.api.selection.expandToTag(e);
|
|
2013
1978
|
}
|
|
2014
1979
|
unwrap(t) {
|
|
2015
1980
|
var n;
|
|
@@ -2023,22 +1988,19 @@ const O = class O {
|
|
|
2023
1988
|
}
|
|
2024
1989
|
checkState() {
|
|
2025
1990
|
var e;
|
|
2026
|
-
const t = this.api.selection.findParentTag(this.tag,
|
|
1991
|
+
const t = this.api.selection.findParentTag(this.tag, z.CSS);
|
|
2027
1992
|
return (e = this.button) == null || e.classList.toggle(this.iconClasses.active, !!t), !!t;
|
|
2028
1993
|
}
|
|
2029
1994
|
get toolboxIcon() {
|
|
2030
|
-
return
|
|
2031
|
-
<path 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" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2032
|
-
<path d="M7.71429 18H16.2857" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2033
|
-
</svg>`;
|
|
1995
|
+
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>';
|
|
2034
1996
|
}
|
|
2035
1997
|
static get sanitize() {
|
|
2036
|
-
return { u: { class:
|
|
1998
|
+
return { u: { class: z.CSS } };
|
|
2037
1999
|
}
|
|
2038
2000
|
};
|
|
2039
|
-
|
|
2040
|
-
let
|
|
2041
|
-
class
|
|
2001
|
+
z.isInline = !0;
|
|
2002
|
+
let rt = z;
|
|
2003
|
+
class $ {
|
|
2042
2004
|
constructor({ api: t }) {
|
|
2043
2005
|
this.tag = "CODE", this.api = t, this.button = null, this.iconClasses = { base: this.api.styles.inlineToolButton, active: this.api.styles.inlineToolButtonActive };
|
|
2044
2006
|
}
|
|
@@ -2054,12 +2016,12 @@ class W {
|
|
|
2054
2016
|
surround(t) {
|
|
2055
2017
|
var i;
|
|
2056
2018
|
if (!t) return;
|
|
2057
|
-
let e = this.api.selection.findParentTag(this.tag,
|
|
2019
|
+
let e = this.api.selection.findParentTag(this.tag, $.CSS);
|
|
2058
2020
|
e ? this.unwrap(e) : (i = t.commonAncestorContainer.parentElement) != null && i.querySelector(this.tag) || this.wrap(t);
|
|
2059
2021
|
}
|
|
2060
2022
|
wrap(t) {
|
|
2061
2023
|
let e = document.createElement(this.tag);
|
|
2062
|
-
e.classList.add(
|
|
2024
|
+
e.classList.add($.CSS), e.appendChild(t.extractContents()), t.insertNode(e), this.api.selection.expandToTag(e);
|
|
2063
2025
|
}
|
|
2064
2026
|
unwrap(t) {
|
|
2065
2027
|
var n;
|
|
@@ -2070,42 +2032,39 @@ class W {
|
|
|
2070
2032
|
(n = t.parentNode) == null || n.removeChild(t), i.insertNode(s), e.removeAllRanges(), e.addRange(i);
|
|
2071
2033
|
}
|
|
2072
2034
|
checkState() {
|
|
2073
|
-
const t = this.api.selection.findParentTag(this.tag,
|
|
2035
|
+
const t = this.api.selection.findParentTag(this.tag, $.CSS);
|
|
2074
2036
|
return this.button && this.button.classList.toggle(this.iconClasses.active, !!t), !!t;
|
|
2075
2037
|
}
|
|
2076
2038
|
get toolboxIcon() {
|
|
2077
|
-
return
|
|
2078
|
-
<path d="M9 8L5 12L9 16" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2079
|
-
<path d="M15 8L19 12L15 16" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2080
|
-
</svg>
|
|
2081
|
-
`;
|
|
2039
|
+
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>';
|
|
2082
2040
|
}
|
|
2083
2041
|
static get sanitize() {
|
|
2084
|
-
return { code: { class:
|
|
2042
|
+
return { code: { class: $.CSS } };
|
|
2085
2043
|
}
|
|
2086
2044
|
}
|
|
2087
|
-
function
|
|
2088
|
-
const i = document.createElement(
|
|
2045
|
+
function T(c, t, e = {}) {
|
|
2046
|
+
const i = document.createElement(c);
|
|
2089
2047
|
Array.isArray(t) ? i.classList.add(...t) : t && i.classList.add(t);
|
|
2090
|
-
for (const s in e) Object.prototype.hasOwnProperty.call(e, s) && (
|
|
2048
|
+
for (const s in e) Object.prototype.hasOwnProperty.call(e, s) && i.setAttribute(s, e[s]);
|
|
2091
2049
|
return i;
|
|
2092
2050
|
}
|
|
2093
|
-
function
|
|
2094
|
-
const t =
|
|
2051
|
+
function yt(c) {
|
|
2052
|
+
const t = c.getBoundingClientRect();
|
|
2095
2053
|
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) };
|
|
2096
2054
|
}
|
|
2097
|
-
function
|
|
2098
|
-
const e =
|
|
2055
|
+
function Q(c, t) {
|
|
2056
|
+
const e = yt(c), i = yt(t);
|
|
2099
2057
|
return { fromTopBorder: i.y1 - e.y1, fromLeftBorder: i.x1 - e.x1, fromRightBorder: e.x2 - i.x2, fromBottomBorder: e.y2 - i.y2 };
|
|
2100
2058
|
}
|
|
2101
|
-
function
|
|
2102
|
-
|
|
2059
|
+
function St(c, t) {
|
|
2060
|
+
var e;
|
|
2061
|
+
return (e = t == null ? void 0 : t.parentNode) == null ? void 0 : e.insertBefore(c, t);
|
|
2103
2062
|
}
|
|
2104
|
-
function
|
|
2063
|
+
function Lt(c, t = !0) {
|
|
2105
2064
|
const e = document.createRange(), i = window.getSelection();
|
|
2106
|
-
e.selectNodeContents(
|
|
2065
|
+
e.selectNodeContents(c), e.collapse(t), i == null || i.removeAllRanges(), i == null || i.addRange(e);
|
|
2107
2066
|
}
|
|
2108
|
-
class
|
|
2067
|
+
class y {
|
|
2109
2068
|
constructor({ items: t }) {
|
|
2110
2069
|
this.items = t, this.wrapper = void 0, this.itemEls = [];
|
|
2111
2070
|
}
|
|
@@ -2113,46 +2072,51 @@ class C {
|
|
|
2113
2072
|
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" };
|
|
2114
2073
|
}
|
|
2115
2074
|
render() {
|
|
2116
|
-
return this.wrapper =
|
|
2117
|
-
|
|
2118
|
-
i.
|
|
2075
|
+
return this.wrapper = T("div", y.CSS.popover), this.items.forEach((t, e) => {
|
|
2076
|
+
var r;
|
|
2077
|
+
const i = T("div", y.CSS.item), s = T("div", y.CSS.itemIcon, { innerHTML: t.icon }), n = T("div", y.CSS.itemLabel, { textContent: t.label });
|
|
2078
|
+
i.dataset.index = e + "", i.appendChild(s), i.appendChild(n), (r = this.wrapper) == null || r.appendChild(i), this.itemEls.push(i);
|
|
2119
2079
|
}), this.wrapper.addEventListener("click", (t) => {
|
|
2120
2080
|
this.popoverClicked(t);
|
|
2121
2081
|
}), this.wrapper;
|
|
2122
2082
|
}
|
|
2123
2083
|
popoverClicked(t) {
|
|
2124
|
-
const e = t.target.closest(`.${
|
|
2084
|
+
const e = t.target.closest(`.${y.CSS.item}`);
|
|
2125
2085
|
if (!e) return;
|
|
2126
|
-
const i = e.dataset.index
|
|
2086
|
+
const i = e.dataset.index;
|
|
2087
|
+
if (!i) return;
|
|
2088
|
+
const s = this.items[parseInt(i)];
|
|
2127
2089
|
!s.confirmationRequired || this.hasConfirmationState(e) ? s.onClick() : this.setConfirmationState(e);
|
|
2128
2090
|
}
|
|
2129
2091
|
setConfirmationState(t) {
|
|
2130
|
-
t.classList.add(
|
|
2092
|
+
t.classList.add(y.CSS.itemConfirmState);
|
|
2131
2093
|
}
|
|
2132
2094
|
clearConfirmationState(t) {
|
|
2133
|
-
t.classList.remove(
|
|
2095
|
+
t.classList.remove(y.CSS.itemConfirmState);
|
|
2134
2096
|
}
|
|
2135
2097
|
hasConfirmationState(t) {
|
|
2136
|
-
return t.classList.contains(
|
|
2098
|
+
return t.classList.contains(y.CSS.itemConfirmState);
|
|
2137
2099
|
}
|
|
2138
2100
|
get opened() {
|
|
2139
|
-
|
|
2101
|
+
var t;
|
|
2102
|
+
return ((t = this.wrapper) == null ? void 0 : t.classList.contains(y.CSS.popoverOpened)) || !1;
|
|
2140
2103
|
}
|
|
2141
2104
|
open() {
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2105
|
+
var t;
|
|
2106
|
+
this.items.forEach((e, i) => {
|
|
2107
|
+
typeof e.hideIf == "function" && this.itemEls[i].classList.toggle(y.CSS.itemHidden, e.hideIf());
|
|
2108
|
+
}), (t = this.wrapper) == null || t.classList.add(y.CSS.popoverOpened);
|
|
2145
2109
|
}
|
|
2146
2110
|
close() {
|
|
2147
|
-
|
|
2148
|
-
|
|
2111
|
+
var t;
|
|
2112
|
+
(t = this.wrapper) == null || t.classList.remove(y.CSS.popoverOpened), this.itemEls.forEach((e) => {
|
|
2113
|
+
this.clearConfirmationState(e);
|
|
2149
2114
|
});
|
|
2150
2115
|
}
|
|
2151
2116
|
}
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
this.api = t, this.items = e, this.onOpen = i, this.onClose = s, this.cssModifier = n, this.popover = null, this.wrapper = this.createToolbox();
|
|
2117
|
+
class O {
|
|
2118
|
+
constructor({ items: t, onOpen: e, onClose: i, cssModifier: s = "" }) {
|
|
2119
|
+
this.items = t, this.onOpen = e, this.onClose = i, this.cssModifier = s, this.popover = null, this.wrapper = this.createToolbox();
|
|
2156
2120
|
}
|
|
2157
2121
|
static get CSS() {
|
|
2158
2122
|
return { toolbox: "tc-toolbox", toolboxShowed: "tc-toolbox--showed", toggler: "tc-toolbox__toggler" };
|
|
@@ -2161,19 +2125,19 @@ class I {
|
|
|
2161
2125
|
return this.wrapper;
|
|
2162
2126
|
}
|
|
2163
2127
|
createToolbox() {
|
|
2164
|
-
const t =
|
|
2128
|
+
const t = T("div", [O.CSS.toolbox, this.cssModifier ? `${O.CSS.toolbox}--${this.cssModifier}` : ""]);
|
|
2165
2129
|
t.dataset.mutationFree = "true";
|
|
2166
2130
|
const e = this.createPopover(), i = this.createToggler();
|
|
2167
2131
|
return t.appendChild(i), t.appendChild(e), t;
|
|
2168
2132
|
}
|
|
2169
2133
|
createToggler() {
|
|
2170
|
-
const t =
|
|
2134
|
+
const t = T("div", O.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>' });
|
|
2171
2135
|
return t.addEventListener("click", () => {
|
|
2172
2136
|
this.togglerClicked();
|
|
2173
2137
|
}), t;
|
|
2174
2138
|
}
|
|
2175
2139
|
createPopover() {
|
|
2176
|
-
return this.popover = new
|
|
2140
|
+
return this.popover = new y({ items: this.items }), this.popover.render();
|
|
2177
2141
|
}
|
|
2178
2142
|
togglerClicked() {
|
|
2179
2143
|
var t, e;
|
|
@@ -2182,30 +2146,31 @@ class I {
|
|
|
2182
2146
|
show(t) {
|
|
2183
2147
|
const e = t();
|
|
2184
2148
|
Object.entries(e).forEach(([i, s]) => {
|
|
2185
|
-
this.wrapper.style
|
|
2186
|
-
}), this.wrapper.classList.add(
|
|
2149
|
+
this.wrapper.style.setProperty(i, s);
|
|
2150
|
+
}), this.wrapper.classList.add(O.CSS.toolboxShowed);
|
|
2187
2151
|
}
|
|
2188
2152
|
hide() {
|
|
2189
2153
|
var t;
|
|
2190
|
-
(t = this.popover) == null || t.close(), this.wrapper.classList.remove(
|
|
2154
|
+
(t = this.popover) == null || t.close(), this.wrapper.classList.remove(O.CSS.toolboxShowed);
|
|
2191
2155
|
}
|
|
2192
2156
|
}
|
|
2193
|
-
const
|
|
2194
|
-
class
|
|
2157
|
+
const xt = "tc-wrap", Ce = "tc-wrap--readonly", Tt = "tc-table", D = "tc-row", Et = "tc-table--heading", tt = "tc-row--selected", N = "tc-cell", et = "tc-cell--selected", it = "tc-add-row", Mt = "tc-add-row--disabled", st = "tc-add-column", It = "tc-add-column--disabled";
|
|
2158
|
+
class ve {
|
|
2195
2159
|
constructor(t, e, i, s) {
|
|
2196
2160
|
this.minCellWidhth = 50, this.defaultCellWidth = 100, this.handleDocumentMousedown = (n) => {
|
|
2197
|
-
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.
|
|
2161
|
+
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);
|
|
2198
2162
|
}, this.handleDocumentMousemove = (n) => {
|
|
2199
2163
|
if (!this.isDragging) return;
|
|
2200
2164
|
const r = n.clientX - this.mouseStartX, o = Math.max(this.startWidth + r, this.minCellWidhth);
|
|
2201
2165
|
this.colWidthArr[this.draggingColumn - 1] = o, this.updateColWidth();
|
|
2202
|
-
}, this.handleDocumentMouseup = (
|
|
2166
|
+
}, this.handleDocumentMouseup = () => {
|
|
2203
2167
|
this.updateToolboxesPosition(), this.isDragging = !1, this.table.classList.remove("table-resizing"), document.removeEventListener("mousemove", this.handleDocumentMousemove), document.removeEventListener("mouseup", this.handleDocumentMouseup);
|
|
2204
|
-
}, 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.
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2168
|
+
}, 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.length > 0 && (this.colWidthArr = this.data.colWidth), this.updateColWidth(), this.fill(), this.focusedCell = { row: 0, column: 0 }, this.documentClicked = (n) => {
|
|
2169
|
+
let r = n.target;
|
|
2170
|
+
const o = r.closest(`.${Tt}`) !== null, a = r.closest(`.${xt}`) === null;
|
|
2171
|
+
(o || a) && this.hideToolboxes();
|
|
2172
|
+
const d = r.closest(`.${it}`), l = r.closest(`.${st}`);
|
|
2173
|
+
d && d.parentNode === this.wrapper ? (this.addRow(void 0, !0), this.hideToolboxes()) : l && l.parentNode === this.wrapper && (this.addColumn(void 0, !0), this.hideToolboxes());
|
|
2209
2174
|
}, this.readOnly || this.bindEvents();
|
|
2210
2175
|
}
|
|
2211
2176
|
getWrapper() {
|
|
@@ -2222,17 +2187,17 @@ class le {
|
|
|
2222
2187
|
}
|
|
2223
2188
|
getCellInCol(t) {
|
|
2224
2189
|
const e = [];
|
|
2225
|
-
return this.table.querySelectorAll(`.${
|
|
2226
|
-
const s = i.querySelector(`.${
|
|
2190
|
+
return this.table.querySelectorAll(`.${D}`).forEach((i) => {
|
|
2191
|
+
const s = i.querySelector(`.${N}:nth-child(${t})`);
|
|
2227
2192
|
s && e.push(s);
|
|
2228
2193
|
}), e;
|
|
2229
2194
|
}
|
|
2230
2195
|
createColumnToolbox() {
|
|
2231
|
-
return new
|
|
2196
|
+
return new O({ 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: () => {
|
|
2232
2197
|
this.addColumn(this.selectedColumn, !0), this.hideToolboxes(), this.updateColWidth();
|
|
2233
2198
|
} }, { 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: () => {
|
|
2234
2199
|
this.addColumn(this.selectedColumn + 1, !0), this.hideToolboxes(), this.updateColWidth();
|
|
2235
|
-
} }, { label: this.api.i18n.t("Delete column"), icon:
|
|
2200
|
+
} }, { label: this.api.i18n.t("Delete column"), icon: Ct, hideIf: () => this.numberOfColumns === 1, confirmationRequired: !0, onClick: () => {
|
|
2236
2201
|
this.deleteColumn(this.selectedColumn), this.hideToolboxes(), this.updateColWidth();
|
|
2237
2202
|
} }], onOpen: () => {
|
|
2238
2203
|
this.selectColumn(this.hoveredColumn), this.hideRowToolbox();
|
|
@@ -2241,11 +2206,11 @@ class le {
|
|
|
2241
2206
|
} });
|
|
2242
2207
|
}
|
|
2243
2208
|
createRowToolbox() {
|
|
2244
|
-
return new
|
|
2209
|
+
return new O({ 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: () => {
|
|
2245
2210
|
this.addRow(this.selectedRow, !0), this.hideToolboxes();
|
|
2246
2211
|
} }, { 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: () => {
|
|
2247
2212
|
this.addRow(this.selectedRow + 1, !0), this.hideToolboxes();
|
|
2248
|
-
} }, { label: this.api.i18n.t("Delete row"), icon:
|
|
2213
|
+
} }, { label: this.api.i18n.t("Delete row"), icon: Ct, hideIf: () => this.numberOfRows === 1, confirmationRequired: !0, onClick: () => {
|
|
2249
2214
|
this.deleteRow(this.selectedRow), this.hideToolboxes();
|
|
2250
2215
|
} }], onOpen: () => {
|
|
2251
2216
|
this.selectRow(this.hoveredRow), this.hideColumnToolbox();
|
|
@@ -2257,16 +2222,16 @@ class le {
|
|
|
2257
2222
|
this.focusedCell.row !== this.numberOfRows ? (this.focusedCell.row += 1, this.focusCell()) : (this.addRow(), this.focusedCell.row += 1, this.focusCell(), this.updateToolboxesPosition(0, 0));
|
|
2258
2223
|
}
|
|
2259
2224
|
getCell(t, e) {
|
|
2260
|
-
return this.table.querySelectorAll(`.${
|
|
2225
|
+
return this.table.querySelectorAll(`.${D}:nth-child(${t}) .${N}`)[e - 1];
|
|
2261
2226
|
}
|
|
2262
2227
|
getRow(t) {
|
|
2263
|
-
return this.table.querySelector(`.${
|
|
2228
|
+
return this.table.querySelector(`.${D}:nth-child(${t})`);
|
|
2264
2229
|
}
|
|
2265
2230
|
getRowByCell(t) {
|
|
2266
2231
|
return t.parentElement;
|
|
2267
2232
|
}
|
|
2268
2233
|
getRowFirstCell(t) {
|
|
2269
|
-
return t.querySelector(`.${
|
|
2234
|
+
return t.querySelector(`.${N}:first-child`);
|
|
2270
2235
|
}
|
|
2271
2236
|
setCellContent(t, e, i) {
|
|
2272
2237
|
this.getCell(t, e).innerHTML = i;
|
|
@@ -2278,24 +2243,24 @@ class le {
|
|
|
2278
2243
|
for (let r = 1; r <= this.numberOfRows; r++) {
|
|
2279
2244
|
let o;
|
|
2280
2245
|
const a = this.createCell();
|
|
2281
|
-
if (t > 0 && t <= i ? (o = this.getCell(r, t),
|
|
2282
|
-
const
|
|
2283
|
-
|
|
2246
|
+
if (t > 0 && t <= i ? (o = this.getCell(r, t), St(a, o)) : o = this.getRow(r).appendChild(a), r === 1) {
|
|
2247
|
+
const d = this.getCell(r, t > 0 ? t : i + 1);
|
|
2248
|
+
d && e && Lt(d);
|
|
2284
2249
|
}
|
|
2285
2250
|
}
|
|
2286
|
-
const s = this.wrapper.querySelector(`.${
|
|
2287
|
-
(n = this.config) != null && n.maxcols && this.numberOfColumns > this.config.maxcols - 1 && s && s.classList.add(
|
|
2251
|
+
const s = this.wrapper.querySelector(`.${st}`);
|
|
2252
|
+
(n = this.config) != null && n.maxcols && this.numberOfColumns > this.config.maxcols - 1 && s && s.classList.add(It), this.addHeadingAttrToFirstRow(), this.colWidthArr.splice(t - 1, 0, this.defaultCellWidth);
|
|
2288
2253
|
}
|
|
2289
2254
|
addRow(t = -1, e = !1) {
|
|
2290
|
-
let i, s =
|
|
2255
|
+
let i, s = T("div", D);
|
|
2291
2256
|
this.tunes.withHeadings && this.removeHeadingAttrFromFirstRow();
|
|
2292
2257
|
let n = this.numberOfColumns;
|
|
2293
|
-
if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows
|
|
2294
|
-
t > 0 && t <= this.numberOfRows ? i =
|
|
2258
|
+
if (this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows) return;
|
|
2259
|
+
t > 0 && t <= this.numberOfRows ? i = St(s, this.getRow(t)) : i = this.table.appendChild(s), this.fillRow(i, n), this.tunes.withHeadings && this.addHeadingAttrToFirstRow();
|
|
2295
2260
|
const r = this.getRowFirstCell(i);
|
|
2296
|
-
r && e &&
|
|
2297
|
-
const o = this.wrapper.querySelector(`.${
|
|
2298
|
-
return this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && o && o.classList.add(
|
|
2261
|
+
r && e && Lt(r);
|
|
2262
|
+
const o = this.wrapper.querySelector(`.${it}`);
|
|
2263
|
+
return this.config && this.config.maxrows && this.numberOfRows >= this.config.maxrows && o && o.classList.add(Mt), i;
|
|
2299
2264
|
}
|
|
2300
2265
|
deleteColumn(t) {
|
|
2301
2266
|
for (let i = 1; i <= this.numberOfRows; i++) {
|
|
@@ -2303,20 +2268,20 @@ class le {
|
|
|
2303
2268
|
if (!s) return;
|
|
2304
2269
|
s.remove();
|
|
2305
2270
|
}
|
|
2306
|
-
const e = this.wrapper.querySelector(`.${
|
|
2307
|
-
e && e.classList.remove(
|
|
2271
|
+
const e = this.wrapper.querySelector(`.${st}`);
|
|
2272
|
+
e && e.classList.remove(It), this.colWidthArr.splice(t - 1, 1);
|
|
2308
2273
|
}
|
|
2309
2274
|
deleteRow(t) {
|
|
2310
2275
|
this.getRow(t).remove();
|
|
2311
|
-
const e = this.wrapper.querySelector(`.${
|
|
2312
|
-
e && e.classList.remove(
|
|
2276
|
+
const e = this.wrapper.querySelector(`.${it}`);
|
|
2277
|
+
e && e.classList.remove(Mt), this.addHeadingAttrToFirstRow();
|
|
2313
2278
|
}
|
|
2314
2279
|
createTableWrapper() {
|
|
2315
|
-
this.wrapper =
|
|
2280
|
+
this.wrapper = T("div", xt), this.table = T("div", Tt), this.readOnly && this.wrapper.classList.add(Ce), this.wrapper.appendChild(this.toolboxRow.element), this.wrapper.appendChild(this.toolboxColumn.element), this.wrapper.appendChild(this.table);
|
|
2316
2281
|
}
|
|
2317
2282
|
computeInitialSize() {
|
|
2318
|
-
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,
|
|
2319
|
-
return { rows: s || a || 2, cols: n ||
|
|
2283
|
+
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;
|
|
2284
|
+
return { rows: s || a || 2, cols: n || d || 2 };
|
|
2320
2285
|
}
|
|
2321
2286
|
resize() {
|
|
2322
2287
|
const { rows: t, cols: e } = this.computeInitialSize();
|
|
@@ -2339,13 +2304,13 @@ class le {
|
|
|
2339
2304
|
}
|
|
2340
2305
|
}
|
|
2341
2306
|
createCell() {
|
|
2342
|
-
return
|
|
2307
|
+
return T("div", N, { contentEditable: !this.readOnly });
|
|
2343
2308
|
}
|
|
2344
2309
|
get numberOfRows() {
|
|
2345
2310
|
return this.table.childElementCount;
|
|
2346
2311
|
}
|
|
2347
2312
|
get numberOfColumns() {
|
|
2348
|
-
return this.numberOfRows ? this.table.querySelectorAll(`.${
|
|
2313
|
+
return this.numberOfRows ? this.table.querySelectorAll(`.${D}:first-child .${N}`).length : 0;
|
|
2349
2314
|
}
|
|
2350
2315
|
get isColumnMenuShowing() {
|
|
2351
2316
|
return this.selectedColumn !== 0;
|
|
@@ -2354,7 +2319,7 @@ class le {
|
|
|
2354
2319
|
return this.selectedRow !== 0;
|
|
2355
2320
|
}
|
|
2356
2321
|
onMouseMoveInTable(t) {
|
|
2357
|
-
const { row: e, column: i, deltaXCell: s
|
|
2322
|
+
const { row: e, column: i, deltaXCell: s } = this.getHoveredCell(t);
|
|
2358
2323
|
this.hoveredColumn = i, this.hoveredRow = e, this.updateToolboxesPosition(), this.hoveredCell !== null && this.hoveredCell.classList.contains("cell-resizable") && this.hoveredCell.classList.remove("cell-resizable"), this.hoveredCell = this.getCell(e, i), this.cellIsResizable(this.hoveredCell, s) && (this.hoveredCell.classList.contains("cell-resizable") || this.hoveredCell.classList.add("cell-resizable"));
|
|
2359
2324
|
}
|
|
2360
2325
|
cellIsResizable(t, e) {
|
|
@@ -2372,7 +2337,7 @@ class le {
|
|
|
2372
2337
|
}
|
|
2373
2338
|
focusInTableListener(t) {
|
|
2374
2339
|
const e = t.target, i = this.getRowByCell(e);
|
|
2375
|
-
this.focusedCell = { row: Array.from(this.table.querySelectorAll(`.${
|
|
2340
|
+
i && (this.focusedCell = { row: Array.from(this.table.querySelectorAll(`.${D}`)).indexOf(i) + 1, column: Array.from(i.querySelectorAll(`.${N}`)).indexOf(e) + 1 });
|
|
2376
2341
|
}
|
|
2377
2342
|
hideToolboxes() {
|
|
2378
2343
|
this.hideRowToolbox(), this.hideColumnToolbox(), this.updateToolboxesPosition();
|
|
@@ -2392,12 +2357,12 @@ class le {
|
|
|
2392
2357
|
}
|
|
2393
2358
|
updateToolboxesPosition(t = this.hoveredRow, e = this.hoveredColumn) {
|
|
2394
2359
|
this.isColumnMenuShowing || e > 0 && e <= this.numberOfColumns && this.toolboxColumn.show(() => ({ left: `calc((100% - var(--cell-size)) / (${this.numberOfColumns} * 2) * (1 + (${e} - 1) * 2))` })), this.isRowMenuShowing || t > 0 && t <= this.numberOfRows && this.toolboxRow.show(() => {
|
|
2395
|
-
const i = this.getRow(t), { fromTopBorder: s } =
|
|
2360
|
+
const i = this.getRow(t), { fromTopBorder: s } = Q(this.table, i), { height: n } = i.getBoundingClientRect();
|
|
2396
2361
|
return { top: `${Math.ceil(s + n / 2)}px` };
|
|
2397
2362
|
});
|
|
2398
2363
|
}
|
|
2399
2364
|
setHeadingsSetting(t) {
|
|
2400
|
-
this.tunes.withHeadings = t, t ? (this.table.classList.add(
|
|
2365
|
+
this.tunes.withHeadings = t, t ? (this.table.classList.add(Et), this.addHeadingAttrToFirstRow()) : (this.table.classList.remove(Et), this.removeHeadingAttrFromFirstRow());
|
|
2401
2366
|
}
|
|
2402
2367
|
addHeadingAttrToFirstRow() {
|
|
2403
2368
|
for (let t = 1; t <= this.numberOfColumns; t++) {
|
|
@@ -2413,53 +2378,53 @@ class le {
|
|
|
2413
2378
|
}
|
|
2414
2379
|
selectRow(t) {
|
|
2415
2380
|
const e = this.getRow(t);
|
|
2416
|
-
e && (this.selectedRow = t, e.classList.add(
|
|
2381
|
+
e && (this.selectedRow = t, e.classList.add(tt));
|
|
2417
2382
|
}
|
|
2418
2383
|
unselectRow() {
|
|
2419
2384
|
if (this.selectedRow <= 0) return;
|
|
2420
|
-
const t = this.table.querySelector(`.${
|
|
2421
|
-
t && t.classList.remove(
|
|
2385
|
+
const t = this.table.querySelector(`.${tt}`);
|
|
2386
|
+
t && t.classList.remove(tt), this.selectedRow = 0;
|
|
2422
2387
|
}
|
|
2423
2388
|
selectColumn(t) {
|
|
2424
2389
|
for (let e = 1; e <= this.numberOfRows; e++) {
|
|
2425
2390
|
const i = this.getCell(e, t);
|
|
2426
|
-
i && i.classList.add(
|
|
2391
|
+
i && i.classList.add(et);
|
|
2427
2392
|
}
|
|
2428
2393
|
this.selectedColumn = t;
|
|
2429
2394
|
}
|
|
2430
2395
|
unselectColumn() {
|
|
2431
2396
|
if (this.selectedColumn <= 0) return;
|
|
2432
|
-
let t = this.table.querySelectorAll(`.${
|
|
2397
|
+
let t = this.table.querySelectorAll(`.${et}`);
|
|
2433
2398
|
Array.from(t).forEach((e) => {
|
|
2434
|
-
e.classList.remove(
|
|
2399
|
+
e.classList.remove(et);
|
|
2435
2400
|
}), this.selectedColumn = 0;
|
|
2436
2401
|
}
|
|
2437
2402
|
getHoveredCell(t) {
|
|
2438
2403
|
let e = this.hoveredRow, i = this.hoveredColumn;
|
|
2439
|
-
const { width: s, height: n, x: r, y: o } = function(
|
|
2440
|
-
const g =
|
|
2441
|
-
return { width:
|
|
2404
|
+
const { width: s, height: n, x: r, y: o } = function(p, u) {
|
|
2405
|
+
const g = p.getBoundingClientRect(), { width: m, height: f, x: v, y: L } = g, { clientX: w, clientY: I } = u;
|
|
2406
|
+
return { width: m, height: f, x: w - v, y: I - L };
|
|
2442
2407
|
}(this.table, t);
|
|
2443
2408
|
if (r >= 0) {
|
|
2444
|
-
const
|
|
2445
|
-
i = this.binSearch(this.numberOfColumns, (g) => this.getCell(1, g),
|
|
2409
|
+
const p = ({ fromLeftBorder: g }) => r < g, u = ({ fromRightBorder: g }) => r > s - g;
|
|
2410
|
+
i = this.binSearch(this.numberOfColumns, (g) => this.getCell(1, g), p, u);
|
|
2446
2411
|
}
|
|
2447
2412
|
if (o >= 0) {
|
|
2448
|
-
const
|
|
2449
|
-
e = this.binSearch(this.numberOfRows, (g) => this.getCell(g, 1),
|
|
2413
|
+
const p = ({ fromTopBorder: g }) => o < g, u = ({ fromBottomBorder: g }) => o > n - g;
|
|
2414
|
+
e = this.binSearch(this.numberOfRows, (g) => this.getCell(g, 1), p, u);
|
|
2450
2415
|
}
|
|
2451
|
-
const a = e || this.hoveredRow,
|
|
2452
|
-
return { row: a, column:
|
|
2416
|
+
const a = e || this.hoveredRow, d = i || this.hoveredColumn, { deltaXCell: l, deltaYCell: h } = this.getMousePositionRelateToCell(a, d, r, o);
|
|
2417
|
+
return { row: a, column: d, deltaXCell: l, deltaYCell: h };
|
|
2453
2418
|
}
|
|
2454
2419
|
getMousePositionRelateToCell(t, e, i, s) {
|
|
2455
|
-
const n = this.getCell(t, e), { fromTopBorder: r, fromLeftBorder: o } =
|
|
2420
|
+
const n = this.getCell(t, e), { fromTopBorder: r, fromLeftBorder: o } = Q(this.table, n);
|
|
2456
2421
|
return { deltaXCell: i - o, deltaYCell: s - r };
|
|
2457
2422
|
}
|
|
2458
2423
|
binSearch(t, e, i, s) {
|
|
2459
2424
|
let n, r = 0, o = t + 1, a = 0;
|
|
2460
2425
|
for (; r < o - 1 && a < 10; ) {
|
|
2461
2426
|
n = Math.ceil((r + o) / 2);
|
|
2462
|
-
const
|
|
2427
|
+
const d = e(n), l = Q(this.table, d);
|
|
2463
2428
|
if (i(l)) o = n;
|
|
2464
2429
|
else {
|
|
2465
2430
|
if (!s(l)) break;
|
|
@@ -2472,7 +2437,7 @@ class le {
|
|
|
2472
2437
|
getData() {
|
|
2473
2438
|
const t = [];
|
|
2474
2439
|
for (let e = 1; e <= this.numberOfRows; e++) {
|
|
2475
|
-
const i = this.table.querySelector(`.${
|
|
2440
|
+
const i = this.table.querySelector(`.${D}:nth-child(${e})`), s = Array.from(i.querySelectorAll(`.${N}`));
|
|
2476
2441
|
s.every((n) => !n.textContent.trim()) || t.push(s.map((n) => n.innerHTML));
|
|
2477
2442
|
}
|
|
2478
2443
|
return t;
|
|
@@ -2481,7 +2446,7 @@ class le {
|
|
|
2481
2446
|
document.removeEventListener("click", this.documentClicked);
|
|
2482
2447
|
}
|
|
2483
2448
|
}
|
|
2484
|
-
class
|
|
2449
|
+
class ke {
|
|
2485
2450
|
static get isReadOnlySupported() {
|
|
2486
2451
|
return !0;
|
|
2487
2452
|
}
|
|
@@ -2495,7 +2460,7 @@ class he {
|
|
|
2495
2460
|
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" };
|
|
2496
2461
|
}
|
|
2497
2462
|
render() {
|
|
2498
|
-
return this.table = new
|
|
2463
|
+
return this.table = new ve(this.readOnly, this.api, this.data, this.config), this.container = T("div", this.api.styles.block), this.container.appendChild(this.table.getWrapper()), this.table.setHeadingsSetting(this.data.withHeadings), this.container;
|
|
2499
2464
|
}
|
|
2500
2465
|
renderSettings() {
|
|
2501
2466
|
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: () => {
|
|
@@ -2525,42 +2490,492 @@ class he {
|
|
|
2525
2490
|
}
|
|
2526
2491
|
}
|
|
2527
2492
|
}
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2493
|
+
function P(c, t = null, e = {}) {
|
|
2494
|
+
const i = document.createElement(c);
|
|
2495
|
+
Array.isArray(t) ? i.classList.add(...t) : t !== null && i.classList.add(t);
|
|
2496
|
+
for (const s in e) e.hasOwnProperty(s) && (i[s] = e[s]);
|
|
2497
|
+
return i;
|
|
2498
|
+
}
|
|
2499
|
+
var V = ((c) => (c.Empty = "empty", c.Uploading = "uploading", c.Filled = "filled", c))(V || {});
|
|
2500
|
+
class we {
|
|
2501
|
+
constructor({ api: t, config: e, onSelectFile: i, readOnly: s }) {
|
|
2502
|
+
this.api = t, this.config = e, this.onSelectFile = i, this.readOnly = s, this.nodes = { wrapper: P("div", [this.CSS.baseClass, this.CSS.wrapper]), imageContainer: P("div", [this.CSS.imageContainer]), fileButton: this.createFileButton(), imageEl: void 0, imagePreloader: P("div", this.CSS.imagePreloader), caption: P("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);
|
|
2503
|
+
}
|
|
2504
|
+
applyTune(t, e) {
|
|
2505
|
+
this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${t}`, e);
|
|
2506
|
+
}
|
|
2507
|
+
render() {
|
|
2508
|
+
return this.toggleStatus("empty"), this.nodes.wrapper;
|
|
2509
|
+
}
|
|
2510
|
+
showPreloader(t) {
|
|
2511
|
+
this.nodes.imagePreloader.style.backgroundImage = `url(${t})`;
|
|
2512
|
+
}
|
|
2513
|
+
hidePreloader() {
|
|
2514
|
+
this.nodes.imagePreloader.style.backgroundImage = "", this.toggleStatus("empty");
|
|
2515
|
+
}
|
|
2516
|
+
fillImage(t) {
|
|
2517
|
+
const e = /\.mp4$/.test(t) ? "VIDEO" : "IMG", i = { src: t };
|
|
2518
|
+
let s = "load";
|
|
2519
|
+
e === "VIDEO" && (i.autoplay = !0, i.loop = !0, i.muted = !0, i.playsinline = !0, s = "loadeddata"), this.nodes.imageEl = P(e, this.CSS.imageEl, i), this.nodes.imageEl.addEventListener(s, () => {
|
|
2520
|
+
this.toggleStatus("filled"), this.nodes.imagePreloader !== void 0 && (this.nodes.imagePreloader.style.backgroundImage = "");
|
|
2521
|
+
}), this.nodes.imageContainer.appendChild(this.nodes.imageEl);
|
|
2522
|
+
}
|
|
2523
|
+
fillCaption(t) {
|
|
2524
|
+
this.nodes.caption !== void 0 && (this.nodes.caption.innerHTML = t);
|
|
2525
|
+
}
|
|
2526
|
+
toggleStatus(t) {
|
|
2527
|
+
for (const e in V) if (Object.prototype.hasOwnProperty.call(V, e)) {
|
|
2528
|
+
const i = V[e];
|
|
2529
|
+
this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${i}`, i === t);
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
get CSS() {
|
|
2533
|
+
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" };
|
|
2534
|
+
}
|
|
2535
|
+
createFileButton() {
|
|
2536
|
+
var e;
|
|
2537
|
+
const t = P("div", [this.CSS.button]);
|
|
2538
|
+
return t.innerHTML = (e = this.config.buttonContent) != null ? e : `${Ot} ${this.api.i18n.t("Select an Image")}`, t.addEventListener("click", () => {
|
|
2539
|
+
this.onSelectFile();
|
|
2540
|
+
}), t;
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
class be {
|
|
2544
|
+
constructor({ config: t, onUpload: e, onError: i }) {
|
|
2545
|
+
this.config = t, this.onUpload = e, this.onError = i;
|
|
2546
|
+
}
|
|
2547
|
+
async uploadSelectedFile({ onPreview: t, noSelectedFile: e }) {
|
|
2548
|
+
var g;
|
|
2549
|
+
let i = "", s = "";
|
|
2550
|
+
const n = await function(m = {}) {
|
|
2551
|
+
let f = !0;
|
|
2552
|
+
return new Promise((v, L) => {
|
|
2553
|
+
let w = document.createElement("INPUT");
|
|
2554
|
+
w.type = "file", m.multiple && w.setAttribute("multiple", "multiple"), m.accept && w.setAttribute("accept", m.accept), w.style.display = "none", document.body.appendChild(w), w.addEventListener("change", (I) => {
|
|
2555
|
+
f = !1;
|
|
2556
|
+
const B = I.target.files;
|
|
2557
|
+
v(B), document.body.removeChild(w);
|
|
2558
|
+
}, !1), window.addEventListener("focus", () => {
|
|
2559
|
+
setTimeout(() => {
|
|
2560
|
+
f && v([]);
|
|
2561
|
+
}, 1e3);
|
|
2562
|
+
}, { once: !0 }), w.click();
|
|
2563
|
+
});
|
|
2564
|
+
}({ accept: (g = this.config.types) != null ? g : "image/*" });
|
|
2565
|
+
if (!(n && n.length > 0)) return void e();
|
|
2566
|
+
(function(m) {
|
|
2567
|
+
const f = new FileReader();
|
|
2568
|
+
f.readAsDataURL(m), f.onload = (v) => {
|
|
2569
|
+
t(v.target.result);
|
|
2570
|
+
};
|
|
2571
|
+
})(n[0]);
|
|
2572
|
+
const r = n[0], o = this.config.types.split(",");
|
|
2573
|
+
let a = r.name.lastIndexOf("."), d = r.name.slice(a);
|
|
2574
|
+
if (!o.includes(d.toLowerCase())) return void this.onError("文件类型不支持");
|
|
2575
|
+
let l = {};
|
|
2576
|
+
if (this.config.userStore) {
|
|
2577
|
+
const m = this.config.userStore.token, f = this.config.userStore.tokenName, v = this.config.userStore.tokenPrefix;
|
|
2578
|
+
m && f && (l[f] = v + " " + m);
|
|
2579
|
+
}
|
|
2580
|
+
const h = G.create({ timeout: 18e5, headers: l });
|
|
2581
|
+
l["Content-Type"] = "application/json";
|
|
2582
|
+
const p = await h.post(this.config.endpoints.byFile, { fileName: r.name, contentType: r.type });
|
|
2583
|
+
if (p.status !== 200) return void this.onError(p.statusText);
|
|
2584
|
+
const u = p.data;
|
|
2585
|
+
if (!u.success) return void this.onError(u.message);
|
|
2586
|
+
i = u.data.cdn, s = u.data.objectKey, l["Content-Type"] = r.type, h.put(u.data.presignedUrl, r).then((m) => {
|
|
2587
|
+
m.status === 200 && (m = { success: 1, file: { url: i + s } }), this.onUpload(m);
|
|
2588
|
+
}).catch((m) => {
|
|
2589
|
+
this.onError(m);
|
|
2590
|
+
});
|
|
2591
|
+
}
|
|
2592
|
+
uploadByUrl(t) {
|
|
2593
|
+
let e, i = { "Content-Type": "application/json" };
|
|
2594
|
+
if (this.config.userStore) {
|
|
2595
|
+
const s = this.config.userStore.token, n = this.config.userStore.tokenName, r = this.config.userStore.tokenPrefix;
|
|
2596
|
+
s && n && (i[n] = r + " " + s);
|
|
2597
|
+
}
|
|
2598
|
+
e = G.create({ timeout: 18e5, headers: i }).post(this.config.endpoints.byUrl, { url: t, accept: ".jpg,.jpeg,.gif,.png,.webp" }), e.then((s) => {
|
|
2599
|
+
if (s.status !== 200 || s.data.success === !1) return void this.onError(s.data.message);
|
|
2600
|
+
let n = { success: 1, file: { url: s.data.data.cdn + s.data.data.objectKey } };
|
|
2601
|
+
this.onUpload(n);
|
|
2602
|
+
}).catch((s) => {
|
|
2603
|
+
this.onError(s);
|
|
2604
|
+
});
|
|
2605
|
+
}
|
|
2606
|
+
async uploadByFile(t, { onPreview: e }) {
|
|
2607
|
+
const i = this.config.types.split(",");
|
|
2608
|
+
let s = t.name.lastIndexOf("."), n = t.name.slice(s);
|
|
2609
|
+
if (!i.includes(n.toLowerCase())) return void this.onError("文件类型不支持");
|
|
2610
|
+
let r = {};
|
|
2611
|
+
if (this.config.userStore) {
|
|
2612
|
+
const p = this.config.userStore.token, u = this.config.userStore.tokenName, g = this.config.userStore.tokenPrefix;
|
|
2613
|
+
p && u && (r[u] = g + " " + p);
|
|
2614
|
+
}
|
|
2615
|
+
const o = G.create({ timeout: 18e5, headers: r });
|
|
2616
|
+
r["Content-Type"] = "application/json";
|
|
2617
|
+
const a = await o.post(this.config.endpoints.byFile, { fileName: t.name, contentType: t.type });
|
|
2618
|
+
if (a.status !== 200) return void this.onError(a.statusText);
|
|
2619
|
+
const d = a.data;
|
|
2620
|
+
if (!d.success) return void this.onError(d.message);
|
|
2621
|
+
let l = d.data.cdn, h = d.data.objectKey;
|
|
2622
|
+
r["Content-Type"] = t.type, o.put(d.data.presignedUrl, t).then((p) => {
|
|
2623
|
+
p.status === 200 && (p = { success: 1, file: { url: l + h } }), this.onUpload(p);
|
|
2624
|
+
}).catch((p) => {
|
|
2625
|
+
this.onError(p);
|
|
2626
|
+
});
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
class Y {
|
|
2630
|
+
constructor({ data: t, config: e, api: i, readOnly: s, block: n }) {
|
|
2631
|
+
var r;
|
|
2632
|
+
this.isCaptionEnabled = null, this.api = i, this.block = n, this.userStore = e == null ? void 0 : e.userStore, 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 be({ config: this.config, onUpload: (o) => this.onUpload(o), onError: (o) => this.uploadingFailed(o) }), this.ui = new we({ api: i, config: this.config, onSelectFile: () => {
|
|
2633
|
+
this.uploader.uploadSelectedFile({ onPreview: (o) => {
|
|
2634
|
+
this.ui.showPreloader(o);
|
|
2635
|
+
}, noSelectedFile: () => {
|
|
2636
|
+
this.noSelectedFile();
|
|
2637
|
+
} });
|
|
2638
|
+
}, readOnly: s }), this._data = { caption: "", withBorder: !1, withBackground: !1, stretched: !1, file: { url: "" } }, this.data = t;
|
|
2639
|
+
}
|
|
2640
|
+
noSelectedFile() {
|
|
2641
|
+
this.api.blocks.delete(this.api.blocks.getCurrentBlockIndex());
|
|
2642
|
+
}
|
|
2643
|
+
deleteCurrentBlock() {
|
|
2644
|
+
this.api.blocks.delete(this.api.blocks.getCurrentBlockIndex());
|
|
2645
|
+
}
|
|
2646
|
+
static get isReadOnlySupported() {
|
|
2647
|
+
return !0;
|
|
2648
|
+
}
|
|
2649
|
+
static get toolbox() {
|
|
2650
|
+
return { icon: Ot, title: "Image" };
|
|
2651
|
+
}
|
|
2652
|
+
static get tunes() {
|
|
2653
|
+
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 }];
|
|
2654
|
+
}
|
|
2655
|
+
render() {
|
|
2656
|
+
var t, e, i;
|
|
2657
|
+
return (((t = this.config.features) == null ? void 0 : t.caption) === !0 || ((e = this.config.features) == null ? void 0 : e.caption) === void 0 || ((i = this.config.features) == null ? void 0 : i.caption) === "optional" && this.data.caption) && (this.isCaptionEnabled = !0, this.ui.applyTune("caption", !0)), this.ui.render();
|
|
2658
|
+
}
|
|
2659
|
+
validate(t) {
|
|
2660
|
+
return !!t.file.url;
|
|
2661
|
+
}
|
|
2662
|
+
save() {
|
|
2663
|
+
const t = this.ui.nodes.caption;
|
|
2664
|
+
return this._data.caption = t.innerHTML, this.data;
|
|
2665
|
+
}
|
|
2666
|
+
renderSettings() {
|
|
2667
|
+
var n;
|
|
2668
|
+
const t = Y.tunes.concat(this.config.actions || []), e = { border: "withBorder", background: "withBackground", stretch: "stretched", caption: "caption" };
|
|
2669
|
+
((n = this.config.features) == null ? void 0 : n.caption) === "optional" && t.push({ name: "caption", icon: Rt, title: "With caption", toggle: !0 });
|
|
2670
|
+
const i = t.filter((r) => {
|
|
2671
|
+
var a, d;
|
|
2672
|
+
const o = Object.keys(e).find((l) => e[l] === r.name);
|
|
2673
|
+
return o === "caption" ? ((a = this.config.features) == null ? void 0 : a.caption) !== !1 : o == null || ((d = this.config.features) == null ? void 0 : d[o]) !== !1;
|
|
2674
|
+
}), s = (r) => {
|
|
2675
|
+
var a;
|
|
2676
|
+
let o = this.data[r.name];
|
|
2677
|
+
return r.name === "caption" && (o = (a = this.isCaptionEnabled) != null ? a : o), o;
|
|
2678
|
+
};
|
|
2679
|
+
return i.map((r) => ({ icon: r.icon, label: this.api.i18n.t(r.title), name: r.name, toggle: r.toggle, isActive: s(r), onActivate: () => {
|
|
2680
|
+
if (typeof r.action == "function") return void r.action(r.name);
|
|
2681
|
+
let o = !s(r);
|
|
2682
|
+
r.name === "caption" && (this.isCaptionEnabled = !this.isCaptionEnabled, o = this.isCaptionEnabled), this.tuneToggled(r.name, o);
|
|
2683
|
+
} }));
|
|
2684
|
+
}
|
|
2685
|
+
appendCallback() {
|
|
2686
|
+
this.ui.nodes.fileButton.click();
|
|
2687
|
+
}
|
|
2688
|
+
static get pasteConfig() {
|
|
2689
|
+
return { tags: [{ img: { src: !0 } }], files: { mimeTypes: ["image/*"] } };
|
|
2690
|
+
}
|
|
2691
|
+
async onPaste(t) {
|
|
2692
|
+
switch (t.type) {
|
|
2693
|
+
case "tag": {
|
|
2694
|
+
const e = t.detail.data;
|
|
2695
|
+
if (/^blob:/.test(e.src)) {
|
|
2696
|
+
const i = await fetch(e.src), s = await i.blob();
|
|
2697
|
+
this.uploadFile(s);
|
|
2698
|
+
break;
|
|
2699
|
+
}
|
|
2700
|
+
this.uploadUrl(e.src);
|
|
2701
|
+
break;
|
|
2702
|
+
}
|
|
2703
|
+
case "file": {
|
|
2704
|
+
const e = t.detail.file;
|
|
2705
|
+
this.uploadFile(e);
|
|
2706
|
+
break;
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
set data(t) {
|
|
2711
|
+
var e;
|
|
2712
|
+
this.image = t.file, this._data.caption = t.caption || "", this.ui.fillCaption(this._data.caption), Y.tunes.forEach(({ name: i }) => {
|
|
2713
|
+
const s = t[i] !== void 0 && (t[i] === !0 || t[i] === "true");
|
|
2714
|
+
this.setTune(i, s);
|
|
2715
|
+
}), (t.caption || ((e = this.config.features) == null ? void 0 : e.caption) === !0) && this.setTune("caption", !0);
|
|
2716
|
+
}
|
|
2717
|
+
get data() {
|
|
2718
|
+
return this._data;
|
|
2719
|
+
}
|
|
2720
|
+
set image(t) {
|
|
2721
|
+
this._data.file = t || { url: "" }, t && t.url && this.ui.fillImage(t.url);
|
|
2722
|
+
}
|
|
2723
|
+
onUpload(t) {
|
|
2724
|
+
t.success && t.file ? this.image = t.file : this.uploadingFailed("incorrect response: " + JSON.stringify(t));
|
|
2725
|
+
}
|
|
2726
|
+
uploadingFailed(t) {
|
|
2727
|
+
let e = this.api.i18n.t("Couldn’t upload image. Please try another.");
|
|
2728
|
+
t && (e = this.api.i18n.t(t)), this.api.notifier.show({ message: e, style: "error" }), this.ui.hidePreloader(), this.deleteCurrentBlock();
|
|
2729
|
+
}
|
|
2730
|
+
tuneToggled(t, e) {
|
|
2731
|
+
t === "caption" ? (this.ui.applyTune(t, e), e == 0 && (this._data.caption = "", this.ui.fillCaption(""))) : this.setTune(t, e);
|
|
2732
|
+
}
|
|
2733
|
+
setTune(t, e) {
|
|
2734
|
+
this._data[t] = e, this.ui.applyTune(t, e), t === "stretched" && Promise.resolve().then(() => {
|
|
2735
|
+
this.block.stretched = e;
|
|
2736
|
+
}).catch((i) => {
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
uploadFile(t) {
|
|
2740
|
+
this.uploader.uploadByFile(t, { onPreview: (e) => {
|
|
2741
|
+
this.ui.showPreloader(e);
|
|
2742
|
+
} });
|
|
2743
|
+
}
|
|
2744
|
+
uploadUrl(t) {
|
|
2745
|
+
this.ui.showPreloader(t), this.uploader.uploadByUrl(t);
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
class ye {
|
|
2749
|
+
constructor({ api: t, data: e, config: i, block: s }) {
|
|
2750
|
+
var n, r, o, a, d, l, h, p, u, g, m, f, v, L, w, I, B;
|
|
2751
|
+
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: (p = (h = e == null ? void 0 : e.resize) != null ? h : i == null ? void 0 : i.resize) != null ? p : !1, resizeSize: (u = e == null ? void 0 : e.resizeSize) != null ? u : 0, crop: (m = (g = e == null ? void 0 : e.crop) != null ? g : i == null ? void 0 : i.crop) != null ? m : !1, cropperFrameHeight: (f = e == null ? void 0 : e.cropperFrameHeight) != null ? f : 0, cropperFrameWidth: (v = e == null ? void 0 : e.cropperFrameWidth) != null ? v : 0, cropperFrameLeft: (L = e == null ? void 0 : e.cropperFrameLeft) != null ? L : 0, cropperFrameTop: (w = e == null ? void 0 : e.cropperFrameTop) != null ? w : 0, cropperImageHeight: (I = e == null ? void 0 : e.cropperImageHeight) != null ? I : 0, cropperImageWidth: (B = e == null ? void 0 : e.cropperImageWidth) != null ? B : 0, cropperInterface: void 0 }, this.wrapper = void 0, this.buttons = [], this.styles = { settingsButton: "cdx-settings-button", settingsButtonActive: "cdx-settings-button--active", settingsButtonModifier: "", settingsButtonModifierActive: "" };
|
|
2752
|
+
}
|
|
2753
|
+
static get isTune() {
|
|
2754
|
+
return !0;
|
|
2755
|
+
}
|
|
2756
|
+
static get sanitize() {
|
|
2757
|
+
return { floatLeft: {}, floatRight: {}, center: {}, sizeSmall: {}, sizeMiddle: {}, sizeLarge: {}, resize: {}, resizeSize: {}, crop: {}, cropperFrameHeight: {}, cropperFrameWidth: {}, cropperFrameLeft: {}, cropperFrameTop: {}, cropperImageHeight: {}, cropperImageWidth: {}, cropperInterface: {} };
|
|
2758
|
+
}
|
|
2759
|
+
get CSS() {
|
|
2760
|
+
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", isCrop: "cdx-image-tool-tune--crop" };
|
|
2761
|
+
}
|
|
2762
|
+
get view() {
|
|
2763
|
+
return this.wrapper || (this.wrapper = this.createView()), this.wrapper;
|
|
2764
|
+
}
|
|
2765
|
+
tuneClicked(t, e) {
|
|
2766
|
+
var n;
|
|
2767
|
+
t.preventDefault(), t.stopPropagation();
|
|
2768
|
+
const i = e.dataset.tune || "", s = (n = this.settings.find((r) => r.name === i)) == null ? void 0 : n.group;
|
|
2769
|
+
this.buttons.forEach((r) => {
|
|
2770
|
+
var o;
|
|
2771
|
+
((o = this.settings.find((a) => a.name === r.dataset.tune)) == null ? void 0 : o.group) === s && r !== e && r.classList.remove(this.CSS.buttonActive);
|
|
2772
|
+
}), e.classList.toggle(this.CSS.buttonActive), this.setTune(i);
|
|
2773
|
+
}
|
|
2774
|
+
setTune(t) {
|
|
2775
|
+
switch (t) {
|
|
2776
|
+
case "floatLeft":
|
|
2777
|
+
this.data.floatLeft = !this.data.floatLeft, this.data.floatRight = !1, this.data.center = !1;
|
|
2778
|
+
break;
|
|
2779
|
+
case "floatRight":
|
|
2780
|
+
this.data.floatLeft = !1, this.data.floatRight = !this.data.floatRight, this.data.center = !1;
|
|
2781
|
+
break;
|
|
2782
|
+
case "center":
|
|
2783
|
+
this.data.center = !this.data.center, this.data.floatLeft = !1, this.data.floatRight = !1;
|
|
2784
|
+
break;
|
|
2785
|
+
case "sizeSmall":
|
|
2786
|
+
this.data.sizeSmall = !this.data.sizeSmall, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !1, this.data.crop = !1;
|
|
2787
|
+
break;
|
|
2788
|
+
case "sizeMiddle":
|
|
2789
|
+
this.data.sizeSmall = !1, this.data.sizeMiddle = !this.data.sizeMiddle, this.data.sizeLarge = !1, this.data.resize = !1, this.data.crop = !1;
|
|
2790
|
+
break;
|
|
2791
|
+
case "sizeLarge":
|
|
2792
|
+
this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !this.data.sizeLarge, this.data.resize = !1, this.data.crop = !1;
|
|
2793
|
+
break;
|
|
2794
|
+
case "resize":
|
|
2795
|
+
this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !this.data.resize, this.data.crop = !1;
|
|
2796
|
+
break;
|
|
2797
|
+
case "crop":
|
|
2798
|
+
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;
|
|
2799
|
+
break;
|
|
2800
|
+
default:
|
|
2801
|
+
this.data.floatLeft = !1, this.data.floatRight = !1, this.data.sizeSmall = !1, this.data.sizeMiddle = !1, this.data.sizeLarge = !1, this.data.resize = !1, this.data.crop = !1;
|
|
2802
|
+
}
|
|
2803
|
+
this.data.resize || (this.data.resizeSize = 0), this.data.crop || (this.data.cropperFrameHeight = 0, this.data.cropperFrameWidth = 0, this.data.cropperFrameLeft = 0, this.data.cropperFrameTop = 0, this.data.cropperImageHeight = 0, this.data.cropperImageWidth = 0);
|
|
2804
|
+
const e = this.block.holder.querySelector(".ce-block__content");
|
|
2805
|
+
this.apply(e), this.block.dispatchChange();
|
|
2806
|
+
}
|
|
2807
|
+
apply(t) {
|
|
2808
|
+
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)), this.data.crop ? (t.classList.add(this.CSS.isCrop), this.crop(t), this.data.cropperFrameHeight > 0 && this.data.cropperFrameWidth > 0 && this.applyCrop(t)) : (t.classList.remove(this.CSS.isCrop), this.uncrop(t));
|
|
2809
|
+
}
|
|
2810
|
+
crop(t) {
|
|
2811
|
+
if (this.api.readOnly.isEnabled) return;
|
|
2812
|
+
const e = t.getElementsByClassName("image-tool__image")[0], i = document.createElement("div");
|
|
2813
|
+
i.classList.add("crop-btn", "btn-crop-action"), i.innerHTML = this.api.i18n.t("Crop"), i.addEventListener("click", () => {
|
|
2814
|
+
e.removeChild(i), this.appendCrop(t);
|
|
2815
|
+
}), e.appendChild(i);
|
|
2816
|
+
}
|
|
2817
|
+
appendCrop(t) {
|
|
2818
|
+
if (this.api.readOnly.isEnabled) return;
|
|
2819
|
+
this.uncrop(t);
|
|
2820
|
+
const e = t.getElementsByClassName("cdx-block")[0], i = e.getElementsByTagName("img")[0];
|
|
2821
|
+
e.classList.add("isCropping"), this.data.cropperInterface = new Cropper(i);
|
|
2822
|
+
const s = document.createElement("div");
|
|
2823
|
+
s.classList.add("crop-save", "btn-crop-action"), s.innerHTML = this.api.i18n.t("Apply"), s.addEventListener("click", () => {
|
|
2824
|
+
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);
|
|
2825
|
+
}), t.getElementsByClassName("image-tool__image")[0].appendChild(s), t.classList.add("isCropping");
|
|
2826
|
+
}
|
|
2827
|
+
applyCrop(t) {
|
|
2828
|
+
const e = t.getElementsByClassName("cdx-block")[0];
|
|
2829
|
+
if (e) {
|
|
2830
|
+
e.style.minWidth = this.data.cropperFrameWidth + "px", e.style.maxWidth = this.data.cropperFrameWidth + "px";
|
|
2831
|
+
const n = e.getElementsByTagName("img")[0];
|
|
2832
|
+
n.style.width = this.data.cropperImageWidth + "px", n.style.height = this.data.cropperImageHeight + "px";
|
|
2833
|
+
const r = t.getElementsByClassName("image-tool__image")[0];
|
|
2834
|
+
r.style.width = this.data.cropperFrameWidth + "px", r.style.height = this.data.cropperFrameHeight + "px";
|
|
2835
|
+
const o = r.getElementsByTagName("img")[0];
|
|
2836
|
+
o && (o.style.left = this.data.cropperFrameLeft + "px", o.style.top = this.data.cropperFrameTop + "px", o.classList.add("isCropped")), e.classList.remove("isCropping");
|
|
2837
|
+
const a = t.getElementsByClassName("btn-crop-action")[0];
|
|
2838
|
+
a && r.removeChild(a);
|
|
2839
|
+
}
|
|
2840
|
+
if (this.data.cropperInterface && (this.data.cropperInterface.destroy(), this.data.cropperInterface = void 0), this.api.readOnly.isEnabled) return;
|
|
2841
|
+
const i = document.createElement("div");
|
|
2842
|
+
i.classList.add("crop-btn", "btn-crop-action"), i.innerHTML = this.api.i18n.t("Crop");
|
|
2843
|
+
const s = t.getElementsByClassName("image-tool__image")[0];
|
|
2844
|
+
s && (i.addEventListener("click", () => {
|
|
2845
|
+
s.removeChild(i), this.appendCrop(t);
|
|
2846
|
+
}), s.appendChild(i)), t.classList.remove("isCropping"), this.block.dispatchChange();
|
|
2847
|
+
}
|
|
2848
|
+
uncrop(t) {
|
|
2849
|
+
if (this.api.readOnly.isEnabled) return;
|
|
2850
|
+
const e = t.getElementsByClassName("image-tool__image")[0], i = t.getElementsByClassName("btn-crop-action")[0];
|
|
2851
|
+
i && e && e.removeChild(i);
|
|
2852
|
+
const s = t.getElementsByClassName("btn-crop-action")[0];
|
|
2853
|
+
s && e && e.removeChild(s);
|
|
2854
|
+
const n = t.getElementsByClassName("cdx-block")[0];
|
|
2855
|
+
if (n) {
|
|
2856
|
+
const r = n.getElementsByTagName("img")[0];
|
|
2857
|
+
r && r.classList.remove("isCropped"), n.classList.remove("isCropping"), n.style.minWidth = "", n.style.maxWidth = "";
|
|
2858
|
+
}
|
|
2859
|
+
if (e) {
|
|
2860
|
+
e.style.width = "", e.style.height = "";
|
|
2861
|
+
const r = e.getElementsByTagName("img")[0];
|
|
2862
|
+
r && (r.style.left = "", r.style.top = "", r.style.width = "", r.style.height = "");
|
|
2863
|
+
}
|
|
2864
|
+
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;
|
|
2865
|
+
}
|
|
2866
|
+
resize(t) {
|
|
2867
|
+
if (this.api.readOnly.isEnabled) return;
|
|
2868
|
+
const e = document.createElement("div");
|
|
2869
|
+
e.classList.add("resizable");
|
|
2870
|
+
const i = document.createElement("div");
|
|
2871
|
+
i.classList.add("resizers");
|
|
2872
|
+
const s = document.createElement("div");
|
|
2873
|
+
s.classList.add("resizer", "top-right"), s.addEventListener("mousedown", (r) => {
|
|
2874
|
+
this.resizeClick(t.getElementsByClassName("cdx-block")[0], s, r);
|
|
2875
|
+
});
|
|
2876
|
+
const n = document.createElement("div");
|
|
2877
|
+
n.classList.add("resizer", "bottom-right"), n.addEventListener("mousedown", (r) => {
|
|
2878
|
+
this.resizeClick(t.getElementsByClassName("cdx-block")[0], n, r);
|
|
2879
|
+
}), i.appendChild(s), i.appendChild(n), e.appendChild(i), t.getElementsByClassName("cdx-block")[0].appendChild(e);
|
|
2880
|
+
}
|
|
2881
|
+
resizeClick(t, e, i) {
|
|
2882
|
+
const s = document.getElementsByClassName("codex-editor")[0].clientWidth;
|
|
2883
|
+
let n = 0, r = 0;
|
|
2884
|
+
const o = (d) => {
|
|
2885
|
+
const l = d.clientX - n, h = r + l;
|
|
2886
|
+
h > 50 && h < s && (t.style.width = h + "px");
|
|
2887
|
+
}, a = () => {
|
|
2888
|
+
const d = parseInt(window.getComputedStyle(t).width, 10);
|
|
2889
|
+
d > 0 && (this.data.resizeSize = d), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", a), this.block.dispatchChange();
|
|
2890
|
+
};
|
|
2891
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", a), n = i.clientX, r = parseInt(window.getComputedStyle(t).width, 10);
|
|
2892
|
+
}
|
|
2893
|
+
unresize(t) {
|
|
2894
|
+
const e = t.getElementsByClassName("resizable")[0];
|
|
2895
|
+
e && t.getElementsByClassName("cdx-block")[0].removeChild(e), t.getElementsByClassName("cdx-block")[0].style.width = "auto";
|
|
2896
|
+
}
|
|
2897
|
+
unwrap(t) {
|
|
2898
|
+
this.buttons.forEach((n) => {
|
|
2899
|
+
n.classList.remove(this.CSS.buttonActive);
|
|
2900
|
+
}), 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), t.classList.remove(this.CSS.isCrop);
|
|
2901
|
+
const e = t.getElementsByClassName("cdx-block")[0];
|
|
2902
|
+
e.getElementsByTagName("img")[0].classList.remove("isCropped"), e.classList.remove("isCropping"), e.style.minWidth = "", e.style.maxWidth = "";
|
|
2903
|
+
const i = t.getElementsByClassName("image-tool__image")[0];
|
|
2904
|
+
i.style.width = "", i.style.height = "";
|
|
2905
|
+
const s = i.getElementsByTagName("img")[0];
|
|
2906
|
+
return s.style.left = "", s.style.top = "", s.style.width = "", s.style.height = "", this.unresize(t), this.uncrop(t), 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, t;
|
|
2907
|
+
}
|
|
2908
|
+
save() {
|
|
2909
|
+
return this.data;
|
|
2910
|
+
}
|
|
2911
|
+
wrap(t) {
|
|
2912
|
+
return this.wrapper || (this.wrapper = this.createView()), this.apply(t), t;
|
|
2913
|
+
}
|
|
2914
|
+
tuneNameToI18nKey(t) {
|
|
2915
|
+
return { crop: "Crop", resize: "Resize" }[t];
|
|
2916
|
+
}
|
|
2917
|
+
createView() {
|
|
2918
|
+
this.buttons = this.settings.map((e) => {
|
|
2919
|
+
const i = document.createElement("div"), s = document.createElement("span"), n = document.createElement("span");
|
|
2920
|
+
return i.classList.add(this.CSS.button), n.style.fontSize = "8px", s.innerHTML = e.icon, n.innerHTML = e.label, i.appendChild(s), i.appendChild(n), i.dataset.tune = e.name, i.title = e.label, i.addEventListener("click", (r) => this.tuneClicked(r, i)), this.api.tooltip.onHover(i, this.api.i18n.t(this.tuneNameToI18nKey(e.name))), i;
|
|
2921
|
+
});
|
|
2922
|
+
const t = document.createElement("div");
|
|
2923
|
+
return this.buttons.forEach((e) => {
|
|
2924
|
+
t.appendChild(e);
|
|
2925
|
+
}), t.classList.add(this.CSS.wrapper), t;
|
|
2926
|
+
}
|
|
2927
|
+
isTuneActive(t) {
|
|
2928
|
+
return !!this.data[t];
|
|
2929
|
+
}
|
|
2930
|
+
render() {
|
|
2931
|
+
return this.buttons.forEach((t) => {
|
|
2932
|
+
const e = t.dataset.tune || "";
|
|
2933
|
+
t.classList.toggle(this.CSS.buttonActive, this.isTuneActive(e));
|
|
2934
|
+
}), this.view;
|
|
2935
|
+
}
|
|
2936
|
+
destroy() {
|
|
2937
|
+
this.wrapper = void 0, this.buttons = [];
|
|
2938
|
+
}
|
|
2939
|
+
_toggleTune(t) {
|
|
2940
|
+
this.setTune(t);
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
const Se = { class: "ebl-editor", id: "holder" }, Le = { class: "ce-block__content ebl-editor-title-wrap" }, xe = { class: "ce-block__content ebl-editor-time-wrap" }, Te = { class: "ebl-editor-time" }, Ee = zt({ name: "EblEditor", inheritAttrs: !1, __name: "Editor", props: { readOnly: { type: Boolean, default: !1 }, placeholder: { default: "Enter something" }, title: { default: "" }, lastUpdateTime: { default: "" }, data: { default: () => ({ blocks: [] }) }, locale: { default: {} }, userStore: {} }, emits: ["onReady", "onChange"], setup(c, { emit: t }) {
|
|
2944
|
+
const e = Ft("EblEditorSettings");
|
|
2531
2945
|
let i = t;
|
|
2532
|
-
const s =
|
|
2946
|
+
const s = c, n = Pt(s.title);
|
|
2533
2947
|
let r = null;
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2948
|
+
const o = ["indent", "blockAlignment"];
|
|
2949
|
+
function a() {
|
|
2950
|
+
r !== null && r.save().then((d) => {
|
|
2951
|
+
}).catch((d) => {
|
|
2537
2952
|
});
|
|
2538
2953
|
}
|
|
2539
|
-
return
|
|
2540
|
-
const
|
|
2541
|
-
r = new
|
|
2542
|
-
i("onChange",
|
|
2954
|
+
return Wt(() => {
|
|
2955
|
+
const d = $t(s.data);
|
|
2956
|
+
r = new Gt({ holder: "holder", autofocus: !0, defaultBlock: "paragraph", placeholder: s.placeholder, tunes: o, tools: { inlineCode: $, underline: rt, Color: { class: fe }, marker: { class: W }, indent: { class: nt }, alert: { class: _, inlineToolbar: !0 }, List: { class: K, inlineToolbar: !0, config: { defaultStyle: "unordered" } }, h1: { class: ne, inlineToolbar: !0 }, h2: { class: re, inlineToolbar: !0 }, h3: { class: oe, inlineToolbar: !0 }, h4: { class: ae, inlineToolbar: !0 }, h5: { class: le, inlineToolbar: !0 }, h6: { class: de, inlineToolbar: !0 }, paragraph: { class: lt, inlineToolbar: !0 }, blockAlignment: { class: at, inlineToolbar: !0 }, code: { class: j, config: { lang: "javascript", theme: "catppuccin-latte" } }, quote: { class: he, inlineToolbar: !0 }, delimiter: ce, table: { class: ke, inlineToolbar: !0, config: { rows: 2, cols: 3 } }, image: { class: Y, inlineToolbar: !0, tunes: o.concat(["imageResize"]), config: { types: ".png,.jpeg,.jpg,.gif,.webp", userStore: s.userStore, endpoints: { byFile: e == null ? void 0 : e.fileUploadEndpoint, byUrl: e == null ? void 0 : e.urlUploadEndpoint }, features: { caption: !1, stretch: !1, border: !1, background: !1 } } }, imageResize: { class: ye, config: { resize: !0, crop: !1 } } }, data: d, readOnly: s.readOnly, i18n: s.locale, onChange: (l, h) => {
|
|
2957
|
+
i("onChange", l, h);
|
|
2543
2958
|
}, onReady: () => {
|
|
2544
|
-
new
|
|
2545
|
-
} }).initialize(
|
|
2959
|
+
new se("holder", s.readOnly, r, "1px solid #999"), new ge({ editor: r, config: { debounceTimer: 200, maxLength: 100 }, onUpdate: () => {
|
|
2960
|
+
} }).initialize(d), i("onReady");
|
|
2546
2961
|
} });
|
|
2547
|
-
}),
|
|
2962
|
+
}), Ut(() => {
|
|
2548
2963
|
r !== null && (r.destroy(), r = null);
|
|
2549
|
-
}), (
|
|
2550
|
-
} }),
|
|
2551
|
-
let
|
|
2552
|
-
for (let
|
|
2553
|
-
const t =
|
|
2554
|
-
|
|
2964
|
+
}), (d, l) => (qt(), jt("div", Se, [U("div", Le, [Vt(U("input", { type: "text", "onUpdate:modelValue": l[0] || (l[0] = (h) => n.value = h), placeholder: "请输入标题", class: "ebl-editor-title-input" }, null, 512), [[Kt, n.value]])]), U("div", xe, [U("span", Te, "最后修改时间:" + Yt(d.lastUpdateTime), 1)]), U("button", { onClick: a }, "保存")]));
|
|
2965
|
+
} }), Ht = [Ee];
|
|
2966
|
+
let Dt = [];
|
|
2967
|
+
for (let c in Ht) {
|
|
2968
|
+
const t = ie(Ht[c]);
|
|
2969
|
+
Dt.push(t);
|
|
2555
2970
|
}
|
|
2556
|
-
const
|
|
2557
|
-
t[
|
|
2558
|
-
} }))(
|
|
2971
|
+
const Re = { messages: { ui: { blockTunes: { toggler: { "Click to tune": "可拖拽和点击" } }, toolbar: { toolbox: { Add: "添加", Filter: "过滤", "Nothing found": "无内容" }, popover: { Filter: "过滤", "Nothing found": "无内容" } }, popover: { Filter: "筛选", "Nothing found": "未找到任何内容", "Convert to": "转化为" } }, 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: "已复制" }, 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": "右对齐" } }, 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": "向左缩进" } } } }, Nt = /* @__PURE__ */ ((c = []) => ({ version: "1.1.1", install: (t, e) => {
|
|
2972
|
+
t[ht] || (t[ht] = !0, c.forEach((i) => t.use(i)), e && t.provide("EblEditorSettings", e));
|
|
2973
|
+
} }))(Dt), De = Nt.install, Ne = Nt.version;
|
|
2559
2974
|
export {
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2975
|
+
Ee as EblEditor,
|
|
2976
|
+
Nt as default,
|
|
2977
|
+
De as install,
|
|
2978
|
+
Ne as version,
|
|
2979
|
+
Re as zhCn
|
|
2565
2980
|
};
|
|
2566
2981
|
//# sourceMappingURL=index.mjs.map
|