@stll/folio-core 0.5.0 → 0.6.1
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/ai-edits/headless.d.ts +5 -1
- package/dist/ai-edits/headless.js +53 -3
- package/dist/ai-edits/index.d.ts +2 -2
- package/dist/compat/eigenpal.d.ts +2 -2
- package/dist/controller/layoutPipeline.js +17 -6
- package/dist/document-operations.d.ts +20 -3
- package/dist/document-operations.js +7 -4
- package/dist/docx/blockContentParser.js +2 -100
- package/dist/docx/paragraphTextBoxEnrichment.d.ts +9 -0
- package/dist/docx/paragraphTextBoxEnrichment.js +104 -0
- package/dist/docx/tableParser.js +2 -0
- package/dist/i18n/messages/catalogs.gen.d.ts +1054 -34
- package/dist/i18n/messages/catalogs.gen.js +1122 -68
- package/dist/i18n/messages/messages.gen.d.ts +62 -2
- package/dist/index.d.ts +2 -2
- package/dist/layout-bridge/convert/toFlowBlocks.js +15 -13
- package/dist/layout-bridge/sectionColumns.js +6 -1
- package/dist/layout-engine/index.js +63 -11
- package/dist/layout-engine/measure/measureBlocks.js +25 -2
- package/dist/layout-engine/paginator.d.ts +2 -0
- package/dist/layout-engine/paginator.js +17 -13
- package/dist/layout-engine/tableRowBreak.js +3 -0
- package/dist/layout-engine/types.d.ts +5 -2
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/renderPage.js +7 -2
- package/dist/layout-painter/renderParagraph.js +5 -4
- package/dist/layout-painter/renderTable.js +88 -10
- package/dist/managers/TableSelectionManager.js +1 -1
- package/dist/paged-layout/sectionBlockWidths.js +11 -3
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.js +11 -2
- package/dist/prosemirror/conversion/toProseDoc.js +26 -20
- package/dist/prosemirror/extensions/nodes/TableExtension.js +2 -2
- package/dist/prosemirror/index.js +1 -1
- package/dist/prosemirror/insertOperations.js +1 -1
- package/dist/server.d.ts +2 -2
- package/package.json +1 -1
|
@@ -910,7 +910,9 @@ function renderLine(block, line, alignment, doc, options) {
|
|
|
910
910
|
if (!options.isLastLine || options.paragraphEndsWithLineBreak) {
|
|
911
911
|
const firstLineIndentPx = options.isFirstLine ? options.firstLineIndentPx ?? 0 : 0;
|
|
912
912
|
const firstLineHangingPx = Math.max(0, -firstLineIndentPx);
|
|
913
|
-
const
|
|
913
|
+
const hasVisibleListMarker = options.isFirstLine && block.attrs?.listMarker && !block.attrs.listMarkerHidden;
|
|
914
|
+
const firstLineHangingExpansionPx = hasVisibleListMarker ? Math.min(firstLineHangingPx, Math.max(0, options.leftIndentPx ?? 0)) : firstLineHangingPx;
|
|
915
|
+
const justifyCapacityPx = options.availableWidth + firstLineHangingExpansionPx;
|
|
914
916
|
const overfullPx = line.width - justifyCapacityPx;
|
|
915
917
|
const shrinkableSpaces = countShrinkableSpaces(runsForLine);
|
|
916
918
|
if (overfullPx > RIGHT_EDGE_EPSILON_PX && shrinkableSpaces > 0) {
|
|
@@ -925,7 +927,7 @@ function renderLine(block, line, alignment, doc, options) {
|
|
|
925
927
|
lineEl.style.textAlign = "justify";
|
|
926
928
|
lineEl.style.textAlignLast = "justify";
|
|
927
929
|
}
|
|
928
|
-
const listFirstLineOffset =
|
|
930
|
+
const listFirstLineOffset = hasVisibleListMarker ? Math.max(firstLineIndentPx, -firstLineHangingExpansionPx) : 0;
|
|
929
931
|
lineEl.style.width = `${options.availableWidth - listFirstLineOffset}px`;
|
|
930
932
|
}
|
|
931
933
|
}
|
|
@@ -1249,7 +1251,6 @@ function renderParagraphFragment(fragment, block, measure, context, options = {}
|
|
|
1249
1251
|
} else if (indentLeft > 0) lineEl.style.paddingLeft = `${indentLeft}px`;
|
|
1250
1252
|
else if (hasFirstLine && !isFlexLine) lineEl.style.textIndent = `${indent.firstLine ?? 0}px`;
|
|
1251
1253
|
} else if (indentLeft > 0) lineEl.style.paddingLeft = `${indentLeft}px`;
|
|
1252
|
-
else if (hasHanging && indentLeft === 0) lineEl.style.paddingLeft = `${indent.hanging ?? 0}px`;
|
|
1253
1254
|
if (indentRight > 0) lineEl.style.paddingRight = `${indentRight}px`;
|
|
1254
1255
|
if (isFirstLine && block.attrs?.listMarker && !block.attrs.listMarkerHidden) {
|
|
1255
1256
|
const hanging = indent?.hanging ?? 0;
|
|
@@ -1269,7 +1270,7 @@ function renderParagraphFragment(fragment, block, measure, context, options = {}
|
|
|
1269
1270
|
const markerFontSize = block.attrs.listMarkerFontSize ?? firstTextRun?.fontSize ?? block.attrs.defaultFontSize;
|
|
1270
1271
|
const marker = renderListMarker(block.attrs.listMarker, getListMarkerInlineWidth(block), doc, markerFontFamily, markerFontSize, block.attrs.listMarkerRevision, block.attrs.listMarkerSecondSlotOffsetTwips);
|
|
1271
1272
|
const markerMarginLeft = markerStart - Math.min(indentLeft, 0);
|
|
1272
|
-
if (markerMarginLeft < 0
|
|
1273
|
+
if (markerMarginLeft < 0) marker.style.marginLeft = `${markerMarginLeft}px`;
|
|
1273
1274
|
lineEl.prepend(marker);
|
|
1274
1275
|
}
|
|
1275
1276
|
fragmentEl.append(lineEl);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { emuToPixels } from "../utils/units.js";
|
|
2
|
+
import { isFloatingImageRun, isFloatingTextBoxBlock, tableColumnsArePinned } from "../layout-engine/types.js";
|
|
2
3
|
import { measureParagraph } from "../layout-engine/measure/measureParagraph.js";
|
|
3
4
|
import { getAutomaticTextColorForBackground } from "./documentColors.js";
|
|
4
5
|
import { renderParagraphFragment } from "./renderParagraph.js";
|
|
5
6
|
import { buildTableCellFloatingZones, getTableCellContentWidth, getTableCellFloatingImages } from "../layout-engine/measure/tableCellFloating.js";
|
|
7
|
+
import { renderTextBoxFragment } from "./renderTextBox.js";
|
|
6
8
|
//#region src/layout-painter/renderTable.ts
|
|
7
9
|
/**
|
|
8
10
|
* Table Renderer
|
|
@@ -26,9 +28,6 @@ const TABLE_CLASS_NAMES = {
|
|
|
26
28
|
tableEdgeHandleBottom: "layout-table-edge-handle-bottom",
|
|
27
29
|
tableEdgeHandleRight: "layout-table-edge-handle-right"
|
|
28
30
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Render cell content (paragraphs and nested tables)
|
|
31
|
-
*/
|
|
32
31
|
function renderCellContent(cell, cellMeasure, context, doc) {
|
|
33
32
|
const contentEl = doc.createElement("div");
|
|
34
33
|
contentEl.className = TABLE_CLASS_NAMES.cellContent;
|
|
@@ -37,6 +36,7 @@ function renderCellContent(cell, cellMeasure, context, doc) {
|
|
|
37
36
|
contentEl.style.width = `${contentWidth}px`;
|
|
38
37
|
const cellFloatingImages = getTableCellFloatingImages(cell, cellMeasure, contentWidth);
|
|
39
38
|
const floatingZones = buildTableCellFloatingZones(cellFloatingImages, contentWidth);
|
|
39
|
+
const floatingLayers = [];
|
|
40
40
|
if (cellFloatingImages.length > 0) {
|
|
41
41
|
const floatingLayer = doc.createElement("div");
|
|
42
42
|
floatingLayer.className = "layout-cell-floating-images-layer";
|
|
@@ -47,7 +47,7 @@ function renderCellContent(cell, cellMeasure, context, doc) {
|
|
|
47
47
|
floatingLayer.style.height = "100%";
|
|
48
48
|
floatingLayer.style.pointerEvents = "none";
|
|
49
49
|
floatingLayer.style.zIndex = "10";
|
|
50
|
-
floatingLayer.style.overflow = "
|
|
50
|
+
floatingLayer.style.overflow = "visible";
|
|
51
51
|
for (const img of cellFloatingImages) {
|
|
52
52
|
const imgContainer = doc.createElement("div");
|
|
53
53
|
imgContainer.className = "layout-cell-floating-image";
|
|
@@ -67,9 +67,11 @@ function renderCellContent(cell, cellMeasure, context, doc) {
|
|
|
67
67
|
imgContainer.append(imgEl);
|
|
68
68
|
floatingLayer.append(imgContainer);
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
floatingLayers.push(floatingLayer);
|
|
71
71
|
}
|
|
72
72
|
let cumulativeY = 0;
|
|
73
|
+
let anchorParagraphY = 0;
|
|
74
|
+
let floatingTextBoxesLayer;
|
|
73
75
|
for (let i = 0; i < cell.blocks.length; i++) {
|
|
74
76
|
const block = cell.blocks[i];
|
|
75
77
|
const measure = cellMeasure.blocks[i];
|
|
@@ -103,15 +105,81 @@ function renderCellContent(cell, cellMeasure, context, doc) {
|
|
|
103
105
|
const spaceBefore = paragraphBlock.attrs?.spacing?.before ?? 0;
|
|
104
106
|
if (spaceBefore > 0) fragEl.style.paddingTop = `${spaceBefore}px`;
|
|
105
107
|
contentEl.append(fragEl);
|
|
108
|
+
anchorParagraphY = cumulativeY;
|
|
106
109
|
cumulativeY += paragraphMeasure.totalHeight;
|
|
107
110
|
} else if (block?.kind === "table" && measure?.kind === "table") {
|
|
108
111
|
const nestedTableEl = renderNestedTable(block, measure, context, doc);
|
|
109
112
|
nestedTableEl.style.position = "relative";
|
|
110
113
|
contentEl.append(nestedTableEl);
|
|
111
114
|
cumulativeY += measure.totalHeight;
|
|
115
|
+
anchorParagraphY = cumulativeY;
|
|
116
|
+
} else if (block?.kind === "textBox" && measure?.kind === "textBox") {
|
|
117
|
+
const textBoxBlock = block;
|
|
118
|
+
const textBoxMeasure = measure;
|
|
119
|
+
const textBoxEl = renderTextBoxFragment({
|
|
120
|
+
kind: "textBox",
|
|
121
|
+
blockId: textBoxBlock.id,
|
|
122
|
+
x: 0,
|
|
123
|
+
y: 0,
|
|
124
|
+
width: textBoxMeasure.width,
|
|
125
|
+
height: textBoxMeasure.height,
|
|
126
|
+
...textBoxBlock.pmStart !== void 0 ? { pmStart: textBoxBlock.pmStart } : {},
|
|
127
|
+
...textBoxBlock.pmEnd !== void 0 ? { pmEnd: textBoxBlock.pmEnd } : {}
|
|
128
|
+
}, textBoxBlock, textBoxMeasure, {
|
|
129
|
+
...context,
|
|
130
|
+
insideTableCell: true
|
|
131
|
+
}, { document: doc });
|
|
132
|
+
if (isFloatingTextBoxBlock(textBoxBlock)) {
|
|
133
|
+
floatingTextBoxesLayer ??= createCellFloatingTextBoxesLayer(doc);
|
|
134
|
+
textBoxEl.style.left = `${resolveCellTextBoxX(textBoxBlock, contentWidth)}px`;
|
|
135
|
+
textBoxEl.style.top = `${anchorParagraphY + resolveCellTextBoxY(textBoxBlock)}px`;
|
|
136
|
+
textBoxEl.style.pointerEvents = "auto";
|
|
137
|
+
floatingTextBoxesLayer.append(textBoxEl);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
textBoxEl.style.position = "relative";
|
|
141
|
+
textBoxEl.style.left = "0";
|
|
142
|
+
textBoxEl.style.top = "0";
|
|
143
|
+
contentEl.append(textBoxEl);
|
|
144
|
+
cumulativeY += textBoxMeasure.height;
|
|
145
|
+
anchorParagraphY = cumulativeY;
|
|
112
146
|
}
|
|
113
147
|
}
|
|
114
|
-
|
|
148
|
+
if (floatingTextBoxesLayer) floatingLayers.push(floatingTextBoxesLayer);
|
|
149
|
+
return {
|
|
150
|
+
content: contentEl,
|
|
151
|
+
floatingLayers
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function createCellFloatingTextBoxesLayer(doc) {
|
|
155
|
+
const layer = doc.createElement("div");
|
|
156
|
+
layer.className = "layout-cell-floating-text-boxes-layer";
|
|
157
|
+
layer.style.position = "absolute";
|
|
158
|
+
layer.style.inset = "0";
|
|
159
|
+
layer.style.pointerEvents = "none";
|
|
160
|
+
layer.style.zIndex = "10";
|
|
161
|
+
layer.style.overflow = "visible";
|
|
162
|
+
return layer;
|
|
163
|
+
}
|
|
164
|
+
function resolveCellTextBoxX(block, contentWidth) {
|
|
165
|
+
const horizontal = block.position?.horizontal;
|
|
166
|
+
if (horizontal?.posOffset !== void 0) return emuToPixels(horizontal.posOffset);
|
|
167
|
+
if (horizontal?.align === "center") return (contentWidth - block.width) / 2;
|
|
168
|
+
if (horizontal?.align === "right" || horizontal?.align === "outside") return contentWidth - block.width;
|
|
169
|
+
return 0;
|
|
170
|
+
}
|
|
171
|
+
function resolveCellTextBoxY(block) {
|
|
172
|
+
const vertical = block.position?.vertical;
|
|
173
|
+
if (vertical?.posOffset !== void 0) return emuToPixels(vertical.posOffset);
|
|
174
|
+
return 0;
|
|
175
|
+
}
|
|
176
|
+
function tableHasFloatingCellContent(block) {
|
|
177
|
+
for (const row of block.rows) for (const cell of row.cells) for (const cellBlock of cell.blocks) {
|
|
178
|
+
if (cellBlock.kind === "textBox" && isFloatingTextBoxBlock(cellBlock)) return true;
|
|
179
|
+
if (cellBlock.kind === "paragraph" && cellBlock.runs.some((run) => run.kind === "image" && isFloatingImageRun(run))) return true;
|
|
180
|
+
if (cellBlock.kind === "table" && tableHasFloatingCellContent(cellBlock)) return true;
|
|
181
|
+
}
|
|
182
|
+
return false;
|
|
115
183
|
}
|
|
116
184
|
/**
|
|
117
185
|
* Render a nested table (within a cell)
|
|
@@ -214,8 +282,18 @@ function renderTableCell(cell, cellMeasure, x, rowHeight, borderFlags, columnsPi
|
|
|
214
282
|
default: break;
|
|
215
283
|
}
|
|
216
284
|
}
|
|
217
|
-
const
|
|
218
|
-
|
|
285
|
+
const renderedContent = renderCellContent(cell, cellMeasure, context, doc);
|
|
286
|
+
if (renderedContent.floatingLayers.length > 0) {
|
|
287
|
+
renderedContent.content.style.height = "100%";
|
|
288
|
+
renderedContent.content.style.overflow = "hidden";
|
|
289
|
+
cellEl.style.overflow = "visible";
|
|
290
|
+
}
|
|
291
|
+
cellEl.append(renderedContent.content);
|
|
292
|
+
for (const floatingLayer of renderedContent.floatingLayers) {
|
|
293
|
+
floatingLayer.style.left = `${padLeft}px`;
|
|
294
|
+
floatingLayer.style.top = `${padTop}px`;
|
|
295
|
+
cellEl.append(floatingLayer);
|
|
296
|
+
}
|
|
219
297
|
if (cell.blocks.length > 0) {
|
|
220
298
|
const firstBlock = cell.blocks.at(0);
|
|
221
299
|
const lastBlock = cell.blocks.at(-1);
|
|
@@ -316,7 +394,7 @@ function renderTableFragment(fragment, block, measure, context, options = {}) {
|
|
|
316
394
|
tableEl.style.position = "absolute";
|
|
317
395
|
tableEl.style.width = `${fragment.width}px`;
|
|
318
396
|
tableEl.style.height = `${fragment.height}px`;
|
|
319
|
-
tableEl.style.overflow = "hidden";
|
|
397
|
+
tableEl.style.overflow = tableHasFloatingCellContent(block) ? "visible" : "hidden";
|
|
320
398
|
tableEl.dataset["blockId"] = String(fragment.blockId);
|
|
321
399
|
tableEl.dataset["fromRow"] = String(fragment.fromRow);
|
|
322
400
|
tableEl.dataset["toRow"] = String(fragment.toRow);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addColumn, addRow, createTableContext, deleteColumn, deleteRow, getColumnCount, mergeCells, splitCell } from "../utils/tableOperations.js";
|
|
2
1
|
import { Subscribable } from "./Subscribable.js";
|
|
2
|
+
import { addColumn, addRow, createTableContext, deleteColumn, deleteRow, getColumnCount, mergeCells, splitCell } from "../utils/tableOperations.js";
|
|
3
3
|
//#region src/managers/TableSelectionManager.ts
|
|
4
4
|
/** Data attributes for table elements in the rendered DOM */
|
|
5
5
|
const TABLE_DATA_ATTRIBUTES = {
|
|
@@ -20,8 +20,10 @@ function computePerBlockWidths({ blocks, bodyConfig, finalConfig }) {
|
|
|
20
20
|
}).widths;
|
|
21
21
|
}
|
|
22
22
|
function computePerBlockMeasureInputs({ blocks, bodyConfig, finalConfig }) {
|
|
23
|
-
function colWidth(cw, cols) {
|
|
23
|
+
function colWidth(cw, cols, columnIndex) {
|
|
24
24
|
if (cols.count <= 1) return cw;
|
|
25
|
+
const authoredWidth = cols.widths?.[columnIndex];
|
|
26
|
+
if (authoredWidth !== void 0) return authoredWidth;
|
|
25
27
|
return Math.floor((cw - (cols.count - 1) * cols.gap) / cols.count);
|
|
26
28
|
}
|
|
27
29
|
function contentWidth(config) {
|
|
@@ -29,17 +31,23 @@ function computePerBlockMeasureInputs({ blocks, bodyConfig, finalConfig }) {
|
|
|
29
31
|
}
|
|
30
32
|
const { configs: sectionConfigs, breakIndices } = collectSectionConfigs(blocks, bodyConfig, finalConfig);
|
|
31
33
|
let sectionIdx = 0;
|
|
34
|
+
let columnIndex = 0;
|
|
32
35
|
const widths = [];
|
|
33
36
|
const marginTops = [];
|
|
34
37
|
const pageHeights = [];
|
|
35
38
|
const marginBottoms = [];
|
|
36
39
|
for (let i = 0; i < blocks.length; i++) {
|
|
37
40
|
const config = sectionConfigs[sectionIdx] ?? finalConfig;
|
|
38
|
-
|
|
41
|
+
const columns = config.columns ?? SINGLE_COLUMN_LAYOUT;
|
|
42
|
+
widths.push(colWidth(contentWidth(config), columns, columnIndex));
|
|
39
43
|
marginTops.push(config.margins.top);
|
|
40
44
|
pageHeights.push(config.pageSize.h);
|
|
41
45
|
marginBottoms.push(config.margins.bottom);
|
|
42
|
-
if (sectionIdx < breakIndices.length && i === breakIndices[sectionIdx])
|
|
46
|
+
if (sectionIdx < breakIndices.length && i === breakIndices[sectionIdx]) {
|
|
47
|
+
sectionIdx++;
|
|
48
|
+
columnIndex = 0;
|
|
49
|
+
} else if (blocks[i]?.kind === "pageBreak") columnIndex = 0;
|
|
50
|
+
else if (blocks[i]?.kind === "columnBreak") columnIndex = (columnIndex + 1) % columns.count;
|
|
43
51
|
}
|
|
44
52
|
return {
|
|
45
53
|
widths,
|
|
@@ -5,9 +5,9 @@ import { getTableContext, isInTable as isInTableCell } from "../extensions/nodes
|
|
|
5
5
|
import { getListInfo, isInList } from "../extensions/features/ListExtension.js";
|
|
6
6
|
import { CLIPBOARD_READ_ERROR_EVENT, buildPlainTextSlice, pasteWithoutFormatting } from "./pastePlainText.js";
|
|
7
7
|
import { getHyperlinkAttrs, getSelectedText, isHyperlinkActive } from "../extensions/marks/HyperlinkExtension.js";
|
|
8
|
+
import { addColumnLeft, addColumnRight, addRowAbove, addRowBelow, applyTableStyle, autoFitContents, deleteColumn, deleteRow, deleteTable, distributeColumns, insertTable, mergeCells, removeTableBorders, selectColumn, selectRow, selectTable, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setInsideTableBorders, setOutsideTableBorders, setRowHeight, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, splitCell, toggleHeaderRow, toggleNoWrap } from "./table.js";
|
|
8
9
|
import { clearFontFamily, clearFontSize, clearHighlight, clearTextColor, insertHyperlink, removeHyperlink, setFontFamily, setFontSize, setHighlight, setHyperlink, setTextColor, setUnderlineStyle, toggleBold, toggleItalic, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline } from "./formatting.js";
|
|
9
10
|
import { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, doubleSpacing, generateTOC, increaseIndent, increaseListLevel, oneAndHalfSpacing, removeList, removeTabStop, setAlignment, setIndentFirstLine, setIndentLeft, setIndentRight, setLineSpacing, setLtr, setRtl, setSpaceAfter, setSpaceBefore, singleSpacing, toggleBidi, toggleBulletList, toggleNumberedList } from "./paragraph.js";
|
|
10
|
-
import { addColumnLeft, addColumnRight, addRowAbove, addRowBelow, applyTableStyle, autoFitContents, deleteColumn, deleteRow, deleteTable, distributeColumns, insertTable, mergeCells, removeTableBorders, selectColumn, selectRow, selectTable, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setInsideTableBorders, setOutsideTableBorders, setRowHeight, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, splitCell, toggleHeaderRow, toggleNoWrap } from "./table.js";
|
|
11
11
|
import { PAINTABLE_MARK_NAMES, applyFormatMarks, captureFormatMarks } from "./formatPainter.js";
|
|
12
12
|
import { insertPageBreak } from "./pageBreak.js";
|
|
13
13
|
export { CLIPBOARD_READ_ERROR_EVENT, PAINTABLE_MARK_NAMES, acceptAIEditRevision, acceptAllChanges, acceptChange, addColumnLeft, addColumnRight, addCommentMark, addRowAbove, addRowBelow, addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyFormatMarks, applyStyle, applyTableStyle, autoFitContents, buildPlainTextSlice, captureFormatMarks, clearFontFamily, clearFontSize, clearFormatting, clearHighlight, clearStyle, clearTextColor, createRemoveMarkCommand, createSetMarkCommand, decreaseIndent, decreaseListLevel, deleteColumn, deleteRow, deleteTable, distributeColumns, doubleSpacing, findAIEditRevisionRange, findNextChange, findPreviousChange, generateTOC, getHyperlinkAttrs, getListInfo, getMarkAttr, getParagraphAlignment, getParagraphBidi, getSelectedText, getStyleId, getTableContext, increaseIndent, increaseListLevel, insertHyperlink, insertPageBreak, insertTable, isHyperlinkActive, isInList, isInTableCell as isInTable, isMarkActive, mergeCells, oneAndHalfSpacing, pasteWithoutFormatting, rejectAIEditRevision, rejectAllChanges, rejectChange, removeCommentMark, removeHyperlink, removeList, removeTabStop, removeTableBorders, selectColumn, selectRow, selectTable, setAlignment, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setFontFamily, setFontSize, setHighlight, setHyperlink, setIndentFirstLine, setIndentLeft, setIndentRight, setInsideTableBorders, setLineSpacing, setLtr, setOutsideTableBorders, setRowHeight, setRtl, setSpaceAfter, setSpaceBefore, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, setTextColor, setUnderlineStyle, singleSpacing, splitCell, toggleBidi, toggleBold, toggleBulletList, toggleHeaderRow, toggleItalic, toggleNoWrap, toggleNumberedList, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline };
|
|
@@ -1430,9 +1430,18 @@ function tableRowAttrsToFormatting(attrs) {
|
|
|
1430
1430
|
function convertPMTableCell(node, documentCounts) {
|
|
1431
1431
|
const attrs = expectTableCellAttrs(node);
|
|
1432
1432
|
const content = [];
|
|
1433
|
+
let previousStandaloneTextBox = null;
|
|
1433
1434
|
node.forEach((contentNode) => {
|
|
1434
|
-
if (contentNode.type.name === "paragraph")
|
|
1435
|
-
|
|
1435
|
+
if (contentNode.type.name === "paragraph") {
|
|
1436
|
+
content.push(convertPMParagraph(contentNode, documentCounts));
|
|
1437
|
+
previousStandaloneTextBox = null;
|
|
1438
|
+
} else if (contentNode.type.name === "table") {
|
|
1439
|
+
content.push(convertPMTable(contentNode, documentCounts));
|
|
1440
|
+
previousStandaloneTextBox = null;
|
|
1441
|
+
} else if (contentNode.type.name === "textBox") previousStandaloneTextBox = appendTextBoxBlock(content, contentNode, {
|
|
1442
|
+
pendingPageBreaks: 0,
|
|
1443
|
+
previousStandaloneTextBox
|
|
1444
|
+
});
|
|
1436
1445
|
});
|
|
1437
1446
|
const cell = {
|
|
1438
1447
|
type: "tableCell",
|
|
@@ -24,15 +24,18 @@ function toProseDoc(document, options) {
|
|
|
24
24
|
const styleResolver = createStyleEngine(options?.styles ?? document.package.styles);
|
|
25
25
|
const theme = options?.theme ?? document.package.theme ?? null;
|
|
26
26
|
let textBoxGroupIndex = 0;
|
|
27
|
+
const nextTextBoxGroupId = () => String(textBoxGroupIndex++);
|
|
27
28
|
const convertBodyBlocks = (blocks) => {
|
|
28
29
|
const out = [];
|
|
29
30
|
for (const block of blocks) if (block.type === "paragraph") {
|
|
30
31
|
const pbPos = paragraphPageBreakPosition(block);
|
|
31
32
|
if (pbPos === "before") out.push(schema.node("pageBreak"));
|
|
32
|
-
out.push(...convertParagraphWithTextBoxes(block, styleResolver,
|
|
33
|
-
textBoxGroupIndex += 1;
|
|
33
|
+
out.push(...convertParagraphWithTextBoxes(block, styleResolver, { textBoxGroupId: nextTextBoxGroupId() }));
|
|
34
34
|
if (pbPos === "after") out.push(schema.node("pageBreak"));
|
|
35
|
-
} else if (block.type === "table") out.push(convertTable(block, styleResolver,
|
|
35
|
+
} else if (block.type === "table") out.push(convertTable(block, styleResolver, {
|
|
36
|
+
theme,
|
|
37
|
+
nextTextBoxGroupId
|
|
38
|
+
}));
|
|
36
39
|
else out.push(convertBlockSdt(block, convertBodyBlocks));
|
|
37
40
|
return out;
|
|
38
41
|
};
|
|
@@ -535,7 +538,7 @@ function paragraphContentHasMeaningfulContent(content) {
|
|
|
535
538
|
if (content.type === "insertion" || content.type === "deletion" || content.type === "moveFrom" || content.type === "moveTo") return content.content.some(paragraphContentHasMeaningfulContent);
|
|
536
539
|
return true;
|
|
537
540
|
}
|
|
538
|
-
function convertTable(table, styleResolver,
|
|
541
|
+
function convertTable(table, styleResolver, context) {
|
|
539
542
|
const rowSpanMap = calculateRowSpans(table);
|
|
540
543
|
const columnWidths = table.columnWidths;
|
|
541
544
|
const totalWidth = columnWidths?.reduce((sum, w) => sum + w, 0) ?? 0;
|
|
@@ -604,7 +607,7 @@ function convertTable(table, styleResolver, theme) {
|
|
|
604
607
|
})();
|
|
605
608
|
})();
|
|
606
609
|
if (bandingEnabledH && !isFirstRowStyled && !isLastRow) dataRowIndex++;
|
|
607
|
-
return convertTableRow(row, styleResolver, isFirstRowStyled, columnWidths, totalWidth, conditionalStyles, rowBandStyle, bandingEnabledV, look, resolvedTableBorders, rowIndex, totalRows, totalColumns, rowSpanMap, cellMarginsAttr
|
|
610
|
+
return convertTableRow(row, styleResolver, context, isFirstRowStyled, columnWidths, totalWidth, conditionalStyles, rowBandStyle, bandingEnabledV, look, resolvedTableBorders, rowIndex, totalRows, totalColumns, rowSpanMap, cellMarginsAttr);
|
|
608
611
|
});
|
|
609
612
|
return schema.node("table", attrs, rows);
|
|
610
613
|
}
|
|
@@ -620,7 +623,7 @@ function countTableColumns(rows) {
|
|
|
620
623
|
/**
|
|
621
624
|
* Convert a TableRow to a ProseMirror table row node
|
|
622
625
|
*/
|
|
623
|
-
function convertTableRow(row, styleResolver, isHeaderRow, columnWidths, totalWidth, conditionalStyles, rowBandStyle, bandingEnabledV, tableLook, tableBorders, rowIndex, totalRows, totalColumns, rowSpanMap, defaultCellMargins
|
|
626
|
+
function convertTableRow(row, styleResolver, context, isHeaderRow, columnWidths, totalWidth, conditionalStyles, rowBandStyle, bandingEnabledV, tableLook, tableBorders, rowIndex, totalRows, totalColumns, rowSpanMap, defaultCellMargins) {
|
|
624
627
|
const attrs = { isHeader: !!row.formatting?.header };
|
|
625
628
|
if (row.formatting?.height?.value !== void 0) attrs.height = row.formatting.height.value;
|
|
626
629
|
if (row.formatting?.heightRule) attrs.heightRule = row.formatting.heightRule;
|
|
@@ -695,7 +698,7 @@ function convertTableRow(row, styleResolver, isHeaderRow, columnWidths, totalWid
|
|
|
695
698
|
if (cellIsFirstRow && cellIsLastCol && (tableLook?.firstRow || rowCnf?.firstRow || cellCnf?.firstRow) && (tableLook?.lastColumn || rowCnf?.lastColumn || cellCnf?.lastColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.neCell);
|
|
696
699
|
if (cellIsLastRow && cellIsFirstCol && (tableLook?.lastRow || rowCnf?.lastRow || cellCnf?.lastRow) && (tableLook?.firstColumn || rowCnf?.firstColumn || cellCnf?.firstColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.swCell);
|
|
697
700
|
if (cellIsLastRow && cellIsLastCol && (tableLook?.lastRow || rowCnf?.lastRow || cellCnf?.lastRow) && (tableLook?.lastColumn || rowCnf?.lastColumn || cellCnf?.lastColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.seCell);
|
|
698
|
-
cells.push(convertTableCell(cell, styleResolver, isHeaderRow, gridWidth, cellConditionalStyle, tableBorders, isFirstRow, isLastRow, isFirstCol, isLastCol, calculatedRowSpan, preserveVMergeRestart, rowSpanInfo?.continuationCells, defaultCellMargins
|
|
701
|
+
cells.push(convertTableCell(cell, styleResolver, context, isHeaderRow, gridWidth, cellConditionalStyle, tableBorders, isFirstRow, isLastRow, isFirstCol, isLastCol, calculatedRowSpan, preserveVMergeRestart, rowSpanInfo?.continuationCells, defaultCellMargins));
|
|
699
702
|
}
|
|
700
703
|
return schema.node("tableRow", attrs, cells);
|
|
701
704
|
}
|
|
@@ -724,7 +727,8 @@ function resolveThemedBorderColors(borders, theme) {
|
|
|
724
727
|
/**
|
|
725
728
|
* Convert a TableCell to a ProseMirror table cell node
|
|
726
729
|
*/
|
|
727
|
-
function convertTableCell(cell, styleResolver, isHeader, gridWidthPercent, conditionalStyle, tableBorders, isFirstRow, isLastRow, isFirstCol, isLastCol, calculatedRowSpan, preserveVMergeRestart, vMergeContinuationCells, defaultCellMargins
|
|
730
|
+
function convertTableCell(cell, styleResolver, context, isHeader, gridWidthPercent, conditionalStyle, tableBorders, isFirstRow, isLastRow, isFirstCol, isLastCol, calculatedRowSpan, preserveVMergeRestart, vMergeContinuationCells, defaultCellMargins) {
|
|
731
|
+
const { theme } = context;
|
|
728
732
|
const formatting = cell.formatting;
|
|
729
733
|
const rowspan = calculatedRowSpan ?? 1;
|
|
730
734
|
let width = formatting?.width?.value;
|
|
@@ -776,8 +780,12 @@ function convertTableCell(cell, styleResolver, isHeader, gridWidthPercent, condi
|
|
|
776
780
|
if (preserveVMergeRestart) attrs._preserveVMergeRestart = true;
|
|
777
781
|
if (vMergeContinuationCells && vMergeContinuationCells.length > 0) attrs._docxVMergeContinuationCells = vMergeContinuationCells;
|
|
778
782
|
const contentNodes = [];
|
|
779
|
-
for (const content of cell.content) if (content.type === "paragraph") contentNodes.push(
|
|
780
|
-
|
|
783
|
+
for (const content of cell.content) if (content.type === "paragraph") contentNodes.push(...convertParagraphWithTextBoxes(content, styleResolver, {
|
|
784
|
+
textBoxGroupId: context.nextTextBoxGroupId(),
|
|
785
|
+
...conditionalStyle?.rPr !== void 0 ? { extraRunFormatting: conditionalStyle.rPr } : {},
|
|
786
|
+
...conditionalStyle?.pPr !== void 0 ? { tableParagraphOverlay: conditionalStyle.pPr } : {}
|
|
787
|
+
}));
|
|
788
|
+
else contentNodes.push(convertTable(content, styleResolver, context));
|
|
781
789
|
if (contentNodes.length === 0) contentNodes.push(schema.node("paragraph", {}, []));
|
|
782
790
|
const nodeType = isHeader ? "tableHeader" : "tableCell";
|
|
783
791
|
return schema.node(nodeType, attrs, contentNodes);
|
|
@@ -1214,13 +1222,9 @@ function convertShape(shape) {
|
|
|
1214
1222
|
position
|
|
1215
1223
|
});
|
|
1216
1224
|
}
|
|
1217
|
-
|
|
1218
|
-
* Convert a paragraph block to PM nodes, extracting text boxes as sibling nodes.
|
|
1219
|
-
* Skips ghost empty paragraphs that only contained text box drawings.
|
|
1220
|
-
*/
|
|
1221
|
-
function convertParagraphWithTextBoxes(block, styleResolver, textBoxGroupId) {
|
|
1225
|
+
function convertParagraphWithTextBoxes(block, styleResolver, { textBoxGroupId, extraRunFormatting, tableParagraphOverlay }) {
|
|
1222
1226
|
const textBoxes = extractTextBoxesFromParagraph(block);
|
|
1223
|
-
const pmParagraph = convertParagraph(block, styleResolver);
|
|
1227
|
+
const pmParagraph = convertParagraph(block, styleResolver, void 0, extraRunFormatting, tableParagraphOverlay);
|
|
1224
1228
|
const nodes = [];
|
|
1225
1229
|
const isEmptyAfterExtraction = textBoxes.length > 0 && pmParagraph.content.size === 0;
|
|
1226
1230
|
const keepWrapperParagraph = isEmptyAfterExtraction && hasParagraphBoundaryPayload(block, pmParagraph);
|
|
@@ -1361,12 +1365,14 @@ function headerFooterToProseDoc(content, options) {
|
|
|
1361
1365
|
const styleResolver = options?.styles ? createStyleEngine(options.styles) : null;
|
|
1362
1366
|
const theme = options?.theme ?? null;
|
|
1363
1367
|
let textBoxGroupIndex = 0;
|
|
1368
|
+
const nextTextBoxGroupId = () => String(textBoxGroupIndex++);
|
|
1364
1369
|
const convertBlocks = (blocks) => {
|
|
1365
1370
|
const out = [];
|
|
1366
|
-
for (const block of blocks) if (block.type === "paragraph") {
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1371
|
+
for (const block of blocks) if (block.type === "paragraph") out.push(...convertParagraphWithTextBoxes(block, styleResolver, { textBoxGroupId: nextTextBoxGroupId() }));
|
|
1372
|
+
else if (block.type === "table") out.push(convertTable(block, styleResolver, {
|
|
1373
|
+
theme,
|
|
1374
|
+
nextTextBoxGroupId
|
|
1375
|
+
}));
|
|
1370
1376
|
else out.push(convertBlockSdt(block, convertBlocks));
|
|
1371
1377
|
return out;
|
|
1372
1378
|
};
|
|
@@ -298,7 +298,7 @@ function buildCellWidthStyles(attrs) {
|
|
|
298
298
|
return styles;
|
|
299
299
|
}
|
|
300
300
|
const tableCellSpec = {
|
|
301
|
-
content: "(paragraph | table)+",
|
|
301
|
+
content: "(paragraph | table | textBox)+",
|
|
302
302
|
tableRole: "cell",
|
|
303
303
|
isolating: true,
|
|
304
304
|
attrs: {
|
|
@@ -351,7 +351,7 @@ const tableCellSpec = {
|
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
353
|
const tableHeaderSpec = {
|
|
354
|
-
content: "(paragraph | table)+",
|
|
354
|
+
content: "(paragraph | table | textBox)+",
|
|
355
355
|
tableRole: "header_cell",
|
|
356
356
|
isolating: true,
|
|
357
357
|
attrs: {
|
|
@@ -11,10 +11,10 @@ import { createSelectionTrackerPlugin, extractSelectionContext, getSelectionCont
|
|
|
11
11
|
import { getHyperlinkAttrs, getSelectedText, isHyperlinkActive } from "./extensions/marks/HyperlinkExtension.js";
|
|
12
12
|
import { schema, singletonManager } from "./schema/index.js";
|
|
13
13
|
import { createEmptyDoc, toProseDoc } from "./conversion/toProseDoc.js";
|
|
14
|
+
import { addColumnLeft, addColumnRight, addRowAbove, addRowBelow, applyTableStyle, autoFitContents, deleteColumn, deleteRow, deleteTable, distributeColumns, insertTable, mergeCells, removeTableBorders, selectColumn, selectRow, selectTable, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setInsideTableBorders, setOutsideTableBorders, setRowHeight, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, splitCell, toggleHeaderRow, toggleNoWrap } from "./commands/table.js";
|
|
14
15
|
import { extractSelectionState } from "./selectionState.js";
|
|
15
16
|
import { clearFontFamily, clearFontSize, clearHighlight, clearTextColor, insertHyperlink, removeHyperlink, setFontFamily, setFontSize, setHighlight, setHyperlink, setTextColor, toggleBold, toggleItalic, toggleStrike, toggleSubscript, toggleSuperscript, toggleUnderline } from "./commands/formatting.js";
|
|
16
17
|
import { addTabStop, alignCenter, alignJustify, alignLeft, alignRight, applyStyle, clearStyle, decreaseIndent, decreaseListLevel, generateTOC, increaseIndent, increaseListLevel, removeList, removeTabStop, setAlignment, setIndentFirstLine, setIndentLeft, setIndentRight, setLineSpacing, setLtr, setRtl, toggleBidi, toggleBulletList, toggleNumberedList } from "./commands/paragraph.js";
|
|
17
|
-
import { addColumnLeft, addColumnRight, addRowAbove, addRowBelow, applyTableStyle, autoFitContents, deleteColumn, deleteRow, deleteTable, distributeColumns, insertTable, mergeCells, removeTableBorders, selectColumn, selectRow, selectTable, setAllTableBorders, setCellBorder, setCellFillColor, setCellMargins, setCellTextDirection, setCellVerticalAlign, setInsideTableBorders, setOutsideTableBorders, setRowHeight, setTableBorderColor, setTableBorderPreset, setTableBorderWidth, setTableBorders, setTableProperties, splitCell, toggleHeaderRow, toggleNoWrap } from "./commands/table.js";
|
|
18
18
|
import { PAINTABLE_MARK_NAMES, applyFormatMarks, captureFormatMarks } from "./commands/formatPainter.js";
|
|
19
19
|
import { insertPageBreak } from "./commands/pageBreak.js";
|
|
20
20
|
import { insertImageFromFile } from "./commands/image.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { generateTOC } from "./commands/paragraph.js";
|
|
2
1
|
import { insertTable } from "./commands/table.js";
|
|
2
|
+
import { generateTOC } from "./commands/paragraph.js";
|
|
3
3
|
import { insertPageBreak } from "./commands/pageBreak.js";
|
|
4
4
|
import { insertImageFromFile } from "./commands/image.js";
|
|
5
5
|
//#region src/prosemirror/insertOperations.ts
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockPreviewRun, FolioAIComment, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditSnapshot, FolioAIInlineFormatting, FolioAITextRangeHandle } from "./ai-edits/types.js";
|
|
2
|
-
import { FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FolioDocumentOperation, FolioDocumentOperationAffectedTarget, FolioDocumentOperationBatch, FolioDocumentOperationCapabilities, FolioDocumentOperationIssue, FolioDocumentOperationMode, FolioDocumentOperationPrecondition, FolioDocumentOperationReceipt, FolioDocumentOperationRecovery, FolioDocumentOperationResult, FolioDocumentOperationStatus, FolioDocumentOperationType, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, assertSupportedFolioDocumentOperationVersion, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, isFolioDocumentOperationModeSupported, isSupportedFolioDocumentOperationVersion, parseFolioDocumentOperationBatch } from "./document-operations.js";
|
|
2
|
+
import { FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FolioDocumentOperation, FolioDocumentOperationAffectedTarget, FolioDocumentOperationBatch, FolioDocumentOperationCapabilities, FolioDocumentOperationIssue, FolioDocumentOperationMode, FolioDocumentOperationPrecondition, FolioDocumentOperationReceipt, FolioDocumentOperationRecovery, FolioDocumentOperationResult, FolioDocumentOperationStatus, FolioDocumentOperationType, FolioDocumentOperationUndoFailureReason, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, assertSupportedFolioDocumentOperationVersion, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, isFolioDocumentOperationModeSupported, isSupportedFolioDocumentOperationVersion, parseFolioDocumentOperationBatch } from "./document-operations.js";
|
|
3
3
|
import { FolioReviewChange, FolioReviewChangeKind } from "./ai-edits/read.js";
|
|
4
4
|
import { ApplyFolioAIEditsToBufferOptions, ApplyFolioAIEditsToBufferResult, FolioApplyDocumentOperationsOptions, FolioApplyOperationsOptions, FolioDocumentStory, FolioDocumentStoryHandle, FolioDocxReviewer, FolioDocxReviewerOptions, FolioReviewChangeFilter, FolioReviewComment, FolioReviewCommentFilter, FolioReviewCommentReply, FolioReviewReplyInput, applyFolioAIEditsToBuffer } from "./ai-edits/headless.js";
|
|
5
5
|
import { createFolioAITextRangeHandle } from "./ai-edits/snapshot.js";
|
|
@@ -9,4 +9,4 @@ import { createDocx } from "./docx/rezip.js";
|
|
|
9
9
|
import { CreateCommentReplyInput, replyToComment } from "./docx/replyToComment.js";
|
|
10
10
|
import { GenerateRedlineDocxOptions, GenerateRedlineDocxResult, generateRedlineDocx } from "./redline.js";
|
|
11
11
|
import { FolioBlockDiff, FolioFormatProperty, FolioVersionDiff, FolioVersionDiffSegment, compareDocxVersions } from "./version-comparison.js";
|
|
12
|
-
export { type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, type DeriveBlockIdInput, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineFormatting, type FolioAITextRangeHandle, type FolioApplyDocumentOperationsOptions, type FolioApplyOperationsOptions, type FolioBlockDiff, type FolioBlockId, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationStatus, type FolioDocumentOperationType, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioFormatProperty, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, type FolioVersionDiff, type FolioVersionDiffSegment, type GenerateRedlineDocxOptions, type GenerateRedlineDocxResult, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, applyFolioAIEditsToBuffer, assertSupportedFolioDocumentOperationVersion, compareDocxVersions, createDocx, createEmptyDocument, createFolioAITextRangeHandle, deriveBlockId, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioParaIdFromBlockId, isFolioBlockId, isFolioDocumentOperationModeSupported, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, parseFolioDocumentOperationBatch, replyToComment };
|
|
12
|
+
export { type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, type DeriveBlockIdInput, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineFormatting, type FolioAITextRangeHandle, type FolioApplyDocumentOperationsOptions, type FolioApplyOperationsOptions, type FolioBlockDiff, type FolioBlockId, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationStatus, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioFormatProperty, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, type FolioVersionDiff, type FolioVersionDiffSegment, type GenerateRedlineDocxOptions, type GenerateRedlineDocxResult, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, applyFolioAIEditsToBuffer, assertSupportedFolioDocumentOperationVersion, compareDocxVersions, createDocx, createEmptyDocument, createFolioAITextRangeHandle, deriveBlockId, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioParaIdFromBlockId, isFolioBlockId, isFolioDocumentOperationModeSupported, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, parseFolioDocumentOperationBatch, replyToComment };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Headless, framework-neutral core of folio: the OOXML (.docx) parser, document model, ProseMirror integration, and page-layout engine. No React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"document-model",
|