dsh-talk-map 0.1.35 → 0.1.37

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 +32 -64
  2. package/package.json +1 -1
package/client/client.js CHANGED
@@ -10727,22 +10727,6 @@ if (typeof document !== "undefined") {
10727
10727
  }
10728
10728
  }
10729
10729
 
10730
- // src/client/colors.ts
10731
- var COLOR_TAGS = [
10732
- { id: "red", swatch: "#e5484d", border: "rgba(229,72,77,0.75)", fill: "rgba(229,72,77,0.18)", faint: "rgba(229,72,77,0.05)" },
10733
- { id: "orange", swatch: "#f76b15", border: "rgba(247,107,21,0.75)", fill: "rgba(247,107,21,0.18)", faint: "rgba(247,107,21,0.05)" },
10734
- { id: "yellow", swatch: "#ffc53d", border: "rgba(255,197,61,0.75)", fill: "rgba(255,197,61,0.18)", faint: "rgba(255,197,61,0.05)" },
10735
- { id: "green", swatch: "#30a46c", border: "rgba(48,164,108,0.8)", fill: "rgba(48,164,108,0.18)", faint: "rgba(48,164,108,0.05)" },
10736
- { id: "teal", swatch: "#12a594", border: "rgba(18,165,148,0.8)", fill: "rgba(18,165,148,0.18)", faint: "rgba(18,165,148,0.05)" },
10737
- { id: "blue", swatch: "#3e63dd", border: "rgba(62,99,221,0.8)", fill: "rgba(62,99,221,0.2)", faint: "rgba(62,99,221,0.06)" },
10738
- { id: "purple", swatch: "#8e4ec6", border: "rgba(142,78,198,0.8)", fill: "rgba(142,78,198,0.18)", faint: "rgba(142,78,198,0.05)" },
10739
- { id: "gray", swatch: "#7d828d", border: "rgba(125,130,141,0.8)", fill: "rgba(125,130,141,0.16)", faint: "rgba(125,130,141,0.05)" }
10740
- ];
10741
- var byId = new Map(COLOR_TAGS.map((tag) => [tag.id, tag]));
10742
- function colorOf(tagId) {
10743
- return tagId === void 0 ? void 0 : byId.get(tagId);
10744
- }
10745
-
10746
10730
  // src/client/digest-text.ts
10747
10731
  function digestBody(digest) {
10748
10732
  const parts = [];
@@ -12880,6 +12864,22 @@ function SpawnPreview(props) {
12880
12864
  ] });
12881
12865
  }
12882
12866
 
12867
+ // src/client/colors.ts
12868
+ var COLOR_TAGS = [
12869
+ { id: "red", swatch: "#e5484d", border: "rgba(229,72,77,0.75)", fill: "rgba(229,72,77,0.18)", faint: "rgba(229,72,77,0.05)" },
12870
+ { id: "orange", swatch: "#f76b15", border: "rgba(247,107,21,0.75)", fill: "rgba(247,107,21,0.18)", faint: "rgba(247,107,21,0.05)" },
12871
+ { id: "yellow", swatch: "#ffc53d", border: "rgba(255,197,61,0.75)", fill: "rgba(255,197,61,0.18)", faint: "rgba(255,197,61,0.05)" },
12872
+ { id: "green", swatch: "#30a46c", border: "rgba(48,164,108,0.8)", fill: "rgba(48,164,108,0.18)", faint: "rgba(48,164,108,0.05)" },
12873
+ { id: "teal", swatch: "#12a594", border: "rgba(18,165,148,0.8)", fill: "rgba(18,165,148,0.18)", faint: "rgba(18,165,148,0.05)" },
12874
+ { id: "blue", swatch: "#3e63dd", border: "rgba(62,99,221,0.8)", fill: "rgba(62,99,221,0.2)", faint: "rgba(62,99,221,0.06)" },
12875
+ { id: "purple", swatch: "#8e4ec6", border: "rgba(142,78,198,0.8)", fill: "rgba(142,78,198,0.18)", faint: "rgba(142,78,198,0.05)" },
12876
+ { id: "gray", swatch: "#7d828d", border: "rgba(125,130,141,0.8)", fill: "rgba(125,130,141,0.16)", faint: "rgba(125,130,141,0.05)" }
12877
+ ];
12878
+ var byId = new Map(COLOR_TAGS.map((tag) => [tag.id, tag]));
12879
+ function colorOf(tagId) {
12880
+ return tagId === void 0 ? void 0 : byId.get(tagId);
12881
+ }
12882
+
12883
12883
  // src/client/WsFrame.tsx
12884
12884
  var import_jsx_runtime12 = require("react/jsx-runtime");
12885
12885
  var EDGE = 10;
