@json-to-office/core-pptx 0.20.0 → 0.22.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/components/chart.d.ts.map +1 -1
- package/dist/components/highcharts.d.ts.map +1 -1
- package/dist/components/image.d.ts +2 -5
- package/dist/components/image.d.ts.map +1 -1
- package/dist/components/text.d.ts +2 -5
- package/dist/components/text.d.ts.map +1 -1
- package/dist/core/generator.d.ts +17 -3
- package/dist/core/generator.d.ts.map +1 -1
- package/dist/core/packagePresentation.d.ts +17 -0
- package/dist/core/packagePresentation.d.ts.map +1 -0
- package/dist/core/structure.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +424 -114
- package/dist/index.js.map +1 -1
- package/dist/plugin/createPresentationGenerator.d.ts +5 -2
- package/dist/plugin/createPresentationGenerator.d.ts.map +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +15 -3
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/validation.d.ts +9 -6
- package/dist/plugin/validation.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/color.d.ts +16 -4
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/hyperlink.d.ts +40 -0
- package/dist/utils/hyperlink.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { PptxThemeConfig } from '../types';
|
|
2
|
-
import type { PresentationGeneratorBuilder } from './types';
|
|
2
|
+
import type { PresentationGeneratorBuilder, GenerationValidationOptions } from './types';
|
|
3
3
|
import type { ServicesConfig, FontRuntimeOpts } from '@json-to-office/shared';
|
|
4
|
+
import { type PresentationPackagingOptions } from '../core/packagePresentation';
|
|
4
5
|
/**
|
|
5
6
|
* Options for creating a presentation generator
|
|
6
7
|
*/
|
|
7
|
-
export interface PresentationGeneratorOptions {
|
|
8
|
+
export interface PresentationGeneratorOptions extends PresentationPackagingOptions {
|
|
8
9
|
/** Theme configuration or theme name */
|
|
9
10
|
theme?: PptxThemeConfig | string;
|
|
10
11
|
/** Custom themes map */
|
|
@@ -15,6 +16,8 @@ export interface PresentationGeneratorOptions {
|
|
|
15
16
|
services?: ServicesConfig;
|
|
16
17
|
/** Font resolution options — extraEntries, Google Fonts config, onResolved hook. */
|
|
17
18
|
fonts?: FontRuntimeOpts;
|
|
19
|
+
/** Default validation behavior; per-call options take precedence. */
|
|
20
|
+
validation?: GenerationValidationOptions;
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* Create a presentation generator with chainable component registration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPresentationGenerator.d.ts","sourceRoot":"","sources":["../../src/plugin/createPresentationGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createPresentationGenerator.d.ts","sourceRoot":"","sources":["../../src/plugin/createPresentationGenerator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAIV,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAEV,4BAA4B,EAK5B,2BAA2B,EAE5B,MAAM,SAAS,CAAC;AAMjB,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG9E,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,4BACf,SAAQ,4BAA4B;IACpC,wCAAwC;IACxC,KAAK,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACjC,wBAAwB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC/C,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,oFAAoF;IACpF,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,qEAAqE;IACrE,UAAU,CAAC,EAAE,2BAA2B,CAAC;CAC1C;AA0iBD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,4BAAiC,GACzC,4BAA4B,CAAC,SAAS,EAAE,CAAC,CAiB3C"}
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*/
|
|
26
26
|
export { createComponent, createVersion, type CustomComponent, type ComponentVersion, type ComponentVersionMap, type RenderFunction, type RenderContext, } from '@json-to-office/shared/plugin';
|
|
27
27
|
export { createPresentationGenerator, type PresentationGeneratorOptions, } from './createPresentationGenerator';
|
|
28
|
-
export { type PresentationGenerator, type PresentationGeneratorBuilder, type BufferGenerationResult, type FileGenerationResult, type ValidationResult, type ExtractCustomComponentType, type CustomComponentUnion, type ExtendedPptxComponentInput, type ExtendedPresentationComponent, type InferBuilderComponents, type InferDocumentType, type InferComponentDefinition, } from './types';
|
|
28
|
+
export { type PresentationGenerator, type PresentationGeneratorBuilder, type BufferGenerationResult, type FileGenerationResult, type GenerateFileOptions, type GenerateOptions, type GenerationValidationOptions, type ValidationResult, type ExtractCustomComponentType, type CustomComponentUnion, type ExtendedPptxComponentInput, type ExtendedPresentationComponent, type InferBuilderComponents, type InferDocumentType, type InferComponentDefinition, } from './types';
|
|
29
29
|
export { validateComponentProps, validatePresentation, cleanComponentProps, ComponentValidationError, DuplicateComponentError, type ValidationError, type ComponentValidationResult, } from './validation';
|
|
30
30
|
export { generatePluginPresentationSchema, exportPluginSchema } from './schema';
|
|
31
31
|
export { resolveComponentVersion } from '@json-to-office/shared/plugin';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EACL,eAAe,EACf,aAAa,EACb,KAAK,eAAe,EAC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AA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,GAC9B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,yBAAyB,GAC/B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,gCAAgC,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGhF,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import type { Static, TSchema } from '@sinclair/typebox';
|
|
6
6
|
import type { CustomComponent } from '@json-to-office/shared/plugin';
|
|
7
7
|
import type { PptxComponentInput, PresentationComponentDefinition, SlideComponentDefinition, PipelineWarning } from '../types';
|
|
8
|
+
import type { PresentationPackagingOptions } from '../core/packagePresentation';
|
|
8
9
|
type InferVersionMap<T> = T extends CustomComponent<any, infer V, any> ? V : never;
|
|
9
10
|
type InferName<T> = T extends CustomComponent<any, any, infer N> ? N : never;
|
|
10
11
|
/**
|
|
@@ -79,13 +80,24 @@ export interface ValidationResult {
|
|
|
79
80
|
message: string;
|
|
80
81
|
}>;
|
|
81
82
|
}
|
|
83
|
+
/** Validation behavior shared by all plugin generation entry points. */
|
|
84
|
+
export interface GenerationValidationOptions {
|
|
85
|
+
/** Validate authored and expanded trees before rendering. Defaults to true. */
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
/** Accept unknown props while preserving required-field/type checks. */
|
|
88
|
+
allowUnknownFields?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface GenerateOptions extends PresentationPackagingOptions {
|
|
91
|
+
validation?: GenerationValidationOptions;
|
|
92
|
+
}
|
|
93
|
+
export type GenerateFileOptions = GenerateOptions;
|
|
82
94
|
/**
|
|
83
95
|
* Presentation generator with custom components and full type safety
|
|
84
96
|
*/
|
|
85
97
|
export interface PresentationGenerator<TCustomComponents extends readonly CustomComponent<any, any, any>[] = readonly []> {
|
|
86
|
-
generate: (document: ExtendedPresentationComponent<TCustomComponents
|
|
87
|
-
generateBuffer: (document: ExtendedPresentationComponent<TCustomComponents
|
|
88
|
-
generateFile: (document: ExtendedPresentationComponent<TCustomComponents>, outputPath: string) => Promise<FileGenerationResult>;
|
|
98
|
+
generate: (document: ExtendedPresentationComponent<TCustomComponents>, options?: GenerateOptions) => Promise<BufferGenerationResult>;
|
|
99
|
+
generateBuffer: (document: ExtendedPresentationComponent<TCustomComponents>, options?: GenerateOptions) => Promise<BufferGenerationResult>;
|
|
100
|
+
generateFile: (document: ExtendedPresentationComponent<TCustomComponents>, outputPath: string, options?: GenerateFileOptions) => Promise<FileGenerationResult>;
|
|
89
101
|
getComponentNames: () => string[];
|
|
90
102
|
validate: (document: ExtendedPresentationComponent<TCustomComponents>) => ValidationResult;
|
|
91
103
|
generateSchema: () => TSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EACV,kBAAkB,EAClB,+BAA+B,EAC/B,wBAAwB,EACxB,eAAe,EAChB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAA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IAC7B,CAAC,SAAS,4BAA4B,CAAC,MAAM,CAAC,CAAC,GAC3C,6BAA6B,CAAC,CAAC,CAAC,GAChC,KAAK,CAAC;AAEZ,MAAM,MAAM,wBAAwB,CAAC,CAAC,IACpC,CAAC,SAAS,4BAA4B,CAAC,MAAM,CAAC,CAAC,GAC3C,0BAA0B,CAAC,CAAC,CAAC,GAC7B,CAAC,SAAS,qBAAqB,CAAC,MAAM,CAAC,CAAC,GACtC,0BAA0B,CAAC,CAAC,CAAC,GAC7B,KAAK,CAAC"}
|
|
@@ -11,16 +11,19 @@ export type { ValidationError } from '@json-to-office/shared';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function validateComponentProps<TPropsSchema extends TSchema>(schema: {
|
|
13
13
|
propsSchema: TPropsSchema;
|
|
14
|
-
}, props: unknown, componentName?: string
|
|
14
|
+
}, props: unknown, componentName?: string, opts?: {
|
|
15
|
+
clean?: boolean;
|
|
16
|
+
applyDefaults?: boolean;
|
|
17
|
+
}): ComponentValidationResult<TPropsSchema>;
|
|
15
18
|
/**
|
|
16
19
|
* Validate presentation and all custom components (version-aware).
|
|
17
20
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* (`path`/`base64`/`svg`) — matching core-docx behavior so a multi-source payload
|
|
21
|
-
* is a hard error rather than being silently resolved by runtime precedence.
|
|
21
|
+
* Standard nodes and tree structure are checked by the shared deep validator;
|
|
22
|
+
* custom component props are then checked against their resolved version.
|
|
22
23
|
*/
|
|
23
|
-
export declare function validatePresentation(document: PresentationComponentDefinition, customComponents: CustomComponent<any, any, any>[]
|
|
24
|
+
export declare function validatePresentation(document: PresentationComponentDefinition, customComponents: CustomComponent<any, any, any>[], options?: {
|
|
25
|
+
allowUnknownFields?: boolean;
|
|
26
|
+
}): {
|
|
24
27
|
valid: boolean;
|
|
25
28
|
errors: ValidationError[];
|
|
26
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/plugin/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,SAAS,OAAO,EACjE,MAAM,EAAE;IAAE,WAAW,EAAE,YAAY,CAAA;CAAE,EACrC,KAAK,EAAE,OAAO,EACd,aAAa,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/plugin/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D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