@8btc/ppt-generator-mcp 0.0.32-beta.1 → 0.0.32-beta.2
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.
|
@@ -87,14 +87,14 @@ declare const t: z.ZodObject<{
|
|
|
87
87
|
text: string;
|
|
88
88
|
}>, "many">;
|
|
89
89
|
images: z.ZodArray<z.ZodObject<{
|
|
90
|
-
imageType: z.ZodEnum<["pageFigure", "itemFigure"
|
|
90
|
+
imageType: z.ZodEnum<["pageFigure", "itemFigure"]>;
|
|
91
91
|
src: z.ZodString;
|
|
92
92
|
}, "strip", z.ZodTypeAny, {
|
|
93
93
|
src: string;
|
|
94
|
-
imageType: "pageFigure" | "itemFigure"
|
|
94
|
+
imageType: "pageFigure" | "itemFigure";
|
|
95
95
|
}, {
|
|
96
96
|
src: string;
|
|
97
|
-
imageType: "pageFigure" | "itemFigure"
|
|
97
|
+
imageType: "pageFigure" | "itemFigure";
|
|
98
98
|
}>, "many">;
|
|
99
99
|
}, "strip", z.ZodTypeAny, {
|
|
100
100
|
title: string;
|
|
@@ -104,7 +104,7 @@ declare const t: z.ZodObject<{
|
|
|
104
104
|
}[];
|
|
105
105
|
images: {
|
|
106
106
|
src: string;
|
|
107
|
-
imageType: "pageFigure" | "itemFigure"
|
|
107
|
+
imageType: "pageFigure" | "itemFigure";
|
|
108
108
|
}[];
|
|
109
109
|
}, {
|
|
110
110
|
title: string;
|
|
@@ -114,7 +114,7 @@ declare const t: z.ZodObject<{
|
|
|
114
114
|
}[];
|
|
115
115
|
images: {
|
|
116
116
|
src: string;
|
|
117
|
-
imageType: "pageFigure" | "itemFigure"
|
|
117
|
+
imageType: "pageFigure" | "itemFigure";
|
|
118
118
|
}[];
|
|
119
119
|
}>;
|
|
120
120
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -127,7 +127,7 @@ declare const t: z.ZodObject<{
|
|
|
127
127
|
}[];
|
|
128
128
|
images: {
|
|
129
129
|
src: string;
|
|
130
|
-
imageType: "pageFigure" | "itemFigure"
|
|
130
|
+
imageType: "pageFigure" | "itemFigure";
|
|
131
131
|
}[];
|
|
132
132
|
};
|
|
133
133
|
}, {
|
|
@@ -140,7 +140,7 @@ declare const t: z.ZodObject<{
|
|
|
140
140
|
}[];
|
|
141
141
|
images: {
|
|
142
142
|
src: string;
|
|
143
|
-
imageType: "pageFigure" | "itemFigure"
|
|
143
|
+
imageType: "pageFigure" | "itemFigure";
|
|
144
144
|
}[];
|
|
145
145
|
};
|
|
146
146
|
}>, z.ZodObject<{
|
|
@@ -179,7 +179,7 @@ declare const t: z.ZodObject<{
|
|
|
179
179
|
}[];
|
|
180
180
|
images: {
|
|
181
181
|
src: string;
|
|
182
|
-
imageType: "pageFigure" | "itemFigure"
|
|
182
|
+
imageType: "pageFigure" | "itemFigure";
|
|
183
183
|
}[];
|
|
184
184
|
};
|
|
185
185
|
} | {
|
|
@@ -216,7 +216,7 @@ declare const t: z.ZodObject<{
|
|
|
216
216
|
}[];
|
|
217
217
|
images: {
|
|
218
218
|
src: string;
|
|
219
|
-
imageType: "pageFigure" | "itemFigure"
|
|
219
|
+
imageType: "pageFigure" | "itemFigure";
|
|
220
220
|
}[];
|
|
221
221
|
};
|
|
222
222
|
} | {
|
|
@@ -48,7 +48,7 @@ const inputSchema = {
|
|
|
48
48
|
text: zod_1.z.string(),
|
|
49
49
|
})),
|
|
50
50
|
images: zod_1.z.array(zod_1.z.object({
|
|
51
|
-
imageType: zod_1.z.enum(["pageFigure", "itemFigure"
|
|
51
|
+
imageType: zod_1.z.enum(["pageFigure", "itemFigure"]), // 先不要背景
|
|
52
52
|
src: zod_1.z.string(),
|
|
53
53
|
})),
|
|
54
54
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OutlineContent } from "../../types/outline";
|
|
2
|
-
import { PPTElement, Slide, TextType } from "../../types/slide";
|
|
2
|
+
import { PPTElement, Slide, TextType, ImageType } from "../../types/slide";
|
|
3
3
|
export declare const checkTextType: (el: PPTElement, type: TextType) => boolean | undefined;
|
|
4
|
-
export declare const checkImageType: (el: PPTElement) =>
|
|
4
|
+
export declare const checkImageType: (el: PPTElement, type?: ImageType) => boolean | ImageType | undefined;
|
|
5
5
|
export declare const getUseableTemplates: (templates: Slide[], n: number, type: TextType) => Slide[];
|
|
6
6
|
/** 确定使用的内容模版 */
|
|
7
7
|
export declare const getUseableContentTemplates: (templates: Slide[], outlineItem: OutlineContent) => Slide[];
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getUseableContentTemplates = exports.getUseableTemplates = exports.checkImageType = exports.checkTextType = void 0;
|
|
7
|
-
const logger_1 = __importDefault(require("../../utils/logger"));
|
|
8
4
|
const checkTextType = (el, type) => {
|
|
9
5
|
return ((el.type === "text" && el.textType === type) ||
|
|
10
6
|
(el.type === "shape" && el.text && el.text.type === type));
|
|
11
7
|
};
|
|
12
8
|
exports.checkTextType = checkTextType;
|
|
13
|
-
const checkImageType = (el) => {
|
|
14
|
-
return
|
|
9
|
+
const checkImageType = (el, type) => {
|
|
10
|
+
return type
|
|
11
|
+
? el.type === "image" && el.imageType === type
|
|
12
|
+
: el.type === "image" && el.imageType;
|
|
15
13
|
};
|
|
16
14
|
exports.checkImageType = checkImageType;
|
|
17
15
|
const getUseableTemplates = (templates, n, type) => {
|
|
@@ -88,8 +86,6 @@ const getUseableContentTemplates = (templates, outlineItem) => {
|
|
|
88
86
|
const targetLen = target.elements.filter((el) => (0, exports.checkImageType)(el)).length;
|
|
89
87
|
return len === targetLen;
|
|
90
88
|
});
|
|
91
|
-
logger_1.default.info("target::" + target);
|
|
92
|
-
logger_1.default.info("result::" + result);
|
|
93
89
|
return result;
|
|
94
90
|
};
|
|
95
91
|
exports.getUseableContentTemplates = getUseableContentTemplates;
|
package/dist/types/outline.d.ts
CHANGED