@hirokisakabe/pom 0.1.12 → 0.3.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 (103) hide show
  1. package/README.md +31 -584
  2. package/dist/calcYogaLayout/calcYogaLayout.d.ts.map +1 -1
  3. package/dist/calcYogaLayout/calcYogaLayout.js +61 -84
  4. package/dist/calcYogaLayout/fontLoader.d.ts +20 -0
  5. package/dist/calcYogaLayout/fontLoader.d.ts.map +1 -0
  6. package/dist/calcYogaLayout/fontLoader.js +59 -0
  7. package/dist/calcYogaLayout/fonts/notoSansJPBold.d.ts +7 -0
  8. package/dist/calcYogaLayout/fonts/notoSansJPBold.d.ts.map +1 -0
  9. package/dist/calcYogaLayout/fonts/notoSansJPBold.js +6 -0
  10. package/dist/calcYogaLayout/fonts/notoSansJPRegular.d.ts +7 -0
  11. package/dist/calcYogaLayout/fonts/notoSansJPRegular.d.ts.map +1 -0
  12. package/dist/calcYogaLayout/fonts/notoSansJPRegular.js +6 -0
  13. package/dist/calcYogaLayout/measureText.d.ts +1 -1
  14. package/dist/calcYogaLayout/measureText.d.ts.map +1 -1
  15. package/dist/calcYogaLayout/measureText.js +65 -114
  16. package/dist/inputSchema.d.ts +268 -2
  17. package/dist/inputSchema.d.ts.map +1 -1
  18. package/dist/inputSchema.js +53 -1
  19. package/dist/renderPptx/nodes/box.d.ts +1 -0
  20. package/dist/renderPptx/nodes/box.d.ts.map +1 -0
  21. package/dist/renderPptx/nodes/box.js +2 -0
  22. package/dist/renderPptx/nodes/chart.d.ts +8 -0
  23. package/dist/renderPptx/nodes/chart.d.ts.map +1 -0
  24. package/dist/renderPptx/nodes/chart.js +23 -0
  25. package/dist/renderPptx/nodes/flow.d.ts +8 -0
  26. package/dist/renderPptx/nodes/flow.d.ts.map +1 -0
  27. package/dist/renderPptx/nodes/flow.js +208 -0
  28. package/dist/renderPptx/nodes/image.d.ts +8 -0
  29. package/dist/renderPptx/nodes/image.d.ts.map +1 -0
  30. package/dist/renderPptx/nodes/image.js +17 -0
  31. package/dist/renderPptx/nodes/index.d.ts +11 -0
  32. package/dist/renderPptx/nodes/index.d.ts.map +1 -0
  33. package/dist/renderPptx/nodes/index.js +10 -0
  34. package/dist/renderPptx/nodes/matrix.d.ts +8 -0
  35. package/dist/renderPptx/nodes/matrix.d.ts.map +1 -0
  36. package/dist/renderPptx/nodes/matrix.js +150 -0
  37. package/dist/renderPptx/nodes/processArrow.d.ts +8 -0
  38. package/dist/renderPptx/nodes/processArrow.d.ts.map +1 -0
  39. package/dist/renderPptx/nodes/processArrow.js +75 -0
  40. package/dist/renderPptx/nodes/shape.d.ts +8 -0
  41. package/dist/renderPptx/nodes/shape.d.ts.map +1 -0
  42. package/dist/renderPptx/nodes/shape.js +49 -0
  43. package/dist/renderPptx/nodes/table.d.ts +8 -0
  44. package/dist/renderPptx/nodes/table.d.ts.map +1 -0
  45. package/dist/renderPptx/nodes/table.js +29 -0
  46. package/dist/renderPptx/nodes/text.d.ts +8 -0
  47. package/dist/renderPptx/nodes/text.d.ts.map +1 -0
  48. package/dist/renderPptx/nodes/text.js +5 -0
  49. package/dist/renderPptx/nodes/timeline.d.ts +8 -0
  50. package/dist/renderPptx/nodes/timeline.d.ts.map +1 -0
  51. package/dist/renderPptx/nodes/timeline.js +157 -0
  52. package/dist/renderPptx/nodes/tree.d.ts +8 -0
  53. package/dist/renderPptx/nodes/tree.d.ts.map +1 -0
  54. package/dist/renderPptx/nodes/tree.js +223 -0
  55. package/dist/renderPptx/renderPptx.d.ts.map +1 -1
  56. package/dist/renderPptx/renderPptx.js +32 -166
  57. package/dist/renderPptx/types.d.ts +10 -0
  58. package/dist/renderPptx/types.d.ts.map +1 -0
  59. package/dist/renderPptx/utils/backgroundBorder.d.ts +8 -0
  60. package/dist/renderPptx/utils/backgroundBorder.d.ts.map +1 -0
  61. package/dist/renderPptx/utils/backgroundBorder.js +44 -0
  62. package/dist/renderPptx/utils/index.d.ts +6 -0
  63. package/dist/renderPptx/utils/index.d.ts.map +1 -0
  64. package/dist/renderPptx/utils/index.js +3 -0
  65. package/dist/renderPptx/utils/shapeDrawing.d.ts +27 -0
  66. package/dist/renderPptx/utils/shapeDrawing.d.ts.map +1 -0
  67. package/dist/renderPptx/utils/shapeDrawing.js +36 -0
  68. package/dist/renderPptx/utils/textDrawing.d.ts +20 -0
  69. package/dist/renderPptx/utils/textDrawing.d.ts.map +1 -0
  70. package/dist/renderPptx/utils/textDrawing.js +20 -0
  71. package/dist/toPositioned/toPositioned.d.ts.map +1 -1
  72. package/dist/toPositioned/toPositioned.js +45 -0
  73. package/dist/types.d.ts +399 -2
  74. package/dist/types.d.ts.map +1 -1
  75. package/dist/types.js +134 -0
  76. package/package.json +13 -3
  77. package/dist/parsePptx/convertChart.d.ts +0 -8
  78. package/dist/parsePptx/convertChart.d.ts.map +0 -1
  79. package/dist/parsePptx/convertChart.js +0 -78
  80. package/dist/parsePptx/convertImage.d.ts +0 -8
  81. package/dist/parsePptx/convertImage.d.ts.map +0 -1
  82. package/dist/parsePptx/convertImage.js +0 -13
  83. package/dist/parsePptx/convertShape.d.ts +0 -7
  84. package/dist/parsePptx/convertShape.d.ts.map +0 -1
  85. package/dist/parsePptx/convertShape.js +0 -137
  86. package/dist/parsePptx/convertTable.d.ts +0 -7
  87. package/dist/parsePptx/convertTable.d.ts.map +0 -1
  88. package/dist/parsePptx/convertTable.js +0 -46
  89. package/dist/parsePptx/convertText.d.ts +0 -7
  90. package/dist/parsePptx/convertText.d.ts.map +0 -1
  91. package/dist/parsePptx/convertText.js +0 -32
  92. package/dist/parsePptx/index.d.ts +0 -23
  93. package/dist/parsePptx/index.d.ts.map +0 -1
  94. package/dist/parsePptx/index.js +0 -114
  95. package/dist/parsePptx/parseHtml.d.ts +0 -22
  96. package/dist/parsePptx/parseHtml.d.ts.map +0 -1
  97. package/dist/parsePptx/parseHtml.js +0 -53
  98. package/dist/parsePptx/types.d.ts +0 -15
  99. package/dist/parsePptx/types.d.ts.map +0 -1
  100. package/dist/parsePptx/units.d.ts +0 -13
  101. package/dist/parsePptx/units.d.ts.map +0 -1
  102. package/dist/parsePptx/units.js +0 -19
  103. /package/dist/{parsePptx → renderPptx}/types.js +0 -0
