From 054db215cd1b024ae50ab3be1870418cd26aef9b Mon Sep 17 00:00:00 2001 From: qiqi Date: Tue, 24 Nov 2026 14:25:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(plugins):=20=E5=90=8C=E6=AD=A5=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=8D=E5=BA=93=20promptlib=20v1.10.1=EF=BC=88?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=B0=81=E9=9D=A2=E5=BC=80=E5=85=B3=20+=20?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=AB=96=E5=90=91=E5=88=86=E5=89=B2=E7=BA=BF?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/index.json | 6 +++--- plugins/promptlib/main.js | 26 +++++++------------------- plugins/promptlib/manifest.json | 6 +++--- plugins/promptlib/styles.css | 5 +++++ 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/plugins/index.json b/plugins/index.json index 35c4a77..299302c 100644 --- a/plugins/index.json +++ b/plugins/index.json @@ -44,10 +44,10 @@ "dir": "promptlib", "main": "main.js", "style": "styles.css", - "version": "1.10.0", + "version": "1.10.1", "files": { - "main.js": "8c9ddb2fbb7888d6c85c5a727e45bc11f83d2c1450e3cdf99675ba3439e6ad9b", - "styles.css": "2c01c56012cde646362e871dbf463f1ac08d873fcb1afb644e37b082d01178fd" + "main.js": "41d73c02cf4791312d0b922b572ff991a83341aabe3a000a84e9b249e77afac8", + "styles.css": "1ff5e60079166968cfaed95c875a1347884d5476090419491e317cdec2c4e6cd" } }, { diff --git a/plugins/promptlib/main.js b/plugins/promptlib/main.js index 4a8034b..2d1f716 100644 --- a/plugins/promptlib/main.js +++ b/plugins/promptlib/main.js @@ -162,20 +162,8 @@ if (!item || typeof item.text !== 'string' || !item.text.trim()) return null return item } - // 分享是否附带封面图:后台设置页开关,默认带图(兼容老行为);关掉后分享文本只有文字,短很多。 - // 从 ctx.settings 读,manifest 里声明了 default:true —— 老客户端/未设置时也按“带图”走。 - function shareWithCover () { - var S = (PLP_CTX || {}).settings - return !S || typeof S.get !== 'function' || S.get('shareWithCover') !== false - } - function plpSharePayload (p) { - var body = { app: 'image-workbench', kind: 'prompt-share', version: 1, sharing: { name: p.name || '', text: p.text || '', vars: detectVars(p.text || ''), group: p.group || '', tags: p.tags || [] } } - if (!shareWithCover()) return Promise.resolve(SHARE_TAG + '\n' + JSON.stringify(body)) - return plpCoverUrl(p).then(function (cv) { - if (cv && cv.length < 300000) body.sharing.cover = cv - return SHARE_TAG + '\n' + JSON.stringify(body) - }) - } + // v1.10.1:分享封面开关已移除——文本分享恒纯文字、文件分享恒带封面,不再有全局开关。 + // (旧的 shareWithCover() / plpSharePayload() 已删除;plpCoverUrl 仍供备份导出使用。) function renderPluginSettings () { var root = el('div', { class: 'iwb-plp-settings' }) @@ -1277,10 +1265,10 @@ // 分享格式刻意做成「可读的 JSON 文本」,直接粘到微信/QQ 也能看懂;导入时两种都认: // ① 带 IWB-PROMPT 头的整段文本 ② 直接是 {kind:'prompt-share'} 的 JSON // v1.10.0:withCover 显式传入——文本分享恒传 false(纯文字、短),文件分享传 true(封面放文件里不怕大)。 - // 不传时仍读后台 shareWithCover 开关(兼容旧调用/旧设置)。 + // v1.10.1:开关已删,只认显式布尔;未传一律按纯文字,不再回退读设置。 function sharePayload (p, withCover) { var body = { app: 'image-workbench', kind: 'prompt-share', version: 1, sharing: { name: p.name || '', text: p.text || '', vars: varsOf(p), group: p.group || '', tags: p.tags || [] } } - var wantCover = (typeof withCover === 'boolean') ? withCover : shareWithCover() + var wantCover = withCover === true if (!wantCover) return Promise.resolve(SHARE_TAG + '\n' + JSON.stringify(body)) return coverToDataUrl(p).then(function (cv) { if (cv && cv.length < 300000) body.sharing.cover = cv @@ -1530,7 +1518,8 @@ } footEl.appendChild(del); footEl.appendChild(el('span', { class: 'iwb-drawer-spacer' })) footEl.appendChild(shareText); footEl.appendChild(shareFile) - footEl.appendChild(el('span', { style: 'display:inline-block;width:26px;flex:none' })) + // v1.10.1:分享组与插入组之间加竖向分割线(替代原来的 26px 空白)。 + footEl.appendChild(el('span', { class: 'iwb-plp-foot-vsep' })) footEl.appendChild(cp); if (insTpl) footEl.appendChild(insTpl) if (insImg) footEl.appendChild(insImg) footEl.appendChild(ins) @@ -1889,12 +1878,11 @@ global.IWBPluginHost.register({ id: 'promptlib', name: '提示词库', - version: '1.10.0', + version: '1.10.1', apiVersion: 1, capabilities: ['panels', 'promptlib', 'nodeTypes', 'canvas', 'canvasWrite'], data: { schemaVersion: 3, maxBytes: 4 * 1024 * 1024 }, settings: { - shareWithCover: { type: 'boolean', label: '分享时附带封面图片(关闭后分享内容更短)', default: true }, panel: { type: 'custom', label: '分组与备份', render: renderPluginSettings }, }, }, function (ctx) { diff --git a/plugins/promptlib/manifest.json b/plugins/promptlib/manifest.json index 5962a02..ca1e817 100644 --- a/plugins/promptlib/manifest.json +++ b/plugins/promptlib/manifest.json @@ -1,7 +1,7 @@ { "id": "promptlib", "name": "提示词库", - "version": "1.10.0", + "version": "1.10.1", "apiVersion": 1, "main": "main.js", "style": "styles.css", @@ -13,7 +13,7 @@ "提示词" ], "files": { - "main.js": "8c9ddb2fbb7888d6c85c5a727e45bc11f83d2c1450e3cdf99675ba3439e6ad9b", - "styles.css": "2c01c56012cde646362e871dbf463f1ac08d873fcb1afb644e37b082d01178fd" + "main.js": "41d73c02cf4791312d0b922b572ff991a83341aabe3a000a84e9b249e77afac8", + "styles.css": "1ff5e60079166968cfaed95c875a1347884d5476090419491e317cdec2c4e6cd" } } diff --git a/plugins/promptlib/styles.css b/plugins/promptlib/styles.css index 4fea94d..017f51c 100644 --- a/plugins/promptlib/styles.css +++ b/plugins/promptlib/styles.css @@ -348,6 +348,11 @@ height: 1px; margin: 4px 6px; background: var(--iwb-border); flex: 0 0 auto; .iwb-promptlib .iwb-drawer-spacer { flex: 1 1 auto; } +/* v1.10.1:详情底部分享组(文本/文件分享)与插入组之间的竖向分割线 */ +.iwb-plp-dialog .iwb-plp-foot-vsep { +display: inline-block; width: 1px; height: 18px; flex: 0 0 auto; +align-self: center; margin: 0 13px; background: var(--iwb-border); +} .iwb-plp-dialog .iwb-section-sub { margin-top: 2px; }