deckjsx 0.7.0 → 0.8.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/index.d.mts CHANGED
@@ -1,35 +1,64 @@
1
- import { $t as ViewStyle, A as ThemeDefaults, At as CssPosition, Bt as Spacing, C as SlideFactoryInput, Ct as CssGridTemplateAreas, D as SourceContextMapper, Dt as CssJustifySelf, E as SourceContextInput, Et as CssJustifyContent, Ft as ImageCropValue, Gt as StrokeLineJoin, Ht as StackAxis, It as ImageStyle, Jt as TextStyle, Kt as TextFit, L as SemanticAuthorGraph, Lt as LayoutMode, Mt as DeckLength, Nt as DeckPointLength, O as Theme, Ot as CssObjectPosition, Pt as ImageCropAuthoring, Qt as VerticalAlign, Rt as ShapeStyle, S as SlideFactory, St as CssGridTemplate, T as SlideOptions, Tt as CssGridTrack, Ut as StrokeDashType, Vt as StackAlignment, Wt as StrokeLineCap, Xt as TextTabStopAuthoring, Yt as TextTabStopAlignment, Zt as TextTabStopLength, _ as ViewProps, _t as CssFlexWrap, a as DeckJsxIntrinsicElements, an as formatDiagnostics, at as TemplateFrame, b as CompositionSource, bt as CssGridPlacement, c as IntrinsicDivProps, cn as SemanticGraphDiagnosticError, ct as BorderStyle, d as IntrinsicTextTag, dt as CssAlignSelf, en as Diagnostic, et as EmptySlideTemplateSet, f as IntrinsicViewTag, ft as CssAspectRatio, g as TextRunNodeProps, gt as CssFlexDirection, h as TextProps, ht as CssFlexBasis, i as ContentJsxChild, in as formatDiagnostic, it as TemplateAreaRef, j as StyleSheet, jt as CssVisibility, k as ThemeInput, kt as CssOverflow, l as IntrinsicImgProps, ln as StyleDiagnosticError, lt as CssAlignContent, m as TextJsxChild, mn as SourceSpan, mt as CssDisplay, n as ClassNameValue, nn as DiagnosticSeverity, nt as SlideTemplateSet, o as DeckOptions, on as CompositionDiagnosticError, ot as TemplateHandle, p as ShapeProps, pn as JsxKey, pt as CssBoxSizing, qt as TextRunStyle, r as ClassNameValueArray, rn as Diagnostics, rt as TemplateArea, s as ImageProps, sn as DeckDiagnosticError, st as TemplateName, t as ClassNameObject, tn as DiagnosticLabel, tt as SlideTemplate, u as IntrinsicPProps, ut as CssAlignItems, v as COMPOSITION_SOURCE, vt as CssGridAutoFlow, w as SlideFactoryInputWithTemplate, wt as CssGridTemplateShorthand, x as CompositionSourceInternals, xt as CssGridShorthand, y as CompositionContext, yt as CssGridLine, zt as SlideStyle } from "./index-C-LDA3Lj.mjs";
2
- import { B as StageArtifactStatus, C as ProjectInspectionSummary, E as ResolvedStyleMap, F as OutputFormat, H as StageSummary, I as ProjectStages, L as ProjectionFormat, P as CompileStages, R as RenderStages, U as WrittenOutput, V as StageName, s as PptxPackageModel, z as RenderedArtifact } from "./pptx-DaSXvESd.mjs";
3
- import { n as WriterAdapter, t as RenderOptions } from "./adapter-NxGlM8_c.mjs";
4
- import { a as createElement, c as Text, i as Fragment, l as View, o as Image, s as Shape } from "./jsx-runtime-Dz8WBHpq.mjs";
1
+ import { $ as Diagnostics, $t as StackAlignment, At as CssGridAutoFlow, Bt as CssObjectPosition, C as SourceContextValue, Ct as CssAlignSelf, D as StyleSheet, Dt as CssFlexBasis, E as ThemeDefaults, Et as CssDisplay, Ft as CssGridTemplateAreas, Gt as DeckPointLength, Ht as CssPosition, It as CssGridTemplateShorthand, Jt as ImageStyle, Kt as ImageCropAuthoring, Lt as CssGridTrack, Mt as CssGridPlacement, N as SemanticAuthorGraph, Nt as CssGridShorthand, Ot as CssFlexDirection, Pt as CssGridTemplate, Q as DiagnosticSeverity, Qt as Spacing, Rt as CssJustifyContent, S as SourceContextMapper, St as CssAlignItems, T as ThemeInput, Tt as CssBoxSizing, Ut as CssVisibility, Vt as CssOverflow, Wt as DeckLength, X as Diagnostic, Xt as ShapeStyle, Yt as LayoutMode, Z as DiagnosticLabel, Zt as SlideStyle, _ as SlideFactory, _t as TemplateFrame, a as IntrinsicDivProps, at as StyleDiagnosticError, b as SlideOptions, bt as BorderStyle, c as IntrinsicShapeProps, cn as TextStyle, ct as ClassNameObject, dn as TextTabStopLength, dt as EmptySlideTemplateSet, en as StackAxis, et as formatDiagnostic, f as TextJsxChild, fn as VerticalAlign, ft as SlideTemplate, g as CompositionSourceInternals, gt as TemplateAreaRef, h as CompositionSource, ht as TemplateAreaKind, i as DeckOptions, it as SemanticGraphDiagnosticError, jt as CssGridLine, kt as CssFlexWrap, l as IntrinsicTextTag, ln as TextTabStopAlignment, lt as ClassNameValue, m as CompositionContext, mt as TemplateArea, n as DeckJsxElement, nn as StrokeLineCap, nt as CompositionDiagnosticError, o as IntrinsicImgProps, on as TextFit, ot as JsxKey, p as COMPOSITION_SOURCE, pn as ViewStyle, pt as SlideTemplateSet, qt as ImageCropValue, r as DeckJsxIntrinsicElements, rn as StrokeLineJoin, rt as DeckDiagnosticError, s as IntrinsicPProps, sn as TextRunStyle, st as SourceSpan, t as ContentJsxChild, tn as StrokeDashType, tt as formatDiagnostics, u as IntrinsicViewTag, un as TextTabStopAuthoring, ut as ClassNameValueArray, v as SlideFactoryInput, vt as TemplateHandle, w as Theme, wt as CssAspectRatio, x as SourceContextInput, xt as CssAlignContent, y as SlideFactoryInputWithTemplate, yt as TemplateName, zt as CssJustifySelf } from "./index-dx2ZSBgF.mjs";
2
+ import { An as AssetSource, Cn as StageSummary, Dn as AssetLoaderContext, En as AssetLoader, Gt as ProjectInspectionSummary, On as AssetMediaType, Sn as StageName, T as PptxPackageModelCandidate, Tn as AssetLoadResult, _n as RenderOutputSideEffectStatus, an as ProjectOptions, bn as RenderedArtifact, cn as RenderAssemblyBuildSummary, dn as RenderAssemblyFingerprintDelta, fn as RenderAssemblyPlanEntrySummary, gn as RenderOutputSideEffectReason, hn as RenderInspectionSummary, in as OutputFormat, kn as AssetProbeResult, ln as RenderAssemblyExpectedEntrySummary, mn as RenderAssemblyReasonDetails, nn as CompileStages, on as ProjectStages, pn as RenderAssemblyPlanSummary, rn as InspectionDetailLevel, sn as ProjectionFormat, un as RenderAssemblyFinalEntrySummary, vn as RenderOutputSideEffectSummary, w as PptxPackageModel, wn as WrittenOutput, xn as StageArtifactStatus, yn as RenderStages } from "./model-BVkO8qGK.mjs";
3
+ import { n as RenderOptions, r as WriterAdapter } from "./adapter-C2AHiDGa.mjs";
4
+ import { r as ResolvedStyleMap } from "./resolve-BD1dHxZd.mjs";
5
5
 
