visualproof 0.4.2 → 0.4.3

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.
@@ -18912,8 +18912,17 @@ var FocusMenu = class {
18912
18912
 
18913
18913
  // src/web/src/phone.ts
18914
18914
  var PHONE = "(max-width: 640px)";
18915
+ var TALL = "(min-width: 641px) and (max-aspect-ratio: 5/6)";
18916
+ var SHEETED = "(max-width: 640px), (max-aspect-ratio: 5/6)";
18917
+ var matches = (q2) => typeof matchMedia === "function" && matchMedia(q2).matches;
18915
18918
  function isPhone() {
18916
- return typeof matchMedia === "function" && matchMedia(PHONE).matches;
18919
+ return matches(PHONE);
18920
+ }
18921
+ function isTall() {
18922
+ return matches(TALL);
18923
+ }
18924
+ function sheeted() {
18925
+ return matches(SHEETED);
18917
18926
  }
18918
18927
  var ITEMS = [
18919
18928
  { id: "share-btn", label: "Share" },
@@ -18934,6 +18943,28 @@ var SIDE_POPS = [
18934
18943
  var SHEET_MID = 0.55;
18935
18944
  var SHEET_TOP = 0.92;
18936
18945
  var GRIP_PX = 34;
18946
+ var TALL_MID = 0.5;
18947
+ var TALL_LEAST = 0.33;
18948
+ var TALL_TOP_PX = 120;
18949
+ var EDGE_PX = 12;
18950
+ var SHEETS = ["panel", "activity", "lostfound"];
18951
+ var DOCKED = "#windows > :is(.sw-win, .pw-win, #following.talking):not(.collapsed, [hidden])";
18952
+ function tallInsets() {
18953
+ const $5 = (id) => document.getElementById(id);
18954
+ const bar = $5("selbar");
18955
+ const strip = [$5("lensbar"), $5("tm-kept")].find((e2) => e2 && !e2.hidden);
18956
+ const under2 = !bar.hidden ? bar.getBoundingClientRect().bottom : strip ? strip.getBoundingClientRect().bottom : $5("viewbar").getBoundingClientRect().bottom;
18957
+ let low = 0;
18958
+ for (const id of SHEETS) {
18959
+ const el = $5(id);
18960
+ if (el?.classList.contains("open")) low = Math.max(low, el.offsetHeight);
18961
+ }
18962
+ if (document.querySelector(DOCKED)) low = Math.max(low, $5("windows").offsetHeight);
18963
+ const room2 = low ? low + EDGE_PX + 8 : EDGE_PX;
18964
+ document.body.style.setProperty("--room-bottom", `${room2}px`);
18965
+ document.body.style.setProperty("--room-shown", innerHeight - room2 - under2 < 200 ? "hidden" : "visible");
18966
+ return { left: 0, right: 0, top: under2 + 12, bottom: room2 + 36 };
18967
+ }
18937
18968
  var Phone = class {
18938
18969
  hooks;
18939
18970
  pop;
@@ -18971,12 +19002,30 @@ var Phone = class {
18971
19002
  }).observe(badge, { attributes: true, childList: true, characterData: true, subtree: true });
18972
19003
  document.getElementById("side-btn").addEventListener("click", () => this.drawer(!document.body.classList.contains("side-open")));
18973
19004
  document.getElementById("side").addEventListener("click", (e2) => {
18974
- if (!isPhone()) return;
19005
+ if (!sheeted()) return;
18975
19006
  const t2 = e2.target;
18976
19007
  if (t2.closest(".tw, button, [data-sec]")) return;
18977
19008
  if (t2.closest(".tg-row, .o-row, [data-go], [data-open]")) setTimeout(() => this.drawer(false), 120);
18978
19009
  });
18979
- this.bindSheet(document.getElementById("panel"));
19010
+ for (const id of SHEETS) {
19011
+ const el = document.getElementById(id);
19012
+ if (el) this.bindSheet(el);
19013
+ }
19014
+ const dock = document.getElementById("windows");
19015
+ if (dock) this.bindSheet(dock, 14, true);
19016
+ const changed = () => {
19017
+ if (!sheeted()) this.drawer(false);
19018
+ this.sizeSheet();
19019
+ this.hooks.resized();
19020
+ };
19021
+ if (typeof matchMedia === "function") for (const q2 of [PHONE, TALL]) matchMedia(q2).addEventListener("change", changed);
19022
+ addEventListener("resize", () => this.sizeSheet());
19023
+ this.sizeSheet();
19024
+ const windows = document.getElementById("windows");
19025
+ if (windows)
19026
+ new MutationObserver((ms) => {
19027
+ if (isTall() && ms.some((m3) => m3.type === "childList" ? m3.target === windows : m3.target.parentNode === windows)) this.hooks.resized();
19028
+ }).observe(windows, { childList: true, subtree: true, attributes: true, attributeFilter: ["class", "hidden"] });
18980
19029
  for (const [id, close] of [["activity", "[data-act-close]"], ["lostfound", "[data-lf-close]"]]) {
18981
19030
  const el = document.getElementById(id);
18982
19031
  el?.addEventListener("click", (e2) => {
@@ -19037,24 +19086,63 @@ var Phone = class {
19037
19086
  document.body.classList.toggle("side-open", on);
19038
19087
  document.getElementById("side-btn").setAttribute("aria-expanded", String(on));
19039
19088
  }
19040
- /** The panel's sheet: a tap on its handle, at its top, makes it the whole screen or half of it
19041
- * (PhoneSpec decision 10: a tap, not a drag); ✕ closes it. */
19042
- bindSheet(panel) {
19089
+ /** The sheet's height as a share of the screen's, while the page is open: on a phone the middle
19090
+ * or the top (decision 10), on a tall screen what the reader set (decision 20). */
19091
+ share = { phone: SHEET_MID, tall: TALL_MID };
19092
+ /** The sheet's height, in px, for the screen as it is now (`--sheet-h`: the panel, Activity, the
19093
+ * lost-and-found and the windows docked in their place read it). */
19094
+ sizeSheet() {
19095
+ const tall = isTall();
19096
+ const h2 = tall ? Math.min(innerHeight * this.share.tall, innerHeight - TALL_TOP_PX - EDGE_PX) : innerHeight * this.share.phone;
19097
+ document.documentElement.style.setProperty("--sheet-h", `${Math.round(h2)}px`);
19098
+ }
19099
+ /** A sheet: a tap on its handle, at its top, makes it the tallest or half of the screen (PhoneSpec
19100
+ * decision 10: on a phone a tap, not a drag); on a tall screen a drag on the handle sets its
19101
+ * height too (decision 20). ✕ closes it. */
19102
+ bindSheet(sheet, grip = GRIP_PX, own2 = false) {
19043
19103
  let press = null;
19044
- panel.addEventListener("pointerdown", (e2) => {
19045
- if (!isPhone() || e2.button !== 0) return;
19046
- const r2 = panel.getBoundingClientRect();
19047
- press = e2.clientY - r2.top <= GRIP_PX ? { id: e2.pointerId, y: e2.clientY } : null;
19048
- });
19049
- panel.addEventListener("pointerup", (e2) => {
19104
+ const move = (e2) => {
19105
+ const p2 = press;
19106
+ if (!p2 || p2.id !== e2.pointerId) return;
19107
+ if (!p2.dragged && Math.abs(e2.clientY - p2.y) <= 10) return;
19108
+ p2.dragged = true;
19109
+ sheet.classList.add("sizing");
19110
+ const h2 = Math.max(innerHeight * TALL_LEAST, Math.min(p2.h + p2.y - e2.clientY, innerHeight - TALL_TOP_PX - EDGE_PX));
19111
+ this.share.tall = h2 / innerHeight;
19112
+ this.sizeSheet();
19113
+ };
19114
+ const end = (e2) => {
19050
19115
  const p2 = press;
19116
+ if (!p2 || p2.id !== e2.pointerId) return;
19051
19117
  press = null;
19052
- if (!p2 || p2.id !== e2.pointerId || Math.abs(e2.clientY - p2.y) > 10) return;
19053
- const full = panel.getBoundingClientRect().height > innerHeight * ((SHEET_MID + SHEET_TOP) / 2);
19054
- panel.style.setProperty("--sheet-h", `${Math.round(innerHeight * (full ? SHEET_MID : SHEET_TOP))}px`);
19118
+ removeEventListener("pointermove", move);
19119
+ removeEventListener("pointerup", end);
19120
+ removeEventListener("pointercancel", end);
19121
+ sheet.classList.remove("sizing");
19122
+ if (e2.type === "pointercancel") return;
19123
+ if (p2.dragged) return void this.hooks.resized();
19124
+ if (Math.abs(e2.clientY - p2.y) > 10) return;
19125
+ if (isTall()) {
19126
+ const top = (innerHeight - TALL_TOP_PX - EDGE_PX) / innerHeight;
19127
+ this.share.tall = this.share.tall > (TALL_MID + top) / 2 ? TALL_MID : top;
19128
+ } else {
19129
+ const full = sheet.getBoundingClientRect().height > innerHeight * ((SHEET_MID + SHEET_TOP) / 2);
19130
+ this.share.phone = full ? SHEET_MID : SHEET_TOP;
19131
+ }
19132
+ this.sizeSheet();
19055
19133
  setTimeout(() => this.hooks.resized(), 240);
19134
+ };
19135
+ sheet.addEventListener("pointerdown", (e2) => {
19136
+ if (!sheeted() || e2.button !== 0 || press) return;
19137
+ if (e2.target.closest("button, a, input, textarea, select") || own2 && e2.target !== sheet) return;
19138
+ if (own2 && !isTall()) return;
19139
+ const r2 = sheet.getBoundingClientRect();
19140
+ if (e2.clientY - r2.top > grip) return;
19141
+ press = { id: e2.pointerId, y: e2.clientY, h: r2.height, dragged: false };
19142
+ if (isTall()) addEventListener("pointermove", move);
19143
+ addEventListener("pointerup", end);
19144
+ addEventListener("pointercancel", end);
19056
19145
  });
19057
- panel.addEventListener("pointercancel", () => press = null);
19058
19146
  }
19059
19147
  };
19060
19148
 
@@ -19518,7 +19606,7 @@ function tipsFor(ctx, tips = TIPS) {
19518
19606
  function plain(html) {
19519
19607
  return html.replace(/<[^>]*>/g, "").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
19520
19608
  }
19521
- function matches(t2, filter) {
19609
+ function matches2(t2, filter) {
19522
19610
  const words = filter.toLowerCase().split(/\s+/).filter(Boolean);
19523
19611
  const text2 = `${t2.title} ${plain(t2.text)}`.toLowerCase();
19524
19612
  return words.every((w2) => text2.includes(w2));
@@ -19537,7 +19625,7 @@ function rowHtml(t2, ctx, open) {
19537
19625
  return `<div class="ref${open ? " open" : ""}" data-tip="${t2.id}"><button class="ref-head" data-ref-toggle="${t2.id}" aria-expanded="${open}"><span class="ref-title">${escapeHtml(t2.title)}${isNew ? ` <span class="tip-new">New</span>` : ""}</span><span class="ref-line">${escapeHtml(plain(t2.text))}</span></button>` + (open ? `<div class="ref-body"><div class="tip-text">${t2.text}</div>${clip}${actsHtml(t2.showMe, t2.manual, ctx, `data-tip-show="${t2.id}"`)}</div>` : "") + `</div>`;
19538
19626
  }
19539
19627
  function refsHtml(ctx, filter, open) {
19540
- const mine = tipsFor(ctx).filter((t2) => matches(t2, filter));
19628
+ const mine = tipsFor(ctx).filter((t2) => matches2(t2, filter));
19541
19629
  if (!mine.length) return `<div class="tips-none help-note">No tip says that. The <b>Keys</b> tab lists every key.</div>`;
19542
19630
  return GROUPS.map((g2) => {
19543
19631
  const of = mine.filter((t2) => t2.group === g2.id);
@@ -20196,10 +20284,12 @@ function around(...sels) {
20196
20284
  function board() {
20197
20285
  const side2 = $2("#side")?.getBoundingClientRect();
20198
20286
  const panel = $2("#panel.open")?.getBoundingClientRect();
20199
- const left = side2 && side2.width && !isPhone() ? side2.right + 8 : 12;
20200
- const right = panel && panel.width && !isPhone() ? panel.left - 8 : innerWidth - 12;
20201
- const top = isPhone() ? 104 : 108;
20202
- const bottom = isPhone() && panel && panel.height ? panel.top - 8 : innerHeight - 48;
20287
+ const sheet = sheeted();
20288
+ const bar = isTall() ? $2("#selbar:not([hidden])")?.getBoundingClientRect() : void 0;
20289
+ const left = side2 && side2.width && !sheet ? side2.right + 8 : 12;
20290
+ const right = panel && panel.width && !sheet ? panel.left - 8 : innerWidth - 12;
20291
+ const top = isPhone() ? 104 : bar?.height ? bar.bottom + 8 : 108;
20292
+ const bottom = sheet && panel && panel.height ? panel.top - 8 : innerHeight - 48;
20203
20293
  return new DOMRect(left, top, Math.max(40, right - left), Math.max(40, bottom - top));
20204
20294
  }
20205
20295
  var TOUCH = [
@@ -21920,6 +22010,7 @@ var FloatWindow = class {
21920
22010
  * touch alike, the pointer captured until it is let go. */
21921
22011
  press(e2) {
21922
22012
  if (!this.o.live() || this.collapsed || this.dragging || !e2.isPrimary || e2.pointerType === "mouse" && e2.button !== 0) return;
22013
+ if (sheeted()) return;
21923
22014
  const t2 = e2.target;
21924
22015
  const edge = t2.closest("[data-rz]");
21925
22016
  const bar = t2.closest(this.o.handle);
@@ -23236,7 +23327,7 @@ function offsetIn(root, node, off) {
23236
23327
  }
23237
23328
 
23238
23329
  // src/web/src/reload.ts
23239
- var PAGE_VERSION = true ? "0.4.2" : null;
23330
+ var PAGE_VERSION = true ? "0.4.3" : null;
23240
23331
  var KEY4 = "visualproof:reload";
23241
23332
  var FOR_KEY2 = "visualproof:reloaded-for";
23242
23333
  var FRESH_MS = 10 * 6e4;
@@ -44403,7 +44494,7 @@ function lineOf(p2, k2) {
44403
44494
  const next = p2.lines.find((s2) => s2 > k2);
44404
44495
  return [first, (next ?? p2.words.length) - 1];
44405
44496
  }
44406
- var TALL = 3;
44497
+ var TALL2 = 3;
44407
44498
  var usualHeights = /* @__PURE__ */ new WeakMap();
44408
44499
  function usualHeight(words) {
44409
44500
  let h2 = usualHeights.get(words);
@@ -44415,7 +44506,7 @@ function usualHeight(words) {
44415
44506
  return h2;
44416
44507
  }
44417
44508
  function nearestWord(p2, x2, y2, aspect) {
44418
- const tall = TALL * usualHeight(p2.words);
44509
+ const tall = TALL2 * usualHeight(p2.words);
44419
44510
  let best = -1;
44420
44511
  let bestRank = 3;
44421
44512
  let bestD = Infinity;
@@ -47612,7 +47703,7 @@ var NOTE_LINES = 14;
47612
47703
  var DOT = 4;
47613
47704
  var EASE_MS = 480;
47614
47705
  var SLIDE_MS = 70;
47615
- var EDGE_PX = 48;
47706
+ var EDGE_PX2 = 48;
47616
47707
  var EDGE_SPEED = 0.9;
47617
47708
  var ARCS_MOST = 6e3;
47618
47709
  var FOLD_MORE = 10;
@@ -47625,7 +47716,8 @@ var LinearForm = class {
47625
47716
  ctx;
47626
47717
  canvas;
47627
47718
  hooks;
47628
- /** why it is shown: the Export window is open, the reader asked for it */
47719
+ /** why it is shown: the Export window is open, the reader asked for it, or the reader they follow
47720
+ * shows it (kept once following ends: CollabSpec decision 4) */
47629
47721
  why = /* @__PURE__ */ new Set();
47630
47722
  outline = null;
47631
47723
  rows = [];
@@ -47674,11 +47766,16 @@ var LinearForm = class {
47674
47766
  get shown() {
47675
47767
  return this.why.size > 0;
47676
47768
  }
47677
- /** Whether the reader asked for it (⋯, the key), as followers take it. */
47769
+ /** Whether the reader asked for it (⋯, the key), or has it from a reader they follow or followed:
47770
+ * ⋯ and the key put it away. */
47678
47771
  get asked() {
47679
- return this.why.has("reader");
47772
+ return this.why.has("reader") || this.why.has("followed");
47680
47773
  }
47681
- /** Show it, for the Export window or at the reader's asking. */
47774
+ /** Whether it shows as a followed reader's does, or did when following ended. */
47775
+ get followed() {
47776
+ return this.why.has("followed");
47777
+ }
47778
+ /** Show it, for the Export window, at the reader's asking, or as a followed reader's. */
47682
47779
  async show(why) {
47683
47780
  const was = this.shown;
47684
47781
  this.why.add(why);
@@ -47698,9 +47795,11 @@ var LinearForm = class {
47698
47795
  this.ease(1);
47699
47796
  this.hooks.changed(true);
47700
47797
  }
47701
- /** Put it away, for `why`; the board comes back once nothing asks for it. */
47702
- hide(why) {
47703
- if (!this.why.delete(why) || this.shown) return;
47798
+ /** Put it away, for each of `whys`; the board comes back once nothing asks for it. */
47799
+ hide(...whys) {
47800
+ const was = this.shown;
47801
+ for (const w2 of whys) this.why.delete(w2);
47802
+ if (!was || this.shown) return;
47704
47803
  this.turn++;
47705
47804
  this.press = null;
47706
47805
  this.drag = null;
@@ -47710,7 +47809,7 @@ var LinearForm = class {
47710
47809
  this.hooks.changed(false);
47711
47810
  }
47712
47811
  toggle() {
47713
- if (this.asked) this.hide("reader");
47812
+ if (this.asked) this.hide("reader", "followed");
47714
47813
  else void this.show("reader");
47715
47814
  }
47716
47815
  /** The board changed (a pin, a note, another build, another board): the outline is asked for
@@ -47923,7 +48022,7 @@ var LinearForm = class {
47923
48022
  if (d2) {
47924
48023
  const v2 = this.view();
47925
48024
  const room2 = (v2.h - v2.top) / this.cam.k;
47926
- const edge = d2.py < v2.top + EDGE_PX && this.cam.y > 0 ? -1 : d2.py > v2.h - EDGE_PX && this.cam.y + room2 < this.height ? 1 : 0;
48025
+ const edge = d2.py < v2.top + EDGE_PX2 && this.cam.y > 0 ? -1 : d2.py > v2.h - EDGE_PX2 && this.cam.y + room2 < this.height ? 1 : 0;
47927
48026
  if (edge) {
47928
48027
  this.cam.y += edge * EDGE_SPEED * dt2 / this.cam.k;
47929
48028
  this.clampCam();
@@ -51028,7 +51127,7 @@ var KEEP_GRAPHS = 5;
51028
51127
  var KEEP_LAYOUTS = 16;
51029
51128
  var BUSY_AFTER_MS = 150;
51030
51129
  var DWELL_MS = 90;
51031
- var EDGE_PX2 = 12;
51130
+ var EDGE_PX3 = 12;
51032
51131
  var EDGE_MS = 60;
51033
51132
  var SPIN_MS = 900;
51034
51133
  var spinPhase = () => `animation-delay:-${Math.round(performance.now() % SPIN_MS)}ms`;
@@ -51856,8 +51955,8 @@ var TimeMachine = class {
51856
51955
  const edge = () => {
51857
51956
  const p2 = place2(lastX);
51858
51957
  if (!p2 || dragging === null || !this.ruler) return 0;
51859
- if (p2.x < EDGE_PX2 && this.scroll > 0) return -1;
51860
- if (p2.x > p2.w - EDGE_PX2 && this.scroll < maxScroll(this.ruler)) return 1;
51958
+ if (p2.x < EDGE_PX3 && this.scroll > 0) return -1;
51959
+ if (p2.x > p2.w - EDGE_PX3 && this.scroll < maxScroll(this.ruler)) return 1;
51861
51960
  return 0;
51862
51961
  };
51863
51962
  const roll = () => {
@@ -52659,9 +52758,9 @@ async function boot() {
52659
52758
  else delete document.body.dataset.artBg;
52660
52759
  if (a3 && a3.style !== "board") document.body.dataset.artStyle = a3.style;
52661
52760
  else delete document.body.dataset.artStyle;
52662
- for (const el of document.querySelectorAll(ART_INERT)) el.inert = !!a3;
52761
+ artReach();
52663
52762
  if (a3) {
52664
- linear.hide("reader");
52763
+ linear.hide("reader", "followed");
52665
52764
  document.documentElement.dataset.theme = a3.style === "board" ? a3.theme : "dark";
52666
52765
  } else applyTheme();
52667
52766
  canvas.setArt(a3 && { labels: a3.labels, namesFrom: a3.namesFrom, hidden: new Set(a3.hiddenNames), shown: new Set(a3.shownNames), ruled: new Set(a3.ruledNames), edges: a3.edges, targets: a3.targets, shownTargets: new Set(a3.shownTargets), keys: a3.keys, style: a3.style });
@@ -52669,6 +52768,9 @@ async function boot() {
52669
52768
  syncEdges();
52670
52769
  apply();
52671
52770
  };
52771
+ const artReach = () => {
52772
+ for (const el of document.querySelectorAll(ART_INERT)) el.inert = !!artLook && !(people.following && el.matches(".peers-wrap"));
52773
+ };
52672
52774
  let drawnAt = 0;
52673
52775
  canvas.onFrame = () => {
52674
52776
  drawnAt = performance.now();
@@ -52809,7 +52911,10 @@ async function boot() {
52809
52911
  right: 0,
52810
52912
  top: bar2.hidden ? $4("#viewbar").getBoundingClientRect().bottom + (strip ? 44 : 12) : bar2.getBoundingClientRect().bottom + 12,
52811
52913
  bottom: sheet ? sheet + 8 : 56
52812
- } : {
52914
+ } : isTall() ? (
52915
+ // a tall screen (PhoneSpec, "Tall screens"): the whole width, above the sheet and the dock
52916
+ tallInsets()
52917
+ ) : {
52813
52918
  left: side2.width ? side2.right + 8 : 0,
52814
52919
  // offsetWidth, not the bounding box: the panel may still be sliding in
52815
52920
  right: open ? $4("#panel").offsetWidth + 20 : bar2.hidden ? 0 : bar2.offsetWidth + 20,
@@ -52918,7 +53023,7 @@ async function boot() {
52918
53023
  if (ownScheme() !== v2.scheme) chooseScheme(v2.scheme);
52919
53024
  },
52920
53025
  edges: (v2) => setEdges(v2.edges),
52921
- linear: (v2) => v2.linear ? void linear.show("reader") : linear.hide("reader"),
53026
+ linear: (v2) => v2.linear ? void linear.show("followed") : linear.hide("reader", "followed"),
52922
53027
  artwork: (v2) => art.follow(v2.artwork ?? null)
52923
53028
  }
52924
53029
  };
@@ -52971,16 +53076,23 @@ async function boot() {
52971
53076
  reveal: () => chatWin.reveal(),
52972
53077
  stripDrawn: () => talk.dress(),
52973
53078
  describe: (v2) => describePlace(v2),
52974
- follow: (v2) => void goWhere(v2, false),
53079
+ follow: (v2) => {
53080
+ artReach();
53081
+ void goWhere(v2, false);
53082
+ },
52975
53083
  changed: () => {
52976
53084
  syncPeers();
52977
53085
  peerMenu.render();
52978
53086
  },
52979
53087
  // the windows that stood for the followed reader's are this reader's own now, and none says any
52980
- // more that the reader follows someone
53088
+ // more that the reader follows someone; what following left is theirs to leave (CollabSpec, "What
53089
+ // following leaves"): the artwork mode's bar, all but Share and Search out of reach again; the
53090
+ // linear form, which nothing on the screen says how to put away — the line does, once
52981
53091
  unfollowed: () => {
52982
53092
  sources.release();
52983
53093
  papers.unfollowed();
53094
+ artReach();
53095
+ if (!people.following && linear.followed && !exportModal.isOpen) say(`The board stays in the linear form you followed: ${isPhone() ? "\u22EF at the bottom \u2192 Linear form puts" : "o, or \u22EF at the bottom \u2192 Linear form, puts"} it away.`);
52984
53096
  },
52985
53097
  // what is left to review where the review has a focus is the reader's own
52986
53098
  renamed: () => {
@@ -53045,12 +53157,15 @@ async function boot() {
53045
53157
  else if (!(id && await nav.select(id, to)) && scope2) await nav.open(scope2, to);
53046
53158
  const reached = nav.board.id === id || scope2 !== null && nav.query() === scope2;
53047
53159
  if (once && !reached) place2(to, false);
53048
- if (v2.history) {
53049
- if (!tm.active) await tm.open({ snapshot: v2.history.snapshot });
53050
- else if (tm.snapshot !== v2.history.snapshot) await tm.show(v2.history.snapshot);
53051
- } else if (tm.active) await tm.close();
53160
+ const ended = () => !once && !people.following;
53161
+ if (!ended()) {
53162
+ if (v2.history) {
53163
+ if (!tm.active) await tm.open({ snapshot: v2.history.snapshot });
53164
+ else if (tm.snapshot !== v2.history.snapshot) await tm.show(v2.history.snapshot);
53165
+ } else if (tm.active) await tm.close();
53166
+ }
53052
53167
  writeAddress(false);
53053
- if (!once && !people.following) return reached;
53168
+ if (ended()) return reached;
53054
53169
  applyOwn(v2, parts.apply);
53055
53170
  if (!once) papers.mirror(v2.paper);
53056
53171
  if (!pastShown())
@@ -53308,7 +53423,10 @@ async function boot() {
53308
53423
  },
53309
53424
  start: (body) => data.exportDoc(body),
53310
53425
  poll: (id) => data.exportJob(id),
53311
- shown: (open) => open ? void linear.show("export") : linear.hide("export"),
53426
+ // the window closing, following nobody, takes with it the form following left, which nobody here
53427
+ // asked for: the followed reader's own Export window drew it, as often as not (CollabSpec, "What
53428
+ // following leaves")
53429
+ shown: (open) => open ? void linear.show("export") : people.following ? linear.hide("export") : linear.hide("export", "followed"),
53312
53430
  artwork: () => art.open(),
53313
53431
  artworkOnly: () => !!data.snapshot
53314
53432
  });
@@ -1019,7 +1019,9 @@ button.o-trust:hover { color: var(--accent); background: var(--code-bg); }
1019
1019
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
1020
1020
  }
1021
1021
  #peer-menu[hidden] { display: none; }
1022
- #bar:has(#peer-menu:not([hidden])) { z-index: 36; }
1022
+ /* over the Export window and the artwork's panel too: following someone, or no longer, is the
1023
+ reader's own way out wherever they are (CollabSpec, "What following leaves") */
1024
+ #bar:has(#peer-menu:not([hidden])) { z-index: 42; }
1023
1025
  .pm-who { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 6px 10px 4px; }
1024
1026
  .pm-dot { width: 9px; height: 9px; border-radius: 50%; }
1025
1027
  .pm-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@@ -2649,7 +2651,6 @@ span.tm-row { color: var(--text-2); cursor: default; }
2649
2651
  width: auto !important; max-width: none !important; max-height: calc(100dvh - 70px); overflow: auto;
2650
2652
  }
2651
2653
  #viewbar { top: 58px; left: 8px; right: 8px; gap: 6px; }
2652
- .side-btn { display: inline-flex; flex: none; width: 36px; justify-content: center; padding: 0; }
2653
2654
  #tabs { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
2654
2655
  #tabs::-webkit-scrollbar { display: none; }
2655
2656
  .vb-gap, .light-l { display: none; }
@@ -2688,20 +2689,6 @@ span.tm-row { color: var(--text-2); cursor: default; }
2688
2689
  }
2689
2690
  #panel.open { transform: none; }
2690
2691
  #panel::before { content: ""; position: sticky; top: -18px; display: block; width: 40px; height: 5px; margin: -18px auto 13px; border-radius: 3px; background: var(--text-3); opacity: 0.6; }
2691
- /* the side panel: a drawer from the left, over a shade */
2692
- body.side-open #side { display: flex; position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); border-radius: 0 16px 16px 0; z-index: 47; padding-top: env(safe-area-inset-top); background: var(--surface-solid); }
2693
- body.side-open::after { content: ""; position: fixed; inset: 0; z-index: 46; background: rgba(0, 0, 0, 0.3); }
2694
- /* ⚙ Board and Trusted: in the drawer's place, over it, with a way back */
2695
- body.side-open .side-pop {
2696
- left: 0 !important; top: 0 !important; bottom: 0 !important; right: auto !important; width: min(320px, 86vw) !important;
2697
- height: auto !important; max-height: none !important; border-radius: 0 16px 16px 0; z-index: 48;
2698
- background: var(--surface-solid); padding-top: calc(8px + env(safe-area-inset-top));
2699
- }
2700
- body.side-open .side-back {
2701
- display: flex; align-items: center; gap: 4px; min-height: 40px; margin: 0 0 6px -6px; padding: 0 6px; border: 0;
2702
- background: none; color: var(--accent); font: 600 15px var(--font);
2703
- }
2704
- .side-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
2705
2692
  /* a field under 16 px makes iOS zoom the whole page into it */
2706
2693
  #panel textarea, #panel input, #share-pop input, #share-pop select, #who-menu input, #modal input, .sh-field input, .sh-field select { font-size: 16px; }
2707
2694
  /* nothing slides sideways: the page is the screen */
@@ -2741,3 +2728,109 @@ span.tm-row { color: var(--text-2); cursor: default; }
2741
2728
  }
2742
2729
  .act-head .icon { width: 40px; height: 40px; font-size: 20px; }
2743
2730
  }
2731
+
2732
+ /* ---------------------------------------------------------------- a phone or a tall screen
2733
+
2734
+ What the two shapes whose panel is a sheet share (web/src/phone.ts, SHEETED): the side panel is a
2735
+ drawer from ☰, at the left of the view bar, and ⚙ Board and Trusted take its place. */
2736
+ @media (max-width: 640px), (max-aspect-ratio: 5/6) {
2737
+ .side-btn { display: inline-flex; flex: none; width: 36px; justify-content: center; padding: 0; }
2738
+ /* the side panel: a drawer from the left, over a shade */
2739
+ body.side-open #side { display: flex; position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); border-radius: 0 16px 16px 0; z-index: 47; padding-top: env(safe-area-inset-top); background: var(--surface-solid); }
2740
+ body.side-open::after { content: ""; position: fixed; inset: 0; z-index: 46; background: rgba(0, 0, 0, 0.3); }
2741
+ /* ⚙ Board and Trusted: in the drawer's place, over it, with a way back */
2742
+ body.side-open .side-pop {
2743
+ left: 0 !important; top: 0 !important; bottom: 0 !important; right: auto !important; width: min(320px, 86vw) !important;
2744
+ height: auto !important; max-height: none !important; border-radius: 0 16px 16px 0; z-index: 48;
2745
+ background: var(--surface-solid); padding-top: calc(8px + env(safe-area-inset-top));
2746
+ }
2747
+ body.side-open .side-back {
2748
+ display: flex; align-items: center; gap: 4px; min-height: 40px; margin: 0 0 6px -6px; padding: 0 6px; border: 0;
2749
+ background: none; color: var(--accent); font: 600 15px var(--font);
2750
+ }
2751
+ .side-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
2752
+ }
2753
+
2754
+ /* ---------------------------------------------------------------- a tall screen (PhoneSpec, "Tall screens")
2755
+
2756
+ Wider than a phone and upright: a tablet held upright, a narrow window, a monitor on its side. A
2757
+ larger screen's page, placed for the shape: the side panel is the drawer (above), the panel a sheet
2758
+ from the bottom across the screen, and what takes the panel's place on a larger screen —
2759
+ Activity, the lost-and-found, Export's window — takes the sheet's; the floating windows dock there
2760
+ too. The review strip, then the selection bar, go across under the view bar; the legend and the
2761
+ zoom's box keep to the board's room, above the sheet (--room-bottom: web/src/phone.ts). */
2762
+ @media (min-width: 641px) and (max-aspect-ratio: 5/6) {
2763
+ /* the tallest the sheet and the dock go: under the view bar, the review strip and the selection
2764
+ bar (--strip-h, --selbar-h: main.ts) */
2765
+ body { --sheet-most: calc(100dvh - 120px - var(--strip-h, 0px) - var(--selbar-h, 0px)); }
2766
+ #side { display: none; }
2767
+ body.side-open #side, body.side-open .side-pop { width: min(360px, 60vw) !important; }
2768
+ /* the sheet: the panel, or Activity or the lost-and-found in its place, at the height the reader
2769
+ gives it (a drag on its handle, or a tap: half the screen or the tallest, under the view bar) */
2770
+ #panel, #activity, #lostfound {
2771
+ top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; height: var(--sheet-h, 50dvh); max-height: var(--sheet-most);
2772
+ padding-top: 30px; overflow-x: hidden; overscroll-behavior: contain;
2773
+ transform: translateY(calc(100% + 60px)); transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1), height 0.2s;
2774
+ }
2775
+ #activity, #lostfound { z-index: 7; }
2776
+ #panel.open, #activity.open, #lostfound.open { transform: none; }
2777
+ #panel.sizing, #activity.sizing, #lostfound.sizing { transition: none; user-select: none; -webkit-user-select: none; }
2778
+ #panel::before, #activity::before, #lostfound::before {
2779
+ content: ""; position: sticky; top: -22px; z-index: 3; display: block; width: 44px; height: 5px; margin: -22px auto 17px;
2780
+ border-radius: 3px; background: var(--text-3); opacity: 0.6; cursor: ns-resize; touch-action: none;
2781
+ }
2782
+ /* the floating windows: docked in the sheet's place, over it, side by side where there is room
2783
+ and one over the other where there is not; a collapsed one its pill, at the dock's foot. The
2784
+ dock places them: no edge resizes them, no drag moves them (web/src/floatwin.ts) */
2785
+ #windows {
2786
+ top: auto; left: 12px; right: 12px; bottom: 12px; height: var(--sheet-h, 50dvh); max-height: var(--sheet-most);
2787
+ display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
2788
+ }
2789
+ /* its handle, over the windows while one is open there, sets the dock's height as the sheet's does
2790
+ (the same height: web/src/phone.ts) */
2791
+ #windows:has(> :is(.sw-win, .pw-win, #following.talking):not(.collapsed, [hidden])) { padding-top: 14px; }
2792
+ #windows:has(> :is(.sw-win, .pw-win, #following.talking):not(.collapsed, [hidden]))::before {
2793
+ content: ""; position: absolute; top: 0; left: 50%; width: 120px; height: 14px; transform: translateX(-50%);
2794
+ pointer-events: auto; cursor: ns-resize; touch-action: none;
2795
+ background: linear-gradient(var(--text-3), var(--text-3)) center 4px / 44px 5px no-repeat; opacity: 0.6; border-radius: 3px;
2796
+ }
2797
+ /* the declaration's source first, then the reference beside it, then a conversation */
2798
+ #windows > .sw-win { order: 1; }
2799
+ #windows > .pw-win { order: 2; }
2800
+ #windows > #following { order: 3; }
2801
+ #windows > .sw-win, #windows > .pw-win, #windows > #following.talking {
2802
+ position: relative !important; inset: auto !important; transform: none;
2803
+ width: auto !important; height: auto !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; max-height: none !important;
2804
+ flex: 1 1 0; z-index: auto !important;
2805
+ }
2806
+ #windows > .collapsed { flex: none; align-self: flex-start; max-width: min(360px, 100%) !important; }
2807
+ #windows .fl-rz { display: none !important; }
2808
+ @media (min-width: 960px) { #windows { flex-direction: row; align-items: stretch; } #windows > .collapsed { align-self: flex-end; } }
2809
+ #windows .sw-head, #windows .pw-head, #windows > #following.talking > .fl-strip { cursor: default; }
2810
+ /* Export's window: in the sheet's place too, the outline it arranges above it */
2811
+ #export-modal { top: auto; left: 12px; right: 12px; bottom: 12px; }
2812
+ #export-modal .ex-box { width: auto; max-height: var(--sheet-h, 50dvh); }
2813
+ /* under the view bar, across the screen: the review strip, then the selection bar (--strip-h:
2814
+ main.ts) */
2815
+ #lensbar, #tm-kept { top: 108px; left: 12px; right: 12px; transform: none; max-width: none; }
2816
+ #selbar { top: calc(108px + var(--strip-h, 0px)); left: 12px; right: 12px; width: auto; }
2817
+ /* the legend and the zoom's box at the foot of the board's room, above the sheet or the dock */
2818
+ #foot { left: 12px; bottom: var(--room-bottom, 12px); visibility: var(--room-shown, visible); transition: bottom 0.32s cubic-bezier(0.2, 0.9, 0.25, 1); }
2819
+ #zoom { right: 12px; bottom: var(--room-bottom, 12px); visibility: var(--room-shown, visible); transition: bottom 0.32s cubic-bezier(0.2, 0.9, 0.25, 1); }
2820
+ #following:not(.talking), #whatsnew { bottom: calc(var(--room-bottom, 12px) + 40px); }
2821
+ #welcome { left: 12px; bottom: calc(var(--room-bottom, 12px) + 40px); }
2822
+ /* the bar's popovers: at its right, under it, never past the screen's edge */
2823
+ .share-wrap, .library-wrap { position: static; }
2824
+ #share-pop, #library-pop { top: calc(100% + 6px); right: 0; }
2825
+ /* the help: as wide as the screen allows, the film over its chapters */
2826
+ .help-box, .help-box:has([data-help-pane="tips"]:not([hidden])) { width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
2827
+ }
2828
+ /* a tall screen narrower than the bar's words: Share, the library and Export by their icons; the
2829
+ focus gives way to the Time Machine, as on a phone */
2830
+ @media (min-width: 641px) and (max-width: 1000px) and (max-aspect-ratio: 5/6) {
2831
+ body.tm .focus-wrap { display: none; }
2832
+ }
2833
+ @media (min-width: 641px) and (max-width: 900px) and (max-aspect-ratio: 5/6) {
2834
+ #share-btn > span, #library-btn > span, #export-btn > span { display: none; }
2835
+ #bar { gap: 10px; }
2836
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visualproof",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "type": "module",
5
5
  "description": "See a Lean codebase's declaration graph and the TCB of its theorems.",
6
6
  "license": "Apache-2.0",