dsh-talk-map 0.1.28 → 0.1.30
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 +10 -66
- 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.30",
|
|
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.30",
|
|
603
603
|
"global.searchRun": "Search",
|
|
604
604
|
"global.searchTitle": "Search the map",
|
|
605
605
|
"font.group": "Text size",
|
|
@@ -12188,50 +12188,6 @@ function roundedPath(points, radius = 10) {
|
|
|
12188
12188
|
function round(value) {
|
|
12189
12189
|
return Math.round(value * 100) / 100;
|
|
12190
12190
|
}
|
|
12191
|
-
function clipToRects(points, rects) {
|
|
12192
|
-
if (points.length < 2) return [points];
|
|
12193
|
-
const insideAny = (point) => rects.some((rect) => point.x > rect.x + 0.5 && point.x < rect.x + rect.w - 0.5 && point.y > rect.y + 0.5 && point.y < rect.y + rect.h - 0.5);
|
|
12194
|
-
const subpaths = [];
|
|
12195
|
-
let current = [];
|
|
12196
|
-
const flush = () => {
|
|
12197
|
-
if (current.length >= 2) subpaths.push(current);
|
|
12198
|
-
current = [];
|
|
12199
|
-
};
|
|
12200
|
-
for (let index2 = 1; index2 < points.length; index2 += 1) {
|
|
12201
|
-
const a = points[index2 - 1];
|
|
12202
|
-
const b = points[index2];
|
|
12203
|
-
const steps = Math.max(2, Math.ceil((Math.abs(b.x - a.x) + Math.abs(b.y - a.y)) / 2));
|
|
12204
|
-
for (let step2 = 0; step2 <= steps; step2 += 1) {
|
|
12205
|
-
const t2 = step2 / steps;
|
|
12206
|
-
const point = { x: a.x + (b.x - a.x) * t2, y: a.y + (b.y - a.y) * t2 };
|
|
12207
|
-
if (insideAny(point)) {
|
|
12208
|
-
flush();
|
|
12209
|
-
} else {
|
|
12210
|
-
const last = current[current.length - 1];
|
|
12211
|
-
if (last === void 0 || Math.abs(last.x - point.x) > 0.4 || Math.abs(last.y - point.y) > 0.4) {
|
|
12212
|
-
current.push(point);
|
|
12213
|
-
}
|
|
12214
|
-
}
|
|
12215
|
-
}
|
|
12216
|
-
}
|
|
12217
|
-
flush();
|
|
12218
|
-
if (subpaths.length === 0) return [points];
|
|
12219
|
-
return subpaths.map((subpath) => {
|
|
12220
|
-
const rounded = subpath.map((point) => ({ x: Math.round(point.x * 2) / 2, y: Math.round(point.y * 2) / 2 }));
|
|
12221
|
-
const out = [];
|
|
12222
|
-
for (const point of rounded) {
|
|
12223
|
-
const last = out[out.length - 1];
|
|
12224
|
-
if (last !== void 0 && last.x === point.x && last.y === point.y) continue;
|
|
12225
|
-
const before = out[out.length - 2];
|
|
12226
|
-
if (before !== void 0 && last !== void 0 && (before.x === last.x && last.x === point.x || before.y === last.y && last.y === point.y)) {
|
|
12227
|
-
out[out.length - 1] = point;
|
|
12228
|
-
continue;
|
|
12229
|
-
}
|
|
12230
|
-
out.push(point);
|
|
12231
|
-
}
|
|
12232
|
-
return out;
|
|
12233
|
-
}).filter((subpath) => subpath.length >= 2);
|
|
12234
|
-
}
|
|
12235
12191
|
|
|
12236
12192
|
// src/client/TalkMapEdge.tsx
|
|
12237
12193
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
@@ -12263,10 +12219,6 @@ function boardBoxes() {
|
|
|
12263
12219
|
}
|
|
12264
12220
|
return boxes;
|
|
12265
12221
|
}
|
|
12266
|
-
function containsPoint(box, x, y) {
|
|
12267
|
-
const pad = 40;
|
|
12268
|
-
return x >= box.x - pad && x <= box.x + box.w + pad && y >= box.y - pad && y <= box.y + box.h + pad;
|
|
12269
|
-
}
|
|
12270
12222
|
function TalkMapEdge(props) {
|
|
12271
12223
|
const data = props.data ?? {};
|
|
12272
12224
|
const synced = data.sync === "synced";
|
|
@@ -12281,12 +12233,14 @@ function TalkMapEdge(props) {
|
|
|
12281
12233
|
const obstacles = data.obstacles;
|
|
12282
12234
|
const measuredBoxes = boardBoxes();
|
|
12283
12235
|
const sameCorner = (box, other) => other !== void 0 && Math.abs(box.x - other.x) < 6 && Math.abs(box.y - other.y) < 6;
|
|
12284
|
-
const merged = (
|
|
12236
|
+
const merged = (obstacles !== void 0 && obstacles.length > 0 ? obstacles : measuredBoxes).filter((box) => !sameCorner(box, data.fromRect)).filter((box) => !sameCorner(box, data.toRect)).filter((box) => !sameCorner(box, data.fromRect)).filter((box) => !sameCorner(box, data.toRect));
|
|
12285
12237
|
const route = merged.length === 0 ? void 0 : routeBetween(
|
|
12286
12238
|
{
|
|
12287
|
-
|
|
12239
|
+
// Rounded to whole flow pixels: anchors carry sub-pixel noise after a zoom,
|
|
12240
|
+
// which shifted the clipped endpoints by a pixel between renders.
|
|
12241
|
+
start: { x: Math.round(props.sourceX), y: Math.round(props.sourceY) },
|
|
12288
12242
|
startFace: faceOf(props.sourcePosition),
|
|
12289
|
-
end: { x: props.targetX, y: props.targetY },
|
|
12243
|
+
end: { x: Math.round(props.targetX), y: Math.round(props.targetY) },
|
|
12290
12244
|
endFace: faceOf(props.targetPosition)
|
|
12291
12245
|
},
|
|
12292
12246
|
// The endpoints' real boxes: the router excludes them from the obstacle
|
|
@@ -12313,7 +12267,7 @@ function TalkMapEdge(props) {
|
|
|
12313
12267
|
}
|
|
12314
12268
|
return false;
|
|
12315
12269
|
};
|
|
12316
|
-
const guardBoxes = merged
|
|
12270
|
+
const guardBoxes = merged;
|
|
12317
12271
|
const blockedRoute = routeHitsCard(route, guardBoxes);
|
|
12318
12272
|
if (typeof window !== "undefined") {
|
|
12319
12273
|
const w = window;
|
|
@@ -12337,18 +12291,8 @@ function TalkMapEdge(props) {
|
|
|
12337
12291
|
targetY: props.targetY,
|
|
12338
12292
|
targetPosition: props.targetPosition
|
|
12339
12293
|
});
|
|
12340
|
-
const safeRoute = routed
|
|
12341
|
-
const
|
|
12342
|
-
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 };
|
|
12343
|
-
const length = 16;
|
|
12344
|
-
const a = normal(faceOf(props.sourcePosition));
|
|
12345
|
-
const b = normal(faceOf(props.targetPosition));
|
|
12346
|
-
const p1 = { x: props.sourceX + a.x * length, y: props.sourceY + a.y * length };
|
|
12347
|
-
const p2 = { x: props.targetX + b.x * length, y: props.targetY + b.y * length };
|
|
12348
|
-
return `M ${props.sourceX} ${props.sourceY} L ${p1.x} ${p1.y} M ${props.targetX} ${props.targetY} L ${p2.x} ${p2.y}`;
|
|
12349
|
-
})();
|
|
12350
|
-
const endpointBoxes = [data.fromRect, data.toRect].filter((box) => box !== void 0);
|
|
12351
|
-
const path = safeRoute !== void 0 ? endpointBoxes.length === 0 ? roundedPath(safeRoute, 10) : clipToRects(safeRoute, endpointBoxes).map((subpath) => roundedPath(subpath, 10)).join(" ") : blockedRoute ? stubPath : smoothPath;
|
|
12294
|
+
const safeRoute = routed ? route : void 0;
|
|
12295
|
+
const path = safeRoute !== void 0 ? roundedPath(safeRoute, 10) : smoothPath;
|
|
12352
12296
|
const arrowAngle = (() => {
|
|
12353
12297
|
if (routed) {
|
|
12354
12298
|
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.
|
|
3
|
+
"version": "0.1.30",
|
|
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",
|