6
6
  //#region src/pipeline-runner.d.ts
7
- type CompileResult = {
7
+ type PresentStageArtifactStatus = Exclude<StageArtifactStatus, "missing">;
8
+ type CompileResult = CompileResultWithGraph | CompileResultWithoutGraph;
9
+ type CompileResultWithGraph = {
8
10
  readonly ok: boolean;
9
11
  readonly diagnostics: Diagnostics;
10
- readonly stages: CompileStages;
11
- readonly graph?: SemanticAuthorGraph;
12
- readonly resolvedStyles?: ResolvedStyleMap;
12
+ readonly stages: CompileStages<PresentStageArtifactStatus>;
13
+ readonly graph: SemanticAuthorGraph;
14
+ readonly resolvedStyles: ResolvedStyleMap;
13
15
  };
14
- type ProjectResult = {
16
+ type CompileResultWithoutGraph = {
15
17
  readonly ok: boolean;
16
18
  readonly diagnostics: Diagnostics;
17
- readonly stages: ProjectStages;
19
+ readonly stages: CompileStages<"missing">;
20
+ readonly graph?: undefined;
21
+ readonly resolvedStyles?: undefined;
22
+ };
23
+ type ProjectResult = ProjectResultWithProjection | ProjectResultWithoutProjection;
24
+ type ProjectResultWithProjection = {
25
+ readonly ok: boolean;
26
+ readonly diagnostics: Diagnostics;
27
+ readonly stages: ProjectStages<StageArtifactStatus, PresentStageArtifactStatus>;
18
28
  readonly format: ProjectionFormat;
19
- readonly projection?: PptxPackageModel;
29
+ readonly projection: PptxPackageModel;
20
30
  readonly summary?: ProjectInspectionSummary;
21
31
  };
22
- type RenderResult = {
32
+ type ProjectResultWithoutProjection = {
23
33
  readonly ok: boolean;
24
34
  readonly diagnostics: Diagnostics;
25
- readonly stages: RenderStages;
35
+ readonly stages: ProjectStages<StageArtifactStatus, "missing">;
36
+ readonly format: ProjectionFormat;
37
+ readonly projection?: undefined;
38
+ readonly summary?: undefined;
39
+ };
40
+ type RenderResult = RenderResultWithArtifact | RenderResultWithoutArtifact;
41
+ type RenderResultWithArtifact = {
42
+ readonly ok: boolean;
43
+ readonly diagnostics: Diagnostics;
44
+ readonly stages: RenderStages<StageArtifactStatus, StageArtifactStatus, PresentStageArtifactStatus>;
26
45
  readonly format: OutputFormat;
27
- readonly artifact?: RenderedArtifact;
46
+ readonly artifact: RenderedArtifact;
28
47
  readonly output?: WrittenOutput;
48
+ readonly summary?: RenderInspectionSummary;
49
+ };
50
+ type RenderResultWithoutArtifact = {
51
+ readonly ok: boolean;
52
+ readonly diagnostics: Diagnostics;
53
+ readonly stages: RenderStages<StageArtifactStatus, StageArtifactStatus, "missing">;
54
+ readonly format: OutputFormat;
55
+ readonly artifact?: undefined;
56
+ readonly output?: undefined;
57
+ readonly summary?: undefined;
29
58
  };
30
59
  //#endregion
31
60
  //#region src/deck.d.ts
32
- type WithSource<TSourceContext, TTemplates extends SlideTemplateSet> = [TSourceContext] extends [void] ? never : (sourceContext: TSourceContext) => BoundSource<TSourceContext, TTemplates>;
61
+ type WithSource<TSourceContext extends SourceContextValue | void, TTemplates extends SlideTemplateSet> = [TSourceContext] extends [void] ? never : (sourceContext: TSourceContext) => BoundSource<TSourceContext, TTemplates>;
33
62
  /**
34
63
  * A Deck with Source Context already bound.
35
64
  *
@@ -40,14 +69,14 @@ type WithSource<TSourceContext, TTemplates extends SlideTemplateSet> = [TSourceC
40
69
  * @typeParam TSourceContext - The Source Context type already bound to this source.
41
70
  * @typeParam TTemplates - The Deck-local Slide Template set owned by the source Deck.
42
71
  */
43
- declare class BoundSource<TSourceContext = void, TTemplates extends SlideTemplateSet = SlideTemplateSet> implements CompositionSource<TSourceContext> {
72
+ declare class BoundSource<TSourceContext extends SourceContextValue | void = void, TTemplates extends SlideTemplateSet = SlideTemplateSet> implements CompositionSource<TSourceContext, TTemplates> {
44
73
  #private;
45
74
  /**
46
75
  * @param source - The Deck whose Source Context should be bound.
47
76
  * @param sourceContext - The Source Context value used whenever this source is composed.
48
77
  */
49
78
  constructor(source: Deck<TSourceContext, TTemplates>, sourceContext: TSourceContext);
50
- [COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext>;
79
+ [COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext, TTemplates>;
51
80
  /**
52
81
  * Compile this bound source into a Semantic Author Graph and resolved style inspection data.
53
82
  *
@@ -59,7 +88,7 @@ declare class BoundSource<TSourceContext = void, TTemplates extends SlideTemplat
59
88
  *
60
89
  * @returns A project result with diagnostics, stage summaries, and the projected model when valid.
61
90
  */
62
- project(): ProjectResult;
91
+ project(options?: ProjectOptions): Promise<ProjectResult>;
63
92
  /**
64
93
  * Render this bound source with the default writer adapter or an explicit Writer Adapter.
65
94
  *
@@ -81,7 +110,7 @@ type UntemplatedSlideOptions = Omit<SlideOptions<SlideTemplateSet>, "template">
81
110
  * @typeParam TSourceContext - Source Context required by this Deck's slide factories.
82
111
  * @typeParam TTemplates - Deck-local Slide Template set inferred from `new Deck({ templates })`.
83
112
  */
84
- declare class Deck<TSourceContext = void, TTemplates extends SlideTemplateSet = EmptySlideTemplateSet> implements CompositionSource<TSourceContext> {
113
+ declare class Deck<TSourceContext extends SourceContextValue | void = void, TTemplates extends SlideTemplateSet = EmptySlideTemplateSet> implements CompositionSource<TSourceContext, TTemplates> {
85
114
  #private;
86
115
  /** Bind Source Context to this Deck so it can be compiled, projected, rendered, or mounted. */
87
116
  readonly withSource: WithSource<TSourceContext, TTemplates>;
@@ -90,7 +119,8 @@ declare class Deck<TSourceContext = void, TTemplates extends SlideTemplateSet =
90
119
  */
91
120
  constructor(options: DeckOptions<TTemplates>);
92
121
  get options(): DeckOptions<TTemplates>;
93
- [COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext>;
122
+ get assetLoaders(): readonly AssetLoader[];
123
+ [COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext, TTemplates>;
94
124
  /**
95
125
  * Register a source-local StyleSheet for CSS-like `className` resolution.
96
126
  *
@@ -98,6 +128,20 @@ declare class Deck<TSourceContext = void, TTemplates extends SlideTemplateSet =
98
128
  * @returns This Deck, for fluent authoring.
99
129
  */
100
130
  useStyles(stylesheet: StyleSheet): this;
131
+ /**
132
+ * Register a source-local Asset Loading Boundary for media metadata and bytes.
133
+ *
134
+ * Asset loaders keep runtime-specific filesystem, framework-public URL, or authenticated media
135
+ * rules outside the multi-runtime core. Project and Render consume the registered loaders when
136
+ * media metadata or bytes are required.
137
+ *
138
+ * Loaders are evaluated before deckjsx's built-in asset boundary and in registration order. The
139
+ * loader that resolves Project metadata also owns Render byte loading for that source.
140
+ *
141
+ * @param loader - Asset loader with optional probe/load functions.
142
+ * @returns This Deck, for fluent authoring.
143
+ */
144
+ useAssets(loader: AssetLoader): this;
101
145
  /**
102
146
  * Declare one slide.
103
147
  *
@@ -144,8 +188,8 @@ declare class Deck<TSourceContext = void, TTemplates extends SlideTemplateSet =
144
188
  * @param context - Required child Source Context value or synchronous mapper when the child needs context.
145
189
  * @returns This Deck, for fluent authoring.
146
190
  */
147
- mount<TChildContext, TChildTemplates extends SlideTemplateSet>(sourceKey: string, child: Deck<TChildContext, TChildTemplates>, ...context: [TChildContext] extends [void] ? [] : [sourceContext: SourceContextInput<TSourceContext, TChildContext>]): this;
148
- mount<TChildContext, TChildTemplates extends SlideTemplateSet>(sourceKey: string, child: BoundSource<TChildContext, TChildTemplates>): this;
191
+ mount<TChildContext extends SourceContextValue | void, TChildTemplates extends SlideTemplateSet>(sourceKey: string, child: Deck<TChildContext, TChildTemplates>, ...context: [TChildContext] extends [void] ? [] : [sourceContext: SourceContextInput<TSourceContext, TChildContext>]): this;
192
+ mount<TChildContext extends SourceContextValue | void, TChildTemplates extends SlideTemplateSet>(sourceKey: string, child: BoundSource<TChildContext, TChildTemplates>): this;
149
193
  /**
150
194
  * Replace the current compiled graph artifact before calling `project()` or `render()`.
151
195
  *
@@ -159,7 +203,7 @@ declare class Deck<TSourceContext = void, TTemplates extends SlideTemplateSet =
159
203
  * @param projection - The projected PPTX Package Model to use as this Deck's projection state.
160
204
  * @returns This Deck, for fluent pipeline editing.
161
205
  */
162
- defineProjection(projection: PptxPackageModel): this;
206
+ defineProjection(projection: PptxPackageModelCandidate): this;
163
207
  /**
164
208
  * Compile this root Deck into the Semantic Author Graph and inspection artifacts.
165
209
  *
@@ -171,7 +215,7 @@ declare class Deck<TSourceContext = void, TTemplates extends SlideTemplateSet =
171
215
  *
172
216
  * @returns A project result with diagnostics, stage summaries, and the projected model when valid.
173
217
  */
174
- project(this: Deck<void, TTemplates>): ProjectResult;
218
+ project(this: Deck<void, TTemplates>, options?: ProjectOptions): Promise<ProjectResult>;
175
219
  /**
176
220
  * Render this root Deck with the default writer adapter or an explicit Writer Adapter.
177
221
  *
@@ -199,4 +243,4 @@ declare global {
199
243
  }
200
244
  }
201
245
  //#endregion
202
- export { type BorderStyle, type BoundSource, type ClassNameObject, type ClassNameValue, type ClassNameValueArray, type CompileResult, type CompositionContext, CompositionDiagnosticError, type ContentJsxChild, type CssAlignContent, type CssAlignItems, type CssAlignSelf, type CssAspectRatio, type CssBoxSizing, type CssDisplay, type CssFlexBasis, type CssFlexDirection, type CssFlexWrap, type CssGridAutoFlow, type CssGridLine, type CssGridPlacement, type CssGridShorthand, type CssGridTemplate, type CssGridTemplateAreas, type CssGridTemplateShorthand, type CssGridTrack, type CssJustifyContent, type CssJustifySelf, type CssObjectPosition, type CssOverflow, type CssPosition, type CssVisibility, Deck, DeckDiagnosticError, type DeckJsxIntrinsicElements, type DeckLength, type DeckOptions, type DeckPointLength, type Diagnostic, type DiagnosticLabel, type DiagnosticSeverity, type Diagnostics, EMU_PER_INCH, Fragment, Image, type ImageCropAuthoring, type ImageCropValue, type ImageProps, type ImageStyle, type IntrinsicDivProps, type IntrinsicImgProps, type IntrinsicPProps, type IntrinsicTextTag, type IntrinsicViewTag, type JsxKey, type LayoutMode, type OutputFormat, POINTS_PER_INCH, type ProjectResult, type ProjectionFormat, type RenderResult, type RenderedArtifact, SemanticGraphDiagnosticError, Shape, type ShapeProps, type ShapeStyle, type SlideFactory, type SlideFactoryInput, type SlideFactoryInputWithTemplate, type SlideOptions, type SlideStyle, type SlideTemplate, type SlideTemplateSet, type SourceContextMapper, type SourceSpan, type Spacing, type StackAlignment, type StackAxis, type StageArtifactStatus, type StageName, type StageSummary, type StrokeDashType, type StrokeLineCap, type StrokeLineJoin, StyleDiagnosticError, StyleSheet, type TemplateArea, type TemplateAreaRef, type TemplateFrame, type TemplateHandle, Text, type TextFit, type TextJsxChild, type TextProps, type TextRunNodeProps, type TextRunStyle, type TextStyle, type TextTabStopAlignment, type TextTabStopAuthoring, type TextTabStopLength, Theme, type ThemeDefaults, type ThemeInput, type VerticalAlign, View, type ViewProps, type ViewStyle, type WrittenOutput, createElement, formatDiagnostic, formatDiagnostics };
246
+ export { type AssetLoadResult, type AssetLoader, type AssetLoaderContext, type AssetMediaType, type AssetProbeResult, type AssetSource, type BorderStyle, type BoundSource, type ClassNameObject, type ClassNameValue, type ClassNameValueArray, type CompileResult, type CompositionContext, CompositionDiagnosticError, type ContentJsxChild, type CssAlignContent, type CssAlignItems, type CssAlignSelf, type CssAspectRatio, type CssBoxSizing, type CssDisplay, type CssFlexBasis, type CssFlexDirection, type CssFlexWrap, type CssGridAutoFlow, type CssGridLine, type CssGridPlacement, type CssGridShorthand, type CssGridTemplate, type CssGridTemplateAreas, type CssGridTemplateShorthand, type CssGridTrack, type CssJustifyContent, type CssJustifySelf, type CssObjectPosition, type CssOverflow, type CssPosition, type CssVisibility, Deck, DeckDiagnosticError, type DeckJsxElement, type DeckJsxIntrinsicElements, type DeckLength, type DeckOptions, type DeckPointLength, type Diagnostic, type DiagnosticLabel, type DiagnosticSeverity, type Diagnostics, EMU_PER_INCH, type ImageCropAuthoring, type ImageCropValue, type ImageStyle, type InspectionDetailLevel, type IntrinsicDivProps, type IntrinsicImgProps, type IntrinsicPProps, type IntrinsicShapeProps, type IntrinsicTextTag, type IntrinsicViewTag, type JsxKey, type LayoutMode, type OutputFormat, POINTS_PER_INCH, type ProjectOptions, type ProjectResult, type ProjectionFormat, type RenderAssemblyBuildSummary, type RenderAssemblyExpectedEntrySummary, type RenderAssemblyFinalEntrySummary, type RenderAssemblyFingerprintDelta, type RenderAssemblyPlanEntrySummary, type RenderAssemblyPlanSummary, type RenderAssemblyReasonDetails, type RenderInspectionSummary, type RenderOutputSideEffectReason, type RenderOutputSideEffectStatus, type RenderOutputSideEffectSummary, type RenderResult, type RenderedArtifact, SemanticGraphDiagnosticError, type ShapeStyle, type SlideFactory, type SlideFactoryInput, type SlideFactoryInputWithTemplate, type SlideOptions, type SlideStyle, type SlideTemplate, type SlideTemplateSet, type SourceContextMapper, type SourceSpan, type Spacing, type StackAlignment, type StackAxis, type StageArtifactStatus, type StageName, type StageSummary, type StrokeDashType, type StrokeLineCap, type StrokeLineJoin, StyleDiagnosticError, StyleSheet, type TemplateArea, type TemplateAreaKind, type TemplateAreaRef, type TemplateFrame, type TemplateHandle, type TextFit, type TextJsxChild, type TextRunStyle, type TextStyle, type TextTabStopAlignment, type TextTabStopAuthoring, type TextTabStopLength, Theme, type ThemeDefaults, type ThemeInput, type VerticalAlign, type ViewStyle, type WrittenOutput, formatDiagnostic, formatDiagnostics };