document-schema 7.11.1 → 7.11.3
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/a1.cjs +1 -1
- package/dist/a1.js +1 -1
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/color.cjs +3 -5
- package/dist/color.js +3 -5
- package/dist/{content-zNNPbwYY.d.cts → content-DllbQ_-F.d.cts} +1 -1
- package/dist/content-json-schema-defs.cjs +1 -3
- package/dist/content-json-schema-defs.js +1 -3
- package/dist/{content-GHj_31uQ.d.ts → content-ovWk5At_.d.ts} +1 -1
- package/dist/content.cjs +1 -1
- package/dist/content.d.cts +1 -1
- package/dist/content.d.ts +1 -1
- package/dist/content.js +1 -1
- package/dist/decompose.d.cts +2 -2
- package/dist/decompose.d.ts +2 -2
- package/dist/definitions.d.cts +1 -1
- package/dist/definitions.d.ts +1 -1
- package/dist/factor-styles.cjs +17 -61
- package/dist/factor-styles.d.cts +1 -1
- package/dist/factor-styles.d.ts +1 -1
- package/dist/factor-styles.js +17 -61
- package/dist/flatten.d.cts +1 -1
- package/dist/flatten.d.ts +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/{package-node-CIZQ2_C1.d.ts → package-node-BNCUdJJa.d.ts} +1 -1
- package/dist/{package-node-DaPwHzsg.d.cts → package-node-D_7FINlv.d.cts} +1 -1
- package/dist/package-node.cjs +0 -1
- package/dist/package-node.d.cts +1 -1
- package/dist/package-node.d.ts +1 -1
- package/dist/package-node.js +0 -1
- package/dist/package.d.cts +1 -1
- package/dist/package.d.ts +1 -1
- package/dist/schema-io.cjs +2 -2
- package/dist/schema-io.d.cts +1 -1
- package/dist/schema-io.d.ts +1 -1
- package/dist/schema-io.js +2 -2
- package/package.json +1 -1
- package/schemas/content-document.schema.json +16 -16
- package/schemas/document-tree.schema.json +3 -3
package/dist/a1.cjs
CHANGED
|
@@ -43,7 +43,7 @@ function cellReference(row, column) {
|
|
|
43
43
|
function parseRangeReference(ref) {
|
|
44
44
|
const separatorIndex = ref.indexOf(":");
|
|
45
45
|
const startRaw = separatorIndex === -1 ? ref : ref.slice(0, separatorIndex);
|
|
46
|
-
const endRaw =
|
|
46
|
+
const endRaw = ref.slice(separatorIndex + 1);
|
|
47
47
|
const start = parseCellReference(startRaw);
|
|
48
48
|
const end = parseCellReference(endRaw);
|
|
49
49
|
if (start === void 0 || end === void 0) return;
|
package/dist/a1.js
CHANGED
|
@@ -42,7 +42,7 @@ function cellReference(row, column) {
|
|
|
42
42
|
function parseRangeReference(ref) {
|
|
43
43
|
const separatorIndex = ref.indexOf(":");
|
|
44
44
|
const startRaw = separatorIndex === -1 ? ref : ref.slice(0, separatorIndex);
|
|
45
|
-
const endRaw =
|
|
45
|
+
const endRaw = ref.slice(separatorIndex + 1);
|
|
46
46
|
const start = parseCellReference(startRaw);
|
|
47
47
|
const end = parseCellReference(endRaw);
|
|
48
48
|
if (start === void 0 || end === void 0) return;
|
package/dist/codec.d.cts
CHANGED
package/dist/codec.d.ts
CHANGED
package/dist/color.cjs
CHANGED
|
@@ -11,13 +11,11 @@ const COLOR_BLACK = {
|
|
|
11
11
|
g: 0,
|
|
12
12
|
b: 0
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const HEX_DIGITS_PATTERN = /^[0-9a-fA-F]{6}$/;
|
|
15
15
|
const HEX_BYTE_MAX = 255;
|
|
16
16
|
function rgbHexToColor(hex) {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const digits = match[1];
|
|
20
|
-
if (digits === void 0) throw new Error(`not a 6-digit hex colour: ${hex}`);
|
|
17
|
+
const digits = hex.startsWith("#") ? hex.slice(1) : hex;
|
|
18
|
+
if (!HEX_DIGITS_PATTERN.test(digits)) throw new Error(`not a 6-digit hex colour: ${hex}`);
|
|
21
19
|
const r = Number.parseInt(digits.slice(0, 2), 16);
|
|
22
20
|
const g = Number.parseInt(digits.slice(2, 4), 16);
|
|
23
21
|
const b = Number.parseInt(digits.slice(4, 6), 16);
|
package/dist/color.js
CHANGED
|
@@ -10,13 +10,11 @@ const COLOR_BLACK = {
|
|
|
10
10
|
g: 0,
|
|
11
11
|
b: 0
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const HEX_DIGITS_PATTERN = /^[0-9a-fA-F]{6}$/;
|
|
14
14
|
const HEX_BYTE_MAX = 255;
|
|
15
15
|
function rgbHexToColor(hex) {
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const digits = match[1];
|
|
19
|
-
if (digits === void 0) throw new Error(`not a 6-digit hex colour: ${hex}`);
|
|
16
|
+
const digits = hex.startsWith("#") ? hex.slice(1) : hex;
|
|
17
|
+
if (!HEX_DIGITS_PATTERN.test(digits)) throw new Error(`not a 6-digit hex colour: ${hex}`);
|
|
20
18
|
const r = Number.parseInt(digits.slice(0, 2), 16);
|
|
21
19
|
const g = Number.parseInt(digits.slice(2, 4), 16);
|
|
22
20
|
const b = Number.parseInt(digits.slice(4, 6), 16);
|
|
@@ -1588,12 +1588,12 @@ declare const ContentEmbeddedObjectBlockSchema: z.ZodObject<{
|
|
|
1588
1588
|
}, z.core.$strip>>;
|
|
1589
1589
|
}, z.core.$strip>>;
|
|
1590
1590
|
objectKind: z.ZodEnum<{
|
|
1591
|
+
chart: "chart";
|
|
1591
1592
|
formula: "formula";
|
|
1592
1593
|
wordprocessing: "wordprocessing";
|
|
1593
1594
|
presentation: "presentation";
|
|
1594
1595
|
spreadsheet: "spreadsheet";
|
|
1595
1596
|
drawing: "drawing";
|
|
1596
|
-
chart: "chart";
|
|
1597
1597
|
}>;
|
|
1598
1598
|
document: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1599
1599
|
sections: z.ZodArray<z.ZodObject<{
|
|
@@ -27,9 +27,7 @@ function getMathMlJsonSchemas() {
|
|
|
27
27
|
return cachedMathMlJsonSchemas;
|
|
28
28
|
}
|
|
29
29
|
function mathMlDef(id) {
|
|
30
|
-
const
|
|
31
|
-
if (generated === void 0) throw new Error(`z.toJSONSchema() produced no schema for registered id "${id}"`);
|
|
32
|
-
const stripped = { ...generated };
|
|
30
|
+
const stripped = { ...getMathMlJsonSchemas()[id] };
|
|
33
31
|
delete stripped.$schema;
|
|
34
32
|
delete stripped.$id;
|
|
35
33
|
return stripped;
|
|
@@ -26,9 +26,7 @@ function getMathMlJsonSchemas() {
|
|
|
26
26
|
return cachedMathMlJsonSchemas;
|
|
27
27
|
}
|
|
28
28
|
function mathMlDef(id) {
|
|
29
|
-
const
|
|
30
|
-
if (generated === void 0) throw new Error(`z.toJSONSchema() produced no schema for registered id "${id}"`);
|
|
31
|
-
const stripped = { ...generated };
|
|
29
|
+
const stripped = { ...getMathMlJsonSchemas()[id] };
|
|
32
30
|
delete stripped.$schema;
|
|
33
31
|
delete stripped.$id;
|
|
34
32
|
return stripped;
|
|
@@ -1588,12 +1588,12 @@ declare const ContentEmbeddedObjectBlockSchema: z.ZodObject<{
|
|
|
1588
1588
|
}, z.core.$strip>>;
|
|
1589
1589
|
}, z.core.$strip>>;
|
|
1590
1590
|
objectKind: z.ZodEnum<{
|
|
1591
|
+
chart: "chart";
|
|
1591
1592
|
formula: "formula";
|
|
1592
1593
|
wordprocessing: "wordprocessing";
|
|
1593
1594
|
presentation: "presentation";
|
|
1594
1595
|
spreadsheet: "spreadsheet";
|
|
1595
1596
|
drawing: "drawing";
|
|
1596
|
-
chart: "chart";
|
|
1597
1597
|
}>;
|
|
1598
1598
|
document: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1599
1599
|
sections: z.ZodArray<z.ZodObject<{
|
package/dist/content.cjs
CHANGED
|
@@ -165,7 +165,7 @@ const IMAGE_FORMATS = [
|
|
|
165
165
|
"gif"
|
|
166
166
|
];
|
|
167
167
|
function isImageFormat(value) {
|
|
168
|
-
return
|
|
168
|
+
return IMAGE_FORMATS.includes(value);
|
|
169
169
|
}
|
|
170
170
|
const ContentImageOriginalSchema = zod.z.object({
|
|
171
171
|
filter: zod.z.enum(["jbig2", "jpeg2000"]),
|
package/dist/content.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-
|
|
1
|
+
import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-DllbQ_-F.cjs";
|
|
2
2
|
export { CONTENT_ANNOTATION_FIELDS, ConstructMarkerImbalance, ContentBitmapFill, ContentBitmapFillSchema, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellFill, ContentCellFillSchema, ContentCellPatternType, ContentCellPatternTypeSchema, ContentCellValue, ContentCellValueSchema, ContentConstructEnd, ContentConstructEndSchema, ContentConstructStart, ContentConstructStartSchema, ContentDefinedName, ContentDefinedNameSchema, ContentDocument, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFillPattern, ContentFillPatternSchema, ContentFloatAlign, ContentFloatAlignSchema, ContentFloatAxis, ContentFloatAxisSchema, ContentFloatOrigin, ContentFloatOriginSchema, ContentFloatPosition, ContentFloatPositionSchema, ContentFont, ContentFontSchema, ContentFormula, ContentFormulaSchema, ContentGradientFill, ContentGradientFillSchema, ContentGradientStyle, ContentGradientStyleSchema, ContentHatchFill, ContentHatchFillSchema, ContentHatchStyle, ContentHatchStyleSchema, ContentImageBlock, ContentImageBlockSchema, ContentImageOriginal, ContentImageOriginalSchema, ContentInterpretation, ContentInterpretationSchema, ContentListMembership, ContentListMembershipSchema, ContentOrigin, ContentOriginSchema, ContentPageBreak, ContentPageBreakSchema, ContentPageFurniture, ContentPageFurnitureSchema, ContentParagraph, ContentParagraphBorders, ContentParagraphBordersSchema, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellComment, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetConditionalFormat, ContentSheetConditionalFormatSchema, ContentSheetConditionalFormatStyle, ContentSheetConditionalFormatStyleSchema, ContentSheetConditionalFormatValue, ContentSheetConditionalFormatValueSchema, ContentSheetDataValidation, ContentSheetDataValidationSchema, ContentSheetDataValidationType, ContentSheetDataValidationTypeSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRange, ContentSheetRangeSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeDash, ContentStrokeDashSchema, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentTranscript, ContentTranscriptSchema, ContentVector, ContentVectorSchema, DecimalString, DecimalStringSchema, FusedNode, IMAGE_FORMATS, ImageFormat, RUN_FONT_PROPERTY_SHAPE, RunConstructExtent, RunConstructExtentSchema, RunConstructFault, SheetRuleOperator, SheetRuleOperatorSchema, clampHeadingLevel, contentDocumentSharedFields, findConstructMarkerImbalance, findRunConstructFault, isContentBlock, isContentConstructEnd, isContentConstructStart, isRunConstructExtent, resolveCellFillColor, unrecognizedFillKind };
|
package/dist/content.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-
|
|
1
|
+
import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-ovWk5At_.js";
|
|
2
2
|
export { CONTENT_ANNOTATION_FIELDS, ConstructMarkerImbalance, ContentBitmapFill, ContentBitmapFillSchema, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellFill, ContentCellFillSchema, ContentCellPatternType, ContentCellPatternTypeSchema, ContentCellValue, ContentCellValueSchema, ContentConstructEnd, ContentConstructEndSchema, ContentConstructStart, ContentConstructStartSchema, ContentDefinedName, ContentDefinedNameSchema, ContentDocument, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFillPattern, ContentFillPatternSchema, ContentFloatAlign, ContentFloatAlignSchema, ContentFloatAxis, ContentFloatAxisSchema, ContentFloatOrigin, ContentFloatOriginSchema, ContentFloatPosition, ContentFloatPositionSchema, ContentFont, ContentFontSchema, ContentFormula, ContentFormulaSchema, ContentGradientFill, ContentGradientFillSchema, ContentGradientStyle, ContentGradientStyleSchema, ContentHatchFill, ContentHatchFillSchema, ContentHatchStyle, ContentHatchStyleSchema, ContentImageBlock, ContentImageBlockSchema, ContentImageOriginal, ContentImageOriginalSchema, ContentInterpretation, ContentInterpretationSchema, ContentListMembership, ContentListMembershipSchema, ContentOrigin, ContentOriginSchema, ContentPageBreak, ContentPageBreakSchema, ContentPageFurniture, ContentPageFurnitureSchema, ContentParagraph, ContentParagraphBorders, ContentParagraphBordersSchema, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellComment, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetConditionalFormat, ContentSheetConditionalFormatSchema, ContentSheetConditionalFormatStyle, ContentSheetConditionalFormatStyleSchema, ContentSheetConditionalFormatValue, ContentSheetConditionalFormatValueSchema, ContentSheetDataValidation, ContentSheetDataValidationSchema, ContentSheetDataValidationType, ContentSheetDataValidationTypeSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRange, ContentSheetRangeSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeDash, ContentStrokeDashSchema, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentTranscript, ContentTranscriptSchema, ContentVector, ContentVectorSchema, DecimalString, DecimalStringSchema, FusedNode, IMAGE_FORMATS, ImageFormat, RUN_FONT_PROPERTY_SHAPE, RunConstructExtent, RunConstructExtentSchema, RunConstructFault, SheetRuleOperator, SheetRuleOperatorSchema, clampHeadingLevel, contentDocumentSharedFields, findConstructMarkerImbalance, findRunConstructFault, isContentBlock, isContentConstructEnd, isContentConstructStart, isRunConstructExtent, resolveCellFillColor, unrecognizedFillKind };
|
package/dist/content.js
CHANGED
|
@@ -164,7 +164,7 @@ const IMAGE_FORMATS = [
|
|
|
164
164
|
"gif"
|
|
165
165
|
];
|
|
166
166
|
function isImageFormat(value) {
|
|
167
|
-
return
|
|
167
|
+
return IMAGE_FORMATS.includes(value);
|
|
168
168
|
}
|
|
169
169
|
const ContentImageOriginalSchema = z.object({
|
|
170
170
|
filter: z.enum(["jbig2", "jpeg2000"]),
|
package/dist/decompose.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ContentDocument, Et as ContentShape, Ot as ContentSheet, T as ContentDrawPage, W as ContentFormula, in as ContentSlide, mt as ContentParagraph, n as ConstructMarkerImbalance, wt as ContentSection } from "./content-
|
|
2
|
-
import { D as ShapeGroupNode, I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, c as HeadingParagraph, i as DrawPageGroupNode, p as ListParagraph } from "./package-node-
|
|
1
|
+
import { C as ContentDocument, Et as ContentShape, Ot as ContentSheet, T as ContentDrawPage, W as ContentFormula, in as ContentSlide, mt as ContentParagraph, n as ConstructMarkerImbalance, wt as ContentSection } from "./content-DllbQ_-F.cjs";
|
|
2
|
+
import { D as ShapeGroupNode, I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, c as HeadingParagraph, i as DrawPageGroupNode, p as ListParagraph } from "./package-node-D_7FINlv.cjs";
|
|
3
3
|
//#region src/decompose.d.ts
|
|
4
4
|
declare function isHeadingParagraph(paragraph: ContentParagraph): paragraph is HeadingParagraph;
|
|
5
5
|
declare function isListParagraph(paragraph: ContentParagraph): paragraph is ListParagraph;
|
package/dist/decompose.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ContentDocument, Et as ContentShape, Ot as ContentSheet, T as ContentDrawPage, W as ContentFormula, in as ContentSlide, mt as ContentParagraph, n as ConstructMarkerImbalance, wt as ContentSection } from "./content-
|
|
2
|
-
import { D as ShapeGroupNode, I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, c as HeadingParagraph, i as DrawPageGroupNode, p as ListParagraph } from "./package-node-
|
|
1
|
+
import { C as ContentDocument, Et as ContentShape, Ot as ContentSheet, T as ContentDrawPage, W as ContentFormula, in as ContentSlide, mt as ContentParagraph, n as ConstructMarkerImbalance, wt as ContentSection } from "./content-ovWk5At_.js";
|
|
2
|
+
import { D as ShapeGroupNode, I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, c as HeadingParagraph, i as DrawPageGroupNode, p as ListParagraph } from "./package-node-BNCUdJJa.js";
|
|
3
3
|
//#region src/decompose.d.ts
|
|
4
4
|
declare function isHeadingParagraph(paragraph: ContentParagraph): paragraph is HeadingParagraph;
|
|
5
5
|
declare function isListParagraph(paragraph: ContentParagraph): paragraph is ListParagraph;
|
package/dist/definitions.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { St as ContentRun, mt as ContentParagraph } from "./content-
|
|
1
|
+
import { St as ContentRun, mt as ContentParagraph } from "./content-DllbQ_-F.cjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/definitions.d.ts
|
|
4
4
|
declare const StyleParagraphPropertiesSchema: z.ZodObject<{
|
package/dist/definitions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { St as ContentRun, mt as ContentParagraph } from "./content-
|
|
1
|
+
import { St as ContentRun, mt as ContentParagraph } from "./content-ovWk5At_.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/definitions.d.ts
|
|
4
4
|
declare const StyleParagraphPropertiesSchema: z.ZodObject<{
|
package/dist/factor-styles.cjs
CHANGED
|
@@ -22,18 +22,9 @@ const RUN_STYLE_KEYS = [
|
|
|
22
22
|
"sizePt",
|
|
23
23
|
"color"
|
|
24
24
|
];
|
|
25
|
-
function isShapeGroupWrapper(wrapper) {
|
|
26
|
-
return !("kind" in wrapper.node);
|
|
27
|
-
}
|
|
28
25
|
function isAnchorGroupWrapper(wrapper) {
|
|
29
26
|
return "kind" in wrapper.node && wrapper.node.kind === "paragraph";
|
|
30
27
|
}
|
|
31
|
-
function isSlideGroupWrapper(wrapper) {
|
|
32
|
-
return "kind" in wrapper.node && wrapper.node.kind === "slide";
|
|
33
|
-
}
|
|
34
|
-
function isDrawPageGroupWrapper(wrapper) {
|
|
35
|
-
return "kind" in wrapper.node && wrapper.node.kind === "drawPage";
|
|
36
|
-
}
|
|
37
28
|
function isHeadingGroup(group) {
|
|
38
29
|
return group.node.headingLevel !== void 0;
|
|
39
30
|
}
|
|
@@ -82,21 +73,13 @@ function factorStyles(pkg) {
|
|
|
82
73
|
...pkg.fonts !== void 0 ? { fonts: pkg.fonts } : {},
|
|
83
74
|
...pkg.source !== void 0 ? { source: pkg.source } : {}
|
|
84
75
|
};
|
|
85
|
-
if (pkg.definitions === void 0 && pkg.fonts === void 0 && pkg.source === void 0) return reassembled;
|
|
86
76
|
return {
|
|
87
77
|
...reassembled,
|
|
88
78
|
...carried
|
|
89
79
|
};
|
|
90
80
|
}
|
|
91
81
|
function extentOf(wrapper) {
|
|
92
|
-
if (isShapeGroupWrapper(wrapper)) return flowExtent(wrapper.children);
|
|
93
82
|
if (isAnchorGroupWrapper(wrapper)) return [wrapper.node, ...flowExtent(wrapper.children)];
|
|
94
|
-
if (isSlideGroupWrapper(wrapper)) return wrapper.children.flatMap(extentOf);
|
|
95
|
-
if (isDrawPageGroupWrapper(wrapper)) {
|
|
96
|
-
const paragraphs = [];
|
|
97
|
-
for (const child of wrapper.children) if ("node" in child) paragraphs.push(...extentOf(child));
|
|
98
|
-
return paragraphs;
|
|
99
|
-
}
|
|
100
83
|
return flowExtent(wrapper.children);
|
|
101
84
|
}
|
|
102
85
|
function flowExtent(children) {
|
|
@@ -107,12 +90,12 @@ function flowExtent(children) {
|
|
|
107
90
|
}
|
|
108
91
|
function paragraphTuple(paragraph, keys) {
|
|
109
92
|
const tuple = {};
|
|
110
|
-
for (const key of keys)
|
|
93
|
+
for (const key of keys) tuple[key] = paragraph[key];
|
|
111
94
|
return tuple;
|
|
112
95
|
}
|
|
113
96
|
function runTuple(run, keys) {
|
|
114
97
|
const tuple = {};
|
|
115
|
-
for (const key of keys)
|
|
98
|
+
for (const key of keys) tuple[key] = run[key];
|
|
116
99
|
return tuple;
|
|
117
100
|
}
|
|
118
101
|
function commonParagraphKeys(extent, frozen) {
|
|
@@ -120,7 +103,6 @@ function commonParagraphKeys(extent, frozen) {
|
|
|
120
103
|
}
|
|
121
104
|
function commonRunKeys(extent, frozen) {
|
|
122
105
|
const runs = extent.flatMap((paragraph) => paragraph.runs);
|
|
123
|
-
if (runs.length === 0) return [];
|
|
124
106
|
return RUN_STYLE_KEYS.filter((key) => !frozen.has(key) && runs.every((run) => run[key] !== void 0));
|
|
125
107
|
}
|
|
126
108
|
function bestParagraphCandidate(extent, keys, factored) {
|
|
@@ -165,10 +147,10 @@ function bestGroup(groups) {
|
|
|
165
147
|
}
|
|
166
148
|
return best;
|
|
167
149
|
}
|
|
168
|
-
function plan(wrapper,
|
|
150
|
+
function plan(wrapper, branch, state, entries) {
|
|
169
151
|
const extent = extentOf(wrapper);
|
|
170
|
-
const paragraphCandidate =
|
|
171
|
-
const runCandidate =
|
|
152
|
+
const paragraphCandidate = bestParagraphCandidate(extent, commonParagraphKeys(extent, branch.frozenParagraphs), branch.factoredParagraphs);
|
|
153
|
+
const runCandidate = bestRunCandidate(extent, commonRunKeys(extent, branch.frozenRuns), branch.factoredRuns);
|
|
172
154
|
const nextFrozenParagraphs = new Set(branch.frozenParagraphs);
|
|
173
155
|
const nextFrozenRuns = new Set(branch.frozenRuns);
|
|
174
156
|
const nextFactoredParagraphs = new Set(branch.factoredParagraphs);
|
|
@@ -183,8 +165,7 @@ function plan(wrapper, visit, branch, state, entries) {
|
|
|
183
165
|
if (existing === void 0) entries.set(contentKey, {
|
|
184
166
|
content,
|
|
185
167
|
wrappers: [wrapper],
|
|
186
|
-
frequency: (paragraphCandidate?.positions.length ?? 0) + (runCandidate?.positions.length ?? 0)
|
|
187
|
-
firstVisit: visit.index
|
|
168
|
+
frequency: (paragraphCandidate?.positions.length ?? 0) + (runCandidate?.positions.length ?? 0)
|
|
188
169
|
});
|
|
189
170
|
else {
|
|
190
171
|
existing.wrappers.push(wrapper);
|
|
@@ -210,27 +191,15 @@ function plan(wrapper, visit, branch, state, entries) {
|
|
|
210
191
|
}
|
|
211
192
|
state.wrapperStrips.set(wrapper, strips);
|
|
212
193
|
}
|
|
213
|
-
visit.index += 1;
|
|
214
194
|
const next = {
|
|
215
195
|
frozenParagraphs: nextFrozenParagraphs,
|
|
216
196
|
frozenRuns: nextFrozenRuns,
|
|
217
197
|
factoredParagraphs: nextFactoredParagraphs,
|
|
218
198
|
factoredRuns: nextFactoredRuns
|
|
219
199
|
};
|
|
220
|
-
for (const child of childWrappers(wrapper)) plan(child,
|
|
200
|
+
for (const child of childWrappers(wrapper)) plan(child, next, state, entries);
|
|
221
201
|
}
|
|
222
202
|
function childWrappers(wrapper) {
|
|
223
|
-
if (isShapeGroupWrapper(wrapper) || isAnchorGroupWrapper(wrapper)) {
|
|
224
|
-
const wrappers = [];
|
|
225
|
-
for (const child of wrapper.children) if ("node" in child && "children" in child) wrappers.push(child);
|
|
226
|
-
return wrappers;
|
|
227
|
-
}
|
|
228
|
-
if (isSlideGroupWrapper(wrapper)) return [...wrapper.children];
|
|
229
|
-
if (isDrawPageGroupWrapper(wrapper)) {
|
|
230
|
-
const shapes = [];
|
|
231
|
-
for (const child of wrapper.children) if ("node" in child) shapes.push(child);
|
|
232
|
-
return shapes;
|
|
233
|
-
}
|
|
234
203
|
const wrappers = [];
|
|
235
204
|
for (const child of wrapper.children) if ("node" in child && "children" in child) wrappers.push(child);
|
|
236
205
|
return wrappers;
|
|
@@ -241,7 +210,6 @@ function mint(pkg) {
|
|
|
241
210
|
wrapperStrips: /* @__PURE__ */ new Map()
|
|
242
211
|
};
|
|
243
212
|
const entries = /* @__PURE__ */ new Map();
|
|
244
|
-
const visit = { index: 0 };
|
|
245
213
|
const rootBranch = {
|
|
246
214
|
frozenParagraphs: /* @__PURE__ */ new Set(),
|
|
247
215
|
frozenRuns: /* @__PURE__ */ new Set(),
|
|
@@ -250,15 +218,11 @@ function mint(pkg) {
|
|
|
250
218
|
};
|
|
251
219
|
switch (pkg.kind) {
|
|
252
220
|
case "wordprocessing":
|
|
253
|
-
for (const root of pkg.children) plan(root, visit, rootBranch, state, entries);
|
|
254
|
-
break;
|
|
255
221
|
case "presentation":
|
|
256
|
-
|
|
257
|
-
break;
|
|
258
|
-
case "drawing": for (const root of pkg.children) plan(root, visit, rootBranch, state, entries);
|
|
222
|
+
case "drawing": for (const root of pkg.children) plan(root, rootBranch, state, entries);
|
|
259
223
|
}
|
|
260
224
|
if (entries.size === 0) return pkg;
|
|
261
|
-
const ordered = [...entries.values()].sort((a, b) => b.frequency - a.frequency
|
|
225
|
+
const ordered = [...entries.values()].sort((a, b) => b.frequency - a.frequency);
|
|
262
226
|
const styles = {};
|
|
263
227
|
ordered.forEach((entry, index) => {
|
|
264
228
|
const id = `s${index + 1}`;
|
|
@@ -312,7 +276,7 @@ function rebuildSlideGroup(group, chain, state) {
|
|
|
312
276
|
const inner = innerChain(group, chain, state);
|
|
313
277
|
const children = group.children.map((shape) => rebuildShapeGroup(shape, inner, state));
|
|
314
278
|
const ref = state.wrapperRefs.get(group);
|
|
315
|
-
return
|
|
279
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
316
280
|
node: group.node,
|
|
317
281
|
...ref !== void 0 ? { style: ref } : {},
|
|
318
282
|
children
|
|
@@ -322,7 +286,7 @@ function rebuildDrawPageGroup(group, chain, state) {
|
|
|
322
286
|
const inner = innerChain(group, chain, state);
|
|
323
287
|
const children = group.children.map((child) => "node" in child ? rebuildShapeGroup(child, inner, state) : child);
|
|
324
288
|
const ref = state.wrapperRefs.get(group);
|
|
325
|
-
return
|
|
289
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
326
290
|
node: group.node,
|
|
327
291
|
...ref !== void 0 ? { style: ref } : {},
|
|
328
292
|
children
|
|
@@ -332,7 +296,7 @@ function rebuildSectionGroup(group, chain, state) {
|
|
|
332
296
|
const inner = innerChain(group, chain, state);
|
|
333
297
|
const children = group.children.map((child) => rebuildSectionChild(child, inner, state));
|
|
334
298
|
const ref = state.wrapperRefs.get(group);
|
|
335
|
-
return
|
|
299
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
336
300
|
node: group.node,
|
|
337
301
|
...ref !== void 0 ? { style: ref } : {},
|
|
338
302
|
children
|
|
@@ -354,7 +318,7 @@ function rebuildShapeGroup(group, chain, state) {
|
|
|
354
318
|
const inner = innerChain(group, chain, state);
|
|
355
319
|
const children = group.children.map((child) => rebuildListChild(child, inner, state));
|
|
356
320
|
const ref = state.wrapperRefs.get(group);
|
|
357
|
-
return
|
|
321
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
358
322
|
node: group.node,
|
|
359
323
|
...ref !== void 0 ? { style: ref } : {},
|
|
360
324
|
children
|
|
@@ -364,7 +328,7 @@ function rebuildSectionConstructGroup(group, chain, state) {
|
|
|
364
328
|
const inner = innerChain(group, chain, state);
|
|
365
329
|
const children = group.children.map((child) => rebuildSectionChild(child, inner, state));
|
|
366
330
|
const ref = state.wrapperRefs.get(group);
|
|
367
|
-
return
|
|
331
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
368
332
|
node: group.node,
|
|
369
333
|
...ref !== void 0 ? { style: ref } : {},
|
|
370
334
|
children
|
|
@@ -374,7 +338,7 @@ function rebuildShapeConstructGroup(group, chain, state) {
|
|
|
374
338
|
const inner = innerChain(group, chain, state);
|
|
375
339
|
const children = group.children.map((child) => rebuildListChild(child, inner, state));
|
|
376
340
|
const ref = state.wrapperRefs.get(group);
|
|
377
|
-
return
|
|
341
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
378
342
|
node: group.node,
|
|
379
343
|
...ref !== void 0 ? { style: ref } : {},
|
|
380
344
|
children
|
|
@@ -383,10 +347,9 @@ function rebuildShapeConstructGroup(group, chain, state) {
|
|
|
383
347
|
function rebuildHeadingGroup(group, chain, state, rebuildChild) {
|
|
384
348
|
const inner = innerChain(group, chain, state);
|
|
385
349
|
const anchor = rebuildParagraph(group.node, inner);
|
|
386
|
-
assertHeadingAnchor(anchor);
|
|
387
350
|
const children = group.children.map((child) => rebuildChild(child, inner, state));
|
|
388
351
|
const ref = state.wrapperRefs.get(group);
|
|
389
|
-
return
|
|
352
|
+
return anchor === group.node && children.every((child, index) => child === group.children[index]) ? group : {
|
|
390
353
|
node: anchor,
|
|
391
354
|
...ref !== void 0 ? { style: ref } : {},
|
|
392
355
|
children
|
|
@@ -395,21 +358,14 @@ function rebuildHeadingGroup(group, chain, state, rebuildChild) {
|
|
|
395
358
|
function rebuildListGroup(group, chain, state, rebuildChild) {
|
|
396
359
|
const inner = innerChain(group, chain, state);
|
|
397
360
|
const anchor = rebuildParagraph(group.node, inner);
|
|
398
|
-
assertListAnchor(anchor);
|
|
399
361
|
const children = group.children.map((child) => rebuildChild(child, inner, state));
|
|
400
362
|
const ref = state.wrapperRefs.get(group);
|
|
401
|
-
return
|
|
363
|
+
return anchor === group.node && children.every((child, index) => child === group.children[index]) ? group : {
|
|
402
364
|
node: anchor,
|
|
403
365
|
...ref !== void 0 ? { style: ref } : {},
|
|
404
366
|
children
|
|
405
367
|
};
|
|
406
368
|
}
|
|
407
|
-
function assertHeadingAnchor(paragraph) {
|
|
408
|
-
if (paragraph.headingLevel === void 0) throw new Error("factorStyles: stripping dropped a heading anchor's headingLevel");
|
|
409
|
-
}
|
|
410
|
-
function assertListAnchor(paragraph) {
|
|
411
|
-
if (paragraph.list === void 0) throw new Error("factorStyles: stripping dropped a list anchor's list membership");
|
|
412
|
-
}
|
|
413
369
|
function rebuildParagraph(paragraph, chain) {
|
|
414
370
|
const strips = paragraphStripsOf(chain, paragraph);
|
|
415
371
|
const base = strips === void 0 ? paragraph : stripParagraphKeys(paragraph, strips);
|
package/dist/factor-styles.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as PageSize } from "./geometry-CvcjSwnA.cjs";
|
|
2
|
-
import { C as ContentDocument } from "./content-
|
|
2
|
+
import { C as ContentDocument } from "./content-DllbQ_-F.cjs";
|
|
3
3
|
import { DocumentTree } from "./package.cjs";
|
|
4
4
|
//#region src/factor-styles.d.ts
|
|
5
5
|
declare function assembleTree(content: ContentDocument, pages?: readonly PageSize[]): DocumentTree;
|
package/dist/factor-styles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as PageSize } from "./geometry-CvcjSwnA.js";
|
|
2
|
-
import { C as ContentDocument } from "./content-
|
|
2
|
+
import { C as ContentDocument } from "./content-ovWk5At_.js";
|
|
3
3
|
import { DocumentTree } from "./package.js";
|
|
4
4
|
//#region src/factor-styles.d.ts
|
|
5
5
|
declare function assembleTree(content: ContentDocument, pages?: readonly PageSize[]): DocumentTree;
|
package/dist/factor-styles.js
CHANGED
|
@@ -21,18 +21,9 @@ const RUN_STYLE_KEYS = [
|
|
|
21
21
|
"sizePt",
|
|
22
22
|
"color"
|
|
23
23
|
];
|
|
24
|
-
function isShapeGroupWrapper(wrapper) {
|
|
25
|
-
return !("kind" in wrapper.node);
|
|
26
|
-
}
|
|
27
24
|
function isAnchorGroupWrapper(wrapper) {
|
|
28
25
|
return "kind" in wrapper.node && wrapper.node.kind === "paragraph";
|
|
29
26
|
}
|
|
30
|
-
function isSlideGroupWrapper(wrapper) {
|
|
31
|
-
return "kind" in wrapper.node && wrapper.node.kind === "slide";
|
|
32
|
-
}
|
|
33
|
-
function isDrawPageGroupWrapper(wrapper) {
|
|
34
|
-
return "kind" in wrapper.node && wrapper.node.kind === "drawPage";
|
|
35
|
-
}
|
|
36
27
|
function isHeadingGroup(group) {
|
|
37
28
|
return group.node.headingLevel !== void 0;
|
|
38
29
|
}
|
|
@@ -81,21 +72,13 @@ function factorStyles(pkg) {
|
|
|
81
72
|
...pkg.fonts !== void 0 ? { fonts: pkg.fonts } : {},
|
|
82
73
|
...pkg.source !== void 0 ? { source: pkg.source } : {}
|
|
83
74
|
};
|
|
84
|
-
if (pkg.definitions === void 0 && pkg.fonts === void 0 && pkg.source === void 0) return reassembled;
|
|
85
75
|
return {
|
|
86
76
|
...reassembled,
|
|
87
77
|
...carried
|
|
88
78
|
};
|
|
89
79
|
}
|
|
90
80
|
function extentOf(wrapper) {
|
|
91
|
-
if (isShapeGroupWrapper(wrapper)) return flowExtent(wrapper.children);
|
|
92
81
|
if (isAnchorGroupWrapper(wrapper)) return [wrapper.node, ...flowExtent(wrapper.children)];
|
|
93
|
-
if (isSlideGroupWrapper(wrapper)) return wrapper.children.flatMap(extentOf);
|
|
94
|
-
if (isDrawPageGroupWrapper(wrapper)) {
|
|
95
|
-
const paragraphs = [];
|
|
96
|
-
for (const child of wrapper.children) if ("node" in child) paragraphs.push(...extentOf(child));
|
|
97
|
-
return paragraphs;
|
|
98
|
-
}
|
|
99
82
|
return flowExtent(wrapper.children);
|
|
100
83
|
}
|
|
101
84
|
function flowExtent(children) {
|
|
@@ -106,12 +89,12 @@ function flowExtent(children) {
|
|
|
106
89
|
}
|
|
107
90
|
function paragraphTuple(paragraph, keys) {
|
|
108
91
|
const tuple = {};
|
|
109
|
-
for (const key of keys)
|
|
92
|
+
for (const key of keys) tuple[key] = paragraph[key];
|
|
110
93
|
return tuple;
|
|
111
94
|
}
|
|
112
95
|
function runTuple(run, keys) {
|
|
113
96
|
const tuple = {};
|
|
114
|
-
for (const key of keys)
|
|
97
|
+
for (const key of keys) tuple[key] = run[key];
|
|
115
98
|
return tuple;
|
|
116
99
|
}
|
|
117
100
|
function commonParagraphKeys(extent, frozen) {
|
|
@@ -119,7 +102,6 @@ function commonParagraphKeys(extent, frozen) {
|
|
|
119
102
|
}
|
|
120
103
|
function commonRunKeys(extent, frozen) {
|
|
121
104
|
const runs = extent.flatMap((paragraph) => paragraph.runs);
|
|
122
|
-
if (runs.length === 0) return [];
|
|
123
105
|
return RUN_STYLE_KEYS.filter((key) => !frozen.has(key) && runs.every((run) => run[key] !== void 0));
|
|
124
106
|
}
|
|
125
107
|
function bestParagraphCandidate(extent, keys, factored) {
|
|
@@ -164,10 +146,10 @@ function bestGroup(groups) {
|
|
|
164
146
|
}
|
|
165
147
|
return best;
|
|
166
148
|
}
|
|
167
|
-
function plan(wrapper,
|
|
149
|
+
function plan(wrapper, branch, state, entries) {
|
|
168
150
|
const extent = extentOf(wrapper);
|
|
169
|
-
const paragraphCandidate =
|
|
170
|
-
const runCandidate =
|
|
151
|
+
const paragraphCandidate = bestParagraphCandidate(extent, commonParagraphKeys(extent, branch.frozenParagraphs), branch.factoredParagraphs);
|
|
152
|
+
const runCandidate = bestRunCandidate(extent, commonRunKeys(extent, branch.frozenRuns), branch.factoredRuns);
|
|
171
153
|
const nextFrozenParagraphs = new Set(branch.frozenParagraphs);
|
|
172
154
|
const nextFrozenRuns = new Set(branch.frozenRuns);
|
|
173
155
|
const nextFactoredParagraphs = new Set(branch.factoredParagraphs);
|
|
@@ -182,8 +164,7 @@ function plan(wrapper, visit, branch, state, entries) {
|
|
|
182
164
|
if (existing === void 0) entries.set(contentKey, {
|
|
183
165
|
content,
|
|
184
166
|
wrappers: [wrapper],
|
|
185
|
-
frequency: (paragraphCandidate?.positions.length ?? 0) + (runCandidate?.positions.length ?? 0)
|
|
186
|
-
firstVisit: visit.index
|
|
167
|
+
frequency: (paragraphCandidate?.positions.length ?? 0) + (runCandidate?.positions.length ?? 0)
|
|
187
168
|
});
|
|
188
169
|
else {
|
|
189
170
|
existing.wrappers.push(wrapper);
|
|
@@ -209,27 +190,15 @@ function plan(wrapper, visit, branch, state, entries) {
|
|
|
209
190
|
}
|
|
210
191
|
state.wrapperStrips.set(wrapper, strips);
|
|
211
192
|
}
|
|
212
|
-
visit.index += 1;
|
|
213
193
|
const next = {
|
|
214
194
|
frozenParagraphs: nextFrozenParagraphs,
|
|
215
195
|
frozenRuns: nextFrozenRuns,
|
|
216
196
|
factoredParagraphs: nextFactoredParagraphs,
|
|
217
197
|
factoredRuns: nextFactoredRuns
|
|
218
198
|
};
|
|
219
|
-
for (const child of childWrappers(wrapper)) plan(child,
|
|
199
|
+
for (const child of childWrappers(wrapper)) plan(child, next, state, entries);
|
|
220
200
|
}
|
|
221
201
|
function childWrappers(wrapper) {
|
|
222
|
-
if (isShapeGroupWrapper(wrapper) || isAnchorGroupWrapper(wrapper)) {
|
|
223
|
-
const wrappers = [];
|
|
224
|
-
for (const child of wrapper.children) if ("node" in child && "children" in child) wrappers.push(child);
|
|
225
|
-
return wrappers;
|
|
226
|
-
}
|
|
227
|
-
if (isSlideGroupWrapper(wrapper)) return [...wrapper.children];
|
|
228
|
-
if (isDrawPageGroupWrapper(wrapper)) {
|
|
229
|
-
const shapes = [];
|
|
230
|
-
for (const child of wrapper.children) if ("node" in child) shapes.push(child);
|
|
231
|
-
return shapes;
|
|
232
|
-
}
|
|
233
202
|
const wrappers = [];
|
|
234
203
|
for (const child of wrapper.children) if ("node" in child && "children" in child) wrappers.push(child);
|
|
235
204
|
return wrappers;
|
|
@@ -240,7 +209,6 @@ function mint(pkg) {
|
|
|
240
209
|
wrapperStrips: /* @__PURE__ */ new Map()
|
|
241
210
|
};
|
|
242
211
|
const entries = /* @__PURE__ */ new Map();
|
|
243
|
-
const visit = { index: 0 };
|
|
244
212
|
const rootBranch = {
|
|
245
213
|
frozenParagraphs: /* @__PURE__ */ new Set(),
|
|
246
214
|
frozenRuns: /* @__PURE__ */ new Set(),
|
|
@@ -249,15 +217,11 @@ function mint(pkg) {
|
|
|
249
217
|
};
|
|
250
218
|
switch (pkg.kind) {
|
|
251
219
|
case "wordprocessing":
|
|
252
|
-
for (const root of pkg.children) plan(root, visit, rootBranch, state, entries);
|
|
253
|
-
break;
|
|
254
220
|
case "presentation":
|
|
255
|
-
|
|
256
|
-
break;
|
|
257
|
-
case "drawing": for (const root of pkg.children) plan(root, visit, rootBranch, state, entries);
|
|
221
|
+
case "drawing": for (const root of pkg.children) plan(root, rootBranch, state, entries);
|
|
258
222
|
}
|
|
259
223
|
if (entries.size === 0) return pkg;
|
|
260
|
-
const ordered = [...entries.values()].sort((a, b) => b.frequency - a.frequency
|
|
224
|
+
const ordered = [...entries.values()].sort((a, b) => b.frequency - a.frequency);
|
|
261
225
|
const styles = {};
|
|
262
226
|
ordered.forEach((entry, index) => {
|
|
263
227
|
const id = `s${index + 1}`;
|
|
@@ -311,7 +275,7 @@ function rebuildSlideGroup(group, chain, state) {
|
|
|
311
275
|
const inner = innerChain(group, chain, state);
|
|
312
276
|
const children = group.children.map((shape) => rebuildShapeGroup(shape, inner, state));
|
|
313
277
|
const ref = state.wrapperRefs.get(group);
|
|
314
|
-
return
|
|
278
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
315
279
|
node: group.node,
|
|
316
280
|
...ref !== void 0 ? { style: ref } : {},
|
|
317
281
|
children
|
|
@@ -321,7 +285,7 @@ function rebuildDrawPageGroup(group, chain, state) {
|
|
|
321
285
|
const inner = innerChain(group, chain, state);
|
|
322
286
|
const children = group.children.map((child) => "node" in child ? rebuildShapeGroup(child, inner, state) : child);
|
|
323
287
|
const ref = state.wrapperRefs.get(group);
|
|
324
|
-
return
|
|
288
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
325
289
|
node: group.node,
|
|
326
290
|
...ref !== void 0 ? { style: ref } : {},
|
|
327
291
|
children
|
|
@@ -331,7 +295,7 @@ function rebuildSectionGroup(group, chain, state) {
|
|
|
331
295
|
const inner = innerChain(group, chain, state);
|
|
332
296
|
const children = group.children.map((child) => rebuildSectionChild(child, inner, state));
|
|
333
297
|
const ref = state.wrapperRefs.get(group);
|
|
334
|
-
return
|
|
298
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
335
299
|
node: group.node,
|
|
336
300
|
...ref !== void 0 ? { style: ref } : {},
|
|
337
301
|
children
|
|
@@ -353,7 +317,7 @@ function rebuildShapeGroup(group, chain, state) {
|
|
|
353
317
|
const inner = innerChain(group, chain, state);
|
|
354
318
|
const children = group.children.map((child) => rebuildListChild(child, inner, state));
|
|
355
319
|
const ref = state.wrapperRefs.get(group);
|
|
356
|
-
return
|
|
320
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
357
321
|
node: group.node,
|
|
358
322
|
...ref !== void 0 ? { style: ref } : {},
|
|
359
323
|
children
|
|
@@ -363,7 +327,7 @@ function rebuildSectionConstructGroup(group, chain, state) {
|
|
|
363
327
|
const inner = innerChain(group, chain, state);
|
|
364
328
|
const children = group.children.map((child) => rebuildSectionChild(child, inner, state));
|
|
365
329
|
const ref = state.wrapperRefs.get(group);
|
|
366
|
-
return
|
|
330
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
367
331
|
node: group.node,
|
|
368
332
|
...ref !== void 0 ? { style: ref } : {},
|
|
369
333
|
children
|
|
@@ -373,7 +337,7 @@ function rebuildShapeConstructGroup(group, chain, state) {
|
|
|
373
337
|
const inner = innerChain(group, chain, state);
|
|
374
338
|
const children = group.children.map((child) => rebuildListChild(child, inner, state));
|
|
375
339
|
const ref = state.wrapperRefs.get(group);
|
|
376
|
-
return
|
|
340
|
+
return children.every((child, index) => child === group.children[index]) ? group : {
|
|
377
341
|
node: group.node,
|
|
378
342
|
...ref !== void 0 ? { style: ref } : {},
|
|
379
343
|
children
|
|
@@ -382,10 +346,9 @@ function rebuildShapeConstructGroup(group, chain, state) {
|
|
|
382
346
|
function rebuildHeadingGroup(group, chain, state, rebuildChild) {
|
|
383
347
|
const inner = innerChain(group, chain, state);
|
|
384
348
|
const anchor = rebuildParagraph(group.node, inner);
|
|
385
|
-
assertHeadingAnchor(anchor);
|
|
386
349
|
const children = group.children.map((child) => rebuildChild(child, inner, state));
|
|
387
350
|
const ref = state.wrapperRefs.get(group);
|
|
388
|
-
return
|
|
351
|
+
return anchor === group.node && children.every((child, index) => child === group.children[index]) ? group : {
|
|
389
352
|
node: anchor,
|
|
390
353
|
...ref !== void 0 ? { style: ref } : {},
|
|
391
354
|
children
|
|
@@ -394,21 +357,14 @@ function rebuildHeadingGroup(group, chain, state, rebuildChild) {
|
|
|
394
357
|
function rebuildListGroup(group, chain, state, rebuildChild) {
|
|
395
358
|
const inner = innerChain(group, chain, state);
|
|
396
359
|
const anchor = rebuildParagraph(group.node, inner);
|
|
397
|
-
assertListAnchor(anchor);
|
|
398
360
|
const children = group.children.map((child) => rebuildChild(child, inner, state));
|
|
399
361
|
const ref = state.wrapperRefs.get(group);
|
|
400
|
-
return
|
|
362
|
+
return anchor === group.node && children.every((child, index) => child === group.children[index]) ? group : {
|
|
401
363
|
node: anchor,
|
|
402
364
|
...ref !== void 0 ? { style: ref } : {},
|
|
403
365
|
children
|
|
404
366
|
};
|
|
405
367
|
}
|
|
406
|
-
function assertHeadingAnchor(paragraph) {
|
|
407
|
-
if (paragraph.headingLevel === void 0) throw new Error("factorStyles: stripping dropped a heading anchor's headingLevel");
|
|
408
|
-
}
|
|
409
|
-
function assertListAnchor(paragraph) {
|
|
410
|
-
if (paragraph.list === void 0) throw new Error("factorStyles: stripping dropped a list anchor's list membership");
|
|
411
|
-
}
|
|
412
368
|
function rebuildParagraph(paragraph, chain) {
|
|
413
369
|
const strips = paragraphStripsOf(chain, paragraph);
|
|
414
370
|
const base = strips === void 0 ? paragraph : stripParagraphKeys(paragraph, strips);
|
package/dist/flatten.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ContentDocument } from "./content-
|
|
1
|
+
import { C as ContentDocument } from "./content-DllbQ_-F.cjs";
|
|
2
2
|
import { DocumentTree } from "./package.cjs";
|
|
3
3
|
//#region src/flatten.d.ts
|
|
4
4
|
declare function flattenTree(pkg: DocumentTree): ContentDocument;
|
package/dist/flatten.d.ts
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -6,11 +6,11 @@ import { a as rgbHexToColor, i as colorToRgbHex, n as Color, r as ColorSchema, t
|
|
|
6
6
|
import { a as Margins, c as PAGE_SIZE_LETTER, d as Point, f as SLIDE_SIZE_STANDARD, i as LayoutFrameSchema, l as PageSize, n as BoxSchema, o as MarginsSchema, p as SLIDE_SIZE_WIDESCREEN, r as LayoutFrame, s as PAGE_SIZE_A4, t as Box, u as PageSizeSchema } from "./geometry-CvcjSwnA.cjs";
|
|
7
7
|
import { i as SourceResidueSchema, n as SourceFormatSchema, r as SourceResidue, t as SourceFormat } from "./source-Bas5ol6f.cjs";
|
|
8
8
|
import { a as LayoutFontSchema, i as LayoutFont, n as AlignmentSchema, o as TextDirection, r as DEFAULT_LAYOUT_FONT, s as TextDirectionSchema, t as Alignment } from "./style-BGMcYrD2.cjs";
|
|
9
|
-
import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-
|
|
9
|
+
import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-DllbQ_-F.cjs";
|
|
10
10
|
import { ContentCodec } from "./codec.cjs";
|
|
11
11
|
import { C as ProvenanceChange, E as ProvenanceDescriptorSchema, S as LinkTargetSchema, T as ProvenanceDescriptor, _ as FieldDescriptor, a as ConstructDescriptor, b as LinkDescriptorSchema, c as ContentControlDescriptorSchema, d as ContentControlType, f as ContentControlTypeSchema, g as DivisionSourceSchema, h as DivisionSource, i as AnchorTypeSchema, l as ContentControlLock, m as DivisionDescriptorSchema, n as AnchorDescriptorSchema, o as ConstructDescriptorSchema, p as DivisionDescriptor, r as AnchorType, s as ContentControlDescriptor, t as AnchorDescriptor, u as ContentControlLockSchema, v as FieldDescriptorSchema, w as ProvenanceChangeSchema, x as LinkTarget, y as LinkDescriptor } from "./construct-C9cYkjnd.cjs";
|
|
12
12
|
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.cjs";
|
|
13
|
-
import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-
|
|
13
|
+
import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-D_7FINlv.cjs";
|
|
14
14
|
import { ConstructMarkerImbalanceError, TreeChildren, decompose } from "./decompose.cjs";
|
|
15
15
|
import { DefinitionEntry, DefinitionEntrySchema, DefinitionsTable, DefinitionsTableSchema, StyleEntry, StyleEntrySchema, StyleParagraphProperties, StyleParagraphPropertiesSchema, StyleRunProperties, StyleRunPropertiesSchema, StylesTable, StylesTableSchema, applyParagraphStyleProperties, applyRunStyleProperties, overlayStyleEntries, resolveStyleChain } from "./definitions.cjs";
|
|
16
16
|
import { DocumentTree, DocumentTreeSchema, TreeEmbeddedFont, TreeEmbeddedFontSchema } from "./package.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ import { a as rgbHexToColor, i as colorToRgbHex, n as Color, r as ColorSchema, t
|
|
|
6
6
|
import { a as Margins, c as PAGE_SIZE_LETTER, d as Point, f as SLIDE_SIZE_STANDARD, i as LayoutFrameSchema, l as PageSize, n as BoxSchema, o as MarginsSchema, p as SLIDE_SIZE_WIDESCREEN, r as LayoutFrame, s as PAGE_SIZE_A4, t as Box, u as PageSizeSchema } from "./geometry-CvcjSwnA.js";
|
|
7
7
|
import { i as SourceResidueSchema, n as SourceFormatSchema, r as SourceResidue, t as SourceFormat } from "./source-Bas5ol6f.js";
|
|
8
8
|
import { a as LayoutFontSchema, i as LayoutFont, n as AlignmentSchema, o as TextDirection, r as DEFAULT_LAYOUT_FONT, s as TextDirectionSchema, t as Alignment } from "./style-BGMcYrD2.js";
|
|
9
|
-
import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-
|
|
9
|
+
import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-ovWk5At_.js";
|
|
10
10
|
import { ContentCodec } from "./codec.js";
|
|
11
11
|
import { C as ProvenanceChange, E as ProvenanceDescriptorSchema, S as LinkTargetSchema, T as ProvenanceDescriptor, _ as FieldDescriptor, a as ConstructDescriptor, b as LinkDescriptorSchema, c as ContentControlDescriptorSchema, d as ContentControlType, f as ContentControlTypeSchema, g as DivisionSourceSchema, h as DivisionSource, i as AnchorTypeSchema, l as ContentControlLock, m as DivisionDescriptorSchema, n as AnchorDescriptorSchema, o as ConstructDescriptorSchema, p as DivisionDescriptor, r as AnchorType, s as ContentControlDescriptor, t as AnchorDescriptor, u as ContentControlLockSchema, v as FieldDescriptorSchema, w as ProvenanceChangeSchema, x as LinkTarget, y as LinkDescriptor } from "./construct-C9cYkjnd.js";
|
|
12
12
|
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.js";
|
|
13
|
-
import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-
|
|
13
|
+
import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-BNCUdJJa.js";
|
|
14
14
|
import { ConstructMarkerImbalanceError, TreeChildren, decompose } from "./decompose.js";
|
|
15
15
|
import { DefinitionEntry, DefinitionEntrySchema, DefinitionsTable, DefinitionsTableSchema, StyleEntry, StyleEntrySchema, StyleParagraphProperties, StyleParagraphPropertiesSchema, StyleRunProperties, StyleRunPropertiesSchema, StylesTable, StylesTableSchema, applyParagraphStyleProperties, applyRunStyleProperties, overlayStyleEntries, resolveStyleChain } from "./definitions.js";
|
|
16
16
|
import { DocumentTree, DocumentTreeSchema, TreeEmbeddedFont, TreeEmbeddedFontSchema } from "./package.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as ContentEmbeddedObject, Gt as ContentSheetImage, Sn as ContentVector, W as ContentFormula, _ as ContentConstructEnd, a as ContentBlock, y as ContentConstructStart } from "./content-
|
|
1
|
+
import { D as ContentEmbeddedObject, Gt as ContentSheetImage, Sn as ContentVector, W as ContentFormula, _ as ContentConstructEnd, a as ContentBlock, y as ContentConstructStart } from "./content-ovWk5At_.js";
|
|
2
2
|
import { a as ConstructDescriptor } from "./construct-C9cYkjnd.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/package-node.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as ContentEmbeddedObject, Gt as ContentSheetImage, Sn as ContentVector, W as ContentFormula, _ as ContentConstructEnd, a as ContentBlock, y as ContentConstructStart } from "./content-
|
|
1
|
+
import { D as ContentEmbeddedObject, Gt as ContentSheetImage, Sn as ContentVector, W as ContentFormula, _ as ContentConstructEnd, a as ContentBlock, y as ContentConstructStart } from "./content-DllbQ_-F.cjs";
|
|
2
2
|
import { a as ConstructDescriptor } from "./construct-C9cYkjnd.cjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/package-node.d.ts
|
package/dist/package-node.cjs
CHANGED
|
@@ -20,7 +20,6 @@ function isRecord(value) {
|
|
|
20
20
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
21
21
|
}
|
|
22
22
|
function isGroupWrapper(value, isChild) {
|
|
23
|
-
if (!isRecord(value.node)) return false;
|
|
24
23
|
if (value.style !== void 0 && typeof value.style !== "string") return false;
|
|
25
24
|
if (!Object.keys(value).every((key) => key === "node" || key === "style" || key === "children")) return false;
|
|
26
25
|
return Array.isArray(value.children) && value.children.every(isChild);
|
package/dist/package-node.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-
|
|
1
|
+
import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-D_7FINlv.cjs";
|
|
2
2
|
export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, TreeBlockLeaf, TreeBlockLeafSchema, TreeGroup, TreeGroupSchema, TreeLeaf, TreeLeafSchema, TreeNode, TreeNodeSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isTreeBlockLeaf, isTreeGroup, isTreeLeaf, isTreeNode };
|
package/dist/package-node.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-
|
|
1
|
+
import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-BNCUdJJa.js";
|
|
2
2
|
export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, TreeBlockLeaf, TreeBlockLeafSchema, TreeGroup, TreeGroupSchema, TreeLeaf, TreeLeafSchema, TreeNode, TreeNodeSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isTreeBlockLeaf, isTreeGroup, isTreeLeaf, isTreeNode };
|
package/dist/package-node.js
CHANGED
|
@@ -19,7 +19,6 @@ function isRecord(value) {
|
|
|
19
19
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20
20
|
}
|
|
21
21
|
function isGroupWrapper(value, isChild) {
|
|
22
|
-
if (!isRecord(value.node)) return false;
|
|
23
22
|
if (value.style !== void 0 && typeof value.style !== "string") return false;
|
|
24
23
|
if (!Object.keys(value).every((key) => key === "node" || key === "style" || key === "children")) return false;
|
|
25
24
|
return Array.isArray(value.children) && value.children.every(isChild);
|
package/dist/package.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as MathMlNode } from "./mathml-Czqc1mdZ.cjs";
|
|
2
2
|
import { p as MathExpression } from "./math-BScHxedi.cjs";
|
|
3
|
-
import { I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, i as DrawPageGroupNode } from "./package-node-
|
|
3
|
+
import { I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, i as DrawPageGroupNode } from "./package-node-D_7FINlv.cjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/package.d.ts
|
|
6
6
|
declare const TreeEmbeddedFontSchema: z.ZodObject<{
|
package/dist/package.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as MathMlNode } from "./mathml-Czqc1mdZ.js";
|
|
2
2
|
import { p as MathExpression } from "./math-BScHxedi.js";
|
|
3
|
-
import { I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, i as DrawPageGroupNode } from "./package-node-
|
|
3
|
+
import { I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, i as DrawPageGroupNode } from "./package-node-BNCUdJJa.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/package.d.ts
|
|
6
6
|
declare const TreeEmbeddedFontSchema: z.ZodObject<{
|
package/dist/schema-io.cjs
CHANGED
|
@@ -7,7 +7,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
7
7
|
ContentDocument: "content-document.schema.json"
|
|
8
8
|
};
|
|
9
9
|
function schemaUriFor(kind) {
|
|
10
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
10
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
11
11
|
}
|
|
12
12
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-tree|document-package|content-document|layout-document)\.schema\.json$/;
|
|
13
13
|
function parseSchemaUri(uri) {
|
|
@@ -102,7 +102,7 @@ function documentFromJson(value) {
|
|
|
102
102
|
if (parts.stem === "document-package") throw new DocumentPackageRenamedError(value.$schema);
|
|
103
103
|
const kind = kindForFileStem(parts.stem);
|
|
104
104
|
if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
|
|
105
|
-
if (majorVersionOf(parts.version) !== majorVersionOf("7.11.
|
|
105
|
+
if (majorVersionOf(parts.version) !== majorVersionOf("7.11.3")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "7.11.3");
|
|
106
106
|
switch (kind) {
|
|
107
107
|
case "DocumentTree": return {
|
|
108
108
|
kind,
|
package/dist/schema-io.d.cts
CHANGED
package/dist/schema-io.d.ts
CHANGED
package/dist/schema-io.js
CHANGED
|
@@ -6,7 +6,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
6
6
|
ContentDocument: "content-document.schema.json"
|
|
7
7
|
};
|
|
8
8
|
function schemaUriFor(kind) {
|
|
9
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
9
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
10
10
|
}
|
|
11
11
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-tree|document-package|content-document|layout-document)\.schema\.json$/;
|
|
12
12
|
function parseSchemaUri(uri) {
|
|
@@ -101,7 +101,7 @@ function documentFromJson(value) {
|
|
|
101
101
|
if (parts.stem === "document-package") throw new DocumentPackageRenamedError(value.$schema);
|
|
102
102
|
const kind = kindForFileStem(parts.stem);
|
|
103
103
|
if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
|
|
104
|
-
if (majorVersionOf(parts.version) !== majorVersionOf("7.11.
|
|
104
|
+
if (majorVersionOf(parts.version) !== majorVersionOf("7.11.3")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "7.11.3");
|
|
105
105
|
switch (kind) {
|
|
106
106
|
case "DocumentTree": return {
|
|
107
107
|
kind,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-schema",
|
|
3
|
-
"version": "7.11.
|
|
3
|
+
"version": "7.11.3",
|
|
4
4
|
"description": "The canonical, format-agnostic content and document-tree schemas shared by ooxml.js, odf.js, documents.js, pdf-codec, and markdown-codec, plus the structural transform between them -- no format-specific or I/O behaviour.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/content-document.schema.json",
|
|
4
4
|
"oneOf": [
|
|
5
5
|
{
|
|
6
6
|
"type": "object",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"blocks": {
|
|
134
134
|
"type": "array",
|
|
135
135
|
"items": {
|
|
136
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
136
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
139
|
"breakType": {
|
|
@@ -151,19 +151,19 @@
|
|
|
151
151
|
"default": {
|
|
152
152
|
"type": "array",
|
|
153
153
|
"items": {
|
|
154
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
154
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
"even": {
|
|
158
158
|
"type": "array",
|
|
159
159
|
"items": {
|
|
160
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
160
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
163
|
"first": {
|
|
164
164
|
"type": "array",
|
|
165
165
|
"items": {
|
|
166
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
166
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
},
|
|
@@ -175,19 +175,19 @@
|
|
|
175
175
|
"default": {
|
|
176
176
|
"type": "array",
|
|
177
177
|
"items": {
|
|
178
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
178
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
"even": {
|
|
182
182
|
"type": "array",
|
|
183
183
|
"items": {
|
|
184
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
184
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
187
|
"first": {
|
|
188
188
|
"type": "array",
|
|
189
189
|
"items": {
|
|
190
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
190
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
},
|
|
@@ -199,19 +199,19 @@
|
|
|
199
199
|
"default": {
|
|
200
200
|
"type": "array",
|
|
201
201
|
"items": {
|
|
202
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
202
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
205
|
"even": {
|
|
206
206
|
"type": "array",
|
|
207
207
|
"items": {
|
|
208
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
208
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
"first": {
|
|
212
212
|
"type": "array",
|
|
213
213
|
"items": {
|
|
214
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
214
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
},
|
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
"blocks": {
|
|
639
639
|
"type": "array",
|
|
640
640
|
"items": {
|
|
641
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
641
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
},
|
|
@@ -2659,7 +2659,7 @@
|
|
|
2659
2659
|
]
|
|
2660
2660
|
},
|
|
2661
2661
|
"document": {
|
|
2662
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
2662
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/content-document.schema.json"
|
|
2663
2663
|
},
|
|
2664
2664
|
"frame": {
|
|
2665
2665
|
"type": "object",
|
|
@@ -5021,7 +5021,7 @@
|
|
|
5021
5021
|
"blocks": {
|
|
5022
5022
|
"type": "array",
|
|
5023
5023
|
"items": {
|
|
5024
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
5024
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/undefined#/$defs/schema2"
|
|
5025
5025
|
}
|
|
5026
5026
|
}
|
|
5027
5027
|
},
|
|
@@ -8027,7 +8027,7 @@
|
|
|
8027
8027
|
]
|
|
8028
8028
|
},
|
|
8029
8029
|
"document": {
|
|
8030
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
8030
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/content-document.schema.json"
|
|
8031
8031
|
},
|
|
8032
8032
|
"frame": {
|
|
8033
8033
|
"$ref": "#/$defs/Box"
|
|
@@ -10353,7 +10353,7 @@
|
|
|
10353
10353
|
]
|
|
10354
10354
|
},
|
|
10355
10355
|
"document": {
|
|
10356
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
10356
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/content-document.schema.json"
|
|
10357
10357
|
},
|
|
10358
10358
|
"frame": {
|
|
10359
10359
|
"$ref": "#/$defs/Box"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/document-tree.schema.json",
|
|
4
4
|
"oneOf": [
|
|
5
5
|
{
|
|
6
6
|
"type": "object",
|
|
@@ -1993,7 +1993,7 @@
|
|
|
1993
1993
|
]
|
|
1994
1994
|
},
|
|
1995
1995
|
"document": {
|
|
1996
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
1996
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/content-document.schema.json"
|
|
1997
1997
|
},
|
|
1998
1998
|
"frame": {
|
|
1999
1999
|
"$ref": "#/$defs/Box"
|
|
@@ -4319,7 +4319,7 @@
|
|
|
4319
4319
|
]
|
|
4320
4320
|
},
|
|
4321
4321
|
"document": {
|
|
4322
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.
|
|
4322
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@7.11.3/schemas/content-document.schema.json"
|
|
4323
4323
|
},
|
|
4324
4324
|
"frame": {
|
|
4325
4325
|
"$ref": "#/$defs/Box"
|