deckjsx 0.5.0 → 0.6.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.
@@ -168,6 +168,7 @@ type SemanticImageNode = BaseSemanticNode & {
168
168
  };
169
169
  type SemanticShapeNode = BaseSemanticNode & {
170
170
  readonly kind: "shape";
171
+ readonly shape: "rect" | "ellipse" | "line";
171
172
  };
172
173
  type SemanticNode = SemanticContainerNode | SemanticDocumentNode | SemanticImageNode | SemanticShapeNode | SemanticSlideNode | SemanticTextNode | SemanticTextRunNode;
173
174
  type StyleClassRef = {
@@ -567,8 +568,6 @@ type CompositionSource<TSourceContext = unknown> = {
567
568
  };
568
569
  //#endregion
569
570
  //#region src/authoring/index.d.ts
570
- type BackendName = "pptxgenjs" | "ooxml";
571
- type ImplementedBackendName = "pptxgenjs";
572
571
  interface TextJsxChildArray extends ReadonlyArray<TextJsxChild> {}
573
572
  type TextJsxChild = AuthorTreeNode | string | number | boolean | null | undefined | TextJsxChildArray;
574
573
  interface ContentJsxChildArray extends ReadonlyArray<ContentJsxChild> {}
@@ -595,14 +594,13 @@ type DeckOptions = {
595
594
  subject?: string;
596
595
  };
597
596
  theme?: Theme;
597
+ output?: {
598
+ format?: "pptx";
599
+ };
598
600
  };
599
601
  type SlideContext = {
600
602
  composition: CompositionContext;
601
603
  };
