dsh-plugin-zotero 0.6.8 → 0.6.9
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/client/client.js +44 -10
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -2302,6 +2302,27 @@ const TAG_BUTTON_CLASS = "dsh-zp-tag";
|
|
|
2302
2302
|
function tagButtonClass(selected = false) {
|
|
2303
2303
|
return selected ? `${TAG_BUTTON_CLASS} is-selected` : TAG_BUTTON_CLASS;
|
|
2304
2304
|
}
|
|
2305
|
+
/**
|
|
2306
|
+
* 条目类型图标的 class:配色向 Zotero 7 的 item-type 图标靠拢。
|
|
2307
|
+
*
|
|
2308
|
+
* Zotero 的普通条目是白纸 + 近黑的灰线(#444444),只有书(#4072E5 蓝)、
|
|
2309
|
+
* 笔记(#FAA700 黄)、附件(#DB2C3A 红)带特征色。这里沿用这四支色,
|
|
2310
|
+
* 但仍用自己的单线描边画法:不复制官方 SVG、不铺纸面底色。
|
|
2311
|
+
* 已读态不用粉色,改去饱和 + 淡化,避免整列图标泛彩。
|
|
2312
|
+
*/
|
|
2313
|
+
const ITEM_ICON_CLASS = "dsh-zp-item-icon";
|
|
2314
|
+
/** 只有这三个家族带 Zotero 特征色,其余一律墨色。 */
|
|
2315
|
+
const ITEM_ICON_ACCENT_FAMILIES = /* @__PURE__ */ new Set([
|
|
2316
|
+
"book",
|
|
2317
|
+
"note",
|
|
2318
|
+
"attachment"
|
|
2319
|
+
]);
|
|
2320
|
+
function itemTypeIconClass(family, read = false) {
|
|
2321
|
+
const parts = [ITEM_ICON_CLASS];
|
|
2322
|
+
if (ITEM_ICON_ACCENT_FAMILIES.has(family)) parts.push(`is-${family}`);
|
|
2323
|
+
if (read) parts.push("is-read");
|
|
2324
|
+
return parts.join(" ");
|
|
2325
|
+
}
|
|
2305
2326
|
/** 全局主题样式:只在入口注入一次,portal / 浮层里的按钮同样生效。 */
|
|
2306
2327
|
const THEME_CSS = `
|
|
2307
2328
|
.dsh-zp-soft-btn {
|
|
@@ -2338,6 +2359,26 @@ const THEME_CSS = `
|
|
|
2338
2359
|
.dsh-zp-tag.is-selected:active {
|
|
2339
2360
|
background-color: #404040 !important;
|
|
2340
2361
|
}
|
|
2362
|
+
/* 条目类型图标:近黑墨色为主,只有书 / 笔记 / 附件留 Zotero 特征色。
|
|
2363
|
+
先给宿主文字色兜底,再用 light-dark() 做深浅两套;老浏览器退成墨色。 */
|
|
2364
|
+
.dsh-zp-item-icon {
|
|
2365
|
+
color: var(--dsw-alias-label-primary, #3b3b3b);
|
|
2366
|
+
color: light-dark(#3b3b3b, #d0d0d0);
|
|
2367
|
+
opacity: 0.95;
|
|
2368
|
+
}
|
|
2369
|
+
.dsh-zp-item-icon.is-book {
|
|
2370
|
+
color: light-dark(#4072e5, #8eaef5);
|
|
2371
|
+
}
|
|
2372
|
+
.dsh-zp-item-icon.is-note {
|
|
2373
|
+
color: light-dark(#b87b06, #eeb23c);
|
|
2374
|
+
}
|
|
2375
|
+
.dsh-zp-item-icon.is-attachment {
|
|
2376
|
+
color: light-dark(#d32f3c, #f0727a);
|
|
2377
|
+
}
|
|
2378
|
+
.dsh-zp-item-icon.is-read {
|
|
2379
|
+
opacity: 0.5;
|
|
2380
|
+
filter: grayscale(1);
|
|
2381
|
+
}
|
|
2341
2382
|
.dsh-zp-title {
|
|
2342
2383
|
display: inline-flex;
|
|
2343
2384
|
align-items: center;
|
|
@@ -4181,12 +4222,8 @@ const PATH = {
|
|
|
4181
4222
|
note: "M4.5 3h7v10h-7z M4.5 5.6h7 M6.6 7.9h3.3 M6.6 9.9h3.3",
|
|
4182
4223
|
attachment: "M9.6 3.5 4.9 8.2a1.9 1.9 0 0 0 2.7 2.7l4.7-4.7a3 3 0 0 0-4.2-4.2L3.4 6.7a4.2 4.2 0 0 0 5.9 5.9l1.2-1.2"
|
|
4183
4224
|
};
|
|
4184
|
-
/** 已读图标的粉色:不用主题蓝,蓝色容易被读成「未读消息」徽标。 */
|
|
4185
|
-
const READ_ICON_COLOR = "#e8798d";
|
|
4186
|
-
/** 未读图标用 Zotero 蓝:列表行里比中性灰更醒目,也与树、按钮同一支蓝。 */
|
|
4187
|
-
const ICON_COLOR = "#4a86e8";
|
|
4188
4225
|
/**
|
|
4189
|
-
*
|
|
4226
|
+
* 条目类型图标;未知类型显示文档图标,已读条目去饱和并淡化。
|
|
4190
4227
|
* 无底衬,默认 22px(比 Zotero 原生 16px 放大,列表里才看得清)。
|
|
4191
4228
|
*/
|
|
4192
4229
|
function ItemTypeIcon({ itemType, read = false, size = 22 }) {
|
|
@@ -4197,13 +4234,10 @@ function ItemTypeIcon({ itemType, read = false, size = 22 }) {
|
|
|
4197
4234
|
viewBox: "0 0 16 16",
|
|
4198
4235
|
fill: "none",
|
|
4199
4236
|
stroke: "currentColor",
|
|
4200
|
-
strokeWidth: 1.
|
|
4237
|
+
strokeWidth: 1.2,
|
|
4201
4238
|
strokeLinejoin: "round",
|
|
4202
4239
|
strokeLinecap: "round",
|
|
4203
|
-
|
|
4204
|
-
opacity: read ? .95 : .9,
|
|
4205
|
-
color: read ? READ_ICON_COLOR : ICON_COLOR
|
|
4206
|
-
},
|
|
4240
|
+
className: itemTypeIconClass(family, read),
|
|
4207
4241
|
"aria-hidden": true,
|
|
4208
4242
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: PATH[family] })
|
|
4209
4243
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-zotero",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"description": "Map your Zotero library into DSH: let AI operate Zotero for you and help you read papers. Browse collections and tags in the sidebar, read PDFs with highlights in place, and cite excerpts, annotations, notes or whole items into the chat. The model works from the source text for reviews, comparisons and data extraction, and can also search and organize the library, import papers and attach translations back to items; first use needs the Zotero MCP plugin and the local API enabled.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|