chore(plugins): promptlib 1.4.2 自带样式(不依赖宿主注入)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 52s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 52s
This commit is contained in:
1 parent
774b980f69
commit
a3edc81f55
3 files changed
+18
-5
No files matched your search
+2
-2
@@ -44,9 +44,9 @@
|
||||
"dir": "promptlib",
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"files": {
|
||||
"main.js": "c8737ff05837b1ff845e6416e7ee634d4d025c4b69e8789631d667735593c213",
|
||||
"main.js": "62e09d2e882addf28d379e66167e2f95ffd4b10b8eb0795d3c8ebf0a093edf4d",
|
||||
"styles.css": "c0bbcb3274c98a62465e10090102fdcbd86d645ffdaf258db8732ca90a91d555"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -134,6 +134,19 @@
|
||||
step()
|
||||
}
|
||||
|
||||
var PLP_CSS = '/* promptlib(提示词库)自带样式\n 作用域全部带 .iwb-plp-*,不影响宿主与其他插件;样式随插件发布,不必等客户端发版。 */\n\n/* 分组胶囊「适应面板宽度」自动换行。\n 宿主的 .iwb-lib-chips 是 flex-wrap: nowrap(配 .iwb-lib-chips-scroll 做单行横向滚动 + 右侧渐隐),\n 分组多时靠后的分类看不见也点不到。双类选择器提高优先级(不依赖样式注入顺序)。 */\n.iwb-lib-chips.iwb-plp-chips {\n flex-wrap: wrap;\n row-gap: 6px;\n}\n\n/* + / ⚙ 是动作按钮,不是分组名:不参与压缩,并与最后一个分组稍作分隔 */\n.iwb-plp-chips .iwb-plp-add {\n flex: 0 0 auto;\n margin-left: 2px;\n}\n\n/* v1.0.2(2026-11-21):卡片化 —— 白卡 + 悬停 + 文本三行截断。\n 颜色一律走宿主 --iwb-plugin-* / --iwb-* token,不在插件里写死。 */\n.iwb-promptlib .iwb-pname { font-weight: 600; }\n.iwb-promptlib .iwb-ptext {\n display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;\n overflow: hidden; color: var(--iwb-text2, #4d5668);\n}\n.iwb-promptlib .iwb-lib-cards { gap: 8px; }\n\n/* v1.1.0(2026-11-21):封面网格 + 长文详情 + 宽编辑弹窗。\n 颜色全部走宿主 token,不写死。 */\n.iwb-plp-card {\n position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;\n aspect-ratio: 1 / 1; border: 1px solid var(--iwb-border, #d5d9e0);\n transition: border-color .12s ease, transform .12s ease;\n}\n.iwb-plp-card:hover { border-color: var(--iwb-border2, #b9bfca); }\n.iwb-plp-cover { width: 100%; height: 100%; object-fit: cover; display: block; }\n.iwb-plp-t {\n position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 7px 6px;\n background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.66));\n color: #fff; font-size: 10.5px; line-height: 1.35; max-height: 48%;\n display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;\n text-shadow: 0 1px 2px rgba(0,0,0,.35);\n}\n/* 详情:长文阅读 */\n.iwb-plp-dhead { display: flex; align-items: center; gap: 6px; padding: 2px 0 8px; position: sticky; top: 0; z-index: 2; background: var(--iwb-plugin-surface, #fafafb); }\n.iwb-plp-dtop { align-items: flex-start; gap: 10px; margin-bottom: 8px; }\n.iwb-plp-dthumb { flex: 0 0 84px; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--iwb-border, #d5d9e0); }\n.iwb-plp-dmeta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }\n.iwb-plp-dtitle { font-size: 13px; font-weight: 600; color: var(--iwb-text, #1c2333); line-height: 1.45; }\n.iwb-plp-dtext {\n font-size: 12px; line-height: 1.75; color: var(--iwb-text2, #4d5668);\n white-space: pre-wrap; word-break: break-word; padding: 4px 0 12px;\n}\n.iwb-plp-dfoot { display: flex; align-items: center; gap: 6px; padding: 8px 0 2px; position: sticky; bottom: 0; background: var(--iwb-plugin-surface, #fafafb); }\n/* 编辑弹窗:760 宽 + 大文本框 */\n.iwb-promptlib-editor { width: 760px; max-width: 94vw; }\n.iwb-promptlib-editor .iwb-modal-body { max-height: 78vh; }\n.iwb-promptlib-text { min-height: 360px; height: 44vh; font-size: 12.5px; line-height: 1.9; resize: vertical; }\n.iwb-plp-editor-cover { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }\n.iwb-plp-editor-thumb { flex: 0 0 96px; width: 96px; height: 128px; border-radius: 8px; overflow: hidden; border: 1px solid var(--iwb-border, #d5d9e0); }\n.iwb-plp-editor-coverops { display: flex; flex-direction: column; gap: 8px; }\n\n/* v1.2.0:可拖动 / 可缩放的详情与编辑弹窗(同宽 880×640,最小 640×420) */\n.iwb-plp-mask { background: transparent; display: block; }\n.iwb-plp-dialog { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px;\n box-shadow: 0 24px 60px rgba(0,0,0,.28); }\n.iwb-plp-dhead { display: flex; align-items: center; gap: 6px; padding: 10px 14px;\n border-bottom: 1px solid var(--iwb-border, #d5d9e0); cursor: move; user-select: none; }\n.iwb-plp-grip { display: grid; grid-template-columns: repeat(3, 3px); gap: 2px; margin-right: 6px; }\n.iwb-plp-grip i { width: 3px; height: 3px; border-radius: 50%; background: var(--iwb-border2, #b9bfca); display: block; }\n.iwb-plp-dbody { flex: 1 1 auto; min-height: 0; display: flex; gap: 14px; padding: 14px; }\n.iwb-plp-dcov { flex: 0 0 210px; width: 210px; height: 280px; border-radius: 10px; overflow: hidden;\n border: 1px solid var(--iwb-border, #d5d9e0); background: var(--iwb-plugin-inset, #f5f6f7); }\n.iwb-plp-dright { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }\n.iwb-plp-dtext { flex: 1 1 auto; min-height: 0; overflow: auto; white-space: pre-wrap; word-break: break-word;\n font-size: 12px; line-height: 1.9; color: var(--iwb-text2, #4d5668); }\n.iwb-plp-dfooter { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 14pLine truncated
|
||||
// v1.4.2:自带样式(不再依赖宿主注入 styles.css)—— 宿主样式加载失败时也能正确排版
|
||||
function ensureStyle () {
|
||||
try {
|
||||
if (document.querySelector('style[data-plugin="promptlib-inline"]')) return
|
||||
var n = document.createElement('style')
|
||||
n.setAttribute('data-plugin', 'promptlib-inline')
|
||||
n.textContent = PLP_CSS
|
||||
document.head.appendChild(n)
|
||||
} catch (e) { /* ignore */ }
|
||||
}
|
||||
ensureStyle()
|
||||
|
||||
// ---- 搜索 / 过滤 ----
|
||||
function words () { return query.trim().toLowerCase().split(/\s+/).filter(Boolean) }
|
||||
function matches (p) {
|
||||
@@ -716,7 +729,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'promptlib',
|
||||
name: '提示词库',
|
||||
version: '1.4.1',
|
||||
version: '1.4.2',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'promptlib'],
|
||||
data: { schemaVersion: 1, maxBytes: 65536 },
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "promptlib",
|
||||
"name": "提示词库",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"apiVersion": 1,
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
@@ -13,7 +13,7 @@
|
||||
"提示词"
|
||||
],
|
||||
"files": {
|
||||
"main.js": "c8737ff05837b1ff845e6416e7ee634d4d025c4b69e8789631d667735593c213",
|
||||
"main.js": "62e09d2e882addf28d379e66167e2f95ffd4b10b8eb0795d3c8ebf0a093edf4d",
|
||||
"styles.css": "c0bbcb3274c98a62465e10090102fdcbd86d645ffdaf258db8732ca90a91d555"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user