diff --git a/plugins/index.json b/plugins/index.json index af5ff5f..e9fe08c 100644 --- a/plugins/index.json +++ b/plugins/index.json @@ -55,9 +55,9 @@ "dir": "promptlib", "main": "main.js", "style": "styles.css", - "version": "1.14.15", + "version": "1.14.16", "files": { - "main.js": "1358d8fb185577e67a928b4f79a15215c726fba53ade39860d1d2e299697e4cc", + "main.js": "fb35d555858fd7116d5c30adc6521f6bdb17a0f901568b06cbcb3f1dd7c302dd", "styles.css": "a086b172cc8261b9f346e612b5f76cc085d5a1e486657d0c656cb87c675f238c" } }, diff --git a/plugins/promptlib/main.js b/plugins/promptlib/main.js index 89508e3..3bb844d 100644 --- a/plugins/promptlib/main.js +++ b/plugins/promptlib/main.js @@ -1597,7 +1597,11 @@ // 分享入库:剪贴板导入与文件导入共用,避免两套逻辑跑偏。 function importShareItem (item) { var name = String(item.name || '').trim() || ('导入的提示词 ' + String(item.text).slice(0, 8) + '…') - var incoming = normalize({ id: uid('q'), name: name, text: item.text, group: String(item.group || ''), tags: item.tags || [] }) + // 2026-12-05:分享里带了 vars(key/名称/内容/说明),导入时必须整段交给 normalize; + // 否则 varsOf 回落 detectVars(text) —— 正文 {} 里是内容原文 ⇒ 名称变成内容、同内容变量被去重合并。 + var incoming = normalize({ id: uid('q'), name: name, text: item.text, + vars: Array.isArray(item.vars) ? item.vars : [], + group: String(item.group || ''), tags: item.tags || [] }) var cv = item.cover var ready = (typeof cv === 'string' && cv.indexOf('data:') === 0 && FILEAPI) ? Promise.resolve(FILEAPI.put(coverFileName(cv), cv)).then(function (res) { return res && res.ok ? Object.assign({}, incoming, { cover: { img: coverFileName(cv) } }) : incoming }).catch(function () { return incoming }) @@ -2270,7 +2274,7 @@ global.IWBPluginHost.register({ id: 'promptlib', name: '提示词库', - version: '1.14.15', + version: '1.14.16', apiVersion: 1, capabilities: ['panels', 'promptlib', 'nodeTypes', 'canvas', 'canvasWrite', 'nodeActions', 'commands'], data: { schemaVersion: 3, maxBytes: 4 * 1024 * 1024 }, diff --git a/plugins/promptlib/manifest.json b/plugins/promptlib/manifest.json index 82b59c5..ab9d2e6 100644 --- a/plugins/promptlib/manifest.json +++ b/plugins/promptlib/manifest.json @@ -1,7 +1,7 @@ { "id": "promptlib", "name": "提示词库", - "version": "1.14.15", + "version": "1.14.16", "apiVersion": 1, "main": "main.js", "style": "styles.css", @@ -13,7 +13,7 @@ "提示词" ], "files": { - "main.js": "1358d8fb185577e67a928b4f79a15215c726fba53ade39860d1d2e299697e4cc", + "main.js": "fb35d555858fd7116d5c30adc6521f6bdb17a0f901568b06cbcb3f1dd7c302dd", "styles.css": "a086b172cc8261b9f346e612b5f76cc085d5a1e486657d0c656cb87c675f238c" } } diff --git a/site/dev/index.html b/site/dev/index.html index 22231c8..c6b1b6e 100644 --- a/site/dev/index.html +++ b/site/dev/index.html @@ -3,7 +3,7 @@ 插件开发规范 · Image Workbench - +