@json-to-office/shared-docx 1.7.0 → 1.10.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-2HFXG2VP.js} +6 -6
- package/dist/{chunk-Y6FW7T32.js → chunk-6A25WCKU.js} +4 -4
- package/dist/{chunk-ZF3JUN3R.js → chunk-B7QVLWCF.js} +3 -3
- package/dist/{chunk-TVMTDS57.js → chunk-CEEW7MC6.js} +2 -2
- package/dist/{chunk-KGQAQE4S.js → chunk-JW5NOPVQ.js} +2 -2
- 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-KLINZKYA.js → chunk-R4N6E4JK.js} +2 -2
- package/dist/{chunk-ZKBTTJN6.js → chunk-V3YRROBV.js} +20 -10
- package/dist/chunk-V3YRROBV.js.map +1 -0
- package/dist/{chunk-4LLFZ5OY.js → chunk-XKTKIG57.js} +2 -2
- package/dist/{chunk-7TTAAYQ5.js → chunk-Y3XKLR27.js} +19 -9
- package/dist/chunk-Y3XKLR27.js.map +1 -0
- package/dist/{chunk-DQ3DTWOC.js → chunk-YFP757D6.js} +2 -2
- package/dist/chunk-YFP757D6.js.map +1 -0
- package/dist/{chunk-OYSBFM6W.js → chunk-YJMOIHYP.js} +166 -98
- package/dist/chunk-YJMOIHYP.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-2HFXG2VP.js.map} +0 -0
- /package/dist/{chunk-Y6FW7T32.js.map → chunk-6A25WCKU.js.map} +0 -0
- /package/dist/{chunk-ZF3JUN3R.js.map → chunk-B7QVLWCF.js.map} +0 -0
- /package/dist/{chunk-TVMTDS57.js.map → chunk-CEEW7MC6.js.map} +0 -0
- /package/dist/{chunk-KGQAQE4S.js.map → chunk-JW5NOPVQ.js.map} +0 -0
- /package/dist/{chunk-5SMBRJIZ.js.map → chunk-N6CCWDPF.js.map} +0 -0
- /package/dist/{chunk-KLINZKYA.js.map → chunk-R4N6E4JK.js.map} +0 -0
- /package/dist/{chunk-4LLFZ5OY.js.map → chunk-XKTKIG57.js.map} +0 -0
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, DividerPropsSchema } from './schemas/components.js';
|
|
2
|
+
export { Alignment, AlignmentSchema, BaseComponentProps, BaseComponentPropsSchema, BorderSchema, ChartProps, ColumnsProps, Comment, CommentReply, CommentReplySchema, CommentSchema, DividerProps, 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';
|
|
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
|
+
* Divider component with literal name discriminator
|
|
2301
|
+
*/
|
|
2302
|
+
interface DividerComponent {
|
|
2303
|
+
name: 'divider';
|
|
2304
|
+
id?: string;
|
|
2305
|
+
/** When false, this component is filtered out and not rendered. Defaults to true */
|
|
2306
|
+
enabled?: boolean;
|
|
2307
|
+
props?: Static<typeof DividerPropsSchema>;
|
|
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 | DividerComponent;
|
|
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", "divider", "heading", "highcharts", "image", "list", "paragraph", "docx", "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, DividerPropsSchema, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateUnifiedDocumentSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-B7QVLWCF.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-2HFXG2VP.js";
|
|
35
35
|
import {
|
|
36
36
|
GenerateDocumentRequestSchema,
|
|
37
37
|
GenerateDocumentResponseSchema,
|
|
38
38
|
ValidateDocumentRequestSchema,
|
|
39
39
|
ValidateDocumentResponseSchema
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-CEEW7MC6.js";
|
|
41
41
|
import {
|
|
42
42
|
JSON_SCHEMA_URLS,
|
|
43
43
|
JsonComponentDefinitionSchema
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-R4N6E4JK.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-6A25WCKU.js";
|
|
70
70
|
import {
|
|
71
71
|
ComponentDefinitionSchema,
|
|
72
72
|
StandardComponentDefinitionSchema
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-YFP757D6.js";
|
|
74
74
|
import {
|
|
75
75
|
CustomComponentDefinitionSchema,
|
|
76
76
|
TextSpaceAfterComponentSchema,
|
|
@@ -84,9 +84,10 @@ import {
|
|
|
84
84
|
createComponentSchema,
|
|
85
85
|
exportSchemaToFile,
|
|
86
86
|
fixSchemaReferences
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-XKTKIG57.js";
|
|
88
88
|
import {
|
|
89
89
|
ChartPropsSchema,
|
|
90
|
+
DividerPropsSchema,
|
|
90
91
|
HighchartsPropsSchema,
|
|
91
92
|
ReportPropsSchema,
|
|
92
93
|
STANDARD_COMPONENTS_REGISTRY,
|
|
@@ -94,7 +95,7 @@ import {
|
|
|
94
95
|
TocPropsSchema,
|
|
95
96
|
getAllStandardComponentNames,
|
|
96
97
|
getStandardComponent
|
|
97
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-YJMOIHYP.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;
|
|
@@ -1867,6 +1868,7 @@ function isValidComponent(name, props) {
|
|
|
1867
1868
|
var STANDARD_COMPONENTS = [
|
|
1868
1869
|
"chart",
|
|
1869
1870
|
"columns",
|
|
1871
|
+
"divider",
|
|
1870
1872
|
"heading",
|
|
1871
1873
|
"highcharts",
|
|
1872
1874
|
"image",
|
|
@@ -1941,6 +1943,7 @@ export {
|
|
|
1941
1943
|
DEFAULT_DOCX_RENDERER_ID,
|
|
1942
1944
|
DEFAULT_ERROR_CONFIG,
|
|
1943
1945
|
DOCX_RENDERER_IDS,
|
|
1946
|
+
DividerPropsSchema,
|
|
1944
1947
|
ERROR_EMOJIS,
|
|
1945
1948
|
ERROR_TEMPLATES,
|
|
1946
1949
|
EndnotesSchema,
|