oasis-editor 0.0.162 → 0.0.164
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/{OasisEditorApp-1SLQ3toO.js → OasisEditorApp-B5U2tjAM.js} +1 -1
- package/dist/assets/{importDocxWorker-BnENWXFH.js → importDocxWorker-q9FwIHr4.js} +1 -1
- package/dist/core/model/types/runSdtAugmentation.d.ts +16 -0
- package/dist/export/docx/text/revisionXml.d.ts +15 -0
- package/dist/import/docx/runs/types.d.ts +3 -1
- package/dist/{index-BY8DRmWC.js → index-BGlDfVIA.js} +231 -15
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +4 -4
- package/package.json +1 -1
|
@@ -8,6 +8,22 @@ declare module "./nodes.js" {
|
|
|
8
8
|
interface EditorRunBase {
|
|
9
9
|
/** Enclosing inline `w:sdt` content controls, outermost first. */
|
|
10
10
|
sdtWrappers?: EditorSdtBlockWrapper[];
|
|
11
|
+
/**
|
|
12
|
+
* Zero-length Word move-container boundary (`moveFrom/ToRangeStart/End`).
|
|
13
|
+
* Start markers carry CT_MoveBookmark metadata; end markers retain the
|
|
14
|
+
* matching id and optional custom-XML displacement hint.
|
|
15
|
+
*/
|
|
16
|
+
revisionRangeMarker?: {
|
|
17
|
+
move: "from" | "to";
|
|
18
|
+
edge: "start" | "end";
|
|
19
|
+
id: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
author?: string;
|
|
22
|
+
date?: number;
|
|
23
|
+
columnFirst?: number;
|
|
24
|
+
columnLast?: number;
|
|
25
|
+
displacedByCustomXml?: string;
|
|
26
|
+
};
|
|
11
27
|
}
|
|
12
28
|
interface EditorTableRowNode {
|
|
13
29
|
/** Enclosing row-level `w:sdt` content controls, outermost first. */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EditorRevision, EditorRunBase } from '../../../core/model.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Word stores visible text from deletion-like revisions in `w:delText` and
|
|
5
|
+
* deleted field instructions in `w:delInstrText`. Canonical run generation uses
|
|
6
|
+
* the ordinary tags, so normalize only direct run children here. If a source
|
|
7
|
+
* overlay retained stale deleted-text children after an edit, the generated
|
|
8
|
+
* ordinary child is authoritative and the stale counterpart is removed first.
|
|
9
|
+
*/
|
|
10
|
+
export declare function serializeDeletionRunContent(xml: string): string;
|
|
11
|
+
export declare function serializeRunRevisionWrapper(innerXml: string, revision: EditorRevision): string;
|
|
12
|
+
type MoveRangeMarker = NonNullable<EditorRunBase["revisionRangeMarker"]>;
|
|
13
|
+
/** Serializes a zero-length move source/destination container boundary. */
|
|
14
|
+
export declare function serializeMoveRangeMarker(marker: MoveRangeMarker): string;
|
|
15
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Element as XmlElement } from '@xmldom/xmldom';
|
|
2
|
-
import { EditorBlockNode, EditorTextStyle, EditorImageRunData, EditorTextBoxData, EditorMathExpression, EditorRevision, EditorSdtBlockWrapper } from '../../../core/model.js';
|
|
2
|
+
import { EditorBlockNode, EditorTextStyle, EditorImageRunData, EditorTextBoxData, EditorMathExpression, EditorRevision, EditorRunBase, EditorSdtBlockWrapper } from '../../../core/model.js';
|
|
3
3
|
|
|
4
4
|
export type ParseNestedBlocks = (container: XmlElement) => Promise<EditorBlockNode[]>;
|
|
5
5
|
/**
|
|
@@ -30,6 +30,8 @@ export interface ImportedRun {
|
|
|
30
30
|
styles?: EditorTextStyle;
|
|
31
31
|
/** Tracked insertion/deletion, optionally paired as a Word move. */
|
|
32
32
|
revision?: EditorRevision;
|
|
33
|
+
/** Zero-length move range start/end marker retained in inline order. */
|
|
34
|
+
revisionRangeMarker?: EditorRunBase["revisionRangeMarker"];
|
|
33
35
|
/** Enclosing inline `w:sdt` wrappers, outermost first. */
|
|
34
36
|
sdtWrappers?: EditorSdtBlockWrapper[];
|
|
35
37
|
field?: {
|
|
@@ -2863,7 +2863,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2863
2863
|
onCleanup(() => {
|
|
2864
2864
|
cancelled = true;
|
|
2865
2865
|
});
|
|
2866
|
-
import("./OasisEditorApp-
|
|
2866
|
+
import("./OasisEditorApp-B5U2tjAM.js").then((m) => {
|
|
2867
2867
|
cancelled = true;
|
|
2868
2868
|
setProgress(1);
|
|
2869
2869
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
|
@@ -39752,6 +39752,57 @@ function parseCommentMarker(element) {
|
|
|
39752
39752
|
docxId
|
|
39753
39753
|
};
|
|
39754
39754
|
}
|
|
39755
|
+
function fallbackRevisionId(element) {
|
|
39756
|
+
const xml = new XMLSerializer().serializeToString(element);
|
|
39757
|
+
let hash = 2166136261;
|
|
39758
|
+
for (let index = 0; index < xml.length; index += 1) {
|
|
39759
|
+
hash ^= xml.charCodeAt(index);
|
|
39760
|
+
hash = Math.imul(hash, 16777619);
|
|
39761
|
+
}
|
|
39762
|
+
return `revision:${hash >>> 0}`;
|
|
39763
|
+
}
|
|
39764
|
+
function parseRevisionContainer(element) {
|
|
39765
|
+
const kind = element.localName;
|
|
39766
|
+
if (kind !== "ins" && kind !== "del" && kind !== "moveFrom" && kind !== "moveTo") {
|
|
39767
|
+
return void 0;
|
|
39768
|
+
}
|
|
39769
|
+
const rawDate = getAttributeValue(element, "date");
|
|
39770
|
+
const parsedDate = rawDate ? Date.parse(rawDate) : Number.NaN;
|
|
39771
|
+
const isDeletion = kind === "del" || kind === "moveFrom";
|
|
39772
|
+
return {
|
|
39773
|
+
id: getAttributeValue(element, "id") ?? fallbackRevisionId(element),
|
|
39774
|
+
type: isDeletion ? "delete" : "insert",
|
|
39775
|
+
author: getAttributeValue(element, "author") ?? "Unknown",
|
|
39776
|
+
date: Number.isFinite(parsedDate) ? parsedDate : 0,
|
|
39777
|
+
...kind === "moveFrom" ? { move: "from" } : kind === "moveTo" ? { move: "to" } : {}
|
|
39778
|
+
};
|
|
39779
|
+
}
|
|
39780
|
+
function parseMoveRangeMarker(element) {
|
|
39781
|
+
const match = /^move(From|To)Range(Start|End)$/.exec(element.localName ?? "");
|
|
39782
|
+
if (!match) return void 0;
|
|
39783
|
+
const move = match[1] === "From" ? "from" : "to";
|
|
39784
|
+
const edge = match[2] === "Start" ? "start" : "end";
|
|
39785
|
+
const rawDate = getAttributeValue(element, "date");
|
|
39786
|
+
const parsedDate = rawDate ? Date.parse(rawDate) : Number.NaN;
|
|
39787
|
+
const colFirstRaw = getAttributeValue(element, "colFirst");
|
|
39788
|
+
const colLastRaw = getAttributeValue(element, "colLast");
|
|
39789
|
+
const columnFirst = colFirstRaw !== null ? Number.parseInt(colFirstRaw, 10) : Number.NaN;
|
|
39790
|
+
const columnLast = colLastRaw !== null ? Number.parseInt(colLastRaw, 10) : Number.NaN;
|
|
39791
|
+
const name = getAttributeValue(element, "name") ?? void 0;
|
|
39792
|
+
const author = getAttributeValue(element, "author") ?? void 0;
|
|
39793
|
+
const displacedByCustomXml = getAttributeValue(element, "displacedByCustomXml") ?? void 0;
|
|
39794
|
+
return {
|
|
39795
|
+
move,
|
|
39796
|
+
edge,
|
|
39797
|
+
id: getAttributeValue(element, "id") ?? fallbackRevisionId(element),
|
|
39798
|
+
...name !== void 0 ? { name } : {},
|
|
39799
|
+
...author !== void 0 ? { author } : {},
|
|
39800
|
+
...Number.isFinite(parsedDate) ? { date: parsedDate } : {},
|
|
39801
|
+
...Number.isFinite(columnFirst) ? { columnFirst } : {},
|
|
39802
|
+
...Number.isFinite(columnLast) ? { columnLast } : {},
|
|
39803
|
+
...displacedByCustomXml !== void 0 ? { displacedByCustomXml } : {}
|
|
39804
|
+
};
|
|
39805
|
+
}
|
|
39755
39806
|
async function parseRunElement(runElement, zip, relsMap, assets, parseNestedBlocks) {
|
|
39756
39807
|
const textParts = [];
|
|
39757
39808
|
let image;
|
|
@@ -39772,7 +39823,7 @@ async function parseRunElement(runElement, zip, relsMap, assets, parseNestedBloc
|
|
|
39772
39823
|
}
|
|
39773
39824
|
const element = node;
|
|
39774
39825
|
if (element.namespaceURI === WORD_NS$3) {
|
|
39775
|
-
if (element.localName === "t") {
|
|
39826
|
+
if (element.localName === "t" || element.localName === "delText") {
|
|
39776
39827
|
pushText(element.textContent ?? "");
|
|
39777
39828
|
} else if (element.localName === "tab") {
|
|
39778
39829
|
pushText(" ");
|
|
@@ -39959,6 +40010,31 @@ async function parseRunsContainer(container, numberingMaps, zip, relsMap, assets
|
|
|
39959
40010
|
runs.push({ text: "", comment: marker });
|
|
39960
40011
|
continue;
|
|
39961
40012
|
}
|
|
40013
|
+
const moveRangeMarker = parseMoveRangeMarker(element);
|
|
40014
|
+
if (moveRangeMarker) {
|
|
40015
|
+
runs.push({ text: "", revisionRangeMarker: moveRangeMarker });
|
|
40016
|
+
continue;
|
|
40017
|
+
}
|
|
40018
|
+
const revision = parseRevisionContainer(element);
|
|
40019
|
+
if (revision) {
|
|
40020
|
+
const nestedRuns = await parseRunsContainer(
|
|
40021
|
+
element,
|
|
40022
|
+
numberingMaps,
|
|
40023
|
+
zip,
|
|
40024
|
+
relsMap,
|
|
40025
|
+
assets,
|
|
40026
|
+
theme,
|
|
40027
|
+
inheritedLink,
|
|
40028
|
+
parseNestedBlocks
|
|
40029
|
+
);
|
|
40030
|
+
for (const nestedRun of nestedRuns) {
|
|
40031
|
+
runs.push({
|
|
40032
|
+
...nestedRun,
|
|
40033
|
+
revision: nestedRun.revision ?? revision
|
|
40034
|
+
});
|
|
40035
|
+
}
|
|
40036
|
+
continue;
|
|
40037
|
+
}
|
|
39962
40038
|
if (element.localName === "sdt") {
|
|
39963
40039
|
const sdtContent = getFirstChildByTagNameNS(element, WORD_NS$3, "sdtContent");
|
|
39964
40040
|
if (!sdtContent) {
|
|
@@ -39994,7 +40070,7 @@ async function parseRunsContainer(container, numberingMaps, zip, relsMap, assets
|
|
|
39994
40070
|
getFirstChildByTagNameNS(element, WORD_NS$3, "rPr"),
|
|
39995
40071
|
theme
|
|
39996
40072
|
);
|
|
39997
|
-
const hasFieldControl = getChildrenByTagNameNS(element, WORD_NS$3, "fldChar").length > 0 || getChildrenByTagNameNS(element, WORD_NS$3, "instrText").length > 0;
|
|
40073
|
+
const hasFieldControl = getChildrenByTagNameNS(element, WORD_NS$3, "fldChar").length > 0 || getChildrenByTagNameNS(element, WORD_NS$3, "instrText").length > 0 || getChildrenByTagNameNS(element, WORD_NS$3, "delInstrText").length > 0;
|
|
39998
40074
|
if (hasFieldControl) {
|
|
39999
40075
|
for (let child2 = 0; child2 < element.childNodes.length; child2 += 1) {
|
|
40000
40076
|
const childNode = element.childNodes[child2];
|
|
@@ -40007,7 +40083,7 @@ async function parseRunsContainer(container, numberingMaps, zip, relsMap, assets
|
|
|
40007
40083
|
}
|
|
40008
40084
|
if (childElement.localName === "fldChar") {
|
|
40009
40085
|
onFldChar(childElement, runStyles);
|
|
40010
|
-
} else if (childElement.localName === "instrText") {
|
|
40086
|
+
} else if (childElement.localName === "instrText" || childElement.localName === "delInstrText") {
|
|
40011
40087
|
onInstrText(childElement, runStyles);
|
|
40012
40088
|
}
|
|
40013
40089
|
}
|
|
@@ -40540,6 +40616,9 @@ function importedRunToEditorRun(run) {
|
|
|
40540
40616
|
if (run.revision) {
|
|
40541
40617
|
base.revision = { ...run.revision };
|
|
40542
40618
|
}
|
|
40619
|
+
if (run.revisionRangeMarker) {
|
|
40620
|
+
base.revisionRangeMarker = { ...run.revisionRangeMarker };
|
|
40621
|
+
}
|
|
40543
40622
|
if ((_a2 = run.sdtWrappers) == null ? void 0 : _a2.length) {
|
|
40544
40623
|
base.sdtWrappers = [...run.sdtWrappers];
|
|
40545
40624
|
}
|
|
@@ -40622,7 +40701,7 @@ function splitRunsAtPageBreaks(runs) {
|
|
|
40622
40701
|
const segments = [[]];
|
|
40623
40702
|
let hasPageBreak = false;
|
|
40624
40703
|
const appendRun = (run, text2) => {
|
|
40625
|
-
if (text2.length === 0 && !run.image && !run.textBox && !run.field && !run.fieldChar && run.fieldInstruction === void 0 && !run.bookmark && !run.comment) {
|
|
40704
|
+
if (text2.length === 0 && !run.image && !run.textBox && !run.field && !run.fieldChar && run.fieldInstruction === void 0 && !run.bookmark && !run.comment && !run.revisionRangeMarker) {
|
|
40626
40705
|
return;
|
|
40627
40706
|
}
|
|
40628
40707
|
segments[segments.length - 1].push({
|
|
@@ -40648,7 +40727,7 @@ function splitRunsAtPageBreaks(runs) {
|
|
|
40648
40727
|
}
|
|
40649
40728
|
function paragraphHasVisibleContent(runs) {
|
|
40650
40729
|
return runs.some(
|
|
40651
|
-
(run) => run.image || run.textBox || run.field || run.fieldChar || run.fieldInstruction !== void 0 || run.bookmark || run.comment || run.text.replace(/\s/g, "").length > 0
|
|
40730
|
+
(run) => run.image || run.textBox || run.field || run.fieldChar || run.fieldInstruction !== void 0 || run.bookmark || run.comment || run.revisionRangeMarker || run.text.replace(/\s/g, "").length > 0
|
|
40652
40731
|
);
|
|
40653
40732
|
}
|
|
40654
40733
|
async function parseParagraphNodes(paragraphNode, numberingMaps, zip, relsMap, assets, theme, parseNestedBlocks, inheritedStyle) {
|
|
@@ -43259,7 +43338,7 @@ function wrapTableStructuralSdts(table, tableElement) {
|
|
|
43259
43338
|
}))
|
|
43260
43339
|
);
|
|
43261
43340
|
}
|
|
43262
|
-
function elementChildren(node) {
|
|
43341
|
+
function elementChildren$1(node) {
|
|
43263
43342
|
const children2 = [];
|
|
43264
43343
|
for (let index = 0; index < node.childNodes.length; index += 1) {
|
|
43265
43344
|
const child2 = node.childNodes[index];
|
|
@@ -43311,8 +43390,8 @@ function matchingChildByOccurrence(sourceChildren, sourceIndex, generatedChildre
|
|
|
43311
43390
|
}
|
|
43312
43391
|
function mergeNestedExtensionMarkup(source, generated) {
|
|
43313
43392
|
copyExtensionAttributes(source, generated);
|
|
43314
|
-
const sourceChildren = elementChildren(source);
|
|
43315
|
-
const generatedChildren = elementChildren(generated);
|
|
43393
|
+
const sourceChildren = elementChildren$1(source);
|
|
43394
|
+
const generatedChildren = elementChildren$1(generated);
|
|
43316
43395
|
sourceChildren.forEach((sourceChild, sourceIndex) => {
|
|
43317
43396
|
const generatedChild = matchingChildByOccurrence(
|
|
43318
43397
|
sourceChildren,
|
|
@@ -45145,7 +45224,139 @@ function mergeRunOoxmlSourceIntoGeneratedXml(run, generatedXml) {
|
|
|
45145
45224
|
mergeSourceRunChildren(sourceRun, generatedRun);
|
|
45146
45225
|
return new XMLSerializer().serializeToString(generatedRun);
|
|
45147
45226
|
}
|
|
45227
|
+
const WRAPPER_XMLNS = `xmlns:oasis="urn:oasis:docx" xmlns:w="${WORD_NS$1}" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"`;
|
|
45228
|
+
function elementChildren(element) {
|
|
45229
|
+
const result = [];
|
|
45230
|
+
for (let index = 0; index < element.childNodes.length; index += 1) {
|
|
45231
|
+
const child2 = element.childNodes[index];
|
|
45232
|
+
if ((child2 == null ? void 0 : child2.nodeType) === child2.ELEMENT_NODE) {
|
|
45233
|
+
result.push(child2);
|
|
45234
|
+
}
|
|
45235
|
+
}
|
|
45236
|
+
return result;
|
|
45237
|
+
}
|
|
45238
|
+
function parseSingleRun(xml) {
|
|
45239
|
+
const wrapper = new DOMParser$1().parseFromString(
|
|
45240
|
+
`<oasis:root ${WRAPPER_XMLNS}>${xml}</oasis:root>`,
|
|
45241
|
+
"application/xml"
|
|
45242
|
+
).documentElement;
|
|
45243
|
+
if (!wrapper) return void 0;
|
|
45244
|
+
const children2 = elementChildren(wrapper);
|
|
45245
|
+
if (children2.length !== 1) return void 0;
|
|
45246
|
+
const run = children2[0];
|
|
45247
|
+
return run.namespaceURI === WORD_NS$1 && run.localName === "r" ? run : void 0;
|
|
45248
|
+
}
|
|
45249
|
+
function replaceWordChildName(parent, source, targetLocalName) {
|
|
45250
|
+
const ownerDocument = parent.ownerDocument;
|
|
45251
|
+
if (!ownerDocument) return;
|
|
45252
|
+
const replacement = ownerDocument.createElementNS(
|
|
45253
|
+
WORD_NS$1,
|
|
45254
|
+
`w:${targetLocalName}`
|
|
45255
|
+
);
|
|
45256
|
+
for (let index = 0; index < source.attributes.length; index += 1) {
|
|
45257
|
+
const attribute = source.attributes.item(index);
|
|
45258
|
+
if (!attribute) continue;
|
|
45259
|
+
if (attribute.namespaceURI) {
|
|
45260
|
+
replacement.setAttributeNS(
|
|
45261
|
+
attribute.namespaceURI,
|
|
45262
|
+
attribute.name,
|
|
45263
|
+
attribute.value
|
|
45264
|
+
);
|
|
45265
|
+
} else {
|
|
45266
|
+
replacement.setAttribute(attribute.name, attribute.value);
|
|
45267
|
+
}
|
|
45268
|
+
}
|
|
45269
|
+
while (source.firstChild) {
|
|
45270
|
+
replacement.appendChild(source.firstChild);
|
|
45271
|
+
}
|
|
45272
|
+
parent.replaceChild(replacement, source);
|
|
45273
|
+
}
|
|
45274
|
+
function serializeDeletionRunContent(xml) {
|
|
45275
|
+
const run = parseSingleRun(xml);
|
|
45276
|
+
if (!run) return xml;
|
|
45277
|
+
const children2 = elementChildren(run);
|
|
45278
|
+
const generatedText = children2.filter(
|
|
45279
|
+
(child2) => child2.namespaceURI === WORD_NS$1 && child2.localName === "t"
|
|
45280
|
+
);
|
|
45281
|
+
if (generatedText.length > 0) {
|
|
45282
|
+
for (const child2 of children2) {
|
|
45283
|
+
if (child2.namespaceURI === WORD_NS$1 && child2.localName === "delText") {
|
|
45284
|
+
run.removeChild(child2);
|
|
45285
|
+
}
|
|
45286
|
+
}
|
|
45287
|
+
for (const child2 of generatedText) {
|
|
45288
|
+
replaceWordChildName(run, child2, "delText");
|
|
45289
|
+
}
|
|
45290
|
+
}
|
|
45291
|
+
const refreshed = elementChildren(run);
|
|
45292
|
+
const generatedInstructions = refreshed.filter(
|
|
45293
|
+
(child2) => child2.namespaceURI === WORD_NS$1 && child2.localName === "instrText"
|
|
45294
|
+
);
|
|
45295
|
+
if (generatedInstructions.length > 0) {
|
|
45296
|
+
for (const child2 of refreshed) {
|
|
45297
|
+
if (child2.namespaceURI === WORD_NS$1 && child2.localName === "delInstrText") {
|
|
45298
|
+
run.removeChild(child2);
|
|
45299
|
+
}
|
|
45300
|
+
}
|
|
45301
|
+
for (const child2 of generatedInstructions) {
|
|
45302
|
+
replaceWordChildName(run, child2, "delInstrText");
|
|
45303
|
+
}
|
|
45304
|
+
}
|
|
45305
|
+
return new XMLSerializer().serializeToString(run);
|
|
45306
|
+
}
|
|
45307
|
+
function revisionNumericId(id) {
|
|
45308
|
+
if (/^\d+$/.test(id)) return id;
|
|
45309
|
+
return String(
|
|
45310
|
+
Array.from(id).reduce(
|
|
45311
|
+
(hash, character) => hash * 31 + character.charCodeAt(0) >>> 0,
|
|
45312
|
+
0
|
|
45313
|
+
)
|
|
45314
|
+
);
|
|
45315
|
+
}
|
|
45316
|
+
function revisionElementName(revision) {
|
|
45317
|
+
if (revision.move === "from") return "moveFrom";
|
|
45318
|
+
if (revision.move === "to") return "moveTo";
|
|
45319
|
+
return revision.type === "delete" ? "del" : "ins";
|
|
45320
|
+
}
|
|
45321
|
+
function serializeRunRevisionWrapper(innerXml, revision) {
|
|
45322
|
+
const date = Number.isFinite(revision.date) ? new Date(revision.date).toISOString() : (/* @__PURE__ */ new Date(0)).toISOString();
|
|
45323
|
+
const attributes = `w:id="${revisionNumericId(revision.id)}" w:author="${escapeXml(revision.author)}" w:date="${date}"`;
|
|
45324
|
+
const element = revisionElementName(revision);
|
|
45325
|
+
return `<w:${element} ${attributes}>${innerXml}</w:${element}>`;
|
|
45326
|
+
}
|
|
45327
|
+
function serializeMoveRangeMarker(marker) {
|
|
45328
|
+
const element = `move${marker.move === "from" ? "From" : "To"}Range${marker.edge === "start" ? "Start" : "End"}`;
|
|
45329
|
+
const attributes = [
|
|
45330
|
+
`w:id="${revisionNumericId(marker.id)}"`
|
|
45331
|
+
];
|
|
45332
|
+
if (marker.displacedByCustomXml !== void 0) {
|
|
45333
|
+
attributes.push(
|
|
45334
|
+
`w:displacedByCustomXml="${escapeXml(marker.displacedByCustomXml)}"`
|
|
45335
|
+
);
|
|
45336
|
+
}
|
|
45337
|
+
if (marker.edge === "start") {
|
|
45338
|
+
if (marker.name !== void 0) {
|
|
45339
|
+
attributes.push(`w:name="${escapeXml(marker.name)}"`);
|
|
45340
|
+
}
|
|
45341
|
+
if (marker.author !== void 0) {
|
|
45342
|
+
attributes.push(`w:author="${escapeXml(marker.author)}"`);
|
|
45343
|
+
}
|
|
45344
|
+
if (marker.date !== void 0 && Number.isFinite(marker.date)) {
|
|
45345
|
+
attributes.push(`w:date="${new Date(marker.date).toISOString()}"`);
|
|
45346
|
+
}
|
|
45347
|
+
if (marker.columnFirst !== void 0) {
|
|
45348
|
+
attributes.push(`w:colFirst="${Math.trunc(marker.columnFirst)}"`);
|
|
45349
|
+
}
|
|
45350
|
+
if (marker.columnLast !== void 0) {
|
|
45351
|
+
attributes.push(`w:colLast="${Math.trunc(marker.columnLast)}"`);
|
|
45352
|
+
}
|
|
45353
|
+
}
|
|
45354
|
+
return `<w:${element} ${attributes.join(" ")}/>`;
|
|
45355
|
+
}
|
|
45148
45356
|
function serializeRun(run, context2, paragraphStyleId, styles, serializeBlocksXml2) {
|
|
45357
|
+
if (run.revisionRangeMarker) {
|
|
45358
|
+
return serializeMoveRangeMarker(run.revisionRangeMarker);
|
|
45359
|
+
}
|
|
45149
45360
|
if (run.__isFootnoteRefMarker) {
|
|
45150
45361
|
return serializeFootnoteRefMarker();
|
|
45151
45362
|
}
|
|
@@ -45194,19 +45405,23 @@ function serializeRun(run, context2, paragraphStyleId, styles, serializeBlocksXm
|
|
|
45194
45405
|
return mergeRunOoxmlSourceIntoGeneratedXml(run, generatedXml);
|
|
45195
45406
|
}
|
|
45196
45407
|
function serializeRunWithRelationships(run, context2, paragraphStyleId, styles, serializeBlocksXml2) {
|
|
45197
|
-
var _a2;
|
|
45198
|
-
|
|
45408
|
+
var _a2, _b2;
|
|
45409
|
+
let runXml = serializeRun(
|
|
45199
45410
|
run,
|
|
45200
45411
|
context2,
|
|
45201
45412
|
paragraphStyleId,
|
|
45202
45413
|
styles,
|
|
45203
45414
|
serializeBlocksXml2
|
|
45204
45415
|
);
|
|
45205
|
-
|
|
45206
|
-
if (!href) {
|
|
45416
|
+
if (run.revisionRangeMarker) {
|
|
45207
45417
|
return runXml;
|
|
45208
45418
|
}
|
|
45209
|
-
|
|
45419
|
+
if (((_a2 = run.revision) == null ? void 0 : _a2.type) === "delete") {
|
|
45420
|
+
runXml = serializeDeletionRunContent(runXml);
|
|
45421
|
+
}
|
|
45422
|
+
const href = (_b2 = run.styles) == null ? void 0 : _b2.link;
|
|
45423
|
+
const linkedXml = href ? wrapRunWithHyperlink(runXml, href, context2) : runXml;
|
|
45424
|
+
return run.revision ? serializeRunRevisionWrapper(linkedXml, run.revision) : linkedXml;
|
|
45210
45425
|
}
|
|
45211
45426
|
function serializeRunsWithInlineSdts(runs, serializeRun2) {
|
|
45212
45427
|
var _a2, _b2, _c;
|
|
@@ -46590,6 +46805,7 @@ function cloneRun(run) {
|
|
|
46590
46805
|
text: run.text,
|
|
46591
46806
|
styles: cloneStyle(run.styles),
|
|
46592
46807
|
revision: run.revision ? { ...run.revision } : void 0,
|
|
46808
|
+
revisionRangeMarker: run.revisionRangeMarker ? { ...run.revisionRangeMarker } : void 0,
|
|
46593
46809
|
sdtWrappers: run.sdtWrappers ? [...run.sdtWrappers] : void 0
|
|
46594
46810
|
};
|
|
46595
46811
|
const cloned = visitRun(run, {
|
|
@@ -47571,7 +47787,7 @@ async function importDocxInWorker(buffer, options = {}) {
|
|
|
47571
47787
|
const worker = new Worker(
|
|
47572
47788
|
new URL(
|
|
47573
47789
|
/* @vite-ignore */
|
|
47574
|
-
"" + new URL("assets/importDocxWorker-
|
|
47790
|
+
"" + new URL("assets/importDocxWorker-q9FwIHr4.js", import.meta.url).href,
|
|
47575
47791
|
import.meta.url
|
|
47576
47792
|
),
|
|
47577
47793
|
{
|
package/dist/oasis-editor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dK, ah, aw, aM, aG, dL, dM, dN, aA, dO, ai, dP, dt, aN, dQ, dR, aL, aD, dS, dT, dU, ag, dV, dr, aP, dW, dX, dY, dZ, d_, dF, d$, e0, e1, aU, aT, e2, aE, e3, e4, e5, e6, e7, e8, aI, aF, e9, b3, aO, b2, aV, az, aK, dE, ea, dL as dL2, dS as dS2, dV as dV2, e2 as e22, e3 as e32, e8 as e82, eb, ec, dv, dq, ed, ee, ef, eg, eh, ei, ej, ds, ek, el, em, du, en } from "./index-
|
|
1
|
+
import { dK, ah, aw, aM, aG, dL, dM, dN, aA, dO, ai, dP, dt, aN, dQ, dR, aL, aD, dS, dT, dU, ag, dV, dr, aP, dW, dX, dY, dZ, d_, dF, d$, e0, e1, aU, aT, e2, aE, e3, e4, e5, e6, e7, e8, aI, aF, e9, b3, aO, b2, aV, az, aK, dE, ea, dL as dL2, dS as dS2, dV as dV2, e2 as e22, e3 as e32, e8 as e82, eb, ec, dv, dq, ed, ee, ef, eg, eh, ei, ej, ds, ek, el, em, du, en } from "./index-BGlDfVIA.js";
|
|
2
2
|
export {
|
|
3
3
|
dK as ActionRow,
|
|
4
4
|
ah as BalloonShell,
|