@floless/app 0.98.0 → 0.99.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 +1359 -1266
- package/dist/web/steel-editor.html +20 -11
- package/package.json +1 -1
|
@@ -1098,7 +1098,7 @@ async function boot() {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
} catch (_) { /* no target goal shown */ }
|
|
1100
1100
|
PAL = (Array.isArray(C.palette) && C.palette.length) ? C.palette : DEFAULT_PAL; WT = C.weights || {};
|
|
1101
|
-
try { const _sr = await fetch('/api/aisc-shapes'); if (_sr.ok) { const _sj = await _sr.json(); if (Array.isArray(_sj.shapes)) window.__AISC_SHAPES = new Set(_sj.shapes); if (_sj.bf && typeof _sj.bf === 'object') window.__AISC_BF = _sj.bf; } } catch (_) { /* no shape table → _nominalPlf falls back to regex-only; columns fall back to the marker footprint */ }
|
|
1101
|
+
try { const _sr = await fetch('/api/aisc-shapes'); if (_sr.ok) { const _sj = await _sr.json(); if (Array.isArray(_sj.shapes)) window.__AISC_SHAPES = new Set(_sj.shapes); if (_sj.bf && typeof _sj.bf === 'object') window.__AISC_BF = _sj.bf; if (_sj.sections && typeof _sj.sections === 'object') window.__AISC_SECTIONS = _sj.sections; } } catch (_) { /* no shape table → _nominalPlf falls back to regex-only; columns fall back to the marker footprint */ }
|
|
1102
1102
|
// No weight seeding needed: every RFI/weight read resolves through _wt(), which falls back to the
|
|
1103
1103
|
// SHAPES-guarded _nominalPlf for a valid AISC designation absent from the contract's weights map.
|
|
1104
1104
|
C.custom_details = C.custom_details || {};
|
|
@@ -1551,9 +1551,12 @@ function updUR(){document.getElementById('undoB').disabled=!undo.length;document
|
|
|
1551
1551
|
// index moved off it — a blank/RFI/other-plan profile must not shift a real profile's slot.) Rebuilt at
|
|
1552
1552
|
// render() top so it tracks edits without touching every profs.push site.
|
|
1553
1553
|
let colorRank=[];
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1554
|
+
// Canonical designation (MIRRORS server contract-to-scene canonProfile): upper, x/X/× → X, whitespace
|
|
1555
|
+
// around X / after the prefix removed, mixed-fraction spaces kept. One identity for 2D / 3D / IFC / Tekla.
|
|
1556
|
+
function canonProfile(s){return String(s||'').trim().toUpperCase().replace(/×/g,'X').replace(/\s*X\s*/g,'X').replace(/^([A-Z]+)\s+/,'$1');}
|
|
1557
|
+
function buildColorRank(){colorRank=[...new Set([...(C.plans||[]).flatMap(pl=>(pl.members||[]).map(m=>canonProfile(m.profile))).filter(Boolean), ...Object.keys(WT||{}).map(canonProfile)])].sort();}
|
|
1558
|
+
function colorFor(p){const k=canonProfile(p);
|
|
1559
|
+
const ov=C.profile_colors[p]??(Object.entries(C.profile_colors).find(([kk])=>canonProfile(kk)===k)||[])[1]; // override: exact key, then canonical (case + x/X/× + separator whitespace) — mirrors contract-to-scene pickColor so an override resolves identically in 2D + 3D
|
|
1557
1560
|
if(ov)return ov;
|
|
1558
1561
|
const i=colorRank.indexOf(k);return PAL[((i%PAL.length)+PAL.length)%PAL.length];} // i<0 (blank/CUSTOM/unresolved) wraps to PAL[last], matching pickColor so those members agree in 2D + 3D too
|
|
1559
1562
|
// F5: per member-type 2D line style. Tokens → px; dashes chosen to avoid the reserved semantic patterns
|
|
@@ -1585,14 +1588,20 @@ function len(a,b){return Math.hypot(a[0]-b[0],a[1]-b[1]);}
|
|
|
1585
1588
|
// /api/aisc-shapes. Returns null for an unresolved mark (RFI).
|
|
1586
1589
|
function profileDimsIn(profile){
|
|
1587
1590
|
if(!profile)return null;
|
|
1588
|
-
const p=String(profile).trim().toUpperCase();
|
|
1591
|
+
const p=String(profile).trim().toUpperCase().replace(/×/g,'X'); // separator may be x / X / ×
|
|
1589
1592
|
if(p===''||/(^|[^A-Z])MF($|[^A-Z])/.test(p))return null;
|
|
1590
|
-
const m=p.match(/^([A-Z]+)\s*(
|
|
1591
|
-
|
|
1593
|
+
const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
|
|
1594
|
+
// parseDim (not parseFloat) so a mixed-fraction leg "3 1/2" → 3.5, not 3 — mirrors server contract-to-scene.
|
|
1595
|
+
const _pd=t=>{const s=String(t).trim();let mm=s.match(/^(\d+)\s+(\d+)\/(\d+)$/);if(mm)return +mm[1]+ +mm[2]/+mm[3];mm=s.match(/^(\d+)\/(\d+)$/);if(mm)return +mm[1]/+mm[2];const d=parseFloat(s);return isFinite(d)?d:null;};
|
|
1596
|
+
const prefix=m[1],nums=m[2].split('X').map(_pd).filter(n=>n!=null);
|
|
1592
1597
|
if(!nums.length)return null;
|
|
1593
1598
|
if((prefix==='HSS'||prefix==='TUBE'||prefix==='L')&&nums.length>=3)return{d:nums[0],w:nums[1]};
|
|
1594
1599
|
if(prefix==='HSS'||prefix==='PIPE'){const dia=nums[0];return{d:dia,w:dia};}
|
|
1595
|
-
if(/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)){const
|
|
1600
|
+
if(/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)){const key=p.replace(/\s+/g,'');
|
|
1601
|
+
// ACTUAL AISC depth+width when tabulated (the leading number is the NOMINAL series depth). Mirrors
|
|
1602
|
+
// server sectionDimsIn → __AISC_SECTIONS {designation:[d,bf]} from /api/aisc-shapes.
|
|
1603
|
+
const sec=(window.__AISC_SECTIONS||{})[key];if(sec)return{d:sec[0],w:sec[1]};
|
|
1604
|
+
const d=nums[0],bf=(window.__AISC_BF||{})[key];
|
|
1596
1605
|
if(bf!==undefined)return{d,w:bf};const ratio=(prefix==='C'||prefix==='MC')?0.28:0.42;return{d,w:d*ratio};}
|
|
1597
1606
|
return null;
|
|
1598
1607
|
}
|
|
@@ -4872,7 +4881,7 @@ function wireTypeFilter(p){
|
|
|
4872
4881
|
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).
|
|
4873
4882
|
});
|
|
4874
4883
|
}
|
|
4875
|
-
function profileKeyOf(m){return (m&&m.profile
|
|
4884
|
+
function profileKeyOf(m){return canonProfile(m&&m.profile);} // matches the scene group key (contract-to-scene canonProfile)
|
|
4876
4885
|
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)
|
|
4877
4886
|
let legendMode=(localStorage.getItem('floless.legendMode')==='type')?'type':'profile';
|
|
4878
4887
|
let collapsedCats=new Set((()=>{try{return JSON.parse(localStorage.getItem('floless.legendCollapsed')||'[]');}catch{return [];}})());
|
|
@@ -6122,11 +6131,11 @@ const BANDPILL={verified:'background:#166534;color:#86efac',high:'background:#14
|
|
|
6122
6131
|
// "×" IS the AISC lb/ft (W10X33 = 33). Resolves a valid size even with no weights map — but ONLY a size that
|
|
6123
6132
|
// actually exists in the AISC catalogue (SHAPES), so a regex-matching but non-standard string (e.g. W99X999)
|
|
6124
6133
|
// stays unresolved (RFI) instead of being trusted for a bogus name-encoded weight.
|
|
6125
|
-
function _nominalPlf(p){const k=String(p||'').toUpperCase().replace(/\s/g,'');const m=k.match(/^(W|M|S|HP|C|MC|WT|MT|ST)\d+(?:\.\d+)?X([\d.]+)$/);if(!m)return null;const _S=window.__AISC_SHAPES;if(_S&&!_S.has(k))return null;return parseFloat(m[2]);}
|
|
6134
|
+
function _nominalPlf(p){const k=String(p||'').toUpperCase().replace(/\s/g,'').replace(/×/g,'X');const m=k.match(/^(W|M|S|HP|C|MC|WT|MT|ST)\d+(?:\.\d+)?X([\d.]+)$/);if(!m)return null;const _S=window.__AISC_SHAPES;if(_S&&!_S.has(k))return null;return parseFloat(m[2]);}
|
|
6126
6135
|
function _ensureWt(p){if(p&&WT&&WT[p]==null){const v=_nominalPlf(p);if(v!=null)WT[p]=v;}}
|
|
6127
6136
|
function _wt(profile){if(!profile)return null;
|
|
6128
6137
|
if(WT&&profile in WT&&WT[profile]!=null)return WT[profile];
|
|
6129
|
-
if(WT){const h=Object.entries(WT).find(([k])=>k
|
|
6138
|
+
if(WT){const t=canonProfile(profile);const h=Object.entries(WT).find(([k])=>canonProfile(k)===t);if(h&&h[1]!=null)return h[1];} // shared canonProfile identity so a ×/spaced designation matches its weight-map key
|
|
6130
6139
|
return _nominalPlf(profile);} // fall back to the lb/ft encoded in a standard designation
|
|
6131
6140
|
const _isMf=p=>!!p&&/(^|[^A-Z])MF($|[^A-Z])/i.test(p);
|
|
6132
6141
|
// Elevation-aware coincident dedupe for the browser confidence panel — same footprint+wildcard-elevation logic as
|