@stll/folio-core 0.15.1 → 0.15.2
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/docx/commentParser.js +30 -2
- package/dist/docx/drawingIdNormalization.d.ts +5 -0
- package/dist/docx/drawingIdNormalization.js +35 -0
- package/dist/docx/drawingUtils.d.ts +1 -1
- package/dist/docx/drawingUtils.js +111 -27
- package/dist/docx/headerFooterVerbatim.d.ts +2 -1
- package/dist/docx/headerFooterVerbatim.js +6 -1
- package/dist/docx/paragraphParser.js +5 -2
- package/dist/docx/paragraphTraversal.d.ts +5 -3
- package/dist/docx/paragraphTraversal.js +20 -13
- package/dist/docx/parser.js +11 -1
- package/dist/docx/parserEnums.d.ts +4 -1
- package/dist/docx/parserEnums.js +5 -2
- package/dist/docx/runConsolidator.js +0 -1
- package/dist/docx/runParser.js +17 -1
- package/dist/docx/serializer/commentSerializer.js +12 -7
- package/dist/docx/serializer/runSerializer.js +16 -10
- package/dist/docx/serializer/sectionPropertiesSerializer.js +3 -2
- package/dist/docx/shapeParser.js +5 -113
- package/dist/docx/tableParser.js +8 -6
- package/dist/docx/textBoxParser.js +1 -1
- package/dist/model.d.ts +3 -3
- package/dist/model.js +2 -2
- package/dist/prosemirror/attrs/index.d.ts +4 -2
- package/dist/prosemirror/attrs/index.js +17 -2
- package/dist/prosemirror/conversion/fromProseDoc.js +10 -6
- package/dist/prosemirror/conversion/toProseDoc.js +1 -1
- package/dist/prosemirror/extensions/nodes/TabExtension.js +32 -9
- package/dist/prosemirror/schema/index.d.ts +2 -2
- package/dist/prosemirror/schema/nodes.d.ts +4 -1
- package/dist/prosemirror/validation.js +5 -3
- package/dist/types/content.d.ts +2 -2
- package/dist/types/documentEnumValues.d.ts +4 -1
- package/dist/types/documentEnumValues.js +14 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +2 -2
|
@@ -38,7 +38,7 @@ function getUniqueId(id) {
|
|
|
38
38
|
return String(nextAutoId++);
|
|
39
39
|
}
|
|
40
40
|
/** Valid OOXML highlight color names (ECMA-376 §17.18.40) */
|
|
41
|
-
const VALID_HIGHLIGHT_COLORS = new Set(HIGHLIGHT_COLOR_VALUES
|
|
41
|
+
const VALID_HIGHLIGHT_COLORS = new Set(HIGHLIGHT_COLOR_VALUES);
|
|
42
42
|
/**
|
|
43
43
|
* Serialize a color element (w:color)
|
|
44
44
|
*/
|
|
@@ -132,7 +132,7 @@ function serializeTextFormatting(formatting) {
|
|
|
132
132
|
if (formatting.position !== void 0) parts.push(`<w:position w:val="${intAttr(formatting.position)}"/>`);
|
|
133
133
|
if (formatting.fontSize !== void 0) parts.push(`<w:sz w:val="${intAttr(formatting.fontSize)}"/>`);
|
|
134
134
|
if (formatting.fontSizeCs !== void 0) parts.push(`<w:szCs w:val="${intAttr(formatting.fontSizeCs)}"/>`);
|
|
135
|
-
if (formatting.highlight
|
|
135
|
+
if (formatting.highlight) {
|
|
136
136
|
if (VALID_HIGHLIGHT_COLORS.has(formatting.highlight)) parts.push(`<w:highlight w:val="${formatting.highlight}"/>`);
|
|
137
137
|
else if (!formatting.shading) {
|
|
138
138
|
const hex = formatting.highlight.replace(/^#/u, "");
|
|
@@ -150,13 +150,14 @@ function serializeTextFormatting(formatting) {
|
|
|
150
150
|
parts.push(`<w:u ${uAttrs.join(" ")}/>`);
|
|
151
151
|
}
|
|
152
152
|
if (formatting.effect && formatting.effect !== "none") parts.push(`<w:effect w:val="${formatting.effect}"/>`);
|
|
153
|
-
if (formatting.emphasisMark
|
|
153
|
+
if (formatting.emphasisMark) parts.push(`<w:em w:val="${formatting.emphasisMark}"/>`);
|
|
154
154
|
const shadingXml = serializeShading(formatting.shading);
|
|
155
155
|
if (shadingXml) parts.push(shadingXml);
|
|
156
156
|
if (formatting.vertAlign) parts.push(`<w:vertAlign w:val="${formatting.vertAlign}"/>`);
|
|
157
157
|
if (formatting.rtl === true) parts.push("<w:rtl/>");
|
|
158
158
|
else if (formatting.rtl === false) parts.push("<w:rtl w:val=\"0\"/>");
|
|
159
|
-
if (formatting.cs) parts.push("<w:cs/>");
|
|
159
|
+
if (formatting.cs === true) parts.push("<w:cs/>");
|
|
160
|
+
else if (formatting.cs === false) parts.push("<w:cs w:val=\"0\"/>");
|
|
160
161
|
if (parts.length === 0) return "";
|
|
161
162
|
return `<w:rPr>${parts.join("")}</w:rPr>`;
|
|
162
163
|
}
|
|
@@ -191,8 +192,13 @@ function serializeTextContent(content) {
|
|
|
191
192
|
/**
|
|
192
193
|
* Serialize tab content (w:tab)
|
|
193
194
|
*/
|
|
194
|
-
function serializeTabContent(
|
|
195
|
-
return "<w:tab/>";
|
|
195
|
+
function serializeTabContent(content) {
|
|
196
|
+
if (!content.positional) return "<w:tab/>";
|
|
197
|
+
return `<w:ptab${[
|
|
198
|
+
content.positional.relativeTo ? ` w:relativeTo="${escapeXml(content.positional.relativeTo)}"` : "",
|
|
199
|
+
content.positional.alignment ? ` w:alignment="${escapeXml(content.positional.alignment)}"` : "",
|
|
200
|
+
content.positional.leader ? ` w:leader="${escapeXml(content.positional.leader)}"` : ""
|
|
201
|
+
].join("")}/>`;
|
|
196
202
|
}
|
|
197
203
|
/**
|
|
198
204
|
* Serialize break content (w:br)
|
|
@@ -201,10 +207,8 @@ function serializeBreakContent(content) {
|
|
|
201
207
|
const attrs = [];
|
|
202
208
|
if (content.breakType === "page") attrs.push("w:type=\"page\"");
|
|
203
209
|
else if (content.breakType === "column") attrs.push("w:type=\"column\"");
|
|
204
|
-
else if (content.breakType === "textWrapping")
|
|
205
|
-
|
|
206
|
-
if (content.clear && content.clear !== "none") attrs.push(`w:clear="${content.clear}"`);
|
|
207
|
-
}
|
|
210
|
+
else if (content.breakType === "textWrapping") attrs.push("w:type=\"textWrapping\"");
|
|
211
|
+
if (content.clear !== void 0) attrs.push(`w:clear="${content.clear}"`);
|
|
208
212
|
if (attrs.length === 0) return "<w:br/>";
|
|
209
213
|
return `<w:br ${attrs.join(" ")}/>`;
|
|
210
214
|
}
|
|
@@ -264,6 +268,7 @@ function serializeDrawingColor(color) {
|
|
|
264
268
|
/** Serialize shape fill to DrawingML */
|
|
265
269
|
function serializeFill(fill) {
|
|
266
270
|
if (!fill) return "";
|
|
271
|
+
if (fill.rawXml) return fill.rawXml;
|
|
267
272
|
if (fill.type === "none") return "<a:noFill/>";
|
|
268
273
|
if (fill.type === "solid" && fill.color) return `<a:solidFill>${serializeDrawingColor(fill.color)}</a:solidFill>`;
|
|
269
274
|
if (fill.type === "gradient" && fill.gradient) {
|
|
@@ -286,6 +291,7 @@ function serializeLineCap(cap) {
|
|
|
286
291
|
}
|
|
287
292
|
function serializeOutline(outline) {
|
|
288
293
|
if (!outline) return "";
|
|
294
|
+
if (outline.rawXml) return outline.rawXml;
|
|
289
295
|
const attrs = [];
|
|
290
296
|
if (typeof outline.width === "number") attrs.push(`w="${outline.width}"`);
|
|
291
297
|
if (outline.cap) attrs.push(`cap="${serializeLineCap(outline.cap)}"`);
|
|
@@ -51,7 +51,7 @@ function serializePaperSource(props) {
|
|
|
51
51
|
return attrs.length > 0 ? `<w:paperSrc ${attrs.join(" ")}/>` : "";
|
|
52
52
|
}
|
|
53
53
|
function serializeColumns(props) {
|
|
54
|
-
if (props.columnCount === void 0 && !props.columns?.length && props.columnSpace === void 0) return "";
|
|
54
|
+
if (props.columnCount === void 0 && !props.columns?.length && props.columnSpace === void 0 && props.equalWidth === void 0) return "";
|
|
55
55
|
const attrs = [];
|
|
56
56
|
if (props.columnCount !== void 0 && props.columnCount >= 1) attrs.push(`w:num="${intAttr(props.columnCount)}"`);
|
|
57
57
|
if (props.columnSpace !== void 0) attrs.push(`w:space="${intAttr(props.columnSpace)}"`);
|
|
@@ -169,7 +169,8 @@ function serializeSectionProperties(props) {
|
|
|
169
169
|
]) if (xml) parts.push(xml);
|
|
170
170
|
if (props.verticalAlign) parts.push(`<w:vAlign w:val="${props.verticalAlign}"/>`);
|
|
171
171
|
if (props.textDirection) parts.push(`<w:textDirection w:val="${props.textDirection}"/>`);
|
|
172
|
-
|
|
172
|
+
const titlePgXml = serializeOnOffElement(props.titlePg, "titlePg");
|
|
173
|
+
if (titlePgXml) parts.push(titlePgXml);
|
|
173
174
|
const bidiXml = serializeOnOffElement(props.bidi, "bidi");
|
|
174
175
|
if (bidiXml) parts.push(bidiXml);
|
|
175
176
|
for (const xml of [
|
package/dist/docx/shapeParser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { findAllDeep, findChildByLocalName,
|
|
3
|
-
import { parseAnchorPosition, parseAnchorWrap,
|
|
1
|
+
import { ShapeTypeSchema, narrowEnum } from "./parserEnums.js";
|
|
2
|
+
import { findAllDeep, findChildByLocalName, getAttribute, parseNumericAttribute } from "./xmlParser.js";
|
|
3
|
+
import { parseAnchorPosition, parseAnchorWrap, parseFill, parseOutline } from "./drawingUtils.js";
|
|
4
4
|
//#region src/docx/shapeParser.ts
|
|
5
5
|
/** Convert OOXML rotation (1/60000ths of a degree) to degrees. */
|
|
6
6
|
function rotToDegrees(rot) {
|
|
@@ -13,115 +13,7 @@ function rotToDegrees(rot) {
|
|
|
13
13
|
* Falls through to `drawingUtils.parseFill` for solid / none cases.
|
|
14
14
|
*/
|
|
15
15
|
function parseShapeFill(spPr) {
|
|
16
|
-
|
|
17
|
-
if (base?.type !== "gradient" || !spPr) return base;
|
|
18
|
-
const gradFill = findChildByLocalName(spPr, "gradFill");
|
|
19
|
-
if (!gradFill) return base;
|
|
20
|
-
return parseGradientFill(gradFill);
|
|
21
|
-
}
|
|
22
|
-
function parseGradientFill(gradFill) {
|
|
23
|
-
let gradientType = "linear";
|
|
24
|
-
let angle;
|
|
25
|
-
const lin = findChildByLocalName(gradFill, "lin");
|
|
26
|
-
if (lin) {
|
|
27
|
-
gradientType = "linear";
|
|
28
|
-
const ang = getAttribute(lin, null, "ang");
|
|
29
|
-
if (ang) {
|
|
30
|
-
const parsed = Number.parseInt(ang, 10);
|
|
31
|
-
angle = Number.isNaN(parsed) ? void 0 : parsed / 6e4;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const path = findChildByLocalName(gradFill, "path");
|
|
35
|
-
if (path) {
|
|
36
|
-
const pathType = getAttribute(path, null, "path");
|
|
37
|
-
if (pathType === "circle") gradientType = "radial";
|
|
38
|
-
else if (pathType === "rect") gradientType = "rectangular";
|
|
39
|
-
else gradientType = "path";
|
|
40
|
-
}
|
|
41
|
-
const stops = [];
|
|
42
|
-
const gsLst = findChildByLocalName(gradFill, "gsLst");
|
|
43
|
-
if (gsLst) for (const gs of findChildrenByLocalName(gsLst, "gs")) {
|
|
44
|
-
const pos = getAttribute(gs, null, "pos");
|
|
45
|
-
const position = pos ? Number.parseInt(pos, 10) : 0;
|
|
46
|
-
const color = parseColorElement(gs);
|
|
47
|
-
if (color) stops.push({
|
|
48
|
-
position: Number.isNaN(position) ? 0 : position,
|
|
49
|
-
color
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return {
|
|
53
|
-
type: "gradient",
|
|
54
|
-
gradient: {
|
|
55
|
-
type: gradientType,
|
|
56
|
-
...angle !== void 0 ? { angle } : {},
|
|
57
|
-
stops
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
const LINE_END_TYPES = /* @__PURE__ */ new Set([
|
|
62
|
-
"none",
|
|
63
|
-
"triangle",
|
|
64
|
-
"stealth",
|
|
65
|
-
"diamond",
|
|
66
|
-
"oval",
|
|
67
|
-
"arrow"
|
|
68
|
-
]);
|
|
69
|
-
function narrowLineEndType(value) {
|
|
70
|
-
if (value === null || value === void 0) return "none";
|
|
71
|
-
for (const allowed of LINE_END_TYPES) if (allowed === value) return allowed;
|
|
72
|
-
return "none";
|
|
73
|
-
}
|
|
74
|
-
function narrowLineEndSize(value) {
|
|
75
|
-
if (value === "sm" || value === "med" || value === "lg") return value;
|
|
76
|
-
}
|
|
77
|
-
function parseLineEnd(element) {
|
|
78
|
-
const type = narrowLineEndType(getAttribute(element, null, "type"));
|
|
79
|
-
const width = narrowLineEndSize(getAttribute(element, null, "w"));
|
|
80
|
-
const length = narrowLineEndSize(getAttribute(element, null, "len"));
|
|
81
|
-
return {
|
|
82
|
-
type,
|
|
83
|
-
...width !== void 0 ? { width } : {},
|
|
84
|
-
...length !== void 0 ? { length } : {}
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Parse a shape outline with cap, join, and arrow end fidelity. Returns
|
|
89
|
-
* `undefined` when the spPr has no `<a:ln>`, an explicit `<a:noFill/>`,
|
|
90
|
-
* or no usable attributes.
|
|
91
|
-
*/
|
|
92
|
-
function parseShapeOutline(spPr) {
|
|
93
|
-
const ln = findChildByLocalName(spPr, "ln");
|
|
94
|
-
if (!ln) return;
|
|
95
|
-
if (findChildByLocalName(ln, "noFill")) return;
|
|
96
|
-
const outline = {};
|
|
97
|
-
const w = getAttribute(ln, null, "w");
|
|
98
|
-
if (w) {
|
|
99
|
-
const parsed = Number.parseInt(w, 10);
|
|
100
|
-
if (!Number.isNaN(parsed)) outline.width = parsed;
|
|
101
|
-
}
|
|
102
|
-
const cap = getAttribute(ln, null, "cap");
|
|
103
|
-
if (cap === "flat") outline.cap = "flat";
|
|
104
|
-
else if (cap === "rnd") outline.cap = "round";
|
|
105
|
-
else if (cap === "sq") outline.cap = "square";
|
|
106
|
-
if (findChildByLocalName(ln, "bevel")) outline.join = "bevel";
|
|
107
|
-
else if (findChildByLocalName(ln, "round")) outline.join = "round";
|
|
108
|
-
else if (findChildByLocalName(ln, "miter")) outline.join = "miter";
|
|
109
|
-
const solidFill = findChildByLocalName(ln, "solidFill");
|
|
110
|
-
if (solidFill) {
|
|
111
|
-
const color = parseColorElement(solidFill);
|
|
112
|
-
if (color) outline.color = color;
|
|
113
|
-
}
|
|
114
|
-
const prstDash = findChildByLocalName(ln, "prstDash");
|
|
115
|
-
if (prstDash) {
|
|
116
|
-
const narrowed = narrowEnum(getAttribute(prstDash, null, "val"), ShapeOutlineStyleSchema);
|
|
117
|
-
if (narrowed !== void 0) outline.style = narrowed;
|
|
118
|
-
}
|
|
119
|
-
const headEnd = findChildByLocalName(ln, "headEnd");
|
|
120
|
-
if (headEnd) outline.headEnd = parseLineEnd(headEnd);
|
|
121
|
-
const tailEnd = findChildByLocalName(ln, "tailEnd");
|
|
122
|
-
if (tailEnd) outline.tailEnd = parseLineEnd(tailEnd);
|
|
123
|
-
if (outline.width === void 0 && outline.color === void 0 && outline.cap === void 0 && outline.join === void 0 && outline.style === void 0 && outline.headEnd === void 0 && outline.tailEnd === void 0) return;
|
|
124
|
-
return outline;
|
|
16
|
+
return parseFill(spPr);
|
|
125
17
|
}
|
|
126
18
|
function parseTransform(xfrm) {
|
|
127
19
|
if (!xfrm) return { size: {
|
|
@@ -194,7 +86,7 @@ function parseShape(node) {
|
|
|
194
86
|
const shapeType = parseShapeType(spPr);
|
|
195
87
|
const { size, transform } = parseTransform(findChildByLocalName(spPr, "xfrm"));
|
|
196
88
|
const fill = parseShapeFill(spPr);
|
|
197
|
-
const outline =
|
|
89
|
+
const outline = parseOutline(spPr);
|
|
198
90
|
const id = cNvPr ? getAttribute(cNvPr, null, "id") ?? void 0 : void 0;
|
|
199
91
|
const name = cNvPr ? getAttribute(cNvPr, null, "name") ?? void 0 : void 0;
|
|
200
92
|
const shape = {
|
package/dist/docx/tableParser.js
CHANGED
|
@@ -394,12 +394,14 @@ function parseTableRowProperties(trPrElement) {
|
|
|
394
394
|
const heightElement = findChild(trPrElement, "w", "trHeight");
|
|
395
395
|
if (heightElement) {
|
|
396
396
|
const heightVal = parseNumericAttribute(heightElement, "w", "val");
|
|
397
|
-
if (heightVal !== void 0 && heightVal > 0)
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
397
|
+
if (heightVal !== void 0 && heightVal > 0) {
|
|
398
|
+
formatting.height = {
|
|
399
|
+
value: heightVal,
|
|
400
|
+
type: "dxa"
|
|
401
|
+
};
|
|
402
|
+
const hRule = getAttribute(heightElement, "w", "hRule");
|
|
403
|
+
if (hRule === "auto" || hRule === "atLeast" || hRule === "exact") formatting.heightRule = hRule;
|
|
404
|
+
}
|
|
403
405
|
}
|
|
404
406
|
if (parseBooleanElement(findChild(trPrElement, "w", "tblHeader"))) formatting.header = true;
|
|
405
407
|
if (parseBooleanElement(findChild(trPrElement, "w", "cantSplit"))) formatting.cantSplit = true;
|
package/dist/model.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { document_d_exports } from "./types/document.js";
|
|
2
2
|
import { DeriveBlockIdInput, FolioBlockId, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
3
|
-
import { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "./types/documentEnumValues.js";
|
|
3
|
+
import { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "./types/documentEnumValues.js";
|
|
4
4
|
import { types_d_exports } from "./layout-engine/types.js";
|
|
5
5
|
import { measureTypes_d_exports } from "./layout-engine/measure/measureTypes.js";
|
|
6
6
|
export * from "@stll/docx-core/model";
|
|
7
7
|
declare namespace model_d_exports {
|
|
8
|
-
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
8
|
+
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
|
-
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, type measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
11
|
+
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, type measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
package/dist/model.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "./types/documentEnumValues.js";
|
|
1
|
+
import { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "./types/documentEnumValues.js";
|
|
2
2
|
import { deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
3
3
|
import { types_exports } from "./layout-engine/types.js";
|
|
4
|
-
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_exports as Layout, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
4
|
+
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_exports as Layout, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isFolioBlockId, isSequentialFolioBlockId };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CharacterSpacingAttrs, CharacterStyleAttrs, CommentAttrs, EmphasisMarkAttrs, FontFamilyAttrs, FontSizeAttrs, FootnoteRefAttrs, HighlightAttrs, HyperlinkAttrs, LanguageAttrs, RunFormattingOverrideAttrs, RunPropertyChangeMarkAttrs, RunShadingAttrs, StrikeAttrs, TextColorAttrs, TextEffectAttrs, TrackedChangeMarkAttrs, UnderlineAttrs } from "../schema/marks.js";
|
|
2
|
-
import { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs } from "../schema/nodes.js";
|
|
2
|
+
import { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TabAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs } from "../schema/nodes.js";
|
|
3
3
|
import "../schema/index.js";
|
|
4
4
|
import { Mark, Node } from "prosemirror-model";
|
|
5
5
|
//#region src/prosemirror/attrs/index.d.ts
|
|
@@ -18,6 +18,8 @@ declare const readParagraphAttrs: (node: Node) => ReadProseMirrorAttrsResult<Par
|
|
|
18
18
|
declare const expectParagraphAttrs: (node: Node) => ParagraphAttrs;
|
|
19
19
|
declare const readHardBreakAttrs: (node: Node) => ReadProseMirrorAttrsResult<HardBreakAttrs>;
|
|
20
20
|
declare const expectHardBreakAttrs: (node: Node) => HardBreakAttrs;
|
|
21
|
+
declare const readTabAttrs: (node: Node) => ReadProseMirrorAttrsResult<TabAttrs>;
|
|
22
|
+
declare const expectTabAttrs: (node: Node) => TabAttrs;
|
|
21
23
|
declare const readTableAttrs: (node: Node) => ReadProseMirrorAttrsResult<TableAttrs>;
|
|
22
24
|
declare const expectTableAttrs: (node: Node) => TableAttrs;
|
|
23
25
|
declare const readTableRowAttrs: (node: Node) => ReadProseMirrorAttrsResult<TableRowAttrs>;
|
|
@@ -81,4 +83,4 @@ declare const mergeTableAttrs: (node: Node, patch: NodeAttrPatch<TableAttrs>) =>
|
|
|
81
83
|
declare const mergeTableRowAttrs: (node: Node, patch: NodeAttrPatch<TableRowAttrs>) => TableRowAttrs;
|
|
82
84
|
declare const mergeTableCellAttrs: (node: Node, patch: NodeAttrPatch<TableCellAttrs>) => TableCellAttrs;
|
|
83
85
|
//#endregion
|
|
84
|
-
export { ProseMirrorAttrIssue, ReadProseMirrorAttrsResult, expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs, mergeImageAttrs, mergeParagraphAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs };
|
|
86
|
+
export { ProseMirrorAttrIssue, ReadProseMirrorAttrsResult, expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTabAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs, mergeImageAttrs, mergeParagraphAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTabAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FIELD_TYPE_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LINE_SPACING_RULE_VALUES, OUTLINE_STYLE_ATTR_VALUES, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "../../types/documentEnumValues.js";
|
|
1
|
+
import { FIELD_TYPE_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LINE_SPACING_RULE_VALUES, OUTLINE_STYLE_ATTR_VALUES, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES } from "../../types/documentEnumValues.js";
|
|
2
2
|
import { isParagraphDirection } from "../paragraphDirection.js";
|
|
3
3
|
import { TRACKED_CHANGE_PROVENANCE_VALUES } from "../schema/marks.js";
|
|
4
4
|
import { panic } from "better-result";
|
|
@@ -119,6 +119,7 @@ const SECTION_VERTICAL_ALIGNMENTS = [
|
|
|
119
119
|
];
|
|
120
120
|
const paragraphAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
121
121
|
const hardBreakAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
122
|
+
const tabAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
122
123
|
const tableAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
123
124
|
const tableRowAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
124
125
|
const tableCellAttrsCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -233,6 +234,20 @@ const readHardBreakAttrs = (node) => {
|
|
|
233
234
|
return attrsResult(attrs, issues);
|
|
234
235
|
};
|
|
235
236
|
const expectHardBreakAttrs = (node) => expectCachedNodeAttrs(node, hardBreakAttrsCache, readHardBreakAttrs, "hard break attrs");
|
|
237
|
+
const readTabAttrs = (node) => {
|
|
238
|
+
const attrs = attrsRecord(node.attrs);
|
|
239
|
+
const issues = [];
|
|
240
|
+
expectNodeType(node, "tab", issues);
|
|
241
|
+
optionalRecord(attrs, "positional", "tab.attrs.positional", issues);
|
|
242
|
+
const positional = attrs["positional"];
|
|
243
|
+
if (isRecord(positional)) {
|
|
244
|
+
optionalOneOf(positional, "relativeTo", "tab.attrs.positional.relativeTo", issues, POSITIONAL_TAB_RELATIVE_TO_VALUES);
|
|
245
|
+
optionalOneOf(positional, "alignment", "tab.attrs.positional.alignment", issues, POSITIONAL_TAB_ALIGNMENT_VALUES);
|
|
246
|
+
optionalOneOf(positional, "leader", "tab.attrs.positional.leader", issues, POSITIONAL_TAB_LEADER_VALUES);
|
|
247
|
+
}
|
|
248
|
+
return attrsResult(attrs, issues);
|
|
249
|
+
};
|
|
250
|
+
const expectTabAttrs = (node) => expectCachedNodeAttrs(node, tabAttrsCache, readTabAttrs, "tab attrs");
|
|
236
251
|
const readTableAttrs = (node) => {
|
|
237
252
|
const attrs = attrsRecord(node.attrs);
|
|
238
253
|
const issues = [];
|
|
@@ -1411,4 +1426,4 @@ const optionalEmptyHyperlinkArray = (value, issues) => {
|
|
|
1411
1426
|
}
|
|
1412
1427
|
};
|
|
1413
1428
|
//#endregion
|
|
1414
|
-
export { expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs, mergeImageAttrs, mergeParagraphAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs };
|
|
1429
|
+
export { expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTabAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs, mergeImageAttrs, mergeParagraphAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs, readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTabAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OUTLINE_STYLE_CSS_ALIASES } from "../../types/documentEnumValues.js";
|
|
2
2
|
import { directionToBidi } from "../paragraphDirection.js";
|
|
3
|
-
import { expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs } from "../attrs/index.js";
|
|
3
|
+
import { expectBlockSdtAttrs, expectCharacterSpacingMarkAttrs, expectCharacterStyleMarkAttrs, expectCommentMarkAttrs, expectEmphasisMarkAttrs, expectFieldAttrs, expectFontFamilyMarkAttrs, expectFontSizeMarkAttrs, expectFootnoteRefMarkAttrs, expectHardBreakAttrs, expectHighlightMarkAttrs, expectHyperlinkMarkAttrs, expectImageAttrs, expectLanguageMarkAttrs, expectMathAttrs, expectParagraphAttrs, expectRunFormattingOverrideMarkAttrs, expectRunPropertyChangeMarkAttrs, expectRunShadingMarkAttrs, expectSdtAttrs, expectShapeAttrs, expectStrikeMarkAttrs, expectTabAttrs, expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs, expectTextBoxAttrs, expectTextColorMarkAttrs, expectTextEffectMarkAttrs, expectTrackedChangeMarkAttrs, expectUnderlineMarkAttrs } from "../attrs/index.js";
|
|
4
4
|
import { ShapeOutlineStyleSchema, narrowEnum } from "../../docx/parserEnums.js";
|
|
5
5
|
import { numPrEqual } from "../../docx/numberingParser.js";
|
|
6
6
|
import { pixelsToEmu } from "../../utils/units.js";
|
|
@@ -806,7 +806,7 @@ function extractParagraphContent(paragraph, _documentCounts, emptyHyperlinks, te
|
|
|
806
806
|
content.push(createShapeRun(node));
|
|
807
807
|
} else if (node.type.name === "tab") {
|
|
808
808
|
flushCurrentInline();
|
|
809
|
-
content.push(createTabRun());
|
|
809
|
+
content.push(createTabRun(node));
|
|
810
810
|
} else if (node.type.name === "renderedPageBreak") {
|
|
811
811
|
flushCurrentInline();
|
|
812
812
|
content.push(createRenderedPageBreakRun());
|
|
@@ -870,7 +870,7 @@ function createTrackedChangeRun(node, marks) {
|
|
|
870
870
|
if (node.type.name === "hardBreak") return createBreakRun(readHardBreakType(node));
|
|
871
871
|
if (node.type.name === "image") return createImageRun(node);
|
|
872
872
|
if (node.type.name === "shape") return createShapeRun(node);
|
|
873
|
-
if (node.type.name === "tab") return createTabRun();
|
|
873
|
+
if (node.type.name === "tab") return createTabRun(node);
|
|
874
874
|
if (node.type.name === "renderedPageBreak") return createRenderedPageBreakRun();
|
|
875
875
|
return null;
|
|
876
876
|
}
|
|
@@ -979,7 +979,7 @@ function addNodeToHyperlink(hyperlink, node) {
|
|
|
979
979
|
return;
|
|
980
980
|
}
|
|
981
981
|
if (node.type.name === "tab") {
|
|
982
|
-
hyperlink.children.push(createTabRun(nonLinkMarks));
|
|
982
|
+
hyperlink.children.push(createTabRun(node, nonLinkMarks));
|
|
983
983
|
return;
|
|
984
984
|
}
|
|
985
985
|
if (node.type.name === "renderedPageBreak") {
|
|
@@ -1076,10 +1076,14 @@ function readHardBreakType(node) {
|
|
|
1076
1076
|
/**
|
|
1077
1077
|
* Create a Run containing a tab
|
|
1078
1078
|
*/
|
|
1079
|
-
function createTabRun(marks) {
|
|
1079
|
+
function createTabRun(node, marks) {
|
|
1080
|
+
const { positional } = expectTabAttrs(node);
|
|
1080
1081
|
const run = {
|
|
1081
1082
|
type: "run",
|
|
1082
|
-
content: [{
|
|
1083
|
+
content: [{
|
|
1084
|
+
type: "tab",
|
|
1085
|
+
...positional ? { positional } : {}
|
|
1086
|
+
}]
|
|
1083
1087
|
};
|
|
1084
1088
|
const formatting = getRunFormattingFromMarks(marks);
|
|
1085
1089
|
if (formatting) run.formatting = formatting;
|
|
@@ -1048,7 +1048,7 @@ function convertRunContent(content, marks, formatting, textBoxAnchors) {
|
|
|
1048
1048
|
if (content.breakType === "column") return [withHyperlinkBoundaryMarks(schema.node("hardBreak", { breakType: "column" }), marks)];
|
|
1049
1049
|
return [];
|
|
1050
1050
|
case "renderedPageBreak": return [schema.node("renderedPageBreak").mark(marks)];
|
|
1051
|
-
case "tab": return [schema.node("tab").mark(marks)];
|
|
1051
|
+
case "tab": return [schema.node("tab", content.positional ? { positional: content.positional } : void 0).mark(marks)];
|
|
1052
1052
|
case "drawing": return [withHyperlinkBoundaryMarks(convertImage(content.image, content.rawXml), marks)];
|
|
1053
1053
|
case "shape": {
|
|
1054
1054
|
const shp = content.shape;
|
|
@@ -1,27 +1,50 @@
|
|
|
1
|
+
import { expectTabAttrs } from "../../attrs/index.js";
|
|
1
2
|
import { createNodeExtension } from "../create.js";
|
|
2
3
|
//#region src/prosemirror/extensions/nodes/TabExtension.ts
|
|
3
|
-
/**
|
|
4
|
-
* Tab Extension — inline tab character node
|
|
5
|
-
*/
|
|
6
4
|
const TabExtension = createNodeExtension({
|
|
7
5
|
name: "tab",
|
|
8
6
|
schemaNodeName: "tab",
|
|
9
7
|
nodeSpec: {
|
|
10
8
|
inline: true,
|
|
11
9
|
group: "inline",
|
|
10
|
+
attrs: { positional: { default: null } },
|
|
12
11
|
selectable: false,
|
|
13
|
-
parseDOM: [{
|
|
14
|
-
|
|
12
|
+
parseDOM: [{
|
|
13
|
+
tag: "span.docx-tab",
|
|
14
|
+
getAttrs(node) {
|
|
15
|
+
if (!(node instanceof HTMLElement) || !node.dataset["docxPositionalTab"]) return null;
|
|
16
|
+
return { positional: parsePositionalTab(node) };
|
|
17
|
+
}
|
|
18
|
+
}],
|
|
19
|
+
toDOM(node) {
|
|
20
|
+
const { positional } = expectTabAttrs(node);
|
|
21
|
+
const attrs = {
|
|
22
|
+
class: "docx-tab",
|
|
23
|
+
style: "display: inline-block; min-width: 16px; white-space: pre;"
|
|
24
|
+
};
|
|
25
|
+
if (positional) {
|
|
26
|
+
attrs["data-docx-positional-tab"] = "true";
|
|
27
|
+
if (positional.relativeTo) attrs["data-docx-tab-relative-to"] = positional.relativeTo;
|
|
28
|
+
if (positional.alignment) attrs["data-docx-tab-alignment"] = positional.alignment;
|
|
29
|
+
if (positional.leader) attrs["data-docx-tab-leader"] = positional.leader;
|
|
30
|
+
}
|
|
15
31
|
return [
|
|
16
32
|
"span",
|
|
17
|
-
|
|
18
|
-
class: "docx-tab",
|
|
19
|
-
style: "display: inline-block; min-width: 16px; white-space: pre;"
|
|
20
|
-
},
|
|
33
|
+
attrs,
|
|
21
34
|
" "
|
|
22
35
|
];
|
|
23
36
|
}
|
|
24
37
|
}
|
|
25
38
|
});
|
|
39
|
+
const parsePositionalTab = (element) => {
|
|
40
|
+
const relativeTo = element.dataset["docxTabRelativeTo"];
|
|
41
|
+
const alignment = element.dataset["docxTabAlignment"];
|
|
42
|
+
const leader = element.dataset["docxTabLeader"];
|
|
43
|
+
return {
|
|
44
|
+
...relativeTo === "margin" || relativeTo === "indent" ? { relativeTo } : {},
|
|
45
|
+
...alignment === "left" || alignment === "center" || alignment === "right" ? { alignment } : {},
|
|
46
|
+
...leader === "none" || leader === "dot" || leader === "hyphen" || leader === "underscore" || leader === "middleDot" ? { leader } : {}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
26
49
|
//#endregion
|
|
27
50
|
export { TabExtension };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CharacterSpacingAttrs, CharacterStyleAttrs, CommentAttrs, EmphasisMarkAttrs, FontFamilyAttrs, FontSizeAttrs, FootnoteRefAttrs, HighlightAttrs, HyperlinkAttrs, LanguageAttrs, RunFormattingOverrideAttrs, RunPropertyChangeMarkAttrs, RunShadingAttrs, StrikeAttrs, TextColorAttrs, TextEffectAttrs, TrackedChangeMarkAttrs, UnderlineAttrs } from "./marks.js";
|
|
2
2
|
import { ExtensionManager } from "../extensions/ExtensionManager.js";
|
|
3
|
-
import { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs } from "./nodes.js";
|
|
3
|
+
import { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TabAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs } from "./nodes.js";
|
|
4
4
|
//#region src/prosemirror/schema/index.d.ts
|
|
5
5
|
declare const singletonManager: ExtensionManager;
|
|
6
6
|
declare const schema: import("prosemirror-model").Schema<any, any>;
|
|
@@ -11,4 +11,4 @@ type DocxSchema = typeof schema;
|
|
|
11
11
|
type DocxNode = ReturnType<typeof schema.node>;
|
|
12
12
|
type DocxMark = ReturnType<typeof schema.mark>;
|
|
13
13
|
//#endregion
|
|
14
|
-
export { type BlockSdtAttrs, type CharacterSpacingAttrs, type CharacterStyleAttrs, type CommentAttrs, DocxMark, DocxNode, DocxSchema, type EmphasisMarkAttrs, type FieldAttrs, type FontFamilyAttrs, type FontSizeAttrs, type FootnoteRefAttrs, type HardBreakAttrs, type HighlightAttrs, type HyperlinkAttrs, type ImageAttrs, type ImagePositionAttrs, type LanguageAttrs, type MathAttrs, type ParagraphAttrs, type RunFormattingOverrideAttrs, type RunPropertyChangeMarkAttrs, type RunShadingAttrs, type SdtAttrs, type ShapeAttrs, type StrikeAttrs, type TableAttrs, type TableCellAttrs, type TableRowAttrs, type TextBoxAttrs, type TextColorAttrs, type TextEffectAttrs, type TrackedChangeMarkAttrs, type UnderlineAttrs, schema, singletonManager };
|
|
14
|
+
export { type BlockSdtAttrs, type CharacterSpacingAttrs, type CharacterStyleAttrs, type CommentAttrs, DocxMark, DocxNode, DocxSchema, type EmphasisMarkAttrs, type FieldAttrs, type FontFamilyAttrs, type FontSizeAttrs, type FootnoteRefAttrs, type HardBreakAttrs, type HighlightAttrs, type HyperlinkAttrs, type ImageAttrs, type ImagePositionAttrs, type LanguageAttrs, type MathAttrs, type ParagraphAttrs, type RunFormattingOverrideAttrs, type RunPropertyChangeMarkAttrs, type RunShadingAttrs, type SdtAttrs, type ShapeAttrs, type StrikeAttrs, type TabAttrs, type TableAttrs, type TableCellAttrs, type TableRowAttrs, type TextBoxAttrs, type TextColorAttrs, type TextEffectAttrs, type TrackedChangeMarkAttrs, type UnderlineAttrs, schema, singletonManager };
|
|
@@ -8,6 +8,9 @@ import { ParagraphDirection } from "../paragraphDirection.js";
|
|
|
8
8
|
type HardBreakAttrs = {
|
|
9
9
|
breakType?: "column";
|
|
10
10
|
};
|
|
11
|
+
type TabAttrs = {
|
|
12
|
+
positional?: document_d_exports.PositionalTab;
|
|
13
|
+
};
|
|
11
14
|
/**
|
|
12
15
|
* Paragraph node attributes - maps to ParagraphFormatting
|
|
13
16
|
*/
|
|
@@ -681,4 +684,4 @@ type TableCellAttrs = {
|
|
|
681
684
|
_docxVMergeContinuationCells?: document_d_exports.TableCell[];
|
|
682
685
|
};
|
|
683
686
|
//#endregion
|
|
684
|
-
export { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, SuggestedStructuralMarker, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAnchorAttrs, TextBoxAttrs };
|
|
687
|
+
export { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, SuggestedStructuralMarker, TabAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAnchorAttrs, TextBoxAttrs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs } from "./attrs/index.js";
|
|
1
|
+
import { readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTabAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs } from "./attrs/index.js";
|
|
2
2
|
import { readTextBoxAnchorAttrs } from "./textBoxAnchorAttrs.js";
|
|
3
3
|
//#region src/prosemirror/validation.ts
|
|
4
4
|
var ProseMirrorDocumentValidationError = class extends Error {
|
|
@@ -49,8 +49,10 @@ const validateNodeAttrs = (node, path, issues) => {
|
|
|
49
49
|
case "text":
|
|
50
50
|
case "horizontalRule":
|
|
51
51
|
case "pageBreak":
|
|
52
|
-
case "renderedPageBreak":
|
|
53
|
-
case "tab":
|
|
52
|
+
case "renderedPageBreak": return;
|
|
53
|
+
case "tab":
|
|
54
|
+
appendAttrIssues(path, readTabAttrs(node), issues);
|
|
55
|
+
return;
|
|
54
56
|
case "hardBreak":
|
|
55
57
|
appendAttrIssues(path, readHardBreakAttrs(node), issues);
|
|
56
58
|
return;
|
package/dist/types/content.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BlockContent, BlockSdt, BookmarkEnd, BookmarkStart, BreakContent, Column, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, ComplexField, Deletion, DocumentBody, DrawingContent, Endnote, EndnotePosition, EndnoteProperties, Field, FieldCharContent, FieldType, FooterReference, Footnote, FootnotePosition, FootnoteProperties, HeaderFooter, HeaderFooterType, HeaderReference, Hyperlink, Image, ImageCrop, ImagePadding, ImagePosition, ImageSize, ImageTransform, ImageWrap, InlineSdt, Insertion, InstrTextContent, LineNumberRestart, MathEquation, MoveFrom, MoveFromRangeEnd, MoveFromRangeStart, MoveTo, MoveToRangeEnd, MoveToRangeStart, NoBreakHyphenContent, NoteNumberRestart, NoteReferenceContent, PageOrientation, Paragraph, ParagraphContent, ParagraphPropertyChange, PropertyChangeInfo, Run, RunContent, RunPropertyChange, SdtProperties, SdtType, Section, SectionProperties, SectionStart, Shape, ShapeContent, ShapeFill, ShapeOutline, ShapeTextBody, ShapeType, SimpleField, SoftHyphenContent, SymbolContent, TabContent, Table, TableCell, TableCellPropertyChange, TableRow, TableRowPropertyChange, TableStructuralChangeInfo, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange, VerticalAlign } from "@stll/docx-core/model";
|
|
2
|
-
export type { BlockContent, BlockSdt, BookmarkEnd, BookmarkStart, BreakContent, Column, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, ComplexField, Deletion, DocumentBody, DrawingContent, Endnote, EndnotePosition, EndnoteProperties, Field, FieldCharContent, FieldType, FooterReference, Footnote, FootnotePosition, FootnoteProperties, HeaderFooter, HeaderFooterType, HeaderReference, Hyperlink, Image, ImageCrop, ImagePadding, ImagePosition, ImageSize, ImageTransform, ImageWrap, InlineSdt, Insertion, InstrTextContent, LineNumberRestart, MathEquation, MoveFrom, MoveFromRangeEnd, MoveFromRangeStart, MoveTo, MoveToRangeEnd, MoveToRangeStart, NoBreakHyphenContent, NoteNumberRestart, NoteReferenceContent, PageOrientation, Paragraph, ParagraphContent, ParagraphPropertyChange, PropertyChangeInfo, Run, RunContent, RunPropertyChange, SdtProperties, SdtType, Section, SectionProperties, SectionStart, Shape, ShapeContent, ShapeFill, ShapeOutline, ShapeTextBody, ShapeType, SimpleField, SoftHyphenContent, SymbolContent, TabContent, Table, TableCell, TableCellPropertyChange, TableRow, TableRowPropertyChange, TableStructuralChangeInfo, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange, VerticalAlign };
|
|
1
|
+
import { BlockContent, BlockSdt, BookmarkEnd, BookmarkStart, BreakContent, Column, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, ComplexField, Deletion, DocumentBody, DrawingContent, Endnote, EndnotePosition, EndnoteProperties, Field, FieldCharContent, FieldType, FooterReference, Footnote, FootnotePosition, FootnoteProperties, HeaderFooter, HeaderFooterType, HeaderReference, Hyperlink, Image, ImageCrop, ImagePadding, ImagePosition, ImageSize, ImageTransform, ImageWrap, InlineSdt, Insertion, InstrTextContent, LineNumberRestart, MathEquation, MoveFrom, MoveFromRangeEnd, MoveFromRangeStart, MoveTo, MoveToRangeEnd, MoveToRangeStart, NoBreakHyphenContent, NoteNumberRestart, NoteReferenceContent, PageOrientation, Paragraph, ParagraphContent, ParagraphPropertyChange, PositionalTab, PropertyChangeInfo, Run, RunContent, RunPropertyChange, SdtProperties, SdtType, Section, SectionProperties, SectionStart, Shape, ShapeContent, ShapeFill, ShapeOutline, ShapeTextBody, ShapeType, SimpleField, SoftHyphenContent, SymbolContent, TabContent, Table, TableCell, TableCellPropertyChange, TableRow, TableRowPropertyChange, TableStructuralChangeInfo, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange, VerticalAlign } from "@stll/docx-core/model";
|
|
2
|
+
export type { BlockContent, BlockSdt, BookmarkEnd, BookmarkStart, BreakContent, Column, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, ComplexField, Deletion, DocumentBody, DrawingContent, Endnote, EndnotePosition, EndnoteProperties, Field, FieldCharContent, FieldType, FooterReference, Footnote, FootnotePosition, FootnoteProperties, HeaderFooter, HeaderFooterType, HeaderReference, Hyperlink, Image, ImageCrop, ImagePadding, ImagePosition, ImageSize, ImageTransform, ImageWrap, InlineSdt, Insertion, InstrTextContent, LineNumberRestart, MathEquation, MoveFrom, MoveFromRangeEnd, MoveFromRangeStart, MoveTo, MoveToRangeEnd, MoveToRangeStart, NoBreakHyphenContent, NoteNumberRestart, NoteReferenceContent, PageOrientation, Paragraph, ParagraphContent, ParagraphPropertyChange, PositionalTab, PropertyChangeInfo, Run, RunContent, RunPropertyChange, SdtProperties, SdtType, Section, SectionProperties, SectionStart, Shape, ShapeContent, ShapeFill, ShapeOutline, ShapeTextBody, ShapeType, SimpleField, SoftHyphenContent, SymbolContent, TabContent, Table, TableCell, TableCellPropertyChange, TableRow, TableRowPropertyChange, TableStructuralChangeInfo, TextBox, TextContent, TrackedChangeInfo, TrackedRunChange, VerticalAlign };
|
|
@@ -11,6 +11,9 @@ declare const PARAGRAPH_ALIGNMENT_VALUES: readonly ["left", "center", "right", "
|
|
|
11
11
|
declare const LINE_SPACING_RULE_VALUES: readonly ["auto", "exact", "atLeast"];
|
|
12
12
|
declare const TAB_STOP_ALIGNMENT_VALUES: readonly ["left", "center", "right", "decimal", "bar", "clear", "num"];
|
|
13
13
|
declare const TAB_LEADER_VALUES: readonly ["none", "dot", "hyphen", "underscore", "heavy", "middleDot"];
|
|
14
|
+
declare const POSITIONAL_TAB_RELATIVE_TO_VALUES: readonly ["margin", "indent"];
|
|
15
|
+
declare const POSITIONAL_TAB_ALIGNMENT_VALUES: readonly ["left", "center", "right"];
|
|
16
|
+
declare const POSITIONAL_TAB_LEADER_VALUES: readonly ["none", "dot", "hyphen", "underscore", "middleDot"];
|
|
14
17
|
declare const FRAME_X_ALIGN_VALUES: readonly ["left", "center", "right", "inside", "outside"];
|
|
15
18
|
declare const FRAME_Y_ALIGN_VALUES: readonly ["top", "center", "bottom", "inside", "outside", "inline"];
|
|
16
19
|
declare const FRAME_WRAP_VALUES: readonly ["around", "auto", "none", "notBeside", "through", "tight"];
|
|
@@ -87,4 +90,4 @@ type OutlineStyleAttr = (typeof OUTLINE_STYLE_ATTR_VALUES)[number];
|
|
|
87
90
|
declare const NUMBER_FORMAT_VALUES: readonly ["decimal", "upperRoman", "lowerRoman", "upperLetter", "lowerLetter", "ordinal", "cardinalText", "ordinalText", "hex", "chicago", "ideographDigital", "japaneseCounting", "aiueo", "iroha", "decimalFullWidth", "decimalHalfWidth", "japaneseLegal", "japaneseDigitalTenThousand", "decimalEnclosedCircle", "decimalFullWidth2", "aiueoFullWidth", "irohaFullWidth", "decimalZero", "decimalZero3", "decimalZero4", "decimalZero5", "bullet", "ganada", "chosung", "decimalEnclosedFullstop", "decimalEnclosedParen", "decimalEnclosedCircleChinese", "ideographEnclosedCircle", "ideographTraditional", "ideographZodiac", "ideographZodiacTraditional", "taiwaneseCounting", "ideographLegalTraditional", "taiwaneseCountingThousand", "taiwaneseDigital", "chineseCounting", "chineseLegalSimplified", "chineseCountingThousand", "koreanDigital", "koreanCounting", "koreanLegal", "koreanDigital2", "vietnameseCounting", "russianLower", "russianUpper", "none", "numberInDash", "hebrew1", "hebrew2", "arabicAlpha", "arabicAbjad", "hindiVowels", "hindiConsonants", "hindiNumbers", "hindiCounting", "thaiLetters", "thaiNumbers", "thaiCounting"];
|
|
88
91
|
declare const LEVEL_SUFFIX_VALUES: readonly ["tab", "space", "nothing"];
|
|
89
92
|
//#endregion
|
|
90
|
-
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES };
|
|
93
|
+
export { BORDER_STYLE_VALUES, CONDITIONAL_STYLE_TYPE_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIASES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_OUTLINE_STYLE_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_TEXT_DIRECTION_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_EFFECT_VALUES, THEME_COLOR_SLOT_VALUES, UNDERLINE_STYLE_VALUES };
|