@floless/app 0.99.1 → 0.99.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.
@@ -53106,7 +53106,7 @@ function appVersion() {
53106
53106
  return resolveVersion({
53107
53107
  isSea: isSea2(),
53108
53108
  sqVersionXml: readSqVersionXml(),
53109
- define: true ? "0.99.1" : void 0,
53109
+ define: true ? "0.99.2" : void 0,
53110
53110
  pkgVersion: readPkgVersion()
53111
53111
  });
53112
53112
  }
@@ -53116,7 +53116,7 @@ function resolveChannel(s) {
53116
53116
  return "dev";
53117
53117
  }
53118
53118
  function appChannel() {
53119
- return resolveChannel({ isSea: isSea2(), define: true ? "0.99.1" : void 0 });
53119
+ return resolveChannel({ isSea: isSea2(), define: true ? "0.99.2" : void 0 });
53120
53120
  }
53121
53121
 
53122
53122
  // workflow-update.ts
package/dist/web/app.css CHANGED
@@ -3981,6 +3981,8 @@ tr.hist-diff-row[hidden] { display:none; }
3981
3981
  .kb-g-hint { font-size: 10.5px; color: var(--text-dim); }
3982
3982
  .kb-graph-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; position: relative; }
3983
3983
  .kb-graph-svg { width: 100%; height: 100%; }
3984
+ .kb-graph-svg.kb-zoomed { cursor: grab; } /* pannable (zoomed in) — nodes keep their own pointer */
3985
+ .kb-graph-svg.kb-panning, .kb-graph-svg.kb-panning * { cursor: grabbing; } /* while dragging, grabbing everywhere incl. over nodes */
3984
3986
  .kb-g-fit { position: absolute; top: 10px; right: 10px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-muted); border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer; font: inherit; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
3985
3987
  .kb-g-fit:hover { color: var(--text); border-color: var(--accent); }
3986
3988
  .kb-g-fit[hidden] { display: none; }
@@ -968,7 +968,7 @@
968
968
  const legend = '<div class="kb-g-legend"><span class="kb-gleg src">Source</span><span class="kb-gleg con">Concept</span><span class="kb-gleg per">Person</span></div>';
969
969
  const note = graph.truncated ? `<div class="kb-view-note">Showing ${graph.nodes.length} — graph truncated (some pages omitted)</div>` : '';
970
970
  return '<section class="kb-col kb-graph"><div class="kb-graph-head"><span>Knowledge graph</span>' + overview + '</div>' +
971
- '<div class="kb-graph-sub">' + legend + '<span class="kb-g-hint">Click a node to open its page · scroll to zoom</span></div>' +
971
+ '<div class="kb-graph-sub">' + legend + '<span class="kb-g-hint">Click a node to open its page · scroll to zoom · drag to pan</span></div>' +
972
972
  `<div class="kb-graph-body"><svg viewBox="0 0 ${W} ${H}" data-vb-base="0 0 ${W} ${H}" class="kb-graph-svg" role="group" aria-label="Knowledge graph">${lines}${dots}</svg>` +
973
973
  `<button type="button" class="kb-g-fit" data-kb-fit hidden data-tip="Zoom to fit (Home)" aria-label="Zoom to fit">⤢ Fit</button></div>${note}</section>`;
974
974
  }
@@ -990,6 +990,7 @@
990
990
  const off = Math.abs(w - bw) > 0.5 || Math.abs(x - bx) > 0.5 || Math.abs(y - by) > 0.5;
991
991
  const fit = svg.parentElement.querySelector('[data-kb-fit]');
992
992
  if (fit) fit.hidden = !off;
993
+ svg.classList.toggle('kb-zoomed', w < bw - 0.5); // pannable (zoomed in) → the SVG shows a grab cursor
993
994
  }
994
995
  function kbFitGraph(svg) { const b = svg.dataset.vbBase.split(' ').map(Number); kbSetVb(svg, b[0], b[1], b[2], b[3]); }
995
996
  function kbZoomGraph(svg, clientX, clientY, factor) {
@@ -1701,6 +1702,42 @@
1701
1702
  e.preventDefault();
1702
1703
  kbZoomGraph(svg, e.clientX, e.clientY, e.deltaY < 0 ? 0.85 : 1 / 0.85);
1703
1704
  }, { passive: false });
1705
+ // Drag to pan — mirrors the main canvas's pan model (web/app.js): MIDDLE-mouse anywhere, OR LEFT-drag
1706
+ // on empty background (never a node — those open on click), so pan is reachable without a middle button
1707
+ // (trackpads have none). Window-level move/up track the drag past the SVG edge; client px ÷ the on-screen
1708
+ // (letterbox-fitted) scale → viewBox units, clamped to the content box like zoom. Only starts when zoomed
1709
+ // in — at fit there's nothing outside the box, so a press there is a true no-op (no cursor flip).
1710
+ let kbPan = null;
1711
+ $wsKnowledge.addEventListener('mousedown', (e) => {
1712
+ const svg = e.target.closest('.kb-graph-svg');
1713
+ if (!svg) return;
1714
+ const isMiddle = e.button === 1;
1715
+ const isLeftBg = e.button === 0 && !e.target.closest('.kb-g-node');
1716
+ if (!isMiddle && !isLeftBg) return;
1717
+ if (isMiddle) e.preventDefault(); // kill middle-click autoscroll even at fit
1718
+ const [x, y, w, h] = svg.getAttribute('viewBox').split(' ').map(Number);
1719
+ const [, , bw, bh] = svg.dataset.vbBase.split(' ').map(Number);
1720
+ if (w >= bw && h >= bh) return; // at fit: nothing to pan
1721
+ e.preventDefault(); // suppress text selection while dragging
1722
+ const rect = svg.getBoundingClientRect();
1723
+ const scale = Math.min(rect.width / w, rect.height / h); // on-screen px per viewBox unit (meet)
1724
+ kbPan = { svg, sx: e.clientX, sy: e.clientY, vx: x, vy: y, w, h, scale, bw, bh };
1725
+ svg.classList.add('kb-panning');
1726
+ });
1727
+ window.addEventListener('mousemove', (e) => {
1728
+ if (!kbPan) return;
1729
+ const { svg, sx, sy, vx, vy, w, h, scale, bw, bh } = kbPan;
1730
+ if (!svg.isConnected) { kbPan = null; return; } // graph re-rendered (generation change) mid-drag — drop the stale ref
1731
+ const nx = Math.max(0, Math.min(bw - w, vx - (e.clientX - sx) / scale));
1732
+ const ny = Math.max(0, Math.min(bh - h, vy - (e.clientY - sy) / scale));
1733
+ kbSetVb(svg, nx, ny, w, h); // node counter-scale is unchanged during a pan (w fixed) — a redundant but cheap re-apply, bounded by the graph's node cap
1734
+ });
1735
+ window.addEventListener('mouseup', () => {
1736
+ if (!kbPan) return;
1737
+ kbPan.svg.classList.remove('kb-panning');
1738
+ kbPan = null;
1739
+ });
1740
+ $wsKnowledge.addEventListener('auxclick', (e) => { if (e.button === 1) e.preventDefault(); }); // suppress the middle-click default aux action (paste / new-tab); autoscroll is already killed on mousedown
1704
1741
  // Graph nodes are keyboard-focusable (tabindex="0" role="button") but SVG <g> elements have no
1705
1742
  // native activation behaviour, so Enter/Space must be wired explicitly.
1706
1743
  $wsKnowledge.addEventListener('keydown', (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.99.1",
3
+ "version": "0.99.2",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {