dsh-talk-map 0.1.12 → 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.
- package/client/client.js +41 -13
- 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.
|
|
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.
|
|
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
|
|
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];
|
|
@@ -13999,16 +14027,16 @@ function CanvasInner(props) {
|
|
|
13999
14027
|
if (card === void 0) return void 0;
|
|
14000
14028
|
return sessions.byId[card.sessionId]?.updatedAt;
|
|
14001
14029
|
};
|
|
14002
|
-
const
|
|
14003
|
-
const
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
const slot = cardLayout[cardId];
|
|
14010
|
-
return { x: slot?.x ?? card.x, y: slot?.y ?? card.y, w: CARD_W, h: CARD_H };
|
|
14030
|
+
const renderedBoxes = () => {
|
|
14031
|
+
const out = {};
|
|
14032
|
+
for (const node of liveNodes) {
|
|
14033
|
+
if (node.type !== "sessionCard" || node.hidden === true) continue;
|
|
14034
|
+
out[node.id] = { x: node.position.x, y: node.position.y, w: CARD_W, h: CARD_H };
|
|
14035
|
+
}
|
|
14036
|
+
return out;
|
|
14011
14037
|
};
|
|
14038
|
+
const obstaclesFor = (fromCardId, toCardId) => Object.entries(renderedBoxes()).filter(([id2]) => id2 !== fromCardId && id2 !== toCardId).filter(([id2]) => !foldedSet.has(id2)).map(([, box]) => box);
|
|
14039
|
+
const boxOf = (cardId) => renderedBoxes()[cardId];
|
|
14012
14040
|
const routingObstacles = () => Object.entries(canvasState.cards).map(([id2, card]) => ({
|
|
14013
14041
|
id: id2,
|
|
14014
14042
|
x: card.x,
|
|
@@ -14129,7 +14157,7 @@ function CanvasInner(props) {
|
|
|
14129
14157
|
}
|
|
14130
14158
|
}
|
|
14131
14159
|
return out;
|
|
14132
|
-
}, [visibleCards, canvasState.edges, sessions, sessionIdToCardId, liveSelectedEdgeIds, foldedSet, locale, pushEpoch, lineageHidden]);
|
|
14160
|
+
}, [visibleCards, canvasState.edges, sessions, sessionIdToCardId, liveSelectedEdgeIds, foldedSet, locale, pushEpoch, lineageHidden, liveNodes]);
|
|
14133
14161
|
const drawerWireLinks = (0, import_react12.useMemo)(() => {
|
|
14134
14162
|
if (drawer === null) return [];
|
|
14135
14163
|
const layout = folderLayouts[drawer.groupId];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-talk-map",
|
|
3
|
-
"version": "0.1.
|
|
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",
|