@@ -13808,13 +13808,17 @@ function CanvasInner(props) {
13808
13808
  (0, import_react12.useEffect)(() => {
13809
13809
  if (canvasState.phase !== "ready") return;
13810
13810
  if (draggingCardId !== null || liveFrame !== null) return;
13811
- const stale = {};
13812
- for (const [cardId, point] of Object.entries(cardLayout)) {
13813
- const card = canvasState.cards[cardId];
13814
- if (card === void 0) continue;
13815
- if (card.x !== point.x || card.y !== point.y) stale[cardId] = point;
13816
- }
13817
- if (Object.keys(stale).length > 0) canvas.moveCards(stale);
13811
+ const timer4 = window.setTimeout(() => {
13812
+ const stale = {};
13813
+ for (const [cardId, point] of Object.entries(cardLayout)) {
13814
+ const card = canvasState.cards[cardId];
13815
+ if (card === void 0) continue;
13816
+ if (!Number.isFinite(point.x) || !Number.isFinite(point.y)) continue;
13817
+ if (Math.abs(card.x - point.x) > 0.5 || Math.abs(card.y - point.y) > 0.5) stale[cardId] = point;
13818
+ }
13819
+ if (Object.keys(stale).length > 0) canvas.moveCards(stale);
13820
+ }, 140);
13821
+ return () => window.clearTimeout(timer4);
13818
13822
  }, [cardLayout, canvasState.cards, canvasState.phase, draggingCardId, liveFrame]);
13819
13823
  const foldedSet = (0, import_react12.useMemo)(() => new Set(Object.values(foldedCards).flat()), [foldedCards]);
13820
13824
  (0, import_react12.useEffect)(() => {
@@ -14104,7 +14108,7 @@ function CanvasInner(props) {
14104
14108
  count: members.length,
14105
14109
  width: rect.width,
14106
14110
  height: rect.height,
14107
- ...wsColors[groupId] !== void 0 ? { colorTag: wsColors[groupId] } : {},
14111
+ // Workspace colours are not used any more: frames keep their default look.
14108
14112
  // Red outline while this folder overlaps another one mid-drag.
14109
14113
  blocked: blockedFrame === groupId,
14110
14114
  onResizeStart: (axis, event) => {
@@ -14224,17 +14228,17 @@ function CanvasInner(props) {
14224
14228
  const out = {};
14225
14229
  for (const node of liveNodes) {
14226
14230
  if (node.type !== "sessionCard" || node.hidden === true) continue;
14227
- const sessionId = canvasState.cards[node.id]?.sessionId;
14228
- const element = sessionId === void 0 ? null : document.querySelector(`[data-talkmap-session="${sessionId}"]`);
14229
14231
  out[node.id] = {
14230
14232
  x: node.position.x,
14231
14233
  y: node.position.y,
14232
- w: element?.offsetWidth ?? CARD_W,
14233
- h: element?.offsetHeight ?? CARD_H
14234
+ w: CARD_PAINTED_W,
14235
+ h: CARD_PAINTED_H
14234
14236
  };
14235
14237
  }
14236
14238
  return out;
14237
14239
  };
14240
+ const CARD_PAINTED_W = 250;
14241
+ const CARD_PAINTED_H = 129;
14238
14242
  const [boardTick, setBoardTick] = (0, import_react12.useState)(0);
14239
14243
  (0, import_react12.useEffect)(() => {
14240
14244
  const timer4 = window.setTimeout(() => setBoardTick((value) => value + 1), 150);
@@ -15304,7 +15308,6 @@ function CanvasInner(props) {
15304
15308
  }
15305
15309
  }
15306
15310
  ) : null,
15307
- !batchMode && selectedFrameWs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FrameColorToolbar, { workspaceIds: selectedFrameWs }) : null,
15308
15311
  hasContent ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: talk_map_default["emptyHint"], children: t("map.empty") }),
15309
15312
  menuState !== null ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContextMenu, { menu: menuState, onClose: () => {
15310
15313
  setMenu(null);
@@ -15369,41 +15372,6 @@ function CanvasInner(props) {
15369
15372
  }
15370
15373
  );
15371
15374
  }
15372
- function FrameColorToolbar(props) {
15373
- const apply2 = (colorTag) => {
15374
- for (const workspaceId of props.workspaceIds) canvas.setWorkspaceColor(workspaceId, colorTag);
15375
- };
15376
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: talk_map_default["colorToolbar"], role: "toolbar", "aria-label": t("color.toolbar"), children: [
15377
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: talk_map_default["colorToolbarLabel"], children: t("color.toolbar") }),
15378
- COLOR_TAGS.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15379
- "button",
15380
- {
15381
- type: "button",
15382
- className: talk_map_default["colorSwatch"],
15383
- style: { background: tag.swatch },
15384
- title: tag.id,
15385
- "aria-label": tag.id,
15386
- onClick: () => {
15387
- apply2(tag.id);
15388
- }
15389
- },
15390
- tag.id
15391
- )),
15392
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15393
- "button",
15394
- {
15395
- type: "button",
15396
- className: `${talk_map_default["colorSwatch"]} ${talk_map_default["colorSwatchClear"]}`,
15397
- title: t("color.clear"),
15398
- "aria-label": t("color.clear"),
15399
- onClick: () => {
15400
- apply2(void 0);
15401
- },
15402
- children: "×"
15403
- }
15404
- )
15405
- ] });
15406
- }
15407
15375
  function BatchBar(props) {
15408
15376
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: talk_map_default["batchBar"], role: "toolbar", "aria-label": t("batch.title"), children: [
15409
15377
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: talk_map_default["batchCount"], children: t("batch.count", { n: String(props.count) }) }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-talk-map",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "description": "Visual conversation map for DeepSeek Harness: an infinite whiteboard where every session is a card — drag to arrange, double-click to start a chat in place, draw an edge to fork a new session with injected context. Built for ADHD-friendly spatial memory. · DSH 可视化对话地图:会话即卡片,双击即聊,连线分叉带上下文的新对话。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",