@superdoc-dev/cli 0.5.0-next.66 → 0.5.0-next.68
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 +440 -157
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -57583,7 +57583,7 @@ var init_uuid_qzgm05fK_es = __esm(() => {
|
|
|
57583
57583
|
v5_default = v35("v5", 80, sha1);
|
|
57584
57584
|
});
|
|
57585
57585
|
|
|
57586
|
-
// ../../packages/superdoc/dist/chunks/constants-
|
|
57586
|
+
// ../../packages/superdoc/dist/chunks/constants-CGhJRd87.es.js
|
|
57587
57587
|
function computeCrc32Hex(data) {
|
|
57588
57588
|
let crc = 4294967295;
|
|
57589
57589
|
for (let i2 = 0;i2 < data.length; i2++)
|
|
@@ -57657,6 +57657,11 @@ function linesToTwips(lines) {
|
|
|
57657
57657
|
return;
|
|
57658
57658
|
return lines * 240;
|
|
57659
57659
|
}
|
|
57660
|
+
function halfPointToPixels(halfPoints) {
|
|
57661
|
+
if (halfPoints == null)
|
|
57662
|
+
return;
|
|
57663
|
+
return Math.round(halfPoints * 96 / 72);
|
|
57664
|
+
}
|
|
57660
57665
|
function halfPointToPoints(halfPoints) {
|
|
57661
57666
|
if (halfPoints == null)
|
|
57662
57667
|
return;
|
|
@@ -57975,7 +57980,7 @@ var import_lib, CRC32_TABLE, REMOTE_RESOURCE_PATTERN, DATA_URI_PATTERN, getArray
|
|
|
57975
57980
|
return "webp";
|
|
57976
57981
|
return null;
|
|
57977
57982
|
}, COMMENT_FILE_BASENAMES, DEFAULT_XML_DECLARATION, COMMENT_RELATIONSHIP_TYPES;
|
|
57978
|
-
var
|
|
57983
|
+
var init_constants_CGhJRd87_es = __esm(() => {
|
|
57979
57984
|
init_xml_js_CqGKpaft_es();
|
|
57980
57985
|
import_lib = require_lib();
|
|
57981
57986
|
CRC32_TABLE = new Uint32Array(256);
|
|
@@ -65881,7 +65886,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
|
|
|
65881
65886
|
emptyOptions2 = {};
|
|
65882
65887
|
});
|
|
65883
65888
|
|
|
65884
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
65889
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-CJYLTlzF.es.js
|
|
65885
65890
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
65886
65891
|
const fieldValue = extension$1.config[field];
|
|
65887
65892
|
if (typeof fieldValue === "function")
|
|
@@ -117496,12 +117501,12 @@ var isRegExp = (value) => {
|
|
|
117496
117501
|
state.kern = kernNode.attributes["w:val"];
|
|
117497
117502
|
}
|
|
117498
117503
|
}, SuperConverter;
|
|
117499
|
-
var
|
|
117504
|
+
var init_SuperConverter_CJYLTlzF_es = __esm(() => {
|
|
117500
117505
|
init_rolldown_runtime_Bg48TavK_es();
|
|
117501
117506
|
init_jszip_C49i9kUs_es();
|
|
117502
117507
|
init_xml_js_CqGKpaft_es();
|
|
117503
117508
|
init_uuid_qzgm05fK_es();
|
|
117504
|
-
|
|
117509
|
+
init_constants_CGhJRd87_es();
|
|
117505
117510
|
init_dist_B8HfvhaK_es();
|
|
117506
117511
|
init_unified_Dsuw2be5_es();
|
|
117507
117512
|
init_lib_CYqLdG4z_es();
|
|
@@ -154588,7 +154593,7 @@ var init_SuperConverter_tT_4c8Ha_es = __esm(() => {
|
|
|
154588
154593
|
};
|
|
154589
154594
|
});
|
|
154590
154595
|
|
|
154591
|
-
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-
|
|
154596
|
+
// ../../packages/superdoc/dist/chunks/create-headless-toolbar-BvILQhp3.es.js
|
|
154592
154597
|
function parseSizeUnit(val = "0") {
|
|
154593
154598
|
const length3 = val.toString() || "0";
|
|
154594
154599
|
const value = Number.parseFloat(length3);
|
|
@@ -156124,9 +156129,9 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
|
|
|
156124
156129
|
return false;
|
|
156125
156130
|
return Boolean(checker(attrs));
|
|
156126
156131
|
};
|
|
156127
|
-
var
|
|
156128
|
-
|
|
156129
|
-
|
|
156132
|
+
var init_create_headless_toolbar_BvILQhp3_es = __esm(() => {
|
|
156133
|
+
init_SuperConverter_CJYLTlzF_es();
|
|
156134
|
+
init_constants_CGhJRd87_es();
|
|
156130
156135
|
init_dist_B8HfvhaK_es();
|
|
156131
156136
|
CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
|
|
156132
156137
|
DOM_SIZE_UNITS = [
|
|
@@ -157572,7 +157577,7 @@ var init_decrypt_docx_Bs1PbPQR_es = __esm(() => {
|
|
|
157572
157577
|
]);
|
|
157573
157578
|
});
|
|
157574
157579
|
|
|
157575
|
-
// ../../packages/superdoc/dist/chunks/DocxZipper-
|
|
157580
|
+
// ../../packages/superdoc/dist/chunks/DocxZipper-CaIWmehq.es.js
|
|
157576
157581
|
function sniffEncoding(u8) {
|
|
157577
157582
|
if (u8.length >= 2) {
|
|
157578
157583
|
const b0 = u8[0], b1 = u8[1];
|
|
@@ -158217,11 +158222,11 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
|
|
|
158217
158222
|
return `image/${MIME_TYPE_FOR_EXT[detectedType] || detectedType}`;
|
|
158218
158223
|
}
|
|
158219
158224
|
}, DocxZipper_default;
|
|
158220
|
-
var
|
|
158225
|
+
var init_DocxZipper_CaIWmehq_es = __esm(() => {
|
|
158221
158226
|
init_rolldown_runtime_Bg48TavK_es();
|
|
158222
158227
|
init_jszip_C49i9kUs_es();
|
|
158223
158228
|
init_xml_js_CqGKpaft_es();
|
|
158224
|
-
|
|
158229
|
+
init_constants_CGhJRd87_es();
|
|
158225
158230
|
init_dist_B8HfvhaK_es();
|
|
158226
158231
|
MANAGED_PACKAGE_PARTS = [
|
|
158227
158232
|
{
|
|
@@ -204563,7 +204568,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
|
|
|
204563
204568
|
init_remark_gfm_BhnWr3yf_es();
|
|
204564
204569
|
});
|
|
204565
204570
|
|
|
204566
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
204571
|
+
// ../../packages/superdoc/dist/chunks/src-d1wQbdUW.es.js
|
|
204567
204572
|
function deleteProps(obj, propOrProps) {
|
|
204568
204573
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
204569
204574
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -209396,6 +209401,15 @@ function getCurrentCellAttrs(state) {
|
|
|
209396
209401
|
attrs: copyCellAttrs(cell2)
|
|
209397
209402
|
};
|
|
209398
209403
|
}
|
|
209404
|
+
function parseCellVerticalAlignFromStyle(element3) {
|
|
209405
|
+
const value = element3.style?.verticalAlign;
|
|
209406
|
+
if (!value || typeof value !== "string")
|
|
209407
|
+
return null;
|
|
209408
|
+
const normalized = value.trim().toLowerCase();
|
|
209409
|
+
if (normalized === "middle")
|
|
209410
|
+
return "center";
|
|
209411
|
+
return normalized;
|
|
209412
|
+
}
|
|
209399
209413
|
function findRemovedFieldAnnotations(tr) {
|
|
209400
209414
|
let removedNodes = [];
|
|
209401
209415
|
if (!tr.steps.length || tr.meta && !Object.keys(tr.meta).every((meta2) => [
|
|
@@ -248040,6 +248054,32 @@ function createAnchoredTableFragment(block, measure, x, y$1) {
|
|
|
248040
248054
|
applyTableFragmentPmRange(fragment2, block, measure);
|
|
248041
248055
|
return fragment2;
|
|
248042
248056
|
}
|
|
248057
|
+
function buildParagraphIndexById(blocks2, len3) {
|
|
248058
|
+
const paragraphIndexById = /* @__PURE__ */ new Map;
|
|
248059
|
+
for (let i4 = 0;i4 < len3; i4 += 1) {
|
|
248060
|
+
const block = blocks2[i4];
|
|
248061
|
+
if (block.kind === "paragraph")
|
|
248062
|
+
paragraphIndexById.set(block.id, i4);
|
|
248063
|
+
}
|
|
248064
|
+
return paragraphIndexById;
|
|
248065
|
+
}
|
|
248066
|
+
function findNearestParagraphIndex(blocks2, len3, fromIndex) {
|
|
248067
|
+
for (let i4 = fromIndex - 1;i4 >= 0; i4 -= 1)
|
|
248068
|
+
if (blocks2[i4].kind === "paragraph")
|
|
248069
|
+
return i4;
|
|
248070
|
+
for (let i4 = fromIndex + 1;i4 < len3; i4 += 1)
|
|
248071
|
+
if (blocks2[i4].kind === "paragraph")
|
|
248072
|
+
return i4;
|
|
248073
|
+
return null;
|
|
248074
|
+
}
|
|
248075
|
+
function resolveAnchorParagraphIndex(blocks2, len3, paragraphIndexById, fromIndex, anchorParagraphId) {
|
|
248076
|
+
if (typeof anchorParagraphId === "string") {
|
|
248077
|
+
const explicitIndex = paragraphIndexById.get(anchorParagraphId);
|
|
248078
|
+
if (typeof explicitIndex === "number")
|
|
248079
|
+
return explicitIndex;
|
|
248080
|
+
}
|
|
248081
|
+
return findNearestParagraphIndex(blocks2, len3, fromIndex);
|
|
248082
|
+
}
|
|
248043
248083
|
function isPageRelativeAnchor(block) {
|
|
248044
248084
|
const vRelativeFrom = block.anchor?.vRelativeFrom;
|
|
248045
248085
|
return vRelativeFrom === "margin" || vRelativeFrom === "page";
|
|
@@ -248069,24 +248109,7 @@ function collectPreRegisteredAnchors(blocks2, measures) {
|
|
|
248069
248109
|
function collectAnchoredDrawings(blocks2, measures) {
|
|
248070
248110
|
const map$12 = /* @__PURE__ */ new Map;
|
|
248071
248111
|
const len3 = Math.min(blocks2.length, measures.length);
|
|
248072
|
-
const paragraphIndexById =
|
|
248073
|
-
for (let i4 = 0;i4 < len3; i4 += 1) {
|
|
248074
|
-
const block = blocks2[i4];
|
|
248075
|
-
if (block.kind === "paragraph")
|
|
248076
|
-
paragraphIndexById.set(block.id, i4);
|
|
248077
|
-
}
|
|
248078
|
-
const nearestPrevParagraph = (fromIndex) => {
|
|
248079
|
-
for (let i4 = fromIndex - 1;i4 >= 0; i4 -= 1)
|
|
248080
|
-
if (blocks2[i4].kind === "paragraph")
|
|
248081
|
-
return i4;
|
|
248082
|
-
return null;
|
|
248083
|
-
};
|
|
248084
|
-
const nearestNextParagraph = (fromIndex) => {
|
|
248085
|
-
for (let i4 = fromIndex + 1;i4 < len3; i4 += 1)
|
|
248086
|
-
if (blocks2[i4].kind === "paragraph")
|
|
248087
|
-
return i4;
|
|
248088
|
-
return null;
|
|
248089
|
-
};
|
|
248112
|
+
const paragraphIndexById = buildParagraphIndexById(blocks2, len3);
|
|
248090
248113
|
for (let i4 = 0;i4 < len3; i4 += 1) {
|
|
248091
248114
|
const block = blocks2[i4];
|
|
248092
248115
|
const measure = measures[i4];
|
|
@@ -248101,11 +248124,7 @@ function collectAnchoredDrawings(blocks2, measures) {
|
|
|
248101
248124
|
if (isPageRelativeAnchor(drawingBlock))
|
|
248102
248125
|
continue;
|
|
248103
248126
|
const anchorParagraphId = typeof drawingBlock.attrs === "object" && drawingBlock.attrs ? drawingBlock.attrs.anchorParagraphId : undefined;
|
|
248104
|
-
|
|
248105
|
-
if (anchorParaIndex == null)
|
|
248106
|
-
anchorParaIndex = nearestPrevParagraph(i4);
|
|
248107
|
-
if (anchorParaIndex == null)
|
|
248108
|
-
anchorParaIndex = nearestNextParagraph(i4);
|
|
248127
|
+
const anchorParaIndex = resolveAnchorParagraphIndex(blocks2, len3, paragraphIndexById, i4, anchorParagraphId);
|
|
248109
248128
|
if (anchorParaIndex == null)
|
|
248110
248129
|
continue;
|
|
248111
248130
|
const list5 = map$12.get(anchorParaIndex) ?? [];
|
|
@@ -248118,26 +248137,11 @@ function collectAnchoredDrawings(blocks2, measures) {
|
|
|
248118
248137
|
return map$12;
|
|
248119
248138
|
}
|
|
248120
248139
|
function collectAnchoredTables(blocks2, measures) {
|
|
248121
|
-
const
|
|
248122
|
-
const
|
|
248123
|
-
|
|
248124
|
-
|
|
248125
|
-
|
|
248126
|
-
paragraphIndexById.set(block.id, i4);
|
|
248127
|
-
}
|
|
248128
|
-
const nearestPrevParagraph = (fromIndex) => {
|
|
248129
|
-
for (let i4 = fromIndex - 1;i4 >= 0; i4 -= 1)
|
|
248130
|
-
if (blocks2[i4].kind === "paragraph")
|
|
248131
|
-
return i4;
|
|
248132
|
-
return null;
|
|
248133
|
-
};
|
|
248134
|
-
const nearestNextParagraph = (fromIndex) => {
|
|
248135
|
-
for (let i4 = fromIndex + 1;i4 < blocks2.length; i4 += 1)
|
|
248136
|
-
if (blocks2[i4].kind === "paragraph")
|
|
248137
|
-
return i4;
|
|
248138
|
-
return null;
|
|
248139
|
-
};
|
|
248140
|
-
for (let i4 = 0;i4 < blocks2.length; i4 += 1) {
|
|
248140
|
+
const len3 = Math.min(blocks2.length, measures.length);
|
|
248141
|
+
const byParagraph = /* @__PURE__ */ new Map;
|
|
248142
|
+
const withoutParagraph = [];
|
|
248143
|
+
const paragraphIndexById = buildParagraphIndexById(blocks2, len3);
|
|
248144
|
+
for (let i4 = 0;i4 < len3; i4 += 1) {
|
|
248141
248145
|
const block = blocks2[i4];
|
|
248142
248146
|
const measure = measures[i4];
|
|
248143
248147
|
if (block.kind !== "table" || measure?.kind !== "table")
|
|
@@ -248147,21 +248151,25 @@ function collectAnchoredTables(blocks2, measures) {
|
|
|
248147
248151
|
if (!tableBlock.anchor?.isAnchored)
|
|
248148
248152
|
continue;
|
|
248149
248153
|
const anchorParagraphId = typeof tableBlock.attrs === "object" && tableBlock.attrs ? tableBlock.attrs.anchorParagraphId : undefined;
|
|
248150
|
-
|
|
248151
|
-
if (anchorParaIndex == null)
|
|
248152
|
-
|
|
248153
|
-
|
|
248154
|
-
|
|
248155
|
-
|
|
248154
|
+
const anchorParaIndex = resolveAnchorParagraphIndex(blocks2, len3, paragraphIndexById, i4, anchorParagraphId);
|
|
248155
|
+
if (anchorParaIndex == null) {
|
|
248156
|
+
withoutParagraph.push({
|
|
248157
|
+
block: tableBlock,
|
|
248158
|
+
measure: tableMeasure
|
|
248159
|
+
});
|
|
248156
248160
|
continue;
|
|
248157
|
-
|
|
248161
|
+
}
|
|
248162
|
+
const list5 = byParagraph.get(anchorParaIndex) ?? [];
|
|
248158
248163
|
list5.push({
|
|
248159
248164
|
block: tableBlock,
|
|
248160
248165
|
measure: tableMeasure
|
|
248161
248166
|
});
|
|
248162
|
-
|
|
248167
|
+
byParagraph.set(anchorParaIndex, list5);
|
|
248163
248168
|
}
|
|
248164
|
-
return
|
|
248169
|
+
return {
|
|
248170
|
+
byParagraph,
|
|
248171
|
+
withoutParagraph
|
|
248172
|
+
};
|
|
248165
248173
|
}
|
|
248166
248174
|
function computePhysicalAnchorY(block, fragmentHeight, pageHeight) {
|
|
248167
248175
|
const alignV = block.anchor?.alignV ?? "top";
|
|
@@ -248203,6 +248211,12 @@ function normalizeFragmentsForRegion(pages, blocks2, _measures, _kind, constrain
|
|
|
248203
248211
|
function createPaginator(opts) {
|
|
248204
248212
|
const states = [];
|
|
248205
248213
|
const pages = [];
|
|
248214
|
+
const pruneTrailingEmptyPages = () => {
|
|
248215
|
+
while (pages.length > 0 && pages[pages.length - 1].fragments.length === 0) {
|
|
248216
|
+
pages.pop();
|
|
248217
|
+
states.pop();
|
|
248218
|
+
}
|
|
248219
|
+
};
|
|
248206
248220
|
const getActiveColumnsForState = (state) => {
|
|
248207
248221
|
if (state.activeConstraintIndex >= 0 && state.constraintBoundaries[state.activeConstraintIndex])
|
|
248208
248222
|
return state.constraintBoundaries[state.activeConstraintIndex].columns;
|
|
@@ -248289,7 +248303,8 @@ function createPaginator(opts) {
|
|
|
248289
248303
|
advanceColumn,
|
|
248290
248304
|
columnX,
|
|
248291
248305
|
getActiveColumnsForState,
|
|
248292
|
-
getPageByNumber
|
|
248306
|
+
getPageByNumber,
|
|
248307
|
+
pruneTrailingEmptyPages
|
|
248293
248308
|
};
|
|
248294
248309
|
}
|
|
248295
248310
|
function toUpperRoman(num) {
|
|
@@ -248832,6 +248847,7 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
248832
248847
|
let pendingPageSize = null;
|
|
248833
248848
|
let activeColumns = cloneColumnLayout(options.columns);
|
|
248834
248849
|
let pendingColumns = null;
|
|
248850
|
+
const allowParagraphlessAnchoredTableFallback = options.allowParagraphlessAnchoredTableFallback !== false;
|
|
248835
248851
|
let activeOrientation = null;
|
|
248836
248852
|
let pendingOrientation = null;
|
|
248837
248853
|
let activeVAlign = null;
|
|
@@ -249295,11 +249311,38 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
249295
249311
|
}, activePageSize.w);
|
|
249296
249312
|
};
|
|
249297
249313
|
const anchoredByParagraph = collectAnchoredDrawings(blocks2, measures);
|
|
249298
|
-
const
|
|
249314
|
+
const anchoredTables = collectAnchoredTables(blocks2, measures);
|
|
249315
|
+
const anchoredTablesByParagraph = anchoredTables.byParagraph;
|
|
249316
|
+
const paragraphlessAnchoredTables = anchoredTables.withoutParagraph;
|
|
249299
249317
|
const placedAnchoredIds = /* @__PURE__ */ new Set;
|
|
249300
249318
|
const placedAnchoredTableIds = /* @__PURE__ */ new Set;
|
|
249301
249319
|
const preRegisteredAnchors = collectPreRegisteredAnchors(blocks2, measures);
|
|
249302
249320
|
const preRegisteredPositions = /* @__PURE__ */ new Map;
|
|
249321
|
+
const resolveParagraphlessAnchoredTableY = (block, measure, state) => {
|
|
249322
|
+
const contentTop = state.topMargin;
|
|
249323
|
+
const contentBottom = state.contentBottom;
|
|
249324
|
+
const contentHeight = Math.max(0, contentBottom - contentTop);
|
|
249325
|
+
const tableHeight = measure.totalHeight ?? 0;
|
|
249326
|
+
const anchor = block.anchor;
|
|
249327
|
+
const offsetV = anchor?.offsetV ?? 0;
|
|
249328
|
+
const vRelativeFrom = anchor?.vRelativeFrom;
|
|
249329
|
+
const alignV = anchor?.alignV;
|
|
249330
|
+
if (vRelativeFrom === "margin") {
|
|
249331
|
+
if (alignV === "bottom")
|
|
249332
|
+
return contentBottom - tableHeight + offsetV;
|
|
249333
|
+
if (alignV === "center")
|
|
249334
|
+
return contentTop + (contentHeight - tableHeight) / 2 + offsetV;
|
|
249335
|
+
return contentTop + offsetV;
|
|
249336
|
+
}
|
|
249337
|
+
if (vRelativeFrom === "page") {
|
|
249338
|
+
if (alignV === "bottom")
|
|
249339
|
+
return contentBottom + (state.page.margins?.bottom ?? activeBottomMargin) - tableHeight + offsetV;
|
|
249340
|
+
if (alignV === "center")
|
|
249341
|
+
return (contentBottom + (state.page.margins?.bottom ?? activeBottomMargin) - tableHeight) / 2 + offsetV;
|
|
249342
|
+
return offsetV;
|
|
249343
|
+
}
|
|
249344
|
+
return contentTop + offsetV;
|
|
249345
|
+
};
|
|
249303
249346
|
for (const entry of preRegisteredAnchors) {
|
|
249304
249347
|
const state = paginator.ensurePage();
|
|
249305
249348
|
const vRelativeFrom = entry.block.anchor?.vRelativeFrom ?? "paragraph";
|
|
@@ -249783,8 +249826,21 @@ function layoutDocument(blocks2, measures, options = {}) {
|
|
|
249783
249826
|
}
|
|
249784
249827
|
throw new Error(`layoutDocument: unsupported block kind for ${block.id}`);
|
|
249785
249828
|
}
|
|
249786
|
-
|
|
249787
|
-
|
|
249829
|
+
paginator.pruneTrailingEmptyPages();
|
|
249830
|
+
if (allowParagraphlessAnchoredTableFallback && pages.length === 0 && paragraphlessAnchoredTables.length > 0) {
|
|
249831
|
+
const state = paginator.ensurePage();
|
|
249832
|
+
for (const { block: tableBlock, measure: tableMeasure } of paragraphlessAnchoredTables) {
|
|
249833
|
+
const columnWidthForTable = getCurrentColumnWidth();
|
|
249834
|
+
const totalWidth = tableMeasure.totalWidth ?? 0;
|
|
249835
|
+
if (columnWidthForTable > 0 && totalWidth >= columnWidthForTable * 0.99)
|
|
249836
|
+
continue;
|
|
249837
|
+
const anchorY = resolveParagraphlessAnchoredTableY(tableBlock, tableMeasure, state);
|
|
249838
|
+
const anchorX = tableBlock.anchor?.offsetH ?? columnX(state.columnIndex);
|
|
249839
|
+
floatManager.registerTable(tableBlock, tableMeasure, anchorY, state.columnIndex, state.page.number);
|
|
249840
|
+
state.page.fragments.push(createAnchoredTableFragment(tableBlock, tableMeasure, anchorX, anchorY));
|
|
249841
|
+
placedAnchoredTableIds.add(tableBlock.id);
|
|
249842
|
+
}
|
|
249843
|
+
}
|
|
249788
249844
|
for (const page of pages) {
|
|
249789
249845
|
if (!page.vAlign || page.vAlign === "top")
|
|
249790
249846
|
continue;
|
|
@@ -249940,7 +249996,8 @@ function layoutHeaderFooter(blocks2, measures, constraints, kind) {
|
|
|
249940
249996
|
right: 0,
|
|
249941
249997
|
bottom: 0,
|
|
249942
249998
|
left: 0
|
|
249943
|
-
}
|
|
249999
|
+
},
|
|
250000
|
+
allowParagraphlessAnchoredTableFallback: false
|
|
249944
250001
|
});
|
|
249945
250002
|
if (kind === "footer" && constraints.pageHeight != null)
|
|
249946
250003
|
normalizeFragmentsForRegion(layout.pages, blocks2, measures, kind, constraints);
|
|
@@ -250502,6 +250559,8 @@ async function layoutHeaderFooterWithCache(sections, constraints, measureBlock$1
|
|
|
250502
250559
|
return result;
|
|
250503
250560
|
}
|
|
250504
250561
|
const { totalPages: docTotalPages } = pageResolver(1);
|
|
250562
|
+
if (!Number.isFinite(docTotalPages) || docTotalPages <= 0)
|
|
250563
|
+
return result;
|
|
250505
250564
|
const useBucketing = FeatureFlags.HF_DIGIT_BUCKETING && docTotalPages >= MIN_PAGES_FOR_BUCKETING;
|
|
250506
250565
|
for (const [type, blocks2] of Object.entries(sections)) {
|
|
250507
250566
|
if (!blocks2 || blocks2.length === 0)
|
|
@@ -260323,15 +260382,45 @@ function resolveTableMinWidth(spec, contentWidth) {
|
|
|
260323
260382
|
return contentWidth * (spec.value / OOXML_PCT_DIVISOR);
|
|
260324
260383
|
return spec.value;
|
|
260325
260384
|
}
|
|
260326
|
-
function
|
|
260385
|
+
function getRefsForKind(section, kind) {
|
|
260386
|
+
return kind === "header" ? section.headerRefs : section.footerRefs;
|
|
260387
|
+
}
|
|
260388
|
+
function buildEffectiveRefsBySection(sectionMetadata, kind) {
|
|
260327
260389
|
const result = /* @__PURE__ */ new Map;
|
|
260328
|
-
let
|
|
260390
|
+
let inheritedRefs = {};
|
|
260329
260391
|
for (const section of sectionMetadata) {
|
|
260330
|
-
const
|
|
260331
|
-
|
|
260332
|
-
|
|
260333
|
-
|
|
260334
|
-
|
|
260392
|
+
const explicitRefs = getRefsForKind(section, kind);
|
|
260393
|
+
const effectiveRefs = { ...inheritedRefs };
|
|
260394
|
+
for (const variant of HEADER_FOOTER_VARIANTS4) {
|
|
260395
|
+
const rId = explicitRefs?.[variant];
|
|
260396
|
+
if (rId)
|
|
260397
|
+
effectiveRefs[variant] = rId;
|
|
260398
|
+
}
|
|
260399
|
+
if (Object.keys(effectiveRefs).length > 0)
|
|
260400
|
+
result.set(section.sectionIndex, effectiveRefs);
|
|
260401
|
+
inheritedRefs = effectiveRefs;
|
|
260402
|
+
}
|
|
260403
|
+
return result;
|
|
260404
|
+
}
|
|
260405
|
+
function collectReferencedRIdsBySection(effectiveRefsBySection) {
|
|
260406
|
+
const result = /* @__PURE__ */ new Set;
|
|
260407
|
+
for (const refs of effectiveRefsBySection.values())
|
|
260408
|
+
for (const variant of HEADER_FOOTER_VARIANTS4) {
|
|
260409
|
+
const rId = refs[variant];
|
|
260410
|
+
if (rId)
|
|
260411
|
+
result.add(rId);
|
|
260412
|
+
}
|
|
260413
|
+
return result;
|
|
260414
|
+
}
|
|
260415
|
+
function resolveDefaultRIdPerSection(sectionMetadata, kind) {
|
|
260416
|
+
const result = /* @__PURE__ */ new Map;
|
|
260417
|
+
let inheritedDefaultRId;
|
|
260418
|
+
for (const section of sectionMetadata) {
|
|
260419
|
+
const explicitDefaultRId = getRefsForKind(section, kind)?.default;
|
|
260420
|
+
if (explicitDefaultRId)
|
|
260421
|
+
inheritedDefaultRId = explicitDefaultRId;
|
|
260422
|
+
if (inheritedDefaultRId)
|
|
260423
|
+
result.set(section.sectionIndex, inheritedDefaultRId);
|
|
260335
260424
|
}
|
|
260336
260425
|
return result;
|
|
260337
260426
|
}
|
|
@@ -260353,14 +260442,18 @@ async function layoutPerRIdHeaderFooters(headerFooterInput, layout, sectionMetad
|
|
|
260353
260442
|
await layoutWithPerSectionConstraints("header", headerBlocksByRId, sectionMetadata, constraints, pageResolver, deps.headerLayoutsByRId);
|
|
260354
260443
|
await layoutWithPerSectionConstraints("footer", footerBlocksByRId, sectionMetadata, constraints, pageResolver, deps.footerLayoutsByRId);
|
|
260355
260444
|
} else {
|
|
260356
|
-
|
|
260357
|
-
|
|
260445
|
+
const effectiveHeaderRefsBySection = buildEffectiveRefsBySection(sectionMetadata, "header");
|
|
260446
|
+
const effectiveFooterRefsBySection = buildEffectiveRefsBySection(sectionMetadata, "footer");
|
|
260447
|
+
await layoutBlocksByRId("header", headerBlocksByRId, collectReferencedRIdsBySection(effectiveHeaderRefsBySection), constraints, pageResolver, deps.headerLayoutsByRId);
|
|
260448
|
+
await layoutBlocksByRId("footer", footerBlocksByRId, collectReferencedRIdsBySection(effectiveFooterRefsBySection), constraints, pageResolver, deps.footerLayoutsByRId);
|
|
260358
260449
|
}
|
|
260359
260450
|
}
|
|
260360
|
-
async function layoutBlocksByRId(kind, blocksByRId, constraints, pageResolver, layoutsByRId) {
|
|
260361
|
-
if (!blocksByRId)
|
|
260451
|
+
async function layoutBlocksByRId(kind, blocksByRId, referencedRIds, constraints, pageResolver, layoutsByRId) {
|
|
260452
|
+
if (!blocksByRId || referencedRIds.size === 0)
|
|
260362
260453
|
return;
|
|
260363
260454
|
for (const [rId, blocks2] of blocksByRId) {
|
|
260455
|
+
if (!referencedRIds.has(rId))
|
|
260456
|
+
continue;
|
|
260364
260457
|
if (!blocks2 || blocks2.length === 0)
|
|
260365
260458
|
continue;
|
|
260366
260459
|
try {
|
|
@@ -260413,7 +260506,7 @@ function adjustFramePositionsForContentWidth(layout, blocks2, effectiveWidth, co
|
|
|
260413
260506
|
async function layoutWithPerSectionConstraints(kind, blocksByRId, sectionMetadata, fallbackConstraints, pageResolver, layoutsByRId) {
|
|
260414
260507
|
if (!blocksByRId)
|
|
260415
260508
|
return;
|
|
260416
|
-
const
|
|
260509
|
+
const defaultRIdPerSection = resolveDefaultRIdPerSection(sectionMetadata, kind);
|
|
260417
260510
|
const tableWidthSpecByRId = /* @__PURE__ */ new Map;
|
|
260418
260511
|
for (const [rId, blocks2] of blocksByRId) {
|
|
260419
260512
|
const spec = getTableWidthSpec(blocks2);
|
|
@@ -260422,7 +260515,7 @@ async function layoutWithPerSectionConstraints(kind, blocksByRId, sectionMetadat
|
|
|
260422
260515
|
}
|
|
260423
260516
|
const groups = /* @__PURE__ */ new Map;
|
|
260424
260517
|
for (const section of sectionMetadata) {
|
|
260425
|
-
const rId =
|
|
260518
|
+
const rId = defaultRIdPerSection.get(section.sectionIndex);
|
|
260426
260519
|
if (!rId || !blocksByRId.has(rId))
|
|
260427
260520
|
continue;
|
|
260428
260521
|
const contentWidth = buildSectionContentWidth(section, fallbackConstraints);
|
|
@@ -266662,7 +266755,87 @@ var Node$13 = class Node$14 {
|
|
|
266662
266755
|
const nextAttrs = { ...attrs };
|
|
266663
266756
|
delete nextAttrs.borders;
|
|
266664
266757
|
return nextAttrs;
|
|
266665
|
-
}, IMPORT_CONTEXT_SELECTOR = '[data-superdoc-import="true"]', IMPORT_DEFAULT_TABLE_WIDTH_PCT = 5000, isImportedTableElement = (element3) => Boolean(element3?.closest?.(IMPORT_CONTEXT_SELECTOR)), Table,
|
|
266758
|
+
}, IMPORT_CONTEXT_SELECTOR = '[data-superdoc-import="true"]', IMPORT_DEFAULT_TABLE_WIDTH_PCT = 5000, isImportedTableElement = (element3) => Boolean(element3?.closest?.(IMPORT_CONTEXT_SELECTOR)), Table, STYLE_TOKEN_SET, STYLE_TOKEN_PATTERN, parseBorderWidth = (value) => {
|
|
266759
|
+
const widthMatch = value.match(/(?:^|\s)(-?\d*\.?\d+(?:px|pt))(?=\s|$)/i);
|
|
266760
|
+
if (!widthMatch?.[1])
|
|
266761
|
+
return null;
|
|
266762
|
+
const [widthValue, widthUnit] = parseSizeUnit(widthMatch[1]);
|
|
266763
|
+
const numericWidth = Number(widthValue);
|
|
266764
|
+
return widthUnit === "pt" ? halfPointToPixels(numericWidth) : numericWidth;
|
|
266765
|
+
}, parseBorderStyle = (value) => {
|
|
266766
|
+
const styleMatch = value.match(new RegExp(`(?:^|\\s)(${STYLE_TOKEN_PATTERN})(?=\\s|$)`, "i"));
|
|
266767
|
+
return styleMatch?.[1] ? styleMatch[1].toLowerCase() : null;
|
|
266768
|
+
}, parseBorderColor = (value) => {
|
|
266769
|
+
const directColorMatch = value.match(/(rgba?\([^)]+\)|hsla?\([^)]+\)|#[0-9a-fA-F]{3,8}|var\([^)]+\))/i);
|
|
266770
|
+
if (directColorMatch?.[1])
|
|
266771
|
+
return directColorMatch[1];
|
|
266772
|
+
return value.split(/\s+/).find((part) => /^[a-z]+$/i.test(part) && !STYLE_TOKEN_SET.has(part.toLowerCase())) || null;
|
|
266773
|
+
}, parseBorderValue = (rawValue) => {
|
|
266774
|
+
if (!rawValue || typeof rawValue !== "string")
|
|
266775
|
+
return null;
|
|
266776
|
+
const value = rawValue.trim();
|
|
266777
|
+
if (!value)
|
|
266778
|
+
return null;
|
|
266779
|
+
if (value === "none")
|
|
266780
|
+
return {
|
|
266781
|
+
val: "none",
|
|
266782
|
+
size: 0,
|
|
266783
|
+
color: "auto",
|
|
266784
|
+
style: "none"
|
|
266785
|
+
};
|
|
266786
|
+
const size$1 = parseBorderWidth(value);
|
|
266787
|
+
const style2 = parseBorderStyle(value);
|
|
266788
|
+
const hexColor = cssColorToHex(parseBorderColor(value));
|
|
266789
|
+
if (style2 === "none")
|
|
266790
|
+
return {
|
|
266791
|
+
val: "none",
|
|
266792
|
+
size: 0,
|
|
266793
|
+
color: "auto",
|
|
266794
|
+
style: "none"
|
|
266795
|
+
};
|
|
266796
|
+
if (size$1 == null && !hexColor && !style2)
|
|
266797
|
+
return null;
|
|
266798
|
+
return {
|
|
266799
|
+
val: style2 === "dashed" || style2 === "dotted" ? style2 : "single",
|
|
266800
|
+
size: size$1 ?? 1,
|
|
266801
|
+
color: hexColor || "auto",
|
|
266802
|
+
style: style2 || "solid"
|
|
266803
|
+
};
|
|
266804
|
+
}, parseCellBorders = (element3) => {
|
|
266805
|
+
const { style: style2 } = element3;
|
|
266806
|
+
const top$1 = parseBorderValue(style2?.borderTop || style2?.border);
|
|
266807
|
+
const right$1 = parseBorderValue(style2?.borderRight || style2?.border);
|
|
266808
|
+
const bottom$1 = parseBorderValue(style2?.borderBottom || style2?.border);
|
|
266809
|
+
const left$1 = parseBorderValue(style2?.borderLeft || style2?.border);
|
|
266810
|
+
if (!top$1 && !right$1 && !bottom$1 && !left$1)
|
|
266811
|
+
return null;
|
|
266812
|
+
return {
|
|
266813
|
+
...top$1 ? { top: top$1 } : {},
|
|
266814
|
+
...right$1 ? { right: right$1 } : {},
|
|
266815
|
+
...bottom$1 ? { bottom: bottom$1 } : {},
|
|
266816
|
+
...left$1 ? { left: left$1 } : {}
|
|
266817
|
+
};
|
|
266818
|
+
}, parseSide = (sideValue) => {
|
|
266819
|
+
if (!sideValue)
|
|
266820
|
+
return;
|
|
266821
|
+
const [rawValue, unit] = parseSizeUnit(sideValue);
|
|
266822
|
+
const numericValue = Number(rawValue);
|
|
266823
|
+
return unit === "pt" ? halfPointToPixels(numericValue) : numericValue;
|
|
266824
|
+
}, parseCellMargins = (element3) => {
|
|
266825
|
+
const { style: style2 } = element3;
|
|
266826
|
+
const top$1 = parseSide(style2?.paddingTop);
|
|
266827
|
+
const right$1 = parseSide(style2?.paddingRight);
|
|
266828
|
+
const bottom$1 = parseSide(style2?.paddingBottom);
|
|
266829
|
+
const left$1 = parseSide(style2?.paddingLeft);
|
|
266830
|
+
if (top$1 == null && right$1 == null && bottom$1 == null && left$1 == null)
|
|
266831
|
+
return null;
|
|
266832
|
+
return {
|
|
266833
|
+
...top$1 != null ? { top: top$1 } : {},
|
|
266834
|
+
...right$1 != null ? { right: right$1 } : {},
|
|
266835
|
+
...bottom$1 != null ? { bottom: bottom$1 } : {},
|
|
266836
|
+
...left$1 != null ? { left: left$1 } : {}
|
|
266837
|
+
};
|
|
266838
|
+
}, renderCellBorderStyle = (borders) => {
|
|
266666
266839
|
if (!borders)
|
|
266667
266840
|
return {};
|
|
266668
266841
|
return { style: [
|
|
@@ -266681,7 +266854,49 @@ var Node$13 = class Node$14 {
|
|
|
266681
266854
|
return `border-${side}: ${Math.ceil(border.size)}px solid ${color2};`;
|
|
266682
266855
|
return "";
|
|
266683
266856
|
}).join(" ") };
|
|
266684
|
-
}, TableHeader,
|
|
266857
|
+
}, TableHeader, parseLengthPx = (length$12) => {
|
|
266858
|
+
if (length$12 == null)
|
|
266859
|
+
return;
|
|
266860
|
+
if (typeof length$12 === "string") {
|
|
266861
|
+
const trimmed = length$12.trim().toLowerCase();
|
|
266862
|
+
if (!trimmed || trimmed === "auto")
|
|
266863
|
+
return;
|
|
266864
|
+
}
|
|
266865
|
+
const [value, unit] = parseSizeUnit(String(length$12));
|
|
266866
|
+
const numericValue = Number(value);
|
|
266867
|
+
return unit === "pt" ? halfPointToPixels(numericValue) : numericValue;
|
|
266868
|
+
}, parseExplicitRowHeight = (element3) => {
|
|
266869
|
+
const fromHeightStyle = parseLengthPx(element3?.style?.height);
|
|
266870
|
+
if (fromHeightStyle != null)
|
|
266871
|
+
return fromHeightStyle;
|
|
266872
|
+
const fromMinHeightStyle = parseLengthPx(element3?.style?.minHeight);
|
|
266873
|
+
if (fromMinHeightStyle != null)
|
|
266874
|
+
return fromMinHeightStyle;
|
|
266875
|
+
if (element3?.hasAttribute?.("height")) {
|
|
266876
|
+
const fromHeightAttr = parseLengthPx(element3.getAttribute("height"));
|
|
266877
|
+
if (fromHeightAttr != null)
|
|
266878
|
+
return fromHeightAttr;
|
|
266879
|
+
}
|
|
266880
|
+
}, parseTallestCellHeight = (element3) => {
|
|
266881
|
+
const cells = element3?.querySelectorAll?.("td,th");
|
|
266882
|
+
if (!cells?.length)
|
|
266883
|
+
return;
|
|
266884
|
+
let maxCellHeight;
|
|
266885
|
+
for (const cellNode of Array.from(cells)) {
|
|
266886
|
+
const cell2 = cellNode;
|
|
266887
|
+
const fromCellHeight = parseLengthPx(cell2?.style?.height);
|
|
266888
|
+
const fromCellMinHeight = parseLengthPx(cell2?.style?.minHeight);
|
|
266889
|
+
const fromCellHeightAttr = cell2?.hasAttribute?.("height") ? parseLengthPx(cell2.getAttribute("height")) : undefined;
|
|
266890
|
+
const candidate = fromCellHeight ?? fromCellMinHeight ?? fromCellHeightAttr;
|
|
266891
|
+
if (candidate == null)
|
|
266892
|
+
continue;
|
|
266893
|
+
if (maxCellHeight == null || candidate > maxCellHeight)
|
|
266894
|
+
maxCellHeight = candidate;
|
|
266895
|
+
}
|
|
266896
|
+
return maxCellHeight;
|
|
266897
|
+
}, parseRowHeight = (element3) => {
|
|
266898
|
+
return parseExplicitRowHeight(element3) ?? parseTallestCellHeight(element3);
|
|
266899
|
+
}, TableRow, TableCell, FieldAnnotationView = class {
|
|
266685
266900
|
editor;
|
|
266686
266901
|
node;
|
|
266687
266902
|
decorations;
|
|
@@ -276385,13 +276600,21 @@ var Node$13 = class Node$14 {
|
|
|
276385
276600
|
const cellBounds = getTableCellGridBounds(cellPosition);
|
|
276386
276601
|
const touchesTopBoundary = cellBounds.touchesTopEdge || continuesFromPrev;
|
|
276387
276602
|
const touchesBottomBoundary = cellBounds.touchesBottomEdge || continuesOnNext;
|
|
276388
|
-
if (hasExplicitBorders)
|
|
276603
|
+
if (hasExplicitBorders) {
|
|
276604
|
+
if (cellSpacingPx === 0)
|
|
276605
|
+
return {
|
|
276606
|
+
top: resolveTableBorderValue(cellBorders.top, touchesTopBoundary ? tableBorders.top : tableBorders.insideH),
|
|
276607
|
+
right: cellBounds.touchesRightEdge ? resolveTableBorderValue(cellBorders.right, tableBorders.right) : undefined,
|
|
276608
|
+
bottom: touchesBottomBoundary ? resolveTableBorderValue(cellBorders.bottom, tableBorders.bottom) : undefined,
|
|
276609
|
+
left: resolveTableBorderValue(cellBorders.left, cellBounds.touchesLeftEdge ? tableBorders.left : tableBorders.insideV)
|
|
276610
|
+
};
|
|
276389
276611
|
return {
|
|
276390
276612
|
top: resolveTableBorderValue(cellBorders.top, touchesTopBoundary ? tableBorders.top : tableBorders.insideH),
|
|
276391
276613
|
right: resolveTableBorderValue(cellBorders.right, cellBounds.touchesRightEdge ? tableBorders.right : undefined),
|
|
276392
276614
|
bottom: resolveTableBorderValue(cellBorders.bottom, touchesBottomBoundary ? tableBorders.bottom : undefined),
|
|
276393
276615
|
left: resolveTableBorderValue(cellBorders.left, cellBounds.touchesLeftEdge ? tableBorders.left : tableBorders.insideV)
|
|
276394
276616
|
};
|
|
276617
|
+
}
|
|
276395
276618
|
if (cellSpacingPx > 0) {
|
|
276396
276619
|
const interiorBorders = {
|
|
276397
276620
|
top: touchesTopBoundary ? undefined : borderValueToSpec(tableBorders.insideH),
|
|
@@ -285383,7 +285606,7 @@ var Node$13 = class Node$14 {
|
|
|
285383
285606
|
exportSubEditorToPart(mainEditor, editor, headerFooterRefId, type);
|
|
285384
285607
|
}, setEditorToolbar = ({ editor }, mainEditor) => {
|
|
285385
285608
|
editor.setToolbar(mainEditor.toolbar);
|
|
285386
|
-
},
|
|
285609
|
+
}, HEADER_FOOTER_VARIANTS$12, DEFAULT_HEADER_FOOTER_HEIGHT = 100, EDITOR_READY_TIMEOUT_MS = 5000, MAX_CACHED_EDITORS_LIMIT = 100, HeaderFooterEditorManager, HeaderFooterLayoutAdapter = class {
|
|
285387
285610
|
#manager;
|
|
285388
285611
|
#mediaFiles;
|
|
285389
285612
|
#blockCache = /* @__PURE__ */ new Map;
|
|
@@ -285844,7 +286067,7 @@ var Node$13 = class Node$14 {
|
|
|
285844
286067
|
target: currentX + DEFAULT_TAB_INTERVAL_PX,
|
|
285845
286068
|
nextIndex: index2
|
|
285846
286069
|
};
|
|
285847
|
-
}, HeaderFooterSessionManager = class {
|
|
286070
|
+
}, HEADER_FOOTER_VARIANTS4, HeaderFooterSessionManager = class {
|
|
285848
286071
|
#options;
|
|
285849
286072
|
#deps = null;
|
|
285850
286073
|
#callbacks = {};
|
|
@@ -286988,18 +287211,18 @@ var Node$13 = class Node$14 {
|
|
|
286988
287211
|
return;
|
|
286989
287212
|
console.log(...args$1);
|
|
286990
287213
|
}, 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;
|
|
286991
|
-
var
|
|
287214
|
+
var init_src_d1wQbdUW_es = __esm(() => {
|
|
286992
287215
|
init_rolldown_runtime_Bg48TavK_es();
|
|
286993
|
-
|
|
287216
|
+
init_SuperConverter_CJYLTlzF_es();
|
|
286994
287217
|
init_jszip_C49i9kUs_es();
|
|
286995
287218
|
init_uuid_qzgm05fK_es();
|
|
286996
|
-
|
|
286997
|
-
|
|
287219
|
+
init_create_headless_toolbar_BvILQhp3_es();
|
|
287220
|
+
init_constants_CGhJRd87_es();
|
|
286998
287221
|
init_dist_B8HfvhaK_es();
|
|
286999
287222
|
init_unified_Dsuw2be5_es();
|
|
287000
287223
|
init_remark_gfm_BhnWr3yf_es();
|
|
287001
287224
|
init_remark_stringify_6MMJfY0k_es();
|
|
287002
|
-
|
|
287225
|
+
init_DocxZipper_CaIWmehq_es();
|
|
287003
287226
|
init__plugin_vue_export_helper_HmhZBO0u_es();
|
|
287004
287227
|
init_eventemitter3_BdNugZrm_es();
|
|
287005
287228
|
init_errors_CtyzHiH4_es();
|
|
@@ -291615,6 +291838,19 @@ ${err.toString()}`);
|
|
|
291615
291838
|
})) };
|
|
291616
291839
|
}
|
|
291617
291840
|
});
|
|
291841
|
+
STYLE_TOKEN_SET = new Set([
|
|
291842
|
+
"none",
|
|
291843
|
+
"hidden",
|
|
291844
|
+
"dotted",
|
|
291845
|
+
"dashed",
|
|
291846
|
+
"solid",
|
|
291847
|
+
"double",
|
|
291848
|
+
"groove",
|
|
291849
|
+
"ridge",
|
|
291850
|
+
"inset",
|
|
291851
|
+
"outset"
|
|
291852
|
+
]);
|
|
291853
|
+
STYLE_TOKEN_PATTERN = Array.from(STYLE_TOKEN_SET).join("|");
|
|
291618
291854
|
TableHeader = Node$13.create({
|
|
291619
291855
|
name: "tableHeader",
|
|
291620
291856
|
content: "block+",
|
|
@@ -291647,36 +291883,51 @@ ${err.toString()}`);
|
|
|
291647
291883
|
return { "data-colwidth": attrs.colwidth.join(",") };
|
|
291648
291884
|
}
|
|
291649
291885
|
},
|
|
291650
|
-
background: {
|
|
291651
|
-
|
|
291652
|
-
|
|
291653
|
-
|
|
291654
|
-
|
|
291655
|
-
|
|
291656
|
-
|
|
291657
|
-
|
|
291658
|
-
|
|
291659
|
-
|
|
291660
|
-
|
|
291661
|
-
|
|
291662
|
-
|
|
291663
|
-
|
|
291664
|
-
|
|
291665
|
-
|
|
291666
|
-
|
|
291667
|
-
|
|
291668
|
-
|
|
291669
|
-
|
|
291670
|
-
|
|
291671
|
-
|
|
291672
|
-
|
|
291673
|
-
|
|
291674
|
-
|
|
291675
|
-
|
|
291676
|
-
|
|
291677
|
-
|
|
291886
|
+
background: {
|
|
291887
|
+
parseDOM: (element3) => {
|
|
291888
|
+
const color2 = cssColorToHex(element3.style?.backgroundColor);
|
|
291889
|
+
if (!color2)
|
|
291890
|
+
return null;
|
|
291891
|
+
return { color: color2.replace(/^#/, "") };
|
|
291892
|
+
},
|
|
291893
|
+
renderDOM({ background }) {
|
|
291894
|
+
if (!background)
|
|
291895
|
+
return {};
|
|
291896
|
+
const { color: color2 } = background || {};
|
|
291897
|
+
return { style: `background-color: ${color2 ? `#${color2}` : "transparent"}` };
|
|
291898
|
+
}
|
|
291899
|
+
},
|
|
291900
|
+
verticalAlign: {
|
|
291901
|
+
parseDOM: parseCellVerticalAlignFromStyle,
|
|
291902
|
+
renderDOM({ verticalAlign }) {
|
|
291903
|
+
if (!verticalAlign)
|
|
291904
|
+
return {};
|
|
291905
|
+
return { style: `vertical-align: ${verticalAlign}` };
|
|
291906
|
+
}
|
|
291907
|
+
},
|
|
291908
|
+
cellMargins: {
|
|
291909
|
+
parseDOM: (element3) => parseCellMargins(element3),
|
|
291910
|
+
renderDOM({ cellMargins, borders }) {
|
|
291911
|
+
if (!cellMargins)
|
|
291912
|
+
return {};
|
|
291913
|
+
return { style: [
|
|
291914
|
+
"top",
|
|
291915
|
+
"right",
|
|
291916
|
+
"bottom",
|
|
291917
|
+
"left"
|
|
291918
|
+
].map((side) => {
|
|
291919
|
+
const margin = cellMargins?.[side] ?? 0;
|
|
291920
|
+
const border = borders?.[side];
|
|
291921
|
+
const borderSize = border && border.val !== "none" ? Math.ceil(border.size) : 0;
|
|
291922
|
+
if (margin)
|
|
291923
|
+
return `padding-${side}: ${Math.max(0, margin - borderSize)}px;`;
|
|
291924
|
+
return "";
|
|
291925
|
+
}).join(" ") };
|
|
291926
|
+
}
|
|
291927
|
+
},
|
|
291678
291928
|
borders: {
|
|
291679
291929
|
default: null,
|
|
291930
|
+
parseDOM: (element3) => parseCellBorders(element3),
|
|
291680
291931
|
renderDOM: ({ borders }) => {
|
|
291681
291932
|
if (!borders)
|
|
291682
291933
|
return {};
|
|
@@ -291756,7 +292007,18 @@ ${err.toString()}`);
|
|
|
291756
292007
|
return { "data-cant-split": "true" };
|
|
291757
292008
|
}
|
|
291758
292009
|
},
|
|
291759
|
-
tableRowProperties: {
|
|
292010
|
+
tableRowProperties: {
|
|
292011
|
+
rendered: false,
|
|
292012
|
+
parseDOM: (element3) => {
|
|
292013
|
+
const parsedHeightPx = parseRowHeight(element3);
|
|
292014
|
+
if (parsedHeightPx == null)
|
|
292015
|
+
return;
|
|
292016
|
+
return { rowHeight: {
|
|
292017
|
+
value: pixelsToTwips(parsedHeightPx),
|
|
292018
|
+
rule: "atLeast"
|
|
292019
|
+
} };
|
|
292020
|
+
}
|
|
292021
|
+
},
|
|
291760
292022
|
rsidDel: { rendered: false },
|
|
291761
292023
|
rsidR: { rendered: false },
|
|
291762
292024
|
rsidRPr: { rendered: false },
|
|
@@ -291820,36 +292082,51 @@ ${err.toString()}`);
|
|
|
291820
292082
|
return { "data-colwidth": attrs.colwidth.join(",") };
|
|
291821
292083
|
}
|
|
291822
292084
|
},
|
|
291823
|
-
background: {
|
|
291824
|
-
|
|
291825
|
-
|
|
291826
|
-
|
|
291827
|
-
|
|
291828
|
-
|
|
291829
|
-
|
|
291830
|
-
|
|
291831
|
-
|
|
291832
|
-
|
|
291833
|
-
|
|
291834
|
-
|
|
291835
|
-
|
|
291836
|
-
|
|
291837
|
-
|
|
291838
|
-
|
|
291839
|
-
|
|
291840
|
-
|
|
291841
|
-
|
|
291842
|
-
|
|
291843
|
-
|
|
291844
|
-
|
|
291845
|
-
|
|
291846
|
-
|
|
291847
|
-
|
|
291848
|
-
|
|
291849
|
-
|
|
291850
|
-
|
|
292085
|
+
background: {
|
|
292086
|
+
parseDOM: (element3) => {
|
|
292087
|
+
const color2 = cssColorToHex(element3.style?.backgroundColor);
|
|
292088
|
+
if (!color2)
|
|
292089
|
+
return null;
|
|
292090
|
+
return { color: color2.replace(/^#/, "") };
|
|
292091
|
+
},
|
|
292092
|
+
renderDOM({ background }) {
|
|
292093
|
+
if (!background)
|
|
292094
|
+
return {};
|
|
292095
|
+
const { color: color2 } = background || {};
|
|
292096
|
+
return { style: `background-color: ${color2 ? `#${color2}` : "transparent"}` };
|
|
292097
|
+
}
|
|
292098
|
+
},
|
|
292099
|
+
verticalAlign: {
|
|
292100
|
+
parseDOM: parseCellVerticalAlignFromStyle,
|
|
292101
|
+
renderDOM({ verticalAlign }) {
|
|
292102
|
+
if (!verticalAlign)
|
|
292103
|
+
return {};
|
|
292104
|
+
return { style: `vertical-align: ${verticalAlign}` };
|
|
292105
|
+
}
|
|
292106
|
+
},
|
|
292107
|
+
cellMargins: {
|
|
292108
|
+
parseDOM: (element3) => parseCellMargins(element3),
|
|
292109
|
+
renderDOM({ cellMargins, borders }) {
|
|
292110
|
+
if (!cellMargins)
|
|
292111
|
+
return {};
|
|
292112
|
+
return { style: [
|
|
292113
|
+
"top",
|
|
292114
|
+
"right",
|
|
292115
|
+
"bottom",
|
|
292116
|
+
"left"
|
|
292117
|
+
].map((side) => {
|
|
292118
|
+
const margin = cellMargins?.[side] ?? 0;
|
|
292119
|
+
const border = borders?.[side];
|
|
292120
|
+
const borderSize = border && border.val !== "none" ? Math.ceil(border.size) : 0;
|
|
292121
|
+
if (margin)
|
|
292122
|
+
return `padding-${side}: ${Math.max(0, margin - borderSize)}px;`;
|
|
292123
|
+
return "";
|
|
292124
|
+
}).join(" ") };
|
|
292125
|
+
}
|
|
292126
|
+
},
|
|
291851
292127
|
borders: {
|
|
291852
292128
|
default: null,
|
|
292129
|
+
parseDOM: (element3) => parseCellBorders(element3),
|
|
291853
292130
|
renderDOM: ({ borders }) => {
|
|
291854
292131
|
if (!borders)
|
|
291855
292132
|
return {};
|
|
@@ -316933,7 +317210,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
316933
317210
|
".tif"
|
|
316934
317211
|
]);
|
|
316935
317212
|
new PluginKey("paginationPlugin");
|
|
316936
|
-
|
|
317213
|
+
HEADER_FOOTER_VARIANTS$12 = [
|
|
316937
317214
|
"default",
|
|
316938
317215
|
"first",
|
|
316939
317216
|
"even",
|
|
@@ -317174,7 +317451,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
317174
317451
|
variant
|
|
317175
317452
|
});
|
|
317176
317453
|
};
|
|
317177
|
-
|
|
317454
|
+
HEADER_FOOTER_VARIANTS$12.forEach((variant) => {
|
|
317178
317455
|
const headerId = collections.headerIds?.[variant];
|
|
317179
317456
|
const footerId = collections.footerIds?.[variant];
|
|
317180
317457
|
if (typeof headerId === "string")
|
|
@@ -317437,6 +317714,12 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
317437
317714
|
"bar",
|
|
317438
317715
|
"clear"
|
|
317439
317716
|
]);
|
|
317717
|
+
HEADER_FOOTER_VARIANTS4 = [
|
|
317718
|
+
"default",
|
|
317719
|
+
"first",
|
|
317720
|
+
"even",
|
|
317721
|
+
"odd"
|
|
317722
|
+
];
|
|
317440
317723
|
DEFAULT_SEMANTIC_FOOTNOTE_HEADING_STYLE = {
|
|
317441
317724
|
fontFamily: "Arial",
|
|
317442
317725
|
fontSize: 14,
|
|
@@ -321502,15 +321785,15 @@ var init_zipper_DbkgrypV_es = __esm(() => {
|
|
|
321502
321785
|
|
|
321503
321786
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
321504
321787
|
var init_super_editor_es = __esm(() => {
|
|
321505
|
-
|
|
321506
|
-
|
|
321788
|
+
init_src_d1wQbdUW_es();
|
|
321789
|
+
init_SuperConverter_CJYLTlzF_es();
|
|
321507
321790
|
init_jszip_C49i9kUs_es();
|
|
321508
321791
|
init_xml_js_CqGKpaft_es();
|
|
321509
|
-
|
|
321510
|
-
|
|
321792
|
+
init_create_headless_toolbar_BvILQhp3_es();
|
|
321793
|
+
init_constants_CGhJRd87_es();
|
|
321511
321794
|
init_dist_B8HfvhaK_es();
|
|
321512
321795
|
init_unified_Dsuw2be5_es();
|
|
321513
|
-
|
|
321796
|
+
init_DocxZipper_CaIWmehq_es();
|
|
321514
321797
|
init_eventemitter3_BdNugZrm_es();
|
|
321515
321798
|
init_errors_CtyzHiH4_es();
|
|
321516
321799
|
init_zipper_DbkgrypV_es();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.5.0-next.
|
|
3
|
+
"version": "0.5.0-next.68",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@superdoc-dev/cli-darwin-arm64": "0.5.0-next.
|
|
38
|
-
"@superdoc-dev/cli-darwin-x64": "0.5.0-next.
|
|
39
|
-
"@superdoc-dev/cli-linux-
|
|
40
|
-
"@superdoc-dev/cli-linux-
|
|
41
|
-
"@superdoc-dev/cli-windows-x64": "0.5.0-next.
|
|
37
|
+
"@superdoc-dev/cli-darwin-arm64": "0.5.0-next.68",
|
|
38
|
+
"@superdoc-dev/cli-darwin-x64": "0.5.0-next.68",
|
|
39
|
+
"@superdoc-dev/cli-linux-arm64": "0.5.0-next.68",
|
|
40
|
+
"@superdoc-dev/cli-linux-x64": "0.5.0-next.68",
|
|
41
|
+
"@superdoc-dev/cli-windows-x64": "0.5.0-next.68"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"predev": "node scripts/ensure-superdoc-build.js",
|