dsh-talk-map 0.1.49 → 0.1.51
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 +45 -18
- 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": "b51 · 搜地图上的卡片(标题/正文)",
|
|
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": "
|
|
602
|
+
"global.searchPlaceholder": "b51 · Search cards on the map",
|
|
603
603
|
"global.searchRun": "Search",
|
|
604
604
|
"global.searchTitle": "Search the map",
|
|
605
605
|
"font.group": "Text size",
|
|
@@ -13063,6 +13063,7 @@ function StackDrawer(props) {
|
|
|
13063
13063
|
};
|
|
13064
13064
|
});
|
|
13065
13065
|
const next = [];
|
|
13066
|
+
let wireIndex = 0;
|
|
13066
13067
|
for (const link2 of links) {
|
|
13067
13068
|
const from = boxOf(link2.from);
|
|
13068
13069
|
const to = boxOf(link2.to);
|
|
@@ -13143,6 +13144,7 @@ function StackDrawer(props) {
|
|
|
13143
13144
|
};
|
|
13144
13145
|
let bestD;
|
|
13145
13146
|
let bestCost = Number.POSITIVE_INFINITY;
|
|
13147
|
+
let arrival = { x: endPoint.x - startPoint.x, y: endPoint.y - startPoint.y };
|
|
13146
13148
|
const tryCurve = (control1, control2) => {
|
|
13147
13149
|
const u1 = (t2) => (1 - t2) * (1 - t2) * (1 - t2);
|
|
13148
13150
|
const u2 = (t2) => 3 * (1 - t2) * (1 - t2) * t2;
|
|
@@ -13156,6 +13158,7 @@ function StackDrawer(props) {
|
|
|
13156
13158
|
if (cost < bestCost) {
|
|
13157
13159
|
bestCost = cost;
|
|
13158
13160
|
bestD = "M " + startPoint.x + " " + startPoint.y + " C " + control1.x + " " + control1.y + ", " + control2.x + " " + control2.y + ", " + endPoint.x + " " + endPoint.y;
|
|
13161
|
+
arrival = { x: endPoint.x - control2.x, y: endPoint.y - control2.y };
|
|
13159
13162
|
}
|
|
13160
13163
|
};
|
|
13161
13164
|
for (const bow of [0.15, 0.3, 0.5, 0.75, 1.1]) {
|
|
@@ -13185,16 +13188,18 @@ function StackDrawer(props) {
|
|
|
13185
13188
|
}
|
|
13186
13189
|
}
|
|
13187
13190
|
if (bestCost > 0) {
|
|
13188
|
-
const bands2 = (
|
|
13189
|
-
const
|
|
13191
|
+
const bands2 = (edges) => {
|
|
13192
|
+
const sorted = [...edges].sort((a, b) => a.start - b.start);
|
|
13190
13193
|
const lanes = [];
|
|
13191
|
-
|
|
13192
|
-
|
|
13194
|
+
let reach = Number.NEGATIVE_INFINITY;
|
|
13195
|
+
for (const edge of sorted) {
|
|
13196
|
+
if (edge.start > reach && Number.isFinite(reach)) lanes.push((reach + edge.start) / 2);
|
|
13197
|
+
reach = Math.max(reach, edge.end);
|
|
13198
|
+
}
|
|
13199
|
+
if (sorted.length > 0) {
|
|
13200
|
+
lanes.unshift(Math.max(8, sorted[0].start - 14));
|
|
13201
|
+
lanes.push(reach + 14);
|
|
13193
13202
|
}
|
|
13194
|
-
const first = unique[0];
|
|
13195
|
-
const last = unique[unique.length - 1];
|
|
13196
|
-
if (first !== void 0) lanes.unshift(Math.max(8, first - 14));
|
|
13197
|
-
if (last !== void 0) lanes.push(last + size + 14);
|
|
13198
13203
|
return lanes;
|
|
13199
13204
|
};
|
|
13200
13205
|
const samplePolyline = (points) => (t2) => {
|
|
@@ -13218,30 +13223,52 @@ function StackDrawer(props) {
|
|
|
13218
13223
|
};
|
|
13219
13224
|
const midY = (startPoint.y + endPoint.y) / 2;
|
|
13220
13225
|
const midX = (startPoint.x + endPoint.x) / 2;
|
|
13221
|
-
const lanesY = bands2(cardsInDrawer.map((card) => card.y
|
|
13222
|
-
const lanesX = bands2(cardsInDrawer.map((card) => card.x
|
|
13226
|
+
const lanesY = bands2(cardsInDrawer.map((card) => ({ start: card.y, end: card.y + card.h }))).sort((a, b) => Math.abs(a - midY) - Math.abs(b - midY));
|
|
13227
|
+
const lanesX = bands2(cardsInDrawer.map((card) => ({ start: card.x, end: card.x + card.w }))).sort((a, b) => Math.abs(a - midX) - Math.abs(b - midX));
|
|
13228
|
+
const startStub = { x: startPoint.x + startNormal.x * 12, y: startPoint.y + startNormal.y * 12 };
|
|
13229
|
+
const endStub = { x: endPoint.x + endNormal.x * 12, y: endPoint.y + endNormal.y * 12 };
|
|
13230
|
+
const laneOffset = (wireIndex % 7 - 3) * 1.3;
|
|
13223
13231
|
const shapes = [];
|
|
13224
13232
|
for (const lane of lanesY) {
|
|
13225
|
-
|
|
13233
|
+
const at = lane + laneOffset;
|
|
13234
|
+
shapes.push([
|
|
13235
|
+
startPoint,
|
|
13236
|
+
startStub,
|
|
13237
|
+
{ x: startStub.x, y: at },
|
|
13238
|
+
{ x: endStub.x, y: at },
|
|
13239
|
+
endStub,
|
|
13240
|
+
endPoint
|
|
13241
|
+
]);
|
|
13226
13242
|
}
|
|
13227
13243
|
for (const lane of lanesX) {
|
|
13228
|
-
|
|
13244
|
+
const at = lane + laneOffset;
|
|
13245
|
+
shapes.push([
|
|
13246
|
+
startPoint,
|
|
13247
|
+
startStub,
|
|
13248
|
+
{ x: at, y: startStub.y },
|
|
13249
|
+
{ x: at, y: endStub.y },
|
|
13250
|
+
endStub,
|
|
13251
|
+
endPoint
|
|
13252
|
+
]);
|
|
13229
13253
|
}
|
|
13230
13254
|
for (const shape of shapes) {
|
|
13231
13255
|
const cost = badness(samplePolyline(shape));
|
|
13232
13256
|
if (cost < bestCost) {
|
|
13233
13257
|
bestCost = cost;
|
|
13234
13258
|
bestD = roundedPath(shape, 10);
|
|
13259
|
+
arrival = { x: endPoint.x - endStub.x, y: endPoint.y - endStub.y };
|
|
13235
13260
|
if (cost === 0) break;
|
|
13236
13261
|
}
|
|
13237
13262
|
}
|
|
13238
13263
|
}
|
|
13239
|
-
const angle = toSide === "l" ? 180 : toSide === "r" ? 0 : toSide === "t" ? -90 : 90;
|
|
13264
|
+
const angle = Math.abs(arrival.x) < 0.5 && Math.abs(arrival.y) < 0.5 ? toSide === "l" ? 180 : toSide === "r" ? 0 : toSide === "t" ? -90 : 90 : Math.abs(arrival.x) >= Math.abs(arrival.y) ? arrival.x >= 0 ? 0 : 180 : arrival.y >= 0 ? 90 : -90;
|
|
13265
|
+
const arrowAngle = angle;
|
|
13266
|
+
wireIndex += 1;
|
|
13240
13267
|
next.push({
|
|
13241
13268
|
d: bestD ?? "M " + startPoint.x + " " + startPoint.y + " L " + endPoint.x + " " + endPoint.y,
|
|
13242
|
-
ax: endPoint.x,
|
|
13243
|
-
ay: endPoint.y,
|
|
13244
|
-
angle,
|
|
13269
|
+
ax: endPoint.x - endNormal.x * 2.5,
|
|
13270
|
+
ay: endPoint.y - endNormal.y * 2.5,
|
|
13271
|
+
angle: arrowAngle,
|
|
13245
13272
|
from: link2.from,
|
|
13246
13273
|
to: link2.to
|
|
13247
13274
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-talk-map",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51",
|
|
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",
|