@json-to-office/shared-docx 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-TCEEX3OY.js → chunk-3ELXAZC3.js} +6 -6
- package/dist/{chunk-OYSBFM6W.js → chunk-64CLASFN.js} +166 -98
- package/dist/chunk-64CLASFN.js.map +1 -0
- package/dist/{chunk-4LLFZ5OY.js → chunk-7ACKXJZL.js} +2 -2
- package/dist/{chunk-KGQAQE4S.js → chunk-JW5NOPVQ.js} +2 -2
- package/dist/{chunk-KLINZKYA.js → chunk-KEIKGZ7S.js} +2 -2
- package/dist/{chunk-DQ3DTWOC.js → chunk-M2GYRM4P.js} +2 -2
- package/dist/chunk-M2GYRM4P.js.map +1 -0
- package/dist/{chunk-5SMBRJIZ.js → chunk-N6CCWDPF.js} +4 -4
- package/dist/{chunk-MCS7JCUD.js → chunk-P43S7QYT.js} +6 -4
- package/dist/chunk-P43S7QYT.js.map +1 -0
- package/dist/{chunk-ZF3JUN3R.js → chunk-Q6RCIVH5.js} +3 -3
- package/dist/{chunk-Y6FW7T32.js → chunk-S7CHEAUQ.js} +4 -4
- package/dist/{chunk-TVMTDS57.js → chunk-UDP63RKH.js} +2 -2
- package/dist/{chunk-ZKBTTJN6.js → chunk-V3YRROBV.js} +20 -10
- package/dist/chunk-V3YRROBV.js.map +1 -0
- package/dist/{chunk-7TTAAYQ5.js → chunk-Y3XKLR27.js} +19 -9
- package/dist/chunk-Y3XKLR27.js.map +1 -0
- package/dist/index.d.ts +15 -5
- package/dist/index.js +16 -13
- package/dist/index.js.map +1 -1
- package/dist/schemas/api.js +8 -8
- package/dist/schemas/component-defaults.js +3 -3
- package/dist/schemas/component-registry.js +6 -6
- package/dist/schemas/components.d.ts +14 -1
- package/dist/schemas/components.js +9 -7
- package/dist/schemas/document.js +9 -9
- package/dist/schemas/export.js +7 -7
- package/dist/schemas/font.js +1 -1
- package/dist/schemas/generator.js +7 -7
- package/dist/schemas/renderer.js +3 -3
- package/dist/schemas/theme.js +4 -4
- package/dist/validation/unified/index.js +9 -9
- package/package.json +1 -1
- package/dist/chunk-7TTAAYQ5.js.map +0 -1
- package/dist/chunk-DQ3DTWOC.js.map +0 -1
- package/dist/chunk-MCS7JCUD.js.map +0 -1
- package/dist/chunk-OYSBFM6W.js.map +0 -1
- package/dist/chunk-ZKBTTJN6.js.map +0 -1
- /package/dist/{chunk-TCEEX3OY.js.map → chunk-3ELXAZC3.js.map} +0 -0
- /package/dist/{chunk-4LLFZ5OY.js.map → chunk-7ACKXJZL.js.map} +0 -0
- /package/dist/{chunk-KGQAQE4S.js.map → chunk-JW5NOPVQ.js.map} +0 -0
- /package/dist/{chunk-KLINZKYA.js.map → chunk-KEIKGZ7S.js.map} +0 -0
- /package/dist/{chunk-5SMBRJIZ.js.map → chunk-N6CCWDPF.js.map} +0 -0
- /package/dist/{chunk-ZF3JUN3R.js.map → chunk-Q6RCIVH5.js.map} +0 -0
- /package/dist/{chunk-Y6FW7T32.js.map → chunk-S7CHEAUQ.js.map} +0 -0
- /package/dist/{chunk-TVMTDS57.js.map → chunk-UDP63RKH.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/components/common.ts"],"sourcesContent":["/**\n * Common Types and Schemas for Components\n *\n * Shared type definitions used across multiple component schemas.\n */\n\nimport { Type, Static } from '@sinclair/typebox';\nimport { HexColorSchema } from '../font';\n\n// ============================================================================\n// Common Types\n// ============================================================================\n\nexport const AlignmentSchema = Type.Union(\n [Type.Literal('left'), Type.Literal('center'), Type.Literal('right')],\n { description: 'Text alignment options' }\n);\n\nexport const JustifiedAlignmentSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('justify'),\n ],\n { description: 'Text alignment options including justify' }\n);\n\nexport const HeadingLevelSchema = Type.Union(\n [\n Type.Literal(1),\n Type.Literal(2),\n Type.Literal(3),\n Type.Literal(4),\n Type.Literal(5),\n Type.Literal(6),\n ],\n { description: 'Heading level (1-6)' }\n);\n\nexport const SpacingSchema = Type.Object(\n {\n before: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing before element in points',\n })\n ),\n after: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing after element in points',\n })\n ),\n },\n {\n description: 'Spacing configuration',\n additionalProperties: false,\n }\n);\n\nexport const ListSpacingSchema = Type.Object(\n {\n before: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing before list in points',\n })\n ),\n after: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing after list in points',\n })\n ),\n item: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Spacing between list items in points',\n })\n ),\n },\n {\n description: 'List spacing configuration with item spacing',\n additionalProperties: false,\n }\n);\n\nexport const MarginsSchema = Type.Object(\n {\n top: Type.Optional(Type.Number({ minimum: 0 })),\n bottom: Type.Optional(Type.Number({ minimum: 0 })),\n left: Type.Optional(Type.Number({ minimum: 0 })),\n right: Type.Optional(Type.Number({ minimum: 0 })),\n },\n { description: 'Margin configuration', additionalProperties: false }\n);\n\nexport const BorderSchema = Type.Object(\n {\n style: Type.Optional(\n Type.Union([\n Type.Literal('solid'),\n Type.Literal('dashed'),\n Type.Literal('dotted'),\n Type.Literal('double'),\n Type.Literal('none'),\n ])\n ),\n width: Type.Optional(Type.Number({ minimum: 0 })),\n color: Type.Optional(HexColorSchema),\n },\n { description: 'Border configuration', additionalProperties: false }\n);\n\nexport const LineSpacingSchema = Type.Object(\n {\n type: Type.Union(\n [\n Type.Literal('single'),\n Type.Literal('atLeast'),\n Type.Literal('exactly'),\n Type.Literal('double'),\n Type.Literal('multiple'),\n ],\n {\n description:\n '`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to.',\n }\n ),\n value: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. `exactly` has no floor of its own — an empty spacer paragraph legitimately pins a fraction of a point — so a box smaller than the text it holds is accepted here and clips it.',\n })\n ),\n },\n { description: 'Line spacing configuration', additionalProperties: false }\n);\n\n/**\n * List-level indentation, in POINTS.\n *\n * Points, unlike `ParagraphIndentSchema` next door, which is twips — the two\n * have always disagreed and neither said so, which is how every bundled theme\n * came to ship `indent: 3` meaning half an inch and getting three points: the\n * marker landed outside the page margin, to the left of the body text it was\n * supposed to label.\n */\nexport const IndentSchema = Type.Object(\n {\n left: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level.',\n })\n ),\n hanging: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Hanging indent in points — how far the marker sits left of the text. Omit for the 18pt default.',\n })\n ),\n },\n {\n description: 'Indentation configuration, in points',\n additionalProperties: false,\n }\n);\n\nexport const ParagraphIndentSchema = Type.Object(\n {\n left: Type.Optional(\n Type.Number({\n description: 'Left indentation in twips (1/20 of a point)',\n })\n ),\n right: Type.Optional(\n Type.Number({\n description: 'Right indentation in twips (1/20 of a point)',\n })\n ),\n hanging: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Hanging indent in twips: first line stays at the left indent, following lines are indented. Mutually exclusive with firstLine.',\n })\n ),\n firstLine: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'First-line indent in twips: only the first line is indented. Mutually exclusive with hanging.',\n })\n ),\n },\n {\n description:\n 'Paragraph indentation (w:ind) in twips. Use either hanging or firstLine, not both.',\n additionalProperties: false,\n }\n);\n\nexport const TabStopTypeSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('right'),\n Type.Literal('center'),\n Type.Literal('decimal'),\n Type.Literal('bar'),\n ],\n { description: 'Tab stop alignment type' }\n);\n\nexport const TabStopLeaderSchema = Type.Union(\n [\n Type.Literal('dot'),\n Type.Literal('hyphen'),\n Type.Literal('underscore'),\n Type.Literal('middleDot'),\n Type.Literal('none'),\n ],\n { description: 'Leader character filling the space before the tab stop' }\n);\n\nexport const TabStopSchema = Type.Object(\n {\n type: TabStopTypeSchema,\n position: Type.Number({\n minimum: 0,\n description: 'Tab stop position in twips (1/20 of a point)',\n }),\n leader: Type.Optional(TabStopLeaderSchema),\n },\n {\n description: 'Tab stop definition (w:tab in w:tabs)',\n additionalProperties: false,\n }\n);\n\nexport const TabStopsSchema = Type.Array(TabStopSchema, {\n description:\n 'Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions.',\n});\n\n// ============================================================================\n// Floating Positioning Schemas (shared between image, text-box components)\n// ============================================================================\n\nexport const HorizontalPositionRelativeFromSchema = Type.Union(\n [\n Type.Literal('character'),\n Type.Literal('column'),\n Type.Literal('margin'),\n Type.Literal('page'),\n Type.Literal('text'), // VML compatibility for text-box\n ],\n {\n description: 'Horizontal position relative to',\n }\n);\n\nexport const VerticalPositionRelativeFromSchema = Type.Union(\n [\n Type.Literal('margin'),\n Type.Literal('page'),\n Type.Literal('paragraph'),\n Type.Literal('line'),\n Type.Literal('text'), // VML compatibility for text-box\n ],\n {\n description: 'Vertical position relative to',\n }\n);\n\nexport const HorizontalPositionAlignSchema = Type.Union(\n [\n Type.Literal('left'),\n Type.Literal('center'),\n Type.Literal('right'),\n Type.Literal('inside'),\n Type.Literal('outside'),\n ],\n {\n description: 'Horizontal alignment',\n }\n);\n\nexport const VerticalPositionAlignSchema = Type.Union(\n [\n Type.Literal('top'),\n Type.Literal('center'),\n Type.Literal('bottom'),\n Type.Literal('inside'),\n Type.Literal('outside'),\n ],\n {\n description: 'Vertical alignment',\n }\n);\n\nexport const TextWrappingTypeSchema = Type.Union(\n [\n Type.Literal('none'),\n Type.Literal('square'),\n Type.Literal('topAndBottom'),\n Type.Literal('around'), // VML compatibility for text-box\n Type.Literal('tight'), // VML compatibility for text-box\n Type.Literal('through'), // VML compatibility for text-box\n ],\n {\n description: 'Text wrapping type',\n }\n);\n\nexport const TextWrappingSideSchema = Type.Union(\n [\n Type.Literal('bothSides'),\n Type.Literal('left'),\n Type.Literal('right'),\n Type.Literal('largest'),\n ],\n {\n description: 'Text wrapping side',\n }\n);\n\nexport const FloatingPropertiesSchema = Type.Object(\n {\n horizontalPosition: Type.Optional(\n Type.Object(\n {\n relative: Type.Optional(HorizontalPositionRelativeFromSchema),\n align: Type.Optional(HorizontalPositionAlignSchema),\n offset: Type.Optional(\n Type.Union([\n Type.Number({\n description: 'Horizontal offset in twips (1/20 of a point)',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Horizontal offset as percentage (e.g., \"50%\") relative to page or margin width',\n }),\n ])\n ),\n },\n {\n description:\n 'Horizontal positioning (use either align or offset, not both)',\n additionalProperties: false,\n }\n )\n ),\n verticalPosition: Type.Optional(\n Type.Object(\n {\n relative: Type.Optional(VerticalPositionRelativeFromSchema),\n align: Type.Optional(VerticalPositionAlignSchema),\n offset: Type.Optional(\n Type.Union([\n Type.Number({\n description: 'Vertical offset in twips (1/20 of a point)',\n }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description:\n 'Vertical offset as percentage (e.g., \"50%\") relative to page or margin height',\n }),\n ])\n ),\n },\n {\n description:\n 'Vertical positioning (use either align or offset, not both)',\n additionalProperties: false,\n }\n )\n ),\n wrap: Type.Optional(\n Type.Object(\n {\n type: TextWrappingTypeSchema,\n side: Type.Optional(TextWrappingSideSchema),\n margins: Type.Optional(\n Type.Object(\n {\n top: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Top margin in twips' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Top margin as percentage of page height',\n }),\n ])\n ),\n bottom: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Bottom margin in twips' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Bottom margin as percentage of page height',\n }),\n ])\n ),\n left: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Left margin in twips' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Left margin as percentage of page width',\n }),\n ])\n ),\n right: Type.Optional(\n Type.Union([\n Type.Number({ description: 'Right margin in twips' }),\n Type.String({\n pattern: '^\\\\d+(\\\\.\\\\d+)?%$',\n description: 'Right margin as percentage of page width',\n }),\n ])\n ),\n },\n {\n description: 'Distance from text margins',\n additionalProperties: false,\n }\n )\n ),\n },\n {\n description: 'Text wrapping configuration',\n additionalProperties: false,\n }\n )\n ),\n allowOverlap: Type.Optional(\n Type.Boolean({\n description: 'Allow element to overlap with other elements',\n })\n ),\n behindDocument: Type.Optional(\n Type.Boolean({\n description: 'Place element behind document text',\n })\n ),\n lockAnchor: Type.Optional(\n Type.Boolean({\n description: 'Lock the anchor position',\n })\n ),\n layoutInCell: Type.Optional(\n Type.Boolean({\n description: 'Layout element within table cell',\n })\n ),\n zIndex: Type.Optional(\n Type.Number({\n minimum: 0,\n description: 'Z-order for overlapping elements (must be non-negative)',\n })\n ),\n rotation: Type.Optional(\n Type.Number({\n description: 'Rotation angle in degrees',\n })\n ),\n visibility: Type.Optional(\n Type.Union([Type.Literal('hidden'), Type.Literal('inherit')], {\n description: 'Visibility of the floating element',\n })\n ),\n },\n {\n description: 'Floating element properties',\n additionalProperties: false,\n }\n);\n\nexport type HorizontalPositionRelativeFrom = Static<\n typeof HorizontalPositionRelativeFromSchema\n>;\nexport type VerticalPositionRelativeFrom = Static<\n typeof VerticalPositionRelativeFromSchema\n>;\nexport type HorizontalPositionAlign = Static<\n typeof HorizontalPositionAlignSchema\n>;\nexport type VerticalPositionAlign = Static<typeof VerticalPositionAlignSchema>;\nexport type TextWrappingType = Static<typeof TextWrappingTypeSchema>;\nexport type TextWrappingSide = Static<typeof TextWrappingSideSchema>;\nexport type FloatingProperties = Static<typeof FloatingPropertiesSchema>;\n\nexport const NumberingSchema = Type.Object(\n {\n start: Type.Optional(Type.Number({ minimum: 1 })),\n style: Type.Optional(\n Type.Union([\n Type.Literal('decimal'),\n Type.Literal('lowerLetter'),\n Type.Literal('upperLetter'),\n Type.Literal('lowerRoman'),\n Type.Literal('upperRoman'),\n ])\n ),\n separator: Type.Optional(Type.String()),\n },\n {\n description: 'Numbering configuration for lists',\n additionalProperties: false,\n }\n);\n\n// ============================================================================\n// Base Component Props (common fields across all components)\n// ============================================================================\n// Note: BaseComponentFields is currently empty as common properties\n// (className, style, hidden, condition) are not implemented in the rendering engine.\n// These were removed to accurately reflect actual capabilities.\n\nconst BaseComponentFields = {};\n\n// Export BaseComponentPropsSchema\nexport const BaseComponentPropsSchema = Type.Object(BaseComponentFields, {\n description: 'Base component props',\n additionalProperties: true,\n});\n\n// Export BaseComponentFields for use in component definitions\nexport { BaseComponentFields };\n\n// ============================================================================\n// TypeScript Types\n// ============================================================================\n\nexport type Alignment = Static<typeof AlignmentSchema>;\nexport type JustifiedAlignment = Static<typeof JustifiedAlignmentSchema>;\nexport type HeadingLevel = Static<typeof HeadingLevelSchema>;\nexport type Spacing = Static<typeof SpacingSchema>;\nexport type ListSpacing = Static<typeof ListSpacingSchema>;\nexport type LineSpacing = Static<typeof LineSpacingSchema>;\nexport type Indent = Static<typeof IndentSchema>;\nexport type ParagraphIndent = Static<typeof ParagraphIndentSchema>;\nexport type TabStopType = Static<typeof TabStopTypeSchema>;\nexport type TabStopLeader = Static<typeof TabStopLeaderSchema>;\nexport type TabStop = Static<typeof TabStopSchema>;\nexport type TabStops = Static<typeof TabStopsSchema>;\nexport type Numbering = Static<typeof NumberingSchema>;\nexport type Margins = Static<typeof MarginsSchema>;\nexport type Border = Static<typeof BorderSchema>;\nexport type BaseComponentProps = Static<typeof BaseComponentPropsSchema>;\n"],"mappings":";;;;;AAMA,SAAS,YAAoB;AAOtB,IAAM,kBAAkB,KAAK;AAAA,EAClC,CAAC,KAAK,QAAQ,MAAM,GAAG,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,OAAO,CAAC;A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AAsB;AAAA,EACxB;AACF;AAgBO,IAAM,kBAAkB,KAAK;AAAA,EAClC;AAAA,IACE,OAAO,KAAK,SAAS,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,IAChD,OAAO,KAAK;AAAA,MACV,KAAK,MAAM;AAAA,QACT,KAAK,QAAQ,SAAS;AAAA,QACtB,KAAK,QAAQ,aAAa;AAAA,QAC1B,KAAK,QAAQ,aAAa;AAAA,QAC1B,KAAK,QAAQ,YAAY;AAAA,QACzB,KAAK,QAAQ,YAAY;AAAA,MAC3B,CAAC;AAAA,IACH;AAAA,IACA,WAAW,KAAK,SAAS,KAAK,OAAO,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,IACE,aAAa;AAAA,IACb,sBAAsB;AAAA,EACxB;AACF;AASA,IAAM,sBAAsB,CAAC;AAGtB,IAAM,2BAA2B,KAAK,OAAO,qBAAqB;AAAA,EACvE,aAAa;AAAA,EACb,sBAAsB;AACxB,CAAC;","names":[]}
|
|
@@ -38,14 +38,24 @@ var TextFormattingPropertiesSchema = Type.Object(
|
|
|
38
38
|
lineSpacing: Type.Optional(
|
|
39
39
|
Type.Object(
|
|
40
40
|
{
|
|
41
|
-
type: Type.Union(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
type: Type.Union(
|
|
42
|
+
[
|
|
43
|
+
Type.Literal("single"),
|
|
44
|
+
Type.Literal("atLeast"),
|
|
45
|
+
Type.Literal("exactly"),
|
|
46
|
+
Type.Literal("double"),
|
|
47
|
+
Type.Literal("multiple")
|
|
48
|
+
],
|
|
49
|
+
{
|
|
50
|
+
description: "`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
value: Type.Optional(
|
|
54
|
+
Type.Number({
|
|
55
|
+
minimum: 0,
|
|
56
|
+
description: "Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. Unlike `size` this has no floor \u2014 an empty spacer paragraph legitimately pins a fraction of a point \u2014 so an `exactly` box too small for the text it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE instead."
|
|
57
|
+
})
|
|
58
|
+
)
|
|
49
59
|
},
|
|
50
60
|
{ additionalProperties: false }
|
|
51
61
|
)
|
|
@@ -101,4 +111,4 @@ export {
|
|
|
101
111
|
TextFormattingPropertiesSchema,
|
|
102
112
|
FontDefinitionSchema
|
|
103
113
|
};
|
|
104
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-Y3XKLR27.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/font.ts"],"sourcesContent":["/**\n * Font-related Schemas (shared)\n * Extracted to avoid circular dependencies between theme and component schemas.\n */\n\nimport { Type } from '@sinclair/typebox';\nimport { FontFamilyNameSchema } from '@json-to-office/shared';\n\n// ----------------------------------------------------------------------------\n// Shared Color Schema\n// ----------------------------------------------------------------------------\n\n/** Hex color with # prefix (e.g. \"#000000\") or a theme color name (e.g. \"primary\") */\nexport const HexColorSchema = Type.String({\n pattern: '^(#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$',\n description: 'Hex color with # prefix (e.g. \"#000000\") or theme color name',\n});\n\n/** Like HexColorSchema but also accepts \"transparent\" (used for backgroundColor) */\nexport const HexColorOrTransparentSchema = Type.String({\n pattern: '^(transparent|#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$',\n description: 'Hex color with # prefix, theme color name, or \"transparent\"',\n});\n\n// ----------------------------------------------------------------------------\n// Shared Language / Proofing Schemas\n// ----------------------------------------------------------------------------\n\n/**\n * BCP-47 / IETF language tag used by Word for spell- and grammar-checking\n * (e.g. \"en-US\", \"fr-FR\", \"de-DE\"). Set on the document to change the default\n * proofing language, or on a component to override it for that text only.\n */\nexport const LanguageSchema = Type.String({\n pattern: '^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$',\n description:\n 'BCP-47 language tag for spell/grammar checking (e.g. \"en-US\", \"fr-FR\", \"de-DE\")',\n examples: ['en-US', 'fr-FR', 'de-DE', 'it-IT', 'es-ES'],\n});\n\n/**\n * Disable spell/grammar checking (\"do not proof\") for the text, e.g. code\n * snippets, identifiers, or product names Word would otherwise flag.\n */\nexport const NoProofSchema = Type.Boolean({\n description:\n 'Disable spell/grammar checking for this text (e.g. code snippets or identifiers)',\n});\n\n/**\n * A \"known words\" allowlist: every whole-word, case-insensitive occurrence of\n * these terms is wrapped in a no-proof run so Word never flags them, while the\n * surrounding text is still spell-checked. Acts as a portable, document-embedded\n * stand-in for a custom dictionary (Word's real dictionaries can't be shipped\n * inside a .docx). Set on the document to apply everywhere; a component's list\n * is merged with (added to) the document list.\n */\nexport const NoProofWordsSchema = Type.Array(Type.String({ minLength: 1 }), {\n description:\n 'Words that should never be flagged as misspelled (whole-word, case-insensitive). E.g. brand names or technical terms.',\n examples: [['Wiseair', 'json-to-office', 'pptx']],\n});\n\n// ----------------------------------------------------------------------------\n// Shared Text Formatting Properties\n// ----------------------------------------------------------------------------\n\n/**\n * Shared schema for text formatting properties.\n * Used as base for both font definitions and style definitions.\n */\nexport const TextFormattingPropertiesSchema = Type.Object(\n {\n size: Type.Optional(Type.Number({ minimum: 8, maximum: 120 })),\n color: Type.Optional(HexColorSchema),\n bold: Type.Optional(Type.Boolean()),\n fontWeight: Type.Optional(\n Type.Integer({\n minimum: 100,\n maximum: 900,\n description:\n 'Per-run weight (100–900). Any integer accepted; renderer picks the closest embedded variant via CSS font-matching. `bold: true` is shorthand for `fontWeight: 700`; if both are set, `fontWeight` wins.',\n })\n ),\n italic: Type.Optional(Type.Boolean()),\n underline: Type.Optional(Type.Boolean()),\n lineSpacing: Type.Optional(\n Type.Object(\n {\n type: Type.Union(\n [\n Type.Literal('single'),\n Type.Literal('atLeast'),\n Type.Literal('exactly'),\n Type.Literal('double'),\n Type.Literal('multiple'),\n ],\n {\n description:\n '`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to.',\n }\n ),\n value: Type.Optional(\n Type.Number({\n minimum: 0,\n description:\n 'Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. Unlike `size` this has no floor — an empty spacer paragraph legitimately pins a fraction of a point — so an `exactly` box too small for the text it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE instead.',\n })\n ),\n },\n { additionalProperties: false }\n )\n ),\n spacing: Type.Optional(\n Type.Object(\n {\n before: Type.Optional(Type.Number({ minimum: 0 })),\n after: Type.Optional(Type.Number({ minimum: 0 })),\n },\n { additionalProperties: false }\n )\n ),\n characterSpacing: Type.Optional(\n Type.Object(\n {\n type: Type.Union([\n Type.Literal('condensed'),\n Type.Literal('expanded'),\n ]),\n value: Type.Number(),\n },\n { additionalProperties: false }\n )\n ),\n scale: Type.Optional(\n Type.Number({\n minimum: 1,\n maximum: 600,\n description:\n 'Character width scaling in percent (w:w). 100 is normal; values below compress glyphs, above expand them (e.g. 55, 115).',\n })\n ),\n },\n { additionalProperties: false }\n);\n\n// ----------------------------------------------------------------------------\n// Font Definition Schema\n// ----------------------------------------------------------------------------\n\n/**\n * Font definition schema with full text formatting properties.\n * All properties except 'family' are optional.\n */\nexport const FontDefinitionSchema = Type.Object(\n {\n family: FontFamilyNameSchema,\n ...TextFormattingPropertiesSchema.properties,\n },\n {\n description:\n 'Font definition with family and optional formatting properties',\n additionalProperties: false,\n }\n);\n"],"mappings":";AAKA,SAAS,YAAY;AACrB,SAAS,4BAA4B;AAO9B,IAAM,iBAAiB,KAAK,OAAO;AAAA,EACxC,SAAS;AAAA,EACT,aAAa;AACf,CAAC;AAGM,IAAM,8BAA8B,KAAK,OAAO;AAAA,EACrD,SAAS;AAAA,EACT,aAAa;AACf,CAAC;AAWM,IAAM,iBAAiB,KAAK,OAAO;AAAA,EACx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,SAAS,KAAK;AAAA,MACZ,KAAK;AAAA,QACH;AAAA,UACE,QAAQ,KAAK,SAAS,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,UACjD,OAAO,KAAK,SAAS,KAAK,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,QAClD;AAAA,QACA,EAAE,sBAAsB,MAAM;AAAA,MAChC;AAAA,IACF;AAAA,IACA,kBAAkB,KAAK;AAAA,MACrB,KAAK;AAAA,QACH;AAAA,UACE,MAAM,KAAK,MAAM;AAAA,YACf,KAAK,QAAQ,WAAW;AAAA,YACxB,KAAK,QAAQ,UAAU;AAAA,UACzB,CAAC;AAAA,UACD,OAAO,KAAK,OAAO;AAAA,QACrB;AAAA,QACA,EAAE,sBAAsB,MAAM;AAAA,MAChC;AAAA,IACF;AAAA,IACA,OAAO,KAAK;AAAA,MACV,KAAK,OAAO;AAAA,QACV,SAAS;AAAA,QACT,SAAS;AAAA,QACT,aACE;AAAA,MACJ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EACA,EAAE,sBAAsB,MAAM;AAChC;AAUO,IAAM,uBAAuB,KAAK;AAAA,EACvC;AAAA,IACE,QAAQ;AAAA,IACR,GAAG,+BAA+B;AAAA,EACpC;AAAA,EACA;AAAA,IACE,aACE;AAAA,IACF,sBAAsB;AAAA,EACxB;AACF;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RevisionSegment, ComponentDefinition as ComponentDefinition$1, ComponentDefinitionSchema, ColumnsPropsSchema, ReportPropsSchema, SectionPropsSchema, HeadingPropsSchema, ParagraphPropsSchema, TextBoxPropsSchema, ImagePropsSchema, HighchartsPropsSchema, ChartPropsSchema, VisualPropsSchema, StatisticPropsSchema, TablePropsSchema, ListPropsSchema, TocPropsSchema } from './schemas/components.js';
|
|
2
|
-
export { Alignment, AlignmentSchema, BaseComponentProps, BaseComponentPropsSchema, BorderSchema, ChartProps, ColumnsProps, Comment, CommentReply, CommentReplySchema, CommentSchema, EndnotesSchema, FootnotesSchema, HeadingLevel, HeadingLevelSchema, HeadingProps, HighchartsProps, ImageProps, Indent, IndentSchema, JustifiedAlignment, JustifiedAlignmentSchema, LineSpacing, LineSpacingSchema, ListMarkerFont, ListMarkerFontSchema, ListProps, MarginsSchema, NATIVE_RENDER_MODE, NATIVE_VISUAL_ELEMENT_NAMES, NativeVisualCanvas, NativeVisualCanvasSchema, NativeVisualElement, NativeVisualElementName, NativeVisualElementSchema, NativeVisualFill, NativeVisualImageProps, NativeVisualImagePropsSchema, NativeVisualLine, NativeVisualShapeProps, NativeVisualShapePropsSchema, NativeVisualTextProps, NativeVisualTextPropsSchema, NativeVisualTextRun, NativeVisualTextSegment, Note, NoteSchema, Numbering, NumberingSchema, ParagraphIndent, ParagraphIndentSchema, ParagraphProps, ReportProps, Revision, RevisionMark, RevisionMarkSchema, RevisionSchema, RevisionSegmentSchema, SectionProps, Spacing, SpacingSchema, StandardComponentDefinitionSchema, StatisticProps, TabStop, TabStopLeader, TabStopLeaderSchema, TabStopSchema, TabStopType, TabStopTypeSchema, TabStops, TabStopsSchema, TableProps, TextBoxProps, TocProps, VisualCanvas, VisualCanvasBackgroundSchema, VisualCanvasSchema, VisualNativeProps, VisualNativePropsSchema, VisualProps, VisualRasterProps, VisualRasterPropsSchema, isNativeVisualProps } from './schemas/components.js';
|
|
1
|
+
import { RevisionSegment, ComponentDefinition as ComponentDefinition$1, ComponentDefinitionSchema, ColumnsPropsSchema, ReportPropsSchema, SectionPropsSchema, HeadingPropsSchema, ParagraphPropsSchema, TextBoxPropsSchema, ImagePropsSchema, HighchartsPropsSchema, ChartPropsSchema, VisualPropsSchema, StatisticPropsSchema, TablePropsSchema, ListPropsSchema, TocPropsSchema, RulePropsSchema } from './schemas/components.js';
|
|
2
|
+
export { Alignment, AlignmentSchema, BaseComponentProps, BaseComponentPropsSchema, BorderSchema, ChartProps, ColumnsProps, Comment, CommentReply, CommentReplySchema, CommentSchema, EndnotesSchema, FootnotesSchema, HeadingLevel, HeadingLevelSchema, HeadingProps, HighchartsProps, ImageProps, Indent, IndentSchema, JustifiedAlignment, JustifiedAlignmentSchema, LineSpacing, LineSpacingSchema, ListMarkerFont, ListMarkerFontSchema, ListProps, MarginsSchema, NATIVE_RENDER_MODE, NATIVE_VISUAL_ELEMENT_NAMES, NativeVisualCanvas, NativeVisualCanvasSchema, NativeVisualElement, NativeVisualElementName, NativeVisualElementSchema, NativeVisualFill, NativeVisualImageProps, NativeVisualImagePropsSchema, NativeVisualLine, NativeVisualShapeProps, NativeVisualShapePropsSchema, NativeVisualTextProps, NativeVisualTextPropsSchema, NativeVisualTextRun, NativeVisualTextSegment, Note, NoteSchema, Numbering, NumberingSchema, ParagraphIndent, ParagraphIndentSchema, ParagraphProps, ReportProps, Revision, RevisionMark, RevisionMarkSchema, RevisionSchema, RevisionSegmentSchema, RuleProps, SectionProps, Spacing, SpacingSchema, StandardComponentDefinitionSchema, StatisticProps, TabStop, TabStopLeader, TabStopLeaderSchema, TabStopSchema, TabStopType, TabStopTypeSchema, TabStops, TabStopsSchema, TableProps, TextBoxProps, TocProps, VisualCanvas, VisualCanvasBackgroundSchema, VisualCanvasSchema, VisualNativeProps, VisualNativePropsSchema, VisualProps, VisualRasterProps, VisualRasterPropsSchema, isNativeVisualProps } from './schemas/components.js';
|
|
3
3
|
export { AddWarningFunction, ComponentSchemaConfig, DEFAULT_ERROR_CONFIG, ERROR_EMOJIS, ErrorFormatterConfig, GenerationWarning, ParsedSemver, ComponentDefinition as SharedComponentDefinition, ValidationError, ValidationResult, calculatePosition, clearComponentNamesCache, compareSemver, convertToJsonSchema, createComponentSchema, createErrorConfig, createJsonParseError, exportSchemaToFile, extractStandardComponentNames, fixSchemaReferences, formatErrorMessage, formatErrorSummary, getLiteralValue, getObjectSchemaPropertyNames, getSchemaMetadata, groupErrorsByPath, isLiteralSchema, isObjectSchema, isUnionSchema, isValidSemver, latestVersion, parseSemver, createComponentSchemaObject as sharedCreateComponentSchemaObject, transformValueError, transformValueErrors } from '@json-to-office/shared';
|
|
4
4
|
import { DocumentValidationResult, ValidationError } from './schemas/document.js';
|
|
5
5
|
export { JSON_SCHEMA_URLS, JsonComponentDefinitionSchema } from './schemas/document.js';
|
|
@@ -2296,6 +2296,16 @@ interface TocComponent {
|
|
|
2296
2296
|
enabled?: boolean;
|
|
2297
2297
|
props: Static<typeof TocPropsSchema>;
|
|
2298
2298
|
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Rule component with literal name discriminator
|
|
2301
|
+
*/
|
|
2302
|
+
interface RuleComponent {
|
|
2303
|
+
name: 'rule';
|
|
2304
|
+
id?: string;
|
|
2305
|
+
/** When false, this component is filtered out and not rendered. Defaults to true */
|
|
2306
|
+
enabled?: boolean;
|
|
2307
|
+
props?: Static<typeof RulePropsSchema>;
|
|
2308
|
+
}
|
|
2299
2309
|
/**
|
|
2300
2310
|
* Text Space After component with literal name discriminator
|
|
2301
2311
|
*/
|
|
@@ -2309,12 +2319,12 @@ interface TextSpaceAfterComponent {
|
|
|
2309
2319
|
/**
|
|
2310
2320
|
* Union of all standard component types
|
|
2311
2321
|
*/
|
|
2312
|
-
type StandardComponentDefinition = ReportComponent | SectionComponent | ColumnsComponent | HeadingComponent | ParagraphComponent | TextBoxComponent | ImageComponent | HighchartsComponent | ChartComponent | VisualComponent | StatisticComponent | TableComponent | ListComponent | TocComponent;
|
|
2322
|
+
type StandardComponentDefinition = ReportComponent | SectionComponent | ColumnsComponent | HeadingComponent | ParagraphComponent | TextBoxComponent | ImageComponent | HighchartsComponent | ChartComponent | VisualComponent | StatisticComponent | TableComponent | ListComponent | TocComponent | RuleComponent;
|
|
2313
2323
|
/**
|
|
2314
2324
|
* Array of all standard component names.
|
|
2315
2325
|
* Useful for iterating, validation, or displaying available components to users.
|
|
2316
2326
|
*/
|
|
2317
|
-
declare const STANDARD_COMPONENTS: readonly ["chart", "columns", "heading", "highcharts", "image", "list", "paragraph", "docx", "section", "statistic", "table", "text-box", "toc", "visual"];
|
|
2327
|
+
declare const STANDARD_COMPONENTS: readonly ["chart", "columns", "heading", "highcharts", "image", "list", "paragraph", "docx", "rule", "section", "statistic", "table", "text-box", "toc", "visual"];
|
|
2318
2328
|
/**
|
|
2319
2329
|
* Set of all standard component names for O(1) lookup.
|
|
2320
2330
|
*/
|
|
@@ -2363,4 +2373,4 @@ type ThemeName = 'minimal' | 'verizon' | 'a2a' | 'hitachi';
|
|
|
2363
2373
|
|
|
2364
2374
|
declare const SHARED_DOCX_VERSION = "1.0.0";
|
|
2365
2375
|
|
|
2366
|
-
export { ChartPropsSchema, type ColumnsComponent, ColumnsPropsSchema, type ComponentDefinition, ComponentDefinitionSchema, type CoreValidationResult, type DiffDocumentsOptions, type DiffDocumentsResult, type DiffSegment, type DiffSummary, ValidationError as DocumentValidationError, DocumentValidationResult, DocxRendererId, type FormattedError, type HeadingComponent, HeadingPropsSchema, type HighchartsComponent, HighchartsPropsSchema, type ImageComponent, ImagePropsSchema, JsonDocumentParser, type JsonNode, JsonParsingError, JsonValidationError, type ListComponent, ListPropsSchema, type ParagraphComponent, ParagraphPropsSchema, type ReportComponent, type ReportComponentFor, ReportPropsSchema, RevisionSegment, SHARED_DOCX_VERSION, STANDARD_COMPONENTS, STANDARD_COMPONENTS_SET, type SectionComponent, SectionPropsSchema, type StandardComponentDefinition, type StandardComponentName, type StatisticComponent, StatisticPropsSchema, type TableComponent, TablePropsSchema, type TextBoxComponent, TextBoxPropsSchema, type TextSpaceAfterComponent, TextSpaceAfterPropsSchema, type ThemeName, type TocComponent, TocPropsSchema, type UntrackedChange, type VisualComponent, VisualPropsSchema, createValidatedComponent, diffDocuments, diffWords, formatErrorReport, formatValidationError, formatValidationErrorStrings, formatValidationErrors, getErrorSummary, getValidationContext, getValidationErrors, hasCriticalErrors, isColumnsComponent, isHeadingComponent, isHighchartsComponent, isImageComponent, isListComponent, isParagraphComponent, isReportComponent, isSectionComponent, isStatisticComponent, isTableComponent, isTextBoxComponent, isTextSpaceAfterComponent, isTocComponent, isValidComponent, isVisualComponent, parseJsonComponent, parseJsonWithLineNumbers, safeValidateComponentDefinition, safeValidateComponentProps, stripMarkdown, transformAndValidate, validateComponent, validateComponentDefinition, validateComponents };
|
|
2376
|
+
export { ChartPropsSchema, type ColumnsComponent, ColumnsPropsSchema, type ComponentDefinition, ComponentDefinitionSchema, type CoreValidationResult, type DiffDocumentsOptions, type DiffDocumentsResult, type DiffSegment, type DiffSummary, ValidationError as DocumentValidationError, DocumentValidationResult, DocxRendererId, type FormattedError, type HeadingComponent, HeadingPropsSchema, type HighchartsComponent, HighchartsPropsSchema, type ImageComponent, ImagePropsSchema, JsonDocumentParser, type JsonNode, JsonParsingError, JsonValidationError, type ListComponent, ListPropsSchema, type ParagraphComponent, ParagraphPropsSchema, type ReportComponent, type ReportComponentFor, ReportPropsSchema, RevisionSegment, RulePropsSchema, SHARED_DOCX_VERSION, STANDARD_COMPONENTS, STANDARD_COMPONENTS_SET, type SectionComponent, SectionPropsSchema, type StandardComponentDefinition, type StandardComponentName, type StatisticComponent, StatisticPropsSchema, type TableComponent, TablePropsSchema, type TextBoxComponent, TextBoxPropsSchema, type TextSpaceAfterComponent, TextSpaceAfterPropsSchema, type ThemeName, type TocComponent, TocPropsSchema, type UntrackedChange, type VisualComponent, VisualPropsSchema, createValidatedComponent, diffDocuments, diffWords, formatErrorReport, formatValidationError, formatValidationErrorStrings, formatValidationErrors, getErrorSummary, getValidationContext, getValidationErrors, hasCriticalErrors, isColumnsComponent, isHeadingComponent, isHighchartsComponent, isImageComponent, isListComponent, isParagraphComponent, isReportComponent, isSectionComponent, isStatisticComponent, isTableComponent, isTextBoxComponent, isTextSpaceAfterComponent, isTocComponent, isValidComponent, isVisualComponent, parseJsonComponent, parseJsonWithLineNumbers, safeValidateComponentDefinition, safeValidateComponentProps, stripMarkdown, transformAndValidate, validateComponent, validateComponentDefinition, validateComponents };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateUnifiedDocumentSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q6RCIVH5.js";
|
|
4
4
|
import {
|
|
5
5
|
ERROR_TEMPLATES,
|
|
6
6
|
componentValidator,
|
|
@@ -31,17 +31,17 @@ import {
|
|
|
31
31
|
validateTheme,
|
|
32
32
|
validateThemeJson,
|
|
33
33
|
validateThemeWithEnhancement
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-3ELXAZC3.js";
|
|
35
35
|
import {
|
|
36
36
|
GenerateDocumentRequestSchema,
|
|
37
37
|
GenerateDocumentResponseSchema,
|
|
38
38
|
ValidateDocumentRequestSchema,
|
|
39
39
|
ValidateDocumentResponseSchema
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-UDP63RKH.js";
|
|
41
41
|
import {
|
|
42
42
|
JSON_SCHEMA_URLS,
|
|
43
43
|
JsonComponentDefinitionSchema
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-KEIKGZ7S.js";
|
|
45
45
|
import {
|
|
46
46
|
collectIndentConflicts,
|
|
47
47
|
collectNoteRevisionConflicts,
|
|
@@ -66,11 +66,11 @@ import {
|
|
|
66
66
|
validateJsonComponent,
|
|
67
67
|
validateJsonDocument,
|
|
68
68
|
validateWithEnhancement
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-S7CHEAUQ.js";
|
|
70
70
|
import {
|
|
71
71
|
ComponentDefinitionSchema,
|
|
72
72
|
StandardComponentDefinitionSchema
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-M2GYRM4P.js";
|
|
74
74
|
import {
|
|
75
75
|
CustomComponentDefinitionSchema,
|
|
76
76
|
TextSpaceAfterComponentSchema,
|
|
@@ -84,17 +84,18 @@ import {
|
|
|
84
84
|
createComponentSchema,
|
|
85
85
|
exportSchemaToFile,
|
|
86
86
|
fixSchemaReferences
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-7ACKXJZL.js";
|
|
88
88
|
import {
|
|
89
89
|
ChartPropsSchema,
|
|
90
90
|
HighchartsPropsSchema,
|
|
91
91
|
ReportPropsSchema,
|
|
92
|
+
RulePropsSchema,
|
|
92
93
|
STANDARD_COMPONENTS_REGISTRY,
|
|
93
94
|
TextBoxPropsSchema,
|
|
94
95
|
TocPropsSchema,
|
|
95
96
|
getAllStandardComponentNames,
|
|
96
97
|
getStandardComponent
|
|
97
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-64CLASFN.js";
|
|
98
99
|
import {
|
|
99
100
|
DEFAULT_DOCX_RENDERER_ID,
|
|
100
101
|
DOCX_RENDERER_IDS,
|
|
@@ -113,12 +114,12 @@ import {
|
|
|
113
114
|
collectDocxRendererErrors,
|
|
114
115
|
docxComponentDefinitionName,
|
|
115
116
|
isNativeVisualProps
|
|
116
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-JW5NOPVQ.js";
|
|
117
118
|
import {
|
|
118
119
|
ThemeConfigSchema,
|
|
119
120
|
createMinimalTheme,
|
|
120
121
|
isValidThemeConfig
|
|
121
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-N6CCWDPF.js";
|
|
122
123
|
import {
|
|
123
124
|
ColumnsPropsSchema,
|
|
124
125
|
CommentReplySchema,
|
|
@@ -137,7 +138,7 @@ import {
|
|
|
137
138
|
SectionPropsSchema,
|
|
138
139
|
StatisticPropsSchema,
|
|
139
140
|
TablePropsSchema
|
|
140
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-P43S7QYT.js";
|
|
141
142
|
import {
|
|
142
143
|
AlignmentSchema,
|
|
143
144
|
BaseComponentPropsSchema,
|
|
@@ -154,8 +155,8 @@ import {
|
|
|
154
155
|
TabStopSchema,
|
|
155
156
|
TabStopTypeSchema,
|
|
156
157
|
TabStopsSchema
|
|
157
|
-
} from "./chunk-
|
|
158
|
-
import "./chunk-
|
|
158
|
+
} from "./chunk-V3YRROBV.js";
|
|
159
|
+
import "./chunk-Y3XKLR27.js";
|
|
159
160
|
|
|
160
161
|
// src/diff/word-diff.ts
|
|
161
162
|
var MAX_LCS_CELLS = 1e6;
|
|
@@ -1873,6 +1874,7 @@ var STANDARD_COMPONENTS = [
|
|
|
1873
1874
|
"list",
|
|
1874
1875
|
"paragraph",
|
|
1875
1876
|
"docx",
|
|
1877
|
+
"rule",
|
|
1876
1878
|
"section",
|
|
1877
1879
|
"statistic",
|
|
1878
1880
|
"table",
|
|
@@ -1977,6 +1979,7 @@ export {
|
|
|
1977
1979
|
RevisionMarkSchema,
|
|
1978
1980
|
RevisionSchema,
|
|
1979
1981
|
RevisionSegmentSchema,
|
|
1982
|
+
RulePropsSchema,
|
|
1980
1983
|
SHARED_DOCX_VERSION,
|
|
1981
1984
|
STANDARD_COMPONENTS,
|
|
1982
1985
|
STANDARD_COMPONENTS_REGISTRY,
|