bto-md-editor 0.1.5 → 0.1.6
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/md-editor.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-2e4633d5]{position:relative;display:inline-flex;align-items:center;line-height:0}.tooltip[data-v-2e4633d5]{position:fixed;transform:translate(-50%);background:#3c3c3cf2;color:#fff;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.2;box-shadow:0 6px 20px #0003;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;pointer-events:none;z-index:1000}.tooltip.visible[data-v-2e4633d5]{opacity:1;visibility:visible}.shortcut[data-v-2e4633d5]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.icon[data-v-8ea77a66]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:50px;justify-content:space-between;background:#fff}.icon[data-v-8ea77a66]:hover{background:#0000000d}.font-size[data-v-8ea77a66]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.label[data-v-8ea77a66]{font-size:15px;color:#333}.dropdown[data-v-8ea77a66]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-8ea77a66],.dropdown-slide-leave-to[data-v-8ea77a66]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-8ea77a66],.dropdown-slide-leave-active[data-v-8ea77a66]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-8ea77a66]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-8ea77a66]:hover{background:#0000000d}.text[data-v-8ea77a66]{flex:1}.icon[data-v-0f5572cb]{cursor:default;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-0f5572cb]{width:auto;justify-content:space-between;background:#fff}.icon-stack[data-v-0f5572cb]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-0f5572cb]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-0f5572cb]:hover{background:#0000000d}.underline[data-v-0f5572cb]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#000}.color-select[data-v-0f5572cb]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.dropdown[data-v-0f5572cb]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-0f5572cb],.dropdown-slide-leave-to[data-v-0f5572cb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-0f5572cb],.dropdown-slide-leave-active[data-v-0f5572cb]{transition:opacity .18s ease,transform .18s ease}.section[data-v-0f5572cb]{margin-bottom:8px}.section-title[data-v-0f5572cb]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-0f5572cb]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-0f5572cb]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-0f5572cb]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-0f5572cb]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-0f5572cb]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-0f5572cb]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-0f5572cb]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-0f5572cb]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-0f5572cb]{justify-self:end;flex-shrink:1}.svg-icon[data-v-c83ef2e3]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-c83ef2e3]{width:1em;height:1em;display:block}.icon[data-v-620c7aa3]{cursor:default;width:19px;height:19px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-620c7aa3]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:#fff}.icon-stack[data-v-620c7aa3]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-620c7aa3]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-620c7aa3]:hover{background:#0000000d}.underline[data-v-620c7aa3]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#fff}.bg-color-select[data-v-620c7aa3]{position:relative;-webkit-user-select:none;user-select:none}.dropdown[data-v-620c7aa3]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-620c7aa3]{margin-bottom:8px}.section-title[data-v-620c7aa3]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-620c7aa3]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-620c7aa3]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-620c7aa3]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-620c7aa3]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-620c7aa3]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-620c7aa3]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-620c7aa3]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-620c7aa3]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-620c7aa3]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-620c7aa3],.dropdown-slide-leave-to[data-v-620c7aa3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-620c7aa3],.dropdown-slide-leave-active[data-v-620c7aa3]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-e1c5f3df]{position:relative}.image-input-panel[data-v-e1c5f3df]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.image-input[data-v-e1c5f3df]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.image-actions[data-v-e1c5f3df]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-e1c5f3df]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-e1c5f3df]:hover{background:#0000000d}.btn-primary[data-v-e1c5f3df]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-e1c5f3df]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-e1c5f3df],.img-panel-leave-active[data-v-e1c5f3df]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-e1c5f3df],.img-panel-leave-to[data-v-e1c5f3df]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-e1c5f3df],.img-panel-leave-from[data-v-e1c5f3df]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-35a7027c]{position:relative}.video-input-panel[data-v-35a7027c]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.video-input[data-v-35a7027c]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.video-actions[data-v-35a7027c]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-35a7027c]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-35a7027c]:hover{background:#0000000d}.btn-primary[data-v-35a7027c]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-35a7027c]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-35a7027c],.video-panel-leave-active[data-v-35a7027c]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-35a7027c],.video-panel-leave-to[data-v-35a7027c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-35a7027c],.video-panel-leave-from[data-v-35a7027c]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.find-icon[data-v-750ee9bb]{position:relative}.find-input-panel[data-v-750ee9bb]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.fr-header[data-v-750ee9bb]{display:flex;align-items:center;gap:6px;margin-bottom:6px}.fr-tab[data-v-750ee9bb]{border:none;background:transparent;padding:6px 8px;cursor:pointer;border-bottom:2px solid transparent}.fr-tab.active[data-v-750ee9bb]{border-color:#1a69f8;font-weight:600}.fr-label[data-v-750ee9bb]{display:block;font-size:12px;color:#666;margin:6px 0 4px}.fr-input-row[data-v-750ee9bb]{display:flex;align-items:center;gap:6px;width:100%}.fr-input[data-v-750ee9bb]{flex:1;padding:8px;border:1px solid #e5e7eb;border-radius:8px}.fr-count[data-v-750ee9bb]{font-size:12px;color:#999}.fr-actions[data-v-750ee9bb]{display:flex;gap:8px;margin-top:10px;justify-content:flex-end}.fr-btn[data-v-750ee9bb]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.fr-btn.primary[data-v-750ee9bb]{color:#fff;background:#1a69f8;border-color:#1a69f8}.find-panel-enter-active[data-v-750ee9bb],.find-panel-leave-active[data-v-750ee9bb]{transition:opacity .18s ease,transform .18s ease}.find-panel-enter-from[data-v-750ee9bb],.find-panel-leave-to[data-v-750ee9bb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.find-panel-enter-to[data-v-750ee9bb],.find-panel-leave-from[data-v-750ee9bb]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-47847dc2]{position:relative}.link-input-panel[data-v-47847dc2]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.field[data-v-47847dc2]{margin-bottom:8px}.label[data-v-47847dc2]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-47847dc2]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.actions[data-v-47847dc2]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-47847dc2]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-47847dc2]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-47847dc2]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-47847dc2],.link-panel-leave-active[data-v-47847dc2]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-47847dc2],.link-panel-leave-to[data-v-47847dc2]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-47847dc2],.link-panel-leave-from[data-v-47847dc2]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-8a3a35f7]{position:relative}.table-panel[data-v-8a3a35f7]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-8a3a35f7]{font-size:12px;color:#666;margin-bottom:6px}.grid[data-v-8a3a35f7]{display:flex;flex-direction:column;gap:4px;padding:8px;background:#f7f8fa;border-radius:8px}.row[data-v-8a3a35f7]{display:flex;gap:4px}.cell[data-v-8a3a35f7]{width:18px;height:18px;background:#fff;border:1px solid #e5e7eb;border-radius:3px;cursor:pointer}.cell.active[data-v-8a3a35f7]{background:#e8f1ff;border-color:#1677ff}.size[data-v-8a3a35f7]{margin-top:6px;font-size:12px;color:#333}.table-tools[data-v-bbf06816]{position:relative}.tools-panel[data-v-bbf06816]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.tools-grid[data-v-bbf06816]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-bbf06816]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.icon[data-v-693f2c14]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-693f2c14]:hover{background:#0000000d}.icon[data-v-587fb9a8]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;color:#404040;position:relative}.icon[data-v-587fb9a8]:hover{background:#0000000d}.heading-select[data-v-aeb74f7c]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-aeb74f7c]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:70px;justify-content:space-between;background:#fff}.icon[data-v-aeb74f7c]:hover{background:#0000000d}.label[data-v-aeb74f7c]{font-size:15px;color:#333}.dropdown[data-v-aeb74f7c]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-aeb74f7c],.dropdown-slide-leave-to[data-v-aeb74f7c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-aeb74f7c],.dropdown-slide-leave-active[data-v-aeb74f7c]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-aeb74f7c]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-aeb74f7c]:hover{background:#0000000d}.item-label[data-v-aeb74f7c]{flex:1;color:#222}.item-label.paragraph[data-v-aeb74f7c]{font-size:15px}.item-label.level-1[data-v-aeb74f7c]{font-size:22px;font-weight:600}.item-label.level-2[data-v-aeb74f7c]{font-size:20px;font-weight:600}.item-label.level-3[data-v-aeb74f7c]{font-size:18px;font-weight:600}.item-label.level-4[data-v-aeb74f7c]{font-size:16px}.item-label.level-5[data-v-aeb74f7c]{font-size:15px}.item-label.level-6[data-v-aeb74f7c]{font-size:14px}.shortcut[data-v-aeb74f7c]{color:#999;font-size:12px}.align-select[data-v-f2f793f3]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-f2f793f3]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:#fff;gap:3px}.icon_box[data-v-f2f793f3]:hover{background:#0000000d}.dropdown[data-v-f2f793f3]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform;padding:6px}.dropdown-slide-enter-from[data-v-f2f793f3],.dropdown-slide-leave-to[data-v-f2f793f3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-f2f793f3],.dropdown-slide-leave-active[data-v-f2f793f3]{transition:opacity .18s ease,transform .18s ease}.options[data-v-f2f793f3]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-f2f793f3]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-f2f793f3]:hover{background:#0000000d}.option.active[data-v-f2f793f3]{background:#0000001a}.header_box[data-v-547a7ef3]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid rgba(0,0,0,.1)}.header_box .icon[data-v-547a7ef3]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.header_box .icon[data-v-547a7ef3]:hover{background:#0000000d}.header_box .icon.active[data-v-547a7ef3]{background:#0000001a}.header_box .icon[aria-disabled=true][data-v-547a7ef3]{cursor:not-allowed;opacity:.5}.outline-wrapper[data-v-b5f802fc]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-b5f802fc]{border-left:1px solid #e5e7eb;padding:8px;font-size:14px;position:sticky;top:0;align-self:start;max-height:100%;background:#fff;display:flex;flex-direction:column;width:0;opacity:0;overflow:hidden;transform:scaleX(0);transform-origin:right center;transition:width .2s ease,transform .2s ease,opacity .2s ease;border-left:none}.outline.isOpen[data-v-b5f802fc]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid #e5e7eb}.outline__listWrap[data-v-b5f802fc]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-b5f802fc]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-b5f802fc]>*{display:inline-flex;gap:6px}.outline__list[data-v-b5f802fc]{list-style:none;padding:0;margin:0}.outline__item[data-v-b5f802fc]{cursor:pointer;padding:4px 0;color:#333}.outline__caret[data-v-b5f802fc]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline__caret.collapsed[data-v-b5f802fc]{transform:rotate(0)}.outline__caret.expanded[data-v-b5f802fc]{transform:rotate(90deg)}.outline__item[data-v-b5f802fc]:hover{color:#6366f1}.outline__item.lv-1[data-v-b5f802fc]{padding-left:0}.outline__item.lv-2[data-v-b5f802fc]{padding-left:8px}.outline__item.lv-3[data-v-b5f802fc]{padding-left:16px}.outline__item.lv-4[data-v-b5f802fc]{padding-left:24px}.outline__item.lv-5[data-v-b5f802fc]{padding-left:32px}.outline__item.lv-6[data-v-b5f802fc]{padding-left:40px}.outline__text[data-v-b5f802fc]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-b5f802fc]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline__close[data-v-b5f802fc]:hover{color:#6366f1}.outline__title[data-v-b5f802fc]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-b5f802fc]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-b5f802fc]{display:none}@media (max-width: 900px){.outline[data-v-b5f802fc]{position:absolute;right:0;top:0;bottom:0;width:0;max-width:85vw;box-shadow:-6px 0 24px #00000014;z-index:10}.outline.isOpen[data-v-b5f802fc]{width:min(85vw,280px)}.outline-drawer-mask[data-v-b5f802fc]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-b5f802fc],.outline-slide-leave-active[data-v-b5f802fc]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{transform:translate(100%)}}.outline-mask-enter-active[data-v-b5f802fc],.outline-mask-leave-active[data-v-b5f802fc]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-b5f802fc],.outline-mask-leave-to[data-v-b5f802fc]{opacity:0}.simple-editor[data-v-81f1ca5f]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:8px;background:#fff;box-sizing:border-box;border:1px solid #e5e7eb}.simple-editor.fullscreen[data-v-81f1ca5f]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.editor_wrapper[data-v-81f1ca5f]{position:relative;overflow-y:auto;color:#333;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-81f1ca5f]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-81f1ca5f]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-81f1ca5f]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-81f1ca5f]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-81f1ca5f]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-81f1ca5f]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-81f1ca5f]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-81f1ca5f]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-81f1ca5f]{background:#22c55e}.content[data-v-81f1ca5f]{padding:12px 24px}.content[data-v-81f1ca5f] img{max-width:100%;height:auto;display:inline-block}.content[data-v-81f1ca5f] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-81f1ca5f] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-81f1ca5f] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;background:#fff;box-shadow:inset 0 1px 2px #0000000f;margin-top:2px;flex-shrink:0;cursor:pointer;position:relative;display:inline-flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] .todo-box:after{content:"✓";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.3);opacity:0;color:#fff;font-size:12px;font-weight:700;transition:transform .18s ease,opacity .18s ease;animation:todo-check-out-81f1ca5f .18s ease both}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box:after{transform:translate(-50%,-50%) scale(1);opacity:1;animation:todo-check-in-81f1ca5f .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-81f1ca5f{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}60%{transform:translate(-50%,-50%) scale(1.15);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes todo-check-out-81f1ca5f{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] input[type=checkbox]{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:static;opacity:1;pointer-events:auto;width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;margin-top:2px}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-81f1ca5f] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-81f1ca5f] img.ProseMirror-selectednode{outline:2px solid #6366f1;border-radius:4px}.content[data-v-81f1ca5f] [data-resize-wrapper]{display:inline-block}.content[data-v-81f1ca5f] .tiptap-resize-handle{width:10px;height:10px;background:#1677ffd9;border-radius:2px;box-shadow:0 0 0 1px #fff;cursor:nwse-resize;z-index:4;opacity:0;pointer-events:none;transition:opacity .12s ease}.content[data-v-81f1ca5f] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-81f1ca5f] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-81f1ca5f] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-81f1ca5f] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-81f1ca5f] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-81f1ca5f] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-81f1ca5f] .tiptap-resize-wrapper:hover>img,.content[data-v-81f1ca5f] .tiptap-resize-wrapper:hover>video{outline:2px solid #6366f1;border-radius:4px}.content[data-v-81f1ca5f] .tiptap-resize-wrapper{position:relative}.content[data-v-81f1ca5f] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-81f1ca5f] .tiptap-upload-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#1677ff;font-size:12px;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:2}.content[data-v-81f1ca5f] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-81f1ca5f] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-81f1ca5f] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-81f1ca5f 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-81f1ca5f{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-81f1ca5f] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-81f1ca5f] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-81f1ca5f] .ProseMirror table th,.content[data-v-81f1ca5f] .ProseMirror table td{border:1px solid #e5e7eb;padding:8px;text-align:left;position:relative}.content[data-v-81f1ca5f] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content[data-v-81f1ca5f] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-81f1ca5f] .ProseMirror table .column-resize-handle{position:absolute;right:-3px;top:0;bottom:0;width:8px;background:transparent;cursor:col-resize;z-index:3;-webkit-user-select:none;user-select:none;pointer-events:auto}.content[data-v-81f1ca5f] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-81f1ca5f] .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:#999;pointer-events:none;float:left;height:0;white-space:pre-line}.content[data-v-81f1ca5f] code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f2f4f7;padding:2px 4px;border-radius:4px}.content[data-v-81f1ca5f] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-81f1ca5f] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f6f8fa;padding:12px;border-radius:6px;border:1px solid #e5e7eb;overflow:auto}.content[data-v-81f1ca5f] p{margin:12px 0}[data-v-81f1ca5f] .md-drag-handle{width:22px;height:22px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 10px #00000014;background:#fff;border:1px solid #e5e7eb;cursor:grab;z-index:5}[data-v-81f1ca5f] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-81f1ca5f]{grid-template-columns:1fr}.outline-markers[data-v-81f1ca5f]{display:none}}.link-modal-backdrop[data-v-81f1ca5f]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-81f1ca5f]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-81f1ca5f]{background:#fff;border:1px solid #e5e7eb;border-radius:8px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.link-modal__title[data-v-81f1ca5f]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-81f1ca5f]{width:100%;padding:8px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px}.link-modal__actions[data-v-81f1ca5f]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-81f1ca5f]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.tiptap-video[data-v-81f1ca5f]{display:block;width:640px;height:auto}[data-format-brush=true] .ProseMirror{cursor:url("data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1763569611105'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='87406'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='18'%20height='18'%3e%3cpath%20d='M840%20192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3%200-24%2010.7-24%2024v272c0%2013.3%2010.7%2024%2024%2024h592c13.3%200%2024-10.7%2024-24V256h32v200H465c-22.1%200-40%2017.9-40%2040v136h-44c-4.4%200-8%203.6-8%208v228c0%200.6%200.1%201.3%200.2%201.9-0.1%202-0.2%204.1-0.2%206.1%200%2046.4%2037.6%2084%2084%2084s84-37.6%2084-84c0-2.1-0.1-4.1-0.2-6.1%200.1-0.6%200.2-1.2%200.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1%200%2040-17.9%2040-40V232c0-22.1-17.9-40-40-40zM720%20352H208V160h512v192zM477%20876c0%2011-9%2020-20%2020s-20-9-20-20V696h40v180z'%20p-id='87407'%3e%3c/path%3e%3c/svg%3e") 0 16,crosshair}[data-format-brush=true] .ProseMirror *{cursor:inherit}`)),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
3
|
-
import { inject as ee, createVNode as d, defineComponent as ot, ref as E, onMounted as ut, onUnmounted as oe, watch as
|
|
2
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-2e4633d5]{position:relative;display:inline-flex;align-items:center;line-height:0}.tooltip[data-v-2e4633d5]{position:fixed;transform:translate(-50%);background:#3c3c3cf2;color:#fff;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.2;box-shadow:0 6px 20px #0003;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;pointer-events:none;z-index:1000}.tooltip.visible[data-v-2e4633d5]{opacity:1;visibility:visible}.shortcut[data-v-2e4633d5]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.icon[data-v-8ea77a66]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:50px;justify-content:space-between;background:#fff}.icon[data-v-8ea77a66]:hover{background:#0000000d}.font-size[data-v-8ea77a66]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.label[data-v-8ea77a66]{font-size:15px;color:#333}.dropdown[data-v-8ea77a66]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-8ea77a66],.dropdown-slide-leave-to[data-v-8ea77a66]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-8ea77a66],.dropdown-slide-leave-active[data-v-8ea77a66]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-8ea77a66]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-8ea77a66]:hover{background:#0000000d}.text[data-v-8ea77a66]{flex:1}.icon[data-v-0f5572cb]{cursor:default;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-0f5572cb]{width:auto;justify-content:space-between;background:#fff}.icon-stack[data-v-0f5572cb]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-0f5572cb]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-0f5572cb]:hover{background:#0000000d}.underline[data-v-0f5572cb]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#000}.color-select[data-v-0f5572cb]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.dropdown[data-v-0f5572cb]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-0f5572cb],.dropdown-slide-leave-to[data-v-0f5572cb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-0f5572cb],.dropdown-slide-leave-active[data-v-0f5572cb]{transition:opacity .18s ease,transform .18s ease}.section[data-v-0f5572cb]{margin-bottom:8px}.section-title[data-v-0f5572cb]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-0f5572cb]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-0f5572cb]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-0f5572cb]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-0f5572cb]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-0f5572cb]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-0f5572cb]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-0f5572cb]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-0f5572cb]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-0f5572cb]{justify-self:end;flex-shrink:1}.svg-icon[data-v-c83ef2e3]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-c83ef2e3]{width:1em;height:1em;display:block}.icon[data-v-620c7aa3]{cursor:default;width:19px;height:19px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-620c7aa3]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:#fff}.icon-stack[data-v-620c7aa3]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-620c7aa3]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-620c7aa3]:hover{background:#0000000d}.underline[data-v-620c7aa3]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#fff}.bg-color-select[data-v-620c7aa3]{position:relative;-webkit-user-select:none;user-select:none}.dropdown[data-v-620c7aa3]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-620c7aa3]{margin-bottom:8px}.section-title[data-v-620c7aa3]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-620c7aa3]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-620c7aa3]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-620c7aa3]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-620c7aa3]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-620c7aa3]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-620c7aa3]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-620c7aa3]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-620c7aa3]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-620c7aa3]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-620c7aa3],.dropdown-slide-leave-to[data-v-620c7aa3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-620c7aa3],.dropdown-slide-leave-active[data-v-620c7aa3]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-e1c5f3df]{position:relative}.image-input-panel[data-v-e1c5f3df]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.image-input[data-v-e1c5f3df]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.image-actions[data-v-e1c5f3df]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-e1c5f3df]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-e1c5f3df]:hover{background:#0000000d}.btn-primary[data-v-e1c5f3df]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-e1c5f3df]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-e1c5f3df],.img-panel-leave-active[data-v-e1c5f3df]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-e1c5f3df],.img-panel-leave-to[data-v-e1c5f3df]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-e1c5f3df],.img-panel-leave-from[data-v-e1c5f3df]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-35a7027c]{position:relative}.video-input-panel[data-v-35a7027c]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.video-input[data-v-35a7027c]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.video-actions[data-v-35a7027c]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-35a7027c]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-35a7027c]:hover{background:#0000000d}.btn-primary[data-v-35a7027c]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-35a7027c]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-35a7027c],.video-panel-leave-active[data-v-35a7027c]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-35a7027c],.video-panel-leave-to[data-v-35a7027c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-35a7027c],.video-panel-leave-from[data-v-35a7027c]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.find-icon[data-v-750ee9bb]{position:relative}.find-input-panel[data-v-750ee9bb]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.fr-header[data-v-750ee9bb]{display:flex;align-items:center;gap:6px;margin-bottom:6px}.fr-tab[data-v-750ee9bb]{border:none;background:transparent;padding:6px 8px;cursor:pointer;border-bottom:2px solid transparent}.fr-tab.active[data-v-750ee9bb]{border-color:#1a69f8;font-weight:600}.fr-label[data-v-750ee9bb]{display:block;font-size:12px;color:#666;margin:6px 0 4px}.fr-input-row[data-v-750ee9bb]{display:flex;align-items:center;gap:6px;width:100%}.fr-input[data-v-750ee9bb]{flex:1;padding:8px;border:1px solid #e5e7eb;border-radius:8px}.fr-count[data-v-750ee9bb]{font-size:12px;color:#999}.fr-actions[data-v-750ee9bb]{display:flex;gap:8px;margin-top:10px;justify-content:flex-end}.fr-btn[data-v-750ee9bb]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.fr-btn.primary[data-v-750ee9bb]{color:#fff;background:#1a69f8;border-color:#1a69f8}.find-panel-enter-active[data-v-750ee9bb],.find-panel-leave-active[data-v-750ee9bb]{transition:opacity .18s ease,transform .18s ease}.find-panel-enter-from[data-v-750ee9bb],.find-panel-leave-to[data-v-750ee9bb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.find-panel-enter-to[data-v-750ee9bb],.find-panel-leave-from[data-v-750ee9bb]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-47847dc2]{position:relative}.link-input-panel[data-v-47847dc2]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.field[data-v-47847dc2]{margin-bottom:8px}.label[data-v-47847dc2]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-47847dc2]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.actions[data-v-47847dc2]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-47847dc2]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-47847dc2]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-47847dc2]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-47847dc2],.link-panel-leave-active[data-v-47847dc2]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-47847dc2],.link-panel-leave-to[data-v-47847dc2]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-47847dc2],.link-panel-leave-from[data-v-47847dc2]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-8a3a35f7]{position:relative}.table-panel[data-v-8a3a35f7]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-8a3a35f7]{font-size:12px;color:#666;margin-bottom:6px}.grid[data-v-8a3a35f7]{display:flex;flex-direction:column;gap:4px;padding:8px;background:#f7f8fa;border-radius:8px}.row[data-v-8a3a35f7]{display:flex;gap:4px}.cell[data-v-8a3a35f7]{width:18px;height:18px;background:#fff;border:1px solid #e5e7eb;border-radius:3px;cursor:pointer}.cell.active[data-v-8a3a35f7]{background:#e8f1ff;border-color:#1677ff}.size[data-v-8a3a35f7]{margin-top:6px;font-size:12px;color:#333}.table-tools[data-v-bbf06816]{position:relative}.tools-panel[data-v-bbf06816]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.tools-grid[data-v-bbf06816]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-bbf06816]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.icon[data-v-693f2c14]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-693f2c14]:hover{background:#0000000d}.icon[data-v-587fb9a8]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;color:#404040;position:relative}.icon[data-v-587fb9a8]:hover{background:#0000000d}.heading-select[data-v-aeb74f7c]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-aeb74f7c]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:70px;justify-content:space-between;background:#fff}.icon[data-v-aeb74f7c]:hover{background:#0000000d}.label[data-v-aeb74f7c]{font-size:15px;color:#333}.dropdown[data-v-aeb74f7c]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-aeb74f7c],.dropdown-slide-leave-to[data-v-aeb74f7c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-aeb74f7c],.dropdown-slide-leave-active[data-v-aeb74f7c]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-aeb74f7c]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-aeb74f7c]:hover{background:#0000000d}.item-label[data-v-aeb74f7c]{flex:1;color:#222}.item-label.paragraph[data-v-aeb74f7c]{font-size:15px}.item-label.level-1[data-v-aeb74f7c]{font-size:22px;font-weight:600}.item-label.level-2[data-v-aeb74f7c]{font-size:20px;font-weight:600}.item-label.level-3[data-v-aeb74f7c]{font-size:18px;font-weight:600}.item-label.level-4[data-v-aeb74f7c]{font-size:16px}.item-label.level-5[data-v-aeb74f7c]{font-size:15px}.item-label.level-6[data-v-aeb74f7c]{font-size:14px}.shortcut[data-v-aeb74f7c]{color:#999;font-size:12px}.align-select[data-v-f2f793f3]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-f2f793f3]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:#fff;gap:3px}.icon_box[data-v-f2f793f3]:hover{background:#0000000d}.dropdown[data-v-f2f793f3]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform;padding:6px}.dropdown-slide-enter-from[data-v-f2f793f3],.dropdown-slide-leave-to[data-v-f2f793f3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-f2f793f3],.dropdown-slide-leave-active[data-v-f2f793f3]{transition:opacity .18s ease,transform .18s ease}.options[data-v-f2f793f3]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-f2f793f3]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-f2f793f3]:hover{background:#0000000d}.option.active[data-v-f2f793f3]{background:#0000001a}.header_box[data-v-40d61df0]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid rgba(0,0,0,.1)}.header_box.disabled[data-v-40d61df0]{pointer-events:none;opacity:.5}.header_box .icon[data-v-40d61df0]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.header_box .icon[data-v-40d61df0]:hover{background:#0000000d}.header_box .icon.active[data-v-40d61df0]{background:#0000001a}.header_box .icon[aria-disabled=true][data-v-40d61df0]{cursor:not-allowed;opacity:.5}.outline-wrapper[data-v-b5f802fc]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-b5f802fc]{border-left:1px solid #e5e7eb;padding:8px;font-size:14px;position:sticky;top:0;align-self:start;max-height:100%;background:#fff;display:flex;flex-direction:column;width:0;opacity:0;overflow:hidden;transform:scaleX(0);transform-origin:right center;transition:width .2s ease,transform .2s ease,opacity .2s ease;border-left:none}.outline.isOpen[data-v-b5f802fc]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid #e5e7eb}.outline__listWrap[data-v-b5f802fc]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-b5f802fc]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-b5f802fc]>*{display:inline-flex;gap:6px}.outline__list[data-v-b5f802fc]{list-style:none;padding:0;margin:0}.outline__item[data-v-b5f802fc]{cursor:pointer;padding:4px 0;color:#333}.outline__caret[data-v-b5f802fc]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline__caret.collapsed[data-v-b5f802fc]{transform:rotate(0)}.outline__caret.expanded[data-v-b5f802fc]{transform:rotate(90deg)}.outline__item[data-v-b5f802fc]:hover{color:#6366f1}.outline__item.lv-1[data-v-b5f802fc]{padding-left:0}.outline__item.lv-2[data-v-b5f802fc]{padding-left:8px}.outline__item.lv-3[data-v-b5f802fc]{padding-left:16px}.outline__item.lv-4[data-v-b5f802fc]{padding-left:24px}.outline__item.lv-5[data-v-b5f802fc]{padding-left:32px}.outline__item.lv-6[data-v-b5f802fc]{padding-left:40px}.outline__text[data-v-b5f802fc]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-b5f802fc]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline__close[data-v-b5f802fc]:hover{color:#6366f1}.outline__title[data-v-b5f802fc]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-b5f802fc]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-b5f802fc]{display:none}@media (max-width: 900px){.outline[data-v-b5f802fc]{position:absolute;right:0;top:0;bottom:0;width:0;max-width:85vw;box-shadow:-6px 0 24px #00000014;z-index:10}.outline.isOpen[data-v-b5f802fc]{width:min(85vw,280px)}.outline-drawer-mask[data-v-b5f802fc]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-b5f802fc],.outline-slide-leave-active[data-v-b5f802fc]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{transform:translate(100%)}}.outline-mask-enter-active[data-v-b5f802fc],.outline-mask-leave-active[data-v-b5f802fc]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-b5f802fc],.outline-mask-leave-to[data-v-b5f802fc]{opacity:0}.simple-editor[data-v-bd45188e]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:8px;background:#fff;box-sizing:border-box;border:1px solid #e5e7eb}.simple-editor.fullscreen[data-v-bd45188e]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.editor_wrapper[data-v-bd45188e]{position:relative;overflow-y:auto;color:#333;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-bd45188e]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-bd45188e]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-bd45188e]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-bd45188e]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-bd45188e]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-bd45188e]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-bd45188e]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-bd45188e]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-bd45188e]{background:#22c55e}.content[data-v-bd45188e]{padding:12px 24px}.content[data-v-bd45188e] img{max-width:100%;height:auto;display:inline-block}.content[data-v-bd45188e] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-bd45188e] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-bd45188e] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;background:#fff;box-shadow:inset 0 1px 2px #0000000f;margin-top:2px;flex-shrink:0;cursor:pointer;position:relative;display:inline-flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] .todo-box:after{content:"✓";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.3);opacity:0;color:#fff;font-size:12px;font-weight:700;transition:transform .18s ease,opacity .18s ease;animation:todo-check-out-bd45188e .18s ease both}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box:after{transform:translate(-50%,-50%) scale(1);opacity:1;animation:todo-check-in-bd45188e .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-bd45188e{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}60%{transform:translate(-50%,-50%) scale(1.15);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes todo-check-out-bd45188e{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] input[type=checkbox]{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:static;opacity:1;pointer-events:auto;width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;margin-top:2px}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-bd45188e] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-bd45188e] img.ProseMirror-selectednode{outline:2px solid #6366f1;border-radius:4px}.content[data-v-bd45188e] [data-resize-wrapper]{display:inline-block}.content[data-v-bd45188e] .tiptap-resize-handle{width:10px;height:10px;background:#1677ffd9;border-radius:2px;box-shadow:0 0 0 1px #fff;cursor:nwse-resize;z-index:4;opacity:0;pointer-events:none;transition:opacity .12s ease}.content[data-v-bd45188e] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-bd45188e] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-bd45188e] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-bd45188e] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-bd45188e] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-bd45188e] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-bd45188e] .tiptap-resize-wrapper:hover>img,.content[data-v-bd45188e] .tiptap-resize-wrapper:hover>video{outline:2px solid #6366f1;border-radius:4px}.content[data-v-bd45188e] .tiptap-resize-wrapper{position:relative}.content[data-v-bd45188e] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-bd45188e] .tiptap-upload-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#1677ff;font-size:12px;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:2}.content[data-v-bd45188e] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-bd45188e] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-bd45188e] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-bd45188e 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-bd45188e{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-bd45188e] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-bd45188e] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-bd45188e] .ProseMirror table th,.content[data-v-bd45188e] .ProseMirror table td{border:1px solid #e5e7eb;padding:8px;text-align:left;position:relative}.content[data-v-bd45188e] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content[data-v-bd45188e] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-bd45188e] .ProseMirror table .column-resize-handle{position:absolute;right:-3px;top:0;bottom:0;width:8px;background:transparent;cursor:col-resize;z-index:3;-webkit-user-select:none;user-select:none;pointer-events:auto}.content[data-v-bd45188e] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-bd45188e] .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:#999;pointer-events:none;float:left;height:0;white-space:pre-line}.content[data-v-bd45188e] code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f2f4f7;padding:2px 4px;border-radius:4px}.content[data-v-bd45188e] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-bd45188e] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f6f8fa;padding:12px;border-radius:6px;border:1px solid #e5e7eb;overflow:auto}.content[data-v-bd45188e] p{margin:12px 0}[data-v-bd45188e] .md-drag-handle{width:22px;height:22px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 10px #00000014;background:#fff;border:1px solid #e5e7eb;cursor:grab;z-index:5}[data-v-bd45188e] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-bd45188e]{grid-template-columns:1fr}.outline-markers[data-v-bd45188e]{display:none}}.link-modal-backdrop[data-v-bd45188e]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-bd45188e]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-bd45188e]{background:#fff;border:1px solid #e5e7eb;border-radius:8px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.link-modal__title[data-v-bd45188e]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-bd45188e]{width:100%;padding:8px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px}.link-modal__actions[data-v-bd45188e]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-bd45188e]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.tiptap-video[data-v-bd45188e]{display:block;width:640px;height:auto}[data-format-brush=true] .ProseMirror{cursor:url("data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1763569611105'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='87406'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='18'%20height='18'%3e%3cpath%20d='M840%20192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3%200-24%2010.7-24%2024v272c0%2013.3%2010.7%2024%2024%2024h592c13.3%200%2024-10.7%2024-24V256h32v200H465c-22.1%200-40%2017.9-40%2040v136h-44c-4.4%200-8%203.6-8%208v228c0%200.6%200.1%201.3%200.2%201.9-0.1%202-0.2%204.1-0.2%206.1%200%2046.4%2037.6%2084%2084%2084s84-37.6%2084-84c0-2.1-0.1-4.1-0.2-6.1%200.1-0.6%200.2-1.2%200.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1%200%2040-17.9%2040-40V232c0-22.1-17.9-40-40-40zM720%20352H208V160h512v192zM477%20876c0%2011-9%2020-20%2020s-20-9-20-20V696h40v180z'%20p-id='87407'%3e%3c/path%3e%3c/svg%3e") 0 16,crosshair}[data-format-brush=true] .ProseMirror *{cursor:inherit}`)),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
3
|
+
import { inject as ee, createVNode as d, defineComponent as ot, ref as E, onMounted as ut, onUnmounted as oe, watch as kt, nextTick as bt, createElementBlock as B, openBlock as T, renderSlot as ne, createBlock as xt, Teleport as se, createElementVNode as r, normalizeStyle as ct, normalizeClass as J, createCommentVNode as Y, toDisplayString as pt, computed as dt, onBeforeUnmount as ht, unref as L, withCtx as W, withModifiers as D, Transition as yt, Fragment as mt, renderList as gt, withDirectives as _t, vModelText as Lt, useAttrs as ie, resolveDynamicComponent as le } from "vue";
|
|
4
4
|
import { Editor as re, EditorContent as ae } from "@tiptap/vue-3";
|
|
5
5
|
import { StarterKit as ce } from "@tiptap/starter-kit";
|
|
6
6
|
import { Markdown as de } from "@tiptap/markdown";
|
|
@@ -23,41 +23,41 @@ const Ce = ue.extend({
|
|
|
23
23
|
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
24
24
|
uploading: {
|
|
25
25
|
default: null,
|
|
26
|
-
parseHTML: (
|
|
27
|
-
renderHTML: (
|
|
26
|
+
parseHTML: (c) => c.getAttribute("data-uploading") ? !0 : null,
|
|
27
|
+
renderHTML: (c) => c.uploading ? { "data-uploading": "true" } : {}
|
|
28
28
|
},
|
|
29
29
|
width: {
|
|
30
30
|
default: null,
|
|
31
|
-
parseHTML: (
|
|
32
|
-
const s =
|
|
31
|
+
parseHTML: (c) => {
|
|
32
|
+
const s = c.getAttribute("width") || c.style.width || "", o = String(s).match(/^(\d+)(px)?$/);
|
|
33
33
|
return o ? Number(o[1]) : null;
|
|
34
34
|
},
|
|
35
|
-
renderHTML: (
|
|
35
|
+
renderHTML: (c) => c.width ? { width: c.width } : {}
|
|
36
36
|
},
|
|
37
37
|
height: {
|
|
38
38
|
default: null,
|
|
39
|
-
parseHTML: (
|
|
40
|
-
const s =
|
|
39
|
+
parseHTML: (c) => {
|
|
40
|
+
const s = c.getAttribute("height") || c.style.height || "", o = String(s).match(/^(\d+)(px)?$/);
|
|
41
41
|
return o ? Number(o[1]) : null;
|
|
42
42
|
},
|
|
43
|
-
renderHTML: (
|
|
43
|
+
renderHTML: (c) => c.height ? { height: c.height } : {}
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
},
|
|
47
47
|
addNodeView() {
|
|
48
|
-
return ({ node: t, getPos:
|
|
48
|
+
return ({ node: t, getPos: c, editor: s }) => {
|
|
49
49
|
const o = document.createElement("img"), l = t.attrs;
|
|
50
50
|
o.src = l.src || "", l.alt && (o.alt = l.alt), l.title && (o.title = l.title), typeof l.width == "number" && (o.style.width = `${l.width}px`), typeof l.height == "number" && (o.style.height = `${l.height}px`), o.style.maxWidth = "100%", o.style.height = o.style.height || "auto", o.style.display = "inline-block";
|
|
51
|
-
const
|
|
51
|
+
const a = new Qt({
|
|
52
52
|
element: o,
|
|
53
53
|
node: t,
|
|
54
|
-
getPos:
|
|
54
|
+
getPos: c,
|
|
55
55
|
onResize: (x, z) => {
|
|
56
56
|
o.style.width = `${x}px`, o.style.height = `${z}px`;
|
|
57
57
|
},
|
|
58
58
|
onCommit: (x, z) => {
|
|
59
59
|
try {
|
|
60
|
-
const p = s, M =
|
|
60
|
+
const p = s, M = c();
|
|
61
61
|
if (M !== void 0) {
|
|
62
62
|
const { state: y } = p, C = y.schema.nodes.image, u = y.doc.nodeAt(M);
|
|
63
63
|
if (C && u) {
|
|
@@ -70,7 +70,7 @@ const Ce = ue.extend({
|
|
|
70
70
|
},
|
|
71
71
|
onUpdate: (x) => {
|
|
72
72
|
const z = x.attrs;
|
|
73
|
-
return typeof z.src == "string" && z.src && o.src !== z.src && (o.src = z.src), typeof z.width == "number" && (o.style.width = `${z.width}px`), typeof z.height == "number" && (o.style.height = `${z.height}px`), z.uploading ?
|
|
73
|
+
return typeof z.src == "string" && z.src && o.src !== z.src && (o.src = z.src), typeof z.width == "number" && (o.style.width = `${z.width}px`), typeof z.height == "number" && (o.style.height = `${z.height}px`), z.uploading ? a.wrapper.setAttribute("data-uploading", "true") : a.wrapper.removeAttribute("data-uploading"), !0;
|
|
74
74
|
},
|
|
75
75
|
options: {
|
|
76
76
|
directions: ["bottom-right", "bottom-left", "top-right", "top-left"],
|
|
@@ -85,13 +85,13 @@ const Ce = ue.extend({
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
try {
|
|
88
|
-
|
|
88
|
+
a.container.style.display = "inline-block", a.wrapper.style.display = "inline-block";
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
const S = document.createElement("div");
|
|
92
92
|
S.className = "tiptap-upload-mask";
|
|
93
93
|
const i = document.createElement("div");
|
|
94
|
-
return i.className = "tiptap-upload-progress", S.appendChild(i),
|
|
94
|
+
return i.className = "tiptap-upload-progress", S.appendChild(i), a.wrapper.appendChild(S), l.uploading && a.wrapper.setAttribute("data-uploading", "true"), a;
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
}), xe = ge.extend({
|
|
@@ -101,9 +101,9 @@ const Ce = ue.extend({
|
|
|
101
101
|
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
102
102
|
backgroundColor: {
|
|
103
103
|
default: null,
|
|
104
|
-
parseHTML: (
|
|
105
|
-
renderHTML: (
|
|
106
|
-
const s =
|
|
104
|
+
parseHTML: (c) => c.getAttribute("data-background-color"),
|
|
105
|
+
renderHTML: (c) => {
|
|
106
|
+
const s = c.backgroundColor;
|
|
107
107
|
return s ? {
|
|
108
108
|
"data-background-color": s,
|
|
109
109
|
style: `background-color: ${s}`
|
|
@@ -138,7 +138,7 @@ const _e = ((Xt = It == null ? void 0 : It.Node) == null ? void 0 : Xt.create) ?
|
|
|
138
138
|
width: {
|
|
139
139
|
default: null,
|
|
140
140
|
parseHTML: (t) => {
|
|
141
|
-
const
|
|
141
|
+
const c = t.getAttribute("width") || t.style.width || "", s = String(c).match(/^(\d+)(px)?$/);
|
|
142
142
|
return s ? Number(s[1]) : null;
|
|
143
143
|
},
|
|
144
144
|
renderHTML: (t) => t.width ? { width: t.width } : {}
|
|
@@ -146,7 +146,7 @@ const _e = ((Xt = It == null ? void 0 : It.Node) == null ? void 0 : Xt.create) ?
|
|
|
146
146
|
height: {
|
|
147
147
|
default: null,
|
|
148
148
|
parseHTML: (t) => {
|
|
149
|
-
const
|
|
149
|
+
const c = t.getAttribute("height") || t.style.height || "", s = String(c).match(/^(\d+)(px)?$/);
|
|
150
150
|
return s ? Number(s[1]) : null;
|
|
151
151
|
},
|
|
152
152
|
renderHTML: (t) => t.height ? { height: t.height } : {}
|
|
@@ -165,7 +165,7 @@ const _e = ((Xt = It == null ? void 0 : It.Node) == null ? void 0 : Xt.create) ?
|
|
|
165
165
|
return ["video", { "data-tiptap-video": "", ...t }];
|
|
166
166
|
},
|
|
167
167
|
renderMarkdown(t) {
|
|
168
|
-
const
|
|
168
|
+
const c = (t == null ? void 0 : t.attrs) || {}, s = typeof c.src == "string" ? c.src : "";
|
|
169
169
|
return s ? `[video](${s})` : "";
|
|
170
170
|
},
|
|
171
171
|
// Markdown → Node: 支持自定义语法 [video](url)
|
|
@@ -174,30 +174,30 @@ const _e = ((Xt = It == null ? void 0 : It.Node) == null ? void 0 : Xt.create) ?
|
|
|
174
174
|
level: "inline",
|
|
175
175
|
start: (t) => t.indexOf("[video]("),
|
|
176
176
|
tokenize: (t) => {
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
return { type: "video", raw:
|
|
177
|
+
const c = /^\[video\]\(([^)]+)\)/.exec(t);
|
|
178
|
+
if (c)
|
|
179
|
+
return { type: "video", raw: c[0], href: c[1] };
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
182
|
parseMarkdown(t) {
|
|
183
|
-
const
|
|
184
|
-
return
|
|
183
|
+
const c = (t == null ? void 0 : t.href) || (t == null ? void 0 : t.src) || "";
|
|
184
|
+
return c ? { type: "video", attrs: { src: c, controls: !0 } } : { type: "paragraph" };
|
|
185
185
|
},
|
|
186
186
|
addNodeView() {
|
|
187
|
-
return ({ node: t, getPos:
|
|
187
|
+
return ({ node: t, getPos: c, editor: s }) => {
|
|
188
188
|
var x;
|
|
189
189
|
const o = document.createElement("video"), l = t.attrs;
|
|
190
190
|
o.src = l.src || "", o.controls = l.controls !== !1, o.autoplay = !1, o.loop = !!l.loop, o.muted = !!l.muted, l.poster && (o.poster = l.poster), o.setAttribute("playsinline", "true"), l.class && (o.className = String(l.class)), typeof l.width == "number" && (o.style.width = `${l.width}px`), typeof l.height == "number" && (o.style.height = `${l.height}px`), o.style.display = "inline-block";
|
|
191
|
-
const
|
|
191
|
+
const a = new Qt({
|
|
192
192
|
element: o,
|
|
193
193
|
node: t,
|
|
194
|
-
getPos:
|
|
194
|
+
getPos: c,
|
|
195
195
|
onResize: (z, p) => {
|
|
196
196
|
o.style.width = `${z}px`, o.style.height = `${p}px`;
|
|
197
197
|
},
|
|
198
198
|
onCommit: (z, p) => {
|
|
199
199
|
try {
|
|
200
|
-
const M = s, y =
|
|
200
|
+
const M = s, y = c();
|
|
201
201
|
if (y !== void 0) {
|
|
202
202
|
const { state: C } = M, u = C.schema.nodes.video, f = C.doc.nodeAt(y);
|
|
203
203
|
if (u && f) {
|
|
@@ -211,14 +211,14 @@ const _e = ((Xt = It == null ? void 0 : It.Node) == null ? void 0 : Xt.create) ?
|
|
|
211
211
|
onUpdate: (z) => {
|
|
212
212
|
const p = z.attrs || {};
|
|
213
213
|
if (typeof p.src == "string" && p.src && o.src !== p.src && (o.src = p.src), typeof p.width == "number" && (o.style.width = `${p.width}px`), typeof p.height == "number" && (o.style.height = `${p.height}px`), p.uploading) {
|
|
214
|
-
|
|
214
|
+
a.wrapper.setAttribute("data-uploading", "true"), o.controls = !1;
|
|
215
215
|
try {
|
|
216
216
|
o.pause();
|
|
217
217
|
} catch {
|
|
218
218
|
}
|
|
219
219
|
o.style.pointerEvents = "none";
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
a.wrapper.removeAttribute("data-uploading"), o.controls = p.controls !== !1, o.style.pointerEvents = "";
|
|
222
222
|
return !0;
|
|
223
223
|
},
|
|
224
224
|
options: {
|
|
@@ -234,28 +234,28 @@ const _e = ((Xt = It == null ? void 0 : It.Node) == null ? void 0 : Xt.create) ?
|
|
|
234
234
|
}
|
|
235
235
|
});
|
|
236
236
|
try {
|
|
237
|
-
|
|
237
|
+
a.container.style.display = "inline-block", a.wrapper.style.display = "inline-block";
|
|
238
238
|
} catch {
|
|
239
239
|
}
|
|
240
240
|
const S = document.createElement("div");
|
|
241
241
|
S.className = "tiptap-upload-mask";
|
|
242
242
|
const i = document.createElement("div");
|
|
243
|
-
if (i.className = "tiptap-upload-progress", S.appendChild(i),
|
|
244
|
-
|
|
243
|
+
if (i.className = "tiptap-upload-progress", S.appendChild(i), a.wrapper.appendChild(S), (x = t.attrs) != null && x.uploading) {
|
|
244
|
+
a.wrapper.setAttribute("data-uploading", "true"), o.controls = !1;
|
|
245
245
|
try {
|
|
246
246
|
o.pause();
|
|
247
247
|
} catch {
|
|
248
248
|
}
|
|
249
249
|
o.style.pointerEvents = "none";
|
|
250
250
|
}
|
|
251
|
-
return
|
|
251
|
+
return a;
|
|
252
252
|
};
|
|
253
253
|
},
|
|
254
254
|
addCommands() {
|
|
255
255
|
return {
|
|
256
|
-
setVideo: (t) => ({ chain:
|
|
256
|
+
setVideo: (t) => ({ chain: c }) => {
|
|
257
257
|
const { src: s, HTMLAttributes: o = {} } = t || {};
|
|
258
|
-
return
|
|
258
|
+
return c().insertContent({ type: this.name, attrs: { src: s, ...o } }).run();
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
261
|
}
|
|
@@ -265,31 +265,31 @@ const _e = ((Xt = It == null ? void 0 : It.Node) == null ? void 0 : Xt.create) ?
|
|
|
265
265
|
return { ...(t = this.parent) == null ? void 0 : t.call(this), nested: !0 };
|
|
266
266
|
},
|
|
267
267
|
addNodeView() {
|
|
268
|
-
return ({ node: t, editor:
|
|
268
|
+
return ({ node: t, editor: c, getPos: s }) => {
|
|
269
269
|
const o = document.createElement("li");
|
|
270
270
|
o.setAttribute("data-type", "taskItem"), o.setAttribute("data-checked", t.attrs.checked ? "true" : "false");
|
|
271
271
|
const l = document.createElement("span");
|
|
272
272
|
l.className = "todo-box", l.tabIndex = 0, l.setAttribute("role", "checkbox"), l.setAttribute("aria-checked", t.attrs.checked ? "true" : "false"), l.addEventListener("mousedown", (i) => i.preventDefault());
|
|
273
|
-
const
|
|
273
|
+
const a = () => {
|
|
274
274
|
const i = typeof s == "function" ? s() : null;
|
|
275
275
|
if (i == null) return { pos: null, n: null };
|
|
276
|
-
const x =
|
|
276
|
+
const x = c.view.state.doc.nodeAt(i);
|
|
277
277
|
return { pos: i, n: x };
|
|
278
278
|
};
|
|
279
279
|
l.addEventListener("click", () => {
|
|
280
280
|
var C;
|
|
281
|
-
const { pos: i, n: x } =
|
|
281
|
+
const { pos: i, n: x } = a();
|
|
282
282
|
if (i == null || !x) return;
|
|
283
|
-
const z =
|
|
284
|
-
|
|
283
|
+
const z = c.view.state, p = z.schema.nodes.taskItem, M = !!((C = x.attrs) != null && C.checked), y = z.tr.setNodeMarkup(i, p, { ...x.attrs || {}, checked: !M });
|
|
284
|
+
c.view.dispatch(y);
|
|
285
285
|
}), l.addEventListener("keydown", (i) => {
|
|
286
286
|
var x;
|
|
287
287
|
if (i.key === "Enter" || i.key === " ") {
|
|
288
288
|
i.preventDefault();
|
|
289
|
-
const { pos: z, n: p } =
|
|
289
|
+
const { pos: z, n: p } = a();
|
|
290
290
|
if (z == null || !p) return;
|
|
291
|
-
const M =
|
|
292
|
-
|
|
291
|
+
const M = c.view.state, y = M.schema.nodes.taskItem, C = !!((x = p.attrs) != null && x.checked), u = M.tr.setNodeMarkup(z, y, { ...p.attrs || {}, checked: !C });
|
|
292
|
+
c.view.dispatch(u);
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
295
|
const S = document.createElement("div");
|
|
@@ -335,9 +335,9 @@ var ze = {
|
|
|
335
335
|
function $e() {
|
|
336
336
|
return "icon-" + ((1 + Math.random()) * 4294967296 | 0).toString(16).substring(1);
|
|
337
337
|
}
|
|
338
|
-
function Se(t,
|
|
339
|
-
var o = typeof
|
|
340
|
-
switch (
|
|
338
|
+
function Se(t, c, s) {
|
|
339
|
+
var o = typeof c.fill == "string" ? [c.fill] : c.fill || [], l = [], a = c.theme || s.theme;
|
|
340
|
+
switch (a) {
|
|
341
341
|
case "outline":
|
|
342
342
|
l.push(typeof o[0] == "string" ? o[0] : "currentColor"), l.push("none"), l.push(typeof o[0] == "string" ? o[0] : "currentColor"), l.push("none");
|
|
343
343
|
break;
|
|
@@ -352,23 +352,23 @@ function Se(t, a, s) {
|
|
|
352
352
|
break;
|
|
353
353
|
}
|
|
354
354
|
return {
|
|
355
|
-
size:
|
|
356
|
-
strokeWidth:
|
|
357
|
-
strokeLinecap:
|
|
358
|
-
strokeLinejoin:
|
|
355
|
+
size: c.size || s.size,
|
|
356
|
+
strokeWidth: c.strokeWidth || s.strokeWidth,
|
|
357
|
+
strokeLinecap: c.strokeLinecap || s.strokeLinecap,
|
|
358
|
+
strokeLinejoin: c.strokeLinejoin || s.strokeLinejoin,
|
|
359
359
|
colors: l,
|
|
360
360
|
id: t
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
363
|
var Te = Symbol("icon-context");
|
|
364
|
-
function vt(t,
|
|
364
|
+
function vt(t, c, s) {
|
|
365
365
|
var o = {
|
|
366
366
|
name: "icon-" + t,
|
|
367
367
|
props: ["size", "strokeWidth", "strokeLinecap", "strokeLinejoin", "theme", "fill", "spin"],
|
|
368
|
-
setup: function(
|
|
368
|
+
setup: function(a) {
|
|
369
369
|
var S = $e(), i = ee(Te, ze);
|
|
370
370
|
return function() {
|
|
371
|
-
var x =
|
|
371
|
+
var x = a.size, z = a.strokeWidth, p = a.strokeLinecap, M = a.strokeLinejoin, y = a.theme, C = a.fill, u = a.spin, f = Se(S, {
|
|
372
372
|
size: x,
|
|
373
373
|
strokeWidth: z,
|
|
374
374
|
strokeLinecap: p,
|
|
@@ -376,7 +376,7 @@ function vt(t, a, s) {
|
|
|
376
376
|
theme: y,
|
|
377
377
|
fill: C
|
|
378
378
|
}, i), v = [i.prefix + "-icon"];
|
|
379
|
-
return v.push(i.prefix + "-icon-" + t),
|
|
379
|
+
return v.push(i.prefix + "-icon-" + t), c && i.rtl && v.push(i.prefix + "-icon-rtl"), u && v.push(i.prefix + "-icon-spin"), d("span", {
|
|
380
380
|
class: v.join(" ")
|
|
381
381
|
}, [s(f)]);
|
|
382
382
|
};
|
|
@@ -702,18 +702,18 @@ const Bt = vt("check", !0, function(t) {
|
|
|
702
702
|
offset: { type: Number, default: 6 }
|
|
703
703
|
},
|
|
704
704
|
setup(t) {
|
|
705
|
-
const
|
|
705
|
+
const c = t, s = E(null), o = E(null), l = E(!1), a = E(c.placement), S = E({ top: 0, left: 0 });
|
|
706
706
|
function i() {
|
|
707
707
|
const p = s.value, M = o.value;
|
|
708
708
|
if (!p || !M) return;
|
|
709
|
-
let y =
|
|
710
|
-
const C = M.getBoundingClientRect(), u = C.top, f = window.innerHeight - C.bottom, v = p.offsetHeight +
|
|
711
|
-
y === "bottom" ? f < v && u >= v && (y = "top") : u < v && f >= v && (y = "bottom"),
|
|
712
|
-
const g = C.left + C.width / 2, h = y === "bottom" ? C.bottom +
|
|
709
|
+
let y = c.placement;
|
|
710
|
+
const C = M.getBoundingClientRect(), u = C.top, f = window.innerHeight - C.bottom, v = p.offsetHeight + c.offset;
|
|
711
|
+
y === "bottom" ? f < v && u >= v && (y = "top") : u < v && f >= v && (y = "bottom"), a.value = y;
|
|
712
|
+
const g = C.left + C.width / 2, h = y === "bottom" ? C.bottom + c.offset : C.top - c.offset - p.offsetHeight;
|
|
713
713
|
S.value = { top: h, left: g };
|
|
714
714
|
}
|
|
715
715
|
function x() {
|
|
716
|
-
l.value = !0,
|
|
716
|
+
l.value = !0, bt(i);
|
|
717
717
|
}
|
|
718
718
|
function z() {
|
|
719
719
|
l.value = !1;
|
|
@@ -722,10 +722,10 @@ const Bt = vt("check", !0, function(t) {
|
|
|
722
722
|
window.addEventListener("resize", i), window.addEventListener("scroll", i, !0);
|
|
723
723
|
}), oe(() => {
|
|
724
724
|
window.removeEventListener("resize", i), window.removeEventListener("scroll", i, !0);
|
|
725
|
-
}),
|
|
726
|
-
() =>
|
|
727
|
-
() =>
|
|
728
|
-
), (p, M) => (T(),
|
|
725
|
+
}), kt(
|
|
726
|
+
() => c.text,
|
|
727
|
+
() => bt(i)
|
|
728
|
+
), (p, M) => (T(), B("div", {
|
|
729
729
|
ref_key: "wrapperRef",
|
|
730
730
|
ref: o,
|
|
731
731
|
class: "tooltip-wrapper",
|
|
@@ -739,18 +739,18 @@ const Bt = vt("check", !0, function(t) {
|
|
|
739
739
|
r("div", {
|
|
740
740
|
ref_key: "tipRef",
|
|
741
741
|
ref: s,
|
|
742
|
-
class: J(["tooltip", [
|
|
742
|
+
class: J(["tooltip", [a.value, { visible: l.value }]]),
|
|
743
743
|
style: ct({ top: S.value.top + "px", left: S.value.left + "px" })
|
|
744
744
|
}, [
|
|
745
745
|
r("div", Re, pt(t.text), 1),
|
|
746
|
-
t.shortcut ? (T(),
|
|
746
|
+
t.shortcut ? (T(), B("div", Ne, pt(t.shortcut), 1)) : Y("", !0)
|
|
747
747
|
], 6)
|
|
748
748
|
]))
|
|
749
749
|
], 544));
|
|
750
750
|
}
|
|
751
|
-
}), nt = (t,
|
|
751
|
+
}), nt = (t, c) => {
|
|
752
752
|
const s = t.__vccOpts || t;
|
|
753
|
-
for (const [o, l] of
|
|
753
|
+
for (const [o, l] of c)
|
|
754
754
|
s[o] = l;
|
|
755
755
|
return s;
|
|
756
756
|
}, P = /* @__PURE__ */ nt(Pe, [["__scopeId", "data-v-2e4633d5"]]), Ge = ["aria-expanded"], Ye = { class: "label" }, Ke = {
|
|
@@ -763,7 +763,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
763
763
|
editor: {}
|
|
764
764
|
},
|
|
765
765
|
setup(t) {
|
|
766
|
-
const
|
|
766
|
+
const c = t, s = [
|
|
767
767
|
"12px",
|
|
768
768
|
"13px",
|
|
769
769
|
"14px",
|
|
@@ -778,9 +778,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
778
778
|
"48px"
|
|
779
779
|
], o = dt(() => {
|
|
780
780
|
var y, C;
|
|
781
|
-
const M = (C = (y =
|
|
781
|
+
const M = (C = (y = c.editor) == null ? void 0 : y.getAttributes("textStyle")) == null ? void 0 : C.fontSize;
|
|
782
782
|
return typeof M == "string" && M ? M : "15px";
|
|
783
|
-
}), l = E(!1),
|
|
783
|
+
}), l = E(!1), a = E(null);
|
|
784
784
|
function S() {
|
|
785
785
|
l.value || window.dispatchEvent(new CustomEvent(Ot, { detail: { id: Yt } })), l.value = !l.value;
|
|
786
786
|
}
|
|
@@ -789,10 +789,10 @@ const Bt = vt("check", !0, function(t) {
|
|
|
789
789
|
}
|
|
790
790
|
function x(M) {
|
|
791
791
|
var y;
|
|
792
|
-
(y =
|
|
792
|
+
(y = c.editor) == null || y.chain().focus().setMark("textStyle", { fontSize: M }).run(), i();
|
|
793
793
|
}
|
|
794
794
|
function z(M) {
|
|
795
|
-
const y = M.target, C =
|
|
795
|
+
const y = M.target, C = a.value;
|
|
796
796
|
C && !C.contains(y) && i();
|
|
797
797
|
}
|
|
798
798
|
ut(() => {
|
|
@@ -804,10 +804,10 @@ const Bt = vt("check", !0, function(t) {
|
|
|
804
804
|
var C;
|
|
805
805
|
((C = M.detail) == null ? void 0 : C.id) !== Yt && (l.value = !1);
|
|
806
806
|
}
|
|
807
|
-
return (M, y) => (T(),
|
|
807
|
+
return (M, y) => (T(), B("div", {
|
|
808
808
|
class: "font-size",
|
|
809
809
|
ref_key: "rootRef",
|
|
810
|
-
ref:
|
|
810
|
+
ref: a
|
|
811
811
|
}, [
|
|
812
812
|
d(L(P), {
|
|
813
813
|
text: "字体大小",
|
|
@@ -830,8 +830,8 @@ const Bt = vt("check", !0, function(t) {
|
|
|
830
830
|
}),
|
|
831
831
|
d(yt, { name: "dropdown-slide" }, {
|
|
832
832
|
default: W(() => [
|
|
833
|
-
l.value ? (T(),
|
|
834
|
-
(T(),
|
|
833
|
+
l.value ? (T(), B("div", Ke, [
|
|
834
|
+
(T(), B(mt, null, gt(s, (C) => r("div", {
|
|
835
835
|
key: C,
|
|
836
836
|
class: "dropdown-item",
|
|
837
837
|
"aria-selected": C === o.value,
|
|
@@ -866,7 +866,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
866
866
|
currentColor: {}
|
|
867
867
|
},
|
|
868
868
|
setup(t) {
|
|
869
|
-
const
|
|
869
|
+
const c = t, s = [
|
|
870
870
|
"#000000",
|
|
871
871
|
"#262626",
|
|
872
872
|
"#595959",
|
|
@@ -896,7 +896,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
896
896
|
"#85A5FF",
|
|
897
897
|
"#B37FEB",
|
|
898
898
|
"#F759AB"
|
|
899
|
-
], o = E(!1), l = E(!1),
|
|
899
|
+
], o = E(!1), l = E(!1), a = E(null), S = E(c.currentColor || "#000000"), i = E(v()), x = E("#F5222D");
|
|
900
900
|
function z() {
|
|
901
901
|
o.value || window.dispatchEvent(new CustomEvent(Wt, { detail: { id: Kt } })), o.value = !o.value;
|
|
902
902
|
}
|
|
@@ -908,14 +908,14 @@ const Bt = vt("check", !0, function(t) {
|
|
|
908
908
|
}
|
|
909
909
|
function y(b) {
|
|
910
910
|
var m;
|
|
911
|
-
(m =
|
|
911
|
+
(m = c.editor) == null || m.chain().focus().setColor(b).run(), x.value = b, g(b), p();
|
|
912
912
|
}
|
|
913
913
|
function C() {
|
|
914
914
|
var b;
|
|
915
|
-
(b =
|
|
915
|
+
(b = c.editor) == null || b.chain().focus().unsetColor().run(), p();
|
|
916
916
|
}
|
|
917
917
|
function u(b) {
|
|
918
|
-
const m = b.target, k =
|
|
918
|
+
const m = b.target, k = a.value;
|
|
919
919
|
k && !k.contains(m) && p();
|
|
920
920
|
}
|
|
921
921
|
function f() {
|
|
@@ -940,7 +940,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
940
940
|
}
|
|
941
941
|
let h = [];
|
|
942
942
|
function $() {
|
|
943
|
-
const b =
|
|
943
|
+
const b = c.editor;
|
|
944
944
|
b && (h = [
|
|
945
945
|
{ event: "selectionUpdate", handler: f },
|
|
946
946
|
{ event: "transaction", handler: f },
|
|
@@ -953,15 +953,15 @@ const Bt = vt("check", !0, function(t) {
|
|
|
953
953
|
document.addEventListener("click", u), window.addEventListener(Wt, j), $();
|
|
954
954
|
}), ht(() => {
|
|
955
955
|
document.removeEventListener("click", u), window.removeEventListener(Wt, j);
|
|
956
|
-
const b =
|
|
956
|
+
const b = c.editor;
|
|
957
957
|
b && h.forEach(({ event: m, handler: k }) => {
|
|
958
958
|
b.off(m, k);
|
|
959
959
|
}), h = [];
|
|
960
|
-
}),
|
|
961
|
-
() =>
|
|
960
|
+
}), kt(
|
|
961
|
+
() => c.editor,
|
|
962
962
|
(b, m) => {
|
|
963
|
-
m && h.forEach(({ event: k, handler:
|
|
964
|
-
m.off(k,
|
|
963
|
+
m && h.forEach(({ event: k, handler: U }) => {
|
|
964
|
+
m.off(k, U);
|
|
965
965
|
}), h = [], $();
|
|
966
966
|
}
|
|
967
967
|
);
|
|
@@ -969,10 +969,10 @@ const Bt = vt("check", !0, function(t) {
|
|
|
969
969
|
var k;
|
|
970
970
|
((k = b.detail) == null ? void 0 : k.id) !== Kt && (o.value = !1);
|
|
971
971
|
}
|
|
972
|
-
return (b, m) => (T(),
|
|
972
|
+
return (b, m) => (T(), B("div", {
|
|
973
973
|
class: "color-select",
|
|
974
974
|
ref_key: "rootRef",
|
|
975
|
-
ref:
|
|
975
|
+
ref: a
|
|
976
976
|
}, [
|
|
977
977
|
r("div", {
|
|
978
978
|
class: "icon icon-dropdown",
|
|
@@ -1022,15 +1022,15 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1022
1022
|
], 8, Qe),
|
|
1023
1023
|
d(yt, { name: "dropdown-slide" }, {
|
|
1024
1024
|
default: W(() => [
|
|
1025
|
-
o.value ? (T(),
|
|
1025
|
+
o.value ? (T(), B("div", to, [
|
|
1026
1026
|
r("div", eo, [
|
|
1027
1027
|
m[4] || (m[4] = r("div", { class: "section-title" }, "默认", -1)),
|
|
1028
1028
|
r("div", oo, [
|
|
1029
|
-
(T(!0),
|
|
1029
|
+
(T(!0), B(mt, null, gt(s.slice(0, 9), (k) => (T(), B("div", {
|
|
1030
1030
|
key: k,
|
|
1031
1031
|
class: "swatch",
|
|
1032
1032
|
style: ct({ background: k }),
|
|
1033
|
-
onClick: D((
|
|
1033
|
+
onClick: D((U) => y(k), ["stop"])
|
|
1034
1034
|
}, [
|
|
1035
1035
|
k === x.value ? (T(), xt(L(Bt), {
|
|
1036
1036
|
key: 0,
|
|
@@ -1043,11 +1043,11 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1043
1043
|
r("div", so, [
|
|
1044
1044
|
m[5] || (m[5] = r("div", { class: "section-title" }, "常用颜色", -1)),
|
|
1045
1045
|
r("div", io, [
|
|
1046
|
-
(T(!0),
|
|
1046
|
+
(T(!0), B(mt, null, gt(s.slice(9), (k) => (T(), B("div", {
|
|
1047
1047
|
key: k,
|
|
1048
1048
|
class: "swatch",
|
|
1049
1049
|
style: ct({ background: k }),
|
|
1050
|
-
onClick: D((
|
|
1050
|
+
onClick: D((U) => y(k), ["stop"])
|
|
1051
1051
|
}, [
|
|
1052
1052
|
k === x.value ? (T(), xt(L(Bt), {
|
|
1053
1053
|
key: 0,
|
|
@@ -1057,14 +1057,14 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1057
1057
|
], 12, lo))), 128))
|
|
1058
1058
|
])
|
|
1059
1059
|
]),
|
|
1060
|
-
i.value.length ? (T(),
|
|
1060
|
+
i.value.length ? (T(), B("div", ro, [
|
|
1061
1061
|
m[6] || (m[6] = r("div", { class: "section-title" }, "最近使用自定义颜色", -1)),
|
|
1062
1062
|
r("div", ao, [
|
|
1063
|
-
(T(!0),
|
|
1063
|
+
(T(!0), B(mt, null, gt(i.value, (k) => (T(), B("div", {
|
|
1064
1064
|
key: k,
|
|
1065
1065
|
class: "swatch",
|
|
1066
1066
|
style: ct({ background: k }),
|
|
1067
|
-
onClick: D((
|
|
1067
|
+
onClick: D((U) => y(k), ["stop"])
|
|
1068
1068
|
}, null, 12, co))), 128))
|
|
1069
1069
|
])
|
|
1070
1070
|
])) : Y("", !0),
|
|
@@ -1078,7 +1078,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1078
1078
|
onClick: D(M, ["stop"])
|
|
1079
1079
|
}, "更多颜色")
|
|
1080
1080
|
]),
|
|
1081
|
-
l.value ? (T(),
|
|
1081
|
+
l.value ? (T(), B("div", vo, [
|
|
1082
1082
|
_t(r("input", {
|
|
1083
1083
|
type: "color",
|
|
1084
1084
|
"onUpdate:modelValue": m[1] || (m[1] = (k) => S.value = k)
|
|
@@ -1110,7 +1110,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1110
1110
|
size: {}
|
|
1111
1111
|
},
|
|
1112
1112
|
setup(t) {
|
|
1113
|
-
const
|
|
1113
|
+
const c = t, s = ie(), o = /* @__PURE__ */ Object.assign({
|
|
1114
1114
|
"/src/svg/alignCenter.svg": ho,
|
|
1115
1115
|
"/src/svg/alignJustify.svg": mo,
|
|
1116
1116
|
"/src/svg/alignLeft.svg": go,
|
|
@@ -1138,8 +1138,8 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1138
1138
|
const f = u.split("/").pop();
|
|
1139
1139
|
f && (p[f] = y);
|
|
1140
1140
|
}), p;
|
|
1141
|
-
})(),
|
|
1142
|
-
const p =
|
|
1141
|
+
})(), a = dt(() => {
|
|
1142
|
+
const p = c.name.replace(/\.svg$/i, "");
|
|
1143
1143
|
return l[p] || "";
|
|
1144
1144
|
});
|
|
1145
1145
|
function S(p) {
|
|
@@ -1147,18 +1147,18 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1147
1147
|
let M = p.replace(/<\?xml[\s\S]*?\?>/gi, "").replace(/<!DOCTYPE[\s\S]*?>/gi, "");
|
|
1148
1148
|
return M = M.replace(/<svg([^>]*)>/i, (y, C) => `<svg${C.replace(/\s(width|height)="[^"]*"/gi, "").replace(/\s(fill|stroke)="[^"]*"/gi, "")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet">`), M = M.replace(/fill="(?!none)[^"]*"/gi, 'fill="currentColor"'), M = M.replace(/stroke="(?!none)[^"]*"/gi, 'stroke="currentColor"'), M;
|
|
1149
1149
|
}
|
|
1150
|
-
const i = dt(() => S(
|
|
1150
|
+
const i = dt(() => S(a.value));
|
|
1151
1151
|
function x(p) {
|
|
1152
1152
|
if (p != null)
|
|
1153
1153
|
return typeof p == "number" ? `${p}px` : p;
|
|
1154
1154
|
}
|
|
1155
1155
|
const z = dt(() => {
|
|
1156
|
-
const p = {}, M = x(
|
|
1157
|
-
M && (p.fontSize = M),
|
|
1156
|
+
const p = {}, M = x(c.size);
|
|
1157
|
+
M && (p.fontSize = M), c.color && (p.color = c.color);
|
|
1158
1158
|
const y = s.style ?? void 0;
|
|
1159
1159
|
return [p, y].filter(Boolean);
|
|
1160
1160
|
});
|
|
1161
|
-
return (p, M) => (T(),
|
|
1161
|
+
return (p, M) => (T(), B("span", {
|
|
1162
1162
|
class: J(["svg-icon", L(s).class]),
|
|
1163
1163
|
style: ct(z.value),
|
|
1164
1164
|
innerHTML: i.value
|
|
@@ -1183,7 +1183,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1183
1183
|
currentBg: {}
|
|
1184
1184
|
},
|
|
1185
1185
|
setup(t) {
|
|
1186
|
-
const
|
|
1186
|
+
const c = t, s = [
|
|
1187
1187
|
"#000000",
|
|
1188
1188
|
"#262626",
|
|
1189
1189
|
"#595959",
|
|
@@ -1213,7 +1213,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1213
1213
|
"#85A5FF",
|
|
1214
1214
|
"#B37FEB",
|
|
1215
1215
|
"#F759AB"
|
|
1216
|
-
], o = E(!1), l = E(!1),
|
|
1216
|
+
], o = E(!1), l = E(!1), a = E(null), S = E(c.currentBg || "#ffffff"), i = E(v()), x = E("#FADB14");
|
|
1217
1217
|
function z() {
|
|
1218
1218
|
o.value || window.dispatchEvent(new CustomEvent(Rt, { detail: { id: qt } })), o.value = !o.value;
|
|
1219
1219
|
}
|
|
@@ -1225,14 +1225,14 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
function y(b) {
|
|
1227
1227
|
var m;
|
|
1228
|
-
(m =
|
|
1228
|
+
(m = c.editor) == null || m.chain().focus().setMark("textStyle", { backgroundColor: b }).run(), x.value = b, g(b), p();
|
|
1229
1229
|
}
|
|
1230
1230
|
function C() {
|
|
1231
1231
|
var b;
|
|
1232
|
-
(b =
|
|
1232
|
+
(b = c.editor) == null || b.chain().focus().setMark("textStyle", { backgroundColor: null }).removeEmptyTextStyle().run(), p();
|
|
1233
1233
|
}
|
|
1234
1234
|
function u(b) {
|
|
1235
|
-
const m = b.target, k =
|
|
1235
|
+
const m = b.target, k = a.value;
|
|
1236
1236
|
k && !k.contains(m) && p();
|
|
1237
1237
|
}
|
|
1238
1238
|
function f() {
|
|
@@ -1257,7 +1257,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
let h = [];
|
|
1259
1259
|
function $() {
|
|
1260
|
-
const b =
|
|
1260
|
+
const b = c.editor;
|
|
1261
1261
|
b && (h = [
|
|
1262
1262
|
{ event: "selectionUpdate", handler: f },
|
|
1263
1263
|
{ event: "transaction", handler: f },
|
|
@@ -1270,15 +1270,15 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1270
1270
|
document.addEventListener("click", u), window.addEventListener(Rt, j), $();
|
|
1271
1271
|
}), ht(() => {
|
|
1272
1272
|
document.removeEventListener("click", u), window.removeEventListener(Rt, j);
|
|
1273
|
-
const b =
|
|
1273
|
+
const b = c.editor;
|
|
1274
1274
|
b && h.forEach(({ event: m, handler: k }) => {
|
|
1275
1275
|
b.off(m, k);
|
|
1276
1276
|
}), h = [];
|
|
1277
|
-
}),
|
|
1278
|
-
() =>
|
|
1277
|
+
}), kt(
|
|
1278
|
+
() => c.editor,
|
|
1279
1279
|
(b, m) => {
|
|
1280
|
-
m && h.forEach(({ event: k, handler:
|
|
1281
|
-
m.off(k,
|
|
1280
|
+
m && h.forEach(({ event: k, handler: U }) => {
|
|
1281
|
+
m.off(k, U);
|
|
1282
1282
|
}), h = [], $();
|
|
1283
1283
|
}
|
|
1284
1284
|
);
|
|
@@ -1286,10 +1286,10 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1286
1286
|
var k;
|
|
1287
1287
|
((k = b.detail) == null ? void 0 : k.id) !== qt && (o.value = !1);
|
|
1288
1288
|
}
|
|
1289
|
-
return (b, m) => (T(),
|
|
1289
|
+
return (b, m) => (T(), B("div", {
|
|
1290
1290
|
class: "bg-color-select",
|
|
1291
1291
|
ref_key: "rootRef",
|
|
1292
|
-
ref:
|
|
1292
|
+
ref: a
|
|
1293
1293
|
}, [
|
|
1294
1294
|
r("div", {
|
|
1295
1295
|
class: "icon icon-dropdown",
|
|
@@ -1337,7 +1337,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1337
1337
|
], 8, Ho),
|
|
1338
1338
|
d(yt, { name: "dropdown-slide" }, {
|
|
1339
1339
|
default: W(() => [
|
|
1340
|
-
o.value ? (T(),
|
|
1340
|
+
o.value ? (T(), B("div", Vo, [
|
|
1341
1341
|
r("div", Uo, [
|
|
1342
1342
|
m[4] || (m[4] = r("div", { class: "section-title" }, "无填充色", -1)),
|
|
1343
1343
|
r("div", Io, [
|
|
@@ -1357,24 +1357,24 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1357
1357
|
r("div", jo, [
|
|
1358
1358
|
m[5] || (m[5] = r("div", { class: "section-title" }, "默认", -1)),
|
|
1359
1359
|
r("div", Oo, [
|
|
1360
|
-
(T(!0),
|
|
1360
|
+
(T(!0), B(mt, null, gt(s.slice(0, 9), (k) => (T(), B("div", {
|
|
1361
1361
|
key: k,
|
|
1362
1362
|
class: "swatch",
|
|
1363
1363
|
style: ct({ background: k }),
|
|
1364
|
-
onClick: D((
|
|
1364
|
+
onClick: D((U) => y(k), ["stop"])
|
|
1365
1365
|
}, [
|
|
1366
|
-
k === x.value ? (T(),
|
|
1366
|
+
k === x.value ? (T(), B("span", Ro, "✓")) : Y("", !0)
|
|
1367
1367
|
], 12, Wo))), 128))
|
|
1368
1368
|
])
|
|
1369
1369
|
]),
|
|
1370
1370
|
r("div", No, [
|
|
1371
1371
|
m[6] || (m[6] = r("div", { class: "section-title" }, "常用颜色", -1)),
|
|
1372
1372
|
r("div", Po, [
|
|
1373
|
-
(T(!0),
|
|
1373
|
+
(T(!0), B(mt, null, gt(s.slice(9), (k) => (T(), B("div", {
|
|
1374
1374
|
key: k,
|
|
1375
1375
|
class: "swatch",
|
|
1376
1376
|
style: ct({ background: k }),
|
|
1377
|
-
onClick: D((
|
|
1377
|
+
onClick: D((U) => y(k), ["stop"])
|
|
1378
1378
|
}, [
|
|
1379
1379
|
k === x.value ? (T(), xt(L(Bt), {
|
|
1380
1380
|
key: 0,
|
|
@@ -1384,14 +1384,14 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1384
1384
|
], 12, Go))), 128))
|
|
1385
1385
|
])
|
|
1386
1386
|
]),
|
|
1387
|
-
i.value.length ? (T(),
|
|
1387
|
+
i.value.length ? (T(), B("div", Yo, [
|
|
1388
1388
|
m[7] || (m[7] = r("div", { class: "section-title" }, "最近使用自定义颜色", -1)),
|
|
1389
1389
|
r("div", Ko, [
|
|
1390
|
-
(T(!0),
|
|
1390
|
+
(T(!0), B(mt, null, gt(i.value, (k) => (T(), B("div", {
|
|
1391
1391
|
key: k,
|
|
1392
1392
|
class: "swatch",
|
|
1393
1393
|
style: ct({ background: k }),
|
|
1394
|
-
onClick: D((
|
|
1394
|
+
onClick: D((U) => y(k), ["stop"])
|
|
1395
1395
|
}, null, 12, qo))), 128))
|
|
1396
1396
|
])
|
|
1397
1397
|
])) : Y("", !0),
|
|
@@ -1405,7 +1405,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1405
1405
|
onClick: D(M, ["stop"])
|
|
1406
1406
|
}, "更多颜色")
|
|
1407
1407
|
]),
|
|
1408
|
-
l.value ? (T(),
|
|
1408
|
+
l.value ? (T(), B("div", Zo, [
|
|
1409
1409
|
_t(r("input", {
|
|
1410
1410
|
type: "color",
|
|
1411
1411
|
"onUpdate:modelValue": m[1] || (m[1] = (k) => S.value = k)
|
|
@@ -1437,22 +1437,22 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1437
1437
|
uploadSizeLimit: {}
|
|
1438
1438
|
},
|
|
1439
1439
|
setup(t) {
|
|
1440
|
-
const
|
|
1440
|
+
const c = t, s = E(!1), o = E(""), l = E(!1), a = E(null), S = () => {
|
|
1441
1441
|
s.value = !s.value;
|
|
1442
1442
|
}, i = () => {
|
|
1443
1443
|
var u, f, v, g, h, $;
|
|
1444
1444
|
const C = o.value.trim();
|
|
1445
|
-
C && (($ = (h = ((g = (f = (u =
|
|
1445
|
+
C && (($ = (h = ((g = (f = (u = c.editor) == null ? void 0 : u.chain) == null ? void 0 : (v = f.call(u)).focus) == null ? void 0 : g.call(v)).setImage({ src: C })).run) == null || $.call(h), s.value = !1, o.value = "");
|
|
1446
1446
|
}, x = (C) => {
|
|
1447
1447
|
C.key === "Enter" && i(), C.key === "Escape" && (s.value = !1, o.value = "");
|
|
1448
1448
|
}, z = () => {
|
|
1449
1449
|
var C;
|
|
1450
|
-
|
|
1450
|
+
c.imageUploader && ((C = a.value) == null || C.click());
|
|
1451
1451
|
}, p = async (C) => {
|
|
1452
|
-
var g, h, $, j, b, m, k,
|
|
1452
|
+
var g, h, $, j, b, m, k, U;
|
|
1453
1453
|
const u = C.target, f = (g = u.files) == null ? void 0 : g[0];
|
|
1454
|
-
if (u.value = "", !f || !
|
|
1455
|
-
const v = (h =
|
|
1454
|
+
if (u.value = "", !f || !c.imageUploader) return;
|
|
1455
|
+
const v = (h = c.uploadSizeLimit) == null ? void 0 : h.image;
|
|
1456
1456
|
if (typeof v == "number" && v > 0) {
|
|
1457
1457
|
const G = Math.max(1, v) * 1024 * 1024;
|
|
1458
1458
|
if (f.size > G) {
|
|
@@ -1466,10 +1466,10 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1466
1466
|
try {
|
|
1467
1467
|
l.value = !0;
|
|
1468
1468
|
let G = null;
|
|
1469
|
-
G = URL.createObjectURL(f), (
|
|
1470
|
-
const
|
|
1471
|
-
if (typeof
|
|
1472
|
-
const O =
|
|
1469
|
+
G = URL.createObjectURL(f), (U = (k = ((m = (j = ($ = c.editor) == null ? void 0 : $.chain) == null ? void 0 : (b = j.call($)).focus) == null ? void 0 : m.call(b)).setImage({ src: G, uploading: !0 })).run) == null || U.call(k);
|
|
1470
|
+
const H = await c.imageUploader(f);
|
|
1471
|
+
if (typeof H == "string" && H) {
|
|
1472
|
+
const O = c.editor, { state: K } = O, { doc: Z } = K;
|
|
1473
1473
|
let X = null;
|
|
1474
1474
|
if (Z.descendants((Q, rt) => {
|
|
1475
1475
|
var st, at;
|
|
@@ -1477,7 +1477,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1477
1477
|
}), X != null) {
|
|
1478
1478
|
const Q = Z.nodeAt(X), rt = K.schema.nodes.image;
|
|
1479
1479
|
if (Q && rt) {
|
|
1480
|
-
const st = { ...Q.attrs || {}, src:
|
|
1480
|
+
const st = { ...Q.attrs || {}, src: H, uploading: null }, at = K.tr.setNodeMarkup(X, rt, st, Q.marks);
|
|
1481
1481
|
O.view.dispatch(at);
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
@@ -1500,7 +1500,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1500
1500
|
}, document.addEventListener("mousedown", y, !0);
|
|
1501
1501
|
}), ht(() => {
|
|
1502
1502
|
y && (document.removeEventListener("mousedown", y, !0), y = null);
|
|
1503
|
-
}), (C, u) => (T(),
|
|
1503
|
+
}), (C, u) => (T(), B("div", {
|
|
1504
1504
|
class: "icon image-icon",
|
|
1505
1505
|
onClick: S,
|
|
1506
1506
|
ref_key: "rootRef",
|
|
@@ -1523,7 +1523,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1523
1523
|
appear: ""
|
|
1524
1524
|
}, {
|
|
1525
1525
|
default: W(() => [
|
|
1526
|
-
s.value ? (T(),
|
|
1526
|
+
s.value ? (T(), B("div", {
|
|
1527
1527
|
key: 0,
|
|
1528
1528
|
class: "image-input-panel",
|
|
1529
1529
|
onClick: u[1] || (u[1] = D(() => {
|
|
@@ -1540,7 +1540,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1540
1540
|
]),
|
|
1541
1541
|
r("input", {
|
|
1542
1542
|
ref_key: "imageUploadInput",
|
|
1543
|
-
ref:
|
|
1543
|
+
ref: a,
|
|
1544
1544
|
type: "file",
|
|
1545
1545
|
accept: "image/*",
|
|
1546
1546
|
style: { display: "none" },
|
|
@@ -1553,8 +1553,8 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1553
1553
|
}, "插入"),
|
|
1554
1554
|
r("button", {
|
|
1555
1555
|
class: "btn",
|
|
1556
|
-
"aria-disabled": !
|
|
1557
|
-
disabled: !
|
|
1556
|
+
"aria-disabled": !c.imageUploader || l.value,
|
|
1557
|
+
disabled: !c.imageUploader || l.value,
|
|
1558
1558
|
onClick: D(z, ["stop"])
|
|
1559
1559
|
}, pt(l.value ? "上传中…" : "上传文件"), 9, en)
|
|
1560
1560
|
])
|
|
@@ -1572,12 +1572,12 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1572
1572
|
uploadSizeLimit: {}
|
|
1573
1573
|
},
|
|
1574
1574
|
setup(t) {
|
|
1575
|
-
const
|
|
1575
|
+
const c = t, s = E(!1), o = E(""), l = E(!1), a = E(null), S = () => {
|
|
1576
1576
|
s.value = !s.value;
|
|
1577
1577
|
}, i = () => {
|
|
1578
1578
|
const u = o.value.trim();
|
|
1579
1579
|
if (!u) return;
|
|
1580
|
-
const f =
|
|
1580
|
+
const f = c.editor, v = f == null ? void 0 : f.commands;
|
|
1581
1581
|
if (/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(u)) {
|
|
1582
1582
|
const h = String(u).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1583
1583
|
try {
|
|
@@ -1604,12 +1604,12 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1604
1604
|
u.key === "Enter" && i(), u.key === "Escape" && (s.value = !1, o.value = "");
|
|
1605
1605
|
}, z = () => {
|
|
1606
1606
|
var u;
|
|
1607
|
-
|
|
1607
|
+
c.videoUploader && ((u = a.value) == null || u.click());
|
|
1608
1608
|
}, p = async (u) => {
|
|
1609
1609
|
var $, j;
|
|
1610
1610
|
const f = u.target, v = ($ = f.files) == null ? void 0 : $[0];
|
|
1611
|
-
if (f.value = "", !v || !
|
|
1612
|
-
const g = (j =
|
|
1611
|
+
if (f.value = "", !v || !c.videoUploader) return;
|
|
1612
|
+
const g = (j = c.uploadSizeLimit) == null ? void 0 : j.video;
|
|
1613
1613
|
if (typeof g == "number" && g > 0) {
|
|
1614
1614
|
const b = Math.max(1, g) * 1024 * 1024;
|
|
1615
1615
|
if (v.size > b) {
|
|
@@ -1623,7 +1623,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1623
1623
|
let h = null;
|
|
1624
1624
|
try {
|
|
1625
1625
|
l.value = !0;
|
|
1626
|
-
const b =
|
|
1626
|
+
const b = c.editor, m = b == null ? void 0 : b.commands;
|
|
1627
1627
|
h = URL.createObjectURL(v);
|
|
1628
1628
|
try {
|
|
1629
1629
|
if (typeof (m == null ? void 0 : m.setVideo) == "function")
|
|
@@ -1632,18 +1632,18 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1632
1632
|
HTMLAttributes: { controls: !0, width: 640, uploading: !0 }
|
|
1633
1633
|
}).run();
|
|
1634
1634
|
else {
|
|
1635
|
-
const
|
|
1635
|
+
const U = String(h).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1636
1636
|
try {
|
|
1637
1637
|
b.chain().focus().insertContent(
|
|
1638
|
-
`<p><a href="${
|
|
1638
|
+
`<p><a href="${U}" target="_blank" rel="noopener noreferrer">${U}</a></p>`
|
|
1639
1639
|
).run();
|
|
1640
1640
|
} catch {
|
|
1641
|
-
b.chain().focus().insertContent(
|
|
1641
|
+
b.chain().focus().insertContent(U).run();
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
1644
|
} catch {
|
|
1645
1645
|
}
|
|
1646
|
-
const k = await
|
|
1646
|
+
const k = await c.videoUploader(v);
|
|
1647
1647
|
h && M(h, k), s.value = !1, o.value = "";
|
|
1648
1648
|
} finally {
|
|
1649
1649
|
l.value = !1;
|
|
@@ -1654,7 +1654,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1654
1654
|
}
|
|
1655
1655
|
};
|
|
1656
1656
|
function M(u, f) {
|
|
1657
|
-
const v =
|
|
1657
|
+
const v = c.editor;
|
|
1658
1658
|
if (!v) return;
|
|
1659
1659
|
const { state: g } = v, { doc: h } = g;
|
|
1660
1660
|
let $ = null;
|
|
@@ -1678,7 +1678,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1678
1678
|
}, document.addEventListener("mousedown", C, !0);
|
|
1679
1679
|
}), ht(() => {
|
|
1680
1680
|
C && (document.removeEventListener("mousedown", C, !0), C = null);
|
|
1681
|
-
}), (u, f) => (T(),
|
|
1681
|
+
}), (u, f) => (T(), B("div", {
|
|
1682
1682
|
class: "icon video-icon",
|
|
1683
1683
|
onClick: S,
|
|
1684
1684
|
ref_key: "rootRef",
|
|
@@ -1701,7 +1701,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1701
1701
|
appear: ""
|
|
1702
1702
|
}, {
|
|
1703
1703
|
default: W(() => [
|
|
1704
|
-
s.value ? (T(),
|
|
1704
|
+
s.value ? (T(), B("div", {
|
|
1705
1705
|
key: 0,
|
|
1706
1706
|
class: "video-input-panel",
|
|
1707
1707
|
onClick: f[1] || (f[1] = D(() => {
|
|
@@ -1718,7 +1718,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1718
1718
|
]),
|
|
1719
1719
|
r("input", {
|
|
1720
1720
|
ref_key: "videoUploadInput",
|
|
1721
|
-
ref:
|
|
1721
|
+
ref: a,
|
|
1722
1722
|
type: "file",
|
|
1723
1723
|
accept: "video/*,application/x-mpegURL",
|
|
1724
1724
|
style: { display: "none" },
|
|
@@ -1731,8 +1731,8 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1731
1731
|
}, "插入"),
|
|
1732
1732
|
r("button", {
|
|
1733
1733
|
class: "btn",
|
|
1734
|
-
"aria-disabled": !
|
|
1735
|
-
disabled: !
|
|
1734
|
+
"aria-disabled": !c.videoUploader || l.value,
|
|
1735
|
+
disabled: !c.videoUploader || l.value,
|
|
1736
1736
|
onClick: D(z, ["stop"])
|
|
1737
1737
|
}, pt(l.value ? "上传中…" : "上传文件"), 9, ln)
|
|
1738
1738
|
])
|
|
@@ -1759,19 +1759,19 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1759
1759
|
props: {
|
|
1760
1760
|
editor: {}
|
|
1761
1761
|
},
|
|
1762
|
-
setup(t, { expose:
|
|
1763
|
-
const s = t, o = E(!1), l = E("find"),
|
|
1764
|
-
const
|
|
1765
|
-
return !
|
|
1762
|
+
setup(t, { expose: c }) {
|
|
1763
|
+
const s = t, o = E(!1), l = E("find"), a = E(""), S = E(""), i = E([]), x = E(0), z = dt(() => {
|
|
1764
|
+
const H = i.value.length;
|
|
1765
|
+
return !a.value || !H ? "0/0" : `${Math.min(Math.max(x.value + 1, 1), H)}/${H}`;
|
|
1766
1766
|
}), p = typeof navigator < "u" && navigator.platform.includes("Mac"), M = dt(() => p ? "⌘ F / ⌥ ⌘ F" : "Ctrl F / Ctrl H"), y = () => o.value = !o.value, C = () => o.value = !1;
|
|
1767
1767
|
function u() {
|
|
1768
|
-
var
|
|
1769
|
-
return ((
|
|
1768
|
+
var H;
|
|
1769
|
+
return ((H = s.editor) == null ? void 0 : H.view) || null;
|
|
1770
1770
|
}
|
|
1771
1771
|
function f() {
|
|
1772
|
-
const
|
|
1773
|
-
if (i.value = [], x.value = 0, !
|
|
1774
|
-
const K =
|
|
1772
|
+
const H = u(), O = a.value;
|
|
1773
|
+
if (i.value = [], x.value = 0, !H || !O) return;
|
|
1774
|
+
const K = H.dom, Z = document.createTreeWalker(K, NodeFilter.SHOW_TEXT, null);
|
|
1775
1775
|
let X;
|
|
1776
1776
|
for (; X = Z.nextNode(); ) {
|
|
1777
1777
|
const Q = X, rt = Q.data || "";
|
|
@@ -1779,60 +1779,60 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1779
1779
|
for (; ; ) {
|
|
1780
1780
|
const at = rt.indexOf(O, st);
|
|
1781
1781
|
if (at === -1) break;
|
|
1782
|
-
const Ct =
|
|
1782
|
+
const Ct = H.posAtDOM(Q, at), St = H.posAtDOM(Q, at + O.length);
|
|
1783
1783
|
typeof Ct == "number" && typeof St == "number" && i.value.push({ from: Ct, to: St }), st = at + O.length;
|
|
1784
1784
|
}
|
|
1785
1785
|
}
|
|
1786
|
-
|
|
1786
|
+
bt(() => {
|
|
1787
1787
|
i.value.length && v(0);
|
|
1788
1788
|
});
|
|
1789
1789
|
}
|
|
1790
|
-
function v(
|
|
1790
|
+
function v(H) {
|
|
1791
1791
|
const O = s.editor, K = u();
|
|
1792
1792
|
if (!O || !K || !i.value.length) return;
|
|
1793
1793
|
const Z = i.value.length;
|
|
1794
|
-
x.value = (
|
|
1794
|
+
x.value = (H % Z + Z) % Z;
|
|
1795
1795
|
const X = i.value[x.value];
|
|
1796
1796
|
O.chain().focus().setTextSelection({ from: X.from, to: X.to }).run();
|
|
1797
1797
|
}
|
|
1798
1798
|
const g = () => i.value.length && v(x.value + 1), h = () => i.value.length && v(x.value - 1);
|
|
1799
1799
|
function $() {
|
|
1800
|
-
const
|
|
1801
|
-
if (!
|
|
1802
|
-
const O = i.value[x.value], K =
|
|
1803
|
-
|
|
1800
|
+
const H = s.editor;
|
|
1801
|
+
if (!H || !i.value.length) return;
|
|
1802
|
+
const O = i.value[x.value], K = H.state.tr.insertText(S.value, O.from, O.to);
|
|
1803
|
+
H.view.dispatch(K), f();
|
|
1804
1804
|
}
|
|
1805
1805
|
function j() {
|
|
1806
|
-
const
|
|
1807
|
-
if (!
|
|
1808
|
-
const O = [...i.value], K =
|
|
1806
|
+
const H = s.editor;
|
|
1807
|
+
if (!H || !i.value.length) return;
|
|
1808
|
+
const O = [...i.value], K = H.state.tr;
|
|
1809
1809
|
for (let Z = O.length - 1; Z >= 0; Z--) {
|
|
1810
1810
|
const X = O[Z];
|
|
1811
1811
|
K.insertText(S.value, X.from, X.to);
|
|
1812
1812
|
}
|
|
1813
|
-
|
|
1813
|
+
H.view.dispatch(K), f();
|
|
1814
1814
|
}
|
|
1815
|
-
function b(
|
|
1816
|
-
|
|
1815
|
+
function b(H) {
|
|
1816
|
+
a.value = H.target.value, f();
|
|
1817
1817
|
}
|
|
1818
|
-
function m(
|
|
1819
|
-
|
|
1818
|
+
function m(H) {
|
|
1819
|
+
H.key === "Enter" && g(), H.key === "Escape" && C();
|
|
1820
1820
|
}
|
|
1821
1821
|
const k = E(null);
|
|
1822
|
-
let
|
|
1822
|
+
let U = null;
|
|
1823
1823
|
ut(() => {
|
|
1824
|
-
|
|
1824
|
+
U = (H) => {
|
|
1825
1825
|
if (!o.value) return;
|
|
1826
|
-
const O = k.value, K =
|
|
1826
|
+
const O = k.value, K = H.target;
|
|
1827
1827
|
O && K && !O.contains(K) && C();
|
|
1828
|
-
}, document.addEventListener("mousedown",
|
|
1828
|
+
}, document.addEventListener("mousedown", U, !0);
|
|
1829
1829
|
}), ht(() => {
|
|
1830
|
-
|
|
1830
|
+
U && (document.removeEventListener("mousedown", U, !0), U = null);
|
|
1831
1831
|
});
|
|
1832
|
-
function G(
|
|
1833
|
-
|
|
1832
|
+
function G(H) {
|
|
1833
|
+
H && (l.value = H), o.value = !0, bt(f);
|
|
1834
1834
|
}
|
|
1835
|
-
return
|
|
1835
|
+
return c({ openPanel: G }), (H, O) => (T(), B("div", {
|
|
1836
1836
|
class: "icon find-icon",
|
|
1837
1837
|
ref_key: "rootRef",
|
|
1838
1838
|
ref: k,
|
|
@@ -1856,7 +1856,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1856
1856
|
appear: ""
|
|
1857
1857
|
}, {
|
|
1858
1858
|
default: W(() => [
|
|
1859
|
-
o.value ? (T(),
|
|
1859
|
+
o.value ? (T(), B("div", {
|
|
1860
1860
|
key: 0,
|
|
1861
1861
|
class: "find-input-panel",
|
|
1862
1862
|
onClick: O[3] || (O[3] = D(() => {
|
|
@@ -1872,17 +1872,17 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1872
1872
|
onClick: O[1] || (O[1] = D((K) => l.value = "replace", ["stop"]))
|
|
1873
1873
|
}, " 替换 ", 2)
|
|
1874
1874
|
]),
|
|
1875
|
-
l.value === "find" ? (T(),
|
|
1875
|
+
l.value === "find" ? (T(), B("div", dn, [
|
|
1876
1876
|
O[4] || (O[4] = r("label", { class: "fr-label" }, "查找", -1)),
|
|
1877
1877
|
r("div", un, [
|
|
1878
1878
|
r("input", {
|
|
1879
1879
|
class: "fr-input",
|
|
1880
|
-
value:
|
|
1880
|
+
value: a.value,
|
|
1881
1881
|
placeholder: "输入关键字",
|
|
1882
1882
|
onInput: b,
|
|
1883
1883
|
onKeydown: m
|
|
1884
1884
|
}, null, 40, vn),
|
|
1885
|
-
|
|
1885
|
+
a.value ? (T(), B("span", fn, pt(z.value), 1)) : Y("", !0)
|
|
1886
1886
|
]),
|
|
1887
1887
|
r("div", pn, [
|
|
1888
1888
|
r("button", {
|
|
@@ -1894,16 +1894,16 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1894
1894
|
onClick: D(g, ["stop"])
|
|
1895
1895
|
}, "下一个")
|
|
1896
1896
|
])
|
|
1897
|
-
])) : (T(),
|
|
1897
|
+
])) : (T(), B("div", hn, [
|
|
1898
1898
|
O[5] || (O[5] = r("label", { class: "fr-label" }, "查找", -1)),
|
|
1899
1899
|
r("div", mn, [
|
|
1900
1900
|
r("input", {
|
|
1901
1901
|
class: "fr-input",
|
|
1902
|
-
value:
|
|
1902
|
+
value: a.value,
|
|
1903
1903
|
placeholder: "输入关键字",
|
|
1904
1904
|
onInput: b
|
|
1905
1905
|
}, null, 40, gn),
|
|
1906
|
-
|
|
1906
|
+
a.value ? (T(), B("span", kn, pt(z.value), 1)) : Y("", !0)
|
|
1907
1907
|
]),
|
|
1908
1908
|
O[6] || (O[6] = r("label", { class: "fr-label" }, "替换为", -1)),
|
|
1909
1909
|
_t(r("input", {
|
|
@@ -1945,11 +1945,11 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1945
1945
|
editor: {}
|
|
1946
1946
|
},
|
|
1947
1947
|
setup(t) {
|
|
1948
|
-
const
|
|
1948
|
+
const c = t, s = E(!1), o = E(""), l = E("");
|
|
1949
1949
|
E(!1);
|
|
1950
|
-
const
|
|
1950
|
+
const a = E(null);
|
|
1951
1951
|
function S() {
|
|
1952
|
-
const u =
|
|
1952
|
+
const u = c.editor;
|
|
1953
1953
|
if (!s.value && u)
|
|
1954
1954
|
try {
|
|
1955
1955
|
const f = u.state.selection, v = f.from;
|
|
@@ -1961,12 +1961,12 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1961
1961
|
function i() {
|
|
1962
1962
|
setTimeout(() => {
|
|
1963
1963
|
var f;
|
|
1964
|
-
const u = (f =
|
|
1964
|
+
const u = (f = a.value) == null ? void 0 : f.querySelector('input[name="link-text"]');
|
|
1965
1965
|
u == null || u.focus(), u == null || u.select();
|
|
1966
1966
|
}, 0);
|
|
1967
1967
|
}
|
|
1968
1968
|
function x() {
|
|
1969
|
-
const u =
|
|
1969
|
+
const u = c.editor;
|
|
1970
1970
|
if (u)
|
|
1971
1971
|
try {
|
|
1972
1972
|
const f = u.state.selection, v = f.from, g = f.to, $ = g > v ? u.state.doc.textBetween(v, g) : "";
|
|
@@ -1977,7 +1977,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
1979
|
function z() {
|
|
1980
|
-
const u =
|
|
1980
|
+
const u = c.editor;
|
|
1981
1981
|
if (!u) return;
|
|
1982
1982
|
const f = o.value.trim(), v = l.value.trim();
|
|
1983
1983
|
if (v)
|
|
@@ -2009,31 +2009,31 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2009
2009
|
ut(() => {
|
|
2010
2010
|
y = (u) => {
|
|
2011
2011
|
if (!s.value) return;
|
|
2012
|
-
const f =
|
|
2012
|
+
const f = a.value, v = u.target;
|
|
2013
2013
|
f && v && !f.contains(v) && (s.value = !1);
|
|
2014
2014
|
}, document.addEventListener("mousedown", y, !0);
|
|
2015
2015
|
}), ht(() => {
|
|
2016
2016
|
y && (document.removeEventListener("mousedown", y, !0), y = null);
|
|
2017
2017
|
});
|
|
2018
2018
|
const C = E({});
|
|
2019
|
-
return
|
|
2019
|
+
return kt(s, async (u) => {
|
|
2020
2020
|
var v;
|
|
2021
2021
|
if (!u) return;
|
|
2022
|
-
const f =
|
|
2022
|
+
const f = c.editor;
|
|
2023
2023
|
if (f) {
|
|
2024
|
-
await
|
|
2024
|
+
await bt();
|
|
2025
2025
|
try {
|
|
2026
2026
|
const g = f.state.selection, h = g.from, $ = g.to;
|
|
2027
2027
|
if (!($ > h)) {
|
|
2028
2028
|
C.value = {};
|
|
2029
2029
|
return;
|
|
2030
2030
|
}
|
|
2031
|
-
const b = f.view.coordsAtPos(h), m = f.view.coordsAtPos($), k = (b.left + m.right) / 2,
|
|
2032
|
-
Z +
|
|
2033
|
-
Math.min(O - Z -
|
|
2034
|
-
), Q =
|
|
2031
|
+
const b = f.view.coordsAtPos(h), m = f.view.coordsAtPos($), k = (b.left + m.right) / 2, U = Math.max(b.bottom, m.bottom) + 8, G = (v = a.value) == null ? void 0 : v.querySelector(".link-input-panel"), H = G ? G.getBoundingClientRect() : { width: 320, height: 120 }, O = window.innerWidth, K = window.innerHeight, Z = 12, X = Math.max(
|
|
2032
|
+
Z + H.width / 2,
|
|
2033
|
+
Math.min(O - Z - H.width / 2, k)
|
|
2034
|
+
), Q = U, rt = Math.min(b.top, m.top) - H.height - 8;
|
|
2035
2035
|
let st = Q;
|
|
2036
|
-
Q +
|
|
2036
|
+
Q + H.height + Z > K && rt - Z >= 0 && (st = rt), st = Math.max(Z, Math.min(K - Z - H.height, st)), C.value = {
|
|
2037
2037
|
position: "fixed",
|
|
2038
2038
|
left: Math.round(X) + "px",
|
|
2039
2039
|
top: Math.round(st) + "px"
|
|
@@ -2041,11 +2041,11 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2041
2041
|
} catch {
|
|
2042
2042
|
}
|
|
2043
2043
|
}
|
|
2044
|
-
}), (u, f) => (T(),
|
|
2044
|
+
}), (u, f) => (T(), B("div", {
|
|
2045
2045
|
class: "icon link-icon",
|
|
2046
2046
|
onClick: S,
|
|
2047
2047
|
ref_key: "rootRef",
|
|
2048
|
-
ref:
|
|
2048
|
+
ref: a
|
|
2049
2049
|
}, [
|
|
2050
2050
|
d(L(P), {
|
|
2051
2051
|
text: "链接",
|
|
@@ -2064,7 +2064,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2064
2064
|
appear: ""
|
|
2065
2065
|
}, {
|
|
2066
2066
|
default: W(() => [
|
|
2067
|
-
s.value ? (T(),
|
|
2067
|
+
s.value ? (T(), B("div", {
|
|
2068
2068
|
key: 0,
|
|
2069
2069
|
class: "link-input-panel",
|
|
2070
2070
|
style: ct(C.value),
|
|
@@ -2114,7 +2114,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2114
2114
|
editor: {}
|
|
2115
2115
|
},
|
|
2116
2116
|
setup(t) {
|
|
2117
|
-
const
|
|
2117
|
+
const c = t, s = E(!1), o = E(0), l = E(0), a = dt(() => {
|
|
2118
2118
|
const z = Math.max(o.value, 1), p = Math.max(l.value, 1);
|
|
2119
2119
|
return `${z} x ${p}`;
|
|
2120
2120
|
}), S = () => {
|
|
@@ -2124,9 +2124,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2124
2124
|
}, x = () => {
|
|
2125
2125
|
var M, y, C, u, f, v, g, h;
|
|
2126
2126
|
const z = Math.max(o.value, 1), p = Math.max(l.value, 1);
|
|
2127
|
-
(h = (v = (u = (y = (M =
|
|
2127
|
+
(h = (v = (u = (y = (M = c.editor) == null ? void 0 : M.chain) == null ? void 0 : (C = y.call(M)).focus) == null ? void 0 : (f = u.call(C)).insertTable) == null ? void 0 : (g = v.call(f, { rows: z, cols: p, withHeaderRow: !0 })).run) == null || h.call(g), s.value = !1, o.value = 0, l.value = 0;
|
|
2128
2128
|
};
|
|
2129
|
-
return (z, p) => (T(),
|
|
2129
|
+
return (z, p) => (T(), B("div", {
|
|
2130
2130
|
class: "icon table-icon",
|
|
2131
2131
|
onClick: S
|
|
2132
2132
|
}, [
|
|
@@ -2142,7 +2142,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2142
2142
|
]),
|
|
2143
2143
|
_: 1
|
|
2144
2144
|
}),
|
|
2145
|
-
s.value ? (T(),
|
|
2145
|
+
s.value ? (T(), B("div", {
|
|
2146
2146
|
key: 0,
|
|
2147
2147
|
class: "table-panel",
|
|
2148
2148
|
onClick: p[0] || (p[0] = D(() => {
|
|
@@ -2150,11 +2150,11 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2150
2150
|
}, [
|
|
2151
2151
|
p[1] || (p[1] = r("div", { class: "panel-title" }, "表格", -1)),
|
|
2152
2152
|
r("div", zn, [
|
|
2153
|
-
(T(),
|
|
2153
|
+
(T(), B(mt, null, gt(Tn, (M) => r("div", {
|
|
2154
2154
|
key: "r-" + M,
|
|
2155
2155
|
class: "row"
|
|
2156
2156
|
}, [
|
|
2157
|
-
(T(),
|
|
2157
|
+
(T(), B(mt, null, gt(En, (y) => r("span", {
|
|
2158
2158
|
key: "c-" + M + "-" + y,
|
|
2159
2159
|
class: J(["cell", { active: M <= o.value && y <= l.value }]),
|
|
2160
2160
|
onMouseenter: (C) => i(M, y),
|
|
@@ -2162,7 +2162,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2162
2162
|
}, null, 42, $n)), 64))
|
|
2163
2163
|
])), 64))
|
|
2164
2164
|
]),
|
|
2165
|
-
r("div", Sn, pt(
|
|
2165
|
+
r("div", Sn, pt(a.value), 1)
|
|
2166
2166
|
])) : Y("", !0)
|
|
2167
2167
|
]));
|
|
2168
2168
|
}
|
|
@@ -2172,21 +2172,21 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2172
2172
|
editor: {}
|
|
2173
2173
|
},
|
|
2174
2174
|
setup(t) {
|
|
2175
|
-
const
|
|
2175
|
+
const c = t, s = E(!1), o = () => s.value = !s.value, l = (S, ...i) => {
|
|
2176
2176
|
var z, p, M;
|
|
2177
|
-
const x =
|
|
2177
|
+
const x = c.editor;
|
|
2178
2178
|
return !!((M = (z = x == null ? void 0 : x.can) == null ? void 0 : (p = z.call(x))[S]) != null && M.call(p, ...i));
|
|
2179
|
-
},
|
|
2179
|
+
}, a = (S, ...i) => {
|
|
2180
2180
|
var z, p, M, y, C, u, f;
|
|
2181
|
-
const x =
|
|
2181
|
+
const x = c.editor;
|
|
2182
2182
|
(f = (u = (C = (y = (M = (z = x == null ? void 0 : x.chain) == null ? void 0 : (p = z.call(x)).focus) == null ? void 0 : M.call(p))[S]) == null ? void 0 : C.call(y, ...i)) == null ? void 0 : u.run) == null || f.call(u), s.value = !1;
|
|
2183
2183
|
};
|
|
2184
2184
|
return (S, i) => {
|
|
2185
2185
|
var x, z;
|
|
2186
|
-
return T(),
|
|
2186
|
+
return T(), B("div", {
|
|
2187
2187
|
class: "icon table-tools",
|
|
2188
2188
|
onClick: o,
|
|
2189
|
-
"aria-disabled": !((z = (x =
|
|
2189
|
+
"aria-disabled": !((z = (x = c.editor) == null ? void 0 : x.isActive) != null && z.call(x, "table"))
|
|
2190
2190
|
}, [
|
|
2191
2191
|
d(L(P), {
|
|
2192
2192
|
text: "表格工具",
|
|
@@ -2200,7 +2200,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2200
2200
|
]),
|
|
2201
2201
|
_: 1
|
|
2202
2202
|
}),
|
|
2203
|
-
s.value ? (T(),
|
|
2203
|
+
s.value ? (T(), B("div", {
|
|
2204
2204
|
key: 0,
|
|
2205
2205
|
class: "tools-panel",
|
|
2206
2206
|
onClick: i[17] || (i[17] = D(() => {
|
|
@@ -2209,87 +2209,87 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2209
2209
|
r("div", An, [
|
|
2210
2210
|
r("button", {
|
|
2211
2211
|
class: "btn",
|
|
2212
|
-
onClick: i[0] || (i[0] = D((p) =>
|
|
2212
|
+
onClick: i[0] || (i[0] = D((p) => a("addColumnBefore"), ["stop"])),
|
|
2213
2213
|
disabled: !l("addColumnBefore")
|
|
2214
2214
|
}, " 前插列 ", 8, Hn),
|
|
2215
2215
|
r("button", {
|
|
2216
2216
|
class: "btn",
|
|
2217
|
-
onClick: i[1] || (i[1] = D((p) =>
|
|
2217
|
+
onClick: i[1] || (i[1] = D((p) => a("addColumnAfter"), ["stop"])),
|
|
2218
2218
|
disabled: !l("addColumnAfter")
|
|
2219
2219
|
}, " 后插列 ", 8, Vn),
|
|
2220
2220
|
r("button", {
|
|
2221
2221
|
class: "btn",
|
|
2222
|
-
onClick: i[2] || (i[2] = D((p) =>
|
|
2222
|
+
onClick: i[2] || (i[2] = D((p) => a("deleteColumn"), ["stop"])),
|
|
2223
2223
|
disabled: !l("deleteColumn")
|
|
2224
2224
|
}, " 删除列 ", 8, Un),
|
|
2225
2225
|
r("button", {
|
|
2226
2226
|
class: "btn",
|
|
2227
|
-
onClick: i[3] || (i[3] = D((p) =>
|
|
2227
|
+
onClick: i[3] || (i[3] = D((p) => a("addRowBefore"), ["stop"])),
|
|
2228
2228
|
disabled: !l("addRowBefore")
|
|
2229
2229
|
}, " 前插行 ", 8, In),
|
|
2230
2230
|
r("button", {
|
|
2231
2231
|
class: "btn",
|
|
2232
|
-
onClick: i[4] || (i[4] = D((p) =>
|
|
2232
|
+
onClick: i[4] || (i[4] = D((p) => a("addRowAfter"), ["stop"])),
|
|
2233
2233
|
disabled: !l("addRowAfter")
|
|
2234
2234
|
}, " 后插行 ", 8, jn),
|
|
2235
2235
|
r("button", {
|
|
2236
2236
|
class: "btn",
|
|
2237
|
-
onClick: i[5] || (i[5] = D((p) =>
|
|
2237
|
+
onClick: i[5] || (i[5] = D((p) => a("deleteRow"), ["stop"])),
|
|
2238
2238
|
disabled: !l("deleteRow")
|
|
2239
2239
|
}, " 删除行 ", 8, On),
|
|
2240
2240
|
r("button", {
|
|
2241
2241
|
class: "btn",
|
|
2242
|
-
onClick: i[6] || (i[6] = D((p) =>
|
|
2242
|
+
onClick: i[6] || (i[6] = D((p) => a("deleteTable"), ["stop"])),
|
|
2243
2243
|
disabled: !l("deleteTable")
|
|
2244
2244
|
}, " 删除表 ", 8, Wn),
|
|
2245
2245
|
r("button", {
|
|
2246
2246
|
class: "btn",
|
|
2247
|
-
onClick: i[7] || (i[7] = D((p) =>
|
|
2247
|
+
onClick: i[7] || (i[7] = D((p) => a("mergeCells"), ["stop"])),
|
|
2248
2248
|
disabled: !l("mergeCells")
|
|
2249
2249
|
}, " 合并单元格 ", 8, Rn),
|
|
2250
2250
|
r("button", {
|
|
2251
2251
|
class: "btn",
|
|
2252
|
-
onClick: i[8] || (i[8] = D((p) =>
|
|
2252
|
+
onClick: i[8] || (i[8] = D((p) => a("splitCell"), ["stop"])),
|
|
2253
2253
|
disabled: !l("splitCell")
|
|
2254
2254
|
}, " 拆分单元格 ", 8, Nn),
|
|
2255
2255
|
r("button", {
|
|
2256
2256
|
class: "btn",
|
|
2257
|
-
onClick: i[9] || (i[9] = D((p) =>
|
|
2257
|
+
onClick: i[9] || (i[9] = D((p) => a("mergeOrSplit"), ["stop"])),
|
|
2258
2258
|
disabled: !l("mergeOrSplit")
|
|
2259
2259
|
}, " 合并/拆分 ", 8, Pn),
|
|
2260
2260
|
r("button", {
|
|
2261
2261
|
class: "btn",
|
|
2262
|
-
onClick: i[10] || (i[10] = D((p) =>
|
|
2262
|
+
onClick: i[10] || (i[10] = D((p) => a("toggleHeaderRow"), ["stop"])),
|
|
2263
2263
|
disabled: !l("toggleHeaderRow")
|
|
2264
2264
|
}, " 切换表头行 ", 8, Gn),
|
|
2265
2265
|
r("button", {
|
|
2266
2266
|
class: "btn",
|
|
2267
|
-
onClick: i[11] || (i[11] = D((p) =>
|
|
2267
|
+
onClick: i[11] || (i[11] = D((p) => a("toggleHeaderColumn"), ["stop"])),
|
|
2268
2268
|
disabled: !l("toggleHeaderColumn")
|
|
2269
2269
|
}, " 切换表头列 ", 8, Yn),
|
|
2270
2270
|
r("button", {
|
|
2271
2271
|
class: "btn",
|
|
2272
|
-
onClick: i[12] || (i[12] = D((p) =>
|
|
2272
|
+
onClick: i[12] || (i[12] = D((p) => a("toggleHeaderCell"), ["stop"])),
|
|
2273
2273
|
disabled: !l("toggleHeaderCell")
|
|
2274
2274
|
}, " 切换表头单元 ", 8, Kn),
|
|
2275
2275
|
r("button", {
|
|
2276
2276
|
class: "btn",
|
|
2277
|
-
onClick: i[13] || (i[13] = D((p) =>
|
|
2277
|
+
onClick: i[13] || (i[13] = D((p) => a("fixTables"), ["stop"])),
|
|
2278
2278
|
disabled: !l("fixTables")
|
|
2279
2279
|
}, " 修复表格 ", 8, qn),
|
|
2280
2280
|
r("button", {
|
|
2281
2281
|
class: "btn",
|
|
2282
|
-
onClick: i[14] || (i[14] = D((p) =>
|
|
2282
|
+
onClick: i[14] || (i[14] = D((p) => a("goToNextCell"), ["stop"])),
|
|
2283
2283
|
disabled: !l("goToNextCell")
|
|
2284
2284
|
}, " 下个单元格 ", 8, Jn),
|
|
2285
2285
|
r("button", {
|
|
2286
2286
|
class: "btn",
|
|
2287
|
-
onClick: i[15] || (i[15] = D((p) =>
|
|
2287
|
+
onClick: i[15] || (i[15] = D((p) => a("goToPreviousCell"), ["stop"])),
|
|
2288
2288
|
disabled: !l("goToPreviousCell")
|
|
2289
2289
|
}, " 上个单元格 ", 8, Zn),
|
|
2290
2290
|
r("button", {
|
|
2291
2291
|
class: "btn",
|
|
2292
|
-
onClick: i[16] || (i[16] = D((p) =>
|
|
2292
|
+
onClick: i[16] || (i[16] = D((p) => a("setCellAttribute", "backgroundColor", "#FAF594"), ["stop"])),
|
|
2293
2293
|
disabled: !l("setCellAttribute", "backgroundColor", "#FAF594")
|
|
2294
2294
|
}, " 单元格着色 ", 8, Xn)
|
|
2295
2295
|
])
|
|
@@ -2303,13 +2303,13 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2303
2303
|
editor: {}
|
|
2304
2304
|
},
|
|
2305
2305
|
setup(t) {
|
|
2306
|
-
const
|
|
2306
|
+
const c = t, o = typeof navigator < "u" && navigator.platform.includes("Mac") ? "⇧ ⌘ 9" : "Ctrl Shift 9";
|
|
2307
2307
|
function l() {
|
|
2308
|
-
const
|
|
2309
|
-
if (
|
|
2310
|
-
|
|
2308
|
+
const a = c.editor;
|
|
2309
|
+
if (a) {
|
|
2310
|
+
a.chain().focus().toggleTaskList().run();
|
|
2311
2311
|
try {
|
|
2312
|
-
const { state: S } =
|
|
2312
|
+
const { state: S } = a, i = S.selection;
|
|
2313
2313
|
let x = null;
|
|
2314
2314
|
S.doc.nodesBetween(
|
|
2315
2315
|
Math.max(0, i.from - 5),
|
|
@@ -2318,12 +2318,12 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2318
2318
|
var M;
|
|
2319
2319
|
return ((M = z == null ? void 0 : z.type) == null ? void 0 : M.name) === "taskItem" && x == null ? (x = p, !1) : !0;
|
|
2320
2320
|
}
|
|
2321
|
-
), x != null &&
|
|
2321
|
+
), x != null && a.commands.setTextSelection(x + 1);
|
|
2322
2322
|
} catch {
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
2325
|
}
|
|
2326
|
-
return (
|
|
2326
|
+
return (a, S) => (T(), B("div", {
|
|
2327
2327
|
class: "icon",
|
|
2328
2328
|
onClick: l
|
|
2329
2329
|
}, [
|
|
@@ -2348,12 +2348,12 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2348
2348
|
editor: {}
|
|
2349
2349
|
},
|
|
2350
2350
|
setup(t) {
|
|
2351
|
-
const
|
|
2351
|
+
const c = t;
|
|
2352
2352
|
function s() {
|
|
2353
|
-
const o =
|
|
2353
|
+
const o = c.editor;
|
|
2354
2354
|
o && o.chain().focus().toggleBlockquote().run();
|
|
2355
2355
|
}
|
|
2356
|
-
return (o, l) => (T(),
|
|
2356
|
+
return (o, l) => (T(), B("div", {
|
|
2357
2357
|
class: "icon",
|
|
2358
2358
|
onClick: s
|
|
2359
2359
|
}, [
|
|
@@ -2381,7 +2381,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2381
2381
|
editor: {}
|
|
2382
2382
|
},
|
|
2383
2383
|
setup(t) {
|
|
2384
|
-
const
|
|
2384
|
+
const c = t, s = typeof navigator < "u" && navigator.platform.includes("Mac"), o = {
|
|
2385
2385
|
0: s ? "⌥ ⌘ 0" : "Ctrl Alt 0",
|
|
2386
2386
|
1: s ? "⌥ ⌘ 1" : "Ctrl Alt 1",
|
|
2387
2387
|
2: s ? "⌥ ⌘ 2" : "Ctrl Alt 2",
|
|
@@ -2397,15 +2397,15 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2397
2397
|
{ label: "标题4", level: 4, shortcut: o[4] },
|
|
2398
2398
|
{ label: "标题5", level: 5, shortcut: o[5] },
|
|
2399
2399
|
{ label: "标题6", level: 6, shortcut: o[6] }
|
|
2400
|
-
],
|
|
2400
|
+
], a = dt(() => {
|
|
2401
2401
|
var f, v;
|
|
2402
|
-
const u =
|
|
2402
|
+
const u = c.editor;
|
|
2403
2403
|
if (!u) return null;
|
|
2404
2404
|
for (let g = 1; g <= 6; g++)
|
|
2405
2405
|
if ((f = u.isActive) != null && f.call(u, "heading", { level: g })) return g;
|
|
2406
2406
|
return (v = u.isActive) != null && v.call(u, "paragraph"), null;
|
|
2407
2407
|
}), S = dt(() => {
|
|
2408
|
-
const u =
|
|
2408
|
+
const u = a.value;
|
|
2409
2409
|
return u ? `标题${u}` : "正文";
|
|
2410
2410
|
}), i = E(!1), x = E(null);
|
|
2411
2411
|
function z() {
|
|
@@ -2415,9 +2415,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2415
2415
|
i.value = !1;
|
|
2416
2416
|
}
|
|
2417
2417
|
function M(u) {
|
|
2418
|
-
var v, g, h, $, j, b, m, k,
|
|
2419
|
-
const f = ($ = (g = (v =
|
|
2420
|
-
f && (u.level === null ? (m = (j = f.setParagraph) == null ? void 0 : (b = j.call(f)).run) == null || m.call(b) : (G = (
|
|
2418
|
+
var v, g, h, $, j, b, m, k, U, G;
|
|
2419
|
+
const f = ($ = (g = (v = c.editor) == null ? void 0 : v.chain) == null ? void 0 : (h = g.call(v)).focus) == null ? void 0 : $.call(h);
|
|
2420
|
+
f && (u.level === null ? (m = (j = f.setParagraph) == null ? void 0 : (b = j.call(f)).run) == null || m.call(b) : (G = (U = (k = f.toggleHeading) == null ? void 0 : k.call(f, { level: u.level })) == null ? void 0 : U.run) == null || G.call(U), p());
|
|
2421
2421
|
}
|
|
2422
2422
|
function y(u) {
|
|
2423
2423
|
const f = u.target, v = x.value;
|
|
@@ -2431,7 +2431,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2431
2431
|
document.addEventListener("click", y), window.addEventListener(Nt, C);
|
|
2432
2432
|
}), ht(() => {
|
|
2433
2433
|
document.removeEventListener("click", y), window.removeEventListener(Nt, C);
|
|
2434
|
-
}), (u, f) => (T(),
|
|
2434
|
+
}), (u, f) => (T(), B("div", {
|
|
2435
2435
|
class: "heading-select",
|
|
2436
2436
|
ref_key: "rootRef",
|
|
2437
2437
|
ref: x
|
|
@@ -2457,14 +2457,14 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2457
2457
|
}),
|
|
2458
2458
|
d(yt, { name: "dropdown-slide" }, {
|
|
2459
2459
|
default: W(() => [
|
|
2460
|
-
i.value ? (T(),
|
|
2461
|
-
(T(),
|
|
2460
|
+
i.value ? (T(), B("div", rs, [
|
|
2461
|
+
(T(), B(mt, null, gt(l, (v) => r("div", {
|
|
2462
2462
|
key: v.label,
|
|
2463
2463
|
class: "dropdown-item",
|
|
2464
|
-
"aria-selected": v.level ===
|
|
2464
|
+
"aria-selected": v.level === a.value,
|
|
2465
2465
|
onClick: D((g) => M(v), ["stop"])
|
|
2466
2466
|
}, [
|
|
2467
|
-
v.level ===
|
|
2467
|
+
v.level === a.value ? (T(), xt(L(Bt), {
|
|
2468
2468
|
key: 0,
|
|
2469
2469
|
theme: "filled",
|
|
2470
2470
|
strokeWidth: 3
|
|
@@ -2498,9 +2498,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2498
2498
|
editor: {}
|
|
2499
2499
|
},
|
|
2500
2500
|
setup(t) {
|
|
2501
|
-
const
|
|
2501
|
+
const c = t, s = dt(() => {
|
|
2502
2502
|
var h, $, j, b;
|
|
2503
|
-
const g =
|
|
2503
|
+
const g = c.editor;
|
|
2504
2504
|
return !g || (h = g.isActive) != null && h.call(g, { textAlign: "left" }) ? "left" : ($ = g.isActive) != null && $.call(g, { textAlign: "center" }) ? "center" : (j = g.isActive) != null && j.call(g, { textAlign: "right" }) ? "right" : (b = g.isActive) != null && b.call(g, { textAlign: "justify" }) ? "justify" : "left";
|
|
2505
2505
|
}), o = dt(() => ({
|
|
2506
2506
|
left: "alignLeft",
|
|
@@ -2509,15 +2509,15 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2509
2509
|
justify: "alignJustify"
|
|
2510
2510
|
})[s.value]);
|
|
2511
2511
|
function l(g) {
|
|
2512
|
-
var h, $, j, b, m, k,
|
|
2513
|
-
(G = (k = (b = ($ = (h =
|
|
2512
|
+
var h, $, j, b, m, k, U, G;
|
|
2513
|
+
(G = (k = (b = ($ = (h = c.editor) == null ? void 0 : h.chain) == null ? void 0 : (j = $.call(h)).focus) == null ? void 0 : (m = b.call(j)).setTextAlign) == null ? void 0 : (U = k.call(m, g)).run) == null || G.call(U);
|
|
2514
2514
|
}
|
|
2515
|
-
const
|
|
2515
|
+
const a = E(!1), S = E(null), i = typeof navigator < "u" && navigator.platform.includes("Mac"), x = i ? "⇧ ⌘ L" : "Ctrl Shift L", z = i ? "⇧ ⌘ E" : "Ctrl Shift E", p = i ? "⇧ ⌘ R" : "Ctrl Shift R", M = i ? "⇧ ⌘ J" : "Ctrl Shift J";
|
|
2516
2516
|
function y() {
|
|
2517
|
-
|
|
2517
|
+
a.value || window.dispatchEvent(new CustomEvent(Pt, { detail: { id: Zt } })), a.value = !a.value;
|
|
2518
2518
|
}
|
|
2519
2519
|
function C() {
|
|
2520
|
-
|
|
2520
|
+
a.value = !1;
|
|
2521
2521
|
}
|
|
2522
2522
|
function u(g) {
|
|
2523
2523
|
l(g), C();
|
|
@@ -2528,13 +2528,13 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2528
2528
|
}
|
|
2529
2529
|
function v(g) {
|
|
2530
2530
|
var $;
|
|
2531
|
-
(($ = g.detail) == null ? void 0 : $.id) !== Zt && (
|
|
2531
|
+
(($ = g.detail) == null ? void 0 : $.id) !== Zt && (a.value = !1);
|
|
2532
2532
|
}
|
|
2533
2533
|
return ut(() => {
|
|
2534
2534
|
document.addEventListener("click", f), window.addEventListener(Pt, v);
|
|
2535
2535
|
}), ht(() => {
|
|
2536
2536
|
document.removeEventListener("click", f), window.removeEventListener(Pt, v);
|
|
2537
|
-
}), (g, h) => (T(),
|
|
2537
|
+
}), (g, h) => (T(), B("div", {
|
|
2538
2538
|
class: "align-select",
|
|
2539
2539
|
ref_key: "rootRef",
|
|
2540
2540
|
ref: S
|
|
@@ -2547,7 +2547,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2547
2547
|
r("div", {
|
|
2548
2548
|
class: "icon_box",
|
|
2549
2549
|
onClick: D(y, ["stop"]),
|
|
2550
|
-
"aria-expanded":
|
|
2550
|
+
"aria-expanded": a.value
|
|
2551
2551
|
}, [
|
|
2552
2552
|
d(et, {
|
|
2553
2553
|
name: o.value,
|
|
@@ -2563,7 +2563,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2563
2563
|
}),
|
|
2564
2564
|
d(yt, { name: "dropdown-slide" }, {
|
|
2565
2565
|
default: W(() => [
|
|
2566
|
-
|
|
2566
|
+
a.value ? (T(), B("div", fs, [
|
|
2567
2567
|
r("div", ps, [
|
|
2568
2568
|
r("div", {
|
|
2569
2569
|
class: J(["option", { active: s.value === "left" }]),
|
|
@@ -2648,7 +2648,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2648
2648
|
})
|
|
2649
2649
|
], 512));
|
|
2650
2650
|
}
|
|
2651
|
-
}), ms = /* @__PURE__ */ nt(hs, [["__scopeId", "data-v-f2f793f3"]]), gs =
|
|
2651
|
+
}), ms = /* @__PURE__ */ nt(hs, [["__scopeId", "data-v-f2f793f3"]]), gs = ["aria-disabled"], ks = ["aria-disabled"], ws = /* @__PURE__ */ ot({
|
|
2652
2652
|
__name: "index",
|
|
2653
2653
|
props: {
|
|
2654
2654
|
editor: {},
|
|
@@ -2656,18 +2656,19 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2656
2656
|
videoUploader: { type: Function },
|
|
2657
2657
|
imageUploader: { type: Function },
|
|
2658
2658
|
uploadSizeLimit: {},
|
|
2659
|
-
fullscreen: { type: Boolean }
|
|
2659
|
+
fullscreen: { type: Boolean },
|
|
2660
|
+
disabled: { type: Boolean }
|
|
2660
2661
|
},
|
|
2661
2662
|
emits: ["openLinkModal", "toggleFullscreen"],
|
|
2662
|
-
setup(t, { emit:
|
|
2663
|
-
const s = t, o =
|
|
2663
|
+
setup(t, { emit: c }) {
|
|
2664
|
+
const s = t, o = c, l = (_, e) => {
|
|
2664
2665
|
var n, w;
|
|
2665
2666
|
return (w = (n = s.editor) == null ? void 0 : n.isActive) == null ? void 0 : w.call(n, _, e);
|
|
2666
|
-
},
|
|
2667
|
-
var A, V,
|
|
2667
|
+
}, a = (_, e) => {
|
|
2668
|
+
var A, V, F, I, R, N;
|
|
2668
2669
|
const n = s.editor;
|
|
2669
2670
|
if (!n) return;
|
|
2670
|
-
const w = (
|
|
2671
|
+
const w = (F = (A = n.chain) == null ? void 0 : (V = A.call(n)).focus) == null ? void 0 : F.call(V);
|
|
2671
2672
|
return (N = (R = (I = w == null ? void 0 : w[_]) == null ? void 0 : I.call(w)) == null ? void 0 : R.run) == null ? void 0 : N.call(R);
|
|
2672
2673
|
}, S = () => {
|
|
2673
2674
|
var _, e, n, w;
|
|
@@ -2690,19 +2691,19 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2690
2691
|
var _, e, n;
|
|
2691
2692
|
return (n = (e = (_ = s.editor) == null ? void 0 : _.commands) == null ? void 0 : e.redo) == null ? void 0 : n.call(e);
|
|
2692
2693
|
}, p = typeof navigator < "u" && navigator.platform.includes("Mac") ? "⌘ Z" : "Ctrl Z", M = typeof navigator < "u" && navigator.platform.includes("Mac") ? "⇧ ⌘ Z" : "Ctrl Y", y = typeof navigator < "u" && navigator.platform.includes("Mac"), C = y ? "⌘ B" : "Ctrl B", u = y ? "⌘ I" : "Ctrl I", f = y ? "⌘ U" : "Ctrl U", v = y ? "⇧ ⌘ X" : "Ctrl Shift X", g = y ? "⌘ \\" : "Ctrl \\", h = y ? "⇧ ⌘ S" : "Ctrl Shift S", $ = y ? "⇧ ⌘ 8" : "Ctrl Shift 8", j = y ? "⇧ ⌘ 7" : "Ctrl Shift 7", b = y ? "⇧ ⌘ C" : "Ctrl Shift C", m = E(null), k = () => {
|
|
2693
|
-
var e, n, w, A, V,
|
|
2694
|
+
var e, n, w, A, V, F, I;
|
|
2694
2695
|
const _ = s.editor;
|
|
2695
|
-
_ && ((I = (
|
|
2696
|
-
},
|
|
2697
|
-
var n, w, A, V,
|
|
2696
|
+
_ && ((I = (F = (V = (A = (w = (n = (e = _.chain()) == null ? void 0 : e.focus()) == null ? void 0 : n.unsetAllMarks) == null ? void 0 : w.call(n)) == null ? void 0 : A.removeEmptyTextStyle) == null ? void 0 : V.call(A)) == null ? void 0 : F.run) == null || I.call(F));
|
|
2697
|
+
}, U = E(!1), G = E(!1), H = E({}), O = E(null), K = () => {
|
|
2698
|
+
var n, w, A, V, F, I;
|
|
2698
2699
|
const _ = s.editor;
|
|
2699
2700
|
if (!_) return;
|
|
2700
2701
|
const e = ((n = _.getAttributes) == null ? void 0 : n.call(_, "textStyle")) || {};
|
|
2701
|
-
|
|
2702
|
+
H.value = {
|
|
2702
2703
|
bold: !!((w = _.isActive) != null && w.call(_, "bold")),
|
|
2703
2704
|
italic: !!((A = _.isActive) != null && A.call(_, "italic")),
|
|
2704
2705
|
strike: !!((V = _.isActive) != null && V.call(_, "strike")),
|
|
2705
|
-
underline: !!((
|
|
2706
|
+
underline: !!((F = _.isActive) != null && F.call(_, "underline")),
|
|
2706
2707
|
code: !!((I = _.isActive) != null && I.call(_, "code")),
|
|
2707
2708
|
textStyle: {
|
|
2708
2709
|
...e != null && e.color ? { color: e.color } : {},
|
|
@@ -2711,31 +2712,32 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2711
2712
|
}
|
|
2712
2713
|
};
|
|
2713
2714
|
}, Z = () => {
|
|
2714
|
-
var V,
|
|
2715
|
+
var V, F, I, R, N, q, lt, ft, zt, Et, tt, it;
|
|
2715
2716
|
const _ = s.editor;
|
|
2716
2717
|
if (!_) return;
|
|
2717
|
-
const e =
|
|
2718
|
-
let n = (I = (V = _.chain) == null ? void 0 : (
|
|
2718
|
+
const e = H.value;
|
|
2719
|
+
let n = (I = (V = _.chain) == null ? void 0 : (F = V.call(_)).focus) == null ? void 0 : I.call(F);
|
|
2719
2720
|
const w = e.textStyle || {}, A = (R = _.state) == null ? void 0 : R.selection;
|
|
2720
2721
|
A && A.from === A.to || (n = ((N = n == null ? void 0 : n.unsetAllMarks) == null ? void 0 : N.call(n)) || n, Object.keys(w).length && (n = ((q = n == null ? void 0 : n.setMark) == null ? void 0 : q.call(n, "textStyle", w)) || n), e.bold && (n = ((lt = n == null ? void 0 : n.toggleBold) == null ? void 0 : lt.call(n)) || n), e.italic && (n = ((ft = n == null ? void 0 : n.toggleItalic) == null ? void 0 : ft.call(n)) || n), e.strike && (n = ((zt = n == null ? void 0 : n.toggleStrike) == null ? void 0 : zt.call(n)) || n), e.underline && (n = ((Et = n == null ? void 0 : n.toggleUnderline) == null ? void 0 : Et.call(n)) || n), e.code && (n = ((tt = n == null ? void 0 : n.toggleCode) == null ? void 0 : tt.call(n)) || n), (it = n == null ? void 0 : n.run) == null || it.call(n));
|
|
2721
2722
|
}, X = (_) => {
|
|
2722
2723
|
var w;
|
|
2723
2724
|
const e = s.editor;
|
|
2724
2725
|
if (!e) return;
|
|
2725
|
-
K(),
|
|
2726
|
+
K(), U.value = !0, G.value = !!_;
|
|
2726
2727
|
const n = (w = e.state) == null ? void 0 : w.selection;
|
|
2727
2728
|
O.value = n ? { from: n.from, to: n.to } : null;
|
|
2728
2729
|
}, Q = () => {
|
|
2729
|
-
|
|
2730
|
+
U.value = !1, G.value = !1;
|
|
2730
2731
|
}, rt = () => {
|
|
2731
2732
|
Mt();
|
|
2732
2733
|
}, st = (_) => {
|
|
2733
|
-
!((_.metaKey || _.ctrlKey) && _.shiftKey && (_.key === "s" || _.key === "S")) || !s.editor || (_.preventDefault(), X(!1));
|
|
2734
|
+
s.disabled || !((_.metaKey || _.ctrlKey) && _.shiftKey && (_.key === "s" || _.key === "S")) || !s.editor || (_.preventDefault(), X(!1));
|
|
2734
2735
|
}, at = (_) => {
|
|
2735
2736
|
var I, R, N, q;
|
|
2737
|
+
if (s.disabled) return;
|
|
2736
2738
|
const e = _.metaKey || _.ctrlKey, n = _.key === "c" || _.key === "C";
|
|
2737
2739
|
if (e && _.shiftKey && n) {
|
|
2738
|
-
_.preventDefault(),
|
|
2740
|
+
_.preventDefault(), a("toggleCodeBlock");
|
|
2739
2741
|
return;
|
|
2740
2742
|
}
|
|
2741
2743
|
const w = _.key === "f" || _.key === "F";
|
|
@@ -2747,8 +2749,8 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2747
2749
|
}
|
|
2748
2750
|
return;
|
|
2749
2751
|
}
|
|
2750
|
-
const A = _.key === "h" || _.key === "H", V = _.metaKey && _.altKey && w,
|
|
2751
|
-
if (V ||
|
|
2752
|
+
const A = _.key === "h" || _.key === "H", V = _.metaKey && _.altKey && w, F = _.ctrlKey && A;
|
|
2753
|
+
if (V || F) {
|
|
2752
2754
|
_.preventDefault();
|
|
2753
2755
|
try {
|
|
2754
2756
|
(q = (N = m.value) == null ? void 0 : N.openPanel) == null || q.call(N, "replace");
|
|
@@ -2771,7 +2773,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2771
2773
|
St();
|
|
2772
2774
|
}), ht(() => {
|
|
2773
2775
|
Tt();
|
|
2774
|
-
}),
|
|
2776
|
+
}), kt(
|
|
2775
2777
|
() => s.editor,
|
|
2776
2778
|
(_, e) => {
|
|
2777
2779
|
var n;
|
|
@@ -2780,11 +2782,11 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2780
2782
|
);
|
|
2781
2783
|
const Mt = () => {
|
|
2782
2784
|
try {
|
|
2783
|
-
|
|
2785
|
+
U.value ? document.body.setAttribute("data-format-brush", "true") : document.body.removeAttribute("data-format-brush");
|
|
2784
2786
|
} catch {
|
|
2785
2787
|
}
|
|
2786
2788
|
};
|
|
2787
|
-
|
|
2789
|
+
kt(U, Mt), ut(Mt), ht(() => {
|
|
2788
2790
|
try {
|
|
2789
2791
|
document.body.removeAttribute("data-format-brush");
|
|
2790
2792
|
} catch {
|
|
@@ -2792,7 +2794,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2792
2794
|
});
|
|
2793
2795
|
const At = () => {
|
|
2794
2796
|
var w;
|
|
2795
|
-
if (!
|
|
2797
|
+
if (s.disabled || !U.value) return;
|
|
2796
2798
|
const _ = s.editor;
|
|
2797
2799
|
if (!_) return;
|
|
2798
2800
|
const e = (w = _.state) == null ? void 0 : w.selection;
|
|
@@ -2800,7 +2802,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2800
2802
|
const n = O.value;
|
|
2801
2803
|
n && n.from === e.from && n.to === e.to || (Z(), O.value = { from: e.from, to: e.to }, G.value || Q());
|
|
2802
2804
|
};
|
|
2803
|
-
return (_, e) => (T(),
|
|
2805
|
+
return (_, e) => (T(), B("div", {
|
|
2806
|
+
class: J(["header_box", { disabled: !!s.disabled }])
|
|
2807
|
+
}, [
|
|
2804
2808
|
r("div", {
|
|
2805
2809
|
class: "icon",
|
|
2806
2810
|
"aria-disabled": !S(),
|
|
@@ -2819,7 +2823,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2819
2823
|
]),
|
|
2820
2824
|
_: 1
|
|
2821
2825
|
}, 8, ["shortcut"])
|
|
2822
|
-
], 8,
|
|
2826
|
+
], 8, gs),
|
|
2823
2827
|
r("div", {
|
|
2824
2828
|
class: "icon",
|
|
2825
2829
|
"aria-disabled": !i(),
|
|
@@ -2838,9 +2842,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2838
2842
|
]),
|
|
2839
2843
|
_: 1
|
|
2840
2844
|
}, 8, ["shortcut"])
|
|
2841
|
-
], 8,
|
|
2845
|
+
], 8, ks),
|
|
2842
2846
|
r("div", {
|
|
2843
|
-
class: J(["icon", { active:
|
|
2847
|
+
class: J(["icon", { active: U.value }]),
|
|
2844
2848
|
onClick: e[0] || (e[0] = (n) => X(!1)),
|
|
2845
2849
|
onDblclick: e[1] || (e[1] = (n) => X(!0))
|
|
2846
2850
|
}, [
|
|
@@ -2884,7 +2888,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2884
2888
|
}, null, 8, ["editor"]),
|
|
2885
2889
|
r("div", {
|
|
2886
2890
|
class: J(["icon", { active: l("bold") }]),
|
|
2887
|
-
onClick: e[2] || (e[2] = (n) =>
|
|
2891
|
+
onClick: e[2] || (e[2] = (n) => a("toggleBold"))
|
|
2888
2892
|
}, [
|
|
2889
2893
|
d(L(P), {
|
|
2890
2894
|
text: "加粗",
|
|
@@ -2902,7 +2906,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2902
2906
|
], 2),
|
|
2903
2907
|
r("div", {
|
|
2904
2908
|
class: J(["icon", { active: l("italic") }]),
|
|
2905
|
-
onClick: e[3] || (e[3] = (n) =>
|
|
2909
|
+
onClick: e[3] || (e[3] = (n) => a("toggleItalic"))
|
|
2906
2910
|
}, [
|
|
2907
2911
|
d(L(P), {
|
|
2908
2912
|
text: "斜体",
|
|
@@ -2920,7 +2924,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2920
2924
|
], 2),
|
|
2921
2925
|
r("div", {
|
|
2922
2926
|
class: J(["icon", { active: l("strike") }]),
|
|
2923
|
-
onClick: e[4] || (e[4] = (n) =>
|
|
2927
|
+
onClick: e[4] || (e[4] = (n) => a("toggleStrike"))
|
|
2924
2928
|
}, [
|
|
2925
2929
|
d(L(P), {
|
|
2926
2930
|
text: "删除线",
|
|
@@ -2938,7 +2942,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2938
2942
|
], 2),
|
|
2939
2943
|
r("div", {
|
|
2940
2944
|
class: J(["icon", { active: l("underline") }]),
|
|
2941
|
-
onClick: e[5] || (e[5] = (n) =>
|
|
2945
|
+
onClick: e[5] || (e[5] = (n) => a("toggleUnderline"))
|
|
2942
2946
|
}, [
|
|
2943
2947
|
d(L(P), {
|
|
2944
2948
|
text: "下划线",
|
|
@@ -2967,7 +2971,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2967
2971
|
}, null, 8, ["editor"]),
|
|
2968
2972
|
r("div", {
|
|
2969
2973
|
class: J(["icon", { active: l("bulletList") }]),
|
|
2970
|
-
onClick: e[6] || (e[6] = (n) =>
|
|
2974
|
+
onClick: e[6] || (e[6] = (n) => a("toggleBulletList"))
|
|
2971
2975
|
}, [
|
|
2972
2976
|
d(L(P), {
|
|
2973
2977
|
text: "无序列表",
|
|
@@ -2985,7 +2989,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
2985
2989
|
], 2),
|
|
2986
2990
|
r("div", {
|
|
2987
2991
|
class: J(["icon", { active: l("orderedList") }]),
|
|
2988
|
-
onClick: e[7] || (e[7] = (n) =>
|
|
2992
|
+
onClick: e[7] || (e[7] = (n) => a("toggleOrderedList"))
|
|
2989
2993
|
}, [
|
|
2990
2994
|
d(L(P), {
|
|
2991
2995
|
text: "有序列表",
|
|
@@ -3006,7 +3010,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3006
3010
|
}, null, 8, ["editor"]),
|
|
3007
3011
|
r("div", {
|
|
3008
3012
|
class: J(["icon", { active: l("code") }]),
|
|
3009
|
-
onClick: e[8] || (e[8] = (n) =>
|
|
3013
|
+
onClick: e[8] || (e[8] = (n) => a("toggleCode"))
|
|
3010
3014
|
}, [
|
|
3011
3015
|
d(L(P), {
|
|
3012
3016
|
text: "行内代码",
|
|
@@ -3023,7 +3027,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3023
3027
|
], 2),
|
|
3024
3028
|
r("div", {
|
|
3025
3029
|
class: J(["icon", { active: l("codeBlock") }]),
|
|
3026
|
-
onClick: e[9] || (e[9] = (n) =>
|
|
3030
|
+
onClick: e[9] || (e[9] = (n) => a("toggleCodeBlock"))
|
|
3027
3031
|
}, [
|
|
3028
3032
|
d(L(P), {
|
|
3029
3033
|
text: "代码块",
|
|
@@ -3083,9 +3087,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3083
3087
|
_: 1
|
|
3084
3088
|
}, 8, ["text"])
|
|
3085
3089
|
])
|
|
3086
|
-
]));
|
|
3090
|
+
], 2));
|
|
3087
3091
|
}
|
|
3088
|
-
}),
|
|
3092
|
+
}), bs = /* @__PURE__ */ nt(ws, [["__scopeId", "data-v-40d61df0"]]), ys = { class: "outline__header" }, Cs = { style: { cursor: "pointer", "margin-top": "5px" } }, xs = { class: "outline__listWrap" }, _s = { class: "outline__list" }, Ls = ["onClick"], Ms = ["onClick"], zs = /* @__PURE__ */ ot({
|
|
3089
3093
|
__name: "index",
|
|
3090
3094
|
props: {
|
|
3091
3095
|
items: {},
|
|
@@ -3098,16 +3102,16 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3098
3102
|
pinned: { type: Boolean }
|
|
3099
3103
|
},
|
|
3100
3104
|
emits: ["select", "update:open"],
|
|
3101
|
-
setup(t, { emit:
|
|
3102
|
-
const s = t, o =
|
|
3105
|
+
setup(t, { emit: c }) {
|
|
3106
|
+
const s = t, o = c;
|
|
3103
3107
|
function l(v) {
|
|
3104
3108
|
C(v), o("select", v);
|
|
3105
3109
|
}
|
|
3106
|
-
function
|
|
3110
|
+
function a() {
|
|
3107
3111
|
o("update:open", !1), o("update:pinned", !1);
|
|
3108
3112
|
}
|
|
3109
3113
|
function S() {
|
|
3110
|
-
s.pinned ||
|
|
3114
|
+
s.pinned || a();
|
|
3111
3115
|
}
|
|
3112
3116
|
function i(v) {
|
|
3113
3117
|
const g = [], h = [];
|
|
@@ -3139,32 +3143,32 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3139
3143
|
const { doc: h } = g.state, $ = h.nodeAt(v.pos), j = Math.max(1, h.content.size - 1);
|
|
3140
3144
|
let b = v.pos + 1;
|
|
3141
3145
|
$ && $.type.name === "heading" && (b = v.pos + $.nodeSize - 1), b = Math.min(Math.max(1, b), j), g.chain().focus().setTextSelection(b).run();
|
|
3142
|
-
const m = L(s.container) ?? null, k = g.view.coordsAtPos(b),
|
|
3146
|
+
const m = L(s.container) ?? null, k = g.view.coordsAtPos(b), U = s.offset ?? 8, G = s.duration ?? 700;
|
|
3143
3147
|
if (m) {
|
|
3144
|
-
const
|
|
3148
|
+
const H = m.getBoundingClientRect(), O = m.scrollTop + k.top - H.top - U;
|
|
3145
3149
|
u(m, O, G);
|
|
3146
3150
|
} else {
|
|
3147
|
-
const
|
|
3148
|
-
f(
|
|
3151
|
+
const H = (window.scrollY || window.pageYOffset) + k.top - U;
|
|
3152
|
+
f(H, G);
|
|
3149
3153
|
}
|
|
3150
3154
|
}
|
|
3151
3155
|
function u(v, g, h = 600) {
|
|
3152
|
-
const $ = v.scrollTop, j = g - $, b = performance.now(), m = (
|
|
3153
|
-
function k(
|
|
3154
|
-
const G =
|
|
3155
|
-
v.scrollTop = $ + j * m(
|
|
3156
|
+
const $ = v.scrollTop, j = g - $, b = performance.now(), m = (U) => U < 0.5 ? 4 * U * U * U : 1 - Math.pow(-2 * U + 2, 3) / 2;
|
|
3157
|
+
function k(U) {
|
|
3158
|
+
const G = U - b, H = Math.min(1, G / h);
|
|
3159
|
+
v.scrollTop = $ + j * m(H), H < 1 && requestAnimationFrame(k);
|
|
3156
3160
|
}
|
|
3157
3161
|
requestAnimationFrame(k);
|
|
3158
3162
|
}
|
|
3159
3163
|
function f(v, g = 600) {
|
|
3160
3164
|
const h = window.scrollY || window.pageYOffset, $ = v - h, j = performance.now(), b = (k) => k < 0.5 ? 4 * k * k * k : 1 - Math.pow(-2 * k + 2, 3) / 2;
|
|
3161
3165
|
function m(k) {
|
|
3162
|
-
const
|
|
3163
|
-
window.scrollTo(0,
|
|
3166
|
+
const U = k - j, G = Math.min(1, U / g), H = h + $ * b(G);
|
|
3167
|
+
window.scrollTo(0, H), G < 1 && requestAnimationFrame(m);
|
|
3164
3168
|
}
|
|
3165
3169
|
requestAnimationFrame(m);
|
|
3166
3170
|
}
|
|
3167
|
-
return (v, g) => (T(),
|
|
3171
|
+
return (v, g) => (T(), B("div", {
|
|
3168
3172
|
class: "outline-wrapper",
|
|
3169
3173
|
onClick: g[1] || (g[1] = D(() => {
|
|
3170
3174
|
}, ["stop"]))
|
|
@@ -3176,9 +3180,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3176
3180
|
}),
|
|
3177
3181
|
onMouseleave: S
|
|
3178
3182
|
}, [
|
|
3179
|
-
r("div",
|
|
3183
|
+
r("div", ys, [
|
|
3180
3184
|
g[2] || (g[2] = r("div", { style: { "margin-right": "6px" } }, "大纲", -1)),
|
|
3181
|
-
r("div",
|
|
3185
|
+
r("div", Cs, [
|
|
3182
3186
|
s.open && !s.pinned ? (T(), xt(L(He), {
|
|
3183
3187
|
key: 0,
|
|
3184
3188
|
onClick: g[0] || (g[0] = (h) => v.$emit("update:pinned", !0)),
|
|
@@ -3188,20 +3192,20 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3188
3192
|
})) : Y("", !0),
|
|
3189
3193
|
s.pinned ? (T(), xt(L(Ae), {
|
|
3190
3194
|
key: 1,
|
|
3191
|
-
onClick:
|
|
3195
|
+
onClick: a,
|
|
3192
3196
|
theme: "outline",
|
|
3193
3197
|
size: "16",
|
|
3194
3198
|
strokeWidth: 3
|
|
3195
3199
|
})) : Y("", !0)
|
|
3196
3200
|
])
|
|
3197
3201
|
]),
|
|
3198
|
-
r("div",
|
|
3199
|
-
r("ul",
|
|
3200
|
-
(T(!0),
|
|
3202
|
+
r("div", xs, [
|
|
3203
|
+
r("ul", _s, [
|
|
3204
|
+
(T(!0), B(mt, null, gt(y.value, (h, $) => (T(), B("li", {
|
|
3201
3205
|
key: h.node.pos + "-" + $,
|
|
3202
3206
|
class: J(["outline__item", "lv-" + h.level])
|
|
3203
3207
|
}, [
|
|
3204
|
-
h.hasChildren ? (T(),
|
|
3208
|
+
h.hasChildren ? (T(), B("span", {
|
|
3205
3209
|
key: 0,
|
|
3206
3210
|
class: J(["outline__caret", { collapsed: z(h.node), expanded: !z(h.node) }]),
|
|
3207
3211
|
onClick: D((j) => p(h.node), ["stop"]),
|
|
@@ -3218,28 +3222,28 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3218
3222
|
fill: "currentColor"
|
|
3219
3223
|
})
|
|
3220
3224
|
], -1)
|
|
3221
|
-
])], 10,
|
|
3225
|
+
])], 10, Ls)) : Y("", !0),
|
|
3222
3226
|
r("span", {
|
|
3223
3227
|
class: "outline__text",
|
|
3224
3228
|
onClick: (j) => l(h.node)
|
|
3225
|
-
}, pt(h.node.text || "(无标题)"), 9,
|
|
3229
|
+
}, pt(h.node.text || "(无标题)"), 9, Ms)
|
|
3226
3230
|
], 2))), 128))
|
|
3227
3231
|
])
|
|
3228
3232
|
])
|
|
3229
3233
|
], 38),
|
|
3230
3234
|
d(yt, { name: "outline-mask" }, {
|
|
3231
3235
|
default: W(() => [
|
|
3232
|
-
s.open ? (T(),
|
|
3236
|
+
s.open ? (T(), B("div", {
|
|
3233
3237
|
key: 0,
|
|
3234
3238
|
class: "outline-drawer-mask",
|
|
3235
|
-
onClick:
|
|
3239
|
+
onClick: a
|
|
3236
3240
|
})) : Y("", !0)
|
|
3237
3241
|
]),
|
|
3238
3242
|
_: 1
|
|
3239
3243
|
})
|
|
3240
3244
|
]));
|
|
3241
3245
|
}
|
|
3242
|
-
}),
|
|
3246
|
+
}), $s = /* @__PURE__ */ nt(zs, [["__scopeId", "data-v-b5f802fc"]]), Ss = ["onClick"], Ts = /* @__PURE__ */ ot({
|
|
3243
3247
|
__name: "index",
|
|
3244
3248
|
props: {
|
|
3245
3249
|
modelValue: {},
|
|
@@ -3249,11 +3253,12 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3249
3253
|
imageUploader: { type: Function },
|
|
3250
3254
|
videoUploader: { type: Function },
|
|
3251
3255
|
caretColor: {},
|
|
3252
|
-
uploadSizeLimit: {}
|
|
3256
|
+
uploadSizeLimit: {},
|
|
3257
|
+
readonly: { type: Boolean }
|
|
3253
3258
|
},
|
|
3254
3259
|
emits: ["update:modelValue", "update:markdown"],
|
|
3255
|
-
setup(t, { expose:
|
|
3256
|
-
const o = t, l = s,
|
|
3260
|
+
setup(t, { expose: c, emit: s }) {
|
|
3261
|
+
const o = t, l = s, a = E(null);
|
|
3257
3262
|
let S = !1;
|
|
3258
3263
|
const i = E(!1), x = E(!1), z = E(""), p = E([]), M = E("#000000"), y = E(!0), C = E(!0), u = E(null), f = E(void 0), v = E([]), g = E(null), h = () => {
|
|
3259
3264
|
const e = u.value;
|
|
@@ -3261,7 +3266,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3261
3266
|
};
|
|
3262
3267
|
let $ = null;
|
|
3263
3268
|
ut(() => {
|
|
3264
|
-
h(), $ = () => h(), window.addEventListener("resize", $),
|
|
3269
|
+
h(), $ = () => h(), window.addEventListener("resize", $), bt(() => {
|
|
3265
3270
|
const e = u.value;
|
|
3266
3271
|
e && e.addEventListener("scroll", Mt, { passive: !0 });
|
|
3267
3272
|
});
|
|
@@ -3269,9 +3274,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3269
3274
|
$ && (window.removeEventListener("resize", $), $ = null);
|
|
3270
3275
|
const e = u.value;
|
|
3271
3276
|
e && e.removeEventListener("scroll", Mt);
|
|
3272
|
-
}),
|
|
3273
|
-
await
|
|
3274
|
-
}),
|
|
3277
|
+
}), kt([() => o.height, y, i], async () => {
|
|
3278
|
+
await bt(), h(), Mt();
|
|
3279
|
+
}), kt(i, (e) => {
|
|
3275
3280
|
try {
|
|
3276
3281
|
document.body.style.overflow = e ? "hidden" : "";
|
|
3277
3282
|
} catch {
|
|
@@ -3325,7 +3330,7 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3325
3330
|
}
|
|
3326
3331
|
});
|
|
3327
3332
|
ut(() => {
|
|
3328
|
-
|
|
3333
|
+
a.value = new re({
|
|
3329
3334
|
extensions: [
|
|
3330
3335
|
ce.configure({ dropcursor: !1 }),
|
|
3331
3336
|
we.configure({ color: "#22c55e", width: 2 }),
|
|
@@ -3367,12 +3372,19 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3367
3372
|
// 直接在构造时设置初始内容,避免立即调用 setContent 导致部分插件(如 resizable)在尚未完成挂载时触发 selection 更新报错
|
|
3368
3373
|
content: o.markdown != null ? String(o.markdown || "") : String(o.modelValue || ""),
|
|
3369
3374
|
contentType: o.markdown != null ? "markdown" : /<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(o.modelValue || "")) ? "html" : "markdown",
|
|
3370
|
-
editable: !
|
|
3371
|
-
autofocus: !
|
|
3375
|
+
editable: !o.readonly,
|
|
3376
|
+
autofocus: !o.readonly,
|
|
3372
3377
|
editorProps: {
|
|
3373
3378
|
// 任务列表等交互由扩展自身处理,无需额外事件
|
|
3374
3379
|
handlePaste(e, n) {
|
|
3375
3380
|
var ft, zt, Et;
|
|
3381
|
+
if (o.readonly) {
|
|
3382
|
+
try {
|
|
3383
|
+
n.preventDefault();
|
|
3384
|
+
} catch {
|
|
3385
|
+
}
|
|
3386
|
+
return !0;
|
|
3387
|
+
}
|
|
3376
3388
|
const w = n.clipboardData;
|
|
3377
3389
|
if (!w) return !1;
|
|
3378
3390
|
const A = w.files && w.files.length ? Array.from(w.files) : [], V = A.find((tt) => {
|
|
@@ -3389,12 +3401,12 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3389
3401
|
}
|
|
3390
3402
|
return O(V), !0;
|
|
3391
3403
|
}
|
|
3392
|
-
const
|
|
3404
|
+
const F = A.find((tt) => {
|
|
3393
3405
|
var it;
|
|
3394
3406
|
return (it = tt.type) == null ? void 0 : it.startsWith("video/");
|
|
3395
3407
|
});
|
|
3396
|
-
if (
|
|
3397
|
-
return n.preventDefault(), at(
|
|
3408
|
+
if (F)
|
|
3409
|
+
return n.preventDefault(), at(F), !0;
|
|
3398
3410
|
const R = (w.items ? Array.from(w.items) : []).find((tt) => tt.kind === "file"), N = R ? R.getAsFile() : null;
|
|
3399
3411
|
if (N && N.type.startsWith("image/")) {
|
|
3400
3412
|
if (n.preventDefault(), !o.imageUploader) {
|
|
@@ -3433,26 +3445,26 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3433
3445
|
}
|
|
3434
3446
|
}
|
|
3435
3447
|
}
|
|
3436
|
-
|
|
3448
|
+
U(Ft);
|
|
3437
3449
|
}
|
|
3438
3450
|
return !0;
|
|
3439
3451
|
}
|
|
3440
|
-
const $t = q.match(/<video[^>]+src=["']([^"']+)["']/i),
|
|
3452
|
+
const $t = q.match(/<video[^>]+src=["']([^"']+)["']/i), wt = q.match(/<source[^>]+src=["']([^"']+)["']/i), Dt = q.replace(/\s+/g, "").match(/^<video[^>]*>.*<\/video>$/i), Gt = $t && $t[1] || wt && wt[1];
|
|
3441
3453
|
if (Gt && Dt)
|
|
3442
|
-
return n.preventDefault(),
|
|
3454
|
+
return n.preventDefault(), H(Gt), !0;
|
|
3443
3455
|
}
|
|
3444
3456
|
const lt = w.getData("text/plain");
|
|
3445
3457
|
if (lt) {
|
|
3446
3458
|
const tt = lt.trim(), it = st(tt);
|
|
3447
3459
|
if (Q(tt) && tt === lt.trim()) {
|
|
3448
3460
|
if (n.preventDefault(), /^data:image\//i.test(tt)) {
|
|
3449
|
-
const $t = X(tt, "clipboard.png"),
|
|
3450
|
-
if (
|
|
3451
|
-
const Dt = Math.max(1,
|
|
3461
|
+
const $t = X(tt, "clipboard.png"), wt = (zt = o.uploadSizeLimit) == null ? void 0 : zt.image;
|
|
3462
|
+
if (wt) {
|
|
3463
|
+
const Dt = Math.max(1, wt) * 1024 * 1024;
|
|
3452
3464
|
if ($t.size > Dt) {
|
|
3453
3465
|
try {
|
|
3454
3466
|
window.alert(
|
|
3455
|
-
`图片文件大小超限(${($t.size / 1024 / 1024).toFixed(2)}MB > ${
|
|
3467
|
+
`图片文件大小超限(${($t.size / 1024 / 1024).toFixed(2)}MB > ${wt}MB)`
|
|
3456
3468
|
);
|
|
3457
3469
|
} catch {
|
|
3458
3470
|
}
|
|
@@ -3460,17 +3472,17 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3460
3472
|
}
|
|
3461
3473
|
}
|
|
3462
3474
|
}
|
|
3463
|
-
return
|
|
3475
|
+
return U(tt), !0;
|
|
3464
3476
|
}
|
|
3465
3477
|
if (it) {
|
|
3466
3478
|
if (n.preventDefault(), /^data:image\//i.test(it)) {
|
|
3467
|
-
const $t = X(it, "clipboard.png"),
|
|
3468
|
-
if (
|
|
3469
|
-
const Dt = Math.max(1,
|
|
3479
|
+
const $t = X(it, "clipboard.png"), wt = (Et = o.uploadSizeLimit) == null ? void 0 : Et.image;
|
|
3480
|
+
if (wt) {
|
|
3481
|
+
const Dt = Math.max(1, wt) * 1024 * 1024;
|
|
3470
3482
|
if ($t.size > Dt) {
|
|
3471
3483
|
try {
|
|
3472
3484
|
window.alert(
|
|
3473
|
-
`图片文件大小超限(${($t.size / 1024 / 1024).toFixed(2)}MB > ${
|
|
3485
|
+
`图片文件大小超限(${($t.size / 1024 / 1024).toFixed(2)}MB > ${wt}MB)`
|
|
3474
3486
|
);
|
|
3475
3487
|
} catch {
|
|
3476
3488
|
}
|
|
@@ -3478,19 +3490,26 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3478
3490
|
}
|
|
3479
3491
|
}
|
|
3480
3492
|
}
|
|
3481
|
-
return
|
|
3493
|
+
return U(it), !0;
|
|
3482
3494
|
}
|
|
3483
3495
|
if (rt(tt) && tt === lt.trim())
|
|
3484
|
-
return n.preventDefault(),
|
|
3496
|
+
return n.preventDefault(), H(tt), !0;
|
|
3485
3497
|
}
|
|
3486
3498
|
return !1;
|
|
3487
3499
|
},
|
|
3488
3500
|
handleDrop(e, n) {
|
|
3501
|
+
if (o.readonly) {
|
|
3502
|
+
try {
|
|
3503
|
+
n.preventDefault();
|
|
3504
|
+
} catch {
|
|
3505
|
+
}
|
|
3506
|
+
return !0;
|
|
3507
|
+
}
|
|
3489
3508
|
const w = n.dataTransfer;
|
|
3490
3509
|
if (!w) return !1;
|
|
3491
|
-
const V = (w.files ? Array.from(w.files) : []).find((
|
|
3510
|
+
const V = (w.files ? Array.from(w.files) : []).find((F) => {
|
|
3492
3511
|
var I;
|
|
3493
|
-
return (I =
|
|
3512
|
+
return (I = F.type) == null ? void 0 : I.startsWith("image/");
|
|
3494
3513
|
});
|
|
3495
3514
|
if (V) {
|
|
3496
3515
|
if (n.preventDefault(), !o.imageUploader) {
|
|
@@ -3505,9 +3524,9 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3505
3524
|
return !1;
|
|
3506
3525
|
},
|
|
3507
3526
|
handleClick(e, n, w) {
|
|
3508
|
-
const A = w, V = A.target,
|
|
3509
|
-
if (
|
|
3510
|
-
const I =
|
|
3527
|
+
const A = w, V = A.target, F = V ? V.closest("a[href]") : null;
|
|
3528
|
+
if (F && (A.ctrlKey || A.metaKey)) {
|
|
3529
|
+
const I = F.getAttribute("href") || "";
|
|
3511
3530
|
if (I) {
|
|
3512
3531
|
A.preventDefault();
|
|
3513
3532
|
try {
|
|
@@ -3527,41 +3546,52 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3527
3546
|
M.value = typeof w == "string" ? w : "#000000";
|
|
3528
3547
|
},
|
|
3529
3548
|
onUpdate: () => {
|
|
3530
|
-
const e =
|
|
3549
|
+
const e = a.value;
|
|
3531
3550
|
S = !0, l("update:modelValue", e.getHTML()), l("update:markdown", e.getMarkdown()), Tt();
|
|
3532
3551
|
},
|
|
3533
3552
|
onTransaction: () => {
|
|
3534
3553
|
Tt();
|
|
3535
3554
|
}
|
|
3536
|
-
}),
|
|
3555
|
+
}), bt(() => {
|
|
3537
3556
|
var e;
|
|
3538
3557
|
Tt();
|
|
3539
3558
|
try {
|
|
3540
|
-
(e =
|
|
3559
|
+
o.readonly || (e = a.value) == null || e.chain().focus().run();
|
|
3541
3560
|
} catch {
|
|
3542
3561
|
}
|
|
3543
3562
|
});
|
|
3544
3563
|
}), ht(() => {
|
|
3545
3564
|
var e;
|
|
3546
|
-
(e =
|
|
3547
|
-
}),
|
|
3565
|
+
(e = a.value) == null || e.destroy();
|
|
3566
|
+
}), kt(
|
|
3567
|
+
() => o.readonly,
|
|
3568
|
+
(e) => {
|
|
3569
|
+
var w, A, V, F, I;
|
|
3570
|
+
const n = a.value;
|
|
3571
|
+
if (n)
|
|
3572
|
+
try {
|
|
3573
|
+
n.setEditable(!e), e ? (A = (w = n.commands) == null ? void 0 : w.blur) == null || A.call(w) : (I = (F = (V = n.chain()) == null ? void 0 : V.focus()) == null ? void 0 : F.run) == null || I.call(F);
|
|
3574
|
+
} catch {
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
), kt(
|
|
3548
3578
|
() => o.modelValue,
|
|
3549
3579
|
(e) => {
|
|
3550
3580
|
if (S) {
|
|
3551
3581
|
S = !1;
|
|
3552
3582
|
return;
|
|
3553
3583
|
}
|
|
3554
|
-
e != null &&
|
|
3584
|
+
e != null && a.value && bt(() => {
|
|
3555
3585
|
try {
|
|
3556
3586
|
const n = /<\s*(video|iframe)\b|data-youtube-video/i.test(e), w = e.match(/\[video\]\(([^)]+)\)/i);
|
|
3557
3587
|
if (!n && w) {
|
|
3558
3588
|
const A = w[1], V = e.replace(
|
|
3559
3589
|
/\[video\]\(([^)]+)\)/gi,
|
|
3560
|
-
(
|
|
3590
|
+
(F, I) => `<video data-tiptap-video src="${I}" controls></video>`
|
|
3561
3591
|
);
|
|
3562
|
-
|
|
3592
|
+
a.value.commands.setContent(V, { contentType: "html" });
|
|
3563
3593
|
} else
|
|
3564
|
-
|
|
3594
|
+
a.value.commands.setContent(e, {
|
|
3565
3595
|
contentType: n ? "html" : "markdown"
|
|
3566
3596
|
});
|
|
3567
3597
|
} catch (n) {
|
|
@@ -3569,31 +3599,31 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3569
3599
|
}
|
|
3570
3600
|
});
|
|
3571
3601
|
}
|
|
3572
|
-
),
|
|
3602
|
+
), kt(
|
|
3573
3603
|
() => o.markdown,
|
|
3574
3604
|
(e) => {
|
|
3575
3605
|
if (S) {
|
|
3576
3606
|
S = !1;
|
|
3577
3607
|
return;
|
|
3578
3608
|
}
|
|
3579
|
-
e != null &&
|
|
3609
|
+
e != null && a.value && bt(() => {
|
|
3580
3610
|
try {
|
|
3581
|
-
|
|
3611
|
+
a.value.commands.setContent(e, { contentType: "markdown" });
|
|
3582
3612
|
} catch (n) {
|
|
3583
3613
|
console.warn("setContent 失败,内容更新被忽略:", n);
|
|
3584
3614
|
}
|
|
3585
3615
|
});
|
|
3586
3616
|
}
|
|
3587
3617
|
);
|
|
3588
|
-
function
|
|
3618
|
+
function U(e) {
|
|
3589
3619
|
var n;
|
|
3590
|
-
(n =
|
|
3620
|
+
(n = a.value) == null || n.chain().focus().setImage({ src: e }).run();
|
|
3591
3621
|
}
|
|
3592
3622
|
function G(e) {
|
|
3593
3623
|
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3594
3624
|
}
|
|
3595
|
-
function
|
|
3596
|
-
const n =
|
|
3625
|
+
function H(e) {
|
|
3626
|
+
const n = a.value;
|
|
3597
3627
|
if (!n) return;
|
|
3598
3628
|
if (typeof n.commands.setVideo == "function") {
|
|
3599
3629
|
n.chain().focus().setVideo({ src: e, HTMLAttributes: { controls: !0, autoplay: !1, width: 640 } }).run();
|
|
@@ -3623,16 +3653,16 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3623
3653
|
}
|
|
3624
3654
|
if (o.imageUploader) {
|
|
3625
3655
|
const V = URL.createObjectURL(e);
|
|
3626
|
-
(A =
|
|
3656
|
+
(A = a.value) == null || A.chain().focus().setImage({ src: V, uploading: !0 }).run();
|
|
3627
3657
|
try {
|
|
3628
|
-
const
|
|
3629
|
-
if (typeof
|
|
3630
|
-
K(V,
|
|
3658
|
+
const F = await o.imageUploader(e);
|
|
3659
|
+
if (typeof F == "string" && F) {
|
|
3660
|
+
K(V, F);
|
|
3631
3661
|
return;
|
|
3632
3662
|
}
|
|
3633
3663
|
Z(e, (I) => K(V, I));
|
|
3634
|
-
} catch (
|
|
3635
|
-
console.warn("图片上传失败,回退为 base64",
|
|
3664
|
+
} catch (F) {
|
|
3665
|
+
console.warn("图片上传失败,回退为 base64", F), Z(e, (I) => K(V, I));
|
|
3636
3666
|
} finally {
|
|
3637
3667
|
try {
|
|
3638
3668
|
URL.revokeObjectURL(V);
|
|
@@ -3648,24 +3678,24 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3648
3678
|
}
|
|
3649
3679
|
function K(e, n) {
|
|
3650
3680
|
var I, R;
|
|
3651
|
-
const w =
|
|
3681
|
+
const w = a.value;
|
|
3652
3682
|
if (!w) return;
|
|
3653
3683
|
const { state: A } = w, { doc: V } = A;
|
|
3654
|
-
let
|
|
3684
|
+
let F = null;
|
|
3655
3685
|
if (V.descendants((N, q) => {
|
|
3656
3686
|
var lt, ft;
|
|
3657
|
-
return ((lt = N.type) == null ? void 0 : lt.name) === "image" && ((ft = N.attrs) == null ? void 0 : ft.src) === e ? (
|
|
3658
|
-
}),
|
|
3659
|
-
const N = V.nodeAt(
|
|
3687
|
+
return ((lt = N.type) == null ? void 0 : lt.name) === "image" && ((ft = N.attrs) == null ? void 0 : ft.src) === e ? (F = q, !1) : !0;
|
|
3688
|
+
}), F != null) {
|
|
3689
|
+
const N = V.nodeAt(F), q = A.schema.nodes.image;
|
|
3660
3690
|
if (!N || !q) return;
|
|
3661
|
-
const lt = { ...N.attrs || {}, src: n, uploading: null }, ft = A.tr.setNodeMarkup(
|
|
3691
|
+
const lt = { ...N.attrs || {}, src: n, uploading: null }, ft = A.tr.setNodeMarkup(F, q, lt, N.marks);
|
|
3662
3692
|
w.view.dispatch(ft);
|
|
3663
3693
|
try {
|
|
3664
3694
|
(R = (I = w.options) == null ? void 0 : I.onUpdate) == null || R.call(I, { editor: w });
|
|
3665
3695
|
} catch {
|
|
3666
3696
|
}
|
|
3667
3697
|
} else
|
|
3668
|
-
|
|
3698
|
+
U(n);
|
|
3669
3699
|
}
|
|
3670
3700
|
function Z(e, n) {
|
|
3671
3701
|
const w = new FileReader();
|
|
@@ -3674,10 +3704,10 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3674
3704
|
function X(e, n = "image.png") {
|
|
3675
3705
|
var R;
|
|
3676
3706
|
const w = e.split(","), A = ((R = w[0].match(/:(.*?);/)) == null ? void 0 : R[1]) || "image/png", V = atob(w[1]);
|
|
3677
|
-
let
|
|
3678
|
-
const I = new Uint8Array(
|
|
3679
|
-
for (;
|
|
3680
|
-
I[
|
|
3707
|
+
let F = V.length;
|
|
3708
|
+
const I = new Uint8Array(F);
|
|
3709
|
+
for (; F--; )
|
|
3710
|
+
I[F] = V.charCodeAt(F);
|
|
3681
3711
|
return new File([I], n, { type: A });
|
|
3682
3712
|
}
|
|
3683
3713
|
function Q(e) {
|
|
@@ -3706,14 +3736,14 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3706
3736
|
}
|
|
3707
3737
|
}
|
|
3708
3738
|
if (o.videoUploader) {
|
|
3709
|
-
const V = URL.createObjectURL(e),
|
|
3739
|
+
const V = URL.createObjectURL(e), F = a.value, I = F == null ? void 0 : F.commands;
|
|
3710
3740
|
try {
|
|
3711
|
-
typeof (I == null ? void 0 : I.setVideo) == "function" ?
|
|
3741
|
+
typeof (I == null ? void 0 : I.setVideo) == "function" ? F == null || F.chain().focus().setVideo({
|
|
3712
3742
|
src: V,
|
|
3713
3743
|
HTMLAttributes: { controls: !0, autoplay: !1, width: 640, uploading: !0 }
|
|
3714
|
-
}).run() :
|
|
3744
|
+
}).run() : H(V);
|
|
3715
3745
|
} catch {
|
|
3716
|
-
|
|
3746
|
+
H(V);
|
|
3717
3747
|
}
|
|
3718
3748
|
try {
|
|
3719
3749
|
const R = await o.videoUploader(e);
|
|
@@ -3729,47 +3759,47 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3729
3759
|
return;
|
|
3730
3760
|
}
|
|
3731
3761
|
const w = URL.createObjectURL(e);
|
|
3732
|
-
|
|
3762
|
+
H(w);
|
|
3733
3763
|
}
|
|
3734
3764
|
function Ct(e, n) {
|
|
3735
|
-
const w =
|
|
3765
|
+
const w = a.value;
|
|
3736
3766
|
if (!w) return;
|
|
3737
3767
|
const { state: A } = w, { doc: V } = A;
|
|
3738
|
-
let
|
|
3768
|
+
let F = null;
|
|
3739
3769
|
if (V.descendants((I, R) => {
|
|
3740
3770
|
var N, q;
|
|
3741
|
-
return ((N = I.type) == null ? void 0 : N.name) === "video" && ((q = I.attrs) == null ? void 0 : q.src) === e ? (
|
|
3742
|
-
}),
|
|
3743
|
-
const I = V.nodeAt(
|
|
3771
|
+
return ((N = I.type) == null ? void 0 : N.name) === "video" && ((q = I.attrs) == null ? void 0 : q.src) === e ? (F = R, !1) : !0;
|
|
3772
|
+
}), F != null) {
|
|
3773
|
+
const I = V.nodeAt(F), R = A.schema.nodes.video;
|
|
3744
3774
|
if (!I || !R) return;
|
|
3745
|
-
const N = { ...I.attrs || {}, src: n, uploading: null }, q = A.tr.setNodeMarkup(
|
|
3775
|
+
const N = { ...I.attrs || {}, src: n, uploading: null }, q = A.tr.setNodeMarkup(F, R, N, I.marks);
|
|
3746
3776
|
w.view.dispatch(q);
|
|
3747
3777
|
}
|
|
3748
3778
|
}
|
|
3749
3779
|
function St() {
|
|
3750
3780
|
var e, n;
|
|
3751
|
-
z.value = ((n = (e =
|
|
3781
|
+
z.value = ((n = (e = a.value) == null ? void 0 : e.getAttributes("link")) == null ? void 0 : n.href) || "", x.value = !0;
|
|
3752
3782
|
}
|
|
3753
3783
|
function Tt() {
|
|
3754
|
-
const e =
|
|
3784
|
+
const e = a.value;
|
|
3755
3785
|
if (!e) return;
|
|
3756
3786
|
const n = [];
|
|
3757
3787
|
e.state.doc.descendants((w, A) => {
|
|
3758
3788
|
if (w.type.name === "heading") {
|
|
3759
|
-
const V = w.attrs.level || 1,
|
|
3760
|
-
n.push({ text:
|
|
3789
|
+
const V = w.attrs.level || 1, F = w.textContent || "";
|
|
3790
|
+
n.push({ text: F, level: V, pos: A });
|
|
3761
3791
|
}
|
|
3762
3792
|
}), p.value = n, Mt();
|
|
3763
3793
|
}
|
|
3764
3794
|
function Mt() {
|
|
3765
|
-
const e =
|
|
3795
|
+
const e = a.value, n = u.value, w = p.value;
|
|
3766
3796
|
if (!e || !n || !w.length) {
|
|
3767
3797
|
v.value = [], g.value = null;
|
|
3768
3798
|
return;
|
|
3769
3799
|
}
|
|
3770
|
-
const A = n.getBoundingClientRect(), V = n.scrollHeight || n.clientHeight,
|
|
3800
|
+
const A = n.getBoundingClientRect(), V = n.scrollHeight || n.clientHeight, F = n.clientHeight || 1, I = w.map((q) => {
|
|
3771
3801
|
const ft = e.view.coordsAtPos(Math.min(q.pos + 1, e.state.doc.content.size)).top - A.top + n.scrollTop, zt = V ? Math.max(0, Math.min(1, ft / V)) : 0;
|
|
3772
|
-
return Math.round(zt *
|
|
3802
|
+
return Math.round(zt * F);
|
|
3773
3803
|
});
|
|
3774
3804
|
v.value = I;
|
|
3775
3805
|
const R = n.scrollTop + 8;
|
|
@@ -3783,26 +3813,27 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3783
3813
|
}
|
|
3784
3814
|
function At(e) {
|
|
3785
3815
|
const n = e.target;
|
|
3786
|
-
n.closest(".outline") || n.closest(".outline-toggle") ||
|
|
3816
|
+
n.closest(".outline") || n.closest(".outline-toggle") || a.value && a.value.chain().focus().run();
|
|
3787
3817
|
}
|
|
3788
3818
|
function _() {
|
|
3789
|
-
const e =
|
|
3819
|
+
const e = a.value;
|
|
3790
3820
|
return e ? e.getMarkdown() : "";
|
|
3791
3821
|
}
|
|
3792
|
-
return
|
|
3822
|
+
return c({ getMarkdown: _ }), (e, n) => (T(), B("div", {
|
|
3793
3823
|
class: J(["simple-editor", { fullscreen: i.value }]),
|
|
3794
3824
|
style: ct(b.value)
|
|
3795
3825
|
}, [
|
|
3796
|
-
d(L(
|
|
3797
|
-
editor:
|
|
3826
|
+
d(L(bs), {
|
|
3827
|
+
editor: a.value,
|
|
3798
3828
|
currentColor: M.value,
|
|
3799
3829
|
imageUploader: t.imageUploader,
|
|
3800
3830
|
videoUploader: t.videoUploader,
|
|
3801
3831
|
"upload-size-limit": o.uploadSizeLimit,
|
|
3802
3832
|
fullscreen: i.value,
|
|
3833
|
+
disabled: !!o.readonly,
|
|
3803
3834
|
onToggleFullscreen: n[0] || (n[0] = (w) => i.value = !i.value),
|
|
3804
3835
|
onOpenLinkModal: St
|
|
3805
|
-
}, null, 8, ["editor", "currentColor", "imageUploader", "videoUploader", "upload-size-limit", "fullscreen"]),
|
|
3836
|
+
}, null, 8, ["editor", "currentColor", "imageUploader", "videoUploader", "upload-size-limit", "fullscreen", "disabled"]),
|
|
3806
3837
|
r("div", {
|
|
3807
3838
|
class: J(["editor_main", { hasOutline: y.value }])
|
|
3808
3839
|
}, [
|
|
@@ -3813,47 +3844,47 @@ const Bt = vt("check", !0, function(t) {
|
|
|
3813
3844
|
onClick: At
|
|
3814
3845
|
}, [
|
|
3815
3846
|
d(L(ae), {
|
|
3816
|
-
editor:
|
|
3847
|
+
editor: a.value,
|
|
3817
3848
|
class: "content"
|
|
3818
3849
|
}, null, 8, ["editor"])
|
|
3819
3850
|
], 512),
|
|
3820
|
-
d(L(
|
|
3851
|
+
d(L($s), {
|
|
3821
3852
|
open: y.value,
|
|
3822
3853
|
"onUpdate:open": n[1] || (n[1] = (w) => y.value = w),
|
|
3823
3854
|
items: p.value,
|
|
3824
|
-
editor:
|
|
3855
|
+
editor: a.value,
|
|
3825
3856
|
container: u.value,
|
|
3826
3857
|
maxHeight: f.value,
|
|
3827
3858
|
pinned: C.value,
|
|
3828
3859
|
"onUpdate:pinned": n[2] || (n[2] = (w) => C.value = w)
|
|
3829
3860
|
}, null, 8, ["open", "items", "editor", "container", "maxHeight", "pinned"]),
|
|
3830
|
-
y.value ? Y("", !0) : (T(),
|
|
3861
|
+
y.value ? Y("", !0) : (T(), B("div", {
|
|
3831
3862
|
key: 0,
|
|
3832
3863
|
class: "outline-markers",
|
|
3833
3864
|
onMouseenter: n[3] || (n[3] = (w) => (y.value = !0, C.value = !1))
|
|
3834
3865
|
}, [
|
|
3835
|
-
(T(!0),
|
|
3866
|
+
(T(!0), B(mt, null, gt(v.value, (w, A) => {
|
|
3836
3867
|
var V;
|
|
3837
|
-
return T(),
|
|
3868
|
+
return T(), B("span", {
|
|
3838
3869
|
key: A,
|
|
3839
3870
|
class: J(["outline-marker", { active: ((V = p.value[A]) == null ? void 0 : V.pos) === g.value }]),
|
|
3840
3871
|
style: ct({ top: (w || 0) + "px" }),
|
|
3841
|
-
onClick: D((
|
|
3872
|
+
onClick: D((F) => {
|
|
3842
3873
|
var I, R;
|
|
3843
|
-
return (R =
|
|
3874
|
+
return (R = a.value) == null ? void 0 : R.chain().focus().setTextSelection((((I = p.value[A]) == null ? void 0 : I.pos) || 1) + 1).run();
|
|
3844
3875
|
}, ["stop"])
|
|
3845
|
-
}, null, 14,
|
|
3876
|
+
}, null, 14, Ss);
|
|
3846
3877
|
}), 128))
|
|
3847
3878
|
], 32))
|
|
3848
3879
|
], 2)
|
|
3849
3880
|
], 6));
|
|
3850
3881
|
}
|
|
3851
|
-
}),
|
|
3882
|
+
}), Es = /* @__PURE__ */ nt(Ts, [["__scopeId", "data-v-bd45188e"]]), Ys = {
|
|
3852
3883
|
install(t) {
|
|
3853
|
-
t.component("Editor",
|
|
3884
|
+
t.component("Editor", Es);
|
|
3854
3885
|
}
|
|
3855
3886
|
};
|
|
3856
3887
|
export {
|
|
3857
|
-
|
|
3858
|
-
|
|
3888
|
+
Es as Editor,
|
|
3889
|
+
Ys as default
|
|
3859
3890
|
};
|