@floless/app 0.127.2 → 0.127.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.
@@ -54744,7 +54744,7 @@ function appVersion() {
54744
54744
  return resolveVersion({
54745
54745
  isSea: isSea2(),
54746
54746
  sqVersionXml: readSqVersionXml(),
54747
- define: true ? "0.127.2" : void 0,
54747
+ define: true ? "0.127.3" : void 0,
54748
54748
  pkgVersion: readPkgVersion()
54749
54749
  });
54750
54750
  }
@@ -54760,7 +54760,7 @@ function resolveChannel(s) {
54760
54760
  function appChannel() {
54761
54761
  return resolveChannel({
54762
54762
  isSea: isSea2(),
54763
- define: true ? "0.127.2" : void 0,
54763
+ define: true ? "0.127.3" : void 0,
54764
54764
  // argv[1] is the entry the runtime actually loaded (…/dist/floless-server.cjs), which is what
54765
54765
  // carries the npx cache prefix. Absent under the SEA exe, which never reaches the npx branch.
54766
54766
  modulePath: process.argv[1]
@@ -79,6 +79,17 @@ export function countShown(elements, mode, sel) {
79
79
  return n;
80
80
  }
81
81
 
82
+ /**
83
+ * Geometry that belongs in the live, interactive SVG overlay. A registered raster already preserves
84
+ * the complete drawing for orientation, so mounting non-matches would make a large PDF sluggish.
85
+ * Baked contracts deliberately strip that confidential raster; those sheets retain every vector as
86
+ * the explicit dimmed fallback context and the caller marks non-matches inert.
87
+ */
88
+ export function liveOverlayElements(elements, mode, sel, rasterContext) {
89
+ const all = Array.isArray(elements) ? elements : [];
90
+ return rasterContext ? all.filter((el) => matchesActive(el, mode, sel)) : all;
91
+ }
92
+
82
93
  /**
83
94
  * Where a sheet's background raster (`page.bg_b64`) maps, in the same vector-frame coords as the
84
95
  * elements' `d` paths — so the raster registers 1:1 with the linework. The producer clips the raster
@@ -113,11 +113,11 @@ footer{margin-top:auto;border-top:1px solid var(--line);padding-top:12px}
113
113
  #stage{flex:1;position:relative;background:var(--bg);min-width:0}
114
114
  #canvas{width:100%;height:100%;cursor:grab;touch-action:none;display:block}
115
115
  #canvas.dragging{cursor:grabbing}
116
- #canvas image.bg{opacity:.28}
116
+ #canvas image.bg{opacity:.28;pointer-events:none}
117
117
  #canvas path.el{pointer-events:stroke}
118
118
  #canvas text.el{pointer-events:all;cursor:pointer;user-select:none}
119
- /* Filtered-out vector content stays as quiet, non-selectable drawing context. The selector must beat
120
- the text rule above, otherwise dim labels still open the eyedropper. */
119
+ /* Raster-less baked sheets cannot retain the confidential background. Keep their full vector sheet as
120
+ an explicit, non-interactive fallback; raster-backed sheets mount selected vectors only. */
121
121
  #canvas .el.is-context{opacity:.2;pointer-events:none}
122
122
  #empty{position:absolute;inset:0;display:none;align-items:center;justify-content:center;padding:40px;text-align:center;color:var(--mut)}
123
123
  #empty.show{display:flex}
@@ -289,7 +289,7 @@ body.publication-blocked #empty{position:static;flex:1}
289
289
  </div>
290
290
 
291
291
  <script type="module">
292
- import { matchesActive, modeDims, canonicalMode, selFromFilter, eyedropperAdd, countShown, bgRect, textFontSize, applySelToFilter, normalizeFilter, liveUpdateAction, statChip, newMutationId, sheetLabel, NOTE_TEXT } from './steel-filter-core.js';
292
+ import { matchesActive, modeDims, canonicalMode, selFromFilter, eyedropperAdd, countShown, liveOverlayElements, bgRect, textFontSize, applySelToFilter, normalizeFilter, liveUpdateAction, statChip, newMutationId, sheetLabel, NOTE_TEXT } from './steel-filter-core.js';
293
293
 
294
294
  const APP_ID = new URLSearchParams(location.search).get('app') || '';
295
295
  // Workspaces: project-keyed contract (see steel-editor.html). Empty = legacy app-keyed URLs.
@@ -892,16 +892,19 @@ function setSheet(i){
892
892
  bgImg.style.display='';
893
893
  }
894
894
  else bgImg.style.display = 'none';
895
- buildOverlay();
896
895
  base = { x: 0, y: 0, w: pg.w, h: pg.h }; vb = { ...base }; setVB();
897
- apply();
898
896
  closeEye();
897
+ apply();
899
898
  syncSheetSwitcher();
900
899
  }
901
900
 
902
901
  function buildOverlay(){
903
902
  overlay.replaceChildren();
904
- nodes = ((sheets[active] && sheets[active].elements) || []).map(el => {
903
+ const rasterContext = hasRasterContext();
904
+ // The raster is the full, quiet sheet context. Mount only the selected vectors: a large PDF can
905
+ // carry tens of thousands of paths, and keeping every rejected path in the live SVG makes filtering
906
+ // sluggish even when those paths are dimmed and non-interactive.
907
+ nodes = liveOverlayElements((sheets[active] && sheets[active].elements) || [], mode, sel, rasterContext).map(el => {
905
908
  let n;
906
909
  if(el.kind === 'text'){
907
910
  n = document.createElementNS(SVGNS, 'text');
@@ -930,6 +933,8 @@ function buildOverlay(){
930
933
  });
931
934
  }
932
935
 
936
+ function hasRasterContext(){ return !!((sheets[active] && sheets[active].page) || {}).bg_b64; }
937
+
933
938
  function setOf(facet){ return facet === 'layers' ? sel.layers : facet === 'thicknesses' ? sel.thicknesses : sel.colors; }
934
939
 
935
940
  function buildFacet(facet, items, valueKey, label, selValue){
@@ -974,14 +979,16 @@ function syncFacetChecks(){
974
979
  }
975
980
 
976
981
  function apply(){
977
- for(const { node, el } of nodes){
978
- const vis = matchesActive(el, mode, sel);
979
- node.classList.toggle('is-context', !vis);
980
- node.setAttribute('aria-hidden', String(!vis));
981
- }
982
982
  if(eyeEl && !matchesActive(eyeEl, mode, sel)) closeEye();
983
+ const rasterContext = hasRasterContext();
984
+ buildOverlay();
985
+ if(!rasterContext) for(const { node, el } of nodes){
986
+ const contextOnly = !matchesActive(el, mode, sel);
987
+ node.classList.toggle('is-context', contextOnly);
988
+ node.setAttribute('aria-hidden', String(contextOnly));
989
+ }
983
990
  const cur = (sheets[active] && sheets[active].elements) || [];
984
- let html = '<b>' + countShown(cur, mode, sel) + '</b> selected of <b>' + cur.length + '</b> · remaining elements shown as context';
991
+ let html = '<b>' + countShown(cur, mode, sel) + '</b> selected of <b>' + cur.length + '</b> · complete ' + (rasterContext ? 'drawing' : 'vector drawing') + ' shown as context';
985
992
  if(sheets.length > 1){
986
993
  let sa = 0, ta = 0;
987
994
  for(const s of sheets){ const els = s.elements || []; sa += countShown(els, mode, sel); ta += els.length; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.127.2",
3
+ "version": "0.127.3",
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": {