@superdoc-dev/cli 0.14.0-next.4 → 0.14.0-next.5
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/index.js +174 -60
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1916,7 +1916,7 @@ More content with **bold** and *italic*.`
|
|
|
1916
1916
|
idempotency: "conditional",
|
|
1917
1917
|
supportsDryRun: true,
|
|
1918
1918
|
supportsTrackedMode: true,
|
|
1919
|
-
possibleFailureCodes: ["INVALID_TARGET"],
|
|
1919
|
+
possibleFailureCodes: ["INVALID_TARGET", "NO_OP"],
|
|
1920
1920
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET", "INVALID_INPUT", ...T_STORY]
|
|
1921
1921
|
}),
|
|
1922
1922
|
referenceDocPath: "format/apply.mdx",
|
|
@@ -1989,7 +1989,7 @@ More content with **bold** and *italic*.`
|
|
|
1989
1989
|
idempotency: "conditional",
|
|
1990
1990
|
supportsDryRun: true,
|
|
1991
1991
|
supportsTrackedMode: true,
|
|
1992
|
-
possibleFailureCodes: ["INVALID_TARGET"],
|
|
1992
|
+
possibleFailureCodes: ["INVALID_TARGET", "NO_OP"],
|
|
1993
1993
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET", "INVALID_INPUT", ...T_STORY]
|
|
1994
1994
|
}),
|
|
1995
1995
|
referenceDocPath: "format/apply.mdx",
|
|
@@ -67793,7 +67793,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
67793
67793
|
emptyOptions2 = {};
|
|
67794
67794
|
});
|
|
67795
67795
|
|
|
67796
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
67796
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-DZZ9HhoA.es.js
|
|
67797
67797
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
67798
67798
|
const fieldValue = extension$1.config[field];
|
|
67799
67799
|
if (typeof fieldValue === "function")
|
|
@@ -121870,12 +121870,12 @@ var isRegExp = (value) => {
|
|
|
121870
121870
|
return text$2;
|
|
121871
121871
|
return String(text$2).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
121872
121872
|
}
|
|
121873
|
-
#generateXml(node3) {
|
|
121873
|
+
#generateXml(node3, insideDeletion = false) {
|
|
121874
121874
|
if (!node3)
|
|
121875
121875
|
return null;
|
|
121876
121876
|
let { name } = node3;
|
|
121877
121877
|
const { elements, attributes } = node3;
|
|
121878
|
-
if (name === "w:delInstrText")
|
|
121878
|
+
if (name === "w:delInstrText" && !insideDeletion)
|
|
121879
121879
|
name = "w:instrText";
|
|
121880
121880
|
let tag = `<${name}`;
|
|
121881
121881
|
for (let attr in attributes) {
|
|
@@ -121890,8 +121890,9 @@ var isRegExp = (value) => {
|
|
|
121890
121890
|
let tags = [tag];
|
|
121891
121891
|
if (!name && node3.type === "text")
|
|
121892
121892
|
return this.#replaceSpecialCharacters(node3.text ?? "");
|
|
121893
|
+
const nextInsideDeletion = insideDeletion || name === "w:del";
|
|
121893
121894
|
if (elements) {
|
|
121894
|
-
if (name === "w:instrText") {
|
|
121895
|
+
if (name === "w:instrText" || name === "w:delInstrText") {
|
|
121895
121896
|
const textContent = (elements || []).map((child) => typeof child?.text === "string" ? child.text : "").join("");
|
|
121896
121897
|
tags.push(this.#replaceSpecialCharacters(textContent));
|
|
121897
121898
|
} else if (name === "w:t" || name === "w:delText" || name === "wp:posOffset")
|
|
@@ -121907,7 +121908,7 @@ var isRegExp = (value) => {
|
|
|
121907
121908
|
}
|
|
121908
121909
|
else if (elements)
|
|
121909
121910
|
for (let child of elements) {
|
|
121910
|
-
const newElements = this.#generateXml(child);
|
|
121911
|
+
const newElements = this.#generateXml(child, nextInsideDeletion);
|
|
121911
121912
|
if (!newElements)
|
|
121912
121913
|
continue;
|
|
121913
121914
|
if (typeof newElements === "string") {
|
|
@@ -122658,7 +122659,7 @@ var isRegExp = (value) => {
|
|
|
122658
122659
|
state.kern = kernNode.attributes["w:val"];
|
|
122659
122660
|
}
|
|
122660
122661
|
}, SuperConverter;
|
|
122661
|
-
var
|
|
122662
|
+
var init_SuperConverter_DZZ9HhoA_es = __esm(() => {
|
|
122662
122663
|
init_rolldown_runtime_Bg48TavK_es();
|
|
122663
122664
|
init_jszip_C49i9kUs_es();
|
|
122664
122665
|
init_xml_js_CqGKpaft_es();
|
|
@@ -125939,7 +125940,7 @@ var init_SuperConverter_BzpaXL4Z_es = __esm(() => {
|
|
|
125939
125940
|
idempotency: "conditional",
|
|
125940
125941
|
supportsDryRun: true,
|
|
125941
125942
|
supportsTrackedMode: true,
|
|
125942
|
-
possibleFailureCodes: ["INVALID_TARGET"],
|
|
125943
|
+
possibleFailureCodes: ["INVALID_TARGET", "NO_OP"],
|
|
125943
125944
|
throws: [
|
|
125944
125945
|
...T_NOT_FOUND_CAPABLE2,
|
|
125945
125946
|
"INVALID_TARGET",
|
|
@@ -126015,7 +126016,7 @@ var init_SuperConverter_BzpaXL4Z_es = __esm(() => {
|
|
|
126015
126016
|
idempotency: "conditional",
|
|
126016
126017
|
supportsDryRun: true,
|
|
126017
126018
|
supportsTrackedMode: true,
|
|
126018
|
-
possibleFailureCodes: ["INVALID_TARGET"],
|
|
126019
|
+
possibleFailureCodes: ["INVALID_TARGET", "NO_OP"],
|
|
126019
126020
|
throws: [
|
|
126020
126021
|
...T_NOT_FOUND_CAPABLE2,
|
|
126021
126022
|
"INVALID_TARGET",
|
|
@@ -160972,7 +160973,7 @@ var init_SuperConverter_BzpaXL4Z_es = __esm(() => {
|
|
|
160972
160973
|
};
|
|
160973
160974
|
});
|
|
160974
160975
|
|
|
160975
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
160976
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-DMKUCLlb.es.js
|
|
160976
160977
|
function parseSizeUnit(val = "0") {
|
|
160977
160978
|
const length3 = val.toString() || "0";
|
|
160978
160979
|
const value = Number.parseFloat(length3);
|
|
@@ -171204,8 +171205,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
171204
171205
|
}
|
|
171205
171206
|
};
|
|
171206
171207
|
};
|
|
171207
|
-
var
|
|
171208
|
-
|
|
171208
|
+
var init_create_headless_toolbar_DMKUCLlb_es = __esm(() => {
|
|
171209
|
+
init_SuperConverter_DZZ9HhoA_es();
|
|
171209
171210
|
init_uuid_qzgm05fK_es();
|
|
171210
171211
|
init_constants_DrU4EASo_es();
|
|
171211
171212
|
init_dist_B8HfvhaK_es();
|
|
@@ -220415,7 +220416,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
220415
220416
|
init_remark_gfm_BhnWr3yf_es();
|
|
220416
220417
|
});
|
|
220417
220418
|
|
|
220418
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
220419
|
+
// ../../packages/superdoc/dist/chunks/src-DC1U6aZu.es.js
|
|
220419
220420
|
function deleteProps(obj, propOrProps) {
|
|
220420
220421
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
220421
220422
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -230148,6 +230149,64 @@ function recordDeletedValue(value, path2, diff, ignoreKeys) {
|
|
|
230148
230149
|
function joinPath(base5, key2) {
|
|
230149
230150
|
return base5 ? `${base5}.${key2}` : key2;
|
|
230150
230151
|
}
|
|
230152
|
+
function applyAttrsDiff(baseAttrs, attrsDiff) {
|
|
230153
|
+
const result = cloneAttrs(baseAttrs ?? {});
|
|
230154
|
+
if (!attrsDiff)
|
|
230155
|
+
return result;
|
|
230156
|
+
for (const [path2, value] of Object.entries(attrsDiff.added ?? {}))
|
|
230157
|
+
setAtPath(result, path2, value);
|
|
230158
|
+
for (const [path2, change] of Object.entries(attrsDiff.modified ?? {}))
|
|
230159
|
+
setAtPath(result, path2, change.to);
|
|
230160
|
+
for (const path2 of Object.keys(attrsDiff.deleted ?? {}))
|
|
230161
|
+
deleteAtPath(result, path2);
|
|
230162
|
+
return result;
|
|
230163
|
+
}
|
|
230164
|
+
function cloneAttrs(value) {
|
|
230165
|
+
if (!isPlainObject$4(value))
|
|
230166
|
+
return {};
|
|
230167
|
+
const clone = {};
|
|
230168
|
+
for (const [key2, child] of Object.entries(value))
|
|
230169
|
+
clone[key2] = cloneDeep(child);
|
|
230170
|
+
return clone;
|
|
230171
|
+
}
|
|
230172
|
+
function cloneDeep(value) {
|
|
230173
|
+
if (Array.isArray(value))
|
|
230174
|
+
return value.map(cloneDeep);
|
|
230175
|
+
if (isPlainObject$4(value)) {
|
|
230176
|
+
const clone = {};
|
|
230177
|
+
for (const [key2, child] of Object.entries(value))
|
|
230178
|
+
clone[key2] = cloneDeep(child);
|
|
230179
|
+
return clone;
|
|
230180
|
+
}
|
|
230181
|
+
return value;
|
|
230182
|
+
}
|
|
230183
|
+
function splitPath(path2) {
|
|
230184
|
+
return path2.split(".");
|
|
230185
|
+
}
|
|
230186
|
+
function setAtPath(target, path2, value) {
|
|
230187
|
+
const segments = splitPath(path2);
|
|
230188
|
+
let cursor = target;
|
|
230189
|
+
for (let i4 = 0;i4 < segments.length - 1; i4++) {
|
|
230190
|
+
const key2 = segments[i4];
|
|
230191
|
+
const next2 = cursor[key2];
|
|
230192
|
+
if (!isPlainObject$4(next2))
|
|
230193
|
+
cursor[key2] = {};
|
|
230194
|
+
cursor = cursor[key2];
|
|
230195
|
+
}
|
|
230196
|
+
cursor[segments[segments.length - 1]] = cloneDeep(value);
|
|
230197
|
+
}
|
|
230198
|
+
function deleteAtPath(target, path2) {
|
|
230199
|
+
const segments = splitPath(path2);
|
|
230200
|
+
let cursor = target;
|
|
230201
|
+
for (let i4 = 0;i4 < segments.length - 1; i4++) {
|
|
230202
|
+
const key2 = segments[i4];
|
|
230203
|
+
const next2 = cursor[key2];
|
|
230204
|
+
if (!isPlainObject$4(next2))
|
|
230205
|
+
return;
|
|
230206
|
+
cursor = next2;
|
|
230207
|
+
}
|
|
230208
|
+
delete cursor[segments[segments.length - 1]];
|
|
230209
|
+
}
|
|
230151
230210
|
function isPlainObject$4(value) {
|
|
230152
230211
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
230153
230212
|
}
|
|
@@ -230182,7 +230241,10 @@ function omitKeys(attrs, keysToOmit) {
|
|
|
230182
230241
|
return result;
|
|
230183
230242
|
}
|
|
230184
230243
|
function normalizeParagraphAttrs(attrs) {
|
|
230185
|
-
return omitKeys(attrs,
|
|
230244
|
+
return omitKeys(attrs, NON_SEMANTIC_BLOCK_ATTRS);
|
|
230245
|
+
}
|
|
230246
|
+
function normalizeBlockAttrs(attrs) {
|
|
230247
|
+
return omitKeys(attrs, NON_SEMANTIC_BLOCK_ATTRS);
|
|
230186
230248
|
}
|
|
230187
230249
|
function normalizeImageNodeJSON(nodeJSON) {
|
|
230188
230250
|
const attrs = nodeJSON.attrs;
|
|
@@ -230247,14 +230309,54 @@ function normalizeDocJSON(docJSON) {
|
|
|
230247
230309
|
function normalizeDocNodeJSON(nodeJSON) {
|
|
230248
230310
|
if (nodeJSON.type === "paragraph")
|
|
230249
230311
|
return normalizeParagraphNodeJSON(nodeJSON);
|
|
230312
|
+
const attrs = nodeJSON.attrs;
|
|
230250
230313
|
const content3 = nodeJSON.content;
|
|
230314
|
+
const normalizedAttrs = attrs ? normalizeBlockAttrs(attrs) : undefined;
|
|
230251
230315
|
if (content3)
|
|
230252
230316
|
return {
|
|
230253
230317
|
...nodeJSON,
|
|
230318
|
+
...normalizedAttrs ? { attrs: normalizedAttrs } : {},
|
|
230254
230319
|
content: content3.map(normalizeDocNodeJSON)
|
|
230255
230320
|
};
|
|
230321
|
+
if (normalizedAttrs)
|
|
230322
|
+
return {
|
|
230323
|
+
...nodeJSON,
|
|
230324
|
+
attrs: normalizedAttrs
|
|
230325
|
+
};
|
|
230326
|
+
return nodeJSON;
|
|
230327
|
+
}
|
|
230328
|
+
function normalizeParagraphAttrsLegacy(attrs) {
|
|
230329
|
+
return omitKeys(attrs, LEGACY_VOLATILE_PARAGRAPH_ATTRS);
|
|
230330
|
+
}
|
|
230331
|
+
function normalizeParagraphNodeJSONLegacy(nodeJSON) {
|
|
230332
|
+
const attrs = nodeJSON.attrs ?? {};
|
|
230333
|
+
const content3 = nodeJSON.content;
|
|
230334
|
+
return {
|
|
230335
|
+
...nodeJSON,
|
|
230336
|
+
attrs: normalizeParagraphAttrsLegacy(attrs),
|
|
230337
|
+
...content3 ? { content: content3.map(normalizeContentNodeJSON) } : {}
|
|
230338
|
+
};
|
|
230339
|
+
}
|
|
230340
|
+
function normalizeDocNodeJSONLegacy(nodeJSON) {
|
|
230341
|
+
if (nodeJSON.type === "paragraph")
|
|
230342
|
+
return normalizeParagraphNodeJSONLegacy(nodeJSON);
|
|
230343
|
+
const content3 = nodeJSON.content;
|
|
230344
|
+
if (content3)
|
|
230345
|
+
return {
|
|
230346
|
+
...nodeJSON,
|
|
230347
|
+
content: content3.map(normalizeDocNodeJSONLegacy)
|
|
230348
|
+
};
|
|
230256
230349
|
return nodeJSON;
|
|
230257
230350
|
}
|
|
230351
|
+
function normalizeDocJSONLegacy(docJSON) {
|
|
230352
|
+
const content3 = docJSON.content;
|
|
230353
|
+
if (!content3)
|
|
230354
|
+
return docJSON;
|
|
230355
|
+
return {
|
|
230356
|
+
...docJSON,
|
|
230357
|
+
content: content3.map(normalizeDocNodeJSONLegacy)
|
|
230358
|
+
};
|
|
230359
|
+
}
|
|
230258
230360
|
function diffSequences(oldSeq, newSeq, options) {
|
|
230259
230361
|
if (!options)
|
|
230260
230362
|
throw new Error("diffSequences requires an options object.");
|
|
@@ -230814,7 +230916,7 @@ function buildDeletedDiff(nodeInfo, deletedNodesSet) {
|
|
|
230814
230916
|
function buildModifiedDiff(oldNodeInfo, newNodeInfo) {
|
|
230815
230917
|
if (isParagraphNodeInfo(oldNodeInfo) && isParagraphNodeInfo(newNodeInfo))
|
|
230816
230918
|
return buildModifiedParagraphDiff(oldNodeInfo, newNodeInfo);
|
|
230817
|
-
const attrsDiff = getAttributesDiff(oldNodeInfo.node.attrs, newNodeInfo.node.attrs);
|
|
230919
|
+
const attrsDiff = getAttributesDiff(oldNodeInfo.node.attrs, newNodeInfo.node.attrs, NON_PARAGRAPH_BLOCK_IGNORED_ATTRS);
|
|
230818
230920
|
if (!attrsDiff)
|
|
230819
230921
|
return null;
|
|
230820
230922
|
return {
|
|
@@ -231388,12 +231490,9 @@ function replayNonParagraphDiff({ tr, diff, schema }) {
|
|
|
231388
231490
|
skipWithWarning(`Node type mismatch at pos ${pos} for modification.`);
|
|
231389
231491
|
return result;
|
|
231390
231492
|
}
|
|
231391
|
-
if (!diff.newNodeJSON?.attrs) {
|
|
231392
|
-
skipWithWarning(`Missing newNodeJSON.attrs at pos ${pos} for modification.`);
|
|
231393
|
-
return result;
|
|
231394
|
-
}
|
|
231395
231493
|
try {
|
|
231396
|
-
|
|
231494
|
+
const mergedAttrs = applyAttrsDiff(node3.attrs, diff.attrsDiff);
|
|
231495
|
+
tr.setNodeMarkup(pos, undefined, mergedAttrs, node3.marks);
|
|
231397
231496
|
result.applied += 1;
|
|
231398
231497
|
return result;
|
|
231399
231498
|
} catch (error3) {
|
|
@@ -231404,7 +231503,7 @@ function replayNonParagraphDiff({ tr, diff, schema }) {
|
|
|
231404
231503
|
skipWithWarning(`Unsupported diff action for non-paragraph node at pos ${pos}.`);
|
|
231405
231504
|
return result;
|
|
231406
231505
|
}
|
|
231407
|
-
function applyAttrsDiff({ attrs, diff }) {
|
|
231506
|
+
function applyAttrsDiff$1({ attrs, diff }) {
|
|
231408
231507
|
const updated = JSON.parse(JSON.stringify(attrs ?? {}));
|
|
231409
231508
|
Object.entries(diff.added || {}).forEach(([path2, value]) => {
|
|
231410
231509
|
setNestedValue(updated, path2, value);
|
|
@@ -231682,19 +231781,15 @@ function replayParagraphDiff({ tr, diff, schema }) {
|
|
|
231682
231781
|
skipWithWarning(`Node type mismatch at pos ${pos} for paragraph modification.`);
|
|
231683
231782
|
return result;
|
|
231684
231783
|
}
|
|
231685
|
-
if (diff.attrsDiff)
|
|
231686
|
-
if (!diff.newNodeJSON?.attrs) {
|
|
231687
|
-
skipWithWarning(`Missing newNodeJSON attrs at pos ${pos} for paragraph modification.`);
|
|
231688
|
-
return result;
|
|
231689
|
-
}
|
|
231784
|
+
if (diff.attrsDiff)
|
|
231690
231785
|
try {
|
|
231691
|
-
|
|
231786
|
+
const mergedAttrs = applyAttrsDiff(node3.attrs, diff.attrsDiff);
|
|
231787
|
+
tr.setNodeMarkup(pos, undefined, mergedAttrs, node3.marks);
|
|
231692
231788
|
result.applied += 1;
|
|
231693
231789
|
} catch (error3) {
|
|
231694
231790
|
skipWithWarning(`Failed to update paragraph attrs at pos ${pos}.`);
|
|
231695
231791
|
return result;
|
|
231696
231792
|
}
|
|
231697
|
-
}
|
|
231698
231793
|
const paragraphEndPos = pos + 1 + node3.content.size;
|
|
231699
231794
|
const contentDiffs = [...diff.contentDiff ?? []].sort((a2, b$1) => {
|
|
231700
231795
|
const aPos = a2.startPos ?? paragraphEndPos;
|
|
@@ -248032,6 +248127,16 @@ function buildCanonicalDiffableState(doc$12, comments, styles, numbering, header
|
|
|
248032
248127
|
partsState: partsState ? structuredClone(partsState) : null
|
|
248033
248128
|
};
|
|
248034
248129
|
}
|
|
248130
|
+
function buildLegacyCanonicalDiffableState(doc$12, comments, styles, numbering, headerFooters, partsState) {
|
|
248131
|
+
return {
|
|
248132
|
+
body: normalizeDocJSONLegacy(doc$12.toJSON()),
|
|
248133
|
+
comments: comments.map(canonicalizeComment),
|
|
248134
|
+
styles: styles ? styles : null,
|
|
248135
|
+
numbering: numbering ? numbering : null,
|
|
248136
|
+
headerFooters: headerFooters ? structuredClone(headerFooters) : null,
|
|
248137
|
+
partsState: partsState ? structuredClone(partsState) : null
|
|
248138
|
+
};
|
|
248139
|
+
}
|
|
248035
248140
|
function sortKeysDeep(value) {
|
|
248036
248141
|
if (value === null || value === undefined)
|
|
248037
248142
|
return value;
|
|
@@ -248152,6 +248257,9 @@ function getEditorPartsState(editor, headerFooters) {
|
|
|
248152
248257
|
function buildCanonicalStateForCoverage(doc$12, comments, styles, numbering, headerFooters, partsState, coverage) {
|
|
248153
248258
|
return buildCanonicalDiffableState(doc$12, comments, styles, numbering, coverage.headerFooters ? headerFooters : null, coverage.headerFooters ? partsState : null);
|
|
248154
248259
|
}
|
|
248260
|
+
function buildLegacyCanonicalStateForCoverage(doc$12, comments, styles, numbering, headerFooters, partsState, coverage) {
|
|
248261
|
+
return buildLegacyCanonicalDiffableState(doc$12, comments, styles, numbering, coverage.headerFooters ? headerFooters : null, coverage.headerFooters ? partsState : null);
|
|
248262
|
+
}
|
|
248155
248263
|
function captureSnapshot(editor) {
|
|
248156
248264
|
const doc$12 = editor.state.doc;
|
|
248157
248265
|
const comments = getEditorComments(editor);
|
|
@@ -248196,8 +248304,10 @@ function compareToSnapshot(editor, targetSnapshot) {
|
|
|
248196
248304
|
throw err;
|
|
248197
248305
|
throw new DiffServiceError("INVALID_INPUT", `Snapshot payload contains malformed data that failed during canonicalization: ${err instanceof Error ? err.message : String(err)}`);
|
|
248198
248306
|
}
|
|
248199
|
-
if (reDerivedFingerprint !== targetSnapshot.fingerprint)
|
|
248200
|
-
|
|
248307
|
+
if (reDerivedFingerprint !== targetSnapshot.fingerprint) {
|
|
248308
|
+
if (computeFingerprint(buildLegacyCanonicalStateForCoverage(targetDoc, targetComments, targetStyles, targetNumbering, targetHeaderFooters, targetSnapshot.version === SNAPSHOT_VERSION_V2 ? targetPartsState : null, targetCoverage)) !== targetSnapshot.fingerprint)
|
|
248309
|
+
throw new DiffServiceError("INVALID_INPUT", `Target snapshot fingerprint does not match re-derived value. The snapshot may have been tampered with.`);
|
|
248310
|
+
}
|
|
248201
248311
|
const baseDoc = editor.state.doc;
|
|
248202
248312
|
const baseComments = getEditorComments(editor);
|
|
248203
248313
|
const baseStyles = getEditorStyles(editor);
|
|
@@ -248244,8 +248354,10 @@ function applyDiffPayload(editor, diffPayload, options) {
|
|
|
248244
248354
|
const baseHeaderFooters = getEditorHeaderFooters(editor);
|
|
248245
248355
|
const basePartsState = getEditorPartsState(editor, baseHeaderFooters);
|
|
248246
248356
|
const currentFingerprint = computeFingerprint(buildCanonicalStateForCoverage(baseDoc, baseComments, baseStyles, baseNumbering2, baseHeaderFooters, diffPayload.version === PAYLOAD_VERSION_V2 ? basePartsState : null, diffPayload.coverage));
|
|
248247
|
-
if (currentFingerprint !== diffPayload.baseFingerprint)
|
|
248248
|
-
|
|
248357
|
+
if (currentFingerprint !== diffPayload.baseFingerprint) {
|
|
248358
|
+
if (computeFingerprint(buildLegacyCanonicalStateForCoverage(baseDoc, baseComments, baseStyles, baseNumbering2, baseHeaderFooters, diffPayload.version === PAYLOAD_VERSION_V2 ? basePartsState : null, diffPayload.coverage)) !== diffPayload.baseFingerprint)
|
|
248359
|
+
throw new DiffServiceError("PRECONDITION_FAILED", `Document fingerprint mismatch. Expected "${diffPayload.baseFingerprint}", got "${currentFingerprint}". The document may have changed since the diff was computed. Re-run diff.compare against the current state.`);
|
|
248360
|
+
}
|
|
248249
248361
|
const rawDiff = parseDiffPayloadContents(diffPayload.payload);
|
|
248250
248362
|
const comments = editor.converter ? Array.isArray(editor.converter.comments) ? editor.converter.comments : [] : [];
|
|
248251
248363
|
const trackedRequested = options?.changeMode === "tracked";
|
|
@@ -293344,7 +293456,7 @@ var Node$13 = class Node$14 {
|
|
|
293344
293456
|
id: { default: null },
|
|
293345
293457
|
edGrp: { default: null },
|
|
293346
293458
|
displacedByCustomXml: { default: null }
|
|
293347
|
-
}), PermEnd, PermEndBlock, IGNORED_ATTRIBUTE_KEYS, TRACK_CHANGE_MARK_NAMES$1, TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS,
|
|
293459
|
+
}), PermEnd, PermEndBlock, IGNORED_ATTRIBUTE_KEYS, TRACK_CHANGE_MARK_NAMES$1, TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS, NON_SEMANTIC_BLOCK_ATTRS, VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS, LEGACY_VOLATILE_PARAGRAPH_ATTRS, SIMILARITY_THRESHOLD = 0.65, MIN_LENGTH_FOR_SIMILARITY = 4, NON_PARAGRAPH_BLOCK_IGNORED_ATTRS, COMMENT_ATTRS_DIFF_IGNORED_KEYS, SLOT_VARIANTS, PART_KINDS, DOCUMENT_RELS_PATH$2 = "word/_rels/document.xml.rels", DOCUMENT_RELS_PATH$1 = "word/_rels/document.xml.rels", BODY_RELATIONSHIP_EXCLUSIONS, setNestedValue = (target, path2, value) => {
|
|
293348
293460
|
if (!path2.includes(".")) {
|
|
293349
293461
|
target[path2] = value;
|
|
293350
293462
|
return;
|
|
@@ -293435,7 +293547,7 @@ var Node$13 = class Node$14 {
|
|
|
293435
293547
|
return { warning: `No run nodes found in ${from$1}-${to} for run-attr update.` };
|
|
293436
293548
|
const failures = [];
|
|
293437
293549
|
runEntries.forEach(({ pos, node: node3 }) => {
|
|
293438
|
-
const updatedAttrs = applyAttrsDiff({
|
|
293550
|
+
const updatedAttrs = applyAttrsDiff$1({
|
|
293439
293551
|
attrs: node3.attrs,
|
|
293440
293552
|
diff
|
|
293441
293553
|
});
|
|
@@ -317259,13 +317371,13 @@ menclose::after {
|
|
|
317259
317371
|
return;
|
|
317260
317372
|
console.log(...args$1);
|
|
317261
317373
|
}, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
|
|
317262
|
-
var
|
|
317374
|
+
var init_src_DC1U6aZu_es = __esm(() => {
|
|
317263
317375
|
init_rolldown_runtime_Bg48TavK_es();
|
|
317264
|
-
|
|
317376
|
+
init_SuperConverter_DZZ9HhoA_es();
|
|
317265
317377
|
init_jszip_C49i9kUs_es();
|
|
317266
317378
|
init_xml_js_CqGKpaft_es();
|
|
317267
317379
|
init_uuid_qzgm05fK_es();
|
|
317268
|
-
|
|
317380
|
+
init_create_headless_toolbar_DMKUCLlb_es();
|
|
317269
317381
|
init_constants_DrU4EASo_es();
|
|
317270
317382
|
init_dist_B8HfvhaK_es();
|
|
317271
317383
|
init_unified_Dsuw2be5_es();
|
|
@@ -332726,7 +332838,7 @@ ${err.toString()}`);
|
|
|
332726
332838
|
customizer = typeof customizer == "function" ? customizer : undefined$1;
|
|
332727
332839
|
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
|
|
332728
332840
|
}
|
|
332729
|
-
function cloneDeep(value) {
|
|
332841
|
+
function cloneDeep$1(value) {
|
|
332730
332842
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
332731
332843
|
}
|
|
332732
332844
|
function cloneDeepWith(value, customizer) {
|
|
@@ -333803,7 +333915,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
333803
333915
|
lodash.ceil = ceil;
|
|
333804
333916
|
lodash.clamp = clamp$2;
|
|
333805
333917
|
lodash.clone = clone;
|
|
333806
|
-
lodash.cloneDeep = cloneDeep;
|
|
333918
|
+
lodash.cloneDeep = cloneDeep$1;
|
|
333807
333919
|
lodash.cloneDeepWith = cloneDeepWith;
|
|
333808
333920
|
lodash.cloneWith = cloneWith;
|
|
333809
333921
|
lodash.conformsTo = conformsTo;
|
|
@@ -335986,7 +336098,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
335986
336098
|
"trackFormat"
|
|
335987
336099
|
]);
|
|
335988
336100
|
TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS = new Set(["id", "sourceId"]);
|
|
335989
|
-
|
|
336101
|
+
NON_SEMANTIC_BLOCK_ATTRS = new Set([
|
|
336102
|
+
"sdBlockId",
|
|
336103
|
+
"sdBlockRev",
|
|
335990
336104
|
"paraId",
|
|
335991
336105
|
"textId",
|
|
335992
336106
|
"rsidR",
|
|
@@ -335996,6 +336110,16 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
335996
336110
|
"rsidDel"
|
|
335997
336111
|
]);
|
|
335998
336112
|
VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS = new Set(["wp14:anchorId", "wp14:editId"]);
|
|
336113
|
+
LEGACY_VOLATILE_PARAGRAPH_ATTRS = new Set([
|
|
336114
|
+
"paraId",
|
|
336115
|
+
"textId",
|
|
336116
|
+
"rsidR",
|
|
336117
|
+
"rsidRDefault",
|
|
336118
|
+
"rsidP",
|
|
336119
|
+
"rsidRPr",
|
|
336120
|
+
"rsidDel"
|
|
336121
|
+
]);
|
|
336122
|
+
NON_PARAGRAPH_BLOCK_IGNORED_ATTRS = Array.from(NON_SEMANTIC_BLOCK_ATTRS);
|
|
335999
336123
|
COMMENT_ATTRS_DIFF_IGNORED_KEYS = [
|
|
336000
336124
|
"textJson",
|
|
336001
336125
|
"elements",
|
|
@@ -340782,17 +340906,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
340782
340906
|
headerRowFill: null
|
|
340783
340907
|
}
|
|
340784
340908
|
};
|
|
340785
|
-
IDENTITY_BLOCK_ATTRS =
|
|
340786
|
-
"sdBlockId",
|
|
340787
|
-
"sdBlockRev",
|
|
340788
|
-
"paraId",
|
|
340789
|
-
"textId",
|
|
340790
|
-
"rsidR",
|
|
340791
|
-
"rsidRDefault",
|
|
340792
|
-
"rsidP",
|
|
340793
|
-
"rsidRPr",
|
|
340794
|
-
"rsidDel"
|
|
340795
|
-
]);
|
|
340909
|
+
IDENTITY_BLOCK_ATTRS = NON_SEMANTIC_BLOCK_ATTRS;
|
|
340796
340910
|
WORD_DEFAULT_TBL_LOOK = {
|
|
340797
340911
|
firstRow: true,
|
|
340798
340912
|
lastRow: false,
|
|
@@ -351353,11 +351467,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
351353
351467
|
]);
|
|
351354
351468
|
});
|
|
351355
351469
|
|
|
351356
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
351470
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-DmQpJGyP.es.js
|
|
351357
351471
|
var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
|
|
351358
|
-
var
|
|
351359
|
-
|
|
351360
|
-
|
|
351472
|
+
var init_create_super_doc_ui_DmQpJGyP_es = __esm(() => {
|
|
351473
|
+
init_SuperConverter_DZZ9HhoA_es();
|
|
351474
|
+
init_create_headless_toolbar_DMKUCLlb_es();
|
|
351361
351475
|
MOD_ALIASES = new Set([
|
|
351362
351476
|
"Mod",
|
|
351363
351477
|
"Meta",
|
|
@@ -351399,16 +351513,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
351399
351513
|
|
|
351400
351514
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
351401
351515
|
var init_super_editor_es = __esm(() => {
|
|
351402
|
-
|
|
351403
|
-
|
|
351516
|
+
init_src_DC1U6aZu_es();
|
|
351517
|
+
init_SuperConverter_DZZ9HhoA_es();
|
|
351404
351518
|
init_jszip_C49i9kUs_es();
|
|
351405
351519
|
init_xml_js_CqGKpaft_es();
|
|
351406
|
-
|
|
351520
|
+
init_create_headless_toolbar_DMKUCLlb_es();
|
|
351407
351521
|
init_constants_DrU4EASo_es();
|
|
351408
351522
|
init_dist_B8HfvhaK_es();
|
|
351409
351523
|
init_unified_Dsuw2be5_es();
|
|
351410
351524
|
init_DocxZipper_CZMPWpOp_es();
|
|
351411
|
-
|
|
351525
|
+
init_create_super_doc_ui_DmQpJGyP_es();
|
|
351412
351526
|
init_ui_C5PAS9hY_es();
|
|
351413
351527
|
init_eventemitter3_BnGqBE_Q_es();
|
|
351414
351528
|
init_errors_CNaD6vcg_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.14.0-next.
|
|
3
|
+
"version": "0.14.0-next.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.14.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.14.0-next.
|
|
39
|
-
"@superdoc-dev/cli-
|
|
40
|
-
"@superdoc-dev/cli-
|
|
41
|
-
"@superdoc-dev/cli-linux-arm64": "0.14.0-next.
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.14.0-next.5",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.14.0-next.5",
|
|
39
|
+
"@superdoc-dev/cli-linux-x64": "0.14.0-next.5",
|
|
40
|
+
"@superdoc-dev/cli-windows-x64": "0.14.0-next.5",
|
|
41
|
+
"@superdoc-dev/cli-linux-arm64": "0.14.0-next.5"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|