@floless/app 0.127.4 → 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.
- package/dist/floless-server.cjs +2 -2
- package/dist/web/steel-3d-view.js +24 -13
- package/dist/web/steel-editor.html +65 -24
- package/package.json +1 -1
package/dist/floless-server.cjs
CHANGED
|
@@ -54858,7 +54858,7 @@ function appVersion() {
|
|
|
54858
54858
|
return resolveVersion({
|
|
54859
54859
|
isSea: isSea2(),
|
|
54860
54860
|
sqVersionXml: readSqVersionXml(),
|
|
54861
|
-
define: true ? "0.127.
|
|
54861
|
+
define: true ? "0.127.5" : void 0,
|
|
54862
54862
|
pkgVersion: readPkgVersion()
|
|
54863
54863
|
});
|
|
54864
54864
|
}
|
|
@@ -54874,7 +54874,7 @@ function resolveChannel(s) {
|
|
|
54874
54874
|
function appChannel() {
|
|
54875
54875
|
return resolveChannel({
|
|
54876
54876
|
isSea: isSea2(),
|
|
54877
|
-
define: true ? "0.127.
|
|
54877
|
+
define: true ? "0.127.5" : void 0,
|
|
54878
54878
|
// argv[1] is the entry the runtime actually loaded (…/dist/floless-server.cjs), which is what
|
|
54879
54879
|
// carries the npx cache prefix. Absent under the SEA exe, which never reaches the npx branch.
|
|
54880
54880
|
modulePath: process.argv[1]
|
|
@@ -72,6 +72,7 @@ const groupHidden = new Set(); // profile keys hidden via the legen
|
|
|
72
72
|
let soloGroups = new Set(); // profile keys isolated via the legend (dbl-click; Ctrl/Shift add to the set)
|
|
73
73
|
let isolatedIds = null; // Tekla "isolate selected": Set of ids shown exclusively, or null for off
|
|
74
74
|
let connHidden = new Set(); // explicit per-PART hide (legend connection rows) — lets a shared part-kind (weld/nut) hide per-connection by id, not per group
|
|
75
|
+
let selectionHidden = new Set(); // session-only per-mesh hide from the toolbar's Hide selected action; raw renderer ids never enter the tagged saved-view contract
|
|
75
76
|
let cube = null; // ViewCube { renderer, scene, cam, mesh, faces }
|
|
76
77
|
let triad = null; // world-axis triad { renderer, scene, cam, group } — passive X/Y/Z readout
|
|
77
78
|
const DRAG_TOL_PX = 4; // movement past this = a drag (not a click)
|
|
@@ -888,8 +889,11 @@ function buildFromScene(sc) {
|
|
|
888
889
|
buildRefLines();
|
|
889
890
|
syncMemberLabels(); // refresh the member-label pool from the (possibly edited) member set
|
|
890
891
|
syncPropLabels(); // re-anchor the property labels too (member geometry may have moved)
|
|
891
|
-
|
|
892
|
+
const hadVisibilityFilter = hasVisibilityFilter();
|
|
893
|
+
if (isolatedIds) { isolatedIds = new Set([...isolatedIds].filter((id) => meshById.has(id))); if (!isolatedIds.size) isolatedIds = null; } // drop ids an edit removed; if none survive, exit isolation
|
|
892
894
|
if (connHidden.size) connHidden = new Set([...connHidden].filter((id) => meshById.has(id))); // drop per-part hides whose mesh an edit removed
|
|
895
|
+
if (selectionHidden.size) selectionHidden = new Set([...selectionHidden].filter((id) => meshById.has(id))); // drop transient hides whose mesh an edit removed
|
|
896
|
+
if (hadVisibilityFilter !== hasVisibilityFilter()) notifyVisibilityChange(); // keep the host's recovery control honest when an edit removes the last hidden/isolated mesh
|
|
893
897
|
applyGroupVisibility(); applyDisplayMode();
|
|
894
898
|
built = true;
|
|
895
899
|
if (fitPending) { fitCamera(box); fitPending = false; } // fit only on entering 3D (rebuild(true)) — NOT on every edit
|
|
@@ -2439,7 +2443,7 @@ function visibleIgnoringWorkArea(m) {
|
|
|
2439
2443
|
const k = m.userData && m.userData.group;
|
|
2440
2444
|
const byGroup = !groupHidden.has(k) && (soloGroups.size === 0 || soloGroups.has(k));
|
|
2441
2445
|
const byIso = isolatedIds === null || isolatedIds.has(m.userData.id); // isolate-selected: only the isolated ids show
|
|
2442
|
-
return byGroup && byIso && !connHidden.has(m.userData.id);
|
|
2446
|
+
return byGroup && byIso && !connHidden.has(m.userData.id) && !selectionHidden.has(m.userData.id);
|
|
2443
2447
|
}
|
|
2444
2448
|
function applyGroupVisibility() {
|
|
2445
2449
|
for (const m of meshById.values()) m.visible = visibleIgnoringWorkArea(m) && meshInWorkArea(m); // meshInWorkArea: work-area whole-parts spatial filter
|
|
@@ -2449,17 +2453,18 @@ function visibleMemberIds() {
|
|
|
2449
2453
|
for (const [id, m] of meshById) if (m.visible && !m.userData.derived) out.push(id);
|
|
2450
2454
|
return out;
|
|
2451
2455
|
}
|
|
2452
|
-
function
|
|
2456
|
+
function notifyVisibilityChange() { if (api && api.onIsolateChange) api.onIsolateChange(isolatedIds !== null); }
|
|
2457
|
+
function toggleGroup(k) { if (groupHidden.has(k)) groupHidden.delete(k); else groupHidden.add(k); soloGroups.clear(); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); notifyVisibilityChange(); }
|
|
2453
2458
|
// Hide/show a SET of groups in one pass (a legend type-category master toggle) — deterministic (not a flip),
|
|
2454
2459
|
// so "hide all" / "show all" for the category is exact. Clears solo, like toggleGroup.
|
|
2455
|
-
function setGroupsHidden(keys, hidden) {
|
|
2460
|
+
function setGroupsHidden(keys, hidden) { const target = new Set(keys || []); for (const k of target) { if (hidden) groupHidden.add(k); else groupHidden.delete(k); } if (!hidden && selectionHidden.size) selectionHidden = new Set([...selectionHidden].filter((id) => { const m = meshById.get(id); return !m || !target.has(m.userData && m.userData.group); })); soloGroups.clear(); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); notifyVisibilityChange(); }
|
|
2456
2461
|
// Hide/show specific PART ids (a legend connection row / connection master). Per-id so a connection's own
|
|
2457
2462
|
// nuts/welds toggle independently of the other connection's (the part-kind group is shared across joints).
|
|
2458
|
-
function setIdsHidden(ids, hidden) { for (const id of (ids || [])) { if (hidden) connHidden.add(id); else connHidden.delete(id); } applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); }
|
|
2463
|
+
function setIdsHidden(ids, hidden) { for (const id of (ids || [])) { if (hidden) connHidden.add(id); else { connHidden.delete(id); selectionHidden.delete(id); } } applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); notifyVisibilityChange(); }
|
|
2459
2464
|
// Isolate an explicit SET of profile groups (the editor's legend builds it from Ctrl/Shift dbl-clicks, Explorer-style).
|
|
2460
|
-
function setSoloGroups(keys) { soloGroups = new Set((keys || []).filter((k) => k != null)); if (soloGroups.size) groupHidden.clear(); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); }
|
|
2465
|
+
function setSoloGroups(keys) { soloGroups = new Set((keys || []).filter((k) => k != null)); if (soloGroups.size) groupHidden.clear(); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); notifyVisibilityChange(); }
|
|
2461
2466
|
function soloToggle(k) { setSoloGroups(soloGroups.size === 1 && soloGroups.has(k) ? [] : [k]); } // plain dbl-click: isolate just this group (or clear if it's already the only one)
|
|
2462
|
-
function showAllGroups() { groupHidden.clear(); soloGroups.clear(); isolatedIds = null; connHidden.clear(); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims();
|
|
2467
|
+
function showAllGroups() { groupHidden.clear(); soloGroups.clear(); isolatedIds = null; connHidden.clear(); selectionHidden.clear(); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); updateStatusChip(); notifyVisibilityChange(); }
|
|
2463
2468
|
function groupState() { return { hidden: [...groupHidden], solo: [...soloGroups] }; }
|
|
2464
2469
|
// One serialisable snapshot of the objects-list pane's PERSISTENT visibility state — group hide/solo +
|
|
2465
2470
|
// isolate-selected + per-part legend hides. This is what a saved view (Views Organizer) captures; it
|
|
@@ -2475,14 +2480,19 @@ function applyObjectsPaneState(s) {
|
|
|
2475
2480
|
soloGroups = new Set(Array.isArray(s.solo) ? s.solo : []);
|
|
2476
2481
|
isolatedIds = (Array.isArray(s.isolated) && s.isolated.length) ? new Set(s.isolated) : null;
|
|
2477
2482
|
connHidden = new Set(Array.isArray(s.connHidden) ? s.connHidden : []);
|
|
2483
|
+
selectionHidden.clear(); // Hide selected is session-only; applying a saved view restores its authored persistent visibility without leaking the current session filter
|
|
2478
2484
|
applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims();
|
|
2479
|
-
|
|
2485
|
+
notifyVisibilityChange();
|
|
2480
2486
|
}
|
|
2481
2487
|
// Tekla "isolate selected": show ONLY the currently-selected parts (a snapshot taken now — distinct from
|
|
2482
2488
|
// soloToggle, which isolates a whole PROFILE group from the legend). clearIsolation / showAllGroups restore all.
|
|
2483
|
-
function isolateSelected() { if (!selIds.size) return false; isolatedIds = new Set(selIds); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); updateStatusChip();
|
|
2484
|
-
|
|
2489
|
+
function isolateSelected() { if (!selIds.size) return false; isolatedIds = new Set(selIds); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); updateStatusChip(); notifyVisibilityChange(); return true; }
|
|
2490
|
+
// Hide the current selection by explicit mesh id. This remains session-only because v2 saved views require tagged
|
|
2491
|
+
// SceneRefs while the renderer owns raw ids; broadening that contract is a separate migration, not toolbar state.
|
|
2492
|
+
function hideSelected() { const ids = [...selIds].filter((id) => meshById.has(id)); if (!ids.length) return 0; for (const id of ids) selectionHidden.add(id); applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); updateStatusChip(); notifyVisibilityChange(); return ids.length; }
|
|
2493
|
+
function clearIsolation() { if (isolatedIds === null) return; isolatedIds = null; applyGroupVisibility(); rebuildEndpoints(); refreshOverlayDims(); refreshDims(); updateStatusChip(); notifyVisibilityChange(); }
|
|
2485
2494
|
function isIsolated() { return isolatedIds !== null; }
|
|
2495
|
+
function hasVisibilityFilter() { return isolatedIds !== null || groupHidden.size > 0 || soloGroups.size > 0 || connHidden.size > 0 || selectionHidden.size > 0; }
|
|
2486
2496
|
function getGroups() { return sceneGroups.map((g) => ({ ...g })); }
|
|
2487
2497
|
|
|
2488
2498
|
// ---- clip planes / clip boxes (Tekla-style sectioning) ----
|
|
@@ -5616,6 +5626,7 @@ function updateStatusChip() {
|
|
|
5616
5626
|
else if (showId) { const m = memberById(showId); txt = m ? `${m.id} · ${m.profile || '—'}` : ''; }
|
|
5617
5627
|
else if (selIds.size > 1) txt = `${selIds.size} members selected`;
|
|
5618
5628
|
else if (isolatedIds) txt = `Isolated: ${isolatedIds.size} · Show all to restore`;
|
|
5629
|
+
else if (selectionHidden.size) txt = `${selectionHidden.size} objects hidden · Show all to restore`;
|
|
5619
5630
|
// A read-only host (the vector 3D viewer) supplies its own idle hint — the default speaks editing
|
|
5620
5631
|
// verbs (move/stretch/elevate) a viewer's no-op api would silently ignore. Otherwise the default
|
|
5621
5632
|
// tells the truth about the drag-move/copy toggle (ON = drag-move + Ctrl-drag-copy; OFF = click-select).
|
|
@@ -5741,7 +5752,7 @@ function debug() {
|
|
|
5741
5752
|
// the pixels valid. Exists so a MATERIAL change can be checked by looking at it, not only by
|
|
5742
5753
|
// asserting on state — the whole point of Realistic is how it looks.
|
|
5743
5754
|
snapshot: (quality = 0.82) => { renderer.render(scene, camera); return canvasEl.toDataURL('image/jpeg', quality); },
|
|
5744
|
-
hidden: [...groupHidden], solo: [...soloGroups], isolated: isolatedIds ? [...isolatedIds] : null, visible: [...meshById.values()].filter((m) => m.visible).length,
|
|
5755
|
+
hidden: [...groupHidden], solo: [...soloGroups], isolated: isolatedIds ? [...isolatedIds] : null, selectionHidden: [...selectionHidden], visible: [...meshById.values()].filter((m) => m.visible).length,
|
|
5745
5756
|
endpoints: epGroup ? epGroup.children.length : 0,
|
|
5746
5757
|
endpointColors: epGroup ? epGroup.children.map((c) => '#' + c.material.color.getHexString()) : [],
|
|
5747
5758
|
hoverId, hoverGlowIds: [...hoverGlowIds], hoverEp, dragEp, refLine: refLineOn, // hoverGlowIds = the group the hover glow is computed over (whole connection at root, one part once drilled) — hoverId alone can't show that grouping. Selection still beats hover, so a selected id in this set glows brand blue, not sky
|
|
@@ -5880,9 +5891,9 @@ window.Steel3DView = {
|
|
|
5880
5891
|
if (!wpGroup) return { group: false, extent: wpExtent };
|
|
5881
5892
|
return { group: true, extent: wpExtent, children: wpGroup.children.map((c) => ({ type: c.type, color: c.material && '#' + c.material.color.getHexString(), opacity: c.material && c.material.opacity, w: c.geometry && c.geometry.parameters ? c.geometry.parameters.width : null, h: c.geometry && c.geometry.parameters ? c.geometry.parameters.height : null })) };
|
|
5882
5893
|
},
|
|
5883
|
-
toggleGroup, setGroupsHidden, setIdsHidden, connHiddenIds: () => [...connHidden], soloToggle, setSoloGroups, showAllGroups, groupState, getGroups, visibleMemberIds,
|
|
5894
|
+
toggleGroup, setGroupsHidden, setIdsHidden, connHiddenIds: () => [...connHidden], selectionHiddenIds: () => [...selectionHidden], soloToggle, setSoloGroups, showAllGroups, groupState, getGroups, visibleMemberIds,
|
|
5884
5895
|
setClipMode, clipMode: clipModeOn, addClipBox, toggleClip, removeClip, clearClips, getClips, renameClip, selectClip, setSelectedClips, selectedClips, deleteSelectedClips, clipState, setClipState,
|
|
5885
|
-
isolateSelected, clearIsolation, isIsolated,
|
|
5896
|
+
isolateSelected, hideSelected, clearIsolation, isIsolated, hasVisibilityFilter,
|
|
5886
5897
|
cameraState, setCameraState, sectionViewState, sceneBounds, objectsPaneState, applyObjectsPaneState, // saved-view snapshot surface (Views Organizer + F11 generated cuts)
|
|
5887
5898
|
workAreaSetAll, workAreaFromSelection, workAreaToggle, workAreaSetWhole, clearWorkArea, workAreaState,
|
|
5888
5899
|
armWorkPlanePick, setWorkPlanePrincipal, clearWorkPlane, toggleWorkPlaneVisible, workPlaneInfo,
|
|
@@ -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
|
-
<
|
|
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>
|
|
@@ -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();}, //
|
|
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
|
|
@@ -11712,8 +11731,8 @@ function build3DLegend(){const host=document.getElementById('m3dLegendBody');if(
|
|
|
11712
11731
|
if(opts.onToggle)tog.addEventListener('click',e=>{e.stopPropagation();opts.onToggle();refresh3DLegend();});
|
|
11713
11732
|
updateCatTog(hdr);return hdr;};
|
|
11714
11733
|
// master state/action over a set of part-group keys (members + connection categories share this)
|
|
11715
|
-
const grpState=keys=>{const h=new Set(window.Steel3DView.groupState().hidden);const
|
|
11716
|
-
const grpToggle=keys=>{
|
|
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)
|
|
11717
11736
|
const members=groups.filter(g=>!CONN_ORDER.includes(g.key));
|
|
11718
11737
|
const conns=groups.filter(g=>CONN_ORDER.includes(g.key)).sort((a,b)=>CONN_ORDER.indexOf(a.key)-CONN_ORDER.indexOf(b.key));
|
|
11719
11738
|
if(members.length){ // By profile ⇄ By type toggle, above the hint
|
|
@@ -11756,7 +11775,7 @@ function build3DLegend(){const host=document.getElementById('m3dLegendBody');if(
|
|
|
11756
11775
|
else{
|
|
11757
11776
|
const byConn=new Map(); // connType → Map(part-kind → [ids])
|
|
11758
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);}
|
|
11759
|
-
const hiddenSet=()=>new Set(window.Steel3DView.connHiddenIds());
|
|
11778
|
+
const hiddenSet=()=>new Set([...(window.Steel3DView.connHiddenIds?window.Steel3DView.connHiddenIds():[]),...(window.Steel3DView.selectionHiddenIds?window.Steel3DView.selectionHiddenIds():[])]);
|
|
11760
11779
|
const order=[...CONN_TYPES.map(t=>t.k),...[...byConn.keys()].filter(k=>!CONN_TYPES.some(t=>t.k===k))];
|
|
11761
11780
|
for(const ct of order){const pk=byConn.get(ct);if(!pk||!pk.size)continue;
|
|
11762
11781
|
const allIds=[].concat(...[...pk.values()]),label=(CONN_TYPES.find(t=>t.k===ct)||{}).label||'Other',ck='conn-'+ct;
|
|
@@ -11835,14 +11854,15 @@ function build3DLegend(){const host=document.getElementById('m3dLegendBody');if(
|
|
|
11835
11854
|
}
|
|
11836
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)
|
|
11837
11856
|
refresh3DLegend();applyLegendFilter();refreshLegendSel();} // the Objects body's visibility is owned by the active-tab class, not set here
|
|
11838
|
-
//
|
|
11839
|
-
//
|
|
11840
|
-
function updateIsolateBtn(){const b=document.getElementById('m3dIso');if(!b||!
|
|
11841
|
-
const
|
|
11842
|
-
|
|
11843
|
-
b.
|
|
11844
|
-
|
|
11845
|
-
|
|
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');}}
|
|
11846
11866
|
// The Work area button + its two slider toggles reflect the live work-area state (api.onWorkAreaChange).
|
|
11847
11867
|
// "Show work area" = box drawn / sectioning on; "Show whole parts" = touching parts shown whole vs cut at the box.
|
|
11848
11868
|
// The whole-parts row only appears once a work area exists (nothing to act on before that — no dimmed dead control).
|
|
@@ -11855,10 +11875,10 @@ function updateWorkBtn(){const b=document.getElementById('m3dWork'),ck=document.
|
|
|
11855
11875
|
// some = ◪ mixed. Colour comes from data-state (CSS); the glyph from the textContent.
|
|
11856
11876
|
function updateCatTog(hdr){const tog=hdr&&hdr.querySelector('.cat-tog');if(!tog||!hdr._getState||tog.style.display==='none')return;
|
|
11857
11877
|
const state=hdr._getState();tog.dataset.state=state;tog.textContent=state==='on'?'■':(state==='off'?'□':'◪');}
|
|
11858
|
-
function refresh3DLegend(){if(!window.Steel3DView)return;const st=window.Steel3DView.groupState(),hidden=new Set(st.hidden),solo=new Set(st.solo);
|
|
11859
|
-
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
|
|
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
|
|
11860
11880
|
const ch=new Set(window.Steel3DView.connHiddenIds?window.Steel3DView.connHiddenIds():[]); // per-part connection hide
|
|
11861
|
-
document.querySelectorAll('#m3dLegend .lrow[data-connkey]').forEach(r=>{const ids=r._ids||[]
|
|
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));});
|
|
11862
11882
|
document.querySelectorAll('#m3dLegend .cat-hdr').forEach(updateCatTog);updateLegendReset();} // refresh the type-category master toggles + the show-all reset bar's visibility
|
|
11863
11883
|
// ── Objects-list SELECTION — click a row (its name) to select its object[s] in 3D; Ctrl/Cmd add/remove, Shift range ──
|
|
11864
11884
|
// Plain click is deferred (leg3dClickT) so a dbl-click can isolate instead; a modified click selects immediately
|
|
@@ -11882,7 +11902,7 @@ function refreshLegendSel(){const host=document.getElementById('m3dLegend');if(!
|
|
|
11882
11902
|
// (the clicked row's current state drives the direction). Members toggle by group key, connections by part id.
|
|
11883
11903
|
function legendBoxToggle(row){if(!row||!window.Steel3DView)return;
|
|
11884
11904
|
const rows=row.classList.contains('lsel')?[...document.querySelectorAll('#m3dLegend .lrow.lsel')]:[row];
|
|
11885
|
-
const willHide=!row.classList.contains('off'); //
|
|
11905
|
+
const willHide=!row.classList.contains('off')&&!row.classList.contains('mixed'); // filled → hide; hollow/dash → show all
|
|
11886
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);}
|
|
11887
11907
|
if(keys.length&&window.Steel3DView.setGroupsHidden)window.Steel3DView.setGroupsHidden(keys,willHide);
|
|
11888
11908
|
if(ids.length&&window.Steel3DView.setIdsHidden)window.Steel3DView.setIdsHidden(ids,willHide);
|
|
@@ -11899,7 +11919,7 @@ function legendReset(){if(!window.Steel3DView)return;window.Steel3DView.showAllG
|
|
|
11899
11919
|
// Show the reset bar only when 3D visibility is non-default (something hidden / solo'd / isolated). Indifferent to search.
|
|
11900
11920
|
function updateLegendReset(){const b=document.getElementById('m3dLegendReset');if(!b||!window.Steel3DView)return;
|
|
11901
11921
|
const st=window.Steel3DView.groupState();
|
|
11902
|
-
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);
|
|
11903
11923
|
b.classList.toggle('show',filtered);}
|
|
11904
11924
|
// ── Objects-list SEARCH ──────────────────────────────────────────────────────────────────────────────────────
|
|
11905
11925
|
// Search narrows the MEMBER + CONNECTION rows only (never Dimensions/Grid/Clip, never the 3D scene). Crossing
|
|
@@ -11971,14 +11991,23 @@ function wire3DBar(){if(bar3dWired||!window.Steel3DView)return;bar3dWired=true;
|
|
|
11971
11991
|
// Property labels: independent 3D visibility for the shared prop-label selection (B1) — clears/repushes the 3D labels.
|
|
11972
11992
|
document.getElementById('m3dPropLabels').onchange=e=>{if(!canWritePropLabelVis()){e.target.checked=plVis(true);return;}C.prop_labels.vis3d=e.target.checked;scheduleSave();refreshPropLabels3d();};
|
|
11973
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();}
|
|
11974
11997
|
// View menu: groups the Ref line + Labels toggles (same open/close discipline as Clip / Work area / Plane).
|
|
11975
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();}}
|
|
11976
12001
|
function viewMenuOutside(e){if(!viewMenu.contains(e.target)&&e.target!==viewBtn)viewMenuClose();}
|
|
11977
|
-
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();}
|
|
11978
12003
|
viewBtn.onclick=e=>{e.stopPropagation();
|
|
11979
12004
|
if(viewMenu.classList.contains('open'))viewMenuClose();
|
|
11980
|
-
else{
|
|
11981
|
-
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));
|
|
11982
12011
|
// Insert a detail: the ▾ menu lists the detail library + an "add image" option; picking one arms a
|
|
11983
12012
|
// placement pick (onInsertPlace drops it). While armed the button is a cancel target (onInsertModeChange).
|
|
11984
12013
|
// The menu is built with DOM nodes (textContent) — the detail names are user text, never innerHTML.
|
|
@@ -12095,7 +12124,18 @@ function wire3DBar(){if(bar3dWired||!window.Steel3DView)return;bar3dWired=true;
|
|
|
12095
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
|
|
12096
12125
|
document.addEventListener('keydown',e=>{if(e.key==='Escape'&&ci$('connImportModal').style.display==='flex'){e.stopPropagation();ciClose();}},true);
|
|
12097
12126
|
}
|
|
12098
|
-
|
|
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));
|
|
12099
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).
|
|
12100
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();};}
|
|
12101
12141
|
// Work area: the ▢ Work area button opens a menu (Set to all objects / Define from selection / Show work area).
|
|
@@ -14517,7 +14557,8 @@ boot().catch(err => { document.body.replaceChildren(Object.assign(document.creat
|
|
|
14517
14557
|
// Themed tooltips (replaces native title=) for the 3D toolbar — one shared element, shown on
|
|
14518
14558
|
// data-tip hover after a short delay, positioned below the control and clamped to the viewport.
|
|
14519
14559
|
(function(){ const tip=document.createElement('div'); tip.id='tooltip'; document.body.appendChild(tip); let t=null;
|
|
14520
|
-
function show(el){
|
|
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');
|
|
14521
14562
|
const r=el.getBoundingClientRect(), tw=tip.offsetWidth, th=tip.offsetHeight;
|
|
14522
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;
|
|
14523
14564
|
tip.style.left=x+'px'; tip.style.top=y+'px'; }
|