dsh-talk-map 0.1.13 → 0.1.14

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 +31 -3
  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": "搜地图上的卡片(标题/正文)· v0.1.13",
451
+ "global.searchPlaceholder": "搜地图上的卡片(标题/正文)· v0.1.14",
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 · v0.1.13",
602
+ "global.searchPlaceholder": "Search cards on the map · v0.1.14",
603
603
  "global.searchRun": "Search",
604
604
  "global.searchTitle": "Search the map",
605
605
  "font.group": "Text size",
@@ -12172,6 +12172,24 @@ function TalkMapEdge(props) {
12172
12172
  obstacles
12173
12173
  );
12174
12174
  const routed = route !== void 0 && route.length > 1;
12175
+ const routeHitsCard = (points, rects) => {
12176
+ if (points === void 0 || rects === void 0) return false;
12177
+ for (let index2 = 1; index2 < points.length; index2 += 1) {
12178
+ const a = points[index2 - 1];
12179
+ const b = points[index2];
12180
+ const steps = Math.max(2, Math.ceil((Math.abs(b.x - a.x) + Math.abs(b.y - a.y)) / 3));
12181
+ for (let step2 = 0; step2 <= steps; step2 += 1) {
12182
+ const t2 = step2 / steps;
12183
+ const x = a.x + (b.x - a.x) * t2;
12184
+ const y = a.y + (b.y - a.y) * t2;
12185
+ for (const rect of rects) {
12186
+ if (x > rect.x + 1 && x < rect.x + rect.w - 1 && y > rect.y + 1 && y < rect.y + rect.h - 1) return true;
12187
+ }
12188
+ }
12189
+ }
12190
+ return false;
12191
+ };
12192
+ const blockedRoute = routeHitsCard(route, obstacles ?? data.obstacles);
12175
12193
  if (typeof window !== "undefined") {
12176
12194
  const w = window;
12177
12195
  w.__edgeDebug = w.__edgeDebug ?? [];
@@ -12193,7 +12211,17 @@ function TalkMapEdge(props) {
12193
12211
  targetY: props.targetY,
12194
12212
  targetPosition: props.targetPosition
12195
12213
  });
12196
- const path = routed ? roundedPath(route, 10) : smoothPath;
12214
+ const safeRoute = routed && !blockedRoute ? route : void 0;
12215
+ const stubPath = (() => {
12216
+ const normal = (face) => face === "r" ? { x: 1, y: 0 } : face === "l" ? { x: -1, y: 0 } : face === "t" ? { x: 0, y: -1 } : { x: 0, y: 1 };
12217
+ const length = 16;
12218
+ const a = normal(faceOf(props.sourcePosition));
12219
+ const b = normal(faceOf(props.targetPosition));
12220
+ const p1 = { x: props.sourceX + a.x * length, y: props.sourceY + a.y * length };
12221
+ const p2 = { x: props.targetX + b.x * length, y: props.targetY + b.y * length };
12222
+ return `M ${props.sourceX} ${props.sourceY} L ${p1.x} ${p1.y} M ${props.targetX} ${props.targetY} L ${p2.x} ${p2.y}`;
12223
+ })();
12224
+ const path = safeRoute !== void 0 ? roundedPath(safeRoute, 10) : blockedRoute ? stubPath : smoothPath;
12197
12225
  const arrowAngle = (() => {
12198
12226
  if (routed) {
12199
12227
  const end = route[route.length - 1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-talk-map",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
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",