deckjsx 0.7.0 → 0.8.1
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/README.md +265 -71
- package/dist/adapter-B-bVXjv-.d.mts +34 -0
- package/dist/adapter-CNSvvD4i.mjs +8613 -0
- package/dist/adapter.d.mts +2 -2
- package/dist/adapter.mjs +2 -2
- package/dist/{index-C-LDA3Lj.d.mts → index-BlOsGMTm.d.mts} +137 -194
- package/dist/index.d.mts +69 -25
- package/dist/index.mjs +5407 -1190
- package/dist/inspect.d.mts +4 -3
- package/dist/inspect.mjs +2 -1
- package/dist/jsx-dev-runtime.d.mts +26 -4
- package/dist/jsx-dev-runtime.mjs +6 -8
- package/dist/jsx-runtime-Dd6G09P7.d.mts +42 -0
- package/dist/jsx-runtime-DzJLgS1w.mjs +120 -0
- package/dist/jsx-runtime.d.mts +3 -3
- package/dist/jsx-runtime.mjs +1 -7
- package/dist/model-DIuh51qh.mjs +32 -0
- package/dist/model-oqG9gKTq.d.mts +1256 -0
- package/dist/node-output-BXQOTLKj.mjs +28 -0
- package/dist/resolve-CfjiMtv5.d.mts +36 -0
- package/dist/tree-DNsco0U3.mjs +156 -0
- package/package.json +7 -24
- package/dist/adapter-NxGlM8_c.d.mts +0 -22
- package/dist/adapter-rS3mWdi0.mjs +0 -11244
- package/dist/jsx-DetoUfLm.mjs +0 -279
- package/dist/jsx-runtime-Dz8WBHpq.d.mts +0 -56
- package/dist/pptx-DaSXvESd.d.mts +0 -448
package/dist/adapter.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
export { RenderOptions, WriterAdapter, WriterAdapterResult,
|
|
1
|
+
import { a as WriterRenderContext, i as WriterAdapterResult, n as RenderOptions, o as pptx, r as WriterAdapter, t as PptxRenderOptions } from "./adapter-B-bVXjv-.mjs";
|
|
2
|
+
export { PptxRenderOptions, RenderOptions, WriterAdapter, WriterAdapterResult, WriterRenderContext, pptx };
|
package/dist/adapter.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
export {
|
|
1
|
+
import { t as pptx } from "./adapter-CNSvvD4i.mjs";
|
|
2
|
+
export { pptx };
|
|
@@ -1,90 +1,6 @@
|
|
|
1
1
|
//#region src/authoring/tags.d.ts
|
|
2
|
-
type AuthoredTag = "article" | "aside" | "div" | "figure" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "img" | "main" | "nav" | "p" | "section" | "span";
|
|
2
|
+
type AuthoredTag = "article" | "aside" | "div" | "figure" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "img" | "main" | "nav" | "p" | "section" | "shape" | "span";
|
|
3
3
|
type SectioningTag = "article" | "aside" | "footer" | "header" | "main" | "nav" | "section";
|
|
4
|
-
type AuthoredComponent = "Image" | "Shape" | "Slide" | "Text" | "View";
|
|
5
|
-
type IntrinsicViewTag$1 = "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section";
|
|
6
|
-
type IntrinsicTextTag$1 = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/authoring/tree.d.ts
|
|
9
|
-
type JsxKey = string | number | bigint;
|
|
10
|
-
type SourceSpan = {
|
|
11
|
-
readonly file?: string;
|
|
12
|
-
readonly line?: number;
|
|
13
|
-
readonly column?: number;
|
|
14
|
-
};
|
|
15
|
-
type AuthorElementSource = {
|
|
16
|
-
readonly kind: "tag";
|
|
17
|
-
readonly tag: AuthoredTag;
|
|
18
|
-
} | {
|
|
19
|
-
readonly kind: "component";
|
|
20
|
-
readonly component: AuthoredComponent;
|
|
21
|
-
};
|
|
22
|
-
type AuthorElementNode = {
|
|
23
|
-
readonly $$typeof: "deckjsx.author-tree";
|
|
24
|
-
readonly kind: "element";
|
|
25
|
-
readonly source: AuthorElementSource;
|
|
26
|
-
readonly key?: JsxKey;
|
|
27
|
-
readonly props: Record<string, unknown>;
|
|
28
|
-
readonly children: readonly AuthorTreeNode[];
|
|
29
|
-
readonly sourceSpan?: SourceSpan;
|
|
30
|
-
};
|
|
31
|
-
type AuthorFragmentNode = {
|
|
32
|
-
readonly $$typeof: "deckjsx.author-tree";
|
|
33
|
-
readonly kind: "fragment";
|
|
34
|
-
readonly key?: JsxKey;
|
|
35
|
-
readonly children: readonly AuthorTreeNode[];
|
|
36
|
-
readonly sourceSpan?: SourceSpan;
|
|
37
|
-
};
|
|
38
|
-
type AuthorTextLeaf = {
|
|
39
|
-
readonly $$typeof: "deckjsx.author-tree";
|
|
40
|
-
readonly kind: "text";
|
|
41
|
-
readonly value: string | number;
|
|
42
|
-
readonly sourceSpan?: SourceSpan;
|
|
43
|
-
};
|
|
44
|
-
type AuthorTreeNode = AuthorElementNode | AuthorFragmentNode | AuthorTextLeaf;
|
|
45
|
-
type AuthorTreeChild = AuthorTreeNode | string | number | boolean | null | undefined | readonly AuthorTreeChild[];
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/diagnostics/errors.d.ts
|
|
48
|
-
declare class DeckDiagnosticError extends Error {
|
|
49
|
-
readonly diagnostics: Diagnostics;
|
|
50
|
-
constructor(message: string, diagnostics: Diagnostics);
|
|
51
|
-
}
|
|
52
|
-
declare class SemanticGraphDiagnosticError extends DeckDiagnosticError {
|
|
53
|
-
constructor(diagnostics: Diagnostics);
|
|
54
|
-
}
|
|
55
|
-
declare class CompositionDiagnosticError extends DeckDiagnosticError {
|
|
56
|
-
constructor(diagnostics: Diagnostics);
|
|
57
|
-
}
|
|
58
|
-
declare class StyleDiagnosticError extends DeckDiagnosticError {
|
|
59
|
-
constructor(diagnostics: Diagnostics);
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/diagnostics/format.d.ts
|
|
63
|
-
declare function formatDiagnostic(diagnostic: Diagnostic): string;
|
|
64
|
-
declare function formatDiagnostics(diagnostics: Diagnostics): string;
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/diagnostics/index.d.ts
|
|
67
|
-
type DiagnosticSeverity = "error" | "warning";
|
|
68
|
-
type DiagnosticLabel = {
|
|
69
|
-
readonly message: string;
|
|
70
|
-
readonly path: string;
|
|
71
|
-
readonly sourceSpan?: SourceSpan;
|
|
72
|
-
readonly severity?: "primary" | "secondary";
|
|
73
|
-
};
|
|
74
|
-
type Diagnostic = {
|
|
75
|
-
readonly severity: DiagnosticSeverity;
|
|
76
|
-
readonly code: string;
|
|
77
|
-
readonly title: string;
|
|
78
|
-
readonly message?: string;
|
|
79
|
-
readonly labels: readonly DiagnosticLabel[];
|
|
80
|
-
readonly notes?: readonly string[];
|
|
81
|
-
readonly help?: readonly string[];
|
|
82
|
-
};
|
|
83
|
-
type Diagnostics = {
|
|
84
|
-
readonly items: readonly Diagnostic[];
|
|
85
|
-
readonly hasErrors: boolean;
|
|
86
|
-
readonly hasWarnings: boolean;
|
|
87
|
-
};
|
|
88
4
|
//#endregion
|
|
89
5
|
//#region src/style/types.d.ts
|
|
90
6
|
type DeckLength = number | `${number}${"in" | "pt" | "px" | "%" | "em" | "rem" | "vh" | "vw" | "ch"}`;
|
|
@@ -140,6 +56,9 @@ type BaseAuthorProps = {
|
|
|
140
56
|
rotation?: number;
|
|
141
57
|
transform?: string;
|
|
142
58
|
transformOrigin?: string;
|
|
59
|
+
filter?: string;
|
|
60
|
+
mixBlendMode?: string;
|
|
61
|
+
isolation?: "auto" | "isolate";
|
|
143
62
|
zIndex?: number;
|
|
144
63
|
flipH?: boolean;
|
|
145
64
|
flipV?: boolean;
|
|
@@ -339,9 +258,17 @@ type ShapeStyle = FrameAuthorProps & Omit<BoxStyleAuthorProps, "backgroundColor"
|
|
|
339
258
|
radius?: DeckLength;
|
|
340
259
|
};
|
|
341
260
|
type TextRunStyle = Pick<TextStyle, "fontFamily" | "fontSize" | "fontWeight" | "italic" | "fontStyle" | "underline" | "strike" | "textDecoration" | "textDecorationLine" | "textDecorationStyle" | "textDecorationColor" | "textTransform" | "direction" | "writingMode" | "color" | "verticalAlign" | "charSpacing" | "letterSpacing" | "href" | "tooltip" | "superscript" | "subscript" | "textShadow">;
|
|
261
|
+
type KnownStyleDeclarationSource = SlideStyle | ViewStyle | TextStyle | TextRunStyle | ImageStyle | ShapeStyle;
|
|
262
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
263
|
+
type ValueOfUnion<T, TKey extends PropertyKey> = T extends T ? TKey extends keyof T ? T[TKey] : never : never;
|
|
264
|
+
type KnownStyleDeclarationKey = KeysOfUnion<KnownStyleDeclarationSource>;
|
|
265
|
+
type StyleDeclarationValue = ValueOfUnion<KnownStyleDeclarationSource, KnownStyleDeclarationKey>;
|
|
266
|
+
type StyleDeclaration = { readonly [Key in KnownStyleDeclarationKey]?: ValueOfUnion<KnownStyleDeclarationSource, Key> };
|
|
342
267
|
type StyleForAuthoredTag<TTag extends string> = TTag extends "span" ? TextRunStyle : TTag extends "img" ? ImageStyle : TTag extends "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" ? TextStyle : ViewStyle;
|
|
343
268
|
//#endregion
|
|
344
269
|
//#region src/templates.d.ts
|
|
270
|
+
declare const TEMPLATE_AREA_KINDS: readonly ["body", "date", "footer", "generic", "picture", "slideNumber", "title"];
|
|
271
|
+
type TemplateAreaKind = (typeof TEMPLATE_AREA_KINDS)[number];
|
|
345
272
|
/** The concrete frame used by a Template Area before output projection. */
|
|
346
273
|
type TemplateFrame = {
|
|
347
274
|
readonly x: DeckLength;
|
|
@@ -352,6 +279,7 @@ type TemplateFrame = {
|
|
|
352
279
|
/** A named placement area inside a Slide Template. */
|
|
353
280
|
type TemplateArea = {
|
|
354
281
|
readonly frame: TemplateFrame;
|
|
282
|
+
readonly kind?: TemplateAreaKind;
|
|
355
283
|
};
|
|
356
284
|
/** A reusable Deck-owned slide structure made of named Template Areas. */
|
|
357
285
|
type SlideTemplate = {
|
|
@@ -364,7 +292,8 @@ type EmptySlideTemplateSet = Record<never, never>;
|
|
|
364
292
|
* A branded authored reference from slide content to one Template Area.
|
|
365
293
|
*
|
|
366
294
|
* Authors normally obtain this value from the slide factory's `template` handle, for example
|
|
367
|
-
* `area={template.title}`.
|
|
295
|
+
* `area={template.title}`. The runtime reference object is library-owned so callers do not have to
|
|
296
|
+
* manufacture branded values.
|
|
368
297
|
*
|
|
369
298
|
* @typeParam TTemplateName - Name of the Slide Template that owns the referenced area.
|
|
370
299
|
* @typeParam TAreaName - Name of the referenced Template Area.
|
|
@@ -391,6 +320,89 @@ type TemplateHandle<TTemplates extends SlideTemplateSet, TName extends keyof TTe
|
|
|
391
320
|
} & { readonly [AreaName in TemplateAreaNames<TTemplates, TName>]: TemplateAreaRef<TName, AreaName> } : never;
|
|
392
321
|
type TemplateName<TTemplates extends SlideTemplateSet> = keyof TTemplates & string;
|
|
393
322
|
//#endregion
|
|
323
|
+
//#region src/authoring/props.d.ts
|
|
324
|
+
interface ClassNameValueArray extends ReadonlyArray<ClassNameValue> {}
|
|
325
|
+
type ClassNameObject = Readonly<Record<string, boolean | null | undefined>>;
|
|
326
|
+
type ClassNameValue = string | false | null | undefined | ClassNameValueArray | ClassNameObject;
|
|
327
|
+
type ClassNameAuthorProps = {
|
|
328
|
+
className?: ClassNameValue;
|
|
329
|
+
};
|
|
330
|
+
type TemplateAreaAuthorProps = {
|
|
331
|
+
area?: TemplateAreaRef;
|
|
332
|
+
};
|
|
333
|
+
type ViewNodeProps = {
|
|
334
|
+
style?: ViewStyle;
|
|
335
|
+
} & ClassNameAuthorProps & TemplateAreaAuthorProps;
|
|
336
|
+
type TextNodeProps = {
|
|
337
|
+
style?: TextStyle;
|
|
338
|
+
} & ClassNameAuthorProps & TemplateAreaAuthorProps;
|
|
339
|
+
type TextRunNodeProps = {
|
|
340
|
+
style?: TextRunStyle;
|
|
341
|
+
} & ClassNameAuthorProps;
|
|
342
|
+
type ImageNodeProps = {
|
|
343
|
+
style?: ImageStyle;
|
|
344
|
+
} & ClassNameAuthorProps & TemplateAreaAuthorProps & ({
|
|
345
|
+
src: string;
|
|
346
|
+
data?: string;
|
|
347
|
+
} | {
|
|
348
|
+
src?: string;
|
|
349
|
+
data: string;
|
|
350
|
+
});
|
|
351
|
+
type ShapeNodeProps = {
|
|
352
|
+
style?: ShapeStyle;
|
|
353
|
+
shape?: "rect" | "ellipse" | "line";
|
|
354
|
+
} & ClassNameAuthorProps & TemplateAreaAuthorProps;
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/authoring/tree.d.ts
|
|
357
|
+
type JsxKey = string | number | bigint;
|
|
358
|
+
type SourceSpan = {
|
|
359
|
+
readonly file?: string;
|
|
360
|
+
readonly line?: number;
|
|
361
|
+
readonly column?: number;
|
|
362
|
+
};
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/diagnostics/errors.d.ts
|
|
365
|
+
declare class DeckDiagnosticError extends Error {
|
|
366
|
+
readonly diagnostics: Diagnostics;
|
|
367
|
+
constructor(message: string, diagnostics: Diagnostics);
|
|
368
|
+
}
|
|
369
|
+
declare class SemanticGraphDiagnosticError extends DeckDiagnosticError {
|
|
370
|
+
constructor(diagnostics: Diagnostics);
|
|
371
|
+
}
|
|
372
|
+
declare class CompositionDiagnosticError extends DeckDiagnosticError {
|
|
373
|
+
constructor(diagnostics: Diagnostics);
|
|
374
|
+
}
|
|
375
|
+
declare class StyleDiagnosticError extends DeckDiagnosticError {
|
|
376
|
+
constructor(diagnostics: Diagnostics);
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/diagnostics/format.d.ts
|
|
380
|
+
declare function formatDiagnostic(diagnostic: Diagnostic): string;
|
|
381
|
+
declare function formatDiagnostics(diagnostics: Diagnostics): string;
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/diagnostics/index.d.ts
|
|
384
|
+
type DiagnosticSeverity = "error" | "warning";
|
|
385
|
+
type DiagnosticLabel = {
|
|
386
|
+
readonly message: string;
|
|
387
|
+
readonly path: string;
|
|
388
|
+
readonly sourceSpan?: SourceSpan;
|
|
389
|
+
readonly severity?: "primary" | "secondary";
|
|
390
|
+
};
|
|
391
|
+
type Diagnostic = {
|
|
392
|
+
readonly severity: DiagnosticSeverity;
|
|
393
|
+
readonly code: string;
|
|
394
|
+
readonly title: string;
|
|
395
|
+
readonly message?: string;
|
|
396
|
+
readonly labels: readonly DiagnosticLabel[];
|
|
397
|
+
readonly notes?: readonly string[];
|
|
398
|
+
readonly help?: readonly string[];
|
|
399
|
+
};
|
|
400
|
+
type Diagnostics = {
|
|
401
|
+
readonly items: readonly Diagnostic[];
|
|
402
|
+
readonly hasErrors: boolean;
|
|
403
|
+
readonly hasWarnings: boolean;
|
|
404
|
+
};
|
|
405
|
+
//#endregion
|
|
394
406
|
//#region src/graph/types.d.ts
|
|
395
407
|
type Brand<T, B extends string> = T & {
|
|
396
408
|
readonly __brand: B;
|
|
@@ -447,7 +459,6 @@ type BaseSemanticNode = {
|
|
|
447
459
|
readonly kind: SemanticNodeKind;
|
|
448
460
|
readonly origin: SemanticOrigin;
|
|
449
461
|
readonly authoredTag?: AuthoredTag;
|
|
450
|
-
readonly authoredComponent?: AuthoredComponent;
|
|
451
462
|
readonly role?: SemanticRole;
|
|
452
463
|
readonly key?: JsxKey;
|
|
453
464
|
readonly styleRef?: StyleEntityId;
|
|
@@ -493,7 +504,7 @@ type StyleEntity = {
|
|
|
493
504
|
readonly id: StyleEntityId;
|
|
494
505
|
readonly target: SemanticNodeKind;
|
|
495
506
|
readonly authored: {
|
|
496
|
-
readonly style?:
|
|
507
|
+
readonly style?: StyleDeclaration;
|
|
497
508
|
readonly classRefs?: readonly StyleClassRef[];
|
|
498
509
|
};
|
|
499
510
|
};
|
|
@@ -506,6 +517,9 @@ type AssetEntity = {
|
|
|
506
517
|
} | {
|
|
507
518
|
readonly kind: "data";
|
|
508
519
|
readonly data: string;
|
|
520
|
+
} | {
|
|
521
|
+
readonly kind: "url";
|
|
522
|
+
readonly url: string;
|
|
509
523
|
};
|
|
510
524
|
readonly metadata: {
|
|
511
525
|
readonly mediaType?: string;
|
|
@@ -532,7 +546,7 @@ type TargetedStyleClassDefinition<TStyle extends StyleClassStyle = StyleClassSty
|
|
|
532
546
|
readonly style: TStyle;
|
|
533
547
|
};
|
|
534
548
|
type StyleClassDefinition<TStyle extends StyleClassStyle = StyleClassStyle> = TStyle | TargetedStyleClassDefinition<TStyle>;
|
|
535
|
-
type StyleSheetInput<TClasses extends Readonly<Record<string,
|
|
549
|
+
type StyleSheetInput<TClasses extends Readonly<Record<string, StyleClassDefinition>> = Readonly<Record<string, StyleClassDefinition>>> = {
|
|
536
550
|
readonly classes: StyleSheetClasses<TClasses>;
|
|
537
551
|
};
|
|
538
552
|
type RightmostSelectorPart<TSelector extends string> = TSelector extends `${string} ${infer TRight}` ? RightmostSelectorPart<TRight> : TSelector;
|
|
@@ -545,14 +559,14 @@ type StyleClassDefinitionFor<TDefinition> = TDefinition extends {
|
|
|
545
559
|
} ? TTarget extends StyleTargetSelector | readonly StyleTargetSelector[] ? TStyle extends StyleForStyleTarget<TTarget> ? TDefinition : never : never : TDefinition extends {
|
|
546
560
|
readonly style: infer TStyle;
|
|
547
561
|
} ? TStyle extends StyleClassStyle ? TDefinition : never : TDefinition extends StyleClassStyle ? TDefinition : never;
|
|
548
|
-
type StyleSheetClasses<TClasses extends Readonly<Record<string,
|
|
549
|
-
declare class StyleSheetImpl<TClasses extends Readonly<Record<string,
|
|
562
|
+
type StyleSheetClasses<TClasses extends Readonly<Record<string, StyleClassDefinition>>> = { readonly [ClassName in keyof TClasses]: StyleClassDefinitionFor<TClasses[ClassName]> };
|
|
563
|
+
declare class StyleSheetImpl<TClasses extends Readonly<Record<string, StyleClassDefinition>> = Readonly<Record<string, StyleClassDefinition>>> {
|
|
550
564
|
readonly classes: StyleSheetClasses<TClasses>;
|
|
551
565
|
constructor(input: StyleSheetInput<TClasses>);
|
|
552
566
|
}
|
|
553
|
-
type StyleSheet<TClasses extends Readonly<Record<string,
|
|
567
|
+
type StyleSheet<TClasses extends Readonly<Record<string, StyleClassDefinition>> = Readonly<Record<string, StyleClassDefinition>>> = StyleSheetImpl<TClasses>;
|
|
554
568
|
declare const StyleSheet: {
|
|
555
|
-
new <const TClasses extends Readonly<Record<string,
|
|
569
|
+
new <const TClasses extends Readonly<Record<string, StyleClassDefinition>> = Readonly<Record<string, StyleClassDefinition>>>(input: StyleSheetInput<TClasses>): StyleSheet<TClasses>;
|
|
556
570
|
};
|
|
557
571
|
//#endregion
|
|
558
572
|
//#region src/style/defaults.d.ts
|
|
@@ -560,7 +574,7 @@ type ThemeDefaults = Partial<{ readonly [Tag in AuthoredTag]: StyleForAuthoredTa
|
|
|
560
574
|
//#endregion
|
|
561
575
|
//#region src/style/theme-values.d.ts
|
|
562
576
|
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
563
|
-
type DeepMerge<TBase, TExtension> = TExtension extends readonly
|
|
577
|
+
type DeepMerge<TBase, TExtension> = TExtension extends readonly (infer _ExtensionItem)[] ? TExtension : TBase extends readonly (infer _BaseItem)[] ? TExtension : TBase extends Primitive ? TExtension : TExtension extends Primitive ? TExtension : TBase extends object ? TExtension extends object ? { readonly [Key in keyof TBase | keyof TExtension]: Key extends keyof TExtension ? Key extends keyof TBase ? DeepMerge<TBase[Key], TExtension[Key]> : TExtension[Key] : Key extends keyof TBase ? TBase[Key] : never } : TExtension : TExtension;
|
|
564
578
|
type MergedTheme<TBase extends object, TExtension extends object> = DeepMerge<TBase, TExtension> & object;
|
|
565
579
|
//#endregion
|
|
566
580
|
//#region src/style/theme.d.ts
|
|
@@ -659,53 +673,50 @@ type SlideOptions<TTemplates extends SlideTemplateSet = EmptySlideTemplateSet, T
|
|
|
659
673
|
*/
|
|
660
674
|
type SourceContextMapper<TParentContext, TChildContext> = [TParentContext] extends [void] ? () => TChildContext : (context: TParentContext) => TChildContext;
|
|
661
675
|
type SourceContextInput<TParentContext, TChildContext> = TChildContext | SourceContextMapper<TParentContext, TChildContext>;
|
|
662
|
-
type
|
|
676
|
+
type SourceContextValue = JsxNode | {
|
|
677
|
+
readonly [key: string]: SourceContextValue;
|
|
678
|
+
};
|
|
679
|
+
type SourceContextBinding<TSourceContext = void> = {
|
|
663
680
|
readonly present: false;
|
|
664
681
|
} | {
|
|
665
682
|
readonly present: true;
|
|
666
683
|
readonly value: TSourceContext;
|
|
667
684
|
};
|
|
668
|
-
type CompositionEntry<TSourceContext =
|
|
685
|
+
type CompositionEntry<TSourceContext extends SourceContextValue | void = void, TTemplates extends SlideTemplateSet = SlideTemplateSet> = {
|
|
669
686
|
readonly kind: "slide";
|
|
670
|
-
readonly options?: SlideOptions<
|
|
671
|
-
readonly factory: SlideFactory<TSourceContext, SlideFactoryInput<TSourceContext> & object
|
|
687
|
+
readonly options?: SlideOptions<TTemplates>;
|
|
688
|
+
readonly factory: SlideFactory<TSourceContext, SlideFactoryInput<TSourceContext> & object> | SlideFactory<TSourceContext, SlideFactoryInputWithTemplate<TSourceContext, TTemplates, TemplateName<TTemplates>>>;
|
|
672
689
|
} | {
|
|
673
690
|
readonly kind: "mount";
|
|
674
691
|
readonly sourceKey: string;
|
|
675
|
-
readonly source: CompositionSource<
|
|
676
|
-
readonly contextProvider?: SourceContextInput<TSourceContext,
|
|
692
|
+
readonly source: CompositionSource<SourceContextValue, SlideTemplateSet>;
|
|
693
|
+
readonly contextProvider?: SourceContextInput<TSourceContext, SourceContextValue>;
|
|
677
694
|
readonly invalidExtraContext?: boolean;
|
|
678
695
|
};
|
|
679
|
-
type CompositionSourceInternals<TSourceContext =
|
|
680
|
-
readonly entries: readonly CompositionEntry<TSourceContext>[];
|
|
696
|
+
type CompositionSourceInternals<TSourceContext extends SourceContextValue | void = void, TTemplates extends SlideTemplateSet = SlideTemplateSet> = {
|
|
697
|
+
readonly entries: readonly CompositionEntry<TSourceContext, TTemplates>[];
|
|
681
698
|
readonly stylesheets: readonly StyleSheet[];
|
|
682
699
|
readonly theme?: Theme;
|
|
683
700
|
readonly templates?: SlideTemplateSet;
|
|
684
701
|
readonly cycleId: object;
|
|
685
702
|
readonly boundContext: SourceContextBinding<TSourceContext>;
|
|
686
703
|
};
|
|
687
|
-
type CompositionSource<TSourceContext =
|
|
688
|
-
readonly [COMPOSITION_SOURCE]: () => CompositionSourceInternals<TSourceContext>;
|
|
704
|
+
type CompositionSource<TSourceContext extends SourceContextValue | void = void, TTemplates extends SlideTemplateSet = SlideTemplateSet> = {
|
|
705
|
+
readonly [COMPOSITION_SOURCE]: () => CompositionSourceInternals<TSourceContext, TTemplates>;
|
|
689
706
|
};
|
|
690
707
|
//#endregion
|
|
691
708
|
//#region src/authoring/index.d.ts
|
|
709
|
+
type DeckJsxElement = {
|
|
710
|
+
readonly $$typeof: "deckjsx.author-tree";
|
|
711
|
+
};
|
|
692
712
|
interface TextJsxChildArray extends ReadonlyArray<TextJsxChild> {}
|
|
693
|
-
type TextJsxChild =
|
|
713
|
+
type TextJsxChild = DeckJsxElement | string | number | boolean | null | undefined | TextJsxChildArray;
|
|
694
714
|
interface ContentJsxChildArray extends ReadonlyArray<ContentJsxChild> {}
|
|
695
|
-
type ContentJsxChild =
|
|
715
|
+
type ContentJsxChild = DeckJsxElement | boolean | null | undefined | ContentJsxChildArray;
|
|
696
716
|
interface ViewIntrinsicJsxChildArray extends ReadonlyArray<ViewIntrinsicJsxChild> {}
|
|
697
717
|
type ViewIntrinsicJsxChild = ContentJsxChild | string | number | ViewIntrinsicJsxChildArray;
|
|
698
718
|
interface JsxNodeArray extends ReadonlyArray<JsxNode> {}
|
|
699
|
-
type JsxNode =
|
|
700
|
-
interface ClassNameValueArray extends ReadonlyArray<ClassNameValue> {}
|
|
701
|
-
type ClassNameObject = Readonly<Record<string, boolean | null | undefined>>;
|
|
702
|
-
type ClassNameValue = string | false | null | undefined | ClassNameValueArray | ClassNameObject;
|
|
703
|
-
type ClassNameAuthorProps = {
|
|
704
|
-
className?: ClassNameValue;
|
|
705
|
-
};
|
|
706
|
-
type TemplateAreaAuthorProps = {
|
|
707
|
-
area?: TemplateAreaRef;
|
|
708
|
-
};
|
|
719
|
+
type JsxNode = DeckJsxElement | string | number | boolean | null | undefined | JsxNodeArray;
|
|
709
720
|
type DeckOptions<TTemplates extends SlideTemplateSet = EmptySlideTemplateSet> = {
|
|
710
721
|
layout: {
|
|
711
722
|
width: number;
|
|
@@ -723,100 +734,32 @@ type DeckOptions<TTemplates extends SlideTemplateSet = EmptySlideTemplateSet> =
|
|
|
723
734
|
format?: "pptx";
|
|
724
735
|
};
|
|
725
736
|
};
|
|
726
|
-
type SlideNodeProps = {
|
|
727
|
-
name?: string;
|
|
728
|
-
template?: string;
|
|
729
|
-
className?: ClassNameValue;
|
|
730
|
-
style?: SlideStyle;
|
|
731
|
-
background?: string;
|
|
732
|
-
backgroundImage?: string;
|
|
733
|
-
backgroundColor?: string;
|
|
734
|
-
backgroundTransparency?: number;
|
|
735
|
-
backgroundPosition?: string;
|
|
736
|
-
backgroundSize?: string;
|
|
737
|
-
backgroundRepeat?: string;
|
|
738
|
-
backgroundClip?: string;
|
|
739
|
-
backgroundOrigin?: string;
|
|
740
|
-
};
|
|
741
|
-
type SlideProps = SlideNodeProps & {
|
|
742
|
-
children?: ContentJsxChild;
|
|
743
|
-
};
|
|
744
|
-
type ViewNodeProps = {
|
|
745
|
-
style?: ViewStyle;
|
|
746
|
-
} & ClassNameAuthorProps & TemplateAreaAuthorProps & ViewStyle;
|
|
747
|
-
type ViewProps = ViewNodeProps & {
|
|
748
|
-
children?: ContentJsxChild;
|
|
749
|
-
};
|
|
750
|
-
type TextNodeProps = {
|
|
751
|
-
style?: TextStyle;
|
|
752
|
-
} & ClassNameAuthorProps & TemplateAreaAuthorProps & TextStyle;
|
|
753
|
-
type TextProps = TextNodeProps & {
|
|
754
|
-
children?: TextJsxChild;
|
|
755
|
-
};
|
|
756
|
-
type TextRunNodeProps = {
|
|
757
|
-
style?: TextRunStyle;
|
|
758
|
-
} & ClassNameAuthorProps & TextRunStyle;
|
|
759
|
-
type ImageNodeProps = {
|
|
760
|
-
style?: ImageStyle;
|
|
761
|
-
} & ClassNameAuthorProps & TemplateAreaAuthorProps & ImageStyle & ({
|
|
762
|
-
src: string;
|
|
763
|
-
data?: string;
|
|
764
|
-
} | {
|
|
765
|
-
src?: string;
|
|
766
|
-
data: string;
|
|
767
|
-
});
|
|
768
737
|
type ImageProps = ImageNodeProps & {
|
|
769
738
|
children?: never;
|
|
770
739
|
};
|
|
771
|
-
type ShapeNodeProps = {
|
|
772
|
-
style?: ShapeStyle;
|
|
773
|
-
shape: "rect" | "ellipse" | "line";
|
|
774
|
-
} & ClassNameAuthorProps & TemplateAreaAuthorProps & ShapeStyle;
|
|
775
740
|
type ShapeProps = ShapeNodeProps & {
|
|
776
741
|
children?: never;
|
|
777
742
|
};
|
|
778
|
-
type
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
image: ImageProps;
|
|
783
|
-
shape: ShapeProps;
|
|
784
|
-
};
|
|
785
|
-
type AuthorNodeKind = keyof AuthorNodeMap;
|
|
786
|
-
type BaseAuthorNode<K extends AuthorNodeKind, P, C> = {
|
|
787
|
-
readonly $$typeof: "deckjsx.author-node";
|
|
788
|
-
readonly kind: K;
|
|
789
|
-
readonly props: P;
|
|
790
|
-
readonly children: ReadonlyArray<C>;
|
|
791
|
-
};
|
|
792
|
-
interface SlideAuthorNode extends BaseAuthorNode<"slide", SlideNodeProps, ContentJsxChild> {}
|
|
793
|
-
interface ViewAuthorNode extends BaseAuthorNode<"view", ViewNodeProps, ContentJsxChild> {}
|
|
794
|
-
interface TextAuthorNode extends BaseAuthorNode<"text", TextNodeProps, TextJsxChild> {}
|
|
795
|
-
interface ImageAuthorNode extends BaseAuthorNode<"image", ImageNodeProps, never> {}
|
|
796
|
-
interface ShapeAuthorNode extends BaseAuthorNode<"shape", ShapeNodeProps, never> {}
|
|
797
|
-
type AuthorNodeByKind = {
|
|
798
|
-
slide: SlideAuthorNode;
|
|
799
|
-
view: ViewAuthorNode;
|
|
800
|
-
text: TextAuthorNode;
|
|
801
|
-
image: ImageAuthorNode;
|
|
802
|
-
shape: ShapeAuthorNode;
|
|
803
|
-
};
|
|
804
|
-
type AuthorNode<K extends AuthorNodeKind = AuthorNodeKind> = AuthorNodeByKind[K];
|
|
805
|
-
type IntrinsicDivProps = ViewNodeProps & {
|
|
743
|
+
type IntrinsicKeyProps = {
|
|
744
|
+
key?: JsxKey;
|
|
745
|
+
};
|
|
746
|
+
type IntrinsicDivProps = ViewNodeProps & IntrinsicKeyProps & {
|
|
806
747
|
children?: ViewIntrinsicJsxChild;
|
|
807
748
|
};
|
|
808
|
-
type IntrinsicPProps = TextNodeProps & {
|
|
749
|
+
type IntrinsicPProps = TextNodeProps & IntrinsicKeyProps & {
|
|
809
750
|
children?: TextJsxChild;
|
|
810
751
|
};
|
|
811
|
-
type IntrinsicSpanProps = TextRunNodeProps & {
|
|
752
|
+
type IntrinsicSpanProps = TextRunNodeProps & IntrinsicKeyProps & {
|
|
812
753
|
children?: TextJsxChild;
|
|
813
754
|
};
|
|
814
|
-
type IntrinsicImgProps = ImageProps;
|
|
755
|
+
type IntrinsicImgProps = ImageProps & IntrinsicKeyProps;
|
|
756
|
+
type IntrinsicShapeProps = ShapeProps & IntrinsicKeyProps;
|
|
815
757
|
type IntrinsicViewTag = "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section";
|
|
816
758
|
type IntrinsicTextTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
|
|
817
759
|
type DeckJsxIntrinsicElements = {
|
|
818
760
|
img: IntrinsicImgProps;
|
|
761
|
+
shape: IntrinsicShapeProps;
|
|
819
762
|
span: IntrinsicSpanProps;
|
|
820
763
|
} & { [Tag in IntrinsicViewTag]: IntrinsicDivProps } & { [Tag in IntrinsicTextTag]: IntrinsicPProps };
|
|
821
764
|
//#endregion
|
|
822
|
-
export {
|
|
765
|
+
export { Diagnostics as $, StackAlignment as $t, BaseSemanticNode as A, CssGridAutoFlow as At, SemanticRole as B, CssObjectPosition as Bt, SourceContextValue as C, CssAlignSelf as Ct, StyleSheet as D, CssFlexBasis as Dt, ThemeDefaults as E, CssDisplay as Et, SemanticDocumentNode as F, CssGridTemplateAreas as Ft, SourceIdentity as G, DeckPointLength as Gt, SemanticSlideNode as H, CssPosition as Ht, SemanticImageNode as I, CssGridTemplateShorthand as It, StyleEntity as J, ImageStyle as Jt, SourceOrigin as K, ImageCropAuthoring as Kt, SemanticNode as L, CssGridTrack as Lt, GraphNodeId as M, CssGridPlacement as Mt, SemanticAuthorGraph as N, CssGridShorthand as Nt, AssetEntity as O, CssFlexDirection as Ot, SemanticContainerNode as P, CssGridTemplate as Pt, DiagnosticSeverity as Q, Spacing as Qt, SemanticNodeKind as R, CssJustifyContent as Rt, SourceContextMapper as S, CssAlignItems as St, ThemeInput as T, CssBoxSizing as Tt, SemanticTextNode as U, CssVisibility as Ut, SemanticShapeNode as V, CssOverflow as Vt, SemanticTextRunNode as W, DeckLength as Wt, Diagnostic as X, ShapeStyle as Xt, StyleEntityId as Y, LayoutMode as Yt, DiagnosticLabel as Z, SlideStyle as Zt, SlideFactory as _, TemplateFrame as _t, IntrinsicDivProps as a, StyleDeclarationValue as an, StyleDiagnosticError as at, SlideOptions as b, BorderStyle as bt, IntrinsicShapeProps as c, TextStyle as cn, ClassNameObject as ct, JsxNode as d, TextTabStopLength as dn, EmptySlideTemplateSet as dt, StackAxis as en, formatDiagnostic as et, TextJsxChild as f, VerticalAlign as fn, SlideTemplate as ft, CompositionSourceInternals as g, TemplateAreaRef as gt, CompositionSource as h, TemplateAreaKind as ht, DeckOptions as i, StyleDeclaration as in, SemanticGraphDiagnosticError as it, Brand as j, CssGridLine as jt, AssetEntityId as k, CssFlexWrap as kt, IntrinsicTextTag as l, TextTabStopAlignment as ln, ClassNameValue as lt, CompositionContext as m, TemplateArea as mt, DeckJsxElement as n, StrokeLineCap as nn, CompositionDiagnosticError as nt, IntrinsicImgProps as o, TextFit as on, JsxKey as ot, COMPOSITION_SOURCE as p, ViewStyle as pn, SlideTemplateSet as pt, StyleClassRef as q, ImageCropValue as qt, DeckJsxIntrinsicElements as r, StrokeLineJoin as rn, DeckDiagnosticError as rt, IntrinsicPProps as s, TextRunStyle as sn, SourceSpan as st, ContentJsxChild as t, StrokeDashType as tn, formatDiagnostics as tt, IntrinsicViewTag as u, TextTabStopAuthoring as un, ClassNameValueArray as ut, SlideFactoryInput as v, TemplateHandle as vt, Theme as w, CssAspectRatio as wt, SourceContextInput as x, CssAlignContent as xt, SlideFactoryInputWithTemplate as y, TemplateName as yt, SemanticOrigin as z, CssJustifySelf as zt };
|