@lemonppt/cli 1.0.2 → 1.0.4

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 (2) hide show
  1. package/dist/index.js +9 -0
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -122,11 +122,20 @@ export async function renderGoalToDir(goal, options = {}) {
122
122
  // 静态文件模式下使用相对资源路径
123
123
  editorHtml = editorHtml.replace(/\/deck\/assets\//g, './assets/');
124
124
  editorHtml = editorHtml.replace(/src="\/editor\.js"/g, 'src="./editor.js"');
125
+ // 收集当前 goal 用到的版式 Schema,注入 editor-script 以在属性面板显示中文标签和数组控件
126
+ const layoutIds = [...new Set(goal.slides.map((s) => s.layout))];
127
+ const layoutSchemas = {};
128
+ for (const id of layoutIds) {
129
+ const schema = getLayoutSchema(id);
130
+ if (schema)
131
+ layoutSchemas[id] = schema;
132
+ }
125
133
  // 内嵌 EditorData,让 editor.js 在静态模式下无需请求 API
126
134
  const embeddedData = `<script>
127
135
  window.__lemonPPT_assetsBase = './assets/';
128
136
  window.__lemonPPT_goal = ${JSON.stringify(goal)};
129
137
  window.__lemonPPT_editorData = ${JSON.stringify(data)};
138
+ window.__lemonPPT_layoutSchemas = ${JSON.stringify(layoutSchemas)};
130
139
  </script>`;
131
140
  editorHtml = editorHtml.replace('</head>', `${embeddedData}\n</head>`);
132
141
  const indexPath = path.join(outputDir, 'editor.html');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemonppt/cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -31,10 +31,10 @@
31
31
  },
32
32
  "homepage": "https://github.com/lemonforme/lemonPPT#readme",
33
33
  "dependencies": {
34
- "@lemonppt/agent-prompts": "1.0.2",
35
- "@lemonppt/core": "1.0.2",
36
- "@lemonppt/renderer": "1.0.2",
37
- "@lemonppt/themes": "1.0.2"
34
+ "@lemonppt/agent-prompts": "1.0.4",
35
+ "@lemonppt/core": "1.0.4",
36
+ "@lemonppt/renderer": "1.0.4",
37
+ "@lemonppt/themes": "1.0.4"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^20.0.0",