deckjsx 0.5.0 → 0.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/index.d.mts CHANGED
@@ -1,7 +1,186 @@
1
- import { $ as CssJustifyContent, $t as formatDiagnostics, A as SourceContextMapper, B as CssBoxSizing, Ct as TextTabStopAuthoring, D as SlideFactory, Et as ViewStyle, F as BorderStyle, G as CssGridAutoFlow, H as CssFlexBasis, I as CssAlignContent, J as CssGridShorthand, Jt as Diagnostic, K as CssGridLine, L as CssAlignItems, M as ThemeInput, N as ThemeDefaults, O as SlideFactoryInput, P as StyleSheet, Q as CssGridTrack, Qt as formatDiagnostic, R as CssAlignSelf, S as ViewProps, St as TextTabStopAlignment, Tt as VerticalAlign, U as CssFlexDirection, V as CssDisplay, W as CssFlexWrap, X as CssGridTemplateAreas, Xt as DiagnosticSeverity, Y as CssGridTemplate, Yt as DiagnosticLabel, Z as CssGridTemplateShorthand, Zt as Diagnostics, _ as SlideContext, _t as StrokeLineCap, a as ContentJsxChild, at as DeckLength, b as TextProps, bt as TextRunStyle, c as ImageProps, cn as SourceSpan, ct as ImageCropValue, d as IntrinsicImgProps, dt as ShapeStyle, en as CompositionDiagnosticError, et as CssJustifySelf, f as IntrinsicPProps, ft as SlideStyle, g as ShapeProps, gt as StrokeDashType, h as OutputConfig, ht as StackAxis, i as ClassNameValueArray, it as CssVisibility, j as Theme, l as ImplementedBackendName, lt as ImageStyle, m as IntrinsicViewTag, mt as StackAlignment, n as ClassNameObject, nn as SemanticGraphDiagnosticError, nt as CssOverflow, o as DeckJsxIntrinsicElements, ot as DeckPointLength, p as IntrinsicTextTag, pt as Spacing, q as CssGridPlacement, r as ClassNameValue, rn as StyleDiagnosticError, rt as CssPosition, s as DeckOptions, sn as JsxKey, st as ImageCropAuthoring, t as BackendName, tn as DeckDiagnosticError, tt as CssObjectPosition, u as IntrinsicDivProps, ut as LayoutMode, v as SlideProps, vt as StrokeLineJoin, w as CompositionContext, wt as TextTabStopLength, x as TextRunNodeProps, xt as TextStyle, y as TextJsxChild, yt as TextFit, z as CssAspectRatio } from "./index-sb451NVh.mjs";
2
- import { a as createElement, c as Slide, i as Fragment, l as Text, o as Image, s as Shape, u as View } from "./jsx-runtime-Bk7Wx3AL.mjs";
3
- import { i as Deck, n as CompileInspectResult, r as CompileMode, t as BoundSource } from "./deck-CvTHG5ik.mjs";
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";
4
5
 
