@hirokisakabe/pom 7.2.0 → 7.3.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 +2 -1
- package/dist/icons/renderIcon.d.ts +1 -1
- package/dist/icons/renderIcon.d.ts.map +1 -1
- package/dist/icons/renderIcon.js +5 -4
- package/dist/parseXml/coercionRules.d.ts.map +1 -1
- package/dist/parseXml/coercionRules.js +4 -0
- package/dist/parseXml/parseXml.d.ts.map +1 -1
- package/dist/parseXml/parseXml.js +16 -14
- package/dist/registry/definitions/icon.d.ts.map +1 -1
- package/dist/registry/definitions/icon.js +2 -4
- package/dist/registry/definitions/svg.d.ts +3 -0
- package/dist/registry/definitions/svg.d.ts.map +1 -0
- package/dist/registry/definitions/svg.js +29 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +2 -0
- package/dist/renderPptx/nodes/svg.d.ts +8 -0
- package/dist/renderPptx/nodes/svg.d.ts.map +1 -0
- package/dist/renderPptx/nodes/svg.js +10 -0
- package/dist/types.d.ts +80 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,7 +89,8 @@ await pptx.writeFile({ fileName: "presentation.pptx" });
|
|
|
89
89
|
| Layer | Absolute-positioned overlay container |
|
|
90
90
|
| VStack | Vertical stack layout |
|
|
91
91
|
| HStack | Horizontal stack layout |
|
|
92
|
-
| Icon | Lucide icons
|
|
92
|
+
| Icon | Lucide icons |
|
|
93
|
+
| Svg | Inline SVG graphics |
|
|
93
94
|
|
|
94
95
|
For detailed node documentation, see [Nodes](./docs/nodes.md).
|
|
95
96
|
|
|
@@ -3,5 +3,5 @@ export declare function rasterizeIcon(name: string, size: number, color: string,
|
|
|
3
3
|
* インライン SVG 文字列を指定サイズでラスタライズし、base64 PNG を返す。
|
|
4
4
|
* color が指定された場合、SVG ルートに stroke / fill 属性を設定する。
|
|
5
5
|
*/
|
|
6
|
-
export declare function rasterizeSvgContent(svgContent: string,
|
|
6
|
+
export declare function rasterizeSvgContent(svgContent: string, width: number, color: string | undefined, cache: Map<string, string>, height?: number): Promise<string>;
|
|
7
7
|
//# sourceMappingURL=renderIcon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderIcon.d.ts","sourceRoot":"","sources":["../../src/icons/renderIcon.ts"],"names":[],"mappings":"AA2DA,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACzB,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,
|
|
1
|
+
{"version":3,"file":"renderIcon.d.ts","sourceRoot":"","sources":["../../src/icons/renderIcon.ts"],"names":[],"mappings":"AA2DA,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACzB,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CA0CjB"}
|
package/dist/icons/renderIcon.js
CHANGED
|
@@ -68,8 +68,9 @@ export async function rasterizeIcon(name, size, color, cache) {
|
|
|
68
68
|
* インライン SVG 文字列を指定サイズでラスタライズし、base64 PNG を返す。
|
|
69
69
|
* color が指定された場合、SVG ルートに stroke / fill 属性を設定する。
|
|
70
70
|
*/
|
|
71
|
-
export async function rasterizeSvgContent(svgContent,
|
|
72
|
-
const
|
|
71
|
+
export async function rasterizeSvgContent(svgContent, width, color, cache, height) {
|
|
72
|
+
const h = height ?? width;
|
|
73
|
+
const key = `svg:${svgContent}|${width}|${h}|${color ?? ""}`;
|
|
73
74
|
const cached = cache.get(key);
|
|
74
75
|
if (cached)
|
|
75
76
|
return cached;
|
|
@@ -84,7 +85,7 @@ export async function rasterizeSvgContent(svgContent, size, color, cache) {
|
|
|
84
85
|
let newAttrs = attrs
|
|
85
86
|
.replace(/\bwidth\s*=\s*"[^"]*"/g, "")
|
|
86
87
|
.replace(/\bheight\s*=\s*"[^"]*"/g, "");
|
|
87
|
-
newAttrs += ` width="${
|
|
88
|
+
newAttrs += ` width="${width}" height="${h}"`;
|
|
88
89
|
// color 指定時は stroke / fill を設定(プリセットアイコンとの一貫性)
|
|
89
90
|
if (color) {
|
|
90
91
|
if (!attrs.includes("stroke=")) {
|
|
@@ -98,7 +99,7 @@ export async function rasterizeSvgContent(svgContent, size, color, cache) {
|
|
|
98
99
|
});
|
|
99
100
|
await ensureWasmInitialized();
|
|
100
101
|
const Resvg = getResvg();
|
|
101
|
-
const resvg = new Resvg(svg, { fitTo: { mode: "width", value:
|
|
102
|
+
const resvg = new Resvg(svg, { fitTo: { mode: "width", value: width } });
|
|
102
103
|
const pngData = resvg.render();
|
|
103
104
|
const pngBuffer = pngData.asPng();
|
|
104
105
|
const result = `image/png;base64,${Buffer.from(pngBuffer).toString("base64")}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coercionRules.d.ts","sourceRoot":"","sources":["../../src/parseXml/coercionRules.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,MAAM,MAAM,YAAY,GACpB,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,MAAM,GACN;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;CAAE,GACrD;IA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,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CA+I1E,CAAC;AAGF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAgF7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseXml.d.ts","sourceRoot":"","sources":["../../src/parseXml/parseXml.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EAgBb,MAAM,aAAa,CAAC;AAYrB,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,MAAM,EAAE,MAAM,EAAE,CAAC;gBACrB,MAAM,EAAE,MAAM,EAAE;CAM7B;AAGD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"parseXml.d.ts","sourceRoot":"","sources":["../../src/parseXml/parseXml.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EAgBb,MAAM,aAAa,CAAC;AAYrB,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,MAAM,EAAE,MAAM,EAAE,CAAC;gBACrB,MAAM,EAAE,MAAM,EAAE;CAM7B;AAGD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoB9C,CAAC;AA6oCF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CAiCrD"}
|
|
@@ -31,6 +31,7 @@ export const TAG_TO_TYPE = {
|
|
|
31
31
|
HStack: "hstack",
|
|
32
32
|
Layer: "layer",
|
|
33
33
|
Icon: "icon",
|
|
34
|
+
Svg: "svg",
|
|
34
35
|
};
|
|
35
36
|
// Reverse mapping: node type → tag name
|
|
36
37
|
const TYPE_TO_TAG = Object.fromEntries(Object.entries(TAG_TO_TYPE).map(([tag, type]) => [type, tag]));
|
|
@@ -159,7 +160,8 @@ const CHILD_ELEMENT_PROPS = {
|
|
|
159
160
|
tree: new Set(["data"]),
|
|
160
161
|
ul: new Set(["items"]),
|
|
161
162
|
ol: new Set(["items"]),
|
|
162
|
-
icon: new Set(["name"
|
|
163
|
+
icon: new Set(["name"]),
|
|
164
|
+
svg: new Set(["svgContent"]),
|
|
163
165
|
};
|
|
164
166
|
function validateLeafNode(nodeType, result, errors) {
|
|
165
167
|
const schema = leafNodeValidationSchemas[nodeType];
|
|
@@ -678,20 +680,15 @@ const svgBuilder = new XMLBuilder({
|
|
|
678
680
|
function serializeSvgElement(svgElement) {
|
|
679
681
|
return String(svgBuilder.build([svgElement]));
|
|
680
682
|
}
|
|
681
|
-
function
|
|
683
|
+
function convertSvgChildren(childElements, result, errors) {
|
|
682
684
|
if (childElements.length !== 1) {
|
|
683
|
-
errors.push(`<
|
|
685
|
+
errors.push(`<Svg>: Expected exactly one <svg> child element, but found ${childElements.length} child element(s)`);
|
|
684
686
|
return;
|
|
685
687
|
}
|
|
686
688
|
const child = childElements[0];
|
|
687
689
|
const tag = getTagName(child);
|
|
688
690
|
if (tag !== "svg") {
|
|
689
|
-
errors.push(`<
|
|
690
|
-
return;
|
|
691
|
-
}
|
|
692
|
-
// name と svg の排他バリデーション
|
|
693
|
-
if (result.name !== undefined) {
|
|
694
|
-
errors.push('<Icon>: Cannot specify both "name" attribute and <svg> child element');
|
|
691
|
+
errors.push(`<Svg>: Expected <svg> child element, but found <${tag}>`);
|
|
695
692
|
return;
|
|
696
693
|
}
|
|
697
694
|
result.svgContent = serializeSvgElement(child);
|
|
@@ -725,7 +722,7 @@ const CHILD_ELEMENT_CONVERTERS = {
|
|
|
725
722
|
chart: convertChartChildren,
|
|
726
723
|
table: convertTableChildren,
|
|
727
724
|
tree: convertTreeChildren,
|
|
728
|
-
|
|
725
|
+
svg: convertSvgChildren,
|
|
729
726
|
};
|
|
730
727
|
// ===== Node conversion =====
|
|
731
728
|
function convertElement(node, errors) {
|
|
@@ -840,7 +837,7 @@ function convertPomNode(nodeType, tagName, attrs, childElements, textContent, er
|
|
|
840
837
|
if (!CONTAINER_TYPES.has(nodeType)) {
|
|
841
838
|
validateLeafNode(nodeType, result, errors);
|
|
842
839
|
}
|
|
843
|
-
// Icon: normalize color / bgColor
|
|
840
|
+
// Icon: normalize color / bgColor
|
|
844
841
|
if (nodeType === "icon") {
|
|
845
842
|
if (typeof result.color === "string" && !result.color.startsWith("#")) {
|
|
846
843
|
result.color = `#${result.color}`;
|
|
@@ -848,9 +845,14 @@ function convertPomNode(nodeType, tagName, attrs, childElements, textContent, er
|
|
|
848
845
|
if (typeof result.bgColor === "string" && !result.bgColor.startsWith("#")) {
|
|
849
846
|
result.bgColor = `#${result.bgColor}`;
|
|
850
847
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
848
|
+
}
|
|
849
|
+
// Svg: normalize color and validate svgContent
|
|
850
|
+
if (nodeType === "svg") {
|
|
851
|
+
if (typeof result.color === "string" && !result.color.startsWith("#")) {
|
|
852
|
+
result.color = `#${result.color}`;
|
|
853
|
+
}
|
|
854
|
+
if (result.svgContent === undefined) {
|
|
855
|
+
errors.push("<Svg>: A <svg> child element is required");
|
|
854
856
|
}
|
|
855
857
|
}
|
|
856
858
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/registry/definitions/icon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/registry/definitions/icon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,eAAO,MAAM,WAAW,EAAE,cAqEzB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rasterizeIcon
|
|
1
|
+
import { rasterizeIcon } from "../../icons/index.js";
|
|
2
2
|
import { renderIconNode } from "../../renderPptx/nodes/icon.js";
|
|
3
3
|
import { getContentArea } from "../../renderPptx/utils/contentArea.js";
|
|
4
4
|
export const iconNodeDef = {
|
|
@@ -24,9 +24,7 @@ export const iconNodeDef = {
|
|
|
24
24
|
});
|
|
25
25
|
// 実描画サイズに合わせてラスタライズ(不要に大きい PNG を防ぐ)
|
|
26
26
|
const rasterSize = Math.max(Math.ceil(n.variant ? iconSize : Math.min(content.w, content.h)), iconSize);
|
|
27
|
-
const iconImageData = n.
|
|
28
|
-
? await rasterizeSvgContent(n.svgContent, rasterSize, n.color, ctx.iconRasterCache)
|
|
29
|
-
: await rasterizeIcon(n.name, rasterSize, n.color ?? "#000000", ctx.iconRasterCache);
|
|
27
|
+
const iconImageData = await rasterizeIcon(n.name, rasterSize, n.color ?? "#000000", ctx.iconRasterCache);
|
|
30
28
|
const positioned = {
|
|
31
29
|
...n,
|
|
32
30
|
x: absoluteX,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../../src/registry/definitions/svg.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,UAAU,EAAE,cAiCxB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { rasterizeSvgContent } from "../../icons/index.js";
|
|
2
|
+
import { renderSvgNode } from "../../renderPptx/nodes/svg.js";
|
|
3
|
+
export const svgNodeDef = {
|
|
4
|
+
type: "svg",
|
|
5
|
+
category: "leaf",
|
|
6
|
+
applyYogaStyle(node, yn) {
|
|
7
|
+
const n = node;
|
|
8
|
+
const width = n.w ?? 24;
|
|
9
|
+
const height = n.h ?? 24;
|
|
10
|
+
yn.setMeasureFunc(() => ({ width, height }));
|
|
11
|
+
},
|
|
12
|
+
async toPositioned(pom, absoluteX, absoluteY, layout, ctx) {
|
|
13
|
+
const n = pom;
|
|
14
|
+
const rasterWidth = Math.ceil(layout.width);
|
|
15
|
+
const rasterHeight = Math.ceil(layout.height);
|
|
16
|
+
const iconImageData = await rasterizeSvgContent(n.svgContent, rasterWidth, n.color, ctx.iconRasterCache, rasterHeight);
|
|
17
|
+
return {
|
|
18
|
+
...n,
|
|
19
|
+
x: absoluteX,
|
|
20
|
+
y: absoluteY,
|
|
21
|
+
w: layout.width,
|
|
22
|
+
h: layout.height,
|
|
23
|
+
iconImageData,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
render(node, ctx) {
|
|
27
|
+
renderSvgNode(node, ctx);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/registry/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { lineNodeDef } from "./definitions/line.js";
|
|
|
10
10
|
import { timelineNodeDef, matrixNodeDef, treeNodeDef, flowNodeDef, processArrowNodeDef, pyramidNodeDef, } from "./definitions/compositeNodes.js";
|
|
11
11
|
import { vstackNodeDef, hstackNodeDef } from "./definitions/stack.js";
|
|
12
12
|
import { layerNodeDef } from "./definitions/layer.js";
|
|
13
|
+
import { svgNodeDef } from "./definitions/svg.js";
|
|
13
14
|
// 全ノード定義を登録
|
|
14
15
|
registerNode(textNodeDef);
|
|
15
16
|
registerNode(ulNodeDef);
|
|
@@ -29,4 +30,5 @@ registerNode(pyramidNodeDef);
|
|
|
29
30
|
registerNode(vstackNodeDef);
|
|
30
31
|
registerNode(hstackNodeDef);
|
|
31
32
|
registerNode(layerNodeDef);
|
|
33
|
+
registerNode(svgNodeDef);
|
|
32
34
|
export { getNodeDef } from "./nodeRegistry.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PositionedNode } from "../../types.ts";
|
|
2
|
+
import type { RenderContext } from "../types.ts";
|
|
3
|
+
type SvgPositionedNode = Extract<PositionedNode, {
|
|
4
|
+
type: "svg";
|
|
5
|
+
}>;
|
|
6
|
+
export declare function renderSvgNode(node: SvgPositionedNode, ctx: RenderContext): void;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../../src/renderPptx/nodes/svg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,KAAK,iBAAiB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAElE,wBAAgB,aAAa,CAC3B,IAAI,EAAE,iBAAiB,EACvB,GAAG,EAAE,aAAa,GACjB,IAAI,CAQN"}
|
package/dist/types.d.ts
CHANGED
|
@@ -764,10 +764,9 @@ export declare const iconNodeSchema: z.ZodObject<{
|
|
|
764
764
|
color: z.ZodOptional<z.ZodString>;
|
|
765
765
|
}, z.core.$strip>>;
|
|
766
766
|
type: z.ZodLiteral<"icon">;
|
|
767
|
-
name: z.
|
|
767
|
+
name: z.ZodEnum<{
|
|
768
768
|
[x: string]: string;
|
|
769
|
-
}
|
|
770
|
-
svgContent: z.ZodOptional<z.ZodString>;
|
|
769
|
+
}>;
|
|
771
770
|
size: z.ZodOptional<z.ZodNumber>;
|
|
772
771
|
color: z.ZodOptional<z.ZodString>;
|
|
773
772
|
variant: z.ZodOptional<z.ZodEnum<{
|
|
@@ -779,6 +778,81 @@ export declare const iconNodeSchema: z.ZodObject<{
|
|
|
779
778
|
bgColor: z.ZodOptional<z.ZodString>;
|
|
780
779
|
}, z.core.$strip>;
|
|
781
780
|
export type IconNode = z.infer<typeof iconNodeSchema>;
|
|
781
|
+
export declare const svgNodeSchema: z.ZodObject<{
|
|
782
|
+
minW: z.ZodOptional<z.ZodNumber>;
|
|
783
|
+
maxW: z.ZodOptional<z.ZodNumber>;
|
|
784
|
+
minH: z.ZodOptional<z.ZodNumber>;
|
|
785
|
+
maxH: z.ZodOptional<z.ZodNumber>;
|
|
786
|
+
padding: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
787
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
788
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
789
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
790
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
791
|
+
}, z.core.$strip>]>>;
|
|
792
|
+
margin: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
793
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
794
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
795
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
796
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
797
|
+
}, z.core.$strip>]>>;
|
|
798
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
799
|
+
backgroundImage: z.ZodOptional<z.ZodObject<{
|
|
800
|
+
src: z.ZodString;
|
|
801
|
+
sizing: z.ZodOptional<z.ZodEnum<{
|
|
802
|
+
cover: "cover";
|
|
803
|
+
contain: "contain";
|
|
804
|
+
}>>;
|
|
805
|
+
}, z.core.$strip>>;
|
|
806
|
+
border: z.ZodOptional<z.ZodObject<{
|
|
807
|
+
color: z.ZodOptional<z.ZodString>;
|
|
808
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
809
|
+
dashType: z.ZodOptional<z.ZodEnum<{
|
|
810
|
+
solid: "solid";
|
|
811
|
+
dash: "dash";
|
|
812
|
+
dashDot: "dashDot";
|
|
813
|
+
lgDash: "lgDash";
|
|
814
|
+
lgDashDot: "lgDashDot";
|
|
815
|
+
lgDashDotDot: "lgDashDotDot";
|
|
816
|
+
sysDash: "sysDash";
|
|
817
|
+
sysDot: "sysDot";
|
|
818
|
+
}>>;
|
|
819
|
+
}, z.core.$strip>>;
|
|
820
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
821
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
822
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
823
|
+
position: z.ZodOptional<z.ZodEnum<{
|
|
824
|
+
relative: "relative";
|
|
825
|
+
absolute: "absolute";
|
|
826
|
+
}>>;
|
|
827
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
828
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
829
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
830
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
831
|
+
alignSelf: z.ZodOptional<z.ZodEnum<{
|
|
832
|
+
auto: "auto";
|
|
833
|
+
start: "start";
|
|
834
|
+
center: "center";
|
|
835
|
+
end: "end";
|
|
836
|
+
stretch: "stretch";
|
|
837
|
+
}>>;
|
|
838
|
+
shadow: z.ZodOptional<z.ZodObject<{
|
|
839
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
840
|
+
outer: "outer";
|
|
841
|
+
inner: "inner";
|
|
842
|
+
}>>;
|
|
843
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
844
|
+
blur: z.ZodOptional<z.ZodNumber>;
|
|
845
|
+
angle: z.ZodOptional<z.ZodNumber>;
|
|
846
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
847
|
+
color: z.ZodOptional<z.ZodString>;
|
|
848
|
+
}, z.core.$strip>>;
|
|
849
|
+
type: z.ZodLiteral<"svg">;
|
|
850
|
+
svgContent: z.ZodString;
|
|
851
|
+
w: z.ZodOptional<z.ZodNumber>;
|
|
852
|
+
h: z.ZodOptional<z.ZodNumber>;
|
|
853
|
+
color: z.ZodOptional<z.ZodString>;
|
|
854
|
+
}, z.core.$strip>;
|
|
855
|
+
export type SvgNode = z.infer<typeof svgNodeSchema>;
|
|
782
856
|
export declare const tableNodeSchema: z.ZodObject<{
|
|
783
857
|
w: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"max">, z.ZodString]>>;
|
|
784
858
|
h: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"max">, z.ZodString]>>;
|
|
@@ -2062,7 +2136,7 @@ export type LayerNode = BasePOMNode & {
|
|
|
2062
2136
|
type: "layer";
|
|
2063
2137
|
children: LayerChild[];
|
|
2064
2138
|
};
|
|
2065
|
-
export type POMNode = TextNode | UlNode | OlNode | ImageNode | TableNode | VStackNode | HStackNode | ShapeNode | ChartNode | TimelineNode | MatrixNode | TreeNode | FlowNode | ProcessArrowNode | PyramidNode | LineNode | LayerNode | IconNode;
|
|
2139
|
+
export type POMNode = TextNode | UlNode | OlNode | ImageNode | TableNode | VStackNode | HStackNode | ShapeNode | ChartNode | TimelineNode | MatrixNode | TreeNode | FlowNode | ProcessArrowNode | PyramidNode | LineNode | LayerNode | IconNode | SvgNode;
|
|
2066
2140
|
declare const positionedBaseSchema: z.ZodObject<{
|
|
2067
2141
|
x: z.ZodNumber;
|
|
2068
2142
|
y: z.ZodNumber;
|
|
@@ -2092,6 +2166,8 @@ export type PositionedNode = (TextNode & PositionedBase) | (UlNode & PositionedB
|
|
|
2092
2166
|
iconY?: number;
|
|
2093
2167
|
iconW?: number;
|
|
2094
2168
|
iconH?: number;
|
|
2169
|
+
}) | (SvgNode & PositionedBase & {
|
|
2170
|
+
iconImageData: string;
|
|
2095
2171
|
});
|
|
2096
2172
|
declare const masterTextObjectSchema: z.ZodObject<{
|
|
2097
2173
|
type: z.ZodLiteral<"text">;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMnC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -402,13 +402,19 @@ const iconVariantSchema = z
|
|
|
402
402
|
.optional();
|
|
403
403
|
export const iconNodeSchema = basePOMNodeSchema.extend({
|
|
404
404
|
type: z.literal("icon"),
|
|
405
|
-
name: iconNameSchema
|
|
406
|
-
svgContent: z.string().optional(),
|
|
405
|
+
name: iconNameSchema,
|
|
407
406
|
size: z.number().positive().max(1024).optional(),
|
|
408
407
|
color: iconColorSchema,
|
|
409
408
|
variant: iconVariantSchema,
|
|
410
409
|
bgColor: iconColorSchema,
|
|
411
410
|
});
|
|
411
|
+
export const svgNodeSchema = basePOMNodeSchema.extend({
|
|
412
|
+
type: z.literal("svg"),
|
|
413
|
+
svgContent: z.string(),
|
|
414
|
+
w: z.number().positive().max(1024).optional(),
|
|
415
|
+
h: z.number().positive().max(1024).optional(),
|
|
416
|
+
color: iconColorSchema,
|
|
417
|
+
});
|
|
412
418
|
const tableCellSchema = z.object({
|
|
413
419
|
text: z.string(),
|
|
414
420
|
runs: z.array(textRunSchema).optional(),
|
|
@@ -691,6 +697,7 @@ const pomNodeSchema = z.lazy(() => z.discriminatedUnion("type", [
|
|
|
691
697
|
lineNodeSchema,
|
|
692
698
|
layerNodeSchemaBase,
|
|
693
699
|
iconNodeSchema,
|
|
700
|
+
svgNodeSchema,
|
|
694
701
|
]));
|
|
695
702
|
// ===== Positioned Node Types =====
|
|
696
703
|
const positionedBaseSchema = z.object({
|
|
@@ -732,6 +739,9 @@ const positionedNodeSchema = z.lazy(() => z.union([
|
|
|
732
739
|
iconNodeSchema.merge(positionedBaseSchema).extend({
|
|
733
740
|
iconImageData: z.string(),
|
|
734
741
|
}),
|
|
742
|
+
svgNodeSchema.merge(positionedBaseSchema).extend({
|
|
743
|
+
iconImageData: z.string(),
|
|
744
|
+
}),
|
|
735
745
|
]));
|
|
736
746
|
// ===== Slide Master Options =====
|
|
737
747
|
const masterTextObjectSchema = z.object({
|