@hirokisakabe/pom 5.4.0 → 5.5.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.
Files changed (81) hide show
  1. package/README.md +6 -5
  2. package/dist/autoFit/autoFit.d.ts +2 -1
  3. package/dist/autoFit/autoFit.d.ts.map +1 -1
  4. package/dist/autoFit/autoFit.js +33 -17
  5. package/dist/buildContext.d.ts +2 -0
  6. package/dist/buildContext.d.ts.map +1 -1
  7. package/dist/buildContext.js +2 -0
  8. package/dist/buildPptx.d.ts +7 -1
  9. package/dist/buildPptx.d.ts.map +1 -1
  10. package/dist/buildPptx.js +14 -5
  11. package/dist/calcYogaLayout/calcYogaLayout.d.ts +4 -2
  12. package/dist/calcYogaLayout/calcYogaLayout.d.ts.map +1 -1
  13. package/dist/calcYogaLayout/calcYogaLayout.js +29 -15
  14. package/dist/calcYogaLayout/types.d.ts +16 -0
  15. package/dist/calcYogaLayout/types.d.ts.map +1 -0
  16. package/dist/calcYogaLayout/types.js +14 -0
  17. package/dist/diagnostics.d.ts +14 -0
  18. package/dist/diagnostics.d.ts.map +1 -0
  19. package/dist/diagnostics.js +17 -0
  20. package/dist/index.d.ts +3 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +1 -0
  23. package/dist/parseXml/parseXml.d.ts +1 -1
  24. package/dist/parseXml/parseXml.d.ts.map +1 -1
  25. package/dist/parseXml/parseXml.js +16 -16
  26. package/dist/registry/definitions/icon.d.ts.map +1 -1
  27. package/dist/registry/definitions/icon.js +26 -14
  28. package/dist/registry/definitions/image.d.ts.map +1 -1
  29. package/dist/registry/definitions/image.js +2 -3
  30. package/dist/registry/definitions/layer.d.ts.map +1 -1
  31. package/dist/registry/definitions/layer.js +9 -6
  32. package/dist/registry/definitions/line.d.ts.map +1 -1
  33. package/dist/registry/definitions/line.js +1 -2
  34. package/dist/registry/types.d.ts +2 -1
  35. package/dist/registry/types.d.ts.map +1 -1
  36. package/dist/renderPptx/nodes/chart.d.ts.map +1 -1
  37. package/dist/renderPptx/nodes/chart.js +6 -4
  38. package/dist/renderPptx/nodes/flow.d.ts.map +1 -1
  39. package/dist/renderPptx/nodes/flow.js +14 -4
  40. package/dist/renderPptx/nodes/image.d.ts.map +1 -1
  41. package/dist/renderPptx/nodes/image.js +8 -6
  42. package/dist/renderPptx/nodes/list.d.ts.map +1 -1
  43. package/dist/renderPptx/nodes/list.js +19 -16
  44. package/dist/renderPptx/nodes/matrix.d.ts.map +1 -1
  45. package/dist/renderPptx/nodes/matrix.js +11 -9
  46. package/dist/renderPptx/nodes/processArrow.d.ts.map +1 -1
  47. package/dist/renderPptx/nodes/processArrow.js +14 -4
  48. package/dist/renderPptx/nodes/pyramid.d.ts.map +1 -1
  49. package/dist/renderPptx/nodes/pyramid.js +6 -4
  50. package/dist/renderPptx/nodes/shape.d.ts.map +1 -1
  51. package/dist/renderPptx/nodes/shape.js +6 -4
  52. package/dist/renderPptx/nodes/table.d.ts.map +1 -1
  53. package/dist/renderPptx/nodes/table.js +7 -5
  54. package/dist/renderPptx/nodes/timeline.d.ts.map +1 -1
  55. package/dist/renderPptx/nodes/timeline.js +14 -4
  56. package/dist/renderPptx/nodes/tree.d.ts.map +1 -1
  57. package/dist/renderPptx/nodes/tree.js +6 -4
  58. package/dist/renderPptx/textOptions.d.ts.map +1 -1
  59. package/dist/renderPptx/textOptions.js +6 -4
  60. package/dist/renderPptx/utils/contentArea.d.ts +26 -0
  61. package/dist/renderPptx/utils/contentArea.d.ts.map +1 -0
  62. package/dist/renderPptx/utils/contentArea.js +26 -0
  63. package/dist/renderPptx/utils/scaleToFit.d.ts +3 -2
  64. package/dist/renderPptx/utils/scaleToFit.d.ts.map +1 -1
  65. package/dist/renderPptx/utils/scaleToFit.js +3 -3
  66. package/dist/shared/freeYogaTree.d.ts +3 -3
  67. package/dist/shared/freeYogaTree.d.ts.map +1 -1
  68. package/dist/shared/freeYogaTree.js +16 -21
  69. package/dist/shared/measureImage.d.ts +3 -2
  70. package/dist/shared/measureImage.d.ts.map +1 -1
  71. package/dist/shared/measureImage.js +5 -5
  72. package/dist/toPositioned/toPositioned.d.ts +3 -6
  73. package/dist/toPositioned/toPositioned.d.ts.map +1 -1
  74. package/dist/toPositioned/toPositioned.js +11 -19
  75. package/dist/types.d.ts +12 -445
  76. package/dist/types.d.ts.map +1 -1
  77. package/dist/types.js +43 -50
  78. package/package.json +5 -2
  79. package/dist/parseXml/inputSchema.d.ts +0 -1622
  80. package/dist/parseXml/inputSchema.d.ts.map +0 -1
  81. package/dist/parseXml/inputSchema.js +0 -257
