deckjsx 0.6.0 → 0.8.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 +140 -25
- package/dist/adapter-BamaV2yi.mjs +8638 -0
- package/dist/adapter-C2AHiDGa.d.mts +38 -0
- package/dist/adapter.d.mts +2 -2
- package/dist/adapter.mjs +2 -2
- package/dist/{index-C5l8PX5V.d.mts → index-dx2ZSBgF.d.mts} +380 -314
- package/dist/index.d.mts +202 -32
- package/dist/index.mjs +5557 -1063
- package/dist/inspect.d.mts +4 -3
- package/dist/inspect.mjs +2 -1
- package/dist/jsx-DGGM5erN.mjs +403 -0
- package/dist/jsx-dev-runtime.d.mts +26 -4
- package/dist/jsx-dev-runtime.mjs +6 -7
- package/dist/jsx-runtime-_eIs-wi1.d.mts +42 -0
- package/dist/jsx-runtime.d.mts +3 -3
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/model-BVkO8qGK.d.mts +1257 -0
- package/dist/model-DIuh51qh.mjs +32 -0
- package/dist/node-output-ChRpOCV8.mjs +28 -0
- package/dist/resolve-BD1dHxZd.d.mts +36 -0
- package/package.json +6 -22
- package/dist/adapter-BbtteJ7s.mjs +0 -11244
- package/dist/adapter-C8xw46nz.d.mts +0 -22
- package/dist/jsx-C671yNZa.mjs +0 -290
- package/dist/jsx-runtime-DwfBuBkY.d.mts +0 -57
- package/dist/pptx-PzEK54aA.d.mts +0 -448
package/dist/inspect.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as
|
|
3
|
-
|
|
1
|
+
import { A as BaseSemanticNode, B as SemanticRole, F as SemanticDocumentNode, G as SourceIdentity, H as SemanticSlideNode, I as SemanticImageNode, J as StyleEntity, K as SourceOrigin, L as SemanticNode, M as GraphNodeId, N as SemanticAuthorGraph, O as AssetEntity, P as SemanticContainerNode, R as SemanticNodeKind, U as SemanticTextNode, V as SemanticShapeNode, W as SemanticTextRunNode, Y as StyleEntityId, k as AssetEntityId, q as StyleClassRef, z as SemanticOrigin } from "./index-dx2ZSBgF.mjs";
|
|
2
|
+
import { $ as PptxSupportPartPayload, $t as isPptxRelationshipsPart, A as PptxPackagePartKind, At as ProjectInspectionEffectiveProjectedStyleEntry, B as PptxRelationshipsPart, Bt as ProjectInspectionPaintFallbackAggregationEntry, C as PptxNotesPlaceholderPayload, Ct as PptxVisibility, D as PptxPackagePartCandidate, Dt as ProjectInspectionComposedPaintOrderSlideView, E as PptxPackagePart, Et as ProjectInspectionComposedPaintOrderEntry, F as PptxPackagePartRequirementStatus, Ft as ProjectInspectionMediaSummary, G as PptxShapeElement, Gt as ProjectInspectionSummary, H as PptxSerializedIdentities, Ht as ProjectInspectionPartSummary, I as PptxPaintOrderInput, It as ProjectInspectionPackageDependencyInvalidationEntry, J as PptxSlideLayoutPartPayload, Jt as ProjectInspectionUnsupportedSemanticRecord, K as PptxSlideDrawing, Kt as ProjectInspectionThemeProjectionEntry, L as PptxPictureElement, Lt as ProjectInspectionPackageDependencyInvalidationView, M as PptxPackagePartOrderKey, Mt as ProjectInspectionElementSummary, N as PptxPackagePartRequirement, Nt as ProjectInspectionFilteredReason, O as PptxPackagePartCategory, Ot as ProjectInspectionDetails, P as PptxPackagePartRequirementCondition, Pt as ProjectInspectionFilteredRecord, Q as PptxSupportPart, Qt as isPptxPackagePart, R as PptxPresentationSlideMasterId, Rt as ProjectInspectionPackageDependencyReason, S as PptxMediaPartPayload, St as PptxUnsupportedSemanticFeature, T as PptxPackageModelCandidate, Tt as ProjectInspectionBackgroundLayerSummary, U as PptxSerializedIdentity, Ut as ProjectInspectionRelationshipSummary, V as PptxRelationshipsPayload, Vt as ProjectInspectionPaintFallbackAggregationView, W as PptxShadow, Wt as ProjectInspectionResolvedValues, X as PptxSlideMasterPartPayload, Xt as isPptxMediaPart, Y as PptxSlideMasterLayoutId, Yt as isPptxContentTypesPart, Z as PptxSlidePart, Zt as isPptxPackageModel, _ as PptxKnownPackagePart, _t as PptxThemeValueGroupFingerprint, a as PptxContentTypeOverride, at as PptxThemeEffectiveInheritanceStep, b as PptxMediaMetadata, bt as PptxUnsupportedFallbackStrategy, c as PptxDrawingNode, ct as PptxThemeProjectionPayload, d as PptxElementKind, dt as PptxThemeReferenceSerializationChoice, en as isPptxSlidePart, et as PptxTextElement, f as PptxElementOrigin, ft as PptxThemeReferenceSerializationDecision, g as PptxGroupElement, gt as PptxThemeValueGroup, h as PptxGeneratedStrokeLayer, ht as PptxThemeUnprojectedMapping, i as PptxContentTypeDefault, it as PptxThemeDefaultStyleProjectionTarget, j as PptxPackagePartOrderGroup, jt as ProjectInspectionEffectiveProjectedStyleSlideView, k as PptxPackagePartDependencyFingerprint, kt as ProjectInspectionDiagnosticSummary, l as PptxElement, lt as PptxThemeProjectionTrace, m as PptxEmptySupportPartPayload, mt as PptxThemeSupportMapping, n as PptxBackgroundLayer, nt as PptxThemeDefaultStyleDecision, o as PptxContentTypesPart, ot as PptxThemeEffectiveInheritanceTrace, p as PptxEmissionTarget, pt as PptxThemeReferenceSerializationKind, q as PptxSlideLayoutAnchor, qt as ProjectInspectionThemeProjectionView, r as PptxClip, rt as PptxThemeDefaultStyleDecisionKind, s as PptxContentTypesPayload, st as PptxThemePartPayload, t as PackagePartId, tn as isPptxSupportPart, tt as PptxThemeConcreteDrawingPropertyMapping, u as PptxElementId, ut as PptxThemeReferenceCandidate, v as PptxLayoutAnchor, vt as PptxThemeWholeThemeMapping, w as PptxPackageModel, wt as ProjectInspectionAdapterLimitation, x as PptxMediaPart, xt as PptxUnsupportedSemantic, y as PptxMeasurement, yt as PptxUnsupportedFallback, z as PptxRelationship, zt as ProjectInspectionPackageDependencySummary } from "./model-BVkO8qGK.mjs";
|
|
3
|
+
import { a as ResolvedStyleSource, i as ResolvedStyleProperty, n as ResolvedStyleLayer, o as StyleResolutionResult, r as ResolvedStyleMap, t as ResolvedStyle } from "./resolve-BD1dHxZd.mjs";
|
|
4
|
+
export { type AssetEntity, type AssetEntityId, type BaseSemanticNode, type GraphNodeId, type PackagePartId, type PptxBackgroundLayer, type PptxClip, type PptxContentTypeDefault, type PptxContentTypeOverride, type PptxContentTypesPart, type PptxContentTypesPayload, type PptxDrawingNode, type PptxElement, type PptxElementId, type PptxElementKind, type PptxElementOrigin, type PptxEmissionTarget, type PptxEmptySupportPartPayload, type PptxGeneratedStrokeLayer, type PptxGroupElement, type PptxKnownPackagePart, type PptxLayoutAnchor, type PptxMeasurement, type PptxMediaMetadata, type PptxMediaPart, type PptxMediaPartPayload, type PptxNotesPlaceholderPayload, type PptxPackageModel, type PptxPackageModelCandidate, type PptxPackagePart, type PptxPackagePartCandidate, type PptxPackagePartCategory, type PptxPackagePartDependencyFingerprint, type PptxPackagePartKind, type PptxPackagePartOrderGroup, type PptxPackagePartOrderKey, type PptxPackagePartRequirement, type PptxPackagePartRequirementCondition, type PptxPackagePartRequirementStatus, type PptxPaintOrderInput, type PptxPictureElement, type PptxPresentationSlideMasterId, type PptxRelationship, type PptxRelationshipsPart, type PptxRelationshipsPayload, type PptxSerializedIdentities, type PptxSerializedIdentity, type PptxShadow, type PptxShapeElement, type PptxSlideDrawing, type PptxSlideLayoutAnchor, type PptxSlideLayoutPartPayload, type PptxSlideMasterLayoutId, type PptxSlideMasterPartPayload, type PptxSlidePart, type PptxSupportPart, type PptxSupportPartPayload, type PptxTextElement, type PptxThemeConcreteDrawingPropertyMapping, type PptxThemeDefaultStyleDecision, type PptxThemeDefaultStyleDecisionKind, type PptxThemeDefaultStyleProjectionTarget, type PptxThemeEffectiveInheritanceStep, type PptxThemeEffectiveInheritanceTrace, type PptxThemePartPayload, type PptxThemeProjectionPayload, type PptxThemeProjectionTrace, type PptxThemeReferenceCandidate, type PptxThemeReferenceSerializationChoice, type PptxThemeReferenceSerializationDecision, type PptxThemeReferenceSerializationKind, type PptxThemeSupportMapping, type PptxThemeUnprojectedMapping, type PptxThemeValueGroup, type PptxThemeValueGroupFingerprint, type PptxThemeWholeThemeMapping, type PptxUnsupportedFallback, type PptxUnsupportedFallbackStrategy, type PptxUnsupportedSemantic, type PptxUnsupportedSemanticFeature, type PptxVisibility, type ProjectInspectionAdapterLimitation, type ProjectInspectionBackgroundLayerSummary, type ProjectInspectionComposedPaintOrderEntry, type ProjectInspectionComposedPaintOrderSlideView, type ProjectInspectionDetails, type ProjectInspectionDiagnosticSummary, type ProjectInspectionEffectiveProjectedStyleEntry, type ProjectInspectionEffectiveProjectedStyleSlideView, type ProjectInspectionElementSummary, type ProjectInspectionFilteredReason, type ProjectInspectionFilteredRecord, type ProjectInspectionMediaSummary, type ProjectInspectionPackageDependencyInvalidationEntry, type ProjectInspectionPackageDependencyInvalidationView, type ProjectInspectionPackageDependencyReason, type ProjectInspectionPackageDependencySummary, type ProjectInspectionPaintFallbackAggregationEntry, type ProjectInspectionPaintFallbackAggregationView, type ProjectInspectionPartSummary, type ProjectInspectionRelationshipSummary, type ProjectInspectionResolvedValues, type ProjectInspectionSummary, type ProjectInspectionThemeProjectionEntry, type ProjectInspectionThemeProjectionView, type ProjectInspectionUnsupportedSemanticRecord, 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, isPptxContentTypesPart, isPptxMediaPart, isPptxPackageModel, isPptxPackagePart, isPptxRelationshipsPart, isPptxSlidePart, isPptxSupportPart };
|
package/dist/inspect.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as isPptxRelationshipsPart, i as isPptxPackagePart, n as isPptxMediaPart, o as isPptxSlidePart, r as isPptxPackageModel, s as isPptxSupportPart, t as isPptxContentTypesPart } from "./model-DIuh51qh.mjs";
|
|
2
|
+
export { isPptxContentTypesPart, isPptxMediaPart, isPptxPackageModel, isPptxPackagePart, isPptxRelationshipsPart, isPptxSlidePart, isPptxSupportPart };
|
|
@@ -0,0 +1,403 @@
|
|
|
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 === "shape" || value === "span";
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/authoring/tree.ts
|
|
33
|
+
function isRecord$1(value) {
|
|
34
|
+
return typeof value === "object" && value !== null;
|
|
35
|
+
}
|
|
36
|
+
function isAuthorElementPropValue(value) {
|
|
37
|
+
if (value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean") return true;
|
|
38
|
+
if (Array.isArray(value)) return value.every(isAuthorElementPropValue);
|
|
39
|
+
if (typeof value !== "object" || isAuthorTreeNode(value)) return false;
|
|
40
|
+
return Object.values(value).every(isAuthorElementPropValue);
|
|
41
|
+
}
|
|
42
|
+
function authorElementPropsFromEntries(entries) {
|
|
43
|
+
const props = {};
|
|
44
|
+
for (const [key, value] of entries) {
|
|
45
|
+
if (!isAuthorElementPropValue(value)) throw new Error(`JSX prop "${key}" must be serializable authoring data.`);
|
|
46
|
+
props[key] = value;
|
|
47
|
+
}
|
|
48
|
+
return props;
|
|
49
|
+
}
|
|
50
|
+
function createAuthorText(value, sourceSpan) {
|
|
51
|
+
return {
|
|
52
|
+
$$typeof: "deckjsx.author-tree",
|
|
53
|
+
kind: "text",
|
|
54
|
+
value,
|
|
55
|
+
...sourceSpan ? { sourceSpan } : {}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function buildAuthorElement(input) {
|
|
59
|
+
return {
|
|
60
|
+
$$typeof: "deckjsx.author-tree",
|
|
61
|
+
kind: "element",
|
|
62
|
+
source: input.source,
|
|
63
|
+
...input.key !== void 0 ? { key: input.key } : {},
|
|
64
|
+
props: input.props,
|
|
65
|
+
children: normalizeAuthorChildren(input.children ?? []),
|
|
66
|
+
...input.sourceSpan ? { sourceSpan: input.sourceSpan } : {}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function isSlideElementInput(input) {
|
|
70
|
+
return input.source.kind === "slide";
|
|
71
|
+
}
|
|
72
|
+
function isViewElementInput(input) {
|
|
73
|
+
return input.source.kind === "tag" && isIntrinsicViewTag(input.source.tag);
|
|
74
|
+
}
|
|
75
|
+
function isTextElementInput(input) {
|
|
76
|
+
return input.source.kind === "tag" && isIntrinsicTextTag(input.source.tag);
|
|
77
|
+
}
|
|
78
|
+
function isSpanElementInput(input) {
|
|
79
|
+
return input.source.kind === "tag" && input.source.tag === "span";
|
|
80
|
+
}
|
|
81
|
+
function isImageElementInput(input) {
|
|
82
|
+
return input.source.kind === "tag" && input.source.tag === "img";
|
|
83
|
+
}
|
|
84
|
+
function isShapeElementInput(input) {
|
|
85
|
+
return input.source.kind === "tag" && input.source.tag === "shape";
|
|
86
|
+
}
|
|
87
|
+
function createAuthorElement(input) {
|
|
88
|
+
if (isSlideElementInput(input)) return buildAuthorElement({
|
|
89
|
+
...input,
|
|
90
|
+
source: input.source,
|
|
91
|
+
props: input.props ?? {}
|
|
92
|
+
});
|
|
93
|
+
if (isViewElementInput(input)) return buildAuthorElement({
|
|
94
|
+
...input,
|
|
95
|
+
source: input.source,
|
|
96
|
+
props: input.props ?? {}
|
|
97
|
+
});
|
|
98
|
+
if (isTextElementInput(input)) return buildAuthorElement({
|
|
99
|
+
...input,
|
|
100
|
+
source: input.source,
|
|
101
|
+
props: input.props ?? {}
|
|
102
|
+
});
|
|
103
|
+
if (isSpanElementInput(input)) return buildAuthorElement({
|
|
104
|
+
...input,
|
|
105
|
+
source: input.source,
|
|
106
|
+
props: input.props ?? {}
|
|
107
|
+
});
|
|
108
|
+
if (isImageElementInput(input)) return buildAuthorElement({
|
|
109
|
+
...input,
|
|
110
|
+
source: input.source,
|
|
111
|
+
props: input.props
|
|
112
|
+
});
|
|
113
|
+
if (isShapeElementInput(input)) return buildAuthorElement({
|
|
114
|
+
...input,
|
|
115
|
+
source: input.source,
|
|
116
|
+
props: input.props
|
|
117
|
+
});
|
|
118
|
+
throw new Error("Unsupported author element source.");
|
|
119
|
+
}
|
|
120
|
+
function createAuthorFragment(input) {
|
|
121
|
+
return {
|
|
122
|
+
$$typeof: "deckjsx.author-tree",
|
|
123
|
+
kind: "fragment",
|
|
124
|
+
...input.key !== void 0 ? { key: input.key } : {},
|
|
125
|
+
children: normalizeAuthorChildren(input.children ?? []),
|
|
126
|
+
...input.sourceSpan ? { sourceSpan: input.sourceSpan } : {}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function isAuthorTreeNode(value) {
|
|
130
|
+
return isRecord$1(value) && value.$$typeof === "deckjsx.author-tree";
|
|
131
|
+
}
|
|
132
|
+
function isAuthorTreeChild(value) {
|
|
133
|
+
return value === null || value === void 0 || typeof value === "boolean" || typeof value === "string" || typeof value === "number" || isAuthorTreeNode(value) || Array.isArray(value) && value.every(isAuthorTreeChild);
|
|
134
|
+
}
|
|
135
|
+
function authorTreeChildrenFromUnknown(children) {
|
|
136
|
+
return children.map((child) => {
|
|
137
|
+
if (!isAuthorTreeChild(child)) throw new Error("JSX children must be deckjsx author tree nodes or primitive text values.");
|
|
138
|
+
return child;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function normalizeAuthorChildren(children) {
|
|
142
|
+
return children.flatMap((child) => {
|
|
143
|
+
if (child === null || child === void 0 || typeof child === "boolean") return [];
|
|
144
|
+
if (typeof child === "string" || typeof child === "number") return [createAuthorText(child)];
|
|
145
|
+
if (Array.isArray(child)) return normalizeAuthorChildren(child);
|
|
146
|
+
if (isAuthorTreeNode(child)) return [child];
|
|
147
|
+
throw new Error("JSX children must be deckjsx author tree nodes or primitive text values.");
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function collectChildren(propsObject, children) {
|
|
151
|
+
if (children.length === 0) return propsObject.children;
|
|
152
|
+
if (children.length === 1) return children[0];
|
|
153
|
+
return children;
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/authoring/author-node.ts
|
|
157
|
+
function textAuthorNode(props, children) {
|
|
158
|
+
return {
|
|
159
|
+
$$typeof: "deckjsx.author-node",
|
|
160
|
+
kind: "text",
|
|
161
|
+
props,
|
|
162
|
+
children
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function textFromPrimitive(value) {
|
|
166
|
+
if (typeof value === "string" && value.trim().length === 0) return null;
|
|
167
|
+
const text = typeof value === "string" && /[\n\r\t]/.test(value) ? value.trim() : String(value);
|
|
168
|
+
if (text.length === 0) return null;
|
|
169
|
+
return textAuthorNode({}, [text]);
|
|
170
|
+
}
|
|
171
|
+
function convertContentChildren(children) {
|
|
172
|
+
const converted = [];
|
|
173
|
+
for (const child of children) {
|
|
174
|
+
if (child.kind === "fragment") {
|
|
175
|
+
converted.push(...convertContentChildren(child.children));
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (child.kind === "text") {
|
|
179
|
+
const textNode = textFromPrimitive(child.value);
|
|
180
|
+
if (textNode) converted.push(textNode);
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
converted.push(toAuthorNode(child));
|
|
184
|
+
}
|
|
185
|
+
return converted;
|
|
186
|
+
}
|
|
187
|
+
function convertTextChildren(children) {
|
|
188
|
+
const converted = [];
|
|
189
|
+
for (const child of children) {
|
|
190
|
+
if (child.kind === "fragment") {
|
|
191
|
+
converted.push(...convertTextChildren(child.children));
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (child.kind === "text") {
|
|
195
|
+
converted.push(child.value);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
const node = toAuthorNode(child);
|
|
199
|
+
if (node.kind === "text") converted.push(node);
|
|
200
|
+
}
|
|
201
|
+
return converted;
|
|
202
|
+
}
|
|
203
|
+
function slideAuthorNode(props, children) {
|
|
204
|
+
return {
|
|
205
|
+
$$typeof: "deckjsx.author-node",
|
|
206
|
+
kind: "slide",
|
|
207
|
+
props,
|
|
208
|
+
children
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function viewAuthorNode(props, children) {
|
|
212
|
+
return {
|
|
213
|
+
$$typeof: "deckjsx.author-node",
|
|
214
|
+
kind: "view",
|
|
215
|
+
props,
|
|
216
|
+
children
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function imageAuthorNode(props) {
|
|
220
|
+
return {
|
|
221
|
+
$$typeof: "deckjsx.author-node",
|
|
222
|
+
kind: "image",
|
|
223
|
+
props,
|
|
224
|
+
children: []
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function shapeAuthorNode(props) {
|
|
228
|
+
return {
|
|
229
|
+
$$typeof: "deckjsx.author-node",
|
|
230
|
+
kind: "shape",
|
|
231
|
+
props,
|
|
232
|
+
children: []
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function isSlideElement(node) {
|
|
236
|
+
return node.source.kind === "slide";
|
|
237
|
+
}
|
|
238
|
+
function isViewElement(node) {
|
|
239
|
+
return node.source.kind === "tag" && isIntrinsicViewTag(node.source.tag);
|
|
240
|
+
}
|
|
241
|
+
function isTextElement(node) {
|
|
242
|
+
return node.source.kind === "tag" && isIntrinsicTextTag(node.source.tag);
|
|
243
|
+
}
|
|
244
|
+
function isSpanElement(node) {
|
|
245
|
+
return node.source.kind === "tag" && node.source.tag === "span";
|
|
246
|
+
}
|
|
247
|
+
function isImageElement(node) {
|
|
248
|
+
return node.source.kind === "tag" && node.source.tag === "img";
|
|
249
|
+
}
|
|
250
|
+
function isShapeElement(node) {
|
|
251
|
+
return node.source.kind === "tag" && node.source.tag === "shape";
|
|
252
|
+
}
|
|
253
|
+
function toAuthorNode(node) {
|
|
254
|
+
if (isSlideElement(node)) return slideAuthorNode(node.props, convertContentChildren(node.children));
|
|
255
|
+
if (isViewElement(node)) return viewAuthorNode(node.props, convertContentChildren(node.children));
|
|
256
|
+
if (isTextElement(node)) return textAuthorNode(node.props, convertTextChildren(node.children));
|
|
257
|
+
if (isSpanElement(node)) return textAuthorNode(node.props, convertTextChildren(node.children));
|
|
258
|
+
if (isImageElement(node)) return imageAuthorNode(node.props);
|
|
259
|
+
if (isShapeElement(node)) return shapeAuthorNode(node.props);
|
|
260
|
+
throw new Error("Unsupported author element node.");
|
|
261
|
+
}
|
|
262
|
+
function toAuthorJsxNode(value) {
|
|
263
|
+
if (isAuthorNodeValue(value)) return value;
|
|
264
|
+
if (Array.isArray(value)) return value.map((item) => toAuthorJsxNode(item));
|
|
265
|
+
if (!isAuthorTreeNode(value)) {
|
|
266
|
+
if (typeof value === "string" || typeof value === "number") return textFromPrimitive(value) ?? void 0;
|
|
267
|
+
if (value === null || value === void 0 || typeof value === "boolean") return value;
|
|
268
|
+
throw new Error("JSX content must be deckjsx author tree nodes or primitive text values.");
|
|
269
|
+
}
|
|
270
|
+
if (value.kind === "fragment") return value.children.map((child) => toAuthorJsxNode(child));
|
|
271
|
+
if (value.kind === "text") return textFromPrimitive(value.value) ?? void 0;
|
|
272
|
+
return toAuthorNode(value);
|
|
273
|
+
}
|
|
274
|
+
function isAuthorNodeValue(value) {
|
|
275
|
+
return typeof value === "object" && value !== null && "$$typeof" in value && value.$$typeof === "deckjsx.author-node";
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/jsx.ts
|
|
279
|
+
function isRecord(value) {
|
|
280
|
+
return typeof value === "object" && value !== null;
|
|
281
|
+
}
|
|
282
|
+
function propsRecordWithoutChildren(props) {
|
|
283
|
+
return authorElementPropsFromEntries(Object.entries(props).filter(([key]) => key !== "children"));
|
|
284
|
+
}
|
|
285
|
+
function splitProps(props, children) {
|
|
286
|
+
const rawChildren = collectChildren(props, children);
|
|
287
|
+
return {
|
|
288
|
+
props: propsRecordWithoutChildren(props),
|
|
289
|
+
children: rawChildren === void 0 ? [] : [rawChildren]
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
function intrinsicElement(type, propsObject, children, key, sourceSpan) {
|
|
293
|
+
if (isIntrinsicViewTag(type)) {
|
|
294
|
+
const authored = splitProps(propsObject, children);
|
|
295
|
+
return createAuthorElement({
|
|
296
|
+
source: {
|
|
297
|
+
kind: "tag",
|
|
298
|
+
tag: type
|
|
299
|
+
},
|
|
300
|
+
props: authored.props,
|
|
301
|
+
children: authored.children,
|
|
302
|
+
...key !== void 0 ? { key } : {},
|
|
303
|
+
...sourceSpan ? { sourceSpan } : {}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
if (isIntrinsicTextTag(type)) {
|
|
307
|
+
const authored = splitProps(propsObject, children);
|
|
308
|
+
return createAuthorElement({
|
|
309
|
+
source: {
|
|
310
|
+
kind: "tag",
|
|
311
|
+
tag: type
|
|
312
|
+
},
|
|
313
|
+
props: authored.props,
|
|
314
|
+
children: authored.children,
|
|
315
|
+
...key !== void 0 ? { key } : {},
|
|
316
|
+
...sourceSpan ? { sourceSpan } : {}
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
if (type === "span") {
|
|
320
|
+
const authored = splitProps(propsObject, children);
|
|
321
|
+
return createAuthorElement({
|
|
322
|
+
source: {
|
|
323
|
+
kind: "tag",
|
|
324
|
+
tag: type
|
|
325
|
+
},
|
|
326
|
+
props: authored.props,
|
|
327
|
+
children: authored.children,
|
|
328
|
+
...key !== void 0 ? { key } : {},
|
|
329
|
+
...sourceSpan ? { sourceSpan } : {}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
if (type === "img") {
|
|
333
|
+
const authored = splitProps(propsObject, children);
|
|
334
|
+
return createAuthorElement({
|
|
335
|
+
source: {
|
|
336
|
+
kind: "tag",
|
|
337
|
+
tag: type
|
|
338
|
+
},
|
|
339
|
+
props: authored.props,
|
|
340
|
+
children: authored.children,
|
|
341
|
+
...key !== void 0 ? { key } : {},
|
|
342
|
+
...sourceSpan ? { sourceSpan } : {}
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
const authored = splitProps(propsObject, children);
|
|
346
|
+
return createAuthorElement({
|
|
347
|
+
source: {
|
|
348
|
+
kind: "tag",
|
|
349
|
+
tag: type
|
|
350
|
+
},
|
|
351
|
+
props: authored.props,
|
|
352
|
+
children: authored.children,
|
|
353
|
+
...key !== void 0 ? { key } : {},
|
|
354
|
+
...sourceSpan ? { sourceSpan } : {}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
function createElementWithMetadata(type, props, key, sourceSpan, children = []) {
|
|
358
|
+
if (typeof type === "string") {
|
|
359
|
+
if (isIntrinsicViewTag(type) || isIntrinsicTextTag(type) || type === "img" || type === "shape" || type === "span") return intrinsicElement(type, isRecord(props) ? props : {}, children, key, sourceSpan);
|
|
360
|
+
if (!isAuthoredTag(type)) throw new Error(`Intrinsic element is not supported: <${type}>.`);
|
|
361
|
+
}
|
|
362
|
+
if (typeof type !== "function") throw new Error("JSX element type must be a function component.");
|
|
363
|
+
if (type === Fragment) {
|
|
364
|
+
const rawChildren = collectChildren(isRecord(props) ? props : {}, children);
|
|
365
|
+
return createAuthorFragment({
|
|
366
|
+
children: rawChildren === void 0 ? [] : [rawChildren],
|
|
367
|
+
...key !== void 0 ? { key } : {},
|
|
368
|
+
...sourceSpan ? { sourceSpan } : {}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
const propsObject = isRecord(props) ? props : {};
|
|
372
|
+
const rawChildren = collectChildren(propsObject, children);
|
|
373
|
+
const result = type({
|
|
374
|
+
...propsObject,
|
|
375
|
+
children: rawChildren
|
|
376
|
+
});
|
|
377
|
+
if (!isAuthorTreeNode(result)) throw new Error("Function components must return a deckjsx author tree node.");
|
|
378
|
+
if (key === void 0 && sourceSpan === void 0) return result;
|
|
379
|
+
if (result.kind === "element") return {
|
|
380
|
+
...result,
|
|
381
|
+
...key !== void 0 ? { key } : {},
|
|
382
|
+
...sourceSpan ? { sourceSpan } : {}
|
|
383
|
+
};
|
|
384
|
+
return result;
|
|
385
|
+
}
|
|
386
|
+
function Fragment(props) {
|
|
387
|
+
return createAuthorFragment({ children: props.children === void 0 ? [] : authorTreeChildrenFromUnknown([props.children]) });
|
|
388
|
+
}
|
|
389
|
+
function isAuthorNodeKind(value) {
|
|
390
|
+
return value === "slide" || value === "view" || value === "text" || value === "image" || value === "shape";
|
|
391
|
+
}
|
|
392
|
+
function isAuthorNode(value) {
|
|
393
|
+
if (!isAuthorNodeValue(value)) return false;
|
|
394
|
+
return isAuthorNodeKind(value.kind);
|
|
395
|
+
}
|
|
396
|
+
function isSlideNode(value) {
|
|
397
|
+
return isAuthorNode(value) && value.kind === "slide";
|
|
398
|
+
}
|
|
399
|
+
function isContentNode(value) {
|
|
400
|
+
return isAuthorNode(value) && value.kind !== "slide";
|
|
401
|
+
}
|
|
402
|
+
//#endregion
|
|
403
|
+
export { isSlideNode as a, authorElementPropsFromEntries as c, isAuthorTreeNode as d, isAuthoredTag as f, isContentNode as i, createAuthorElement as l, createElementWithMetadata as n, isAuthorNodeValue as o, isAuthorNode as r, toAuthorJsxNode as s, Fragment as t, isAuthorTreeChild as u };
|
|
@@ -1,7 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
1
|
+
import { a as IntrinsicDivProps, c as IntrinsicShapeProps, d as JsxNode, l as IntrinsicTextTag, n as DeckJsxElement, o as IntrinsicImgProps, ot as JsxKey, r as DeckJsxIntrinsicElements, s as IntrinsicPProps, u as IntrinsicViewTag } from "./index-dx2ZSBgF.mjs";
|
|
2
|
+
import { a as jsxs, i as jsx, n as JsxComponentProps, o as Fragment, r as JsxDevSource } from "./jsx-runtime-_eIs-wi1.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx-dev-runtime.d.ts
|
|
5
|
-
|
|
5
|
+
type JsxComponent<P, R extends DeckJsxElement> = (props: P) => R;
|
|
6
|
+
type JsxProps<P> = P extends {
|
|
7
|
+
children?: JsxNode;
|
|
8
|
+
} ? Omit<P, "children"> & Partial<Pick<P, "children">> : P;
|
|
9
|
+
declare function jsxDEV<P extends JsxComponentProps, R extends DeckJsxElement>(type: JsxComponent<P, R>, props: JsxProps<P> | null, key?: JsxKey, _isStaticChildren?: boolean, source?: JsxDevSource): R;
|
|
10
|
+
declare function jsxDEV(type: IntrinsicViewTag, props: JsxProps<IntrinsicDivProps> | null, key?: JsxKey, _isStaticChildren?: boolean, source?: JsxDevSource): DeckJsxElement;
|
|
11
|
+
declare function jsxDEV(type: IntrinsicTextTag, props: JsxProps<IntrinsicPProps> | null, key?: JsxKey, _isStaticChildren?: boolean, source?: JsxDevSource): DeckJsxElement;
|
|
12
|
+
declare function jsxDEV(type: "span", props: JsxProps<IntrinsicPProps> | null, key?: JsxKey, _isStaticChildren?: boolean, source?: JsxDevSource): DeckJsxElement;
|
|
13
|
+
declare function jsxDEV(type: "img", props: IntrinsicImgProps, key?: JsxKey, _isStaticChildren?: boolean, source?: JsxDevSource): DeckJsxElement;
|
|
14
|
+
declare function jsxDEV(type: "shape", props: IntrinsicShapeProps, key?: JsxKey, _isStaticChildren?: boolean, source?: JsxDevSource): DeckJsxElement;
|
|
15
|
+
declare function jsxDEV(type: string, props: JsxComponentProps | null, key?: JsxKey, _isStaticChildren?: boolean, source?: JsxDevSource): never;
|
|
16
|
+
declare namespace JSX {
|
|
17
|
+
type Element = DeckJsxElement;
|
|
18
|
+
interface ElementChildrenAttribute {
|
|
19
|
+
children: {};
|
|
20
|
+
}
|
|
21
|
+
interface IntrinsicAttributes {
|
|
22
|
+
key?: JsxKey;
|
|
23
|
+
}
|
|
24
|
+
interface IntrinsicElements extends DeckJsxIntrinsicElements {
|
|
25
|
+
span: IntrinsicPProps;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
6
28
|
//#endregion
|
|
7
|
-
export { Fragment,
|
|
29
|
+
export { Fragment, JSX, jsx, jsxDEV, jsxs };
|
package/dist/jsx-dev-runtime.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as createElementWithMetadata, t as Fragment } from "./jsx-DGGM5erN.mjs";
|
|
2
2
|
import { jsx, jsxs } from "./jsx-runtime.mjs";
|
|
3
3
|
//#region src/jsx-dev-runtime.ts
|
|
4
4
|
function sourceSpanFromDevSource(source) {
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
if (devSource.fileName === void 0 && devSource.lineNumber === void 0 && devSource.columnNumber === void 0) return;
|
|
5
|
+
if (!source) return;
|
|
6
|
+
if (source.fileName === void 0 && source.lineNumber === void 0 && source.columnNumber === void 0) return;
|
|
8
7
|
return {
|
|
9
|
-
file:
|
|
10
|
-
line:
|
|
11
|
-
column:
|
|
8
|
+
file: source.fileName,
|
|
9
|
+
line: source.lineNumber,
|
|
10
|
+
column: source.columnNumber
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
13
|
function jsxDEV(type, props, key, _isStaticChildren, source) {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { a as IntrinsicDivProps, c as IntrinsicShapeProps, d as JsxNode, l as IntrinsicTextTag, n as DeckJsxElement, o as IntrinsicImgProps, ot as JsxKey, r as DeckJsxIntrinsicElements, s as IntrinsicPProps, u as IntrinsicViewTag } from "./index-dx2ZSBgF.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/jsx.d.ts
|
|
4
|
+
declare function Fragment(props: {
|
|
5
|
+
children?: JsxNode;
|
|
6
|
+
}): DeckJsxElement;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/jsx-runtime.d.ts
|
|
9
|
+
type JsxComponent<P, R extends DeckJsxElement> = (props: P) => R;
|
|
10
|
+
type JsxProps<P> = P extends {
|
|
11
|
+
children?: JsxNode;
|
|
12
|
+
} ? Omit<P, "children"> & Partial<Pick<P, "children">> : P;
|
|
13
|
+
type JsxComponentProps = {
|
|
14
|
+
readonly children?: JsxNode;
|
|
15
|
+
};
|
|
16
|
+
type JsxDevSource = {
|
|
17
|
+
readonly fileName?: string;
|
|
18
|
+
readonly lineNumber?: number;
|
|
19
|
+
readonly columnNumber?: number;
|
|
20
|
+
};
|
|
21
|
+
declare function jsx<P extends JsxComponentProps, R extends DeckJsxElement>(type: JsxComponent<P, R>, props: JsxProps<P> | null, key?: JsxKey): R;
|
|
22
|
+
declare function jsx(type: IntrinsicViewTag, props: JsxProps<IntrinsicDivProps> | null, key?: JsxKey): DeckJsxElement;
|
|
23
|
+
declare function jsx(type: IntrinsicTextTag, props: JsxProps<IntrinsicPProps> | null, key?: JsxKey): DeckJsxElement;
|
|
24
|
+
declare function jsx(type: "span", props: JsxProps<IntrinsicPProps> | null, key?: JsxKey): DeckJsxElement;
|
|
25
|
+
declare function jsx(type: "img", props: IntrinsicImgProps, key?: JsxKey): DeckJsxElement;
|
|
26
|
+
declare function jsx(type: "shape", props: IntrinsicShapeProps, key?: JsxKey): DeckJsxElement;
|
|
27
|
+
declare function jsx(type: string, props: JsxComponentProps | null, key?: JsxKey): never;
|
|
28
|
+
declare const jsxs: typeof jsx;
|
|
29
|
+
declare namespace JSX {
|
|
30
|
+
type Element = DeckJsxElement;
|
|
31
|
+
interface ElementChildrenAttribute {
|
|
32
|
+
children: {};
|
|
33
|
+
}
|
|
34
|
+
interface IntrinsicAttributes {
|
|
35
|
+
key?: JsxKey;
|
|
36
|
+
}
|
|
37
|
+
interface IntrinsicElements extends DeckJsxIntrinsicElements {
|
|
38
|
+
span: IntrinsicPProps;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { jsxs as a, jsx as i, JsxComponentProps as n, Fragment as o, JsxDevSource as r, JSX as t };
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
export { Fragment, JSX, JsxKey, jsx, jsxs };
|
|
1
|
+
import { ot as JsxKey } from "./index-dx2ZSBgF.mjs";
|
|
2
|
+
import { a as jsxs, i as jsx, n as JsxComponentProps, o as Fragment, r as JsxDevSource, t as JSX } from "./jsx-runtime-_eIs-wi1.mjs";
|
|
3
|
+
export { Fragment, JSX, JsxComponentProps, JsxDevSource, JsxKey, jsx, jsxs };
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as createElementWithMetadata, t as Fragment } from "./jsx-DGGM5erN.mjs";
|
|
2
2
|
//#region src/jsx-runtime.ts
|
|
3
3
|
function jsx(type, props, key) {
|
|
4
4
|
return createElementWithMetadata(type, props, key);
|