@stll/folio-core 0.22.3 → 0.23.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/apply.d.ts +1 -1
- package/dist/controller/layoutPipeline.js +7 -3
- package/dist/document-operations.d.ts +4 -4
- package/dist/document-operations.js +17 -1
- package/dist/docx/blockContentParser.js +2 -47
- package/dist/docx/fieldParser.d.ts +1 -1
- package/dist/docx/fieldParser.js +12 -4
- package/dist/docx/numberingParser.d.ts +2 -11
- package/dist/docx/numberingParser.js +3 -79
- package/dist/docx/ooxmlCounterFormatter.d.ts +8 -0
- package/dist/docx/ooxmlCounterFormatter.js +134 -0
- package/dist/docx/rezip.d.ts +1 -1
- package/dist/docx/rezip.js +12 -31
- package/dist/docx/serializer/tableSerializer.js +1 -1
- package/dist/docx/tableParser.js +2 -1
- package/dist/fields/bookmarkPages.js +1 -1
- package/dist/fields/evaluateField.js +1 -1
- package/dist/fields/fieldContext.d.ts +2 -0
- package/dist/fields/resolveFieldValues.js +5 -2
- package/dist/layout-bridge/convert/headerFooterLayout.js +6 -0
- package/dist/layout-bridge/convert/toFlowBlocks.js +51 -109
- package/dist/layout-engine/index.d.ts +3 -2
- package/dist/layout-engine/index.js +40 -16
- package/dist/layout-engine/measure/cache.js +1 -1
- package/dist/layout-engine/measure/complexScriptFormatting.d.ts +18 -0
- package/dist/layout-engine/measure/complexScriptFormatting.js +11 -0
- package/dist/layout-engine/measure/measureContainer.js +31 -16
- package/dist/layout-engine/measure/measureHelpers.js +4 -0
- package/dist/layout-engine/measure/measureParagraph.js +13 -3
- package/dist/layout-engine/measure/measureTypes.d.ts +4 -0
- package/dist/layout-engine/paginator.d.ts +5 -3
- package/dist/layout-engine/paginator.js +34 -13
- package/dist/layout-engine/types.d.ts +31 -4
- package/dist/layout-painter/imageLayout.d.ts +1 -1
- package/dist/layout-painter/index.js +2 -1
- package/dist/layout-painter/renderPage.js +9 -3
- package/dist/layout-painter/renderParagraph.js +42 -25
- package/dist/layout-painter/renderUtils.d.ts +2 -0
- package/dist/managers/AutoSaveManager.js +8 -40
- package/dist/managers/TableSelectionManager.d.ts +1 -1
- package/dist/managers/autoSaveCodec.d.ts +17 -0
- package/dist/managers/autoSaveCodec.js +109 -0
- package/dist/paged-layout/sectionGeometry.d.ts +3 -2
- package/dist/paged-layout/sectionGeometry.js +17 -1
- package/dist/prosemirror/attrs/index.js +278 -25
- package/dist/prosemirror/commands/comments.js +3 -3
- package/dist/prosemirror/commands/formatting.js +19 -19
- package/dist/prosemirror/commands/index.d.ts +2 -2
- package/dist/prosemirror/commands/paragraph.js +32 -32
- package/dist/prosemirror/commands/propertyChangeScope.d.ts +4 -2
- package/dist/prosemirror/commands/propertyChangeScope.js +8 -8
- package/dist/prosemirror/commands/table.d.ts +10 -52
- package/dist/prosemirror/commands/table.js +34 -34
- package/dist/prosemirror/conversion/fromProseDoc.js +24 -33
- package/dist/prosemirror/conversion/sdtAttrs.d.ts +2 -1
- package/dist/prosemirror/conversion/sdtAttrs.js +9 -4
- package/dist/prosemirror/conversion/toProseDoc.js +4 -1
- package/dist/prosemirror/extensions/ExtensionManager.d.ts +6 -3
- package/dist/prosemirror/extensions/ExtensionManager.js +5 -3
- package/dist/prosemirror/extensions/core/ParagraphExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/ListExtension.js +4 -4
- package/dist/prosemirror/extensions/marks/RunFormattingOverrideExtension.d.ts +3 -2
- package/dist/prosemirror/extensions/marks/RunFormattingOverrideExtension.js +31 -17
- package/dist/prosemirror/extensions/nodes/ShapeExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -0
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/types.d.ts +134 -1
- package/dist/prosemirror/index.d.ts +2 -2
- package/dist/prosemirror/plugins/selectionTracker.js +25 -99
- package/dist/prosemirror/revisionCarriers.js +3 -1
- package/dist/prosemirror/schema/index.d.ts +2 -2
- package/dist/prosemirror/schema/index.js +87 -0
- package/dist/prosemirror/schema/marks.d.ts +8 -0
- package/dist/prosemirror/schema/nodes.d.ts +15 -2
- package/dist/prosemirror/selectionState.d.ts +11 -5
- package/dist/prosemirror/selectionState.js +94 -57
- package/dist/utils/tableOperations.d.ts +7 -6
- package/package.json +3 -3
|
@@ -177,7 +177,7 @@ type ParagraphAttrs = {
|
|
|
177
177
|
* them in UI today, but stripping them on every edit would corrupt the
|
|
178
178
|
* `w:pPrChange` history Word relies on for "show previous formatting"
|
|
179
179
|
* and for reverting an accepted property change. */
|
|
180
|
-
_propertyChanges?:
|
|
180
|
+
_propertyChanges?: ParagraphPropertyChangeAttrs[];
|
|
181
181
|
/** Paragraph-mark insertion / deletion (`<w:pPr><w:rPr><w:ins/>` /
|
|
182
182
|
* `<w:del/>`). Word emits this when the paragraph break itself was
|
|
183
183
|
* authored in track-changes mode — pressing Enter mid-paragraph
|
|
@@ -192,6 +192,17 @@ type ParagraphAttrs = {
|
|
|
192
192
|
*/
|
|
193
193
|
_suggestedInsert?: SuggestedStructuralMarker | null;
|
|
194
194
|
};
|
|
195
|
+
/**
|
|
196
|
+
* ProseMirror property-change attrs may also carry the editor's list-marker
|
|
197
|
+
* snapshot fields alongside the canonical paragraph formatting fields.
|
|
198
|
+
* Keeping that shape typed here lets layout consume validated attrs directly.
|
|
199
|
+
*/
|
|
200
|
+
type ParagraphPropertyChangeAttrs = Omit<document_d_exports.ParagraphPropertyChange, "previousFormatting" | "currentFormatting"> & {
|
|
201
|
+
previousFormatting?: Omit<document_d_exports.ParagraphFormatting, "numPr"> & {
|
|
202
|
+
numPr?: document_d_exports.ParagraphFormatting["numPr"] | null;
|
|
203
|
+
} & Partial<Pick<ParagraphAttrs, "listIsBullet" | "listIsLegal" | "listNumFmt" | "listMarker" | "listMarkerHidden" | "listMarkerFontFamily" | "listMarkerFontSize" | "listMarkerBold" | "listMarkerAlignment" | "listMarkerSuffix" | "listLevelNumFmts" | "listLevelStarts" | "listAbstractNumId" | "listStartOverride" | "lineSpacingExplicit" | "direction" | "_autospacingBase">>;
|
|
204
|
+
currentFormatting?: document_d_exports.ParagraphFormatting;
|
|
205
|
+
};
|
|
195
206
|
/**
|
|
196
207
|
* Image position for floating images (horizontal and vertical positioning)
|
|
197
208
|
*/
|
|
@@ -544,6 +555,8 @@ type TableAttrs = {
|
|
|
544
555
|
borders?: document_d_exports.TableBorders;
|
|
545
556
|
/** Effective table indent after style resolution. PM-only; never serialized. */
|
|
546
557
|
_resolvedIndent?: NonNullable<document_d_exports.TableFormatting["indent"]>;
|
|
558
|
+
/** Effective table direction after style resolution. PM-only; never serialized. */
|
|
559
|
+
_resolvedBidi?: boolean;
|
|
547
560
|
/** Original table formatting from DOCX for lossless round-trip serialization */
|
|
548
561
|
_originalFormatting?: document_d_exports.TableFormatting;
|
|
549
562
|
/** Tracked table property changes (w:tblPrChange) for round-trip + accept/reject */
|
|
@@ -689,4 +702,4 @@ type TableCellAttrs = {
|
|
|
689
702
|
_docxVMergeContinuationCells?: document_d_exports.TableCell[];
|
|
690
703
|
};
|
|
691
704
|
//#endregion
|
|
692
|
-
export { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, SuggestedStructuralMarker, SymbolAttrs, TabAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAnchorAttrs, TextBoxAttrs };
|
|
705
|
+
export { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, ParagraphPropertyChangeAttrs, SdtAttrs, ShapeAttrs, SuggestedStructuralMarker, SymbolAttrs, TabAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAnchorAttrs, TextBoxAttrs };
|
|
@@ -2,9 +2,11 @@ import { document_d_exports } from "../types/document.js";
|
|
|
2
2
|
import { EditorState } from "prosemirror-state";
|
|
3
3
|
//#region src/prosemirror/selectionState.d.ts
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Canonical selection projection shared by toolbar and selection-change APIs.
|
|
6
|
+
* Adapter-specific context belongs on top of this snapshot rather than in a
|
|
7
|
+
* second formatting extractor.
|
|
6
8
|
*/
|
|
7
|
-
type
|
|
9
|
+
type SelectionSnapshot = {
|
|
8
10
|
/** Whether there's an active selection (not just cursor) */
|
|
9
11
|
hasSelection: boolean;
|
|
10
12
|
/** Whether selection spans multiple paragraphs */
|
|
@@ -20,10 +22,14 @@ type SelectionState = {
|
|
|
20
22
|
/** End paragraph index */
|
|
21
23
|
endParagraphIndex: number;
|
|
22
24
|
};
|
|
25
|
+
/** Compatibility name for the public toolbar selection contract. */
|
|
26
|
+
type SelectionState = SelectionSnapshot;
|
|
23
27
|
/**
|
|
24
|
-
* Extract selection
|
|
25
|
-
* Used by
|
|
28
|
+
* Extract the canonical selection snapshot from editor state.
|
|
29
|
+
* Used by both the toolbar callback and the selection tracker plugin.
|
|
26
30
|
*/
|
|
31
|
+
declare function extractSelectionSnapshot(state: EditorState): SelectionSnapshot;
|
|
32
|
+
/** Compatibility entry point used by existing React and Vue integrations. */
|
|
27
33
|
declare function extractSelectionState(state: EditorState): SelectionState | null;
|
|
28
34
|
//#endregion
|
|
29
|
-
export { SelectionState, extractSelectionState };
|
|
35
|
+
export { SelectionSnapshot, SelectionState, extractSelectionSnapshot, extractSelectionState };
|
|
@@ -1,100 +1,137 @@
|
|
|
1
|
+
import { FONT_THEME_VALUES } from "../types/documentEnumValues.js";
|
|
2
|
+
import { expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectHighlightMarkAttrs, expectParagraphAttrs, expectStrikeMarkAttrs, expectTextColorMarkAttrs, expectUnderlineMarkAttrs } from "./attrs/index.js";
|
|
1
3
|
import { directionIsRtl } from "./paragraphDirection.js";
|
|
2
4
|
import { collectMarksInRange } from "./selectionMarks.js";
|
|
3
5
|
//#region src/prosemirror/selectionState.ts
|
|
6
|
+
const isFontTheme = (value) => value !== void 0 && FONT_THEME_VALUES.some((theme) => theme === value);
|
|
4
7
|
/**
|
|
5
|
-
* Extract selection
|
|
6
|
-
* Used by
|
|
8
|
+
* Extract the canonical selection snapshot from editor state.
|
|
9
|
+
* Used by both the toolbar callback and the selection tracker plugin.
|
|
7
10
|
*/
|
|
8
|
-
function
|
|
11
|
+
function extractSelectionSnapshot(state) {
|
|
9
12
|
const { selection, doc } = state;
|
|
10
13
|
const { from, to, empty } = selection;
|
|
11
14
|
const $from = doc.resolve(from);
|
|
15
|
+
const { startParagraphIndex, endParagraphIndex } = paragraphIndexes(doc, from, to);
|
|
16
|
+
const paragraph = $from.parent;
|
|
17
|
+
const paragraphAttrs = paragraph.type.name === "paragraph" ? expectParagraphAttrs(paragraph) : null;
|
|
18
|
+
const marks = selectionMarks(state);
|
|
19
|
+
let textFormatting = extractTextFormatting(marks);
|
|
20
|
+
if (paragraph.type.name === "paragraph" && paragraph.textContent.length === 0 && marks.length === 0 && paragraphAttrs?.defaultTextFormatting) textFormatting = { ...paragraphAttrs.defaultTextFormatting };
|
|
21
|
+
const paragraphFormatting = {};
|
|
22
|
+
let styleId = null;
|
|
23
|
+
if (paragraphAttrs) {
|
|
24
|
+
if (paragraphAttrs.alignment !== void 0) paragraphFormatting.alignment = paragraphAttrs.alignment;
|
|
25
|
+
if (paragraphAttrs.lineSpacing !== void 0) {
|
|
26
|
+
paragraphFormatting.lineSpacing = paragraphAttrs.lineSpacing;
|
|
27
|
+
if (paragraphAttrs.lineSpacingRule !== void 0) paragraphFormatting.lineSpacingRule = paragraphAttrs.lineSpacingRule;
|
|
28
|
+
}
|
|
29
|
+
if (paragraphAttrs.snapToGrid !== void 0) paragraphFormatting.snapToGrid = paragraphAttrs.snapToGrid;
|
|
30
|
+
if (paragraphAttrs.numPr !== void 0) paragraphFormatting.numPr = paragraphAttrs.numPr;
|
|
31
|
+
if (paragraphAttrs.indentLeft !== void 0) paragraphFormatting.indentLeft = paragraphAttrs.indentLeft;
|
|
32
|
+
if (paragraphAttrs.indentRight !== void 0) paragraphFormatting.indentRight = paragraphAttrs.indentRight;
|
|
33
|
+
if (paragraphAttrs.indentFirstLine !== void 0) paragraphFormatting.indentFirstLine = paragraphAttrs.indentFirstLine;
|
|
34
|
+
if (paragraphAttrs.hangingIndent !== void 0) paragraphFormatting.hangingIndent = paragraphAttrs.hangingIndent;
|
|
35
|
+
if (paragraphAttrs.tabs !== void 0) paragraphFormatting.tabs = paragraphAttrs.tabs;
|
|
36
|
+
if (directionIsRtl(paragraphAttrs.direction)) paragraphFormatting.bidi = true;
|
|
37
|
+
if (paragraphAttrs.styleId !== void 0) styleId = paragraphAttrs.styleId;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
hasSelection: !empty,
|
|
41
|
+
isMultiParagraph: startParagraphIndex !== endParagraphIndex,
|
|
42
|
+
textFormatting,
|
|
43
|
+
paragraphFormatting,
|
|
44
|
+
styleId,
|
|
45
|
+
startParagraphIndex,
|
|
46
|
+
endParagraphIndex
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Compatibility entry point used by existing React and Vue integrations. */
|
|
50
|
+
function extractSelectionState(state) {
|
|
51
|
+
return extractSelectionSnapshot(state);
|
|
52
|
+
}
|
|
53
|
+
function paragraphIndexes(doc, from, to) {
|
|
12
54
|
let startParagraphIndex = 0;
|
|
13
55
|
let endParagraphIndex = 0;
|
|
14
56
|
doc.forEach((_node, offset, index) => {
|
|
15
57
|
if (offset <= from) startParagraphIndex = index;
|
|
16
58
|
if (offset <= to) endParagraphIndex = index;
|
|
17
59
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
60
|
+
return {
|
|
61
|
+
startParagraphIndex,
|
|
62
|
+
endParagraphIndex
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function selectionMarks(state) {
|
|
66
|
+
const { selection, doc } = state;
|
|
67
|
+
const { from, to, empty } = selection;
|
|
68
|
+
return empty ? state.storedMarks || selection.$from.marks() : collectMarksInRange({
|
|
23
69
|
doc,
|
|
24
70
|
from,
|
|
25
71
|
to
|
|
26
72
|
});
|
|
27
|
-
|
|
73
|
+
}
|
|
74
|
+
function extractTextFormatting(marks) {
|
|
75
|
+
const formatting = {};
|
|
28
76
|
for (const mark of marks) switch (mark.type.name) {
|
|
29
77
|
case "bold":
|
|
30
|
-
|
|
78
|
+
formatting.bold = true;
|
|
31
79
|
break;
|
|
32
80
|
case "italic":
|
|
33
|
-
|
|
81
|
+
formatting.italic = true;
|
|
34
82
|
break;
|
|
35
|
-
case "underline":
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
83
|
+
case "underline": {
|
|
84
|
+
const attrs = expectUnderlineMarkAttrs(mark);
|
|
85
|
+
if (attrs.style !== "none") formatting.underline = {
|
|
86
|
+
style: attrs.style ?? "single",
|
|
87
|
+
...attrs.color !== void 0 ? { color: attrs.color } : {}
|
|
39
88
|
};
|
|
40
89
|
break;
|
|
90
|
+
}
|
|
41
91
|
case "strike":
|
|
42
|
-
if (mark.
|
|
43
|
-
else
|
|
92
|
+
if (expectStrikeMarkAttrs(mark).double) formatting.doubleStrike = true;
|
|
93
|
+
else formatting.strike = true;
|
|
44
94
|
break;
|
|
45
|
-
case "textColor":
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
95
|
+
case "textColor": {
|
|
96
|
+
const attrs = expectTextColorMarkAttrs(mark);
|
|
97
|
+
formatting.color = {
|
|
98
|
+
...attrs.rgb !== void 0 ? { rgb: attrs.rgb } : {},
|
|
99
|
+
...attrs.themeColor !== void 0 ? { themeColor: attrs.themeColor } : {},
|
|
100
|
+
...attrs.themeTint !== void 0 ? { themeTint: attrs.themeTint } : {},
|
|
101
|
+
...attrs.themeShade !== void 0 ? { themeShade: attrs.themeShade } : {}
|
|
49
102
|
};
|
|
50
103
|
break;
|
|
104
|
+
}
|
|
51
105
|
case "highlight":
|
|
52
|
-
|
|
106
|
+
formatting.highlight = expectHighlightMarkAttrs(mark).color;
|
|
53
107
|
break;
|
|
54
108
|
case "fontSize":
|
|
55
|
-
|
|
109
|
+
formatting.fontSize = expectFontSizeMarkAttrs(mark).size;
|
|
56
110
|
break;
|
|
57
|
-
case "fontFamily":
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
111
|
+
case "fontFamily": {
|
|
112
|
+
const attrs = expectFontFamilyMarkAttrs(mark);
|
|
113
|
+
formatting.fontFamily = {
|
|
114
|
+
...attrs.ascii !== void 0 ? { ascii: attrs.ascii } : {},
|
|
115
|
+
...attrs.hAnsi !== void 0 ? { hAnsi: attrs.hAnsi } : {},
|
|
116
|
+
...attrs.eastAsia !== void 0 ? { eastAsia: attrs.eastAsia } : {},
|
|
117
|
+
...attrs.cs !== void 0 ? { cs: attrs.cs } : {},
|
|
118
|
+
...attrs.hint !== void 0 ? { hint: attrs.hint } : {},
|
|
119
|
+
...isFontTheme(attrs.asciiTheme) ? { asciiTheme: attrs.asciiTheme } : {},
|
|
120
|
+
...attrs.hAnsiTheme !== void 0 ? { hAnsiTheme: attrs.hAnsiTheme } : {},
|
|
121
|
+
...attrs.eastAsiaTheme !== void 0 ? { eastAsiaTheme: attrs.eastAsiaTheme } : {},
|
|
122
|
+
...attrs.csTheme !== void 0 ? { csTheme: attrs.csTheme } : {}
|
|
61
123
|
};
|
|
62
124
|
break;
|
|
125
|
+
}
|
|
63
126
|
case "superscript":
|
|
64
|
-
|
|
127
|
+
formatting.vertAlign = "superscript";
|
|
65
128
|
break;
|
|
66
129
|
case "subscript":
|
|
67
|
-
|
|
130
|
+
formatting.vertAlign = "subscript";
|
|
68
131
|
break;
|
|
69
132
|
default: break;
|
|
70
133
|
}
|
|
71
|
-
|
|
72
|
-
let styleId = null;
|
|
73
|
-
if (paragraph.type.name === "paragraph") {
|
|
74
|
-
if (paragraph.attrs["alignment"]) paragraphFormatting.alignment = paragraph.attrs["alignment"];
|
|
75
|
-
if (typeof paragraph.attrs["lineSpacing"] === "number") {
|
|
76
|
-
paragraphFormatting.lineSpacing = paragraph.attrs["lineSpacing"];
|
|
77
|
-
paragraphFormatting.lineSpacingRule = paragraph.attrs["lineSpacingRule"];
|
|
78
|
-
}
|
|
79
|
-
if (typeof paragraph.attrs["snapToGrid"] === "boolean") paragraphFormatting.snapToGrid = paragraph.attrs["snapToGrid"];
|
|
80
|
-
if (paragraph.attrs["numPr"]) paragraphFormatting.numPr = paragraph.attrs["numPr"];
|
|
81
|
-
if (paragraph.attrs["indentLeft"]) paragraphFormatting.indentLeft = paragraph.attrs["indentLeft"];
|
|
82
|
-
if (paragraph.attrs["indentRight"]) paragraphFormatting.indentRight = paragraph.attrs["indentRight"];
|
|
83
|
-
if (paragraph.attrs["indentFirstLine"]) paragraphFormatting.indentFirstLine = paragraph.attrs["indentFirstLine"];
|
|
84
|
-
if (paragraph.attrs["hangingIndent"]) paragraphFormatting.hangingIndent = paragraph.attrs["hangingIndent"];
|
|
85
|
-
if (paragraph.attrs["tabs"]) paragraphFormatting.tabs = paragraph.attrs["tabs"];
|
|
86
|
-
if (directionIsRtl(paragraph.attrs["direction"])) paragraphFormatting.bidi = true;
|
|
87
|
-
if (paragraph.attrs["styleId"]) styleId = paragraph.attrs["styleId"];
|
|
88
|
-
}
|
|
89
|
-
return {
|
|
90
|
-
hasSelection: !empty,
|
|
91
|
-
isMultiParagraph: startParagraphIndex !== endParagraphIndex,
|
|
92
|
-
textFormatting,
|
|
93
|
-
paragraphFormatting,
|
|
94
|
-
styleId,
|
|
95
|
-
startParagraphIndex,
|
|
96
|
-
endParagraphIndex
|
|
97
|
-
};
|
|
134
|
+
return formatting;
|
|
98
135
|
}
|
|
99
136
|
//#endregion
|
|
100
|
-
export { extractSelectionState };
|
|
137
|
+
export { extractSelectionSnapshot, extractSelectionState };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { document_d_exports } from "../types/document.js";
|
|
2
2
|
//#region src/utils/tableOperations.d.ts
|
|
3
|
+
type TablePropertiesCommand = {
|
|
4
|
+
width?: number | null;
|
|
5
|
+
widthType?: document_d_exports.TableWidthType | null;
|
|
6
|
+
justification?: "left" | "center" | "right" | null;
|
|
7
|
+
};
|
|
3
8
|
type TableAction = "addRowAbove" | "addRowBelow" | "addColumnLeft" | "addColumnRight" | "deleteRow" | "deleteColumn" | "mergeCells" | "splitCell" | "deleteTable" | "selectTable" | "selectRow" | "selectColumn" | "borderAll" | "borderOutside" | "borderInside" | "borderNone" | "borderTop" | "borderBottom" | "borderLeft" | "borderRight" | {
|
|
4
9
|
type: "cellFillColor";
|
|
5
10
|
color: string | null;
|
|
@@ -43,11 +48,7 @@ type TableAction = "addRowAbove" | "addRowBelow" | "addColumnLeft" | "addColumnR
|
|
|
43
48
|
type: "autoFitContents";
|
|
44
49
|
} | {
|
|
45
50
|
type: "tableProperties";
|
|
46
|
-
props:
|
|
47
|
-
width?: number | null;
|
|
48
|
-
widthType?: string | null;
|
|
49
|
-
justification?: "left" | "center" | "right" | null;
|
|
50
|
-
};
|
|
51
|
+
props: TablePropertiesCommand;
|
|
51
52
|
} | {
|
|
52
53
|
type: "openTableProperties";
|
|
53
54
|
} | {
|
|
@@ -83,4 +84,4 @@ declare const deleteColumn: (table: document_d_exports.Table, columnIndex: numbe
|
|
|
83
84
|
declare const mergeCells: (table: document_d_exports.Table, selection: TableSelection) => document_d_exports.Table;
|
|
84
85
|
declare const splitCell: (table: document_d_exports.Table, rowIndex: number, columnIndex: number) => document_d_exports.Table;
|
|
85
86
|
//#endregion
|
|
86
|
-
export { TableAction, TableContext, TableSelection, addColumn, addRow, createTableContext, deleteColumn, deleteRow, getCellAt, getColumnCount, mergeCells, splitCell };
|
|
87
|
+
export { TableAction, TableContext, TablePropertiesCommand, TableSelection, addColumn, addRow, createTableContext, deleteColumn, deleteRow, getCellAt, getColumnCount, mergeCells, splitCell };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.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",
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
"perf": "bun scripts/profile-editor.ts"
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
|
-
"@stll/docx-core": "^0.15.
|
|
116
|
+
"@stll/docx-core": "^0.15.2",
|
|
117
117
|
"@stll/docx-utils": "^0.1.0",
|
|
118
118
|
"@stll/template-conditions": "^0.1.0",
|
|
119
119
|
"better-result": "3.0.1",
|
|
120
120
|
"csstype": "^3.1.3",
|
|
121
121
|
"dompurify": "^3.4.13",
|
|
122
|
-
"fast-xml-parser": "^5.
|
|
122
|
+
"fast-xml-parser": "^5.10.1",
|
|
123
123
|
"hyphen": "1.14.1",
|
|
124
124
|
"jszip": "3.10.1",
|
|
125
125
|
"marked": "^18.0.5",
|