@json-to-office/core-pptx 1.4.0 → 1.7.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/core/generateFromIr.d.ts.map +1 -1
- package/dist/core/generationOptions.d.ts +4 -0
- package/dist/core/generationOptions.d.ts.map +1 -1
- package/dist/core/grid.d.ts.map +1 -1
- package/dist/core/placeholders.d.ts +21 -0
- package/dist/core/placeholders.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1253 -315
- package/dist/index.js.map +1 -1
- package/dist/ir/compiler.d.ts.map +1 -1
- package/dist/quality/facts.d.ts +59 -0
- package/dist/quality/facts.d.ts.map +1 -0
- package/dist/quality/preflight.d.ts +15 -0
- package/dist/quality/preflight.d.ts.map +1 -0
- package/dist/quality/rules.d.ts +41 -0
- package/dist/quality/rules.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/ir/compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/ir/compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,KAAK,EACV,eAAe,EAGf,qBAAqB,EAKtB,MAAM,UAAU,CAAC;AAWlB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAM9C,OAAO,EAGL,KAAK,MAAM,EA+BZ,MAAM,SAAS,CAAC;AAWjB,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,QAAQ,EAAE,SAAS,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;IACrD,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B;;;;OAIG;IACH,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACrC;AAwBD,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,qBAAqB,EAChC,QAAQ,GAAE,eAAe,EAAO,GAC/B,iBAAiB,CAoDnB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { PreparedDocument, QualityFact } from '@json-to-office/quality';
|
|
2
|
+
import type { FontRuntimeOpts, ServicesConfig } from '@json-to-office/shared';
|
|
3
|
+
import type { PipelineWarning, PptxThemeConfig, PresentationComponentDefinition, ProcessedPresentation } from '../types';
|
|
4
|
+
export interface PptxCanvasFact extends QualityFact {
|
|
5
|
+
kind: 'pptx/canvas';
|
|
6
|
+
widthIn?: number;
|
|
7
|
+
heightIn?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface PptxTextFact extends QualityFact {
|
|
10
|
+
kind: 'pptx/text';
|
|
11
|
+
slidePath: string;
|
|
12
|
+
text: string;
|
|
13
|
+
fontSizePt: number;
|
|
14
|
+
lineSpacingPt: number;
|
|
15
|
+
paraSpaceBeforePt: number;
|
|
16
|
+
paraSpaceAfterPt: number;
|
|
17
|
+
styleName?: string;
|
|
18
|
+
boxXPt?: number;
|
|
19
|
+
boxYPt?: number;
|
|
20
|
+
boxWidthPt?: number;
|
|
21
|
+
boxHeightPt?: number;
|
|
22
|
+
verticalAlign: 'top' | 'middle' | 'bottom';
|
|
23
|
+
rotationDeg: number;
|
|
24
|
+
/**
|
|
25
|
+
* True when neither `h` nor a grid supplies a height. The compiler resolves
|
|
26
|
+
* grid positions before checking `props.h`, so grid height is a hard ceiling.
|
|
27
|
+
*/
|
|
28
|
+
autoFit: boolean;
|
|
29
|
+
/** Effective bold, from the run or its named style. */
|
|
30
|
+
bold: boolean;
|
|
31
|
+
/** Resolved run colour, bare hex, when the document states one. */
|
|
32
|
+
colorHex?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Every colour the surface behind this text can paint, bare hex. A gradient
|
|
35
|
+
* contributes each stop: text has to stay legible over all of them, and the
|
|
36
|
+
* worst stop is the one a reader notices.
|
|
37
|
+
*/
|
|
38
|
+
backgroundHexes?: readonly string[];
|
|
39
|
+
}
|
|
40
|
+
export interface PptxSlideFact extends QualityFact {
|
|
41
|
+
kind: 'pptx/slide';
|
|
42
|
+
bodyWords: number;
|
|
43
|
+
}
|
|
44
|
+
export type PptxQualityFact = PptxCanvasFact | PptxTextFact | PptxSlideFact;
|
|
45
|
+
export interface PptxQualityModel {
|
|
46
|
+
authored: PresentationComponentDefinition;
|
|
47
|
+
document: PresentationComponentDefinition;
|
|
48
|
+
theme: PptxThemeConfig;
|
|
49
|
+
processed: ProcessedPresentation;
|
|
50
|
+
}
|
|
51
|
+
export interface PreparePptxQualityOptions {
|
|
52
|
+
customThemes?: Record<string, PptxThemeConfig>;
|
|
53
|
+
fonts?: FontRuntimeOpts;
|
|
54
|
+
services?: ServicesConfig;
|
|
55
|
+
warnings?: PipelineWarning[];
|
|
56
|
+
renderer?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare function preparePptxQualityDocument(document: PresentationComponentDefinition, options?: PreparePptxQualityOptions): PreparedDocument<PptxQualityModel, PptxQualityFact>;
|
|
59
|
+
//# sourceMappingURL=facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facts.d.ts","sourceRoot":"","sources":["../../src/quality/facts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE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AAQ,EAAE,+BAA+B,CAAC;IAC1C,KAAK,EAAE,eAAe,CAAC;IACvB,SAAS,EAAE,qBAAqB,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC/C,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsjBD,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,+BAA+B,EACzC,OAAO,GAAE,yBAA8B,GACtC,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAyIrD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** PPTX quality analysis over renderer-aligned prepared facts. */
|
|
2
|
+
import { type PreparedDocument, type QualityAnalysis, type QualityPolicy, type QualityProfile } from '@json-to-office/quality';
|
|
3
|
+
import type { PptxThemeConfig } from '../types';
|
|
4
|
+
import type { PptxQualityFact, PptxQualityModel } from './facts';
|
|
5
|
+
export interface PptxQualityOptions {
|
|
6
|
+
customThemes?: Record<string, PptxThemeConfig>;
|
|
7
|
+
}
|
|
8
|
+
export interface PptxQualityAnalysisOptions extends PptxQualityOptions {
|
|
9
|
+
renderer?: string;
|
|
10
|
+
profile?: QualityProfile;
|
|
11
|
+
policy?: QualityPolicy;
|
|
12
|
+
prepared?: PreparedDocument<PptxQualityModel, PptxQualityFact>;
|
|
13
|
+
}
|
|
14
|
+
export declare function analyzePptxQuality(doc: unknown, options?: PptxQualityAnalysisOptions): QualityAnalysis;
|
|
15
|
+
//# sourceMappingURL=preflight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/quality/preflight.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAUjE,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;CAChE;AAiBD,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,OAAO,GAAE,0BAA+B,GACvC,eAAe,CA2CjB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { QualityEngine, type QualityProfile, type QualityRule, type QualityRulePack } from '@json-to-office/quality';
|
|
2
|
+
import type { PptxQualityFact, PptxQualityModel } from './facts';
|
|
3
|
+
export declare const pptxCanvasRule: QualityRule<PptxQualityModel, PptxQualityFact>;
|
|
4
|
+
export declare const pptxMinimumFontRule: QualityRule<PptxQualityModel, PptxQualityFact>;
|
|
5
|
+
export declare const pptxTextFitRule: QualityRule<PptxQualityModel, PptxQualityFact>;
|
|
6
|
+
export declare const pptxSlideDensityRule: QualityRule<PptxQualityModel, PptxQualityFact>;
|
|
7
|
+
export declare const pptxTextContrastRule: QualityRule<PptxQualityModel, PptxQualityFact>;
|
|
8
|
+
export declare const PPTX_QUALITY_RULES: QualityRulePack<PptxQualityModel, PptxQualityFact>;
|
|
9
|
+
export declare const PPTX_QUALITY_PROFILES: {
|
|
10
|
+
readonly 'executive-presentation': {
|
|
11
|
+
readonly id: "executive-presentation";
|
|
12
|
+
readonly formats: readonly ["pptx"];
|
|
13
|
+
readonly description: "Decision deck optimized for scan speed and projection.";
|
|
14
|
+
readonly rules: {
|
|
15
|
+
readonly 'pptx/minimum-font-size': {
|
|
16
|
+
readonly parameters: {
|
|
17
|
+
readonly minimumFontPt: 14;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly 'pptx/slide-density': {
|
|
21
|
+
readonly parameters: {
|
|
22
|
+
readonly maximumBodyWords: 70;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
readonly 'technical-presentation': {
|
|
28
|
+
readonly id: "technical-presentation";
|
|
29
|
+
readonly formats: readonly ["pptx"];
|
|
30
|
+
readonly description: "Portable professional presentation defaults.";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare const PPTX_DEFAULT_QUALITY_PROFILE: QualityProfile;
|
|
34
|
+
/**
|
|
35
|
+
* Callers name a shipped profile by id — `{ id: 'executive-presentation', formats: ['pptx'] }`.
|
|
36
|
+
* Without this lookup that request reaches the engine carrying nothing but its id,
|
|
37
|
+
* so the analysis runs on defaults while stamping the requested profileId.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolvePptxQualityProfile(requested: QualityProfile | undefined): QualityProfile | undefined;
|
|
40
|
+
export declare const pptxQualityEngine: QualityEngine<PptxQualityModel, PptxQualityFact>;
|
|
41
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/quality/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EAEb,KAAK,cAAc,EACnB,KAAK,WAAW,EAEhB,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAEV,eAAe,EACf,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AA8EjB,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,gBAAgB,EAAE,eAAe,CA2EzE,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAC3C,gBAAgB,EAChB,eAAe,CAkChB,CAAC;AAsCF,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,gBAAgB,EAAE,eAAe,CAgG1E,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAC5C,gBAAgB,EAChB,eAAe,CA8BhB,CAAC;AAqCF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAC5C,gBAAgB,EAChB,eAAe,CAiFhB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,gBAAgB,EAChB,eAAe,CAUhB,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;CAeiB,CAAC;AAEpD,eAAO,MAAM,4BAA4B,EAAE,cACM,CAAC;AAKlD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,cAAc,GAAG,SAAS,GACpC,cAAc,GAAG,SAAS,CAK5B;AAED,eAAO,MAAM,iBAAiB,kDAA8C,CAAC"}
|