@floless/app 0.89.2 → 0.90.0
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 +17 -3
- package/dist/web/steel-editor.html +71 -8
- 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.
|
|
53109
|
+
define: true ? "0.90.0" : 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.
|
|
53119
|
+
return resolveChannel({ isSea: isSea2(), define: true ? "0.90.0" : void 0 });
|
|
53120
53120
|
}
|
|
53121
53121
|
|
|
53122
53122
|
// workflow-update.ts
|
|
@@ -54062,8 +54062,10 @@ var SHEAR_PLATE_PARAMS = {
|
|
|
54062
54062
|
boltCols: [1, 10],
|
|
54063
54063
|
boltRows: [1, 30],
|
|
54064
54064
|
boltPitch: [1, 1e3],
|
|
54065
|
+
boltColPitch: [1, 1e3],
|
|
54065
54066
|
edgeDist: [0, 2e3]
|
|
54066
54067
|
};
|
|
54068
|
+
var gridCountsInteger = (p) => (!("boltCols" in p) || Number.isInteger(p.boltCols)) && (!("boltRows" in p) || Number.isInteger(p.boltRows));
|
|
54067
54069
|
function sanitizeRecipe(raw) {
|
|
54068
54070
|
if (!raw || typeof raw !== "object") return void 0;
|
|
54069
54071
|
const r = raw;
|
|
@@ -54080,6 +54082,7 @@ function sanitizeRecipe(raw) {
|
|
|
54080
54082
|
params[k] = num4[k];
|
|
54081
54083
|
}
|
|
54082
54084
|
}
|
|
54085
|
+
if (!gridCountsInteger(params)) return void 0;
|
|
54083
54086
|
return Object.keys(params).length ? { kind: r.kind, params } : void 0;
|
|
54084
54087
|
}
|
|
54085
54088
|
if (r.kind === "shear-plate") {
|
|
@@ -54090,6 +54093,16 @@ function sanitizeRecipe(raw) {
|
|
|
54090
54093
|
params[k] = num4[k];
|
|
54091
54094
|
}
|
|
54092
54095
|
}
|
|
54096
|
+
if (!gridCountsInteger(params)) return void 0;
|
|
54097
|
+
if ((params.boltCols ?? 1) <= 1) delete params.boltColPitch;
|
|
54098
|
+
if ((params.boltCols ?? 1) > 1) {
|
|
54099
|
+
if (!("boltDia" in params) || !("boltColPitch" in params) || params.boltColPitch < 2 * params.boltDia) return void 0;
|
|
54100
|
+
const w = params.plateWidth ?? 120, cols = params.boltCols;
|
|
54101
|
+
const edge = params.edgeDist ?? Math.max(1.5 * params.boltDia, 30);
|
|
54102
|
+
const edgeU = Math.min(edge, w * 0.4);
|
|
54103
|
+
const regHi = Math.max(edgeU, w - edgeU), regLo = Math.min(12.7 + edgeU, regHi);
|
|
54104
|
+
if (Math.min(params.boltColPitch, (regHi - regLo) / (cols - 1)) < 2 * params.boltDia) return void 0;
|
|
54105
|
+
}
|
|
54093
54106
|
return Object.keys(params).length ? { kind: r.kind, params } : void 0;
|
|
54094
54107
|
}
|
|
54095
54108
|
return Object.keys(num4).length ? { kind: r.kind, params: num4 } : void 0;
|
|
@@ -56979,6 +56992,7 @@ function expandShearPlate(joint, beam, support) {
|
|
|
56979
56992
|
const cols = intMin1(p, "boltCols", 1);
|
|
56980
56993
|
const rows = intMin1(p, "boltRows", 3);
|
|
56981
56994
|
const pitch = pos(p, "boltPitch", 70);
|
|
56995
|
+
const colPitch = pos(p, "boltColPitch", pitch);
|
|
56982
56996
|
const holeClr = num3(p, "holeClearance", 2);
|
|
56983
56997
|
const edge = Math.max(0, num3(p, "edgeDist", Math.max(1.5 * boltDia, 30)));
|
|
56984
56998
|
const weldLeg = num3(p, "weldLeg", 6);
|
|
@@ -56996,7 +57010,7 @@ function expandShearPlate(joint, beam, support) {
|
|
|
56996
57010
|
const regHi = Math.max(edgeU, width - edgeU);
|
|
56997
57011
|
const regLo = Math.min(clearance + edgeU, regHi);
|
|
56998
57012
|
const cU = (regLo + regHi) / 2;
|
|
56999
|
-
const pU = cols > 1 ? Math.min(
|
|
57013
|
+
const pU = cols > 1 ? Math.min(colPitch, (regHi - regLo) / (cols - 1)) : 0;
|
|
57000
57014
|
const uOffs = Array.from({ length: cols }, (_, j) => cU + (j - (cols - 1) / 2) * pU);
|
|
57001
57015
|
const nutH = 0.8 * boltDia, nutAF = 1.6 * boltDia;
|
|
57002
57016
|
const plateOuterN = webSide * (twHalf + thickness);
|
|
@@ -106,6 +106,15 @@
|
|
|
106
106
|
.edec{display:block;text-align:right;color:var(--mut);font-size:11px;margin-top:2px;font-variant-numeric:tabular-nums}
|
|
107
107
|
.elabrow{display:flex;align-items:center;justify-content:space-between;margin:8px 0 2px}
|
|
108
108
|
.elabrow .elab{margin:0}
|
|
109
|
+
/* F4: select-by-type filter — one clickable chip per object type in a MIXED selection. Click a chip to
|
|
110
|
+
DROP that type from the selection (real narrowing). Ghost look (overrides the global filled button); a
|
|
111
|
+
dashed border marks the Dimensions chip as a categorically different (annotation) object. */
|
|
112
|
+
.tfstrip{margin:2px 0 10px}
|
|
113
|
+
.tfchips{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
|
|
114
|
+
.tfchip{background:transparent;border:1px solid var(--line);color:var(--text);font:11px/1.4 system-ui;padding:2px 9px;border-radius:999px;cursor:pointer;white-space:nowrap}
|
|
115
|
+
.tfchip:hover{background:transparent;border-color:var(--brand);color:var(--brand)}
|
|
116
|
+
.tfchip:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
|
|
117
|
+
.tfchip.tfdim{border-style:dashed}
|
|
109
118
|
.defck{display:inline-flex;align-items:center;gap:4px;font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:var(--mut);cursor:pointer}
|
|
110
119
|
.defck input{width:auto;margin:0;cursor:pointer;accent-color:var(--brand)}
|
|
111
120
|
input:disabled{opacity:.55;cursor:default}
|
|
@@ -2283,10 +2292,10 @@ function panel(){
|
|
|
2283
2292
|
if(mode==='add'){
|
|
2284
2293
|
const pk=picking&&pickKind==='profile';
|
|
2285
2294
|
p.innerHTML=`<span class=badge>Add member</span>
|
|
2286
|
-
|
|
2295
|
+
${memberTypeField('mTypeA',[{memberType:addType}])}
|
|
2296
|
+
<div class=sect style="margin-top:8px">Current profile</div>
|
|
2287
2297
|
<div style="display:flex;gap:6px"><input id=addProf class=combo data-src=profiles placeholder="type or pick (e.g. W16X26)" value="${esc(addProfile)}" style="flex:1" autocomplete=off><button id=addPick class="ghost${pk?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>
|
|
2288
2298
|
<div class=hint id=pickHint style="margin-top:4px;font-style:italic${pk?';color:var(--brand)':''}">${pk?'Click a profile label in the drawing…':'or click a label in the drawing'}</div>
|
|
2289
|
-
${memberTypeField('mTypeA',[{memberType:addType}])}
|
|
2290
2299
|
<div class=divrow><hr></div>
|
|
2291
2300
|
<div class=sect>Draw a member</div>
|
|
2292
2301
|
<div class=hint id=drawHint>${view3d?'✏️ Click the start then the end — both land on the <b>working plane</b>. A near-vertical pick pair becomes a column. <b>Shift</b> = straight, <b>Esc</b> = exit.':drawHintText()}</div>`;
|
|
@@ -2416,7 +2425,7 @@ function panel(){
|
|
|
2416
2425
|
const sec=t=>`<div class=divrow><hr><span class=sect style="margin:0">${t}</span><hr></div>`;
|
|
2417
2426
|
let body='';
|
|
2418
2427
|
if(pk==='plate'&&j.kind==='shear-plate')body=sec('Plate')+kv('Width',dim(el&&el.width))+kv('Height',dim(el&&el.depth))+kv('Thickness',dim(el&&el.thickness))+kv('Weld leg',v('weldLeg','mm'))+kv('Clearance',v('clearance','mm'));
|
|
2419
|
-
else if(pk==='bolt')body=sec('Bolts')+kv('Grid (cols × rows)',esc(`${pp.boltCols||1} × ${pp.boltRows||3}`))+kv('Diameter',v('boltDia','mm'))+kv('Grade',pp.boltGrade?esc(pp.boltGrade):'A325'+dft)+kv('
|
|
2428
|
+
else if(pk==='bolt')body=sec('Bolts')+kv('Grid (cols × rows)',esc(`${pp.boltCols||1} × ${pp.boltRows||3}`))+kv('Diameter',v('boltDia','mm'))+kv('Grade',pp.boltGrade?esc(pp.boltGrade):'A325'+dft)+kv('Row pitch',v('boltPitch','mm'))+((Number(pp.boltCols)||1)>1?kv('Column pitch',pp.boltColPitch!=null?v('boltColPitch','mm'):dim(Number(pp.boltPitch!=null?pp.boltPitch:70))):'')+kv('Length','<span style="color:var(--mut)">auto (from grip)</span>');
|
|
2420
2429
|
else if(pk==='weld')body=sec('Weld')+kv('Leg',v('weldLeg','mm'));
|
|
2421
2430
|
else if(pk==='cope')body=sec('Cope')+kv('Length',dim(el&&el.width))+kv('Depth',dim(el&&el.depth))+kv('Re-entrant radius',v('copeRadius','mm'));
|
|
2422
2431
|
else if(pk==='stiff')body=sec('Stiffener')+`<div class=hint style="margin:0">Opposite-side web stiffener on the support.</div>`;
|
|
@@ -2477,10 +2486,10 @@ function panel(){
|
|
|
2477
2486
|
const posA=!allCol?agg(beams,m=>posDefault(m)):null;
|
|
2478
2487
|
const rotAgg=agg(arr,m=>((((+m.rot||0)%360)+360)%360)); // shared rotation, or VARIES
|
|
2479
2488
|
p.innerHTML=`<h3>${arr.length} members selected</h3>
|
|
2489
|
+
${typeFilterHTML()}
|
|
2480
2490
|
<div class="row hint" style="margin-top:0">Edits apply to <b>all ${arr.length}</b> selected · a blank <b>Varies</b> field is left unchanged.</div>
|
|
2481
|
-
<div class=row><label>Profile</label><input id=pf class=combo data-src=profiles placeholder="${VV(profAgg)?'Varies':''}" value="${VV(profAgg)?'':esc(profAgg||'')}" autocomplete=off></div>
|
|
2482
2491
|
${memberTypeField('mTypeM',arr)}
|
|
2483
|
-
|
|
2492
|
+
<div class="f"><div class=elab>Profile</div><input id=pf class=combo data-src=profiles placeholder="${VV(profAgg)?'Varies':''}" value="${VV(profAgg)?'':esc(profAgg||'')}" autocomplete=off></div>
|
|
2484
2493
|
<div class="row hint">Total length <b>${totalL} ft</b>${totalW!=null?` · <b>${totalW.toLocaleString()} lb</b>`:''}${dupSel?` · <span style="color:#fca5a5">${dupSel} duplicate${dupSel>1?'s':''}</span> (overlap a kept member — deleting these dedupes)`:''}</div>
|
|
2485
2494
|
<div class=row><button class=ghostw id=verifyBtn${allVerified?' style="border-color:#166534;color:#86efac"':''}>${allVerified?'✓ All verified — click to unverify':'Mark all verified'}</button></div>
|
|
2486
2495
|
${elev}
|
|
@@ -2494,6 +2503,7 @@ function panel(){
|
|
|
2494
2503
|
<div class=hint style="margin-top:6px">${geoMode==='el'?'Click a <b>target line</b> — the nearest end of <b>every</b> selected member snaps to where it meets that line.':'<b>Extend/Trim</b> (E) every selected member\'s nearest end to one line. <b>Esc</b> cancels.'}</div>
|
|
2495
2504
|
<div class=row><button class=ghostw id=swapEnds data-tip="Reverse every selected member: swap each one's start and end (yellow ↔ magenta / bottom ↔ top) handles · Shortcut: P">⇄ Swap start ↔ end (all) <span style="opacity:.55">(P)</span></button></div>
|
|
2496
2505
|
<div class="row f"><button class=danger id=del>Delete selected (${arr.length})</button></div>`;
|
|
2506
|
+
wireTypeFilter(p);
|
|
2497
2507
|
// wiring — every commit applies to the whole selection; a blank field is a no-op (leaves each member's own value).
|
|
2498
2508
|
document.getElementById('pf').onchange=e=>{const v=e.target.value.toUpperCase().replace(/ /g,'');if(!v)return;edit(()=>{for(const m of selArr()){m.profile=v;m.rfi=(_wt(v)==null);}if(!profs.includes(v)){profs.push(v);profs.sort();}});};
|
|
2499
2509
|
document.getElementById('mTypeM').onchange=e=>{const v=e.target.value;if(!normMemberTypeKey(v)){e.target.value=memberTypeValueFor(selArr());return;}edit(()=>{const k=memberTypeFromInput(v);if(!k)return;applyMemberType(selArr(),k);});}; // type owns Column-vs-beam-style role and legend category
|
|
@@ -2574,7 +2584,7 @@ function panel(){
|
|
|
2574
2584
|
<div class=elabrow><span class=elab>Weld sides</span></div>
|
|
2575
2585
|
<div class=seg2 style="margin-top:0"><button id="spw_e${e}_n" class="${(j.params&&j.params.weldSide==='near')?'on':''}">Near</button><button id="spw_e${e}_f" class="${(j.params&&j.params.weldSide==='far')?'on':''}">Far</button><button id="spw_e${e}_b" class="${(!j.params||!j.params.weldSide||j.params.weldSide==='both')?'on':''}">Both</button></div>
|
|
2576
2586
|
<div class=elab style="margin-top:7px;opacity:.7">Bolts</div>
|
|
2577
|
-
${spF(e,j,'boltCols','Bolt columns','1','')}${spF(e,j,'boltRows','Bolt rows','3','')}${spF(e,j,'boltDia','Bolt ⌀','3/4"','mm')}${spF(e,j,'boltPitch','
|
|
2587
|
+
${spF(e,j,'boltCols','Bolt columns','1','')}${spF(e,j,'boltRows','Bolt rows','3','')}${spF(e,j,'boltDia','Bolt ⌀','3/4"','mm')}${spF(e,j,'boltPitch','Row spacing','2 3/4"','mm')}${(Number(j.params&&j.params.boltCols)>1)?spF(e,j,'boltColPitch','Column spacing',(j.params&&j.params.boltPitch!=null?fmtFtIn(Number(j.params.boltPitch)/25.4):'2 3/4"'),'mm'):''}
|
|
2578
2588
|
<div class=elabrow><span class=elab>Bolt grade</span></div>
|
|
2579
2589
|
<div class=seg2 style="margin-top:0"><button id="spg_e${e}_325" class="${(j.params&&j.params.boltGrade==='A490')?'':'on'}">A325</button><button id="spg_e${e}_490" class="${(j.params&&j.params.boltGrade==='A490')?'on':''}">A490</button></div>
|
|
2580
2590
|
<div class=hint style="margin:4px 0 0">Bolt length auto-sizes from the grip (AISC) → shown on the bolt callout.</div>
|
|
@@ -2598,8 +2608,9 @@ function panel(){
|
|
|
2598
2608
|
<div class=hint style="margin:4px 0 0">Changes which end shows the double arrowhead. <b>Display only</b> — no geometry moves.</div></div>
|
|
2599
2609
|
<div class=hint style="margin:8px 0 0">Split / Extend / Trim don't apply to a brace — drag an end handle to move a work point, or set the Offset above.</div>`;
|
|
2600
2610
|
p.innerHTML=`<h3>Member ${esc(m.id)}</h3>
|
|
2601
|
-
|
|
2611
|
+
${typeFilterHTML()}
|
|
2602
2612
|
${memberTypeField('mTypeS',[m])}
|
|
2613
|
+
<div class="f"><div class=elab>Profile</div><div style="display:flex;gap:6px"><input id=pf class=combo data-src=profiles value="${esc(m.profile)}" style="flex:1" autocomplete=off><button id=pickProf class="ghost${(picking&&pickKind==='profile')?' on':''}" data-tip="Pick profile by clicking a label in the drawing">⌖ pick</button></div>${(picking&&pickKind==='profile')?'<div class="hint" style="margin-top:4px;font-style:italic;color:var(--brand)">Click a profile label in the drawing…</div>':(picking&&pickKind==='detail')?'<div class="hint" style="margin-top:4px;font-style:italic;color:#a855f7">Click a detail callout in the drawing…</div>':''}</div>
|
|
2603
2614
|
${braceSect}
|
|
2604
2615
|
<div class="row hint">Length <b>${L} ft</b> · ${wpf==null?'<span id=rfiPill class="pill pill-clickable" role=button tabindex=0 data-tip="Open the RFI list, focused on this member" style="background:#7f1d1d">RFI — size unresolved</span>':'Weight <b>'+(_lenFt(m)*wpf).toFixed(0)+' lb</b> · '+wpf+' lb/ft'}</div>
|
|
2605
2616
|
<div class=row><button class=ghostw id=verifyBtn${m.verified?' style="border-color:#166534;color:#86efac"':''} data-tip="Mark this member human-confirmed → 100% in the confidence report">${m.verified?'✓ Verified — human-confirmed':'Mark verified'}</button></div>
|
|
@@ -2616,6 +2627,7 @@ function panel(){
|
|
|
2616
2627
|
<div class=hint style="margin-top:6px">${geoMode==='el'?'Click a <b>target line</b> — another member or a grey segment. The nearest end of this member snaps to where the two lines meet (extends if short, trims if it overshoots).':geoMode==='split'?'Click a <b>point on this member</b> to cut it into two members.':'<b>Extend/Trim</b> (E) an end to meet another line · <b>Split</b> (S) at a point. <b>Esc</b> cancels.'}</div>
|
|
2617
2628
|
<div class=row><button class=ghostw id=swapEnds data-tip="Reverse the member: swap the start (${col?'bottom':'yellow'}) and end (${col?'top':'magenta'}) handles · Shortcut: P">⇄ Swap start ↔ end <span style="opacity:.55">(P)</span></button></div>`}
|
|
2618
2629
|
<div class="row f"><button class=danger id=del>Delete member</button></div>`;
|
|
2630
|
+
wireTypeFilter(p);
|
|
2619
2631
|
document.getElementById('pf').onchange=e=>edit(()=>{const v=e.target.value.toUpperCase().replace(/ /g,'');m.profile=v;m.rfi=(_wt(v)==null);if(v&&!profs.includes(v)){profs.push(v);profs.sort();}});
|
|
2620
2632
|
{const rp=document.getElementById('rfiPill');if(rp){const go=()=>openRFI(m.id);rp.onclick=go;rp.onkeydown=e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();e.stopPropagation();go();}};}} // F12: the RFI pill opens the list focused on THIS member (role=button span → keydown for Enter/Space). stopPropagation so idle Space/Enter doesn't ALSO hit the global repeat-last handler (:3804) — matches the editor's local-keydown convention (:1738,:4212)
|
|
2621
2633
|
document.getElementById('pickProf').onclick=()=>{if(picking&&pickKind==='profile'){picking=false;}else{picking=true;pickKind='profile';pickEnd=null;}render();};
|
|
@@ -2683,8 +2695,11 @@ function panel(){
|
|
|
2683
2695
|
const raw=(ev.target.value||'').trim();let n;if(isInt){n=raw===''?NaN:Math.round(Number(raw.replace(',','.')));}else{const pl=parseLen(raw);n=(pl==null)?NaN:pl*25.4;} // dimensional fields entered in ft-in/inches → store mm
|
|
2684
2696
|
edit(()=>{const jj=(C.joints||[]).find(x=>x&&x.id===jid);if(!jj)return;if(!jj.params)jj.params={};
|
|
2685
2697
|
if(isFinite(n)&&n>0)jj.params[key]=Math.min(isInt?MAXC:MAXD,n);else delete jj.params[key];
|
|
2698
|
+
// Enabling multiple columns: seed the column pitch from the current row pitch so the two axes are
|
|
2699
|
+
// DECOUPLED (else an absent boltColPitch silently inherits boltPitch and later row-pitch edits move both).
|
|
2700
|
+
if((Number(jj.params.boltCols)||1)>1&&jj.params.boltColPitch==null)jj.params.boltColPitch=jj.params.boltPitch!=null?jj.params.boltPitch:70;
|
|
2686
2701
|
jj.source='user';});};};
|
|
2687
|
-
['plateWidth','plateHeight','plateThickness','weldLeg','clearance','boltDia','boltPitch'].forEach(k=>wsp(k,false));['boltCols','boltRows'].forEach(k=>wsp(k,true));
|
|
2702
|
+
['plateWidth','plateHeight','plateThickness','weldLeg','clearance','boltDia','boltPitch','boltColPitch'].forEach(k=>wsp(k,false));['boltCols','boltRows'].forEach(k=>wsp(k,true));
|
|
2688
2703
|
{const setSide=(s)=>edit(()=>{const jj=(C.joints||[]).find(x=>x&&x.id===jid);if(!jj)return;if(!jj.params)jj.params={};jj.params.webSide=s;jj.source='user';}); // which face of the web the plate laps
|
|
2689
2704
|
const n=document.getElementById('spside_e'+e+'_n');if(n)n.onclick=()=>setSide(1);
|
|
2690
2705
|
const f=document.getElementById('spside_e'+e+'_f');if(f)f.onclick=()=>setSide(-1);}
|
|
@@ -4278,6 +4293,54 @@ function memberTypeField(id,ms){
|
|
|
4278
4293
|
const v=memberTypeValueFor(ms);
|
|
4279
4294
|
return `<div class="mtype-field f"><div class=elab>Member type</div><input id=${id} class="combo member-type-combo" data-src=membertypes placeholder="${v?'':'Varies'}" value="${esc(v)}" autocomplete=off></div>`;
|
|
4280
4295
|
}
|
|
4296
|
+
// ── F4: select-by-type filter for a MIXED selection ─────────────────────────────────────────────────────────
|
|
4297
|
+
// A marquee can grab a mix of object types (members of several member types + dimensions, and — once grids are
|
|
4298
|
+
// selectable — grid lines). typeFilterGroups buckets the CURRENT selection by type; typeFilterHTML renders one
|
|
4299
|
+
// chip per type, but ONLY when more than one type is present (a single-type selection shows nothing).
|
|
4300
|
+
// Plain-clicking a chip (wireTypeFilter) DROPS that type from the selection; Alt-clicking ISOLATES it (keeps only
|
|
4301
|
+
// that type, deselects the rest — the "solo this layer" gesture). Both are real narrowing → render() resyncs the
|
|
4302
|
+
// 2D glow/badges, the 3D highlight, AND re-runs panel(), which re-derives the strip from the now-smaller selection.
|
|
4303
|
+
// GRIDS: grid lines aren't selectable yet (they're drag-to-move today); a parallel session is adding grid
|
|
4304
|
+
// selection. This assumes it will expose a global `selGridIds` (a Set of grid-line ids, sibling to selIds/
|
|
4305
|
+
// selDimIds) and stays INERT until then — the `typeof selGridIds` guard in gridSelSet() means no ReferenceError
|
|
4306
|
+
// now, and the Grids chip + its drop/isolate light up automatically once that Set exists and the marquee fills
|
|
4307
|
+
// it. (That session still owns the render() selection highlight + Delete for a selected grid.)
|
|
4308
|
+
function gridSelSet(){return (typeof selGridIds!=='undefined'&&selGridIds&&typeof selGridIds.size==='number')?selGridIds:null;}
|
|
4309
|
+
function typeFilterGroups(){
|
|
4310
|
+
const g=[],by=new Map();
|
|
4311
|
+
for(const m of selArr()){const k=memberTypeOf(m);if(!by.has(k))by.set(k,[]);by.get(k).push(m.id);}
|
|
4312
|
+
for(const rec of memberTypeRecords())if(by.has(rec.k))g.push({kind:'member',key:rec.k,label:rec.label,ids:by.get(rec.k)}); // canonical member-type order (Column, Beam, Brace, Ledger, Frame, then custom)
|
|
4313
|
+
for(const [k,ids] of by)if(!g.some(x=>x.key===k))g.push({kind:'member',key:k,label:memberTypeLabel(k),ids}); // any stray key not in the records list (defensive)
|
|
4314
|
+
if(selDimIds.size)g.push({kind:'dim',key:'__dims',label:'Dimensions',ids:[...selDimIds]});
|
|
4315
|
+
const G=gridSelSet();if(G&&G.size)g.push({kind:'grid',key:'__grids',label:'Grids',ids:[...G]}); // inert until grids become selectable (see header)
|
|
4316
|
+
return g;
|
|
4317
|
+
}
|
|
4318
|
+
function typeFilterHTML(){
|
|
4319
|
+
const g=typeFilterGroups();if(g.length<2)return ''; // one type only → nothing to filter → no strip (the >1-type gate)
|
|
4320
|
+
const chips=g.map(x=>{const tip=`Click to drop ${x.label} · Alt-click to isolate ${x.label}`;
|
|
4321
|
+
const aria=`${x.label}, ${x.ids.length} selected. Activate to drop, hold Alt to isolate.`; // accessible name keeps the COUNT (visible-text override would lose it) + gesture-neutral wording; data-tip carries the pointer copy
|
|
4322
|
+
return `<button type=button class="tfchip${x.kind!=='member'?' tfdim':''}" data-tfkind="${x.kind}" data-tfkey="${esc(x.key)}" data-tip="${esc(tip)}" aria-label="${esc(aria)}">${esc(x.label)} · ${x.ids.length}</button>`;}).join(''); // dashed = a non-member (annotation/reference) group: Dimensions, Grids
|
|
4323
|
+
return `<div class=tfstrip><div class=elab>Mixed selection — click a type to drop it, Alt-click to isolate it</div><div class=tfchips role=group aria-label="Filter selection by object type">${chips}</div></div>`;
|
|
4324
|
+
}
|
|
4325
|
+
function wireTypeFilter(p){
|
|
4326
|
+
p.querySelectorAll('.tfchip').forEach(b=>{
|
|
4327
|
+
// plain = DROP this type; Alt = ISOLATE it (keep only this type, drop everything else). Three buckets:
|
|
4328
|
+
// members (by type), dims, grids. Both narrow the real selection, then render() resyncs 2D/3D + re-runs panel().
|
|
4329
|
+
const act=iso=>{const kind=b.dataset.tfkind,key=b.dataset.tfkey,G=gridSelSet();
|
|
4330
|
+
if(iso){ // keep ONLY this type
|
|
4331
|
+
if(kind==='member'){for(const m of selArr())if(memberTypeOf(m)!==key)selIds.delete(m.id);}else selIds.clear();
|
|
4332
|
+
if(kind!=='dim')selDimIds.clear();
|
|
4333
|
+
if(G&&kind!=='grid')G.clear();
|
|
4334
|
+
}else{ // drop just this type
|
|
4335
|
+
if(kind==='member'){for(const m of selArr())if(memberTypeOf(m)===key)selIds.delete(m.id);}
|
|
4336
|
+
else if(kind==='dim')selDimIds.clear();
|
|
4337
|
+
else if(kind==='grid'&&G)G.clear();
|
|
4338
|
+
}
|
|
4339
|
+
render();};
|
|
4340
|
+
b.onclick=e=>act(e.altKey);
|
|
4341
|
+
b.onkeydown=e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();e.stopPropagation();act(e.altKey);}}; // native <button> Enter/Space bubbles to the global idle-repeat-last handler (:3838, !inForm) which preventDefaults activation — activate here + stopPropagation, mirroring the F12 RFI pill (:2632). Alt+Enter/Space isolates (keyboard parity).
|
|
4342
|
+
});
|
|
4343
|
+
}
|
|
4281
4344
|
function profileKeyOf(m){return (m&&m.profile||'').trim().toUpperCase();} // matches the scene group key (contract-to-scene upper-cases the profile)
|
|
4282
4345
|
function categoryOfProfile(profKey){for(const m of (P.members||[]))if(profileKeyOf(m)===profKey)return memberTypeOf(m);return 'beam';} // a profile-group's category = the type of its member(s)
|
|
4283
4346
|
let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'profile';
|