visualproof 0.11.1 → 0.11.2
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/dist/shared/notecard.js +60 -1
- package/dist/web/bundle/app.js +156 -10
- package/dist/web/style.css +15 -1
- package/package.json +1 -1
package/dist/shared/notecard.js
CHANGED
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
// The notes layer stacks, bottom to top (NOTE_Z): the leaders, the icons and dots with the folded
|
|
25
25
|
// clusters' markers, the cards — the one pressed or opened last in front —, what would hold a dragged
|
|
26
26
|
// note, and the icon being dragged. An expanded note's card covers the icons under it; its own it
|
|
27
|
-
// never covers, since a card hangs clear of its icon.
|
|
27
|
+
// never covers, since a card hangs clear of its icon. Another card it covers only where no place
|
|
28
|
+
// near enough is free (the owner's decision of 2026-11-10, spreadCards).
|
|
28
29
|
import { AUTO_COLLAPSE_PX, CARD_REACH, DECL_AT, DECL_REACH, keptDecl, noteLook, ZONE_MAX_PX, ZONE_MIN_PX } from "./sticky.js";
|
|
29
30
|
/** the icon's diameter on the screen, in pixels: something to point at and click, small enough to
|
|
30
31
|
* sit in a cluster without covering what is around its place */
|
|
@@ -257,6 +258,64 @@ export function hangCard(icon, off, w, h, room, avoid = null) {
|
|
|
257
258
|
}
|
|
258
259
|
return { box: best.box, flip: best.flip };
|
|
259
260
|
}
|
|
261
|
+
/** the room kept between two cards set apart (spreadCards), in pixels of the screen */
|
|
262
|
+
export const CARD_APART = 6;
|
|
263
|
+
/** The cards' boxes set apart so that, as far as they can be, no card covers another (the owner's
|
|
264
|
+
* decision of 2026-11-10): one placed by hand, or dragged, stays where it is; every other, from the
|
|
265
|
+
* top of the screen down, keeps where it hangs by itself where nothing taken is there, and else
|
|
266
|
+
* moves the least it can to where nothing is — another way round its icon (FLIPS), or from one of
|
|
267
|
+
* them along an edge of a card in the way to just past it, CARD_APART clear —, clear of its own
|
|
268
|
+
* icon, within CARD_REACH of it, no further out of the room nor over the name it keeps off than it
|
|
269
|
+
* was. Where no such place is, it stays where it hangs, over the others. */
|
|
270
|
+
export function spreadCards(cards) {
|
|
271
|
+
const out = cards.map((c) => c.box);
|
|
272
|
+
const taken = cards.filter((c) => c.fixed).map((c) => c.box);
|
|
273
|
+
const free = cards
|
|
274
|
+
.map((c, i) => ({ c, i }))
|
|
275
|
+
.filter(({ c }) => !c.fixed)
|
|
276
|
+
.sort((a, b) => a.c.box.y0 - b.c.box.y0 || a.c.box.x0 - b.c.box.x0 || a.i - b.i);
|
|
277
|
+
for (const { c, i } of free) {
|
|
278
|
+
const b = c.box;
|
|
279
|
+
const meets = (x) => taken.some((t) => area(x, t) > 0);
|
|
280
|
+
if (!meets(b)) {
|
|
281
|
+
taken.push(b);
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
const w = b.x1 - b.x0, h = b.y1 - b.y0;
|
|
285
|
+
const outside = (x) => Math.max(0, w * h - area(x, c.room));
|
|
286
|
+
const was = { out: outside(b), covers: !!c.avoid && area(b, c.avoid) > 0 };
|
|
287
|
+
const [ix, iy] = c.icon;
|
|
288
|
+
const off = [(b.x0 + b.x1) / 2 - ix, (b.y0 + b.y1) / 2 - iy];
|
|
289
|
+
const fits = (x) => {
|
|
290
|
+
const dx = (x.x0 + x.x1) / 2 - ix, dy = (x.y0 + x.y1) / 2 - iy;
|
|
291
|
+
if (Math.abs(dx) > CARD_REACH || Math.abs(dy) > CARD_REACH)
|
|
292
|
+
return false;
|
|
293
|
+
if (Math.abs(dx) < w / 2 + ICON_CLEAR && Math.abs(dy) < h / 2 + ICON_CLEAR)
|
|
294
|
+
return false;
|
|
295
|
+
if (outside(x) > was.out + 0.5)
|
|
296
|
+
return false;
|
|
297
|
+
if (!was.covers && c.avoid && area(x, c.avoid) > 0)
|
|
298
|
+
return false;
|
|
299
|
+
return !meets(x);
|
|
300
|
+
};
|
|
301
|
+
const by = (x, dx, dy) => ({ x0: x.x0 + dx, y0: x.y0 + dy, x1: x.x1 + dx, y1: x.y1 + dy });
|
|
302
|
+
const ways = [];
|
|
303
|
+
for (const [fx, fy] of FLIPS) {
|
|
304
|
+
const f = cardBox(ix, iy, [off[0] * fx, off[1] * fy], w, h);
|
|
305
|
+
ways.push(f);
|
|
306
|
+
for (const t of taken)
|
|
307
|
+
ways.push(by(f, 0, t.y0 - CARD_APART - f.y1), by(f, 0, t.y1 + CARD_APART - f.y0), by(f, t.x0 - CARD_APART - f.x1, 0), by(f, t.x1 + CARD_APART - f.x0, 0));
|
|
308
|
+
}
|
|
309
|
+
// the nearest to where it hangs by itself, the first of those as near: tried nearest first
|
|
310
|
+
const cx = (b.x0 + b.x1) / 2, cy = (b.y0 + b.y1) / 2;
|
|
311
|
+
const far = ways.map((x, k) => ({ x, k, d: Math.hypot((x.x0 + x.x1) / 2 - cx, (x.y0 + x.y1) / 2 - cy) }));
|
|
312
|
+
far.sort((p, q) => p.d - q.d || p.k - q.k);
|
|
313
|
+
const best = far.find((p) => fits(p.x))?.x ?? b;
|
|
314
|
+
out[i] = best;
|
|
315
|
+
taken.push(best);
|
|
316
|
+
}
|
|
317
|
+
return out;
|
|
318
|
+
}
|
|
260
319
|
/** The leader between an icon at (x, y) and its card's box: from the icon's edge to the point of the
|
|
261
320
|
* card nearest the icon's centre; null where they touch. */
|
|
262
321
|
export function leaderLine(x, y, b) {
|
package/dist/web/bundle/app.js
CHANGED
|
@@ -6346,7 +6346,7 @@ var FocusMenu = class {
|
|
|
6346
6346
|
};
|
|
6347
6347
|
|
|
6348
6348
|
// src/web/src/reload.ts
|
|
6349
|
-
var PAGE_VERSION = true ? "0.11.
|
|
6349
|
+
var PAGE_VERSION = true ? "0.11.2" : null;
|
|
6350
6350
|
var KEY = "visualproof:reload";
|
|
6351
6351
|
var FOR_KEY = "visualproof:reloaded-for";
|
|
6352
6352
|
var FRESH_MS = 10 * 6e4;
|
|
@@ -16719,6 +16719,13 @@ var AGAIN_MS = 900;
|
|
|
16719
16719
|
var SIDE_MIN = 700;
|
|
16720
16720
|
var FITTED_MIN = 540;
|
|
16721
16721
|
var SCREEN_MIN = 1e3;
|
|
16722
|
+
var PANE_W = 360;
|
|
16723
|
+
var PANE_MIN = 240;
|
|
16724
|
+
var CODE_MIN = 300;
|
|
16725
|
+
function paneWidth(want, room2) {
|
|
16726
|
+
const w2 = want !== null && Number.isFinite(want) ? want : PANE_W;
|
|
16727
|
+
return Math.round(Math.max(PANE_MIN, Math.min(w2, room2 - CODE_MIN)));
|
|
16728
|
+
}
|
|
16722
16729
|
function paneSide(winWidth, fitted, screenWidth) {
|
|
16723
16730
|
if (screenWidth < SCREEN_MIN && winWidth < SIDE_MIN) return false;
|
|
16724
16731
|
return winWidth >= (fitted && screenWidth >= SCREEN_MIN ? FITTED_MIN : SIDE_MIN);
|
|
@@ -16781,6 +16788,7 @@ function headHtml(caret, sides, interactive) {
|
|
|
16781
16788
|
return `<div class="iv-head"><span class="iv-title">InfoView</span><span class="iv-where" title="${interactive ? "Hover a subterm for its type" : ""}">line ${caret.line + 1}, column ${caret.ch + 1}</span>${seg}<button type="button" class="icon iv-hide" data-iv-hide aria-label="Hide the InfoView" title="Hide the InfoView in every source window (kept in this browser)">${HIDE}</button></div>`;
|
|
16782
16789
|
}
|
|
16783
16790
|
var HIDE = `<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M6 4l4 4-4 4"/></svg>`;
|
|
16791
|
+
var GRIP = `<div class="iv-grip" aria-hidden="true" title="Drag to widen or narrow the InfoView; double-click for its own width"></div>`;
|
|
16784
16792
|
var InfoView = class {
|
|
16785
16793
|
hooks;
|
|
16786
16794
|
code = null;
|
|
@@ -16799,6 +16807,8 @@ var InfoView = class {
|
|
|
16799
16807
|
hoverWait = null;
|
|
16800
16808
|
hoverTurn = 0;
|
|
16801
16809
|
sizer = null;
|
|
16810
|
+
/** the last press in the pane was on its grip, beside the code */
|
|
16811
|
+
onGrip = false;
|
|
16802
16812
|
constructor(hooks) {
|
|
16803
16813
|
this.hooks = hooks;
|
|
16804
16814
|
}
|
|
@@ -16976,7 +16986,7 @@ var InfoView = class {
|
|
|
16976
16986
|
if (had) this.hooks.win().focus({ preventScroll: true });
|
|
16977
16987
|
return this.below();
|
|
16978
16988
|
}
|
|
16979
|
-
pane.innerHTML = headHtml(k2, v2.sides, !!this.answer?.interactive) + `<div class="iv-body">${v2.html}</div>`;
|
|
16989
|
+
pane.innerHTML = GRIP + headHtml(k2, v2.sides, !!this.answer?.interactive) + `<div class="iv-body">${v2.html}</div>`;
|
|
16980
16990
|
pane.setAttribute("aria-label", "What Lean says at the caret");
|
|
16981
16991
|
if (had && !had.isConnected) (pane.querySelector(`[data-iv-when="${when}"]`) ?? this.hooks.win()).focus({ preventScroll: true });
|
|
16982
16992
|
this.below();
|
|
@@ -17021,6 +17031,13 @@ var InfoView = class {
|
|
|
17021
17031
|
this.hooks.moved();
|
|
17022
17032
|
}
|
|
17023
17033
|
});
|
|
17034
|
+
pane.addEventListener("pointerdown", (e2) => {
|
|
17035
|
+
this.onGrip = !!split?.classList.contains("iv-side") && !!e2.target.closest(".iv-grip");
|
|
17036
|
+
if (this.onGrip) this.drag(e2);
|
|
17037
|
+
});
|
|
17038
|
+
pane.addEventListener("dblclick", () => {
|
|
17039
|
+
if (this.onGrip) this.hooks.setWidth(null);
|
|
17040
|
+
});
|
|
17024
17041
|
pane.addEventListener("mousemove", (e2) => {
|
|
17025
17042
|
if (e2.buttons) return;
|
|
17026
17043
|
const t2 = e2.target;
|
|
@@ -17071,8 +17088,51 @@ var InfoView = class {
|
|
|
17071
17088
|
if (!r2 || r2.error || r2.pending || r2.stale || !r2.type && !r2.expr) return;
|
|
17072
17089
|
this.hooks.cards.show(subtermHtml(r2, (w2) => this.hooks.resolve(w2)), box);
|
|
17073
17090
|
}
|
|
17074
|
-
/**
|
|
17075
|
-
*
|
|
17091
|
+
/** A press on the pane's edge beside the code: dragged, the pane as wide as the pointer makes it,
|
|
17092
|
+
* in this window as it moves and, let go, kept for every window (hooks.setWidth). Dragged left it
|
|
17093
|
+
* widens, the code giving way, or the window growing where it is fitted to its code. */
|
|
17094
|
+
drag(e2) {
|
|
17095
|
+
const pane = this.pane;
|
|
17096
|
+
const split = pane?.parentElement;
|
|
17097
|
+
if (!pane || !split || !e2.isPrimary || e2.pointerType === "mouse" && e2.button !== 0) return;
|
|
17098
|
+
e2.preventDefault();
|
|
17099
|
+
const x0 = e2.clientX, w0 = pane.offsetWidth;
|
|
17100
|
+
let w2 = w0;
|
|
17101
|
+
pane.setPointerCapture(e2.pointerId);
|
|
17102
|
+
split.classList.add("iv-sizing");
|
|
17103
|
+
const move = (ev) => {
|
|
17104
|
+
if (ev.pointerId !== e2.pointerId) return;
|
|
17105
|
+
w2 = paneWidth(w0 + x0 - ev.clientX, this.room());
|
|
17106
|
+
pane.style.width = `${w2}px`;
|
|
17107
|
+
};
|
|
17108
|
+
const end = (ev) => {
|
|
17109
|
+
if (ev.pointerId !== e2.pointerId) return;
|
|
17110
|
+
pane.removeEventListener("pointermove", move);
|
|
17111
|
+
pane.removeEventListener("pointerup", end);
|
|
17112
|
+
pane.removeEventListener("pointercancel", end);
|
|
17113
|
+
split.classList.remove("iv-sizing");
|
|
17114
|
+
if (w2 !== w0) this.hooks.setWidth(w2);
|
|
17115
|
+
};
|
|
17116
|
+
pane.addEventListener("pointermove", move);
|
|
17117
|
+
pane.addEventListener("pointerup", end);
|
|
17118
|
+
pane.addEventListener("pointercancel", end);
|
|
17119
|
+
}
|
|
17120
|
+
/** The width the code and the pane beside it may share (paneWidth's `room`): the window's, or the
|
|
17121
|
+
* most it may grow to where it is fitted to its code. */
|
|
17122
|
+
room() {
|
|
17123
|
+
const split = this.pane?.parentElement;
|
|
17124
|
+
if (!split) return 0;
|
|
17125
|
+
const win2 = this.hooks.win();
|
|
17126
|
+
const max = this.hooks.fitted() ? parseFloat(getComputedStyle(win2).maxWidth) : NaN;
|
|
17127
|
+
return split.clientWidth + (Number.isFinite(max) ? Math.max(0, max - win2.offsetWidth) : 0);
|
|
17128
|
+
}
|
|
17129
|
+
/** The reader's width for the pane changed, in another window or this one: it takes it. */
|
|
17130
|
+
resized() {
|
|
17131
|
+
this.size();
|
|
17132
|
+
}
|
|
17133
|
+
/** Keep the pane beside the code where the window is wide enough, else below it, as wide there as
|
|
17134
|
+
* the reader made it (paneWidth); and tell the pane how tall the window's scrolled view is, which
|
|
17135
|
+
* it stays within. */
|
|
17076
17136
|
watchSize() {
|
|
17077
17137
|
if (this.sizer || typeof ResizeObserver === "undefined") return this.size();
|
|
17078
17138
|
this.sizer = new ResizeObserver(() => this.size());
|
|
@@ -17085,6 +17145,12 @@ var InfoView = class {
|
|
|
17085
17145
|
if (!split || !scroll) return;
|
|
17086
17146
|
const side2 = paneSide(this.hooks.win().offsetWidth, this.hooks.fitted(), document.documentElement.clientWidth || innerWidth);
|
|
17087
17147
|
split.classList.toggle("iv-side", side2);
|
|
17148
|
+
const pane = this.pane;
|
|
17149
|
+
if (!side2) pane.style.width = "";
|
|
17150
|
+
else if (!split.classList.contains("iv-sizing")) {
|
|
17151
|
+
const w2 = `${paneWidth(this.hooks.width(), this.room())}px`;
|
|
17152
|
+
if (pane.style.width !== w2) pane.style.width = w2;
|
|
17153
|
+
}
|
|
17088
17154
|
scroll.style.setProperty("--sw-view", `${scroll.clientHeight}px`);
|
|
17089
17155
|
this.below();
|
|
17090
17156
|
}
|
|
@@ -17673,6 +17739,8 @@ var SourceWindow = class {
|
|
|
17673
17739
|
card: (name) => ({ html: this.fromGraph(name), more: this.describe(name) }),
|
|
17674
17740
|
hidden: () => this.hooks.infoHidden?.() ?? false,
|
|
17675
17741
|
hide: (on) => this.hooks.hideInfo?.(on),
|
|
17742
|
+
width: () => this.hooks.infoWidth?.() ?? null,
|
|
17743
|
+
setWidth: (w2) => this.hooks.setInfoWidth?.(w2),
|
|
17676
17744
|
moved: () => this.hooks.caretMoved?.(this),
|
|
17677
17745
|
win: () => this.el,
|
|
17678
17746
|
fitted: () => this.win.fitted,
|
|
@@ -18018,6 +18086,10 @@ var SourceWindow = class {
|
|
|
18018
18086
|
infoChanged() {
|
|
18019
18087
|
this.info.draw();
|
|
18020
18088
|
}
|
|
18089
|
+
/** The InfoView's width beside the code set by the reader, in every window. */
|
|
18090
|
+
infoResized() {
|
|
18091
|
+
this.info.resized();
|
|
18092
|
+
}
|
|
18021
18093
|
/** Nothing picked: the quote button goes. */
|
|
18022
18094
|
unpick() {
|
|
18023
18095
|
this.picked = null;
|
|
@@ -42338,6 +42410,16 @@ function panelsPart(page) {
|
|
|
42338
42410
|
store2.save();
|
|
42339
42411
|
for (const w2 of sources.all) w2.infoChanged();
|
|
42340
42412
|
},
|
|
42413
|
+
// its width beside the code, the reader's too (the owner's decision of 2026-11-10)
|
|
42414
|
+
infoWidth: () => {
|
|
42415
|
+
const w2 = store2.data.infoWidth;
|
|
42416
|
+
return typeof w2 === "number" && Number.isFinite(w2) ? w2 : null;
|
|
42417
|
+
},
|
|
42418
|
+
setInfoWidth: (w2) => {
|
|
42419
|
+
store2.data.infoWidth = w2 ?? void 0;
|
|
42420
|
+
store2.save();
|
|
42421
|
+
for (const s2 of sources.all) s2.infoResized();
|
|
42422
|
+
},
|
|
42341
42423
|
caretMoved: (w2) => {
|
|
42342
42424
|
for (const o2 of sources.all) if (o2 !== w2) o2.followCaret(null);
|
|
42343
42425
|
page.people.report();
|
|
@@ -48655,6 +48737,48 @@ function hangCard(icon, off, w2, h2, room2, avoid = null) {
|
|
|
48655
48737
|
}
|
|
48656
48738
|
return { box: best.box, flip: best.flip };
|
|
48657
48739
|
}
|
|
48740
|
+
var CARD_APART = 6;
|
|
48741
|
+
function spreadCards(cards) {
|
|
48742
|
+
const out = cards.map((c3) => c3.box);
|
|
48743
|
+
const taken = cards.filter((c3) => c3.fixed).map((c3) => c3.box);
|
|
48744
|
+
const free = cards.map((c3, i2) => ({ c: c3, i: i2 })).filter(({ c: c3 }) => !c3.fixed).sort((a3, b2) => a3.c.box.y0 - b2.c.box.y0 || a3.c.box.x0 - b2.c.box.x0 || a3.i - b2.i);
|
|
48745
|
+
for (const { c: c3, i: i2 } of free) {
|
|
48746
|
+
const b2 = c3.box;
|
|
48747
|
+
const meets2 = (x2) => taken.some((t2) => area(x2, t2) > 0);
|
|
48748
|
+
if (!meets2(b2)) {
|
|
48749
|
+
taken.push(b2);
|
|
48750
|
+
continue;
|
|
48751
|
+
}
|
|
48752
|
+
const w2 = b2.x1 - b2.x0, h2 = b2.y1 - b2.y0;
|
|
48753
|
+
const outside2 = (x2) => Math.max(0, w2 * h2 - area(x2, c3.room));
|
|
48754
|
+
const was = { out: outside2(b2), covers: !!c3.avoid && area(b2, c3.avoid) > 0 };
|
|
48755
|
+
const [ix, iy] = c3.icon;
|
|
48756
|
+
const off = [(b2.x0 + b2.x1) / 2 - ix, (b2.y0 + b2.y1) / 2 - iy];
|
|
48757
|
+
const fits = (x2) => {
|
|
48758
|
+
const dx = (x2.x0 + x2.x1) / 2 - ix, dy = (x2.y0 + x2.y1) / 2 - iy;
|
|
48759
|
+
if (Math.abs(dx) > CARD_REACH || Math.abs(dy) > CARD_REACH) return false;
|
|
48760
|
+
if (Math.abs(dx) < w2 / 2 + ICON_CLEAR && Math.abs(dy) < h2 / 2 + ICON_CLEAR) return false;
|
|
48761
|
+
if (outside2(x2) > was.out + 0.5) return false;
|
|
48762
|
+
if (!was.covers && c3.avoid && area(x2, c3.avoid) > 0) return false;
|
|
48763
|
+
return !meets2(x2);
|
|
48764
|
+
};
|
|
48765
|
+
const by = (x2, dx, dy) => ({ x0: x2.x0 + dx, y0: x2.y0 + dy, x1: x2.x1 + dx, y1: x2.y1 + dy });
|
|
48766
|
+
const ways = [];
|
|
48767
|
+
for (const [fx, fy] of FLIPS) {
|
|
48768
|
+
const f2 = cardBox(ix, iy, [off[0] * fx, off[1] * fy], w2, h2);
|
|
48769
|
+
ways.push(f2);
|
|
48770
|
+
for (const t2 of taken)
|
|
48771
|
+
ways.push(by(f2, 0, t2.y0 - CARD_APART - f2.y1), by(f2, 0, t2.y1 + CARD_APART - f2.y0), by(f2, t2.x0 - CARD_APART - f2.x1, 0), by(f2, t2.x1 + CARD_APART - f2.x0, 0));
|
|
48772
|
+
}
|
|
48773
|
+
const cx = (b2.x0 + b2.x1) / 2, cy = (b2.y0 + b2.y1) / 2;
|
|
48774
|
+
const far = ways.map((x2, k2) => ({ x: x2, k: k2, d: Math.hypot((x2.x0 + x2.x1) / 2 - cx, (x2.y0 + x2.y1) / 2 - cy) }));
|
|
48775
|
+
far.sort((p2, q2) => p2.d - q2.d || p2.k - q2.k);
|
|
48776
|
+
const best = far.find((p2) => fits(p2.x))?.x ?? b2;
|
|
48777
|
+
out[i2] = best;
|
|
48778
|
+
taken.push(best);
|
|
48779
|
+
}
|
|
48780
|
+
return out;
|
|
48781
|
+
}
|
|
48658
48782
|
function leaderLine(x2, y2, b2) {
|
|
48659
48783
|
const px2 = Math.max(b2.x0, Math.min(b2.x1, x2)), py = Math.max(b2.y0, Math.min(b2.y1, y2));
|
|
48660
48784
|
const d2 = Math.hypot(px2 - x2, py - y2);
|
|
@@ -49026,6 +49150,8 @@ var Stickies = class {
|
|
|
49026
49150
|
nbOf = { L: null, nodes: null, mode: null };
|
|
49027
49151
|
/** the ring around the board, as drawn in the last frame */
|
|
49028
49152
|
ring = null;
|
|
49153
|
+
/** the cards open this frame, as each hangs by itself: set apart once all are placed (hangCards) */
|
|
49154
|
+
opened = [];
|
|
49029
49155
|
/** what would hold the note whose icon is dragged, were it let go now */
|
|
49030
49156
|
target = null;
|
|
49031
49157
|
/** the circle round its declaration, while the icon of a note attached to one is dragged */
|
|
@@ -49305,6 +49431,7 @@ var Stickies = class {
|
|
|
49305
49431
|
const S7 = C7.scene;
|
|
49306
49432
|
const W2 = innerWidth, H2 = innerHeight;
|
|
49307
49433
|
this.topRing = void 0;
|
|
49434
|
+
this.opened = [];
|
|
49308
49435
|
const onRing = [];
|
|
49309
49436
|
const inCluster = [];
|
|
49310
49437
|
for (const d3 of this.drawn.values()) {
|
|
@@ -49320,6 +49447,7 @@ var Stickies = class {
|
|
|
49320
49447
|
else this.place(d3, s2.x, s2.y, look, t2, s2.point);
|
|
49321
49448
|
}
|
|
49322
49449
|
this.frameRing(onRing);
|
|
49450
|
+
this.hangCards();
|
|
49323
49451
|
const p2 = this.dragging();
|
|
49324
49452
|
const d2 = p2?.part === "icon" && p2.now ? this.drawn.get(p2.id) : void 0;
|
|
49325
49453
|
const aim2 = d2 && p2?.now ? this.aimFor(d2, p2.now) : null;
|
|
@@ -49423,9 +49551,10 @@ var Stickies = class {
|
|
|
49423
49551
|
/** Note `d` drawn at (wx, wy) of the board's world — its place, or, attached to a declaration whose
|
|
49424
49552
|
* point is at `point`, its spot at its offset from it —, in `look`, `t` of its icon showing (1 its
|
|
49425
49553
|
* icon, 0 its dot, between a blend: shared/notecard.ts, iconShare): its mark, and where it is open
|
|
49426
|
-
* its card, hanging as its offset says and flipped to stay on the screen,
|
|
49427
|
-
*
|
|
49428
|
-
*
|
|
49554
|
+
* its card, hanging as its offset says and flipped to stay on the screen, then set apart from the
|
|
49555
|
+
* other open cards and joined to the icon by its leader (hangCards); attached, the dashed leader to
|
|
49556
|
+
* the declaration's point. Hidden where its mark is off the screen. What is dragged follows the
|
|
49557
|
+
* pointer instead: the icon with its card, or the card alone. */
|
|
49429
49558
|
place(d2, wx, wy, look, t2 = 1, point = null) {
|
|
49430
49559
|
const C7 = this.canvas;
|
|
49431
49560
|
const k2 = C7.cam.k;
|
|
@@ -49458,13 +49587,30 @@ var Stickies = class {
|
|
|
49458
49587
|
return;
|
|
49459
49588
|
}
|
|
49460
49589
|
const [w2, h2] = this.cardSizeOf(d2);
|
|
49461
|
-
|
|
49590
|
+
const room2 = this.room();
|
|
49591
|
+
let box, avoid = null;
|
|
49462
49592
|
if (p2?.part === "card" && p2.now) box = { x0: p2.now[0], y0: p2.now[1], x1: p2.now[0] + w2, y1: p2.now[1] + h2 };
|
|
49463
49593
|
else {
|
|
49464
|
-
const
|
|
49465
|
-
|
|
49594
|
+
const hang = this.hangOf(d2, w2, h2);
|
|
49595
|
+
avoid = hang.avoid;
|
|
49596
|
+
box = hangCard([sx, sy], hang.off, w2, h2, room2, avoid).box;
|
|
49466
49597
|
}
|
|
49467
49598
|
d2.box = box;
|
|
49599
|
+
this.opened.push({ d: d2, card: { icon: [sx, sy], box, room: room2, avoid, fixed: !!p2 || !!d2.note.card } });
|
|
49600
|
+
}
|
|
49601
|
+
/** The open cards set apart from one another, as far as they can be (the owner's decision of
|
|
49602
|
+
* 2026-11-10; shared/notecard.ts, spreadCards), and each hung there, joined to its icon by its
|
|
49603
|
+
* leader. */
|
|
49604
|
+
hangCards() {
|
|
49605
|
+
const opened = this.opened;
|
|
49606
|
+
this.opened = [];
|
|
49607
|
+
const boxes = spreadCards(opened.map((o2) => o2.card));
|
|
49608
|
+
opened.forEach(({ d: d2, card }, k2) => this.hang(d2, card.icon, boxes[k2]));
|
|
49609
|
+
}
|
|
49610
|
+
/** Note `d`'s card hung at `box`, its leader from its icon at `icon`. */
|
|
49611
|
+
hang(d2, icon, box) {
|
|
49612
|
+
const [sx, sy] = icon;
|
|
49613
|
+
d2.box = box;
|
|
49468
49614
|
d2.card.style.transform = `translate(${Math.round(box.x0)}px, ${Math.round(box.y0)}px)`;
|
|
49469
49615
|
const line = leaderLine(sx, sy, box);
|
|
49470
49616
|
d2.lead.hidden = !line;
|
package/dist/web/style.css
CHANGED
|
@@ -812,7 +812,21 @@ button.o-trust:hover { color: var(--accent); background: var(--code-bg); }
|
|
|
812
812
|
contain: inline-size; position: sticky; bottom: 0; max-height: max(140px, calc(var(--sw-view, 60vh) * 0.45));
|
|
813
813
|
border-top: 1px solid var(--line); box-shadow: 0 -10px 18px -16px rgba(0, 0, 0, 0.35);
|
|
814
814
|
}
|
|
815
|
-
|
|
815
|
+
/* beside the code, as wide as the reader made it (web/src/infoview.ts, paneWidth: its own 360 px); its
|
|
816
|
+
head stays and its body scrolls, so that the grip on its left edge stays in sight */
|
|
817
|
+
.sw-split.iv-side > .sw-info {
|
|
818
|
+
flex: none; width: 360px; position: sticky; top: 0; max-height: var(--sw-view, 70vh); border-left: 1px solid var(--line);
|
|
819
|
+
display: flex; flex-direction: column; overflow: visible;
|
|
820
|
+
}
|
|
821
|
+
.sw-split.iv-side > .sw-info > .iv-head { flex: none; }
|
|
822
|
+
.sw-split.iv-side > .sw-info > .iv-body { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
|
|
823
|
+
/* the grip: the pane's left edge, dragged to widen or narrow it, double-clicked for its own width; the
|
|
824
|
+
line lights under the pointer and while dragged */
|
|
825
|
+
.iv-grip { display: none; }
|
|
826
|
+
.sw-split.iv-side > .sw-info > .iv-grip { display: block; position: absolute; z-index: 2; top: 0; bottom: 0; left: -5px; width: 9px; cursor: ew-resize; touch-action: none; }
|
|
827
|
+
.iv-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background 0.15s, box-shadow 0.15s; }
|
|
828
|
+
.iv-grip:hover::after, .iv-sizing .iv-grip::after { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
|
|
829
|
+
.sw-split.iv-sizing, .sw-split.iv-sizing * { cursor: ew-resize !important; user-select: none; -webkit-user-select: none; }
|
|
816
830
|
.iv-head {
|
|
817
831
|
position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px;
|
|
818
832
|
background: var(--surface-solid); border-bottom: 1px solid var(--line); font: 12px var(--font);
|