@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
|
@@ -7511,7 +7511,6 @@ function require_stream_duplex() {
|
|
|
7511
7511
|
}
|
|
7512
7512
|
var string_decoder = {};
|
|
7513
7513
|
var safeBuffer = { exports: {} };
|
|
7514
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
7515
7514
|
var hasRequiredSafeBuffer;
|
|
7516
7515
|
function requireSafeBuffer() {
|
|
7517
7516
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
@@ -7533,7 +7532,6 @@ function requireSafeBuffer() {
|
|
|
7533
7532
|
function SafeBuffer(arg, encodingOrOffset, length2) {
|
|
7534
7533
|
return Buffer3(arg, encodingOrOffset, length2);
|
|
7535
7534
|
}
|
|
7536
|
-
SafeBuffer.prototype = Object.create(Buffer3.prototype);
|
|
7537
7535
|
copyProps(Buffer3, SafeBuffer);
|
|
7538
7536
|
SafeBuffer.from = function(arg, encodingOrOffset, length2) {
|
|
7539
7537
|
if (typeof arg === "number") {
|
|
@@ -26396,7 +26394,7 @@ class DocxExporter {
|
|
|
26396
26394
|
}
|
|
26397
26395
|
}
|
|
26398
26396
|
_DocxExporter_instances = /* @__PURE__ */ new WeakSet();
|
|
26399
|
-
generate_xml_as_list_fn = function(data, debug =
|
|
26397
|
+
generate_xml_as_list_fn = function(data, debug = false) {
|
|
26400
26398
|
const json = JSON.parse(JSON.stringify(data));
|
|
26401
26399
|
const declaration = this.converter.declaration.attributes;
|
|
26402
26400
|
const xmlTag = `<?xml${Object.entries(declaration).map(([key, value]) => ` ${key}="${value}"`).join("")}?>`;
|
|
@@ -27033,6 +27031,7 @@ function handleImageImport(node2, currentFileName, params2) {
|
|
|
27033
27031
|
const relationships = rels.elements.find((el) => el.name === "Relationships");
|
|
27034
27032
|
const { elements } = relationships;
|
|
27035
27033
|
const rel = elements.find((el) => el.attributes["Id"] === rEmbed);
|
|
27034
|
+
if (!rel) return null;
|
|
27036
27035
|
const { attributes: relAttributes } = rel;
|
|
27037
27036
|
const path = `word/${relAttributes["Target"]}`;
|
|
27038
27037
|
return {
|
|
@@ -28257,11 +28256,18 @@ function getNumberingDefinitions(docx) {
|
|
|
28257
28256
|
const abstractId = Number(el.attributes["w:abstractNumId"]);
|
|
28258
28257
|
abstractDefinitions[abstractId] = el;
|
|
28259
28258
|
});
|
|
28260
|
-
|
|
28259
|
+
let importListDefs = {};
|
|
28261
28260
|
definitions.forEach((el) => {
|
|
28262
28261
|
const numId = Number(el.attributes["w:numId"]);
|
|
28263
28262
|
importListDefs[numId] = el;
|
|
28264
28263
|
});
|
|
28264
|
+
const listDefsEntries = Object.entries(importListDefs);
|
|
28265
|
+
const foundByDurableId = listDefsEntries.filter(([_id, def]) => def.attributes?.["w16cid:durableId"] === "485517411");
|
|
28266
|
+
if (foundByDurableId.length > 1) {
|
|
28267
|
+
importListDefs = Object.fromEntries(
|
|
28268
|
+
listDefsEntries.filter(([_id, def]) => def.attributes?.["w16cid:durableId"] !== "485517411")
|
|
28269
|
+
);
|
|
28270
|
+
}
|
|
28265
28271
|
return {
|
|
28266
28272
|
abstracts: abstractDefinitions,
|
|
28267
28273
|
definitions: importListDefs
|
|
@@ -28348,7 +28354,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
28348
28354
|
return;
|
|
28349
28355
|
}
|
|
28350
28356
|
}
|
|
28351
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.
|
|
28357
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.17") {
|
|
28352
28358
|
const customLocation = "docProps/custom.xml";
|
|
28353
28359
|
if (!docx[customLocation]) {
|
|
28354
28360
|
docx[customLocation] = generateCustomXml();
|
|
@@ -28826,7 +28832,7 @@ function storeSuperdocVersion(docx) {
|
|
|
28826
28832
|
function generateCustomXml() {
|
|
28827
28833
|
return DEFAULT_CUSTOM_XML;
|
|
28828
28834
|
}
|
|
28829
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.
|
|
28835
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.17") {
|
|
28830
28836
|
return {
|
|
28831
28837
|
type: "element",
|
|
28832
28838
|
name: "property",
|
|
@@ -33749,6 +33755,7 @@ const splitListItem = () => (props) => {
|
|
|
33749
33755
|
const paraOffset = $from.parentOffset;
|
|
33750
33756
|
const beforeCursor = paragraphNode.content.cut(0, paraOffset);
|
|
33751
33757
|
const afterCursor = paragraphNode.content.cut(paraOffset);
|
|
33758
|
+
let firstList, secondList;
|
|
33752
33759
|
const listItemHasMultipleParagraphs = listItemNode.childCount > 1;
|
|
33753
33760
|
if (listItemHasMultipleParagraphs) {
|
|
33754
33761
|
const paragraphIndex = $from.index(-1);
|
|
@@ -33786,19 +33793,19 @@ const splitListItem = () => (props) => {
|
|
|
33786
33793
|
{ ...listItemNode.attrs },
|
|
33787
33794
|
Fragment.from(firstListContent)
|
|
33788
33795
|
);
|
|
33789
|
-
|
|
33796
|
+
firstList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(firstListItem));
|
|
33790
33797
|
const secondListItem = editor.schema.nodes.listItem.create(
|
|
33791
33798
|
{ ...listItemNode.attrs },
|
|
33792
33799
|
Fragment.from(secondListContent)
|
|
33793
33800
|
);
|
|
33794
|
-
|
|
33801
|
+
secondList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(secondListItem));
|
|
33795
33802
|
} else {
|
|
33796
33803
|
const firstParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, beforeCursor);
|
|
33797
33804
|
const firstListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, firstParagraph);
|
|
33798
|
-
|
|
33805
|
+
firstList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(firstListItem));
|
|
33799
33806
|
const secondParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, afterCursor);
|
|
33800
33807
|
const secondListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, secondParagraph);
|
|
33801
|
-
|
|
33808
|
+
secondList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(secondListItem));
|
|
33802
33809
|
}
|
|
33803
33810
|
if (!firstList || !secondList) return false;
|
|
33804
33811
|
const listStart = matchedParentList.pos;
|
|
@@ -34507,7 +34514,7 @@ function posFromCaret(view, node2, offset2, coords) {
|
|
|
34507
34514
|
return null;
|
|
34508
34515
|
if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) && // Ignore elements with zero-size bounding rectangles
|
|
34509
34516
|
((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {
|
|
34510
|
-
if (desc.node.isBlock && desc.parent) {
|
|
34517
|
+
if (desc.node.isBlock && desc.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(desc.dom.nodeName)) {
|
|
34511
34518
|
if (!sawBlock && rect.left > coords.left || rect.top > coords.top)
|
|
34512
34519
|
outsideBlock = desc.posBefore;
|
|
34513
34520
|
else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top)
|
|
@@ -38535,7 +38542,7 @@ function ruleFromNode(dom) {
|
|
|
38535
38542
|
}
|
|
38536
38543
|
return null;
|
|
38537
38544
|
}
|
|
38538
|
-
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;
|
|
38545
|
+
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;
|
|
38539
38546
|
function readDOMChange(view, from2, to, typeOver, addedNodes) {
|
|
38540
38547
|
let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);
|
|
38541
38548
|
view.input.compositionPendingChanges = 0;
|
|
@@ -42306,7 +42313,6 @@ const createHeaderFooterEditor = ({
|
|
|
42306
42313
|
});
|
|
42307
42314
|
if (appendToBody) document.body.appendChild(editorContainer);
|
|
42308
42315
|
const headerFooterEditor = new Editor({
|
|
42309
|
-
documentMode: editor.options.documentMode,
|
|
42310
42316
|
role: editor.options.role,
|
|
42311
42317
|
loadFromSchema: true,
|
|
42312
42318
|
mode: "docx",
|
|
@@ -44068,7 +44074,7 @@ const shouldMigrateList = (listItem) => {
|
|
|
44068
44074
|
if (firstChild && firstChild.type.name === "listItem") {
|
|
44069
44075
|
const { attrs } = firstChild;
|
|
44070
44076
|
const { level, listNumberingType } = attrs || {};
|
|
44071
|
-
if (typeof level ===
|
|
44077
|
+
if (typeof level === "undefined" || !listNumberingType) {
|
|
44072
44078
|
return true;
|
|
44073
44079
|
}
|
|
44074
44080
|
const childContent = firstChild?.content?.content;
|
|
@@ -44923,9 +44929,9 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
44923
44929
|
* @returns {boolean} Whether migrations are needed
|
|
44924
44930
|
*/
|
|
44925
44931
|
static checkIfMigrationsNeeded(data) {
|
|
44926
|
-
|
|
44927
|
-
const migrations = getNecessaryMigrations(
|
|
44928
|
-
console.debug("[checkVersionMigrations] Migrations needed:",
|
|
44932
|
+
const dataVersion = version || "initial";
|
|
44933
|
+
const migrations = getNecessaryMigrations(dataVersion) || [];
|
|
44934
|
+
console.debug("[checkVersionMigrations] Migrations needed:", dataVersion, migrations.length);
|
|
44929
44935
|
return migrations.length > 0;
|
|
44930
44936
|
}
|
|
44931
44937
|
/**
|
|
@@ -44933,7 +44939,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
44933
44939
|
* @returns {Object | void} Migration results
|
|
44934
44940
|
*/
|
|
44935
44941
|
processCollaborationMigrations() {
|
|
44936
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.
|
|
44942
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.17");
|
|
44937
44943
|
if (!this.options.ydoc) return;
|
|
44938
44944
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
44939
44945
|
let docVersion = metaMap.get("version");
|
|
@@ -45254,6 +45260,7 @@ createConverter_fn = function() {
|
|
|
45254
45260
|
}
|
|
45255
45261
|
};
|
|
45256
45262
|
initMedia_fn = function() {
|
|
45263
|
+
if (this.options.isChildEditor) return;
|
|
45257
45264
|
if (!this.options.ydoc) return this.storage.image.media = this.options.mediaFiles;
|
|
45258
45265
|
const mediaMap = this.options.ydoc.getMap("media");
|
|
45259
45266
|
if (this.options.isNewFile) {
|
|
@@ -45367,6 +45374,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
45367
45374
|
if (!this.options.isNewFile) {
|
|
45368
45375
|
this.initPagination();
|
|
45369
45376
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
45377
|
+
updateYdocDocxData(this);
|
|
45370
45378
|
}
|
|
45371
45379
|
};
|
|
45372
45380
|
initComments_fn = function() {
|
|
@@ -47486,7 +47494,6 @@ const ListItem = Node$1.create({
|
|
|
47486
47494
|
},
|
|
47487
47495
|
styleId: {
|
|
47488
47496
|
rendered: false,
|
|
47489
|
-
keepOnSplit: true,
|
|
47490
47497
|
keepOnSplit: true
|
|
47491
47498
|
},
|
|
47492
47499
|
customFormat: {
|
|
@@ -51986,7 +51993,7 @@ const FieldAnnotation = Node$1.create({
|
|
|
51986
51993
|
...node2.attrs,
|
|
51987
51994
|
// reset displayLabel to default.
|
|
51988
51995
|
displayLabel,
|
|
51989
|
-
// reset attrs
|
|
51996
|
+
// reset attrs for specific types.
|
|
51990
51997
|
imageSrc: null,
|
|
51991
51998
|
rawHtml: null,
|
|
51992
51999
|
linkUrl: null
|
|
@@ -7494,7 +7494,6 @@ function require_stream_duplex() {
|
|
|
7494
7494
|
}
|
|
7495
7495
|
var string_decoder = {};
|
|
7496
7496
|
var safeBuffer = { exports: {} };
|
|
7497
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
7498
7497
|
var hasRequiredSafeBuffer;
|
|
7499
7498
|
function requireSafeBuffer() {
|
|
7500
7499
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
@@ -7516,7 +7515,6 @@ function requireSafeBuffer() {
|
|
|
7516
7515
|
function SafeBuffer(arg, encodingOrOffset, length2) {
|
|
7517
7516
|
return Buffer3(arg, encodingOrOffset, length2);
|
|
7518
7517
|
}
|
|
7519
|
-
SafeBuffer.prototype = Object.create(Buffer3.prototype);
|
|
7520
7518
|
copyProps(Buffer3, SafeBuffer);
|
|
7521
7519
|
SafeBuffer.from = function(arg, encodingOrOffset, length2) {
|
|
7522
7520
|
if (typeof arg === "number") {
|
|
@@ -26379,7 +26377,7 @@ class DocxExporter {
|
|
|
26379
26377
|
}
|
|
26380
26378
|
}
|
|
26381
26379
|
_DocxExporter_instances = /* @__PURE__ */ new WeakSet();
|
|
26382
|
-
generate_xml_as_list_fn = function(data, debug =
|
|
26380
|
+
generate_xml_as_list_fn = function(data, debug = false) {
|
|
26383
26381
|
const json = JSON.parse(JSON.stringify(data));
|
|
26384
26382
|
const declaration = this.converter.declaration.attributes;
|
|
26385
26383
|
const xmlTag = `<?xml${Object.entries(declaration).map(([key, value]) => ` ${key}="${value}"`).join("")}?>`;
|
|
@@ -27016,6 +27014,7 @@ function handleImageImport(node2, currentFileName, params2) {
|
|
|
27016
27014
|
const relationships = rels.elements.find((el) => el.name === "Relationships");
|
|
27017
27015
|
const { elements } = relationships;
|
|
27018
27016
|
const rel = elements.find((el) => el.attributes["Id"] === rEmbed);
|
|
27017
|
+
if (!rel) return null;
|
|
27019
27018
|
const { attributes: relAttributes } = rel;
|
|
27020
27019
|
const path = `word/${relAttributes["Target"]}`;
|
|
27021
27020
|
return {
|
|
@@ -28240,11 +28239,18 @@ function getNumberingDefinitions(docx) {
|
|
|
28240
28239
|
const abstractId = Number(el.attributes["w:abstractNumId"]);
|
|
28241
28240
|
abstractDefinitions[abstractId] = el;
|
|
28242
28241
|
});
|
|
28243
|
-
|
|
28242
|
+
let importListDefs = {};
|
|
28244
28243
|
definitions.forEach((el) => {
|
|
28245
28244
|
const numId = Number(el.attributes["w:numId"]);
|
|
28246
28245
|
importListDefs[numId] = el;
|
|
28247
28246
|
});
|
|
28247
|
+
const listDefsEntries = Object.entries(importListDefs);
|
|
28248
|
+
const foundByDurableId = listDefsEntries.filter(([_id, def]) => def.attributes?.["w16cid:durableId"] === "485517411");
|
|
28249
|
+
if (foundByDurableId.length > 1) {
|
|
28250
|
+
importListDefs = Object.fromEntries(
|
|
28251
|
+
listDefsEntries.filter(([_id, def]) => def.attributes?.["w16cid:durableId"] !== "485517411")
|
|
28252
|
+
);
|
|
28253
|
+
}
|
|
28248
28254
|
return {
|
|
28249
28255
|
abstracts: abstractDefinitions,
|
|
28250
28256
|
definitions: importListDefs
|
|
@@ -28331,7 +28337,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
28331
28337
|
return;
|
|
28332
28338
|
}
|
|
28333
28339
|
}
|
|
28334
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.
|
|
28340
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.17") {
|
|
28335
28341
|
const customLocation = "docProps/custom.xml";
|
|
28336
28342
|
if (!docx[customLocation]) {
|
|
28337
28343
|
docx[customLocation] = generateCustomXml();
|
|
@@ -28809,7 +28815,7 @@ function storeSuperdocVersion(docx) {
|
|
|
28809
28815
|
function generateCustomXml() {
|
|
28810
28816
|
return DEFAULT_CUSTOM_XML;
|
|
28811
28817
|
}
|
|
28812
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.14.
|
|
28818
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.14.17") {
|
|
28813
28819
|
return {
|
|
28814
28820
|
type: "element",
|
|
28815
28821
|
name: "property",
|
|
@@ -33732,6 +33738,7 @@ const splitListItem = () => (props) => {
|
|
|
33732
33738
|
const paraOffset = $from.parentOffset;
|
|
33733
33739
|
const beforeCursor = paragraphNode.content.cut(0, paraOffset);
|
|
33734
33740
|
const afterCursor = paragraphNode.content.cut(paraOffset);
|
|
33741
|
+
let firstList, secondList;
|
|
33735
33742
|
const listItemHasMultipleParagraphs = listItemNode.childCount > 1;
|
|
33736
33743
|
if (listItemHasMultipleParagraphs) {
|
|
33737
33744
|
const paragraphIndex = $from.index(-1);
|
|
@@ -33769,19 +33776,19 @@ const splitListItem = () => (props) => {
|
|
|
33769
33776
|
{ ...listItemNode.attrs },
|
|
33770
33777
|
Fragment.from(firstListContent)
|
|
33771
33778
|
);
|
|
33772
|
-
|
|
33779
|
+
firstList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(firstListItem));
|
|
33773
33780
|
const secondListItem = editor.schema.nodes.listItem.create(
|
|
33774
33781
|
{ ...listItemNode.attrs },
|
|
33775
33782
|
Fragment.from(secondListContent)
|
|
33776
33783
|
);
|
|
33777
|
-
|
|
33784
|
+
secondList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(secondListItem));
|
|
33778
33785
|
} else {
|
|
33779
33786
|
const firstParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, beforeCursor);
|
|
33780
33787
|
const firstListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, firstParagraph);
|
|
33781
|
-
|
|
33788
|
+
firstList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(firstListItem));
|
|
33782
33789
|
const secondParagraph = editor.schema.nodes.paragraph.create(paragraphNode.attrs, afterCursor);
|
|
33783
33790
|
const secondListItem = editor.schema.nodes.listItem.create({ ...listItemNode.attrs }, secondParagraph);
|
|
33784
|
-
|
|
33791
|
+
secondList = editor.schema.nodes.orderedList.createAndFill(parentListNode.attrs, Fragment.from(secondListItem));
|
|
33785
33792
|
}
|
|
33786
33793
|
if (!firstList || !secondList) return false;
|
|
33787
33794
|
const listStart = matchedParentList.pos;
|
|
@@ -34490,7 +34497,7 @@ function posFromCaret(view, node2, offset2, coords) {
|
|
|
34490
34497
|
return null;
|
|
34491
34498
|
if (desc.dom.nodeType == 1 && (desc.node.isBlock && desc.parent || !desc.contentDOM) && // Ignore elements with zero-size bounding rectangles
|
|
34492
34499
|
((rect = desc.dom.getBoundingClientRect()).width || rect.height)) {
|
|
34493
|
-
if (desc.node.isBlock && desc.parent) {
|
|
34500
|
+
if (desc.node.isBlock && desc.parent && !/^T(R|BODY|HEAD|FOOT)$/.test(desc.dom.nodeName)) {
|
|
34494
34501
|
if (!sawBlock && rect.left > coords.left || rect.top > coords.top)
|
|
34495
34502
|
outsideBlock = desc.posBefore;
|
|
34496
34503
|
else if (!sawBlock && rect.right < coords.left || rect.bottom < coords.top)
|
|
@@ -38518,7 +38525,7 @@ function ruleFromNode(dom) {
|
|
|
38518
38525
|
}
|
|
38519
38526
|
return null;
|
|
38520
38527
|
}
|
|
38521
|
-
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;
|
|
38528
|
+
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;
|
|
38522
38529
|
function readDOMChange(view, from2, to, typeOver, addedNodes) {
|
|
38523
38530
|
let compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);
|
|
38524
38531
|
view.input.compositionPendingChanges = 0;
|
|
@@ -42289,7 +42296,6 @@ const createHeaderFooterEditor = ({
|
|
|
42289
42296
|
});
|
|
42290
42297
|
if (appendToBody) document.body.appendChild(editorContainer);
|
|
42291
42298
|
const headerFooterEditor = new Editor({
|
|
42292
|
-
documentMode: editor.options.documentMode,
|
|
42293
42299
|
role: editor.options.role,
|
|
42294
42300
|
loadFromSchema: true,
|
|
42295
42301
|
mode: "docx",
|
|
@@ -44051,7 +44057,7 @@ const shouldMigrateList = (listItem) => {
|
|
|
44051
44057
|
if (firstChild && firstChild.type.name === "listItem") {
|
|
44052
44058
|
const { attrs } = firstChild;
|
|
44053
44059
|
const { level, listNumberingType } = attrs || {};
|
|
44054
|
-
if (typeof level ===
|
|
44060
|
+
if (typeof level === "undefined" || !listNumberingType) {
|
|
44055
44061
|
return true;
|
|
44056
44062
|
}
|
|
44057
44063
|
const childContent = firstChild?.content?.content;
|
|
@@ -44906,9 +44912,9 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
44906
44912
|
* @returns {boolean} Whether migrations are needed
|
|
44907
44913
|
*/
|
|
44908
44914
|
static checkIfMigrationsNeeded(data) {
|
|
44909
|
-
|
|
44910
|
-
const migrations = getNecessaryMigrations(
|
|
44911
|
-
console.debug("[checkVersionMigrations] Migrations needed:",
|
|
44915
|
+
const dataVersion = version || "initial";
|
|
44916
|
+
const migrations = getNecessaryMigrations(dataVersion) || [];
|
|
44917
|
+
console.debug("[checkVersionMigrations] Migrations needed:", dataVersion, migrations.length);
|
|
44912
44918
|
return migrations.length > 0;
|
|
44913
44919
|
}
|
|
44914
44920
|
/**
|
|
@@ -44916,7 +44922,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
44916
44922
|
* @returns {Object | void} Migration results
|
|
44917
44923
|
*/
|
|
44918
44924
|
processCollaborationMigrations() {
|
|
44919
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.14.
|
|
44925
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.14.17");
|
|
44920
44926
|
if (!this.options.ydoc) return;
|
|
44921
44927
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
44922
44928
|
let docVersion = metaMap.get("version");
|
|
@@ -45237,6 +45243,7 @@ createConverter_fn = function() {
|
|
|
45237
45243
|
}
|
|
45238
45244
|
};
|
|
45239
45245
|
initMedia_fn = function() {
|
|
45246
|
+
if (this.options.isChildEditor) return;
|
|
45240
45247
|
if (!this.options.ydoc) return this.storage.image.media = this.options.mediaFiles;
|
|
45241
45248
|
const mediaMap = this.options.ydoc.getMap("media");
|
|
45242
45249
|
if (this.options.isNewFile) {
|
|
@@ -45350,6 +45357,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
|
|
|
45350
45357
|
if (!this.options.isNewFile) {
|
|
45351
45358
|
this.initPagination();
|
|
45352
45359
|
__privateMethod$1(this, _Editor_instances, initComments_fn).call(this);
|
|
45360
|
+
updateYdocDocxData(this);
|
|
45353
45361
|
}
|
|
45354
45362
|
};
|
|
45355
45363
|
initComments_fn = function() {
|
|
@@ -47469,7 +47477,6 @@ const ListItem = Node$1.create({
|
|
|
47469
47477
|
},
|
|
47470
47478
|
styleId: {
|
|
47471
47479
|
rendered: false,
|
|
47472
|
-
keepOnSplit: true,
|
|
47473
47480
|
keepOnSplit: true
|
|
47474
47481
|
},
|
|
47475
47482
|
customFormat: {
|
|
@@ -51969,7 +51976,7 @@ const FieldAnnotation = Node$1.create({
|
|
|
51969
51976
|
...node2.attrs,
|
|
51970
51977
|
// reset displayLabel to default.
|
|
51971
51978
|
displayLabel,
|
|
51972
|
-
// reset attrs
|
|
51979
|
+
// reset attrs for specific types.
|
|
51973
51980
|
imageSrc: null,
|
|
51974
51981
|
rawHtml: null,
|
|
51975
51982
|
linkUrl: null
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as commonjsGlobal, g as getDefaultExportFromCjs, a as getAugmentedNamespace } from "./jszip-BwJb6_S5.es.js";
|
|
2
|
-
import {
|
|
2
|
+
import { r as requireType, a as requireGetIntrinsic, b as requireCallBound } from "./xml-js-BC-eqb4d.es.js";
|
|
3
3
|
import { _ as __viteBrowserExternal } from "./__vite-browser-external-CURh0WXD.es.js";
|
|
4
4
|
var punycode$2 = { 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-DWfnW2xV.cjs");
|
|
3
|
-
const xmlJs = require("./xml-js-
|
|
3
|
+
const xmlJs = require("./xml-js-D24l3ypz.cjs");
|
|
4
4
|
const __viteBrowserExternal = require("./__vite-browser-external-DWbQq7bv.cjs");
|
|
5
5
|
var punycode$2 = { exports: {} };
|
|
6
6
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|