dsh-ppt 0.20.8 → 0.21.1

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/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,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-ppt",
3
- "version": "0.20.8",
4
- "description": "给出材料,拿到可以交付的演示文稿。 可直接下载成品 欢迎提交 issues 和 PR。",
3
+ "version": "0.21.1",
4
+ "description": "DeepSeek Harness 演示文稿生成与编辑工作台:输入材料即可导出离线 HTML 放映、可编辑 PPTX 与工程包,支持按页编辑、数据推演与预审演练,以及原生清透 / 米白纸感 / Claude 暖书卷 / 8-Bit 像素 / 晴空薄荷五套明亮工作台主题。欢迎提交 issues 和 PR。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -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.2.0"
89
+ "@stardustlc/dsh-updates": "0.2.1"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@deepseek-ai/libreoffice-kit": "0.1.5 || 0.2.3"