@floless/app 0.133.0 → 0.133.2
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 +43 -33
- package/dist/web/app.css +36 -0
- package/dist/web/app.js +36 -1
- package/dist/web/aware.js +74 -2
- package/dist/web/commands-shell.js +4 -1
- package/dist/web/commands.js +11 -0
- package/dist/web/index.html +2 -3
- package/dist/web/steel-3d-core.js +9 -11
- package/dist/web/steel-catalog-picker.js +96 -5
- package/dist/web/steel-editor.html +19 -10
- package/package.json +1 -1
package/dist/floless-server.cjs
CHANGED
|
@@ -54505,7 +54505,7 @@ var REMEDIATION = {
|
|
|
54505
54505
|
"no-node": "AWARE needs Node.js 20+. Install it from https://nodejs.org and relaunch floless.app.",
|
|
54506
54506
|
"no-npm": "npm was not found. Install Node.js 20+ (which includes npm) from https://nodejs.org, then relaunch.",
|
|
54507
54507
|
"absent-and-skipped": "AWARE_SKIP_BOOTSTRAP is set but AWARE is not installed. Run: npm i -g @aware-aeco/cli",
|
|
54508
|
-
"aware-version-required": "The installed AWARE is older than this FloLess release requires. Install AWARE 0.
|
|
54508
|
+
"aware-version-required": "The installed AWARE is older than this FloLess release requires. Install AWARE 0.126.0 or newer, then relaunch: npm i -g @aware-aeco/cli",
|
|
54509
54509
|
// Supplementary to the UI's own copy (which the overlay shows above it), so it says
|
|
54510
54510
|
// what was actually attempted rather than paraphrasing "we couldn't check".
|
|
54511
54511
|
"toolchain-unverified": "The PATH lookup for Node.js/npm did not complete \u2014 it timed out or could not be spawned, so nothing was proven missing. Usually a busy machine rather than a broken install: use Try again, and relaunch FloLess if it persists.",
|
|
@@ -55037,7 +55037,7 @@ function appVersion() {
|
|
|
55037
55037
|
return resolveVersion({
|
|
55038
55038
|
isSea: isSea2(),
|
|
55039
55039
|
sqVersionXml: readSqVersionXml(),
|
|
55040
|
-
define: true ? "0.133.
|
|
55040
|
+
define: true ? "0.133.2" : void 0,
|
|
55041
55041
|
pkgVersion: readPkgVersion()
|
|
55042
55042
|
});
|
|
55043
55043
|
}
|
|
@@ -55053,7 +55053,7 @@ function resolveChannel(s) {
|
|
|
55053
55053
|
function appChannel() {
|
|
55054
55054
|
return resolveChannel({
|
|
55055
55055
|
isSea: isSea2(),
|
|
55056
|
-
define: true ? "0.133.
|
|
55056
|
+
define: true ? "0.133.2" : void 0,
|
|
55057
55057
|
// argv[1] is the entry the runtime actually loaded (…/dist/floless-server.cjs), which is what
|
|
55058
55058
|
// carries the npx cache prefix. Absent under the SEA exe, which never reaches the npx branch.
|
|
55059
55059
|
modulePath: process.argv[1]
|
|
@@ -55771,22 +55771,18 @@ function sectionTopology(displaySection, w, d, fallbackKind = "BOX") {
|
|
|
55771
55771
|
return [component(polygon([[-hw, hd], [hw, hd], [hw, hd - tf], [tw / 2, hd - tf], [tw / 2, -hd], [-tw / 2, -hd], [-tw / 2, hd - tf], [-hw, hd - tf]]))];
|
|
55772
55772
|
}
|
|
55773
55773
|
if (xs?.shape === "double-angle") {
|
|
55774
|
-
const longBack = String(xs.orientation).toLowerCase() !== "slbb";
|
|
55775
55774
|
const legDepth = Number(xs.d);
|
|
55776
55775
|
const legWidth = Number(xs.b);
|
|
55777
55776
|
const t = Math.min(Number(xs.t), legDepth, legWidth);
|
|
55778
55777
|
const gap = Math.max(Number(xs.gap) || 0, 0);
|
|
55779
55778
|
if (!(legDepth > 0 && legWidth > 0 && t > 0)) return [];
|
|
55780
|
-
const
|
|
55781
|
-
|
|
55782
|
-
|
|
55783
|
-
|
|
55784
|
-
|
|
55785
|
-
|
|
55786
|
-
|
|
55787
|
-
const lower = [[-hw, -hd], [-hw + t, -hd], [-hw + t, -hg - t], [hw, -hg - t], [hw, -hg], [-hw, -hg]];
|
|
55788
|
-
const upper = [[hw, hd], [hw - t, hd], [hw - t, hg + t], [-hw, hg + t], [-hw, hg], [hw, hg]];
|
|
55789
|
-
return [component(polygon(lower)), component(polygon(upper))];
|
|
55779
|
+
const shortBack = String(xs.orientation).toLowerCase() === "slbb";
|
|
55780
|
+
const backDepth = shortBack ? legWidth : legDepth;
|
|
55781
|
+
const outstandingWidth = shortBack ? legDepth : legWidth;
|
|
55782
|
+
const hd = backDepth / 2, hg = gap / 2;
|
|
55783
|
+
const left = [[-hg - outstandingWidth, hd - t], [-hg - t, hd - t], [-hg - t, -hd], [-hg, -hd], [-hg, hd], [-hg - outstandingWidth, hd]];
|
|
55784
|
+
const right = [[hg, -hd], [hg + t, -hd], [hg + t, hd - t], [hg + outstandingWidth, hd - t], [hg + outstandingWidth, hd], [hg, hd]];
|
|
55785
|
+
return [component(polygon(left)), component(polygon(right))];
|
|
55790
55786
|
}
|
|
55791
55787
|
const shapeKind = xs?.shape === "i" ? "I" : xs?.shape === "channel" ? "C" : xs?.shape === "angle" ? "L" : xs?.shape === "rhs" ? "TUBE" : fallbackKind;
|
|
55792
55788
|
const outlined = sectionOutlinePts(shapeKind, w, d, {
|
|
@@ -59489,11 +59485,11 @@ function parseIndexBytes(bytes2) {
|
|
|
59489
59485
|
const kept = [];
|
|
59490
59486
|
const opaque = [];
|
|
59491
59487
|
const seen = /* @__PURE__ */ new Set();
|
|
59492
|
-
const
|
|
59488
|
+
const dropped2 = [];
|
|
59493
59489
|
for (const row of exportsValue) {
|
|
59494
59490
|
const kind = row?.kind;
|
|
59495
59491
|
if (!isExportKind(kind)) {
|
|
59496
|
-
|
|
59492
|
+
dropped2.push(`unknown kind ${JSON.stringify(kind)}`);
|
|
59497
59493
|
opaque.push(row);
|
|
59498
59494
|
continue;
|
|
59499
59495
|
}
|
|
@@ -59502,16 +59498,16 @@ function parseIndexBytes(bytes2) {
|
|
|
59502
59498
|
}
|
|
59503
59499
|
const key2 = receiptKey(row.kind, row.variant);
|
|
59504
59500
|
if (seen.has(key2)) {
|
|
59505
|
-
|
|
59501
|
+
dropped2.push(`duplicate "${key2.trim()}"`);
|
|
59506
59502
|
opaque.push(row);
|
|
59507
59503
|
continue;
|
|
59508
59504
|
}
|
|
59509
59505
|
seen.add(key2);
|
|
59510
59506
|
kept.push(row);
|
|
59511
59507
|
}
|
|
59512
|
-
if (
|
|
59508
|
+
if (dropped2.length) {
|
|
59513
59509
|
console.warn(
|
|
59514
|
-
`project export index: ignored ${
|
|
59510
|
+
`project export index: ignored ${dropped2.length} unreadable receipt(s) \u2014 ${dropped2.join(", ")}`
|
|
59515
59511
|
);
|
|
59516
59512
|
}
|
|
59517
59513
|
return { exports: kept, opaque };
|
|
@@ -60557,9 +60553,15 @@ function aiscShapesPayload() {
|
|
|
60557
60553
|
function parseDim(tok) {
|
|
60558
60554
|
const s = tok.trim();
|
|
60559
60555
|
let m = s.match(/^(\d+)(?:\s+|-)(\d+)\/(\d+)$/);
|
|
60560
|
-
if (m)
|
|
60556
|
+
if (m) {
|
|
60557
|
+
const denominator = Number(m[3]);
|
|
60558
|
+
return denominator > 0 ? Number(m[1]) + Number(m[2]) / denominator : null;
|
|
60559
|
+
}
|
|
60561
60560
|
m = s.match(/^(\d+)\/(\d+)$/);
|
|
60562
|
-
if (m)
|
|
60561
|
+
if (m) {
|
|
60562
|
+
const denominator = Number(m[2]);
|
|
60563
|
+
return denominator > 0 ? Number(m[1]) / denominator : null;
|
|
60564
|
+
}
|
|
60563
60565
|
const d = Number.parseFloat(s);
|
|
60564
60566
|
return Number.isFinite(d) ? d : null;
|
|
60565
60567
|
}
|
|
@@ -61666,6 +61668,7 @@ var CODEX_COMPLETION_SCHEMA = {
|
|
|
61666
61668
|
var MAX_QUESTION = 2e3;
|
|
61667
61669
|
var MAX_ANSWER_CODE_UNITS = 8e3;
|
|
61668
61670
|
var MAX_ANSWER_BYTES = 32 * 1024;
|
|
61671
|
+
var MAX_DROPPED = 500;
|
|
61669
61672
|
function validateCompletion(value) {
|
|
61670
61673
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
61671
61674
|
return { kind: "violation", why: "completion was not an object" };
|
|
@@ -61682,16 +61685,18 @@ function validateCompletion(value) {
|
|
|
61682
61685
|
if (answerText.length > MAX_ANSWER_CODE_UNITS || answerBytes > MAX_ANSWER_BYTES) {
|
|
61683
61686
|
return { kind: "violation", why: "outcome answered exceeded the answer limit" };
|
|
61684
61687
|
}
|
|
61685
|
-
|
|
61686
|
-
return { kind: "answered", answer: answerText };
|
|
61688
|
+
return { kind: "answered", answer: answerText, ...dropped("question", text5) };
|
|
61687
61689
|
}
|
|
61688
|
-
if (answerText) return { kind: "violation", why: `outcome ${String(outcome)} also carried an answer` };
|
|
61689
61690
|
if (outcome === "needs-you" && !text5) {
|
|
61690
61691
|
return { kind: "violation", why: "outcome needs-you carried no question" };
|
|
61691
61692
|
}
|
|
61692
|
-
if (outcome === "needs-you") return { kind: "needs-you", question: text5 };
|
|
61693
|
-
if (outcome === "refused") return { kind: "refused", question: text5 };
|
|
61694
|
-
return { kind: "applied" };
|
|
61693
|
+
if (outcome === "needs-you") return { kind: "needs-you", question: text5, ...dropped("answer", answerText) };
|
|
61694
|
+
if (outcome === "refused") return { kind: "refused", question: text5, ...dropped("answer", answerText) };
|
|
61695
|
+
return { kind: "applied", ...dropped("answer", answerText) };
|
|
61696
|
+
}
|
|
61697
|
+
function dropped(field, text5) {
|
|
61698
|
+
const flat = text5.replace(/\s+/g, " ").trim();
|
|
61699
|
+
return flat ? { dropped: { field, text: flat.slice(0, MAX_DROPPED) } } : {};
|
|
61695
61700
|
}
|
|
61696
61701
|
function readCompletion(terminal) {
|
|
61697
61702
|
const ev = terminal;
|
|
@@ -67177,7 +67182,7 @@ function profileDimsIn(profile) {
|
|
|
67177
67182
|
case "solid-circle":
|
|
67178
67183
|
return { d: display.diameter / IN_TO_MM2, w: display.diameter / IN_TO_MM2, approx: false, round: true };
|
|
67179
67184
|
case "double-angle": {
|
|
67180
|
-
return display.orientation === "slbb" ? { d: (2 * display.d + display.gap) / IN_TO_MM2,
|
|
67185
|
+
return display.orientation === "slbb" ? { d: display.b / IN_TO_MM2, w: (2 * display.d + display.gap) / IN_TO_MM2, approx: false, round: false } : { d: display.d / IN_TO_MM2, w: (2 * display.b + display.gap) / IN_TO_MM2, approx: false, round: false };
|
|
67181
67186
|
}
|
|
67182
67187
|
case "joist":
|
|
67183
67188
|
case "unsupported-custom":
|
|
@@ -67187,7 +67192,7 @@ function profileDimsIn(profile) {
|
|
|
67187
67192
|
}
|
|
67188
67193
|
const pair = parseDoubleAngle(p);
|
|
67189
67194
|
if (pair) {
|
|
67190
|
-
return pair.orientation === "SLBB" ? { d: 2 * pair.legA + pair.gap,
|
|
67195
|
+
return pair.orientation === "SLBB" ? { d: pair.legB, w: 2 * pair.legA + pair.gap, approx: false, round: false } : { d: pair.legA, w: 2 * pair.legB + pair.gap, approx: false, round: false };
|
|
67191
67196
|
}
|
|
67192
67197
|
const tabulated = sectionDimsIn(p);
|
|
67193
67198
|
if (/^RE#/.test(p) && tabulated) return { d: tabulated.d, w: tabulated.bf, approx: false, round: true };
|
|
@@ -74241,9 +74246,9 @@ function publishProgress(id, event) {
|
|
|
74241
74246
|
s.buffered.push({ seq, frame });
|
|
74242
74247
|
s.bytes += frame.length;
|
|
74243
74248
|
while (s.bytes > MAX_BUFFER_BYTES && s.buffered.length > 1) {
|
|
74244
|
-
const
|
|
74245
|
-
s.bytes -=
|
|
74246
|
-
s.droppedBefore =
|
|
74249
|
+
const dropped2 = s.buffered.shift();
|
|
74250
|
+
s.bytes -= dropped2.frame.length;
|
|
74251
|
+
s.droppedBefore = dropped2.seq;
|
|
74247
74252
|
}
|
|
74248
74253
|
}
|
|
74249
74254
|
function subscribeProgress(id, reply, afterSeq, owner2) {
|
|
@@ -83898,7 +83903,7 @@ function isExportCompanionId(id) {
|
|
|
83898
83903
|
}
|
|
83899
83904
|
|
|
83900
83905
|
// tekla-readiness.ts
|
|
83901
|
-
var TEKLA_AWARE_FLOOR = "0.
|
|
83906
|
+
var TEKLA_AWARE_FLOOR = "0.126.0";
|
|
83902
83907
|
var DEFAULT_DEPS = {
|
|
83903
83908
|
npmVersion: () => aware.npmVersion(),
|
|
83904
83909
|
bridgeStatus: () => aware.teklaBridgeStatus(),
|
|
@@ -90384,6 +90389,11 @@ async function settle(deps, lease, code, out, err2, sessionCaptureError = null)
|
|
|
90384
90389
|
const after = deps.getRequest(lease.requestId);
|
|
90385
90390
|
const gone = !after || after.status === "staged";
|
|
90386
90391
|
const base = { exitCode: code ?? void 0, lastOutput: tail(err2) || tail(prose(out)) };
|
|
90392
|
+
if (completion.kind !== "violation" && completion.dropped) {
|
|
90393
|
+
console.error(
|
|
90394
|
+
`[terminal-run] ${lease.requestType} run ${lease.requestId} finished ${completion.kind} carrying an unused \`${completion.dropped.field}\`; dropped: ${completion.dropped.text}`
|
|
90395
|
+
);
|
|
90396
|
+
}
|
|
90387
90397
|
if (sessionCaptureError) {
|
|
90388
90398
|
if (lease.runtime === "codex") {
|
|
90389
90399
|
try {
|
package/dist/web/app.css
CHANGED
|
@@ -384,6 +384,42 @@
|
|
|
384
384
|
}
|
|
385
385
|
.msg.aware .body { border-left-color: var(--text-dim); }
|
|
386
386
|
.msg.instructor-answer .body { border-left-color: var(--accent); }
|
|
387
|
+
/* Rendered answer prose (answerProse in aware.js). Scoped to this card so no other message body
|
|
388
|
+
inherits a document-ish scale, and re-scaled from the browser defaults an h3/ul would bring into
|
|
389
|
+
a card set at the body's own font-size (mostly down — h3 15.2px→15px, ul padding 40px→17px —
|
|
390
|
+
though h5 comes back UP, because the UA's .83em is smaller than the body text it introduces).
|
|
391
|
+
h3 must stay clear of `strong`, which shares its color and weight: at equal size the top heading
|
|
392
|
+
level and an inline bold phrase were indistinguishable, so h3 carries the heavier weight.
|
|
393
|
+
The new-answer badge is ALWAYS the first child (merely hidden until the answer is new), so the
|
|
394
|
+
heading after it needs the same top-trim a real first child gets. */
|
|
395
|
+
.msg.instructor-answer .body > :first-child,
|
|
396
|
+
.msg.instructor-answer .body > .answer-new-badge + * { margin-top: 0; }
|
|
397
|
+
.msg.instructor-answer .body > :last-child { margin-bottom: 0; }
|
|
398
|
+
.msg.instructor-answer .body h3,
|
|
399
|
+
.msg.instructor-answer .body h4,
|
|
400
|
+
.msg.instructor-answer .body h5 { margin: 14px 0 5px; line-height: 1.35; font-weight: 600; }
|
|
401
|
+
.msg.instructor-answer .body h3 { font-size: 15px; font-weight: 700; color: var(--text); }
|
|
402
|
+
.msg.instructor-answer .body h4 {
|
|
403
|
+
font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
|
|
404
|
+
}
|
|
405
|
+
.msg.instructor-answer .body h5 { font-size: 12px; color: var(--text); }
|
|
406
|
+
.msg.instructor-answer .body p { margin: 0 0 9px; }
|
|
407
|
+
.msg.instructor-answer .body ul, .msg.instructor-answer .body ol { margin: 0 0 9px; padding-left: 17px; }
|
|
408
|
+
.msg.instructor-answer .body li { margin: 0 0 4px; }
|
|
409
|
+
.msg.instructor-answer .body li::marker { color: var(--text-dim); }
|
|
410
|
+
.msg.instructor-answer .body code {
|
|
411
|
+
font-family: var(--mono); font-size: 11.5px; background: var(--surface-3);
|
|
412
|
+
padding: 1px 5px; border-radius: 3px; color: var(--text-muted);
|
|
413
|
+
}
|
|
414
|
+
.msg.instructor-answer .body pre {
|
|
415
|
+
margin: 0 0 9px; padding: 9px 10px; background: var(--surface-3); border-radius: 5px;
|
|
416
|
+
overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
|
|
417
|
+
}
|
|
418
|
+
.msg.instructor-answer .body pre::-webkit-scrollbar { height: 7px; }
|
|
419
|
+
.msg.instructor-answer .body pre::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 7px; }
|
|
420
|
+
.msg.instructor-answer .body pre::-webkit-scrollbar-track { background: transparent; }
|
|
421
|
+
.msg.instructor-answer .body pre code { background: none; padding: 0; font-size: 11.5px; }
|
|
422
|
+
.msg.instructor-answer .body strong { color: var(--text); font-weight: 600; }
|
|
387
423
|
.answer-new-badge { display: none; margin-bottom: 6px; color: var(--accent); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
|
|
388
424
|
.msg.instructor-answer-new .answer-new-badge { display: block; }
|
|
389
425
|
.msg.instructor-answer-new .body {
|
package/dist/web/app.js
CHANGED
|
@@ -291,7 +291,42 @@ function msgEl(cls, who, html, timestamp = new Date()) {
|
|
|
291
291
|
return div;
|
|
292
292
|
}
|
|
293
293
|
function mdInline(s) {
|
|
294
|
-
|
|
294
|
+
// CODE SPANS COME OUT FIRST and go back last. Emphasis used to run over them, rewriting the inside
|
|
295
|
+
// of a <code>: `demos/*/*.flo` came out as `demos/<em>/</em>.flo` — the asterisks GONE from a path
|
|
296
|
+
// a reader copies, and the same for globs (`**/*.ts`), flags, regexes and pointer code, which is a
|
|
297
|
+
// large share of what an Instructor answer is made of. Markdown never processes emphasis inside a
|
|
298
|
+
// code span. Lifting them out also keeps emphasis able to WRAP one (`*see `foo` now*`), which
|
|
299
|
+
// per-segment processing would have broken instead.
|
|
300
|
+
//
|
|
301
|
+
// Bold FIRST among what remains, so the single-asterisk pass that follows sees only real italics.
|
|
302
|
+
// That pass may span the <strong> markup the earlier one produced — `*"the **first** point"*` is
|
|
303
|
+
// ordinary prose, and a guard against `<` left its asterisks on screen.
|
|
304
|
+
//
|
|
305
|
+
// WHAT MAKES THAT SAFE HAS TWO SHAPES, and only one of them is a call-site rule. `answerProse`
|
|
306
|
+
// (aware.js) and the guide description escape the WHOLE string before calling in. The narration
|
|
307
|
+
// lines cannot: they carry authored `**`/`` ` `` on purpose, so their producer escapes each
|
|
308
|
+
// INTERPOLATED VALUE where the line is assembled (see transform() in aware.js) and hands the line
|
|
309
|
+
// over already safe. Adding a narration line means escaping every interpolation there — nothing at
|
|
310
|
+
// this end will catch it for you. Either way no `<` here came from a user, so no pass can build a
|
|
311
|
+
// tag or an attribute out of one.
|
|
312
|
+
//
|
|
313
|
+
// Crossing tags CAN misnest (`<strong>a <em>b</strong> c</em>` from overlapping markers); the
|
|
314
|
+
// parser reparents it into valid-but-different DOM. Acceptable for prose, and the reason this is a
|
|
315
|
+
// pass chain rather than a parser.
|
|
316
|
+
const NUL = String.fromCharCode(0);
|
|
317
|
+
const code = [];
|
|
318
|
+
// NUL is stripped from the input BEFORE any placeholder is minted, so the sentinel cannot collide
|
|
319
|
+
// with text that happened to contain one — the single hazard a mask-and-restore carries. Restored
|
|
320
|
+
// by split parity rather than a regex: placeholders are then the only NULs present, so every odd
|
|
321
|
+
// segment is one, and neither emphasis pass adds or removes a NUL.
|
|
322
|
+
const masked = String(s).split(NUL).join('')
|
|
323
|
+
.replace(/`([^`]+)`/g, (_, body) => NUL + (code.push(body) - 1) + NUL);
|
|
324
|
+
return masked
|
|
325
|
+
.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
|
|
326
|
+
.replace(/\*(?!\s)([^*]+?)\*/g, '<em>$1</em>')
|
|
327
|
+
.split(NUL)
|
|
328
|
+
.map((part, i) => (i % 2 ? `<code>${code[Number(part)]}</code>` : part))
|
|
329
|
+
.join('');
|
|
295
330
|
}
|
|
296
331
|
|
|
297
332
|
function renderTopology() {
|
package/dist/web/aware.js
CHANGED
|
@@ -216,9 +216,81 @@
|
|
|
216
216
|
return !answer.project && !!currentId && answer.appId === currentId;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
+
/* The terminal AI writes its answer as markdown, and the card used to render that markdown raw —
|
|
220
|
+
a reader met a literal `# Dimension` and `**Where this lives:**` where a heading and a bold lead
|
|
221
|
+
belonged. This handles the block shapes those answers actually contain; mdInline still does the
|
|
222
|
+
inline half (bold, code, italic).
|
|
223
|
+
|
|
224
|
+
ESCAPE FIRST, then build. Every branch below composes markup out of text that can no longer
|
|
225
|
+
carry any, which is the order the guide description in this file already uses and the reason the
|
|
226
|
+
`<img src=x onerror=…>` case in instructor-answers-rendered.test.ts stays inert prose.
|
|
227
|
+
|
|
228
|
+
ponytail: hand-rolled for the handful of line shapes these answers use rather than shipping a
|
|
229
|
+
markdown library into web/ — reach for one when answers start carrying tables, links, nested
|
|
230
|
+
lists, or 4-space-indented code (which flattens into a paragraph here; fenced blocks are what
|
|
231
|
+
the models actually emit, and indent-detection would misfire on list continuations). */
|
|
232
|
+
function answerProse(raw) {
|
|
233
|
+
const out = [];
|
|
234
|
+
let list = null;
|
|
235
|
+
let para = [];
|
|
236
|
+
let fence = null;
|
|
237
|
+
const closeList = () => { if (list) { out.push(`</${list}>`); list = null; } };
|
|
238
|
+
// Joined with <br>, not a space. The renderer this replaced turned EVERY newline into one, and a
|
|
239
|
+
// model that hard-wraps a paragraph, or writes `key: value` runs and unbulleted steps as bare
|
|
240
|
+
// lines, would otherwise have that structure silently collapse into one running sentence. Soft-
|
|
241
|
+
// wrap joining is the stricter markdown reading; fidelity to what the AI laid out matters more
|
|
242
|
+
// here, and a blank line still starts a real new paragraph.
|
|
243
|
+
const closePara = () => { if (para.length) { out.push(`<p>${mdInline(para.join('<br>'))}</p>`); para = []; } };
|
|
244
|
+
const openList = (kind) => { if (list !== kind) { closeList(); out.push(`<${kind}>`); list = kind; } };
|
|
245
|
+
|
|
246
|
+
for (const line of escapeHtml(raw || '').split(/\r?\n/)) {
|
|
247
|
+
if (/^\s*```/.test(line)) {
|
|
248
|
+
if (fence) { out.push(`<pre><code>${fence.join('\n')}</code></pre>`); fence = null; }
|
|
249
|
+
else { closePara(); closeList(); fence = []; }
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
if (fence) { fence.push(line); continue; }
|
|
253
|
+
|
|
254
|
+
// `\S` first: `"## "` with nothing after it would otherwise match, `.trim()` to empty, and emit
|
|
255
|
+
// an EMPTY heading — the characters gone from the screen and an accessibility failure ("heading
|
|
256
|
+
// must have content") in their place. Failing the match instead drops it to a paragraph, where
|
|
257
|
+
// the degenerate input at least stays visible as the text the model typed.
|
|
258
|
+
const heading = /^(#{1,6})\s+(\S.*)$/.exec(line);
|
|
259
|
+
if (heading) {
|
|
260
|
+
closePara(); closeList();
|
|
261
|
+
// Levels collapse to h3/h4/h5: this is a card in a narrow side panel, so a document h1 would
|
|
262
|
+
// be both oversized here and a lie about the page's outline.
|
|
263
|
+
const tag = heading[1].length === 1 ? 'h3' : heading[1].length === 2 ? 'h4' : 'h5';
|
|
264
|
+
out.push(`<${tag}>${mdInline(heading[2].trim())}</${tag}>`);
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const bullet = /^\s*[-*]\s+(.+)$/.exec(line);
|
|
269
|
+
const numbered = /^\s*\d+[.)]\s+(.+)$/.exec(line);
|
|
270
|
+
if (bullet || numbered) {
|
|
271
|
+
closePara();
|
|
272
|
+
openList(bullet ? 'ul' : 'ol');
|
|
273
|
+
out.push(`<li>${mdInline((bullet || numbered)[1].trim())}</li>`);
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (!line.trim()) { closePara(); closeList(); continue; }
|
|
278
|
+
// closeList BEFORE the paragraph opens. A prose line after a list item used to append a <p>
|
|
279
|
+
// while the <ul> was still open — content the parser keeps but the list semantics lose, since
|
|
280
|
+
// <p> is not permitted content for <ul> and a screen reader stops reading it as part of the
|
|
281
|
+
// list. The line becomes a paragraph AFTER the list instead.
|
|
282
|
+
closeList();
|
|
283
|
+
para.push(line.trim());
|
|
284
|
+
}
|
|
285
|
+
// An unterminated fence still renders as the code block it was opening, rather than vanishing.
|
|
286
|
+
if (fence) out.push(`<pre><code>${fence.join('\n')}</code></pre>`);
|
|
287
|
+
closePara(); closeList();
|
|
288
|
+
return out.join('');
|
|
289
|
+
}
|
|
290
|
+
|
|
219
291
|
function answerCard(answer, isNew) {
|
|
220
292
|
const subject = escapeHtml(answer.instructorContext.subject || 'this context');
|
|
221
|
-
const prose =
|
|
293
|
+
const prose = answerProse(answer.answer);
|
|
222
294
|
const runtime = answer.runtime === 'claude' ? 'Claude' : answer.runtime === 'codex' ? 'Codex' : 'terminal AI';
|
|
223
295
|
const card = msgEl(`aware instructor-answer${isNew ? ' instructor-answer-new' : ''}`,
|
|
224
296
|
`${runtime} · ${subject}`,
|
|
@@ -6604,7 +6676,7 @@
|
|
|
6604
6676
|
// have is the exact bug this reason exists to prevent.
|
|
6605
6677
|
return "Couldn't check whether Node.js is installed — the check didn't finish, which usually means the machine was busy. Nothing is necessarily missing; try again.";
|
|
6606
6678
|
case 'aware-version-required':
|
|
6607
|
-
return 'This FloLess release needs AWARE 0.
|
|
6679
|
+
return 'This FloLess release needs AWARE 0.126.0 or newer. Update AWARE, then try again.';
|
|
6608
6680
|
case 'offline':
|
|
6609
6681
|
return 'No network connection was detected. Connect to the internet, then try again.';
|
|
6610
6682
|
case 'smoke-failed':
|
|
@@ -664,13 +664,16 @@
|
|
|
664
664
|
});
|
|
665
665
|
|
|
666
666
|
def('shell.narrative-tab', {
|
|
667
|
-
label: 'Narrative', actsOn: 'Shows curated workflow and run narration
|
|
667
|
+
label: 'Narrative', actsOn: 'Shows curated workflow and run narration, not the chat transcript',
|
|
668
|
+
group: 'In the Narrative panel',
|
|
668
669
|
persistence: 'none', interaction: 'mode', risk: [], guidance: 'on-demand',
|
|
670
|
+
why: 'Narration follows the workflow, so a question you asked lands under AI answers instead — this tab never fills up with your own prompts.',
|
|
669
671
|
});
|
|
670
672
|
|
|
671
673
|
def('shell.ai-answers-tab', {
|
|
672
674
|
label: 'AI answers', actsOn: 'Shows durable read-only answers for the visible workflow or project', group: 'In the Narrative panel',
|
|
673
675
|
persistence: 'none', interaction: 'mode', risk: [], guidance: 'on-demand',
|
|
676
|
+
why: 'An answer outlives the run that wrote it, so a question asked once stays readable here instead of scrolling away in the terminal.',
|
|
674
677
|
});
|
|
675
678
|
|
|
676
679
|
def('shell.requests-run', {
|
package/dist/web/commands.js
CHANGED
|
@@ -27,6 +27,17 @@
|
|
|
27
27
|
once per FILE (surfaceScope) rather than per command, because a registration
|
|
28
28
|
file is wholly one surface — see the note beside SURFACE below.
|
|
29
29
|
|
|
30
|
+
`why` is OPTIONAL and, today, NOT READ COPY. Two consumers: the command
|
|
31
|
+
sheet's search haystack (instructor.js), and the `tip` of the entry the sheet
|
|
32
|
+
synthesizes when the command it activates has NO control on screen — a branch
|
|
33
|
+
any registered, always-rendered button never reaches, and which
|
|
34
|
+
controlGuidance would then suppress anyway because an entry carrying `actsOn`
|
|
35
|
+
never runs out of derived facts. So `why` earns a command its keyword hits
|
|
36
|
+
and covers the off-screen case; it is not what a user reads beside a live
|
|
37
|
+
control. Write it, but do not budget prose there expecting it on screen —
|
|
38
|
+
the sentence the strip reads out is `actsOn`. (Recorded because a commit
|
|
39
|
+
claimed the opposite and nothing here said otherwise.)
|
|
40
|
+
|
|
30
41
|
`guidance` exists because `interaction` alone got tiers wrong: treating every
|
|
31
42
|
gesture as a narrated command would demand step text for canvas pan and orbit,
|
|
32
43
|
which need none, while drag-to-place genuinely does.
|
package/dist/web/index.html
CHANGED
|
@@ -127,11 +127,10 @@
|
|
|
127
127
|
<aside class="chat" id="chat-panel" data-group="In the Narrative panel">
|
|
128
128
|
<div class="panel-label">
|
|
129
129
|
<span class="narrative-tabs" role="tablist" aria-label="Left panel content">
|
|
130
|
-
<button data-command-id="shell.narrative-tab" type="button" class="narrative-tab active" id="narrative-tab" role="tab" aria-selected="true" aria-controls="messages">Narrative</button>
|
|
131
|
-
<button data-command-id="shell.ai-answers-tab" type="button" class="narrative-tab" id="ai-answers-tab" role="tab" aria-selected="false" aria-controls="ai-answers" tabindex="-1">AI answers <span class="answer-unread" id="answer-unread" hidden></span></button>
|
|
130
|
+
<button data-command-id="shell.narrative-tab" type="button" class="narrative-tab active" id="narrative-tab" role="tab" aria-selected="true" aria-controls="messages" data-tip="Curated narration of this workflow and its runs — the full chat stays in your terminal AI">Narrative</button>
|
|
131
|
+
<button data-command-id="shell.ai-answers-tab" type="button" class="narrative-tab" id="ai-answers-tab" role="tab" aria-selected="false" aria-controls="ai-answers" tabindex="-1" data-tip="Answers your terminal AI wrote for an Instructor question, kept with this workflow or project">AI answers <span class="answer-unread" id="answer-unread" hidden></span></button>
|
|
132
132
|
</span>
|
|
133
133
|
<span class="label-end">
|
|
134
|
-
<span class="role">curated · full chat in your terminal</span>
|
|
135
134
|
<button data-command-id="shell.narrative-panel" type="button" class="panel-toggle" data-side="left" aria-label="Collapse Narrative panel" aria-controls="chat-panel" aria-expanded="true" data-tip="Collapse Narrative panel">‹</button>
|
|
136
135
|
</span>
|
|
137
136
|
</div>
|
|
@@ -470,22 +470,20 @@ export function sectionTopology(displaySection, w, d, fallbackKind = 'BOX') {
|
|
|
470
470
|
return [component(polygon([[-hw, hd], [hw, hd], [hw, hd - tf], [tw / 2, hd - tf], [tw / 2, -hd], [-tw / 2, -hd], [-tw / 2, hd - tf], [-hw, hd - tf]]))];
|
|
471
471
|
}
|
|
472
472
|
if (xs?.shape === 'double-angle') {
|
|
473
|
-
const longBack = String(xs.orientation).toLowerCase() !== 'slbb';
|
|
474
473
|
const legDepth = Number(xs.d);
|
|
475
474
|
const legWidth = Number(xs.b);
|
|
476
475
|
const t = Math.min(Number(xs.t), legDepth, legWidth);
|
|
477
476
|
const gap = Math.max(Number(xs.gap) || 0, 0);
|
|
478
477
|
if (!(legDepth > 0 && legWidth > 0 && t > 0)) return [];
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
const
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
return [component(polygon(lower)), component(polygon(upper))];
|
|
478
|
+
// Both AISC orientations are a side-by-side mirrored pair. The suffix chooses WHICH designation
|
|
479
|
+
// leg forms the adjacent vertical backs; it does not rotate one pair into a vertical stack.
|
|
480
|
+
const shortBack = String(xs.orientation).toLowerCase() === 'slbb';
|
|
481
|
+
const backDepth = shortBack ? legWidth : legDepth;
|
|
482
|
+
const outstandingWidth = shortBack ? legDepth : legWidth;
|
|
483
|
+
const hd = backDepth / 2, hg = gap / 2;
|
|
484
|
+
const left = [[-hg - outstandingWidth, hd - t], [-hg - t, hd - t], [-hg - t, -hd], [-hg, -hd], [-hg, hd], [-hg - outstandingWidth, hd]];
|
|
485
|
+
const right = [[hg, -hd], [hg + t, -hd], [hg + t, hd - t], [hg + outstandingWidth, hd - t], [hg + outstandingWidth, hd], [hg, hd]];
|
|
486
|
+
return [component(polygon(left)), component(polygon(right))];
|
|
489
487
|
}
|
|
490
488
|
|
|
491
489
|
const shapeKind = xs?.shape === 'i' ? 'I'
|
|
@@ -176,27 +176,118 @@ function ensureStyles(doc) {
|
|
|
176
176
|
doc.head.appendChild(style);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
function
|
|
180
|
-
const
|
|
179
|
+
function parseCatalogDimension(token) {
|
|
180
|
+
const value = String(token || '').trim();
|
|
181
|
+
let match = /^(\d+)(?:\s+|-)(\d+)\/(\d+)$/.exec(value);
|
|
182
|
+
if (match) {
|
|
183
|
+
const denominator = Number(match[3]);
|
|
184
|
+
return denominator > 0 ? Number(match[1]) + Number(match[2]) / denominator : null;
|
|
185
|
+
}
|
|
186
|
+
match = /^(\d+)\/(\d+)$/.exec(value);
|
|
187
|
+
if (match) {
|
|
188
|
+
const denominator = Number(match[2]);
|
|
189
|
+
return denominator > 0 ? Number(match[1]) / denominator : null;
|
|
190
|
+
}
|
|
191
|
+
return /^\d+(?:\.\d+)?$/.test(value) ? Number(value) : null;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function parseDoubleAngleDesignation(designation) {
|
|
195
|
+
// Preserve mixed-fraction boundaries before the generic search normalizer removes whitespace.
|
|
196
|
+
// Without this, `2 1/2` becomes `21/2` and silently reads as 10.5 inches.
|
|
197
|
+
const fractionSafe = String(designation == null ? '' : designation)
|
|
198
|
+
.replace(/\u00a0/g, ' ')
|
|
199
|
+
.replace(/(\d)\s+(\d+\/\d+)/g, '$1-$2');
|
|
200
|
+
let key = normalizeCatalogText(fractionSafe);
|
|
201
|
+
if (!key.startsWith('2L')) return null;
|
|
202
|
+
key = key.slice(2);
|
|
203
|
+
const suffix = /(LLBB|SLBB)$/.exec(key);
|
|
204
|
+
const orientation = suffix ? suffix[1].toLowerCase() : null;
|
|
205
|
+
if (suffix) key = key.slice(0, -suffix[1].length);
|
|
206
|
+
const tokens = key.split('X');
|
|
207
|
+
if (tokens.length !== 3 && tokens.length !== 4) return null;
|
|
208
|
+
const values = tokens.map(parseCatalogDimension);
|
|
209
|
+
if (values.slice(0, 3).some((value) => value == null || value <= 0)) return null;
|
|
210
|
+
const gap = tokens.length === 4 ? values[3] : 0;
|
|
211
|
+
if (gap == null || (tokens.length === 4 && gap <= 0) || (!orientation && Math.abs(values[0] - values[1]) > 1e-9)) return null;
|
|
212
|
+
return { legA: values[0], legB: values[1], thickness: values[2], gap, orientation: orientation || 'llbb' };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function formatImperialInches(value) {
|
|
216
|
+
if (!Number.isFinite(value) || value < 0) return null;
|
|
217
|
+
const denominator = 64;
|
|
218
|
+
const scaled = value * denominator;
|
|
219
|
+
// Catalog fractions are rendered conventionally, but a valid decimal custom designation must
|
|
220
|
+
// remain exact rather than being silently rounded to the nearest 1/64 inch.
|
|
221
|
+
if (Math.abs(scaled - Math.round(scaled)) > 1e-9) return `${Number(value.toFixed(9))}\"`;
|
|
222
|
+
const rounded = Math.round(scaled);
|
|
223
|
+
const whole = Math.floor(rounded / denominator);
|
|
224
|
+
let numerator = rounded % denominator;
|
|
225
|
+
if (!numerator) return `${whole}\"`;
|
|
226
|
+
let divisor = numerator;
|
|
227
|
+
let other = denominator;
|
|
228
|
+
while (other) [divisor, other] = [other, divisor % other];
|
|
229
|
+
numerator /= divisor;
|
|
230
|
+
const reducedDenominator = denominator / divisor;
|
|
231
|
+
return `${whole ? `${whole} ` : ''}${numerator}/${reducedDenominator}\"`;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function n(value) { return Number(value.toFixed(3)); }
|
|
235
|
+
|
|
236
|
+
function doubleAngleSchematic(spec) {
|
|
237
|
+
const shortBack = spec.orientation === 'slbb';
|
|
238
|
+
const back = shortBack ? spec.legB : spec.legA;
|
|
239
|
+
const outstanding = shortBack ? spec.legA : spec.legB;
|
|
240
|
+
const fullWidth = 2 * outstanding + spec.gap;
|
|
241
|
+
const scale = Math.min(68 / fullWidth, 68 / back);
|
|
242
|
+
const halfBack = back * scale / 2;
|
|
243
|
+
const halfGap = spec.gap * scale / 2;
|
|
244
|
+
const out = outstanding * scale;
|
|
245
|
+
const thickness = Math.max(2.5, Math.min(spec.thickness * scale, halfBack * 2, out));
|
|
246
|
+
const cx = 50, cy = 50;
|
|
247
|
+
const left = [
|
|
248
|
+
[cx-halfGap-out,cy-halfBack],[cx-halfGap,cy-halfBack],[cx-halfGap,cy+halfBack],
|
|
249
|
+
[cx-halfGap-thickness,cy+halfBack],[cx-halfGap-thickness,cy-halfBack+thickness],[cx-halfGap-out,cy-halfBack+thickness],
|
|
250
|
+
];
|
|
251
|
+
const right = [
|
|
252
|
+
[cx+halfGap,cy-halfBack],[cx+halfGap+out,cy-halfBack],[cx+halfGap+out,cy-halfBack+thickness],
|
|
253
|
+
[cx+halfGap+thickness,cy-halfBack+thickness],[cx+halfGap+thickness,cy+halfBack],[cx+halfGap,cy+halfBack],
|
|
254
|
+
];
|
|
255
|
+
const path = (points) => points.map(([x, y], index) => `${index ? 'L' : 'M'}${n(x)} ${n(y)}`).join('') + 'Z';
|
|
256
|
+
return `<svg viewBox="0 0 100 100" aria-hidden="true" data-back-leg="${back}" data-outstanding-leg="${outstanding}"><path d="${path(left)}" fill="currentColor"/><path d="${path(right)}" fill="currentColor"/></svg>`;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export function profileSchematic(row) { return schematic(row); }
|
|
260
|
+
|
|
261
|
+
function schematic(row) {
|
|
262
|
+
const f = String(row?.family || '').toUpperCase();
|
|
263
|
+
const doubleAngle = parseDoubleAngleDesignation(row?.designation);
|
|
264
|
+
if (doubleAngle) return doubleAngleSchematic(doubleAngle);
|
|
181
265
|
const common = 'fill="none" stroke="currentColor" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"';
|
|
182
266
|
if (f === 'HSS') return `<svg viewBox="0 0 100 100" aria-hidden="true"><rect x="17" y="17" width="66" height="66" rx="4" ${common}/><rect x="31" y="31" width="38" height="38" rx="2" ${common}/></svg>`;
|
|
183
267
|
if (f === 'PIPE' || f === 'CHS') return `<svg viewBox="0 0 100 100" aria-hidden="true"><circle cx="50" cy="50" r="34" ${common}/><circle cx="50" cy="50" r="21" ${common}/></svg>`;
|
|
184
268
|
if (f === 'RE') return `<svg viewBox="0 0 100 100" aria-hidden="true"><circle cx="50" cy="50" r="31" fill="currentColor"/><path d="M28 40L72 60M28 60L72 40" fill="none" stroke="var(--panel)" stroke-width="4" stroke-linecap="round"/></svg>`;
|
|
185
269
|
if (f === 'L') return `<svg viewBox="0 0 100 100" aria-hidden="true"><path d="M25 18V78H82" ${common}/></svg>`;
|
|
186
|
-
if (f === '2L') return
|
|
270
|
+
if (f === '2L') return '';
|
|
187
271
|
if (f === 'C' || f === 'MC') return `<svg viewBox="0 0 100 100" aria-hidden="true"><path d="M76 20H30V80H76" ${common}/></svg>`;
|
|
188
272
|
if (f === 'WT' || f === 'MT' || f === 'ST') return `<svg viewBox="0 0 100 100" aria-hidden="true"><path d="M18 24H82M50 24V82" ${common}/></svg>`;
|
|
189
273
|
if (f === 'W' || f === 'M' || f === 'S' || f === 'HP') return `<svg viewBox="0 0 100 100" aria-hidden="true"><path d="M18 20H82M50 20V80M18 80H82" ${common}/></svg>`;
|
|
190
274
|
return '';
|
|
191
275
|
}
|
|
192
276
|
|
|
193
|
-
function
|
|
277
|
+
export function profileFacts(row) {
|
|
194
278
|
const facts = [];
|
|
195
279
|
if (row.depth != null) facts.push(['Depth', `${row.depth}"`]);
|
|
196
280
|
if (row.width != null) facts.push(['Width', `${row.width}"`]);
|
|
197
281
|
if (row.web != null) facts.push(['Web / wall', `${row.web}"`]);
|
|
198
282
|
if (row.flange != null) facts.push(['Flange', `${row.flange}"`]);
|
|
283
|
+
const pair = parseDoubleAngleDesignation(row.designation);
|
|
284
|
+
if (pair) facts.push(['Gap', formatImperialInches(pair.gap)]);
|
|
199
285
|
if (row.weight != null) facts.push(['Weight', `${row.weight} lb/ft`]);
|
|
286
|
+
return facts;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function factsHtml(row) {
|
|
290
|
+
const facts = profileFacts(row);
|
|
200
291
|
return facts.length
|
|
201
292
|
? `<dl class=scp-facts>${facts.map(([k, v]) => `<dt>${esc(k)}</dt><dd>${esc(v)}</dd>`).join('')}</dl>`
|
|
202
293
|
: '<div class=scp-note>Section dimensions and weight are unavailable for this catalog entry.</div>';
|
|
@@ -411,7 +502,7 @@ export function createCatalogPicker({ kind, catalog, rows, onRetry, document: do
|
|
|
411
502
|
+ `<div class=scp-custom><label for=${modal.id}Custom>Custom material designation</label><div class=row><input data-command-id="steel.catalog-custom#material" id=${modal.id}Custom value="${selected.custom ? esc(selected.value) : ''}" placeholder="e.g. A913-GR.65" autocomplete=off><button data-command-id="steel.catalog-use-custom#material" class=scp-use-custom>Use</button></div></div>`;
|
|
412
503
|
} else {
|
|
413
504
|
const supported = selected.geometrySupported !== false;
|
|
414
|
-
const preview = supported ? schematic(selected
|
|
505
|
+
const preview = supported ? schematic(selected) : '';
|
|
415
506
|
details.innerHTML = `<div class=scp-preview>${preview || '<div class=scp-note>Section preview unavailable for this catalog entry.</div>'}</div><div class=scp-detail-name>${esc(selected.designation)}</div><div class=scp-detail-sub>${selected.current ? 'Current model value · not in this catalog' : esc((catalog?.families || []).find((g) => g.id === selected.family)?.label || selected.family)}</div>${factsHtml(selected)}`
|
|
416
507
|
+ ((selected.aliases || []).length ? `<div class=scp-note style="margin-top:10px">Related catalog names: ${esc(selected.aliases.join(', '))}</div>` : '')
|
|
417
508
|
+ (!supported ? '<div class=scp-warning>This catalog record includes envelope and weight, but not chord or web geometry, so FloLess cannot model this joist faithfully.</div>' : '')
|
|
@@ -4363,13 +4363,21 @@ function _canonDes(s){return String(s==null?'':s).trim().toUpperCase()
|
|
|
4363
4363
|
.replace(/[×✕✖]/g,'X').replace(/[‐-―−]/g,'-').replace(/[‘’ʹ′]/g,"'").replace(/[“”ʺ″]/g,'"')
|
|
4364
4364
|
.replace(/ /g,' ').replace(/(\d)\s+(\d+\/\d+)/g,'$1-$2').replace(/\s+/g,'');}
|
|
4365
4365
|
function _aiscSec(key){return (window.__AISC_SECTIONS||{})[key];}
|
|
4366
|
+
function _profileDimIn(token){
|
|
4367
|
+
const s=String(token).trim();
|
|
4368
|
+
let m=s.match(/^(\d+)(?:\s+|-)(\d+)\/(\d+)$/);
|
|
4369
|
+
if(m){const den=Number(m[3]);if(den===0)return null;const value=Number(m[1])+Number(m[2])/den;return Number.isFinite(value)?value:null;}
|
|
4370
|
+
m=s.match(/^(\d+)\/(\d+)$/);
|
|
4371
|
+
if(m){const den=Number(m[2]);if(den===0)return null;const value=Number(m[1])/den;return Number.isFinite(value)?value:null;}
|
|
4372
|
+
if(!/^\d+(?:\.\d+)?$/.test(s))return null;
|
|
4373
|
+
const value=Number(s);return Number.isFinite(value)?value:null;
|
|
4374
|
+
}
|
|
4366
4375
|
function _parseDoubleAngleIn(profile){
|
|
4367
4376
|
const p=_canonDes(profile);if(!p.startsWith('2L'))return null;
|
|
4368
4377
|
const orientation=p.endsWith('SLBB')?'slbb':p.endsWith('LLBB')?'llbb':null;
|
|
4369
4378
|
const body=p.slice(2).replace(/(LLBB|SLBB)$/,'');
|
|
4370
|
-
const pd=t=>{const s=String(t).trim();if(!/^(?:\d+(?:\.\d+)?|\d+(?:\s+|-)\d+\/\d+|\d+\/\d+)$/.test(s))return null;let mm=s.match(/^(\d+)(?:\s+|-)(\d+)\/(\d+)$/);if(mm)return +mm[1]+ +mm[2]/+mm[3];mm=s.match(/^(\d+)\/(\d+)$/);if(mm)return +mm[1]/+mm[2];const d=Number(s);return isFinite(d)?d:null;};
|
|
4371
4379
|
const toks=body.split('X');if(toks.length!==3&&toks.length!==4)return null;
|
|
4372
|
-
const v=toks.map(
|
|
4380
|
+
const v=toks.map(_profileDimIn);if(v.some(n=>n==null||n<=0)||(!orientation&&Math.abs(v[0]-v[1])>1e-9))return null;
|
|
4373
4381
|
return{d:v[0],b:v[1],t:v[2],gap:toks.length===4?v[3]:0,orientation:orientation||'llbb'};
|
|
4374
4382
|
}
|
|
4375
4383
|
function _profileCatalogRow(profile){return CatalogPicker.resolveProfileCatalogRow(profileCatalogRows,profile);}
|
|
@@ -4389,7 +4397,7 @@ function profileDimsIn(profile){
|
|
|
4389
4397
|
const display=_profileDisplaySectionIn(profile);
|
|
4390
4398
|
if(display&&display.shape==='double-angle'){
|
|
4391
4399
|
return display.orientation==='slbb'
|
|
4392
|
-
?{d:2*display.d+display.gap,
|
|
4400
|
+
?{d:display.b,w:2*display.d+display.gap,round:false}
|
|
4393
4401
|
:{d:display.d,w:2*display.b+display.gap,round:false};
|
|
4394
4402
|
}
|
|
4395
4403
|
if(display&&display.shape==='solid-circle')return{d:display.diameter,w:display.diameter,round:true};
|
|
@@ -4398,8 +4406,11 @@ function profileDimsIn(profile){
|
|
|
4398
4406
|
const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
|
|
4399
4407
|
// parseDim (not parseFloat) so a mixed-fraction leg "3 1/2" or the Manual's "3-1/2" → 3.5, not 3 —
|
|
4400
4408
|
// mirrors server aisc-sections parseDim.
|
|
4401
|
-
const
|
|
4402
|
-
|
|
4409
|
+
const prefix=m[1],key=_canonDes(profile);
|
|
4410
|
+
// Scheduled PIPE names end in STD/XS/XXS rather than a numeric diameter token. Resolve their
|
|
4411
|
+
// table-backed outside diameter before the strict numeric-token guard below; NPS is not the OD.
|
|
4412
|
+
if(prefix==='PIPE'){const sec=_aiscSec(key);if(sec)return{d:sec[0],w:sec[1],round:true};}
|
|
4413
|
+
const nums=m[2].split('X').map(_profileDimIn).filter(n=>n!=null);
|
|
4403
4414
|
if(!nums.length)return null;
|
|
4404
4415
|
// The TABLE answers first — the name is only as good as the glyphs it was typed with. `p` folds the
|
|
4405
4416
|
// multiplication sign but not the dash class, so an en-dashed "L5X3–1/2X1/4" (what OCR and vision
|
|
@@ -4413,7 +4424,7 @@ function profileDimsIn(profile){
|
|
|
4413
4424
|
// w x d implies — 41% too big across the corners. This mirror omitted it, so the 2D plan drew every pipe
|
|
4414
4425
|
// square while the bake measured a circle. Same token-count rule as the server: THREE tokens is a
|
|
4415
4426
|
// rectangular HSS/TUBE (above), TWO is a round one.
|
|
4416
|
-
if(prefix==='PIPE')
|
|
4427
|
+
if(prefix==='PIPE')return{d:nums[0],w:nums[0],round:true};
|
|
4417
4428
|
if(prefix==='HSS'){const dia=nums[0];return{d:dia,w:dia,round:true};}
|
|
4418
4429
|
if(/^(W|S|M|HP|C|MC|WT|ST|MT)$/.test(prefix)){
|
|
4419
4430
|
// ACTUAL AISC depth+width when tabulated (the leading number is the NOMINAL series depth). Mirrors
|
|
@@ -4471,16 +4482,14 @@ function profileThkIn(profile){
|
|
|
4471
4482
|
// LLBB/SLBB suffix is orientation. This is the same designation source used by server parseDoubleAngle.
|
|
4472
4483
|
if(p.startsWith('2L')){
|
|
4473
4484
|
const body=p.slice(2).replace(/(LLBB|SLBB)$/,'');
|
|
4474
|
-
const
|
|
4475
|
-
const toks=body.split('X').map(_pd);
|
|
4485
|
+
const toks=body.split('X').map(_profileDimIn);
|
|
4476
4486
|
return toks.length>=3&&toks[2]>0?{t:toks[2]}:null;
|
|
4477
4487
|
}
|
|
4478
4488
|
const m=p.match(/^([A-Z]+)\s*(.+)$/);if(!m)return null;
|
|
4479
4489
|
const prefix=m[1],sec=_aiscSec(_canonDes(profile));
|
|
4480
4490
|
// parseDim, not parseFloat: a fractional thickness token is the WHOLE point here, and parseFloat('3/8')
|
|
4481
4491
|
// is 3 — a 3" leg on a 4" angle. Same fold and same parse as profileDimsIn above.
|
|
4482
|
-
const
|
|
4483
|
-
const toks=m[2].split('X').map(_pd);
|
|
4492
|
+
const toks=m[2].split('X').map(_profileDimIn);
|
|
4484
4493
|
if(prefix==='L'){
|
|
4485
4494
|
return toks.length>=3&&toks[2]>0?{t:toks[2]}:null; // A×B×t
|
|
4486
4495
|
}
|