602
- type OutputConfig = {
603
- backend: ImplementedBackendName;
604
- output: string;
605
- };
606
604
  type SlideNodeProps = {
607
605
  name?: string;
608
606
  className?: ClassNameValue;
@@ -698,4 +696,4 @@ type DeckJsxIntrinsicElements = {
698
696
  span: IntrinsicSpanProps;
699
697
  } & { [Tag in IntrinsicViewTag]: IntrinsicDivProps } & { [Tag in IntrinsicTextTag]: IntrinsicPProps };
700
698
  //#endregion
701
- export { CssJustifyContent as $, formatDiagnostics as $t, SourceContextMapper as A, GraphNodeId as At, CssBoxSizing as B, SemanticSlideNode as Bt, COMPOSITION_SOURCE as C, TextTabStopAuthoring as Ct, SlideFactory as D, AssetEntity as Dt, CompositionSourceInternals as E, ViewStyle as Et, BorderStyle as F, SemanticNode as Ft, CssGridAutoFlow as G, StyleClassRef as Gt, CssFlexBasis as H, SemanticTextRunNode as Ht, CssAlignContent as I, SemanticNodeKind as It, CssGridShorthand as J, Diagnostic as Jt, CssGridLine as K, StyleEntity as Kt, CssAlignItems as L, SemanticOrigin as Lt, ThemeInput as M, SemanticContainerNode as Mt, ThemeDefaults as N, SemanticDocumentNode as Nt, SlideFactoryInput as O, AssetEntityId as Ot, StyleSheet as P, SemanticImageNode as Pt, CssGridTrack as Q, formatDiagnostic as Qt, CssAlignSelf as R, SemanticRole as Rt, ViewProps as S, TextTabStopAlignment as St, CompositionSource as T, VerticalAlign as Tt, CssFlexDirection as U, SourceIdentity as Ut, CssDisplay as V, SemanticTextNode as Vt, CssFlexWrap as W, SourceOrigin as Wt, CssGridTemplateAreas as X, DiagnosticSeverity as Xt, CssGridTemplate as Y, DiagnosticLabel as Yt, CssGridTemplateShorthand as Z, Diagnostics as Zt, SlideContext as _, StrokeLineCap as _t, ContentJsxChild as a, AuthorTreeChild as an, DeckLength as at, TextProps as b, TextRunStyle as bt, ImageProps as c, SourceSpan as cn, ImageCropValue as ct, IntrinsicImgProps as d, ShapeStyle as dt, CompositionDiagnosticError as en, CssJustifySelf as et, IntrinsicPProps as f, SlideStyle as ft, ShapeProps as g, StrokeDashType as gt, OutputConfig as h, StackAxis as ht, ClassNameValueArray as i, AuthorElementNode as in, CssVisibility as it, Theme as j, SemanticAuthorGraph as jt, SourceContextInput as k, BaseSemanticNode as kt, ImplementedBackendName as l, IntrinsicTextTag$1 as ln, ImageStyle as lt, IntrinsicViewTag as m, StackAlignment as mt, ClassNameObject as n, SemanticGraphDiagnosticError as nn, CssOverflow as nt, DeckJsxIntrinsicElements as o, AuthorTreeNode as on, DeckPointLength as ot, IntrinsicTextTag as p, Spacing as pt, CssGridPlacement as q, StyleEntityId as qt, ClassNameValue as r, StyleDiagnosticError as rn, CssPosition as rt, DeckOptions as s, JsxKey as sn, ImageCropAuthoring as st, BackendName as t, DeckDiagnosticError as tn, CssObjectPosition as tt, IntrinsicDivProps as u, IntrinsicViewTag$1 as un, LayoutMode as ut, SlideProps as v, StrokeLineJoin as vt, CompositionContext as w, TextTabStopLength as wt, TextRunNodeProps as x, TextStyle as xt, TextJsxChild as y, TextFit as yt, CssAspectRatio as z, SemanticShapeNode as zt };
699
+ export { CssOverflow as $, DeckDiagnosticError as $t, ThemeDefaults as A, SemanticContainerNode as At, CssFlexDirection as B, SemanticTextRunNode as Bt, CompositionSourceInternals as C, ViewStyle as Ct, SourceContextMapper as D, Brand as Dt, SourceContextInput as E, BaseSemanticNode as Et, CssAlignSelf as F, SemanticOrigin as Ft, CssGridShorthand as G, StyleEntityId as Gt, CssGridAutoFlow as H, SourceOrigin as Ht, CssAspectRatio as I, SemanticRole as It, CssGridTemplateShorthand as J, DiagnosticSeverity as Jt, CssGridTemplate as K, Diagnostic as Kt, CssBoxSizing as L, SemanticShapeNode as Lt, BorderStyle as M, SemanticImageNode as Mt, CssAlignContent as N, SemanticNode as Nt, Theme as O, GraphNodeId as Ot, CssAlignItems as P, SemanticNodeKind as Pt, CssObjectPosition as Q, CompositionDiagnosticError as Qt, CssDisplay as R, SemanticSlideNode as Rt, CompositionSource as S, VerticalAlign as St, SlideFactoryInput as T, AssetEntityId as Tt, CssGridLine as U, StyleClassRef as Ut, CssFlexWrap as V, SourceIdentity as Vt, CssGridPlacement as W, StyleEntity as Wt, CssJustifyContent as X, formatDiagnostic as Xt, CssGridTrack as Y, Diagnostics as Yt, CssJustifySelf as Z, formatDiagnostics as Zt, TextProps as _, TextRunStyle as _t, DeckJsxIntrinsicElements as a, JsxKey as an, ImageCropValue as at, COMPOSITION_SOURCE as b, TextTabStopAuthoring as bt, IntrinsicDivProps as c, IntrinsicViewTag$1 as cn, ShapeStyle as ct, IntrinsicTextTag as d, StackAlignment as dt, SemanticGraphDiagnosticError as en, CssPosition as et, IntrinsicViewTag as f, StackAxis as ft, TextJsxChild as g, TextFit as gt, SlideProps as h, StrokeLineJoin as ht, ContentJsxChild as i, AuthorTreeNode as in, ImageCropAuthoring as it, StyleSheet as j, SemanticDocumentNode as jt, ThemeInput as k, SemanticAuthorGraph as kt, IntrinsicImgProps as l, SlideStyle as lt, SlideContext as m, StrokeLineCap as mt, ClassNameValue as n, AuthorElementNode as nn, DeckLength as nt, DeckOptions as o, SourceSpan as on, ImageStyle as ot, ShapeProps as p, StrokeDashType as pt, CssGridTemplateAreas as q, DiagnosticLabel as qt, ClassNameValueArray as r, AuthorTreeChild as rn, DeckPointLength as rt, ImageProps as s, IntrinsicTextTag$1 as sn, LayoutMode as st, ClassNameObject as t, StyleDiagnosticError as tn, CssVisibility as tt, IntrinsicPProps as u, Spacing as ut, TextRunNodeProps as v, TextStyle as vt, SlideFactory as w, AssetEntity as wt, CompositionContext as x, TextTabStopLength as xt, ViewProps as y, TextTabStopAlignment as yt, CssFlexBasis as z, SemanticTextNode as zt };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,60 @@
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 { $ as CssOverflow, $t as DeckDiagnosticError, A as ThemeDefaults, B as CssFlexDirection, C as CompositionSourceInternals, Ct as ViewStyle, D as SourceContextMapper, E as SourceContextInput, F as CssAlignSelf, G as CssGridShorthand, H as CssGridAutoFlow, I as CssAspectRatio, J as CssGridTemplateShorthand, Jt as DiagnosticSeverity, K as CssGridTemplate, Kt as Diagnostic, L as CssBoxSizing, M as BorderStyle, N as CssAlignContent, O as Theme, P as CssAlignItems, Q as CssObjectPosition, Qt as CompositionDiagnosticError, R as CssDisplay, S as CompositionSource, St as VerticalAlign, T as SlideFactoryInput, U as CssGridLine, V as CssFlexWrap, W as CssGridPlacement, X as CssJustifyContent, Xt as formatDiagnostic, Y as CssGridTrack, Yt as Diagnostics, Z as CssJustifySelf, Zt as formatDiagnostics, _ as TextProps, _t as TextRunStyle, a as DeckJsxIntrinsicElements, an as JsxKey, at as ImageCropValue, b as COMPOSITION_SOURCE, bt as TextTabStopAuthoring, c as IntrinsicDivProps, ct as ShapeStyle, d as IntrinsicTextTag, dt as StackAlignment, en as SemanticGraphDiagnosticError, et as CssPosition, f as IntrinsicViewTag, ft as StackAxis, g as TextJsxChild, gt as TextFit, h as SlideProps, ht as StrokeLineJoin, i as ContentJsxChild, it as ImageCropAuthoring, j as StyleSheet, k as ThemeInput, kt as SemanticAuthorGraph, l as IntrinsicImgProps, lt as SlideStyle, m as SlideContext, mt as StrokeLineCap, n as ClassNameValue, nt as DeckLength, o as DeckOptions, on as SourceSpan, ot as ImageStyle, p as ShapeProps, pt as StrokeDashType, q as CssGridTemplateAreas, qt as DiagnosticLabel, r as ClassNameValueArray, rt as DeckPointLength, s as ImageProps, st as LayoutMode, t as ClassNameObject, tn as StyleDiagnosticError, tt as CssVisibility, u as IntrinsicPProps, ut as Spacing, v as TextRunNodeProps, vt as TextStyle, w as SlideFactory, x as CompositionContext, xt as TextTabStopLength, y as ViewProps, yt as TextTabStopAlignment, z as CssFlexBasis } from "./index-C5l8PX5V.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-PzEK54aA.mjs";
3
+ import { n as WriterAdapter, t as RenderOptions } from "./adapter-C8xw46nz.mjs";
4
+ 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-DwfBuBkY.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> = [TSourceContext] extends [void] ? never : (sourceContext: TSourceContext) => BoundSource<TSourceContext>;
33
+ declare class BoundSource<TSourceContext = void> implements CompositionSource<TSourceContext> {
34
+ #private;
35
+ constructor(source: Deck<TSourceContext>, sourceContext: TSourceContext);
36
+ [COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext>;
37
+ compile(): CompileResult;
38
+ project(): ProjectResult;
39
+ render(config?: RenderOptions | WriterAdapter<PptxPackageModel>): Promise<RenderResult>;
40
+ }
41
+ declare class Deck<TSourceContext = void> implements CompositionSource<TSourceContext> {
42
+ #private;
43
+ readonly withSource: WithSource<TSourceContext>;
44
+ constructor(options: DeckOptions);
45
+ get options(): DeckOptions;
46
+ [COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext>;
47
+ useStyles(stylesheet: StyleSheet): this;
48
+ add(slide: SlideFactory<TSourceContext>): this;
49
+ mount<TChildContext>(sourceKey: string, child: Deck<TChildContext>, ...context: [TChildContext] extends [void] ? [] : [sourceContext: SourceContextInput<TSourceContext, TChildContext>]): this;
50
+ mount<TChildContext>(sourceKey: string, child: BoundSource<TChildContext>): this;
51
+ defineGraph(graph: SemanticAuthorGraph): this;
52
+ defineProjection(projection: PptxPackageModel): this;
53
+ compile(this: Deck<void>): CompileResult;
54
+ project(this: Deck<void>): ProjectResult;
55
+ render(this: Deck<void>, config?: RenderOptions | WriterAdapter<PptxPackageModel>): Promise<RenderResult>;
56
+ }
57
+ //#endregion
5
58
  //#region src/types.d.ts
6
59
  declare const EMU_PER_INCH = 914400;
7
60
  declare const POINTS_PER_INCH = 72;
@@ -20,4 +73,4 @@ declare global {
20
73
  }
21
74
  }
22
75
  //#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 };
76
+ 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, Slide, type SlideContext, type SlideFactory, type SlideFactoryInput, type SlideProps, type SlideStyle, type SourceContextMapper, type SourceSpan, type Spacing, type StackAlignment, type StackAxis, type StageArtifactStatus, type StageName, type StageSummary, 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, type WrittenOutput, createElement, formatDiagnostic, formatDiagnostics };