@harbour-enterprises/superdoc 0.19.0-next.7 → 0.19.0-next.8
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/chunks/{PdfViewer-DtzjcoY1.cjs → PdfViewer-HREDD6qb.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BUcY_aLU.es.js → PdfViewer-fT3KFJal.es.js} +1 -1
- package/dist/chunks/{index-BfPgSGCT.es.js → index-CSvNxbRW.es.js} +2 -2
- package/dist/chunks/{index-Dic-WukZ.cjs → index-wEO3Mdf3.cjs} +2 -2
- package/dist/chunks/{super-editor.es-ZzKFiBVd.es.js → super-editor.es-C_ozmHgp.es.js} +91 -4
- package/dist/chunks/{super-editor.es-BxWpMXrO.cjs → super-editor.es-D4jQmQ_2.cjs} +91 -4
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-D7JstO1X.js → converter-B0DE5RlJ.js} +3 -3
- package/dist/super-editor/chunks/{docx-zipper-CxuVkw7R.js → docx-zipper-CynIq8Em.js} +1 -1
- package/dist/super-editor/chunks/{editor-C3cafdFa.js → editor-W_wtetmC.js} +90 -3
- package/dist/super-editor/chunks/{toolbar-BSez2SLg.js → toolbar-BzRxJlN2.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/src/core/inputRules/html/transform-copied-lists.d.ts +3 -0
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +91 -4
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-DWle4Cai.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
4
|
+
const superdoc = require("./index-wEO3Mdf3.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-CXxsqYcP.es.js";
|
|
2
|
-
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-
|
|
2
|
+
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-CSvNxbRW.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-
|
|
1
|
+
import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-C_ozmHgp.es.js";
|
|
2
2
|
import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-CXxsqYcP.es.js";
|
|
3
3
|
import { B as Buffer$2 } from "./jszip-B8KIZSNe.es.js";
|
|
4
4
|
import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
|
|
@@ -17369,7 +17369,7 @@ const _sfc_main = {
|
|
|
17369
17369
|
__name: "SuperDoc",
|
|
17370
17370
|
emits: ["selection-update"],
|
|
17371
17371
|
setup(__props, { emit: __emit }) {
|
|
17372
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17372
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-fT3KFJal.es.js"));
|
|
17373
17373
|
const superdocStore = useSuperdocStore();
|
|
17374
17374
|
const commentsStore = useCommentsStore();
|
|
17375
17375
|
const {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-D4jQmQ_2.cjs");
|
|
3
3
|
const vue = require("./vue-DWle4Cai.cjs");
|
|
4
4
|
const jszip = require("./jszip-b7l8QkfH.cjs");
|
|
5
5
|
const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
|
|
@@ -17386,7 +17386,7 @@ const _sfc_main = {
|
|
|
17386
17386
|
__name: "SuperDoc",
|
|
17387
17387
|
emits: ["selection-update"],
|
|
17388
17388
|
setup(__props, { emit: __emit }) {
|
|
17389
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17389
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-HREDD6qb.cjs")));
|
|
17390
17390
|
const superdocStore = useSuperdocStore();
|
|
17391
17391
|
const commentsStore = useCommentsStore();
|
|
17392
17392
|
const {
|
|
@@ -26986,9 +26986,9 @@ function flattenFoundList(listElem, editor) {
|
|
|
26986
26986
|
const nestedLists = getNestedLists([li.nextSibling]);
|
|
26987
26987
|
const newList = createSingleItemList({ li, tag, rootNumId, level, listLevel, editor, NodeInterface });
|
|
26988
26988
|
newLists.push(newList);
|
|
26989
|
-
nestedLists.
|
|
26990
|
-
newLists.push(
|
|
26991
|
-
}
|
|
26989
|
+
if (nestedLists.length > 0) {
|
|
26990
|
+
newLists.push(nestedLists[0].cloneNode(true));
|
|
26991
|
+
}
|
|
26992
26992
|
if (nestedLists.length && ["OL", "UL"].includes(li.nextSibling.tagName)) {
|
|
26993
26993
|
li.nextSibling?.remove();
|
|
26994
26994
|
}
|
|
@@ -34161,7 +34161,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
34161
34161
|
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
34162
34162
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
34163
34163
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
34164
|
-
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_fn;
|
|
34164
|
+
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_fn;
|
|
34165
34165
|
var GOOD_LEAF_SIZE = 200;
|
|
34166
34166
|
var RopeSequence = function RopeSequence2() {
|
|
34167
34167
|
};
|
|
@@ -48003,6 +48003,77 @@ analyzeDocument_fn = function() {
|
|
|
48003
48003
|
doc2.descendants(collectElements);
|
|
48004
48004
|
return analysis;
|
|
48005
48005
|
};
|
|
48006
|
+
const transformListsInCopiedContent = (html) => {
|
|
48007
|
+
const container = document.createElement("div");
|
|
48008
|
+
container.innerHTML = html;
|
|
48009
|
+
const result = [];
|
|
48010
|
+
const stack2 = [];
|
|
48011
|
+
const flushStackUntil = (level) => {
|
|
48012
|
+
while (stack2.length && stack2[stack2.length - 1].level >= level) {
|
|
48013
|
+
const top2 = stack2.pop();
|
|
48014
|
+
if (stack2.length) {
|
|
48015
|
+
stack2[stack2.length - 1].el.appendChild(top2.el);
|
|
48016
|
+
} else {
|
|
48017
|
+
result.push(top2.el.outerHTML);
|
|
48018
|
+
}
|
|
48019
|
+
}
|
|
48020
|
+
};
|
|
48021
|
+
Array.from(container.childNodes).forEach((node) => {
|
|
48022
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
48023
|
+
result.push(node.outerHTML || node.textContent);
|
|
48024
|
+
return;
|
|
48025
|
+
}
|
|
48026
|
+
if (node.tagName.toLowerCase() === "ol" || node.tagName.toLowerCase() === "ul") {
|
|
48027
|
+
const child = getFirstElementChild(node);
|
|
48028
|
+
const level = getLevel(child);
|
|
48029
|
+
const numFmt = child.getAttribute("data-num-fmt");
|
|
48030
|
+
const lvlText = child.getAttribute("data-lvl-text");
|
|
48031
|
+
const tag = node.tagName.toLowerCase();
|
|
48032
|
+
const li = child.cloneNode(true);
|
|
48033
|
+
li.setAttribute("aria-level", level + 1);
|
|
48034
|
+
li.style["list-style-type"] = getListStyleType(numFmt, lvlText);
|
|
48035
|
+
if (!stack2.length || stack2[stack2.length - 1].level < level) {
|
|
48036
|
+
const newList = document.createElement(tag);
|
|
48037
|
+
stack2.push({ tag, level, el: newList });
|
|
48038
|
+
} else if (stack2[stack2.length - 1].level > level) {
|
|
48039
|
+
flushStackUntil(level + 1);
|
|
48040
|
+
} else if (stack2[stack2.length - 1].tag !== tag) {
|
|
48041
|
+
flushStackUntil(level);
|
|
48042
|
+
const newList = document.createElement(tag);
|
|
48043
|
+
stack2.push({ tag, level, el: newList });
|
|
48044
|
+
}
|
|
48045
|
+
stack2[stack2.length - 1].el.appendChild(li);
|
|
48046
|
+
} else {
|
|
48047
|
+
flushStackUntil(0);
|
|
48048
|
+
result.push(node.outerHTML);
|
|
48049
|
+
}
|
|
48050
|
+
});
|
|
48051
|
+
flushStackUntil(0);
|
|
48052
|
+
return result.join("");
|
|
48053
|
+
};
|
|
48054
|
+
const getListStyleType = (numFmt, lvlText) => {
|
|
48055
|
+
const bulletFmtMap = /* @__PURE__ */ new Map([
|
|
48056
|
+
["●", "disc"],
|
|
48057
|
+
["◦", "circle"],
|
|
48058
|
+
["▪", "square"]
|
|
48059
|
+
]);
|
|
48060
|
+
if (numFmt === "bullet") return bulletFmtMap.get(lvlText) || "disc";
|
|
48061
|
+
const fmtMap = /* @__PURE__ */ new Map([
|
|
48062
|
+
["decimal", "decimal"],
|
|
48063
|
+
["lowerLetter", "lower-alpha"],
|
|
48064
|
+
["upperLetter", "upper-alpha"],
|
|
48065
|
+
["lowerRoman", "lower-roman"],
|
|
48066
|
+
["upperRoman", "upper-roman"]
|
|
48067
|
+
]);
|
|
48068
|
+
return lvlText.startsWith("0") ? "decimal-leading-zero" : fmtMap.get(numFmt);
|
|
48069
|
+
};
|
|
48070
|
+
function getFirstElementChild(node) {
|
|
48071
|
+
return Array.from(node.childNodes).find((n) => n.nodeType === Node.ELEMENT_NODE) || null;
|
|
48072
|
+
}
|
|
48073
|
+
const getLevel = (node) => {
|
|
48074
|
+
const lvl = node.getAttribute("data-level");
|
|
48075
|
+
return lvl ? parseInt(lvl, 10) : 0;
|
|
48076
|
+
};
|
|
48006
48077
|
const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
48007
48078
|
/**
|
|
48008
48079
|
* Create a new Editor instance
|
|
@@ -48998,6 +49069,7 @@ init_fn = function() {
|
|
|
48998
49069
|
}
|
|
48999
49070
|
}
|
|
49000
49071
|
__privateMethod$1(this, _Editor_instances, initDevTools_fn).call(this);
|
|
49072
|
+
__privateMethod$1(this, _Editor_instances, registerCopyHandler_fn).call(this);
|
|
49001
49073
|
};
|
|
49002
49074
|
initRichText_fn = function() {
|
|
49003
49075
|
if (!this.options.extensions || !this.options.extensions.length) {
|
|
@@ -49036,6 +49108,21 @@ checkHeadless_fn = function(options) {
|
|
|
49036
49108
|
global$1.window = options.mockWindow;
|
|
49037
49109
|
}
|
|
49038
49110
|
};
|
|
49111
|
+
registerCopyHandler_fn = function() {
|
|
49112
|
+
this.view.dom.addEventListener("copy", (event) => {
|
|
49113
|
+
const clipboardData = event.clipboardData;
|
|
49114
|
+
if (!clipboardData) return;
|
|
49115
|
+
event.preventDefault();
|
|
49116
|
+
const { from: from2, to } = this.view.state.selection;
|
|
49117
|
+
const slice2 = this.view.state.doc.slice(from2, to);
|
|
49118
|
+
const fragment = slice2.content;
|
|
49119
|
+
const div2 = document.createElement("div");
|
|
49120
|
+
const serializer = DOMSerializer.fromSchema(this.view.state.schema);
|
|
49121
|
+
div2.appendChild(serializer.serializeFragment(fragment));
|
|
49122
|
+
const html = transformListsInCopiedContent(div2.innerHTML);
|
|
49123
|
+
clipboardData.setData("text/html", html);
|
|
49124
|
+
});
|
|
49125
|
+
};
|
|
49039
49126
|
insertNewFileData_fn = function() {
|
|
49040
49127
|
if (!this.options.isNewFile) return;
|
|
49041
49128
|
this.options.isNewFile = false;
|
|
@@ -27003,9 +27003,9 @@ function flattenFoundList(listElem, editor) {
|
|
|
27003
27003
|
const nestedLists = getNestedLists([li.nextSibling]);
|
|
27004
27004
|
const newList = createSingleItemList({ li, tag, rootNumId, level, listLevel, editor, NodeInterface });
|
|
27005
27005
|
newLists.push(newList);
|
|
27006
|
-
nestedLists.
|
|
27007
|
-
newLists.push(
|
|
27008
|
-
}
|
|
27006
|
+
if (nestedLists.length > 0) {
|
|
27007
|
+
newLists.push(nestedLists[0].cloneNode(true));
|
|
27008
|
+
}
|
|
27009
27009
|
if (nestedLists.length && ["OL", "UL"].includes(li.nextSibling.tagName)) {
|
|
27010
27010
|
li.nextSibling?.remove();
|
|
27011
27011
|
}
|
|
@@ -34178,7 +34178,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
34178
34178
|
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
34179
34179
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
34180
34180
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
34181
|
-
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_fn;
|
|
34181
|
+
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_fn;
|
|
34182
34182
|
var GOOD_LEAF_SIZE = 200;
|
|
34183
34183
|
var RopeSequence = function RopeSequence2() {
|
|
34184
34184
|
};
|
|
@@ -48020,6 +48020,77 @@ analyzeDocument_fn = function() {
|
|
|
48020
48020
|
doc2.descendants(collectElements);
|
|
48021
48021
|
return analysis;
|
|
48022
48022
|
};
|
|
48023
|
+
const transformListsInCopiedContent = (html) => {
|
|
48024
|
+
const container = document.createElement("div");
|
|
48025
|
+
container.innerHTML = html;
|
|
48026
|
+
const result = [];
|
|
48027
|
+
const stack2 = [];
|
|
48028
|
+
const flushStackUntil = (level) => {
|
|
48029
|
+
while (stack2.length && stack2[stack2.length - 1].level >= level) {
|
|
48030
|
+
const top2 = stack2.pop();
|
|
48031
|
+
if (stack2.length) {
|
|
48032
|
+
stack2[stack2.length - 1].el.appendChild(top2.el);
|
|
48033
|
+
} else {
|
|
48034
|
+
result.push(top2.el.outerHTML);
|
|
48035
|
+
}
|
|
48036
|
+
}
|
|
48037
|
+
};
|
|
48038
|
+
Array.from(container.childNodes).forEach((node) => {
|
|
48039
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
48040
|
+
result.push(node.outerHTML || node.textContent);
|
|
48041
|
+
return;
|
|
48042
|
+
}
|
|
48043
|
+
if (node.tagName.toLowerCase() === "ol" || node.tagName.toLowerCase() === "ul") {
|
|
48044
|
+
const child = getFirstElementChild(node);
|
|
48045
|
+
const level = getLevel(child);
|
|
48046
|
+
const numFmt = child.getAttribute("data-num-fmt");
|
|
48047
|
+
const lvlText = child.getAttribute("data-lvl-text");
|
|
48048
|
+
const tag = node.tagName.toLowerCase();
|
|
48049
|
+
const li = child.cloneNode(true);
|
|
48050
|
+
li.setAttribute("aria-level", level + 1);
|
|
48051
|
+
li.style["list-style-type"] = getListStyleType(numFmt, lvlText);
|
|
48052
|
+
if (!stack2.length || stack2[stack2.length - 1].level < level) {
|
|
48053
|
+
const newList = document.createElement(tag);
|
|
48054
|
+
stack2.push({ tag, level, el: newList });
|
|
48055
|
+
} else if (stack2[stack2.length - 1].level > level) {
|
|
48056
|
+
flushStackUntil(level + 1);
|
|
48057
|
+
} else if (stack2[stack2.length - 1].tag !== tag) {
|
|
48058
|
+
flushStackUntil(level);
|
|
48059
|
+
const newList = document.createElement(tag);
|
|
48060
|
+
stack2.push({ tag, level, el: newList });
|
|
48061
|
+
}
|
|
48062
|
+
stack2[stack2.length - 1].el.appendChild(li);
|
|
48063
|
+
} else {
|
|
48064
|
+
flushStackUntil(0);
|
|
48065
|
+
result.push(node.outerHTML);
|
|
48066
|
+
}
|
|
48067
|
+
});
|
|
48068
|
+
flushStackUntil(0);
|
|
48069
|
+
return result.join("");
|
|
48070
|
+
};
|
|
48071
|
+
const getListStyleType = (numFmt, lvlText) => {
|
|
48072
|
+
const bulletFmtMap = /* @__PURE__ */ new Map([
|
|
48073
|
+
["●", "disc"],
|
|
48074
|
+
["◦", "circle"],
|
|
48075
|
+
["▪", "square"]
|
|
48076
|
+
]);
|
|
48077
|
+
if (numFmt === "bullet") return bulletFmtMap.get(lvlText) || "disc";
|
|
48078
|
+
const fmtMap = /* @__PURE__ */ new Map([
|
|
48079
|
+
["decimal", "decimal"],
|
|
48080
|
+
["lowerLetter", "lower-alpha"],
|
|
48081
|
+
["upperLetter", "upper-alpha"],
|
|
48082
|
+
["lowerRoman", "lower-roman"],
|
|
48083
|
+
["upperRoman", "upper-roman"]
|
|
48084
|
+
]);
|
|
48085
|
+
return lvlText.startsWith("0") ? "decimal-leading-zero" : fmtMap.get(numFmt);
|
|
48086
|
+
};
|
|
48087
|
+
function getFirstElementChild(node) {
|
|
48088
|
+
return Array.from(node.childNodes).find((n) => n.nodeType === Node.ELEMENT_NODE) || null;
|
|
48089
|
+
}
|
|
48090
|
+
const getLevel = (node) => {
|
|
48091
|
+
const lvl = node.getAttribute("data-level");
|
|
48092
|
+
return lvl ? parseInt(lvl, 10) : 0;
|
|
48093
|
+
};
|
|
48023
48094
|
const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
48024
48095
|
/**
|
|
48025
48096
|
* Create a new Editor instance
|
|
@@ -49015,6 +49086,7 @@ init_fn = function() {
|
|
|
49015
49086
|
}
|
|
49016
49087
|
}
|
|
49017
49088
|
__privateMethod$1(this, _Editor_instances, initDevTools_fn).call(this);
|
|
49089
|
+
__privateMethod$1(this, _Editor_instances, registerCopyHandler_fn).call(this);
|
|
49018
49090
|
};
|
|
49019
49091
|
initRichText_fn = function() {
|
|
49020
49092
|
if (!this.options.extensions || !this.options.extensions.length) {
|
|
@@ -49053,6 +49125,21 @@ checkHeadless_fn = function(options) {
|
|
|
49053
49125
|
global$1.window = options.mockWindow;
|
|
49054
49126
|
}
|
|
49055
49127
|
};
|
|
49128
|
+
registerCopyHandler_fn = function() {
|
|
49129
|
+
this.view.dom.addEventListener("copy", (event) => {
|
|
49130
|
+
const clipboardData = event.clipboardData;
|
|
49131
|
+
if (!clipboardData) return;
|
|
49132
|
+
event.preventDefault();
|
|
49133
|
+
const { from: from2, to } = this.view.state.selection;
|
|
49134
|
+
const slice2 = this.view.state.doc.slice(from2, to);
|
|
49135
|
+
const fragment = slice2.content;
|
|
49136
|
+
const div2 = document.createElement("div");
|
|
49137
|
+
const serializer = DOMSerializer.fromSchema(this.view.state.schema);
|
|
49138
|
+
div2.appendChild(serializer.serializeFragment(fragment));
|
|
49139
|
+
const html = transformListsInCopiedContent(div2.innerHTML);
|
|
49140
|
+
clipboardData.setData("text/html", html);
|
|
49141
|
+
});
|
|
49142
|
+
};
|
|
49056
49143
|
insertNewFileData_fn = function() {
|
|
49057
49144
|
if (!this.options.isNewFile) return;
|
|
49058
49145
|
this.options.isNewFile = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../src/core/SuperDoc.js"],"names":[],"mappings":"AAgBA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;AAEH,2EAA2E;AAE3E;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IAwExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IA5ED,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MAD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AAC,QAAQ,EAAE,IAAI,CAAA;KAAE,KAAK,IAAI;;;;yBACvD,MAAM,IAAI;;;;sBACV,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI;;;;2BAC3B,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;;;;qBACpC,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;;;;kBACpC,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI;;;;2BAClC,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI;;;;8BACzC,CAAC,MAAM,EAAE,EAAE,KAAC,GAAA;;;;aACZ,MAAM;;;;uBACN,KAAQ;;;;iBACR,OAAO;;;;YACP,MAAM;;;;oBACN,KAAQ;;;;eACR,OAAO;;;;wBACP,CAAS,IAAI,EAAJ,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC;;;;eAC/B,IAAI;;;;aACJ,OAAO;;;;gCACP,OAAO;;;;;;;;yBAEP,OAAO;;;;WACP,MAAM;;;;eACN,MAAM;;;;cACN,OAAO;;6BA7GQ,eAAe;0BASlB,0CAA0C;6BAJ5B,mCAAmC;8BAC7C,iEAAiE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
|
-
import { T as TextSelection } from "./chunks/converter-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-B0DE5RlJ.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-W_wtetmC.js";
|
|
4
4
|
const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
|
|
5
5
|
const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
|
|
6
6
|
async function baseInsightsFetch(payload, options = {}) {
|
|
@@ -26993,9 +26993,9 @@ function flattenFoundList(listElem, editor) {
|
|
|
26993
26993
|
const nestedLists = getNestedLists([li.nextSibling]);
|
|
26994
26994
|
const newList = createSingleItemList({ li, tag, rootNumId, level, listLevel, editor, NodeInterface });
|
|
26995
26995
|
newLists.push(newList);
|
|
26996
|
-
nestedLists.
|
|
26997
|
-
newLists.push(
|
|
26998
|
-
}
|
|
26996
|
+
if (nestedLists.length > 0) {
|
|
26997
|
+
newLists.push(nestedLists[0].cloneNode(true));
|
|
26998
|
+
}
|
|
26999
26999
|
if (nestedLists.length && ["OL", "UL"].includes(li.nextSibling.tagName)) {
|
|
27000
27000
|
li.nextSibling?.remove();
|
|
27001
27001
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-B0DE5RlJ.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|
|
@@ -9,12 +9,12 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_fn;
|
|
12
|
+
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_fn;
|
|
13
13
|
import * as Y from "yjs";
|
|
14
14
|
import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
15
|
-
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as InputRule, ah as kebabCase, ai as findParentNodeClosestToPos, aj as getListItemStyleDefinitions, ak as docxNumberigHelpers, al as parseIndentElement, am as combineIndents, an as StepMap, ao as getColStyleDeclaration, ap as SelectionRange, aq as Transform, ar as isInTable$1, as as createColGroup, at as generateDocxRandomId, au as insertNewRelationship, av as htmlHandler } from "./converter-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as InputRule, ah as kebabCase, ai as findParentNodeClosestToPos, aj as getListItemStyleDefinitions, ak as docxNumberigHelpers, al as parseIndentElement, am as combineIndents, an as StepMap, ao as getColStyleDeclaration, ap as SelectionRange, aq as Transform, ar as isInTable$1, as as createColGroup, at as generateDocxRandomId, au as insertNewRelationship, av as htmlHandler } from "./converter-B0DE5RlJ.js";
|
|
16
16
|
import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
|
|
17
|
-
import { D as DocxZipper } from "./docx-zipper-
|
|
17
|
+
import { D as DocxZipper } from "./docx-zipper-CynIq8Em.js";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
20
20
|
};
|
|
@@ -13893,6 +13893,77 @@ analyzeDocument_fn = function() {
|
|
|
13893
13893
|
doc2.descendants(collectElements);
|
|
13894
13894
|
return analysis;
|
|
13895
13895
|
};
|
|
13896
|
+
const transformListsInCopiedContent = (html) => {
|
|
13897
|
+
const container = document.createElement("div");
|
|
13898
|
+
container.innerHTML = html;
|
|
13899
|
+
const result = [];
|
|
13900
|
+
const stack = [];
|
|
13901
|
+
const flushStackUntil = (level) => {
|
|
13902
|
+
while (stack.length && stack[stack.length - 1].level >= level) {
|
|
13903
|
+
const top2 = stack.pop();
|
|
13904
|
+
if (stack.length) {
|
|
13905
|
+
stack[stack.length - 1].el.appendChild(top2.el);
|
|
13906
|
+
} else {
|
|
13907
|
+
result.push(top2.el.outerHTML);
|
|
13908
|
+
}
|
|
13909
|
+
}
|
|
13910
|
+
};
|
|
13911
|
+
Array.from(container.childNodes).forEach((node) => {
|
|
13912
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
13913
|
+
result.push(node.outerHTML || node.textContent);
|
|
13914
|
+
return;
|
|
13915
|
+
}
|
|
13916
|
+
if (node.tagName.toLowerCase() === "ol" || node.tagName.toLowerCase() === "ul") {
|
|
13917
|
+
const child = getFirstElementChild(node);
|
|
13918
|
+
const level = getLevel(child);
|
|
13919
|
+
const numFmt = child.getAttribute("data-num-fmt");
|
|
13920
|
+
const lvlText = child.getAttribute("data-lvl-text");
|
|
13921
|
+
const tag = node.tagName.toLowerCase();
|
|
13922
|
+
const li = child.cloneNode(true);
|
|
13923
|
+
li.setAttribute("aria-level", level + 1);
|
|
13924
|
+
li.style["list-style-type"] = getListStyleType(numFmt, lvlText);
|
|
13925
|
+
if (!stack.length || stack[stack.length - 1].level < level) {
|
|
13926
|
+
const newList = document.createElement(tag);
|
|
13927
|
+
stack.push({ tag, level, el: newList });
|
|
13928
|
+
} else if (stack[stack.length - 1].level > level) {
|
|
13929
|
+
flushStackUntil(level + 1);
|
|
13930
|
+
} else if (stack[stack.length - 1].tag !== tag) {
|
|
13931
|
+
flushStackUntil(level);
|
|
13932
|
+
const newList = document.createElement(tag);
|
|
13933
|
+
stack.push({ tag, level, el: newList });
|
|
13934
|
+
}
|
|
13935
|
+
stack[stack.length - 1].el.appendChild(li);
|
|
13936
|
+
} else {
|
|
13937
|
+
flushStackUntil(0);
|
|
13938
|
+
result.push(node.outerHTML);
|
|
13939
|
+
}
|
|
13940
|
+
});
|
|
13941
|
+
flushStackUntil(0);
|
|
13942
|
+
return result.join("");
|
|
13943
|
+
};
|
|
13944
|
+
const getListStyleType = (numFmt, lvlText) => {
|
|
13945
|
+
const bulletFmtMap = /* @__PURE__ */ new Map([
|
|
13946
|
+
["●", "disc"],
|
|
13947
|
+
["◦", "circle"],
|
|
13948
|
+
["▪", "square"]
|
|
13949
|
+
]);
|
|
13950
|
+
if (numFmt === "bullet") return bulletFmtMap.get(lvlText) || "disc";
|
|
13951
|
+
const fmtMap = /* @__PURE__ */ new Map([
|
|
13952
|
+
["decimal", "decimal"],
|
|
13953
|
+
["lowerLetter", "lower-alpha"],
|
|
13954
|
+
["upperLetter", "upper-alpha"],
|
|
13955
|
+
["lowerRoman", "lower-roman"],
|
|
13956
|
+
["upperRoman", "upper-roman"]
|
|
13957
|
+
]);
|
|
13958
|
+
return lvlText.startsWith("0") ? "decimal-leading-zero" : fmtMap.get(numFmt);
|
|
13959
|
+
};
|
|
13960
|
+
function getFirstElementChild(node) {
|
|
13961
|
+
return Array.from(node.childNodes).find((n) => n.nodeType === Node.ELEMENT_NODE) || null;
|
|
13962
|
+
}
|
|
13963
|
+
const getLevel = (node) => {
|
|
13964
|
+
const lvl = node.getAttribute("data-level");
|
|
13965
|
+
return lvl ? parseInt(lvl, 10) : 0;
|
|
13966
|
+
};
|
|
13896
13967
|
const _Editor = class _Editor extends EventEmitter {
|
|
13897
13968
|
/**
|
|
13898
13969
|
* Create a new Editor instance
|
|
@@ -14921,6 +14992,7 @@ init_fn = function() {
|
|
|
14921
14992
|
}
|
|
14922
14993
|
}
|
|
14923
14994
|
__privateMethod(this, _Editor_instances, initDevTools_fn).call(this);
|
|
14995
|
+
__privateMethod(this, _Editor_instances, registerCopyHandler_fn).call(this);
|
|
14924
14996
|
};
|
|
14925
14997
|
/**
|
|
14926
14998
|
* Initialize the editor in rich text mode
|
|
@@ -14976,6 +15048,21 @@ checkHeadless_fn = function(options) {
|
|
|
14976
15048
|
global.window = options.mockWindow;
|
|
14977
15049
|
}
|
|
14978
15050
|
};
|
|
15051
|
+
registerCopyHandler_fn = function() {
|
|
15052
|
+
this.view.dom.addEventListener("copy", (event) => {
|
|
15053
|
+
const clipboardData = event.clipboardData;
|
|
15054
|
+
if (!clipboardData) return;
|
|
15055
|
+
event.preventDefault();
|
|
15056
|
+
const { from: from2, to } = this.view.state.selection;
|
|
15057
|
+
const slice2 = this.view.state.doc.slice(from2, to);
|
|
15058
|
+
const fragment = slice2.content;
|
|
15059
|
+
const div2 = document.createElement("div");
|
|
15060
|
+
const serializer = DOMSerializer.fromSchema(this.view.state.schema);
|
|
15061
|
+
div2.appendChild(serializer.serializeFragment(fragment));
|
|
15062
|
+
const html = transformListsInCopiedContent(div2.innerHTML);
|
|
15063
|
+
clipboardData.setData("text/html", html);
|
|
15064
|
+
});
|
|
15065
|
+
};
|
|
14979
15066
|
/**
|
|
14980
15067
|
* Replace the current document with new data. Necessary for initializing a new collaboration file,
|
|
14981
15068
|
* since we need to insert the data only after the provider has synced.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import { p as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { p as process$1 } from "./converter-B0DE5RlJ.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-W_wtetmC.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-W_wtetmC.js";
|
|
2
|
+
import "./chunks/converter-B0DE5RlJ.js";
|
|
3
|
+
import "./chunks/docx-zipper-CynIq8Em.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
11
11
|
var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
|
|
12
|
-
import { ax as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aA as vClickOutside, H as findParentNode, aB as getActiveFormatting, ar as isInTable, aC as readFromClipboard, aD as handleClipboardPaste, aE as getFileObject, aF as translator, aG as translator$1, aH as translator$2, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { aI, a5, i, a2 } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { k, C, l, T, i as i2, m, j } from "./chunks/editor-
|
|
12
|
+
import { ax as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aA as vClickOutside, H as findParentNode, aB as getActiveFormatting, ar as isInTable, aC as readFromClipboard, aD as handleClipboardPaste, aE as getFileObject, aF as translator, aG as translator$1, aH as translator$2, a as Plugin } from "./chunks/converter-B0DE5RlJ.js";
|
|
13
|
+
import { aI, a5, i, a2 } from "./chunks/converter-B0DE5RlJ.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-W_wtetmC.js";
|
|
15
|
+
import { k, C, l, T, i as i2, m, j } from "./chunks/editor-W_wtetmC.js";
|
|
16
16
|
import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
|
|
17
|
-
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-BzRxJlN2.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-CynIq8Em.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-D4jQmQ_2.cjs");
|
|
4
4
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-
|
|
1
|
+
import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-C_ozmHgp.es.js";
|
|
2
2
|
import "./chunks/vue-CXxsqYcP.es.js";
|
|
3
3
|
export {
|
|
4
4
|
A as AIWriter,
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const superEditor_es = require("./chunks/super-editor.es-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-D4jQmQ_2.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-wEO3Mdf3.cjs");
|
|
5
5
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
6
6
|
require("./chunks/jszip-b7l8QkfH.cjs");
|
|
7
7
|
const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-C_ozmHgp.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-CSvNxbRW.es.js";
|
|
3
3
|
import "./chunks/vue-CXxsqYcP.es.js";
|
|
4
4
|
import "./chunks/jszip-B8KIZSNe.es.js";
|
|
5
5
|
import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
|