6
+ //#region src/pipeline-runner.d.ts
7
+ type CompileResult = {
8
+ readonly ok: boolean;
9
+ readonly diagnostics: Diagnostics;
10
+ readonly stages: CompileStages;
11
+ readonly graph?: SemanticAuthorGraph;
12
+ readonly resolvedStyles?: ResolvedStyleMap;
13
+ };
14
+ type ProjectResult = {
15
+ readonly ok: boolean;
16
+ readonly diagnostics: Diagnostics;
17
+ readonly stages: ProjectStages;
18
+ readonly format: ProjectionFormat;
19
+ readonly projection?: PptxPackageModel;
20
+ readonly summary?: ProjectInspectionSummary;
21
+ };
22
+ type RenderResult = {
23
+ readonly ok: boolean;
24
+ readonly diagnostics: Diagnostics;
25
+ readonly stages: RenderStages;
26
+ readonly format: OutputFormat;
27
+ readonly artifact?: RenderedArtifact;
28
+ readonly output?: WrittenOutput;
29
+ };
30
+ //#endregion
31
+ //#region src/deck.d.ts
32
+ type WithSource<TSourceContext, TTemplates extends SlideTemplateSet> = [TSourceContext] extends [void] ? never : (sourceContext: TSourceContext) => BoundSource<TSourceContext, TTemplates>;
33
+ /**
34
+ * A Deck with Source Context already bound.
35
+ *
36
+ * Bound sources can be mounted, compiled, projected, or rendered, but they are not an authoring
37
+ * registration surface. Use `Deck#withSource(...)` when a child Deck requires Source Context and
38
+ * should be executed as a standalone source.
39
+ *
40
+ * @typeParam TSourceContext - The Source Context type already bound to this source.
41
+ * @typeParam TTemplates - The Deck-local Slide Template set owned by the source Deck.
42
+ */
43
+ declare class BoundSource<TSourceContext = void, TTemplates extends SlideTemplateSet = SlideTemplateSet> implements CompositionSource<TSourceContext> {
44
+ #private;
45
+ /**
46
+ * @param source - The Deck whose Source Context should be bound.
47
+ * @param sourceContext - The Source Context value used whenever this source is composed.
48
+ */
49
+ constructor(source: Deck<TSourceContext, TTemplates>, sourceContext: TSourceContext);
50
+ [COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext>;
51
+ /**
52
+ * Compile this bound source into a Semantic Author Graph and resolved style inspection data.
53
+ *
54
+ * @returns A compile result with diagnostics, stage summaries, and graph artifacts when available.
55
+ */
56
+ compile(): CompileResult;
57
+ /**
58
+ * Project this bound source into the configured output document model.
59
+ *
60
+ * @returns A project result with diagnostics, stage summaries, and the projected model when valid.
61
+ */
62
+ project(): ProjectResult;
63
+ /**
64
+ * Render this bound source with the default writer adapter or an explicit Writer Adapter.
65
+ *
66
+ * @param config - Render options for the default adapter, or an explicit Writer Adapter.
67
+ * @returns A Promise resolving to render diagnostics, stage summaries, and an artifact when render succeeds.
68
+ */
69
+ render(config?: RenderOptions | WriterAdapter<PptxPackageModel>): Promise<RenderResult>;
70
+ }
71
+ type UntemplatedSlideOptions = Omit<SlideOptions<SlideTemplateSet>, "template"> & {
72
+ readonly template?: never;
73
+ };
74
+ /**
75
+ * The main authoring object for a deckjsx document.
76
+ *
77
+ * A Deck owns slide declarations, source-local stylesheets, optional Theme configuration, and
78
+ * Deck-local Slide Templates. It compiles JSX authoring into the Semantic Author Graph, projects
79
+ * that graph into an output document model, and renders the projected model through a writer.
80
+ *
81
+ * @typeParam TSourceContext - Source Context required by this Deck's slide factories.
82
+ * @typeParam TTemplates - Deck-local Slide Template set inferred from `new Deck({ templates })`.
83
+ */
84
+ declare class Deck<TSourceContext = void, TTemplates extends SlideTemplateSet = EmptySlideTemplateSet> implements CompositionSource<TSourceContext> {
85
+ #private;
86
+ /** Bind Source Context to this Deck so it can be compiled, projected, rendered, or mounted. */
87
+ readonly withSource: WithSource<TSourceContext, TTemplates>;
88
+ /**
89
+ * @param options - Deck configuration, including layout, metadata, Theme, output format, and Deck Templates.
90
+ */
91
+ constructor(options: DeckOptions<TTemplates>);
92
+ get options(): DeckOptions<TTemplates>;
93
+ [COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext>;
94
+ /**
95
+ * Register a source-local StyleSheet for CSS-like `className` resolution.
96
+ *
97
+ * @param stylesheet - The StyleSheet to apply to slides declared by this Deck source.
98
+ * @returns This Deck, for fluent authoring.
99
+ */
100
+ useStyles(stylesheet: StyleSheet): this;
101
+ /**
102
+ * Declare one slide.
103
+ *
104
+ * The factory returns the slide content JSX directly; authors should not wrap content in a public
105
+ * `<Slide>` root. Slide-level metadata such as `name`, `className`, `style`, and `template` belongs
106
+ * in the options object.
107
+ *
108
+ * @param factory - Callback that returns the authored JSX content for the slide.
109
+ * @returns This Deck, for fluent authoring.
110
+ */
111
+ slide(factory: SlideFactory<TSourceContext>): this;
112
+ /**
113
+ * Declare one untemplated slide with slide-level options.
114
+ *
115
+ * Use this overload for slide metadata or slide-level style when no Deck Template is selected.
116
+ *
117
+ * @param options - Slide-level metadata and style. `template` is intentionally unavailable here.
118
+ * @param factory - Callback that returns the authored JSX content for the slide.
119
+ * @returns This Deck, for fluent authoring.
120
+ */
121
+ slide(options: UntemplatedSlideOptions, factory: SlideFactory<TSourceContext>): this;
122
+ /**
123
+ * Declare one slide using a Deck-owned Slide Template.
124
+ *
125
+ * The selected template name is type-checked from `new Deck({ templates })`. The factory receives a
126
+ * typed `template` handle whose properties create Template Area References, e.g.
127
+ * `area={template.title}`.
128
+ *
129
+ * @param options - Slide-level options including the selected Deck Template name.
130
+ * @param factory - Callback that returns authored JSX content and receives a typed `template` handle.
131
+ * @returns This Deck, for fluent authoring.
132
+ */
133
+ slide<TTemplateName extends TemplateName<TTemplates>>(options: SlideOptions<TTemplates, TTemplateName> & {
134
+ readonly template: TTemplateName;
135
+ }, factory: SlideFactory<TSourceContext, SlideFactoryInputWithTemplate<TSourceContext, TTemplates, TTemplateName>>): this;
136
+ /**
137
+ * Mount another Deck as a child source.
138
+ *
139
+ * Child Decks keep their own Source Context, stylesheets, Theme, and Slide Templates. Parent Deck
140
+ * templates are not inherited by mounted children.
141
+ *
142
+ * @param sourceKey - Source-local key used for source identity and diagnostics.
143
+ * @param child - Child Deck to compose into this Deck.
144
+ * @param context - Required child Source Context value or synchronous mapper when the child needs context.
145
+ * @returns This Deck, for fluent authoring.
146
+ */
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;
149
+ /**
150
+ * Replace the current compiled graph artifact before calling `project()` or `render()`.
151
+ *
152
+ * @param graph - The Semantic Author Graph to use as this Deck's compiled state.
153
+ * @returns This Deck, for fluent pipeline editing.
154
+ */
155
+ defineGraph(graph: SemanticAuthorGraph): this;
156
+ /**
157
+ * Replace the current projected document model artifact before calling `render()`.
158
+ *
159
+ * @param projection - The projected PPTX Package Model to use as this Deck's projection state.
160
+ * @returns This Deck, for fluent pipeline editing.
161
+ */
162
+ defineProjection(projection: PptxPackageModel): this;
163
+ /**
164
+ * Compile this root Deck into the Semantic Author Graph and inspection artifacts.
165
+ *
166
+ * @returns A compile result with diagnostics, stage summaries, and graph artifacts when available.
167
+ */
168
+ compile(this: Deck<void, TTemplates>): CompileResult;
169
+ /**
170
+ * Project this root Deck into the configured output document model.
171
+ *
172
+ * @returns A project result with diagnostics, stage summaries, and the projected model when valid.
173
+ */
174
+ project(this: Deck<void, TTemplates>): ProjectResult;
175
+ /**
176
+ * Render this root Deck with the default writer adapter or an explicit Writer Adapter.
177
+ *
178
+ * @param config - Render options for the default adapter, or an explicit Writer Adapter.
179
+ * @returns A Promise resolving to render diagnostics, stage summaries, and an artifact when render succeeds.
180
+ */
181
+ render(this: Deck<void, TTemplates>, config?: RenderOptions | WriterAdapter<PptxPackageModel>): Promise<RenderResult>;
182
+ }
183
+ //#endregion
5
184
  //#region src/types.d.ts
6
185
  declare const EMU_PER_INCH = 914400;
7
186
  declare const POINTS_PER_INCH = 72;
@@ -20,4 +199,4 @@ declare global {
20
199
  }
21
200
  }
22
201
  //#endregion
23
- export { type BackendName, type BorderStyle, type BoundSource, type ClassNameObject, type ClassNameValue, type ClassNameValueArray, type CompileInspectResult, type CompileMode, 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 ImplementedBackendName, type IntrinsicDivProps, type IntrinsicImgProps, type IntrinsicPProps, type IntrinsicTextTag, type IntrinsicViewTag, type JsxKey, type LayoutMode, type OutputConfig, POINTS_PER_INCH, SemanticGraphDiagnosticError, Shape, type ShapeProps, type ShapeStyle, Slide, type SlideContext, type SlideFactory, type SlideFactoryInput, type SlideProps, type SlideStyle, type SourceContextMapper, type SourceSpan, type Spacing, type StackAlignment, type StackAxis, type StrokeDashType, type StrokeLineCap, type StrokeLineJoin, StyleDiagnosticError, StyleSheet, 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, createElement, formatDiagnostic, formatDiagnostics };
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 };