@hirokisakabe/pom 0.1.5 → 0.1.7
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 +231 -71
- package/dist/buildPptx.d.ts.map +1 -1
- package/dist/buildPptx.js +1 -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/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 +24 -2
package/dist/inputSchema.d.ts
CHANGED
|
@@ -88,6 +88,32 @@ export declare const inputTextNodeSchema: z.ZodObject<{
|
|
|
88
88
|
bold: z.ZodOptional<z.ZodBoolean>;
|
|
89
89
|
fontFamily: z.ZodOptional<z.ZodString>;
|
|
90
90
|
lineSpacingMultiple: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
bullet: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
92
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
number: "number";
|
|
94
|
+
bullet: "bullet";
|
|
95
|
+
}>>;
|
|
96
|
+
indent: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
numberType: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
alphaLcParenBoth: "alphaLcParenBoth";
|
|
99
|
+
alphaLcParenR: "alphaLcParenR";
|
|
100
|
+
alphaLcPeriod: "alphaLcPeriod";
|
|
101
|
+
alphaUcParenBoth: "alphaUcParenBoth";
|
|
102
|
+
alphaUcParenR: "alphaUcParenR";
|
|
103
|
+
alphaUcPeriod: "alphaUcPeriod";
|
|
104
|
+
arabicParenBoth: "arabicParenBoth";
|
|
105
|
+
arabicParenR: "arabicParenR";
|
|
106
|
+
arabicPeriod: "arabicPeriod";
|
|
107
|
+
arabicPlain: "arabicPlain";
|
|
108
|
+
romanLcParenBoth: "romanLcParenBoth";
|
|
109
|
+
romanLcParenR: "romanLcParenR";
|
|
110
|
+
romanLcPeriod: "romanLcPeriod";
|
|
111
|
+
romanUcParenBoth: "romanUcParenBoth";
|
|
112
|
+
romanUcParenR: "romanUcParenR";
|
|
113
|
+
romanUcPeriod: "romanUcPeriod";
|
|
114
|
+
}>>;
|
|
115
|
+
numberStartAt: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
}, z.core.$strip>]>>;
|
|
91
117
|
}, z.core.$strip>;
|
|
92
118
|
export declare const inputImageNodeSchema: z.ZodObject<{
|
|
93
119
|
w: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"max">, z.ZodString]>>;
|
|
@@ -150,7 +176,7 @@ export declare const inputTableNodeSchema: z.ZodObject<{
|
|
|
150
176
|
}, z.core.$strip>>;
|
|
151
177
|
type: z.ZodLiteral<"table">;
|
|
152
178
|
columns: z.ZodArray<z.ZodObject<{
|
|
153
|
-
width: z.ZodNumber
|
|
179
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
154
180
|
}, z.core.$strip>>;
|
|
155
181
|
rows: z.ZodArray<z.ZodObject<{
|
|
156
182
|
cells: z.ZodArray<z.ZodObject<{
|
|
@@ -409,17 +435,62 @@ export declare const inputShapeNodeSchema: z.ZodObject<{
|
|
|
409
435
|
color: z.ZodOptional<z.ZodString>;
|
|
410
436
|
}, z.core.$strip>>;
|
|
411
437
|
fontPx: z.ZodOptional<z.ZodNumber>;
|
|
412
|
-
|
|
438
|
+
color: z.ZodOptional<z.ZodString>;
|
|
413
439
|
alignText: z.ZodOptional<z.ZodEnum<{
|
|
414
440
|
right: "right";
|
|
415
441
|
left: "left";
|
|
416
442
|
center: "center";
|
|
417
443
|
}>>;
|
|
418
444
|
}, z.core.$strip>;
|
|
445
|
+
export declare const inputChartNodeSchema: z.ZodObject<{
|
|
446
|
+
w: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"max">, z.ZodString]>>;
|
|
447
|
+
h: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"max">, z.ZodString]>>;
|
|
448
|
+
minW: z.ZodOptional<z.ZodNumber>;
|
|
449
|
+
maxW: z.ZodOptional<z.ZodNumber>;
|
|
450
|
+
minH: z.ZodOptional<z.ZodNumber>;
|
|
451
|
+
maxH: z.ZodOptional<z.ZodNumber>;
|
|
452
|
+
padding: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
453
|
+
top: z.ZodOptional<z.ZodNumber>;
|
|
454
|
+
right: z.ZodOptional<z.ZodNumber>;
|
|
455
|
+
bottom: z.ZodOptional<z.ZodNumber>;
|
|
456
|
+
left: z.ZodOptional<z.ZodNumber>;
|
|
457
|
+
}, z.core.$strip>]>>;
|
|
458
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
459
|
+
border: z.ZodOptional<z.ZodObject<{
|
|
460
|
+
color: z.ZodOptional<z.ZodString>;
|
|
461
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
462
|
+
dashType: z.ZodOptional<z.ZodEnum<{
|
|
463
|
+
solid: "solid";
|
|
464
|
+
dash: "dash";
|
|
465
|
+
dashDot: "dashDot";
|
|
466
|
+
lgDash: "lgDash";
|
|
467
|
+
lgDashDot: "lgDashDot";
|
|
468
|
+
lgDashDotDot: "lgDashDotDot";
|
|
469
|
+
sysDash: "sysDash";
|
|
470
|
+
sysDot: "sysDot";
|
|
471
|
+
}>>;
|
|
472
|
+
}, z.core.$strip>>;
|
|
473
|
+
type: z.ZodLiteral<"chart">;
|
|
474
|
+
chartType: z.ZodEnum<{
|
|
475
|
+
line: "line";
|
|
476
|
+
pie: "pie";
|
|
477
|
+
bar: "bar";
|
|
478
|
+
}>;
|
|
479
|
+
data: z.ZodArray<z.ZodObject<{
|
|
480
|
+
name: z.ZodOptional<z.ZodString>;
|
|
481
|
+
labels: z.ZodArray<z.ZodString>;
|
|
482
|
+
values: z.ZodArray<z.ZodNumber>;
|
|
483
|
+
}, z.core.$strip>>;
|
|
484
|
+
showLegend: z.ZodOptional<z.ZodBoolean>;
|
|
485
|
+
showTitle: z.ZodOptional<z.ZodBoolean>;
|
|
486
|
+
title: z.ZodOptional<z.ZodString>;
|
|
487
|
+
chartColors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
488
|
+
}, z.core.$strip>;
|
|
419
489
|
export type InputTextNode = z.infer<typeof inputTextNodeSchema>;
|
|
420
490
|
export type InputImageNode = z.infer<typeof inputImageNodeSchema>;
|
|
421
491
|
export type InputTableNode = z.infer<typeof inputTableNodeSchema>;
|
|
422
492
|
export type InputShapeNode = z.infer<typeof inputShapeNodeSchema>;
|
|
493
|
+
export type InputChartNode = z.infer<typeof inputChartNodeSchema>;
|
|
423
494
|
export type InputBoxNode = InputBaseNode & {
|
|
424
495
|
type: "box";
|
|
425
496
|
children: InputPOMNode;
|
|
@@ -438,7 +509,7 @@ export type InputHStackNode = InputBaseNode & {
|
|
|
438
509
|
alignItems?: AlignItems;
|
|
439
510
|
justifyContent?: JustifyContent;
|
|
440
511
|
};
|
|
441
|
-
export type InputPOMNode = InputTextNode | InputImageNode | InputTableNode | InputBoxNode | InputVStackNode | InputHStackNode | InputShapeNode;
|
|
512
|
+
export type InputPOMNode = InputTextNode | InputImageNode | InputTableNode | InputBoxNode | InputVStackNode | InputHStackNode | InputShapeNode | InputChartNode;
|
|
442
513
|
export declare const inputBoxNodeSchema: z.ZodType<InputBoxNode>;
|
|
443
514
|
export declare const inputVStackNodeSchema: z.ZodType<InputVStackNode>;
|
|
444
515
|
export declare const inputHStackNodeSchema: z.ZodType<InputHStackNode>;
|
|
@@ -472,10 +543,7 @@ export declare const inputMasterSlideOptionsSchema: z.ZodObject<{
|
|
|
472
543
|
}>;
|
|
473
544
|
}, z.core.$strip>>;
|
|
474
545
|
date: z.ZodOptional<z.ZodObject<{
|
|
475
|
-
|
|
476
|
-
"YYYY/MM/DD": "YYYY/MM/DD";
|
|
477
|
-
locale: "locale";
|
|
478
|
-
}>;
|
|
546
|
+
value: z.ZodString;
|
|
479
547
|
}, z.core.$strip>>;
|
|
480
548
|
}, z.core.$strip>;
|
|
481
549
|
export type InputMasterSlideOptions = z.infer<typeof inputMasterSlideOptionsSchema>;
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"inputSchema.d.ts","sourceRoot":"","sources":["../src/inputSchema.ts"],"names":[],"mappings":"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"}
|
package/dist/inputSchema.js
CHANGED
|
@@ -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,
|
|
20
|
+
import { lengthSchema, paddingSchema, borderStyleSchema, fillStyleSchema, shadowStyleSchema, alignItemsSchema, justifyContentSchema, shapeTypeSchema, tableColumnSchema, tableRowSchema, pageNumberPositionSchema, chartTypeSchema, chartDataSchema, bulletOptionsSchema, } from "./types";
|
|
21
21
|
// ===== Base Node Schema =====
|
|
22
22
|
export const inputBaseNodeSchema = z.object({
|
|
23
23
|
w: lengthSchema.optional(),
|
|
@@ -40,6 +40,7 @@ export const inputTextNodeSchema = inputBaseNodeSchema.extend({
|
|
|
40
40
|
bold: z.boolean().optional(),
|
|
41
41
|
fontFamily: z.string().optional(),
|
|
42
42
|
lineSpacingMultiple: z.number().optional(),
|
|
43
|
+
bullet: z.union([z.boolean(), bulletOptionsSchema]).optional(),
|
|
43
44
|
});
|
|
44
45
|
export const inputImageNodeSchema = inputBaseNodeSchema.extend({
|
|
45
46
|
type: z.literal("image"),
|
|
@@ -59,9 +60,18 @@ export const inputShapeNodeSchema = inputBaseNodeSchema.extend({
|
|
|
59
60
|
line: borderStyleSchema.optional(),
|
|
60
61
|
shadow: shadowStyleSchema.optional(),
|
|
61
62
|
fontPx: z.number().optional(),
|
|
62
|
-
|
|
63
|
+
color: z.string().optional(),
|
|
63
64
|
alignText: z.enum(["left", "center", "right"]).optional(),
|
|
64
65
|
});
|
|
66
|
+
export const inputChartNodeSchema = inputBaseNodeSchema.extend({
|
|
67
|
+
type: z.literal("chart"),
|
|
68
|
+
chartType: chartTypeSchema,
|
|
69
|
+
data: z.array(chartDataSchema),
|
|
70
|
+
showLegend: z.boolean().optional(),
|
|
71
|
+
showTitle: z.boolean().optional(),
|
|
72
|
+
title: z.string().optional(),
|
|
73
|
+
chartColors: z.array(z.string()).optional(),
|
|
74
|
+
});
|
|
65
75
|
// ===== Recursive Node Schemas =====
|
|
66
76
|
const inputBoxNodeSchemaBase = inputBaseNodeSchema.extend({
|
|
67
77
|
type: z.literal("box"),
|
|
@@ -110,6 +120,7 @@ export const inputPomNodeSchema = z.lazy(() => z.discriminatedUnion("type", [
|
|
|
110
120
|
inputVStackNodeSchemaBase,
|
|
111
121
|
inputHStackNodeSchemaBase,
|
|
112
122
|
inputShapeNodeSchema,
|
|
123
|
+
inputChartNodeSchema,
|
|
113
124
|
]));
|
|
114
125
|
// ===== Master Slide Options Schema =====
|
|
115
126
|
export const inputMasterSlideOptionsSchema = z.object({
|
|
@@ -122,7 +133,7 @@ export const inputMasterSlideOptionsSchema = z.object({
|
|
|
122
133
|
.optional(),
|
|
123
134
|
date: z
|
|
124
135
|
.object({
|
|
125
|
-
|
|
136
|
+
value: z.string(),
|
|
126
137
|
})
|
|
127
138
|
.optional(),
|
|
128
139
|
});
|
|
@@ -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;AAK/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,
|
|
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;AAK/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,iBA8MnE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "module";
|
|
2
2
|
const require = createRequire(import.meta.url);
|
|
3
3
|
const PptxGenJS = require("pptxgenjs");
|
|
4
|
-
import { resolveRowHeights } from "../table/utils";
|
|
4
|
+
import { resolveColumnWidths, resolveRowHeights } from "../table/utils";
|
|
5
5
|
import { createTextOptions } from "./textOptions";
|
|
6
6
|
import { pxToIn, pxToPt } from "./units";
|
|
7
7
|
export { createTextOptions } from "./textOptions";
|
|
@@ -104,7 +104,7 @@ export function renderPptx(pages, slidePx) {
|
|
|
104
104
|
y: pxToIn(node.y),
|
|
105
105
|
w: pxToIn(node.w),
|
|
106
106
|
h: pxToIn(node.h),
|
|
107
|
-
colW: node.
|
|
107
|
+
colW: resolveColumnWidths(node, node.w).map((width) => pxToIn(width)),
|
|
108
108
|
rowH: resolveRowHeights(node).map((height) => pxToIn(height)),
|
|
109
109
|
margin: 0,
|
|
110
110
|
};
|
|
@@ -150,7 +150,7 @@ export function renderPptx(pages, slidePx) {
|
|
|
150
150
|
shape: node.shapeType,
|
|
151
151
|
fontSize: pxToPt(node.fontPx ?? 24),
|
|
152
152
|
fontFace: "Noto Sans JP",
|
|
153
|
-
color: node.
|
|
153
|
+
color: node.color,
|
|
154
154
|
align: node.alignText ?? "center",
|
|
155
155
|
valign: "middle",
|
|
156
156
|
lineSpacingMultiple: 1.3,
|
|
@@ -162,6 +162,25 @@ export function renderPptx(pages, slidePx) {
|
|
|
162
162
|
}
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
165
|
+
case "chart": {
|
|
166
|
+
const chartData = node.data.map((d) => ({
|
|
167
|
+
name: d.name,
|
|
168
|
+
labels: d.labels,
|
|
169
|
+
values: d.values,
|
|
170
|
+
}));
|
|
171
|
+
const chartOptions = {
|
|
172
|
+
x: pxToIn(node.x),
|
|
173
|
+
y: pxToIn(node.y),
|
|
174
|
+
w: pxToIn(node.w),
|
|
175
|
+
h: pxToIn(node.h),
|
|
176
|
+
showLegend: node.showLegend ?? false,
|
|
177
|
+
showTitle: node.showTitle ?? false,
|
|
178
|
+
title: node.title,
|
|
179
|
+
chartColors: node.chartColors,
|
|
180
|
+
};
|
|
181
|
+
slide.addChart(node.chartType, chartData, chartOptions);
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
165
184
|
}
|
|
166
185
|
}
|
|
167
186
|
renderNode(data);
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import type { PositionedNode } from "../types";
|
|
1
|
+
import type { PositionedNode, BulletOptions } from "../types";
|
|
2
2
|
type TextNode = Extract<PositionedNode, {
|
|
3
3
|
type: "text";
|
|
4
4
|
}>;
|
|
5
|
+
type PptxBulletOptions = {
|
|
6
|
+
type?: "bullet" | "number";
|
|
7
|
+
indent?: number;
|
|
8
|
+
numberType?: BulletOptions["numberType"];
|
|
9
|
+
numberStartAt?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function createBulletOptions(bullet: boolean | BulletOptions): PptxBulletOptions | boolean;
|
|
5
12
|
export declare function createTextOptions(node: TextNode): {
|
|
6
13
|
x: number;
|
|
7
14
|
y: number;
|
|
@@ -15,6 +22,20 @@ export declare function createTextOptions(node: TextNode): {
|
|
|
15
22
|
lineSpacingMultiple: number;
|
|
16
23
|
color: string;
|
|
17
24
|
bold: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
bullet: boolean | PptxBulletOptions;
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
w: number;
|
|
30
|
+
h: number;
|
|
31
|
+
fontSize: number;
|
|
32
|
+
fontFace: string;
|
|
33
|
+
align: "right" | "left" | "center";
|
|
34
|
+
valign: "top";
|
|
35
|
+
margin: number;
|
|
36
|
+
lineSpacingMultiple: number;
|
|
37
|
+
color: string;
|
|
38
|
+
bold: boolean;
|
|
18
39
|
};
|
|
19
40
|
export {};
|
|
20
41
|
//# sourceMappingURL=textOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textOptions.d.ts","sourceRoot":"","sources":["../../src/renderPptx/textOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"textOptions.d.ts","sourceRoot":"","sources":["../../src/renderPptx/textOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9D,KAAK,QAAQ,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE1D,KAAK,iBAAiB,GAAG;IACvB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,GAAG,aAAa,GAC9B,iBAAiB,GAAG,OAAO,CAqB7B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4B/C"}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import { pxToIn, pxToPt } from "./units";
|
|
2
|
+
export function createBulletOptions(bullet) {
|
|
3
|
+
if (typeof bullet === "boolean") {
|
|
4
|
+
return bullet;
|
|
5
|
+
}
|
|
6
|
+
const options = {};
|
|
7
|
+
if (bullet.type !== undefined) {
|
|
8
|
+
options.type = bullet.type;
|
|
9
|
+
}
|
|
10
|
+
if (bullet.indent !== undefined) {
|
|
11
|
+
options.indent = bullet.indent;
|
|
12
|
+
}
|
|
13
|
+
if (bullet.numberType !== undefined) {
|
|
14
|
+
options.numberType = bullet.numberType;
|
|
15
|
+
}
|
|
16
|
+
if (bullet.numberStartAt !== undefined) {
|
|
17
|
+
options.numberStartAt = bullet.numberStartAt;
|
|
18
|
+
}
|
|
19
|
+
return options;
|
|
20
|
+
}
|
|
2
21
|
export function createTextOptions(node) {
|
|
3
22
|
const fontSizePx = node.fontPx ?? 24;
|
|
4
23
|
const fontFamily = node.fontFamily ?? "Noto Sans JP";
|
|
5
24
|
const lineSpacingMultiple = node.lineSpacingMultiple ?? 1.3;
|
|
6
|
-
|
|
25
|
+
const baseOptions = {
|
|
7
26
|
x: pxToIn(node.x),
|
|
8
27
|
y: pxToIn(node.y),
|
|
9
28
|
w: pxToIn(node.w),
|
|
@@ -17,4 +36,11 @@ export function createTextOptions(node) {
|
|
|
17
36
|
color: node.color,
|
|
18
37
|
bold: node.bold,
|
|
19
38
|
};
|
|
39
|
+
if (node.bullet !== undefined) {
|
|
40
|
+
return {
|
|
41
|
+
...baseOptions,
|
|
42
|
+
bullet: createBulletOptions(node.bullet),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return baseOptions;
|
|
20
46
|
}
|
package/dist/table/utils.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import type { TableNode } from "../types";
|
|
2
2
|
export declare const DEFAULT_TABLE_ROW_HEIGHT = 32;
|
|
3
|
+
export declare const DEFAULT_TABLE_COLUMN_WIDTH = 100;
|
|
3
4
|
export declare function calcTableIntrinsicSize(node: TableNode): {
|
|
4
5
|
width: number;
|
|
5
6
|
height: number;
|
|
6
7
|
};
|
|
7
8
|
export declare function resolveRowHeights(node: TableNode): number[];
|
|
9
|
+
/**
|
|
10
|
+
* テーブルの各カラム幅を解決する
|
|
11
|
+
* - 幅が指定されているカラムはその値を使用
|
|
12
|
+
* - 幅が未指定のカラムは、残りの幅を均等分割
|
|
13
|
+
*
|
|
14
|
+
* @param node テーブルノード
|
|
15
|
+
* @param tableWidth テーブル全体の幅(レイアウト計算後の確定値)
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveColumnWidths(node: TableNode, tableWidth: number): number[];
|
|
8
18
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/table/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,wBAAwB,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/table/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS;;;EAQrD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,YAGhD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,MAAM,GACjB,MAAM,EAAE,CAeV"}
|
package/dist/table/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const DEFAULT_TABLE_ROW_HEIGHT = 32;
|
|
2
|
+
export const DEFAULT_TABLE_COLUMN_WIDTH = 100;
|
|
2
3
|
export function calcTableIntrinsicSize(node) {
|
|
3
|
-
const width = node.columns.reduce((sum, column) => sum + column.width, 0);
|
|
4
|
+
const width = node.columns.reduce((sum, column) => sum + (column.width ?? DEFAULT_TABLE_COLUMN_WIDTH), 0);
|
|
4
5
|
const height = resolveRowHeights(node).reduce((sum, h) => sum + h, 0);
|
|
5
6
|
return { width, height };
|
|
6
7
|
}
|
|
@@ -8,3 +9,19 @@ export function resolveRowHeights(node) {
|
|
|
8
9
|
const fallbackRowHeight = node.defaultRowHeight ?? DEFAULT_TABLE_ROW_HEIGHT;
|
|
9
10
|
return node.rows.map((row) => row.height ?? fallbackRowHeight);
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* テーブルの各カラム幅を解決する
|
|
14
|
+
* - 幅が指定されているカラムはその値を使用
|
|
15
|
+
* - 幅が未指定のカラムは、残りの幅を均等分割
|
|
16
|
+
*
|
|
17
|
+
* @param node テーブルノード
|
|
18
|
+
* @param tableWidth テーブル全体の幅(レイアウト計算後の確定値)
|
|
19
|
+
*/
|
|
20
|
+
export function resolveColumnWidths(node, tableWidth) {
|
|
21
|
+
const specifiedTotal = node.columns.reduce((sum, col) => sum + (col.width ?? 0), 0);
|
|
22
|
+
const unspecifiedCount = node.columns.filter((col) => col.width === undefined).length;
|
|
23
|
+
// 未指定カラムがない場合、または未指定カラムに割り当てる幅を計算
|
|
24
|
+
const remainingWidth = Math.max(0, tableWidth - specifiedTotal);
|
|
25
|
+
const widthPerUnspecified = unspecifiedCount > 0 ? remainingWidth / unspecifiedCount : 0;
|
|
26
|
+
return node.columns.map((col) => col.width ?? widthPerUnspecified);
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toPositioned.d.ts","sourceRoot":"","sources":["../../src/toPositioned/toPositioned.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,OAAO,EACZ,OAAO,SAAI,EACX,OAAO,SAAI,GACV,cAAc,
|
|
1
|
+
{"version":3,"file":"toPositioned.d.ts","sourceRoot":"","sources":["../../src/toPositioned/toPositioned.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,OAAO,EACZ,OAAO,SAAI,EACX,OAAO,SAAI,GACV,cAAc,CA0FhB"}
|
|
@@ -49,6 +49,15 @@ export function toPositioned(pom, parentX = 0, parentY = 0) {
|
|
|
49
49
|
h: layout.height,
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
case "chart": {
|
|
53
|
+
return {
|
|
54
|
+
...pom,
|
|
55
|
+
x: absoluteX,
|
|
56
|
+
y: absoluteY,
|
|
57
|
+
w: layout.width,
|
|
58
|
+
h: layout.height,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
52
61
|
case "box": {
|
|
53
62
|
return {
|
|
54
63
|
...pom,
|
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
|