feat(plugins): 同步提示词库 promptlib v1.10.1(移除封面开关 + 详情竖向分割线)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 46s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 46s
This commit is contained in:
1 parent
b34b936d2e
commit
054db215cd
4 files changed
+18
-25
No files matched your search
+3
-3
@@ -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"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user