@hirokisakabe/pom 0.3.0 → 1.0.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.
@@ -1,11 +1,11 @@
1
1
  import { TextMeasurementMode } from "./calcYogaLayout/measureText";
2
- import { POMNode, MasterSlideOptions } from "./types";
2
+ import { POMNode, SlideMasterOptions } from "./types";
3
3
  export type { TextMeasurementMode };
4
4
  export declare function buildPptx(nodes: POMNode[], slideSize: {
5
5
  w: number;
6
6
  h: number;
7
7
  }, options?: {
8
- master?: MasterSlideOptions;
8
+ master?: SlideMasterOptions;
9
9
  textMeasurement?: TextMeasurementMode;
10
10
  }): Promise<import("pptxgenjs").default>;
11
11
  //# sourceMappingURL=buildPptx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildPptx.d.ts","sourceRoot":"","sources":["../src/buildPptx.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,OAAO,EAAkB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AA8FpC,wBAAsB,SAAS,CAC7B,KAAK,EAAE,OAAO,EAAE,EAChB,SAAS,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACnC,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,eAAe,CAAC,EAAE,mBAAmB,CAAC;CACvC,wCAsBF"}
1
+ {"version":3,"file":"buildPptx.d.ts","sourceRoot":"","sources":["../src/buildPptx.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,OAAO,EAAkB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,wBAAsB,SAAS,CAC7B,KAAK,EAAE,OAAO,EAAE,EAChB,SAAS,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EACnC,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,eAAe,CAAC,EAAE,mBAAmB,CAAC;CACvC,wCAoBF"}
package/dist/buildPptx.js CHANGED
@@ -2,65 +2,6 @@ import { calcYogaLayout } from "./calcYogaLayout/calcYogaLayout";
2
2
  import { setTextMeasurementMode, } from "./calcYogaLayout/measureText";
3
3
  import { renderPptx } from "./renderPptx/renderPptx";
4
4
  import { toPositioned } from "./toPositioned/toPositioned";
5
- function replacePlaceholders(node, pageNumber, totalPages, date) {
6
- if (node.type === "text") {
7
- return {
8
- ...node,
9
- text: node.text
10
- .replace(/\{\{page\}\}/g, String(pageNumber))
11
- .replace(/\{\{totalPages\}\}/g, String(totalPages))
12
- .replace(/\{\{date\}\}/g, date),
13
- };
14
- }
15
- if (node.type === "box") {
16
- return {
17
- ...node,
18
- children: replacePlaceholders(node.children, pageNumber, totalPages, date),
19
- };
20
- }
21
- if (node.type === "vstack" || node.type === "hstack") {
22
- return {
23
- ...node,
24
- children: node.children.map((child) => replacePlaceholders(child, pageNumber, totalPages, date)),
25
- };
26
- }
27
- return node;
28
- }
29
- function composePage(content, master, pageNumber, totalPages) {
30
- if (!master) {
31
- return content;
32
- }
33
- const date = master.date?.value ?? "";
34
- const children = [];
35
- // ヘッダーを追加
36
- if (master.header) {
37
- children.push(replacePlaceholders(master.header, pageNumber, totalPages, date));
38
- }
39
- // コンテンツを追加
40
- children.push(content);
41
- // フッターを追加
42
- if (master.footer) {
43
- children.push(replacePlaceholders(master.footer, pageNumber, totalPages, date));
44
- }
45
- // ページ番号を追加
46
- if (master.pageNumber) {
47
- const pageNumberNode = {
48
- type: "text",
49
- text: String(pageNumber),
50
- fontPx: 12,
51
- alignText: master.pageNumber.position,
52
- };
53
- children.push(pageNumberNode);
54
- }
55
- return {
56
- type: "vstack",
57
- w: "100%",
58
- h: "100%",
59
- alignItems: "stretch",
60
- justifyContent: "start",
61
- children,
62
- };
63
- }
64
5
  export async function buildPptx(nodes, slideSize, options) {
65
6
  // テキスト計測モードを設定(デフォルトは auto)
66
7
  if (options?.textMeasurement) {
@@ -70,14 +11,11 @@ export async function buildPptx(nodes, slideSize, options) {
70
11
  setTextMeasurementMode("auto");
71
12
  }
72
13
  const positionedPages = [];
73
- const totalPages = nodes.length;
74
- for (let i = 0; i < nodes.length; i++) {
75
- const node = nodes[i];
76
- const composedNode = composePage(node, options?.master, i + 1, totalPages);
77
- await calcYogaLayout(composedNode, slideSize);
78
- const positioned = toPositioned(composedNode);
14
+ for (const node of nodes) {
15
+ await calcYogaLayout(node, slideSize);
16
+ const positioned = toPositioned(node);
79
17
  positionedPages.push(positioned);
80
18
  }
81
- const pptx = renderPptx(positionedPages, slideSize);
19
+ const pptx = renderPptx(positionedPages, slideSize, options?.master);
82
20
  return pptx;
83
21
  }
@@ -812,20 +812,279 @@ export declare const inputHStackNodeSchema: z.ZodType<InputHStackNode>;
812
812
  * ```
813
813
  */
814
814
  export declare const inputPomNodeSchema: z.ZodType<InputPOMNode>;
815
- export declare const inputMasterSlideOptionsSchema: z.ZodObject<{
816
- header: z.ZodOptional<z.ZodLazy<z.ZodType<InputPOMNode, unknown, z.core.$ZodTypeInternals<InputPOMNode, unknown>>>>;
817
- footer: z.ZodOptional<z.ZodLazy<z.ZodType<InputPOMNode, unknown, z.core.$ZodTypeInternals<InputPOMNode, unknown>>>>;
818
- pageNumber: z.ZodOptional<z.ZodObject<{
819
- position: z.ZodEnum<{
815
+ export declare const inputMasterTextObjectSchema: z.ZodObject<{
816
+ type: z.ZodLiteral<"text">;
817
+ text: z.ZodString;
818
+ x: z.ZodNumber;
819
+ y: z.ZodNumber;
820
+ w: z.ZodNumber;
821
+ h: z.ZodNumber;
822
+ fontPx: z.ZodOptional<z.ZodNumber>;
823
+ fontFamily: z.ZodOptional<z.ZodString>;
824
+ color: z.ZodOptional<z.ZodString>;
825
+ bold: z.ZodOptional<z.ZodBoolean>;
826
+ alignText: z.ZodOptional<z.ZodEnum<{
827
+ right: "right";
828
+ left: "left";
829
+ center: "center";
830
+ }>>;
831
+ }, z.core.$strip>;
832
+ export declare const inputMasterImageObjectSchema: z.ZodObject<{
833
+ type: z.ZodLiteral<"image">;
834
+ src: z.ZodString;
835
+ x: z.ZodNumber;
836
+ y: z.ZodNumber;
837
+ w: z.ZodNumber;
838
+ h: z.ZodNumber;
839
+ }, z.core.$strip>;
840
+ export declare const inputMasterRectObjectSchema: z.ZodObject<{
841
+ type: z.ZodLiteral<"rect">;
842
+ x: z.ZodNumber;
843
+ y: z.ZodNumber;
844
+ w: z.ZodNumber;
845
+ h: z.ZodNumber;
846
+ fill: z.ZodOptional<z.ZodObject<{
847
+ color: z.ZodOptional<z.ZodString>;
848
+ transparency: z.ZodOptional<z.ZodNumber>;
849
+ }, z.core.$strip>>;
850
+ border: z.ZodOptional<z.ZodObject<{
851
+ color: z.ZodOptional<z.ZodString>;
852
+ width: z.ZodOptional<z.ZodNumber>;
853
+ dashType: z.ZodOptional<z.ZodEnum<{
854
+ solid: "solid";
855
+ dash: "dash";
856
+ dashDot: "dashDot";
857
+ lgDash: "lgDash";
858
+ lgDashDot: "lgDashDot";
859
+ lgDashDotDot: "lgDashDotDot";
860
+ sysDash: "sysDash";
861
+ sysDot: "sysDot";
862
+ }>>;
863
+ }, z.core.$strip>>;
864
+ }, z.core.$strip>;
865
+ export declare const inputMasterLineObjectSchema: z.ZodObject<{
866
+ type: z.ZodLiteral<"line">;
867
+ x: z.ZodNumber;
868
+ y: z.ZodNumber;
869
+ w: z.ZodNumber;
870
+ h: z.ZodNumber;
871
+ line: z.ZodOptional<z.ZodObject<{
872
+ color: z.ZodOptional<z.ZodString>;
873
+ width: z.ZodOptional<z.ZodNumber>;
874
+ dashType: z.ZodOptional<z.ZodEnum<{
875
+ solid: "solid";
876
+ dash: "dash";
877
+ dashDot: "dashDot";
878
+ lgDash: "lgDash";
879
+ lgDashDot: "lgDashDot";
880
+ lgDashDotDot: "lgDashDotDot";
881
+ sysDash: "sysDash";
882
+ sysDot: "sysDot";
883
+ }>>;
884
+ }, z.core.$strip>>;
885
+ }, z.core.$strip>;
886
+ export declare const inputMasterObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
887
+ type: z.ZodLiteral<"text">;
888
+ text: z.ZodString;
889
+ x: z.ZodNumber;
890
+ y: z.ZodNumber;
891
+ w: z.ZodNumber;
892
+ h: z.ZodNumber;
893
+ fontPx: z.ZodOptional<z.ZodNumber>;
894
+ fontFamily: z.ZodOptional<z.ZodString>;
895
+ color: z.ZodOptional<z.ZodString>;
896
+ bold: z.ZodOptional<z.ZodBoolean>;
897
+ alignText: z.ZodOptional<z.ZodEnum<{
898
+ right: "right";
899
+ left: "left";
900
+ center: "center";
901
+ }>>;
902
+ }, z.core.$strip>, z.ZodObject<{
903
+ type: z.ZodLiteral<"image">;
904
+ src: z.ZodString;
905
+ x: z.ZodNumber;
906
+ y: z.ZodNumber;
907
+ w: z.ZodNumber;
908
+ h: z.ZodNumber;
909
+ }, z.core.$strip>, z.ZodObject<{
910
+ type: z.ZodLiteral<"rect">;
911
+ x: z.ZodNumber;
912
+ y: z.ZodNumber;
913
+ w: z.ZodNumber;
914
+ h: z.ZodNumber;
915
+ fill: z.ZodOptional<z.ZodObject<{
916
+ color: z.ZodOptional<z.ZodString>;
917
+ transparency: z.ZodOptional<z.ZodNumber>;
918
+ }, z.core.$strip>>;
919
+ border: z.ZodOptional<z.ZodObject<{
920
+ color: z.ZodOptional<z.ZodString>;
921
+ width: z.ZodOptional<z.ZodNumber>;
922
+ dashType: z.ZodOptional<z.ZodEnum<{
923
+ solid: "solid";
924
+ dash: "dash";
925
+ dashDot: "dashDot";
926
+ lgDash: "lgDash";
927
+ lgDashDot: "lgDashDot";
928
+ lgDashDotDot: "lgDashDotDot";
929
+ sysDash: "sysDash";
930
+ sysDot: "sysDot";
931
+ }>>;
932
+ }, z.core.$strip>>;
933
+ }, z.core.$strip>, z.ZodObject<{
934
+ type: z.ZodLiteral<"line">;
935
+ x: z.ZodNumber;
936
+ y: z.ZodNumber;
937
+ w: z.ZodNumber;
938
+ h: z.ZodNumber;
939
+ line: z.ZodOptional<z.ZodObject<{
940
+ color: z.ZodOptional<z.ZodString>;
941
+ width: z.ZodOptional<z.ZodNumber>;
942
+ dashType: z.ZodOptional<z.ZodEnum<{
943
+ solid: "solid";
944
+ dash: "dash";
945
+ dashDot: "dashDot";
946
+ lgDash: "lgDash";
947
+ lgDashDot: "lgDashDot";
948
+ lgDashDotDot: "lgDashDotDot";
949
+ sysDash: "sysDash";
950
+ sysDot: "sysDot";
951
+ }>>;
952
+ }, z.core.$strip>>;
953
+ }, z.core.$strip>], "type">;
954
+ export declare const inputSlideNumberOptionsSchema: z.ZodObject<{
955
+ x: z.ZodNumber;
956
+ y: z.ZodNumber;
957
+ w: z.ZodOptional<z.ZodNumber>;
958
+ h: z.ZodOptional<z.ZodNumber>;
959
+ fontPx: z.ZodOptional<z.ZodNumber>;
960
+ fontFamily: z.ZodOptional<z.ZodString>;
961
+ color: z.ZodOptional<z.ZodString>;
962
+ }, z.core.$strip>;
963
+ export declare const inputSlideMasterBackgroundSchema: z.ZodUnion<readonly [z.ZodObject<{
964
+ color: z.ZodString;
965
+ }, z.core.$strip>, z.ZodObject<{
966
+ path: z.ZodString;
967
+ }, z.core.$strip>, z.ZodObject<{
968
+ data: z.ZodString;
969
+ }, z.core.$strip>]>;
970
+ export declare const inputSlideMasterMarginSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
971
+ top: z.ZodOptional<z.ZodNumber>;
972
+ right: z.ZodOptional<z.ZodNumber>;
973
+ bottom: z.ZodOptional<z.ZodNumber>;
974
+ left: z.ZodOptional<z.ZodNumber>;
975
+ }, z.core.$strip>]>;
976
+ /**
977
+ * Input schema for slide master options (for LLM/external input validation)
978
+ *
979
+ * @example
980
+ * ```typescript
981
+ * import { inputSlideMasterOptionsSchema, buildPptx } from "@hirokisakabe/pom";
982
+ *
983
+ * const masterOptions = inputSlideMasterOptionsSchema.parse({
984
+ * title: "MY_MASTER",
985
+ * background: { color: "F0F0F0" },
986
+ * objects: [
987
+ * { type: "text", text: "Header", x: 48, y: 12, w: 200, h: 28, fontPx: 14 },
988
+ * ],
989
+ * slideNumber: { x: 1100, y: 680, fontPx: 10 },
990
+ * });
991
+ *
992
+ * const pptx = await buildPptx([page], { w: 1280, h: 720 }, { master: masterOptions });
993
+ * ```
994
+ */
995
+ export declare const inputSlideMasterOptionsSchema: z.ZodObject<{
996
+ title: z.ZodOptional<z.ZodString>;
997
+ background: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
998
+ color: z.ZodString;
999
+ }, z.core.$strip>, z.ZodObject<{
1000
+ path: z.ZodString;
1001
+ }, z.core.$strip>, z.ZodObject<{
1002
+ data: z.ZodString;
1003
+ }, z.core.$strip>]>>;
1004
+ margin: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
1005
+ top: z.ZodOptional<z.ZodNumber>;
1006
+ right: z.ZodOptional<z.ZodNumber>;
1007
+ bottom: z.ZodOptional<z.ZodNumber>;
1008
+ left: z.ZodOptional<z.ZodNumber>;
1009
+ }, z.core.$strip>]>>;
1010
+ objects: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1011
+ type: z.ZodLiteral<"text">;
1012
+ text: z.ZodString;
1013
+ x: z.ZodNumber;
1014
+ y: z.ZodNumber;
1015
+ w: z.ZodNumber;
1016
+ h: z.ZodNumber;
1017
+ fontPx: z.ZodOptional<z.ZodNumber>;
1018
+ fontFamily: z.ZodOptional<z.ZodString>;
1019
+ color: z.ZodOptional<z.ZodString>;
1020
+ bold: z.ZodOptional<z.ZodBoolean>;
1021
+ alignText: z.ZodOptional<z.ZodEnum<{
820
1022
  right: "right";
821
1023
  left: "left";
822
1024
  center: "center";
823
- }>;
824
- }, z.core.$strip>>;
825
- date: z.ZodOptional<z.ZodObject<{
826
- value: z.ZodString;
1025
+ }>>;
1026
+ }, z.core.$strip>, z.ZodObject<{
1027
+ type: z.ZodLiteral<"image">;
1028
+ src: z.ZodString;
1029
+ x: z.ZodNumber;
1030
+ y: z.ZodNumber;
1031
+ w: z.ZodNumber;
1032
+ h: z.ZodNumber;
1033
+ }, z.core.$strip>, z.ZodObject<{
1034
+ type: z.ZodLiteral<"rect">;
1035
+ x: z.ZodNumber;
1036
+ y: z.ZodNumber;
1037
+ w: z.ZodNumber;
1038
+ h: z.ZodNumber;
1039
+ fill: z.ZodOptional<z.ZodObject<{
1040
+ color: z.ZodOptional<z.ZodString>;
1041
+ transparency: z.ZodOptional<z.ZodNumber>;
1042
+ }, z.core.$strip>>;
1043
+ border: z.ZodOptional<z.ZodObject<{
1044
+ color: z.ZodOptional<z.ZodString>;
1045
+ width: z.ZodOptional<z.ZodNumber>;
1046
+ dashType: z.ZodOptional<z.ZodEnum<{
1047
+ solid: "solid";
1048
+ dash: "dash";
1049
+ dashDot: "dashDot";
1050
+ lgDash: "lgDash";
1051
+ lgDashDot: "lgDashDot";
1052
+ lgDashDotDot: "lgDashDotDot";
1053
+ sysDash: "sysDash";
1054
+ sysDot: "sysDot";
1055
+ }>>;
1056
+ }, z.core.$strip>>;
1057
+ }, z.core.$strip>, z.ZodObject<{
1058
+ type: z.ZodLiteral<"line">;
1059
+ x: z.ZodNumber;
1060
+ y: z.ZodNumber;
1061
+ w: z.ZodNumber;
1062
+ h: z.ZodNumber;
1063
+ line: z.ZodOptional<z.ZodObject<{
1064
+ color: z.ZodOptional<z.ZodString>;
1065
+ width: z.ZodOptional<z.ZodNumber>;
1066
+ dashType: z.ZodOptional<z.ZodEnum<{
1067
+ solid: "solid";
1068
+ dash: "dash";
1069
+ dashDot: "dashDot";
1070
+ lgDash: "lgDash";
1071
+ lgDashDot: "lgDashDot";
1072
+ lgDashDotDot: "lgDashDotDot";
1073
+ sysDash: "sysDash";
1074
+ sysDot: "sysDot";
1075
+ }>>;
1076
+ }, z.core.$strip>>;
1077
+ }, z.core.$strip>], "type">>>;
1078
+ slideNumber: z.ZodOptional<z.ZodObject<{
1079
+ x: z.ZodNumber;
1080
+ y: z.ZodNumber;
1081
+ w: z.ZodOptional<z.ZodNumber>;
1082
+ h: z.ZodOptional<z.ZodNumber>;
1083
+ fontPx: z.ZodOptional<z.ZodNumber>;
1084
+ fontFamily: z.ZodOptional<z.ZodString>;
1085
+ color: z.ZodOptional<z.ZodString>;
827
1086
  }, z.core.$strip>>;
828
1087
  }, z.core.$strip>;
829
- export type InputMasterSlideOptions = z.infer<typeof inputMasterSlideOptionsSchema>;
1088
+ export type InputSlideMasterOptions = z.infer<typeof inputSlideMasterOptionsSchema>;
830
1089
  export {};
831
1090
  //# sourceMappingURL=inputSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inputSchema.d.ts","sourceRoot":"","sources":["../src/inputSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EA8BL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW9B,CAAC;AAEH,KAAK,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGzD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU9B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC"}
@@ -17,7 +17,7 @@
17
17
  * ```
18
18
  */
19
19
  import { z } from "zod";
20
- import { lengthSchema, paddingSchema, borderStyleSchema, fillStyleSchema, shadowStyleSchema, alignItemsSchema, justifyContentSchema, shapeTypeSchema, tableColumnSchema, tableRowSchema, pageNumberPositionSchema, chartTypeSchema, chartDataSchema, bulletOptionsSchema, radarStyleSchema, timelineDirectionSchema, timelineItemSchema, matrixAxisSchema, matrixQuadrantsSchema, matrixItemSchema, treeLayoutSchema, treeNodeShapeSchema, treeConnectorStyleSchema, flowDirectionSchema, flowNodeItemSchema, flowConnectionSchema, flowConnectorStyleSchema, processArrowDirectionSchema, processArrowStepSchema, } from "./types";
20
+ import { lengthSchema, paddingSchema, borderStyleSchema, fillStyleSchema, shadowStyleSchema, alignItemsSchema, justifyContentSchema, shapeTypeSchema, tableColumnSchema, tableRowSchema, chartTypeSchema, chartDataSchema, bulletOptionsSchema, radarStyleSchema, timelineDirectionSchema, timelineItemSchema, matrixAxisSchema, matrixQuadrantsSchema, matrixItemSchema, treeLayoutSchema, treeNodeShapeSchema, treeConnectorStyleSchema, flowDirectionSchema, flowNodeItemSchema, flowConnectionSchema, flowConnectorStyleSchema, processArrowDirectionSchema, processArrowStepSchema, } from "./types";
21
21
  // ===== Base Node Schema =====
22
22
  export const inputBaseNodeSchema = z.object({
23
23
  w: lengthSchema.optional(),
@@ -177,18 +177,97 @@ export const inputPomNodeSchema = z.lazy(() => z.discriminatedUnion("type", [
177
177
  inputFlowNodeSchema,
178
178
  inputProcessArrowNodeSchema,
179
179
  ]));
180
- // ===== Master Slide Options Schema =====
181
- export const inputMasterSlideOptionsSchema = z.object({
182
- header: z.lazy(() => inputPomNodeSchema).optional(),
183
- footer: z.lazy(() => inputPomNodeSchema).optional(),
184
- pageNumber: z
185
- .object({
186
- position: pageNumberPositionSchema,
187
- })
188
- .optional(),
189
- date: z
190
- .object({
191
- value: z.string(),
192
- })
193
- .optional(),
180
+ // ===== Slide Master Options Schema =====
181
+ export const inputMasterTextObjectSchema = z.object({
182
+ type: z.literal("text"),
183
+ text: z.string(),
184
+ x: z.number(),
185
+ y: z.number(),
186
+ w: z.number(),
187
+ h: z.number(),
188
+ fontPx: z.number().optional(),
189
+ fontFamily: z.string().optional(),
190
+ color: z.string().optional(),
191
+ bold: z.boolean().optional(),
192
+ alignText: z.enum(["left", "center", "right"]).optional(),
193
+ });
194
+ export const inputMasterImageObjectSchema = z.object({
195
+ type: z.literal("image"),
196
+ src: z.string(),
197
+ x: z.number(),
198
+ y: z.number(),
199
+ w: z.number(),
200
+ h: z.number(),
201
+ });
202
+ export const inputMasterRectObjectSchema = z.object({
203
+ type: z.literal("rect"),
204
+ x: z.number(),
205
+ y: z.number(),
206
+ w: z.number(),
207
+ h: z.number(),
208
+ fill: fillStyleSchema.optional(),
209
+ border: borderStyleSchema.optional(),
210
+ });
211
+ export const inputMasterLineObjectSchema = z.object({
212
+ type: z.literal("line"),
213
+ x: z.number(),
214
+ y: z.number(),
215
+ w: z.number(),
216
+ h: z.number(),
217
+ line: borderStyleSchema.optional(),
218
+ });
219
+ export const inputMasterObjectSchema = z.discriminatedUnion("type", [
220
+ inputMasterTextObjectSchema,
221
+ inputMasterImageObjectSchema,
222
+ inputMasterRectObjectSchema,
223
+ inputMasterLineObjectSchema,
224
+ ]);
225
+ export const inputSlideNumberOptionsSchema = z.object({
226
+ x: z.number(),
227
+ y: z.number(),
228
+ w: z.number().optional(),
229
+ h: z.number().optional(),
230
+ fontPx: z.number().optional(),
231
+ fontFamily: z.string().optional(),
232
+ color: z.string().optional(),
233
+ });
234
+ export const inputSlideMasterBackgroundSchema = z.union([
235
+ z.object({ color: z.string() }),
236
+ z.object({ path: z.string() }),
237
+ z.object({ data: z.string() }),
238
+ ]);
239
+ export const inputSlideMasterMarginSchema = z.union([
240
+ z.number(),
241
+ z.object({
242
+ top: z.number().optional(),
243
+ right: z.number().optional(),
244
+ bottom: z.number().optional(),
245
+ left: z.number().optional(),
246
+ }),
247
+ ]);
248
+ /**
249
+ * Input schema for slide master options (for LLM/external input validation)
250
+ *
251
+ * @example
252
+ * ```typescript
253
+ * import { inputSlideMasterOptionsSchema, buildPptx } from "@hirokisakabe/pom";
254
+ *
255
+ * const masterOptions = inputSlideMasterOptionsSchema.parse({
256
+ * title: "MY_MASTER",
257
+ * background: { color: "F0F0F0" },
258
+ * objects: [
259
+ * { type: "text", text: "Header", x: 48, y: 12, w: 200, h: 28, fontPx: 14 },
260
+ * ],
261
+ * slideNumber: { x: 1100, y: 680, fontPx: 10 },
262
+ * });
263
+ *
264
+ * const pptx = await buildPptx([page], { w: 1280, h: 720 }, { master: masterOptions });
265
+ * ```
266
+ */
267
+ export const inputSlideMasterOptionsSchema = z.object({
268
+ title: z.string().optional(),
269
+ background: inputSlideMasterBackgroundSchema.optional(),
270
+ margin: inputSlideMasterMarginSchema.optional(),
271
+ objects: z.array(inputMasterObjectSchema).optional(),
272
+ slideNumber: inputSlideNumberOptionsSchema.optional(),
194
273
  });
@@ -1,5 +1,5 @@
1
1
  import type PptxGenJSType from "pptxgenjs";
2
- import type { PositionedNode } from "../types";
2
+ import type { PositionedNode, SlideMasterOptions } from "../types";
3
3
  type SlidePx = {
4
4
  w: number;
5
5
  h: number;
@@ -10,7 +10,8 @@ export { PX_PER_IN, pxToIn, pxToPt } from "./units";
10
10
  * PositionedNode ツリーを PptxGenJS スライドに変換する
11
11
  * @param pages PositionedNode ツリーの配列(各要素が1ページ)
12
12
  * @param slidePx スライド全体のサイズ(px)
13
+ * @param master スライドマスターオプション(省略可能)
13
14
  * @returns PptxGenJS インスタンス
14
15
  */
15
- export declare function renderPptx(pages: PositionedNode[], slidePx: SlidePx): PptxGenJSType;
16
+ export declare function renderPptx(pages: PositionedNode[], slidePx: SlidePx, master?: SlideMasterOptions): PptxGenJSType;
16
17
  //# sourceMappingURL=renderPptx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderPptx.d.ts","sourceRoot":"","sources":["../../src/renderPptx/renderPptx.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,aAAa,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB/C,KAAK,OAAO,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,iBA8EnE"}
1
+ {"version":3,"file":"renderPptx.d.ts","sourceRoot":"","sources":["../../src/renderPptx/renderPptx.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,aAAa,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAiBlB,KAAK,OAAO,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAiJpD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,cAAc,EAAE,EACvB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,kBAAkB,iBAgI5B"}
@@ -1,30 +1,207 @@
1
1
  import { createRequire } from "module";
2
2
  const require = createRequire(import.meta.url);
3
3
  const PptxGenJS = require("pptxgenjs");
4
- import { pxToIn } from "./units";
4
+ import { pxToIn, pxToPt } from "./units";
5
5
  import { renderBackgroundAndBorder } from "./utils/backgroundBorder";
6
6
  import { renderTextNode, renderImageNode, renderTableNode, renderShapeNode, renderChartNode, renderTimelineNode, renderMatrixNode, renderTreeNode, renderFlowNode, renderProcessArrowNode, } from "./nodes";
7
7
  export { createTextOptions } from "./textOptions";
8
8
  export { PX_PER_IN, pxToIn, pxToPt } from "./units";
9
+ const DEFAULT_MASTER_NAME = "POM_MASTER";
10
+ /**
11
+ * MasterObject を pptxgenjs の objects 形式に変換する
12
+ */
13
+ function convertMasterObject(obj) {
14
+ switch (obj.type) {
15
+ case "text":
16
+ return {
17
+ text: {
18
+ text: obj.text,
19
+ options: {
20
+ x: pxToIn(obj.x),
21
+ y: pxToIn(obj.y),
22
+ w: pxToIn(obj.w),
23
+ h: pxToIn(obj.h),
24
+ fontSize: obj.fontPx ? pxToPt(obj.fontPx) : undefined,
25
+ fontFace: obj.fontFamily,
26
+ color: obj.color,
27
+ bold: obj.bold,
28
+ align: obj.alignText,
29
+ },
30
+ },
31
+ };
32
+ case "image": {
33
+ const imageProps = {
34
+ x: pxToIn(obj.x),
35
+ y: pxToIn(obj.y),
36
+ w: pxToIn(obj.w),
37
+ h: pxToIn(obj.h),
38
+ };
39
+ // src が data URI かパスかを判定
40
+ if (obj.src.startsWith("data:")) {
41
+ imageProps.data = obj.src;
42
+ }
43
+ else {
44
+ imageProps.path = obj.src;
45
+ }
46
+ return { image: imageProps };
47
+ }
48
+ case "rect":
49
+ return {
50
+ rect: {
51
+ x: pxToIn(obj.x),
52
+ y: pxToIn(obj.y),
53
+ w: pxToIn(obj.w),
54
+ h: pxToIn(obj.h),
55
+ fill: obj.fill
56
+ ? { color: obj.fill.color, transparency: obj.fill.transparency }
57
+ : undefined,
58
+ line: obj.border
59
+ ? {
60
+ color: obj.border.color,
61
+ width: obj.border.width,
62
+ dashType: obj.border.dashType,
63
+ }
64
+ : undefined,
65
+ },
66
+ };
67
+ case "line":
68
+ return {
69
+ line: {
70
+ x: pxToIn(obj.x),
71
+ y: pxToIn(obj.y),
72
+ w: pxToIn(obj.w),
73
+ h: pxToIn(obj.h),
74
+ line: obj.line
75
+ ? {
76
+ color: obj.line.color,
77
+ width: obj.line.width,
78
+ dashType: obj.line.dashType,
79
+ }
80
+ : { color: "000000", width: 1 },
81
+ },
82
+ };
83
+ }
84
+ }
85
+ /**
86
+ * SlideMasterOptions から pptxgenjs の defineSlideMaster を呼び出す
87
+ */
88
+ function defineSlideMasterFromOptions(pptx, master) {
89
+ const masterName = master.title || DEFAULT_MASTER_NAME;
90
+ const masterProps = {
91
+ title: masterName,
92
+ };
93
+ // background の変換
94
+ if (master.background) {
95
+ if ("color" in master.background) {
96
+ masterProps.background = { color: master.background.color };
97
+ }
98
+ else if ("path" in master.background) {
99
+ masterProps.background = { path: master.background.path };
100
+ }
101
+ else if ("data" in master.background) {
102
+ masterProps.background = { data: master.background.data };
103
+ }
104
+ }
105
+ // margin の変換 (px -> inches)
106
+ if (master.margin !== undefined) {
107
+ if (typeof master.margin === "number") {
108
+ masterProps.margin = pxToIn(master.margin);
109
+ }
110
+ else {
111
+ masterProps.margin = [
112
+ pxToIn(master.margin.top ?? 0),
113
+ pxToIn(master.margin.right ?? 0),
114
+ pxToIn(master.margin.bottom ?? 0),
115
+ pxToIn(master.margin.left ?? 0),
116
+ ];
117
+ }
118
+ }
119
+ // objects の変換
120
+ if (master.objects && master.objects.length > 0) {
121
+ masterProps.objects = master.objects.map((obj) => convertMasterObject(obj));
122
+ }
123
+ // slideNumber の変換
124
+ if (master.slideNumber) {
125
+ masterProps.slideNumber = {
126
+ x: pxToIn(master.slideNumber.x),
127
+ y: pxToIn(master.slideNumber.y),
128
+ w: master.slideNumber.w ? pxToIn(master.slideNumber.w) : undefined,
129
+ h: master.slideNumber.h ? pxToIn(master.slideNumber.h) : undefined,
130
+ fontSize: master.slideNumber.fontPx
131
+ ? pxToPt(master.slideNumber.fontPx)
132
+ : undefined,
133
+ fontFace: master.slideNumber.fontFamily,
134
+ color: master.slideNumber.color,
135
+ };
136
+ }
137
+ pptx.defineSlideMaster(masterProps);
138
+ return masterName;
139
+ }
9
140
  /**
10
141
  * PositionedNode ツリーを PptxGenJS スライドに変換する
11
142
  * @param pages PositionedNode ツリーの配列(各要素が1ページ)
12
143
  * @param slidePx スライド全体のサイズ(px)
144
+ * @param master スライドマスターオプション(省略可能)
13
145
  * @returns PptxGenJS インスタンス
14
146
  */
15
- export function renderPptx(pages, slidePx) {
147
+ export function renderPptx(pages, slidePx, master) {
16
148
  const slideIn = { w: pxToIn(slidePx.w), h: pxToIn(slidePx.h) }; // layout(=px) → PptxGenJS(=inch) への最終変換
17
149
  const pptx = new PptxGenJS();
18
150
  pptx.defineLayout({ name: "custom", width: slideIn.w, height: slideIn.h });
19
151
  pptx.layout = "custom";
152
+ // マスターが指定されている場合、defineSlideMaster を呼び出す
153
+ const masterName = master
154
+ ? defineSlideMasterFromOptions(pptx, master)
155
+ : undefined;
20
156
  for (const data of pages) {
21
- const slide = pptx.addSlide();
157
+ // マスターが指定されている場合は masterName を使用
158
+ const slide = masterName ? pptx.addSlide({ masterName }) : pptx.addSlide();
22
159
  const ctx = { slide, pptx };
160
+ // ルートノードの backgroundColor はスライドの background プロパティとして適用
161
+ // これにより、マスタースライドのオブジェクトを覆い隠さない
162
+ const rootBackgroundColor = data.backgroundColor;
163
+ if (rootBackgroundColor) {
164
+ slide.background = { color: rootBackgroundColor };
165
+ }
23
166
  /**
24
167
  * node をスライドにレンダリングする
168
+ * @param isRoot ルートノードかどうか(ルートノードの background は slide.background で処理済み)
25
169
  */
26
- function renderNode(node) {
27
- renderBackgroundAndBorder(node, ctx);
170
+ function renderNode(node, isRoot = false) {
171
+ // ルートノードの backgroundColor は既に slide.background に適用済みなのでスキップ
172
+ if (isRoot && rootBackgroundColor) {
173
+ // border のみ描画(backgroundColor はスキップ)
174
+ const { border, borderRadius } = node;
175
+ const hasBorder = Boolean(border &&
176
+ (border.color !== undefined ||
177
+ border.width !== undefined ||
178
+ border.dashType !== undefined));
179
+ if (hasBorder) {
180
+ const line = {
181
+ color: border?.color ?? "000000",
182
+ width: border?.width !== undefined ? pxToPt(border.width) : undefined,
183
+ dashType: border?.dashType,
184
+ };
185
+ const shapeType = borderRadius
186
+ ? ctx.pptx.ShapeType.roundRect
187
+ : ctx.pptx.ShapeType.rect;
188
+ const rectRadius = borderRadius
189
+ ? Math.min((borderRadius / Math.min(node.w, node.h)) * 2, 1)
190
+ : undefined;
191
+ ctx.slide.addShape(shapeType, {
192
+ x: pxToIn(node.x),
193
+ y: pxToIn(node.y),
194
+ w: pxToIn(node.w),
195
+ h: pxToIn(node.h),
196
+ fill: { type: "none" },
197
+ line,
198
+ rectRadius,
199
+ });
200
+ }
201
+ }
202
+ else {
203
+ renderBackgroundAndBorder(node, ctx);
204
+ }
28
205
  switch (node.type) {
29
206
  case "text":
30
207
  renderTextNode(node, ctx);
@@ -69,7 +246,7 @@ export function renderPptx(pages, slidePx) {
69
246
  break;
70
247
  }
71
248
  }
72
- renderNode(data);
249
+ renderNode(data, true); // ルートノードとして処理
73
250
  }
74
251
  return pptx;
75
252
  }
package/dist/schema.d.ts CHANGED
@@ -18,6 +18,6 @@
18
18
  * }
19
19
  * ```
20
20
  */
21
- export { inputPomNodeSchema, inputTextNodeSchema, inputImageNodeSchema, inputTableNodeSchema, inputBoxNodeSchema, inputVStackNodeSchema, inputHStackNodeSchema, inputShapeNodeSchema, inputChartNodeSchema, inputMasterSlideOptionsSchema, inputBaseNodeSchema, type InputPOMNode, type InputTextNode, type InputImageNode, type InputTableNode, type InputBoxNode, type InputVStackNode, type InputHStackNode, type InputShapeNode, type InputChartNode, type InputMasterSlideOptions, } from "./inputSchema";
22
- export { lengthSchema, paddingSchema, borderStyleSchema, borderDashSchema, fillStyleSchema, shadowStyleSchema, alignItemsSchema, justifyContentSchema, shapeTypeSchema, chartTypeSchema, chartDataSchema, bulletOptionsSchema, bulletNumberTypeSchema, tableColumnSchema, tableRowSchema, tableCellSchema, pageNumberPositionSchema, type Length, type Padding, type BorderStyle, type BorderDash, type FillStyle, type ShadowStyle, type AlignItems, type JustifyContent, type ShapeType, type ChartType, type ChartData, type BulletOptions, type BulletNumberType, type TableColumn, type TableRow, type TableCell, type PageNumberPosition, } from "./types";
21
+ export { inputPomNodeSchema, inputTextNodeSchema, inputImageNodeSchema, inputTableNodeSchema, inputBoxNodeSchema, inputVStackNodeSchema, inputHStackNodeSchema, inputShapeNodeSchema, inputChartNodeSchema, inputSlideMasterOptionsSchema, inputMasterTextObjectSchema, inputMasterImageObjectSchema, inputMasterRectObjectSchema, inputMasterLineObjectSchema, inputMasterObjectSchema, inputSlideNumberOptionsSchema, inputSlideMasterBackgroundSchema, inputSlideMasterMarginSchema, inputBaseNodeSchema, type InputPOMNode, type InputTextNode, type InputImageNode, type InputTableNode, type InputBoxNode, type InputVStackNode, type InputHStackNode, type InputShapeNode, type InputChartNode, type InputSlideMasterOptions, } from "./inputSchema";
22
+ export { lengthSchema, paddingSchema, borderStyleSchema, borderDashSchema, fillStyleSchema, shadowStyleSchema, alignItemsSchema, justifyContentSchema, shapeTypeSchema, chartTypeSchema, chartDataSchema, bulletOptionsSchema, bulletNumberTypeSchema, tableColumnSchema, tableRowSchema, tableCellSchema, slideMasterOptionsSchema, masterTextObjectSchema, masterImageObjectSchema, masterRectObjectSchema, masterLineObjectSchema, masterObjectSchema, slideNumberOptionsSchema, slideMasterBackgroundSchema, slideMasterMarginSchema, type Length, type Padding, type BorderStyle, type BorderDash, type FillStyle, type ShadowStyle, type AlignItems, type JustifyContent, type ShapeType, type ChartType, type ChartData, type BulletOptions, type BulletNumberType, type TableColumn, type TableRow, type TableCell, type SlideMasterOptions, type MasterTextObject, type MasterImageObject, type MasterRectObject, type MasterLineObject, type MasterObject, type SlideNumberOptions, type SlideMasterBackground, type SlideMasterMargin, } from "./types";
23
23
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,wBAAwB,EACxB,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EA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20
  */
21
21
  // Input schemas for LLM/external input validation
22
- export { inputPomNodeSchema, inputTextNodeSchema, inputImageNodeSchema, inputTableNodeSchema, inputBoxNodeSchema, inputVStackNodeSchema, inputHStackNodeSchema, inputShapeNodeSchema, inputChartNodeSchema, inputMasterSlideOptionsSchema, inputBaseNodeSchema, } from "./inputSchema";
22
+ export { inputPomNodeSchema, inputTextNodeSchema, inputImageNodeSchema, inputTableNodeSchema, inputBoxNodeSchema, inputVStackNodeSchema, inputHStackNodeSchema, inputShapeNodeSchema, inputChartNodeSchema, inputSlideMasterOptionsSchema, inputMasterTextObjectSchema, inputMasterImageObjectSchema, inputMasterRectObjectSchema, inputMasterLineObjectSchema, inputMasterObjectSchema, inputSlideNumberOptionsSchema, inputSlideMasterBackgroundSchema, inputSlideMasterMarginSchema, inputBaseNodeSchema, } from "./inputSchema";
23
23
  // Basic type schemas (browser-compatible)
24
- export { lengthSchema, paddingSchema, borderStyleSchema, borderDashSchema, fillStyleSchema, shadowStyleSchema, alignItemsSchema, justifyContentSchema, shapeTypeSchema, chartTypeSchema, chartDataSchema, bulletOptionsSchema, bulletNumberTypeSchema, tableColumnSchema, tableRowSchema, tableCellSchema, pageNumberPositionSchema, } from "./types";
24
+ export { lengthSchema, paddingSchema, borderStyleSchema, borderDashSchema, fillStyleSchema, shadowStyleSchema, alignItemsSchema, justifyContentSchema, shapeTypeSchema, chartTypeSchema, chartDataSchema, bulletOptionsSchema, bulletNumberTypeSchema, tableColumnSchema, tableRowSchema, tableCellSchema, slideMasterOptionsSchema, masterTextObjectSchema, masterImageObjectSchema, masterRectObjectSchema, masterLineObjectSchema, masterObjectSchema, slideNumberOptionsSchema, slideMasterBackgroundSchema, slideMasterMarginSchema, } from "./types";
package/dist/types.d.ts CHANGED
@@ -1285,26 +1285,268 @@ export type PositionedNode = (TextNode & PositionedBase) | (ImageNode & Position
1285
1285
  children: PositionedNode[];
1286
1286
  }) | (ShapeNode & PositionedBase) | (ChartNode & PositionedBase) | (TimelineNode & PositionedBase) | (MatrixNode & PositionedBase) | (TreeNode & PositionedBase) | (FlowNode & PositionedBase) | (ProcessArrowNode & PositionedBase);
1287
1287
  export declare const positionedNodeSchema: z.ZodType<PositionedNode>;
1288
- export declare const pageNumberPositionSchema: z.ZodEnum<{
1289
- right: "right";
1290
- left: "left";
1291
- center: "center";
1292
- }>;
1293
- export declare const masterSlideOptionsSchema: z.ZodObject<{
1294
- header: z.ZodOptional<z.ZodLazy<z.ZodType<POMNode, unknown, z.core.$ZodTypeInternals<POMNode, unknown>>>>;
1295
- footer: z.ZodOptional<z.ZodLazy<z.ZodType<POMNode, unknown, z.core.$ZodTypeInternals<POMNode, unknown>>>>;
1296
- pageNumber: z.ZodOptional<z.ZodObject<{
1297
- position: z.ZodEnum<{
1288
+ export declare const masterTextObjectSchema: z.ZodObject<{
1289
+ type: z.ZodLiteral<"text">;
1290
+ text: z.ZodString;
1291
+ x: z.ZodNumber;
1292
+ y: z.ZodNumber;
1293
+ w: z.ZodNumber;
1294
+ h: z.ZodNumber;
1295
+ fontPx: z.ZodOptional<z.ZodNumber>;
1296
+ fontFamily: z.ZodOptional<z.ZodString>;
1297
+ color: z.ZodOptional<z.ZodString>;
1298
+ bold: z.ZodOptional<z.ZodBoolean>;
1299
+ alignText: z.ZodOptional<z.ZodEnum<{
1300
+ right: "right";
1301
+ left: "left";
1302
+ center: "center";
1303
+ }>>;
1304
+ }, z.core.$strip>;
1305
+ export declare const masterImageObjectSchema: z.ZodObject<{
1306
+ type: z.ZodLiteral<"image">;
1307
+ src: z.ZodString;
1308
+ x: z.ZodNumber;
1309
+ y: z.ZodNumber;
1310
+ w: z.ZodNumber;
1311
+ h: z.ZodNumber;
1312
+ }, z.core.$strip>;
1313
+ export declare const masterRectObjectSchema: z.ZodObject<{
1314
+ type: z.ZodLiteral<"rect">;
1315
+ x: z.ZodNumber;
1316
+ y: z.ZodNumber;
1317
+ w: z.ZodNumber;
1318
+ h: z.ZodNumber;
1319
+ fill: z.ZodOptional<z.ZodObject<{
1320
+ color: z.ZodOptional<z.ZodString>;
1321
+ transparency: z.ZodOptional<z.ZodNumber>;
1322
+ }, z.core.$strip>>;
1323
+ border: z.ZodOptional<z.ZodObject<{
1324
+ color: z.ZodOptional<z.ZodString>;
1325
+ width: z.ZodOptional<z.ZodNumber>;
1326
+ dashType: z.ZodOptional<z.ZodEnum<{
1327
+ solid: "solid";
1328
+ dash: "dash";
1329
+ dashDot: "dashDot";
1330
+ lgDash: "lgDash";
1331
+ lgDashDot: "lgDashDot";
1332
+ lgDashDotDot: "lgDashDotDot";
1333
+ sysDash: "sysDash";
1334
+ sysDot: "sysDot";
1335
+ }>>;
1336
+ }, z.core.$strip>>;
1337
+ }, z.core.$strip>;
1338
+ export declare const masterLineObjectSchema: z.ZodObject<{
1339
+ type: z.ZodLiteral<"line">;
1340
+ x: z.ZodNumber;
1341
+ y: z.ZodNumber;
1342
+ w: z.ZodNumber;
1343
+ h: z.ZodNumber;
1344
+ line: z.ZodOptional<z.ZodObject<{
1345
+ color: z.ZodOptional<z.ZodString>;
1346
+ width: z.ZodOptional<z.ZodNumber>;
1347
+ dashType: z.ZodOptional<z.ZodEnum<{
1348
+ solid: "solid";
1349
+ dash: "dash";
1350
+ dashDot: "dashDot";
1351
+ lgDash: "lgDash";
1352
+ lgDashDot: "lgDashDot";
1353
+ lgDashDotDot: "lgDashDotDot";
1354
+ sysDash: "sysDash";
1355
+ sysDot: "sysDot";
1356
+ }>>;
1357
+ }, z.core.$strip>>;
1358
+ }, z.core.$strip>;
1359
+ export declare const masterObjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1360
+ type: z.ZodLiteral<"text">;
1361
+ text: z.ZodString;
1362
+ x: z.ZodNumber;
1363
+ y: z.ZodNumber;
1364
+ w: z.ZodNumber;
1365
+ h: z.ZodNumber;
1366
+ fontPx: z.ZodOptional<z.ZodNumber>;
1367
+ fontFamily: z.ZodOptional<z.ZodString>;
1368
+ color: z.ZodOptional<z.ZodString>;
1369
+ bold: z.ZodOptional<z.ZodBoolean>;
1370
+ alignText: z.ZodOptional<z.ZodEnum<{
1371
+ right: "right";
1372
+ left: "left";
1373
+ center: "center";
1374
+ }>>;
1375
+ }, z.core.$strip>, z.ZodObject<{
1376
+ type: z.ZodLiteral<"image">;
1377
+ src: z.ZodString;
1378
+ x: z.ZodNumber;
1379
+ y: z.ZodNumber;
1380
+ w: z.ZodNumber;
1381
+ h: z.ZodNumber;
1382
+ }, z.core.$strip>, z.ZodObject<{
1383
+ type: z.ZodLiteral<"rect">;
1384
+ x: z.ZodNumber;
1385
+ y: z.ZodNumber;
1386
+ w: z.ZodNumber;
1387
+ h: z.ZodNumber;
1388
+ fill: z.ZodOptional<z.ZodObject<{
1389
+ color: z.ZodOptional<z.ZodString>;
1390
+ transparency: z.ZodOptional<z.ZodNumber>;
1391
+ }, z.core.$strip>>;
1392
+ border: z.ZodOptional<z.ZodObject<{
1393
+ color: z.ZodOptional<z.ZodString>;
1394
+ width: z.ZodOptional<z.ZodNumber>;
1395
+ dashType: z.ZodOptional<z.ZodEnum<{
1396
+ solid: "solid";
1397
+ dash: "dash";
1398
+ dashDot: "dashDot";
1399
+ lgDash: "lgDash";
1400
+ lgDashDot: "lgDashDot";
1401
+ lgDashDotDot: "lgDashDotDot";
1402
+ sysDash: "sysDash";
1403
+ sysDot: "sysDot";
1404
+ }>>;
1405
+ }, z.core.$strip>>;
1406
+ }, z.core.$strip>, z.ZodObject<{
1407
+ type: z.ZodLiteral<"line">;
1408
+ x: z.ZodNumber;
1409
+ y: z.ZodNumber;
1410
+ w: z.ZodNumber;
1411
+ h: z.ZodNumber;
1412
+ line: z.ZodOptional<z.ZodObject<{
1413
+ color: z.ZodOptional<z.ZodString>;
1414
+ width: z.ZodOptional<z.ZodNumber>;
1415
+ dashType: z.ZodOptional<z.ZodEnum<{
1416
+ solid: "solid";
1417
+ dash: "dash";
1418
+ dashDot: "dashDot";
1419
+ lgDash: "lgDash";
1420
+ lgDashDot: "lgDashDot";
1421
+ lgDashDotDot: "lgDashDotDot";
1422
+ sysDash: "sysDash";
1423
+ sysDot: "sysDot";
1424
+ }>>;
1425
+ }, z.core.$strip>>;
1426
+ }, z.core.$strip>], "type">;
1427
+ export declare const slideNumberOptionsSchema: z.ZodObject<{
1428
+ x: z.ZodNumber;
1429
+ y: z.ZodNumber;
1430
+ w: z.ZodOptional<z.ZodNumber>;
1431
+ h: z.ZodOptional<z.ZodNumber>;
1432
+ fontPx: z.ZodOptional<z.ZodNumber>;
1433
+ fontFamily: z.ZodOptional<z.ZodString>;
1434
+ color: z.ZodOptional<z.ZodString>;
1435
+ }, z.core.$strip>;
1436
+ export declare const slideMasterBackgroundSchema: z.ZodUnion<readonly [z.ZodObject<{
1437
+ color: z.ZodString;
1438
+ }, z.core.$strip>, z.ZodObject<{
1439
+ path: z.ZodString;
1440
+ }, z.core.$strip>, z.ZodObject<{
1441
+ data: z.ZodString;
1442
+ }, z.core.$strip>]>;
1443
+ export declare const slideMasterMarginSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
1444
+ top: z.ZodOptional<z.ZodNumber>;
1445
+ right: z.ZodOptional<z.ZodNumber>;
1446
+ bottom: z.ZodOptional<z.ZodNumber>;
1447
+ left: z.ZodOptional<z.ZodNumber>;
1448
+ }, z.core.$strip>]>;
1449
+ export declare const slideMasterOptionsSchema: z.ZodObject<{
1450
+ title: z.ZodOptional<z.ZodString>;
1451
+ background: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1452
+ color: z.ZodString;
1453
+ }, z.core.$strip>, z.ZodObject<{
1454
+ path: z.ZodString;
1455
+ }, z.core.$strip>, z.ZodObject<{
1456
+ data: z.ZodString;
1457
+ }, z.core.$strip>]>>;
1458
+ margin: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
1459
+ top: z.ZodOptional<z.ZodNumber>;
1460
+ right: z.ZodOptional<z.ZodNumber>;
1461
+ bottom: z.ZodOptional<z.ZodNumber>;
1462
+ left: z.ZodOptional<z.ZodNumber>;
1463
+ }, z.core.$strip>]>>;
1464
+ objects: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1465
+ type: z.ZodLiteral<"text">;
1466
+ text: z.ZodString;
1467
+ x: z.ZodNumber;
1468
+ y: z.ZodNumber;
1469
+ w: z.ZodNumber;
1470
+ h: z.ZodNumber;
1471
+ fontPx: z.ZodOptional<z.ZodNumber>;
1472
+ fontFamily: z.ZodOptional<z.ZodString>;
1473
+ color: z.ZodOptional<z.ZodString>;
1474
+ bold: z.ZodOptional<z.ZodBoolean>;
1475
+ alignText: z.ZodOptional<z.ZodEnum<{
1298
1476
  right: "right";
1299
1477
  left: "left";
1300
1478
  center: "center";
1301
- }>;
1302
- }, z.core.$strip>>;
1303
- date: z.ZodOptional<z.ZodObject<{
1304
- value: z.ZodString;
1479
+ }>>;
1480
+ }, z.core.$strip>, z.ZodObject<{
1481
+ type: z.ZodLiteral<"image">;
1482
+ src: z.ZodString;
1483
+ x: z.ZodNumber;
1484
+ y: z.ZodNumber;
1485
+ w: z.ZodNumber;
1486
+ h: z.ZodNumber;
1487
+ }, z.core.$strip>, z.ZodObject<{
1488
+ type: z.ZodLiteral<"rect">;
1489
+ x: z.ZodNumber;
1490
+ y: z.ZodNumber;
1491
+ w: z.ZodNumber;
1492
+ h: z.ZodNumber;
1493
+ fill: z.ZodOptional<z.ZodObject<{
1494
+ color: z.ZodOptional<z.ZodString>;
1495
+ transparency: z.ZodOptional<z.ZodNumber>;
1496
+ }, z.core.$strip>>;
1497
+ border: z.ZodOptional<z.ZodObject<{
1498
+ color: z.ZodOptional<z.ZodString>;
1499
+ width: z.ZodOptional<z.ZodNumber>;
1500
+ dashType: z.ZodOptional<z.ZodEnum<{
1501
+ solid: "solid";
1502
+ dash: "dash";
1503
+ dashDot: "dashDot";
1504
+ lgDash: "lgDash";
1505
+ lgDashDot: "lgDashDot";
1506
+ lgDashDotDot: "lgDashDotDot";
1507
+ sysDash: "sysDash";
1508
+ sysDot: "sysDot";
1509
+ }>>;
1510
+ }, z.core.$strip>>;
1511
+ }, z.core.$strip>, z.ZodObject<{
1512
+ type: z.ZodLiteral<"line">;
1513
+ x: z.ZodNumber;
1514
+ y: z.ZodNumber;
1515
+ w: z.ZodNumber;
1516
+ h: z.ZodNumber;
1517
+ line: z.ZodOptional<z.ZodObject<{
1518
+ color: z.ZodOptional<z.ZodString>;
1519
+ width: z.ZodOptional<z.ZodNumber>;
1520
+ dashType: z.ZodOptional<z.ZodEnum<{
1521
+ solid: "solid";
1522
+ dash: "dash";
1523
+ dashDot: "dashDot";
1524
+ lgDash: "lgDash";
1525
+ lgDashDot: "lgDashDot";
1526
+ lgDashDotDot: "lgDashDotDot";
1527
+ sysDash: "sysDash";
1528
+ sysDot: "sysDot";
1529
+ }>>;
1530
+ }, z.core.$strip>>;
1531
+ }, z.core.$strip>], "type">>>;
1532
+ slideNumber: z.ZodOptional<z.ZodObject<{
1533
+ x: z.ZodNumber;
1534
+ y: z.ZodNumber;
1535
+ w: z.ZodOptional<z.ZodNumber>;
1536
+ h: z.ZodOptional<z.ZodNumber>;
1537
+ fontPx: z.ZodOptional<z.ZodNumber>;
1538
+ fontFamily: z.ZodOptional<z.ZodString>;
1539
+ color: z.ZodOptional<z.ZodString>;
1305
1540
  }, z.core.$strip>>;
1306
1541
  }, z.core.$strip>;
1307
- export type PageNumberPosition = z.infer<typeof pageNumberPositionSchema>;
1308
- export type MasterSlideOptions = z.infer<typeof masterSlideOptionsSchema>;
1542
+ export type MasterTextObject = z.infer<typeof masterTextObjectSchema>;
1543
+ export type MasterImageObject = z.infer<typeof masterImageObjectSchema>;
1544
+ export type MasterRectObject = z.infer<typeof masterRectObjectSchema>;
1545
+ export type MasterLineObject = z.infer<typeof masterLineObjectSchema>;
1546
+ export type MasterObject = z.infer<typeof masterObjectSchema>;
1547
+ export type SlideNumberOptions = z.infer<typeof slideNumberOptionsSchema>;
1548
+ export type SlideMasterBackground = z.infer<typeof slideMasterBackgroundSchema>;
1549
+ export type SlideMasterMargin = z.infer<typeof slideMasterMarginSchema>;
1550
+ export type SlideMasterOptions = z.infer<typeof slideMasterOptionsSchema>;
1309
1551
  export {};
1310
1552
  //# sourceMappingURL=types.d.ts.map
@@ -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;AAGxB,eAAO,MAAM,YAAY,sEAIvB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;mBAQxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;EAS3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;iBAI5B,CAAC;AAEH,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;iBAO5B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;EAiBjC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;iBAK9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;EAAgD,CAAC;AAE9E,eAAO,MAAM,oBAAoB;;;;;;;EAO/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;EAA4B,CAAC;AAE7D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmL1B,CAAC;AAGH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,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,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
@@ -535,19 +535,78 @@ export const positionedNodeSchema = z.lazy(() => z.union([
535
535
  flowNodeSchema.merge(positionedBaseSchema),
536
536
  processArrowNodeSchema.merge(positionedBaseSchema),
537
537
  ]));
538
- // ===== Master Slide Options =====
539
- export const pageNumberPositionSchema = z.enum(["left", "center", "right"]);
540
- export const masterSlideOptionsSchema = z.object({
541
- header: z.lazy(() => pomNodeSchema).optional(),
542
- footer: z.lazy(() => pomNodeSchema).optional(),
543
- pageNumber: z
544
- .object({
545
- position: pageNumberPositionSchema,
546
- })
547
- .optional(),
548
- date: z
549
- .object({
550
- value: z.string(),
551
- })
552
- .optional(),
538
+ // ===== Slide Master Options =====
539
+ export const masterTextObjectSchema = z.object({
540
+ type: z.literal("text"),
541
+ text: z.string(),
542
+ x: z.number(),
543
+ y: z.number(),
544
+ w: z.number(),
545
+ h: z.number(),
546
+ fontPx: z.number().optional(),
547
+ fontFamily: z.string().optional(),
548
+ color: z.string().optional(),
549
+ bold: z.boolean().optional(),
550
+ alignText: z.enum(["left", "center", "right"]).optional(),
551
+ });
552
+ export const masterImageObjectSchema = z.object({
553
+ type: z.literal("image"),
554
+ src: z.string(),
555
+ x: z.number(),
556
+ y: z.number(),
557
+ w: z.number(),
558
+ h: z.number(),
559
+ });
560
+ export const masterRectObjectSchema = z.object({
561
+ type: z.literal("rect"),
562
+ x: z.number(),
563
+ y: z.number(),
564
+ w: z.number(),
565
+ h: z.number(),
566
+ fill: fillStyleSchema.optional(),
567
+ border: borderStyleSchema.optional(),
568
+ });
569
+ export const masterLineObjectSchema = z.object({
570
+ type: z.literal("line"),
571
+ x: z.number(),
572
+ y: z.number(),
573
+ w: z.number(),
574
+ h: z.number(),
575
+ line: borderStyleSchema.optional(),
576
+ });
577
+ export const masterObjectSchema = z.discriminatedUnion("type", [
578
+ masterTextObjectSchema,
579
+ masterImageObjectSchema,
580
+ masterRectObjectSchema,
581
+ masterLineObjectSchema,
582
+ ]);
583
+ export const slideNumberOptionsSchema = z.object({
584
+ x: z.number(),
585
+ y: z.number(),
586
+ w: z.number().optional(),
587
+ h: z.number().optional(),
588
+ fontPx: z.number().optional(),
589
+ fontFamily: z.string().optional(),
590
+ color: z.string().optional(),
591
+ });
592
+ export const slideMasterBackgroundSchema = z.union([
593
+ z.object({ color: z.string() }),
594
+ z.object({ path: z.string() }),
595
+ z.object({ data: z.string() }),
596
+ ]);
597
+ export const slideMasterMarginSchema = z.union([
598
+ z.number(),
599
+ z.object({
600
+ top: z.number().optional(),
601
+ right: z.number().optional(),
602
+ bottom: z.number().optional(),
603
+ left: z.number().optional(),
604
+ }),
605
+ ]);
606
+ export const slideMasterOptionsSchema = z.object({
607
+ title: z.string().optional(),
608
+ background: slideMasterBackgroundSchema.optional(),
609
+ margin: slideMasterMarginSchema.optional(),
610
+ objects: z.array(masterObjectSchema).optional(),
611
+ slideNumber: slideNumberOptionsSchema.optional(),
553
612
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hirokisakabe/pom",
3
- "version": "0.3.0",
3
+ "version": "1.0.0",
4
4
  "description": "PowerPoint Object Model - A declarative TypeScript library for creating PowerPoint presentations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",