@8btc/ppt-generator-mcp 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generatePPTSlides = void 0;
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
5
4
|
class CanvasBrowser {
|
|
6
5
|
constructor(width, height) {
|
|
7
6
|
this.el = document.createElement("canvas");
|
|
@@ -17,9 +16,7 @@ if (!globalThis.CanvasImpl) {
|
|
|
17
16
|
}
|
|
18
17
|
// 生成随机ID的函数
|
|
19
18
|
const nanoid = (length = 10) => {
|
|
20
|
-
return (
|
|
21
|
-
.toString("hex")
|
|
22
|
-
.slice(0, length);
|
|
19
|
+
return Math.random().toString(16).slice(0, length);
|
|
23
20
|
};
|
|
24
21
|
const generatePPTSlides = (templateSlides, outlineList, imgs = []) => {
|
|
25
22
|
const slides = [];
|
|
@@ -76,7 +73,7 @@ const formatOutlineList = (outlineList, contentsTemplates) => {
|
|
|
76
73
|
const count = cur.elements.filter((el) => checkTextType(el, "item")).length;
|
|
77
74
|
acc = Math.max(acc, count);
|
|
78
75
|
return acc;
|
|
79
|
-
},
|
|
76
|
+
}, 1);
|
|
80
77
|
for (const outlineItem of outlineList) {
|
|
81
78
|
if (outlineItem.type === "content") {
|
|
82
79
|
const items = outlineItem.data.items;
|