@lemonppt/cli 1.0.1 → 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.
- package/dist/index.js +10 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -122,10 +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/';
|
|
136
|
+
window.__lemonPPT_goal = ${JSON.stringify(goal)};
|
|
128
137
|
window.__lemonPPT_editorData = ${JSON.stringify(data)};
|
|
138
|
+
window.__lemonPPT_layoutSchemas = ${JSON.stringify(layoutSchemas)};
|
|
129
139
|
</script>`;
|
|
130
140
|
editorHtml = editorHtml.replace('</head>', `${embeddedData}\n</head>`);
|
|
131
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.
|
|
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.
|
|
35
|
-
"@lemonppt/core": "1.0.
|
|
36
|
-
"@lemonppt/
|
|
37
|
-
"@lemonppt/
|
|
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",
|