@hirokisakabe/pom 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/inputSchema.d.ts +6 -0
- package/dist/inputSchema.d.ts.map +1 -1
- package/dist/inputSchema.js +1 -0
- package/dist/parsePptx/convertChart.d.ts +8 -0
- package/dist/parsePptx/convertChart.d.ts.map +1 -0
- package/dist/parsePptx/convertChart.js +78 -0
- package/dist/parsePptx/convertImage.d.ts +8 -0
- package/dist/parsePptx/convertImage.d.ts.map +1 -0
- package/dist/parsePptx/convertImage.js +13 -0
- package/dist/parsePptx/convertShape.d.ts +7 -0
- package/dist/parsePptx/convertShape.d.ts.map +1 -0
- package/dist/parsePptx/convertShape.js +137 -0
- package/dist/parsePptx/convertTable.d.ts +7 -0
- package/dist/parsePptx/convertTable.d.ts.map +1 -0
- package/dist/parsePptx/convertTable.js +46 -0
- package/dist/parsePptx/convertText.d.ts +7 -0
- package/dist/parsePptx/convertText.d.ts.map +1 -0
- package/dist/parsePptx/convertText.js +32 -0
- package/dist/parsePptx/index.d.ts +23 -0
- package/dist/parsePptx/index.d.ts.map +1 -0
- package/dist/parsePptx/index.js +114 -0
- package/dist/parsePptx/parseHtml.d.ts +22 -0
- package/dist/parsePptx/parseHtml.d.ts.map +1 -0
- package/dist/parsePptx/parseHtml.js +53 -0
- package/dist/parsePptx/types.d.ts +15 -0
- package/dist/parsePptx/types.d.ts.map +1 -0
- package/dist/parsePptx/types.js +1 -0
- package/dist/parsePptx/units.d.ts +13 -0
- package/dist/parsePptx/units.d.ts.map +1 -0
- package/dist/parsePptx/units.js +19 -0
- package/dist/renderPptx/renderPptx.d.ts.map +1 -1
- package/dist/renderPptx/renderPptx.js +11 -2
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,11 +91,13 @@ Layout attributes that all nodes can have.
|
|
|
91
91
|
width?: number;
|
|
92
92
|
dashType?: "solid" | "dash" | "dashDot" | "lgDash" | "lgDashDot" | "lgDashDotDot" | "sysDash" | "sysDot";
|
|
93
93
|
};
|
|
94
|
+
borderRadius?: number;
|
|
94
95
|
}
|
|
95
96
|
```
|
|
96
97
|
|
|
97
98
|
- `backgroundColor` applies a fill to the entire node (e.g., `"F8F9FA"`).
|
|
98
99
|
- `border.width` is specified in px and can be combined with color and `dashType` to control the border.
|
|
100
|
+
- `borderRadius` specifies the corner radius in px. When specified, the background/border shape becomes a rounded rectangle.
|
|
99
101
|
|
|
100
102
|
### Node List
|
|
101
103
|
|
package/dist/inputSchema.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export declare const inputBaseNodeSchema: z.ZodObject<{
|
|
|
46
46
|
sysDot: "sysDot";
|
|
47
47
|
}>>;
|
|
48
48
|
}, z.core.$strip>>;
|
|
49
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
49
50
|
}, z.core.$strip>;
|
|
50
51
|
type InputBaseNode = z.infer<typeof inputBaseNodeSchema>;
|
|
51
52
|
export declare const inputTextNodeSchema: z.ZodObject<{
|
|
@@ -76,6 +77,7 @@ export declare const inputTextNodeSchema: z.ZodObject<{
|
|
|
76
77
|
sysDot: "sysDot";
|
|
77
78
|
}>>;
|
|
78
79
|
}, z.core.$strip>>;
|
|
80
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
79
81
|
type: z.ZodLiteral<"text">;
|
|
80
82
|
text: z.ZodString;
|
|
81
83
|
fontPx: z.ZodOptional<z.ZodNumber>;
|
|
@@ -143,6 +145,7 @@ export declare const inputImageNodeSchema: z.ZodObject<{
|
|
|
143
145
|
sysDot: "sysDot";
|
|
144
146
|
}>>;
|
|
145
147
|
}, z.core.$strip>>;
|
|
148
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
146
149
|
type: z.ZodLiteral<"image">;
|
|
147
150
|
src: z.ZodString;
|
|
148
151
|
}, z.core.$strip>;
|
|
@@ -174,6 +177,7 @@ export declare const inputTableNodeSchema: z.ZodObject<{
|
|
|
174
177
|
sysDot: "sysDot";
|
|
175
178
|
}>>;
|
|
176
179
|
}, z.core.$strip>>;
|
|
180
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
177
181
|
type: z.ZodLiteral<"table">;
|
|
178
182
|
columns: z.ZodArray<z.ZodObject<{
|
|
179
183
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -223,6 +227,7 @@ export declare const inputShapeNodeSchema: z.ZodObject<{
|
|
|
223
227
|
sysDot: "sysDot";
|
|
224
228
|
}>>;
|
|
225
229
|
}, z.core.$strip>>;
|
|
230
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
226
231
|
type: z.ZodLiteral<"shape">;
|
|
227
232
|
shapeType: z.ZodEnum<{
|
|
228
233
|
accentBorderCallout1: "accentBorderCallout1";
|
|
@@ -470,6 +475,7 @@ export declare const inputChartNodeSchema: z.ZodObject<{
|
|
|
470
475
|
sysDot: "sysDot";
|
|
471
476
|
}>>;
|
|
472
477
|
}, z.core.$strip>>;
|
|
478
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
473
479
|
type: z.ZodLiteral<"chart">;
|
|
474
480
|
chartType: z.ZodEnum<{
|
|
475
481
|
line: "line";
|
|
@@ -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,EAgBL,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"inputSchema.d.ts","sourceRoot":"","sources":["../src/inputSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,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;;;;;;;;;;;iBAaxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC"}
|
package/dist/inputSchema.js
CHANGED
|
@@ -29,6 +29,7 @@ export const inputBaseNodeSchema = z.object({
|
|
|
29
29
|
padding: paddingSchema.optional(),
|
|
30
30
|
backgroundColor: z.string().optional(),
|
|
31
31
|
border: borderStyleSchema.optional(),
|
|
32
|
+
borderRadius: z.number().optional(),
|
|
32
33
|
});
|
|
33
34
|
// ===== Node Schemas =====
|
|
34
35
|
export const inputTextNodeSchema = inputBaseNodeSchema.extend({
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChartNode } from "../types";
|
|
2
|
+
import type { Chart } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* pptxtojsonのChart要素をPOMのChartNodeに変換
|
|
5
|
+
* scatter/bubbleチャートはサポートされていないためnullを返す
|
|
6
|
+
*/
|
|
7
|
+
export declare function convertChart(element: Chart): ChartNode | null;
|
|
8
|
+
//# sourceMappingURL=convertChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertChart.d.ts","sourceRoot":"","sources":["../../src/parsePptx/convertChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAwB,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAA2C,MAAM,SAAS,CAAC;AA2C9E;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,CA4C7D"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ptToPx, normalizeColor } from "./units";
|
|
2
|
+
/**
|
|
3
|
+
* pptxtojsonのchartType から POMのChartType へのマッピング
|
|
4
|
+
* 3Dチャートは2D相当として扱う
|
|
5
|
+
*/
|
|
6
|
+
const CHART_TYPE_MAP = {
|
|
7
|
+
barChart: "bar",
|
|
8
|
+
bar3DChart: "bar",
|
|
9
|
+
lineChart: "line",
|
|
10
|
+
line3DChart: "line",
|
|
11
|
+
pieChart: "pie",
|
|
12
|
+
pie3DChart: "pie",
|
|
13
|
+
areaChart: "area",
|
|
14
|
+
area3DChart: "area",
|
|
15
|
+
doughnutChart: "doughnut",
|
|
16
|
+
radarChart: "radar",
|
|
17
|
+
// サポートされていないチャートタイプ
|
|
18
|
+
scatterChart: null,
|
|
19
|
+
bubbleChart: null,
|
|
20
|
+
surfaceChart: null,
|
|
21
|
+
surface3DChart: null,
|
|
22
|
+
stockChart: null,
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* pptxtojsonのchartTypeをPOMのChartTypeに変換
|
|
26
|
+
* サポートされていない場合はnullを返す
|
|
27
|
+
*/
|
|
28
|
+
function mapChartType(chartType) {
|
|
29
|
+
return CHART_TYPE_MAP[chartType];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* CommonChartかどうかをチェック
|
|
33
|
+
*/
|
|
34
|
+
function isCommonChart(chart) {
|
|
35
|
+
return (chart.chartType !== "scatterChart" && chart.chartType !== "bubbleChart");
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* pptxtojsonのChart要素をPOMのChartNodeに変換
|
|
39
|
+
* scatter/bubbleチャートはサポートされていないためnullを返す
|
|
40
|
+
*/
|
|
41
|
+
export function convertChart(element) {
|
|
42
|
+
// scatter/bubbleチャートはサポートされていない
|
|
43
|
+
if (!isCommonChart(element)) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const pomChartType = mapChartType(element.chartType);
|
|
47
|
+
if (pomChartType === null) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
// データの変換
|
|
51
|
+
// pptxtojson: { key: string, values: { x: string, y: number }[], xlabels: { [key]: string } }
|
|
52
|
+
// pom: { name?: string, labels: string[], values: number[] }
|
|
53
|
+
const data = element.data.map((item) => {
|
|
54
|
+
const labels = item.values.map((v) => v.x);
|
|
55
|
+
const values = item.values.map((v) => v.y);
|
|
56
|
+
return {
|
|
57
|
+
name: item.key || undefined,
|
|
58
|
+
labels,
|
|
59
|
+
values,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
const result = {
|
|
63
|
+
type: "chart",
|
|
64
|
+
chartType: pomChartType,
|
|
65
|
+
data,
|
|
66
|
+
w: ptToPx(element.width),
|
|
67
|
+
h: ptToPx(element.height),
|
|
68
|
+
};
|
|
69
|
+
// チャートの色
|
|
70
|
+
if (element.colors && element.colors.length > 0) {
|
|
71
|
+
result.chartColors = element.colors.map(normalizeColor);
|
|
72
|
+
}
|
|
73
|
+
// radarチャートのスタイル
|
|
74
|
+
if (pomChartType === "radar") {
|
|
75
|
+
result.radarStyle = "standard";
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ImageNode } from "../types";
|
|
2
|
+
import type { Image } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* pptxtojsonのImage要素をPOMのImageNodeに変換
|
|
5
|
+
* pptxtojsonは画像をBase64形式で提供する
|
|
6
|
+
*/
|
|
7
|
+
export declare function convertImage(element: Image): ImageNode;
|
|
8
|
+
//# sourceMappingURL=convertImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertImage.d.ts","sourceRoot":"","sources":["../../src/parsePptx/convertImage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS,CAOtD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ptToPx } from "./units";
|
|
2
|
+
/**
|
|
3
|
+
* pptxtojsonのImage要素をPOMのImageNodeに変換
|
|
4
|
+
* pptxtojsonは画像をBase64形式で提供する
|
|
5
|
+
*/
|
|
6
|
+
export function convertImage(element) {
|
|
7
|
+
return {
|
|
8
|
+
type: "image",
|
|
9
|
+
src: element.src,
|
|
10
|
+
w: ptToPx(element.width),
|
|
11
|
+
h: ptToPx(element.height),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertShape.d.ts","sourceRoot":"","sources":["../../src/parsePptx/convertShape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAsFrC;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS,CA2DtD"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { ptToPx, normalizeColor } from "./units";
|
|
2
|
+
import { extractPlainText, extractStyles } from "./parseHtml";
|
|
3
|
+
/**
|
|
4
|
+
* pptxtojsonのshapType から POMのShapeType へのマッピング
|
|
5
|
+
* pptxtojsonのshapTypeはOpenXMLの図形名に近い形式
|
|
6
|
+
*/
|
|
7
|
+
const SHAPE_TYPE_MAP = {
|
|
8
|
+
rect: "rect",
|
|
9
|
+
rectangle: "rect",
|
|
10
|
+
roundRect: "roundRect",
|
|
11
|
+
roundRectangle: "roundRect",
|
|
12
|
+
ellipse: "ellipse",
|
|
13
|
+
oval: "ellipse",
|
|
14
|
+
triangle: "triangle",
|
|
15
|
+
rtTriangle: "rtTriangle",
|
|
16
|
+
parallelogram: "parallelogram",
|
|
17
|
+
trapezoid: "trapezoid",
|
|
18
|
+
diamond: "diamond",
|
|
19
|
+
pentagon: "pentagon",
|
|
20
|
+
hexagon: "hexagon",
|
|
21
|
+
heptagon: "heptagon",
|
|
22
|
+
octagon: "octagon",
|
|
23
|
+
decagon: "decagon",
|
|
24
|
+
dodecagon: "dodecagon",
|
|
25
|
+
star4: "star4",
|
|
26
|
+
star5: "star5",
|
|
27
|
+
star6: "star6",
|
|
28
|
+
star7: "star7",
|
|
29
|
+
star8: "star8",
|
|
30
|
+
star10: "star10",
|
|
31
|
+
star12: "star12",
|
|
32
|
+
star16: "star16",
|
|
33
|
+
star24: "star24",
|
|
34
|
+
star32: "star32",
|
|
35
|
+
plus: "plus",
|
|
36
|
+
cross: "plus",
|
|
37
|
+
arrow: "rightArrow",
|
|
38
|
+
rightArrow: "rightArrow",
|
|
39
|
+
leftArrow: "leftArrow",
|
|
40
|
+
upArrow: "upArrow",
|
|
41
|
+
downArrow: "downArrow",
|
|
42
|
+
leftRightArrow: "leftRightArrow",
|
|
43
|
+
upDownArrow: "upDownArrow",
|
|
44
|
+
cloud: "cloud",
|
|
45
|
+
cloudCallout: "cloudCallout",
|
|
46
|
+
heart: "heart",
|
|
47
|
+
lightningBolt: "lightningBolt",
|
|
48
|
+
sun: "sun",
|
|
49
|
+
moon: "moon",
|
|
50
|
+
arc: "arc",
|
|
51
|
+
donut: "donut",
|
|
52
|
+
line: "line",
|
|
53
|
+
chevron: "chevron",
|
|
54
|
+
homePlate: "homePlate",
|
|
55
|
+
can: "can",
|
|
56
|
+
cube: "cube",
|
|
57
|
+
bevel: "bevel",
|
|
58
|
+
funnel: "funnel",
|
|
59
|
+
wedgeRectCallout: "wedgeRectCallout",
|
|
60
|
+
wedgeRoundRectCallout: "wedgeRoundRectCallout",
|
|
61
|
+
wedgeEllipseCallout: "wedgeEllipseCallout",
|
|
62
|
+
frame: "frame",
|
|
63
|
+
plaque: "plaque",
|
|
64
|
+
bracePair: "bracePair",
|
|
65
|
+
bracketPair: "bracketPair",
|
|
66
|
+
leftBrace: "leftBrace",
|
|
67
|
+
rightBrace: "rightBrace",
|
|
68
|
+
leftBracket: "leftBracket",
|
|
69
|
+
rightBracket: "rightBracket",
|
|
70
|
+
flowChartProcess: "flowChartProcess",
|
|
71
|
+
flowChartDecision: "flowChartDecision",
|
|
72
|
+
flowChartTerminator: "flowChartTerminator",
|
|
73
|
+
flowChartDocument: "flowChartDocument",
|
|
74
|
+
flowChartConnector: "flowChartConnector",
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* pptxtojsonのshapTypeをPOMのShapeTypeに変換
|
|
78
|
+
* マッピングに存在しない場合はデフォルトで "rect" を返す
|
|
79
|
+
*/
|
|
80
|
+
function mapShapeType(shapType) {
|
|
81
|
+
return SHAPE_TYPE_MAP[shapType] || "rect";
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* pptxtojsonのShape要素をPOMのShapeNodeに変換
|
|
85
|
+
*/
|
|
86
|
+
export function convertShape(element) {
|
|
87
|
+
const result = {
|
|
88
|
+
type: "shape",
|
|
89
|
+
shapeType: mapShapeType(element.shapType),
|
|
90
|
+
w: ptToPx(element.width),
|
|
91
|
+
h: ptToPx(element.height),
|
|
92
|
+
};
|
|
93
|
+
// テキストがある場合
|
|
94
|
+
if (element.content) {
|
|
95
|
+
const text = extractPlainText(element.content);
|
|
96
|
+
if (text) {
|
|
97
|
+
result.text = text;
|
|
98
|
+
const styles = extractStyles(element.content);
|
|
99
|
+
if (styles.fontSize !== undefined) {
|
|
100
|
+
result.fontPx = ptToPx(styles.fontSize);
|
|
101
|
+
}
|
|
102
|
+
if (styles.color) {
|
|
103
|
+
result.color = normalizeColor(styles.color);
|
|
104
|
+
}
|
|
105
|
+
if (styles.bold) {
|
|
106
|
+
result.bold = true;
|
|
107
|
+
}
|
|
108
|
+
if (styles.textAlign) {
|
|
109
|
+
result.alignText = styles.textAlign;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// 塗りつぶし
|
|
114
|
+
if (element.fill && element.fill.type === "color") {
|
|
115
|
+
result.fill = {
|
|
116
|
+
color: normalizeColor(element.fill.value),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// 枠線
|
|
120
|
+
if (element.borderColor && element.borderWidth) {
|
|
121
|
+
result.line = {
|
|
122
|
+
color: normalizeColor(element.borderColor),
|
|
123
|
+
width: ptToPx(element.borderWidth),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
// 影
|
|
127
|
+
if (element.shadow) {
|
|
128
|
+
result.shadow = {
|
|
129
|
+
type: "outer",
|
|
130
|
+
blur: element.shadow.blur,
|
|
131
|
+
offset: Math.sqrt(element.shadow.h * element.shadow.h +
|
|
132
|
+
element.shadow.v * element.shadow.v),
|
|
133
|
+
color: normalizeColor(element.shadow.color),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertTable.d.ts","sourceRoot":"","sources":["../../src/parsePptx/convertTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAoC,MAAM,UAAU,CAAC;AAC5E,OAAO,KAAK,EAAE,KAAK,EAA8B,MAAM,SAAS,CAAC;AA2BjE;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS,CA2BtD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ptToPx, normalizeColor } from "./units";
|
|
2
|
+
import { extractPlainText } from "./parseHtml";
|
|
3
|
+
/**
|
|
4
|
+
* pptxtojsonのTableCell要素をPOMのTableCellに変換
|
|
5
|
+
*/
|
|
6
|
+
function convertCell(cell) {
|
|
7
|
+
const result = {
|
|
8
|
+
text: extractPlainText(cell.text),
|
|
9
|
+
};
|
|
10
|
+
if (cell.fontColor) {
|
|
11
|
+
result.color = normalizeColor(cell.fontColor);
|
|
12
|
+
}
|
|
13
|
+
if (cell.fontBold) {
|
|
14
|
+
result.bold = true;
|
|
15
|
+
}
|
|
16
|
+
if (cell.fillColor) {
|
|
17
|
+
result.backgroundColor = normalizeColor(cell.fillColor);
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* pptxtojsonのTable要素をPOMのTableNodeに変換
|
|
23
|
+
*/
|
|
24
|
+
export function convertTable(element) {
|
|
25
|
+
// 列幅の変換
|
|
26
|
+
const columns = element.colWidths.map((width) => ({
|
|
27
|
+
width: ptToPx(width),
|
|
28
|
+
}));
|
|
29
|
+
// 行データの変換
|
|
30
|
+
const rows = element.data.map((rowCells, rowIndex) => {
|
|
31
|
+
const cells = rowCells.map((cell) => convertCell(cell));
|
|
32
|
+
const row = { cells };
|
|
33
|
+
// 行の高さ
|
|
34
|
+
if (element.rowHeights && element.rowHeights[rowIndex]) {
|
|
35
|
+
row.height = ptToPx(element.rowHeights[rowIndex]);
|
|
36
|
+
}
|
|
37
|
+
return row;
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
type: "table",
|
|
41
|
+
columns,
|
|
42
|
+
rows,
|
|
43
|
+
w: ptToPx(element.width),
|
|
44
|
+
h: ptToPx(element.height),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertText.d.ts","sourceRoot":"","sources":["../../src/parsePptx/convertText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAIpC;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,IAAI,GAAG,QAAQ,CAiCnD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ptToPx, normalizeColor } from "./units";
|
|
2
|
+
import { extractPlainText, extractStyles } from "./parseHtml";
|
|
3
|
+
/**
|
|
4
|
+
* pptxtojsonのText要素をPOMのTextNodeに変換
|
|
5
|
+
*/
|
|
6
|
+
export function convertText(element) {
|
|
7
|
+
const text = extractPlainText(element.content);
|
|
8
|
+
const styles = extractStyles(element.content);
|
|
9
|
+
const result = {
|
|
10
|
+
type: "text",
|
|
11
|
+
text,
|
|
12
|
+
w: ptToPx(element.width),
|
|
13
|
+
h: ptToPx(element.height),
|
|
14
|
+
};
|
|
15
|
+
// スタイル情報を設定
|
|
16
|
+
if (styles.fontSize !== undefined) {
|
|
17
|
+
result.fontPx = ptToPx(styles.fontSize);
|
|
18
|
+
}
|
|
19
|
+
if (styles.color) {
|
|
20
|
+
result.color = normalizeColor(styles.color);
|
|
21
|
+
}
|
|
22
|
+
if (styles.bold) {
|
|
23
|
+
result.bold = true;
|
|
24
|
+
}
|
|
25
|
+
if (styles.textAlign) {
|
|
26
|
+
result.alignText = styles.textAlign;
|
|
27
|
+
}
|
|
28
|
+
if (styles.fontFamily) {
|
|
29
|
+
result.fontFamily = styles.fontFamily;
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ParsedPptx, ParsePptxOptions } from "./types";
|
|
2
|
+
export type { ParsedPptx, ParsePptxOptions };
|
|
3
|
+
/**
|
|
4
|
+
* PPTXファイルを解析してPOMNode[]に変換
|
|
5
|
+
*
|
|
6
|
+
* @param data - PPTXファイルのバイナリデータ
|
|
7
|
+
* @param options - 解析オプション
|
|
8
|
+
* @returns ParsedPptx - 解析結果
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { parsePptx } from "@hirokisakabe/pom";
|
|
13
|
+
* import fs from "fs";
|
|
14
|
+
*
|
|
15
|
+
* const data = new Uint8Array(fs.readFileSync("presentation.pptx"));
|
|
16
|
+
* const result = await parsePptx(data);
|
|
17
|
+
*
|
|
18
|
+
* console.log(`スライド数: ${result.slides.length}`);
|
|
19
|
+
* console.log(`サイズ: ${result.metadata.slideWidth}x${result.metadata.slideHeight}`);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function parsePptx(data: Uint8Array, options?: ParsePptxOptions): Promise<ParsedPptx>;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parsePptx/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAkB,MAAM,SAAS,CAAC;AAQ5E,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;AA4E7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,UAAU,EAChB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,UAAU,CAAC,CAmCrB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as pptxtojson from "pptxtojson";
|
|
2
|
+
import { ptToPx } from "./units";
|
|
3
|
+
import { convertText } from "./convertText";
|
|
4
|
+
import { convertImage } from "./convertImage";
|
|
5
|
+
import { convertShape } from "./convertShape";
|
|
6
|
+
import { convertTable } from "./convertTable";
|
|
7
|
+
import { convertChart } from "./convertChart";
|
|
8
|
+
/**
|
|
9
|
+
* サポートされる要素タイプ
|
|
10
|
+
*/
|
|
11
|
+
const SUPPORTED_ELEMENT_TYPES = ["text", "image", "shape", "table", "chart"];
|
|
12
|
+
/**
|
|
13
|
+
* 要素がサポートされているかチェック
|
|
14
|
+
*/
|
|
15
|
+
function isSupported(element) {
|
|
16
|
+
return SUPPORTED_ELEMENT_TYPES.includes(element.type);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* pptxtojsonの要素をPOMNodeに変換
|
|
20
|
+
*/
|
|
21
|
+
function convertElement(element) {
|
|
22
|
+
switch (element.type) {
|
|
23
|
+
case "text":
|
|
24
|
+
return convertText(element);
|
|
25
|
+
case "image":
|
|
26
|
+
return convertImage(element);
|
|
27
|
+
case "shape":
|
|
28
|
+
return convertShape(element);
|
|
29
|
+
case "table":
|
|
30
|
+
return convertTable(element);
|
|
31
|
+
case "chart":
|
|
32
|
+
return convertChart(element);
|
|
33
|
+
case "group":
|
|
34
|
+
// グループ内の要素をフラット化して返す(最初の要素のみ)
|
|
35
|
+
// 注: グループ全体を適切に処理するには追加の実装が必要
|
|
36
|
+
return null;
|
|
37
|
+
case "diagram":
|
|
38
|
+
// diagramはフラット化してshapeとして扱う可能性があるが、
|
|
39
|
+
// 現時点では未対応
|
|
40
|
+
return null;
|
|
41
|
+
default:
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* スライドをPOMNodeに変換
|
|
47
|
+
* 各スライドはVStackとして返す
|
|
48
|
+
*/
|
|
49
|
+
function convertSlide(slide, slideWidth, slideHeight) {
|
|
50
|
+
const children = [];
|
|
51
|
+
// 要素をorder順にソート
|
|
52
|
+
const sortedElements = [...slide.elements]
|
|
53
|
+
.filter(isSupported)
|
|
54
|
+
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
55
|
+
for (const element of sortedElements) {
|
|
56
|
+
const node = convertElement(element);
|
|
57
|
+
if (node) {
|
|
58
|
+
children.push(node);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// VStackでラップして返す
|
|
62
|
+
const result = {
|
|
63
|
+
type: "vstack",
|
|
64
|
+
w: slideWidth,
|
|
65
|
+
h: slideHeight,
|
|
66
|
+
children,
|
|
67
|
+
};
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* PPTXファイルを解析してPOMNode[]に変換
|
|
72
|
+
*
|
|
73
|
+
* @param data - PPTXファイルのバイナリデータ
|
|
74
|
+
* @param options - 解析オプション
|
|
75
|
+
* @returns ParsedPptx - 解析結果
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* import { parsePptx } from "@hirokisakabe/pom";
|
|
80
|
+
* import fs from "fs";
|
|
81
|
+
*
|
|
82
|
+
* const data = new Uint8Array(fs.readFileSync("presentation.pptx"));
|
|
83
|
+
* const result = await parsePptx(data);
|
|
84
|
+
*
|
|
85
|
+
* console.log(`スライド数: ${result.slides.length}`);
|
|
86
|
+
* console.log(`サイズ: ${result.metadata.slideWidth}x${result.metadata.slideHeight}`);
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export async function parsePptx(data, options) {
|
|
90
|
+
// Uint8ArrayをArrayBufferに変換
|
|
91
|
+
const arrayBuffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
|
|
92
|
+
// pptxtojsonでパース
|
|
93
|
+
const result = await pptxtojson.parse(arrayBuffer, {
|
|
94
|
+
slideFactor: options?.slideFactor,
|
|
95
|
+
fontsizeFactor: options?.fontsizeFactor,
|
|
96
|
+
});
|
|
97
|
+
// スライドサイズをpxに変換
|
|
98
|
+
const slideWidth = ptToPx(result.size.width);
|
|
99
|
+
const slideHeight = ptToPx(result.size.height);
|
|
100
|
+
// 各スライドをPOMNodeに変換
|
|
101
|
+
const slides = result.slides.map((slide) => convertSlide(slide, slideWidth, slideHeight));
|
|
102
|
+
// 画像を収集
|
|
103
|
+
const images = new Map();
|
|
104
|
+
// 注: pptxtojsonは画像をBase64文字列として提供するため、
|
|
105
|
+
// 必要に応じてUint8Arrayに変換して保存する実装が必要
|
|
106
|
+
return {
|
|
107
|
+
slides,
|
|
108
|
+
images,
|
|
109
|
+
metadata: {
|
|
110
|
+
slideWidth,
|
|
111
|
+
slideHeight,
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pptxtojsonのテキスト要素はHTML形式でスタイル情報を含んでいる
|
|
3
|
+
* このモジュールはHTMLからテキストとスタイル情報を抽出する
|
|
4
|
+
*/
|
|
5
|
+
export interface ExtractedStyles {
|
|
6
|
+
fontSize?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
bold?: boolean;
|
|
9
|
+
textAlign?: "left" | "center" | "right";
|
|
10
|
+
fontFamily?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* HTMLコンテンツからプレーンテキストを抽出
|
|
14
|
+
* <p>タグは改行、<br>は改行、それ以外のタグは除去
|
|
15
|
+
*/
|
|
16
|
+
export declare function extractPlainText(html: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* HTMLのstyle属性からスタイル情報を抽出
|
|
19
|
+
* 最初に見つかったスタイルを使用(複数スタイルの場合は最初のもの)
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractStyles(html: string): ExtractedStyles;
|
|
22
|
+
//# sourceMappingURL=parseHtml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseHtml.d.ts","sourceRoot":"","sources":["../../src/parsePptx/parseHtml.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWrD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAkC3D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pptxtojsonのテキスト要素はHTML形式でスタイル情報を含んでいる
|
|
3
|
+
* このモジュールはHTMLからテキストとスタイル情報を抽出する
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* HTMLコンテンツからプレーンテキストを抽出
|
|
7
|
+
* <p>タグは改行、<br>は改行、それ以外のタグは除去
|
|
8
|
+
*/
|
|
9
|
+
export function extractPlainText(html) {
|
|
10
|
+
return html
|
|
11
|
+
.replace(/<br\s*\/?>/gi, "\n")
|
|
12
|
+
.replace(/<\/p>/gi, "\n")
|
|
13
|
+
.replace(/<[^>]+>/g, "")
|
|
14
|
+
.replace(/ /gi, " ")
|
|
15
|
+
.replace(/</gi, "<")
|
|
16
|
+
.replace(/>/gi, ">")
|
|
17
|
+
.replace(/&/gi, "&")
|
|
18
|
+
.replace(/"/gi, '"')
|
|
19
|
+
.trim();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* HTMLのstyle属性からスタイル情報を抽出
|
|
23
|
+
* 最初に見つかったスタイルを使用(複数スタイルの場合は最初のもの)
|
|
24
|
+
*/
|
|
25
|
+
export function extractStyles(html) {
|
|
26
|
+
const result = {};
|
|
27
|
+
// font-size: Npt
|
|
28
|
+
const fontSizeMatch = html.match(/font-size:\s*(\d+(?:\.\d+)?)pt/i);
|
|
29
|
+
if (fontSizeMatch) {
|
|
30
|
+
result.fontSize = parseFloat(fontSizeMatch[1]);
|
|
31
|
+
}
|
|
32
|
+
// color: #XXXXXX or rgb(...)
|
|
33
|
+
const colorMatch = html.match(/(?:^|[^-])color:\s*(#[0-9A-Fa-f]{6})/i);
|
|
34
|
+
if (colorMatch) {
|
|
35
|
+
result.color = colorMatch[1];
|
|
36
|
+
}
|
|
37
|
+
// font-weight: bold
|
|
38
|
+
const boldMatch = html.match(/font-weight:\s*bold/i);
|
|
39
|
+
if (boldMatch) {
|
|
40
|
+
result.bold = true;
|
|
41
|
+
}
|
|
42
|
+
// text-align: left|center|right
|
|
43
|
+
const textAlignMatch = html.match(/text-align:\s*(left|center|right)/i);
|
|
44
|
+
if (textAlignMatch) {
|
|
45
|
+
result.textAlign = textAlignMatch[1];
|
|
46
|
+
}
|
|
47
|
+
// font-family
|
|
48
|
+
const fontFamilyMatch = html.match(/font-family:\s*["']?([^;"']+)/i);
|
|
49
|
+
if (fontFamilyMatch) {
|
|
50
|
+
result.fontFamily = fontFamilyMatch[1].trim();
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { POMNode } from "../types";
|
|
2
|
+
export type { Slide, Element, BaseElement, Text, Image, Shape, Table, TableCell, Chart, CommonChart, ScatterChart, ChartItem, ChartValue, ChartType, Fill, ColorFill, ImageFill, GradientFill, PatternFill, Shadow, Border, Group, Diagram, Video, Audio, Math, } from "pptxtojson";
|
|
3
|
+
export type ParsedPptx = {
|
|
4
|
+
slides: POMNode[];
|
|
5
|
+
images: Map<string, Uint8Array>;
|
|
6
|
+
metadata: {
|
|
7
|
+
slideWidth: number;
|
|
8
|
+
slideHeight: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export type ParsePptxOptions = {
|
|
12
|
+
slideFactor?: number;
|
|
13
|
+
fontsizeFactor?: number;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/parsePptx/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,YAAY,EACV,KAAK,EACL,OAAO,EACP,WAAW,EACX,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,EACJ,SAAS,EACT,SAAS,EACT,YAAY,EACZ,WAAW,EACX,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,EACP,KAAK,EACL,KAAK,EACL,IAAI,GACL,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChC,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ポイント(pt)からピクセル(px)への変換
|
|
3
|
+
* pptxtojsonはpt単位で出力する
|
|
4
|
+
* 変換式: pt × 4/3 = px (96 DPI基準)
|
|
5
|
+
*/
|
|
6
|
+
export declare function ptToPx(pt: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* カラーコードの正規化
|
|
9
|
+
* "#FF0000" → "FF0000"
|
|
10
|
+
* pomでは#なしの16進数カラーコードを使用する
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeColor(color: string): string;
|
|
13
|
+
//# sourceMappingURL=units.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/parsePptx/units.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ポイント(pt)からピクセル(px)への変換
|
|
3
|
+
* pptxtojsonはpt単位で出力する
|
|
4
|
+
* 変換式: pt × 4/3 = px (96 DPI基準)
|
|
5
|
+
*/
|
|
6
|
+
export function ptToPx(pt) {
|
|
7
|
+
return pt * (4 / 3);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* カラーコードの正規化
|
|
11
|
+
* "#FF0000" → "FF0000"
|
|
12
|
+
* pomでは#なしの16進数カラーコードを使用する
|
|
13
|
+
*/
|
|
14
|
+
export function normalizeColor(color) {
|
|
15
|
+
if (color.startsWith("#")) {
|
|
16
|
+
return color.slice(1).toUpperCase();
|
|
17
|
+
}
|
|
18
|
+
return color.toUpperCase();
|
|
19
|
+
}
|
|
@@ -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,iBAqOnE"}
|
|
@@ -20,7 +20,7 @@ export function renderPptx(pages, slidePx) {
|
|
|
20
20
|
for (const data of pages) {
|
|
21
21
|
const slide = pptx.addSlide();
|
|
22
22
|
function renderBackgroundAndBorder(node) {
|
|
23
|
-
const { backgroundColor, border } = node;
|
|
23
|
+
const { backgroundColor, border, borderRadius } = node;
|
|
24
24
|
const hasBackground = Boolean(backgroundColor);
|
|
25
25
|
const hasBorder = Boolean(border &&
|
|
26
26
|
(border.color !== undefined ||
|
|
@@ -39,6 +39,14 @@ export function renderPptx(pages, slidePx) {
|
|
|
39
39
|
dashType: border?.dashType,
|
|
40
40
|
}
|
|
41
41
|
: { type: "none" };
|
|
42
|
+
// borderRadius がある場合は roundRect を使用し、rectRadius を計算
|
|
43
|
+
const shapeType = borderRadius
|
|
44
|
+
? pptx.ShapeType.roundRect
|
|
45
|
+
: pptx.ShapeType.rect;
|
|
46
|
+
// px を 0-1 の正規化値に変換
|
|
47
|
+
const rectRadius = borderRadius
|
|
48
|
+
? Math.min((borderRadius / Math.min(node.w, node.h)) * 2, 1)
|
|
49
|
+
: undefined;
|
|
42
50
|
const shapeOptions = {
|
|
43
51
|
x: pxToIn(node.x),
|
|
44
52
|
y: pxToIn(node.y),
|
|
@@ -46,8 +54,9 @@ export function renderPptx(pages, slidePx) {
|
|
|
46
54
|
h: pxToIn(node.h),
|
|
47
55
|
fill,
|
|
48
56
|
line,
|
|
57
|
+
rectRadius,
|
|
49
58
|
};
|
|
50
|
-
slide.addShape(
|
|
59
|
+
slide.addShape(shapeType, shapeOptions);
|
|
51
60
|
}
|
|
52
61
|
/**
|
|
53
62
|
* node をスライドにレンダリングする
|
package/dist/types.d.ts
CHANGED
|
@@ -329,6 +329,7 @@ declare const basePOMNodeSchema: z.ZodObject<{
|
|
|
329
329
|
sysDot: "sysDot";
|
|
330
330
|
}>>;
|
|
331
331
|
}, z.core.$strip>>;
|
|
332
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
332
333
|
}, z.core.$strip>;
|
|
333
334
|
type BasePOMNode = z.infer<typeof basePOMNodeSchema>;
|
|
334
335
|
export declare const textNodeSchema: z.ZodObject<{
|
|
@@ -360,6 +361,7 @@ export declare const textNodeSchema: z.ZodObject<{
|
|
|
360
361
|
sysDot: "sysDot";
|
|
361
362
|
}>>;
|
|
362
363
|
}, z.core.$strip>>;
|
|
364
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
363
365
|
type: z.ZodLiteral<"text">;
|
|
364
366
|
text: z.ZodString;
|
|
365
367
|
fontPx: z.ZodOptional<z.ZodNumber>;
|
|
@@ -428,6 +430,7 @@ export declare const imageNodeSchema: z.ZodObject<{
|
|
|
428
430
|
sysDot: "sysDot";
|
|
429
431
|
}>>;
|
|
430
432
|
}, z.core.$strip>>;
|
|
433
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
431
434
|
type: z.ZodLiteral<"image">;
|
|
432
435
|
src: z.ZodString;
|
|
433
436
|
}, z.core.$strip>;
|
|
@@ -490,6 +493,7 @@ export declare const tableNodeSchema: z.ZodObject<{
|
|
|
490
493
|
sysDot: "sysDot";
|
|
491
494
|
}>>;
|
|
492
495
|
}, z.core.$strip>>;
|
|
496
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
493
497
|
type: z.ZodLiteral<"table">;
|
|
494
498
|
columns: z.ZodArray<z.ZodObject<{
|
|
495
499
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -540,6 +544,7 @@ export declare const shapeNodeSchema: z.ZodObject<{
|
|
|
540
544
|
sysDot: "sysDot";
|
|
541
545
|
}>>;
|
|
542
546
|
}, z.core.$strip>>;
|
|
547
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
543
548
|
type: z.ZodLiteral<"shape">;
|
|
544
549
|
shapeType: z.ZodEnum<{
|
|
545
550
|
accentBorderCallout1: "accentBorderCallout1";
|
|
@@ -807,6 +812,7 @@ export declare const chartNodeSchema: z.ZodObject<{
|
|
|
807
812
|
sysDot: "sysDot";
|
|
808
813
|
}>>;
|
|
809
814
|
}, z.core.$strip>>;
|
|
815
|
+
borderRadius: z.ZodOptional<z.ZodNumber>;
|
|
810
816
|
type: z.ZodLiteral<"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G;IAAE,QAAQ,EAAE,cAAc,CAAA;CAAE,CAAC,GACzD,CAAC,UAAU,GAAG,cAAc,GAAG;IAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,GAC9D,CAAC,UAAU,GAAG,cAAc,GAAG;IAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC,GAC9D,CAAC,SAAS,GAAG,cAAc,CAAC,GAC5B,CAAC,SAAS,GAAG,cAAc,CAAC,CAAC;AAEjC,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAmB7B,CAAC;AAG/B,eAAO,MAAM,wBAAwB;;;;EAAsC,CAAC;AAE5E,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;iBAanC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -267,6 +267,7 @@ const basePOMNodeSchema = z.object({
|
|
|
267
267
|
padding: paddingSchema.optional(),
|
|
268
268
|
backgroundColor: z.string().optional(),
|
|
269
269
|
border: borderStyleSchema.optional(),
|
|
270
|
+
borderRadius: z.number().optional(),
|
|
270
271
|
});
|
|
271
272
|
// ===== Non-recursive Node Types =====
|
|
272
273
|
export const textNodeSchema = basePOMNodeSchema.extend({
|
package/package.json
CHANGED