@hirokisakabe/pom 0.1.6 → 0.1.8
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 +173 -35
- package/dist/buildPptx.d.ts +3 -0
- package/dist/buildPptx.d.ts.map +1 -1
- package/dist/buildPptx.js +9 -3
- package/dist/calcYogaLayout/calcYogaLayout.d.ts.map +1 -1
- package/dist/calcYogaLayout/calcYogaLayout.js +41 -6
- package/dist/calcYogaLayout/measureImage.d.ts +13 -2
- package/dist/calcYogaLayout/measureImage.d.ts.map +1 -1
- package/dist/calcYogaLayout/measureImage.js +79 -3
- package/dist/calcYogaLayout/measureText.d.ts +9 -0
- package/dist/calcYogaLayout/measureText.d.ts.map +1 -1
- package/dist/calcYogaLayout/measureText.js +155 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/inputSchema.d.ts +75 -7
- package/dist/inputSchema.d.ts.map +1 -1
- package/dist/inputSchema.js +14 -3
- package/dist/renderPptx/renderPptx.d.ts.map +1 -1
- package/dist/renderPptx/renderPptx.js +22 -3
- package/dist/renderPptx/textOptions.d.ts +22 -1
- package/dist/renderPptx/textOptions.d.ts.map +1 -1
- package/dist/renderPptx/textOptions.js +27 -1
- package/dist/table/utils.d.ts +10 -0
- package/dist/table/utils.d.ts.map +1 -1
- package/dist/table/utils.js +18 -1
- package/dist/toPositioned/toPositioned.d.ts.map +1 -1
- package/dist/toPositioned/toPositioned.js +9 -0
- package/dist/types.d.ts +137 -14
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +46 -4
- package/package.json +18 -2
package/dist/types.d.ts
CHANGED
|
@@ -46,6 +46,50 @@ export declare const shadowStyleSchema: z.ZodObject<{
|
|
|
46
46
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
47
47
|
color: z.ZodOptional<z.ZodString>;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
|
+
export declare const bulletNumberTypeSchema: z.ZodEnum<{
|
|
50
|
+
alphaLcParenBoth: "alphaLcParenBoth";
|
|
51
|
+
alphaLcParenR: "alphaLcParenR";
|
|
52
|
+
alphaLcPeriod: "alphaLcPeriod";
|
|
53
|
+
alphaUcParenBoth: "alphaUcParenBoth";
|
|
54
|
+
alphaUcParenR: "alphaUcParenR";
|
|
55
|
+
alphaUcPeriod: "alphaUcPeriod";
|
|
56
|
+
arabicParenBoth: "arabicParenBoth";
|
|
57
|
+
arabicParenR: "arabicParenR";
|
|
58
|
+
arabicPeriod: "arabicPeriod";
|
|
59
|
+
arabicPlain: "arabicPlain";
|
|
60
|
+
romanLcParenBoth: "romanLcParenBoth";
|
|
61
|
+
romanLcParenR: "romanLcParenR";
|
|
62
|
+
romanLcPeriod: "romanLcPeriod";
|
|
63
|
+
romanUcParenBoth: "romanUcParenBoth";
|
|
64
|
+
romanUcParenR: "romanUcParenR";
|
|
65
|
+
romanUcPeriod: "romanUcPeriod";
|
|
66
|
+
}>;
|
|
67
|
+
export declare const bulletOptionsSchema: z.ZodObject<{
|
|
68
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
number: "number";
|
|
70
|
+
bullet: "bullet";
|
|
71
|
+
}>>;
|
|
72
|
+
indent: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
numberType: z.ZodOptional<z.ZodEnum<{
|
|
74
|
+
alphaLcParenBoth: "alphaLcParenBoth";
|
|
75
|
+
alphaLcParenR: "alphaLcParenR";
|
|
76
|
+
alphaLcPeriod: "alphaLcPeriod";
|
|
77
|
+
alphaUcParenBoth: "alphaUcParenBoth";
|
|
78
|
+
alphaUcParenR: "alphaUcParenR";
|
|
79
|
+
alphaUcPeriod: "alphaUcPeriod";
|
|
80
|
+
arabicParenBoth: "arabicParenBoth";
|
|
81
|
+
arabicParenR: "arabicParenR";
|
|
82
|
+
arabicPeriod: "arabicPeriod";
|
|
83
|
+
arabicPlain: "arabicPlain";
|
|
84
|
+
romanLcParenBoth: "romanLcParenBoth";
|
|
85
|
+
romanLcParenR: "romanLcParenR";
|
|
86
|
+
romanLcPeriod: "romanLcPeriod";
|
|
87
|
+
romanUcParenBoth: "romanUcParenBoth";
|
|
88
|
+
romanUcParenR: "romanUcParenR";
|
|
89
|
+
romanUcPeriod: "romanUcPeriod";
|
|
90
|
+
}>>;
|
|
91
|
+
numberStartAt: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
}, z.core.$strip>;
|
|
49
93
|
export declare const alignItemsSchema: z.ZodEnum<{
|
|
50
94
|
start: "start";
|
|
51
95
|
center: "center";
|
|
@@ -250,6 +294,8 @@ export type BorderDash = z.infer<typeof borderDashSchema>;
|
|
|
250
294
|
export type BorderStyle = z.infer<typeof borderStyleSchema>;
|
|
251
295
|
export type FillStyle = z.infer<typeof fillStyleSchema>;
|
|
252
296
|
export type ShadowStyle = z.infer<typeof shadowStyleSchema>;
|
|
297
|
+
export type BulletNumberType = z.infer<typeof bulletNumberTypeSchema>;
|
|
298
|
+
export type BulletOptions = z.infer<typeof bulletOptionsSchema>;
|
|
253
299
|
export type AlignItems = z.infer<typeof alignItemsSchema>;
|
|
254
300
|
export type JustifyContent = z.infer<typeof justifyContentSchema>;
|
|
255
301
|
export type FlexDirection = z.infer<typeof flexDirectionSchema>;
|
|
@@ -326,6 +372,32 @@ export declare const textNodeSchema: z.ZodObject<{
|
|
|
326
372
|
bold: z.ZodOptional<z.ZodBoolean>;
|
|
327
373
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
328
374
|
lineSpacingMultiple: z.ZodOptional<z.ZodNumber>;
|
|
375
|
+
bullet: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
376
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
377
|
+
number: "number";
|
|
378
|
+
bullet: "bullet";
|
|
379
|
+
}>>;
|
|
380
|
+
indent: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
numberType: z.ZodOptional<z.ZodEnum<{
|
|
382
|
+
alphaLcParenBoth: "alphaLcParenBoth";
|
|
383
|
+
alphaLcParenR: "alphaLcParenR";
|
|
384
|
+
alphaLcPeriod: "alphaLcPeriod";
|
|
385
|
+
alphaUcParenBoth: "alphaUcParenBoth";
|
|
386
|
+
alphaUcParenR: "alphaUcParenR";
|
|
387
|
+
alphaUcPeriod: "alphaUcPeriod";
|
|
388
|
+
arabicParenBoth: "arabicParenBoth";
|
|
389
|
+
arabicParenR: "arabicParenR";
|
|
390
|
+
arabicPeriod: "arabicPeriod";
|
|
391
|
+
arabicPlain: "arabicPlain";
|
|
392
|
+
romanLcParenBoth: "romanLcParenBoth";
|
|
393
|
+
romanLcParenR: "romanLcParenR";
|
|
394
|
+
romanLcPeriod: "romanLcPeriod";
|
|
395
|
+
romanUcParenBoth: "romanUcParenBoth";
|
|
396
|
+
romanUcParenR: "romanUcParenR";
|
|
397
|
+
romanUcPeriod: "romanUcPeriod";
|
|
398
|
+
}>>;
|
|
399
|
+
numberStartAt: z.ZodOptional<z.ZodNumber>;
|
|
400
|
+
}, z.core.$strip>]>>;
|
|
329
401
|
}, z.core.$strip>;
|
|
330
402
|
export declare const imageNodeSchema: z.ZodObject<{
|
|
331
403
|
yogaNode: z.ZodOptional<z.ZodCustom<YogaNode, YogaNode>>;
|
|
@@ -387,7 +459,7 @@ export declare const tableRowSchema: z.ZodObject<{
|
|
|
387
459
|
height: z.ZodOptional<z.ZodNumber>;
|
|
388
460
|
}, z.core.$strip>;
|
|
389
461
|
export declare const tableColumnSchema: z.ZodObject<{
|
|
390
|
-
width: z.ZodNumber
|
|
462
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
391
463
|
}, z.core.$strip>;
|
|
392
464
|
export declare const tableNodeSchema: z.ZodObject<{
|
|
393
465
|
yogaNode: z.ZodOptional<z.ZodCustom<YogaNode, YogaNode>>;
|
|
@@ -420,7 +492,7 @@ export declare const tableNodeSchema: z.ZodObject<{
|
|
|
420
492
|
}, z.core.$strip>>;
|
|
421
493
|
type: z.ZodLiteral<"table">;
|
|
422
494
|
columns: z.ZodArray<z.ZodObject<{
|
|
423
|
-
width: z.ZodNumber
|
|
495
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
424
496
|
}, z.core.$strip>>;
|
|
425
497
|
rows: z.ZodArray<z.ZodObject<{
|
|
426
498
|
cells: z.ZodArray<z.ZodObject<{
|
|
@@ -680,12 +752,68 @@ export declare const shapeNodeSchema: z.ZodObject<{
|
|
|
680
752
|
color: z.ZodOptional<z.ZodString>;
|
|
681
753
|
}, z.core.$strip>>;
|
|
682
754
|
fontPx: z.ZodOptional<z.ZodNumber>;
|
|
683
|
-
|
|
755
|
+
color: z.ZodOptional<z.ZodString>;
|
|
684
756
|
alignText: z.ZodOptional<z.ZodEnum<{
|
|
685
757
|
right: "right";
|
|
686
758
|
left: "left";
|
|
687
759
|
center: "center";
|
|
688
760
|
}>>;
|
|
761
|
+
bold: z.ZodOptional<z.ZodBoolean>;
|
|
762
|
+
}, z.core.$strip>;
|
|
763
|
+
export declare const chartTypeSchema: z.ZodEnum<{
|
|
764
|
+
line: "line";
|
|
765
|
+
pie: "pie";
|
|
766
|
+
bar: "bar";
|
|
767
|
+
}>;
|
|
768
|
+
export declare const chartDataSchema: z.ZodObject<{
|
|
769
|
+
name: z.ZodOptional<z.ZodString>;
|
|
770
|
+
labels: z.ZodArray<z.ZodString>;
|
|
771
|
+
values: z.ZodArray<z.ZodNumber>;
|
|
772
|
+
}, z.core.$strip>;
|
|
773
|
+
export declare const chartNodeSchema: z.ZodObject<{
|
|
774
|
+
yogaNode: z.ZodOptional<z.ZodCustom<YogaNode, YogaNode>>;
|
|
775
|
+
w: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"max">, z.ZodString]>>;
|
|
776
|
+
h: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"max">, z.ZodString]>>;
|
|
777
|
+
minW: z.ZodOptional<z.ZodNumber>;
|
|
778
|
+
maxW: z.ZodOptional<z.ZodNumber>;
|
|
779
|
+
minH: z.ZodOptional<z.ZodNumber>;
|
|
780
|
+
maxH: z.ZodOptional<z.ZodNumber>;
|
|
781
|
+
padding: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
782
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
783
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
784
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
785
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
786
|
+
}, z.core.$strip>]>>;
|
|
787
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
788
|
+
border: z.ZodOptional<z.ZodObject<{
|
|
789
|
+
color: z.ZodOptional<z.ZodString>;
|
|
790
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
791
|
+
dashType: z.ZodOptional<z.ZodEnum<{
|
|
792
|
+
solid: "solid";
|
|
793
|
+
dash: "dash";
|
|
794
|
+
dashDot: "dashDot";
|
|
795
|
+
lgDash: "lgDash";
|
|
796
|
+
lgDashDot: "lgDashDot";
|
|
797
|
+
lgDashDotDot: "lgDashDotDot";
|
|
798
|
+
sysDash: "sysDash";
|
|
799
|
+
sysDot: "sysDot";
|
|
800
|
+
}>>;
|
|
801
|
+
}, z.core.$strip>>;
|
|
802
|
+
type: z.ZodLiteral<"chart">;
|
|
803
|
+
chartType: z.ZodEnum<{
|
|
804
|
+
line: "line";
|
|
805
|
+
pie: "pie";
|
|
806
|
+
bar: "bar";
|
|
807
|
+
}>;
|
|
808
|
+
data: z.ZodArray<z.ZodObject<{
|
|
809
|
+
name: z.ZodOptional<z.ZodString>;
|
|
810
|
+
labels: z.ZodArray<z.ZodString>;
|
|
811
|
+
values: z.ZodArray<z.ZodNumber>;
|
|
812
|
+
}, z.core.$strip>>;
|
|
813
|
+
showLegend: z.ZodOptional<z.ZodBoolean>;
|
|
814
|
+
showTitle: z.ZodOptional<z.ZodBoolean>;
|
|
815
|
+
title: z.ZodOptional<z.ZodString>;
|
|
816
|
+
chartColors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
689
817
|
}, z.core.$strip>;
|
|
690
818
|
export type TextNode = z.infer<typeof textNodeSchema>;
|
|
691
819
|
export type ImageNode = z.infer<typeof imageNodeSchema>;
|
|
@@ -694,6 +822,9 @@ export type TableRow = z.infer<typeof tableRowSchema>;
|
|
|
694
822
|
export type TableColumn = z.infer<typeof tableColumnSchema>;
|
|
695
823
|
export type TableNode = z.infer<typeof tableNodeSchema>;
|
|
696
824
|
export type ShapeNode = z.infer<typeof shapeNodeSchema>;
|
|
825
|
+
export type ChartType = z.infer<typeof chartTypeSchema>;
|
|
826
|
+
export type ChartData = z.infer<typeof chartDataSchema>;
|
|
827
|
+
export type ChartNode = z.infer<typeof chartNodeSchema>;
|
|
697
828
|
export type BoxNode = BasePOMNode & {
|
|
698
829
|
type: "box";
|
|
699
830
|
children: POMNode;
|
|
@@ -712,7 +843,7 @@ export type HStackNode = BasePOMNode & {
|
|
|
712
843
|
alignItems?: AlignItems;
|
|
713
844
|
justifyContent?: JustifyContent;
|
|
714
845
|
};
|
|
715
|
-
export type POMNode = TextNode | ImageNode | TableNode | BoxNode | VStackNode | HStackNode | ShapeNode;
|
|
846
|
+
export type POMNode = TextNode | ImageNode | TableNode | BoxNode | VStackNode | HStackNode | ShapeNode | ChartNode;
|
|
716
847
|
export declare const boxNodeSchema: z.ZodType<BoxNode>;
|
|
717
848
|
export declare const vStackNodeSchema: z.ZodType<VStackNode>;
|
|
718
849
|
export declare const hStackNodeSchema: z.ZodType<HStackNode>;
|
|
@@ -730,17 +861,13 @@ export type PositionedNode = (TextNode & PositionedBase) | (ImageNode & Position
|
|
|
730
861
|
children: PositionedNode[];
|
|
731
862
|
}) | (HStackNode & PositionedBase & {
|
|
732
863
|
children: PositionedNode[];
|
|
733
|
-
}) | (ShapeNode & PositionedBase);
|
|
864
|
+
}) | (ShapeNode & PositionedBase) | (ChartNode & PositionedBase);
|
|
734
865
|
export declare const positionedNodeSchema: z.ZodType<PositionedNode>;
|
|
735
866
|
export declare const pageNumberPositionSchema: z.ZodEnum<{
|
|
736
867
|
right: "right";
|
|
737
868
|
left: "left";
|
|
738
869
|
center: "center";
|
|
739
870
|
}>;
|
|
740
|
-
export declare const dateFormatSchema: z.ZodEnum<{
|
|
741
|
-
"YYYY/MM/DD": "YYYY/MM/DD";
|
|
742
|
-
locale: "locale";
|
|
743
|
-
}>;
|
|
744
871
|
export declare const masterSlideOptionsSchema: z.ZodObject<{
|
|
745
872
|
header: z.ZodOptional<z.ZodLazy<z.ZodType<POMNode, unknown, z.core.$ZodTypeInternals<POMNode, unknown>>>>;
|
|
746
873
|
footer: z.ZodOptional<z.ZodLazy<z.ZodType<POMNode, unknown, z.core.$ZodTypeInternals<POMNode, unknown>>>>;
|
|
@@ -752,14 +879,10 @@ export declare const masterSlideOptionsSchema: z.ZodObject<{
|
|
|
752
879
|
}>;
|
|
753
880
|
}, z.core.$strip>>;
|
|
754
881
|
date: z.ZodOptional<z.ZodObject<{
|
|
755
|
-
|
|
756
|
-
"YYYY/MM/DD": "YYYY/MM/DD";
|
|
757
|
-
locale: "locale";
|
|
758
|
-
}>;
|
|
882
|
+
value: z.ZodString;
|
|
759
883
|
}, z.core.$strip>>;
|
|
760
884
|
}, z.core.$strip>;
|
|
761
885
|
export type PageNumberPosition = z.infer<typeof pageNumberPositionSchema>;
|
|
762
|
-
export type DateFormat = z.infer<typeof dateFormatSchema>;
|
|
763
886
|
export type MasterSlideOptions = z.infer<typeof masterSlideOptionsSchema>;
|
|
764
887
|
export {};
|
|
765
888
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGx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B,CAAC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -41,6 +41,30 @@ export const shadowStyleSchema = z.object({
|
|
|
41
41
|
offset: z.number().optional(),
|
|
42
42
|
color: z.string().optional(),
|
|
43
43
|
});
|
|
44
|
+
export const bulletNumberTypeSchema = z.enum([
|
|
45
|
+
"alphaLcParenBoth",
|
|
46
|
+
"alphaLcParenR",
|
|
47
|
+
"alphaLcPeriod",
|
|
48
|
+
"alphaUcParenBoth",
|
|
49
|
+
"alphaUcParenR",
|
|
50
|
+
"alphaUcPeriod",
|
|
51
|
+
"arabicParenBoth",
|
|
52
|
+
"arabicParenR",
|
|
53
|
+
"arabicPeriod",
|
|
54
|
+
"arabicPlain",
|
|
55
|
+
"romanLcParenBoth",
|
|
56
|
+
"romanLcParenR",
|
|
57
|
+
"romanLcPeriod",
|
|
58
|
+
"romanUcParenBoth",
|
|
59
|
+
"romanUcParenR",
|
|
60
|
+
"romanUcPeriod",
|
|
61
|
+
]);
|
|
62
|
+
export const bulletOptionsSchema = z.object({
|
|
63
|
+
type: z.enum(["bullet", "number"]).optional(),
|
|
64
|
+
indent: z.number().optional(),
|
|
65
|
+
numberType: bulletNumberTypeSchema.optional(),
|
|
66
|
+
numberStartAt: z.number().optional(),
|
|
67
|
+
});
|
|
44
68
|
export const alignItemsSchema = z.enum(["start", "center", "end", "stretch"]);
|
|
45
69
|
export const justifyContentSchema = z.enum([
|
|
46
70
|
"start",
|
|
@@ -254,6 +278,7 @@ export const textNodeSchema = basePOMNodeSchema.extend({
|
|
|
254
278
|
bold: z.boolean().optional(),
|
|
255
279
|
fontFamily: z.string().optional(),
|
|
256
280
|
lineSpacingMultiple: z.number().optional(),
|
|
281
|
+
bullet: z.union([z.boolean(), bulletOptionsSchema]).optional(),
|
|
257
282
|
});
|
|
258
283
|
export const imageNodeSchema = basePOMNodeSchema.extend({
|
|
259
284
|
type: z.literal("image"),
|
|
@@ -272,7 +297,7 @@ export const tableRowSchema = z.object({
|
|
|
272
297
|
height: z.number().optional(),
|
|
273
298
|
});
|
|
274
299
|
export const tableColumnSchema = z.object({
|
|
275
|
-
width: z.number(),
|
|
300
|
+
width: z.number().optional(),
|
|
276
301
|
});
|
|
277
302
|
export const tableNodeSchema = basePOMNodeSchema.extend({
|
|
278
303
|
type: z.literal("table"),
|
|
@@ -288,8 +313,24 @@ export const shapeNodeSchema = basePOMNodeSchema.extend({
|
|
|
288
313
|
line: borderStyleSchema.optional(),
|
|
289
314
|
shadow: shadowStyleSchema.optional(),
|
|
290
315
|
fontPx: z.number().optional(),
|
|
291
|
-
|
|
316
|
+
color: z.string().optional(),
|
|
292
317
|
alignText: z.enum(["left", "center", "right"]).optional(),
|
|
318
|
+
bold: z.boolean().optional(),
|
|
319
|
+
});
|
|
320
|
+
export const chartTypeSchema = z.enum(["bar", "line", "pie"]);
|
|
321
|
+
export const chartDataSchema = z.object({
|
|
322
|
+
name: z.string().optional(),
|
|
323
|
+
labels: z.array(z.string()),
|
|
324
|
+
values: z.array(z.number()),
|
|
325
|
+
});
|
|
326
|
+
export const chartNodeSchema = basePOMNodeSchema.extend({
|
|
327
|
+
type: z.literal("chart"),
|
|
328
|
+
chartType: chartTypeSchema,
|
|
329
|
+
data: z.array(chartDataSchema),
|
|
330
|
+
showLegend: z.boolean().optional(),
|
|
331
|
+
showTitle: z.boolean().optional(),
|
|
332
|
+
title: z.string().optional(),
|
|
333
|
+
chartColors: z.array(z.string()).optional(),
|
|
293
334
|
});
|
|
294
335
|
// Define schemas using passthrough to maintain type safety
|
|
295
336
|
const boxNodeSchemaBase = basePOMNodeSchema.extend({
|
|
@@ -322,6 +363,7 @@ export const pomNodeSchema = z.lazy(() => z.discriminatedUnion("type", [
|
|
|
322
363
|
vStackNodeSchemaBase,
|
|
323
364
|
hStackNodeSchemaBase,
|
|
324
365
|
shapeNodeSchema,
|
|
366
|
+
chartNodeSchema,
|
|
325
367
|
]));
|
|
326
368
|
// ===== Positioned Node Types =====
|
|
327
369
|
const positionedBaseSchema = z.object({
|
|
@@ -344,10 +386,10 @@ export const positionedNodeSchema = z.lazy(() => z.union([
|
|
|
344
386
|
children: z.array(z.lazy(() => positionedNodeSchema)),
|
|
345
387
|
}),
|
|
346
388
|
shapeNodeSchema.merge(positionedBaseSchema),
|
|
389
|
+
chartNodeSchema.merge(positionedBaseSchema),
|
|
347
390
|
]));
|
|
348
391
|
// ===== Master Slide Options =====
|
|
349
392
|
export const pageNumberPositionSchema = z.enum(["left", "center", "right"]);
|
|
350
|
-
export const dateFormatSchema = z.enum(["YYYY/MM/DD", "locale"]);
|
|
351
393
|
export const masterSlideOptionsSchema = z.object({
|
|
352
394
|
header: z.lazy(() => pomNodeSchema).optional(),
|
|
353
395
|
footer: z.lazy(() => pomNodeSchema).optional(),
|
|
@@ -358,7 +400,7 @@ export const masterSlideOptionsSchema = z.object({
|
|
|
358
400
|
.optional(),
|
|
359
401
|
date: z
|
|
360
402
|
.object({
|
|
361
|
-
|
|
403
|
+
value: z.string(),
|
|
362
404
|
})
|
|
363
405
|
.optional(),
|
|
364
406
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hirokisakabe/pom",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "PowerPoint Object Model - A declarative TypeScript library for creating PowerPoint presentations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,7 +25,21 @@
|
|
|
25
25
|
"url": "git+https://github.com/hirokisakabe/pom.git"
|
|
26
26
|
},
|
|
27
27
|
"license": "MIT",
|
|
28
|
+
"keywords": [
|
|
29
|
+
"powerpoint",
|
|
30
|
+
"pptx",
|
|
31
|
+
"presentation",
|
|
32
|
+
"slides",
|
|
33
|
+
"typescript",
|
|
34
|
+
"declarative",
|
|
35
|
+
"flexbox",
|
|
36
|
+
"layout",
|
|
37
|
+
"office"
|
|
38
|
+
],
|
|
28
39
|
"author": "Hiroki Sakabe",
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18"
|
|
42
|
+
},
|
|
29
43
|
"scripts": {
|
|
30
44
|
"build": "tsc",
|
|
31
45
|
"prepublishOnly": "npm run build && npm run lint && npm run fmt:check && npm run typecheck && npm run test:run",
|
|
@@ -39,7 +53,9 @@
|
|
|
39
53
|
"vrt": "tsx vrt/runVrt.ts",
|
|
40
54
|
"vrt:update": "tsx vrt/runVrt.ts --update",
|
|
41
55
|
"vrt:docker": "docker compose run --rm vrt",
|
|
42
|
-
"vrt:docker:update": "docker compose run --rm vrt-update"
|
|
56
|
+
"vrt:docker:update": "docker compose run --rm vrt-update",
|
|
57
|
+
"preview": "tsx preview/lib/previewPptx.ts",
|
|
58
|
+
"preview:docker": "docker compose run --rm preview"
|
|
43
59
|
},
|
|
44
60
|
"devDependencies": {
|
|
45
61
|
"@eslint/js": "^9.39.1",
|