@floless/app 0.126.0 → 0.126.1
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 +904 -885
- package/dist/templates/dummy-report.flo +6 -0
- package/dist/templates/floless-workspace-knowledge.flo +6 -0
- package/dist/templates/floless-workspace-read.flo +6 -0
- package/dist/templates/tekla-bom-by-phase.flo +6 -0
- package/dist/templates/tekla-pdf-takeoff.flo +6 -0
- package/dist/templates/tekla-selection-now.flo +10 -0
- package/dist/templates/tekla-selection-report.flo +10 -0
- package/dist/web/aware-update-client.js +0 -2
- package/dist/web/aware.js +0 -5
- package/dist/web/steel-3d-core.js +77 -0
- package/dist/web/steel-3d-view.js +4 -7
- package/dist/web/steel-editor.html +21 -9
- package/dist/web/steel-model-v2-commands.js +23 -3
- package/package.json +4 -1
|
@@ -73,6 +73,12 @@ nodes:
|
|
|
73
73
|
sb.Append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">");
|
|
74
74
|
sb.Append("<title>" + E(title) + "</title><style>");
|
|
75
75
|
sb.Append("*{margin:0;padding:0;box-sizing:border-box}");
|
|
76
|
+
// Scrollbars, themed GLOBALLY for both engines. The report is its own document inside the
|
|
77
|
+
// Viewer iframe, so web/app.css never reaches it: without this the page itself — and any
|
|
78
|
+
// container a later edit makes scrollable — falls back to the browser's own bar. Firefox
|
|
79
|
+
// reads only scrollbar-width/-color; Safari before 18.2 reads only the ::-webkit- block, so
|
|
80
|
+
// both halves are needed. Colours are slate-300/-400, the same ramp as this report's greys.
|
|
81
|
+
sb.Append("*{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#94a3b8}");
|
|
76
82
|
sb.Append("body{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:#f1f5f9;color:#0f172a;padding:2.5rem;line-height:1.6}");
|
|
77
83
|
sb.Append(".wrap{max-width:760px;margin:0 auto;background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:2rem 2.25rem;box-shadow:0 10px 30px rgba(2,6,23,.06)}");
|
|
78
84
|
sb.Append(".hd{border-bottom:2px solid #4a9eff;padding-bottom:1rem;margin-bottom:1.5rem}");
|
|
@@ -105,6 +105,12 @@ nodes:
|
|
|
105
105
|
sb.Append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">");
|
|
106
106
|
sb.Append("<title>Knowledge Base consulted</title><style>");
|
|
107
107
|
sb.Append("*{margin:0;padding:0;box-sizing:border-box}");
|
|
108
|
+
// Scrollbars, themed GLOBALLY for both engines. The report is its own document inside the
|
|
109
|
+
// Viewer iframe, so web/app.css never reaches it: without this the page itself — and any
|
|
110
|
+
// container a later edit makes scrollable — falls back to the browser's own bar. Firefox
|
|
111
|
+
// reads only scrollbar-width/-color; Safari before 18.2 reads only the ::-webkit- block, so
|
|
112
|
+
// both halves are needed. Colours are slate-300/-400, the same ramp as this report's greys.
|
|
113
|
+
sb.Append("*{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#94a3b8}");
|
|
108
114
|
sb.Append("body{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:#f1f5f9;color:#0f172a;padding:2.5rem;line-height:1.6}");
|
|
109
115
|
sb.Append(".wrap{max-width:760px;margin:0 auto;background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:2rem 2.25rem;box-shadow:0 10px 30px rgba(2,6,23,.06)}");
|
|
110
116
|
sb.Append(".hd{border-bottom:2px solid #4a9eff;padding-bottom:1rem;margin-bottom:1.5rem}");
|
|
@@ -100,6 +100,12 @@ nodes:
|
|
|
100
100
|
sb.Append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">");
|
|
101
101
|
sb.Append("<title>Approved Workspace Project</title><style>");
|
|
102
102
|
sb.Append("*{margin:0;padding:0;box-sizing:border-box}");
|
|
103
|
+
// Scrollbars, themed GLOBALLY for both engines. The report is its own document inside the
|
|
104
|
+
// Viewer iframe, so web/app.css never reaches it: without this the page itself — and any
|
|
105
|
+
// container a later edit makes scrollable — falls back to the browser's own bar. Firefox
|
|
106
|
+
// reads only scrollbar-width/-color; Safari before 18.2 reads only the ::-webkit- block, so
|
|
107
|
+
// both halves are needed. Colours are slate-300/-400, the same ramp as this report's greys.
|
|
108
|
+
sb.Append("*{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#94a3b8}");
|
|
103
109
|
sb.Append("body{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:#f1f5f9;color:#0f172a;padding:2.5rem;line-height:1.6}");
|
|
104
110
|
sb.Append(".wrap{max-width:760px;margin:0 auto;background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:2rem 2.25rem;box-shadow:0 10px 30px rgba(2,6,23,.06)}");
|
|
105
111
|
sb.Append(".hd{border-bottom:2px solid #4a9eff;padding-bottom:1rem;margin-bottom:1.5rem}");
|
|
@@ -153,6 +153,12 @@ nodes:
|
|
|
153
153
|
sb.Append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">");
|
|
154
154
|
sb.Append("<title>" + E(modelName) + " - BOM Phase " + phase + "</title><style>");
|
|
155
155
|
sb.Append("*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:#0f172a;color:#e2e8f0;padding:2rem;line-height:1.6}.container{max-width:1200px;margin:0 auto}");
|
|
156
|
+
// Scrollbars, themed GLOBALLY for both engines. The report is its own document inside the
|
|
157
|
+
// Viewer iframe, so web/app.css never reaches it: without this the long table's wrapper and
|
|
158
|
+
// the page itself draw the browser's native LIGHT bar over a dark report. Firefox reads only
|
|
159
|
+
// scrollbar-width/-color; Safari before 18.2 reads only the ::-webkit- block — both halves
|
|
160
|
+
// are needed. Colours are this report's own slate tokens, no new hues.
|
|
161
|
+
sb.Append("*{scrollbar-width:thin;scrollbar-color:#334155 transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#334155;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#64748b}");
|
|
156
162
|
sb.Append(".report-header{border-bottom:2px solid #d946ef;padding-bottom:1rem;margin-bottom:2rem}.report-header h1{font-size:1.75rem;font-weight:700;color:#f8fafc}.report-header .subtitle{color:#94a3b8;font-size:.875rem;margin-top:.25rem}");
|
|
157
163
|
sb.Append(".summary-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem;margin-bottom:2rem}.card{background:#1e293b;border:1px solid #334155;border-radius:8px;padding:1.25rem}.card .label{font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:#94a3b8;margin-bottom:.25rem}.card .value{font-size:1.5rem;font-weight:700;color:#f8fafc;font-family:Consolas,monospace}.card .value.accent{color:#d946ef}");
|
|
158
164
|
sb.Append(".cat{margin-bottom:1.75rem}.cat h2{font-size:1rem;font-weight:700;color:#f8fafc;margin-bottom:.5rem;display:flex;align-items:baseline;gap:.5rem}.cat h2 .pill{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#0f172a;background:#d946ef;border-radius:999px;padding:.1rem .5rem}.cat h2 .sub{font-size:.8rem;font-weight:400;color:#94a3b8;font-family:Consolas,monospace;margin-left:auto}");
|
|
@@ -88,6 +88,12 @@ nodes:
|
|
|
88
88
|
|
|
89
89
|
var sb = new StringBuilder();
|
|
90
90
|
sb.Append("<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><title>PDF Takeoff</title><style>");
|
|
91
|
+
// Scrollbars, themed GLOBALLY for both engines. The report is its own document inside the
|
|
92
|
+
// Viewer iframe, so web/app.css never reaches it: without this the page itself — and any
|
|
93
|
+
// container a later edit makes scrollable — falls back to the browser's own bar. Firefox
|
|
94
|
+
// reads only scrollbar-width/-color; Safari before 18.2 reads only the ::-webkit- block, so
|
|
95
|
+
// both halves are needed. Colours are slate-300/-400, the same ramp as this report's greys.
|
|
96
|
+
sb.Append("*{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#94a3b8}");
|
|
91
97
|
sb.Append("body{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:#f1f5f9;color:#0f172a;padding:2.5rem;line-height:1.6}");
|
|
92
98
|
sb.Append(".wrap{max-width:560px;margin:0 auto;background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:1.75rem 2rem;box-shadow:0 10px 30px rgba(2,6,23,.06)}");
|
|
93
99
|
sb.Append("h1{font-size:1.5rem;font-weight:800;border-bottom:2px solid #4a9eff;padding-bottom:.75rem;margin-bottom:1.25rem}");
|
|
@@ -75,8 +75,18 @@ nodes:
|
|
|
75
75
|
// hosted shared page alike. The "Made with FloLess" badge is injected by the
|
|
76
76
|
// server (report-badge.ts) — never add it here. Accent is brand blue #3b82f6
|
|
77
77
|
// (a selection report is general-purpose; fuchsia is bom-by-phase's phase hue).
|
|
78
|
+
// Scrollbars are themed GLOBALLY for both engines. The report is its own document inside the
|
|
79
|
+
// Viewer iframe, so web/app.css never reaches it: without this the wide table's wrapper and
|
|
80
|
+
// the page itself draw the browser's native LIGHT bar over a dark report. Firefox reads only
|
|
81
|
+
// scrollbar-width/-color; Safari before 18.2 reads only the ::-webkit- block — both halves
|
|
82
|
+
// are needed. Colours are this report's own slate tokens, no new hues.
|
|
78
83
|
string css =
|
|
79
84
|
"*{margin:0;padding:0;box-sizing:border-box}"
|
|
85
|
+
+ "*{scrollbar-width:thin;scrollbar-color:#334155 transparent}"
|
|
86
|
+
+ "::-webkit-scrollbar{width:8px;height:8px}"
|
|
87
|
+
+ "::-webkit-scrollbar-track{background:transparent}"
|
|
88
|
+
+ "::-webkit-scrollbar-thumb{background:#334155;border-radius:4px}"
|
|
89
|
+
+ "::-webkit-scrollbar-thumb:hover{background:#64748b}"
|
|
80
90
|
+ "body{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:#0f172a;color:#e2e8f0;padding:2rem;line-height:1.6}"
|
|
81
91
|
+ ".container{max-width:1200px;margin:0 auto}"
|
|
82
92
|
+ ".report-header{border-bottom:2px solid #3b82f6;padding-bottom:1rem;margin-bottom:2rem}"
|
|
@@ -90,8 +90,18 @@ nodes:
|
|
|
90
90
|
// hosted shared page alike. The "Made with FloLess" badge is injected by the
|
|
91
91
|
// server (report-badge.ts) — never add it here. Accent is brand blue #3b82f6
|
|
92
92
|
// (a selection report is general-purpose; fuchsia is bom-by-phase's phase hue).
|
|
93
|
+
// Scrollbars are themed GLOBALLY for both engines. The report is its own document inside the
|
|
94
|
+
// Viewer iframe, so web/app.css never reaches it: without this the wide table's wrapper and
|
|
95
|
+
// the page itself draw the browser's native LIGHT bar over a dark report. Firefox reads only
|
|
96
|
+
// scrollbar-width/-color; Safari before 18.2 reads only the ::-webkit- block — both halves
|
|
97
|
+
// are needed. Colours are this report's own slate tokens, no new hues.
|
|
93
98
|
string css =
|
|
94
99
|
"*{margin:0;padding:0;box-sizing:border-box}"
|
|
100
|
+
+ "*{scrollbar-width:thin;scrollbar-color:#334155 transparent}"
|
|
101
|
+
+ "::-webkit-scrollbar{width:8px;height:8px}"
|
|
102
|
+
+ "::-webkit-scrollbar-track{background:transparent}"
|
|
103
|
+
+ "::-webkit-scrollbar-thumb{background:#334155;border-radius:4px}"
|
|
104
|
+
+ "::-webkit-scrollbar-thumb:hover{background:#64748b}"
|
|
95
105
|
+ "body{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:#0f172a;color:#e2e8f0;padding:2rem;line-height:1.6}"
|
|
96
106
|
+ ".container{max-width:1200px;margin:0 auto}"
|
|
97
107
|
+ ".report-header{border-bottom:2px solid #3b82f6;padding-bottom:1rem;margin-bottom:2rem}"
|
|
@@ -364,13 +364,11 @@
|
|
|
364
364
|
return {
|
|
365
365
|
start, resume, adopt, acknowledge, retryFailed, check,
|
|
366
366
|
getState: () => state,
|
|
367
|
-
getStoredTransaction: readStored,
|
|
368
367
|
subscribe(listener) {
|
|
369
368
|
listeners.add(listener);
|
|
370
369
|
listener(state);
|
|
371
370
|
return () => listeners.delete(listener);
|
|
372
371
|
},
|
|
373
|
-
cancelPolling() { generation += 1; },
|
|
374
372
|
};
|
|
375
373
|
}
|
|
376
374
|
|
package/dist/web/aware.js
CHANGED
|
@@ -431,11 +431,6 @@
|
|
|
431
431
|
: app.lock.present
|
|
432
432
|
? `<span class="cm"># ${escapeHtml(app.id)}.lock · node "${escapeHtml(n.id)}"</span>\n${escapeHtml(nodeYaml(n))}`
|
|
433
433
|
: `<span class="cm"># not compiled</span>\nHit ⎙ Compile to freeze the .lock.`,
|
|
434
|
-
// raw (unescaped) exec source for the Debug-in-VS handler; null for non-exec.
|
|
435
|
-
_execSource: execSource,
|
|
436
|
-
_execVersion: n.config && typeof n.config.version === 'string' ? n.config.version : null,
|
|
437
|
-
_appId: app.id,
|
|
438
|
-
_nodeId: n.id,
|
|
439
434
|
execution: liveTrace,
|
|
440
435
|
};
|
|
441
436
|
}
|
|
@@ -16,6 +16,83 @@ import { mmPerPx } from './grid-core.js';
|
|
|
16
16
|
export const FT_TO_MM = 304.8;
|
|
17
17
|
export const IN_TO_MM = 25.4;
|
|
18
18
|
|
|
19
|
+
/** @typedef {'I'|'C'|'L'|'TUBE'|'BOX'} SectionKind */
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Steel families as literal designation PREFIXES, paired with the section kind each one draws as.
|
|
23
|
+
* Order here is presentation only — `sectionKindOf` picks the longest match, never the first — with one
|
|
24
|
+
* caveat worth stating because nothing in the loop enforces it: two entries carrying the SAME prefix can
|
|
25
|
+
* only tie, and the tie goes to the earlier one, so a duplicate added later is silently dead. That is the
|
|
26
|
+
* same unreachability this change set out to remove, just re-keyed from chain order to array order, so
|
|
27
|
+
* `section-kind.test.ts` checks the table for duplicates rather than trusting this paragraph.
|
|
28
|
+
*
|
|
29
|
+
* The annotation below is NOT enforcement either: this is a .js file and the server tsconfig runs
|
|
30
|
+
* `allowJs` without `checkJs`, so a typo'd entry (`['MC', 'c']`) or a malformed one still compiles —
|
|
31
|
+
* verified. `section-kind.test.ts` validates the table's shape for that reason.
|
|
32
|
+
*
|
|
33
|
+
* Tees (`WT`/`ST`/`MT`) deliberately carry no entry: there is no 'T' kind, so they ride their parent
|
|
34
|
+
* letter and draw as an I. That is the long-standing behaviour and is left exactly as it was — a tee
|
|
35
|
+
* outline is its own change, not part of the prefix-shadowing fix below. Note that ADDING a tee entry
|
|
36
|
+
* here WOULD silently take every `WT` away from 'I': "a new family cannot un-reach an existing one" is
|
|
37
|
+
* about each family's own prefix still matching, not about the designations it currently attracts.
|
|
38
|
+
*
|
|
39
|
+
* @type {ReadonlyArray<readonly [string, SectionKind]>}
|
|
40
|
+
*/
|
|
41
|
+
export const SECTION_FAMILIES = [
|
|
42
|
+
['W', 'I'], ['M', 'I'], ['S', 'I'], ['HP', 'I'], // US I-family
|
|
43
|
+
['UC', 'I'], ['UB', 'I'], ['UKC', 'I'], ['UKB', 'I'], ['IPE', 'I'], ['HE', 'I'], // UK/EU I-family
|
|
44
|
+
['C', 'C'], ['MC', 'C'], ['PFC', 'C'], // channels
|
|
45
|
+
['L', 'L'], // angles
|
|
46
|
+
['HSS', 'TUBE'], ['PIPE', 'TUBE'], ['TS', 'TUBE'], ['TUBE', 'TUBE'], ['HSQ', 'TUBE'],
|
|
47
|
+
['SHS', 'TUBE'], ['RHS', 'TUBE'], ['CHS', 'TUBE'], // hollow sections
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Section shape KIND from a steel designation — the ONE classifier behind the 2D plan outline
|
|
52
|
+
* (`web/steel-editor.html` sectionShapePts), the 3D extrusion (`web/steel-3d-view.js` shapeOf) and
|
|
53
|
+
* the base-plate weld footprint (`server/steel-joints.ts` profileOutline). Each of those three used
|
|
54
|
+
* to carry its own copy of an ordered regex chain kept in step by a comment; this is the source they
|
|
55
|
+
* now share, so the copies cannot drift apart again.
|
|
56
|
+
*
|
|
57
|
+
* LONGEST PREFIX WINS, and that IS the fix rather than a matter of taste. The old chain tested a bare
|
|
58
|
+
* `M`, `S` and `C` inside earlier alternations, so a one-letter family silently swallowed a longer one
|
|
59
|
+
* three separate times — `M` ate `MC` (#647: an MC channel drew as a wide flange), `S` ate `SHS`, and
|
|
60
|
+
* `C` ate `CHS`, the last two leaving a closed hollow section classified as an open I or channel.
|
|
61
|
+
*
|
|
62
|
+
* In `steel-joints` that is not cosmetic, though the two tubes were hurt differently and it is worth
|
|
63
|
+
* being exact: an `SHS` answering 'I' reached the I-only estimate in `lapFaces` and BUILT a lap on a
|
|
64
|
+
* bearing face it does not have, whereas a `CHS` answering 'C' never entered that branch and so WAS
|
|
65
|
+
* refused — just as `bearing-face-unresolved` rather than the `closed-section-unsupported` it is owed,
|
|
66
|
+
* and with a channel traced as its weld outline. Reachability was a property of the whole chain's ORDER
|
|
67
|
+
* and so invisible while reading any single branch of it; matching on longest literal prefix removes the
|
|
68
|
+
* class, because adding a family can no longer un-reach one.
|
|
69
|
+
*
|
|
70
|
+
* WHAT THIS DOES NOT PROMISE. It matches a literal prefix, not a parsed designation, and several
|
|
71
|
+
* families are a single letter — so `STEEL` answers 'I', `CUSTOM` and `COL` answer 'C', and an `MC`
|
|
72
|
+
* written `M.C.18X58` answers 'I'. Only a designation with no KNOWN family prefix (`2L…`, `ZZ99`, '')
|
|
73
|
+
* reaches BOX. That is long-standing behaviour, unchanged here and not a regression, but do not read BOX
|
|
74
|
+
* as "we could not classify it" — this cannot currently say that, which is why `steel-joints` has no
|
|
75
|
+
* honest way to refuse an unrecognised designation. See #657.
|
|
76
|
+
*
|
|
77
|
+
* @param {unknown} profile
|
|
78
|
+
* @returns {SectionKind}
|
|
79
|
+
*/
|
|
80
|
+
export function sectionKindOf(profile) {
|
|
81
|
+
const p = String(profile == null ? '' : profile).toUpperCase().trim();
|
|
82
|
+
/** @type {SectionKind} */
|
|
83
|
+
let kind = 'BOX';
|
|
84
|
+
let best = 0;
|
|
85
|
+
// No cast on `familyKind`: the table is annotated, so a bad entry is a problem at the table (where
|
|
86
|
+
// section-kind.test.ts checks for it) rather than something an assertion here quietly waves through.
|
|
87
|
+
for (const [prefix, familyKind] of SECTION_FAMILIES) {
|
|
88
|
+
if (prefix.length > best && p.startsWith(prefix)) {
|
|
89
|
+
best = prefix.length;
|
|
90
|
+
kind = familyKind;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return kind;
|
|
94
|
+
}
|
|
95
|
+
|
|
19
96
|
/**
|
|
20
97
|
* Clip a 3D segment against convex half-spaces. Each plane is
|
|
21
98
|
* `{ normal:[x,y,z], constant }`, with points on the non-negative side kept.
|
|
@@ -19,7 +19,7 @@ import { OrbitControls } from 'three/addons/OrbitControls.js';
|
|
|
19
19
|
import { RoomEnvironment } from 'three/addons/RoomEnvironment.js';
|
|
20
20
|
import { surfaceTextures, applyTriplanar, TILE_MM, DIRECTIONAL } from './steel-materials.js';
|
|
21
21
|
import { Brush, Evaluator, SUBTRACTION } from 'three-bvh-csg';
|
|
22
|
-
import { snapPoint, planPointToWp, memberGeometry, snapElevation, dim3dGeom, dominantAxis3d, planeBasis, planeFrom3Points, frameFrom3Points, frameFromAngle, worldToLocal, identityFrame, resolvePointEntry, offsetsFor, candidateOnPlane, snapGridPoint, clipSegmentToPlanes, pointSegmentDistance2d, perspectiveSegmentParameter, gridDepthWins, segmentHitsRect2d, projectedFootprintHitsRect2d, pickGridLevel, selectedLengthLabelAnchors } from './steel-3d-core.js';
|
|
22
|
+
import { snapPoint, planPointToWp, memberGeometry, snapElevation, dim3dGeom, dominantAxis3d, planeBasis, planeFrom3Points, frameFrom3Points, frameFromAngle, worldToLocal, identityFrame, resolvePointEntry, offsetsFor, candidateOnPlane, snapGridPoint, clipSegmentToPlanes, pointSegmentDistance2d, perspectiveSegmentParameter, gridDepthWins, segmentHitsRect2d, projectedFootprintHitsRect2d, pickGridLevel, selectedLengthLabelAnchors, sectionKindOf } from './steel-3d-core.js';
|
|
23
23
|
// `gridGeometry`, `gridCandidates3d` and `mmPerPx` moved behind the host's model read half (unit 5, P7d):
|
|
24
24
|
// each takes a `ptPerFt`, which is a v1 PLAN default and meaningless on a world-mm model grid.
|
|
25
25
|
import { visibleGridLevels } from './grid-core.js';
|
|
@@ -378,12 +378,9 @@ function lengthAxisOf(el) {
|
|
|
378
378
|
function shapeOf(el) {
|
|
379
379
|
const explicit = (el.section && el.section.shape || '').toString().toUpperCase().trim();
|
|
380
380
|
if (/^(I|C|L|TUBE|BOX)$/.test(explicit)) return explicit; // explicit section.shape override wins
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
if (/^L/.test(p)) return 'L'; // angle
|
|
385
|
-
if (/^(HSS|PIPE|TS|SHS|RHS|CHS|TUBE|HSQ)/.test(p)) return 'TUBE'; // hollow tube
|
|
386
|
-
return 'BOX';
|
|
381
|
+
// The designation itself goes to the shared classifier (steel-3d-core.js), which the 2D plan outline
|
|
382
|
+
// and the base-plate weld also use. The copy that lived here drew MC channels as I-sections (#647).
|
|
383
|
+
return sectionKindOf((el.meta && el.meta.profile) || '');
|
|
387
384
|
}
|
|
388
385
|
// A real thickness off the element's `xsection` (AISC table / designation) when there is one and it fits
|
|
389
386
|
// inside the section, else null so the caller keeps its estimate. The fit check matters: a metric
|
|
@@ -3947,13 +3947,13 @@ function widthEstimated(profile){
|
|
|
3947
3947
|
if(!m||!/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(m[1]))return false; // only the I/channel/tee families fall back to a ratio
|
|
3948
3948
|
const key=p.replace(/\s+/g,'');
|
|
3949
3949
|
return sec[key]===undefined&&bf[key]===undefined;}
|
|
3950
|
-
// Section shape kind from the designation —
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3950
|
+
// Section shape kind from the designation — the ONE classifier, in steel-3d-core.js, shared with the 3D
|
|
3951
|
+
// extrusion (steel-3d-view.js shapeOf) and the base-plate weld (server/steel-joints.ts). This used to be
|
|
3952
|
+
// a hand-kept COPY of that regex chain, which is exactly how #647 survived: a bare `M` in the I-branch
|
|
3953
|
+
// made the `MC` branch unreachable, so every MC channel drew as a wide flange. Unguarded because boot()
|
|
3954
|
+
// awaits SteelCore at the top, before it fetches the contract and before main() — and every path here
|
|
3955
|
+
// (render(), and updateLine() on a live drag) needs C/P, which cannot exist until after that await.
|
|
3956
|
+
function sectionKindOf(profile){return SteelCore.sectionKindOf(profile);}
|
|
3957
3957
|
// Local section outline (centred at origin), w/d in PX — mirrors steel-3d-view.js profileShape (the
|
|
3958
3958
|
// tf/tw web+flange fractions match, so 2D and 3D read as the same section). Tube drawn solid in 2D.
|
|
3959
3959
|
function sectionShapePts(profile,w,d){const hw=w/2,hd=d/2,kind=sectionKindOf(profile);
|
|
@@ -5748,6 +5748,11 @@ function panel(){
|
|
|
5748
5748
|
const unavailable=connectionDiagnosticsStatus==='unavailable';
|
|
5749
5749
|
return `<div class=drow aria-busy="${unavailable?'false':'true'}"><div style="flex:1 1 100%;min-width:0"><div class="dmsg warn">${unavailable?'Build status unavailable':'Checking connection build status…'}</div><div class=hint role=note style="margin-top:3px">${unavailable?'The connection engine could not verify this detail. No build action is offered until verification succeeds.':'The connection engine is checking the current model before offering a build action.'}</div></div>${unavailable?`<button id=${id}_retry class=ghostw data-tip="Check this connection against the current model again">Check again</button>`:''}</div>`;
|
|
5750
5750
|
}
|
|
5751
|
+
if(diag&&diag.code==='support-section-unsupported'){
|
|
5752
|
+
const truth=supportSectionWarningCopy(diag),preview=!joint;
|
|
5753
|
+
return `<div class=drow><div style="flex:1 1 100%;min-width:0"><div class=dmsg warn>${preview?'Would build with limited support-side fit':'Built with limited support-side fit'}</div><div class=hint role=note style="margin-top:3px">${esc(truth.detail)}</div></div>`
|
|
5754
|
+
+(r.ok?`<button id=${id}_ap class=ghostw data-tip="${preview?'Build this connection from the detail':'Build it again from the detail, replacing what is here'}">${preview?'Build it':'Rebuild it'}</button>`:'')+`${capBtn}</div>`;
|
|
5755
|
+
}
|
|
5751
5756
|
if(diag&&diag.severity==='error'){
|
|
5752
5757
|
const truth=connectionRefusalCopy(diag,m);
|
|
5753
5758
|
return `<div class=drow><div style="flex:1 1 100%;min-width:0"><div class="dmsg warn">${esc(truth.head)}</div><div class=hint role=note style="margin-top:3px">${esc(truth.detail)}</div></div></div>`;
|
|
@@ -8065,6 +8070,10 @@ function announceConnectionTruth(message,busy){
|
|
|
8065
8070
|
if(p){if(busy)p.setAttribute('aria-busy','true');else p.removeAttribute('aria-busy');}
|
|
8066
8071
|
if(s){s.setAttribute('role','status');s.setAttribute('aria-live','polite');s.setAttribute('aria-atomic','true');s.textContent=message||'';}
|
|
8067
8072
|
}
|
|
8073
|
+
function supportSectionWarningCopy(d){
|
|
8074
|
+
const support=d.supportId||'the named support',profile=d.profile||'this section';
|
|
8075
|
+
return {head:'Built with limited support-side fit',detail:'Support '+support+' ('+profile+') is not an I-shaped section, so the support-side cope or web-face shift was not applied. Review this connection before fabrication.'};
|
|
8076
|
+
}
|
|
8068
8077
|
function connectionRefusalCopy(d,m){
|
|
8069
8078
|
const support=d.supportId||'the named support',main=d.mainId||m.id,profile=d.profile||m.profile||'This profile';
|
|
8070
8079
|
if(d.code==='closed-section-unsupported'){
|
|
@@ -8085,6 +8094,7 @@ function connectionRefusalCopy(d,m){
|
|
|
8085
8094
|
'support-not-found':{head:'Not built · No support meets this brace end',detail:'No support face could be proved for '+main+'. No gusset or brace trim was created.'},
|
|
8086
8095
|
'setback-unprovable':{head:'Not built · Brace setback cannot be proved',detail:'The support face and '+main+' do not define a safe setback. No gusset or brace trim was created.'},
|
|
8087
8096
|
'trim-exceeds-member':{head:'Not built · The required trim is too long',detail:main+' cannot safely give up enough length for this gusset. No geometry or trim was created.'},
|
|
8097
|
+
'support-section-unsupported':{head:'Built with limits · Support section is not an I-girder',detail:support+' ('+profile+') has no v1 cope or web-face model. The connection remains visible, but support-side placement and flange clearance need review.'},
|
|
8088
8098
|
'bearing-face-unresolved':{head:'Not built · Bearing face cannot be resolved',detail:profile+' has no provable face for this through-bolted detail. No geometry or trim was created.'},
|
|
8089
8099
|
'bolt-region-too-small':{head:'Not built · The bolt group does not fit',detail:'The authored plate cannot hold the required bolt group and edge distances. No geometry or trim was created.'}
|
|
8090
8100
|
};
|
|
@@ -8099,10 +8109,11 @@ function updateConnectionDiagnostics(raw,announce=true){
|
|
|
8099
8109
|
for(const d of fresh)shownConnectionDiagnosticSignatures.add(connectionDiagnosticSignature(d));
|
|
8100
8110
|
if(announce&&fresh.length){
|
|
8101
8111
|
const refused=fresh.filter(d=>d.severity==='error').length,adjusted=fresh.filter(d=>d.code==='bolt-gauge-adjusted').length;
|
|
8102
|
-
const
|
|
8112
|
+
const limited=fresh.filter(d=>d.code==='support-section-unsupported').length;
|
|
8113
|
+
const bits=[];if(refused)bits.push(refused+' connection'+(refused>1?'s':'')+' not built');if(adjusted)bits.push(adjusted+' built with an adjusted bolt gauge');if(limited)bits.push(limited+' connection'+(limited>1?'s':'')+' built with limited support-side fit');
|
|
8103
8114
|
toast(bits.join(' · ')+' — see the member inspector.');
|
|
8104
8115
|
}
|
|
8105
|
-
return {count:fresh.length,refused:fresh.filter(d=>d.severity==='error').length,adjusted:fresh.filter(d=>d.code==='bolt-gauge-adjusted').length};
|
|
8116
|
+
return {count:fresh.length,refused:fresh.filter(d=>d.severity==='error').length,adjusted:fresh.filter(d=>d.code==='bolt-gauge-adjusted').length,limited:fresh.filter(d=>d.code==='support-section-unsupported').length};
|
|
8106
8117
|
}
|
|
8107
8118
|
function applyConnectionBakeTruth(j,announce=true){
|
|
8108
8119
|
const fresh=updateConnectionDiagnostics(j&&j.diagnostics,false),sk=Array.isArray(j&&j.skipped)?j.skipped:[];
|
|
@@ -8117,6 +8128,7 @@ function applyConnectionBakeTruth(j,announce=true){
|
|
|
8117
8128
|
const bits=[];
|
|
8118
8129
|
if(fresh.refused)bits.push(fresh.refused+' connection'+(fresh.refused>1?'s':'')+' not built');
|
|
8119
8130
|
if(fresh.adjusted)bits.push(fresh.adjusted+' built with an adjusted bolt gauge');
|
|
8131
|
+
if(fresh.limited)bits.push(fresh.limited+' connection'+(fresh.limited>1?'s':'')+' built with limited support-side fit');
|
|
8120
8132
|
if(legacy)bits.push(legacy+' connection'+(legacy>1?'s':'')+' not shown in 3D');
|
|
8121
8133
|
if(noFit)bits.push(noFit+' member'+(noFit>1?'s':'')+' priced but not drawn — no tabulated footprint');
|
|
8122
8134
|
toast(bits.join(' · ')+' — '+((legacy||noFit)?'see the member inspector and console.':'see the member inspector.'));
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Every public command clones the document, changes the clone, validates the complete result, then
|
|
5
5
|
* commits into the original root object. A rejected command therefore cannot leak a half-written model.
|
|
6
6
|
* Projection controllers are notified only after commit: member-only edits patch stable ids; structural
|
|
7
|
-
* edits rebuild because sheet membership may have changed.
|
|
7
|
+
* edits rebuild because sheet membership may have changed. A mutator must DECLARE which of those it is —
|
|
8
|
+
* see `transact` — because the third shape, saying neither, notifies nobody and renders a stale canvas.
|
|
8
9
|
*
|
|
9
10
|
* This module is inert until steel-editor.html creates a session and hands it tagged projection objects.
|
|
10
11
|
*/
|
|
@@ -269,7 +270,6 @@ export function createV2CommandSession(model, options = {}) {
|
|
|
269
270
|
model,
|
|
270
271
|
registerProjection(controller) { projections.add(controller); return controller; },
|
|
271
272
|
unregisterProjection(controller) { projections.delete(controller); },
|
|
272
|
-
refreshProjections() { for (const projection of projections) projection.rebuild(); },
|
|
273
273
|
replaceDocument(next, label = 'replace document') {
|
|
274
274
|
return session.transact(label, (draft) => {
|
|
275
275
|
replaceRoot(draft, clone(next));
|
|
@@ -302,6 +302,19 @@ export function createV2CommandSession(model, options = {}) {
|
|
|
302
302
|
transact(label, mutator) {
|
|
303
303
|
const draft = clone(model);
|
|
304
304
|
const effect = mutator(draft) || {};
|
|
305
|
+
// Every mutator must SAY what the projections have to be told: `structural` (rebuild) or a
|
|
306
|
+
// `changedIds` list (patch those rows, and an empty list means deliberately none). Saying neither
|
|
307
|
+
// used to be a silent third path — the shape a mutator that simply returns nothing produces — and it
|
|
308
|
+
// committed the document while notifying no projection at all: a canvas drawing the previous model,
|
|
309
|
+
// with no exception and no console line to find it by (#664). It is refused BEFORE the commit, so a
|
|
310
|
+
// mis-declared command is as atomic as an invalid one.
|
|
311
|
+
if (!effect.structural && !Object.hasOwn(effect, 'changedIds')) {
|
|
312
|
+
throw new V2CommandError(
|
|
313
|
+
'effect-undeclared',
|
|
314
|
+
`${label} declared no projection effect; return { structural: true } or { changedIds: [...] }`,
|
|
315
|
+
[`effect keys: ${Object.keys(effect).join(', ') || '(none)'}`],
|
|
316
|
+
);
|
|
317
|
+
}
|
|
305
318
|
const changedIds = effect.changedIds instanceof Set ? effect.changedIds : new Set(effect.changedIds || []);
|
|
306
319
|
const problems = validationProblems(validate, draft);
|
|
307
320
|
if (problems.length) {
|
|
@@ -315,13 +328,20 @@ export function createV2CommandSession(model, options = {}) {
|
|
|
315
328
|
return committed;
|
|
316
329
|
},
|
|
317
330
|
|
|
331
|
+
/**
|
|
332
|
+
* Replace top-level document keys wholesale. Structural by this file's own definition: the caller
|
|
333
|
+
* chooses the keys, so `members`, `plans` and `grid` — everything a projection mirrors — are all
|
|
334
|
+
* reachable, and there is no key list here that could stay in step with the projection as it grows.
|
|
335
|
+
* A rebuild costs one re-projection on what is a click-driven command (dim_style today), and it is
|
|
336
|
+
* the only answer that cannot draw the previous model.
|
|
337
|
+
*/
|
|
318
338
|
patchModel(patch) {
|
|
319
339
|
return session.transact('patch model', (doc) => {
|
|
320
340
|
for (const [key, value] of Object.entries(patch)) {
|
|
321
341
|
if (value === undefined) delete doc[key];
|
|
322
342
|
else doc[key] = clone(value);
|
|
323
343
|
}
|
|
324
|
-
return {};
|
|
344
|
+
return { structural: true };
|
|
325
345
|
});
|
|
326
346
|
},
|
|
327
347
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floless/app",
|
|
3
|
-
"version": "0.126.
|
|
3
|
+
"version": "0.126.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"verify:no-title": "node build/verify-no-title.mjs",
|
|
34
34
|
"verify:no-native-select": "node build/verify-no-native-select.mjs",
|
|
35
35
|
"verify:scrollbars": "node build/verify-scrollbars.mjs",
|
|
36
|
+
"verify:flo-report-scrollbars": "node build/verify-flo-report-scrollbars.mjs",
|
|
37
|
+
"verify:flo-lock-drift": "node build/verify-flo-lock-drift.mjs",
|
|
36
38
|
"verify:native-controls": "node build/verify-native-controls.mjs",
|
|
37
39
|
"verify:display-sync": "node build/verify-display-sync.mjs",
|
|
38
40
|
"verify:view-modes": "node build/verify-view-modes.mjs",
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
"verify:flo-versions": "node build/verify-flo-versions.mjs",
|
|
41
43
|
"verify:boundary": "node build/verify-model-boundary.mjs",
|
|
42
44
|
"verify:change-reasons": "node build/verify-change-reasons.mjs",
|
|
45
|
+
"verify:no-agent-trailer": "node build/verify-no-agent-trailer.mjs",
|
|
43
46
|
"verify:claim-lock": "node ../tools/routine-claim.mjs selftest",
|
|
44
47
|
"typecheck": "tsc --noEmit",
|
|
45
48
|
"prepack": "npm run build",
|