@@ -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,MAAM,MAAM,OAAO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G,cAAc,CAAC,GAC5B,CAAC,SAAS,GAAG,cAAc,CAAC,GAC5B,CAAC,YAAY,GAAG,cAAc,CAAC,GAC/B,CAAC,UAAU,GAAG,cAAc,CAAC,GAC7B,CAAC,QAAQ,GAAG,cAAc,CAAC,GAC3B,CAAC,QAAQ,GAAG,cAAc,CAAC,GAC3B,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;AAExC,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAwB7B,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
@@ -343,6 +343,130 @@ export const chartNodeSchema = basePOMNodeSchema.extend({
343
343
  // radar専用オプション
344
344
  radarStyle: radarStyleSchema.optional(),
345
345
  });
346
+ // ===== Timeline Node =====
347
+ export const timelineDirectionSchema = z.enum(["horizontal", "vertical"]);
348
+ export const timelineItemSchema = z.object({
349
+ date: z.string(),
350
+ title: z.string(),
351
+ description: z.string().optional(),
352
+ color: z.string().optional(),
353
+ });
354
+ export const timelineNodeSchema = basePOMNodeSchema.extend({
355
+ type: z.literal("timeline"),
356
+ direction: timelineDirectionSchema.optional(),
357
+ items: z.array(timelineItemSchema),
358
+ });
359
+ // ===== Matrix Node =====
360
+ export const matrixAxisSchema = z.object({
361
+ x: z.string(),
362
+ y: z.string(),
363
+ });
364
+ export const matrixQuadrantsSchema = z.object({
365
+ topLeft: z.string(),
366
+ topRight: z.string(),
367
+ bottomLeft: z.string(),
368
+ bottomRight: z.string(),
369
+ });
370
+ export const matrixItemSchema = z.object({
371
+ label: z.string(),
372
+ x: z.number().min(0).max(1),
373
+ y: z.number().min(0).max(1),
374
+ color: z.string().optional(),
375
+ });
376
+ export const matrixNodeSchema = basePOMNodeSchema.extend({
377
+ type: z.literal("matrix"),
378
+ axes: matrixAxisSchema,
379
+ quadrants: matrixQuadrantsSchema.optional(),
380
+ items: z.array(matrixItemSchema),
381
+ });
382
+ // ===== Tree Node =====
383
+ export const treeLayoutSchema = z.enum(["vertical", "horizontal"]);
384
+ export const treeNodeShapeSchema = z.enum(["rect", "roundRect", "ellipse"]);
385
+ export const treeConnectorStyleSchema = z.object({
386
+ color: z.string().optional(),
387
+ width: z.number().optional(),
388
+ });
389
+ export const treeDataItemSchema = z.lazy(() => z.object({
390
+ label: z.string(),
391
+ color: z.string().optional(),
392
+ children: z.array(treeDataItemSchema).optional(),
393
+ }));
394
+ export const treeNodeSchema = basePOMNodeSchema.extend({
395
+ type: z.literal("tree"),
396
+ layout: treeLayoutSchema.optional(),
397
+ nodeShape: treeNodeShapeSchema.optional(),
398
+ data: treeDataItemSchema,
399
+ connectorStyle: treeConnectorStyleSchema.optional(),
400
+ nodeWidth: z.number().optional(),
401
+ nodeHeight: z.number().optional(),
402
+ levelGap: z.number().optional(),
403
+ siblingGap: z.number().optional(),
404
+ });
405
+ // ===== ProcessArrow Node =====
406
+ export const processArrowDirectionSchema = z.enum(["horizontal", "vertical"]);
407
+ export const processArrowStepSchema = z.object({
408
+ label: z.string(),
409
+ color: z.string().optional(),
410
+ textColor: z.string().optional(),
411
+ });
412
+ export const processArrowNodeSchema = basePOMNodeSchema.extend({
413
+ type: z.literal("processArrow"),
414
+ direction: processArrowDirectionSchema.optional(),
415
+ steps: z.array(processArrowStepSchema),
416
+ itemWidth: z.number().optional(),
417
+ itemHeight: z.number().optional(),
418
+ gap: z.number().optional(),
419
+ fontPx: z.number().optional(),
420
+ bold: z.boolean().optional(),
421
+ });
422
+ // ===== Flow Node =====
423
+ export const flowDirectionSchema = z.enum(["horizontal", "vertical"]);
424
+ export const flowNodeShapeSchema = z.enum([
425
+ "flowChartTerminator",
426
+ "flowChartProcess",
427
+ "flowChartDecision",
428
+ "flowChartInputOutput",
429
+ "flowChartDocument",
430
+ "flowChartPredefinedProcess",
431
+ "flowChartConnector",
432
+ "flowChartPreparation",
433
+ "flowChartManualInput",
434
+ "flowChartManualOperation",
435
+ "flowChartDelay",
436
+ "flowChartMagneticDisk",
437
+ ]);
438
+ export const flowNodeItemSchema = z.object({
439
+ id: z.string(),
440
+ shape: flowNodeShapeSchema,
441
+ text: z.string(),
442
+ color: z.string().optional(),
443
+ textColor: z.string().optional(),
444
+ width: z.number().optional(),
445
+ height: z.number().optional(),
446
+ });
447
+ export const flowConnectionSchema = z.object({
448
+ from: z.string(),
449
+ to: z.string(),
450
+ label: z.string().optional(),
451
+ color: z.string().optional(),
452
+ });
453
+ export const flowConnectorStyleSchema = z.object({
454
+ color: z.string().optional(),
455
+ width: z.number().optional(),
456
+ arrowType: z
457
+ .enum(["none", "arrow", "diamond", "oval", "stealth", "triangle"])
458
+ .optional(),
459
+ });
460
+ export const flowNodeSchema = basePOMNodeSchema.extend({
461
+ type: z.literal("flow"),
462
+ direction: flowDirectionSchema.optional(),
463
+ nodes: z.array(flowNodeItemSchema),
464
+ connections: z.array(flowConnectionSchema),
465
+ connectorStyle: flowConnectorStyleSchema.optional(),
466
+ nodeWidth: z.number().optional(),
467
+ nodeHeight: z.number().optional(),
468
+ nodeGap: z.number().optional(),
469
+ });
346
470
  // Define schemas using passthrough to maintain type safety
