dsh-ppt 0.20.7 → 0.21.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.
- package/CHANGELOG.md +11 -0
- package/README.en.md +22 -3
- package/README.md +22 -3
- package/lib/client.js +1956 -160
- package/lib/index.d.ts +1 -0
- package/lib/index.js +10 -4
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface PptPluginContext {
|
|
|
15
15
|
logger?: {
|
|
16
16
|
warn?(message: string): void;
|
|
17
17
|
};
|
|
18
|
+
effect?(fn: () => () => void): unknown;
|
|
18
19
|
on?(event: string, listener: () => void): () => void;
|
|
19
20
|
inject?(services: string[], callback: (ctx: any) => void): unknown;
|
|
20
21
|
}
|
package/lib/index.js
CHANGED
|
@@ -63,11 +63,17 @@ export function apply(ctx, config = {}) {
|
|
|
63
63
|
return result;
|
|
64
64
|
} }));
|
|
65
65
|
}
|
|
66
|
+
let cleaned = false;
|
|
67
|
+
const cleanup = () => {
|
|
68
|
+
if (cleaned)
|
|
69
|
+
return;
|
|
70
|
+
cleaned = true;
|
|
71
|
+
for (const dispose of disposers.splice(0).reverse())
|
|
72
|
+
dispose();
|
|
73
|
+
};
|
|
74
|
+
ctx.effect?.(() => cleanup);
|
|
66
75
|
if (typeof ctx.on === 'function') {
|
|
67
|
-
ctx.on('dispose',
|
|
68
|
-
for (const dispose of disposers)
|
|
69
|
-
dispose();
|
|
70
|
-
});
|
|
76
|
+
ctx.on('dispose', cleanup);
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
export { resolvePptConfig, PPT_OUTPUT_DIR_ENV, DEFAULT_MAX_SLIDES, clampInt } from './config.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ppt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "给出材料,拿到可以交付的演示文稿。 可直接下载成品 欢迎提交 issues 和 PR。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"csv-parse": "6.1.0",
|
|
87
87
|
"fflate": "0.8.3",
|
|
88
88
|
"jsep": "1.4.0",
|
|
89
|
-
"@stardustlc/dsh-updates": "0.
|
|
89
|
+
"@stardustlc/dsh-updates": "0.2.0"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@deepseek-ai/libreoffice-kit": "0.1.5 || 0.2.3"
|