oasis-editor 0.0.180 → 0.0.181
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-h2nQFM-y.js → OasisEditorApp-DiKa_1be.js} +1 -1
- package/dist/assets/{importDocxWorker-CTxcTGME.js → importDocxWorker-D1N33VdD.js} +1 -1
- package/dist/core/model/types/nodes.d.ts +3 -1
- package/dist/import/docx/tableProperties.d.ts +2 -1
- package/dist/{index-C0KjmCqU.js → index-DBFpDATA.js} +41 -7
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +2 -2
- package/package.json +1 -1
|
@@ -353,7 +353,9 @@ export interface EditorTableRowNode {
|
|
|
353
353
|
* resolution and re-serialized before `w:trPr` on export.
|
|
354
354
|
*/
|
|
355
355
|
propertyExceptions?: EditorTableStyle;
|
|
356
|
-
/**
|
|
356
|
+
/** Semantic previous row table-property exceptions from `w:tblPrExChange`. */
|
|
357
|
+
propertyExceptionsRevision?: EditorPropertyRevision<EditorTableStyle>;
|
|
358
|
+
/** Exact imported `<w:tblPrExChange ...>` retained as a preservation fallback. */
|
|
357
359
|
tblPrExChangeXml?: string;
|
|
358
360
|
/** Extension attributes (e.g. `w14:paraId`, `w15:*`) preserved for round-trip. */
|
|
359
361
|
extAttributes?: Record<string, string>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Element as XmlElement } from '@xmldom/xmldom';
|
|
2
|
-
import { EditorTableCellStyle, EditorTableRowNode, EditorTableRowStyle, EditorTableStyle, EditorTableConditionalFlags } from '../../core/model.js';
|
|
2
|
+
import { EditorTableCellStyle, EditorTableRowNode, EditorTableRowStyle, EditorTableStyle, EditorPropertyRevision, EditorTableConditionalFlags } from '../../core/model.js';
|
|
3
3
|
import { EditorTableBorders } from './borders.js';
|
|
4
4
|
import { ThemeColorMap } from './themeColors.js';
|
|
5
5
|
|
|
6
6
|
export declare function parseTableConditionalFlags(properties: XmlElement | null): EditorTableConditionalFlags | undefined;
|
|
7
|
+
export declare function parseTablePropertyExceptionRevision(change: XmlElement | null): EditorPropertyRevision<EditorTableStyle> | undefined;
|
|
7
8
|
export declare function parseTableStyle(tblPr: XmlElement | null, tableStyleId?: string): EditorTableStyle | undefined;
|
|
8
9
|
export declare function parseTableRowStyle(rowProperties: XmlElement | null): EditorTableRowStyle | undefined;
|
|
9
10
|
export declare function getTableCellColSpan(cellProperties: XmlElement | null): number;
|
|
@@ -2863,7 +2863,7 @@ function OasisEditorAppLazy(props = {}) {
|
|
|
2863
2863
|
onCleanup(() => {
|
|
2864
2864
|
cancelled = true;
|
|
2865
2865
|
});
|
|
2866
|
-
import("./OasisEditorApp-
|
|
2866
|
+
import("./OasisEditorApp-DiKa_1be.js").then((m) => {
|
|
2867
2867
|
cancelled = true;
|
|
2868
2868
|
setProgress(1);
|
|
2869
2869
|
setTimeout(() => setApp(() => m.OasisEditorApp), 180);
|
|
@@ -37552,6 +37552,16 @@ function parseRevisionMetadata(element) {
|
|
|
37552
37552
|
date: Number.isFinite(parsedDate) ? parsedDate : 0
|
|
37553
37553
|
};
|
|
37554
37554
|
}
|
|
37555
|
+
function parseTablePropertyExceptionRevision(change) {
|
|
37556
|
+
if (!change) return void 0;
|
|
37557
|
+
const previous = getFirstChildByTagNameNS(change, WORD_NS$3, "tblPrEx");
|
|
37558
|
+
if (!previous) return void 0;
|
|
37559
|
+
return {
|
|
37560
|
+
...parseRevisionMetadata(change),
|
|
37561
|
+
type: "property",
|
|
37562
|
+
previous: parseTableStyle(previous) ?? {}
|
|
37563
|
+
};
|
|
37564
|
+
}
|
|
37555
37565
|
function parseFloatingTableProperties(tblPr) {
|
|
37556
37566
|
const tblpPr = getFirstChildByTagNameNS(tblPr, WORD_NS$3, "tblpPr");
|
|
37557
37567
|
if (!tblpPr || !tblpPr.attributes || tblpPr.attributes.length === 0) {
|
|
@@ -41174,6 +41184,10 @@ async function parseTableNode(tableNode, numberingMaps, zip, relsMap, assets, th
|
|
|
41174
41184
|
"tblPrExChange"
|
|
41175
41185
|
);
|
|
41176
41186
|
if (changeEl) {
|
|
41187
|
+
const revision = parseTablePropertyExceptionRevision(changeEl);
|
|
41188
|
+
if (revision) {
|
|
41189
|
+
row.propertyExceptionsRevision = revision;
|
|
41190
|
+
}
|
|
41177
41191
|
row.tblPrExChangeXml = new XMLSerializer().serializeToString(changeEl);
|
|
41178
41192
|
}
|
|
41179
41193
|
}
|
|
@@ -43179,8 +43193,8 @@ function serializeTableProperties(table) {
|
|
|
43179
43193
|
}
|
|
43180
43194
|
return `<w:tblPr>${parts.join("")}</w:tblPr>`;
|
|
43181
43195
|
}
|
|
43182
|
-
function serializeTablePropertyExceptions(exceptions, tblPrExChangeXml) {
|
|
43183
|
-
if (!exceptions && !tblPrExChangeXml) {
|
|
43196
|
+
function serializeTablePropertyExceptions(exceptions, revision, tblPrExChangeXml) {
|
|
43197
|
+
if (!exceptions && !revision && !tblPrExChangeXml) {
|
|
43184
43198
|
return "";
|
|
43185
43199
|
}
|
|
43186
43200
|
const parts = [];
|
|
@@ -43216,6 +43230,11 @@ function serializeTablePropertyExceptions(exceptions, tblPrExChangeXml) {
|
|
|
43216
43230
|
}
|
|
43217
43231
|
if (tblPrExChangeXml) {
|
|
43218
43232
|
parts.push(tblPrExChangeXml);
|
|
43233
|
+
} else if (revision) {
|
|
43234
|
+
const previous = serializeTablePropertyExceptions(revision.previous) || "<w:tblPrEx/>";
|
|
43235
|
+
parts.push(
|
|
43236
|
+
`<w:tblPrExChange ${serializeRevisionAttrs(revision)}>${previous}</w:tblPrExChange>`
|
|
43237
|
+
);
|
|
43219
43238
|
}
|
|
43220
43239
|
return parts.length > 0 ? `<w:tblPrEx>${parts.join("")}</w:tblPrEx>` : "";
|
|
43221
43240
|
}
|
|
@@ -43244,7 +43263,11 @@ function serializeTableXml(table, serializeBlockXml) {
|
|
|
43244
43263
|
const contentXml = cell.vMerge === "continue" ? "<w:p/>" : blocksXml;
|
|
43245
43264
|
return `<w:tc${serializeExtAttributes(cell.extAttributes)}>${serializeTableCellProperties(cell, fallbackWidthPt)}${contentXml}</w:tc>`;
|
|
43246
43265
|
}).join("");
|
|
43247
|
-
return `<w:tr${serializeExtAttributes(row.extAttributes)}>${serializeTablePropertyExceptions(
|
|
43266
|
+
return `<w:tr${serializeExtAttributes(row.extAttributes)}>${serializeTablePropertyExceptions(
|
|
43267
|
+
row.propertyExceptions,
|
|
43268
|
+
row.propertyExceptionsRevision,
|
|
43269
|
+
row.tblPrExChangeXml
|
|
43270
|
+
)}${serializeTableRowProperties(row)}${cellsXml}</w:tr>`;
|
|
43248
43271
|
}).join("");
|
|
43249
43272
|
const gridXml = table.gridCols ? `<w:tblGrid>${table.gridCols.map(
|
|
43250
43273
|
(width) => `<w:gridCol w:w="${pointsToTwips(width) ?? 0}"/>`
|
|
@@ -48014,7 +48037,7 @@ async function importDocxInWorker(buffer, options = {}) {
|
|
|
48014
48037
|
const worker = new Worker(
|
|
48015
48038
|
new URL(
|
|
48016
48039
|
/* @vite-ignore */
|
|
48017
|
-
"" + new URL("assets/importDocxWorker-
|
|
48040
|
+
"" + new URL("assets/importDocxWorker-D1N33VdD.js", import.meta.url).href,
|
|
48018
48041
|
import.meta.url
|
|
48019
48042
|
),
|
|
48020
48043
|
{
|
|
@@ -51955,6 +51978,8 @@ function cloneBlock(block) {
|
|
|
51955
51978
|
rows: block.rows.map((row) => ({
|
|
51956
51979
|
...row,
|
|
51957
51980
|
conditionalStyle: row.conditionalStyle ? { ...row.conditionalStyle } : void 0,
|
|
51981
|
+
propertyExceptions: row.propertyExceptions ? structuredClone(row.propertyExceptions) : void 0,
|
|
51982
|
+
propertyExceptionsRevision: row.propertyExceptionsRevision ? structuredClone(row.propertyExceptionsRevision) : void 0,
|
|
51958
51983
|
style: row.style ? {
|
|
51959
51984
|
...row.style,
|
|
51960
51985
|
revision: row.style.revision ? { ...row.style.revision } : void 0,
|
|
@@ -52400,7 +52425,16 @@ function transformRow(row, path, context2) {
|
|
|
52400
52425
|
let next = resolveRowStructuralRevision(row, path, context2);
|
|
52401
52426
|
const style2 = resolveRowPropertyStyle(next.style, `${path}.style`, context2);
|
|
52402
52427
|
if (style2 !== next.style) next = { ...next, style: style2 };
|
|
52403
|
-
|
|
52428
|
+
const propertyExceptionsRevision = next.propertyExceptionsRevision;
|
|
52429
|
+
if (propertyExceptionsRevision && matchesRevision(context2, propertyExceptionsRevision.id)) {
|
|
52430
|
+
markResolved(context2, propertyExceptionsRevision.id);
|
|
52431
|
+
next = {
|
|
52432
|
+
...next,
|
|
52433
|
+
propertyExceptions: context2.action === "accept" ? next.propertyExceptions : structuredClone(propertyExceptionsRevision.previous),
|
|
52434
|
+
propertyExceptionsRevision: void 0,
|
|
52435
|
+
tblPrExChangeXml: void 0
|
|
52436
|
+
};
|
|
52437
|
+
} else if (next.tblPrExChangeXml && !propertyExceptionsRevision) {
|
|
52404
52438
|
const revisionId = rawRevisionId(next.tblPrExChangeXml);
|
|
52405
52439
|
if (revisionId && matchesRevision(context2, revisionId)) {
|
|
52406
52440
|
markMatched(context2);
|
|
@@ -52412,7 +52446,7 @@ function transformRow(row, path, context2) {
|
|
|
52412
52446
|
kind: "table-property-exception-original-unavailable",
|
|
52413
52447
|
revisionId,
|
|
52414
52448
|
path: `${path}.tblPrExChangeXml`,
|
|
52415
|
-
message: "w:tblPrExChange
|
|
52449
|
+
message: "The imported w:tblPrExChange has no decodable previous w:tblPrEx snapshot."
|
|
52416
52450
|
});
|
|
52417
52451
|
}
|
|
52418
52452
|
}
|
package/dist/oasis-editor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dN, ah, aw, aM, aG, dO, dP, dQ, aA, dR, ai, dS, dw, aN, dT, dU, aL, aD, dV, dW, dX, ag, dY, du, aP, dZ, d_, d$, e0, e1, dI, e2, e3, e4, aU, aT, e5, aE, e6, e7, e8, e9, ea, eb, aI, aF, ec, b3, aO, b2, aV, az, aK, dH, ed, dO as dO2, dV as dV2, dY as dY2, e5 as e52, e6 as e62, eb as eb2, ee, ef, dy, dt, eg, eh, ei, ej, ek, el, em, dv, en, eo, ep, eq, er, dx, es, et } from "./index-
|
|
1
|
+
import { dN, ah, aw, aM, aG, dO, dP, dQ, aA, dR, ai, dS, dw, aN, dT, dU, aL, aD, dV, dW, dX, ag, dY, du, aP, dZ, d_, d$, e0, e1, dI, e2, e3, e4, aU, aT, e5, aE, e6, e7, e8, e9, ea, eb, aI, aF, ec, b3, aO, b2, aV, az, aK, dH, ed, dO as dO2, dV as dV2, dY as dY2, e5 as e52, e6 as e62, eb as eb2, ee, ef, dy, dt, eg, eh, ei, ej, ek, el, em, dv, en, eo, ep, eq, er, dx, es, et } from "./index-DBFpDATA.js";
|
|
2
2
|
export {
|
|
3
3
|
dN as ActionRow,
|
|
4
4
|
ah as BalloonShell,
|