deckjsx 0.4.1 → 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.
@@ -0,0 +1,448 @@
1
+ import { Dt as Brand, Gt as StyleEntityId, Ht as SourceOrigin, M as BorderStyle, Ot as GraphNodeId, St as VerticalAlign, Yt as Diagnostics, gt as TextFit, ht as StrokeLineJoin, mt as StrokeLineCap, o as DeckOptions, pt as StrokeDashType, wt as AssetEntity } from "./index-C5l8PX5V.mjs";
2
+
3
+ //#region src/layout/projected.d.ts
4
+ type SizeIR = {
5
+ widthEmu: number;
6
+ heightEmu: number;
7
+ };
8
+ type FrameIR = SizeIR & {
9
+ xEmu: number;
10
+ yEmu: number;
11
+ };
12
+ type ShadowIR = {
13
+ type: "outer" | "inner";
14
+ color: string;
15
+ opacity?: number;
16
+ blurPt?: number;
17
+ offsetPt?: number;
18
+ angle?: number;
19
+ };
20
+ type HyperlinkIR = {
21
+ url: string;
22
+ tooltip?: string;
23
+ };
24
+ type ObjectPositionIR = {
25
+ x: number;
26
+ y: number;
27
+ };
28
+ type ImageCropIR = {
29
+ top: number;
30
+ right: number;
31
+ bottom: number;
32
+ left: number;
33
+ };
34
+ type SolidFillIR = {
35
+ kind: "solid";
36
+ color: string;
37
+ transparency?: number;
38
+ frame?: FrameIR;
39
+ };
40
+ type LinearGradientStopIR = {
41
+ color: string;
42
+ transparency?: number;
43
+ position: number;
44
+ };
45
+ type LinearGradientFillIR = {
46
+ kind: "linear-gradient";
47
+ angle: number;
48
+ stops: ReadonlyArray<LinearGradientStopIR>;
49
+ frame?: FrameIR;
50
+ };
51
+ type RadialGradientFillIR = {
52
+ kind: "radial-gradient";
53
+ shape: "circle" | "ellipse";
54
+ center: {
55
+ x: number;
56
+ y: number;
57
+ };
58
+ radius: {
59
+ x: number;
60
+ y: number;
61
+ };
62
+ stops: ReadonlyArray<LinearGradientStopIR>;
63
+ frame?: FrameIR;
64
+ };
65
+ type BackgroundImageLayerIR = {
66
+ kind: "background-image";
67
+ frame: FrameIR;
68
+ sourceFrame: FrameIR;
69
+ source: ImageSourceIR;
70
+ fit: "contain" | "cover" | "stretch" | "size";
71
+ size?: {
72
+ widthEmu?: number;
73
+ heightEmu?: number;
74
+ };
75
+ repeat: "no-repeat" | "repeat-x" | "repeat-y" | "repeat";
76
+ objectPosition?: ObjectPositionIR;
77
+ transparency?: number;
78
+ };
79
+ type FillIR = SolidFillIR | LinearGradientFillIR | RadialGradientFillIR;
80
+ type BackgroundLayerIR = FillIR | BackgroundImageLayerIR;
81
+ type StrokeIR = {
82
+ color: string;
83
+ widthPt: number;
84
+ style?: BorderStyle;
85
+ dashType?: StrokeDashType;
86
+ lineCap?: StrokeLineCap;
87
+ lineJoin?: StrokeLineJoin;
88
+ transparency?: number;
89
+ };
90
+ type EdgeStrokeIR = {
91
+ top?: StrokeIR;
92
+ right?: StrokeIR;
93
+ bottom?: StrokeIR;
94
+ left?: StrokeIR;
95
+ };
96
+ type TextRunIR = {
97
+ text: string;
98
+ style?: TextStyleIR;
99
+ };
100
+ type TextTabStopIR = {
101
+ positionIn: number;
102
+ alignment?: "l" | "r" | "ctr" | "dec";
103
+ };
104
+ type TextBulletListIR = {
105
+ type: "bullet";
106
+ characterCode?: string;
107
+ indentPt?: number;
108
+ };
109
+ type TextNumberListIR = {
110
+ type: "number";
111
+ style: "arabicPeriod" | "alphaLcPeriod" | "alphaUcPeriod" | "romanLcPeriod" | "romanUcPeriod";
112
+ startAt?: number;
113
+ indentPt?: number;
114
+ };
115
+ type TextNoListIR = {
116
+ type: "none";
117
+ };
118
+ type TextListIR = TextBulletListIR | TextNumberListIR | TextNoListIR;
119
+ type TextStyleIR = {
120
+ fontFamily?: string;
121
+ fontSizePt?: number;
122
+ fontWeight?: number | "normal" | "bold";
123
+ italic?: boolean;
124
+ underline?: boolean;
125
+ underlineStyle?: "dash" | "dbl" | "dotted" | "none" | "sng" | "wavy";
126
+ underlineColor?: string;
127
+ strike?: boolean;
128
+ rtlMode?: boolean;
129
+ textDirection?: "horz" | "vert" | "vert270";
130
+ superscript?: boolean;
131
+ subscript?: boolean;
132
+ color?: string;
133
+ textAlign?: "left" | "center" | "right" | "justify";
134
+ verticalAlign?: VerticalAlign;
135
+ paddingPt?: [number, number, number, number];
136
+ lineSpacing?: number;
137
+ lineSpacingMultiple?: number;
138
+ paragraphSpacingBefore?: number;
139
+ paragraphSpacingAfter?: number;
140
+ textIndentPt?: number;
141
+ tabStops?: ReadonlyArray<TextTabStopIR>;
142
+ charSpacing?: number;
143
+ list?: TextListIR;
144
+ fit?: TextFit;
145
+ wrap?: boolean;
146
+ };
147
+ type ImageSourceIR = {
148
+ kind: "path";
149
+ path: string;
150
+ } | {
151
+ kind: "data";
152
+ data: string;
153
+ };
154
+ //#endregion
155
+ //#region src/pipeline.d.ts
156
+ type ProjectionFormat = "pptx";
157
+ type OutputFormat = ProjectionFormat | "pdf";
158
+ type StageName = "compile" | "project" | "render";
159
+ type StageArtifactStatus = "available" | "partial" | "missing";
160
+ type StageSummary = {
161
+ readonly ok: boolean;
162
+ readonly diagnostics: Diagnostics;
163
+ readonly artifact: StageArtifactStatus;
164
+ };
165
+ type CompileStageSummary = StageSummary & {
166
+ readonly stage: "compile";
167
+ };
168
+ type ProjectStageSummary = StageSummary & {
169
+ readonly stage: "project";
170
+ };
171
+ type RenderStageSummary = StageSummary & {
172
+ readonly stage: "render";
173
+ };
174
+ type CompileStages = {
175
+ readonly compile: CompileStageSummary;
176
+ };
177
+ type ProjectStages = CompileStages & {
178
+ readonly project: ProjectStageSummary;
179
+ };
180
+ type RenderStages = ProjectStages & {
181
+ readonly render: RenderStageSummary;
182
+ };
183
+ type RenderedArtifact<TFormat extends OutputFormat = OutputFormat> = {
184
+ readonly format: TFormat;
185
+ readonly mediaType: string;
186
+ readonly extension: string;
187
+ readonly bytes: Uint8Array;
188
+ };
189
+ type WrittenOutput = {
190
+ readonly path: string;
191
+ };
192
+ //#endregion
193
+ //#region src/projection/pptx-manifest.d.ts
194
+ type PptxContentTypeDefault = {
195
+ readonly extension: string;
196
+ readonly contentType: string;
197
+ };
198
+ type PptxContentTypeOverride = {
199
+ readonly partName: string;
200
+ readonly contentType: string;
201
+ };
202
+ type PptxContentTypesPayload = {
203
+ readonly defaults: readonly PptxContentTypeDefault[];
204
+ readonly overrides: readonly PptxContentTypeOverride[];
205
+ };
206
+ type PptxRelationshipsPayload = {
207
+ readonly relationships: readonly PptxRelationship[];
208
+ };
209
+ //#endregion
210
+ //#region src/style/resolve.d.ts
211
+ type ResolvedStyleLayer = "default" | "theme" | "class" | "style";
212
+ type ResolvedStyleSource = {
213
+ readonly layer: "default";
214
+ } | {
215
+ readonly layer: "theme";
216
+ readonly defaultKey: string;
217
+ } | {
218
+ readonly layer: "class";
219
+ readonly className: string;
220
+ readonly stylesheetIndex: number;
221
+ readonly ruleIndex: number;
222
+ readonly selector: string;
223
+ } | {
224
+ readonly layer: "style";
225
+ };
226
+ type ResolvedStyleProperty = {
227
+ readonly value: unknown;
228
+ readonly source: ResolvedStyleSource;
229
+ };
230
+ type ResolvedStyle = {
231
+ readonly style: Readonly<Record<string, unknown>>;
232
+ readonly properties: Readonly<Record<string, ResolvedStyleProperty>>;
233
+ readonly appliedClasses: readonly ResolvedStyleSource[];
234
+ };
235
+ type ResolvedStyleMap = ReadonlyMap<GraphNodeId, ResolvedStyle>;
236
+ type StyleResolutionResult = {
237
+ readonly resolvedStyles: ResolvedStyleMap;
238
+ readonly diagnostics: Diagnostics;
239
+ };
240
+ //#endregion
241
+ //#region src/projection/pptx.d.ts
242
+ type PackagePartId = Brand<string, "PackagePartId">;
243
+ type PptxElementId = Brand<string, "PptxElementId">;
244
+ type PptxSerializedIdentity = Brand<string, "PptxSerializedIdentity">;
245
+ type PptxPackagePartCategory = "authored-content" | "manifest" | "support";
246
+ type PptxPackagePartKind = "content-types" | "document-properties" | "media" | "notes-master" | "notes-slide" | "presentation" | "presentation-properties" | "relationships" | "slide" | "slide-layout" | "slide-master" | "theme" | "view-properties";
247
+ type PptxElementKind = "group" | "image" | "shape" | "text";
248
+ type PptxElementOrigin = {
249
+ readonly graphNodeIds?: readonly GraphNodeId[];
250
+ readonly styleEntityIds?: readonly StyleEntityId[];
251
+ readonly assetEntityIds?: readonly AssetEntity["id"][];
252
+ readonly source?: SourceOrigin;
253
+ };
254
+ type PptxSerializedIdentities = {
255
+ readonly relationshipId?: PptxSerializedIdentity;
256
+ readonly shapeObjectId?: PptxSerializedIdentity;
257
+ };
258
+ type PptxMeasurement = {
259
+ readonly frame?: FrameIR;
260
+ readonly overflow?: "clip" | "fit" | "visible";
261
+ };
262
+ type PptxBaseElement = {
263
+ readonly id: PptxElementId;
264
+ readonly kind: PptxElementKind;
265
+ readonly packagePartId: PackagePartId;
266
+ readonly serialized: PptxSerializedIdentities;
267
+ readonly origin: PptxElementOrigin;
268
+ readonly frame: FrameIR;
269
+ readonly opacity?: number;
270
+ readonly rotation?: number;
271
+ readonly zIndex?: number;
272
+ readonly visibility?: string;
273
+ readonly flipH?: boolean;
274
+ readonly flipV?: boolean;
275
+ readonly measurement?: PptxMeasurement;
276
+ };
277
+ type PptxGroupElement = PptxBaseElement & {
278
+ readonly kind: "group";
279
+ readonly children: readonly PptxElement[];
280
+ readonly fill?: FillIR;
281
+ readonly backgroundLayers?: readonly BackgroundLayerIR[];
282
+ readonly stroke?: StrokeIR;
283
+ readonly edgeStrokes?: EdgeStrokeIR;
284
+ readonly outline?: StrokeIR;
285
+ readonly shadow?: ShadowIR;
286
+ readonly radiusEmu?: number;
287
+ };
288
+ type PptxTextElement = PptxBaseElement & {
289
+ readonly kind: "text";
290
+ readonly content: {
291
+ readonly text: string;
292
+ readonly runs?: readonly TextRunIR[];
293
+ };
294
+ readonly style: TextStyleIR;
295
+ readonly fill?: FillIR;
296
+ readonly backgroundLayers?: readonly BackgroundLayerIR[];
297
+ readonly stroke?: StrokeIR;
298
+ readonly edgeStrokes?: EdgeStrokeIR;
299
+ readonly outline?: StrokeIR;
300
+ readonly shadow?: ShadowIR;
301
+ readonly hyperlink?: HyperlinkIR;
302
+ readonly radiusEmu?: number;
303
+ };
304
+ type PptxPictureElement = PptxBaseElement & {
305
+ readonly kind: "image";
306
+ readonly mediaPartId?: PackagePartId;
307
+ readonly sourceFrame: FrameIR;
308
+ readonly source: ImageSourceIR;
309
+ readonly fit: "contain" | "cover" | "stretch";
310
+ readonly objectPosition?: ObjectPositionIR;
311
+ readonly crop?: ImageCropIR;
312
+ readonly transparency?: number;
313
+ readonly rounding?: boolean;
314
+ readonly shadow?: ShadowIR;
315
+ readonly hyperlink?: HyperlinkIR;
316
+ };
317
+ type PptxShapeElement = PptxBaseElement & {
318
+ readonly kind: "shape";
319
+ readonly shape: "rect" | "ellipse" | "line";
320
+ readonly fill?: FillIR;
321
+ readonly backgroundLayers?: readonly BackgroundLayerIR[];
322
+ readonly stroke?: StrokeIR;
323
+ readonly edgeStrokes?: EdgeStrokeIR;
324
+ readonly outline?: StrokeIR;
325
+ readonly shadow?: ShadowIR;
326
+ readonly hyperlink?: HyperlinkIR;
327
+ readonly radiusEmu?: number;
328
+ };
329
+ type PptxElement = PptxGroupElement | PptxPictureElement | PptxShapeElement | PptxTextElement;
330
+ type PptxRelationship = {
331
+ readonly id: PptxSerializedIdentity;
332
+ readonly targetPartId: PackagePartId;
333
+ readonly targetPath: string;
334
+ readonly type: string;
335
+ };
336
+ type PptxPackagePart = {
337
+ readonly id: PackagePartId;
338
+ readonly category: PptxPackagePartCategory;
339
+ readonly kind: PptxPackagePartKind;
340
+ readonly path: string;
341
+ readonly relationships?: readonly PptxRelationship[];
342
+ readonly origin?: {
343
+ readonly graphNodeIds?: readonly GraphNodeId[];
344
+ readonly source?: SourceOrigin;
345
+ };
346
+ readonly payload?: unknown;
347
+ };
348
+ type PptxSupportPartPayload = {
349
+ readonly kind: "presentation";
350
+ readonly size: PptxPackageModel["size"];
351
+ readonly slidePartIds: readonly PackagePartId[];
352
+ } | {
353
+ readonly kind: "document-properties";
354
+ readonly meta?: DeckOptions["meta"];
355
+ } | {
356
+ readonly kind: "notes-master" | "notes-slide" | "presentation-properties" | "slide-layout" | "slide-master" | "theme" | "view-properties";
357
+ readonly status: "placeholder";
358
+ readonly editable: true;
359
+ };
360
+ type PptxContentTypesPart = PptxPackagePart & {
361
+ readonly kind: "content-types";
362
+ readonly payload?: PptxContentTypesPayload;
363
+ };
364
+ type PptxRelationshipsPart = PptxPackagePart & {
365
+ readonly kind: "relationships";
366
+ readonly payload?: PptxRelationshipsPayload;
367
+ };
368
+ type PptxSlidePart = PptxPackagePart & {
369
+ readonly category: "authored-content";
370
+ readonly kind: "slide";
371
+ readonly payload: {
372
+ readonly slideId: string;
373
+ readonly name?: string;
374
+ readonly background?: FillIR;
375
+ readonly backgroundLayers?: readonly BackgroundLayerIR[];
376
+ readonly elements: readonly PptxElement[];
377
+ };
378
+ };
379
+ type ProjectInspectionElementSummary = {
380
+ readonly id: PptxElementId;
381
+ readonly kind: PptxElementKind;
382
+ readonly packagePartId: PackagePartId;
383
+ readonly frame?: FrameIR;
384
+ readonly textPreview?: string;
385
+ readonly origin: PptxElementOrigin;
386
+ readonly resolvedValues?: ProjectInspectionResolvedValues;
387
+ };
388
+ type ProjectInspectionResolvedValues = {
389
+ readonly frame?: FrameIR;
390
+ readonly fill?: FillIR;
391
+ readonly stroke?: StrokeIR;
392
+ readonly textStyle?: TextStyleIR;
393
+ readonly imageSource?: ImageSourceIR;
394
+ };
395
+ type ProjectInspectionPartSummary = {
396
+ readonly id: PackagePartId;
397
+ readonly category: PptxPackagePartCategory;
398
+ readonly kind: PptxPackagePartKind;
399
+ readonly path: string;
400
+ readonly relationshipCount?: number;
401
+ readonly contentTypeCount?: number;
402
+ };
403
+ type ProjectInspectionSummary = {
404
+ readonly format: ProjectionFormat;
405
+ readonly parts: readonly ProjectInspectionPartSummary[];
406
+ readonly media: readonly ProjectInspectionMediaSummary[];
407
+ readonly slides: readonly {
408
+ readonly partId: PackagePartId;
409
+ readonly slideId: string;
410
+ readonly name?: string;
411
+ readonly elements: readonly ProjectInspectionElementSummary[];
412
+ }[];
413
+ readonly pptx: {
414
+ readonly packageParts: readonly ProjectInspectionPartSummary[];
415
+ readonly relationshipCount: number;
416
+ };
417
+ readonly diagnostics: readonly ProjectInspectionDiagnosticSummary[];
418
+ readonly adapterLimitations: readonly ProjectInspectionAdapterLimitation[];
419
+ };
420
+ type ProjectInspectionDiagnosticSummary = {
421
+ readonly severity: Diagnostics["items"][number]["severity"];
422
+ readonly code: string;
423
+ readonly title: string;
424
+ };
425
+ type ProjectInspectionAdapterLimitation = {
426
+ readonly adapter: string;
427
+ readonly code: string;
428
+ readonly message: string;
429
+ };
430
+ type ProjectInspectionMediaSummary = {
431
+ readonly partId?: PackagePartId;
432
+ readonly elementId?: PptxElementId;
433
+ readonly sourceKind: ImageSourceIR["kind"];
434
+ readonly origin: PptxElementOrigin;
435
+ };
436
+ type PptxPackageModel = {
437
+ readonly version: "0.6";
438
+ readonly format: "pptx";
439
+ readonly size: {
440
+ readonly widthEmu: number;
441
+ readonly heightEmu: number;
442
+ };
443
+ readonly meta?: DeckOptions["meta"];
444
+ readonly parts: readonly PptxPackagePart[];
445
+ readonly slides: readonly PptxSlidePart[];
446
+ };
447
+ //#endregion
448
+ export { PptxContentTypeDefault as A, StageArtifactStatus as B, ProjectInspectionSummary as C, ResolvedStyleProperty as D, ResolvedStyleMap as E, OutputFormat as F, StageSummary as H, ProjectStages as I, ProjectionFormat as L, PptxContentTypesPayload as M, PptxRelationshipsPayload as N, ResolvedStyleSource as O, CompileStages as P, RenderStages as R, ProjectInspectionResolvedValues as S, ResolvedStyleLayer as T, WrittenOutput as U, StageName as V, ProjectInspectionAdapterLimitation as _, PptxElementKind as a, ProjectInspectionMediaSummary as b, PptxPackagePart as c, PptxRelationship as d, PptxRelationshipsPart as f, PptxSupportPartPayload as g, PptxSlidePart as h, PptxElementId as i, PptxContentTypeOverride as j, StyleResolutionResult as k, PptxPackagePartCategory as l, PptxSerializedIdentity as m, PptxContentTypesPart as n, PptxElementOrigin as o, PptxSerializedIdentities as p, PptxElement as r, PptxPackageModel as s, PackagePartId as t, PptxPackagePartKind as u, ProjectInspectionDiagnosticSummary as v, ResolvedStyle as w, ProjectInspectionPartSummary as x, ProjectInspectionElementSummary as y, RenderedArtifact as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deckjsx",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "Generate PowerPoint presentations from TSX/JSX through a compiler pipeline.",
5
5
  "license": "MIT",
6
6
  "author": "deckjsx contributors",
@@ -15,6 +15,8 @@
15
15
  "types": "./dist/index.d.mts",
16
16
  "exports": {
17
17
  ".": "./dist/index.mjs",
18
+ "./adapter": "./dist/adapter.mjs",
19
+ "./inspect": "./dist/inspect.mjs",
18
20
  "./jsx-dev-runtime": "./dist/jsx-dev-runtime.mjs",
19
21
  "./jsx-runtime": "./dist/jsx-runtime.mjs",
20
22
  "./package.json": "./package.json"