@@ -1 +0,0 @@
1
- {"version":3,"file":"inputSchema.d.ts","sourceRoot":"","sources":["../../src/parseXml/inputSchema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAuCL,KAAK,YAAY,EAQlB,MAAM,aAAa,CAAC;AA6BrB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa9B,CAAC;AAIH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe5B,CAAC;AAUH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;iBAU9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS9B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAatC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMjC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW9B,CAAC"}
@@ -1,257 +0,0 @@
1
- /**
2
- * Input schemas for LLM/external input validation (internal module)
3
- *
4
- * These schemas do not include internal properties like `yogaNode`.
5
- * Used by `parseXml` to validate parsed XML input.
6
- */
7
- import { z } from "zod";
8
- import { lengthSchema, paddingSchema, borderStyleSchema, borderDashSchema, fillStyleSchema, shadowStyleSchema, alignItemsSchema, justifyContentSchema, shapeTypeSchema, tableColumnSchema, tableRowSchema, chartTypeSchema, chartDataSchema, liNodeSchema, radarStyleSchema, bulletNumberTypeSchema, timelineDirectionSchema, timelineItemSchema, matrixAxisSchema, matrixQuadrantsSchema, matrixItemSchema, treeLayoutSchema, treeNodeShapeSchema, treeConnectorStyleSchema, flowDirectionSchema, flowNodeItemSchema, flowConnectionSchema, flowConnectorStyleSchema, processArrowDirectionSchema, processArrowStepSchema, pyramidDirectionSchema, pyramidLevelSchema, lineArrowSchema, underlineSchema, backgroundImageSchema, iconNameSchema, iconColorSchema, iconVariantSchema, alignSelfSchema, positionTypeSchema, flexWrapSchema, } from "../types.js";
9
- // ===== Base Node Schema =====
10
- const inputBaseNodeSchema = z.object({
11
- w: lengthSchema.optional(),
12
- h: lengthSchema.optional(),
13
- minW: z.number().optional(),
14
- maxW: z.number().optional(),
15
- minH: z.number().optional(),
16
- maxH: z.number().optional(),
17
- padding: paddingSchema.optional(),
18
- margin: paddingSchema.optional(),
19
- backgroundColor: z.string().optional(),
20
- backgroundImage: backgroundImageSchema.optional(),
21
- border: borderStyleSchema.optional(),
22
- borderRadius: z.number().optional(),
23
- opacity: z.number().min(0).max(1).optional(),
24
- zIndex: z.number().optional(),
25
- position: positionTypeSchema.optional(),
26
- top: z.number().optional(),
27
- right: z.number().optional(),
28
- bottom: z.number().optional(),
29
- left: z.number().optional(),
30
- alignSelf: alignSelfSchema.optional(),
31
- });
32
- // ===== Node Schemas =====
33
- export const inputTextNodeSchema = inputBaseNodeSchema.extend({
34
- type: z.literal("text"),
35
- text: z.string(),
36
- fontSize: z.number().optional(),
37
- color: z.string().optional(),
38
- textAlign: z.enum(["left", "center", "right"]).optional(),
39
- bold: z.boolean().optional(),
40
- italic: z.boolean().optional(),
41
- underline: underlineSchema.optional(),
42
- strike: z.boolean().optional(),
43
- highlight: z.string().optional(),
44
- fontFamily: z.string().optional(),
45
- lineHeight: z.number().optional(),
46
- });
47
- const inputLiNodeSchema = liNodeSchema;
48
- export const inputUlNodeSchema = inputBaseNodeSchema.extend({
49
- type: z.literal("ul"),
50
- items: z.array(inputLiNodeSchema),
51
- fontSize: z.number().optional(),
52
- color: z.string().optional(),
53
- textAlign: z.enum(["left", "center", "right"]).optional(),
54
- bold: z.boolean().optional(),
55
- italic: z.boolean().optional(),
56
- underline: underlineSchema.optional(),
57
- strike: z.boolean().optional(),
58
- highlight: z.string().optional(),
59
- fontFamily: z.string().optional(),
60
- lineHeight: z.number().optional(),
61
- });
62
- export const inputOlNodeSchema = inputBaseNodeSchema.extend({
63
- type: z.literal("ol"),
64
- items: z.array(inputLiNodeSchema),
65
- fontSize: z.number().optional(),
66
- color: z.string().optional(),
67
- textAlign: z.enum(["left", "center", "right"]).optional(),
68
- bold: z.boolean().optional(),
69
- italic: z.boolean().optional(),
70
- underline: underlineSchema.optional(),
71
- strike: z.boolean().optional(),
72
- highlight: z.string().optional(),
73
- fontFamily: z.string().optional(),
74
- lineHeight: z.number().optional(),
75
- numberType: bulletNumberTypeSchema.optional(),
76
- numberStartAt: z.number().optional(),
77
- });
78
- const inputImageSizingSchema = z.object({
79
- type: z.enum(["contain", "cover", "crop"]),
80
- w: z.number().optional(),
81
- h: z.number().optional(),
82
- x: z.number().optional(),
83
- y: z.number().optional(),
84
- });
85
- export const inputImageNodeSchema = inputBaseNodeSchema.extend({
86
- type: z.literal("image"),
87
- src: z.string(),
88
- sizing: inputImageSizingSchema.optional(),
89
- shadow: shadowStyleSchema.optional(),
90
- });
91
- export const inputIconNodeSchema = inputBaseNodeSchema.extend({
92
- type: z.literal("icon"),
93
- name: iconNameSchema,
94
- size: z.number().positive().max(1024).optional(),
95
- color: iconColorSchema,
96
- variant: iconVariantSchema,
97
- bgColor: iconColorSchema,
98
- });
99
- export const inputTableNodeSchema = inputBaseNodeSchema.extend({
100
- type: z.literal("table"),
101
- columns: z.array(tableColumnSchema),
102
- rows: z.array(tableRowSchema),
103
- defaultRowHeight: z.number().optional(),
104
- });
105
- export const inputShapeNodeSchema = inputBaseNodeSchema.extend({
106
- type: z.literal("shape"),
107
- shapeType: shapeTypeSchema,
108
- text: z.string().optional(),
109
- fill: fillStyleSchema.optional(),
110
- line: borderStyleSchema.optional(),
111
- shadow: shadowStyleSchema.optional(),
112
- fontSize: z.number().optional(),
113
- color: z.string().optional(),
114
- textAlign: z.enum(["left", "center", "right"]).optional(),
115
- bold: z.boolean().optional(),
116
- italic: z.boolean().optional(),
117
- underline: underlineSchema.optional(),
118
- strike: z.boolean().optional(),
119
- highlight: z.string().optional(),
120
- fontFamily: z.string().optional(),
121
- lineHeight: z.number().optional(),
122
- });
123
- export const inputChartNodeSchema = inputBaseNodeSchema.extend({
124
- type: z.literal("chart"),
125
- chartType: chartTypeSchema,
126
- data: z.array(chartDataSchema),
127
- showLegend: z.boolean().optional(),
128
- showTitle: z.boolean().optional(),
129
- title: z.string().optional(),
130
- chartColors: z.array(z.string()).optional(),
131
- // radar専用オプション
132
- radarStyle: radarStyleSchema.optional(),
133
- });
134
- export const inputTimelineNodeSchema = inputBaseNodeSchema.extend({
135
- type: z.literal("timeline"),
136
- direction: timelineDirectionSchema.optional(),
137
- items: z.array(timelineItemSchema),
138
- });
139
- export const inputMatrixNodeSchema = inputBaseNodeSchema.extend({
140
- type: z.literal("matrix"),
141
- axes: matrixAxisSchema,
142
- quadrants: matrixQuadrantsSchema.optional(),
143
- items: z.array(matrixItemSchema),
144
- });
145
- const inputTreeDataItemSchema = z.lazy(() => z.object({
146
- label: z.string(),
147
- color: z.string().optional(),
148
- children: z.array(inputTreeDataItemSchema).optional(),
149
- }));
150
- export const inputTreeNodeSchema = inputBaseNodeSchema.extend({
151
- type: z.literal("tree"),
152
- layout: treeLayoutSchema.optional(),
153
- nodeShape: treeNodeShapeSchema.optional(),
154
- data: inputTreeDataItemSchema,
155
- connectorStyle: treeConnectorStyleSchema.optional(),
156
- nodeWidth: z.number().optional(),
157
- nodeHeight: z.number().optional(),
158
- levelGap: z.number().optional(),
159
- siblingGap: z.number().optional(),
160
- });
161
- export const inputFlowNodeSchema = inputBaseNodeSchema.extend({
162
- type: z.literal("flow"),
163
- direction: flowDirectionSchema.optional(),
164
- nodes: z.array(flowNodeItemSchema),
165
- connections: z.array(flowConnectionSchema),
166
- connectorStyle: flowConnectorStyleSchema.optional(),
167
- nodeWidth: z.number().optional(),
168
- nodeHeight: z.number().optional(),
169
- nodeGap: z.number().optional(),
170
- });
171
- export const inputProcessArrowNodeSchema = inputBaseNodeSchema.extend({
172
- type: z.literal("processArrow"),
173
- direction: processArrowDirectionSchema.optional(),
174
- steps: z.array(processArrowStepSchema),
175
- itemWidth: z.number().optional(),
176
- itemHeight: z.number().optional(),
177
- gap: z.number().optional(),
178
- fontSize: z.number().optional(),
179
- bold: z.boolean().optional(),
180
- italic: z.boolean().optional(),
181
- underline: underlineSchema.optional(),
182
- strike: z.boolean().optional(),
183
- highlight: z.string().optional(),
184
- });
185
- export const inputPyramidNodeSchema = inputBaseNodeSchema.extend({
186
- type: z.literal("pyramid"),
187
- direction: pyramidDirectionSchema.optional(),
188
- levels: z.array(pyramidLevelSchema).min(1),
189
- fontSize: z.number().optional(),
190
- bold: z.boolean().optional(),
191
- });
192
- export const inputLineNodeSchema = inputBaseNodeSchema.extend({
193
- type: z.literal("line"),
194
- x1: z.number(),
195
- y1: z.number(),
196
- x2: z.number(),
197
- y2: z.number(),
198
- color: z.string().optional(),
199
- lineWidth: z.number().optional(),
200
- dashType: borderDashSchema.optional(),
201
- beginArrow: lineArrowSchema.optional(),
202
- endArrow: lineArrowSchema.optional(),
203
- });
204
- // ===== Recursive Node Schemas =====
205
- const inputBoxNodeSchemaBase = inputBaseNodeSchema.extend({
206
- type: z.literal("box"),
207
- children: z.lazy(() => inputPomNodeSchema),
208
- shadow: shadowStyleSchema.optional(),
209
- });
210
- const inputVStackNodeSchemaBase = inputBaseNodeSchema.extend({
211
- type: z.literal("vstack"),
212
- children: z.array(z.lazy(() => inputPomNodeSchema)),
213
- gap: z.number().optional(),
214
- alignItems: alignItemsSchema.optional(),
215
- justifyContent: justifyContentSchema.optional(),
216
- shadow: shadowStyleSchema.optional(),
217
- flexWrap: flexWrapSchema.optional(),
218
- });
219
- const inputHStackNodeSchemaBase = inputBaseNodeSchema.extend({
220
- type: z.literal("hstack"),
221
- children: z.array(z.lazy(() => inputPomNodeSchema)),
222
- gap: z.number().optional(),
223
- alignItems: alignItemsSchema.optional(),
224
- justifyContent: justifyContentSchema.optional(),
225
- shadow: shadowStyleSchema.optional(),
226
- flexWrap: flexWrapSchema.optional(),
227
- });
228
- const inputLayerChildSchemaBase = z.lazy(() => inputPomNodeSchema.and(z.object({
229
- x: z.number(),
230
- y: z.number(),
231
- })));
232
- const inputLayerNodeSchemaBase = inputBaseNodeSchema.extend({
233
- type: z.literal("layer"),
234
- children: z.array(inputLayerChildSchemaBase),
235
- });
236
- /** Input schema for POM nodes (used internally by parseXml) */
237
- const inputPomNodeSchema = z.lazy(() => z.discriminatedUnion("type", [
238
- inputTextNodeSchema,
239
- inputUlNodeSchema,
240
- inputOlNodeSchema,
241
- inputImageNodeSchema,
242
- inputTableNodeSchema,
243
- inputBoxNodeSchemaBase,
244
- inputVStackNodeSchemaBase,
245
- inputHStackNodeSchemaBase,
246
- inputShapeNodeSchema,
247
- inputChartNodeSchema,
248
- inputTimelineNodeSchema,
249
- inputMatrixNodeSchema,
250
- inputTreeNodeSchema,
251
- inputFlowNodeSchema,
252
- inputProcessArrowNodeSchema,
253
- inputPyramidNodeSchema,
254
- inputLineNodeSchema,
255
- inputLayerNodeSchemaBase,
256
- inputIconNodeSchema,
257
- ]));