@superdoc-dev/mcp 0.11.0-next.14 → 0.11.0-next.16
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 +363 -160
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -52211,7 +52211,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
52211
52211
|
emptyOptions2 = {};
|
|
52212
52212
|
});
|
|
52213
52213
|
|
|
52214
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
52214
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-DOoAJ6Zk.es.js
|
|
52215
52215
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
52216
52216
|
const fieldValue = extension$1.config[field];
|
|
52217
52217
|
if (typeof fieldValue === "function")
|
|
@@ -92420,6 +92420,9 @@ function writeSectPrPageNumbering(sectPr, numbering) {
|
|
|
92420
92420
|
if (numbering.chapterSeparator !== undefined)
|
|
92421
92421
|
setStringAttr(pgNumType, "w:chapSep", numbering.chapterSeparator);
|
|
92422
92422
|
}
|
|
92423
|
+
function readSectPrTitlePage(sectPr) {
|
|
92424
|
+
return Boolean(findChild(sectPr, "w:titlePg"));
|
|
92425
|
+
}
|
|
92423
92426
|
function writeSectPrTitlePage(sectPr, enabled) {
|
|
92424
92427
|
if (enabled) {
|
|
92425
92428
|
ensureChild(sectPr, "w:titlePg");
|
|
@@ -95101,6 +95104,13 @@ function getTextAdapter(editor, input) {
|
|
|
95101
95104
|
`, `
|
|
95102
95105
|
`, { textModel: "visible" });
|
|
95103
95106
|
}
|
|
95107
|
+
function projectInternalTrackChangeType(type, structural) {
|
|
95108
|
+
if (type !== "structural")
|
|
95109
|
+
return type;
|
|
95110
|
+
if (structural?.subtype === "table-delete" || structural?.side === "deletion")
|
|
95111
|
+
return "delete";
|
|
95112
|
+
return "insert";
|
|
95113
|
+
}
|
|
95104
95114
|
function rangesOverlap(a, b) {
|
|
95105
95115
|
return a[0] < b[1] && b[0] < a[1];
|
|
95106
95116
|
}
|
|
@@ -95204,17 +95214,18 @@ function buildPublicTrackedChangeIdMap(grouped, replacements) {
|
|
|
95204
95214
|
return publicIdByChange;
|
|
95205
95215
|
}
|
|
95206
95216
|
function layerFromChange(change, relationship) {
|
|
95217
|
+
const type = resolveTrackedChangeType(change);
|
|
95207
95218
|
return {
|
|
95208
95219
|
id: change.id,
|
|
95209
95220
|
rawId: change.rawId,
|
|
95210
95221
|
commandRawId: change.commandRawId,
|
|
95211
|
-
type:
|
|
95222
|
+
type: projectInternalTrackChangeType(type, change.structural),
|
|
95212
95223
|
relationship
|
|
95213
95224
|
};
|
|
95214
95225
|
}
|
|
95215
95226
|
function compareOverlapChildren(a, b) {
|
|
95216
|
-
const aType = resolveTrackedChangeType(a);
|
|
95217
|
-
const bType = resolveTrackedChangeType(b);
|
|
95227
|
+
const aType = projectInternalTrackChangeType(resolveTrackedChangeType(a), a.structural);
|
|
95228
|
+
const bType = projectInternalTrackChangeType(resolveTrackedChangeType(b), b.structural);
|
|
95218
95229
|
if (aType !== bType) {
|
|
95219
95230
|
if (aType === "delete")
|
|
95220
95231
|
return -1;
|
|
@@ -117871,7 +117882,7 @@ var isRegExp = (value) => {
|
|
|
117871
117882
|
state.kern = kernNode.attributes["w:val"];
|
|
117872
117883
|
}
|
|
117873
117884
|
}, SuperConverter;
|
|
117874
|
-
var
|
|
117885
|
+
var init_SuperConverter_DOoAJ6Zk_es = __esm(() => {
|
|
117875
117886
|
init_rolldown_runtime_Bg48TavK_es();
|
|
117876
117887
|
init_jszip_C49i9kUs_es();
|
|
117877
117888
|
init_xml_js_CqGKpaft_es();
|
|
@@ -122887,7 +122898,7 @@ var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
|
122887
122898
|
"trackChanges.list": {
|
|
122888
122899
|
memberPath: "trackChanges.list",
|
|
122889
122900
|
description: "List all tracked changes in the document.",
|
|
122890
|
-
expectedResult: "Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`, `replacement`, `format
|
|
122901
|
+
expectedResult: "Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`, `replacement`, `format`), total count, and raw imported Word OOXML revision IDs (`w:id`) when available. Whole-table tracked insertions and deletions are surfaced through the legacy `insert` / `delete` types.",
|
|
122891
122902
|
requiresDocumentContext: true,
|
|
122892
122903
|
metadata: readOperation({
|
|
122893
122904
|
idempotency: "idempotent",
|
|
@@ -122901,7 +122912,7 @@ var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
|
122901
122912
|
"trackChanges.get": {
|
|
122902
122913
|
memberPath: "trackChanges.get",
|
|
122903
122914
|
description: "Retrieve a single tracked change by ID.",
|
|
122904
|
-
expectedResult: "Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `replacement`, `format
|
|
122915
|
+
expectedResult: "Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `replacement`, `format`), author, date, affected content, and raw imported Word OOXML revision IDs (`w:id`) when available. Whole-table tracked insertions and deletions are surfaced through the legacy `insert` / `delete` types.",
|
|
122905
122916
|
requiresDocumentContext: true,
|
|
122906
122917
|
metadata: readOperation({
|
|
122907
122918
|
idempotency: "idempotent",
|
|
@@ -122921,6 +122932,7 @@ var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
|
122921
122932
|
supportsTrackedMode: false,
|
|
122922
122933
|
possibleFailureCodes: [
|
|
122923
122934
|
"NO_OP",
|
|
122935
|
+
"INVALID_INPUT",
|
|
122924
122936
|
"INVALID_TARGET",
|
|
122925
122937
|
"TARGET_NOT_FOUND",
|
|
122926
122938
|
"CAPABILITY_UNAVAILABLE",
|
|
@@ -127400,8 +127412,7 @@ var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
|
127400
127412
|
"insert",
|
|
127401
127413
|
"delete",
|
|
127402
127414
|
"replacement",
|
|
127403
|
-
"format"
|
|
127404
|
-
"structural"
|
|
127415
|
+
"format"
|
|
127405
127416
|
];
|
|
127406
127417
|
nodeTypeValues = NODE_TYPES;
|
|
127407
127418
|
blockNodeTypeValues = BLOCK_NODE_TYPES;
|
|
@@ -128431,10 +128442,6 @@ var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
|
128431
128442
|
address: trackedChangeAddressSchema,
|
|
128432
128443
|
id: { type: "string" },
|
|
128433
128444
|
type: { enum: [...trackChangeTypeValues] },
|
|
128434
|
-
subtype: {
|
|
128435
|
-
enum: ["table-insert", "table-delete"],
|
|
128436
|
-
description: "Finer classification for structural changes (type === 'structural')."
|
|
128437
|
-
},
|
|
128438
128445
|
grouping: { enum: [
|
|
128439
128446
|
"standalone",
|
|
128440
128447
|
"replacement-pair",
|
|
@@ -128457,10 +128464,6 @@ var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
|
128457
128464
|
discoveryResultSchema(discoveryItemSchema({
|
|
128458
128465
|
address: trackedChangeAddressSchema,
|
|
128459
128466
|
type: { enum: [...trackChangeTypeValues] },
|
|
128460
|
-
subtype: {
|
|
128461
|
-
enum: ["table-insert", "table-delete"],
|
|
128462
|
-
description: "Finer classification for structural changes (type === 'structural')."
|
|
128463
|
-
},
|
|
128464
128467
|
grouping: { enum: [
|
|
128465
128468
|
"standalone",
|
|
128466
128469
|
"replacement-pair",
|
|
@@ -130955,7 +130958,7 @@ var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
|
130955
130958
|
},
|
|
130956
130959
|
type: {
|
|
130957
130960
|
enum: [...trackChangeTypeValues],
|
|
130958
|
-
description: "Filter by change type: 'insert', 'delete', 'replacement',
|
|
130961
|
+
description: "Filter by change type: 'insert', 'delete', 'replacement', or 'format'."
|
|
130959
130962
|
},
|
|
130960
130963
|
in: {
|
|
130961
130964
|
oneOf: [storyLocatorSchema, { const: "all" }],
|
|
@@ -157216,7 +157219,7 @@ var init_SuperConverter_BVWG4qnQ_es = __esm(() => {
|
|
|
157216
157219
|
};
|
|
157217
157220
|
});
|
|
157218
157221
|
|
|
157219
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
157222
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-pilP-Jq-.es.js
|
|
157220
157223
|
function parseSizeUnit(val = "0") {
|
|
157221
157224
|
const length = val.toString() || "0";
|
|
157222
157225
|
const value = Number.parseFloat(length);
|
|
@@ -166660,6 +166663,11 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
166660
166663
|
disabled: !context,
|
|
166661
166664
|
value: typeof superdoc?.getZoom === "function" ? superdoc.getZoom() : 100
|
|
166662
166665
|
};
|
|
166666
|
+
}, createZoomFitWidthStateDeriver = () => ({ context, superdoc }) => {
|
|
166667
|
+
return {
|
|
166668
|
+
active: (typeof superdoc?.getZoomState === "function" ? superdoc.getZoomState()?.mode : undefined) === "fit-width",
|
|
166669
|
+
disabled: !context || typeof superdoc?.setZoomMode !== "function"
|
|
166670
|
+
};
|
|
166663
166671
|
}, createDocumentModeStateDeriver = () => ({ context, superdoc }) => {
|
|
166664
166672
|
return {
|
|
166665
166673
|
active: false,
|
|
@@ -166680,6 +166688,12 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
166680
166688
|
return false;
|
|
166681
166689
|
superdoc.setZoom?.(normalizedPayload);
|
|
166682
166690
|
return true;
|
|
166691
|
+
}, createZoomFitWidthExecute = () => ({ superdoc }) => {
|
|
166692
|
+
if (typeof superdoc?.setZoomMode !== "function")
|
|
166693
|
+
return false;
|
|
166694
|
+
const mode = typeof superdoc.getZoomState === "function" ? superdoc.getZoomState()?.mode : undefined;
|
|
166695
|
+
superdoc.setZoomMode(mode === "fit-width" ? "manual" : "fit-width");
|
|
166696
|
+
return true;
|
|
166683
166697
|
}, createDocumentModeExecute = () => ({ superdoc, payload }) => {
|
|
166684
166698
|
const validModes = [
|
|
166685
166699
|
"editing",
|
|
@@ -167353,6 +167367,11 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
167353
167367
|
state: createZoomStateDeriver(),
|
|
167354
167368
|
execute: createZoomExecute()
|
|
167355
167369
|
},
|
|
167370
|
+
"zoom-fit-width": {
|
|
167371
|
+
id: "zoom-fit-width",
|
|
167372
|
+
state: createZoomFitWidthStateDeriver(),
|
|
167373
|
+
execute: createZoomFitWidthExecute()
|
|
167374
|
+
},
|
|
167356
167375
|
"document-mode": {
|
|
167357
167376
|
id: "document-mode",
|
|
167358
167377
|
state: createDocumentModeStateDeriver(),
|
|
@@ -167549,8 +167568,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
|
|
|
167549
167568
|
}
|
|
167550
167569
|
};
|
|
167551
167570
|
};
|
|
167552
|
-
var
|
|
167553
|
-
|
|
167571
|
+
var init_create_headless_toolbar_pilP_Jq_es = __esm(() => {
|
|
167572
|
+
init_SuperConverter_DOoAJ6Zk_es();
|
|
167554
167573
|
init_uuid_qzgm05fK_es();
|
|
167555
167574
|
init_constants_D9qj59G2_es();
|
|
167556
167575
|
init_dist_B8HfvhaK_es();
|
|
@@ -168738,7 +168757,7 @@ var init_remark_stringify_6MMJfY0k_es = __esm(() => {
|
|
|
168738
168757
|
eol = /\r?\n|\r/g;
|
|
168739
168758
|
});
|
|
168740
168759
|
|
|
168741
|
-
// ../../packages/superdoc/dist/chunks/detect-container-
|
|
168760
|
+
// ../../packages/superdoc/dist/chunks/detect-container-sTWXwOzh.es.js
|
|
168742
168761
|
function matchesMagic(bytes, magic) {
|
|
168743
168762
|
if (bytes.length < magic.length)
|
|
168744
168763
|
return false;
|
|
@@ -168756,7 +168775,7 @@ function detectContainerType(data) {
|
|
|
168756
168775
|
return "unknown";
|
|
168757
168776
|
}
|
|
168758
168777
|
var ZIP_MAGIC, CFB_MAGIC;
|
|
168759
|
-
var
|
|
168778
|
+
var init_detect_container_sTWXwOzh_es = __esm(() => {
|
|
168760
168779
|
ZIP_MAGIC = [
|
|
168761
168780
|
80,
|
|
168762
168781
|
75,
|
|
@@ -168775,13 +168794,13 @@ var init_detect_container_B6sqy7HZ_es = __esm(() => {
|
|
|
168775
168794
|
];
|
|
168776
168795
|
});
|
|
168777
168796
|
|
|
168778
|
-
// ../../packages/superdoc/dist/chunks/detect-container-
|
|
168779
|
-
var
|
|
168780
|
-
__export(
|
|
168797
|
+
// ../../packages/superdoc/dist/chunks/detect-container-0tUwtCR4.es.js
|
|
168798
|
+
var exports_detect_container_0tUwtCR4_es = {};
|
|
168799
|
+
__export(exports_detect_container_0tUwtCR4_es, {
|
|
168781
168800
|
detectContainerType: () => detectContainerType
|
|
168782
168801
|
});
|
|
168783
|
-
var
|
|
168784
|
-
|
|
168802
|
+
var init_detect_container_0tUwtCR4_es = __esm(() => {
|
|
168803
|
+
init_detect_container_sTWXwOzh_es();
|
|
168785
168804
|
});
|
|
168786
168805
|
|
|
168787
168806
|
// ../../packages/superdoc/dist/chunks/errors-CNaD6vcg.es.js
|
|
@@ -168834,9 +168853,9 @@ var init_errors_CNaD6vcg_es = __esm(() => {
|
|
|
168834
168853
|
};
|
|
168835
168854
|
});
|
|
168836
168855
|
|
|
168837
|
-
// ../../packages/superdoc/dist/chunks/decrypt-docx-
|
|
168838
|
-
var
|
|
168839
|
-
__export(
|
|
168856
|
+
// ../../packages/superdoc/dist/chunks/decrypt-docx-CPcaRl5W.es.js
|
|
168857
|
+
var exports_decrypt_docx_CPcaRl5W_es = {};
|
|
168858
|
+
__export(exports_decrypt_docx_CPcaRl5W_es, {
|
|
168840
168859
|
decryptDocxIfNeeded: () => decryptDocxIfNeeded
|
|
168841
168860
|
});
|
|
168842
168861
|
function concatUint8Arrays(chunks) {
|
|
@@ -169377,10 +169396,10 @@ async function decryptDocxIfNeeded(data, options) {
|
|
|
169377
169396
|
};
|
|
169378
169397
|
}
|
|
169379
169398
|
var CFB_SIGNATURE, CFB_END_OF_CHAIN = 4294967294, CFB_OBJECT_TYPE, utf16LeDecoder, AGILE_VERSION = 4, AGILE_RESERVED = 4, STANDARD_VERSION_3 = 3, STANDARD_VERSION_4 = 4, STANDARD_RESERVED = 3, MIN_HEADER_SIZE = 8, BLOCK_KEY_VERIFIER_INPUT, BLOCK_KEY_VERIFIER_VALUE, BLOCK_KEY_ENCRYPTED_KEY, BLOCK_KEY_HMAC_KEY, BLOCK_KEY_HMAC_VALUE, SEGMENT_SIZE = 4096, PACKAGE_HEADER_SIZE = 8;
|
|
169380
|
-
var
|
|
169399
|
+
var init_decrypt_docx_CPcaRl5W_es = __esm(() => {
|
|
169381
169400
|
init_dist_B8HfvhaK_es();
|
|
169382
169401
|
init_errors_CNaD6vcg_es();
|
|
169383
|
-
|
|
169402
|
+
init_detect_container_sTWXwOzh_es();
|
|
169384
169403
|
CFB_SIGNATURE = new Uint8Array([
|
|
169385
169404
|
208,
|
|
169386
169405
|
207,
|
|
@@ -169449,7 +169468,7 @@ var init_decrypt_docx_G2a7hkiV_es = __esm(() => {
|
|
|
169449
169468
|
]);
|
|
169450
169469
|
});
|
|
169451
169470
|
|
|
169452
|
-
// ../../packages/superdoc/dist/chunks/DocxZipper-
|
|
169471
|
+
// ../../packages/superdoc/dist/chunks/DocxZipper-FUsfThjV.es.js
|
|
169453
169472
|
function sniffEncoding(u8) {
|
|
169454
169473
|
if (u8.length >= 2) {
|
|
169455
169474
|
const b0 = u8[0], b1 = u8[1];
|
|
@@ -169765,11 +169784,11 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
|
|
|
169765
169784
|
return new Uint8Array(0);
|
|
169766
169785
|
}
|
|
169767
169786
|
async getDocxData(file2, isNode = false, options = {}) {
|
|
169768
|
-
const { detectContainerType: detectContainerType2 } = await Promise.resolve().then(() => (
|
|
169787
|
+
const { detectContainerType: detectContainerType2 } = await Promise.resolve().then(() => (init_detect_container_0tUwtCR4_es(), exports_detect_container_0tUwtCR4_es));
|
|
169769
169788
|
const containerType = detectContainerType2(await this.#peekBytes(file2, 8));
|
|
169770
169789
|
let fileData = file2;
|
|
169771
169790
|
if (containerType === "cfb") {
|
|
169772
|
-
const { decryptDocxIfNeeded: decryptDocxIfNeeded2 } = await Promise.resolve().then(() => (
|
|
169791
|
+
const { decryptDocxIfNeeded: decryptDocxIfNeeded2 } = await Promise.resolve().then(() => (init_decrypt_docx_CPcaRl5W_es(), exports_decrypt_docx_CPcaRl5W_es));
|
|
169773
169792
|
const result = await decryptDocxIfNeeded2(file2 instanceof Uint8Array ? file2 : file2 instanceof ArrayBuffer ? new Uint8Array(file2) : new Uint8Array(await file2.arrayBuffer()), { password: options.password });
|
|
169774
169793
|
fileData = result.data;
|
|
169775
169794
|
this.decryptedFileData = result.data;
|
|
@@ -170122,7 +170141,7 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
|
|
|
170122
170141
|
return `image/${MIME_TYPE_FOR_EXT[detectedType] || detectedType}`;
|
|
170123
170142
|
}
|
|
170124
170143
|
}, DocxZipper_default;
|
|
170125
|
-
var
|
|
170144
|
+
var init_DocxZipper_FUsfThjV_es = __esm(() => {
|
|
170126
170145
|
init_rolldown_runtime_Bg48TavK_es();
|
|
170127
170146
|
init_jszip_C49i9kUs_es();
|
|
170128
170147
|
init_xml_js_CqGKpaft_es();
|
|
@@ -211522,9 +211541,9 @@ var init_unified_vFnLRfAM_es = __esm(() => {
|
|
|
211522
211541
|
init_unified_Dsuw2be5_es();
|
|
211523
211542
|
});
|
|
211524
211543
|
|
|
211525
|
-
// ../../packages/superdoc/dist/chunks/rehype-parse-
|
|
211526
|
-
var
|
|
211527
|
-
__export(
|
|
211544
|
+
// ../../packages/superdoc/dist/chunks/rehype-parse-DTSDs3kr.es.js
|
|
211545
|
+
var exports_rehype_parse_DTSDs3kr_es = {};
|
|
211546
|
+
__export(exports_rehype_parse_DTSDs3kr_es, {
|
|
211528
211547
|
default: () => rehypeParse
|
|
211529
211548
|
});
|
|
211530
211549
|
function merge2(definitions, space) {
|
|
@@ -217473,7 +217492,7 @@ var Schema2 = class {
|
|
|
217473
217492
|
}
|
|
217474
217493
|
}
|
|
217475
217494
|
}, TABLE_VOID_ELEMENTS, errors4, base2 = "https://html.spec.whatwg.org/multipage/parsing.html#parse-error-", dashToCamelRe, formatCRe, formatXRe, fatalities, emptyOptions3;
|
|
217476
|
-
var
|
|
217495
|
+
var init_rehype_parse_DTSDs3kr_es = __esm(() => {
|
|
217477
217496
|
init_rolldown_runtime_Bg48TavK_es();
|
|
217478
217497
|
init_default_BqgWzMfR_es();
|
|
217479
217498
|
init_lib_CYqLdG4z_es();
|
|
@@ -220218,9 +220237,9 @@ var init_rehype_parse_q8NfsLv7_es = __esm(() => {
|
|
|
220218
220237
|
emptyOptions3 = {};
|
|
220219
220238
|
});
|
|
220220
220239
|
|
|
220221
|
-
// ../../packages/superdoc/dist/chunks/rehype-remark-
|
|
220222
|
-
var
|
|
220223
|
-
__export(
|
|
220240
|
+
// ../../packages/superdoc/dist/chunks/rehype-remark-Bt5njn02.es.js
|
|
220241
|
+
var exports_rehype_remark_Bt5njn02_es = {};
|
|
220242
|
+
__export(exports_rehype_remark_Bt5njn02_es, {
|
|
220224
220243
|
default: () => rehypeRemark
|
|
220225
220244
|
});
|
|
220226
220245
|
function anyFactory2(tests) {
|
|
@@ -221840,7 +221859,7 @@ var env, deserializer = ($2, _2) => {
|
|
|
221840
221859
|
if (is(parent.children[index2], index2, parent))
|
|
221841
221860
|
return parent.children[index2];
|
|
221842
221861
|
}, searchLineFeeds, searchTabOrSpaces, br$1, cell, p$1, row, notRendered, blockOrCaption, prefix = "language-", defaultChecked = "[x]", defaultUnchecked = "[ ]", own$12, list$1, basic, meta3, defaultQuotes, nodeHandlers2, handlers2, own6, emptyOptions4, defaults;
|
|
221843
|
-
var
|
|
221862
|
+
var init_rehype_remark_Bt5njn02_es = __esm(() => {
|
|
221844
221863
|
init_lib_DEff_P2k_es();
|
|
221845
221864
|
env = typeof self === "object" ? self : globalThis;
|
|
221846
221865
|
({ toString: toString$1 } = {});
|
|
@@ -222234,7 +222253,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
222234
222253
|
init_remark_gfm_BhnWr3yf_es();
|
|
222235
222254
|
});
|
|
222236
222255
|
|
|
222237
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
222256
|
+
// ../../packages/superdoc/dist/chunks/src-CWo3dWd9.es.js
|
|
222238
222257
|
function deleteProps(obj, propOrProps) {
|
|
222239
222258
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
222240
222259
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -238893,7 +238912,7 @@ function buildChangedTextFields(type, excerpt) {
|
|
|
238893
238912
|
}
|
|
238894
238913
|
function buildProjectedInfo(snapshot2, options = {}) {
|
|
238895
238914
|
const id2 = options.id ?? snapshot2.address.entityId;
|
|
238896
|
-
const type = options.type ?? snapshot2.type;
|
|
238915
|
+
const type = options.type ?? projectInternalTrackChangeType(snapshot2.type, { subtype: snapshot2.subtype });
|
|
238897
238916
|
return {
|
|
238898
238917
|
info: {
|
|
238899
238918
|
address: {
|
|
@@ -238902,7 +238921,6 @@ function buildProjectedInfo(snapshot2, options = {}) {
|
|
|
238902
238921
|
},
|
|
238903
238922
|
id: id2,
|
|
238904
238923
|
type,
|
|
238905
|
-
...type === "structural" && snapshot2.subtype ? { subtype: snapshot2.subtype } : {},
|
|
238906
238924
|
grouping: options.grouping,
|
|
238907
238925
|
pairedWithChangeId: options.pairedWithChangeId ?? undefined,
|
|
238908
238926
|
wordRevisionIds: normalizeWordRevisionIds(snapshot2.wordRevisionIds),
|
|
@@ -238933,7 +238951,7 @@ function replacementPairKey2(snapshot2) {
|
|
|
238933
238951
|
return null;
|
|
238934
238952
|
}
|
|
238935
238953
|
function projectedSnapshotType(snapshot2) {
|
|
238936
|
-
return isCombinedReplacementSnapshot(snapshot2) ? "replacement" : snapshot2.type;
|
|
238954
|
+
return isCombinedReplacementSnapshot(snapshot2) ? "replacement" : projectInternalTrackChangeType(snapshot2.type, { subtype: snapshot2.subtype });
|
|
238937
238955
|
}
|
|
238938
238956
|
function snapshotGrouping(snapshot2) {
|
|
238939
238957
|
return isCombinedReplacementSnapshot(snapshot2) ? "replacement-pair" : "standalone";
|
|
@@ -239158,11 +239176,10 @@ function trackChangesListWrapper(editor, input2) {
|
|
|
239158
239176
|
const items = paged.items.map((row2) => {
|
|
239159
239177
|
const info = row2.info;
|
|
239160
239178
|
const handle3 = buildResolvedHandle(row2.handleKey, "stable", "trackedChange");
|
|
239161
|
-
const { address, type,
|
|
239179
|
+
const { address, type, grouping, pairedWithChangeId, wordRevisionIds, overlap, author, authorEmail, authorImage, date: date6, excerpt, insertedText, deletedText, origin, imported } = info;
|
|
239162
239180
|
return buildDiscoveryItem(info.id, handle3, {
|
|
239163
239181
|
address,
|
|
239164
239182
|
type,
|
|
239165
|
-
...subtype ? { subtype } : {},
|
|
239166
239183
|
grouping,
|
|
239167
239184
|
pairedWithChangeId,
|
|
239168
239185
|
wordRevisionIds,
|
|
@@ -239213,7 +239230,7 @@ function trackChangesGetWrapper(editor, input2) {
|
|
|
239213
239230
|
const snapshot2 = snapshots.find((item) => item.anchorKey === anchorKey || item.address.entityId === baseId);
|
|
239214
239231
|
if (snapshot2)
|
|
239215
239232
|
return snapshotToInfo(snapshot2);
|
|
239216
|
-
const type = resolveTrackedChangeType(resolved.change);
|
|
239233
|
+
const type = projectInternalTrackChangeType(resolveTrackedChangeType(resolved.change), resolved.change.structural);
|
|
239217
239234
|
const excerpt = (resolved.change.excerpt !== undefined ? resolved.change.excerpt : undefined) ?? normalizeExcerpt(resolved.editor.state.doc.textBetween(resolved.change.from, resolved.change.to, " ", ""));
|
|
239218
239235
|
const grouping = resolved.change.hasInsert && resolved.change.hasDelete && !resolved.change.hasFormat ? "replacement-pair" : undefined;
|
|
239219
239236
|
return {
|
|
@@ -239225,7 +239242,6 @@ function trackChangesGetWrapper(editor, input2) {
|
|
|
239225
239242
|
},
|
|
239226
239243
|
id: resolved.change.id,
|
|
239227
239244
|
type,
|
|
239228
|
-
...type === "structural" && resolved.change.structural ? { subtype: resolved.change.structural.subtype } : {},
|
|
239229
239245
|
grouping,
|
|
239230
239246
|
wordRevisionIds: normalizeWordRevisionIds(resolved.change.wordRevisionIds),
|
|
239231
239247
|
overlap: resolved.change.overlap,
|
|
@@ -239464,12 +239480,20 @@ function isTrackedChangeCommentTargetShape(target) {
|
|
|
239464
239480
|
return false;
|
|
239465
239481
|
return typeof value.trackedChangeId === "string" && value.trackedChangeId.length > 0;
|
|
239466
239482
|
}
|
|
239483
|
+
function trackedChangeDisplayType(snapshot2) {
|
|
239484
|
+
if (snapshot2.type !== "structural")
|
|
239485
|
+
return null;
|
|
239486
|
+
return snapshot2.subtype === "table-delete" ? "tableDelete" : "tableInsert";
|
|
239487
|
+
}
|
|
239488
|
+
function publicTrackedChangeType(snapshot2) {
|
|
239489
|
+
return projectInternalTrackChangeType(snapshot2.type, { subtype: snapshot2.subtype });
|
|
239490
|
+
}
|
|
239467
239491
|
function buildTrackedChangeLink(snapshot2) {
|
|
239468
239492
|
const { trackedChangeText, deletedText } = trackedChangeTextFields(snapshot2);
|
|
239469
239493
|
return {
|
|
239470
239494
|
trackedChange: true,
|
|
239471
|
-
trackedChangeType: snapshot2
|
|
239472
|
-
trackedChangeDisplayType:
|
|
239495
|
+
trackedChangeType: publicTrackedChangeType(snapshot2),
|
|
239496
|
+
trackedChangeDisplayType: trackedChangeDisplayType(snapshot2),
|
|
239473
239497
|
trackedChangeStory: snapshot2.story,
|
|
239474
239498
|
trackedChangeAnchorKey: snapshot2.anchorKey,
|
|
239475
239499
|
trackedChangeText,
|
|
@@ -239513,7 +239537,7 @@ function choosePreferredTrackedChangeSnapshot(snapshots, preferredId) {
|
|
|
239513
239537
|
const rightLength = Math.max(0, right$1.range.to - right$1.range.from);
|
|
239514
239538
|
if (leftLength !== rightLength)
|
|
239515
239539
|
return leftLength - rightLength;
|
|
239516
|
-
const typeDelta = trackedChangeTypePriority(left$1
|
|
239540
|
+
const typeDelta = trackedChangeTypePriority(publicTrackedChangeType(left$1)) - trackedChangeTypePriority(publicTrackedChangeType(right$1));
|
|
239517
239541
|
if (typeDelta !== 0)
|
|
239518
239542
|
return typeDelta;
|
|
239519
239543
|
if (left$1.range.from !== right$1.range.from)
|
|
@@ -239730,7 +239754,7 @@ function parseCreatedTime(value) {
|
|
|
239730
239754
|
}
|
|
239731
239755
|
function trackedChangeTextFields(snapshot2) {
|
|
239732
239756
|
const excerpt = snapshot2.excerpt ?? "";
|
|
239733
|
-
if (snapshot2
|
|
239757
|
+
if (publicTrackedChangeType(snapshot2) === "delete")
|
|
239734
239758
|
return {
|
|
239735
239759
|
trackedChangeText: "",
|
|
239736
239760
|
deletedText: excerpt
|
|
@@ -239757,7 +239781,8 @@ function toTrackedChangeCommentInfo(snapshot2) {
|
|
|
239757
239781
|
anchoredText: snapshot2.excerpt,
|
|
239758
239782
|
story: snapshot2.story,
|
|
239759
239783
|
trackedChange: true,
|
|
239760
|
-
trackedChangeType: snapshot2
|
|
239784
|
+
trackedChangeType: publicTrackedChangeType(snapshot2),
|
|
239785
|
+
trackedChangeDisplayType: trackedChangeDisplayType(snapshot2),
|
|
239761
239786
|
trackedChangeStory: snapshot2.story,
|
|
239762
239787
|
trackedChangeAnchorKey: snapshot2.anchorKey,
|
|
239763
239788
|
trackedChangeText,
|
|
@@ -240624,7 +240649,7 @@ function listCommentsHandler(editor, query) {
|
|
|
240624
240649
|
const paged = paginate(filtered, query?.offset, query?.limit);
|
|
240625
240650
|
const items = paged.items.map((comment2) => {
|
|
240626
240651
|
const handle3 = buildResolvedHandle(`comment:${comment2.commentId}`, "stable", "comment");
|
|
240627
|
-
const { importedId, parentCommentId, text: text5, isInternal, status, target, anchoredText, createdTime, creatorName, creatorEmail, address, story, trackedChange, trackedChangeType, trackedChangeDisplayType, trackedChangeStory, trackedChangeAnchorKey, trackedChangeText, deletedText, trackedChangeLink } = comment2;
|
|
240652
|
+
const { importedId, parentCommentId, text: text5, isInternal, status, target, anchoredText, createdTime, creatorName, creatorEmail, address, story, trackedChange, trackedChangeType, trackedChangeDisplayType: trackedChangeDisplayType$1, trackedChangeStory, trackedChangeAnchorKey, trackedChangeText, deletedText, trackedChangeLink } = comment2;
|
|
240628
240653
|
return buildDiscoveryItem(comment2.commentId, handle3, {
|
|
240629
240654
|
address,
|
|
240630
240655
|
importedId,
|
|
@@ -240640,7 +240665,7 @@ function listCommentsHandler(editor, query) {
|
|
|
240640
240665
|
story,
|
|
240641
240666
|
trackedChange,
|
|
240642
240667
|
trackedChangeType,
|
|
240643
|
-
trackedChangeDisplayType,
|
|
240668
|
+
trackedChangeDisplayType: trackedChangeDisplayType$1,
|
|
240644
240669
|
trackedChangeStory,
|
|
240645
240670
|
trackedChangeAnchorKey,
|
|
240646
240671
|
trackedChangeText,
|
|
@@ -241577,6 +241602,27 @@ function rewriteImportedStyleNumbering(importedStyleEls, numRemap) {
|
|
|
241577
241602
|
function numAttr(el, attr) {
|
|
241578
241603
|
return el.attributes?.[attr];
|
|
241579
241604
|
}
|
|
241605
|
+
function reorderNumberingChildren(numberingEl) {
|
|
241606
|
+
if (!numberingEl.elements)
|
|
241607
|
+
return;
|
|
241608
|
+
const other = [];
|
|
241609
|
+
const abstracts = [];
|
|
241610
|
+
const nums = [];
|
|
241611
|
+
for (const el of numberingEl.elements) {
|
|
241612
|
+
const ln = localName$1(el);
|
|
241613
|
+
if (ln === "abstractNum")
|
|
241614
|
+
abstracts.push(el);
|
|
241615
|
+
else if (ln === "num")
|
|
241616
|
+
nums.push(el);
|
|
241617
|
+
else
|
|
241618
|
+
other.push(el);
|
|
241619
|
+
}
|
|
241620
|
+
numberingEl.elements = [
|
|
241621
|
+
...other,
|
|
241622
|
+
...abstracts,
|
|
241623
|
+
...nums
|
|
241624
|
+
];
|
|
241625
|
+
}
|
|
241580
241626
|
function mergeNumberingGraph(currentRoot, sourceRoot) {
|
|
241581
241627
|
const result = {
|
|
241582
241628
|
numRemap: /* @__PURE__ */ new Map,
|
|
@@ -241660,6 +241706,7 @@ function mergeNumberingGraph(currentRoot, sourceRoot) {
|
|
|
241660
241706
|
usedNum.add(id2);
|
|
241661
241707
|
cur.elements.push(next2);
|
|
241662
241708
|
}
|
|
241709
|
+
reorderNumberingChildren(cur);
|
|
241663
241710
|
return result;
|
|
241664
241711
|
}
|
|
241665
241712
|
function reconcileSettings(currentRoot, sourceRoot) {
|
|
@@ -241849,18 +241896,21 @@ function importHeaderFooterAssets(editor, converter, byName, dryRun) {
|
|
|
241849
241896
|
usedMedia.add(allocated);
|
|
241850
241897
|
return allocated;
|
|
241851
241898
|
};
|
|
241852
|
-
const
|
|
241899
|
+
const sourceRelIdsByTarget = /* @__PURE__ */ new Map;
|
|
241853
241900
|
for (const rel of srcRelEls) {
|
|
241854
241901
|
const type = rel.attributes?.Type;
|
|
241855
241902
|
const target = rel.attributes?.Target;
|
|
241856
241903
|
const id2 = rel.attributes?.Id;
|
|
241857
241904
|
if (!type || !target || !id2)
|
|
241858
241905
|
continue;
|
|
241859
|
-
if (type === HEADER_REL_TYPE2 || type === FOOTER_REL_TYPE2)
|
|
241860
|
-
|
|
241861
|
-
|
|
241862
|
-
|
|
241863
|
-
|
|
241906
|
+
if (type === HEADER_REL_TYPE2 || type === FOOTER_REL_TYPE2) {
|
|
241907
|
+
const sourceTarget = relTargetToWordPath(target).replace(/^word\//, "");
|
|
241908
|
+
const existing = sourceRelIdsByTarget.get(sourceTarget);
|
|
241909
|
+
if (existing)
|
|
241910
|
+
existing.push(id2);
|
|
241911
|
+
else
|
|
241912
|
+
sourceRelIdsByTarget.set(sourceTarget, [id2]);
|
|
241913
|
+
}
|
|
241864
241914
|
}
|
|
241865
241915
|
const setHeaderIdsArray = (idsHolder, relId) => {
|
|
241866
241916
|
if (!Array.isArray(idsHolder.ids))
|
|
@@ -241951,12 +242001,12 @@ function importHeaderFooterAssets(editor, converter, byName, dryRun) {
|
|
|
241951
242001
|
}
|
|
241952
242002
|
});
|
|
241953
242003
|
docRelsChanged = true;
|
|
241954
|
-
const
|
|
241955
|
-
|
|
241956
|
-
result.relIdRemap.set(
|
|
242004
|
+
const sourceRelIds = sourceRelIdsByTarget.get(sourceTarget) ?? [];
|
|
242005
|
+
for (const sourceRelId of sourceRelIds) {
|
|
242006
|
+
result.relIdRemap.set(sourceRelId, relId);
|
|
241957
242007
|
result.mappings.push({
|
|
241958
242008
|
kind: "relationship",
|
|
241959
|
-
from:
|
|
242009
|
+
from: sourceRelId,
|
|
241960
242010
|
to: relId
|
|
241961
242011
|
});
|
|
241962
242012
|
}
|
|
@@ -242006,6 +242056,29 @@ function ensureContentTypeOverride$1(converter, partPath, contentType) {
|
|
|
242006
242056
|
});
|
|
242007
242057
|
return true;
|
|
242008
242058
|
}
|
|
242059
|
+
function toSectionXmlElement(node2) {
|
|
242060
|
+
if (!node2.name)
|
|
242061
|
+
throw new Error("Expected named XML element.");
|
|
242062
|
+
return {
|
|
242063
|
+
type: node2.type,
|
|
242064
|
+
name: node2.name,
|
|
242065
|
+
attributes: node2.attributes ? { ...node2.attributes } : undefined,
|
|
242066
|
+
elements: node2.elements?.filter((child) => typeof child.name === "string").map((child) => toSectionXmlElement(child))
|
|
242067
|
+
};
|
|
242068
|
+
}
|
|
242069
|
+
function mergePageOneHeaderFooterModel(targetSectPr, sourceSectPr) {
|
|
242070
|
+
const mergedSectPr = ensureSectPrElement(targetSectPr);
|
|
242071
|
+
for (const kind of HEADER_FOOTER_KINDS2)
|
|
242072
|
+
for (const variant of HEADER_FOOTER_VARIANTS$2) {
|
|
242073
|
+
const sourceRef = getSectPrHeaderFooterRef(sourceSectPr, kind, variant);
|
|
242074
|
+
if (sourceRef)
|
|
242075
|
+
setSectPrHeaderFooterRef(mergedSectPr, kind, variant, sourceRef);
|
|
242076
|
+
else
|
|
242077
|
+
clearSectPrHeaderFooterRef(mergedSectPr, kind, variant);
|
|
242078
|
+
}
|
|
242079
|
+
writeSectPrTitlePage(mergedSectPr, readSectPrTitlePage(sourceSectPr));
|
|
242080
|
+
return mergedSectPr;
|
|
242081
|
+
}
|
|
242009
242082
|
function applyPageOneSectionDefaults(editor, sourceDocumentXml, relIdRemap, parseXml2, dryRun) {
|
|
242010
242083
|
const result = {
|
|
242011
242084
|
detected: false,
|
|
@@ -242024,8 +242097,18 @@ function applyPageOneSectionDefaults(editor, sourceDocumentXml, relIdRemap, pars
|
|
|
242024
242097
|
if (!sourceSectPr)
|
|
242025
242098
|
return result;
|
|
242026
242099
|
result.detected = true;
|
|
242027
|
-
|
|
242028
|
-
|
|
242100
|
+
let sectPr;
|
|
242101
|
+
try {
|
|
242102
|
+
const rewrittenSectPr = clone2(sourceSectPr);
|
|
242103
|
+
rewriteSectPrRefs(rewrittenSectPr, relIdRemap);
|
|
242104
|
+
sectPr = toSectionXmlElement(rewrittenSectPr);
|
|
242105
|
+
} catch {
|
|
242106
|
+
result.warnings.push({
|
|
242107
|
+
code: "SECTION_DEFAULTS_UNAVAILABLE",
|
|
242108
|
+
message: "Could not normalize the source page-1 sectPr."
|
|
242109
|
+
});
|
|
242110
|
+
return result;
|
|
242111
|
+
}
|
|
242029
242112
|
let projections;
|
|
242030
242113
|
try {
|
|
242031
242114
|
projections = resolveSectionProjections(editor);
|
|
@@ -242036,26 +242119,43 @@ function applyPageOneSectionDefaults(editor, sourceDocumentXml, relIdRemap, pars
|
|
|
242036
242119
|
});
|
|
242037
242120
|
return result;
|
|
242038
242121
|
}
|
|
242039
|
-
|
|
242040
|
-
if (!bodyProjection) {
|
|
242122
|
+
if (projections.length === 0) {
|
|
242041
242123
|
result.warnings.push({
|
|
242042
242124
|
code: "SECTION_DEFAULTS_UNAVAILABLE",
|
|
242043
|
-
message: "No
|
|
242125
|
+
message: "No section projections found for page-1 sectPr adoption."
|
|
242044
242126
|
});
|
|
242045
242127
|
return result;
|
|
242046
242128
|
}
|
|
242047
|
-
|
|
242129
|
+
const bodyProjection = [...projections].reverse().find((projection) => projection.target.kind === "body") ?? projections[projections.length - 1];
|
|
242130
|
+
const sectionUpdates = projections.map((projection) => {
|
|
242131
|
+
const currentSectPr = readTargetSectPr(editor, projection);
|
|
242132
|
+
const nextSectPr = projection.sectionId === bodyProjection.sectionId ? clone2(sectPr) : mergePageOneHeaderFooterModel(currentSectPr, sectPr);
|
|
242133
|
+
if (xmlDeepEqual(currentSectPr, nextSectPr))
|
|
242134
|
+
return null;
|
|
242135
|
+
return {
|
|
242136
|
+
sectionId: projection.sectionId,
|
|
242137
|
+
nextSectPr
|
|
242138
|
+
};
|
|
242139
|
+
}).filter((update) => Boolean(update));
|
|
242140
|
+
if (sectionUpdates.length === 0)
|
|
242048
242141
|
return result;
|
|
242049
242142
|
result.changed = true;
|
|
242050
242143
|
result.changedParts.push({
|
|
242051
242144
|
part: "word/document.xml",
|
|
242052
242145
|
scope: "sectionDefaults",
|
|
242053
|
-
change: "replaced"
|
|
242146
|
+
change: sectionUpdates.some((update) => update.sectionId !== bodyProjection.sectionId) ? "merged" : "replaced"
|
|
242054
242147
|
});
|
|
242055
242148
|
if (dryRun)
|
|
242056
242149
|
return result;
|
|
242057
242150
|
try {
|
|
242058
|
-
|
|
242151
|
+
for (let index2 = 0;index2 < sectionUpdates.length; index2 += 1) {
|
|
242152
|
+
const update = sectionUpdates[index2];
|
|
242153
|
+
const liveProjection = resolveSectionProjections(editor).find((projection) => projection.sectionId === update.sectionId);
|
|
242154
|
+
if (!liveProjection)
|
|
242155
|
+
throw new Error(`Section ${update.sectionId} disappeared during page-1 sectPr adoption.`);
|
|
242156
|
+
applySectPrToProjection(editor, liveProjection, clone2(update.nextSectPr), { addToHistory: index2 === sectionUpdates.length - 1 });
|
|
242157
|
+
}
|
|
242158
|
+
clearIndexCache(editor);
|
|
242059
242159
|
result.applied = true;
|
|
242060
242160
|
} catch (err) {
|
|
242061
242161
|
result.changed = false;
|
|
@@ -242523,7 +242623,7 @@ async function applyTemplateAsync(editor, converter, input2, options) {
|
|
|
242523
242623
|
});
|
|
242524
242624
|
} else if (sec.detected) {
|
|
242525
242625
|
warnings.push(...sec.warnings);
|
|
242526
|
-
pushNoChangeSkip(skippedScopes, "sectionDefaults", "word/document.xml", sec.warnings.length > 0 ? "Source page-1 section defaults could not be applied." : "Source page-1 section defaults already match the active section defaults.");
|
|
242626
|
+
pushNoChangeSkip(skippedScopes, "sectionDefaults", "word/document.xml", sec.warnings.length > 0 ? "Source page-1 section defaults could not be applied." : "Source page-1 section defaults already match the current document's active section defaults and section header/footer visibility model.");
|
|
242527
242627
|
}
|
|
242528
242628
|
}
|
|
242529
242629
|
if (styleMappings.length > 0)
|
|
@@ -285790,7 +285890,7 @@ var Node$13 = class Node$14 {
|
|
|
285790
285890
|
}, getTrackedChangeText = ({ nodes, mark: mark2, trackedChangeType, isReplacement }) => {
|
|
285791
285891
|
let trackedChangeText = "";
|
|
285792
285892
|
let deletionText = "";
|
|
285793
|
-
let trackedChangeDisplayType = null;
|
|
285893
|
+
let trackedChangeDisplayType$1 = null;
|
|
285794
285894
|
if (trackedChangeType === "trackDelete" || isReplacement)
|
|
285795
285895
|
deletionText = nodes.reduce((acc, node2) => {
|
|
285796
285896
|
if (!node2.marks.find((nodeMark) => nodeMark.type.name === "trackDelete"))
|
|
@@ -285815,14 +285915,14 @@ var Node$13 = class Node$14 {
|
|
|
285815
285915
|
});
|
|
285816
285916
|
if (trackedFormatDisplay) {
|
|
285817
285917
|
trackedChangeText = trackedFormatDisplay.trackedChangeText;
|
|
285818
|
-
trackedChangeDisplayType = trackedFormatDisplay.trackedChangeDisplayType;
|
|
285918
|
+
trackedChangeDisplayType$1 = trackedFormatDisplay.trackedChangeDisplayType;
|
|
285819
285919
|
} else
|
|
285820
285920
|
trackedChangeText = translateFormatChangesToEnglish(normalizedFormatAttrs);
|
|
285821
285921
|
}
|
|
285822
285922
|
return {
|
|
285823
285923
|
deletionText,
|
|
285824
285924
|
trackedChangeText,
|
|
285825
|
-
trackedChangeDisplayType
|
|
285925
|
+
trackedChangeDisplayType: trackedChangeDisplayType$1
|
|
285826
285926
|
};
|
|
285827
285927
|
}, createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes, newEditorState, documentId, trackedChangesForId }) => {
|
|
285828
285928
|
const node2 = nodes[0];
|
|
@@ -285866,7 +285966,7 @@ var Node$13 = class Node$14 {
|
|
|
285866
285966
|
nodesToUse = nodesWithMark.length ? nodesWithMark : node2 ? [node2] : [];
|
|
285867
285967
|
if (!nodesToUse.length)
|
|
285868
285968
|
return;
|
|
285869
|
-
const { deletionText, trackedChangeText, trackedChangeDisplayType } = getTrackedChangeText({
|
|
285969
|
+
const { deletionText, trackedChangeText, trackedChangeDisplayType: trackedChangeDisplayType$1 } = getTrackedChangeText({
|
|
285870
285970
|
nodes: nodesToUse,
|
|
285871
285971
|
mark: trackedMark,
|
|
285872
285972
|
trackedChangeType,
|
|
@@ -285882,7 +285982,7 @@ var Node$13 = class Node$14 {
|
|
|
285882
285982
|
changeId: id2,
|
|
285883
285983
|
trackedChangeType: isReplacement ? "both" : trackedChangeType,
|
|
285884
285984
|
trackedChangeText,
|
|
285885
|
-
trackedChangeDisplayType,
|
|
285985
|
+
trackedChangeDisplayType: trackedChangeDisplayType$1,
|
|
285886
285986
|
deletedText: isReplacement || marks.deletionMark ? deletionText : null,
|
|
285887
285987
|
author,
|
|
285888
285988
|
...authorId && { authorId },
|
|
@@ -299569,7 +299669,7 @@ var Node$13 = class Node$14 {
|
|
|
299569
299669
|
listener(snapshot2);
|
|
299570
299670
|
} catch {}
|
|
299571
299671
|
}
|
|
299572
|
-
}, projectedTrackedChangeCache, TRACK_MARK_TYPE_BY_NAME, EMITTABLE_BLOCK_TYPES, SDT_BLOCK_NODE_NAMES, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, import_jszip_min2, LAYOUT_AFFECTING_SETTING_NAMES, HEADER_REL_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_REL_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", IMAGE_REL_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", HEADER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", FOOTER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", CONTENT_TYPES_PART$1 = "[Content_Types].xml", DOCUMENT_RELS_PART$1 = "word/_rels/document.xml.rels", SUBSTRATE_SCOPE_ORDER, CONTENT_TYPE_BY_SCOPE, REL_TYPE_BY_PART, CONTENT_TYPES_PART = "[Content_Types].xml", DOCUMENT_RELS_PART = "word/_rels/document.xml.rels", SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, HEADING_PATTERN, OOXML_DEFAULT_FONT_SIZE_PT = 10, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, SYMBOL_FONT_NAMES, RFONTS_FAMILY_ATTRS, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, COMMENT_MARK_NAME2 = "commentMark", TRACK_CHANGE_MARK_NAMES, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART$1 = "word/settings.xml", PRESET_GREY = "999999", PRESET_BLACK = "000000", STATIC_PRESETS, IDENTITY_BLOCK_ATTRS, WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, BatchHistoryAdapter = class {
|
|
299672
|
+
}, projectedTrackedChangeCache, TRACK_MARK_TYPE_BY_NAME, EMITTABLE_BLOCK_TYPES, SDT_BLOCK_NODE_NAMES, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, import_jszip_min2, LAYOUT_AFFECTING_SETTING_NAMES, HEADER_REL_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_REL_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", IMAGE_REL_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", HEADER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", FOOTER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", CONTENT_TYPES_PART$1 = "[Content_Types].xml", DOCUMENT_RELS_PART$1 = "word/_rels/document.xml.rels", HEADER_FOOTER_KINDS2, HEADER_FOOTER_VARIANTS$2, SUBSTRATE_SCOPE_ORDER, CONTENT_TYPE_BY_SCOPE, REL_TYPE_BY_PART, CONTENT_TYPES_PART = "[Content_Types].xml", DOCUMENT_RELS_PART = "word/_rels/document.xml.rels", SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, HEADING_PATTERN, OOXML_DEFAULT_FONT_SIZE_PT = 10, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, SYMBOL_FONT_NAMES, RFONTS_FAMILY_ATTRS, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, COMMENT_MARK_NAME2 = "commentMark", TRACK_CHANGE_MARK_NAMES, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART$1 = "word/settings.xml", PRESET_GREY = "999999", PRESET_BLACK = "000000", STATIC_PRESETS, IDENTITY_BLOCK_ATTRS, WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, BatchHistoryAdapter = class {
|
|
299573
299673
|
#done = [];
|
|
299574
299674
|
#redone = [];
|
|
299575
299675
|
#listeners = /* @__PURE__ */ new Set;
|
|
@@ -319338,19 +319438,19 @@ menclose::after {
|
|
|
319338
319438
|
return;
|
|
319339
319439
|
console.log(...args$1);
|
|
319340
319440
|
}, 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;
|
|
319341
|
-
var
|
|
319441
|
+
var init_src_CWo3dWd9_es = __esm(() => {
|
|
319342
319442
|
init_rolldown_runtime_Bg48TavK_es();
|
|
319343
|
-
|
|
319443
|
+
init_SuperConverter_DOoAJ6Zk_es();
|
|
319344
319444
|
init_jszip_C49i9kUs_es();
|
|
319345
319445
|
init_xml_js_CqGKpaft_es();
|
|
319346
319446
|
init_uuid_qzgm05fK_es();
|
|
319347
|
-
|
|
319447
|
+
init_create_headless_toolbar_pilP_Jq_es();
|
|
319348
319448
|
init_constants_D9qj59G2_es();
|
|
319349
319449
|
init_dist_B8HfvhaK_es();
|
|
319350
319450
|
init_unified_Dsuw2be5_es();
|
|
319351
319451
|
init_remark_gfm_BhnWr3yf_es();
|
|
319352
319452
|
init_remark_stringify_6MMJfY0k_es();
|
|
319353
|
-
|
|
319453
|
+
init_DocxZipper_FUsfThjV_es();
|
|
319354
319454
|
init__plugin_vue_export_helper_5t5P5NuM_es();
|
|
319355
319455
|
init_eventemitter3_BnGqBE_Q_es();
|
|
319356
319456
|
init_errors_CNaD6vcg_es();
|
|
@@ -343013,6 +343113,12 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
343013
343113
|
"noPunctuationKerning",
|
|
343014
343114
|
"kerning"
|
|
343015
343115
|
]);
|
|
343116
|
+
HEADER_FOOTER_KINDS2 = ["header", "footer"];
|
|
343117
|
+
HEADER_FOOTER_VARIANTS$2 = [
|
|
343118
|
+
"default",
|
|
343119
|
+
"first",
|
|
343120
|
+
"even"
|
|
343121
|
+
];
|
|
343016
343122
|
SUBSTRATE_SCOPE_ORDER = [
|
|
343017
343123
|
"styles",
|
|
343018
343124
|
"numbering",
|
|
@@ -345327,8 +345433,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
345327
345433
|
try {
|
|
345328
345434
|
const [{ unified: unified$1 }, { default: rehypeParse2 }, { default: rehypeRemark2 }, { default: remarkStringify$1 }, { default: remarkGfm$1 }] = await Promise.all([
|
|
345329
345435
|
Promise.resolve().then(() => (init_unified_vFnLRfAM_es(), exports_unified_vFnLRfAM_es)),
|
|
345330
|
-
Promise.resolve().then(() => (
|
|
345331
|
-
Promise.resolve().then(() => (
|
|
345436
|
+
Promise.resolve().then(() => (init_rehype_parse_DTSDs3kr_es(), exports_rehype_parse_DTSDs3kr_es)),
|
|
345437
|
+
Promise.resolve().then(() => (init_rehype_remark_Bt5njn02_es(), exports_rehype_remark_Bt5njn02_es)),
|
|
345332
345438
|
Promise.resolve().then(() => (init_remark_stringify_B_orWEvD_es(), exports_remark_stringify_B_orWEvD_es)),
|
|
345333
345439
|
Promise.resolve().then(() => (init_remark_gfm_eZN6yzWQ_es(), exports_remark_gfm_eZN6yzWQ_es))
|
|
345334
345440
|
]);
|
|
@@ -354178,11 +354284,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
354178
354284
|
]);
|
|
354179
354285
|
});
|
|
354180
354286
|
|
|
354181
|
-
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-
|
|
354287
|
+
// ../../packages/superdoc/dist/chunks/create-super-doc-ui-DUlu2DFj.es.js
|
|
354182
354288
|
var headlessToolbarConstants, 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;
|
|
354183
|
-
var
|
|
354184
|
-
|
|
354185
|
-
|
|
354289
|
+
var init_create_super_doc_ui_DUlu2DFj_es = __esm(() => {
|
|
354290
|
+
init_SuperConverter_DOoAJ6Zk_es();
|
|
354291
|
+
init_create_headless_toolbar_pilP_Jq_es();
|
|
354186
354292
|
headlessToolbarConstants = {
|
|
354187
354293
|
DEFAULT_TEXT_ALIGN_OPTIONS: [
|
|
354188
354294
|
{
|
|
@@ -354464,16 +354570,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
|
|
|
354464
354570
|
|
|
354465
354571
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
354466
354572
|
var init_super_editor_es = __esm(() => {
|
|
354467
|
-
|
|
354468
|
-
|
|
354573
|
+
init_src_CWo3dWd9_es();
|
|
354574
|
+
init_SuperConverter_DOoAJ6Zk_es();
|
|
354469
354575
|
init_jszip_C49i9kUs_es();
|
|
354470
354576
|
init_xml_js_CqGKpaft_es();
|
|
354471
|
-
|
|
354577
|
+
init_create_headless_toolbar_pilP_Jq_es();
|
|
354472
354578
|
init_constants_D9qj59G2_es();
|
|
354473
354579
|
init_dist_B8HfvhaK_es();
|
|
354474
354580
|
init_unified_Dsuw2be5_es();
|
|
354475
|
-
|
|
354476
|
-
|
|
354581
|
+
init_DocxZipper_FUsfThjV_es();
|
|
354582
|
+
init_create_super_doc_ui_DUlu2DFj_es();
|
|
354477
354583
|
init_ui_C5PAS9hY_es();
|
|
354478
354584
|
init_eventemitter3_BnGqBE_Q_es();
|
|
354479
354585
|
init_errors_CNaD6vcg_es();
|
|
@@ -358085,7 +358191,7 @@ More content with **bold** and *italic*.`
|
|
|
358085
358191
|
"trackChanges.list": {
|
|
358086
358192
|
memberPath: "trackChanges.list",
|
|
358087
358193
|
description: "List all tracked changes in the document.",
|
|
358088
|
-
expectedResult: "Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`, `replacement`, `format
|
|
358194
|
+
expectedResult: "Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`, `replacement`, `format`), total count, and raw imported Word OOXML revision IDs (`w:id`) when available. Whole-table tracked insertions and deletions are surfaced through the legacy `insert` / `delete` types.",
|
|
358089
358195
|
requiresDocumentContext: true,
|
|
358090
358196
|
metadata: readOperation2({
|
|
358091
358197
|
idempotency: "idempotent",
|
|
@@ -358099,7 +358205,7 @@ More content with **bold** and *italic*.`
|
|
|
358099
358205
|
"trackChanges.get": {
|
|
358100
358206
|
memberPath: "trackChanges.get",
|
|
358101
358207
|
description: "Retrieve a single tracked change by ID.",
|
|
358102
|
-
expectedResult: "Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `replacement`, `format
|
|
358208
|
+
expectedResult: "Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `replacement`, `format`), author, date, affected content, and raw imported Word OOXML revision IDs (`w:id`) when available. Whole-table tracked insertions and deletions are surfaced through the legacy `insert` / `delete` types.",
|
|
358103
358209
|
requiresDocumentContext: true,
|
|
358104
358210
|
metadata: readOperation2({
|
|
358105
358211
|
idempotency: "idempotent",
|
|
@@ -358119,6 +358225,7 @@ More content with **bold** and *italic*.`
|
|
|
358119
358225
|
supportsTrackedMode: false,
|
|
358120
358226
|
possibleFailureCodes: [
|
|
358121
358227
|
"NO_OP",
|
|
358228
|
+
"INVALID_INPUT",
|
|
358122
358229
|
"INVALID_TARGET",
|
|
358123
358230
|
"TARGET_NOT_FOUND",
|
|
358124
358231
|
"CAPABILITY_UNAVAILABLE",
|
|
@@ -363460,7 +363567,7 @@ var init_schemas4 = __esm(() => {
|
|
|
363460
363567
|
init_style_policy_types();
|
|
363461
363568
|
init_paragraphs();
|
|
363462
363569
|
init_styles();
|
|
363463
|
-
trackChangeTypeValues2 = ["insert", "delete", "replacement", "format"
|
|
363570
|
+
trackChangeTypeValues2 = ["insert", "delete", "replacement", "format"];
|
|
363464
363571
|
nodeTypeValues2 = NODE_TYPES2;
|
|
363465
363572
|
blockNodeTypeValues2 = BLOCK_NODE_TYPES2;
|
|
363466
363573
|
deletableBlockNodeTypeValues2 = DELETABLE_BLOCK_NODE_TYPES2;
|
|
@@ -364230,10 +364337,6 @@ var init_schemas4 = __esm(() => {
|
|
|
364230
364337
|
address: trackedChangeAddressSchema2,
|
|
364231
364338
|
id: { type: "string" },
|
|
364232
364339
|
type: { enum: [...trackChangeTypeValues2] },
|
|
364233
|
-
subtype: {
|
|
364234
|
-
enum: ["table-insert", "table-delete"],
|
|
364235
|
-
description: "Finer classification for structural changes (type === 'structural')."
|
|
364236
|
-
},
|
|
364237
364340
|
grouping: { enum: ["standalone", "replacement-pair", "unknown"] },
|
|
364238
364341
|
pairedWithChangeId: { type: ["string", "null"] },
|
|
364239
364342
|
wordRevisionIds: trackChangeWordRevisionIdsSchema2,
|
|
@@ -364248,10 +364351,6 @@ var init_schemas4 = __esm(() => {
|
|
|
364248
364351
|
trackChangeDomainItemSchema = discoveryItemSchema2({
|
|
364249
364352
|
address: trackedChangeAddressSchema2,
|
|
364250
364353
|
type: { enum: [...trackChangeTypeValues2] },
|
|
364251
|
-
subtype: {
|
|
364252
|
-
enum: ["table-insert", "table-delete"],
|
|
364253
|
-
description: "Finer classification for structural changes (type === 'structural')."
|
|
364254
|
-
},
|
|
364255
364354
|
grouping: { enum: ["standalone", "replacement-pair", "unknown"] },
|
|
364256
364355
|
pairedWithChangeId: { type: ["string", "null"] },
|
|
364257
364356
|
wordRevisionIds: trackChangeWordRevisionIdsSchema2,
|
|
@@ -366565,7 +366664,7 @@ var init_schemas4 = __esm(() => {
|
|
|
366565
366664
|
offset: { type: "integer", description: "Number of tracked changes to skip for pagination." },
|
|
366566
366665
|
type: {
|
|
366567
366666
|
enum: [...trackChangeTypeValues2],
|
|
366568
|
-
description: "Filter by change type: 'insert', 'delete', 'replacement',
|
|
366667
|
+
description: "Filter by change type: 'insert', 'delete', 'replacement', or 'format'."
|
|
366569
366668
|
},
|
|
366570
366669
|
in: {
|
|
366571
366670
|
oneOf: [storyLocatorSchema2, { const: "all" }],
|
|
@@ -372270,7 +372369,7 @@ function assertHeaderFooterSlotTarget2(input2, operationName) {
|
|
|
372270
372369
|
throw new DocumentApiValidationError3("INVALID_TARGET", `${operationName}.target must be a headerFooterSlot address.`, { field: `${operationName}.target`, value: target });
|
|
372271
372370
|
}
|
|
372272
372371
|
assertSectionAddress2(target.section, `${operationName}.target.section`);
|
|
372273
|
-
assertOneOf3(target.headerFooterKind, `${operationName}.target.headerFooterKind`,
|
|
372372
|
+
assertOneOf3(target.headerFooterKind, `${operationName}.target.headerFooterKind`, HEADER_FOOTER_KINDS3);
|
|
372274
372373
|
assertOneOf3(target.variant, `${operationName}.target.variant`, HEADER_FOOTER_VARIANTS3);
|
|
372275
372374
|
}
|
|
372276
372375
|
function assertHeaderFooterPartTarget2(input2, operationName) {
|
|
@@ -372285,7 +372384,7 @@ function assertHeaderFooterPartTarget2(input2, operationName) {
|
|
|
372285
372384
|
}
|
|
372286
372385
|
function executeHeaderFootersList2(adapter, query2) {
|
|
372287
372386
|
if (query2?.kind !== undefined) {
|
|
372288
|
-
assertOneOf3(query2.kind, "headerFooters.list.kind",
|
|
372387
|
+
assertOneOf3(query2.kind, "headerFooters.list.kind", HEADER_FOOTER_KINDS3);
|
|
372289
372388
|
}
|
|
372290
372389
|
if (query2?.section !== undefined) {
|
|
372291
372390
|
assertSectionAddress2(query2.section, "headerFooters.list.section");
|
|
@@ -372316,12 +372415,12 @@ function executeHeaderFootersRefsSetLinkedToPrevious2(adapter, input2, options)
|
|
|
372316
372415
|
}
|
|
372317
372416
|
function executeHeaderFootersPartsList2(adapter, query2) {
|
|
372318
372417
|
if (query2?.kind !== undefined) {
|
|
372319
|
-
assertOneOf3(query2.kind, "headerFooters.parts.list.kind",
|
|
372418
|
+
assertOneOf3(query2.kind, "headerFooters.parts.list.kind", HEADER_FOOTER_KINDS3);
|
|
372320
372419
|
}
|
|
372321
372420
|
return adapter.parts.list(query2);
|
|
372322
372421
|
}
|
|
372323
372422
|
function executeHeaderFootersPartsCreate2(adapter, input2, options) {
|
|
372324
|
-
assertOneOf3(input2?.kind, "headerFooters.parts.create.kind",
|
|
372423
|
+
assertOneOf3(input2?.kind, "headerFooters.parts.create.kind", HEADER_FOOTER_KINDS3);
|
|
372325
372424
|
if (input2.sourceRefId !== undefined) {
|
|
372326
372425
|
assertNonEmptyString3(input2.sourceRefId, "headerFooters.parts.create.sourceRefId");
|
|
372327
372426
|
}
|
|
@@ -372331,11 +372430,11 @@ function executeHeaderFootersPartsDelete2(adapter, input2, options) {
|
|
|
372331
372430
|
assertHeaderFooterPartTarget2(input2, "headerFooters.parts.delete");
|
|
372332
372431
|
return adapter.parts.delete(input2, normalizeMutationOptions2(options));
|
|
372333
372432
|
}
|
|
372334
|
-
var
|
|
372433
|
+
var HEADER_FOOTER_KINDS3, HEADER_FOOTER_VARIANTS3;
|
|
372335
372434
|
var init_header_footers = __esm(() => {
|
|
372336
372435
|
init_errors5();
|
|
372337
372436
|
init_validation_primitives();
|
|
372338
|
-
|
|
372437
|
+
HEADER_FOOTER_KINDS3 = ["header", "footer"];
|
|
372339
372438
|
HEADER_FOOTER_VARIANTS3 = ["default", "first", "even"];
|
|
372340
372439
|
});
|
|
372341
372440
|
|
|
@@ -372475,7 +372574,7 @@ function normalizeSectionsListQuery2(query2) {
|
|
|
372475
372574
|
return { limit: Number(limit), offset: Number(offset2) };
|
|
372476
372575
|
}
|
|
372477
372576
|
function validateHeaderFooterRefParams2(operationName, kind, variant) {
|
|
372478
|
-
assertOneOf4(kind, `${operationName}.kind`,
|
|
372577
|
+
assertOneOf4(kind, `${operationName}.kind`, HEADER_FOOTER_KINDS4);
|
|
372479
372578
|
assertOneOf4(variant, `${operationName}.variant`, HEADER_FOOTER_VARIANTS4);
|
|
372480
372579
|
}
|
|
372481
372580
|
function executeSectionsList2(adapter, query2) {
|
|
@@ -372624,7 +372723,7 @@ function executeSectionsClearPageBorders2(adapter, input2, options) {
|
|
|
372624
372723
|
assertSectionTarget2(input2, "sections.clearPageBorders");
|
|
372625
372724
|
return adapter.clearPageBorders(input2, normalizeMutationOptions2(options));
|
|
372626
372725
|
}
|
|
372627
|
-
var DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2,
|
|
372726
|
+
var DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS4, HEADER_FOOTER_VARIANTS4, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_NUMBER_CHAPTER_SEPARATORS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2;
|
|
372628
372727
|
var init_sections = __esm(() => {
|
|
372629
372728
|
init_errors5();
|
|
372630
372729
|
init_validation_primitives();
|
|
@@ -372632,7 +372731,7 @@ var init_sections = __esm(() => {
|
|
|
372632
372731
|
SECTION_ORIENTATIONS2 = ["portrait", "landscape"];
|
|
372633
372732
|
SECTION_VERTICAL_ALIGNS2 = ["top", "center", "bottom", "both"];
|
|
372634
372733
|
SECTION_DIRECTIONS2 = ["ltr", "rtl"];
|
|
372635
|
-
|
|
372734
|
+
HEADER_FOOTER_KINDS4 = ["header", "footer"];
|
|
372636
372735
|
HEADER_FOOTER_VARIANTS4 = ["default", "first", "even"];
|
|
372637
372736
|
LINE_NUMBER_RESTARTS2 = ["continuous", "newPage", "newSection"];
|
|
372638
372737
|
PAGE_NUMBER_FORMATS2 = [
|
|
@@ -388723,6 +388822,9 @@ function writeSectPrPageNumbering2(sectPr, numbering) {
|
|
|
388723
388822
|
if (numbering.chapterSeparator !== undefined)
|
|
388724
388823
|
setStringAttr2(pgNumType, "w:chapSep", numbering.chapterSeparator);
|
|
388725
388824
|
}
|
|
388825
|
+
function readSectPrTitlePage2(sectPr) {
|
|
388826
|
+
return Boolean(findChild2(sectPr, "w:titlePg"));
|
|
388827
|
+
}
|
|
388726
388828
|
function writeSectPrTitlePage2(sectPr, enabled) {
|
|
388727
388829
|
if (enabled) {
|
|
388728
388830
|
ensureChild2(sectPr, "w:titlePg");
|
|
@@ -451701,7 +451803,7 @@ function importCommentData2({ docx, editor, converter }) {
|
|
|
451701
451803
|
const trackedChange = attributes["custom:trackedChange"] === "true";
|
|
451702
451804
|
const trackedChangeType = attributes["custom:trackedChangeType"];
|
|
451703
451805
|
const trackedChangeText = attributes["custom:trackedChangeText"] !== "null" ? attributes["custom:trackedChangeText"] : null;
|
|
451704
|
-
const
|
|
451806
|
+
const trackedChangeDisplayType2 = attributes["custom:trackedChangeDisplayType"] !== "null" ? attributes["custom:trackedChangeDisplayType"] : null;
|
|
451705
451807
|
const trackedDeletedText = attributes["custom:trackedDeletedText"] !== "null" ? attributes["custom:trackedDeletedText"] : null;
|
|
451706
451808
|
const date6 = new Date(createdDate);
|
|
451707
451809
|
const unixTimestampMs = date6.getTime();
|
|
@@ -451730,7 +451832,7 @@ function importCommentData2({ docx, editor, converter }) {
|
|
|
451730
451832
|
trackedChange,
|
|
451731
451833
|
trackedChangeText,
|
|
451732
451834
|
trackedChangeType,
|
|
451733
|
-
trackedChangeDisplayType,
|
|
451835
|
+
trackedChangeDisplayType: trackedChangeDisplayType2,
|
|
451734
451836
|
trackedDeletedText,
|
|
451735
451837
|
isDone: false,
|
|
451736
451838
|
origin: converter?.documentOrigin || "word",
|
|
@@ -457547,6 +457649,15 @@ var enumerateStructuralRowChanges2 = (state) => {
|
|
|
457547
457649
|
});
|
|
457548
457650
|
}, stringOf2 = (value) => typeof value === "string" ? value : value == null ? "" : String(value);
|
|
457549
457651
|
|
|
457652
|
+
// ../../packages/super-editor/src/editors/v1/document-api-adapters/helpers/tracked-change-type-utils.ts
|
|
457653
|
+
function projectInternalTrackChangeType2(type, structural) {
|
|
457654
|
+
if (type !== "structural")
|
|
457655
|
+
return type;
|
|
457656
|
+
if (structural?.subtype === "table-delete" || structural?.side === "deletion")
|
|
457657
|
+
return "delete";
|
|
457658
|
+
return "insert";
|
|
457659
|
+
}
|
|
457660
|
+
|
|
457550
457661
|
// ../../packages/super-editor/src/editors/v1/document-api-adapters/helpers/tracked-change-resolver.ts
|
|
457551
457662
|
function rangesOverlap3(a2, b2) {
|
|
457552
457663
|
return a2[0] < b2[1] && b2[0] < a2[1];
|
|
@@ -457655,17 +457766,18 @@ function buildPublicTrackedChangeIdMap2(grouped, replacements) {
|
|
|
457655
457766
|
return publicIdByChange;
|
|
457656
457767
|
}
|
|
457657
457768
|
function layerFromChange2(change, relationship) {
|
|
457769
|
+
const type = resolveTrackedChangeType2(change);
|
|
457658
457770
|
return {
|
|
457659
457771
|
id: change.id,
|
|
457660
457772
|
rawId: change.rawId,
|
|
457661
457773
|
commandRawId: change.commandRawId,
|
|
457662
|
-
type:
|
|
457774
|
+
type: projectInternalTrackChangeType2(type, change.structural),
|
|
457663
457775
|
relationship
|
|
457664
457776
|
};
|
|
457665
457777
|
}
|
|
457666
457778
|
function compareOverlapChildren2(a2, b2) {
|
|
457667
|
-
const aType = resolveTrackedChangeType2(a2);
|
|
457668
|
-
const bType = resolveTrackedChangeType2(b2);
|
|
457779
|
+
const aType = projectInternalTrackChangeType2(resolveTrackedChangeType2(a2), a2.structural);
|
|
457780
|
+
const bType = projectInternalTrackChangeType2(resolveTrackedChangeType2(b2), b2.structural);
|
|
457669
457781
|
if (aType !== bType) {
|
|
457670
457782
|
if (aType === "delete")
|
|
457671
457783
|
return -1;
|
|
@@ -472056,7 +472168,7 @@ function buildChangedTextFields2(type, excerpt) {
|
|
|
472056
472168
|
}
|
|
472057
472169
|
function buildProjectedInfo2(snapshot2, options = {}) {
|
|
472058
472170
|
const id2 = options.id ?? snapshot2.address.entityId;
|
|
472059
|
-
const type = options.type ?? snapshot2.type;
|
|
472171
|
+
const type = options.type ?? projectInternalTrackChangeType2(snapshot2.type, { subtype: snapshot2.subtype });
|
|
472060
472172
|
return {
|
|
472061
472173
|
info: {
|
|
472062
472174
|
address: {
|
|
@@ -472065,7 +472177,6 @@ function buildProjectedInfo2(snapshot2, options = {}) {
|
|
|
472065
472177
|
},
|
|
472066
472178
|
id: id2,
|
|
472067
472179
|
type,
|
|
472068
|
-
...type === "structural" && snapshot2.subtype ? { subtype: snapshot2.subtype } : {},
|
|
472069
472180
|
grouping: options.grouping,
|
|
472070
472181
|
pairedWithChangeId: options.pairedWithChangeId ?? undefined,
|
|
472071
472182
|
wordRevisionIds: normalizeWordRevisionIds2(snapshot2.wordRevisionIds),
|
|
@@ -472098,7 +472209,7 @@ function replacementPairKey4(snapshot2) {
|
|
|
472098
472209
|
return null;
|
|
472099
472210
|
}
|
|
472100
472211
|
function projectedSnapshotType2(snapshot2) {
|
|
472101
|
-
return isCombinedReplacementSnapshot2(snapshot2) ? "replacement" : snapshot2.type;
|
|
472212
|
+
return isCombinedReplacementSnapshot2(snapshot2) ? "replacement" : projectInternalTrackChangeType2(snapshot2.type, { subtype: snapshot2.subtype });
|
|
472102
472213
|
}
|
|
472103
472214
|
function snapshotGrouping2(snapshot2) {
|
|
472104
472215
|
return isCombinedReplacementSnapshot2(snapshot2) ? "replacement-pair" : "standalone";
|
|
@@ -472329,7 +472440,6 @@ function trackChangesListWrapper2(editor, input2) {
|
|
|
472329
472440
|
const {
|
|
472330
472441
|
address: address2,
|
|
472331
472442
|
type,
|
|
472332
|
-
subtype,
|
|
472333
472443
|
grouping,
|
|
472334
472444
|
pairedWithChangeId,
|
|
472335
472445
|
wordRevisionIds,
|
|
@@ -472347,7 +472457,6 @@ function trackChangesListWrapper2(editor, input2) {
|
|
|
472347
472457
|
return buildDiscoveryItem2(info.id, handle4, {
|
|
472348
472458
|
address: address2,
|
|
472349
472459
|
type,
|
|
472350
|
-
...subtype ? { subtype } : {},
|
|
472351
472460
|
grouping,
|
|
472352
472461
|
pairedWithChangeId,
|
|
472353
472462
|
wordRevisionIds,
|
|
@@ -472393,7 +472502,8 @@ function trackChangesGetWrapper2(editor, input2) {
|
|
|
472393
472502
|
const snapshot2 = snapshots.find((item) => item.anchorKey === anchorKey || item.address.entityId === baseId);
|
|
472394
472503
|
if (snapshot2)
|
|
472395
472504
|
return snapshotToInfo2(snapshot2);
|
|
472396
|
-
const
|
|
472505
|
+
const internalType = resolveTrackedChangeType2(resolved.change);
|
|
472506
|
+
const type = projectInternalTrackChangeType2(internalType, resolved.change.structural);
|
|
472397
472507
|
const excerpt = (resolved.change.excerpt !== undefined ? resolved.change.excerpt : undefined) ?? normalizeExcerpt2(resolved.editor.state.doc.textBetween(resolved.change.from, resolved.change.to, " ", ""));
|
|
472398
472508
|
const grouping = resolved.change.hasInsert && resolved.change.hasDelete && !resolved.change.hasFormat ? "replacement-pair" : undefined;
|
|
472399
472509
|
return {
|
|
@@ -472405,7 +472515,6 @@ function trackChangesGetWrapper2(editor, input2) {
|
|
|
472405
472515
|
},
|
|
472406
472516
|
id: resolved.change.id,
|
|
472407
472517
|
type,
|
|
472408
|
-
...type === "structural" && resolved.change.structural ? { subtype: resolved.change.structural.subtype } : {},
|
|
472409
472518
|
grouping,
|
|
472410
472519
|
wordRevisionIds: normalizeWordRevisionIds2(resolved.change.wordRevisionIds),
|
|
472411
472520
|
overlap: resolved.change.overlap,
|
|
@@ -472668,12 +472777,20 @@ function isTrackedChangeCommentTargetShape2(target) {
|
|
|
472668
472777
|
return false;
|
|
472669
472778
|
return typeof value.trackedChangeId === "string" && value.trackedChangeId.length > 0;
|
|
472670
472779
|
}
|
|
472780
|
+
function trackedChangeDisplayType2(snapshot2) {
|
|
472781
|
+
if (snapshot2.type !== "structural")
|
|
472782
|
+
return null;
|
|
472783
|
+
return snapshot2.subtype === "table-delete" ? "tableDelete" : "tableInsert";
|
|
472784
|
+
}
|
|
472785
|
+
function publicTrackedChangeType2(snapshot2) {
|
|
472786
|
+
return projectInternalTrackChangeType2(snapshot2.type, { subtype: snapshot2.subtype });
|
|
472787
|
+
}
|
|
472671
472788
|
function buildTrackedChangeLink2(snapshot2) {
|
|
472672
472789
|
const { trackedChangeText, deletedText } = trackedChangeTextFields2(snapshot2);
|
|
472673
472790
|
return {
|
|
472674
472791
|
trackedChange: true,
|
|
472675
|
-
trackedChangeType: snapshot2
|
|
472676
|
-
trackedChangeDisplayType:
|
|
472792
|
+
trackedChangeType: publicTrackedChangeType2(snapshot2),
|
|
472793
|
+
trackedChangeDisplayType: trackedChangeDisplayType2(snapshot2),
|
|
472677
472794
|
trackedChangeStory: snapshot2.story,
|
|
472678
472795
|
trackedChangeAnchorKey: snapshot2.anchorKey,
|
|
472679
472796
|
trackedChangeText,
|
|
@@ -472720,7 +472837,7 @@ function choosePreferredTrackedChangeSnapshot2(snapshots, preferredId) {
|
|
|
472720
472837
|
const rightLength = Math.max(0, right2.range.to - right2.range.from);
|
|
472721
472838
|
if (leftLength !== rightLength)
|
|
472722
472839
|
return leftLength - rightLength;
|
|
472723
|
-
const typeDelta = trackedChangeTypePriority2(left2
|
|
472840
|
+
const typeDelta = trackedChangeTypePriority2(publicTrackedChangeType2(left2)) - trackedChangeTypePriority2(publicTrackedChangeType2(right2));
|
|
472724
472841
|
if (typeDelta !== 0)
|
|
472725
472842
|
return typeDelta;
|
|
472726
472843
|
if (left2.range.from !== right2.range.from)
|
|
@@ -472927,7 +473044,7 @@ function parseCreatedTime2(value) {
|
|
|
472927
473044
|
}
|
|
472928
473045
|
function trackedChangeTextFields2(snapshot2) {
|
|
472929
473046
|
const excerpt = snapshot2.excerpt ?? "";
|
|
472930
|
-
if (snapshot2
|
|
473047
|
+
if (publicTrackedChangeType2(snapshot2) === "delete") {
|
|
472931
473048
|
return { trackedChangeText: "", deletedText: excerpt };
|
|
472932
473049
|
}
|
|
472933
473050
|
return { trackedChangeText: excerpt, deletedText: null };
|
|
@@ -472949,7 +473066,8 @@ function toTrackedChangeCommentInfo2(snapshot2) {
|
|
|
472949
473066
|
anchoredText: snapshot2.excerpt,
|
|
472950
473067
|
story: snapshot2.story,
|
|
472951
473068
|
trackedChange: true,
|
|
472952
|
-
trackedChangeType: snapshot2
|
|
473069
|
+
trackedChangeType: publicTrackedChangeType2(snapshot2),
|
|
473070
|
+
trackedChangeDisplayType: trackedChangeDisplayType2(snapshot2),
|
|
472953
473071
|
trackedChangeStory: snapshot2.story,
|
|
472954
473072
|
trackedChangeAnchorKey: snapshot2.anchorKey,
|
|
472955
473073
|
trackedChangeText,
|
|
@@ -473817,7 +473935,7 @@ function listCommentsHandler2(editor, query2) {
|
|
|
473817
473935
|
story,
|
|
473818
473936
|
trackedChange,
|
|
473819
473937
|
trackedChangeType,
|
|
473820
|
-
trackedChangeDisplayType,
|
|
473938
|
+
trackedChangeDisplayType: trackedChangeDisplayType3,
|
|
473821
473939
|
trackedChangeStory,
|
|
473822
473940
|
trackedChangeAnchorKey,
|
|
473823
473941
|
trackedChangeText,
|
|
@@ -473839,7 +473957,7 @@ function listCommentsHandler2(editor, query2) {
|
|
|
473839
473957
|
story,
|
|
473840
473958
|
trackedChange,
|
|
473841
473959
|
trackedChangeType,
|
|
473842
|
-
trackedChangeDisplayType,
|
|
473960
|
+
trackedChangeDisplayType: trackedChangeDisplayType3,
|
|
473843
473961
|
trackedChangeStory,
|
|
473844
473962
|
trackedChangeAnchorKey,
|
|
473845
473963
|
trackedChangeText,
|
|
@@ -480186,6 +480304,23 @@ function rewriteImportedStyleNumbering2(importedStyleEls, numRemap) {
|
|
|
480186
480304
|
function numAttr2(el, attr) {
|
|
480187
480305
|
return el.attributes?.[attr];
|
|
480188
480306
|
}
|
|
480307
|
+
function reorderNumberingChildren2(numberingEl) {
|
|
480308
|
+
if (!numberingEl.elements)
|
|
480309
|
+
return;
|
|
480310
|
+
const other = [];
|
|
480311
|
+
const abstracts = [];
|
|
480312
|
+
const nums = [];
|
|
480313
|
+
for (const el of numberingEl.elements) {
|
|
480314
|
+
const ln = localName2(el);
|
|
480315
|
+
if (ln === "abstractNum")
|
|
480316
|
+
abstracts.push(el);
|
|
480317
|
+
else if (ln === "num")
|
|
480318
|
+
nums.push(el);
|
|
480319
|
+
else
|
|
480320
|
+
other.push(el);
|
|
480321
|
+
}
|
|
480322
|
+
numberingEl.elements = [...other, ...abstracts, ...nums];
|
|
480323
|
+
}
|
|
480189
480324
|
function mergeNumberingGraph2(currentRoot, sourceRoot) {
|
|
480190
480325
|
const result = { numRemap: new Map, abstractRemap: new Map, mappings: [] };
|
|
480191
480326
|
const cur = rootElement2(currentRoot, "numbering");
|
|
@@ -480259,6 +480394,7 @@ function mergeNumberingGraph2(currentRoot, sourceRoot) {
|
|
|
480259
480394
|
}
|
|
480260
480395
|
cur.elements.push(next2);
|
|
480261
480396
|
}
|
|
480397
|
+
reorderNumberingChildren2(cur);
|
|
480262
480398
|
return result;
|
|
480263
480399
|
}
|
|
480264
480400
|
function reconcileSettings2(currentRoot, sourceRoot) {
|
|
@@ -480480,7 +480616,7 @@ function importHeaderFooterAssets2(editor, converter, byName, dryRun) {
|
|
|
480480
480616
|
usedMedia.add(allocated);
|
|
480481
480617
|
return allocated;
|
|
480482
480618
|
};
|
|
480483
|
-
const
|
|
480619
|
+
const sourceRelIdsByTarget = new Map;
|
|
480484
480620
|
for (const rel of srcRelEls) {
|
|
480485
480621
|
const type = rel.attributes?.Type;
|
|
480486
480622
|
const target = rel.attributes?.Target;
|
|
@@ -480488,7 +480624,12 @@ function importHeaderFooterAssets2(editor, converter, byName, dryRun) {
|
|
|
480488
480624
|
if (!type || !target || !id2)
|
|
480489
480625
|
continue;
|
|
480490
480626
|
if (type === HEADER_REL_TYPE4 || type === FOOTER_REL_TYPE4) {
|
|
480491
|
-
|
|
480627
|
+
const sourceTarget = relTargetToWordPath2(target).replace(/^word\//, "");
|
|
480628
|
+
const existing = sourceRelIdsByTarget.get(sourceTarget);
|
|
480629
|
+
if (existing)
|
|
480630
|
+
existing.push(id2);
|
|
480631
|
+
else
|
|
480632
|
+
sourceRelIdsByTarget.set(sourceTarget, [id2]);
|
|
480492
480633
|
}
|
|
480493
480634
|
}
|
|
480494
480635
|
const setHeaderIdsArray = (idsHolder, relId) => {
|
|
@@ -480573,10 +480714,10 @@ function importHeaderFooterAssets2(editor, converter, byName, dryRun) {
|
|
|
480573
480714
|
}
|
|
480574
480715
|
});
|
|
480575
480716
|
docRelsChanged = true;
|
|
480576
|
-
const
|
|
480577
|
-
|
|
480578
|
-
result.relIdRemap.set(
|
|
480579
|
-
result.mappings.push({ kind: "relationship", from:
|
|
480717
|
+
const sourceRelIds = sourceRelIdsByTarget.get(sourceTarget) ?? [];
|
|
480718
|
+
for (const sourceRelId of sourceRelIds) {
|
|
480719
|
+
result.relIdRemap.set(sourceRelId, relId);
|
|
480720
|
+
result.mappings.push({ kind: "relationship", from: sourceRelId, to: relId });
|
|
480580
480721
|
}
|
|
480581
480722
|
if (ensureContentTypeOverride2(converter, targetPartName, kind === "header" ? HEADER_CONTENT_TYPE2 : FOOTER_CONTENT_TYPE2)) {
|
|
480582
480723
|
contentTypesChanged = true;
|
|
@@ -480618,6 +480759,32 @@ function ensureContentTypeOverride2(converter, partPath, contentType) {
|
|
|
480618
480759
|
});
|
|
480619
480760
|
return true;
|
|
480620
480761
|
}
|
|
480762
|
+
function toSectionXmlElement2(node4) {
|
|
480763
|
+
if (!node4.name) {
|
|
480764
|
+
throw new Error("Expected named XML element.");
|
|
480765
|
+
}
|
|
480766
|
+
return {
|
|
480767
|
+
type: node4.type,
|
|
480768
|
+
name: node4.name,
|
|
480769
|
+
attributes: node4.attributes ? { ...node4.attributes } : undefined,
|
|
480770
|
+
elements: node4.elements?.filter((child) => typeof child.name === "string").map((child) => toSectionXmlElement2(child))
|
|
480771
|
+
};
|
|
480772
|
+
}
|
|
480773
|
+
function mergePageOneHeaderFooterModel2(targetSectPr, sourceSectPr) {
|
|
480774
|
+
const mergedSectPr = ensureSectPrElement2(targetSectPr);
|
|
480775
|
+
for (const kind of HEADER_FOOTER_KINDS5) {
|
|
480776
|
+
for (const variant of HEADER_FOOTER_VARIANTS5) {
|
|
480777
|
+
const sourceRef = getSectPrHeaderFooterRef2(sourceSectPr, kind, variant);
|
|
480778
|
+
if (sourceRef) {
|
|
480779
|
+
setSectPrHeaderFooterRef2(mergedSectPr, kind, variant, sourceRef);
|
|
480780
|
+
} else {
|
|
480781
|
+
clearSectPrHeaderFooterRef2(mergedSectPr, kind, variant);
|
|
480782
|
+
}
|
|
480783
|
+
}
|
|
480784
|
+
}
|
|
480785
|
+
writeSectPrTitlePage2(mergedSectPr, readSectPrTitlePage2(sourceSectPr));
|
|
480786
|
+
return mergedSectPr;
|
|
480787
|
+
}
|
|
480621
480788
|
function applyPageOneSectionDefaults2(editor, sourceDocumentXml, relIdRemap, parseXml2, dryRun) {
|
|
480622
480789
|
const result = {
|
|
480623
480790
|
detected: false,
|
|
@@ -480636,8 +480803,18 @@ function applyPageOneSectionDefaults2(editor, sourceDocumentXml, relIdRemap, par
|
|
|
480636
480803
|
if (!sourceSectPr)
|
|
480637
480804
|
return result;
|
|
480638
480805
|
result.detected = true;
|
|
480639
|
-
|
|
480640
|
-
|
|
480806
|
+
let sectPr;
|
|
480807
|
+
try {
|
|
480808
|
+
const rewrittenSectPr = clone3(sourceSectPr);
|
|
480809
|
+
rewriteSectPrRefs2(rewrittenSectPr, relIdRemap);
|
|
480810
|
+
sectPr = toSectionXmlElement2(rewrittenSectPr);
|
|
480811
|
+
} catch {
|
|
480812
|
+
result.warnings.push({
|
|
480813
|
+
code: "SECTION_DEFAULTS_UNAVAILABLE",
|
|
480814
|
+
message: "Could not normalize the source page-1 sectPr."
|
|
480815
|
+
});
|
|
480816
|
+
return result;
|
|
480817
|
+
}
|
|
480641
480818
|
let projections;
|
|
480642
480819
|
try {
|
|
480643
480820
|
projections = resolveSectionProjections2(editor);
|
|
@@ -480648,24 +480825,47 @@ function applyPageOneSectionDefaults2(editor, sourceDocumentXml, relIdRemap, par
|
|
|
480648
480825
|
});
|
|
480649
480826
|
return result;
|
|
480650
480827
|
}
|
|
480651
|
-
|
|
480652
|
-
if (!bodyProjection) {
|
|
480828
|
+
if (projections.length === 0) {
|
|
480653
480829
|
result.warnings.push({
|
|
480654
480830
|
code: "SECTION_DEFAULTS_UNAVAILABLE",
|
|
480655
|
-
message: "No
|
|
480831
|
+
message: "No section projections found for page-1 sectPr adoption."
|
|
480656
480832
|
});
|
|
480657
480833
|
return result;
|
|
480658
480834
|
}
|
|
480659
|
-
const
|
|
480660
|
-
|
|
480835
|
+
const bodyProjection = [...projections].reverse().find((projection) => projection.target.kind === "body") ?? projections[projections.length - 1];
|
|
480836
|
+
const sectionUpdates = projections.map((projection) => {
|
|
480837
|
+
const currentSectPr = readTargetSectPr2(editor, projection);
|
|
480838
|
+
const nextSectPr = projection.sectionId === bodyProjection.sectionId ? clone3(sectPr) : mergePageOneHeaderFooterModel2(currentSectPr, sectPr);
|
|
480839
|
+
if (xmlDeepEqual2(currentSectPr, nextSectPr))
|
|
480840
|
+
return null;
|
|
480841
|
+
return {
|
|
480842
|
+
sectionId: projection.sectionId,
|
|
480843
|
+
nextSectPr
|
|
480844
|
+
};
|
|
480845
|
+
}).filter((update) => Boolean(update));
|
|
480846
|
+
if (sectionUpdates.length === 0) {
|
|
480661
480847
|
return result;
|
|
480662
480848
|
}
|
|
480663
480849
|
result.changed = true;
|
|
480664
|
-
result.changedParts.push({
|
|
480850
|
+
result.changedParts.push({
|
|
480851
|
+
part: "word/document.xml",
|
|
480852
|
+
scope: "sectionDefaults",
|
|
480853
|
+
change: sectionUpdates.some((update) => update.sectionId !== bodyProjection.sectionId) ? "merged" : "replaced"
|
|
480854
|
+
});
|
|
480665
480855
|
if (dryRun)
|
|
480666
480856
|
return result;
|
|
480667
480857
|
try {
|
|
480668
|
-
|
|
480858
|
+
for (let index3 = 0;index3 < sectionUpdates.length; index3 += 1) {
|
|
480859
|
+
const update = sectionUpdates[index3];
|
|
480860
|
+
const liveProjection = resolveSectionProjections2(editor).find((projection) => projection.sectionId === update.sectionId);
|
|
480861
|
+
if (!liveProjection) {
|
|
480862
|
+
throw new Error(`Section ${update.sectionId} disappeared during page-1 sectPr adoption.`);
|
|
480863
|
+
}
|
|
480864
|
+
applySectPrToProjection3(editor, liveProjection, clone3(update.nextSectPr), {
|
|
480865
|
+
addToHistory: index3 === sectionUpdates.length - 1
|
|
480866
|
+
});
|
|
480867
|
+
}
|
|
480868
|
+
clearIndexCache2(editor);
|
|
480669
480869
|
result.applied = true;
|
|
480670
480870
|
} catch (err) {
|
|
480671
480871
|
result.changed = false;
|
|
@@ -480677,13 +480877,17 @@ function applyPageOneSectionDefaults2(editor, sourceDocumentXml, relIdRemap, par
|
|
|
480677
480877
|
}
|
|
480678
480878
|
return result;
|
|
480679
480879
|
}
|
|
480680
|
-
var HEADER_REL_TYPE4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_REL_TYPE4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", IMAGE_REL_TYPE4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", HEADER_CONTENT_TYPE2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", FOOTER_CONTENT_TYPE2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", CONTENT_TYPES_PART2 = "[Content_Types].xml", DOCUMENT_RELS_PART2 = "word/_rels/document.xml.rels";
|
|
480880
|
+
var HEADER_REL_TYPE4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_REL_TYPE4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", IMAGE_REL_TYPE4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", HEADER_CONTENT_TYPE2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", FOOTER_CONTENT_TYPE2 = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", CONTENT_TYPES_PART2 = "[Content_Types].xml", DOCUMENT_RELS_PART2 = "word/_rels/document.xml.rels", HEADER_FOOTER_KINDS5, HEADER_FOOTER_VARIANTS5;
|
|
480681
480881
|
var init_template_assets = __esm(() => {
|
|
480682
480882
|
init_template_xml();
|
|
480683
480883
|
init_read_package();
|
|
480684
480884
|
init_sections_resolver();
|
|
480685
480885
|
init_section_mutation_wrapper();
|
|
480686
480886
|
init_section_projection_access();
|
|
480887
|
+
init_index_cache();
|
|
480888
|
+
init_sections_xml();
|
|
480889
|
+
HEADER_FOOTER_KINDS5 = ["header", "footer"];
|
|
480890
|
+
HEADER_FOOTER_VARIANTS5 = ["default", "first", "even"];
|
|
480687
480891
|
});
|
|
480688
480892
|
|
|
480689
480893
|
// ../../packages/super-editor/src/editors/v1/document-api-adapters/templates/templates-adapter.ts
|
|
@@ -481069,7 +481273,7 @@ async function applyTemplateAsync2(editor, converter, input2, options) {
|
|
|
481069
481273
|
appliedScopes.push({ scope: "sectionDefaults", part: "word/document.xml" });
|
|
481070
481274
|
} else if (sec.detected) {
|
|
481071
481275
|
warnings.push(...sec.warnings);
|
|
481072
|
-
pushNoChangeSkip2(skippedScopes, "sectionDefaults", "word/document.xml", sec.warnings.length > 0 ? "Source page-1 section defaults could not be applied." : "Source page-1 section defaults already match the active section defaults.");
|
|
481276
|
+
pushNoChangeSkip2(skippedScopes, "sectionDefaults", "word/document.xml", sec.warnings.length > 0 ? "Source page-1 section defaults could not be applied." : "Source page-1 section defaults already match the current document's active section defaults and section header/footer visibility model.");
|
|
481073
481277
|
}
|
|
481074
481278
|
}
|
|
481075
481279
|
if (styleMappings.length > 0)
|
|
@@ -508856,10 +509060,9 @@ EXAMPLES:
|
|
|
508856
509060
|
"insert",
|
|
508857
509061
|
"delete",
|
|
508858
509062
|
"replacement",
|
|
508859
|
-
"format"
|
|
508860
|
-
"structural"
|
|
509063
|
+
"format"
|
|
508861
509064
|
],
|
|
508862
|
-
description: "Filter by change type: 'insert', 'delete', 'replacement',
|
|
509065
|
+
description: "Filter by change type: 'insert', 'delete', 'replacement', or 'format'. Only for action 'list'. Omit for other actions."
|
|
508863
509066
|
},
|
|
508864
509067
|
force: {
|
|
508865
509068
|
type: "boolean",
|