@floless/app 0.138.1 → 0.139.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/autostart.mjs +6 -2
- package/desktop-access-production-manifest.mjs +7 -0
- package/dist/floless-server.cjs +157133 -70500
- package/dist/schemas/model.continuation.v1.schema.json +19 -0
- package/dist/schemas/model.continuation.v2.schema.json +19 -0
- package/dist/schemas/model.query-response.v1.schema.json +95 -0
- package/dist/schemas/model.query-response.v2.schema.json +80 -0
- package/dist/schemas/model.query.v1.schema.json +87 -0
- package/dist/schemas/model.query.v2.schema.json +87 -0
- package/dist/schemas/model.snap-candidate.v1.schema.json +48 -0
- package/dist/schemas/model.snap-constraint.v1.schema.json +18 -0
- package/dist/schemas/model.snap-query.v1.schema.json +24 -0
- package/dist/schemas/model.snap-result.v1.schema.json +33 -0
- package/dist/schemas/model.snapshot.v1.schema.json +136 -0
- package/dist/schemas/revit.model.v1.schema.json +24 -0
- package/dist/schemas/steel.model.v2.schema.json +45 -6
- package/dist/skills/floless-app-approval/SKILL.md +19 -5
- package/dist/skills/floless-app-bridge/SKILL.md +19 -6
- package/dist/skills/floless-app-knowledge/SKILL.md +22 -1
- package/dist/skills/floless-app-new-workflow/SKILL.md +31 -27
- package/dist/skills/floless-app-new-workflow/references/build-and-verify.md +13 -12
- package/dist/skills/floless-app-onboarding/SKILL.md +3 -3
- package/dist/skills/floless-app-onboarding/references/floless-app-tour.md +16 -9
- package/dist/skills/floless-app-steel-model/SKILL.md +11 -2
- package/dist/skills/floless-app-steel-model/references/detail-from-a-screenshot.md +95 -0
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +146 -21
- package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +19 -0
- package/dist/skills/floless-app-tweak-contract/SKILL.md +42 -8
- package/dist/skills/floless-app-vectorize/SKILL.md +19 -6
- package/dist/skills/floless-app-workflows/SKILL.md +30 -3
- package/dist/skills/floless-app-workflows/references/workspace-data.md +77 -4
- package/dist/templates/floless-workspace-model-report.flo +77 -0
- package/dist/templates/revit-model.flo +111 -0
- package/dist/web/app.css +415 -177
- package/dist/web/app.js +302 -51
- package/dist/web/aware.js +1430 -1040
- package/dist/web/chat.css +692 -0
- package/dist/web/chat.js +2651 -0
- package/dist/web/commands-revit.js +42 -0
- package/dist/web/commands-shell.js +536 -70
- package/dist/web/commands-steel.js +344 -146
- package/dist/web/commands.js +1 -1
- package/dist/web/index.html +283 -77
- package/dist/web/instructor.js +217 -36
- package/dist/web/left-pane.js +636 -0
- package/dist/web/model-artifact-loader.js +75 -0
- package/dist/web/model-authoring-gestures.js +141 -0
- package/dist/web/model-cad-tools.js +20 -0
- package/dist/web/model-clip-gesture.js +148 -0
- package/dist/web/model-clip-list.js +156 -0
- package/dist/web/model-clip-session.js +274 -0
- package/dist/web/model-clip-three-overlay.js +295 -0
- package/dist/web/model-clip-three-preview.js +59 -0
- package/dist/web/model-editor-contract.js +519 -0
- package/dist/web/model-editor-revit-adapter.js +139 -0
- package/dist/web/model-editor-shell.js +271 -0
- package/dist/web/model-editor-state-recovery.js +44 -0
- package/dist/web/model-editor-steel-adapter.js +410 -0
- package/dist/web/model-editor.css +268 -0
- package/dist/web/model-frame.js +192 -0
- package/dist/web/model-inspector.js +128 -0
- package/dist/web/model-measure.js +390 -0
- package/dist/web/model-navigation-controls.js +246 -0
- package/dist/web/model-orientation-overlay.js +217 -0
- package/dist/web/model-panel-bridge.js +230 -0
- package/dist/web/model-pointer-dock.js +164 -0
- package/dist/web/model-revit-module.js +83 -0
- package/dist/web/model-selection-coordinator.js +151 -0
- package/dist/web/model-selection-tools.js +290 -0
- package/dist/web/model-snap-contract.js +267 -0
- package/dist/web/model-snapping.js +497 -0
- package/dist/web/model-spatial-panel.js +294 -0
- package/dist/web/model-spatial-tools.js +249 -0
- package/dist/web/model-tree.js +47 -0
- package/dist/web/model-viewport-lighting.js +166 -0
- package/dist/web/model-viewport-revit-adapter.js +1224 -0
- package/dist/web/model-viewport-state.js +505 -0
- package/dist/web/model-viewport-steel-adapter.js +150 -0
- package/dist/web/model-viewport-toolbar.js +516 -0
- package/dist/web/model-viewport.js +717 -0
- package/dist/web/panels.js +8 -15
- package/dist/web/renderers.js +3 -0
- package/dist/web/revit-editor.css +35 -0
- package/dist/web/revit-editor.html +74 -0
- package/dist/web/revit-editor.js +845 -0
- package/dist/web/steel-3d-core.js +16 -44
- package/dist/web/steel-3d-view.js +1384 -633
- package/dist/web/steel-canvas-guidance.js +3 -1
- package/dist/web/steel-editor.html +2121 -1253
- package/dist/web/steel-filter.html +5 -1
- package/dist/web/steel-model-v2-commands.js +72 -1
- package/dist/web/steel-split-view.js +5 -39
- package/dist/web/steel-view-generation.js +107 -17
- package/dist/web/vector-3d.html +12 -0
- package/dist/web/workspaces.js +2190 -277
- package/distribution-profile-active.mjs +2 -0
- package/distribution-profile-production.mjs +47 -0
- package/distribution-profile-shared.mjs +8 -0
- package/distribution-profile.mjs +18 -0
- package/distribution-resource-inventory.mjs +81 -0
- package/launch.mjs +18 -10
- package/log.mjs +2 -1
- package/managed-runtime-policy.mjs +104 -0
- package/model-reader-policy-active.mjs +7 -0
- package/network-policy-active.mjs +6 -0
- package/package.json +17 -2
- package/post-update-marker.mjs +3 -1
- package/rvt-production-uat-authority.mjs +60 -0
- package/teardown.mjs +4 -3
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* model-editor.css — chrome shared by every 3D editor module, starting with the viewport toolbar.
|
|
3
|
+
*
|
|
4
|
+
* WHAT IS HERE, AND WHY SO LITTLE OF THE TOOLBAR'S APPEARANCE IS.
|
|
5
|
+
*
|
|
6
|
+
* The plan for this extraction assumed the toolbar's styling was separable: move the rules the
|
|
7
|
+
* rendered bar depends on, and a second editor inherits a styled toolbar. Reading the stylesheet
|
|
8
|
+
* proved that boundary wrong, and the measurement is worth recording rather than quietly working
|
|
9
|
+
* around.
|
|
10
|
+
*
|
|
11
|
+
* `.m3dmenu` is NOT the toolbar's dropdown skin — it is the PAGE's dropdown skin. `#m3dInsertMenu`,
|
|
12
|
+
* in the header's ⋯ menu, uses it too, and steel-editor.html says so in as many words at the top of
|
|
13
|
+
* its own stylesheet: the .m3dmenus outside #m3dBar — #m3dInsertMenu in the ⋯ menu, and the
|
|
14
|
+
* Views/Favourites/References row menus in the main window's left Model section — "correctly go light
|
|
15
|
+
* with their host, which is why the .m3dmenu rules are tokenized rather than left as dark literals." `.mck` (the slider knob) and `.mlabel` (the section caption)
|
|
16
|
+
* are shared three ways, with `#moreMenu` and `.cmmenu`.
|
|
17
|
+
*
|
|
18
|
+
* So moving them here would not be an extraction. It would take styling that belongs to the header's
|
|
19
|
+
* menus out of the page they belong to, and hand a future Revit host a stylesheet full of rules named
|
|
20
|
+
* for another editor's ⋯ menu. Only the rules that are unambiguously the TOOLBAR's move now; the
|
|
21
|
+
* shared dropdown skin waits for Task 3, which has to confront the same question for the Explorer and
|
|
22
|
+
* Inspector and will have a second real consumer to draw the boundary against.
|
|
23
|
+
*
|
|
24
|
+
* The consequence is stated rather than hidden: a second editor that renders this toolbar needs the
|
|
25
|
+
* dropdown skin from somewhere. Today that is a host requirement, and this comment is the declaration
|
|
26
|
+
* of it. `docs/qa/2026-08-20-steel-toolbar-styles.json` pins what the rendered bar must compute to,
|
|
27
|
+
* so the day that skin moves, the move is checkable.
|
|
28
|
+
*
|
|
29
|
+
* NO BARE ELEMENT SELECTORS. Everything below is scoped to the toolbar's own id. The side panel's
|
|
30
|
+
* `aside{…}` rule, which Task 3 moves, is exactly the shape that would leak into a host page and is
|
|
31
|
+
* why that slice introduces a root class first.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* SCROLLBAR THEMING, CARRIED RATHER THAN BORROWED.
|
|
36
|
+
*
|
|
37
|
+
* These duplicate steel-editor.html's own global rules, and that is the point: a stylesheet a second
|
|
38
|
+
* editor links must not depend on its host having remembered. `verify-scrollbars` treats every
|
|
39
|
+
* surface separately for exactly this reason and failed this file until the rules were here — the
|
|
40
|
+
* right answer to which is to carry them, not to exclude the file. Identical declarations to the
|
|
41
|
+
* host's, so in this document the two agree and nothing changes; in a Revit host these are what
|
|
42
|
+
* stop a native light bar appearing against the dark theme.
|
|
43
|
+
*/
|
|
44
|
+
*{scrollbar-width:thin;scrollbar-color:var(--scroll) transparent}
|
|
45
|
+
*::-webkit-scrollbar{width:10px;height:10px}
|
|
46
|
+
*::-webkit-scrollbar-track{background:transparent}
|
|
47
|
+
*::-webkit-scrollbar-thumb{background:var(--scroll);border-radius:6px;border:2px solid transparent;background-clip:content-box}
|
|
48
|
+
*::-webkit-scrollbar-thumb:hover{background:var(--scroll-hover);background-clip:content-box}
|
|
49
|
+
*::-webkit-scrollbar-corner{background:transparent}
|
|
50
|
+
|
|
51
|
+
/* Master Steel's view band is the visual contract for every model provider. One shared card owns the
|
|
52
|
+
shadow; controls are compact icons and wrap before they can cover the ViewCube. */
|
|
53
|
+
#m3dBar.model-view-toolbar{position:absolute;inset:auto;top:12px;left:12px;right:auto;bottom:auto;display:flex;flex:0 1 auto;flex-direction:row;flex-wrap:wrap;gap:2px;align-items:center;z-index:59;max-width:calc(100% - 124px);padding:4px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 6px 20px rgba(0,0,0,.5);pointer-events:auto}
|
|
54
|
+
.steel-model-editor #m3dBar.model-view-toolbar{display:none}
|
|
55
|
+
.revit-model-editor #m3dBar.model-view-toolbar{display:flex}
|
|
56
|
+
#m3dBar.model-view-toolbar>.m3dwrap{position:relative;display:block;width:30px;flex:none}
|
|
57
|
+
#m3dBar.model-view-toolbar>.m3dwrap>button,#m3dBar.model-view-toolbar>button{width:30px;height:30px;min-width:0;min-height:0;padding:0;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;border-radius:6px;box-shadow:none;color:var(--mut,var(--muted));font-size:12px}
|
|
58
|
+
#m3dBar.model-view-toolbar button:hover{background:var(--btn-hover,#22324a);color:var(--text)}
|
|
59
|
+
#m3dBar.model-view-toolbar button:disabled{opacity:.38;cursor:default;background:transparent;border-color:transparent;box-shadow:none}
|
|
60
|
+
#m3dBar.model-view-toolbar button[aria-expanded="true"],#m3dBar.model-view-toolbar button.on,#m3dBar.model-view-toolbar .m3dwrap:has(>.m3dmenu.open)>button{background:#16243d;color:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa))}
|
|
61
|
+
#m3dBar.model-view-toolbar svg{width:16px;height:16px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
|
|
62
|
+
#m3dBar.model-view-toolbar svg[data-for]{display:none}
|
|
63
|
+
#m3dBar.model-view-toolbar [data-model-control="model.projection"][data-proj="persp"] svg[data-for="persp"],#m3dBar.model-view-toolbar [data-model-control="model.projection"][data-proj="ortho"] svg[data-for="ortho"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="solid"] svg[data-for="solid"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="wire"] svg[data-for="wire"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="xray"] svg[data-for="xray"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="realistic"] svg[data-for="realistic"],#m3dBar.model-view-toolbar [data-model-control="model.display-mode"][data-mode="shadowed"] svg[data-for="shadowed"]{display:block}
|
|
64
|
+
#m3dBar.model-view-toolbar [data-model-control="model.visibility"] svg[data-iso="on"]{display:none}
|
|
65
|
+
#m3dBar.model-view-toolbar [data-model-control="model.visibility"][data-state-on] svg[data-iso="off"]{display:none}
|
|
66
|
+
#m3dBar.model-view-toolbar [data-model-control="model.visibility"][data-state-on] svg[data-iso="on"]{display:block}
|
|
67
|
+
#m3dBar.model-view-toolbar .rlbl{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
68
|
+
/* A button that HOLDS a setting says so with a cyan corner mark; the brand highlight (.on) means a tool is ARMED
|
|
69
|
+
(a click cancels a pick). Count or code where the value matters (Clip, Plane), a dot for pure on/off (Labels,
|
|
70
|
+
Work area, Visibility, and Plane when "Show plane" is on at level). Code and dot share this ::after and are never
|
|
71
|
+
set together: reflectWpBar lets the code win, as the more specific mark (#1403). */
|
|
72
|
+
#m3dBar.model-view-toolbar button[data-state-count],#m3dBar.model-view-toolbar button[data-state-on],#m3dBar.model-view-toolbar button[data-state-code]{position:relative}
|
|
73
|
+
#m3dBar.model-view-toolbar button[data-state-count]::after,#m3dBar.model-view-toolbar button[data-state-code]::after{content:attr(data-state-count);position:absolute;right:0;bottom:0;min-width:12px;height:12px;padding:0 2px;border-radius:6px;background:var(--cyan,#22d3ee);color:#04222a;font:600 9px/12px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-align:center;box-shadow:0 0 0 2px var(--panel);pointer-events:none}
|
|
74
|
+
#m3dBar.model-view-toolbar button[data-state-code]::after{content:attr(data-state-code)}
|
|
75
|
+
#m3dBar.model-view-toolbar button[data-state-on]::after{content:"";position:absolute;right:2px;bottom:2px;width:6px;height:6px;border-radius:50%;background:var(--cyan,#22d3ee);box-shadow:0 0 0 2px var(--panel);pointer-events:none}
|
|
76
|
+
#m3dBar.model-view-toolbar .tb-sep{width:1px;height:22px;background:color-mix(in srgb,var(--text-dim,var(--muted)) 60%,transparent);flex:0 0 auto;align-self:center;margin:0 5px}
|
|
77
|
+
#m3dBar.model-view-toolbar .m3dmenu{display:none;position:absolute;left:0;top:calc(100% + 6px);bottom:auto;min-width:172px;padding:4px 0;background:var(--panel);border:1px solid var(--ctrl-border,var(--line));border-radius:8px;box-shadow:var(--shadow-lg,0 8px 24px rgba(0,0,0,.5));z-index:30}
|
|
78
|
+
#m3dBar.model-view-toolbar .m3dmenu.open{display:block}
|
|
79
|
+
#m3dBar.model-view-toolbar .m3dmenu button{display:block;width:100%;min-height:0;text-align:left;background:transparent;border:0;border-radius:0;padding:7px 12px;color:var(--text);white-space:nowrap;font-size:12px;box-shadow:none}
|
|
80
|
+
#m3dBar.model-view-toolbar .m3dmenu button:hover{background:var(--btn,#172235)}
|
|
81
|
+
#m3dBar.model-view-toolbar .m3dmenu button.on{color:var(--brand,var(--accent,#60a5fa))}
|
|
82
|
+
#m3dBar.model-view-toolbar .m3dmenu button.on:not(.wtog)::after{content:'✓';float:right;margin-left:16px;color:var(--brand,var(--accent,#60a5fa))}
|
|
83
|
+
/* Switch rows (#1415). The button reset above is at ID specificity, so it outranks the page's own
|
|
84
|
+
`.m3dmenu button.wtog` and `.pl-header` rules in steel-editor.html whatever their classes or order.
|
|
85
|
+
Every switch fell back to block flow with its knob over the label, and the Property labels switch took
|
|
86
|
+
the whole row and pushed its ▸ out of the menu. Restated here at the same specificity.
|
|
87
|
+
"An on switch keeps a plain label" is Steel's alone: Steel draws the knob (.mck) that carries the state,
|
|
88
|
+
while the Revit editor draws none, so there the brand label from `button.on` is its only on-state. */
|
|
89
|
+
#m3dBar.model-view-toolbar .m3dmenu button.wtog{display:flex;align-items:center;justify-content:flex-start;gap:0}
|
|
90
|
+
.steel-model-editor #m3dBar.model-view-toolbar .m3dmenu button.wtog.on{color:var(--text)}
|
|
91
|
+
#m3dBar.model-view-toolbar .m3dmenu .pl-header .wtog{width:38px;flex:none;padding:8px 0 8px 12px}
|
|
92
|
+
#m3dBar.model-view-toolbar .m3dmenu .pl-header .pl-disclosure{flex:1;display:flex;gap:7px;align-items:center;justify-content:space-between;width:auto;padding-left:9px}
|
|
93
|
+
#m3dBar.model-view-toolbar .m3dmenu button:disabled{opacity:.4;cursor:default;background:transparent}
|
|
94
|
+
#m3dBar.model-view-toolbar .m3dmenu button.mdanger{color:var(--err,var(--danger,#fb7185))}
|
|
95
|
+
#m3dBar.model-view-toolbar .m3dmenu button.mdanger:hover{background:var(--err-bg,rgba(251,113,133,.14));color:var(--err-ink,#fecdd3)}
|
|
96
|
+
#m3dBar.model-view-toolbar .m3dmenu hr{width:100%;border:0;border-top:1px solid var(--line);margin:4px 0}
|
|
97
|
+
#m3dBar.model-view-toolbar .m3dmenu label{display:flex;align-items:center;gap:7px;padding:7px 12px;color:var(--text);font-size:12px;cursor:pointer;white-space:nowrap}
|
|
98
|
+
#m3dBar.model-view-toolbar .m3dmenu label:hover{background:var(--btn,#172235)}
|
|
99
|
+
#m3dBar.model-view-toolbar .m3dmenu label input{margin:0;cursor:pointer}
|
|
100
|
+
#m3dBar.model-view-toolbar .m3dmenu .wpprow{display:flex;gap:4px;align-items:center;padding:4px 12px}
|
|
101
|
+
#m3dBar.model-view-toolbar .m3dmenu .wpprow button{width:auto;flex:none;padding:4px 8px;border:1px solid var(--line);border-radius:5px}
|
|
102
|
+
/* The active principal plane (#1396) takes its look from the toolbar's `button.on` rule; the only thing left
|
|
103
|
+
to say is that the floated tick must not land on a 2-character segment's label. Equal specificity to the
|
|
104
|
+
tick rule above, so it has to stay BELOW it. The focus ring is pulled in to 1px because a marked
|
|
105
|
+
segment's border is already brand. A refused offset stays marked until a readable one is applied. */
|
|
106
|
+
#m3dBar.model-view-toolbar .m3dmenu .wpprow button.on::after{content:none}
|
|
107
|
+
#m3dBar.model-view-toolbar .m3dmenu .wpprow button:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
|
|
108
|
+
#m3dBar.model-view-toolbar .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 var(--ui,inherit)}
|
|
109
|
+
#m3dBar.model-view-toolbar .m3dmenu .wpprow input:focus{outline:none;border-color:var(--brand,var(--accent,#60a5fa))}
|
|
110
|
+
#m3dBar.model-view-toolbar .m3dmenu .wpprow input[aria-invalid="true"]{border-color:var(--err,var(--danger,#fb7185))}
|
|
111
|
+
|
|
112
|
+
/* Canonical model orientation chrome. The canvases and their interaction are created by
|
|
113
|
+
model-orientation-overlay.js; both Steel and Revit use these exact dimensions and offsets. */
|
|
114
|
+
#m3dCube,.model-view-cube-host{position:absolute;right:12px;top:12px;width:84px;height:84px;z-index:8;pointer-events:auto;cursor:pointer;filter:drop-shadow(0 6px 14px rgba(0,0,0,.5))}
|
|
115
|
+
#m3dAxes,.model-world-axes-host,.model-axis-triad-host{position:absolute;right:15px;bottom:12px;width:78px;height:78px;z-index:8;pointer-events:none;filter:drop-shadow(0 6px 14px rgba(0,0,0,.5))}
|
|
116
|
+
.model-view-cube-host canvas,#m3dCube canvas,.model-world-axes-host canvas,.model-axis-triad-host canvas,#m3dAxes canvas{display:block;width:100%;height:100%}
|
|
117
|
+
.model-view-cube-host canvas:focus-visible,#m3dCube canvas:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:3px;border-radius:8px}
|
|
118
|
+
.model-orientation-status,.model-view-cube-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
|
|
119
|
+
|
|
120
|
+
.model-clip-list{border-top:1px solid var(--line);margin-top:8px;padding-top:4px}.model-clip-list-header{height:30px;display:flex;align-items:center;gap:7px;padding:0 5px;color:var(--text)}.model-clip-list-header strong{font-size:11px;text-transform:uppercase;letter-spacing:.08em}.model-clip-count{min-width:18px;height:18px;display:grid;place-items:center;border-radius:9px;background:var(--btn);color:var(--muted);font-size:10px}.model-clip-enable-all{width:24px;min-width:24px;min-height:24px;padding:0;border:0;background:transparent;color:var(--muted);box-shadow:none}.model-clip-enable-all[data-state="on"]{color:var(--brand,#60a5fa)}.model-clip-enable-all[data-state="mixed"]{color:#64748b}.model-clip-clear{margin-left:auto}.model-clip-list-rows{display:grid;gap:2px}.model-clip-row{min-height:30px;display:grid;grid-template-columns:24px minmax(0,1fr) 24px;align-items:center;gap:4px;border-radius:5px;padding:2px 3px}.model-clip-row:hover,.model-clip-row.is-selected{background:var(--accent-soft)}.model-clip-row.is-selected{outline:1px solid color-mix(in srgb,var(--brand,#3b82f6) 58%,transparent)}.model-clip-row button{min-width:0;min-height:24px;padding:2px 5px;border:0;background:transparent;color:var(--muted);box-shadow:none}.model-clip-row button:hover{background:var(--btn-hover);color:var(--text)}.model-clip-enable{width:22px;border:1px solid var(--line)!important;color:var(--brand,#60a5fa)!important}.model-clip-enable[aria-pressed="false"]{color:transparent!important}.model-clip-label{text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)!important}.model-clip-remove{font-size:16px;line-height:1}.model-clip-rename{width:100%;min-width:0;height:25px;border:1px solid var(--brand,#3b82f6);border-radius:4px;background:var(--bg,#020817);color:var(--text);padding:2px 6px;font:inherit;outline:none}.model-clip-list-empty{padding:10px 7px 12px;color:var(--muted);font-size:11px;line-height:1.45}.model-clip-drag-readout{position:fixed;z-index:60;pointer-events:none;padding:5px 9px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--text);box-shadow:0 3px 10px rgba(0,0,0,.45);font:11px var(--mono,monospace)}
|
|
121
|
+
|
|
122
|
+
/* Inspector seam, stub and grip are shared with master Steel. */
|
|
123
|
+
.model-inspector-resizer{flex:none;width:11px;cursor:col-resize;background:transparent;position:relative;z-index:6;touch-action:none;align-self:stretch}
|
|
124
|
+
.model-inspector-resizer::before{content:"";position:absolute;top:0;bottom:0;left:50%;width:2px;transform:translateX(-50%);background:color-mix(in srgb,var(--text-dim,var(--muted)) 45%,var(--btn-hover,#22324a));transition:background-color .12s}
|
|
125
|
+
.model-inspector-resizer:hover::before,.model-inspector-resizer.drag::before,.model-inspector-resizer:focus-visible::before{background:var(--brand,var(--accent,#60a5fa))}
|
|
126
|
+
.model-inspector-resizer:focus-visible{outline:none}
|
|
127
|
+
.model-inspector-panel{min-width:0;background:var(--panel);display:flex;flex-direction:column;overflow:hidden;transition:width .26s cubic-bezier(.2,.6,.2,1),padding .26s cubic-bezier(.2,.6,.2,1)}
|
|
128
|
+
.model-inspector-stub{display:flex;width:0;min-width:0;flex:none;flex-direction:column;align-items:center;justify-content:flex-start;padding-top:14px;background:var(--panel);overflow:hidden;transition:width .26s cubic-bezier(.2,.6,.2,1)}
|
|
129
|
+
.model-inspector-stub .vertical-label{writing-mode:vertical-rl;transform:rotate(180deg);font-size:10px;color:var(--text-dim,var(--muted));text-transform:uppercase;letter-spacing:.2em;user-select:none;white-space:nowrap}
|
|
130
|
+
.model-inspector-toggle{position:absolute;right:calc(var(--panelw,240px) - 5px);top:50%;transform:translateY(-50%);z-index:12;width:11px;height:var(--grip-h,32px);min-width:0;min-height:0;padding:0;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--text-dim,var(--muted)) 60%,var(--btn-hover,#22324a));border:0;border-radius:5px;box-shadow:none;line-height:1;color:var(--text);transition:right .26s cubic-bezier(.2,.6,.2,1)}
|
|
131
|
+
.model-inspector-toggle:hover{background:var(--brand,var(--accent,#60a5fa));color:#fff}
|
|
132
|
+
.model-inspector-toggle svg{width:13px;height:13px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s ease}
|
|
133
|
+
.model-editor-shell.panel-layout,.editor-root.model-editor-shell{position:relative;grid-template-columns:minmax(0,1fr) 11px var(--panelw,240px) 0}
|
|
134
|
+
body.panel-collapsed .model-inspector-resizer{pointer-events:none;cursor:default;width:0}
|
|
135
|
+
body.panel-collapsed .model-inspector-panel{width:0!important;padding:0;overflow:hidden;border-left-width:0}
|
|
136
|
+
body.panel-collapsed .model-inspector-stub{width:var(--pane-collapsed,36px)}
|
|
137
|
+
body.panel-collapsed .editor-root.model-editor-shell{grid-template-columns:minmax(0,1fr) 0 0 var(--pane-collapsed,36px)}
|
|
138
|
+
body.panel-collapsed .model-inspector-toggle{right:calc(var(--pane-collapsed,36px) - 6px)}
|
|
139
|
+
body.panel-collapsed .model-inspector-toggle svg{transform:rotate(180deg)}
|
|
140
|
+
body:has(.model-inspector-resizer.drag) .model-inspector-panel,body:has(.model-inspector-resizer.drag) .model-inspector-toggle{transition:none}
|
|
141
|
+
@media (prefers-reduced-motion:reduce){.model-inspector-panel,.model-inspector-stub,.model-inspector-toggle{transition:none}}
|
|
142
|
+
|
|
143
|
+
/* One pointer-control language for every model editor. Steel's whole-editor #bottomDock retains its
|
|
144
|
+
split/layout ownership; Revit uses the neutral dock wrapper below. The inner bars are identical. */
|
|
145
|
+
.model-bottom-dock{position:absolute;left:12px;right:104px;bottom:12px;z-index:14;display:flex;flex-wrap:wrap;align-items:flex-end;align-content:flex-end;justify-content:flex-end;gap:8px;min-width:0;pointer-events:none}
|
|
146
|
+
.model-pointer-bars{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:8px;min-width:0;max-width:100%;flex:none;pointer-events:auto}
|
|
147
|
+
.model-select-bar,.model-snap-bar,.model-module-actions{display:flex;align-items:center;gap:2px;padding:3px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 4px 14px rgba(0,0,0,.45);pointer-events:auto}
|
|
148
|
+
.model-select-bar[hidden],.model-snap-bar[hidden],.model-module-actions[hidden]{display:none}
|
|
149
|
+
.model-select-bar .lbl,.model-snap-bar .lbl{font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:var(--mut,var(--muted));padding:0 4px;user-select:none;align-self:center}
|
|
150
|
+
.model-select-bar button,.model-snap-bar button{width:28px;height:28px;min-width:0;min-height:0;display:grid;place-items:center;border:0;border-radius:5px;background:transparent;opacity:.55;font-size:15px;line-height:1;cursor:pointer;padding:0;position:relative;transition:background-color .12s,opacity .12s,color .12s,box-shadow .12s}
|
|
151
|
+
.model-select-bar button{color:var(--text)}
|
|
152
|
+
.model-select-bar button svg{width:17px;height:17px;display:block}
|
|
153
|
+
.model-select-bar button:hover,.model-snap-bar button:hover{background:rgba(148,163,184,.12);opacity:.9}
|
|
154
|
+
.model-select-bar button.on,.model-snap-bar button.on{background:var(--brand,var(--accent,#60a5fa));color:#0f172a;opacity:1}
|
|
155
|
+
.model-select-bar button.partial{opacity:1;color:var(--brand,var(--accent,#60a5fa));box-shadow:inset 0 0 0 1.5px var(--brand,var(--accent,#60a5fa))}
|
|
156
|
+
.model-select-bar button.off{opacity:.4;color:var(--mut,var(--muted))}
|
|
157
|
+
.model-select-bar button:focus-visible,.model-snap-bar button:focus-visible,.model-module-actions button:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
|
|
158
|
+
.model-select-bar button .car{position:absolute;right:1px;bottom:0;font-size:8px;opacity:.7;pointer-events:none}
|
|
159
|
+
.model-select-bar button .seldot{position:absolute;top:2px;right:2px;width:6px;height:6px;border-radius:50%;background:var(--brand,var(--accent,#60a5fa));box-shadow:0 0 0 1.5px var(--panel)}
|
|
160
|
+
.model-snap-bar button{color:#22d3ee}
|
|
161
|
+
.model-snap-bar [data-snap3d]{font-size:11px;font-weight:700;letter-spacing:.02em;margin-left:4px;border-left:1px solid var(--line);border-radius:0 5px 5px 0;padding-left:4px;box-sizing:border-box;width:32px}
|
|
162
|
+
.model-module-actions{gap:5px}
|
|
163
|
+
.model-module-actions button{min-height:28px;padding:3px 9px;font-size:11px}
|
|
164
|
+
.model-module-actions button.on{background:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa));color:#0f172a}
|
|
165
|
+
.model-dock-status{min-width:52px;padding:0 5px;color:var(--mut,var(--muted));font-size:10px;text-align:center;white-space:nowrap}
|
|
166
|
+
|
|
167
|
+
/* Shared model-space dimension and acquisition overlay. Providers supply points; this presentation,
|
|
168
|
+
including witness lines, ticks, reticle and acquired-target readout, is identical in every module. */
|
|
169
|
+
.measure-armed{cursor:crosshair}
|
|
170
|
+
#modelDimensionOverlay,.model-dimension-overlay-host{position:absolute;inset:0;z-index:9;pointer-events:none}
|
|
171
|
+
.model-dim-overlay{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
|
|
172
|
+
.dimension-mark line,.dimension-preview line{stroke:#60a5fa;stroke-width:1.5;vector-effect:non-scaling-stroke}
|
|
173
|
+
.dimension-preview line{stroke-dasharray:5 4;opacity:.82}
|
|
174
|
+
.dimension-mark.selected .dimension-line{stroke:#22d3ee;stroke-width:2.2}
|
|
175
|
+
.dimension-witness{opacity:.72}.dimension-tick{stroke-width:1.8}
|
|
176
|
+
.dimension-mark text,.dimension-preview text,.model-snap-reticle text{fill:#dbeafe;paint-order:stroke;stroke:#080d18;stroke-width:4px;stroke-linejoin:round;font-size:12px;text-anchor:middle}
|
|
177
|
+
.model-snap-reticle circle,.model-snap-reticle line{fill:none;stroke:#22d3ee;stroke-width:1.5;vector-effect:non-scaling-stroke}
|
|
178
|
+
.model-snap-guide{fill:none;stroke:#38bdf8;stroke-width:1;stroke-dasharray:6 4;opacity:.78;vector-effect:non-scaling-stroke}
|
|
179
|
+
.model-snap-reticle>text{fill:#22d3ee;font-size:10px;font-weight:700}
|
|
180
|
+
.model-snap-reticle .model-snap-readout{fill:#dbeafe;font-size:10px;text-anchor:start}
|
|
181
|
+
.model-snap-one-pick-menu{position:fixed;z-index:120;min-width:190px;display:grid;gap:2px;padding:5px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 30px rgba(0,0,0,.48)}
|
|
182
|
+
.model-snap-one-pick-heading{padding:5px 8px 4px;color:var(--mut,var(--muted));font-size:10px;letter-spacing:.08em;text-transform:uppercase}
|
|
183
|
+
.model-snap-one-pick-menu button{min-height:29px;width:100%;padding:4px 8px;text-align:left;background:transparent;border-color:transparent;color:var(--text)}
|
|
184
|
+
.model-snap-one-pick-menu button:hover,.model-snap-one-pick-menu button:focus-visible{background:rgba(59,130,246,.16);border-color:var(--line)}
|
|
185
|
+
.model-dimension-editor{position:fixed;z-index:121;left:50%;bottom:76px;transform:translateX(-50%);min-width:320px;display:grid;gap:10px;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:9px;box-shadow:0 12px 34px rgba(0,0,0,.52);color:var(--text)}
|
|
186
|
+
.model-dimension-editor>strong{font-size:12px;letter-spacing:.07em;text-transform:uppercase}
|
|
187
|
+
.model-dimension-choice{display:grid;grid-template-columns:72px repeat(5,minmax(34px,1fr));gap:4px;align-items:center}
|
|
188
|
+
.model-dimension-choice>span{color:var(--mut,var(--muted));font-size:10px;text-transform:uppercase}
|
|
189
|
+
.model-dimension-choice button,.model-dimension-editor-actions button{min-height:28px;padding:3px 7px;background:var(--btn,var(--panel2));border:1px solid var(--line);border-radius:5px;color:var(--text);font:inherit}
|
|
190
|
+
.model-dimension-choice button.on{background:var(--brand,var(--accent,#60a5fa));border-color:var(--brand,var(--accent,#60a5fa));color:#0f172a}
|
|
191
|
+
.model-dimension-choice button:focus-visible,.model-dimension-editor-actions button:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
|
|
192
|
+
.model-dimension-editor-actions{display:flex;justify-content:flex-end;gap:6px;padding-top:2px}
|
|
193
|
+
|
|
194
|
+
@container(max-width:820px){
|
|
195
|
+
.model-bottom-dock{left:8px;right:96px;gap:5px}
|
|
196
|
+
#modelModuleActions,.model-pointer-bars{flex:0 1 100%;min-width:0}
|
|
197
|
+
#modelModuleActions{display:flex;justify-content:flex-end}
|
|
198
|
+
.model-pointer-bars{gap:5px}
|
|
199
|
+
.model-module-actions{max-width:100%;flex-wrap:wrap;justify-content:flex-end}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* Shared spatial/frame/clip/work-area panel. It extends the existing model-spatial-dialog language;
|
|
203
|
+
provider-dependent actions are omitted by the JS mount instead of rendered disabled. */
|
|
204
|
+
.model-spatial-hud #modelFrameStatus,.model-spatial-hud [data-model-spatial-trigger]{pointer-events:auto;min-height:0;padding:0;border:0;background:transparent;color:var(--brand,var(--accent,#60a5fa));font:inherit;font-weight:700}
|
|
205
|
+
.model-spatial-hud #modelFrameStatus:hover,.model-spatial-hud [data-model-spatial-trigger]:hover{color:#dbeafe;background:transparent}
|
|
206
|
+
.model-spatial-hud #modelFrameStatus:focus-visible,.model-spatial-hud [data-model-spatial-trigger]:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:3px;border-radius:3px}
|
|
207
|
+
.model-spatial-dialog.model-spatial-panel{width:min(440px,calc(100vw - 24px));max-height:min(640px,82vh);padding:11px;background:var(--panel);border:1px solid var(--line-strong,var(--line));border-radius:9px;box-shadow:0 18px 48px rgba(0,0,0,.48);color:var(--text)}
|
|
208
|
+
.model-spatial-panel>.model-spatial-dialog-header{flex:0 0 auto;padding-bottom:7px;border-bottom:1px solid var(--line)}
|
|
209
|
+
.model-spatial-panel>.model-spatial-dialog-header>strong{font-size:12px;letter-spacing:.08em;text-transform:uppercase}
|
|
210
|
+
.model-spatial-panel>.model-spatial-dialog-header>button{width:28px;height:28px;min-width:0;min-height:0;padding:0;display:grid;place-items:center}
|
|
211
|
+
.model-spatial-panel-body{min-height:0;overflow:auto;display:grid;gap:9px;padding-right:2px}
|
|
212
|
+
.model-spatial-section{min-width:0;margin:0;padding:9px;border:1px solid var(--line);border-radius:7px;background:rgba(8,13,24,.28)}
|
|
213
|
+
.model-spatial-section>legend{padding:0 5px;color:var(--mut,var(--muted));font-size:10px;letter-spacing:.08em;text-transform:uppercase}
|
|
214
|
+
.model-spatial-panel-summary{min-width:0;display:grid;gap:2px;margin-bottom:7px}
|
|
215
|
+
.model-spatial-panel-summary>strong{font-size:12px}.model-spatial-panel-summary>span{min-width:0;color:var(--mut,var(--muted));font:10px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
|
|
216
|
+
.model-spatial-panel-grid{display:grid;grid-template-columns:76px repeat(3,minmax(0,1fr));gap:5px;align-items:end;margin-top:7px}
|
|
217
|
+
.model-spatial-panel-grid-label{align-self:center;color:var(--mut,var(--muted));font-size:10px;line-height:1.25}
|
|
218
|
+
.model-spatial-number-field{min-width:0;display:grid;gap:3px;color:var(--mut,var(--muted));font-size:9px;text-transform:uppercase;letter-spacing:.05em}
|
|
219
|
+
.model-spatial-panel input[type=number]{width:100%;min-width:0;min-height:29px;padding:4px 6px;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:5px;font:11px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;-moz-appearance:textfield;appearance:textfield}
|
|
220
|
+
.model-spatial-panel input[type=number]::-webkit-inner-spin-button,.model-spatial-panel input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
|
|
221
|
+
.model-spatial-panel input[type=number]:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
|
|
222
|
+
.model-spatial-coordinate-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}.model-spatial-panel input[type=text]{width:100%;min-width:0;min-height:30px;padding:5px 7px;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:5px;font:11px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace}.model-spatial-panel input[type=text]:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
|
|
223
|
+
.model-spatial-panel-inline{display:flex;align-items:end;gap:5px;flex-wrap:wrap}.model-spatial-panel-inline>.model-spatial-number-field{width:118px}
|
|
224
|
+
.model-spatial-panel-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:wrap;margin-top:7px}
|
|
225
|
+
.model-spatial-panel button{min-height:28px;padding:3px 8px;color:var(--text);background:var(--btn,var(--panel-2,#172235));border:1px solid var(--line);border-radius:5px;font:inherit;cursor:pointer}
|
|
226
|
+
.model-spatial-panel button:hover{background:rgba(59,130,246,.16);border-color:var(--line-strong,var(--line))}
|
|
227
|
+
.model-spatial-panel button[aria-pressed="true"]{color:#dbeafe;background:rgba(59,130,246,.24);border-color:var(--brand,var(--accent,#60a5fa))}
|
|
228
|
+
.model-spatial-panel button:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
|
|
229
|
+
.model-spatial-clip{display:grid;gap:4px;margin-top:7px;padding:7px;border:1px solid var(--line);border-radius:6px;background:var(--panel-2,var(--panel))}
|
|
230
|
+
.model-spatial-clip-heading{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:8px}.model-spatial-clip-heading strong{font-size:11px}.model-spatial-clip-heading code{min-width:0;color:var(--mut,var(--muted));font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
231
|
+
.model-spatial-panel-status{min-height:16px;flex:0 0 auto;color:var(--mut,var(--muted));font-size:10px}.model-spatial-panel-status[data-tone="error"]{color:var(--danger,#fb7185)}
|
|
232
|
+
@media(max-width:560px){.model-spatial-dialog.model-spatial-panel{width:calc(100vw - 16px)}.model-spatial-panel-grid{grid-template-columns:66px repeat(3,minmax(0,1fr))}.model-spatial-panel-actions{justify-content:flex-start}}
|
|
233
|
+
|
|
234
|
+
/* Shared model-viewer lighting popover. Both Steel and Revit mount this exact surface. */
|
|
235
|
+
.model-lighting-panel{position:fixed;z-index:120;max-height:calc(100vh - 24px);overflow:auto;scrollbar-width:thin;scrollbar-color:#3b4c65 #111c2d;background:var(--panel,#111c2d);border:1px solid var(--line,#2b3b52);border-radius:10px;box-shadow:0 16px 42px rgba(0,0,0,.52);padding:14px;color:var(--text,#e5edf8)}
|
|
236
|
+
.model-lighting-panel[hidden]{display:none}
|
|
237
|
+
.model-lighting-panel::-webkit-scrollbar{width:8px}
|
|
238
|
+
.model-lighting-panel::-webkit-scrollbar-track{background:#111c2d}
|
|
239
|
+
.model-lighting-panel::-webkit-scrollbar-thumb{background:#3b4c65;border-radius:8px;border:2px solid #111c2d}
|
|
240
|
+
.model-lighting-head{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px}
|
|
241
|
+
.model-lighting-close,.model-lighting-reset,.model-lighting-switch{font:inherit;color:inherit;border:1px solid var(--line,#2b3b52);background:var(--panel2,#17243a);border-radius:7px}
|
|
242
|
+
.model-lighting-close{width:28px;height:28px;padding:0;font-size:20px;line-height:1;cursor:pointer}
|
|
243
|
+
.model-lighting-copy{margin:5px 0 12px;color:var(--muted,#91a3bb);font-size:12px;line-height:1.4}
|
|
244
|
+
.model-lighting-switch{display:flex;align-items:center;justify-content:space-between;width:100%;height:38px;padding:0 10px;cursor:pointer}
|
|
245
|
+
.model-lighting-switch-track{position:relative;width:34px;height:18px;border-radius:999px;background:#334155;transition:background .15s}
|
|
246
|
+
.model-lighting-switch-track span{position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#cbd5e1;transition:transform .15s,background .15s}
|
|
247
|
+
.model-lighting-switch.on .model-lighting-switch-track{background:var(--accent,#3b82f6)}
|
|
248
|
+
.model-lighting-switch.on .model-lighting-switch-track span{transform:translateX(16px);background:#fff}
|
|
249
|
+
.model-lighting-field{display:block;margin-top:13px;color:var(--muted,#a8b6cc);font-size:12px}
|
|
250
|
+
.model-lighting-field>span{display:flex;justify-content:space-between;gap:12px;margin-bottom:7px}
|
|
251
|
+
.model-lighting-field output{color:var(--text,#e5edf8);font-variant-numeric:tabular-nums}
|
|
252
|
+
input[type="range"]{appearance:none;-webkit-appearance:none;width:100%;height:18px;margin:0;background:transparent;cursor:pointer}
|
|
253
|
+
input[type="range"]::-webkit-slider-runnable-track{height:4px;border-radius:999px;background:#3a4a62}
|
|
254
|
+
input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;margin-top:-6px;border:2px solid #0b1220;border-radius:50%;background:var(--accent,#3b82f6);box-shadow:0 0 0 1px #60a5fa}
|
|
255
|
+
input[type="range"]::-moz-range-track{height:4px;border-radius:999px;background:#3a4a62}
|
|
256
|
+
input[type="range"]::-moz-range-thumb{width:14px;height:14px;border:2px solid #0b1220;border-radius:50%;background:var(--accent,#3b82f6);box-shadow:0 0 0 1px #60a5fa}
|
|
257
|
+
@media (forced-colors: active){
|
|
258
|
+
input[type="range"]{appearance:revert;-webkit-appearance:revert;width:revert;height:revert;margin:revert;background:revert}
|
|
259
|
+
input[type="range"]::-webkit-slider-runnable-track{height:revert;border-radius:revert;background:revert}
|
|
260
|
+
input[type="range"]::-webkit-slider-thumb{-webkit-appearance:revert;width:revert;height:revert;margin-top:revert;border:revert;border-radius:revert;background:revert;box-shadow:revert}
|
|
261
|
+
input[type="range"]::-moz-range-track{height:revert;border-radius:revert;background:revert}
|
|
262
|
+
input[type="range"]::-moz-range-thumb{width:revert;height:revert;border:revert;border-radius:revert;background:revert;box-shadow:revert}
|
|
263
|
+
}
|
|
264
|
+
.model-lighting-field input[type="range"]:disabled{cursor:not-allowed;opacity:.35}
|
|
265
|
+
.model-lighting-foot{display:flex;justify-content:flex-end;margin-top:14px;padding-top:12px;border-top:1px solid var(--line,#2b3b52)}
|
|
266
|
+
.model-lighting-reset{padding:6px 12px;cursor:pointer}
|
|
267
|
+
.model-lighting-panel button:hover:not(:disabled){border-color:var(--accent,#3b82f6);background:#1d2d47}
|
|
268
|
+
.model-lighting-panel button:focus-visible,.model-lighting-field input[type="range"]:focus-visible{outline:2px solid var(--accent,#3b82f6);outline-offset:2px}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/** Canonical millimetre/Z-up <-> provider render-space boundary. */
|
|
2
|
+
export const MODEL_FRAME_SCHEMA = 'floless.model-frame/v1';
|
|
3
|
+
|
|
4
|
+
const EPSILON = 1e-12;
|
|
5
|
+
const SCALAR_CAMERA_KEYS = Object.freeze(['near', 'far', 'orthoHeight', 'orthoH']);
|
|
6
|
+
|
|
7
|
+
const finite = (value) => typeof value === 'number' && Number.isFinite(value);
|
|
8
|
+
|
|
9
|
+
function fail(message) { throw new TypeError(`Model frame: ${message}`); }
|
|
10
|
+
|
|
11
|
+
function vector3(value, label) {
|
|
12
|
+
if (!Array.isArray(value) || value.length !== 3 || !value.every(finite)) fail(`${label} must be a finite 3-vector.`);
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function scalar(value, label) {
|
|
17
|
+
if (!finite(value) || value < 0) fail(`${label} must be a finite non-negative distance.`);
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function frozenVector(value) { return Object.freeze(value); }
|
|
22
|
+
|
|
23
|
+
function normalized(value, label) {
|
|
24
|
+
const length = Math.hypot(value[0], value[1], value[2]);
|
|
25
|
+
if (!finite(length) || length <= EPSILON) fail(`${label} must be non-zero.`);
|
|
26
|
+
return frozenVector(value.map((entry) => entry / length));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function matrix16(value) {
|
|
30
|
+
if (!Array.isArray(value) || value.length !== 16 || !value.every(finite)) fail('matrix must contain 16 finite column-major values.');
|
|
31
|
+
if (Math.abs(value[3]) > EPSILON || Math.abs(value[7]) > EPSILON || Math.abs(value[11]) > EPSILON || Math.abs(value[15] - 1) > EPSILON) {
|
|
32
|
+
fail('matrix must be affine.');
|
|
33
|
+
}
|
|
34
|
+
return Object.freeze([...value]);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Invert a column-major 4x4 matrix without depending on a rendering library. */
|
|
38
|
+
function inverseMatrix(value) {
|
|
39
|
+
const rows = Array.from({ length: 4 }, (_, row) => [
|
|
40
|
+
value[row], value[4 + row], value[8 + row], value[12 + row],
|
|
41
|
+
row === 0 ? 1 : 0, row === 1 ? 1 : 0, row === 2 ? 1 : 0, row === 3 ? 1 : 0,
|
|
42
|
+
]);
|
|
43
|
+
for (let column = 0; column < 4; column += 1) {
|
|
44
|
+
let pivot = column;
|
|
45
|
+
for (let row = column + 1; row < 4; row += 1) if (Math.abs(rows[row][column]) > Math.abs(rows[pivot][column])) pivot = row;
|
|
46
|
+
if (Math.abs(rows[pivot][column]) <= EPSILON) fail('matrix must be invertible.');
|
|
47
|
+
[rows[column], rows[pivot]] = [rows[pivot], rows[column]];
|
|
48
|
+
const divisor = rows[column][column];
|
|
49
|
+
for (let at = 0; at < 8; at += 1) rows[column][at] /= divisor;
|
|
50
|
+
for (let row = 0; row < 4; row += 1) {
|
|
51
|
+
if (row === column) continue;
|
|
52
|
+
const factor = rows[row][column];
|
|
53
|
+
for (let at = 0; at < 8; at += 1) rows[row][at] -= factor * rows[column][at];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return Object.freeze(Array.from({ length: 16 }, (_, at) => rows[at % 4][4 + Math.floor(at / 4)]));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function transformPoint(matrix, value, label) {
|
|
60
|
+
const [x, y, z] = vector3(value, label);
|
|
61
|
+
const w = matrix[3] * x + matrix[7] * y + matrix[11] * z + matrix[15];
|
|
62
|
+
if (!finite(w) || Math.abs(w) <= EPSILON) fail(`${label} transforms to an invalid homogeneous point.`);
|
|
63
|
+
return frozenVector([
|
|
64
|
+
(matrix[0] * x + matrix[4] * y + matrix[8] * z + matrix[12]) / w,
|
|
65
|
+
(matrix[1] * x + matrix[5] * y + matrix[9] * z + matrix[13]) / w,
|
|
66
|
+
(matrix[2] * x + matrix[6] * y + matrix[10] * z + matrix[14]) / w,
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function transformDirection(matrix, value, label) {
|
|
71
|
+
const [x, y, z] = vector3(value, label);
|
|
72
|
+
return normalized([
|
|
73
|
+
matrix[0] * x + matrix[4] * y + matrix[8] * z,
|
|
74
|
+
matrix[1] * x + matrix[5] * y + matrix[9] * z,
|
|
75
|
+
matrix[2] * x + matrix[6] * y + matrix[10] * z,
|
|
76
|
+
], label);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Apply inverse-transpose(linear(matrix)); translation never acts on a normal. */
|
|
80
|
+
function transformNormal(inverse, value, label) {
|
|
81
|
+
const [x, y, z] = vector3(value, label);
|
|
82
|
+
return normalized([
|
|
83
|
+
inverse[0] * x + inverse[1] * y + inverse[2] * z,
|
|
84
|
+
inverse[4] * x + inverse[5] * y + inverse[6] * z,
|
|
85
|
+
inverse[8] * x + inverse[9] * y + inverse[10] * z,
|
|
86
|
+
], label);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function transformBounds(matrix, value, label) {
|
|
90
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) fail(`${label} must be an object.`);
|
|
91
|
+
const min = vector3(value.min, `${label}.min`); const max = vector3(value.max, `${label}.max`);
|
|
92
|
+
if (min.some((entry, axis) => entry > max[axis])) fail(`${label}.min must not exceed max.`);
|
|
93
|
+
const points = [];
|
|
94
|
+
for (const x of [min[0], max[0]]) for (const y of [min[1], max[1]]) for (const z of [min[2], max[2]]) {
|
|
95
|
+
points.push(transformPoint(matrix, [x, y, z], `${label} corner`));
|
|
96
|
+
}
|
|
97
|
+
return Object.freeze({
|
|
98
|
+
min: frozenVector([0, 1, 2].map((axis) => Math.min(...points.map((point) => point[axis])))),
|
|
99
|
+
max: frozenVector([0, 1, 2].map((axis) => Math.max(...points.map((point) => point[axis])))),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function transformRay(pointTransform, directionTransform, value, label) {
|
|
104
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) fail(`${label} must be an object.`);
|
|
105
|
+
return Object.freeze({ ...value,
|
|
106
|
+
origin: pointTransform(value.origin, `${label}.origin`),
|
|
107
|
+
direction: directionTransform(value.direction, `${label}.direction`),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function transformPlane(pointTransform, normalTransform, value, label) {
|
|
112
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) fail(`${label} must be an object.`);
|
|
113
|
+
const hasNormal = Object.hasOwn(value, 'normal'); const hasN = Object.hasOwn(value, 'n');
|
|
114
|
+
if (hasNormal === hasN) fail(`${label} must carry exactly one of normal or n.`);
|
|
115
|
+
const key = hasNormal ? 'normal' : 'n';
|
|
116
|
+
return Object.freeze({ ...value,
|
|
117
|
+
point: pointTransform(value.point, `${label}.point`),
|
|
118
|
+
[key]: normalTransform(value[key], `${label}.${key}`),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function transformCamera(pointTransform, directionTransform, distanceTransform, value, label) {
|
|
123
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) fail(`${label} must be an object.`);
|
|
124
|
+
const hasPosition = Object.hasOwn(value, 'position'); const hasPos = Object.hasOwn(value, 'pos');
|
|
125
|
+
if (hasPosition === hasPos) fail(`${label} must carry exactly one of position or pos.`);
|
|
126
|
+
const positionKey = hasPosition ? 'position' : 'pos';
|
|
127
|
+
const result = { ...value,
|
|
128
|
+
[positionKey]: pointTransform(value[positionKey], `${label}.${positionKey}`),
|
|
129
|
+
target: pointTransform(value.target, `${label}.target`),
|
|
130
|
+
};
|
|
131
|
+
if (Object.hasOwn(value, 'up')) result.up = directionTransform(value.up, `${label}.up`);
|
|
132
|
+
for (const key of SCALAR_CAMERA_KEYS) if (Object.hasOwn(value, key)) result[key] = distanceTransform(value[key], `${label}.${key}`);
|
|
133
|
+
return Object.freeze(result);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Build the sole versioned port allowed to cross canonical model space and renderer space.
|
|
138
|
+
* Canonical scalar distances are millimetres; render units are adapter-defined.
|
|
139
|
+
* @param {{
|
|
140
|
+
* matrix: readonly number[],
|
|
141
|
+
* millimetresPerRenderUnit?: number,
|
|
142
|
+
* millimetresPerWorldUnit?: number,
|
|
143
|
+
* frameId?: string,
|
|
144
|
+
* }} options
|
|
145
|
+
*/
|
|
146
|
+
export function createModelFrame({
|
|
147
|
+
matrix: rawMatrix,
|
|
148
|
+
millimetresPerRenderUnit = undefined,
|
|
149
|
+
millimetresPerWorldUnit = undefined,
|
|
150
|
+
frameId = 'canonical-mm-z-up-rh',
|
|
151
|
+
}) {
|
|
152
|
+
const matrix = matrix16(rawMatrix);
|
|
153
|
+
const inverse = inverseMatrix(matrix);
|
|
154
|
+
const scale = millimetresPerRenderUnit ?? millimetresPerWorldUnit;
|
|
155
|
+
if (!finite(scale) || scale <= 0) fail('millimetresPerRenderUnit must be finite and positive.');
|
|
156
|
+
if (typeof frameId !== 'string' || !frameId) fail('frameId must be a non-empty string.');
|
|
157
|
+
|
|
158
|
+
const canonicalToRenderPoint = (value, label = 'canonical point') => transformPoint(matrix, value, label);
|
|
159
|
+
const renderToCanonicalPoint = (value, label = 'render point') => transformPoint(inverse, value, label);
|
|
160
|
+
const canonicalToRenderDirection = (value, label = 'canonical direction') => transformDirection(matrix, value, label);
|
|
161
|
+
const renderToCanonicalDirection = (value, label = 'render direction') => transformDirection(inverse, value, label);
|
|
162
|
+
const canonicalToRenderNormal = (value, label = 'canonical normal') => transformNormal(inverse, value, label);
|
|
163
|
+
const renderToCanonicalNormal = (value, label = 'render normal') => transformNormal(matrix, value, label);
|
|
164
|
+
const canonicalToRenderDistance = (value, label = 'canonical distance') => scalar(value, label) / scale;
|
|
165
|
+
const renderToCanonicalDistance = (value, label = 'render distance') => scalar(value, label) * scale;
|
|
166
|
+
|
|
167
|
+
return Object.freeze({
|
|
168
|
+
schema: MODEL_FRAME_SCHEMA,
|
|
169
|
+
frameId,
|
|
170
|
+
matrix,
|
|
171
|
+
inverseMatrix: inverse,
|
|
172
|
+
millimetresPerRenderUnit: scale,
|
|
173
|
+
// Compatibility alias for the existing Revit adapter. New common code should use the name above.
|
|
174
|
+
millimetresPerWorldUnit: scale,
|
|
175
|
+
canonicalToRenderPoint,
|
|
176
|
+
renderToCanonicalPoint,
|
|
177
|
+
canonicalToRenderDirection,
|
|
178
|
+
renderToCanonicalDirection,
|
|
179
|
+
canonicalToRenderNormal,
|
|
180
|
+
renderToCanonicalNormal,
|
|
181
|
+
canonicalToRenderBounds: (value) => transformBounds(matrix, value, 'canonical bounds'),
|
|
182
|
+
renderToCanonicalBounds: (value) => transformBounds(inverse, value, 'render bounds'),
|
|
183
|
+
canonicalToRenderRay: (value) => transformRay(canonicalToRenderPoint, canonicalToRenderDirection, value, 'canonical ray'),
|
|
184
|
+
renderToCanonicalRay: (value) => transformRay(renderToCanonicalPoint, renderToCanonicalDirection, value, 'render ray'),
|
|
185
|
+
canonicalToRenderPlane: (value) => transformPlane(canonicalToRenderPoint, canonicalToRenderNormal, value, 'canonical plane'),
|
|
186
|
+
renderToCanonicalPlane: (value) => transformPlane(renderToCanonicalPoint, renderToCanonicalNormal, value, 'render plane'),
|
|
187
|
+
canonicalToRenderCamera: (value) => transformCamera(canonicalToRenderPoint, canonicalToRenderDirection, canonicalToRenderDistance, value, 'canonical camera'),
|
|
188
|
+
renderToCanonicalCamera: (value) => transformCamera(renderToCanonicalPoint, renderToCanonicalDirection, renderToCanonicalDistance, value, 'render camera'),
|
|
189
|
+
canonicalToRenderDistance,
|
|
190
|
+
renderToCanonicalDistance,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* model-inspector.js - the frame around a domain property renderer, and deliberately nothing more.
|
|
3
|
+
*
|
|
4
|
+
* WHAT THIS DOES NOT OWN. The first editor's property panel is a long mode dispatcher: roughly forty
|
|
5
|
+
* sequential `if (mode) { … return; }` branches, each owning its whole subtree down to its own wiring
|
|
6
|
+
* calls. That switch encodes one product's editing modes one by one, and a read-only viewer has none of
|
|
7
|
+
* them - it supplies its own, much shorter, dispatcher against this same frame. So the seam is the
|
|
8
|
+
* element, its states, the section list, and the read-only contract. The dispatch stays with whoever
|
|
9
|
+
* has the modes.
|
|
10
|
+
*
|
|
11
|
+
* READ-ONLY MEANS OMITTED, NOT DISABLED. An editable section's `render` is never CALLED when the shell
|
|
12
|
+
* is read-only. Disabling would leave a dormant control, which is the thing a read-only provider must
|
|
13
|
+
* not have: it still occupies space, still announces itself to a screen reader, and still invites a
|
|
14
|
+
* click that does nothing. And a section with no `editable` field is treated as editable - it fails
|
|
15
|
+
* CLOSED, because the safe answer to "did the author think about this?" is to withhold the control.
|
|
16
|
+
*
|
|
17
|
+
* A SECTION THAT THROWS IS CONTAINED. This module cannot reach the viewport or the selection, which is
|
|
18
|
+
* exactly why it must not rethrow: an exception escaping into the host's render path is how one bad
|
|
19
|
+
* property section takes the 3D view down with it. The failure is caught, reported in place, and the
|
|
20
|
+
* remaining sections still render.
|
|
21
|
+
*
|
|
22
|
+
* DOC AND WIN ARE ARGUMENTS, for the same reason as every other module here: a shared module must not
|
|
23
|
+
* pick its own page, and the headless harness manufactures elements carrying neither.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const PLACEMENTS = ['floating', 'docked'];
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Mount the Inspector shell over an element the host already has.
|
|
30
|
+
*
|
|
31
|
+
* @param {{
|
|
32
|
+
* panel: Element, doc: Document, win: Window,
|
|
33
|
+
* placement: 'floating' | 'docked',
|
|
34
|
+
* readOnly?: boolean,
|
|
35
|
+
* emptyMessage?: string,
|
|
36
|
+
* }} options
|
|
37
|
+
* @returns {{ render(view): void, headerText(): string, destroy(): void }}
|
|
38
|
+
*/
|
|
39
|
+
export function mountInspectorShell({
|
|
40
|
+
panel, doc, win, placement, readOnly = false,
|
|
41
|
+
emptyMessage = 'Nothing selected.',
|
|
42
|
+
} = {}) {
|
|
43
|
+
if (!panel) throw new Error('mountInspectorShell: no panel element — this mounts over markup the host owns.');
|
|
44
|
+
if (!doc || !win) throw new Error('mountInspectorShell: pass the document and window this panel lives in — '
|
|
45
|
+
+ 'a shared module must not reach for a global one.');
|
|
46
|
+
if (!PLACEMENTS.includes(placement)) {
|
|
47
|
+
throw new Error(`mountInspectorShell: placement must be one of ${PLACEMENTS.join(' | ')}, got ${placement}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
for (const p of PLACEMENTS) panel.classList.toggle(`placement-${p}`, p === placement);
|
|
51
|
+
|
|
52
|
+
const el = (tag, className, text) => {
|
|
53
|
+
const node = doc.createElement(tag);
|
|
54
|
+
if (className) node.className = className;
|
|
55
|
+
if (text !== undefined) node.textContent = text;
|
|
56
|
+
return node;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
let header = null;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Paint a view.
|
|
63
|
+
*
|
|
64
|
+
* `heading` is carried through the LOADING state on purpose. A panel that blanks its header and then
|
|
65
|
+
* re-writes it on every selection reflows twice per click; holding it is the difference between a
|
|
66
|
+
* panel that updates and one that flickers.
|
|
67
|
+
*
|
|
68
|
+
* IT IS `heading`, NOT `title`, AND THAT IS DELIBERATE - do not "tidy" it back. This page bans the
|
|
69
|
+
* native `title=` tooltip (it renders a light OS bubble on a dark theme) and `verify:no-title` scans
|
|
70
|
+
* raw source for it, so a field called `title` trips the guard on its own declaration. The name is
|
|
71
|
+
* also simply more accurate: this is a heading rendered as text, never a tooltip.
|
|
72
|
+
*/
|
|
73
|
+
const render = (view = {}) => {
|
|
74
|
+
const { state = 'empty', heading = '', message, sections = [] } = view;
|
|
75
|
+
|
|
76
|
+
if (state === 'loading') {
|
|
77
|
+
// The header is REUSED, not rebuilt, so the box it occupies never collapses mid-load.
|
|
78
|
+
panel.setAttribute('aria-busy', 'true');
|
|
79
|
+
const kept = header && heading === header.textContent ? header : el('div', 'insp-head', heading);
|
|
80
|
+
header = kept;
|
|
81
|
+
panel.replaceChildren(kept, el('div', 'insp-note', 'Loading…'));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Anything that is not loading has finished loading. Leaving aria-busy set is worse than never
|
|
86
|
+
// setting it: the panel is then permanently announced as busy with nothing on screen to contradict it.
|
|
87
|
+
panel.removeAttribute('aria-busy');
|
|
88
|
+
|
|
89
|
+
if (state === 'empty' || state === 'unavailable') {
|
|
90
|
+
header = null;
|
|
91
|
+
// The two are DIFFERENT facts. "Nothing selected" and "what you had is gone" collapse into one
|
|
92
|
+
// only if you are willing to tell the user they deselected something the model removed.
|
|
93
|
+
panel.replaceChildren(el('div', `insp-note insp-${state}`, message || emptyMessage));
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
header = el('div', 'insp-head', heading);
|
|
98
|
+
const body = el('div', 'insp-body');
|
|
99
|
+
|
|
100
|
+
for (const section of sections) {
|
|
101
|
+
// `editable !== false` rather than `editable === true`: undeclared fails closed.
|
|
102
|
+
if (readOnly && section.editable !== false) continue;
|
|
103
|
+
|
|
104
|
+
const host = el('div', 'insp-section');
|
|
105
|
+
host.dataset.section = section.id || '';
|
|
106
|
+
if (section.heading) host.append(el('div', 'insp-section-heading', section.heading));
|
|
107
|
+
try {
|
|
108
|
+
section.render(host);
|
|
109
|
+
} catch {
|
|
110
|
+
// Said in place rather than swallowed. A section that vanishes without explanation reads as
|
|
111
|
+
// "this object has no dimensions" - a confident wrong answer, the worst state a property panel
|
|
112
|
+
// can be in. The error itself is the host's to log; the user gets the fact.
|
|
113
|
+
host.append(el('div', 'insp-error', 'This section could not be shown.'));
|
|
114
|
+
}
|
|
115
|
+
body.append(host);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
panel.replaceChildren(header, body);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
render({ state: 'empty' });
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
render,
|
|
125
|
+
headerText: () => (header ? header.textContent : ''),
|
|
126
|
+
destroy() { panel.replaceChildren(); },
|
|
127
|
+
};
|
|
128
|
+
}
|