@floless/app 0.172.0 → 0.172.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 +16893 -12178
- package/dist/schemas/drawing-check.profile.v1.schema.json +7 -1
- package/dist/skills/floless-app-steel-model/SKILL.md +2 -2
- package/dist/skills/floless-app-steel-model/references/elements.md +45 -5
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +6 -2
- package/dist/web/app.css +62 -0
- package/dist/web/aware.js +34 -3
- package/dist/web/chat.js +19 -1
- package/dist/web/commands-drawing-check.js +2 -0
- package/dist/web/commands-shell.js +34 -0
- package/dist/web/commands-steel.js +50 -0
- package/dist/web/drawing-check-editor.html +9 -0
- package/dist/web/drawing-check-editor.js +127 -14
- package/dist/web/element-plan.js +98 -0
- package/dist/web/index.html +24 -0
- package/dist/web/instructor.js +1 -0
- package/dist/web/model-elements.js +256 -15
- package/dist/web/pdf-active-content.js +38 -0
- package/dist/web/steel-3d-view.js +5 -1
- package/dist/web/steel-ai-marks.js +19 -3
- package/dist/web/steel-catalog-picker.js +7 -2
- package/dist/web/steel-editor.html +164 -14
- package/dist/web/steel-profile-card-state.js +378 -0
- package/dist/web/steel-profile-card.js +778 -0
- package/dist/web/steel-shape-sketch-core.js +380 -0
- package/dist/web/steel-shape-sketcher.js +595 -0
- package/dist/web/workspaces.js +340 -26
- package/package.json +2 -1
|
@@ -404,6 +404,15 @@
|
|
|
404
404
|
#cutBanner button:focus-visible,#cutPill:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}
|
|
405
405
|
#cutBanner button.cutprimary{border-color:var(--brand);color:var(--brand)}
|
|
406
406
|
#cutPill.on{display:inline-flex;align-items:center;background:var(--panel);border-radius:999px;padding:3px 10px}
|
|
407
|
+
/* #3296 E1b: walls, slabs and footings on a plan, under the steel, in the muted ink both themes already have (no new
|
|
408
|
+
colour). One that FloLess does not count is dashed and hatched, never drawn as checked. */
|
|
409
|
+
.elem-plan path{fill:var(--mut);fill-opacity:.16;stroke:var(--mut);stroke-width:1.25;stroke-linejoin:round;vector-effect:non-scaling-stroke;fill-rule:evenodd}
|
|
410
|
+
.elem-plan path:hover{fill-opacity:.26}
|
|
411
|
+
.elem-plan path.held{fill:url(#elemHeldHatch);fill-opacity:1;stroke-dasharray:6 4}
|
|
412
|
+
.elem-plan .elem-hatch line{stroke:var(--mut);stroke-width:1;opacity:.55;vector-effect:non-scaling-stroke}
|
|
413
|
+
/* Above #bottomDock (bottom 12px, its bars 36px tall) like .ai-strip; lifted over that strip when it shows (paintElementPlanNote). */
|
|
414
|
+
#elemPlanNote{position:absolute;left:12px;bottom:56px;z-index:57;max-width:min(460px,calc(100% - 24px));background:var(--panel);border:1px solid var(--line);border-radius:8px;color:var(--mut);padding:5px 10px;font:12px/1.45 var(--ui);box-shadow:0 4px 14px rgba(0,0,0,.25);pointer-events:none}
|
|
415
|
+
#elemPlanNote[hidden]{display:none}
|
|
407
416
|
#cutForm{margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}
|
|
408
417
|
#cutForm[hidden]{display:none}
|
|
409
418
|
#cutForm .cutlab{display:block;color:var(--text);margin-bottom:4px}
|
|
@@ -2080,6 +2089,13 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
2080
2089
|
#panel .mp-bar span{display:block;height:100%;background:var(--brand)}
|
|
2081
2090
|
#panel .mp-intro{margin:8px 0 0;font-size:11px;line-height:1.45;color:var(--mut)}
|
|
2082
2091
|
#panel .mp-banner{margin-top:8px;padding:6px 8px;border:1px solid var(--warn-edge);border-radius:5px;font-size:11.5px;line-height:1.45;color:var(--text)}
|
|
2092
|
+
/* #3646: the files left for later that carry scripts or other active content (the amber banner), or could not be checked
|
|
2093
|
+
(a muted line under the neutral rule). Said outside the file chooser, so one file, or a folded list, still says it. */
|
|
2094
|
+
#panel .mp-active p{margin:0}
|
|
2095
|
+
#panel .mp-active p+p{margin-top:4px}
|
|
2096
|
+
#panel .mp-active b{font-weight:600;overflow-wrap:anywhere}
|
|
2097
|
+
#panel .hint.mp-active{margin-top:8px;padding-left:8px;border-left:2px solid var(--line)}
|
|
2098
|
+
.chip.active-content{border-color:var(--warn-edge);color:var(--text)}
|
|
2083
2099
|
#panel .mp-ghead{display:flex;align-items:baseline;justify-content:space-between;gap:6px 8px;flex-wrap:wrap}
|
|
2084
2100
|
#panel .mp-ghead button{font-size:11px;padding:3px 8px}
|
|
2085
2101
|
#panel .mp-gtitle{margin:0;font-size:12px;font-weight:600;line-height:1.4;color:var(--text);text-transform:none;letter-spacing:0}
|
|
@@ -3242,6 +3258,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
3242
3258
|
<script src="overlay-escape.js"></script>
|
|
3243
3259
|
<script src="flo.js"></script>
|
|
3244
3260
|
<script src="flo-card.js"></script>
|
|
3261
|
+
<script src="pdf-active-content.js"></script>
|
|
3245
3262
|
<script type="importmap">{"imports":{"three":"./vendor/three.module.js","three/addons/":"./vendor/","three-bvh-csg":"./vendor/three-bvh-csg.module.js"}}</script>
|
|
3246
3263
|
<script type="module" src="./steel-3d-view.js"></script>
|
|
3247
3264
|
<!-- grid-core is an ES module; the editor's classic script reaches it via window.GridCore (set before
|
|
@@ -3258,6 +3275,7 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
3258
3275
|
selection, the measurement — belongs to this page's classic script. -->
|
|
3259
3276
|
<script type="module">import * as RS from './reference-session.js';window.ReferenceSession=RS;</script>
|
|
3260
3277
|
<script type="module">import * as FU from './steel-filter-usage.js';window.SteelFilterUsage=FU;</script>
|
|
3278
|
+
<script type="module">import { installShapeSketcher } from './steel-shape-sketcher.js';installShapeSketcher();</script>
|
|
3261
3279
|
<link rel="stylesheet" href="./steel-change-review.css">
|
|
3262
3280
|
</head><body class=steel-model-editor>
|
|
3263
3281
|
<header>
|
|
@@ -3537,6 +3555,9 @@ text.mlentx{fill:#e2e8f0;text-anchor:middle;dominant-baseline:central;font-famil
|
|
|
3537
3555
|
</form>
|
|
3538
3556
|
</div>
|
|
3539
3557
|
<button data-command-id="steel.cut-banner-show" id=cutPill type=button data-tip="This sheet has no floor level. Open the notice.">No floor level</button>
|
|
3558
|
+
<!-- #3296 E1b: why this view shows none of the model's walls, slabs and footings (no level, a registration that does
|
|
3559
|
+
not hold, or an elevation). Status only: nothing to click. -->
|
|
3560
|
+
<div id=elemPlanNote role=status aria-live=polite hidden></div>
|
|
3540
3561
|
<!-- The 2D VIEW band (#1428): the same two view controls the 3D band leads with, in the same corner, with
|
|
3541
3562
|
the same glyphs and the same words, so the plan and the model read as one editor. It replaced the
|
|
3542
3563
|
bottom-left zoom bar (−/slider/+/percent/Fit) — the tester asked for parity with 3D, which has no
|
|
@@ -4442,6 +4463,7 @@ let ViewGen = null; // steel-view-generation.js pure F11 helpers — loaded befo
|
|
|
4442
4463
|
let ModelCmd = null; // steel-model-commands.js — the model boundary's WRITE half (unit 5, P3a); the read half is steel-model-adapter.js
|
|
4443
4464
|
let AiMarks = null; // steel-ai-marks.js (#2521 row 6): which members rest on an AI decision
|
|
4444
4465
|
let CustomConn = null; // steel-custom-connection.js (#2303 slice A): what Inspect says about a custom connection built from standard parts
|
|
4466
|
+
let ProfileCard = null; // steel-profile-card.js (#3382 P2): the card beside every Profile field
|
|
4445
4467
|
let ViewRefs = null; // steel-view-refs.js (#3594): a saved view's isolation and part hides as the contract's tagged refs, never as 3D mesh ids
|
|
4446
4468
|
let V2Projection = null, V2Commands = null, V2Validation = null, FilterCore = null, ProfileColours = null, ReferenceSheet = null, ReadConfidence = null, CustomSections = null;
|
|
4447
4469
|
let ChatQuestions = null; // model-chat-questions.js — the Questions in chat card and chat labels, shared with every model viewer
|
|
@@ -4457,6 +4479,7 @@ function legendBody(key){
|
|
|
4457
4479
|
views:document.getElementById('m3dViewsBody'),fav:document.getElementById('m3dFavBody'),refs:document.getElementById('m3dRefsBody')};
|
|
4458
4480
|
return legendBodies[key];
|
|
4459
4481
|
}
|
|
4482
|
+
let ElementPlan = null; // element-plan.js — which walls, slabs and footings a plan shows, in its own pixels (#3296 E1b)
|
|
4460
4483
|
let PlanXf = null; // steel-plan-transform.js — the px↔world registration boundary. Already in the module graph (V2Projection imports it); named here so the classic script can read a sheet's registration angle and fit scale when it draws a rolled section footprint.
|
|
4461
4484
|
let SteelEnv = null; // steel-environments.js — the ONE registry of steel-environment TRAITS (units, shapes route, scale grammar, default grade, catalogue noun…). Every behaviour that differs by standard reads a trait from it; nothing on this page compares an environment id. Dynamic import for the same reason DisplayUnits is one.
|
|
4462
4485
|
let CkStd = null; // checkpoint-standard.js — the ONE place a steel standard is named for a reader. A
|
|
@@ -5212,7 +5235,7 @@ async function boot() {
|
|
|
5212
5235
|
if (!APP_ID) { showEmpty('⊞', 'No workflow selected', 'Open a workflow in the FloLess canvas, then open the contract editor from that workflow’s node.'); return; }
|
|
5213
5236
|
armEarlyViewToggle(); // BEFORE the first await — that is the whole point; see above
|
|
5214
5237
|
startContractEvents(); // subscribe first; contract events buffer until the atomic snapshot is installed
|
|
5215
|
-
[DisplayUnits, GridDisplay, SteelCore, ViewGen, ModelCmd, DetailRefs, V2Projection, V2Commands, V2Validation, SplitView, FilterCore, PlanXf, CatalogPicker, ModelEditor, ViewportToolbar, ModelLighting, PointerDock, EditorShell, ReviewClient, ProfileColours, ReferenceSheet, ReadConfidence, CkStd, SteelEnv, ModelPanelBridge, ChatQuestions, SteelSlim, LastSeen, MarksCore, FramesCore, AiMarks, CustomSections, CustomConn, ViewRefs] = await Promise.all([
|
|
5238
|
+
[DisplayUnits, GridDisplay, SteelCore, ViewGen, ModelCmd, DetailRefs, V2Projection, V2Commands, V2Validation, SplitView, FilterCore, PlanXf, CatalogPicker, ModelEditor, ViewportToolbar, ModelLighting, PointerDock, EditorShell, ReviewClient, ProfileColours, ReferenceSheet, ReadConfidence, CkStd, SteelEnv, ModelPanelBridge, ChatQuestions, SteelSlim, LastSeen, MarksCore, FramesCore, AiMarks, CustomSections, CustomConn, ElementPlan, ViewRefs, ProfileCard] = await Promise.all([
|
|
5216
5239
|
import('./display-units.js'), import('./grid-display.js'),
|
|
5217
5240
|
import('./steel-3d-core.js'), import('./steel-view-generation.js'), import('./steel-model-commands.js'),
|
|
5218
5241
|
import('./steel-detail-refs.js'), import('./steel-model-v2-projection.js'),
|
|
@@ -5226,7 +5249,9 @@ async function boot() {
|
|
|
5226
5249
|
import('./steel-model-slim.js'), import('./steel-last-seen.js'), import('./steel-marks-core.js'), import('./steel-frames-core.js'), import('./steel-ai-marks.js'),
|
|
5227
5250
|
import('./steel-custom-sections.js'),
|
|
5228
5251
|
import('./steel-custom-connection.js'),
|
|
5252
|
+
import('./element-plan.js'),
|
|
5229
5253
|
import('./steel-view-refs.js'),
|
|
5254
|
+
import('./steel-profile-card.js'),
|
|
5230
5255
|
]);
|
|
5231
5256
|
({ FT_TO_MM, IN_TO_MM, LB_PER_FT_TO_KG_PER_M } = SteelCore); // the shared unit constants, bound before main() and every reader of them
|
|
5232
5257
|
// BEFORE the first paint, deliberately. Every length on this page reads through it, so resolving it
|
|
@@ -5889,6 +5914,9 @@ function seeChangesFromOpenTab(opener) { openChangeList({ situation: 'B', baseTa
|
|
|
5889
5914
|
|
|
5890
5915
|
function main(bootRecordedBase) {
|
|
5891
5916
|
let P, X0,Y0,X1,Y1, FT, RB64, EXTX, EXTY, profs, NO_PLAN_VIEW=false; // per-plan, set by setPlan()
|
|
5917
|
+
// The sheet's own rectangle (its raster and backdrop are drawn there). X0..Y1 is the VIEW, which can grow past it to
|
|
5918
|
+
// frame walls, slabs and footings drawn beyond the steel (#3296 E1b).
|
|
5919
|
+
let SHEET=[0,0,1000,1000];
|
|
5892
5920
|
let v2IdSeq=0;
|
|
5893
5921
|
/* #2521 row 6: what rests on an AI decision, marked on the canvas, in 3D and in Inspect, with one strip for what cannot
|
|
5894
5922
|
be marked. Plan: docs/superpowers/specs/2026-10-29-quick-model-row6-PLAN.md (Revisions 1 and 2). The analysis
|
|
@@ -6606,7 +6634,9 @@ function mpRestHtml(state){
|
|
|
6606
6634
|
h+=`<div class=mp-rest-list id=mpRestList role=group aria-label="Files to read">`;
|
|
6607
6635
|
for(const f of r.files){
|
|
6608
6636
|
const miss=rs.missing.includes(f.sha256);
|
|
6609
|
-
|
|
6637
|
+
const ac=globalThis.flolessActiveContent,acBody=f.activeContent; // #3646: its sentence is in the summary above
|
|
6638
|
+
const acChip=ac&&ac.shows(acBody)?` <span class="chip${ac.isFinding(acBody)?' active-content':''}" data-tip="${esc(acBody.tip||acBody.note)}">${esc(acBody.label)}</span>`:'';
|
|
6639
|
+
h+=`<label class=mp-rest-file><input type=checkbox data-mp-rest-file="${esc(f.sha256)}" data-mp-key="rf:${esc(f.sha256)}" data-command-id="steel.make-precise-read-rest-file#${esc(f.sha256)}" data-command-instance-label="${esc(f.name)}"${rs.chosen.has(f.sha256)?' checked':''}${dis}> <span>${esc(f.name)}</span>${miss?' <span class="chip assumed">Copy missing</span>':''}${acChip}</label>`;
|
|
6610
6640
|
}
|
|
6611
6641
|
h+='</div>';
|
|
6612
6642
|
}
|
|
@@ -6675,11 +6705,38 @@ async function mpRestQueue(state){
|
|
|
6675
6705
|
}
|
|
6676
6706
|
state.live=same?'':rs.msg+moved;state.focus={key:'rest'};panel(); // same offer: said in the section, as a status or an alert
|
|
6677
6707
|
}
|
|
6708
|
+
/* #3646: the files left for later that carry scripts or other active content, or could not be checked, said outside the
|
|
6709
|
+
chooser: a single file has no row, and the list is folded by default. FloLess keeps every one unchanged; nothing shows
|
|
6710
|
+
for a file that carries none. Whole files and the pages a Quick read left for later alike are checked on their own bytes. */
|
|
6711
|
+
function mpRestActiveHtml(state){
|
|
6712
|
+
const r=state.review&&state.review.readRest,ac=globalThis.flolessActiveContent;
|
|
6713
|
+
if(!r||!Array.isArray(r.files)||!r.files.length||!ac)return'';
|
|
6714
|
+
const entries=r.files.map(f=>({name:f.name,view:f.activeContent})).filter(e=>ac.shows(e.view));
|
|
6715
|
+
const said=(list,cls)=>{const {lines,more}=ac.linesOf(list);return lines.length?`<div class="${cls} mp-active" role=note>${lines.map(l=>`<p><b>${esc(l.name)}</b>: ${esc(l.note)}</p>`).join('')}${more.length?`<p>${esc(ac.moreText(more))}</p>`:''}</div>`:'';};
|
|
6716
|
+
return said(entries.filter(e=>ac.isFinding(e.view)),'mp-banner')+said(entries.filter(e=>!ac.isFinding(e.view)),'hint');
|
|
6717
|
+
}
|
|
6718
|
+
/* #3646: a file left for later whose answer can still change (being checked, not checked, or not read in full) when the
|
|
6719
|
+
panel was read. The server says an answer changed with the project's knowledge-changed event, relayed here by the
|
|
6720
|
+
workspace: the panel then reads again, keeping what it shows meanwhile; while it is busy, once it is done. */
|
|
6721
|
+
function mpActiveContentChanged(m){
|
|
6722
|
+
if(!m||m.type!=='floless:project-event'||m.projectId!==PROJECT||!m.frame||m.frame.type!=='knowledge-changed'||m.frame.projectId!==PROJECT)return;
|
|
6723
|
+
const state=makePrecise,r=state&&state.review&&state.review.readRest;
|
|
6724
|
+
const open=v=>!!v&&!(v.state==='found'&&v.complete===true);
|
|
6725
|
+
if(!r||!Array.isArray(r.files)||!r.files.some(f=>open(f.activeContent)))return;
|
|
6726
|
+
if(state.acAgain)return; // one read is already waiting for the panel to be free
|
|
6727
|
+
state.acAgain=true;
|
|
6728
|
+
const again=()=>{if(makePrecise!==state)return;if(state.busy){setTimeout(again,1000);return;}state.acAgain=false;void mpLoad(true);};
|
|
6729
|
+
again();
|
|
6730
|
+
}
|
|
6731
|
+
window.addEventListener('message',e=>{
|
|
6732
|
+
if(e.origin!==location.origin||!window.parent||window.parent===window||e.source!==window.parent)return;
|
|
6733
|
+
mpActiveContentChanged(e.data);
|
|
6734
|
+
});
|
|
6678
6735
|
/* The block on its own, when no Files read decision is left to review: what is still not read, and Read the rest. */
|
|
6679
6736
|
function mpRestSection(state){
|
|
6680
6737
|
const r=state.review&&state.review.readRest;if(!r)return'';
|
|
6681
6738
|
const sentence=mpRestSentence(r);
|
|
6682
|
-
return`<section class="mer-group mp-group" aria-labelledby=mpGRest><div class=mp-ghead><h3 class=mp-gtitle id=mpGRest>Files left for later</h3></div>${sentence?`<p class=mp-cons>${esc(sentence)}</p>`:''}${mpRestHtml(state)}</section>`;
|
|
6739
|
+
return`<section class="mer-group mp-group" aria-labelledby=mpGRest><div class=mp-ghead><h3 class=mp-gtitle id=mpGRest>Files left for later</h3></div>${sentence?`<p class=mp-cons>${esc(sentence)}</p>`:''}${mpRestActiveHtml(state)}${mpRestHtml(state)}</section>`;
|
|
6683
6740
|
}
|
|
6684
6741
|
function mpRestSentence(r){
|
|
6685
6742
|
const names=(r.files||[]).map(f=>f.name);if(!names.length)return'';
|
|
@@ -6721,7 +6778,7 @@ function renderMakePrecisePanel(p){
|
|
|
6721
6778
|
}
|
|
6722
6779
|
html+=`<section class="mer-group mp-group" aria-labelledby="mpG${gi}"><div class=mp-ghead><h3 class=mp-gtitle id="mpG${gi}">${gl} <span class=mp-gcount>· ${g.items.length} to review</span></h3>${act}</div>`;
|
|
6723
6780
|
if(g.consequence)html+=`<p class=mp-cons>${esc(g.consequence)}</p>`;
|
|
6724
|
-
if(g.id==='scope'&&review.readRest)html+=mpRestHtml(state);
|
|
6781
|
+
if(g.id==='scope'&&review.readRest)html+=mpRestActiveHtml(state)+mpRestHtml(state);
|
|
6725
6782
|
for(const c of items){
|
|
6726
6783
|
const which=twin.get(c.decisionId)||'';
|
|
6727
6784
|
const id=esc(c.decisionId),changed=state.changed.has(c.decisionId),q0=c.question||c.chosen||'An AI decision';
|
|
@@ -7175,6 +7232,44 @@ function elevationDisarmTools(){
|
|
|
7175
7232
|
/** An elevation's grid lines (vertical, with their bubbles) and levels (horizontal, labelled). Passive: nothing here is
|
|
7176
7233
|
* hit-tested, dragged or renamed — the bubbles reuse the plan grid's group so a zoom resizes them and a crowd of them
|
|
7177
7234
|
* declutters the same way, but carry none of its drag/rename attributes. */
|
|
7235
|
+
/* #3296 E1b: walls, slabs and footings on the plan. The server works them out (the same results the 3D view, the bill
|
|
7236
|
+
and the files use) and sends their outlines in world mm; element-plan.js picks the ones this plan's cut meets and
|
|
7237
|
+
turns them into its pixels through the sheet's own registration. Fetched again only when the model's elements change
|
|
7238
|
+
(a reload replaces the list); a failed read draws none and says so. */
|
|
7239
|
+
let elemFootprints=null,elemFootprintsSrc=null,elemFootprintsError=false,elemPlanLeftOut=null;
|
|
7240
|
+
function refreshElementFootprints(){
|
|
7241
|
+
const list=C&&Array.isArray(C.elements)?C.elements:null;
|
|
7242
|
+
if(list===elemFootprintsSrc)return;
|
|
7243
|
+
elemFootprintsSrc=list;elemFootprintsError=false;elemPlanLeftOut=null;
|
|
7244
|
+
if(!list||!list.length||!PROJECT_QS){elemFootprints=null;return;}
|
|
7245
|
+
const asked=list;
|
|
7246
|
+
fetch('/api/contract/'+encodeURIComponent(APP_ID)+'/elements/evaluate'+PROJECT_QS+'&footprints=1',{method:'POST',headers:{'content-type':'application/json'},body:'{}'})
|
|
7247
|
+
.then(r=>r.ok?r.json():Promise.reject(new Error('HTTP '+r.status)))
|
|
7248
|
+
.then(body=>{if(elemFootprintsSrc!==asked)return;elemFootprints=Array.isArray(body&&body.footprints)?body.footprints:[];elemPlanLeftOut=body&&body.planLeftOut&&typeof body.planLeftOut.sentence==='string'?body.planLeftOut.sentence:null;render();})
|
|
7249
|
+
.catch(err=>{if(elemFootprintsSrc!==asked)return;console.warn('[steel] walls, slabs and footings could not be read for the plan: '+(err&&err.message||err));elemFootprints=null;elemFootprintsError=true;paintElementPlanNote(null);});
|
|
7250
|
+
}
|
|
7251
|
+
function paintElementPlanNote(note){
|
|
7252
|
+
const el=document.getElementById('elemPlanNote');if(!el)return;
|
|
7253
|
+
const text=elemFootprintsError?'Walls, slabs and footings could not be read for this plan, so none is shown. Reopen the model to try again.':(note||'');
|
|
7254
|
+
el.textContent=text;el.hidden=!text||view3d||NO_PLAN_VIEW;
|
|
7255
|
+
if(!el.hidden){const strip=document.querySelector('.ai-strip:not([hidden])');const h=strip&&strip.offsetParent===el.offsetParent?strip.offsetHeight:0;el.style.bottom=(56+(h?h+8:0))+'px';}}
|
|
7256
|
+
function elementsPlanSvg(){
|
|
7257
|
+
refreshElementFootprints();
|
|
7258
|
+
if(!ElementPlan||!elemFootprints||NO_PLAN_VIEW){paintElementPlanNote(null);return '';}
|
|
7259
|
+
// The elements it cannot draw are named whether or not anything else is drawn (never a silent drop).
|
|
7260
|
+
if(!elemFootprints.length){paintElementPlanNote(ElementPlan.elementPlanNote({leftOut:elemPlanLeftOut}));return '';}
|
|
7261
|
+
const plan={...P,modelGrid:C.grid};
|
|
7262
|
+
const res=ElementPlan.elementPlanShapes(elemFootprints,P,(x,y)=>PlanXf.worldToSheetPx({x,y,z:{unknown:true}},plan));
|
|
7263
|
+
// The note always says what the fit check does not cover yet: nothing on a plan reads as fitting.
|
|
7264
|
+
paintElementPlanNote(ElementPlan.elementPlanNote({cutNote:res.note,leftOut:elemPlanLeftOut,shown:res.shapes.length}));
|
|
7265
|
+
// The view frames what it draws: elements past the steel grow it (never shrink it), so the first view, Fit and Home
|
|
7266
|
+
// bring them in. The sheet's backdrop stays at the sheet (SHEET); re-fit once, after this render, when it grew.
|
|
7267
|
+
const grown=ElementPlan.planExtentWith([X0,Y0,X1,Y1],res.bounds);
|
|
7268
|
+
if(grown){[X0,Y0,X1,Y1]=grown;EXTX=X1-X0;EXTY=Y1-Y0;svg.setAttribute('viewBox',`${X0} ${Y0} ${X1-X0} ${Y1-Y0}`);queueMicrotask(fitToWindow);}
|
|
7269
|
+
if(!res.shapes.length)return '';
|
|
7270
|
+
let out='<g class=elem-plan><defs><pattern id=elemHeldHatch class=elem-hatch patternUnits=userSpaceOnUse width=8 height=8 patternTransform="rotate(45)"><line x1=0 y1=0 x2=0 y2=8 /></pattern></defs>';
|
|
7271
|
+
for(const sh of res.shapes)out+=`<path class="elem${sh.held?' held':''}" data-element="${esc(sh.id)}" d="${sh.d}" data-tip="${esc(sh.tip)}"/>`;
|
|
7272
|
+
return out+'</g>';}
|
|
7178
7273
|
function elevationFrameSvg(){
|
|
7179
7274
|
const v=P&&P.elevationView;if(!v||!v.ok||!(v.gridLines.length||v.levels.length))return '';
|
|
7180
7275
|
const ys=[...v.levels.map(l=>l.py),...P.members.flatMap(m=>[m.wp[0][1],m.wp[1][1]])],xs=[...v.gridLines.map(l=>l.px),...P.members.flatMap(m=>[m.wp[0][0],m.wp[1][0]])];
|
|
@@ -8447,8 +8542,8 @@ function apply(json,noSave){
|
|
|
8447
8542
|
// An undo steps back through an action; it is not one. So a pending question about a new moment-frame girder's automatic plates is dropped here (and a Ctrl+Z of
|
|
8448
8543
|
// Remove must not bring it back). A redo needs no line of its own: it is only possible after an undo, and nothing can ask in between (an edit empties the redo stack).
|
|
8449
8544
|
// Not in apply(): a refused edit and a cancelled gesture restore through apply() too, and neither answers the question.
|
|
8450
|
-
function rawUndo(){if(!undo.length)return;mfOfferClose();return runSteelAuthoring('undo',{source:'history'},()=>{redo.push(snapshotLike());apply(undo.pop());});}
|
|
8451
|
-
function rawRedo(){if(!redo.length)return;return runSteelAuthoring('redo',{source:'history'},()=>{undo.push(snapshotLike());apply(redo.pop());});}
|
|
8545
|
+
function rawUndo(){profileCardEndPreview();if(!undo.length)return;mfOfferClose();return runSteelAuthoring('undo',{source:'history'},()=>{redo.push(snapshotLike());apply(undo.pop());});}
|
|
8546
|
+
function rawRedo(){profileCardEndPreview();if(!redo.length)return;return runSteelAuthoring('redo',{source:'history'},()=>{undo.push(snapshotLike());apply(redo.pop());});}
|
|
8452
8547
|
// Undo and redo go through the shared history when it holds a step (Sketches S1b), else straight to the model's own.
|
|
8453
8548
|
function doUndo(){const h=window.SketchEditor&&window.SketchEditor.history;if(h&&h.state().canUndo){try{h.undo();}catch(e){toast(errorText(e,{action:'undo that step'}));}updUR();return;}return rawUndo();}
|
|
8454
8549
|
function doRedo(){const h=window.SketchEditor&&window.SketchEditor.history;if(window.SketchEditor&&window.SketchEditor.redoWaits&&window.SketchEditor.redoWaits())return;if(h&&h.state().canRedo){try{h.redo();}catch(e){toast(errorText(e,{action:'redo that step'}));}updUR();return;}return rawRedo();}
|
|
@@ -8474,6 +8569,7 @@ function editGridTopology(fn){
|
|
|
8474
8569
|
toast('Re-spacing changes which grid lines exist, so it goes through a reviewed model update — ask your terminal AI to change the grid.');
|
|
8475
8570
|
}
|
|
8476
8571
|
function edit(fn){
|
|
8572
|
+
profileCardEndPreview(); // a card preview is the model put on loan: any real edit starts from the saved state
|
|
8477
8573
|
// The stale-draft offer stops being safe the moment they build on the CURRENT version instead: clicking
|
|
8478
8574
|
// "Show my earlier edits" afterwards would overlay the old edits on top of this new work and discard it
|
|
8479
8575
|
// silently. Only that banner is dismissed — the AI-update and conflict bars MUST survive edits, which is
|
|
@@ -8595,7 +8691,7 @@ function sanitizeViews(arr){return ViewGen.sanitizeViews(arr);}
|
|
|
8595
8691
|
function draftRootKeys(){return ['members','grid','custom_details','profile_colors','member_styles','member_types','target_confidence','dims3d','dim_overlays','dim_style','prop_labels','joints','connections','detail_placements','views',...((V2Commands&&V2Commands.CUSTOM_SECTION_ROOT_KEYS)||[]),...((V2Commands&&V2Commands.ANNOTATION_ROOT_KEYS)||[])];}
|
|
8596
8692
|
// Set once the person changes or resets the "columns below a floor" setting on this page, or a restored draft carried a Reset.
|
|
8597
8693
|
let reachTouched=false;
|
|
8598
|
-
function persist(){try{const draft={sig:dataSig(),baseEtag:serverEtag,ts:Date.now(),active:C.active};
|
|
8694
|
+
function persist(){profileCardEndPreview();try{const draft={sig:dataSig(),baseEtag:serverEtag,ts:Date.now(),active:C.active};
|
|
8599
8695
|
// `column_below_reach_mm` is saved as `null` when the model has none AND the person touched it: a missing key in a draft means
|
|
8600
8696
|
// "not touched", so a Reset (the key taken away) would otherwise come back from the server's copy on the next restore. A model
|
|
8601
8697
|
// nobody touched writes no key, so its draft keeps master's bytes (#2209's recorded traces pin them).
|
|
@@ -8797,7 +8893,7 @@ function applyRevalidation(rv){
|
|
|
8797
8893
|
// This replaced a client-side merge (fingerprints, ownership rules, etag-generation heuristics) that four
|
|
8798
8894
|
// adversarial review rounds kept finding concurrency bugs in: reconciling a server-authoritative transform
|
|
8799
8895
|
// against a concurrently-edited local copy is a CRDT-class problem, and the way to win it was not to play.
|
|
8800
|
-
async function persistServer(force,token){const seq=saveSeq;
|
|
8896
|
+
async function persistServer(force,token){profileCardEndPreview();const seq=saveSeq;
|
|
8801
8897
|
// Once conflicted, stop firing doomed PUTs; re-surface the explanation instead of hammering the
|
|
8802
8898
|
// network every debounce tick. Cleared only by a reload or a confirmed overwrite.
|
|
8803
8899
|
if(conflicted&&!force){showConflictBanner();return;}
|
|
@@ -8891,6 +8987,7 @@ flushLocalDraft = () => persist(); // the RESULT is load-bearing at the call s
|
|
|
8891
8987
|
* promise, so widening the resolution value breaks nothing.
|
|
8892
8988
|
*/
|
|
8893
8989
|
async function flushContractWith(token, signal) {
|
|
8990
|
+
profileCardEndPreview(); // Approve, Ctrl+S and every other flush save the model as it was before a card preview, never the preview
|
|
8894
8991
|
clearTimeout(saveT); saveT = null; saveWritesInFlight++; publishContractSaveState(); // the debounced write is being taken over by this flush, so it is no longer pending
|
|
8895
8992
|
// Behind the SAME queue as autosave — Approve awaits this, and a flush racing an in-flight autosave
|
|
8896
8993
|
// was the self-conflict path that could abort Approve for no reason.
|
|
@@ -9944,15 +10041,16 @@ function rasterImageSvg(r){const b=r.rect;return `<image class=pdfref aria-hidde
|
|
|
9944
10041
|
function overlaySvg(){
|
|
9945
10042
|
if(!refSheetOn)return ''; // F13: reference sheet hidden → draw neither the raster/vector linework NOR the white pdfsheet backdrop
|
|
9946
10043
|
const rr=reviewedRaster(),d0=drawablePlan();
|
|
9947
|
-
|
|
9948
|
-
|
|
10044
|
+
const [SX0,SY0,SX1,SY1]=SHEET; // the sheet, not the view: the view may have grown to frame elements beyond it
|
|
10045
|
+
let out=rr.ok?`<rect class=pdfsheet x="${SX0}" y="${SY0}" width="${SX1-SX0}" height="${SY1-SY0}"/>${rasterImageSvg(rr)}`:'';
|
|
10046
|
+
if(!d0)return out||(RB64?`<image href="data:image/jpeg;base64,${RB64}" x="${SX0}" y="${SY0}" width="${SX1-SX0}" height="${SY1-SY0}"/>`:''); // legacy scanned plan: only when no reviewed Filter raster resolves
|
|
9949
10047
|
if(!d0.renders)return out; // no drawable vectors means no path and no snap geometry; a reviewed raster may still provide inert printed context
|
|
9950
10048
|
const els=d0.els;
|
|
9951
10049
|
let d='',circ='';
|
|
9952
10050
|
for(const e of els){if(!e)continue;
|
|
9953
10051
|
if(e.kind==='line'){if(typeof e.d==='string'&&e.d)d+=e.d+' ';else if(e.x1!=null&&e.x2!=null)d+=`M${e.x1} ${e.y1}L${e.x2} ${e.y2}`;}
|
|
9954
10052
|
else if(e.kind==='circle'&&e.r>0)circ+=`<circle cx="${e.cx}" cy="${e.cy}" r="${e.r}"/>`;}
|
|
9955
|
-
if(!out)out=`<rect class=pdfsheet x="${
|
|
10053
|
+
if(!out)out=`<rect class=pdfsheet x="${SX0}" y="${SY0}" width="${SX1-SX0}" height="${SY1-SY0}"/>`;
|
|
9956
10054
|
return `${out}<g class=pdfvec>${d?`<path d="${d}"/>`:''}${circ}</g>`;
|
|
9957
10055
|
}
|
|
9958
10056
|
// --- geometric edit: extend/trim (snap nearest end to a target line) + split at a point ---
|
|
@@ -11829,6 +11927,7 @@ function render(){
|
|
|
11829
11927
|
let s=overlaySvg(); // reviewed source image (inert) beneath crisp Filter vectors (the only snap authority)
|
|
11830
11928
|
s+=gridSvg(); // structural grid under the linework (members/dims stay on top)
|
|
11831
11929
|
s+=elevationFrameSvg(); // an elevation's own grid lines and levels (#2780); empty on a plan
|
|
11930
|
+
s+=elementsPlanSvg(); // #3296 E1b: walls, slabs and footings under the steel; on an elevation, a note says why none is drawn
|
|
11832
11931
|
s+=provisionalMembersSvg();
|
|
11833
11932
|
for(const sg of P.segments) s+=`<line class=seg data-seg="${sg.id}" x1="${sg.a[0]}" y1="${sg.a[1]}" x2="${sg.b[0]}" y2="${sg.b[1]}"/>`;
|
|
11834
11933
|
for(const m of P.members){if(!visible2d(m))continue; // hidden or isolated away in this sheet's Objects list
|
|
@@ -17562,7 +17661,7 @@ function hostBakeReasonLabel(reason){return ({
|
|
|
17562
17661
|
'no-footprint':'No tabulated cross-section',unplaceable:'Geometry could not be placed',
|
|
17563
17662
|
'unregistered-view':'Source view is not registered to the model','view-scale-invalid':'Source view has no valid drawing scale',
|
|
17564
17663
|
'cross-view-conflict':'Source views disagree on placement','placement-evidence-conflict':'Invalid scale and conflicting placement evidence',
|
|
17565
|
-
'custom-section-unverified':'Custom section cannot be checked','custom-section-not-exported':'Custom section
|
|
17664
|
+
'custom-section-unverified':'Custom section cannot be checked','custom-section-not-exported':'Custom section left out of this send (chosen, or not checked)',
|
|
17566
17665
|
'not-in-model':'No longer in the model'
|
|
17567
17666
|
})[reason]||'Could not be built';}
|
|
17568
17667
|
|
|
@@ -32965,6 +33064,57 @@ function captureDetailRecipe(m,which,opt,type){
|
|
|
32965
33064
|
});
|
|
32966
33065
|
return {rowId:rowId,droppedSchedule:droppedSchedule};}
|
|
32967
33066
|
const comboPop=document.createElement('div');comboPop.id='comboPop';document.body.appendChild(comboPop);
|
|
33067
|
+
// ── The profile card (epic #3382 §7.2, P2) ────────────────────────────────────────────────────────────────────────────
|
|
33068
|
+
// Hovering or focusing a profile field opens a card that decodes the name (its sizes, order, drawing, weight); a size edited
|
|
33069
|
+
// in the card previews in 3D and Enter applies it as one undo step. The card's rules are `steel-profile-card*.js`; this page
|
|
33070
|
+
// only tells it what the model holds and carries out what the person chose. A preview never touches the undo stack or the
|
|
33071
|
+
// saved draft: it is the model put back to the snapshot taken when the preview began.
|
|
33072
|
+
var cardPreviewBase=null,cardResave=false; // var: edit() reads it, and may run before this block does
|
|
33073
|
+
function profileCardContext(){
|
|
33074
|
+
const PP=CatalogPicker.Parametric,units=parametricUnits();
|
|
33075
|
+
return {definitions:parametricDefs(),units,displayUnits:displayUnits(),material:pickerMaterial,
|
|
33076
|
+
libraryRow:t=>_profileCatalogRow(t),
|
|
33077
|
+
libraryHasPartial:t=>{const q=CatalogPicker.normalizeCatalogText(t);return !!q&&profileCatalogRows.some(r=>CatalogPicker.normalizeCatalogText(r.designation).startsWith(q));},
|
|
33078
|
+
excluded:PP.excludedFor(_envTraits().id),sketched:()=>PP.sketchedStatus(),mentionsSketched:t=>PP.mentionsSketched(t),
|
|
33079
|
+
isParametricMember:m=>{const mm=m&&byId(m.id);return !!mm&&PP.isParametricMember(C,mm);}};
|
|
33080
|
+
}
|
|
33081
|
+
function profileCardField(el){
|
|
33082
|
+
if(!el||!el.matches)return null;
|
|
33083
|
+
if(el.hasAttribute('data-profile-card'))return {kind:'label',ids:[],member:null,readonly:true};
|
|
33084
|
+
if(!el.classList.contains('combo')||el.dataset.src!=='profiles')return null;
|
|
33085
|
+
if(el.id==='pf'){
|
|
33086
|
+
const arr=selArr(),ids=arr.map(m=>m.id);
|
|
33087
|
+
if(arr.length===1){const m=arr[0];return {kind:'member',ids,member:{id:m.id,profile:m.profile,material:m.material,stored:boundParametricOf(m)}};}
|
|
33088
|
+
return {kind:'selection',ids,member:null};}
|
|
33089
|
+
if(el.id==='addProf')return {kind:'add',ids:[],member:null,element:el};
|
|
33090
|
+
return {kind:'other',ids:[],member:null,element:el};
|
|
33091
|
+
}
|
|
33092
|
+
function profileCardPreview(info,{definition,params,spelling}){
|
|
33093
|
+
if(!V2_SESSION)return 'The model is still opening, so this size cannot be previewed yet.';
|
|
33094
|
+
if(cardPreviewBase==null){if(saveT!==null){clearTimeout(saveT);saveT=null;cardResave=true;}cardPreviewBase=snapshot();}else apply(cardPreviewBase,true); // a save already queued waits until the preview is over, so a preview is never saved
|
|
33095
|
+
try{V2_SESSION.bindParametricSection({definition,params,memberIds:info.ids,spelling});}
|
|
33096
|
+
catch(err){
|
|
33097
|
+
apply(cardPreviewBase,true);cardPreviewBase=null;
|
|
33098
|
+
if(err&&err.name==='V2CommandError')return err.message;
|
|
33099
|
+
throw err;}
|
|
33100
|
+
render();sync3D();return true;
|
|
33101
|
+
}
|
|
33102
|
+
function profileCardEndPreview(){
|
|
33103
|
+
if(cardPreviewBase==null)return;
|
|
33104
|
+
const base=cardPreviewBase;cardPreviewBase=null;apply(base,true);
|
|
33105
|
+
if(cardResave){cardResave=false;scheduleSave();}
|
|
33106
|
+
}
|
|
33107
|
+
let profileCard=null;
|
|
33108
|
+
{
|
|
33109
|
+
profileCard=ProfileCard.installProfileCard({document,panel:()=>document.getElementById('panel'),context:profileCardContext,describeField:profileCardField,
|
|
33110
|
+
preview:profileCardPreview,endPreview:profileCardEndPreview,
|
|
33111
|
+
commit:(info,{definition,params,spelling})=>bindParametric(info.ids,{definition,params,spelling}),
|
|
33112
|
+
openCatalog:(info,text)=>{const ids=info.ids||[];if(info.kind==='add'||info.kind==='other'||!ids.length){openProfilePicker({ids:[],current:null,search:text,scope:info.kind==='add'?'New members':'Profile',invoker:document.getElementById('profileBrowseA')||document.getElementById('profileBrowseS'),onApply:v=>{const t=v&&typeof v==='object'?(v.kind==='text'?v.value:(v.spelling&&v.spelling.text)||''):v;const f=info.element&&info.element.isConnected?info.element:document.getElementById(info.kind==='add'?'addProf':'pf');if(f&&t){f.value=t;f.dispatchEvent(new Event('change',{bubbles:true}));}}});return;}
|
|
33113
|
+
openProfilePicker({ids,current:info.member?info.member.profile:null,search:text,scope:ids.length>1?ids.length+' members':'Member '+ids[0],invoker:document.getElementById('profileBrowseS')||document.getElementById('profileBrowseM')});},
|
|
33114
|
+
define:text=>askAiOpen({mode:'modify',text:'Define a new parametric profile shape for the name “'+text+'”, so FloLess can draw, weigh and export it. Ask me for any size or rule you are unsure of.'}),
|
|
33115
|
+
load:()=>CatalogPicker.Parametric.ensureSketched(),selectionKey:()=>[...selIds].sort().join('|')});
|
|
33116
|
+
window.__profileCard=profileCard;
|
|
33117
|
+
}
|
|
32968
33118
|
let comboInput=null,comboIdx=-1;
|
|
32969
33119
|
function showCombo(inp){if(inp&&inp.getAttribute&&inp.getAttribute('aria-disabled')==='true'){hideCombo();return;}const src=COMBO_SRC[inp.dataset.src];if(!src)return;comboInput=inp;
|
|
32970
33120
|
// connrows is a row PICKER (readonly), not a type-to-filter field — always offer every row.
|
|
@@ -33057,7 +33207,7 @@ function resetPlanViewState(i){
|
|
|
33057
33207
|
if(!clip){const points=provisionalMembersForActiveView().flatMap(m=>[m.geometry.fromDisplay,m.geometry.toDisplay]);
|
|
33058
33208
|
if(points.length){const xs=points.map(p=>p.x),ys=points.map(p=>p.y),pad=40;clip=[Math.min(...xs)-pad,Math.min(...ys)-pad,Math.max(...xs)+pad,Math.max(...ys)+pad];}}
|
|
33059
33209
|
if(!clip||!(clip[2]>clip[0])||!(clip[3]>clip[1]))clip=[0,0,1000,1000];
|
|
33060
|
-
X0=clip[0];Y0=clip[1];X1=clip[2];Y1=clip[3];FT=ppfOf(P);RB64=(P&&P.raster_b64)||'';EXTX=X1-X0;EXTY=Y1-Y0;syncElevationContext();
|
|
33210
|
+
X0=clip[0];Y0=clip[1];X1=clip[2];Y1=clip[3];SHEET=[X0,Y0,X1,Y1];FT=ppfOf(P);RB64=(P&&P.raster_b64)||'';EXTX=X1-X0;EXTY=Y1-Y0;syncElevationContext();
|
|
33061
33211
|
svg.setAttribute('aria-label',(P&&P.viewKind==='elevation'?'2D source elevation':P&&P.viewKind==='section'?'2D source section':'2D model view')+(viewLabel(P)?' '+viewLabel(P):''));
|
|
33062
33212
|
svg.setAttribute('viewBox',`${X0} ${Y0} ${X1-X0} ${Y1-Y0}`);
|
|
33063
33213
|
// The profile list, read from the native document root. Deriving it from
|
|
@@ -33112,7 +33262,7 @@ function setPlan(i){
|
|
|
33112
33262
|
if(xs.length){const pad=Math.max(200,(Math.max(...xs)-Math.min(...xs))*0.1);
|
|
33113
33263
|
clip=[Math.min(...xs)-pad,Math.min(...ys)-pad,Math.max(...xs)+pad,Math.max(...ys)+pad];}
|
|
33114
33264
|
else clip=[0,0,1000,1000];}
|
|
33115
|
-
X0=clip[0];Y0=clip[1];X1=clip[2];Y1=clip[3];FT=ppfOf(P);RB64=P.raster_b64||'';EXTX=X1-X0;EXTY=Y1-Y0;
|
|
33265
|
+
X0=clip[0];Y0=clip[1];X1=clip[2];Y1=clip[3];SHEET=[X0,Y0,X1,Y1];FT=ppfOf(P);RB64=P.raster_b64||'';EXTX=X1-X0;EXTY=Y1-Y0;
|
|
33116
33266
|
svg.setAttribute('viewBox',`${X0} ${Y0} ${X1-X0} ${Y1-Y0}`);
|
|
33117
33267
|
profs=[...new Set([...profileCatalogValues(),...P.members.map(m=>m.profile).filter(Boolean)])].sort(CatalogPicker.naturalProfileCompare);
|
|
33118
33268
|
// undo/redo is one GLOBAL stack (module-level, declared once) — NOT swapped per plane. A plane switch
|