@harbour-enterprises/superdoc 0.14.16 → 0.14.17
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-BqH3eQTm.es.js → index-BAysJGB4.es.js} +1 -1
- package/dist/chunks/index-CXnGrIkh.es.js +2956 -0
- package/dist/chunks/{index-DhQaJbc2.cjs → index-CsCJAG9Q.cjs} +1 -1
- package/dist/chunks/{index-DzFLdJgk.es.js → index-D40l9uDK.es.js} +1 -1
- package/dist/chunks/index-Drl2YGAZ.cjs +2955 -0
- package/dist/chunks/{index-B5xS6OKK.cjs → index-FmrzO61m.cjs} +1 -1
- package/dist/chunks/{super-editor.es-BMEPPjoP.cjs → super-editor.es-CD1J7J1S.cjs} +27 -20
- package/dist/chunks/{super-editor.es-DgSN0Pjh.es.js → super-editor.es-DZNEocN0.es.js} +27 -20
- package/dist/chunks/{url-CNqDAz7z.es.js → url-BGS7DYX5.es.js} +1 -1
- package/dist/chunks/{url-7PXI9_kJ.cjs → url-CXyMtOuA.cjs} +1 -1
- package/dist/chunks/{xml-js-Bn0K9fTK.es.js → xml-js-BC-eqb4d.es.js} +24 -2257
- package/dist/chunks/{xml-js-B_rfwhrZ.cjs → xml-js-D24l3ypz.cjs} +20 -2253
- package/dist/style.css +8 -0
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-fWl4mnxk.js → converter-Cb4ybypu.js} +12 -6
- package/dist/super-editor/chunks/{docx-zipper-BD70NG3a.js → docx-zipper-Da0EppdO.js} +1 -1
- package/dist/super-editor/chunks/{editor-BJCoXUyT.js → editor-BsKovpPN.js} +17 -16
- package/dist/super-editor/chunks/{toolbar-CfZV_bo8.js → toolbar-CHJXE6J5.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/commands/splitListItem.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/imageImporter.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/extensions/list-item/list-item.d.ts.map +1 -1
- package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +8 -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 +5 -5
- package/dist/superdoc.css +8 -0
- package/dist/superdoc.es.js +6 -6
- package/dist/superdoc.umd.js +28 -21
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/index-D612mw4O.es.js +0 -727
- package/dist/chunks/index-ibuaxW1X.cjs +0 -726
package/dist/superdoc.umd.js
CHANGED
|
@@ -14889,7 +14889,6 @@
|
|
|
14889
14889
|
}
|
|
14890
14890
|
var string_decoder = {};
|
|
14891
14891
|
var safeBuffer = { exports: {} };
|
|
14892
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
14893
14892
|
var hasRequiredSafeBuffer;
|
|
14894
14893
|
function requireSafeBuffer() {
|
|
14895
14894
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
@@ -14911,7 +14910,6 @@
|
|
|
14911
14910
|
function SafeBuffer(arg, encodingOrOffset, length2) {
|
|
14912
14911
|
return Buffer3(arg, encodingOrOffset, length2);
|
|
14913
14912
|
}
|
|
14914
|
-
SafeBuffer.prototype = Object.create(Buffer3.prototype);
|
|
14915
14913
|
copyProps(Buffer3, SafeBuffer);
|
|
14916
14914
|
SafeBuffer.from = function(arg, encodingOrOffset, length2) {
|
|
14917
14915
|
if (typeof arg === "number") {
|
|
@@ -33774,7 +33772,7 @@
|
|
|
33774
33772
|
}
|
|
33775
33773
|
}
|
|
33776
33774
|
_DocxExporter_instances = /* @__PURE__ */ new WeakSet();
|
|
33777
|
-
generate_xml_as_list_fn = function(data, debug =
|
|
33775
|
+
generate_xml_as_list_fn = function(data, debug = false) {
|
|
33778
33776
|
const json = JSON.parse(JSON.stringify(data));
|
|
33779
33777
|
const declaration = this.converter.declaration.attributes;
|
|
33780
33778
|
const xmlTag = `<?xml${Object.entries(declaration).map(([key, value]) => ` ${key}="${value}"`).join("")}?>`;
|
|
@@ -34411,6 +34409,7 @@
|
|
|
34411
34409
|
const relationships = rels.elements.find((el) => el.name === "Relationships");
|
|
34412
34410
|
const { elements } = relationships;
|
|
34413
34411
|
const rel = elements.find((el) => el.attributes["Id"] === rEmbed);
|
|
34412
|
+
if (!rel) return null;
|
|
34414
34413
|
const { attributes: relAttributes } = rel;
|
|
34415
34414
|
const path = `word/${relAttributes["Target"]}`;
|
|
34416
34415
|
return {
|
|
@@ -35635,11 +35634,18 @@
|
|
|
35635
35634
|
const abstractId = Number(el.attributes["w:abstractNumId"]);
|
|
35636
35635
|
abstractDefinitions[abstractId] = el;
|
|
35637
35636
|
});
|
|
35638
|
-
|
|
35637
|
+
let importListDefs = {};
|
|
35639
35638
|
definitions.forEach((el) => {
|
|
35640
35639
|
const numId = Number(el.attributes["w:numId"]);
|
|
35641
35640
|
importListDefs[numId] = el;
|
|
35642
35641
|
});
|
|
35642
|
+
const listDefsEntries = Object.entries(importListDefs);
|
|
35643
|
+
const foundByDurableId = listDefsEntries.filter(([_id, def2]) => def2.attributes?.["w16cid:durableId"] === "485517411");
|
|
35644
|
+
if (foundByDurableId.length > 1) {
|
|
35645
|
+
importListDefs = Object.fromEntries(
|
|
35646
|
+
listDefsEntries.filter(([_id, def2]) => def2.attributes?.["w16cid:durableId"] !== "485517411")
|
|
35647
|
+
);
|
|
35648
|
+
}
|
|
35643
35649
|
return {
|
|
35644
35650
|
abstracts: abstractDefinitions,
|
|
35645
35651
|
definitions: importListDefs
|
|
@@ -35726,7 +35732,7 @@
|
|
|
35726
35732
|
return;
|
|
35727
35733
|
}
|
|
35728
35734
|
}
|
|
35729
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.
|
|
35735
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.17") {
|
|
35730
35736
|
const customLocation = "docProps/custom.xml";
|
|
35731
35737
|
if (!docx[customLocation]) {
|
|
35732
35738
|
docx[customLocation] = generateCustomXml();
|
|
@@ -36204,7 +36210,7 @@
|
|
|
36204
36210
|
function generateCustomXml() {
|
|
36205
36211
|
return DEFAULT_CUSTOM_XML;
|
|
36206
36212
|
}
|
|
36207
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.
|
|
36213
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.17") {
|
|
36208
36214
|
return {
|
|
36209
36215
|
type: "element",
|
|
36210
36216
|
name: "property",
|
|
@@ -41127,6 +41133,7 @@
|
|
|
41127
41133
|
const paraOffset = $from.parentOffset;
|
|
41128
41134
|
const beforeCursor = paragraphNode.content.cut(0, paraOffset);
|
|
41129
41135
|
const afterCursor = paragraphNode.content.cut(paraOffset);
|
|
41136
|
+
let firstList, secondList;
|
|
41130
41137
|
const listItemHasMultipleParagraphs = listItemNode.childCount > 1;
|
|
41131
41138
|
if (listItemHasMultipleParagraphs) {
|
|
41132
41139
|
const paragraphIndex = $from.index(-1);
|
|
@@ -41164,19 +41171,19 @@
|
|
|
41164
41171
|
{ ...listItemNode.attrs },
|
|
41165
41172
|
Fragment.from(firstListContent)
|
|
41166
41173
|
);
|
|
41167
|
-
|
|
41174
|
+
firstList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(firstListItem));
|
|
41168
41175
|
const secondListItem = editor.schema.nodes.listItem.create(
|
|
41169
41176
|
{ ...listItemNode.attrs },
|
|
41170
41177
|
Fragment.from(secondListContent)
|
|
41171
41178
|
);
|
|
41172
|
-
|
|
41179
|
+
secondList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(secondListItem));
|
|
41173
41180
|
} else {
|
|
41174
41181
|
const firstParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, beforeCursor);
|
|
41175
41182
|
const firstListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, firstParagraph);
|
|
41176
|
-
|
|
41183
|
+
firstList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(firstListItem));
|
|
41177
41184
|
const secondParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, afterCursor);
|
|
41178
41185
|
const secondListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, secondParagraph);
|
|
41179
|
-
|
|
41186
|
+
secondList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(secondListItem));
|
|
41180
41187
|
}
|
|
41181
41188
|
if (!firstList || !secondList) return false;
|
|
41182
41189
|
const listStart = matchedParentList.pos;
|
|
@@ -41885,7 +41892,7 @@
|
|
|
41885
41892
|
return null;
|
|
41886
41893
|
if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) && // Ignore elements with zero-size bounding rectangles
|
|
41887
41894
|
((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {
|
|
41888
|
-
if (desc.node.isBlock && desc.parent) {
|
|
41895
|
+
if (desc.node.isBlock && desc.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(desc.dom.nodeName)) {
|
|
41889
41896
|
if (!sawBlock && rect.left > coords.left || rect.top > coords.top)
|
|
41890
41897
|
outsideBlock = desc.posBefore;
|
|
41891
41898
|
else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top)
|
|
@@ -45913,7 +45920,7 @@
|
|
|
45913
45920
|
}
|
|
45914
45921
|
return null;
|
|
45915
45922
|
}
|
|
45916
|
-
const isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
45923
|
+
const isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
45917
45924
|
function readDOMChange(view, from2, to, typeOver, addedNodes) {
|
|
45918
45925
|
let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);
|
|
45919
45926
|
view.input.compositionPendingChanges = 0;
|
|
@@ -49684,7 +49691,6 @@
|
|
|
49684
49691
|
});
|
|
49685
49692
|
if (appendToBody) document.body.appendChild(editorContainer);
|
|
49686
49693
|
const headerFooterEditor = new Editor({
|
|
49687
|
-
documentMode: editor.options.documentMode,
|
|
49688
49694
|
role: editor.options.role,
|
|
49689
49695
|
loadFromSchema: true,
|
|
49690
49696
|
mode: "docx",
|
|
@@ -51446,7 +51452,7 @@
|
|
|
51446
51452
|
if (firstChild && firstChild.type.name === "listItem") {
|
|
51447
51453
|
const { attrs } = firstChild;
|
|
51448
51454
|
const { level, listNumberingType } = attrs || {};
|
|
51449
|
-
if (typeof level ===
|
|
51455
|
+
if (typeof level === "undefined" || !listNumberingType) {
|
|
51450
51456
|
return true;
|
|
51451
51457
|
}
|
|
51452
51458
|
const childContent = firstChild?.content?.content;
|
|
@@ -52301,9 +52307,9 @@
|
|
|
52301
52307
|
* @returns {boolean} Whether migrations are needed
|
|
52302
52308
|
*/
|
|
52303
52309
|
static checkIfMigrationsNeeded(data) {
|
|
52304
|
-
|
|
52305
|
-
const migrations = getNecessaryMigrations(
|
|
52306
|
-
console.debug("[checkVersionMigrations] Migrations needed:",
|
|
52310
|
+
const dataVersion = version || "initial";
|
|
52311
|
+
const migrations = getNecessaryMigrations(dataVersion) || [];
|
|
52312
|
+
console.debug("[checkVersionMigrations] Migrations needed:", dataVersion, migrations.length);
|
|
52307
52313
|
return migrations.length > 0;
|
|
52308
52314
|
}
|
|
52309
52315
|
/**
|
|
@@ -52311,7 +52317,7 @@
|
|
|
52311
52317
|
* @returns {Object | void} Migration results
|
|
52312
52318
|
*/
|
|
52313
52319
|
processCollaborationMigrations() {
|
|
52314
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.
|
|
52320
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.17");
|
|
52315
52321
|
if (!this.options.ydoc) return;
|
|
52316
52322
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
52317
52323
|
let docVersion = metaMap.get("version");
|
|
@@ -52632,6 +52638,7 @@
|
|
|
52632
52638
|
}
|
|
52633
52639
|
};
|
|
52634
52640
|
initMedia_fn = function() {
|
|
52641
|
+
if (this.options.isChildEditor) return;
|
|
52635
52642
|
if (!this.options.ydoc) return this.storage.image.media = this.options.mediaFiles;
|
|
52636
52643
|
const mediaMap = this.options.ydoc.getMap("media");
|
|
52637
52644
|
if (this.options.isNewFile) {
|
|
@@ -52745,6 +52752,7 @@
|
|
|
52745
52752
|
if (!this.options.isNewFile) {
|
|
52746
52753
|
this.initPagination();
|
|
52747
52754
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
52755
|
+
updateYdocDocxData(this);
|
|
52748
52756
|
}
|
|
52749
52757
|
};
|
|
52750
52758
|
initComments_fn = function() {
|
|
@@ -54864,7 +54872,6 @@
|
|
|
54864
54872
|
},
|
|
54865
54873
|
styleId: {
|
|
54866
54874
|
rendered: false,
|
|
54867
|
-
keepOnSplit: true,
|
|
54868
54875
|
keepOnSplit: true
|
|
54869
54876
|
},
|
|
54870
54877
|
customFormat: {
|
|
@@ -59364,7 +59371,7 @@
|
|
|
59364
59371
|
...node2.attrs,
|
|
59365
59372
|
// reset displayLabel to default.
|
|
59366
59373
|
displayLabel,
|
|
59367
|
-
// reset attrs
|
|
59374
|
+
// reset attrs for specific types.
|
|
59368
59375
|
imageSrc: null,
|
|
59369
59376
|
rawHtml: null,
|
|
59370
59377
|
linkUrl: null
|
|
@@ -98378,7 +98385,7 @@ ${style2}
|
|
|
98378
98385
|
this.config.colors = shuffleArray(this.config.colors);
|
|
98379
98386
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
98380
98387
|
this.colorIndex = 0;
|
|
98381
|
-
this.version = "0.14.
|
|
98388
|
+
this.version = "0.14.17";
|
|
98382
98389
|
console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
98383
98390
|
this.superdocId = config.superdocId || v4();
|
|
98384
98391
|
this.colors = this.config.colors;
|