@portone/docx-editor 0.2.1 → 0.3.0
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/CHANGELOG.md +109 -0
- package/CONTRIBUTING.md +5 -1
- package/dist/DocxEditor.d.ts +6 -0
- package/dist/DocxEditor.js +12 -29
- package/dist/core.d.ts +23 -8
- package/dist/core.js +9 -4
- package/dist/docx/cloning.d.ts +38 -0
- package/dist/docx/cloning.js +74 -0
- package/dist/docx/commentOnlyChange.d.ts +12 -7
- package/dist/docx/commentOnlyChange.js +9 -156
- package/dist/docx/comments/constants.d.ts +0 -1
- package/dist/docx/comments/constants.js +0 -2
- package/dist/docx/comments/grammar.d.ts +10 -4
- package/dist/docx/comments/grammar.js +12 -2
- package/dist/docx/comments/{verifying.d.ts → parts.d.ts} +26 -18
- package/dist/docx/comments/parts.js +279 -0
- package/dist/docx/comments/people.d.ts +11 -2
- package/dist/docx/comments/people.js +16 -92
- package/dist/docx/comments/policy.d.ts +7 -0
- package/dist/docx/comments/policy.js +43 -0
- package/dist/docx/comments/reading.js +8 -10
- package/dist/docx/comments/writing.d.ts +19 -7
- package/dist/docx/comments/writing.js +52 -111
- package/dist/docx/documentSettings.d.ts +7 -0
- package/dist/docx/documentSettings.js +10 -2
- package/dist/docx/exportDocx.d.ts +40 -5
- package/dist/docx/exportDocx.js +69 -71
- package/dist/docx/exportRefs.d.ts +5 -2
- package/dist/docx/exportRefs.js +3 -1
- package/dist/docx/fidelity.d.ts +43 -0
- package/dist/docx/fidelity.js +64 -0
- package/dist/docx/formatting/attrs.d.ts +27 -0
- package/dist/docx/formatting/attrs.js +31 -0
- package/dist/docx/formatting/context.d.ts +31 -0
- package/dist/docx/formatting/context.js +42 -0
- package/dist/docx/formatting/direct.d.ts +6 -5
- package/dist/docx/formatting/direct.js +52 -78
- package/dist/docx/formatting/resolve.d.ts +45 -0
- package/dist/docx/formatting/resolve.js +140 -0
- package/dist/docx/formatting/runProperties.d.ts +93 -0
- package/dist/docx/formatting/runProperties.js +316 -0
- package/dist/docx/formatting/styles.js +3 -3
- package/dist/docx/formatting/tabStops.js +7 -22
- package/dist/docx/formatting.d.ts +4 -1
- package/dist/docx/formatting.js +4 -1
- package/dist/docx/headersFooters.js +6 -13
- package/dist/docx/identities.d.ts +67 -0
- package/dist/docx/identities.js +174 -0
- package/dist/docx/importDocx.d.ts +12 -1
- package/dist/docx/importDocx.js +72 -79
- package/dist/docx/importParagraph.d.ts +1 -1
- package/dist/docx/importParagraph.js +4 -3
- package/dist/docx/importTable.d.ts +1 -1
- package/dist/docx/importTable.js +17 -1
- package/dist/docx/invariants.d.ts +33 -0
- package/dist/docx/invariants.js +256 -0
- package/dist/docx/media.d.ts +6 -4
- package/dist/docx/media.js +6 -37
- package/dist/docx/newLists.d.ts +20 -0
- package/dist/docx/newLists.js +36 -0
- package/dist/docx/notes.js +3 -7
- package/dist/docx/numberingPlanner.d.ts +8 -0
- package/dist/docx/numberingPlanner.js +19 -0
- package/dist/docx/packageParts.d.ts +42 -0
- package/dist/docx/packageParts.js +135 -0
- package/dist/docx/pageGeometry.d.ts +2 -0
- package/dist/docx/pageGeometry.js +18 -9
- package/dist/docx/paraProps.d.ts +10 -22
- package/dist/docx/paraProps.js +47 -76
- package/dist/docx/partPlan.d.ts +36 -0
- package/dist/docx/partPlan.js +59 -0
- package/dist/docx/protectionPolicy.d.ts +127 -0
- package/dist/docx/protectionPolicy.js +169 -0
- package/dist/docx/relationships.d.ts +1 -1
- package/dist/docx/relationships.js +8 -13
- package/dist/docx/runProps.d.ts +9 -22
- package/dist/docx/runProps.js +15 -168
- package/dist/docx/scan.js +20 -52
- package/dist/docx/sdt.js +9 -34
- package/dist/docx/sdtProps.d.ts +8 -1
- package/dist/docx/sdtProps.js +10 -0
- package/dist/docx/serializeBlock.d.ts +2 -0
- package/dist/docx/serializeBlock.js +8 -5
- package/dist/docx/serializeTable.js +32 -15
- package/dist/docx/session.d.ts +42 -14
- package/dist/docx/session.js +43 -17
- package/dist/docx/tableFormatting/editing.js +108 -139
- package/dist/docx/tableFormatting/reading.d.ts +16 -6
- package/dist/docx/tableFormatting/reading.js +40 -20
- package/dist/docx/tableTemplate.js +18 -7
- package/dist/download.d.ts +8 -5
- package/dist/download.js +2 -0
- package/dist/editor/clipboard/inlineFormatting.js +19 -30
- package/dist/editor/commands/comments/editing.d.ts +6 -2
- package/dist/editor/commands/comments/editing.js +19 -31
- package/dist/editor/commands/exportQueries.d.ts +15 -0
- package/dist/editor/commands/exportQueries.js +14 -0
- package/dist/editor/commands/fidelityQueries.d.ts +12 -0
- package/dist/editor/commands/fidelityQueries.js +8 -0
- package/dist/editor/commands/formatting/editing.d.ts +2 -2
- package/dist/editor/commands/formatting/editing.js +26 -108
- package/dist/editor/commands/formatting/propertyCommands.d.ts +21 -0
- package/dist/editor/commands/formatting/propertyCommands.js +103 -0
- package/dist/editor/commands/formatting/shared.d.ts +3 -3
- package/dist/editor/commands/formatting/shared.js +5 -2
- package/dist/editor/commands/indentCommands.js +5 -4
- package/dist/editor/commands/index.d.ts +11 -0
- package/dist/editor/commands/index.js +5 -0
- package/dist/editor/commands/linkCommands.js +5 -6
- package/dist/editor/commands/listCommands.js +8 -10
- package/dist/editor/commands/lockCommands.d.ts +7 -1
- package/dist/editor/commands/lockCommands.js +35 -46
- package/dist/editor/commands/paragraphCommands.js +28 -31
- package/dist/editor/commands/spacingCommands.js +1 -1
- package/dist/editor/createEditor.d.ts +17 -29
- package/dist/editor/createEditor.js +58 -58
- package/dist/editor/documentStyles.d.ts +11 -35
- package/dist/editor/documentStyles.js +9 -52
- package/dist/editor/editorDocument.d.ts +56 -0
- package/dist/editor/editorDocument.js +74 -0
- package/dist/editor/externalClipboard.js +16 -45
- package/dist/editor/insertTable.js +4 -3
- package/dist/editor/paragraphEdits.d.ts +11 -18
- package/dist/editor/paragraphEdits.js +7 -16
- package/dist/editor/plugins/displayDerivation.d.ts +47 -0
- package/dist/editor/plugins/displayDerivation.js +78 -0
- package/dist/editor/plugins/imagePaste.js +4 -3
- package/dist/editor/plugins/keymap.js +18 -3
- package/dist/editor/plugins/numberingDecorations.d.ts +5 -11
- package/dist/editor/plugins/numberingDecorations.js +7 -17
- package/dist/editor/plugins/paragraphDisplay.d.ts +7 -0
- package/dist/editor/plugins/paragraphDisplay.js +51 -0
- package/dist/editor/plugins/tabLayout.js +1 -1
- package/dist/editor/plugins/tableDisplay.d.ts +6 -0
- package/dist/editor/plugins/tableDisplay.js +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/model/format.d.ts +30 -8
- package/dist/model/format.js +35 -22
- package/dist/model/tabStops.d.ts +9 -0
- package/dist/model/tabStops.js +18 -0
- package/dist/numbering/listTemplate.js +24 -7
- package/dist/numbering/parseNumbering.d.ts +14 -1
- package/dist/numbering/parseNumbering.js +35 -22
- package/dist/numbering/writeNumbering.d.ts +3 -4
- package/dist/numbering/writeNumbering.js +14 -25
- package/dist/ooxml/childOrder.d.ts +34 -0
- package/dist/ooxml/childOrder.js +496 -0
- package/dist/ooxml/element.d.ts +24 -11
- package/dist/ooxml/element.js +31 -12
- package/dist/ooxml/errors.d.ts +3 -2
- package/dist/ooxml/image.d.ts +4 -0
- package/dist/ooxml/image.js +2 -5
- package/dist/ooxml/partSplice.d.ts +67 -0
- package/dist/ooxml/partSplice.js +169 -0
- package/dist/ooxml/props.d.ts +112 -0
- package/dist/{docx/propsXml.js → ooxml/props.js} +72 -200
- package/dist/ooxml/simpleTypes.d.ts +103 -0
- package/dist/ooxml/simpleTypes.js +182 -0
- package/dist/ooxml/tabStops.js +8 -27
- package/dist/ooxml/tagScan.d.ts +34 -0
- package/dist/ooxml/tagScan.js +108 -0
- package/dist/ooxml/units.d.ts +25 -13
- package/dist/ooxml/units.js +65 -31
- package/dist/ooxml/xml.d.ts +27 -6
- package/dist/ooxml/xml.js +37 -5
- package/dist/page/blockKinds.d.ts +61 -0
- package/dist/page/blockKinds.js +11 -0
- package/dist/page/kinds/index.d.ts +6 -0
- package/dist/page/kinds/index.js +10 -0
- package/dist/page/kinds/paragraphKind.d.ts +10 -0
- package/dist/page/kinds/paragraphKind.js +71 -0
- package/dist/page/kinds/tableKind.d.ts +10 -0
- package/dist/page/kinds/tableKind.js +178 -0
- package/dist/page/measureBlocks.d.ts +3 -14
- package/dist/page/measureBlocks.js +24 -45
- package/dist/page/pageDecorations.d.ts +27 -44
- package/dist/page/pageDecorations.js +70 -152
- package/dist/page/pageLayout.d.ts +2 -19
- package/dist/page/pageLayout.js +36 -6
- package/dist/page/usePageLayout.d.ts +2 -17
- package/dist/page/usePageLayout.js +3 -39
- package/dist/schema/attrRoles.d.ts +25 -18
- package/dist/schema/attrRoles.js +102 -67
- package/dist/schema/displayDerivation.d.ts +82 -0
- package/dist/schema/displayDerivation.js +130 -0
- package/dist/schema/docxSchema.d.ts +3 -0
- package/dist/schema/docxSchema.js +26 -14
- package/dist/schema/editGuard.d.ts +1 -1
- package/dist/schema/guards.d.ts +37 -14
- package/dist/schema/guards.js +29 -3
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.js +2 -0
- package/dist/schema/locks.d.ts +11 -44
- package/dist/schema/locks.js +0 -9
- package/dist/schema/preservedGuards.d.ts +26 -6
- package/dist/schema/preservedGuards.js +31 -1
- package/dist/schema/protection.d.ts +7 -1
- package/dist/schema/protection.js +2 -1
- package/dist/schema/sourceEquality.d.ts +1 -9
- package/dist/schema/sourceEquality.js +1 -27
- package/dist/styles/inlineStyle.js +15 -6
- package/dist/table/cellFormatting.d.ts +8 -1
- package/dist/table/cellFormatting.js +10 -18
- package/dist/table/commands.js +20 -18
- package/dist/table/format.d.ts +3 -0
- package/dist/table/format.js +3 -9
- package/dist/table/gridBorders.d.ts +14 -16
- package/dist/table/gridBorders.js +3 -41
- package/dist/table/merge.d.ts +2 -6
- package/dist/table/merge.js +5 -5
- package/package.json +7 -3
- package/dist/docx/comments/contentTypes.d.ts +0 -7
- package/dist/docx/comments/contentTypes.js +0 -38
- package/dist/docx/comments/verifying.js +0 -206
- package/dist/docx/formatting/effectiveParagraph.d.ts +0 -15
- package/dist/docx/formatting/effectiveParagraph.js +0 -81
- package/dist/docx/propsXml.d.ts +0 -67
- package/dist/docx/uniqueControls.d.ts +0 -14
- package/dist/docx/uniqueControls.js +0 -62
- package/dist/editor/plugins/commentReservations.d.ts +0 -5
- package/dist/editor/plugins/commentReservations.js +0 -26
- package/dist/editor/plugins/styledParagraphs.d.ts +0 -15
- package/dist/editor/plugins/styledParagraphs.js +0 -65
- package/dist/page/tableMeasurements.d.ts +0 -18
- package/dist/page/tableMeasurements.js +0 -119
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Applies inherited style display values to paragraphs created in the editor. The paragraph under
|
|
3
|
-
* active IME composition is deferred to avoid redrawing and canceling the composition.
|
|
4
|
-
*/
|
|
5
|
-
import { Plugin } from "prosemirror-state";
|
|
6
|
-
/**
|
|
7
|
-
* Reads the document's styles into the paragraphs an edit built.
|
|
8
|
-
*
|
|
9
|
-
* No transaction of its own goes to the history: ProseMirror hands an appended transaction to the
|
|
10
|
-
* history as part of the same event, so a single undo takes the edit and these values back together.
|
|
11
|
-
*
|
|
12
|
-
* An appended transaction is handed nothing but states, so the view an open composition is read
|
|
13
|
-
* from is the one the plugin is given when it mounts.
|
|
14
|
-
*/
|
|
15
|
-
export declare function styledParagraphs(): Plugin;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// src/editor/plugins/styledParagraphs.ts
|
|
2
|
-
import { Plugin } from "prosemirror-state";
|
|
3
|
-
import {
|
|
4
|
-
effectiveParagraphFormat,
|
|
5
|
-
effectiveParagraphStyle,
|
|
6
|
-
layerRunFormat
|
|
7
|
-
} from "../../docx/formatting.js";
|
|
8
|
-
import { docxSchema } from "../../schema/index.js";
|
|
9
|
-
import { documentParagraphFormatting } from "../documentStyles.js";
|
|
10
|
-
function needsFormatting(node) {
|
|
11
|
-
return node.attrs.format === null && node.attrs.styleRun === null;
|
|
12
|
-
}
|
|
13
|
-
function paragraphSpots(doc) {
|
|
14
|
-
const found = [];
|
|
15
|
-
doc.descendants((node, pos) => {
|
|
16
|
-
if (node.type !== docxSchema.nodes.paragraph) return true;
|
|
17
|
-
if (needsFormatting(node)) found.push({ pos, node });
|
|
18
|
-
return false;
|
|
19
|
-
});
|
|
20
|
-
return found;
|
|
21
|
-
}
|
|
22
|
-
function styledAttrs(node, state) {
|
|
23
|
-
const context = documentParagraphFormatting(state);
|
|
24
|
-
const style = effectiveParagraphStyle(node.attrs.pPr, context);
|
|
25
|
-
const format = effectiveParagraphFormat(node.attrs.pPr, context);
|
|
26
|
-
const styleRun = style ? layerRunFormat(style.run, null) : null;
|
|
27
|
-
return { ...node.attrs, format, styleRun };
|
|
28
|
-
}
|
|
29
|
-
function composingAt(view, state) {
|
|
30
|
-
return view?.composing === true ? state.selection.from : null;
|
|
31
|
-
}
|
|
32
|
-
function holdsComposition(paragraph, composing) {
|
|
33
|
-
return composing !== null && composing >= paragraph.pos && composing <= paragraph.pos + paragraph.node.nodeSize;
|
|
34
|
-
}
|
|
35
|
-
function styledParagraphs() {
|
|
36
|
-
let live = null;
|
|
37
|
-
return new Plugin({
|
|
38
|
-
view(view) {
|
|
39
|
-
live = view;
|
|
40
|
-
return {
|
|
41
|
-
destroy() {
|
|
42
|
-
live = null;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
appendTransaction(transactions, _oldState, newState) {
|
|
47
|
-
if (!transactions.some((transaction) => transaction.docChanged)) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const composing = composingAt(live, newState);
|
|
51
|
-
const tr = newState.tr;
|
|
52
|
-
for (const paragraph of paragraphSpots(newState.doc)) {
|
|
53
|
-
if (holdsComposition(paragraph, composing)) continue;
|
|
54
|
-
const attrs = styledAttrs(paragraph.node, newState);
|
|
55
|
-
if (!paragraph.node.hasMarkup(paragraph.node.type, attrs)) {
|
|
56
|
-
tr.setNodeMarkup(paragraph.pos, null, attrs);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return tr.docChanged ? tr : null;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
export {
|
|
64
|
-
styledParagraphs
|
|
65
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** Measures safe row boundaries without treating pagination decorations as document content. */
|
|
2
|
-
import type { Node as PMNode } from "prosemirror-model";
|
|
3
|
-
import type { EditorView } from "prosemirror-view";
|
|
4
|
-
import type { BreakCandidate } from "./blockKinds";
|
|
5
|
-
export interface TableMeasure {
|
|
6
|
-
/** Every row that may start the continued part of the table */
|
|
7
|
-
candidates: readonly BreakCandidate[];
|
|
8
|
-
/** The smallest useful first piece: headers followed by one body row group */
|
|
9
|
-
minFirstPiece: number;
|
|
10
|
-
/** Height already added by the previous pagination pass */
|
|
11
|
-
appliedHeight: number;
|
|
12
|
-
/** Document positions of the contiguous header rows at the start of the table */
|
|
13
|
-
headerRows: readonly number[];
|
|
14
|
-
/** Changes when any projected header content or formatting changes */
|
|
15
|
-
headerSignature: string;
|
|
16
|
-
columns: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function measureTable(view: EditorView, tableNode: PMNode, tablePos: number, tableDom: HTMLElement, scale?: number): TableMeasure | null;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
// src/page/tableMeasurements.ts
|
|
2
|
-
import { toRowFormat } from "../model/format.js";
|
|
3
|
-
import { editorAttributes } from "../styles/classNames.js";
|
|
4
|
-
function span(value) {
|
|
5
|
-
return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : 1;
|
|
6
|
-
}
|
|
7
|
-
function paginationRows(table) {
|
|
8
|
-
return Array.from(
|
|
9
|
-
table.querySelectorAll(
|
|
10
|
-
`[${editorAttributes.tablePageSpace}],[${editorAttributes.tableRepeatedHeader}]`
|
|
11
|
-
)
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
function before(candidate, row) {
|
|
15
|
-
return Boolean(
|
|
16
|
-
candidate.compareDocumentPosition(row) & Node.DOCUMENT_POSITION_FOLLOWING
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
function rowEntries(view, tableNode, tablePos, tableDom, appliedRows, scale) {
|
|
20
|
-
const entries = [];
|
|
21
|
-
const tableTop = tableDom.getBoundingClientRect().top;
|
|
22
|
-
tableNode.forEach((row, offset) => {
|
|
23
|
-
const pos = tablePos + 1 + offset;
|
|
24
|
-
const dom = view.nodeDOM(pos);
|
|
25
|
-
if (!(dom instanceof HTMLElement)) return;
|
|
26
|
-
const rect = dom.getBoundingClientRect();
|
|
27
|
-
const appliedBefore = appliedRows.reduce(
|
|
28
|
-
(total, candidate) => total + (before(candidate, dom) ? candidate.getBoundingClientRect().height / scale : 0),
|
|
29
|
-
0
|
|
30
|
-
);
|
|
31
|
-
entries.push({
|
|
32
|
-
node: row,
|
|
33
|
-
pos,
|
|
34
|
-
top: (rect.top - tableTop) / scale - appliedBefore,
|
|
35
|
-
height: rect.height / scale
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
return entries;
|
|
39
|
-
}
|
|
40
|
-
function unsafeBoundaries(rows) {
|
|
41
|
-
const unsafe = /* @__PURE__ */ new Set();
|
|
42
|
-
rows.forEach((row, rowIndex) => {
|
|
43
|
-
row.node.forEach((cell) => {
|
|
44
|
-
const bottom = Math.min(rows.length, rowIndex + span(cell.attrs.rowspan));
|
|
45
|
-
for (let boundary = rowIndex + 1; boundary < bottom; boundary += 1) {
|
|
46
|
-
unsafe.add(boundary);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
return unsafe;
|
|
51
|
-
}
|
|
52
|
-
function headerCount(rows) {
|
|
53
|
-
let count = 0;
|
|
54
|
-
while (count < rows.length && toRowFormat(rows[count]?.node.attrs.format)?.repeatHeader === true) {
|
|
55
|
-
count += 1;
|
|
56
|
-
}
|
|
57
|
-
return count;
|
|
58
|
-
}
|
|
59
|
-
function columnCount(tableNode) {
|
|
60
|
-
const grid = tableNode.attrs.gridCols;
|
|
61
|
-
if (Array.isArray(grid) && grid.length > 0) return grid.length;
|
|
62
|
-
const first = tableNode.firstChild;
|
|
63
|
-
if (!first) return 1;
|
|
64
|
-
let columns = 0;
|
|
65
|
-
first.forEach((cell) => {
|
|
66
|
-
columns += span(cell.attrs.colspan);
|
|
67
|
-
});
|
|
68
|
-
return Math.max(1, columns);
|
|
69
|
-
}
|
|
70
|
-
function measureTable(view, tableNode, tablePos, tableDom, scale = 1) {
|
|
71
|
-
if (tableNode.type.spec.tableRole !== "table") return null;
|
|
72
|
-
const appliedRows = paginationRows(tableDom);
|
|
73
|
-
const rows = rowEntries(
|
|
74
|
-
view,
|
|
75
|
-
tableNode,
|
|
76
|
-
tablePos,
|
|
77
|
-
tableDom,
|
|
78
|
-
appliedRows,
|
|
79
|
-
scale
|
|
80
|
-
);
|
|
81
|
-
if (rows.length === 0) return null;
|
|
82
|
-
const headers = headerCount(rows);
|
|
83
|
-
const unsafe = unsafeBoundaries(rows);
|
|
84
|
-
const headerRows = rows.slice(0, headers);
|
|
85
|
-
const repeatHeaderHeight = headerRows.reduce(
|
|
86
|
-
(total, row) => total + row.height,
|
|
87
|
-
0
|
|
88
|
-
);
|
|
89
|
-
const candidates = [];
|
|
90
|
-
for (let rowIndex = Math.max(1, headers); rowIndex < rows.length; rowIndex += 1) {
|
|
91
|
-
const row = rows[rowIndex];
|
|
92
|
-
if (row && !unsafe.has(rowIndex)) {
|
|
93
|
-
candidates.push({
|
|
94
|
-
at: row.pos,
|
|
95
|
-
offset: row.top,
|
|
96
|
-
forced: false,
|
|
97
|
-
repeatHeight: repeatHeaderHeight
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const firstBodyBoundary = candidates.find(
|
|
102
|
-
(candidate) => candidate.offset > repeatHeaderHeight + 0.5
|
|
103
|
-
);
|
|
104
|
-
const appliedHeight = appliedRows.reduce(
|
|
105
|
-
(total, row) => total + row.getBoundingClientRect().height / scale,
|
|
106
|
-
0
|
|
107
|
-
);
|
|
108
|
-
return {
|
|
109
|
-
candidates,
|
|
110
|
-
minFirstPiece: firstBodyBoundary?.offset ?? tableDom.getBoundingClientRect().height / scale - appliedHeight,
|
|
111
|
-
appliedHeight,
|
|
112
|
-
headerRows: headerRows.map((row) => row.pos),
|
|
113
|
-
headerSignature: JSON.stringify(headerRows.map((row) => row.node.toJSON())),
|
|
114
|
-
columns: columnCount(tableNode)
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
export {
|
|
118
|
-
measureTable
|
|
119
|
-
};
|