@floless/app 0.90.1 → 0.90.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.
- package/dist/floless-server.cjs +2 -2
- package/dist/web/steel-3d-view.js +25 -10
- package/dist/web/steel-editor.html +32 -1
- package/package.json +1 -1
package/dist/floless-server.cjs
CHANGED
|
@@ -53106,7 +53106,7 @@ function appVersion() {
|
|
|
53106
53106
|
return resolveVersion({
|
|
53107
53107
|
isSea: isSea2(),
|
|
53108
53108
|
sqVersionXml: readSqVersionXml(),
|
|
53109
|
-
define: true ? "0.90.
|
|
53109
|
+
define: true ? "0.90.3" : 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.90.
|
|
53119
|
+
return resolveChannel({ isSea: isSea2(), define: true ? "0.90.3" : void 0 });
|
|
53120
53120
|
}
|
|
53121
53121
|
|
|
53122
53122
|
// workflow-update.ts
|
|
@@ -2243,6 +2243,16 @@ let wpDraft = null; // 3pt picks collected so far
|
|
|
2243
2243
|
let wpVisible = true; // "Show plane" toggle (applies to an explicit plane)
|
|
2244
2244
|
let wpGroup = null;
|
|
2245
2245
|
function effectiveWP() { return workPlane || { origin: [0, 0, api ? api.defaultTosMm() : 0], normal: [0, 0, 1], xAxis: [1, 0, 0] }; }
|
|
2246
|
+
// F3: lock a plan-space [dx,dy] drag delta to the dominant working-plane axis (Shift = ortho on a direct member drag — move or Ctrl+drag copy).
|
|
2247
|
+
// Reuses the Move/Copy u/v basis so a rotated set-axes frame is honoured; the default (no set-axes) frame reduces to
|
|
2248
|
+
// world X/Y, and a tilted frame falls back to X/Y too — the horizontal plan drag never gains a Z component.
|
|
2249
|
+
function orthoLockDelta(dx, dy) {
|
|
2250
|
+
const wp = effectiveWP();
|
|
2251
|
+
if (Math.abs(wp.normal[2]) < 0.9999) return Math.abs(dx) >= Math.abs(dy) ? [dx, 0] : [0, dy]; // ponytail: only an (essentially) horizontal frame — incl. rotated-about-Z — uses u/v; a genuinely tilted frame (>~0.8°) falls back to plan X/Y, whose u/v aren't horizontal (don't inject Z / attenuate the lock)
|
|
2252
|
+
const { u, v } = planeBasis(wp.normal, wp.xAxis);
|
|
2253
|
+
const du = dx * u[0] + dy * u[1], dv = dx * v[0] + dy * v[1];
|
|
2254
|
+
return Math.abs(du) >= Math.abs(dv) ? [du * u[0], du * u[1]] : [dv * v[0], dv * v[1]];
|
|
2255
|
+
}
|
|
2246
2256
|
function renderWorkPlane() {
|
|
2247
2257
|
if (wpGroup) { scene.remove(wpGroup); wpGroup.traverse((o) => { if (o.geometry) o.geometry.dispose(); if (o.material) o.material.dispose(); }); wpGroup = null; }
|
|
2248
2258
|
if (!workPlane || !wpVisible) return; // the implicit level plane is not drawn — the 2D plan already communicates it
|
|
@@ -2685,16 +2695,21 @@ function onMove(e) {
|
|
|
2685
2695
|
if (pending.mode === 'vertical') { onMoveVertical(e); return; }
|
|
2686
2696
|
const cur = rayToPlane(e.clientX, e.clientY, pending.planeZ); if (!cur) return;
|
|
2687
2697
|
let dx = cur[0] - pending.grab[0], dy = cur[1] - pending.grab[1];
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
+
let at = null, atType = null;
|
|
2699
|
+
if (e.shiftKey) { // F3: Shift = ortho lock along the dominant in-plane axis; snap suppressed (marker stays hidden) — mirrors the Move/Copy tool
|
|
2700
|
+
[dx, dy] = orthoLockDelta(dx, dy);
|
|
2701
|
+
} else {
|
|
2702
|
+
// snap the translated endpoints; take the closest winning correction
|
|
2703
|
+
let best = Infinity, corr = null;
|
|
2704
|
+
for (const ep of pending.origMm) {
|
|
2705
|
+
const tp = [ep[0] + dx, ep[1] + dy, ep[2]];
|
|
2706
|
+
const r = snapPoint(tp, pending.candidates, toScreen, SNAP_TOL_PX);
|
|
2707
|
+
if (!r.candidate) continue;
|
|
2708
|
+
const a = toScreen(tp), b = toScreen(r.snapped), d = Math.hypot(b.x - a.x, b.y - a.y);
|
|
2709
|
+
if (d < best) { best = d; corr = [r.snapped[0] - tp[0], r.snapped[1] - tp[1]]; at = r.snapped; atType = r.candidate.type; }
|
|
2710
|
+
}
|
|
2711
|
+
if (corr) { dx += corr[0]; dy += corr[1]; }
|
|
2712
|
+
}
|
|
2698
2713
|
pending.delta = [dx, dy];
|
|
2699
2714
|
if (pending.copy) positionCopyGhost(dx, dy); // Ctrl+drag: move a translucent ghost, never the original
|
|
2700
2715
|
else if (pending.mesh && pending.meshPos0) pending.mesh.position.set(pending.meshPos0.x + dx, pending.meshPos0.y + dy, pending.meshPos0.z);
|
|
@@ -1774,6 +1774,21 @@ function gridSelectables(){if(!gridOn())return [];const geo=gridGeo();if(!geo)re
|
|
|
1774
1774
|
(geo.h||[]).forEach((l,i)=>out.push({id:'gh:'+i,p1:[l.lo,l.y],p2:[l.hi,l.y]}));
|
|
1775
1775
|
(geo.lines||[]).forEach((l,i)=>out.push({id:'gl:'+(l.id!=null?l.id:i),p1:l.a.slice(),p2:l.b.slice()}));
|
|
1776
1776
|
return out;}
|
|
1777
|
+
// selected grid lines → display rows {label,type} for the inspector (resolves labels/types from gridGeo)
|
|
1778
|
+
function gridSelSummary(){const geo=gridGeo()||{};const out=[];
|
|
1779
|
+
for(const id of selGridIds){
|
|
1780
|
+
if(id.startsWith('gv:')){const l=(geo.v||[])[+id.slice(3)];out.push({label:l?l.label:'?',type:'Vertical'});}
|
|
1781
|
+
else if(id.startsWith('gh:')){const l=(geo.h||[])[+id.slice(3)];out.push({label:l?l.label:'?',type:'Horizontal'});}
|
|
1782
|
+
else if(id.startsWith('gl:')){const lid=id.slice(3),l=(geo.lines||[]).find(x=>String(x.id)===lid);out.push({label:l?l.label:'?',type:'Free'});}}
|
|
1783
|
+
return out;}
|
|
1784
|
+
// delete the selected FREE grid lines by identity (regular spacing lines can't be individually deleted → toast). Shared by the inspector Delete button; the keyboard Delete has its own bundled path (members+dims+grids in one edit()).
|
|
1785
|
+
function deleteSelGrids(){
|
|
1786
|
+
const glLids=new Set([...selGridIds].filter(id=>id.startsWith('gl:')).map(id=>id.slice(3)));
|
|
1787
|
+
const freeToDelete=(P.grid&&Array.isArray(P.grid.lines))?P.grid.lines.filter(l=>glLids.has(String(l.id))):[];
|
|
1788
|
+
const hadReg=[...selGridIds].some(id=>id.startsWith('gv:')||id.startsWith('gh:'));
|
|
1789
|
+
if(freeToDelete.length)edit(()=>{P.grid.lines=P.grid.lines.filter(l=>!glLids.has(String(l.id)));selGridIds.clear();});
|
|
1790
|
+
else{selGridIds.clear();render();}
|
|
1791
|
+
if(hadReg)toast('Regular grid lines come from the grid spacing — remove them in “Grid lines…”. Only free grid lines are deletable here.');}
|
|
1777
1792
|
// cursor-following distance readout for grid drags (same chrome as the 3D drag readout)
|
|
1778
1793
|
let gridRd=null;
|
|
1779
1794
|
function gridReadout(e,main,sub){
|
|
@@ -2505,6 +2520,19 @@ function panel(){
|
|
|
2505
2520
|
const eb=document.getElementById('partEdit');if(eb)eb.onclick=()=>{if(window.Steel3DView&&window.Steel3DView.clearConnSel)window.Steel3DView.clearConnSel();selIds=new Set([j.main]);selDimIds.clear();sel3dDimIds.clear();render();};
|
|
2506
2521
|
return;
|
|
2507
2522
|
}}
|
|
2523
|
+
if(selGridIds.size&&!selIds.size&&!selDimIds.size&&!view3d&&mode==='sel'){ // grid-only selection → a grid inspector (was falling through to the Legend)
|
|
2524
|
+
const g=gridSelSummary(),n=g.length,one=n===1?g[0]:null;
|
|
2525
|
+
const nFree=[...selGridIds].filter(id=>id.startsWith('gl:')).length,nReg=n-nFree;
|
|
2526
|
+
const parts=[['Vertical',g.filter(x=>x.type==='Vertical').length],['Horizontal',g.filter(x=>x.type==='Horizontal').length],['Free',nFree]].filter(([,c])=>c>0).map(([t,c])=>c+' '+t.toLowerCase());
|
|
2527
|
+
const regClause=nReg?(nReg===1?` One regular line comes from the grid spacing — respace or rename it in Grid lines…`:` Regular lines come from the grid spacing — respace or rename them in Grid lines…`):''; // scales singular/plural like the free clause
|
|
2528
|
+
const delLbl=(nReg?'Delete free':'Delete')+(nFree>1?` (${nFree})`:''); // count suffix like the multi-member "Delete selected (N)"
|
|
2529
|
+
p.innerHTML=`<span class=badge>Grid line${n>1?'s · '+n:''}</span>
|
|
2530
|
+
${one?`<div class=hint style="margin-top:8px">Grid <b>${esc(one.label)}</b> · ${one.type} line</div>`:`<div class=hint style="margin-top:8px">${esc(parts.join(' · '))}</div>`}
|
|
2531
|
+
<div class=hint style="margin-top:8px">Grid lines are the plan's structural reference.${nFree?` <b>Del</b> removes the free line${nFree>1?'s':''}.`:''}${regClause}</div>
|
|
2532
|
+
<div class="row f" style="gap:6px;margin-top:12px;flex-wrap:wrap"><button class=ghostw id=gridEditFromSel data-tip="Open the grid editor to rename, respace, or adjust the grid">✎ Grid lines…</button>${nFree?`<button class=danger id=gridDelFree data-tip="Delete the selected free grid line${nFree>1?'s':''} (Del)">${delLbl}</button>`:''}</div>`;
|
|
2533
|
+
{const eb=document.getElementById('gridEditFromSel');if(eb)eb.onclick=()=>{setGridMode(true);render();};}
|
|
2534
|
+
{const db=document.getElementById('gridDelFree');if(db)db.onclick=()=>deleteSelGrids();}
|
|
2535
|
+
return;}
|
|
2508
2536
|
const arr=selArr();
|
|
2509
2537
|
if(arr.length===0){p.innerHTML='<h3 style="display:flex;justify-content:space-between;align-items:center">Legend'+(Object.keys(C.profile_colors).length?'<button class=ghost id=resetCols style="font-size:10px;padding:1px 6px">reset colours</button>':'')+'</h3><div class=legend>'+profs.filter(pr=>P.members.some(mm=>mm.profile===pr)).map(pr=>`<span><input type=color class=swc data-prof="${esc(pr)}" value="${colorFor(pr)}" data-tip="Click to recolour ${esc(pr)}">${esc(pr)}</span>`).join('')+'</div><div class=hint style="margin-top:12px">Click a member to edit; <b>Ctrl</b>/<b>Shift+click</b> to add/remove; drag an empty area to <b>box-select</b> — <b>left→right</b> grabs fully-enclosed, <b>right→left</b> grabs touched (Ctrl/Shift adds). Drag a selected line to move it (all selected move together) — it snaps onto nearby grid/endpoints; drag an end dot to adjust — also snaps (<b>Alt</b> off). Hold <b>Shift</b> to keep it straight (H/V). <b>Ctrl+D</b> duplicate, <b>Ctrl+Z/Y</b> undo/redo, <b>Del</b> delete, <b>Esc</b> deselect. <b>Scroll</b> zoom, <b>middle-drag</b> pan, <b>Home</b> fit. Short even dashes = RFI (size unresolved, e.g. MF). A line with <b>arrowheads</b> is a <b>brace</b> — solid = above the floor, long–short dashes = below; the double arrowhead marks its lower end.</div>'+
|
|
2510
2538
|
'<div style="border-top:1px solid var(--line);margin-top:12px;padding-top:12px"><div class=sect>Project defaults</div>'+
|
|
@@ -2803,7 +2831,9 @@ function saveSnapPrefs(){try{localStorage.setItem(SNAP_PREF_KEY,JSON.stringify(s
|
|
|
2803
2831
|
// State: grid/dim are plain on/off; Members & Connections have per-TYPE switches (mtype/ckind, absent===on)
|
|
2804
2832
|
// and their class button is DERIVED (all/some/none on) — so "Members off" just means every member type off.
|
|
2805
2833
|
const SELF_KEY='steel:selFilter:v1';
|
|
2806
|
-
|
|
2834
|
+
// Grids default OFF (opt-in) — grid-line selection is a deliberate act, so a plain marquee/Ctrl+A doesn't
|
|
2835
|
+
// sweep the structural grid unless you switch it on. Members/Connections/Dimensions default ON.
|
|
2836
|
+
let selFilter=(()=>{try{const s=JSON.parse(localStorage.getItem(SELF_KEY)||'{}');return {grid:s.grid===true,dim:s.dim!==false,mtype:(s.mtype&&typeof s.mtype==='object')?s.mtype:{},ckind:(s.ckind&&typeof s.ckind==='object')?s.ckind:{}};}catch(_){return {grid:false,dim:true,mtype:{},ckind:{}};}})();
|
|
2807
2837
|
function saveSelFilter(){try{localStorage.setItem(SELF_KEY,JSON.stringify(selFilter));}catch(_){}}
|
|
2808
2838
|
const normConnKind=k=>String(k||'').trim().toLowerCase(); // 'base-plate' | 'shear-plate' | 'custom'
|
|
2809
2839
|
const selTypeOK=k=>selFilter.mtype[k]!==false; // per-member-type; absent === allowed
|
|
@@ -5416,6 +5446,7 @@ async function setView(on){
|
|
|
5416
5446
|
if(csaxisMode){csaxisMode=false;setCsMode();} // drops the in-progress origin (csDraft) + the set-axes panel
|
|
5417
5447
|
if(picking){picking=false;pickKind='profile';pickEnd=null;} // an armed inspector ⌖ pick
|
|
5418
5448
|
if(on){
|
|
5449
|
+
if(selGridIds.size){selGridIds.clear();disarmed2d=true;} // grids are 2D-only — a grid selection is invisible in 3D and would be silently removed by a 3D Delete (or a member-Delete), so drop it on entry
|
|
5419
5450
|
if(dimMode||dimChain||dimSplitMode){disarmed2d=true;dimMode=dimChain=dimSplitMode=false;selDimIds.clear();setDimMode();document.body.classList.remove('dimsplit');} // entering 3D disarms the 2D dim/chain/split tools so their X/Y/F/S/Esc keys don't double-fire with the 3D tool
|
|
5420
5451
|
if(dimStyleMode){disarmed2d=true;dimStyleMode=false;} // …and closes the 2D Dimension style pane (it styles the 2D overlay only)
|
|
5421
5452
|
if(disarmed2d)render(); // repaint the 2D SVG + inspector ONCE, now that EVERY 2D-only tool is disarmed and view3d is still false (2D render path): they suppress callouts / draw pick hotspots (:2061,:2069) and take over #panel, and the return-to-2D path never render()s — so a render here (like the Esc paths) un-stales the canvas + panel. Deferred past the dim/dim-style disarm so it can't paint a still-armed Dimension panel (dimMode can coexist with grid/pick) that then goes stale.
|