dsh-plugin-zotero 0.9.0 → 0.9.1

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.
Files changed (2) hide show
  1. package/client/client.js +21 -0
  2. package/package.json +1 -1
package/client/client.js CHANGED
@@ -5017,6 +5017,23 @@ const INSIDE_MIN_WIDTH = 160;
5017
5017
  /** 拖宽的硬上限,再宽只是白白盖住正文。 */
5018
5018
  const RESIZE_MAX_WIDTH = 720;
5019
5019
  /**
5020
+ * 面板根节点上的「别拖窗口」声明。
5021
+ *
5022
+ * macOS 宿主的窗口拖拽区是**几何矩形**,不是命中测试:它给整行 chrome 打
5023
+ * `data-window-drag`(对话头部、侧栏顶条、dockkit tabStrip …),浮层只要在几何上
5024
+ * 压住那一行,那段像素就归窗口拖拽 —— 谁画在上层、有没有 pointer capture 都不算数。
5025
+ * 于是把浮层拖到 y≈22(压到对话头部那行)后按住标题栏,动的是整个 DSH 窗口,
5026
+ * 浮层反而拖不动了。
5027
+ *
5028
+ * 宿主留的出口是 `[data-window-drag-exclude]{-webkit-app-region:no-drag}`(base.css),
5029
+ * 且 0.2.2-rc.1 起 `role="dialog"` 之类只在 `data-window-drag` / `-controls` 作用域内
5030
+ * 才自动豁免 no-drag —— 浮层在阅读区里,拿不到那份豁免,必须自己声明。挂了它,
5031
+ * 浮层的整个矩形从拖拽区里被减掉:无论拖到窗口哪儿,按下的都是浮层自己。
5032
+ *
5033
+ * 译文浮层(`viewer/TranslationCard`)压在正文上,会碰到同一行带子,共用这一份。
5034
+ */
5035
+ const WINDOW_DRAG_EXCLUDE = { "data-window-drag-exclude": "" };
5036
+ /**
5020
5037
  * 最近一次「摆到右栏外看得见吗」的结论,只用作下次打开的起点。
5021
5038
  *
5022
5039
  * 早先这里是「一次失败就整个会话锁死在右栏内」:拖动中取样点偶尔被别的元素
@@ -5272,6 +5289,7 @@ function useFloatingBox(options) {
5272
5289
  width: size?.width ?? layout.width,
5273
5290
  ...size === null ? { maxHeight: layout.maxHeight } : { height: size.height }
5274
5291
  },
5292
+ panelProps: WINDOW_DRAG_EXCLUDE,
5275
5293
  moveProps: {
5276
5294
  onPointerDown: (event) => beginDrag("move", event),
5277
5295
  onPointerMove: handleDrag,
@@ -6414,6 +6432,7 @@ function InfoPanel({ t, detail, currentAttachmentKey, open, onToggle, onClose, o
6414
6432
  ref: box.panelRef,
6415
6433
  role: "dialog",
6416
6434
  "aria-label": t("detail.info"),
6435
+ ...box.panelProps,
6417
6436
  style: {
6418
6437
  ...panelStyle$1,
6419
6438
  ...box.style
@@ -6972,6 +6991,7 @@ function OutlinePanel({ t, itemKey, items, sourceLabel, activeIndex, open, onTog
6972
6991
  ref: box.panelRef,
6973
6992
  role: "dialog",
6974
6993
  "aria-label": t("outline.title"),
6994
+ ...box.panelProps,
6975
6995
  style: {
6976
6996
  ...panelStyle,
6977
6997
  ...box.style
@@ -32142,6 +32162,7 @@ function TranslationCard({ t, view, bounds, engine, onEngineChange, onClose, onR
32142
32162
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
32143
32163
  ref: cardRef,
32144
32164
  [MARK]: "",
32165
+ ...WINDOW_DRAG_EXCLUDE,
32145
32166
  style: {
32146
32167
  ...cardStyle,
32147
32168
  width: size.width,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-zotero",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
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",