deckjsx 0.5.0 → 0.7.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 +72 -54
- package/dist/adapter-NxGlM8_c.d.mts +22 -0
- package/dist/{pptxgenjs-BTMKb1WX.mjs → adapter-rS3mWdi0.mjs} +229 -128
- package/dist/adapter.d.mts +2 -0
- package/dist/adapter.mjs +2 -0
- package/dist/{index-sb451NVh.d.mts → index-C-LDA3Lj.d.mts} +260 -139
- package/dist/index.d.mts +183 -4
- package/dist/index.mjs +7517 -5319
- package/dist/inspect.d.mts +3 -3
- package/dist/{jsx-CK-x7PLd.mjs → jsx-DetoUfLm.mjs} +102 -113
- package/dist/jsx-dev-runtime.d.mts +2 -2
- package/dist/jsx-dev-runtime.mjs +1 -1
- package/dist/{jsx-runtime-Bk7Wx3AL.d.mts → jsx-runtime-Dz8WBHpq.d.mts} +2 -3
- package/dist/jsx-runtime.d.mts +2 -2
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/pptx-DaSXvESd.d.mts +448 -0
- package/package.json +2 -2
- package/dist/deck-CvTHG5ik.d.mts +0 -78
- package/dist/index-_eBM2cs3.d.mts +0 -245
- package/dist/legacy.d.mts +0 -6
- package/dist/legacy.mjs +0 -2
package/dist/inspect.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
export { type AssetEntity, type AssetEntityId, type BaseSemanticNode, type
|
|
1
|
+
import { $ as StyleEntityId, B as SemanticImageNode, G as SemanticShapeNode, H as SemanticNodeKind, I as GraphNodeId, J as SemanticTextRunNode, K as SemanticSlideNode, L as SemanticAuthorGraph, M as AssetEntity, N as AssetEntityId, P as BaseSemanticNode, Q as StyleEntity, R as SemanticContainerNode, U as SemanticOrigin, V as SemanticNode, W as SemanticRole, X as SourceOrigin, Y as SourceIdentity, Z as StyleClassRef, q as SemanticTextNode, z as SemanticDocumentNode } from "./index-C-LDA3Lj.mjs";
|
|
2
|
+
import { A as PptxContentTypeDefault, C as ProjectInspectionSummary, D as ResolvedStyleProperty, E as ResolvedStyleMap, M as PptxContentTypesPayload, N as PptxRelationshipsPayload, O as ResolvedStyleSource, S as ProjectInspectionResolvedValues, T as ResolvedStyleLayer, _ as ProjectInspectionAdapterLimitation, a as PptxElementKind, b as ProjectInspectionMediaSummary, c as PptxPackagePart, d as PptxRelationship, f as PptxRelationshipsPart, g as PptxSupportPartPayload, h as PptxSlidePart, i as PptxElementId, j as PptxContentTypeOverride, k as StyleResolutionResult, l as PptxPackagePartCategory, m as PptxSerializedIdentity, n as PptxContentTypesPart, o as PptxElementOrigin, p as PptxSerializedIdentities, r as PptxElement, s as PptxPackageModel, t as PackagePartId, u as PptxPackagePartKind, v as ProjectInspectionDiagnosticSummary, w as ResolvedStyle, x as ProjectInspectionPartSummary, y as ProjectInspectionElementSummary } from "./pptx-DaSXvESd.mjs";
|
|
3
|
+
export { type AssetEntity, type AssetEntityId, type BaseSemanticNode, type GraphNodeId, type PackagePartId, type PptxContentTypeDefault, type PptxContentTypeOverride, type PptxContentTypesPart, type PptxContentTypesPayload, type PptxElement, type PptxElementId, type PptxElementKind, type PptxElementOrigin, type PptxPackageModel, type PptxPackagePart, type PptxPackagePartCategory, type PptxPackagePartKind, type PptxRelationship, type PptxRelationshipsPart, type PptxRelationshipsPayload, type PptxSerializedIdentities, type PptxSerializedIdentity, type PptxSlidePart, type PptxSupportPartPayload, type ProjectInspectionAdapterLimitation, type ProjectInspectionDiagnosticSummary, type ProjectInspectionElementSummary, type ProjectInspectionMediaSummary, type ProjectInspectionPartSummary, type ProjectInspectionResolvedValues, type ProjectInspectionSummary, type ResolvedStyle, type ResolvedStyleLayer, type ResolvedStyleMap, type ResolvedStyleProperty, type ResolvedStyleSource, type SemanticAuthorGraph, type SemanticContainerNode, type SemanticDocumentNode, type SemanticImageNode, type SemanticNode, type SemanticNodeKind, type SemanticOrigin, type SemanticRole, type SemanticShapeNode, type SemanticSlideNode, type SemanticTextNode, type SemanticTextRunNode, type SourceIdentity, type SourceOrigin, type StyleClassRef, type StyleEntity, type StyleEntityId, type StyleResolutionResult };
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
//#region src/authoring/tags.ts
|
|
2
|
+
const INTRINSIC_VIEW_TAGS = new Set([
|
|
3
|
+
"article",
|
|
4
|
+
"aside",
|
|
5
|
+
"div",
|
|
6
|
+
"figure",
|
|
7
|
+
"footer",
|
|
8
|
+
"header",
|
|
9
|
+
"main",
|
|
10
|
+
"nav",
|
|
11
|
+
"section"
|
|
12
|
+
]);
|
|
13
|
+
const INTRINSIC_TEXT_TAGS = new Set([
|
|
14
|
+
"h1",
|
|
15
|
+
"h2",
|
|
16
|
+
"h3",
|
|
17
|
+
"h4",
|
|
18
|
+
"h5",
|
|
19
|
+
"h6",
|
|
20
|
+
"p"
|
|
21
|
+
]);
|
|
22
|
+
function isIntrinsicViewTag(value) {
|
|
23
|
+
return INTRINSIC_VIEW_TAGS.has(value);
|
|
24
|
+
}
|
|
25
|
+
function isIntrinsicTextTag(value) {
|
|
26
|
+
return INTRINSIC_TEXT_TAGS.has(value);
|
|
27
|
+
}
|
|
28
|
+
function isAuthoredTag(value) {
|
|
29
|
+
return isIntrinsicViewTag(value) || isIntrinsicTextTag(value) || value === "img" || value === "span";
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
1
32
|
//#region src/authoring/tree.ts
|
|
2
33
|
function isRecord$1(value) {
|
|
3
34
|
return typeof value === "object" && value !== null;
|
|
@@ -48,109 +79,14 @@ function collectChildren(propsObject, children) {
|
|
|
48
79
|
return children;
|
|
49
80
|
}
|
|
50
81
|
//#endregion
|
|
51
|
-
//#region src/authoring/
|
|
52
|
-
function splitChildren(props) {
|
|
53
|
-
const { children, ...nodeProps } = props;
|
|
54
|
-
return {
|
|
55
|
-
props: nodeProps,
|
|
56
|
-
children: children === void 0 ? [] : [children]
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function leafProps(props) {
|
|
60
|
-
const { children: _children, ...nodeProps } = props;
|
|
61
|
-
return nodeProps;
|
|
62
|
-
}
|
|
63
|
-
function Slide(props) {
|
|
64
|
-
const authored = splitChildren(props);
|
|
65
|
-
return createAuthorElement({
|
|
66
|
-
source: {
|
|
67
|
-
kind: "component",
|
|
68
|
-
component: "Slide"
|
|
69
|
-
},
|
|
70
|
-
props: authored.props,
|
|
71
|
-
children: authored.children
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function View(props) {
|
|
75
|
-
const authored = splitChildren(props);
|
|
76
|
-
return createAuthorElement({
|
|
77
|
-
source: {
|
|
78
|
-
kind: "component",
|
|
79
|
-
component: "View"
|
|
80
|
-
},
|
|
81
|
-
props: authored.props,
|
|
82
|
-
children: authored.children
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function Text(props) {
|
|
86
|
-
const authored = splitChildren(props);
|
|
87
|
-
return createAuthorElement({
|
|
88
|
-
source: {
|
|
89
|
-
kind: "component",
|
|
90
|
-
component: "Text"
|
|
91
|
-
},
|
|
92
|
-
props: authored.props,
|
|
93
|
-
children: authored.children
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
function Image(props) {
|
|
97
|
-
return createAuthorElement({
|
|
98
|
-
source: {
|
|
99
|
-
kind: "component",
|
|
100
|
-
component: "Image"
|
|
101
|
-
},
|
|
102
|
-
props: leafProps(props)
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
function Shape(props) {
|
|
106
|
-
return createAuthorElement({
|
|
107
|
-
source: {
|
|
108
|
-
kind: "component",
|
|
109
|
-
component: "Shape"
|
|
110
|
-
},
|
|
111
|
-
props: leafProps(props)
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/authoring/tags.ts
|
|
116
|
-
const INTRINSIC_VIEW_TAGS = new Set([
|
|
117
|
-
"article",
|
|
118
|
-
"aside",
|
|
119
|
-
"div",
|
|
120
|
-
"figure",
|
|
121
|
-
"footer",
|
|
122
|
-
"header",
|
|
123
|
-
"main",
|
|
124
|
-
"nav",
|
|
125
|
-
"section"
|
|
126
|
-
]);
|
|
127
|
-
const INTRINSIC_TEXT_TAGS = new Set([
|
|
128
|
-
"h1",
|
|
129
|
-
"h2",
|
|
130
|
-
"h3",
|
|
131
|
-
"h4",
|
|
132
|
-
"h5",
|
|
133
|
-
"h6",
|
|
134
|
-
"p"
|
|
135
|
-
]);
|
|
136
|
-
function isIntrinsicViewTag(value) {
|
|
137
|
-
return INTRINSIC_VIEW_TAGS.has(value);
|
|
138
|
-
}
|
|
139
|
-
function isIntrinsicTextTag(value) {
|
|
140
|
-
return INTRINSIC_TEXT_TAGS.has(value);
|
|
141
|
-
}
|
|
142
|
-
function isAuthoredTag(value) {
|
|
143
|
-
return isIntrinsicViewTag(value) || isIntrinsicTextTag(value) || value === "img" || value === "span";
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/authoring/legacy.ts
|
|
82
|
+
//#region src/authoring/author-node.ts
|
|
147
83
|
function textFromPrimitive(value) {
|
|
148
84
|
if (typeof value === "string" && value.trim().length === 0) return null;
|
|
149
85
|
const text = typeof value === "string" && /[\n\r\t]/.test(value) ? value.trim() : String(value);
|
|
150
86
|
if (text.length === 0) return null;
|
|
151
|
-
return
|
|
87
|
+
return authorNode("text", {}, [text]);
|
|
152
88
|
}
|
|
153
|
-
function
|
|
89
|
+
function authorNode(kind, props, children) {
|
|
154
90
|
return {
|
|
155
91
|
$$typeof: "deckjsx.author-node",
|
|
156
92
|
kind,
|
|
@@ -186,33 +122,86 @@ function convertChildrenFor(kind, children) {
|
|
|
186
122
|
converted.push(child.value);
|
|
187
123
|
continue;
|
|
188
124
|
}
|
|
189
|
-
converted.push(
|
|
125
|
+
converted.push(toAuthorNode(child));
|
|
190
126
|
}
|
|
191
127
|
return converted;
|
|
192
128
|
}
|
|
193
|
-
function
|
|
129
|
+
function toAuthorNode(node) {
|
|
194
130
|
const kind = elementKind(node);
|
|
195
131
|
const props = node.props;
|
|
196
132
|
switch (kind) {
|
|
197
|
-
case "slide": return
|
|
198
|
-
case "view": return
|
|
199
|
-
case "text": return
|
|
200
|
-
case "image": return
|
|
201
|
-
case "shape": return
|
|
133
|
+
case "slide": return authorNode("slide", props, convertChildrenFor(kind, node.children));
|
|
134
|
+
case "view": return authorNode("view", props, convertChildrenFor(kind, node.children));
|
|
135
|
+
case "text": return authorNode("text", props, convertChildrenFor(kind, node.children));
|
|
136
|
+
case "image": return authorNode("image", props, []);
|
|
137
|
+
case "shape": return authorNode("shape", props, []);
|
|
202
138
|
}
|
|
203
139
|
}
|
|
204
|
-
function
|
|
205
|
-
if (
|
|
206
|
-
if (Array.isArray(value)) return value.map((item) =>
|
|
140
|
+
function toAuthorJsxNode(value) {
|
|
141
|
+
if (isAuthorNodeValue(value)) return value;
|
|
142
|
+
if (Array.isArray(value)) return value.map((item) => toAuthorJsxNode(item));
|
|
207
143
|
if (!isAuthorTreeNode(value)) return value;
|
|
208
|
-
if (value.kind === "fragment") return value.children.map((child) =>
|
|
144
|
+
if (value.kind === "fragment") return value.children.map((child) => toAuthorJsxNode(child));
|
|
209
145
|
if (value.kind === "text") return value.value;
|
|
210
|
-
return
|
|
146
|
+
return toAuthorNode(value);
|
|
211
147
|
}
|
|
212
|
-
function
|
|
148
|
+
function isAuthorNodeValue(value) {
|
|
213
149
|
return typeof value === "object" && value !== null && "$$typeof" in value && value.$$typeof === "deckjsx.author-node";
|
|
214
150
|
}
|
|
215
151
|
//#endregion
|
|
152
|
+
//#region src/authoring/components.ts
|
|
153
|
+
function splitChildren(props) {
|
|
154
|
+
const { children, ...nodeProps } = props;
|
|
155
|
+
return {
|
|
156
|
+
props: nodeProps,
|
|
157
|
+
children: children === void 0 ? [] : [children]
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function leafProps(props) {
|
|
161
|
+
const { children: _children, ...nodeProps } = props;
|
|
162
|
+
return nodeProps;
|
|
163
|
+
}
|
|
164
|
+
function View(props) {
|
|
165
|
+
const authored = splitChildren(props);
|
|
166
|
+
return createAuthorElement({
|
|
167
|
+
source: {
|
|
168
|
+
kind: "component",
|
|
169
|
+
component: "View"
|
|
170
|
+
},
|
|
171
|
+
props: authored.props,
|
|
172
|
+
children: authored.children
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function Text(props) {
|
|
176
|
+
const authored = splitChildren(props);
|
|
177
|
+
return createAuthorElement({
|
|
178
|
+
source: {
|
|
179
|
+
kind: "component",
|
|
180
|
+
component: "Text"
|
|
181
|
+
},
|
|
182
|
+
props: authored.props,
|
|
183
|
+
children: authored.children
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function Image(props) {
|
|
187
|
+
return createAuthorElement({
|
|
188
|
+
source: {
|
|
189
|
+
kind: "component",
|
|
190
|
+
component: "Image"
|
|
191
|
+
},
|
|
192
|
+
props: leafProps(props)
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function Shape(props) {
|
|
196
|
+
return createAuthorElement({
|
|
197
|
+
source: {
|
|
198
|
+
kind: "component",
|
|
199
|
+
component: "Shape"
|
|
200
|
+
},
|
|
201
|
+
props: leafProps(props)
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
216
205
|
//#region src/jsx.ts
|
|
217
206
|
function isRecord(value) {
|
|
218
207
|
return typeof value === "object" && value !== null;
|
|
@@ -277,7 +266,7 @@ function isAuthorNodeKind(value) {
|
|
|
277
266
|
return value === "slide" || value === "view" || value === "text" || value === "image" || value === "shape";
|
|
278
267
|
}
|
|
279
268
|
function isAuthorNode(value) {
|
|
280
|
-
if (!
|
|
269
|
+
if (!isAuthorNodeValue(value)) return false;
|
|
281
270
|
return isAuthorNodeKind(value.kind);
|
|
282
271
|
}
|
|
283
272
|
function isSlideNode(value) {
|
|
@@ -287,4 +276,4 @@ function isContentNode(value) {
|
|
|
287
276
|
return isAuthorNode(value) && value.kind !== "slide";
|
|
288
277
|
}
|
|
289
278
|
//#endregion
|
|
290
|
-
export { isContentNode as a,
|
|
279
|
+
export { isContentNode as a, Shape as c, isAuthorNodeValue as d, toAuthorJsxNode as f, isAuthoredTag as h, isAuthorNode as i, Text as l, isAuthorTreeNode as m, createElement as n, isSlideNode as o, createAuthorElement as p, createElementWithMetadata as r, Image as s, Fragment as t, View as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as Fragment, n as jsx, r as jsxs, t as JSX } from "./jsx-runtime-
|
|
1
|
+
import { fn as AuthorTreeNode, pn as JsxKey } from "./index-C-LDA3Lj.mjs";
|
|
2
|
+
import { i as Fragment, n as jsx, r as jsxs, t as JSX } from "./jsx-runtime-Dz8WBHpq.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx-dev-runtime.d.ts
|
|
5
5
|
declare function jsxDEV(type: unknown, props: unknown, key?: JsxKey, _isStaticChildren?: boolean, source?: unknown): AuthorTreeNode;
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as createElementWithMetadata, t as Fragment } from "./jsx-
|
|
1
|
+
import { r as createElementWithMetadata, t as Fragment } from "./jsx-DetoUfLm.mjs";
|
|
2
2
|
import { jsx, jsxs } from "./jsx-runtime.mjs";
|
|
3
3
|
//#region src/jsx-dev-runtime.ts
|
|
4
4
|
function sourceSpanFromDevSource(source) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as ViewProps, a as DeckJsxIntrinsicElements, c as IntrinsicDivProps, d as IntrinsicTextTag$1, dn as AuthorTreeChild, f as IntrinsicViewTag$1, fn as AuthorTreeNode, gn as IntrinsicViewTag, h as TextProps, hn as IntrinsicTextTag, l as IntrinsicImgProps, p as ShapeProps, pn as JsxKey, s as ImageProps, u as IntrinsicPProps, un as AuthorElementNode } from "./index-C-LDA3Lj.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/authoring/components.d.ts
|
|
4
|
-
declare function Slide(props: SlideProps): AuthorElementNode;
|
|
5
4
|
declare function View(props: ViewProps): AuthorElementNode;
|
|
6
5
|
declare function Text(props: TextProps): AuthorElementNode;
|
|
7
6
|
declare function Image(props: ImageProps): AuthorElementNode;
|
|
@@ -54,4 +53,4 @@ declare namespace JSX {
|
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
//#endregion
|
|
57
|
-
export { createElement as a,
|
|
56
|
+
export { createElement as a, Text as c, Fragment as i, View as l, jsx as n, Image as o, jsxs as r, Shape as s, JSX as t };
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as Fragment, n as jsx, r as jsxs, t as JSX } from "./jsx-runtime-
|
|
1
|
+
import { pn as JsxKey } from "./index-C-LDA3Lj.mjs";
|
|
2
|
+
import { i as Fragment, n as jsx, r as jsxs, t as JSX } from "./jsx-runtime-Dz8WBHpq.mjs";
|
|
3
3
|
export { Fragment, JSX, JsxKey, jsx, jsxs };
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as createElementWithMetadata, t as Fragment } from "./jsx-
|
|
1
|
+
import { r as createElementWithMetadata, t as Fragment } from "./jsx-DetoUfLm.mjs";
|
|
2
2
|
//#region src/jsx-runtime.ts
|
|
3
3
|
function jsx(type, props, key) {
|
|
4
4
|
return createElementWithMetadata(type, props, key);
|