dsh-talk-map 0.1.45 → 0.1.46
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 +33 -3
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -10791,7 +10791,36 @@ function pickFaces(from, to, obstacles, options) {
|
|
|
10791
10791
|
const gapX = Math.abs(dx) - options.cardWidth;
|
|
10792
10792
|
const gapY = Math.abs(dy) - options.cardHeight;
|
|
10793
10793
|
const horizontalDominant = Math.abs(dx) >= Math.abs(dy);
|
|
10794
|
-
|
|
10794
|
+
const approachClear = (rect, side) => {
|
|
10795
|
+
const band = 30;
|
|
10796
|
+
return !obstacles.some((other) => {
|
|
10797
|
+
if (other.id === rect.id || other.id === from.id || other.id === to.id) return false;
|
|
10798
|
+
const ox = Math.abs(other.x - rect.x);
|
|
10799
|
+
const oy = Math.abs(other.y - rect.y);
|
|
10800
|
+
if (side === "r") return other.x > rect.x && other.x - rect.x < options.cardWidth + band && oy < options.cardHeight * 0.9;
|
|
10801
|
+
if (side === "l") return other.x < rect.x && rect.x - other.x < options.cardWidth + band && oy < options.cardHeight * 0.9;
|
|
10802
|
+
if (side === "b") return other.y > rect.y && other.y - rect.y < options.cardHeight + band && ox < options.cardWidth * 0.9;
|
|
10803
|
+
return other.y < rect.y && rect.y - other.y < options.cardHeight + band && ox < options.cardWidth * 0.9;
|
|
10804
|
+
});
|
|
10805
|
+
};
|
|
10806
|
+
if (horizontalDominant) {
|
|
10807
|
+
const fromSide2 = dx >= 0 ? "r" : "l";
|
|
10808
|
+
const toSide2 = dx >= 0 ? "l" : "r";
|
|
10809
|
+
if (approachClear(from, fromSide2) && approachClear(to, toSide2)) {
|
|
10810
|
+
return { fromHandle: fromSide2, toHandle: toSide2 };
|
|
10811
|
+
}
|
|
10812
|
+
const freeFrom2 = approachClear(from, "b") ? "b" : "t";
|
|
10813
|
+
const freeTo2 = approachClear(to, "b") ? "b" : "t";
|
|
10814
|
+
return { fromHandle: freeFrom2, toHandle: freeTo2 };
|
|
10815
|
+
}
|
|
10816
|
+
const fromSide = dy >= 0 ? "b" : "t";
|
|
10817
|
+
const toSide = dy >= 0 ? "t" : "b";
|
|
10818
|
+
if (approachClear(from, fromSide) && approachClear(to, toSide)) {
|
|
10819
|
+
return { fromHandle: fromSide, toHandle: toSide };
|
|
10820
|
+
}
|
|
10821
|
+
const freeFrom = approachClear(from, "r") ? "r" : "l";
|
|
10822
|
+
const freeTo = approachClear(to, "r") ? "r" : "l";
|
|
10823
|
+
return { fromHandle: freeFrom, toHandle: freeTo };
|
|
10795
10824
|
}
|
|
10796
10825
|
|
|
10797
10826
|
// src/client/push-log.ts
|
|
@@ -13096,7 +13125,8 @@ function StackDrawer(props) {
|
|
|
13096
13125
|
toRect,
|
|
13097
13126
|
faces.fromHandle,
|
|
13098
13127
|
faces.toHandle,
|
|
13099
|
-
[fromRect, toRect, ...obstacles]
|
|
13128
|
+
[fromRect, toRect, ...obstacles],
|
|
13129
|
+
{ stub: 10 }
|
|
13100
13130
|
);
|
|
13101
13131
|
let bestDirty = dirty(points);
|
|
13102
13132
|
if (bestDirty > 0) {
|
|
@@ -13104,7 +13134,7 @@ function StackDrawer(props) {
|
|
|
13104
13134
|
for (const fromFace of FACES) {
|
|
13105
13135
|
for (const toFace of FACES) {
|
|
13106
13136
|
if (fromFace === faces.fromHandle && toFace === faces.toHandle) continue;
|
|
13107
|
-
const attempt = routeEdge(fromRect, toRect, fromFace, toFace, [fromRect, toRect, ...obstacles]);
|
|
13137
|
+
const attempt = routeEdge(fromRect, toRect, fromFace, toFace, [fromRect, toRect, ...obstacles], { stub: 10 });
|
|
13108
13138
|
const attemptDirty = dirty(attempt);
|
|
13109
13139
|
if (attemptDirty < bestDirty) {
|
|
13110
13140
|
bestDirty = attemptDirty;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-talk-map",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
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",
|