@floless/app 0.127.3 → 0.127.5

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.
@@ -826,6 +826,11 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
826
826
  .m3dmenu label{display:flex;align-items:center;gap:7px;padding:7px 12px;color:var(--text);font-size:12px;cursor:pointer;white-space:nowrap}
827
827
  .m3dmenu label:hover{background:#334155}
828
828
  .m3dmenu label input{margin:0;cursor:pointer} /* the global input[type=checkbox] rule now sets the box size, so this no longer inherits input{width:100%} and no longer needs `width:auto` — which on an appearance:none box would collapse it (View / Plane / Work toggles) */
829
+ .m3dmenu .m3d-actions{display:flex;gap:6px;padding:4px 8px}
830
+ .m3dmenu .m3d-actions button{flex:1;width:auto;text-align:center;padding:5px 9px;border:1px solid #475569;border-radius:6px;background:#334155}
831
+ .m3dmenu .m3d-actions button:hover{background:#475569}
832
+ .m3dmenu .m3d-actions button.mprimary{background:var(--brand);border-color:var(--brand);color:#fff}
833
+ .m3dmenu .m3d-actions button.mprimary:hover{background:var(--brand)}
829
834
  .m3dmenu .wpprow{display:flex;gap:4px;align-items:center;padding:4px 12px}
830
835
  .m3dmenu .wpprow button{width:auto;flex:none;padding:4px 8px;border:1px solid var(--line);border-radius:5px}
831
836
  .m3dmenu .wpprow input{width:74px;height:24px;background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:5px;padding:0 6px;font:12px system-ui}
@@ -1123,6 +1128,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1123
1128
  #m3dLegend .lrow.off{opacity:.4}
1124
1129
  /* hidden/off (or a disabled clip) → the box goes HOLLOW (outline of its own colour); the row also dims. No grayscale — the empty box already signals "hidden". */
1125
1130
  #m3dLegend .lrow.off .lsw,#m3dLegend .lrow.dim.dimoff .lsw{background:transparent;box-shadow:inset 0 0 0 1.6px var(--sw)}
1131
+ #m3dLegend .lrow.mixed .lsw{background:linear-gradient(var(--sw),var(--sw)) center/7px 2px no-repeat;box-shadow:inset 0 0 0 1.6px var(--sw)}
1126
1132
  #m3dLegend .lrow.solo{background:rgba(59,130,246,.12)} /* in the isolated set (Explorer-style multi-select highlight) */
1127
1133
  #m3dLegend .lrow.lsel{box-shadow:inset 2px 0 0 var(--brand)} /* selected in 3D — brand left-bar (distinct from .solo's isolate tint; the two can coexist) */
1128
1134
  #m3dLegend .lrow.dim .lsw{--sw:#67e8f9} /* dim overlays are cyan — same filled(on)/hollow(off) box as every other row */
@@ -1444,17 +1450,30 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1444
1450
  <button data-mode=shadowed data-tip="Realistic with cast shadows — more depth, at a cost to frame rate">Shadowed</button>
1445
1451
  </div>
1446
1452
  </div>
1447
- <button id=m3dIso data-tip="Isolate selected — hide everything else (Esc to exit)" style="display:none">Isolate</button>
1453
+ <div class=m3dwrap id=m3dIsoWrap style="display:none">
1454
+ <button id=m3dIso aria-haspopup=menu aria-controls=m3dIsoMenu aria-expanded=false data-tip="Visibility actions for the selected objects">Isolate ▾</button>
1455
+ <div id=m3dIsoMenu class=m3dmenu role=menu>
1456
+ <button role=menuitem data-vis=show-all data-tip="Restore every hidden or isolated object" style="display:none">Show all</button>
1457
+ <hr data-vis-divider style="display:none">
1458
+ <button role=menuitem data-vis=isolate data-tip="Show only the selected objects (Esc to restore)">Isolate selected</button>
1459
+ <button role=menuitem data-vis=hide data-tip="Hide the selected objects">Hide selected</button>
1460
+ </div>
1461
+ </div>
1448
1462
  <button id=m3dViewsBtn data-tip="Saved views — save, switch, and manage named viewpoints">Views</button>
1449
1463
  <span class=tb-sep></span>
1450
1464
  <!-- Display toggles: reference lines + mark labels (grouped into a menu, like Plane / Work area).
1451
1465
  The Dimension tool moved to the header so it lives in one place across 2D and 3D. -->
1452
1466
  <div class=m3dwrap>
1453
- <button id=m3dView data-tip="Show or hide reference lines, mark labels, and property labels on the 3D model">View ▾</button>
1467
+ <button id=m3dView aria-haspopup=menu aria-controls=m3dViewMenu aria-expanded=false data-tip="Show or hide reference lines, mark labels, and property labels on the 3D model">View ▾</button>
1454
1468
  <div id=m3dViewMenu class=m3dmenu role=menu>
1455
1469
  <label data-tip="Show each member's reference line (centreline)"><input type=checkbox id=m3dRef> Ref line</label>
1456
1470
  <label data-tip="Show each member's mark / id label in the 3D view"><input type=checkbox id=m3dLabels> Mark labels</label>
1457
1471
  <label data-tip="Show or hide property labels in the 3D view (the property selection is shared with 2D — this hides them here only)"><input type=checkbox id=m3dPropLabels checked> Property labels</label>
1472
+ <hr>
1473
+ <div class=m3d-actions id=m3dViewActions>
1474
+ <button id=m3dViewHideAll role=menuitem data-tip="Hide reference lines, mark labels, and property labels">Hide all</button>
1475
+ <button id=m3dViewShowAll class=mprimary role=menuitem data-tip="Show reference lines, mark labels, and property labels">Show all</button>
1476
+ </div>
1458
1477
  </div>
1459
1478
  </div>
1460
1479
  <span class=tb-sep></span>
@@ -1613,7 +1632,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
1613
1632
  <!-- The spinner is `connImportModal`'s own `.ci-prog`/`.ci-spin` (see the CSS above), reused rather
1614
1633
  than re-invented: this stage sat as static text for up to six seconds before its honest
1615
1634
  "still working" message appeared, which reads as hung next to the sibling modal that spins. -->
1616
- <div id=riProgStage style="display:none"><div class=ci-prog><span class=ci-spin aria-hidden=true></span><span id=riProgTxt role=status aria-live=polite>Reading the file…</span></div><div id=riProgNote style="display:none">You can close this — FloLess will keep importing this model.</div></div>
1635
+ <div id=riProgStage style="display:none"><div class=ci-prog><span class=ci-spin aria-hidden=true></span><span id=riProgTxt role=status aria-live=polite>Preparing the IFC file…</span></div><div id=riProgNote style="display:none">You can close this — FloLess will keep importing this model.</div></div>
1617
1636
  <div id=riConfirmStage style="display:none">
1618
1637
  <div id=riSays></div>
1619
1638
  <div class=rirow><span class=pn>Schema</span><span class=pv id=riSchema>—</span></div>
@@ -8730,7 +8749,7 @@ const view3dApi={
8730
8749
  edit(()=>{if(!Array.isArray(C.detail_placements))C.detail_placements=[];C.detail_placements.push(place);selIds=new Set(['det:'+id]);});
8731
8750
  toast('Detail placed'+(pick.anchorId?' on '+pick.anchorId:'')+' — adjust it in the panel or ask the AI to build it');
8732
8751
  detailRequest('create',place);},
8733
- onIsolateChange:()=>{updateIsolateBtn();refresh3DLegend();}, // isolate / show-all (incl. Esc, legend "show all", showAllGroups clearing connHidden) → refresh the toolbar button + the legend rows' hidden state
8752
+ onIsolateChange:()=>{updateIsolateBtn();refresh3DLegend();}, // every object-visibility change (isolate, group/part/selection hide, Show all) → refresh recovery control + legend rows
8734
8753
  onWorkAreaChange:()=>updateWorkBtn(), // work area set / toggled → refresh the button + its checkbox
8735
8754
  };
8736
8755
  // Re-extrude the 3D model after a structural edit (keeps the camera where it is). Selection-only
@@ -11146,7 +11165,7 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11146
11165
  // that guard could never fire from this UI, because the browser never disconnected — Cancel left the
11147
11166
  // request in flight, so a cancelled 66 MB read went on holding the single run lock for its full
11148
11167
  // duration and the next import queued behind the file the user had just given up on.
11149
- let riRun=0,riAbort=null,riMutationId=null;
11168
+ let riRun=0,riAbort=null,riMutationId=null,riBackgrounded=false;
11150
11169
  /** End the current attempt: nothing it started may touch the modal, and its upload stops now. */
11151
11170
  const riStop=()=>{riRun++;if(riAbort){try{riAbort.abort();}catch(_){/* already settled */}riAbort=null;}};
11152
11171
  const riClearSoft=()=>{if(riSoftT){clearTimeout(riSoftT);riSoftT=null;}};
@@ -11167,6 +11186,9 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11167
11186
  function openRefImport(){
11168
11187
  if(!MODEL_V2){toast('Reference models need this project on the model-level contract');return;}
11169
11188
  if(!view3d){toast('Switch to the 3D view to add a reference model');return;}
11189
+ // There is one accepted import at a time. Reopening its observer must reveal that same work,
11190
+ // never cancel it and leave `riBusy` wedged behind an invalidated run token.
11191
+ if(riBusy){riBackgrounded=false;ri$('refImportModal').style.display='flex';return;}
11170
11192
  riStop(); // a previous attempt's in-flight probe must not answer into this one
11171
11193
  riSha=null;riName='';riVerdict=null;riProbeCentre=null;riErr('');ri$('riDrop').classList.remove('drag');
11172
11194
  riBuildPick(null); // and the picker, so a cancelled file's storeys never show under a new name
@@ -11176,10 +11198,11 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11176
11198
  // A reference insert is intentionally detached from this modal once accepted. Closing is a
11177
11199
  // backgrounding action, never an implicit cancellation of an expensive model read.
11178
11200
  if(riBusy&&riStageNow==='prog'){
11179
- // The server broadcasts before its HTTP response. Once the user backgrounds this attempt, its
11180
- // mutation may no longer suppress that broadcast or the contract can commit invisibly here.
11181
- if(riMutationId){releaseMutation(riMutationId);riMutationId=null;}
11182
- riRun++;riAbort=null;riBusy=false;riClearSoft();ri$('riCancel').textContent='Cancel';ri$('refImportModal').style.display='none';
11201
+ // Keep the request identity, abort controller and run token alive. The response still owns the
11202
+ // local commit + viewer update after this observer closes; invalidating the token here made that
11203
+ // response return early and relied on a broadcast which may already have been suppressed by our
11204
+ // mutation claim. The reference then existed on disk but stayed invisible until reload.
11205
+ riBackgrounded=true;riClearSoft();ri$('refImportModal').style.display='none';
11183
11206
  toast('Import continues in the background.');return;
11184
11207
  }
11185
11208
  riStop();riClearSoft();ri$('refImportModal').style.display='none';
@@ -11529,7 +11552,7 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11529
11552
  const riNative=nativeModelCentre();
11530
11553
  const riFilterBody=riBuildFilter(); // computed ONCE — it was called twice in one expression
11531
11554
  const riOriginShift=takeOrigin&&riProbeCentre?riProbeCentre.map((v,i)=>riNative[i]-v):null;
11532
- riStage('prog');ri$('riProgNote').style.display='block';ri$('riCancel').textContent='Continue in background';riProg('Reading the geometry…','Still reading — a whole building takes a moment.');
11555
+ riStage('prog');ri$('riTitle').textContent='Converting into 3D viewer geometry';ri$('riProgNote').style.display='block';ri$('riCancel').textContent='Continue in background';riProg('Converting “'+riName+'” into 3D viewer geometry…','AWARE is tessellating objects and preparing the viewer file. Whole-building models can take several minutes; FloLess will add the reference when that completes.');
11533
11556
  let mid=null;
11534
11557
  try{
11535
11558
  mid=newMutationId();riMutationId=mid;claimMutation(mid);
@@ -11557,6 +11580,7 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11557
11580
  }
11558
11581
  riClearSoft();
11559
11582
  if(!res.ok||!d.ok){
11583
+ if(riBackgrounded)toast('Reference import failed — '+(d.error||'the model could not be added.'));
11560
11584
  // STAY ON CONFIRM for the refusals the picker itself can fix. `riStage('drop')` swaps the whole
11561
11585
  // body back to the dropzone, so telling somebody to "choose fewer storeys or types" would
11562
11586
  // remove every control that lets them. The other failures still go back — there is nothing to
@@ -11582,8 +11606,9 @@ function adoptReferenceWrite(etag){if(!etag)return;const prev=serverEtag;serverE
11582
11606
  // Aborted: no response at all, so we cannot know whether the write landed. Same reasoning as
11583
11607
  // above — release the claim so a broadcast that does arrive is applied rather than swallowed.
11584
11608
  if(mine!==riRun||(e&&e.name==='AbortError')){if(mid)releaseMutation(mid);if(riMutationId===mid)riMutationId=null;return;}
11609
+ if(riBackgrounded)toast('Reference import failed — the model could not be added.');
11585
11610
  riClearSoft();riStage('drop');riErr('Could not add that reference.');console.error('[reference] insert failed',e);return;}
11586
- finally{if(mine===riRun){riBusy=false;riAbort=null;ri$('riCancel').textContent='Cancel';}if(riMutationId===mid)riMutationId=null;}
11611
+ finally{if(mine===riRun){riBusy=false;riAbort=null;riBackgrounded=false;ri$('riCancel').textContent='Cancel';}if(riMutationId===mid)riMutationId=null;}
11587
11612
  // ── PAST THE POINT OF NO RETURN. Everything above is the transaction; everything below is showing
11588
11613
  // it. They were one try, and a throw in the presentation half ran riErr() on a modal riClose() had
11589
11614
  // already hidden — so the user saw NOTHING while the reference was committed and on disk, and the
@@ -11706,8 +11731,8 @@ function build3DLegend(){const host=document.getElementById('m3dLegendBody');if(
11706
11731
  if(opts.onToggle)tog.addEventListener('click',e=>{e.stopPropagation();opts.onToggle();refresh3DLegend();});
11707
11732
  updateCatTog(hdr);return hdr;};
11708
11733
  // master state/action over a set of part-group keys (members + connection categories share this)
11709
- const grpState=keys=>{const h=new Set(window.Steel3DView.groupState().hidden);const n=keys.filter(k=>h.has(k)).length;return n===0?'on':(n===keys.length?'off':'mixed');};
11710
- const grpToggle=keys=>{const h=new Set(window.Steel3DView.groupState().hidden);window.Steel3DView.setGroupsHidden(keys,keys.every(k=>!h.has(k)));}; // all-on → hide all; else show all
11734
+ const grpState=keys=>{const h=new Set(window.Steel3DView.groupState().hidden),sh=new Set(window.Steel3DView.selectionHiddenIds?window.Steel3DView.selectionHiddenIds():[]);let shown=0,hiddenCount=0;for(const k of keys){const ids=allMembers().filter(m=>profileKeyOf(m)===k).map(m=>m.id),n=ids.filter(id=>sh.has(id)).length;if(h.has(k)||(ids.length&&n===ids.length))hiddenCount++;else if(n){}else shown++;}return hiddenCount===keys.length?'off':(shown===keys.length?'on':'mixed');};
11735
+ const grpToggle=keys=>{window.Steel3DView.setGroupsHidden(keys,grpState(keys)==='on');}; // all-on → hide all; mixed/off → show all (also clears Hide-selected ids in those groups)
11711
11736
  const members=groups.filter(g=>!CONN_ORDER.includes(g.key));
11712
11737
  const conns=groups.filter(g=>CONN_ORDER.includes(g.key)).sort((a,b)=>CONN_ORDER.indexOf(a.key)-CONN_ORDER.indexOf(b.key));
11713
11738
  if(members.length){ // By profile ⇄ By type toggle, above the hint
@@ -11750,7 +11775,7 @@ function build3DLegend(){const host=document.getElementById('m3dLegendBody');if(
11750
11775
  else{
11751
11776
  const byConn=new Map(); // connType → Map(part-kind → [ids])
11752
11777
  for(const e of connParts){const ct=connTypeOf(e.id);if(!byConn.has(ct))byConn.set(ct,new Map());const pk=byConn.get(ct);if(!pk.has(e.group))pk.set(e.group,[]);pk.get(e.group).push(e.id);}
11753
- const hiddenSet=()=>new Set(window.Steel3DView.connHiddenIds());
11778
+ const hiddenSet=()=>new Set([...(window.Steel3DView.connHiddenIds?window.Steel3DView.connHiddenIds():[]),...(window.Steel3DView.selectionHiddenIds?window.Steel3DView.selectionHiddenIds():[])]);
11754
11779
  const order=[...CONN_TYPES.map(t=>t.k),...[...byConn.keys()].filter(k=>!CONN_TYPES.some(t=>t.k===k))];
11755
11780
  for(const ct of order){const pk=byConn.get(ct);if(!pk||!pk.size)continue;
11756
11781
  const allIds=[].concat(...[...pk.values()]),label=(CONN_TYPES.find(t=>t.k===ct)||{}).label||'Other',ck='conn-'+ct;
@@ -11829,14 +11854,15 @@ function build3DLegend(){const host=document.getElementById('m3dLegendBody');if(
11829
11854
  }
11830
11855
  {const rst=Object.assign(document.createElement('div'),{className:'lreset',id:'m3dLegendReset',textContent:'Show all'});rst.setAttribute('role','button');rst.dataset.tip='Restore every hidden / isolated object in this panel';rst.addEventListener('click',legendReset);host.insertBefore(rst,host.firstChild);} // Show-all reset — body's first child (above the mode toggle); visibility set by updateLegendReset (via refresh3DLegend)
11831
11856
  refresh3DLegend();applyLegendFilter();refreshLegendSel();} // the Objects body's visibility is owned by the active-tab class, not set here
11832
- // The contextual Isolate / Show all toolbar button: visible when something's selected OR while isolated (so
11833
- // "Show all" stays reachable after the selection is cleared). Updated on selection change + via onIsolateChange.
11834
- function updateIsolateBtn(){const b=document.getElementById('m3dIso');if(!b||!window.Steel3DView||!window.Steel3DView.isIsolated)return;
11835
- const iso=window.Steel3DView.isIsolated();
11836
- b.style.display=(iso||selIds.size>0)?'':'none';
11837
- b.classList.toggle('on',iso);
11838
- b.textContent=iso?'Show all':'Isolate';
11839
- b.setAttribute('data-tip', iso?'Restore all hidden members':'Isolate selected — hide everything else (Esc to exit)');} // themed tooltip, updated with state (no native title)
11857
+ // Contextual visibility menu: selection exposes Isolate/Hide; any active object filter keeps Show all reachable
11858
+ // after Hide selected clears that now-invisible selection. Updated on selection change + every visibility callback.
11859
+ function updateIsolateBtn(){const wrap=document.getElementById('m3dIsoWrap'),b=document.getElementById('m3dIso'),menu=document.getElementById('m3dIsoMenu');if(!wrap||!b||!menu||!window.Steel3DView)return;
11860
+ const V=window.Steel3DView,filtered=V.hasVisibilityFilter?V.hasVisibilityFilter():!!(V.isIsolated&&V.isIsolated()),hasSel=selIds.size>0;
11861
+ const visible=filtered||hasSel;if(!visible&&wrap.contains(document.activeElement)){const stable=document.getElementById('m3dViewsBtn');if(stable)stable.focus();}wrap.style.display=visible?'':'none';b.classList.toggle('on',filtered);b.textContent=filtered?'Show all ▾':'Isolate ▾';
11862
+ b.setAttribute('data-tip',filtered?'Restore hidden objects or change the current selection’s visibility':'Visibility actions for the selected objects');
11863
+ const show=menu.querySelector('[data-vis=show-all]'),div=menu.querySelector('[data-vis-divider]'),iso=menu.querySelector('[data-vis=isolate]'),hide=menu.querySelector('[data-vis=hide]');
11864
+ if(show)show.style.display=filtered?'':'none';if(div)div.style.display=(filtered&&hasSel)?'':'none';if(iso)iso.style.display=hasSel?'':'none';if(hide)hide.style.display=hasSel?'':'none';
11865
+ if(!filtered&&!hasSel){menu.classList.remove('open');b.setAttribute('aria-expanded','false');}}
11840
11866
  // The Work area button + its two slider toggles reflect the live work-area state (api.onWorkAreaChange).
11841
11867
  // "Show work area" = box drawn / sectioning on; "Show whole parts" = touching parts shown whole vs cut at the box.
11842
11868
  // The whole-parts row only appears once a work area exists (nothing to act on before that — no dimmed dead control).
@@ -11849,10 +11875,10 @@ function updateWorkBtn(){const b=document.getElementById('m3dWork'),ck=document.
11849
11875
  // some = ◪ mixed. Colour comes from data-state (CSS); the glyph from the textContent.
11850
11876
  function updateCatTog(hdr){const tog=hdr&&hdr.querySelector('.cat-tog');if(!tog||!hdr._getState||tog.style.display==='none')return;
11851
11877
  const state=hdr._getState();tog.dataset.state=state;tog.textContent=state==='on'?'■':(state==='off'?'□':'◪');}
11852
- function refresh3DLegend(){if(!window.Steel3DView)return;const st=window.Steel3DView.groupState(),hidden=new Set(st.hidden),solo=new Set(st.solo);
11853
- document.querySelectorAll('#m3dLegend .lrow[data-key]').forEach(r=>{const k=r.dataset.key;const off=hidden.has(k)||(solo.size>0&&!solo.has(k));r.classList.toggle('off',off);r.classList.toggle('solo',solo.size>0&&solo.has(k));const sw=r.querySelector('.lsw');if(sw)sw.setAttribute('aria-checked',String(!off));}); // PROFILE rows (data-key); .off = hidden or outside the isolated set → box hollows; .solo = inside it (Explorer-style highlight)
11878
+ function refresh3DLegend(){if(!window.Steel3DView)return;const st=window.Steel3DView.groupState(),hidden=new Set(st.hidden),solo=new Set(st.solo),sh=new Set(window.Steel3DView.selectionHiddenIds?window.Steel3DView.selectionHiddenIds():[]);
11879
+ document.querySelectorAll('#m3dLegend .lrow[data-key]').forEach(r=>{const k=r.dataset.key,ids=legRowIds(r),n=ids.filter(id=>sh.has(id)).length;const off=hidden.has(k)||(solo.size>0&&!solo.has(k))||(ids.length>0&&n===ids.length),mixed=!off&&n>0;r.classList.toggle('off',off);r.classList.toggle('mixed',mixed);r.classList.toggle('solo',solo.size>0&&solo.has(k));const sw=r.querySelector('.lsw');if(sw)sw.setAttribute('aria-checked',mixed?'mixed':String(!off));}); // PROFILE rows: filled=shown, hollow=hidden, dash=mixed
11854
11880
  const ch=new Set(window.Steel3DView.connHiddenIds?window.Steel3DView.connHiddenIds():[]); // per-part connection hide
11855
- document.querySelectorAll('#m3dLegend .lrow[data-connkey]').forEach(r=>{const ids=r._ids||[];const off=ids.length>0&&ids.every(id=>ch.has(id));r.classList.toggle('off',off);const sw=r.querySelector('.lsw');if(sw)sw.setAttribute('aria-checked',String(!off));});
11881
+ document.querySelectorAll('#m3dLegend .lrow[data-connkey]').forEach(r=>{const ids=r._ids||[],n=ids.filter(id=>ch.has(id)||sh.has(id)).length,off=ids.length>0&&n===ids.length,mixed=!off&&n>0;r.classList.toggle('off',off);r.classList.toggle('mixed',mixed);const sw=r.querySelector('.lsw');if(sw)sw.setAttribute('aria-checked',mixed?'mixed':String(!off));});
11856
11882
  document.querySelectorAll('#m3dLegend .cat-hdr').forEach(updateCatTog);updateLegendReset();} // refresh the type-category master toggles + the show-all reset bar's visibility
11857
11883
  // ── Objects-list SELECTION — click a row (its name) to select its object[s] in 3D; Ctrl/Cmd add/remove, Shift range ──
11858
11884
  // Plain click is deferred (leg3dClickT) so a dbl-click can isolate instead; a modified click selects immediately
@@ -11876,7 +11902,7 @@ function refreshLegendSel(){const host=document.getElementById('m3dLegend');if(!
11876
11902
  // (the clicked row's current state drives the direction). Members toggle by group key, connections by part id.
11877
11903
  function legendBoxToggle(row){if(!row||!window.Steel3DView)return;
11878
11904
  const rows=row.classList.contains('lsel')?[...document.querySelectorAll('#m3dLegend .lrow.lsel')]:[row];
11879
- const willHide=!row.classList.contains('off'); // one direction for all: hide if the clicked box was shown, else show
11905
+ const willHide=!row.classList.contains('off')&&!row.classList.contains('mixed'); // filled → hide; hollow/dash → show all
11880
11906
  const keys=[],ids=[];for(const r of rows){if(r.dataset.connkey)ids.push(...(r._ids||[]));else if(r.dataset.key)keys.push(r.dataset.key);}
11881
11907
  if(keys.length&&window.Steel3DView.setGroupsHidden)window.Steel3DView.setGroupsHidden(keys,willHide);
11882
11908
  if(ids.length&&window.Steel3DView.setIdsHidden)window.Steel3DView.setIdsHidden(ids,willHide);
@@ -11893,7 +11919,7 @@ function legendReset(){if(!window.Steel3DView)return;window.Steel3DView.showAllG
11893
11919
  // Show the reset bar only when 3D visibility is non-default (something hidden / solo'd / isolated). Indifferent to search.
11894
11920
  function updateLegendReset(){const b=document.getElementById('m3dLegendReset');if(!b||!window.Steel3DView)return;
11895
11921
  const st=window.Steel3DView.groupState();
11896
- const filtered=(st.hidden&&st.hidden.length>0)||(st.solo&&st.solo.length>0)||(window.Steel3DView.isIsolated&&window.Steel3DView.isIsolated())||(window.Steel3DView.connHiddenIds&&window.Steel3DView.connHiddenIds().length>0);
11922
+ const filtered=(window.Steel3DView.hasVisibilityFilter&&window.Steel3DView.hasVisibilityFilter())||(st.hidden&&st.hidden.length>0)||(st.solo&&st.solo.length>0)||(window.Steel3DView.isIsolated&&window.Steel3DView.isIsolated())||(window.Steel3DView.connHiddenIds&&window.Steel3DView.connHiddenIds().length>0);
11897
11923
  b.classList.toggle('show',filtered);}
11898
11924
  // ── Objects-list SEARCH ──────────────────────────────────────────────────────────────────────────────────────
11899
11925
  // Search narrows the MEMBER + CONNECTION rows only (never Dimensions/Grid/Clip, never the 3D scene). Crossing
@@ -11965,14 +11991,23 @@ function wire3DBar(){if(bar3dWired||!window.Steel3DView)return;bar3dWired=true;
11965
11991
  // Property labels: independent 3D visibility for the shared prop-label selection (B1) — clears/repushes the 3D labels.
11966
11992
  document.getElementById('m3dPropLabels').onchange=e=>{if(!canWritePropLabelVis()){e.target.checked=plVis(true);return;}C.prop_labels.vis3d=e.target.checked;scheduleSave();refreshPropLabels3d();};
11967
11993
  roDisablePropLabelToggles(); // the 3D legend is built lazily, so the boot-time pass could not have reached this one
11994
+ function sync3dAnnotationChecks(){document.getElementById('m3dRef').checked=!!d3.refLine();document.getElementById('m3dLabels').checked=!!d3.labelsOn();document.getElementById('m3dPropLabels').checked=!!(C.prop_labels&&plVis(true));}
11995
+ function setAll3dAnnotations(show){if(!canWritePropLabelVis()){sync3dAnnotationChecks();toast('Annotation visibility is locked for this model');return;}
11996
+ d3.setRefLine(show);d3.setLabelsOn(show);C.prop_labels.vis3d=show;scheduleSave();refreshPropLabels3d();sync3dAnnotationChecks();}
11968
11997
  // View menu: groups the Ref line + Labels toggles (same open/close discipline as Clip / Work area / Plane).
11969
11998
  const viewBtn=document.getElementById('m3dView'),viewMenu=document.getElementById('m3dViewMenu');
11999
+ function menuItems(menu){return [...menu.querySelectorAll('button,input')].filter(el=>!el.disabled&&el.offsetParent!==null);}
12000
+ function menuKeys(e,menu,trigger,close){const items=menuItems(menu);if(e.key==='Escape'){e.preventDefault();e.stopPropagation();close(true);return;}if(!items.length)return;const i=items.indexOf(document.activeElement);if(e.key==='ArrowDown'){e.preventDefault();e.stopPropagation();items[(i+1+items.length)%items.length].focus();}else if(e.key==='ArrowUp'){e.preventDefault();e.stopPropagation();items[(i-1+items.length)%items.length].focus();}else if(e.key==='Home'){e.preventDefault();e.stopPropagation();items[0].focus();}else if(e.key==='End'){e.preventDefault();e.stopPropagation();items[items.length-1].focus();}else if((e.key==='Enter'||e.key===' ')&&i>=0){e.preventDefault();e.stopPropagation();items[i].click();}}
11970
12001
  function viewMenuOutside(e){if(!viewMenu.contains(e.target)&&e.target!==viewBtn)viewMenuClose();}
11971
- function viewMenuClose(){viewMenu.classList.remove('open');document.removeEventListener('mousedown',viewMenuOutside,true);}
12002
+ function viewMenuClose(focus=false){viewMenu.classList.remove('open');viewBtn.setAttribute('aria-expanded','false');document.removeEventListener('mousedown',viewMenuOutside,true);if(focus)viewBtn.focus();}
11972
12003
  viewBtn.onclick=e=>{e.stopPropagation();
11973
12004
  if(viewMenu.classList.contains('open'))viewMenuClose();
11974
- else{document.getElementById('m3dRef').checked=!!d3.refLine();document.getElementById('m3dLabels').checked=!!d3.labelsOn();document.getElementById('m3dPropLabels').checked=!!(C.prop_labels&&plVis(true)); // reflect live state on open
11975
- viewMenu.classList.add('open');document.addEventListener('mousedown',viewMenuOutside,true);}};
12005
+ else{sync3dAnnotationChecks();document.getElementById('m3dViewActions').style.display=canWritePropLabelVis()?'':'none'; // all means all: omit the bulk row if Property labels cannot be changed
12006
+ viewMenu.classList.add('open');viewBtn.setAttribute('aria-expanded','true');document.addEventListener('mousedown',viewMenuOutside,true);menuItems(viewMenu)[0]?.focus();}};
12007
+ document.getElementById('m3dViewHideAll').onclick=()=>setAll3dAnnotations(false);
12008
+ document.getElementById('m3dViewShowAll').onclick=()=>setAll3dAnnotations(true);
12009
+ viewBtn.addEventListener('keydown',e=>{if(e.key==='Escape'&&viewMenu.classList.contains('open')){e.preventDefault();e.stopPropagation();viewMenuClose(true);}else if((e.key==='ArrowDown'||e.key==='Enter'||e.key===' ')&&!viewMenu.classList.contains('open')){e.preventDefault();e.stopPropagation();viewBtn.click();}});
12010
+ viewMenu.addEventListener('keydown',e=>menuKeys(e,viewMenu,viewBtn,viewMenuClose));
11976
12011
  // Insert a detail: the ▾ menu lists the detail library + an "add image" option; picking one arms a
11977
12012
  // placement pick (onInsertPlace drops it). While armed the button is a cancel target (onInsertModeChange).
11978
12013
  // The menu is built with DOM nodes (textContent) — the detail names are user text, never innerHTML.
@@ -12089,7 +12124,18 @@ function wire3DBar(){if(bar3dWired||!window.Steel3DView)return;bar3dWired=true;
12089
12124
  ci$('ciBackdrop').onclick=()=>{if(ci$('ciProgStage').style.display==='none')ciClose();}; // no-op mid-run so a stray backdrop click can't orphan the AWARE run
12090
12125
  document.addEventListener('keydown',e=>{if(e.key==='Escape'&&ci$('connImportModal').style.display==='flex'){e.stopPropagation();ciClose();}},true);
12091
12126
  }
12092
- document.getElementById('m3dIso').onclick=()=>{if(d3.isIsolated())d3.clearIsolation();else d3.isolateSelected();}; // onIsolateChange refreshes the button label/visibility
12127
+ // Selection visibility: Isolate + Hide share one contextual menu; Show all remains reachable after the
12128
+ // hidden selection is cleared. Same outside-click/Escape discipline as the neighbouring 3D menus.
12129
+ const isoBtn=document.getElementById('m3dIso'),isoMenu=document.getElementById('m3dIsoMenu');
12130
+ function isoMenuOutside(e){if(!isoMenu.contains(e.target)&&e.target!==isoBtn)isoMenuClose();}
12131
+ function isoMenuClose(focus=false){isoMenu.classList.remove('open');isoBtn.setAttribute('aria-expanded','false');document.removeEventListener('mousedown',isoMenuOutside,true);if(focus){const wrap=document.getElementById('m3dIsoWrap');(wrap.style.display!=='none'?isoBtn:document.getElementById('m3dViewsBtn'))?.focus();}}
12132
+ isoBtn.onclick=e=>{e.stopPropagation();if(isoMenu.classList.contains('open'))isoMenuClose();else{updateIsolateBtn();const tip=document.getElementById('tooltip');if(tip)tip.classList.remove('show'); // the trigger tip must not cover the first menu row when the menu opens beneath the pointer
12133
+ isoMenu.classList.add('open');isoBtn.setAttribute('aria-expanded','true');document.addEventListener('mousedown',isoMenuOutside,true);menuItems(isoMenu)[0]?.focus();}};
12134
+ isoMenu.querySelector('[data-vis=show-all]').onclick=()=>{d3.showAllGroups();isoMenuClose(true);toast('Showing all objects');};
12135
+ isoMenu.querySelector('[data-vis=isolate]').onclick=()=>{d3.isolateSelected();isoMenuClose(true);};
12136
+ isoMenu.querySelector('[data-vis=hide]').onclick=()=>{const n=d3.hideSelected?d3.hideSelected():0;if(n){selIds.clear();render();toast(n+' object'+(n===1?'':'s')+' hidden');}isoMenuClose(true);};
12137
+ isoBtn.addEventListener('keydown',e=>{if(e.key==='Escape'&&isoMenu.classList.contains('open')){e.preventDefault();e.stopPropagation();isoMenuClose(true);}else if((e.key==='ArrowDown'||e.key==='Enter'||e.key===' ')&&!isoMenu.classList.contains('open')){e.preventDefault();e.stopPropagation();isoBtn.click();}});
12138
+ isoMenu.addEventListener('keydown',e=>menuKeys(e,isoMenu,isoBtn,isoMenuClose));
12093
12139
  // Views toolbar button: open the panel on the Views tab (or, if it's already open on Views, toggle it closed — a natural toolbar toggle).
12094
12140
  {const vb=document.getElementById('m3dViewsBtn');if(vb)vb.onclick=()=>{const p=document.getElementById('m3dLegend');const openOnViews=p&&p.style.display!=='none'&&legendTab==='views';if(openOnViews)setLegendPanelCollapsed(true);else{wireLegendTabs();showLegendPanel('views',true);}updateViewsBtn();};}
12095
12141
  // Work area: the ▢ Work area button opens a menu (Set to all objects / Define from selection / Show work area).
@@ -14511,7 +14557,8 @@ boot().catch(err => { document.body.replaceChildren(Object.assign(document.creat
14511
14557
  // Themed tooltips (replaces native title=) for the 3D toolbar — one shared element, shown on
14512
14558
  // data-tip hover after a short delay, positioned below the control and clamped to the viewport.
14513
14559
  (function(){ const tip=document.createElement('div'); tip.id='tooltip'; document.body.appendChild(tip); let t=null;
14514
- function show(el){ const txt=el.getAttribute('data-tip'); if(!txt) return; tip.textContent=txt; tip.classList.add('show');
14560
+ function show(el){ if(el.getAttribute('aria-haspopup')==='menu'&&el.getAttribute('aria-expanded')==='true')return; // an opening trigger can still have a pending hover timer; never let its tip cover the menu below it
14561
+ const txt=el.getAttribute('data-tip'); if(!txt) return; tip.textContent=txt; tip.classList.add('show');
14515
14562
  const r=el.getBoundingClientRect(), tw=tip.offsetWidth, th=tip.offsetHeight;
14516
14563
  let x=Math.max(6,Math.min(r.left+r.width/2-tw/2, innerWidth-tw-6)), y=r.bottom+6; if(y+th>innerHeight-6) y=r.top-th-6;
14517
14564
  tip.style.left=x+'px'; tip.style.top=y+'px'; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.127.3",
3
+ "version": "0.127.5",
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": {