@harbour-enterprises/superdoc 0.14.9-next.4 → 0.14.9-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{index-BMwK7kM5.es.js → index-Bmg-LdrI.es.js} +2 -2
- package/dist/chunks/{index-Oz4X1zyg.cjs → index-Bx6NTjUr.cjs} +2 -2
- package/dist/chunks/{index-CZuIe8A3.cjs → index-D8-yLk4l.cjs} +1 -1
- package/dist/chunks/{index-MJ-5Yknb.es.js → index-q6mHfs8e.es.js} +1 -1
- package/dist/chunks/{super-editor.es-BLipGLuU.es.js → super-editor.es-BniGAo5V.es.js} +119 -16
- package/dist/chunks/{super-editor.es-BhS65olb.cjs → super-editor.es-CQn3Mboc.cjs} +119 -16
- package/dist/chunks/{url-Cqg2Hljl.es.js → url-CZRpBZ8r.es.js} +1 -1
- package/dist/chunks/{url-CRVat8D5.cjs → url-f1i5V486.cjs} +1 -1
- package/dist/chunks/{xml-js-t28wMlyv.cjs → xml-js-CR_HPgfX.cjs} +158 -123
- package/dist/chunks/{xml-js-D78KIQHL.es.js → xml-js-DzoGf_HX.es.js} +158 -123
- package/dist/core/SuperDoc.d.ts +1 -1
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/style.css +37 -0
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-BA-KDEVJ.js → converter-B1JDclhK.js} +134 -26
- package/dist/super-editor/chunks/{docx-zipper-DGmEYrh3.js → docx-zipper-e6p-zLWx.js} +1 -1
- package/dist/super-editor/chunks/{editor-BXXmxa6X.js → editor-VmXCRNX0.js} +12 -16
- package/dist/super-editor/chunks/{toolbar-BZNpDE3m.js → toolbar-Bo1J72SK.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts +3 -10
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/inputRules/html/html-helpers.d.ts +4 -0
- package/dist/super-editor/core/inputRules/html/html-helpers.d.ts.map +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/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 +7 -7
- package/dist/superdoc.es.js +8 -8
- package/dist/superdoc.umd.js +122 -19
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as commonjsGlobal, B as Buffer, a as getAugmentedNamespace, g as getDefaultExportFromCjs } from "./jszip-CYDYUNnI.es.js";
|
|
2
2
|
import { p as process$1 } from "./vue-lU0o_RlU.es.js";
|
|
3
|
-
import { e as eventsExports, r as require$$2, u as util, i as inherits_browserExports, b as browser$1, a as requireString_decoder } from "./xml-js-
|
|
4
|
-
import { u as url } from "./url-
|
|
3
|
+
import { e as eventsExports, r as require$$2, u as util, i as inherits_browserExports, b as browser$1, a as requireString_decoder } from "./xml-js-DzoGf_HX.es.js";
|
|
4
|
+
import { u as url } from "./url-CZRpBZ8r.es.js";
|
|
5
5
|
function _mergeNamespaces(n, m) {
|
|
6
6
|
for (var i = 0; i < m.length; i++) {
|
|
7
7
|
const e = m[i];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jszip = require("./jszip-D5XoMX4C.cjs");
|
|
3
3
|
const vue = require("./vue-tQYF719J.cjs");
|
|
4
|
-
const xmlJs = require("./xml-js-
|
|
5
|
-
const url = require("./url-
|
|
4
|
+
const xmlJs = require("./xml-js-CR_HPgfX.cjs");
|
|
5
|
+
const url = require("./url-f1i5V486.cjs");
|
|
6
6
|
function _mergeNamespaces(n, m) {
|
|
7
7
|
for (var i = 0; i < m.length; i++) {
|
|
8
8
|
const e = m[i];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as getDefaultExportFromCjs } from "./jszip-CYDYUNnI.es.js";
|
|
2
|
-
import { s as streamHttp, r as require$$1 } from "./index-
|
|
2
|
+
import { s as streamHttp, r as require$$1 } from "./index-Bmg-LdrI.es.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
for (var i = 0; i < m.length; i++) {
|
|
5
5
|
const e = m[i];
|
|
@@ -22715,6 +22715,113 @@ function createSingleItemList(li, tag, rootNumId, level, editor, NodeInterface)
|
|
|
22715
22715
|
newList.appendChild(newLi);
|
|
22716
22716
|
return newList;
|
|
22717
22717
|
}
|
|
22718
|
+
function unflattenListsInHtml(html) {
|
|
22719
|
+
const parser = new DOMParser();
|
|
22720
|
+
const doc2 = parser.parseFromString(html, "text/html");
|
|
22721
|
+
const allNodes = [...doc2.body.children];
|
|
22722
|
+
const listSequences = [];
|
|
22723
|
+
let currentSequence = null;
|
|
22724
|
+
allNodes.forEach((node2, index2) => {
|
|
22725
|
+
const isFlattenList = node2.tagName && (node2.tagName === "OL" || node2.tagName === "UL") && node2.hasAttribute("data-list-id");
|
|
22726
|
+
if (isFlattenList) {
|
|
22727
|
+
const listId = node2.getAttribute("data-list-id");
|
|
22728
|
+
if (currentSequence && currentSequence.id === listId) {
|
|
22729
|
+
currentSequence.lists.push({ element: node2, index: index2 });
|
|
22730
|
+
} else {
|
|
22731
|
+
currentSequence = {
|
|
22732
|
+
id: listId,
|
|
22733
|
+
lists: [{ element: node2, index: index2 }]
|
|
22734
|
+
};
|
|
22735
|
+
listSequences.push(currentSequence);
|
|
22736
|
+
}
|
|
22737
|
+
} else {
|
|
22738
|
+
currentSequence = null;
|
|
22739
|
+
}
|
|
22740
|
+
});
|
|
22741
|
+
listSequences.reverse().forEach((sequence) => {
|
|
22742
|
+
const sequenceLists = sequence.lists;
|
|
22743
|
+
if (sequenceLists.length === 0) {
|
|
22744
|
+
return;
|
|
22745
|
+
}
|
|
22746
|
+
const items = sequenceLists.map(({ element: list }) => {
|
|
22747
|
+
const liElement = list.querySelector("li");
|
|
22748
|
+
if (!liElement) return null;
|
|
22749
|
+
return {
|
|
22750
|
+
element: liElement,
|
|
22751
|
+
level: parseInt(liElement.getAttribute("data-level") || "0"),
|
|
22752
|
+
numFmt: liElement.getAttribute("data-num-fmt") || "bullet",
|
|
22753
|
+
listLevel: JSON.parse(liElement.getAttribute("data-list-level") || "[1]")
|
|
22754
|
+
};
|
|
22755
|
+
}).filter((item) => item !== null);
|
|
22756
|
+
if (items.length === 0) {
|
|
22757
|
+
return;
|
|
22758
|
+
}
|
|
22759
|
+
const rootList = buildNestedList({ items });
|
|
22760
|
+
const firstOriginalList = sequenceLists[0].element;
|
|
22761
|
+
firstOriginalList?.parentNode?.insertBefore(rootList, firstOriginalList);
|
|
22762
|
+
sequenceLists.forEach(({ element: list }) => {
|
|
22763
|
+
if (list.parentNode) list.parentNode.removeChild(list);
|
|
22764
|
+
});
|
|
22765
|
+
});
|
|
22766
|
+
return doc2.body.innerHTML;
|
|
22767
|
+
}
|
|
22768
|
+
function buildNestedList({ items }) {
|
|
22769
|
+
if (!items.length) {
|
|
22770
|
+
return null;
|
|
22771
|
+
}
|
|
22772
|
+
const [rootItem] = items;
|
|
22773
|
+
const doc2 = rootItem.element.ownerDocument;
|
|
22774
|
+
const isOrderedList = rootItem.numFmt && !["bullet", "none"].includes(rootItem.numFmt);
|
|
22775
|
+
const rootList = doc2.createElement(isOrderedList ? "ol" : "ul");
|
|
22776
|
+
if (isOrderedList && rootItem.listLevel?.[0] && rootItem.listLevel[0] > 1) {
|
|
22777
|
+
rootList.setAttribute("start", rootItem.listLevel[0]);
|
|
22778
|
+
}
|
|
22779
|
+
const lastLevelItem = /* @__PURE__ */ new Map();
|
|
22780
|
+
items.forEach((item) => {
|
|
22781
|
+
const { element: liElement, level, numFmt, listLevel } = item;
|
|
22782
|
+
const cleanLi = cleanListItem(liElement.cloneNode(true));
|
|
22783
|
+
if (level === 0) {
|
|
22784
|
+
rootList.append(cleanLi);
|
|
22785
|
+
lastLevelItem.set(0, cleanLi);
|
|
22786
|
+
} else {
|
|
22787
|
+
const parentLi = lastLevelItem.get(level - 1);
|
|
22788
|
+
if (!parentLi) {
|
|
22789
|
+
rootList.append(cleanLi);
|
|
22790
|
+
lastLevelItem.set(level, cleanLi);
|
|
22791
|
+
return;
|
|
22792
|
+
}
|
|
22793
|
+
let nestedList = null;
|
|
22794
|
+
[...parentLi.children].forEach((child) => {
|
|
22795
|
+
if (child.tagName && (child.tagName === "OL" || child.tagName === "UL")) {
|
|
22796
|
+
nestedList = child;
|
|
22797
|
+
}
|
|
22798
|
+
});
|
|
22799
|
+
if (!nestedList) {
|
|
22800
|
+
const listType = numFmt && !["bullet", "none"].includes(numFmt) ? "ol" : "ul";
|
|
22801
|
+
nestedList = doc2.createElement(listType);
|
|
22802
|
+
parentLi.append(nestedList);
|
|
22803
|
+
}
|
|
22804
|
+
nestedList.append(cleanLi);
|
|
22805
|
+
lastLevelItem.set(level, cleanLi);
|
|
22806
|
+
}
|
|
22807
|
+
});
|
|
22808
|
+
return rootList;
|
|
22809
|
+
}
|
|
22810
|
+
function cleanListItem(listItem) {
|
|
22811
|
+
const attrs = [
|
|
22812
|
+
"data-num-id",
|
|
22813
|
+
"data-level",
|
|
22814
|
+
"data-num-fmt",
|
|
22815
|
+
"data-lvl-text",
|
|
22816
|
+
"data-list-level",
|
|
22817
|
+
"data-marker-type",
|
|
22818
|
+
"aria-label"
|
|
22819
|
+
];
|
|
22820
|
+
attrs.forEach((attr) => {
|
|
22821
|
+
listItem.removeAttribute(attr);
|
|
22822
|
+
});
|
|
22823
|
+
return listItem;
|
|
22824
|
+
}
|
|
22718
22825
|
class InputRule {
|
|
22719
22826
|
constructor(config) {
|
|
22720
22827
|
__publicField$2(this, "match");
|
|
@@ -26359,7 +26466,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
26359
26466
|
return;
|
|
26360
26467
|
}
|
|
26361
26468
|
}
|
|
26362
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.9-next.
|
|
26469
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.9-next.6") {
|
|
26363
26470
|
const customLocation = "docProps/custom.xml";
|
|
26364
26471
|
if (!docx[customLocation]) {
|
|
26365
26472
|
docx[customLocation] = generateCustomXml();
|
|
@@ -26835,7 +26942,7 @@ function storeSuperdocVersion(docx) {
|
|
|
26835
26942
|
function generateCustomXml() {
|
|
26836
26943
|
return DEFAULT_CUSTOM_XML;
|
|
26837
26944
|
}
|
|
26838
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.9-next.
|
|
26945
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.9-next.6") {
|
|
26839
26946
|
return {
|
|
26840
26947
|
type: "element",
|
|
26841
26948
|
name: "property",
|
|
@@ -42725,9 +42832,6 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42725
42832
|
const attributes = typeof nameOrAttributes === "string" ? attributesOrUndefined : nameOrAttributes;
|
|
42726
42833
|
return isActive(this.state, name, attributes);
|
|
42727
42834
|
}
|
|
42728
|
-
/**
|
|
42729
|
-
* Get the document as JSON.
|
|
42730
|
-
*/
|
|
42731
42835
|
/**
|
|
42732
42836
|
* Get the editor content as JSON
|
|
42733
42837
|
* @returns {Object} Editor content as JSON
|
|
@@ -42735,18 +42839,20 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42735
42839
|
getJSON() {
|
|
42736
42840
|
return this.state.doc.toJSON();
|
|
42737
42841
|
}
|
|
42738
|
-
/**
|
|
42739
|
-
* Get HTML string of the document
|
|
42740
|
-
*/
|
|
42741
42842
|
/**
|
|
42742
42843
|
* Get the editor content as HTML
|
|
42743
42844
|
* @returns {string} Editor content as HTML
|
|
42744
42845
|
*/
|
|
42745
|
-
getHTML() {
|
|
42746
|
-
const
|
|
42846
|
+
getHTML({ unflattenLists = false } = {}) {
|
|
42847
|
+
const tempDocument = document.implementation.createHTMLDocument();
|
|
42848
|
+
const container = tempDocument.createElement("div");
|
|
42747
42849
|
const fragment = DOMSerializer.fromSchema(this.schema).serializeFragment(this.state.doc.content);
|
|
42748
|
-
|
|
42749
|
-
|
|
42850
|
+
container.appendChild(fragment);
|
|
42851
|
+
let html = container.innerHTML;
|
|
42852
|
+
if (unflattenLists) {
|
|
42853
|
+
html = unflattenListsInHtml(html);
|
|
42854
|
+
}
|
|
42855
|
+
return html;
|
|
42750
42856
|
}
|
|
42751
42857
|
/**
|
|
42752
42858
|
* Create a child editor linked to this editor.
|
|
@@ -42758,9 +42864,6 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42758
42864
|
createChildEditor(options2) {
|
|
42759
42865
|
return createLinkedChildEditor(this, options2);
|
|
42760
42866
|
}
|
|
42761
|
-
/**
|
|
42762
|
-
* Get page styles
|
|
42763
|
-
*/
|
|
42764
42867
|
/**
|
|
42765
42868
|
* Get page styles
|
|
42766
42869
|
* @returns {Object} Page styles
|
|
@@ -42925,7 +43028,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42925
43028
|
* @returns {Object | void} Migration results
|
|
42926
43029
|
*/
|
|
42927
43030
|
processCollaborationMigrations() {
|
|
42928
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.
|
|
43031
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.6");
|
|
42929
43032
|
if (!this.options.ydoc) return;
|
|
42930
43033
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
42931
43034
|
let docVersion = metaMap.get("version");
|
|
@@ -22732,6 +22732,113 @@ function createSingleItemList(li, tag, rootNumId, level, editor, NodeInterface)
|
|
|
22732
22732
|
newList.appendChild(newLi);
|
|
22733
22733
|
return newList;
|
|
22734
22734
|
}
|
|
22735
|
+
function unflattenListsInHtml(html) {
|
|
22736
|
+
const parser = new DOMParser();
|
|
22737
|
+
const doc2 = parser.parseFromString(html, "text/html");
|
|
22738
|
+
const allNodes = [...doc2.body.children];
|
|
22739
|
+
const listSequences = [];
|
|
22740
|
+
let currentSequence = null;
|
|
22741
|
+
allNodes.forEach((node2, index2) => {
|
|
22742
|
+
const isFlattenList = node2.tagName && (node2.tagName === "OL" || node2.tagName === "UL") && node2.hasAttribute("data-list-id");
|
|
22743
|
+
if (isFlattenList) {
|
|
22744
|
+
const listId = node2.getAttribute("data-list-id");
|
|
22745
|
+
if (currentSequence && currentSequence.id === listId) {
|
|
22746
|
+
currentSequence.lists.push({ element: node2, index: index2 });
|
|
22747
|
+
} else {
|
|
22748
|
+
currentSequence = {
|
|
22749
|
+
id: listId,
|
|
22750
|
+
lists: [{ element: node2, index: index2 }]
|
|
22751
|
+
};
|
|
22752
|
+
listSequences.push(currentSequence);
|
|
22753
|
+
}
|
|
22754
|
+
} else {
|
|
22755
|
+
currentSequence = null;
|
|
22756
|
+
}
|
|
22757
|
+
});
|
|
22758
|
+
listSequences.reverse().forEach((sequence) => {
|
|
22759
|
+
const sequenceLists = sequence.lists;
|
|
22760
|
+
if (sequenceLists.length === 0) {
|
|
22761
|
+
return;
|
|
22762
|
+
}
|
|
22763
|
+
const items = sequenceLists.map(({ element: list }) => {
|
|
22764
|
+
const liElement = list.querySelector("li");
|
|
22765
|
+
if (!liElement) return null;
|
|
22766
|
+
return {
|
|
22767
|
+
element: liElement,
|
|
22768
|
+
level: parseInt(liElement.getAttribute("data-level") || "0"),
|
|
22769
|
+
numFmt: liElement.getAttribute("data-num-fmt") || "bullet",
|
|
22770
|
+
listLevel: JSON.parse(liElement.getAttribute("data-list-level") || "[1]")
|
|
22771
|
+
};
|
|
22772
|
+
}).filter((item) => item !== null);
|
|
22773
|
+
if (items.length === 0) {
|
|
22774
|
+
return;
|
|
22775
|
+
}
|
|
22776
|
+
const rootList = buildNestedList({ items });
|
|
22777
|
+
const firstOriginalList = sequenceLists[0].element;
|
|
22778
|
+
firstOriginalList?.parentNode?.insertBefore(rootList, firstOriginalList);
|
|
22779
|
+
sequenceLists.forEach(({ element: list }) => {
|
|
22780
|
+
if (list.parentNode) list.parentNode.removeChild(list);
|
|
22781
|
+
});
|
|
22782
|
+
});
|
|
22783
|
+
return doc2.body.innerHTML;
|
|
22784
|
+
}
|
|
22785
|
+
function buildNestedList({ items }) {
|
|
22786
|
+
if (!items.length) {
|
|
22787
|
+
return null;
|
|
22788
|
+
}
|
|
22789
|
+
const [rootItem] = items;
|
|
22790
|
+
const doc2 = rootItem.element.ownerDocument;
|
|
22791
|
+
const isOrderedList = rootItem.numFmt && !["bullet", "none"].includes(rootItem.numFmt);
|
|
22792
|
+
const rootList = doc2.createElement(isOrderedList ? "ol" : "ul");
|
|
22793
|
+
if (isOrderedList && rootItem.listLevel?.[0] && rootItem.listLevel[0] > 1) {
|
|
22794
|
+
rootList.setAttribute("start", rootItem.listLevel[0]);
|
|
22795
|
+
}
|
|
22796
|
+
const lastLevelItem = /* @__PURE__ */ new Map();
|
|
22797
|
+
items.forEach((item) => {
|
|
22798
|
+
const { element: liElement, level, numFmt, listLevel } = item;
|
|
22799
|
+
const cleanLi = cleanListItem(liElement.cloneNode(true));
|
|
22800
|
+
if (level === 0) {
|
|
22801
|
+
rootList.append(cleanLi);
|
|
22802
|
+
lastLevelItem.set(0, cleanLi);
|
|
22803
|
+
} else {
|
|
22804
|
+
const parentLi = lastLevelItem.get(level - 1);
|
|
22805
|
+
if (!parentLi) {
|
|
22806
|
+
rootList.append(cleanLi);
|
|
22807
|
+
lastLevelItem.set(level, cleanLi);
|
|
22808
|
+
return;
|
|
22809
|
+
}
|
|
22810
|
+
let nestedList = null;
|
|
22811
|
+
[...parentLi.children].forEach((child) => {
|
|
22812
|
+
if (child.tagName && (child.tagName === "OL" || child.tagName === "UL")) {
|
|
22813
|
+
nestedList = child;
|
|
22814
|
+
}
|
|
22815
|
+
});
|
|
22816
|
+
if (!nestedList) {
|
|
22817
|
+
const listType = numFmt && !["bullet", "none"].includes(numFmt) ? "ol" : "ul";
|
|
22818
|
+
nestedList = doc2.createElement(listType);
|
|
22819
|
+
parentLi.append(nestedList);
|
|
22820
|
+
}
|
|
22821
|
+
nestedList.append(cleanLi);
|
|
22822
|
+
lastLevelItem.set(level, cleanLi);
|
|
22823
|
+
}
|
|
22824
|
+
});
|
|
22825
|
+
return rootList;
|
|
22826
|
+
}
|
|
22827
|
+
function cleanListItem(listItem) {
|
|
22828
|
+
const attrs = [
|
|
22829
|
+
"data-num-id",
|
|
22830
|
+
"data-level",
|
|
22831
|
+
"data-num-fmt",
|
|
22832
|
+
"data-lvl-text",
|
|
22833
|
+
"data-list-level",
|
|
22834
|
+
"data-marker-type",
|
|
22835
|
+
"aria-label"
|
|
22836
|
+
];
|
|
22837
|
+
attrs.forEach((attr) => {
|
|
22838
|
+
listItem.removeAttribute(attr);
|
|
22839
|
+
});
|
|
22840
|
+
return listItem;
|
|
22841
|
+
}
|
|
22735
22842
|
class InputRule {
|
|
22736
22843
|
constructor(config) {
|
|
22737
22844
|
__publicField$2(this, "match");
|
|
@@ -26376,7 +26483,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
26376
26483
|
return;
|
|
26377
26484
|
}
|
|
26378
26485
|
}
|
|
26379
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.9-next.
|
|
26486
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.9-next.6") {
|
|
26380
26487
|
const customLocation = "docProps/custom.xml";
|
|
26381
26488
|
if (!docx[customLocation]) {
|
|
26382
26489
|
docx[customLocation] = generateCustomXml();
|
|
@@ -26852,7 +26959,7 @@ function storeSuperdocVersion(docx) {
|
|
|
26852
26959
|
function generateCustomXml() {
|
|
26853
26960
|
return DEFAULT_CUSTOM_XML;
|
|
26854
26961
|
}
|
|
26855
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.9-next.
|
|
26962
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.9-next.6") {
|
|
26856
26963
|
return {
|
|
26857
26964
|
type: "element",
|
|
26858
26965
|
name: "property",
|
|
@@ -42742,9 +42849,6 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42742
42849
|
const attributes = typeof nameOrAttributes === "string" ? attributesOrUndefined : nameOrAttributes;
|
|
42743
42850
|
return isActive(this.state, name, attributes);
|
|
42744
42851
|
}
|
|
42745
|
-
/**
|
|
42746
|
-
* Get the document as JSON.
|
|
42747
|
-
*/
|
|
42748
42852
|
/**
|
|
42749
42853
|
* Get the editor content as JSON
|
|
42750
42854
|
* @returns {Object} Editor content as JSON
|
|
@@ -42752,18 +42856,20 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42752
42856
|
getJSON() {
|
|
42753
42857
|
return this.state.doc.toJSON();
|
|
42754
42858
|
}
|
|
42755
|
-
/**
|
|
42756
|
-
* Get HTML string of the document
|
|
42757
|
-
*/
|
|
42758
42859
|
/**
|
|
42759
42860
|
* Get the editor content as HTML
|
|
42760
42861
|
* @returns {string} Editor content as HTML
|
|
42761
42862
|
*/
|
|
42762
|
-
getHTML() {
|
|
42763
|
-
const
|
|
42863
|
+
getHTML({ unflattenLists = false } = {}) {
|
|
42864
|
+
const tempDocument = document.implementation.createHTMLDocument();
|
|
42865
|
+
const container = tempDocument.createElement("div");
|
|
42764
42866
|
const fragment = DOMSerializer.fromSchema(this.schema).serializeFragment(this.state.doc.content);
|
|
42765
|
-
|
|
42766
|
-
|
|
42867
|
+
container.appendChild(fragment);
|
|
42868
|
+
let html = container.innerHTML;
|
|
42869
|
+
if (unflattenLists) {
|
|
42870
|
+
html = unflattenListsInHtml(html);
|
|
42871
|
+
}
|
|
42872
|
+
return html;
|
|
42767
42873
|
}
|
|
42768
42874
|
/**
|
|
42769
42875
|
* Create a child editor linked to this editor.
|
|
@@ -42775,9 +42881,6 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42775
42881
|
createChildEditor(options2) {
|
|
42776
42882
|
return createLinkedChildEditor(this, options2);
|
|
42777
42883
|
}
|
|
42778
|
-
/**
|
|
42779
|
-
* Get page styles
|
|
42780
|
-
*/
|
|
42781
42884
|
/**
|
|
42782
42885
|
* Get page styles
|
|
42783
42886
|
* @returns {Object} Page styles
|
|
@@ -42942,7 +43045,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
42942
43045
|
* @returns {Object | void} Migration results
|
|
42943
43046
|
*/
|
|
42944
43047
|
processCollaborationMigrations() {
|
|
42945
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.
|
|
43048
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.6");
|
|
42946
43049
|
if (!this.options.ydoc) return;
|
|
42947
43050
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
42948
43051
|
let docVersion = metaMap.get("version");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as commonjsGlobal, g as getDefaultExportFromCjs, a as getAugmentedNamespace } from "./jszip-CYDYUNnI.es.js";
|
|
2
|
-
import { t as type, g as getIntrinsic, c as callBound$2 } from "./xml-js-
|
|
2
|
+
import { t as type, g as getIntrinsic, c as callBound$2 } from "./xml-js-DzoGf_HX.es.js";
|
|
3
3
|
import { _ as __viteBrowserExternal } from "./__vite-browser-external-CURh0WXD.es.js";
|
|
4
4
|
var punycode$1 = { exports: {} };
|
|
5
5
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const jszip = require("./jszip-D5XoMX4C.cjs");
|
|
3
|
-
const xmlJs = require("./xml-js-
|
|
3
|
+
const xmlJs = require("./xml-js-CR_HPgfX.cjs");
|
|
4
4
|
const __viteBrowserExternal = require("./__vite-browser-external-DWbQq7bv.cjs");
|
|
5
5
|
var punycode$1 = { exports: {} };
|
|
6
6
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|