dsh-talk-map 0.1.11 → 0.1.12

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 +17 -11
  2. package/package.json +1 -1
package/client/client.js CHANGED
@@ -448,7 +448,7 @@ var zh = {
448
448
  "digest.empty": "这条对话还没有摘要,先刷新摘要再来看。",
449
449
  "digest.copy": "复制",
450
450
  "digest.close": "关闭",
451
- "global.searchPlaceholder": "搜地图上的卡片(标题/正文),回车开始",
451
+ "global.searchPlaceholder": "搜地图上的卡片(标题/正文)· v0.1.12",
452
452
  "global.searchRun": "搜索",
453
453
  "global.searchTitle": "搜索地图",
454
454
  "font.group": "文字大小",
@@ -599,7 +599,7 @@ var en = {
599
599
  "menu.noGroup": "Remove from group (free card)",
600
600
  "menu.open": "Open conversation",
601
601
  "menu.markUnread": "Mark as unread",
602
- "global.searchPlaceholder": "Search cards on the map (title/body), Enter",
602
+ "global.searchPlaceholder": "Search cards on the map · v0.1.12",
603
603
  "global.searchRun": "Search",
604
604
  "global.searchTitle": "Search the map",
605
605
  "font.group": "Text size",
@@ -11741,6 +11741,7 @@ function ContextMenu(props) {
11741
11741
  // src/client/edge-route.ts
11742
11742
  var __routeDebug = {};
11743
11743
  var DEFAULTS = { margin: 8, stub: 22, minCorridor: 18 };
11744
+ var CROSS_PENALTY = 2e4;
11744
11745
  function anchorOf(rect, face) {
11745
11746
  switch (face) {
11746
11747
  case "r":
@@ -11774,22 +11775,24 @@ function insideStrict(rect, point) {
11774
11775
  function hitsHorizontal(rects, y, x1, x2) {
11775
11776
  const lo = Math.min(x1, x2);
11776
11777
  const hi = Math.max(x1, x2);
11778
+ let count = 0;
11777
11779
  for (const rect of rects) {
11778
11780
  if (y <= rect.y || y >= rect.y + rect.h) continue;
11779
11781
  if (hi <= rect.x || lo >= rect.x + rect.w) continue;
11780
- return true;
11782
+ count += 1;
11781
11783
  }
11782
- return false;
11784
+ return count;
11783
11785
  }
11784
11786
  function hitsVertical(rects, x, y1, y2) {
11785
11787
  const lo = Math.min(y1, y2);
11786
11788
  const hi = Math.max(y1, y2);
11789
+ let count = 0;
11787
11790
  for (const rect of rects) {
11788
11791
  if (x <= rect.x || x >= rect.x + rect.w) continue;
11789
11792
  if (hi <= rect.y || lo >= rect.y + rect.h) continue;
11790
- return true;
11793
+ count += 1;
11791
11794
  }
11792
- return false;
11795
+ return count;
11793
11796
  }
11794
11797
  function bands(rects, axis) {
11795
11798
  const spans = rects.map((rect) => axis === "x" ? { start: rect.x, end: rect.x + rect.w } : { start: rect.y, end: rect.y + rect.h }).sort((a, b) => a.start - b.start);
@@ -12088,14 +12091,14 @@ function routeBetween(ends, from, to, obstacles, options = {}) {
12088
12091
  if (nx < 0 || ny < 0 || nx >= xsTrimmed.length || ny >= ysTrimmed.length) continue;
12089
12092
  const next = { x: xsTrimmed[nx], y: ysTrimmed[ny] };
12090
12093
  const nextNode = nodeId(nx, ny);
12091
- if (nextNode !== goalNode && blocked.some((rect) => insideStrict(rect, next))) continue;
12092
- const clear = step2.axis === "x" ? !hitsHorizontal(blocked, here.y, here.x, next.x) : !hitsVertical(blocked, here.x, here.y, next.y);
12093
- if (!clear) continue;
12094
+ const insideCost = blocked.filter((rect) => insideStrict(rect, next)).length * CROSS_PENALTY;
12095
+ const crossing = step2.axis === "x" ? hitsHorizontal(blocked, here.y, here.x, next.x) : hitsVertical(blocked, here.x, here.y, next.y);
12096
+ const crossCost = crossing * CROSS_PENALTY;
12094
12097
  const distance2 = Math.abs(next.x - here.x) + Math.abs(next.y - here.y);
12095
12098
  const onCorridor = step2.axis === "x" ? corridorY.has(Math.round(here.y)) : corridorX.has(Math.round(here.x));
12096
12099
  const turn = dir === step2.axis ? 0 : 18;
12097
12100
  const prefer = onCorridor ? 0 : 40;
12098
- const nextCost = cost + distance2 + turn + prefer;
12101
+ const nextCost = cost + distance2 + turn + prefer + crossCost + insideCost;
12099
12102
  const nextState = withDir(nextNode, step2.axis);
12100
12103
  const known = best.get(nextState);
12101
12104
  if (known !== void 0 && known <= nextCost) continue;
@@ -13996,7 +13999,10 @@ function CanvasInner(props) {
13996
13999
  if (card === void 0) return void 0;
13997
14000
  return sessions.byId[card.sessionId]?.updatedAt;
13998
14001
  };
13999
- const obstaclesFor = (fromCardId, toCardId) => Object.entries(canvasState.cards).filter(([id2]) => id2 !== fromCardId && id2 !== toCardId).filter(([id2]) => !foldedSet.has(id2)).map(([, card]) => ({ x: card.x, y: card.y, w: CARD_W, h: CARD_H }));
14002
+ const obstaclesFor = (fromCardId, toCardId) => Object.entries(canvasState.cards).filter(([id2]) => id2 !== fromCardId && id2 !== toCardId).filter(([id2]) => !foldedSet.has(id2)).map(([id2, card]) => {
14003
+ const slot = cardLayout[id2];
14004
+ return { x: slot?.x ?? card.x, y: slot?.y ?? card.y, w: CARD_W, h: CARD_H };
14005
+ });
14000
14006
  const boxOf = (cardId) => {
14001
14007
  const card = canvasState.cards[cardId];
14002
14008
  if (card === void 0) return void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-talk-map",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
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",