@officedk/pptxdk 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +48 -2
- package/dist/build.d.ts +94 -0
- package/dist/build.js +148 -0
- package/dist/capabilities/dist/all.js +32 -0
- package/dist/capabilities/dist/box/box-codegen.js +51 -0
- package/dist/capabilities/dist/box/box-declaration.js +31 -0
- package/dist/capabilities/dist/box/box-elements.js +17 -0
- package/dist/capabilities/dist/box/box.js +138 -0
- package/dist/capabilities/dist/chart/chart-codegen.js +77 -0
- package/dist/capabilities/dist/chart/chart-declaration.js +7 -0
- package/dist/capabilities/dist/chart/chart-elements.js +12 -0
- package/dist/capabilities/dist/chart/chart-import.js +2272 -0
- package/dist/capabilities/dist/chart/chart-labels.js +86 -0
- package/dist/capabilities/dist/chart/chart-model.js +9 -0
- package/dist/capabilities/dist/chart/chart-schemas.js +1078 -0
- package/dist/capabilities/dist/chart/chart-xml.js +788 -0
- package/dist/capabilities/dist/chart/chart.js +1124 -0
- package/dist/capabilities/dist/chart/preview/axes-and-grid.js +298 -0
- package/dist/capabilities/dist/chart/preview/bar-column.js +143 -0
- package/dist/capabilities/dist/chart/preview/data-labels.js +334 -0
- package/dist/capabilities/dist/chart/preview/error-bars.js +213 -0
- package/dist/capabilities/dist/chart/preview/index.js +190 -0
- package/dist/capabilities/dist/chart/preview/layout.js +519 -0
- package/dist/capabilities/dist/chart/preview/legend.js +273 -0
- package/dist/capabilities/dist/chart/preview/line-area.js +404 -0
- package/dist/capabilities/dist/chart/preview/markers.js +100 -0
- package/dist/capabilities/dist/chart/preview/number-format.js +247 -0
- package/dist/capabilities/dist/chart/preview/pie-doughnut.js +159 -0
- package/dist/capabilities/dist/chart/preview/scales.js +365 -0
- package/dist/capabilities/dist/chart/preview/scatter.js +131 -0
- package/dist/capabilities/dist/chart/preview/style.js +48 -0
- package/dist/capabilities/dist/chart/preview/text-render.js +116 -0
- package/dist/capabilities/dist/chart/preview/trendlines.js +537 -0
- package/dist/capabilities/dist/chart/preview/types.js +5 -0
- package/dist/capabilities/dist/document.js +148 -0
- package/dist/capabilities/dist/font/font-embedding.js +289 -0
- package/dist/capabilities/dist/font/font-family.js +10 -0
- package/dist/capabilities/dist/font/font-import.js +302 -0
- package/dist/capabilities/dist/font/font-subset.js +55 -0
- package/dist/capabilities/dist/font/font.js +25 -0
- package/dist/capabilities/dist/group/group-codegen.js +51 -0
- package/dist/capabilities/dist/group/group-declaration.js +42 -0
- package/dist/capabilities/dist/group/group-elements.js +12 -0
- package/dist/capabilities/dist/group/group-import.js +319 -0
- package/dist/capabilities/dist/group/group-xml.js +7 -0
- package/dist/capabilities/dist/group/group.js +211 -0
- package/dist/capabilities/dist/image/gif-decoder.js +244 -0
- package/dist/capabilities/dist/image/image-codegen.js +94 -0
- package/dist/capabilities/dist/image/image-declaration.js +8 -0
- package/dist/capabilities/dist/image/image-decode.js +221 -0
- package/dist/capabilities/dist/image/image-elements.js +12 -0
- package/dist/capabilities/dist/image/image-import.js +778 -0
- package/dist/capabilities/dist/image/image-schemas.js +149 -0
- package/dist/capabilities/dist/image/image-xml.js +12 -0
- package/dist/capabilities/dist/image/image.js +472 -0
- package/dist/capabilities/dist/masters/footer-placeholder.js +685 -0
- package/dist/capabilities/dist/masters/masters-codegen.js +21 -0
- package/dist/capabilities/dist/masters/masters.js +250 -0
- package/dist/capabilities/dist/motion/motion-api.js +527 -0
- package/dist/capabilities/dist/motion/motion-codegen.js +340 -0
- package/dist/capabilities/dist/motion/motion-elements.js +43 -0
- package/dist/capabilities/dist/motion/motion-import.js +1033 -0
- package/dist/capabilities/dist/motion/motion-plan.js +2189 -0
- package/dist/capabilities/dist/motion/motion-query.js +420 -0
- package/dist/capabilities/dist/motion/motion-schemas.js +216 -0
- package/dist/capabilities/dist/motion/motion.js +1372 -0
- package/dist/capabilities/dist/notes/notes-codegen.js +20 -0
- package/dist/capabilities/dist/notes/notes-declaration.js +8 -0
- package/dist/capabilities/dist/notes/notes-elements.js +12 -0
- package/dist/capabilities/dist/notes/notes-import.js +292 -0
- package/dist/capabilities/dist/notes/notes-schemas.js +35 -0
- package/dist/capabilities/dist/notes/notes-xml.js +38 -0
- package/dist/capabilities/dist/notes/notes.js +191 -0
- package/dist/capabilities/dist/placeholder/placeholder-codegen.js +23 -0
- package/dist/capabilities/dist/placeholder/placeholder-elements.js +12 -0
- package/dist/capabilities/dist/placeholder/placeholder.js +292 -0
- package/dist/capabilities/dist/shape/shape-codegen.js +166 -0
- package/dist/capabilities/dist/shape/shape-declaration.js +57 -0
- package/dist/capabilities/dist/shape/shape-elements.js +12 -0
- package/dist/capabilities/dist/shape/shape-import.js +579 -0
- package/dist/capabilities/dist/shape/shape-xml.js +6 -0
- package/dist/capabilities/dist/shape/shape.js +337 -0
- package/dist/capabilities/dist/shared/geometry.js +1423 -0
- package/dist/capabilities/dist/shared/identity.js +205 -0
- package/dist/capabilities/dist/shared/morph-api.js +11 -0
- package/dist/capabilities/dist/shared/placeholder-import.js +113 -0
- package/dist/capabilities/dist/shared/preset-definitions.js +21390 -0
- package/dist/capabilities/dist/shared/style-inheritance.js +166 -0
- package/dist/capabilities/dist/shared/style-parse.js +11 -0
- package/dist/capabilities/dist/shared/text-schemas.js +216 -0
- package/dist/capabilities/dist/shared/text-service.js +1883 -0
- package/dist/capabilities/dist/shared/visual.js +918 -0
- package/dist/capabilities/dist/slide-background/slide-background-codegen.js +44 -0
- package/dist/capabilities/dist/slide-background/slide-background-import.js +161 -0
- package/dist/capabilities/dist/slide-background/slide-background-xml.js +21 -0
- package/dist/capabilities/dist/slide-background/slide-background.js +221 -0
- package/dist/capabilities/dist/table/table-codegen.js +81 -0
- package/dist/capabilities/dist/table/table-declaration.js +15 -0
- package/dist/capabilities/dist/table/table-elements.js +27 -0
- package/dist/capabilities/dist/table/table-import.js +539 -0
- package/dist/capabilities/dist/table/table-schemas.js +279 -0
- package/dist/capabilities/dist/table/table-xml.js +37 -0
- package/dist/capabilities/dist/table/table.js +662 -0
- package/dist/capabilities/dist/text/text-codegen.js +129 -0
- package/dist/capabilities/dist/text/text-declaration.js +19 -0
- package/dist/capabilities/dist/text/text-elements.js +38 -0
- package/dist/capabilities/dist/text/text-import.js +1077 -0
- package/dist/capabilities/dist/text/text-xml.js +9 -0
- package/dist/capabilities/dist/text/text.js +335 -0
- package/dist/capabilities/dist/transition/transition-api.js +139 -0
- package/dist/capabilities/dist/transition/transition-codegen.js +45 -0
- package/dist/capabilities/dist/transition/transition-import.js +477 -0
- package/dist/capabilities/dist/transition/transition.js +260 -0
- package/dist/capability-D_xeNVIw.d.ts +29496 -0
- package/dist/cli.js +20 -0
- package/dist/codegen/dist/assets.js +78 -0
- package/dist/codegen/dist/codegen.js +611 -0
- package/dist/codegen/dist/identifiers.js +193 -0
- package/dist/codegen/dist/index.js +3 -0
- package/dist/codegen/dist/printer.js +143 -0
- package/dist/codegen/dist/types.js +49 -0
- package/dist/core/dist/author-ids.js +48 -0
- package/dist/core/dist/author-schemas.js +313 -0
- package/dist/core/dist/block-flex-layout.js +749 -0
- package/dist/core/dist/build.js +4 -0
- package/dist/core/dist/capability.js +13 -0
- package/dist/core/dist/declaration.js +15 -0
- package/dist/core/dist/diagnostics.js +21 -0
- package/dist/core/dist/document-internals.js +13 -0
- package/dist/core/dist/document.js +408 -0
- package/dist/core/dist/geometry-schemas.js +249 -0
- package/dist/core/dist/grid-layout.js +445 -0
- package/dist/core/dist/host.js +40 -0
- package/dist/core/dist/index.js +15 -0
- package/dist/core/dist/input-values.js +45 -0
- package/dist/core/dist/layout-protocol.js +66 -0
- package/dist/core/dist/layout-schemas.js +208 -0
- package/dist/core/dist/layout.js +299 -0
- package/dist/core/dist/masters.js +169 -0
- package/dist/core/dist/morph.js +30 -0
- package/dist/core/dist/placeholders.js +213 -0
- package/dist/core/dist/query.js +155 -0
- package/dist/core/dist/resolution.js +11 -0
- package/dist/core/dist/resolve.js +1827 -0
- package/dist/core/dist/stage-options.js +67 -0
- package/dist/core/dist/theme.js +931 -0
- package/dist/document-BHPUODPP.d.ts +27759 -0
- package/dist/emit/dist/emit.js +936 -0
- package/dist/emit/dist/index.js +5 -0
- package/dist/emit/dist/ooxml.js +606 -0
- package/dist/emit/dist/shape-tree.js +12 -0
- package/dist/import/dist/alternate-content.js +54 -0
- package/dist/import/dist/diagnostics.js +153 -0
- package/dist/import/dist/fonts.js +250 -0
- package/dist/import/dist/import.js +504 -0
- package/dist/import/dist/index.js +16 -0
- package/dist/import/dist/masters.js +1153 -0
- package/dist/import/dist/mechanism.js +10 -0
- package/dist/import/dist/namespaces.js +60 -0
- package/dist/import/dist/notes-masters.js +300 -0
- package/dist/import/dist/opc.js +233 -0
- package/dist/import/dist/resources.js +166 -0
- package/dist/import/dist/sections.js +139 -0
- package/dist/import/dist/themes.js +671 -0
- package/dist/import/dist/visual.js +761 -0
- package/dist/import/dist/xml-fragments.js +36 -0
- package/dist/import/dist/xml-reader.js +267 -0
- package/dist/index-B5m3hqjC.d.ts +7 -0
- package/dist/index-CCy-Yo8G.d.ts +1208 -0
- package/dist/index-DpxcZ4Gs.d.ts +725 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +70 -0
- package/dist/node.d.ts +53 -0
- package/dist/node.js +194 -0
- package/dist/pptxdk/src/cli-commands.js +913 -0
- package/dist/pptxdk/src/compose.js +44 -0
- package/dist/pptxdk/src/slide.js +9 -0
- package/dist/preview/dist/index.js +240 -0
- package/dist/preview/dist/options.js +53 -0
- package/dist/preview-Cfw0QdMM.d.ts +86 -0
- package/dist/preview.d.ts +3 -0
- package/dist/preview.js +27 -0
- package/dist/react/dist/append.js +66 -0
- package/dist/react/dist/document-adapter.js +65 -0
- package/dist/react/dist/elements.js +59 -0
- package/dist/react/dist/index.js +68 -0
- package/dist/react/dist/reconciler.js +290 -0
- package/dist/react.d.ts +145 -0
- package/dist/react.js +27 -0
- package/dist/transition-Cips9wma.d.ts +82 -0
- package/dist/vanilla.d.ts +4 -0
- package/dist/vanilla.js +14 -0
- package/package.json +78 -3
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { CapabilityError } from "../../../core/dist/diagnostics.js";
|
|
2
|
+
import { authorIdSchema } from "../../../core/dist/author-ids.js";
|
|
3
|
+
import { isMorphKey } from "../../../core/dist/morph.js";
|
|
4
|
+
import { linkTargetSchema, parseLinkTarget } from "../../../core/dist/author-schemas.js";
|
|
5
|
+
import { matchLayoutPlaceholderKey, nativePlaceholderRefSchema } from "../../../core/dist/placeholders.js";
|
|
6
|
+
import { layoutStyleKeys, parseCapabilityLayoutContract } from "../../../core/dist/layout.js";
|
|
7
|
+
import "../../../core/dist/capability.js";
|
|
8
|
+
import { assertXml10Characters, placeholderRefXml, pxToEmu, xmlEscape } from "../../../emit/dist/ooxml.js";
|
|
9
|
+
import { CommonNode } from "../../../core/dist/document.js";
|
|
10
|
+
import "../../../emit/dist/index.js";
|
|
11
|
+
import { A_NS, P_NS, emuToPx } from "../../../import/dist/namespaces.js";
|
|
12
|
+
import { extentEmuFragmentSchema, offsetEmuFragmentSchema, ooxmlBoolSchema, ooxmlNonNegativeIntSchema } from "../../../import/dist/xml-fragments.js";
|
|
13
|
+
import { defineCanvasMechanism } from "../../../import/dist/mechanism.js";
|
|
14
|
+
import "../../../import/dist/index.js";
|
|
15
|
+
import { nativeLinkXml, optionalNameSchema, parseMorphKey, parseOptionalName, readClickLink } from "../shared/identity.js";
|
|
16
|
+
import { directElementChild, isPlaceholderSpElement, readNvPrPlaceholder } from "../shared/placeholder-import.js";
|
|
17
|
+
import { resolvePlaceholderGeometry } from "../shared/style-inheritance.js";
|
|
18
|
+
import { placeholderCodegen } from "./placeholder-codegen.js";
|
|
19
|
+
import { z } from "zod";
|
|
20
|
+
// ../capabilities/dist/placeholder/placeholder.js
|
|
21
|
+
const NonVisualSpIdSchema = z.object({
|
|
22
|
+
id: ooxmlNonNegativeIntSchema,
|
|
23
|
+
name: z.string().optional()
|
|
24
|
+
});
|
|
25
|
+
const NonVisualSpPrFlagsSchema = z.object({ txBox: ooxmlBoolSchema.optional() });
|
|
26
|
+
const placeholderDeclarationPropsSchema = z.strictObject({
|
|
27
|
+
id: authorIdSchema.optional(),
|
|
28
|
+
name: optionalNameSchema.optional(),
|
|
29
|
+
morphKey: z.custom(isMorphKey).optional(),
|
|
30
|
+
placeholder: z.string().min(1).optional(),
|
|
31
|
+
nativePlaceholder: nativePlaceholderRefSchema.optional(),
|
|
32
|
+
link: linkTargetSchema.optional(),
|
|
33
|
+
x: z.number().finite().optional(),
|
|
34
|
+
y: z.number().finite().optional(),
|
|
35
|
+
width: z.number().finite().positive().optional(),
|
|
36
|
+
height: z.number().finite().positive().optional()
|
|
37
|
+
});
|
|
38
|
+
const placeholderAllowedParameters = Object.keys(placeholderDeclarationPropsSchema.shape);
|
|
39
|
+
/** Creates an editable AST node representing an unpopulated native content placeholder (`<p:sp><p:ph .../></p:sp>` without `<p:txBody>`). */
|
|
40
|
+
function createPlaceholderNode(props) {
|
|
41
|
+
return new CommonNode("placeholder", "placeholder", props);
|
|
42
|
+
}
|
|
43
|
+
function emitPlaceholderModel(model, emitContext) {
|
|
44
|
+
const escapedName = xmlEscape(model.name);
|
|
45
|
+
const spPrXml = model.omitSpPrTransform ? "<p:spPr/>" : `<p:spPr><a:xfrm><a:off x="${pxToEmu(model.box.x)}" y="${pxToEmu(model.box.y)}"/><a:ext cx="${pxToEmu(model.box.width)}" cy="${pxToEmu(model.box.height)}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr>`;
|
|
46
|
+
return { xml: `<p:sp><p:nvSpPr><p:cNvPr id="${emitContext.id}" name="${escapedName}">${nativeLinkXml(emitContext.nativeLink)}</p:cNvPr><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr>${placeholderRefXml(model.nativeRef)}</p:nvPr></p:nvSpPr>${spPrXml}</p:sp>` };
|
|
47
|
+
}
|
|
48
|
+
function paintPlaceholderModel() {
|
|
49
|
+
return { svg: "" };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Reads an unpopulated `<p:sp>` content/object placeholder (no `<p:txBody>`)
|
|
53
|
+
* into a layout-bound `PlaceholderNode` while preserving `<p:ph>` binding.
|
|
54
|
+
*/
|
|
55
|
+
function readContentPlaceholderSp(context) {
|
|
56
|
+
const { cursor, part, slideIndex, layoutPlaceholders } = context;
|
|
57
|
+
const diagnostics = [];
|
|
58
|
+
const nvSpPr = cursor.child(P_NS, "nvSpPr");
|
|
59
|
+
if (nvSpPr === void 0) {
|
|
60
|
+
diagnostics.push({
|
|
61
|
+
code: "corrupt-part",
|
|
62
|
+
category: "corrupt-input",
|
|
63
|
+
disposition: "omitted",
|
|
64
|
+
location: {
|
|
65
|
+
part,
|
|
66
|
+
xpath: cursor.xpath,
|
|
67
|
+
slideIndex
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return { diagnostics };
|
|
71
|
+
}
|
|
72
|
+
let objectId;
|
|
73
|
+
let objectName;
|
|
74
|
+
let clickResult;
|
|
75
|
+
const cNvPr = nvSpPr.child(P_NS, "cNvPr");
|
|
76
|
+
if (cNvPr !== void 0) {
|
|
77
|
+
const rawCNvPr = cNvPr.attrsObject(["id", "name"]);
|
|
78
|
+
const parsedCNvPr = NonVisualSpIdSchema.safeParse(rawCNvPr);
|
|
79
|
+
if (!parsedCNvPr.success) diagnostics.push({
|
|
80
|
+
code: "invalid-xml-value",
|
|
81
|
+
category: "corrupt-input",
|
|
82
|
+
disposition: "recovered",
|
|
83
|
+
location: {
|
|
84
|
+
part,
|
|
85
|
+
xpath: cNvPr.xpath,
|
|
86
|
+
slideIndex
|
|
87
|
+
},
|
|
88
|
+
attributeOrElement: "p:cNvPr",
|
|
89
|
+
rawValue: JSON.stringify(rawCNvPr)
|
|
90
|
+
});
|
|
91
|
+
else {
|
|
92
|
+
objectId = parsedCNvPr.data.id;
|
|
93
|
+
if (parsedCNvPr.data.name !== void 0 && parsedCNvPr.data.name.trim() !== "") objectName = parsedCNvPr.data.name;
|
|
94
|
+
}
|
|
95
|
+
const hlinkClick = cNvPr.child(A_NS, "hlinkClick");
|
|
96
|
+
if (hlinkClick !== void 0) {
|
|
97
|
+
clickResult = readClickLink(hlinkClick, context, {
|
|
98
|
+
...objectId === void 0 ? {} : { objectId },
|
|
99
|
+
...objectName === void 0 ? {} : { objectName }
|
|
100
|
+
});
|
|
101
|
+
diagnostics.push(...clickResult.diagnostics);
|
|
102
|
+
}
|
|
103
|
+
cNvPr.ignoreEmptyChild(A_NS, "extLst");
|
|
104
|
+
}
|
|
105
|
+
const cNvSpPr = nvSpPr.child(P_NS, "cNvSpPr");
|
|
106
|
+
if (cNvSpPr !== void 0) {
|
|
107
|
+
NonVisualSpPrFlagsSchema.safeParse(cNvSpPr.attrsObject(["txBox"]));
|
|
108
|
+
cNvSpPr.child(A_NS, "spLocks")?.attrsObject([
|
|
109
|
+
"noGrp",
|
|
110
|
+
"noRot",
|
|
111
|
+
"noChangeAspect",
|
|
112
|
+
"noMove",
|
|
113
|
+
"noResize",
|
|
114
|
+
"noSelect"
|
|
115
|
+
]);
|
|
116
|
+
}
|
|
117
|
+
const phLocation = {
|
|
118
|
+
part,
|
|
119
|
+
xpath: cursor.xpath,
|
|
120
|
+
slideIndex,
|
|
121
|
+
...objectId === void 0 ? {} : { objectId },
|
|
122
|
+
...objectName === void 0 ? {} : { objectName }
|
|
123
|
+
};
|
|
124
|
+
const nvPr = nvSpPr.child(P_NS, "nvPr");
|
|
125
|
+
const phResult = readNvPrPlaceholder(nvPr, phLocation, diagnostics);
|
|
126
|
+
if (phResult.kind === "none") {
|
|
127
|
+
diagnostics.push({
|
|
128
|
+
code: "corrupt-part",
|
|
129
|
+
category: "corrupt-input",
|
|
130
|
+
disposition: "omitted",
|
|
131
|
+
location: phLocation
|
|
132
|
+
});
|
|
133
|
+
return { diagnostics };
|
|
134
|
+
}
|
|
135
|
+
if (phResult.kind === "error") return { diagnostics };
|
|
136
|
+
const nativeRef = phResult.nativeRef;
|
|
137
|
+
const spPr = cursor.child(P_NS, "spPr");
|
|
138
|
+
if (spPr === void 0) {
|
|
139
|
+
diagnostics.push({
|
|
140
|
+
code: "corrupt-part",
|
|
141
|
+
category: "corrupt-input",
|
|
142
|
+
disposition: "omitted",
|
|
143
|
+
location: phLocation
|
|
144
|
+
});
|
|
145
|
+
return { diagnostics };
|
|
146
|
+
}
|
|
147
|
+
let localBox;
|
|
148
|
+
const xfrm = spPr.child(A_NS, "xfrm");
|
|
149
|
+
if (xfrm !== void 0) {
|
|
150
|
+
xfrm.attrsObject([
|
|
151
|
+
"rot",
|
|
152
|
+
"flipH",
|
|
153
|
+
"flipV"
|
|
154
|
+
]);
|
|
155
|
+
const off = xfrm.child(A_NS, "off");
|
|
156
|
+
const ext = xfrm.child(A_NS, "ext");
|
|
157
|
+
if (off !== void 0 && ext !== void 0) {
|
|
158
|
+
const parsedOff = offsetEmuFragmentSchema.safeParse(off.attrsObject(["x", "y"]));
|
|
159
|
+
const parsedExt = extentEmuFragmentSchema.safeParse(ext.attrsObject(["cx", "cy"]));
|
|
160
|
+
if (parsedOff.success && parsedExt.success) localBox = {
|
|
161
|
+
x: emuToPx(parsedOff.data.x),
|
|
162
|
+
y: emuToPx(parsedOff.data.y),
|
|
163
|
+
width: emuToPx(parsedExt.data.cx),
|
|
164
|
+
height: emuToPx(parsedExt.data.cy)
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const prstGeomEl = directElementChild(spPr.element, A_NS, "prstGeom");
|
|
169
|
+
if (prstGeomEl !== void 0 && prstGeomEl.getAttribute("prst") === "rect" && prstGeomEl.attributes.length === 1) {
|
|
170
|
+
const prstGeom = spPr.child(A_NS, "prstGeom");
|
|
171
|
+
prstGeom.consumeAttr("prst");
|
|
172
|
+
const avLstEl = directElementChild(prstGeom.element, A_NS, "avLst");
|
|
173
|
+
if (avLstEl !== void 0 && avLstEl.children.length === 0 && avLstEl.attributes.length === 0) prstGeom.child(A_NS, "avLst");
|
|
174
|
+
}
|
|
175
|
+
const noFillEl = directElementChild(spPr.element, A_NS, "noFill");
|
|
176
|
+
if (noFillEl !== void 0 && noFillEl.children.length === 0 && noFillEl.attributes.length === 0) spPr.child(A_NS, "noFill");
|
|
177
|
+
const matchedKey = matchLayoutPlaceholderKey(layoutPlaceholders, {
|
|
178
|
+
type: nativeRef.type,
|
|
179
|
+
idx: nativeRef.idx
|
|
180
|
+
});
|
|
181
|
+
const node = createPlaceholderNode({
|
|
182
|
+
...objectName === void 0 ? {} : { name: objectName },
|
|
183
|
+
...matchedKey === void 0 ? {} : { placeholder: matchedKey },
|
|
184
|
+
nativePlaceholder: nativeRef,
|
|
185
|
+
...clickResult?.link === void 0 ? {} : { link: clickResult.link },
|
|
186
|
+
...localBox
|
|
187
|
+
});
|
|
188
|
+
if (clickResult?.deferredSlideLink !== void 0 && context.registerDeferredSlideLink !== void 0) {
|
|
189
|
+
const deferred = clickResult.deferredSlideLink;
|
|
190
|
+
context.registerDeferredSlideLink({
|
|
191
|
+
...deferred,
|
|
192
|
+
apply(targetSlideId) {
|
|
193
|
+
node.set({ link: { id: targetSlideId } });
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
node,
|
|
199
|
+
diagnostics
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/** Shape-tree import handler wired into `contentPlaceholderMechanism` for unpopulated `<p:sp><p:ph .../></p:sp>` placeholders without `<p:txBody>`. */
|
|
203
|
+
const contentPlaceholderImportHandler = {
|
|
204
|
+
target: "shape-tree",
|
|
205
|
+
localName: "sp",
|
|
206
|
+
matches: (cursor) => isPlaceholderSpElement(cursor) && directElementChild(cursor.element, "http://schemas.openxmlformats.org/presentationml/2006/main", "txBody") === void 0,
|
|
207
|
+
read: readContentPlaceholderSp
|
|
208
|
+
};
|
|
209
|
+
/** Typed native canvas mechanism connecting emit, paint, and import for unpopulated `content-placeholder`. */
|
|
210
|
+
const contentPlaceholderMechanism = defineCanvasMechanism({
|
|
211
|
+
key: "content-placeholder",
|
|
212
|
+
role: "canvas",
|
|
213
|
+
emit: emitPlaceholderModel,
|
|
214
|
+
paint: paintPlaceholderModel,
|
|
215
|
+
import: contentPlaceholderImportHandler
|
|
216
|
+
});
|
|
217
|
+
/** Capability preserving unpopulated non-text content placeholder slots across import/emit without synthesizing empty text bodies. */
|
|
218
|
+
const placeholderCapability = {
|
|
219
|
+
declaration: "placeholder",
|
|
220
|
+
mechanisms: [contentPlaceholderMechanism],
|
|
221
|
+
codegen: placeholderCodegen,
|
|
222
|
+
bind(input, context) {
|
|
223
|
+
const unknown = Object.keys(input.props).find((key) => !placeholderAllowedParameters.includes(key));
|
|
224
|
+
if (unknown !== void 0) throw new CapabilityError("unknown-parameter", `Placeholder contains unsupported parameter ${unknown}`);
|
|
225
|
+
if (input.children.length > 0) throw new CapabilityError("unsupported-children", "Unpopulated content placeholder does not accept children");
|
|
226
|
+
const placeholder = context.placeholder;
|
|
227
|
+
const rawNative = nativePlaceholderRefSchema.safeParse(input.props["nativePlaceholder"]);
|
|
228
|
+
const nativeRef = placeholder?.nativeRef ?? (rawNative.success ? rawNative.data : void 0);
|
|
229
|
+
if (nativeRef === void 0) throw new CapabilityError("missing-placeholder-binding", "Content placeholder requires a bound layout placeholder or nativePlaceholder descriptor");
|
|
230
|
+
const requestedName = parseOptionalName(input.props["name"]);
|
|
231
|
+
const morphKey = parseMorphKey(input.props["morphKey"]);
|
|
232
|
+
const link = parseLinkTarget(input.props["link"]);
|
|
233
|
+
const contract = parseCapabilityLayoutContract({
|
|
234
|
+
nativeKind: "sp",
|
|
235
|
+
props: input.props,
|
|
236
|
+
allowedStyleKeys: new Set(layoutStyleKeys),
|
|
237
|
+
allowPadding: false,
|
|
238
|
+
path: context.path
|
|
239
|
+
});
|
|
240
|
+
const placeholderGeometry = placeholder === void 0 ? void 0 : resolvePlaceholderGeometry(placeholder, input.props);
|
|
241
|
+
const rawX = placeholderGeometry?.x ?? input.props["x"];
|
|
242
|
+
const rawY = placeholderGeometry?.y ?? input.props["y"];
|
|
243
|
+
const rawWidth = placeholderGeometry?.width ?? input.props["width"];
|
|
244
|
+
const rawHeight = placeholderGeometry?.height ?? input.props["height"];
|
|
245
|
+
const native = {
|
|
246
|
+
...morphKey === void 0 ? {} : { morphKey },
|
|
247
|
+
...requestedName === void 0 ? {} : { hasExplicitName: true },
|
|
248
|
+
...link === void 0 ? {} : { link }
|
|
249
|
+
};
|
|
250
|
+
return {
|
|
251
|
+
contract,
|
|
252
|
+
...morphKey !== void 0 || requestedName !== void 0 || link !== void 0 ? { native } : {},
|
|
253
|
+
resolve(resolveContext) {
|
|
254
|
+
const box = {
|
|
255
|
+
x: resolveContext.layoutBox?.x ?? (typeof rawX === "number" ? rawX : 0),
|
|
256
|
+
y: resolveContext.layoutBox?.y ?? (typeof rawY === "number" ? rawY : 0),
|
|
257
|
+
width: resolveContext.layoutBox?.width ?? (typeof rawWidth === "number" ? rawWidth : 100),
|
|
258
|
+
height: resolveContext.layoutBox?.height ?? (typeof rawHeight === "number" ? rawHeight : 100)
|
|
259
|
+
};
|
|
260
|
+
const name = resolveContext.morphName ?? requestedName ?? placeholder?.layoutPlaceholder?.name ?? `Placeholder ${resolveContext.id - 1}`;
|
|
261
|
+
try {
|
|
262
|
+
assertXml10Characters(name);
|
|
263
|
+
} catch {
|
|
264
|
+
throw new CapabilityError("invalid-xml-character", "Placeholder.name contains characters not allowed in XML 1.0");
|
|
265
|
+
}
|
|
266
|
+
const omitSpPrTransform = placeholder !== void 0 && placeholderGeometry?.hasLocalBoxOverride !== true;
|
|
267
|
+
const model = {
|
|
268
|
+
box,
|
|
269
|
+
name,
|
|
270
|
+
nativeRef,
|
|
271
|
+
omitSpPrTransform
|
|
272
|
+
};
|
|
273
|
+
return {
|
|
274
|
+
observation: {
|
|
275
|
+
id: resolveContext.id,
|
|
276
|
+
kind: "placeholder",
|
|
277
|
+
name,
|
|
278
|
+
box
|
|
279
|
+
},
|
|
280
|
+
extensions: [],
|
|
281
|
+
emit(emitContext) {
|
|
282
|
+
return contentPlaceholderMechanism.emit(model, emitContext);
|
|
283
|
+
},
|
|
284
|
+
paint() {
|
|
285
|
+
return contentPlaceholderMechanism.paint(model, void 0);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
export { contentPlaceholderImportHandler, contentPlaceholderMechanism, createPlaceholderNode, placeholderCapability, placeholderDeclarationPropsSchema, readContentPlaceholderSp };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import "../../../codegen/dist/index.js";
|
|
2
|
+
import { defineObjectCodegen, expr } from "../../../codegen/dist/types.js";
|
|
3
|
+
import "../../../core/dist/document.js";
|
|
4
|
+
// ../capabilities/dist/shape/shape-codegen.js
|
|
5
|
+
const objectMotionPropKeys = /* @__PURE__ */ new Set([
|
|
6
|
+
"enter",
|
|
7
|
+
"emphasis",
|
|
8
|
+
"motion"
|
|
9
|
+
]);
|
|
10
|
+
function isRecord(value) {
|
|
11
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12
|
+
}
|
|
13
|
+
function formatSvgNumber(value, ctx, propPath) {
|
|
14
|
+
if (typeof value !== "number" || !Number.isFinite(value)) ctx.fail("unexpressible-value", `Non-finite geometry coordinate ${String(value)} cannot be expressed in source`, propPath);
|
|
15
|
+
return Object.is(value, -0) ? "0" : String(value);
|
|
16
|
+
}
|
|
17
|
+
function commandsToSvgPath(commands, ctx, basePath) {
|
|
18
|
+
if (commands.length === 0) return void 0;
|
|
19
|
+
const segments = [];
|
|
20
|
+
for (let index = 0; index < commands.length; index += 1) {
|
|
21
|
+
const command = commands[index];
|
|
22
|
+
if (!isRecord(command) || typeof command["op"] !== "string") return;
|
|
23
|
+
const cmdPath = `${basePath}.commands[${index}]`;
|
|
24
|
+
switch (command["op"]) {
|
|
25
|
+
case "M":
|
|
26
|
+
case "L": {
|
|
27
|
+
if (index === 0 && command["op"] !== "M") return void 0;
|
|
28
|
+
const x = formatSvgNumber(command["x"], ctx, `${cmdPath}.x`);
|
|
29
|
+
const y = formatSvgNumber(command["y"], ctx, `${cmdPath}.y`);
|
|
30
|
+
segments.push(`${command["op"]} ${x} ${y}`);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
case "C": {
|
|
34
|
+
if (index === 0) return void 0;
|
|
35
|
+
const x1 = formatSvgNumber(command["x1"], ctx, `${cmdPath}.x1`);
|
|
36
|
+
const y1 = formatSvgNumber(command["y1"], ctx, `${cmdPath}.y1`);
|
|
37
|
+
const x2 = formatSvgNumber(command["x2"], ctx, `${cmdPath}.x2`);
|
|
38
|
+
const y2 = formatSvgNumber(command["y2"], ctx, `${cmdPath}.y2`);
|
|
39
|
+
const x = formatSvgNumber(command["x"], ctx, `${cmdPath}.x`);
|
|
40
|
+
const y = formatSvgNumber(command["y"], ctx, `${cmdPath}.y`);
|
|
41
|
+
segments.push(`C ${x1} ${y1} ${x2} ${y2} ${x} ${y}`);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case "Q": {
|
|
45
|
+
if (index === 0) return void 0;
|
|
46
|
+
const x1 = formatSvgNumber(command["x1"], ctx, `${cmdPath}.x1`);
|
|
47
|
+
const y1 = formatSvgNumber(command["y1"], ctx, `${cmdPath}.y1`);
|
|
48
|
+
const x = formatSvgNumber(command["x"], ctx, `${cmdPath}.x`);
|
|
49
|
+
const y = formatSvgNumber(command["y"], ctx, `${cmdPath}.y`);
|
|
50
|
+
segments.push(`Q ${x1} ${y1} ${x} ${y}`);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case "Z":
|
|
54
|
+
if (index === 0) return void 0;
|
|
55
|
+
segments.push("Z");
|
|
56
|
+
break;
|
|
57
|
+
default: return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return segments.join(" ");
|
|
61
|
+
}
|
|
62
|
+
function trySerializeCustomAsPath(value, ctx) {
|
|
63
|
+
const width = value["width"];
|
|
64
|
+
const height = value["height"];
|
|
65
|
+
const paths = value["paths"];
|
|
66
|
+
if (typeof width !== "number" || !Number.isFinite(width) || width <= 0 || typeof height !== "number" || !Number.isFinite(height) || height <= 0 || !Array.isArray(paths) || paths.length === 0) return;
|
|
67
|
+
const firstPath = paths[0];
|
|
68
|
+
if (!isRecord(firstPath)) return void 0;
|
|
69
|
+
const uniformFill = firstPath["fill"];
|
|
70
|
+
const uniformStroke = firstPath["stroke"];
|
|
71
|
+
const svgStrings = [];
|
|
72
|
+
for (let index = 0; index < paths.length; index += 1) {
|
|
73
|
+
const entry = paths[index];
|
|
74
|
+
if (!isRecord(entry) || !Array.isArray(entry["commands"])) return;
|
|
75
|
+
if (entry["fill"] !== uniformFill || entry["stroke"] !== uniformStroke) return;
|
|
76
|
+
const svg = commandsToSvgPath(entry["commands"], ctx, `@geometry.paths[${index}]`);
|
|
77
|
+
if (svg === void 0) return void 0;
|
|
78
|
+
svgStrings.push(svg);
|
|
79
|
+
}
|
|
80
|
+
const pathFn = ctx.useImport("path");
|
|
81
|
+
const dataExpr = svgStrings.length === 1 ? JSON.stringify(svgStrings[0]) : ctx.emitValueExpr(svgStrings, "@geometry.paths");
|
|
82
|
+
const optionsObj = {
|
|
83
|
+
viewBox: [width, height],
|
|
84
|
+
...uniformFill === void 0 ? {} : { fill: uniformFill },
|
|
85
|
+
...uniformStroke === void 0 ? {} : { stroke: uniformStroke }
|
|
86
|
+
};
|
|
87
|
+
return expr(`${pathFn}(${dataExpr}, ${ctx.emitValueExpr(optionsObj, "@geometry")})`);
|
|
88
|
+
}
|
|
89
|
+
function serializeGeometryProp(value, ctx) {
|
|
90
|
+
if (typeof value === "string") return value;
|
|
91
|
+
if (!isRecord(value)) return expr(ctx.emitValueExpr(value, "@geometry"));
|
|
92
|
+
if (value["type"] === "preset" && typeof value["name"] === "string") {
|
|
93
|
+
const presetFn = ctx.useImport("preset");
|
|
94
|
+
const adjust = value["adjust"];
|
|
95
|
+
if (adjust !== void 0) {
|
|
96
|
+
if (!isRecord(adjust)) ctx.fail("unexpressible-value", "Preset geometry adjust must be a plain record", "@geometry.adjust");
|
|
97
|
+
if (Object.entries(adjust).filter(([, entryValue]) => entryValue !== void 0).length > 0) return expr(`${presetFn}(${JSON.stringify(value["name"])}, ${ctx.emitValueExpr(adjust, "@geometry.adjust")})`);
|
|
98
|
+
}
|
|
99
|
+
return expr(`${presetFn}(${JSON.stringify(value["name"])})`);
|
|
100
|
+
}
|
|
101
|
+
if (value["type"] === "custom") {
|
|
102
|
+
const asPath = trySerializeCustomAsPath(value, ctx);
|
|
103
|
+
if (asPath !== void 0) return asPath;
|
|
104
|
+
}
|
|
105
|
+
return expr(ctx.emitValueExpr(value, "@geometry"));
|
|
106
|
+
}
|
|
107
|
+
function serializeGradientValue(value, ctx) {
|
|
108
|
+
if (!isRecord(value)) return void 0;
|
|
109
|
+
const type = value["type"];
|
|
110
|
+
if (type === "linear-gradient") {
|
|
111
|
+
const angle = value["angle"];
|
|
112
|
+
const stops = value["stops"];
|
|
113
|
+
if (typeof angle !== "number" || !Array.isArray(stops)) return void 0;
|
|
114
|
+
const fn = ctx.useImport("linearGradient");
|
|
115
|
+
const args = [ctx.emitValueExpr(angle, "@angle"), ...stops.map((stop, idx) => ctx.emitValueExpr(stop, `@stops[${idx}]`))];
|
|
116
|
+
return expr(`${fn}(${args.join(", ")})`);
|
|
117
|
+
}
|
|
118
|
+
if (type === "radial-gradient") {
|
|
119
|
+
const stops = value["stops"];
|
|
120
|
+
if (!Array.isArray(stops)) return void 0;
|
|
121
|
+
const fn = ctx.useImport("radialGradient");
|
|
122
|
+
const args = stops.map((stop, idx) => ctx.emitValueExpr(stop, `@stops[${idx}]`));
|
|
123
|
+
return expr(`${fn}(${args.join(", ")})`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function collectShapeProps(node, ctx) {
|
|
127
|
+
if (node.children.length > 0 && node.props["text"] !== void 0) ctx.fail("unexpressible-value", "Shape.text and Shape children cannot be expressed simultaneously", "@text");
|
|
128
|
+
const extra = ctx.emitObjectExtraProps(node.props);
|
|
129
|
+
const entries = [];
|
|
130
|
+
for (const [key, value] of Object.entries(node.props)) {
|
|
131
|
+
if (value === void 0) continue;
|
|
132
|
+
if (objectMotionPropKeys.has(key)) {
|
|
133
|
+
if (Object.hasOwn(extra, key)) entries.push([key, extra[key]]);
|
|
134
|
+
else ctx.fail("unexpressible-value", `Object property ${JSON.stringify(key)} requires motion codegen support`, `@${key}`);
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (key === "geometry") {
|
|
138
|
+
entries.push([key, serializeGeometryProp(value, ctx)]);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
entries.push([key, value]);
|
|
142
|
+
}
|
|
143
|
+
return entries;
|
|
144
|
+
}
|
|
145
|
+
function emitShapeVanilla(node, ctx) {
|
|
146
|
+
const callee = ctx.useImport("shape");
|
|
147
|
+
const propsEntries = collectShapeProps(node, ctx);
|
|
148
|
+
const args = propsEntries.length === 0 ? [] : [ctx.formatProps(propsEntries)];
|
|
149
|
+
const children = node.children.length === 0 ? [] : ctx.emitRichTextChildren(node.children);
|
|
150
|
+
return ctx.formatVanillaCall(callee, args, children);
|
|
151
|
+
}
|
|
152
|
+
function emitShapeReact(node, ctx) {
|
|
153
|
+
const tag = ctx.useImport("Shape");
|
|
154
|
+
const propsEntries = collectShapeProps(node, ctx);
|
|
155
|
+
const children = node.children.length === 0 ? [] : ctx.emitRichTextChildren(node.children);
|
|
156
|
+
return ctx.formatJsxElement(tag, propsEntries, children);
|
|
157
|
+
}
|
|
158
|
+
/** Source codegen contribution for `shape` declarations and DrawingML gradient values. */
|
|
159
|
+
const shapeCodegen = defineObjectCodegen({
|
|
160
|
+
declarations: { shape: {
|
|
161
|
+
emitVanilla: emitShapeVanilla,
|
|
162
|
+
emitReact: emitShapeReact
|
|
163
|
+
} },
|
|
164
|
+
valueSerializers: [serializeGradientValue]
|
|
165
|
+
});
|
|
166
|
+
export { shapeCodegen };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { authorIdSchema } from "../../../core/dist/author-ids.js";
|
|
2
|
+
import { layoutStyleSchema } from "../../../core/dist/layout-schemas.js";
|
|
3
|
+
import { colorValueSchema, textStyleSchema, visualStyleSchema } from "../../../core/dist/theme.js";
|
|
4
|
+
import { linkTargetSchema } from "../../../core/dist/author-schemas.js";
|
|
5
|
+
import { geometrySchema } from "../../../core/dist/geometry-schemas.js";
|
|
6
|
+
import "../../../core/dist/capability.js";
|
|
7
|
+
import { pxToEmu } from "../../../emit/dist/ooxml.js";
|
|
8
|
+
import { RichTextContainer } from "../../../core/dist/document.js";
|
|
9
|
+
import "../../../emit/dist/index.js";
|
|
10
|
+
import { motionPropsSchema } from "../motion/motion-schemas.js";
|
|
11
|
+
import "../shared/geometry.js";
|
|
12
|
+
import { optionalNameSchema } from "../shared/identity.js";
|
|
13
|
+
import { morphKeySchema } from "../shared/morph-api.js";
|
|
14
|
+
import { lineEndStyleSchema } from "../shared/visual.js";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
// ../capabilities/dist/shape/shape-declaration.js
|
|
17
|
+
const shapeCoordinateSchema = z.number().finite().min(-1e6).max(1e6);
|
|
18
|
+
const shapeSizeSchema = z.number().finite().positive().refine((value) => {
|
|
19
|
+
const extentEmu = pxToEmu(value);
|
|
20
|
+
return extentEmu >= 1 && extentEmu <= 2147483647;
|
|
21
|
+
});
|
|
22
|
+
const shapeStyleSchema = z.strictObject({
|
|
23
|
+
...layoutStyleSchema.unwrap().shape,
|
|
24
|
+
...visualStyleSchema.unwrap().shape,
|
|
25
|
+
...lineEndStyleSchema.unwrap().shape,
|
|
26
|
+
...textStyleSchema.unwrap().shape
|
|
27
|
+
}).readonly();
|
|
28
|
+
const motionPropsShape = motionPropsSchema.unwrap().shape;
|
|
29
|
+
const shapeDeclarationPropsObjectSchema = z.strictObject({
|
|
30
|
+
id: authorIdSchema.optional(),
|
|
31
|
+
name: optionalNameSchema.optional(),
|
|
32
|
+
morphKey: morphKeySchema.optional(),
|
|
33
|
+
link: linkTargetSchema.optional(),
|
|
34
|
+
geometry: geometrySchema.optional(),
|
|
35
|
+
flipH: z.boolean().optional(),
|
|
36
|
+
flipV: z.boolean().optional(),
|
|
37
|
+
x: shapeCoordinateSchema.optional(),
|
|
38
|
+
y: shapeCoordinateSchema.optional(),
|
|
39
|
+
width: shapeSizeSchema.optional(),
|
|
40
|
+
height: shapeSizeSchema.optional(),
|
|
41
|
+
style: shapeStyleSchema.optional(),
|
|
42
|
+
fill: colorValueSchema.optional(),
|
|
43
|
+
/** Directly writes native text into this shape without creating an additional text box; mutually exclusive with children. */
|
|
44
|
+
text: z.string().optional(),
|
|
45
|
+
/** Shape text uses shared text services and can still be emitted when text box capability is omitted. */
|
|
46
|
+
textStyle: textStyleSchema.optional(),
|
|
47
|
+
enter: motionPropsShape.enter,
|
|
48
|
+
emphasis: motionPropsShape.emphasis,
|
|
49
|
+
motion: motionPropsShape.motion
|
|
50
|
+
});
|
|
51
|
+
const shapeDeclarationPropsKeys = [...Object.keys(shapeDeclarationPropsObjectSchema.shape), "children"];
|
|
52
|
+
shapeDeclarationPropsObjectSchema.readonly();
|
|
53
|
+
/** Creates the editable native shape shared by the command factory and the Shape JSX element. */
|
|
54
|
+
function createShapeNode(props) {
|
|
55
|
+
return new RichTextContainer("shape", "shape", props);
|
|
56
|
+
}
|
|
57
|
+
export { createShapeNode, shapeCoordinateSchema, shapeDeclarationPropsKeys, shapeSizeSchema, shapeStyleSchema };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { hostNodeCreator } from "../../../core/dist/host.js";
|
|
2
|
+
import { motionElement } from "../motion/motion-elements.js";
|
|
3
|
+
import { createShapeNode } from "./shape-declaration.js";
|
|
4
|
+
// ../capabilities/dist/shape/shape-elements.js
|
|
5
|
+
/** Declares a native object handled by the shape module within the React tree. */
|
|
6
|
+
function Shape(props) {
|
|
7
|
+
return motionElement("shape", {
|
|
8
|
+
...props,
|
|
9
|
+
[hostNodeCreator]: createShapeNode
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export { Shape };
|