deckjsx 0.4.0 → 0.5.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/deck-CvTHG5ik.d.mts +78 -0
- package/dist/index-_eBM2cs3.d.mts +245 -0
- package/dist/{jsx-runtime-BMKEs7aG.d.mts → index-sb451NVh.d.mts} +120 -131
- package/dist/index.d.mts +4 -320
- package/dist/index.mjs +887 -11251
- package/dist/inspect.d.mts +3 -0
- package/dist/inspect.mjs +1 -0
- package/dist/{jsx-Crlbye9V.mjs → jsx-CK-x7PLd.mjs} +1 -1
- package/dist/jsx-dev-runtime.d.mts +2 -1
- package/dist/jsx-dev-runtime.mjs +1 -1
- package/dist/jsx-runtime-Bk7Wx3AL.d.mts +57 -0
- package/dist/jsx-runtime.d.mts +2 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/legacy.d.mts +6 -0
- package/dist/legacy.mjs +2 -0
- package/dist/pptxgenjs-BTMKb1WX.mjs +11143 -0
- package/package.json +3 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,323 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
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";
|
|
2
4
|
|
|
3
|
-
//#region src/style/resolve.d.ts
|
|
4
|
-
type ResolvedStyleLayer = "default" | "theme" | "class" | "style";
|
|
5
|
-
type ResolvedStyleSource = {
|
|
6
|
-
readonly layer: "default";
|
|
7
|
-
} | {
|
|
8
|
-
readonly layer: "theme";
|
|
9
|
-
} | {
|
|
10
|
-
readonly layer: "class";
|
|
11
|
-
readonly className: string;
|
|
12
|
-
readonly stylesheetIndex: number;
|
|
13
|
-
readonly ruleIndex: number;
|
|
14
|
-
readonly selector: string;
|
|
15
|
-
} | {
|
|
16
|
-
readonly layer: "style";
|
|
17
|
-
};
|
|
18
|
-
type ResolvedStyleProperty = {
|
|
19
|
-
readonly value: unknown;
|
|
20
|
-
readonly source: ResolvedStyleSource;
|
|
21
|
-
};
|
|
22
|
-
type ResolvedStyle = {
|
|
23
|
-
readonly style: Readonly<Record<string, unknown>>;
|
|
24
|
-
readonly properties: Readonly<Record<string, ResolvedStyleProperty>>;
|
|
25
|
-
readonly appliedClasses: readonly ResolvedStyleSource[];
|
|
26
|
-
};
|
|
27
|
-
type ResolvedStyleMap = ReadonlyMap<StyleEntityId, ResolvedStyle>;
|
|
28
|
-
type StyleResolutionResult = {
|
|
29
|
-
readonly resolvedStyles: ResolvedStyleMap;
|
|
30
|
-
readonly diagnostics: Diagnostics;
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/ir/index.d.ts
|
|
34
|
-
type PresentationIR = {
|
|
35
|
-
version: "0.1";
|
|
36
|
-
meta?: {
|
|
37
|
-
title?: string;
|
|
38
|
-
author?: string;
|
|
39
|
-
subject?: string;
|
|
40
|
-
};
|
|
41
|
-
size: SizeIR;
|
|
42
|
-
slides: ReadonlyArray<SlideIR>;
|
|
43
|
-
};
|
|
44
|
-
type SizeIR = {
|
|
45
|
-
widthEmu: number;
|
|
46
|
-
heightEmu: number;
|
|
47
|
-
};
|
|
48
|
-
type FrameIR = SizeIR & {
|
|
49
|
-
xEmu: number;
|
|
50
|
-
yEmu: number;
|
|
51
|
-
};
|
|
52
|
-
type SlideIR = {
|
|
53
|
-
id: string;
|
|
54
|
-
name?: string;
|
|
55
|
-
background?: FillIR;
|
|
56
|
-
backgroundLayers?: ReadonlyArray<BackgroundLayerIR>;
|
|
57
|
-
nodes: ReadonlyArray<NodeIR>;
|
|
58
|
-
};
|
|
59
|
-
type NodeIR = GroupIR | TextIR | ImageIR | ShapeIR;
|
|
60
|
-
type BaseNodeIR = {
|
|
61
|
-
id: string;
|
|
62
|
-
frame: FrameIR;
|
|
63
|
-
opacity?: number;
|
|
64
|
-
rotation?: number;
|
|
65
|
-
zIndex?: number;
|
|
66
|
-
visibility?: CssVisibility;
|
|
67
|
-
flipH?: boolean;
|
|
68
|
-
flipV?: boolean;
|
|
69
|
-
};
|
|
70
|
-
type ShadowIR = {
|
|
71
|
-
type: "outer" | "inner";
|
|
72
|
-
color: string;
|
|
73
|
-
opacity?: number;
|
|
74
|
-
blurPt?: number;
|
|
75
|
-
offsetPt?: number;
|
|
76
|
-
angle?: number;
|
|
77
|
-
};
|
|
78
|
-
type HyperlinkIR = {
|
|
79
|
-
url: string;
|
|
80
|
-
tooltip?: string;
|
|
81
|
-
};
|
|
82
|
-
type ObjectPositionIR = {
|
|
83
|
-
x: number;
|
|
84
|
-
y: number;
|
|
85
|
-
};
|
|
86
|
-
type ImageCropIR = {
|
|
87
|
-
top: number;
|
|
88
|
-
right: number;
|
|
89
|
-
bottom: number;
|
|
90
|
-
left: number;
|
|
91
|
-
};
|
|
92
|
-
type GroupIR = BaseNodeIR & {
|
|
93
|
-
kind: "group";
|
|
94
|
-
children: ReadonlyArray<NodeIR>;
|
|
95
|
-
fill?: FillIR;
|
|
96
|
-
backgroundLayers?: ReadonlyArray<BackgroundLayerIR>;
|
|
97
|
-
stroke?: StrokeIR;
|
|
98
|
-
edgeStrokes?: EdgeStrokeIR;
|
|
99
|
-
outline?: StrokeIR;
|
|
100
|
-
shadow?: ShadowIR;
|
|
101
|
-
radiusEmu?: number;
|
|
102
|
-
};
|
|
103
|
-
type TextIR = BaseNodeIR & {
|
|
104
|
-
kind: "text";
|
|
105
|
-
content: TextContentIR;
|
|
106
|
-
style: TextStyleIR;
|
|
107
|
-
fill?: FillIR;
|
|
108
|
-
backgroundLayers?: ReadonlyArray<BackgroundLayerIR>;
|
|
109
|
-
stroke?: StrokeIR;
|
|
110
|
-
edgeStrokes?: EdgeStrokeIR;
|
|
111
|
-
outline?: StrokeIR;
|
|
112
|
-
shadow?: ShadowIR;
|
|
113
|
-
hyperlink?: HyperlinkIR;
|
|
114
|
-
radiusEmu?: number;
|
|
115
|
-
};
|
|
116
|
-
type ImageIR = BaseNodeIR & {
|
|
117
|
-
kind: "image";
|
|
118
|
-
sourceFrame: FrameIR;
|
|
119
|
-
source: ImageSourceIR;
|
|
120
|
-
fit: "contain" | "cover" | "stretch";
|
|
121
|
-
objectPosition?: ObjectPositionIR;
|
|
122
|
-
crop?: ImageCropIR;
|
|
123
|
-
transparency?: number;
|
|
124
|
-
rounding?: boolean;
|
|
125
|
-
shadow?: ShadowIR;
|
|
126
|
-
hyperlink?: HyperlinkIR;
|
|
127
|
-
};
|
|
128
|
-
type ShapeIR = BaseNodeIR & {
|
|
129
|
-
kind: "shape";
|
|
130
|
-
shape: "rect" | "ellipse" | "line";
|
|
131
|
-
fill?: FillIR;
|
|
132
|
-
backgroundLayers?: ReadonlyArray<BackgroundLayerIR>;
|
|
133
|
-
stroke?: StrokeIR;
|
|
134
|
-
edgeStrokes?: EdgeStrokeIR;
|
|
135
|
-
outline?: StrokeIR;
|
|
136
|
-
shadow?: ShadowIR;
|
|
137
|
-
hyperlink?: HyperlinkIR;
|
|
138
|
-
radiusEmu?: number;
|
|
139
|
-
};
|
|
140
|
-
type SolidFillIR = {
|
|
141
|
-
kind: "solid";
|
|
142
|
-
color: string;
|
|
143
|
-
transparency?: number;
|
|
144
|
-
frame?: FrameIR;
|
|
145
|
-
};
|
|
146
|
-
type LinearGradientStopIR = {
|
|
147
|
-
color: string;
|
|
148
|
-
transparency?: number;
|
|
149
|
-
position: number;
|
|
150
|
-
};
|
|
151
|
-
type LinearGradientFillIR = {
|
|
152
|
-
kind: "linear-gradient";
|
|
153
|
-
angle: number;
|
|
154
|
-
stops: ReadonlyArray<LinearGradientStopIR>;
|
|
155
|
-
frame?: FrameIR;
|
|
156
|
-
};
|
|
157
|
-
type RadialGradientFillIR = {
|
|
158
|
-
kind: "radial-gradient";
|
|
159
|
-
shape: "circle" | "ellipse";
|
|
160
|
-
center: {
|
|
161
|
-
x: number;
|
|
162
|
-
y: number;
|
|
163
|
-
};
|
|
164
|
-
radius: {
|
|
165
|
-
x: number;
|
|
166
|
-
y: number;
|
|
167
|
-
};
|
|
168
|
-
stops: ReadonlyArray<LinearGradientStopIR>;
|
|
169
|
-
frame?: FrameIR;
|
|
170
|
-
};
|
|
171
|
-
type BackgroundImageLayerIR = {
|
|
172
|
-
kind: "background-image";
|
|
173
|
-
frame: FrameIR;
|
|
174
|
-
sourceFrame: FrameIR;
|
|
175
|
-
source: ImageSourceIR;
|
|
176
|
-
fit: "contain" | "cover" | "stretch" | "size";
|
|
177
|
-
size?: {
|
|
178
|
-
widthEmu?: number;
|
|
179
|
-
heightEmu?: number;
|
|
180
|
-
};
|
|
181
|
-
repeat: "no-repeat" | "repeat-x" | "repeat-y" | "repeat";
|
|
182
|
-
objectPosition?: ObjectPositionIR;
|
|
183
|
-
transparency?: number;
|
|
184
|
-
};
|
|
185
|
-
type FillIR = SolidFillIR | LinearGradientFillIR | RadialGradientFillIR;
|
|
186
|
-
type BackgroundLayerIR = FillIR | BackgroundImageLayerIR;
|
|
187
|
-
type StrokeIR = {
|
|
188
|
-
color: string;
|
|
189
|
-
widthPt: number;
|
|
190
|
-
style?: BorderStyle;
|
|
191
|
-
dashType?: StrokeDashType;
|
|
192
|
-
lineCap?: StrokeLineCap;
|
|
193
|
-
lineJoin?: StrokeLineJoin;
|
|
194
|
-
transparency?: number;
|
|
195
|
-
};
|
|
196
|
-
type EdgeStrokeIR = {
|
|
197
|
-
top?: StrokeIR;
|
|
198
|
-
right?: StrokeIR;
|
|
199
|
-
bottom?: StrokeIR;
|
|
200
|
-
left?: StrokeIR;
|
|
201
|
-
};
|
|
202
|
-
type TextContentIR = {
|
|
203
|
-
text: string;
|
|
204
|
-
runs?: ReadonlyArray<TextRunIR>;
|
|
205
|
-
};
|
|
206
|
-
type TextRunIR = {
|
|
207
|
-
text: string;
|
|
208
|
-
style?: TextStyleIR;
|
|
209
|
-
};
|
|
210
|
-
type TextTabStopIR = {
|
|
211
|
-
positionIn: number;
|
|
212
|
-
alignment?: "l" | "r" | "ctr" | "dec";
|
|
213
|
-
};
|
|
214
|
-
type TextBulletListIR = {
|
|
215
|
-
type: "bullet";
|
|
216
|
-
characterCode?: string;
|
|
217
|
-
indentPt?: number;
|
|
218
|
-
};
|
|
219
|
-
type TextNumberListIR = {
|
|
220
|
-
type: "number";
|
|
221
|
-
style: "arabicPeriod" | "alphaLcPeriod" | "alphaUcPeriod" | "romanLcPeriod" | "romanUcPeriod";
|
|
222
|
-
startAt?: number;
|
|
223
|
-
indentPt?: number;
|
|
224
|
-
};
|
|
225
|
-
type TextNoListIR = {
|
|
226
|
-
type: "none";
|
|
227
|
-
};
|
|
228
|
-
type TextListIR = TextBulletListIR | TextNumberListIR | TextNoListIR;
|
|
229
|
-
type TextStyleIR = {
|
|
230
|
-
fontFamily?: string;
|
|
231
|
-
fontSizePt?: number;
|
|
232
|
-
fontWeight?: number | "normal" | "bold";
|
|
233
|
-
italic?: boolean;
|
|
234
|
-
underline?: boolean;
|
|
235
|
-
underlineStyle?: "dash" | "dbl" | "dotted" | "none" | "sng" | "wavy";
|
|
236
|
-
underlineColor?: string;
|
|
237
|
-
strike?: boolean;
|
|
238
|
-
rtlMode?: boolean;
|
|
239
|
-
textDirection?: "horz" | "vert" | "vert270";
|
|
240
|
-
superscript?: boolean;
|
|
241
|
-
subscript?: boolean;
|
|
242
|
-
color?: string;
|
|
243
|
-
textAlign?: "left" | "center" | "right" | "justify";
|
|
244
|
-
verticalAlign?: VerticalAlign;
|
|
245
|
-
paddingPt?: [number, number, number, number];
|
|
246
|
-
lineSpacing?: number;
|
|
247
|
-
lineSpacingMultiple?: number;
|
|
248
|
-
paragraphSpacingBefore?: number;
|
|
249
|
-
paragraphSpacingAfter?: number;
|
|
250
|
-
textIndentPt?: number;
|
|
251
|
-
tabStops?: ReadonlyArray<TextTabStopIR>;
|
|
252
|
-
charSpacing?: number;
|
|
253
|
-
list?: TextListIR;
|
|
254
|
-
fit?: TextFit;
|
|
255
|
-
wrap?: boolean;
|
|
256
|
-
};
|
|
257
|
-
type ImageSourceIR = {
|
|
258
|
-
kind: "path";
|
|
259
|
-
path: string;
|
|
260
|
-
} | {
|
|
261
|
-
kind: "data";
|
|
262
|
-
data: string;
|
|
263
|
-
};
|
|
264
|
-
type BackendArtifact = {
|
|
265
|
-
kind: "buffer";
|
|
266
|
-
mimeType: string;
|
|
267
|
-
data: Uint8Array;
|
|
268
|
-
extension: string;
|
|
269
|
-
};
|
|
270
|
-
type CompileBackend = {
|
|
271
|
-
name: BackendName;
|
|
272
|
-
emit(ir: PresentationIR): Promise<BackendArtifact>;
|
|
273
|
-
};
|
|
274
|
-
//#endregion
|
|
275
|
-
//#region src/deck.d.ts
|
|
276
|
-
type CompileMode = "inspect" | "strict";
|
|
277
|
-
type CompileInspectResult = {
|
|
278
|
-
readonly graph?: SemanticAuthorGraph;
|
|
279
|
-
readonly diagnostics: Diagnostics;
|
|
280
|
-
readonly resolvedStyles?: ResolvedStyleMap;
|
|
281
|
-
};
|
|
282
|
-
type WithSource<TSourceContext> = [TSourceContext] extends [void] ? never : (sourceContext: TSourceContext) => BoundSource<TSourceContext>;
|
|
283
|
-
declare class BoundSource<TSourceContext = void> implements CompositionSource<TSourceContext> {
|
|
284
|
-
#private;
|
|
285
|
-
constructor(source: Deck<TSourceContext>, sourceContext: TSourceContext);
|
|
286
|
-
[COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext>;
|
|
287
|
-
compile(): SemanticAuthorGraph;
|
|
288
|
-
compile(config: {
|
|
289
|
-
mode?: "strict";
|
|
290
|
-
}): SemanticAuthorGraph;
|
|
291
|
-
compile(config: {
|
|
292
|
-
mode: "inspect";
|
|
293
|
-
}): CompileInspectResult;
|
|
294
|
-
render(): PresentationIR;
|
|
295
|
-
output(config: OutputConfig): Promise<void>;
|
|
296
|
-
}
|
|
297
|
-
declare class Deck<TSourceContext = void> implements CompositionSource<TSourceContext> {
|
|
298
|
-
#private;
|
|
299
|
-
readonly withSource: WithSource<TSourceContext>;
|
|
300
|
-
constructor(options: DeckOptions);
|
|
301
|
-
get options(): DeckOptions;
|
|
302
|
-
[COMPOSITION_SOURCE](): CompositionSourceInternals<TSourceContext>;
|
|
303
|
-
useStyles(stylesheet: StyleSheet): this;
|
|
304
|
-
add(slide: SlideFactory<TSourceContext>): this;
|
|
305
|
-
mount<TChildContext>(sourceKey: string, child: Deck<TChildContext>, ...context: [TChildContext] extends [void] ? [] : [sourceContext: SourceContextInput<TSourceContext, TChildContext>]): this;
|
|
306
|
-
mount<TChildContext>(sourceKey: string, child: BoundSource<TChildContext>): this;
|
|
307
|
-
render(this: Deck<void>): PresentationIR;
|
|
308
|
-
compile(this: Deck<void>): SemanticAuthorGraph;
|
|
309
|
-
compile(this: Deck<void>, config: {
|
|
310
|
-
mode?: "strict";
|
|
311
|
-
}): SemanticAuthorGraph;
|
|
312
|
-
compile(this: Deck<void>, config: {
|
|
313
|
-
mode: "inspect";
|
|
314
|
-
}): CompileInspectResult;
|
|
315
|
-
output(this: Deck<void>, config: OutputConfig): Promise<void>;
|
|
316
|
-
}
|
|
317
|
-
//#endregion
|
|
318
|
-
//#region src/backends/pptxgenjs.d.ts
|
|
319
|
-
declare function pptxgenjsBackend(): CompileBackend;
|
|
320
|
-
//#endregion
|
|
321
5
|
//#region src/types.d.ts
|
|
322
6
|
declare const EMU_PER_INCH = 914400;
|
|
323
7
|
declare const POINTS_PER_INCH = 72;
|
|
@@ -336,4 +20,4 @@ declare global {
|
|
|
336
20
|
}
|
|
337
21
|
}
|
|
338
22
|
//#endregion
|
|
339
|
-
export { type
|
|
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 };
|