deckjsx 0.1.2 → 0.2.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/README.md +68 -28
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-dev-runtime.mjs +1 -1
- package/dist/{jsx-Cj45FgcC.mjs → jsx-lqMAdW2X.mjs} +73 -1
- package/dist/{jsx-runtime-BfZK5259.d.mts → jsx-runtime-BWV9tOov.d.mts} +28 -4
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# deckjsx
|
|
2
2
|
|
|
3
|
-
`deckjsx` is a TypeScript library for generating presentation files from JSX through a compiler
|
|
3
|
+
`deckjsx` is a TypeScript library for generating presentation files from JSX through a compiler
|
|
4
|
+
pipeline.
|
|
4
5
|
|
|
5
6
|
The intended architecture is:
|
|
6
7
|
|
|
@@ -13,7 +14,8 @@ JSX
|
|
|
13
14
|
```
|
|
14
15
|
|
|
15
16
|
This project is being designed as a compiler, not as a thin `PptxGenJS` wrapper.
|
|
16
|
-
The
|
|
17
|
+
The API uses a class-based compiler with callback-based `.add()`, `.render()`, and `.output()`.
|
|
18
|
+
Authoring uses typed JSX elements with a `style` object prop.
|
|
17
19
|
|
|
18
20
|
The implementation preserves the compiler model with explicit module boundaries for authoring,
|
|
19
21
|
style normalization, layout, IR, backend emission, and Node runtime output.
|
|
@@ -29,7 +31,7 @@ The package currently targets Node.js output and ships a `pptxgenjs` backend.
|
|
|
29
31
|
## Usage
|
|
30
32
|
|
|
31
33
|
```tsx
|
|
32
|
-
import { Deck, Slide
|
|
34
|
+
import { Deck, Slide } from "deckjsx";
|
|
33
35
|
|
|
34
36
|
const deck = new Deck({
|
|
35
37
|
layout: { width: 13.333, height: 7.5, unit: "in" },
|
|
@@ -38,38 +40,41 @@ const deck = new Deck({
|
|
|
38
40
|
|
|
39
41
|
deck.add(({ slideIndex, totalSlides }) => (
|
|
40
42
|
<Slide name={`Slide ${slideIndex + 1}`} style={{ backgroundColor: "#F8FAFC" }}>
|
|
41
|
-
<
|
|
43
|
+
<main
|
|
42
44
|
style={{
|
|
43
45
|
x: 0.7,
|
|
44
46
|
y: 0.5,
|
|
45
|
-
width: 8.5,
|
|
46
|
-
height: 0.6,
|
|
47
|
-
fontSize: 28,
|
|
48
|
-
fontWeight: 700,
|
|
49
|
-
color: "#0F172A",
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
Quarterly Review
|
|
53
|
-
</Text>
|
|
54
|
-
<View
|
|
55
|
-
style={{
|
|
56
|
-
x: 0.7,
|
|
57
|
-
y: 1.4,
|
|
58
47
|
width: 11.9,
|
|
59
|
-
height:
|
|
48
|
+
height: 6.3,
|
|
60
49
|
display: "grid",
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
gridTemplateRows: ["0.9in", "1fr", "0.4in"],
|
|
51
|
+
rowGap: 0.25,
|
|
63
52
|
}}
|
|
64
53
|
>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
<header>
|
|
55
|
+
<h1 style={{ width: "100%", height: 0.6, fontSize: 28, fontWeight: 700, color: "#0F172A" }}>
|
|
56
|
+
Quarterly Review
|
|
57
|
+
</h1>
|
|
58
|
+
</header>
|
|
59
|
+
|
|
60
|
+
<section style={{ display: "grid", gridTemplateColumns: "1fr 1fr", columnGap: 0.35 }}>
|
|
61
|
+
<p style={{ fontSize: 18, color: "#334155", fit: "shrink" }}>
|
|
62
|
+
Author slides with typed JSX, inspect the generated IR, and emit PPTX files through the
|
|
63
|
+
backend boundary.
|
|
64
|
+
</p>
|
|
65
|
+
<figure style={{ backgroundColor: "#E0F2FE", borderRadius: 0.15, padding: 0.25 }}>
|
|
66
|
+
<img src="chart.png" style={{ width: "100%", height: "100%", fit: "contain" }} />
|
|
67
|
+
</figure>
|
|
68
|
+
</section>
|
|
69
|
+
|
|
70
|
+
<footer>
|
|
71
|
+
<p
|
|
72
|
+
style={{ width: "100%", height: 0.3, fontSize: 11, color: "#64748B", textAlign: "right" }}
|
|
73
|
+
>
|
|
74
|
+
{slideIndex + 1} / {totalSlides}
|
|
75
|
+
</p>
|
|
76
|
+
</footer>
|
|
77
|
+
</main>
|
|
73
78
|
</Slide>
|
|
74
79
|
));
|
|
75
80
|
|
|
@@ -80,6 +85,41 @@ await deck.output({ backend: "pptxgenjs", output: "quarterly-review.pptx" });
|
|
|
80
85
|
Use `deck.render()` for tests, snapshots, and backend-independent inspection. Use
|
|
81
86
|
`deck.output({ backend: "pptxgenjs", output })` when writing a PowerPoint file.
|
|
82
87
|
|
|
88
|
+
## JSX elements
|
|
89
|
+
|
|
90
|
+
`deckjsx` supports both the original capitalized components and a typed HTML-like JSX surface.
|
|
91
|
+
|
|
92
|
+
View-like elements compile to grouped layout containers:
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
<main>
|
|
96
|
+
<header />
|
|
97
|
+
<section />
|
|
98
|
+
<article />
|
|
99
|
+
<aside />
|
|
100
|
+
<nav />
|
|
101
|
+
<footer />
|
|
102
|
+
<figure />
|
|
103
|
+
</main>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Text-like elements compile to text boxes:
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
<h1>Title</h1>
|
|
110
|
+
<h2>Section</h2>
|
|
111
|
+
<p>Body copy</p>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Image elements compile to images and require either `src` or `data`:
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
<img src="diagram.png" style={{ width: 4, height: 2.5, fit: "contain" }} />
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Primitive string and number children inside view-like elements are normalized to implicit text
|
|
121
|
+
nodes. Inline rich text with `span` is intentionally reserved for a later release.
|
|
122
|
+
|
|
83
123
|
## View Layout Semantics
|
|
84
124
|
|
|
85
125
|
`View` is a containing block for its children. Child `x`, `y`, `left`, `top`, `right`,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ImageProps, A as CssFlexBasis, At as ViewProps, B as CssGridTrack, C as ContentJsxChild, Ct as TextJsxChild, D as CssAspectRatio, Dt as TextTabStopAuthoring, E as CssAlignSelf, Et as TextTabStopAlignment, F as CssGridPlacement, G as CssPosition, H as CssJustifySelf, I as CssGridShorthand, J as DeckLength, K as CssVisibility, L as CssGridTemplate, M as CssFlexWrap, N as CssGridAutoFlow, O as CssBoxSizing, Ot as TextTabStopLength, P as CssGridLine, Q as ImageCropValue, R as CssGridTemplateAreas, S as ContentAuthorNode, St as TextFit, T as CssAlignItems, Tt as TextStyle, U as CssObjectPosition, V as CssJustifyContent, W as CssOverflow, X as DeckPointLength, Y as DeckOptions, Z as ImageCropAuthoring, _ as AuthorNodeMap, _t as StackAlignment, a as Fragment, at as IntrinsicTextTag, b as BackendName, bt as StrokeLineCap, c as Slide, ct as LayoutMode, d as createElement, dt as ShapeStyle, et as ImageStyle, f as isAuthorNode, ft as SlideContext, g as AuthorNodeKind, gt as Spacing, h as AuthorNode, ht as SlideStyle, it as IntrinsicPProps, j as CssFlexDirection, jt as ViewStyle, k as CssDisplay, kt as VerticalAlign, l as Text, lt as OutputConfig, m as isSlideNode, mt as SlideProps, n as JsxKey, nt as IntrinsicDivProps, o as Image, ot as IntrinsicViewTag, p as isContentNode, pt as SlideFactory, q as DeckJsxIntrinsicElements, rt as IntrinsicImgProps, s as Shape, st as JsxNode, tt as ImplementedBackendName, u as View, ut as ShapeProps, v as AuthorNodeProps, vt as StackAxis, w as CssAlignContent, wt as TextProps, x as BorderStyle, xt as StrokeLineJoin, y as AuthorNodePropsMap, yt as StrokeDashType, z as CssGridTemplateShorthand } from "./jsx-runtime-BWV9tOov.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/ir/index.d.ts
|
|
4
4
|
type PresentationIR = {
|
|
@@ -263,8 +263,8 @@ declare global {
|
|
|
263
263
|
interface IntrinsicAttributes {
|
|
264
264
|
key?: JsxKey;
|
|
265
265
|
}
|
|
266
|
-
interface IntrinsicElements {}
|
|
266
|
+
interface IntrinsicElements extends DeckJsxIntrinsicElements {}
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
//#endregion
|
|
270
|
-
export { type AuthorNode, type AuthorNodeKind, type AuthorNodeMap, type AuthorNodeProps, type AuthorNodePropsMap, type BackendArtifact, type BackendName, type BackgroundImageLayerIR, type BackgroundLayerIR, type BaseNodeIR, type BorderStyle, type CompileBackend, type ContentAuthorNode, 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, type DeckLength, type DeckOptions, type DeckPointLength, EMU_PER_INCH, type EdgeStrokeIR, type FillIR, Fragment, type FrameIR, type GroupIR, type HyperlinkIR, Image, type ImageCropAuthoring, type ImageCropIR, type ImageCropValue, type ImageIR, type ImageProps, type ImageSourceIR, type ImageStyle, type ImplementedBackendName, type JsxKey, type JsxNode, type LayoutMode, type LinearGradientFillIR, type LinearGradientStopIR, type NodeIR, type ObjectPositionIR, type OutputConfig, POINTS_PER_INCH, type PresentationIR, type RadialGradientFillIR, type ShadowIR, Shape, type ShapeIR, type ShapeProps, type ShapeStyle, type SizeIR, Slide, type SlideContext, type SlideFactory, type SlideIR, type SlideProps, type SlideStyle, type SolidFillIR, type Spacing, type StackAlignment, type StackAxis, type StrokeDashType, type StrokeIR, type StrokeLineCap, type StrokeLineJoin, Text, type TextBulletListIR, type TextContentIR, type TextFit, type TextIR, type TextJsxChild, type TextListIR, type TextNoListIR, type TextNumberListIR, type TextProps, type TextStyle, type TextStyleIR, type TextTabStopAlignment, type TextTabStopAuthoring, type TextTabStopIR, type TextTabStopLength, type VerticalAlign, View, type ViewProps, type ViewStyle, createElement, isAuthorNode, isContentNode, isSlideNode, pptxgenjsBackend };
|
|
270
|
+
export { type AuthorNode, type AuthorNodeKind, type AuthorNodeMap, type AuthorNodeProps, type AuthorNodePropsMap, type BackendArtifact, type BackendName, type BackgroundImageLayerIR, type BackgroundLayerIR, type BaseNodeIR, type BorderStyle, type CompileBackend, type ContentAuthorNode, 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, type DeckJsxIntrinsicElements, type DeckLength, type DeckOptions, type DeckPointLength, EMU_PER_INCH, type EdgeStrokeIR, type FillIR, Fragment, type FrameIR, type GroupIR, type HyperlinkIR, Image, type ImageCropAuthoring, type ImageCropIR, type ImageCropValue, type ImageIR, type ImageProps, type ImageSourceIR, type ImageStyle, type ImplementedBackendName, type IntrinsicDivProps, type IntrinsicImgProps, type IntrinsicPProps, type IntrinsicTextTag, type IntrinsicViewTag, type JsxKey, type JsxNode, type LayoutMode, type LinearGradientFillIR, type LinearGradientStopIR, type NodeIR, type ObjectPositionIR, type OutputConfig, POINTS_PER_INCH, type PresentationIR, type RadialGradientFillIR, type ShadowIR, Shape, type ShapeIR, type ShapeProps, type ShapeStyle, type SizeIR, Slide, type SlideContext, type SlideFactory, type SlideIR, type SlideProps, type SlideStyle, type SolidFillIR, type Spacing, type StackAlignment, type StackAxis, type StrokeDashType, type StrokeIR, type StrokeLineCap, type StrokeLineJoin, Text, type TextBulletListIR, type TextContentIR, type TextFit, type TextIR, type TextJsxChild, type TextListIR, type TextNoListIR, type TextNumberListIR, type TextProps, type TextStyle, type TextStyleIR, type TextTabStopAlignment, type TextTabStopAuthoring, type TextTabStopIR, type TextTabStopLength, type VerticalAlign, View, type ViewProps, type ViewStyle, createElement, isAuthorNode, isContentNode, isSlideNode, pptxgenjsBackend };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Text, c as isAuthorNode, i as Slide, l as isContentNode, n as Image, o as View, r as Shape, s as createElement, t as Fragment, u as isSlideNode } from "./jsx-
|
|
1
|
+
import { a as Text, c as isAuthorNode, i as Slide, l as isContentNode, n as Image, o as View, r as Shape, s as createElement, t as Fragment, u as isSlideNode } from "./jsx-lqMAdW2X.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
4
|
import { dirname } from "node:path";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Fragment, i as jsxs, r as jsx, t as JSX } from "./jsx-runtime-
|
|
1
|
+
import { a as Fragment, i as jsxs, r as jsx, t as JSX } from "./jsx-runtime-BWV9tOov.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsx as jsxDEV, jsxs };
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
//#region src/jsx.ts
|
|
2
|
+
const VIEW_INTRINSIC_TAGS = new Set([
|
|
3
|
+
"article",
|
|
4
|
+
"aside",
|
|
5
|
+
"div",
|
|
6
|
+
"figure",
|
|
7
|
+
"footer",
|
|
8
|
+
"header",
|
|
9
|
+
"main",
|
|
10
|
+
"nav",
|
|
11
|
+
"section"
|
|
12
|
+
]);
|
|
13
|
+
const TEXT_INTRINSIC_TAGS = new Set([
|
|
14
|
+
"h1",
|
|
15
|
+
"h2",
|
|
16
|
+
"h3",
|
|
17
|
+
"h4",
|
|
18
|
+
"h5",
|
|
19
|
+
"h6",
|
|
20
|
+
"p"
|
|
21
|
+
]);
|
|
2
22
|
function isRecord(value) {
|
|
3
23
|
return typeof value === "object" && value !== null;
|
|
4
24
|
}
|
|
25
|
+
function isViewIntrinsicTag(value) {
|
|
26
|
+
return VIEW_INTRINSIC_TAGS.has(value);
|
|
27
|
+
}
|
|
28
|
+
function isTextIntrinsicTag(value) {
|
|
29
|
+
return TEXT_INTRINSIC_TAGS.has(value);
|
|
30
|
+
}
|
|
5
31
|
function isJsxNode(value) {
|
|
6
32
|
return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || isAuthorNode(value) || Array.isArray(value) && value.every((item) => isJsxNode(item));
|
|
7
33
|
}
|
|
34
|
+
function isTextJsxNode(value) {
|
|
35
|
+
return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every((item) => isTextJsxNode(item));
|
|
36
|
+
}
|
|
8
37
|
function requireJsxNode(value) {
|
|
9
38
|
if (isJsxNode(value)) return value;
|
|
10
39
|
throw new Error("JSX children must be deckjsx nodes or primitive text values.");
|
|
11
40
|
}
|
|
41
|
+
function requireTextJsxNode(value) {
|
|
42
|
+
if (isTextJsxNode(value)) return value;
|
|
43
|
+
throw new Error("Text-like intrinsic children must be primitive text values.");
|
|
44
|
+
}
|
|
12
45
|
function flattenChildren(input) {
|
|
13
46
|
if (Array.isArray(input)) return input.flatMap((item) => flattenChildren(item));
|
|
14
47
|
return [input];
|
|
@@ -31,8 +64,47 @@ function splitLeafProps(props) {
|
|
|
31
64
|
const { children: _rawChildren, ...nodeProps } = props;
|
|
32
65
|
return nodeProps;
|
|
33
66
|
}
|
|
67
|
+
function collectRawChildren(propsObject, children) {
|
|
68
|
+
if (children.length === 0) return propsObject.children;
|
|
69
|
+
if (children.length === 1) return children[0];
|
|
70
|
+
return children;
|
|
71
|
+
}
|
|
72
|
+
function implicitTextNode(value) {
|
|
73
|
+
if (typeof value === "string" && value.trim().length === 0) return null;
|
|
74
|
+
const text = typeof value === "string" && /[\n\r\t]/.test(value) ? value.trim() : String(value);
|
|
75
|
+
if (text.length === 0) return null;
|
|
76
|
+
return Text({ children: text });
|
|
77
|
+
}
|
|
78
|
+
function normalizeViewIntrinsicChildren(value) {
|
|
79
|
+
if (value === void 0) return;
|
|
80
|
+
return flattenChildren(value).map((child) => {
|
|
81
|
+
if (typeof child === "string" || typeof child === "number") return implicitTextNode(child);
|
|
82
|
+
return child;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function intrinsicElement(type, propsObject, children) {
|
|
86
|
+
const rawChildren = collectRawChildren(propsObject, children);
|
|
87
|
+
const { children: _children, ...nodeProps } = propsObject;
|
|
88
|
+
if (isViewIntrinsicTag(type)) {
|
|
89
|
+
const viewChildren = requireJsxNode(rawChildren);
|
|
90
|
+
return View({
|
|
91
|
+
...nodeProps,
|
|
92
|
+
children: normalizeViewIntrinsicChildren(viewChildren)
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (isTextIntrinsicTag(type)) return Text({
|
|
96
|
+
...nodeProps,
|
|
97
|
+
children: requireTextJsxNode(rawChildren)
|
|
98
|
+
});
|
|
99
|
+
if (rawChildren !== void 0) throw new Error("<img> is a leaf element and does not accept children.");
|
|
100
|
+
if (typeof propsObject.src !== "string" && typeof propsObject.data !== "string") throw new Error("<img> requires either src or data.");
|
|
101
|
+
return Image(nodeProps);
|
|
102
|
+
}
|
|
34
103
|
function createElement(type, props, ...children) {
|
|
35
|
-
if (typeof type === "string")
|
|
104
|
+
if (typeof type === "string") {
|
|
105
|
+
if (isViewIntrinsicTag(type) || isTextIntrinsicTag(type) || type === "img") return intrinsicElement(type, isRecord(props) ? props : {}, children);
|
|
106
|
+
throw new Error(`Intrinsic element is not supported: <${type}>.`);
|
|
107
|
+
}
|
|
36
108
|
if (typeof type !== "function") throw new Error("JSX element type must be a function component.");
|
|
37
109
|
const propsObject = isRecord(props) ? props : {};
|
|
38
110
|
return type({
|
|
@@ -54,6 +54,8 @@ type TextJsxChild = string | number | boolean | null | undefined | TextJsxChildA
|
|
|
54
54
|
type ContentAuthorNode = AuthorNode<"view" | "text" | "image" | "shape">;
|
|
55
55
|
interface ContentJsxChildArray extends ReadonlyArray<ContentJsxChild> {}
|
|
56
56
|
type ContentJsxChild = AuthorNode | boolean | null | undefined | ContentJsxChildArray;
|
|
57
|
+
interface ViewIntrinsicJsxChildArray extends ReadonlyArray<ViewIntrinsicJsxChild> {}
|
|
58
|
+
type ViewIntrinsicJsxChild = ContentJsxChild | string | number | ViewIntrinsicJsxChildArray;
|
|
57
59
|
interface JsxNodeArray extends ReadonlyArray<JsxNode> {}
|
|
58
60
|
type JsxNode = AuthorNode | string | number | boolean | null | undefined | JsxNodeArray;
|
|
59
61
|
type BaseAuthorProps = {
|
|
@@ -310,9 +312,13 @@ type TextProps = TextNodeProps & {
|
|
|
310
312
|
};
|
|
311
313
|
type ImageNodeProps = {
|
|
312
314
|
style?: ImageStyle;
|
|
313
|
-
|
|
315
|
+
} & ImageStyle & ({
|
|
316
|
+
src: string;
|
|
314
317
|
data?: string;
|
|
315
|
-
}
|
|
318
|
+
} | {
|
|
319
|
+
src?: string;
|
|
320
|
+
data: string;
|
|
321
|
+
});
|
|
316
322
|
type ImageProps = ImageNodeProps & {
|
|
317
323
|
children?: never;
|
|
318
324
|
};
|
|
@@ -358,6 +364,18 @@ type AuthorNodeByKind = {
|
|
|
358
364
|
shape: ShapeAuthorNode;
|
|
359
365
|
};
|
|
360
366
|
type AuthorNode<K extends AuthorNodeKind = AuthorNodeKind> = AuthorNodeByKind[K];
|
|
367
|
+
type IntrinsicDivProps = ViewNodeProps & {
|
|
368
|
+
children?: ViewIntrinsicJsxChild;
|
|
369
|
+
};
|
|
370
|
+
type IntrinsicPProps = TextNodeProps & {
|
|
371
|
+
children?: TextJsxChild;
|
|
372
|
+
};
|
|
373
|
+
type IntrinsicImgProps = ImageProps;
|
|
374
|
+
type IntrinsicViewTag = "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section";
|
|
375
|
+
type IntrinsicTextTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
|
|
376
|
+
type DeckJsxIntrinsicElements = {
|
|
377
|
+
img: IntrinsicImgProps;
|
|
378
|
+
} & { [Tag in IntrinsicViewTag]: IntrinsicDivProps } & { [Tag in IntrinsicTextTag]: IntrinsicPProps };
|
|
361
379
|
//#endregion
|
|
362
380
|
//#region src/jsx.d.ts
|
|
363
381
|
type ComponentProps = {
|
|
@@ -372,6 +390,9 @@ type ElementChildArgs<P> = P extends {
|
|
|
372
390
|
declare function createElement<P extends {
|
|
373
391
|
children?: unknown;
|
|
374
392
|
}, R extends JsxNode>(type: (props: P) => R, props: (Omit<P, "children"> & Partial<Pick<P, "children">>) | null, ...children: ElementChildArgs<P>): R;
|
|
393
|
+
declare function createElement(type: IntrinsicViewTag, props: (Omit<IntrinsicDivProps, "children"> & Partial<Pick<IntrinsicDivProps, "children">>) | null, ...children: ElementChildArgs<IntrinsicDivProps>): AuthorNode<"view">;
|
|
394
|
+
declare function createElement(type: IntrinsicTextTag, props: (Omit<IntrinsicPProps, "children"> & Partial<Pick<IntrinsicPProps, "children">>) | null, ...children: ElementChildArgs<IntrinsicPProps>): AuthorNode<"text">;
|
|
395
|
+
declare function createElement(type: "img", props: IntrinsicImgProps): AuthorNode<"image">;
|
|
375
396
|
declare function createElement(type: string, props: ComponentProps | null): never;
|
|
376
397
|
declare function Fragment(props: {
|
|
377
398
|
children?: ContentJsxChild;
|
|
@@ -392,6 +413,9 @@ type JsxProps<P> = P extends {
|
|
|
392
413
|
children?: unknown;
|
|
393
414
|
} ? Omit<P, "children"> & Partial<Pick<P, "children">> : P;
|
|
394
415
|
declare function jsx<P, R extends JsxNode>(type: JsxComponent<P, R>, props: JsxProps<P> | null, key?: JsxKey): R;
|
|
416
|
+
declare function jsx(type: IntrinsicViewTag, props: JsxProps<IntrinsicDivProps> | null, key?: JsxKey): JsxNode;
|
|
417
|
+
declare function jsx(type: IntrinsicTextTag, props: JsxProps<IntrinsicPProps> | null, key?: JsxKey): JsxNode;
|
|
418
|
+
declare function jsx(type: "img", props: IntrinsicImgProps, key?: JsxKey): JsxNode;
|
|
395
419
|
declare function jsx(type: string, props: Record<string, unknown> | null, key?: JsxKey): never;
|
|
396
420
|
declare const jsxs: typeof jsx;
|
|
397
421
|
declare namespace JSX {
|
|
@@ -402,7 +426,7 @@ declare namespace JSX {
|
|
|
402
426
|
interface IntrinsicAttributes {
|
|
403
427
|
key?: JsxKey;
|
|
404
428
|
}
|
|
405
|
-
interface IntrinsicElements {}
|
|
429
|
+
interface IntrinsicElements extends DeckJsxIntrinsicElements {}
|
|
406
430
|
}
|
|
407
431
|
//#endregion
|
|
408
|
-
export {
|
|
432
|
+
export { ImageProps as $, CssFlexBasis as A, ViewProps as At, CssGridTrack as B, ContentJsxChild as C, TextJsxChild as Ct, CssAspectRatio as D, TextTabStopAuthoring as Dt, CssAlignSelf as E, TextTabStopAlignment as Et, CssGridPlacement as F, CssPosition as G, CssJustifySelf as H, CssGridShorthand as I, DeckLength as J, CssVisibility as K, CssGridTemplate as L, CssFlexWrap as M, CssGridAutoFlow as N, CssBoxSizing as O, TextTabStopLength as Ot, CssGridLine as P, ImageCropValue as Q, CssGridTemplateAreas as R, ContentAuthorNode as S, TextFit as St, CssAlignItems as T, TextStyle as Tt, CssObjectPosition as U, CssJustifyContent as V, CssOverflow as W, DeckPointLength as X, DeckOptions as Y, ImageCropAuthoring as Z, AuthorNodeMap as _, StackAlignment as _t, Fragment as a, IntrinsicTextTag as at, BackendName as b, StrokeLineCap as bt, Slide as c, LayoutMode as ct, createElement as d, ShapeStyle as dt, ImageStyle as et, isAuthorNode as f, SlideContext as ft, AuthorNodeKind as g, Spacing as gt, AuthorNode as h, SlideStyle as ht, jsxs as i, IntrinsicPProps as it, CssFlexDirection as j, ViewStyle as jt, CssDisplay as k, VerticalAlign as kt, Text as l, OutputConfig as lt, isSlideNode as m, SlideProps as mt, JsxKey as n, IntrinsicDivProps as nt, Image as o, IntrinsicViewTag as ot, isContentNode as p, SlideFactory as pt, DeckJsxIntrinsicElements as q, jsx as r, IntrinsicImgProps as rt, Shape as s, JsxNode as st, JSX as t, ImplementedBackendName as tt, View as u, ShapeProps as ut, AuthorNodeProps as v, StackAxis as vt, CssAlignContent as w, TextProps as wt, BorderStyle as x, StrokeLineJoin as xt, AuthorNodePropsMap as y, StrokeDashType as yt, CssGridTemplateShorthand as z };
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Fragment, i as jsxs, n as JsxKey, r as jsx, t as JSX } from "./jsx-runtime-
|
|
1
|
+
import { a as Fragment, i as jsxs, n as JsxKey, r as jsx, t as JSX } from "./jsx-runtime-BWV9tOov.mjs";
|
|
2
2
|
export { Fragment, JSX, JsxKey, jsx, jsxs };
|
package/dist/jsx-runtime.mjs
CHANGED