347
471
  const boxNodeSchemaBase = basePOMNodeSchema.extend({
348
472
  type: z.literal("box"),
@@ -375,6 +499,11 @@ export const pomNodeSchema = z.lazy(() => z.discriminatedUnion("type", [
375
499
  hStackNodeSchemaBase,
376
500
  shapeNodeSchema,
377
501
  chartNodeSchema,
502
+ timelineNodeSchema,
503
+ matrixNodeSchema,
504
+ treeNodeSchema,
505
+ flowNodeSchema,
506
+ processArrowNodeSchema,
378
507
  ]));
379
508
  // ===== Positioned Node Types =====
380
509
  const positionedBaseSchema = z.object({
@@ -400,6 +529,11 @@ export const positionedNodeSchema = z.lazy(() => z.union([
400
529
  }),
401
530
  shapeNodeSchema.merge(positionedBaseSchema),
402
531
  chartNodeSchema.merge(positionedBaseSchema),
532
+ timelineNodeSchema.merge(positionedBaseSchema),
533
+ matrixNodeSchema.merge(positionedBaseSchema),
534
+ treeNodeSchema.merge(positionedBaseSchema),
535
+ flowNodeSchema.merge(positionedBaseSchema),
536
+ processArrowNodeSchema.merge(positionedBaseSchema),
403
537
  ]));
404
538
  // ===== Master Slide Options =====
405
539
  export const pageNumberPositionSchema = z.enum(["left", "center", "right"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hirokisakabe/pom",
3
- "version": "0.1.12",
3
+ "version": "0.3.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",
@@ -59,11 +59,21 @@
59
59
  "vrt:docker": "docker compose build vrt && docker compose run --rm vrt",
60
60
  "vrt:docker:update": "docker compose build vrt-update && docker compose run --rm vrt-update",
61
61
  "preview": "tsx preview/lib/previewPptx.ts",
62
- "preview:docker": "docker compose build preview && docker compose run --rm preview"
62
+ "preview:docker": "docker compose build preview && docker compose run --rm preview",
63
+ "docs:images": "tsx docs/lib/generateNodeImages.ts",
64
+ "docs:images:docker": "docker compose run --rm docs-images",
65
+ "docs:images:docker:update": "docker compose build docs-images && docker compose run --rm docs-images",
66
+ "release": "changeset publish"
67
+ },
68
+ "publishConfig": {
69
+ "access": "public"
63
70
  },
64
71
  "devDependencies": {
72
+ "@changesets/changelog-github": "^0.5.2",
73
+ "@changesets/cli": "^2.29.8",
65
74
  "@eslint/js": "^9.39.1",
66
75
  "@types/image-size": "0.7.0",
76
+ "@types/opentype.js": "^1.3.8",
67
77
  "@types/pngjs": "6.0.5",
68
78
  "@vitest/ui": "^4.0.8",
69
79
  "eslint": "^9.39.1",
@@ -78,8 +88,8 @@
78
88
  "vitest": "^4.0.8"
79
89
  },
80
90
  "dependencies": {
81
- "canvas": "3.2.0",
82
91
  "image-size": "2.0.2",
92
+ "opentype.js": "^1.3.4",
83
93
  "pptxgenjs": "4.0.1",
84
94
  "yoga-layout": "3.2.1",
85
95
  "zod": "4.1.12"
@@ -1,8 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,78 +0,0 @@
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
- }
@@ -1,8 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,13 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- import type { ShapeNode } from "../types";
2
- import type { Shape } from "./types";
3
- /**
4
- * pptxtojsonのShape要素をPOMのShapeNodeに変換
5
- */
6
- export declare function convertShape(element: Shape): ShapeNode;
7
- //# sourceMappingURL=convertShape.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,137 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- import type { TableNode } from "../types";
2
- import type { Table } from "./types";
3
- /**
4
- * pptxtojsonのTable要素をPOMのTableNodeに変換
5
- */
6
- export declare function convertTable(element: Table): TableNode;
7
- //# sourceMappingURL=convertTable.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,46 +0,0 @@
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
- }
@@ -1,7 +0,0 @@
1
- import type { TextNode } from "../types";
2
- import type { Text } from "./types";
3
- /**
4
- * pptxtojsonのText要素をPOMのTextNodeに変換
5
- */
6
- export declare function convertText(element: Text): TextNode;
7
- //# sourceMappingURL=convertText.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,32 +0,0 @@
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
- }
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
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"}