@harbour-enterprises/superdoc 0.19.0-next.7 → 0.19.0-next.9
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-Br7tqQjO.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BUcY_aLU.es.js → PdfViewer-Dt_ISEZh.es.js} +1 -1
- package/dist/chunks/{index-BfPgSGCT.es.js → index-BijsfKdg.es.js} +2 -2
- package/dist/chunks/{index-Dic-WukZ.cjs → index-DroNZHhs.cjs} +2 -2
- package/dist/chunks/{super-editor.es-BxWpMXrO.cjs → super-editor.es-D7MlgnUc.cjs} +99 -7
- package/dist/chunks/{super-editor.es-ZzKFiBVd.es.js → super-editor.es-DT9O7SCK.es.js} +99 -7
- 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-DPiYwzDY.js} +11 -6
- package/dist/super-editor/chunks/{docx-zipper-CxuVkw7R.js → docx-zipper-CS-lB2JG.js} +1 -1
- package/dist/super-editor/chunks/{editor-C3cafdFa.js → editor-BqdYfCl0.js} +90 -3
- package/dist/super-editor/chunks/{toolbar-BSez2SLg.js → toolbar-Dr4JWMZ7.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 +99 -7
- 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-DroNZHhs.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-BijsfKdg.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-DT9O7SCK.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-Dt_ISEZh.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-D7MlgnUc.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-Br7tqQjO.cjs")));
|
|
17390
17390
|
const superdocStore = useSuperdocStore();
|
|
17391
17391
|
const commentsStore = useCommentsStore();
|
|
17392
17392
|
const {
|
|
@@ -26075,11 +26075,16 @@ const config$1 = {
|
|
|
26075
26075
|
};
|
|
26076
26076
|
const translator$1 = NodeTranslator.from(config$1);
|
|
26077
26077
|
function parseTagValueJSON(json) {
|
|
26078
|
+
if (typeof json !== "string") {
|
|
26079
|
+
return {};
|
|
26080
|
+
}
|
|
26081
|
+
const trimmed = json.trim();
|
|
26082
|
+
if (!trimmed) {
|
|
26083
|
+
return {};
|
|
26084
|
+
}
|
|
26078
26085
|
try {
|
|
26079
|
-
|
|
26080
|
-
return attrs;
|
|
26086
|
+
return JSON.parse(trimmed);
|
|
26081
26087
|
} catch (err) {
|
|
26082
|
-
console.error(err);
|
|
26083
26088
|
return {};
|
|
26084
26089
|
}
|
|
26085
26090
|
}
|
|
@@ -27003,9 +27008,9 @@ function flattenFoundList(listElem, editor) {
|
|
|
27003
27008
|
const nestedLists = getNestedLists([li.nextSibling]);
|
|
27004
27009
|
const newList = createSingleItemList({ li, tag, rootNumId, level, listLevel, editor, NodeInterface });
|
|
27005
27010
|
newLists.push(newList);
|
|
27006
|
-
nestedLists.
|
|
27007
|
-
newLists.push(
|
|
27008
|
-
}
|
|
27011
|
+
if (nestedLists.length > 0) {
|
|
27012
|
+
newLists.push(nestedLists[0].cloneNode(true));
|
|
27013
|
+
}
|
|
27009
27014
|
if (nestedLists.length && ["OL", "UL"].includes(li.nextSibling.tagName)) {
|
|
27010
27015
|
li.nextSibling?.remove();
|
|
27011
27016
|
}
|
|
@@ -34178,7 +34183,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
34178
34183
|
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
34184
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
34180
34185
|
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;
|
|
34186
|
+
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
34187
|
var GOOD_LEAF_SIZE = 200;
|
|
34183
34188
|
var RopeSequence = function RopeSequence2() {
|
|
34184
34189
|
};
|
|
@@ -48020,6 +48025,77 @@ analyzeDocument_fn = function() {
|
|
|
48020
48025
|
doc2.descendants(collectElements);
|
|
48021
48026
|
return analysis;
|
|
48022
48027
|
};
|
|
48028
|
+
const transformListsInCopiedContent = (html) => {
|
|
48029
|
+
const container = document.createElement("div");
|
|
48030
|
+
container.innerHTML = html;
|
|
48031
|
+
const result = [];
|
|
48032
|
+
const stack2 = [];
|
|
48033
|
+
const flushStackUntil = (level) => {
|
|
48034
|
+
while (stack2.length && stack2[stack2.length - 1].level >= level) {
|
|
48035
|
+
const top2 = stack2.pop();
|
|
48036
|
+
if (stack2.length) {
|
|
48037
|
+
stack2[stack2.length - 1].el.appendChild(top2.el);
|
|
48038
|
+
} else {
|
|
48039
|
+
result.push(top2.el.outerHTML);
|
|
48040
|
+
}
|
|
48041
|
+
}
|
|
48042
|
+
};
|
|
48043
|
+
Array.from(container.childNodes).forEach((node) => {
|
|
48044
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
48045
|
+
result.push(node.outerHTML || node.textContent);
|
|
48046
|
+
return;
|
|
48047
|
+
}
|
|
48048
|
+
if (node.tagName.toLowerCase() === "ol" || node.tagName.toLowerCase() === "ul") {
|
|
48049
|
+
const child = getFirstElementChild(node);
|
|
48050
|
+
const level = getLevel(child);
|
|
48051
|
+
const numFmt = child.getAttribute("data-num-fmt");
|
|
48052
|
+
const lvlText = child.getAttribute("data-lvl-text");
|
|
48053
|
+
const tag = node.tagName.toLowerCase();
|
|
48054
|
+
const li = child.cloneNode(true);
|
|
48055
|
+
li.setAttribute("aria-level", level + 1);
|
|
48056
|
+
li.style["list-style-type"] = getListStyleType(numFmt, lvlText);
|
|
48057
|
+
if (!stack2.length || stack2[stack2.length - 1].level < level) {
|
|
48058
|
+
const newList = document.createElement(tag);
|
|
48059
|
+
stack2.push({ tag, level, el: newList });
|
|
48060
|
+
} else if (stack2[stack2.length - 1].level > level) {
|
|
48061
|
+
flushStackUntil(level + 1);
|
|
48062
|
+
} else if (stack2[stack2.length - 1].tag !== tag) {
|
|
48063
|
+
flushStackUntil(level);
|
|
48064
|
+
const newList = document.createElement(tag);
|
|
48065
|
+
stack2.push({ tag, level, el: newList });
|
|
48066
|
+
}
|
|
48067
|
+
stack2[stack2.length - 1].el.appendChild(li);
|
|
48068
|
+
} else {
|
|
48069
|
+
flushStackUntil(0);
|
|
48070
|
+
result.push(node.outerHTML);
|
|
48071
|
+
}
|
|
48072
|
+
});
|
|
48073
|
+
flushStackUntil(0);
|
|
48074
|
+
return result.join("");
|
|
48075
|
+
};
|
|
48076
|
+
const getListStyleType = (numFmt, lvlText) => {
|
|
48077
|
+
const bulletFmtMap = /* @__PURE__ */ new Map([
|
|
48078
|
+
["●", "disc"],
|
|
48079
|
+
["◦", "circle"],
|
|
48080
|
+
["▪", "square"]
|
|
48081
|
+
]);
|
|
48082
|
+
if (numFmt === "bullet") return bulletFmtMap.get(lvlText) || "disc";
|
|
48083
|
+
const fmtMap = /* @__PURE__ */ new Map([
|
|
48084
|
+
["decimal", "decimal"],
|
|
48085
|
+
["lowerLetter", "lower-alpha"],
|
|
48086
|
+
["upperLetter", "upper-alpha"],
|
|
48087
|
+
["lowerRoman", "lower-roman"],
|
|
48088
|
+
["upperRoman", "upper-roman"]
|
|
48089
|
+
]);
|
|
48090
|
+
return lvlText.startsWith("0") ? "decimal-leading-zero" : fmtMap.get(numFmt);
|
|
48091
|
+
};
|
|
48092
|
+
function getFirstElementChild(node) {
|
|
48093
|
+
return Array.from(node.childNodes).find((n) => n.nodeType === Node.ELEMENT_NODE) || null;
|
|
48094
|
+
}
|
|
48095
|
+
const getLevel = (node) => {
|
|
48096
|
+
const lvl = node.getAttribute("data-level");
|
|
48097
|
+
return lvl ? parseInt(lvl, 10) : 0;
|
|
48098
|
+
};
|
|
48023
48099
|
const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
48024
48100
|
/**
|
|
48025
48101
|
* Create a new Editor instance
|
|
@@ -49015,6 +49091,7 @@ init_fn = function() {
|
|
|
49015
49091
|
}
|
|
49016
49092
|
}
|
|
49017
49093
|
__privateMethod$1(this, _Editor_instances, initDevTools_fn).call(this);
|
|
49094
|
+
__privateMethod$1(this, _Editor_instances, registerCopyHandler_fn).call(this);
|
|
49018
49095
|
};
|
|
49019
49096
|
initRichText_fn = function() {
|
|
49020
49097
|
if (!this.options.extensions || !this.options.extensions.length) {
|
|
@@ -49053,6 +49130,21 @@ checkHeadless_fn = function(options) {
|
|
|
49053
49130
|
global$1.window = options.mockWindow;
|
|
49054
49131
|
}
|
|
49055
49132
|
};
|
|
49133
|
+
registerCopyHandler_fn = function() {
|
|
49134
|
+
this.view.dom.addEventListener("copy", (event) => {
|
|
49135
|
+
const clipboardData = event.clipboardData;
|
|
49136
|
+
if (!clipboardData) return;
|
|
49137
|
+
event.preventDefault();
|
|
49138
|
+
const { from: from2, to } = this.view.state.selection;
|
|
49139
|
+
const slice2 = this.view.state.doc.slice(from2, to);
|
|
49140
|
+
const fragment = slice2.content;
|
|
49141
|
+
const div2 = document.createElement("div");
|
|
49142
|
+
const serializer = DOMSerializer.fromSchema(this.view.state.schema);
|
|
49143
|
+
div2.appendChild(serializer.serializeFragment(fragment));
|
|
49144
|
+
const html = transformListsInCopiedContent(div2.innerHTML);
|
|
49145
|
+
clipboardData.setData("text/html", html);
|
|
49146
|
+
});
|
|
49147
|
+
};
|
|
49056
49148
|
insertNewFileData_fn = function() {
|
|
49057
49149
|
if (!this.options.isNewFile) return;
|
|
49058
49150
|
this.options.isNewFile = false;
|
|
@@ -26058,11 +26058,16 @@ const config$1 = {
|
|
|
26058
26058
|
};
|
|
26059
26059
|
const translator$1 = NodeTranslator.from(config$1);
|
|
26060
26060
|
function parseTagValueJSON(json) {
|
|
26061
|
+
if (typeof json !== "string") {
|
|
26062
|
+
return {};
|
|
26063
|
+
}
|
|
26064
|
+
const trimmed = json.trim();
|
|
26065
|
+
if (!trimmed) {
|
|
26066
|
+
return {};
|
|
26067
|
+
}
|
|
26061
26068
|
try {
|
|
26062
|
-
|
|
26063
|
-
return attrs;
|
|
26069
|
+
return JSON.parse(trimmed);
|
|
26064
26070
|
} catch (err) {
|
|
26065
|
-
console.error(err);
|
|
26066
26071
|
return {};
|
|
26067
26072
|
}
|
|
26068
26073
|
}
|
|
@@ -26986,9 +26991,9 @@ function flattenFoundList(listElem, editor) {
|
|
|
26986
26991
|
const nestedLists = getNestedLists([li.nextSibling]);
|
|
26987
26992
|
const newList = createSingleItemList({ li, tag, rootNumId, level, listLevel, editor, NodeInterface });
|
|
26988
26993
|
newLists.push(newList);
|
|
26989
|
-
nestedLists.
|
|
26990
|
-
newLists.push(
|
|
26991
|
-
}
|
|
26994
|
+
if (nestedLists.length > 0) {
|
|
26995
|
+
newLists.push(nestedLists[0].cloneNode(true));
|
|
26996
|
+
}
|
|
26992
26997
|
if (nestedLists.length && ["OL", "UL"].includes(li.nextSibling.tagName)) {
|
|
26993
26998
|
li.nextSibling?.remove();
|
|
26994
26999
|
}
|
|
@@ -34161,7 +34166,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
34161
34166
|
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
34167
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
34163
34168
|
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;
|
|
34169
|
+
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
34170
|
var GOOD_LEAF_SIZE = 200;
|
|
34166
34171
|
var RopeSequence = function RopeSequence2() {
|
|
34167
34172
|
};
|
|
@@ -48003,6 +48008,77 @@ analyzeDocument_fn = function() {
|
|
|
48003
48008
|
doc2.descendants(collectElements);
|
|
48004
48009
|
return analysis;
|
|
48005
48010
|
};
|
|
48011
|
+
const transformListsInCopiedContent = (html) => {
|
|
48012
|
+
const container = document.createElement("div");
|
|
48013
|
+
container.innerHTML = html;
|
|
48014
|
+
const result = [];
|
|
48015
|
+
const stack2 = [];
|
|
48016
|
+
const flushStackUntil = (level) => {
|
|
48017
|
+
while (stack2.length && stack2[stack2.length - 1].level >= level) {
|
|
48018
|
+
const top2 = stack2.pop();
|
|
48019
|
+
if (stack2.length) {
|
|
48020
|
+
stack2[stack2.length - 1].el.appendChild(top2.el);
|
|
48021
|
+
} else {
|
|
48022
|
+
result.push(top2.el.outerHTML);
|
|
48023
|
+
}
|
|
48024
|
+
}
|
|
48025
|
+
};
|
|
48026
|
+
Array.from(container.childNodes).forEach((node) => {
|
|
48027
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
48028
|
+
result.push(node.outerHTML || node.textContent);
|
|
48029
|
+
return;
|
|
48030
|
+
}
|
|
48031
|
+
if (node.tagName.toLowerCase() === "ol" || node.tagName.toLowerCase() === "ul") {
|
|
48032
|
+
const child = getFirstElementChild(node);
|
|
48033
|
+
const level = getLevel(child);
|
|
48034
|
+
const numFmt = child.getAttribute("data-num-fmt");
|
|
48035
|
+
const lvlText = child.getAttribute("data-lvl-text");
|
|
48036
|
+
const tag = node.tagName.toLowerCase();
|
|
48037
|
+
const li = child.cloneNode(true);
|
|
48038
|
+
li.setAttribute("aria-level", level + 1);
|
|
48039
|
+
li.style["list-style-type"] = getListStyleType(numFmt, lvlText);
|
|
48040
|
+
if (!stack2.length || stack2[stack2.length - 1].level < level) {
|
|
48041
|
+
const newList = document.createElement(tag);
|
|
48042
|
+
stack2.push({ tag, level, el: newList });
|
|
48043
|
+
} else if (stack2[stack2.length - 1].level > level) {
|
|
48044
|
+
flushStackUntil(level + 1);
|
|
48045
|
+
} else if (stack2[stack2.length - 1].tag !== tag) {
|
|
48046
|
+
flushStackUntil(level);
|
|
48047
|
+
const newList = document.createElement(tag);
|
|
48048
|
+
stack2.push({ tag, level, el: newList });
|
|
48049
|
+
}
|
|
48050
|
+
stack2[stack2.length - 1].el.appendChild(li);
|
|
48051
|
+
} else {
|
|
48052
|
+
flushStackUntil(0);
|
|
48053
|
+
result.push(node.outerHTML);
|
|
48054
|
+
}
|
|
48055
|
+
});
|
|
48056
|
+
flushStackUntil(0);
|
|
48057
|
+
return result.join("");
|
|
48058
|
+
};
|
|
48059
|
+
const getListStyleType = (numFmt, lvlText) => {
|
|
48060
|
+
const bulletFmtMap = /* @__PURE__ */ new Map([
|
|
48061
|
+
["●", "disc"],
|
|
48062
|
+
["◦", "circle"],
|
|
48063
|
+
["▪", "square"]
|
|
48064
|
+
]);
|
|
48065
|
+
if (numFmt === "bullet") return bulletFmtMap.get(lvlText) || "disc";
|
|
48066
|
+
const fmtMap = /* @__PURE__ */ new Map([
|
|
48067
|
+
["decimal", "decimal"],
|
|
48068
|
+
["lowerLetter", "lower-alpha"],
|
|
48069
|
+
["upperLetter", "upper-alpha"],
|
|
48070
|
+
["lowerRoman", "lower-roman"],
|
|
48071
|
+
["upperRoman", "upper-roman"]
|
|
48072
|
+
]);
|
|
48073
|
+
return lvlText.startsWith("0") ? "decimal-leading-zero" : fmtMap.get(numFmt);
|
|
48074
|
+
};
|
|
48075
|
+
function getFirstElementChild(node) {
|
|
48076
|
+
return Array.from(node.childNodes).find((n) => n.nodeType === Node.ELEMENT_NODE) || null;
|
|
48077
|
+
}
|
|
48078
|
+
const getLevel = (node) => {
|
|
48079
|
+
const lvl = node.getAttribute("data-level");
|
|
48080
|
+
return lvl ? parseInt(lvl, 10) : 0;
|
|
48081
|
+
};
|
|
48006
48082
|
const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
48007
48083
|
/**
|
|
48008
48084
|
* Create a new Editor instance
|
|
@@ -48998,6 +49074,7 @@ init_fn = function() {
|
|
|
48998
49074
|
}
|
|
48999
49075
|
}
|
|
49000
49076
|
__privateMethod$1(this, _Editor_instances, initDevTools_fn).call(this);
|
|
49077
|
+
__privateMethod$1(this, _Editor_instances, registerCopyHandler_fn).call(this);
|
|
49001
49078
|
};
|
|
49002
49079
|
initRichText_fn = function() {
|
|
49003
49080
|
if (!this.options.extensions || !this.options.extensions.length) {
|
|
@@ -49036,6 +49113,21 @@ checkHeadless_fn = function(options) {
|
|
|
49036
49113
|
global$1.window = options.mockWindow;
|
|
49037
49114
|
}
|
|
49038
49115
|
};
|
|
49116
|
+
registerCopyHandler_fn = function() {
|
|
49117
|
+
this.view.dom.addEventListener("copy", (event) => {
|
|
49118
|
+
const clipboardData = event.clipboardData;
|
|
49119
|
+
if (!clipboardData) return;
|
|
49120
|
+
event.preventDefault();
|
|
49121
|
+
const { from: from2, to } = this.view.state.selection;
|
|
49122
|
+
const slice2 = this.view.state.doc.slice(from2, to);
|
|
49123
|
+
const fragment = slice2.content;
|
|
49124
|
+
const div2 = document.createElement("div");
|
|
49125
|
+
const serializer = DOMSerializer.fromSchema(this.view.state.schema);
|
|
49126
|
+
div2.appendChild(serializer.serializeFragment(fragment));
|
|
49127
|
+
const html = transformListsInCopiedContent(div2.innerHTML);
|
|
49128
|
+
clipboardData.setData("text/html", html);
|
|
49129
|
+
});
|
|
49130
|
+
};
|
|
49039
49131
|
insertNewFileData_fn = function() {
|
|
49040
49132
|
if (!this.options.isNewFile) return;
|
|
49041
49133
|
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,MADW,OAAO,KAAK,EAAE,GAAG,GAAG,SAAS,CACnC;IAEL,4EAA4E;IAC5E,UADW,OAAO,sBAAsB,EAAE,kBAAkB,GAAG,SAAS,CAC/D;IAET,qBAAqB;IACrB,QADW,MAAM,CAwDf;IAiBA,4BAA6B;IAC7B,mBAAmB;IAMnB,gBAA+C;IAC/C,iBAAgC;IAehC,WAA4B;IAE5B,YAAkB;IAElB,eAAuC;IAEvC;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SuperDoc.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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-DPiYwzDY.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-BqdYfCl0.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 = {}) {
|
|
@@ -26065,11 +26065,16 @@ const config$1 = {
|
|
|
26065
26065
|
};
|
|
26066
26066
|
const translator$1 = NodeTranslator.from(config$1);
|
|
26067
26067
|
function parseTagValueJSON(json) {
|
|
26068
|
+
if (typeof json !== "string") {
|
|
26069
|
+
return {};
|
|
26070
|
+
}
|
|
26071
|
+
const trimmed = json.trim();
|
|
26072
|
+
if (!trimmed) {
|
|
26073
|
+
return {};
|
|
26074
|
+
}
|
|
26068
26075
|
try {
|
|
26069
|
-
|
|
26070
|
-
return attrs;
|
|
26076
|
+
return JSON.parse(trimmed);
|
|
26071
26077
|
} catch (err) {
|
|
26072
|
-
console.error(err);
|
|
26073
26078
|
return {};
|
|
26074
26079
|
}
|
|
26075
26080
|
}
|
|
@@ -26993,9 +26998,9 @@ function flattenFoundList(listElem, editor) {
|
|
|
26993
26998
|
const nestedLists = getNestedLists([li.nextSibling]);
|
|
26994
26999
|
const newList = createSingleItemList({ li, tag, rootNumId, level, listLevel, editor, NodeInterface });
|
|
26995
27000
|
newLists.push(newList);
|
|
26996
|
-
nestedLists.
|
|
26997
|
-
newLists.push(
|
|
26998
|
-
}
|
|
27001
|
+
if (nestedLists.length > 0) {
|
|
27002
|
+
newLists.push(nestedLists[0].cloneNode(true));
|
|
27003
|
+
}
|
|
26999
27004
|
if (nestedLists.length && ["OL", "UL"].includes(li.nextSibling.tagName)) {
|
|
27000
27005
|
li.nextSibling?.remove();
|
|
27001
27006
|
}
|
|
@@ -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-DPiYwzDY.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-DPiYwzDY.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-CS-lB2JG.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-DPiYwzDY.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BqdYfCl0.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-BqdYfCl0.js";
|
|
2
|
+
import "./chunks/converter-DPiYwzDY.js";
|
|
3
|
+
import "./chunks/docx-zipper-CS-lB2JG.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-DPiYwzDY.js";
|
|
13
|
+
import { aI, a5, i, a2 } from "./chunks/converter-DPiYwzDY.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-BqdYfCl0.js";
|
|
15
|
+
import { k, C, l, T, i as i2, m, j } from "./chunks/editor-BqdYfCl0.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-Dr4JWMZ7.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-CS-lB2JG.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|