@floless/app 0.155.1 → 0.155.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 +3340 -2982
- package/dist/web/app.css +5 -2
- package/dist/web/commands-shell.js +11 -0
- package/dist/web/commands-tekla-parser.js +7 -0
- package/dist/web/instructor.js +1 -1
- package/dist/web/left-pane.js +137 -39
- package/dist/web/model-editor.css +10 -0
- package/dist/web/model-group-navigator.js +331 -0
- package/dist/web/model-panel-bridge.js +63 -5
- package/dist/web/model-pointer-dock.js +55 -5
- package/dist/web/model-selection-tools.js +53 -17
- package/dist/web/model-tekla-selection.js +75 -2
- package/dist/web/model-viewport-revit-adapter.js +14 -9
- package/dist/web/revit-editor.js +350 -51
- package/dist/web/steel-3d-view.js +1 -0
- package/package.json +1 -1
package/dist/web/app.css
CHANGED
|
@@ -728,8 +728,11 @@
|
|
|
728
728
|
.left-model-row:hover { background: var(--accent-soft); }
|
|
729
729
|
.left-model-row.selected { box-shadow: inset 2px 0 0 var(--accent); background: var(--accent-soft); }
|
|
730
730
|
.left-model-row .row-label { unicode-bidi: plaintext; }
|
|
731
|
-
.left-model-
|
|
732
|
-
|
|
731
|
+
.left-model-disclosure { width: 22px; height: 22px; margin: -1px -4px -1px -3px; display: inline-grid; place-items: center;
|
|
732
|
+
flex: none; color: var(--text-dim); border-radius: 4px; cursor: pointer; }
|
|
733
|
+
.left-model-disclosure::before { content: "›"; transition: transform 120ms ease; }
|
|
734
|
+
.left-model-row[aria-expanded="true"] > .left-model-disclosure::before { transform: rotate(90deg); }
|
|
735
|
+
.left-model-disclosure:hover { color: var(--text); background: var(--accent-soft); }
|
|
733
736
|
.left-model-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
|
|
734
737
|
.left-model-row .row-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
735
738
|
.left-model-row .explorer-count { margin-left: auto; flex: none; color: var(--text-dim); font: 10px var(--mono); }
|
|
@@ -1499,6 +1499,17 @@
|
|
|
1499
1499
|
group: 'In the Model section of the left panel', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand',
|
|
1500
1500
|
});
|
|
1501
1501
|
|
|
1502
|
+
def('shell.model-hierarchy-drill', {
|
|
1503
|
+
label: 'Model hierarchy group', actsOn: 'Selects {instance}; double-click it, or expand it and press ArrowRight, to enter the group and select its verified objects individually',
|
|
1504
|
+
group: 'In the Model section of the left panel', persistence: 'local', interaction: 'mode', risk: [], guidance: 'on-demand',
|
|
1505
|
+
escLabel: 'Esc leaves the current group',
|
|
1506
|
+
});
|
|
1507
|
+
|
|
1508
|
+
def('shell.model-load-more', {
|
|
1509
|
+
label: 'Load more model objects', actsOn: 'Adds the next authenticated page of {instance} to the Model tree',
|
|
1510
|
+
group: 'In the Model section of the left panel', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand',
|
|
1511
|
+
});
|
|
1512
|
+
|
|
1502
1513
|
def('shell.inspect-panel', {
|
|
1503
1514
|
label: 'Inspect panel',
|
|
1504
1515
|
actsOn: 'Folds the Inspect panel away, or brings it back',
|
|
@@ -43,6 +43,13 @@
|
|
|
43
43
|
def('tekla-parser.snap-mesh-edge-nearest', { label: 'Mesh edge nearest snapping', actsOn: 'Snaps dimensions to the nearest point on an authenticated triangle edge', group: 'In the Tekla Parser snapping bar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
44
44
|
def('tekla-parser.snap-surface', { label: 'Mesh surface snapping', actsOn: 'Snaps dimensions to the authenticated model surface beneath the pointer', group: 'In the Tekla Parser snapping bar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
45
45
|
def('tekla-parser.selection-filter', { label: 'Selection filter', actsOn: 'Narrows selectable model objects by {instance}', group: 'In the Tekla Parser selection bar', persistence: 'local', interaction: 'dialog', risk: [], guidance: 'on-demand' });
|
|
46
|
+
def('tekla-parser.connection-scope-group', { label: 'Select Connections', actsOn: 'Selects a Connection as one logical object while highlighting its verified descendants', group: 'In the Tekla Parser selection bar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
47
|
+
def('tekla-parser.connection-scope-objects', { label: 'Select objects in Connections', actsOn: 'Selects the verified objects inside a Connection individually', group: 'In the Tekla Parser selection bar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
48
|
+
def('tekla-parser.assembly-scope-group', { label: 'Select Assemblies', actsOn: 'Selects an Assembly as one logical object while highlighting its verified descendants', group: 'In the Tekla Parser selection bar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
49
|
+
def('tekla-parser.assembly-scope-objects', { label: 'Select objects in Assemblies', actsOn: 'Selects the verified objects inside an Assembly individually', group: 'In the Tekla Parser selection bar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
50
|
+
def('tekla-parser.hierarchy-drill', { label: 'Model hierarchy group', actsOn: 'Selects {instance}; double-click it, or expand it and press ArrowRight, to enter the group and select its verified objects individually', group: 'In the Tekla Parser hierarchy', persistence: 'local', interaction: 'mode', risk: [], guidance: 'on-demand', escLabel: 'Esc leaves the current group' });
|
|
51
|
+
def('tekla-parser.hierarchy-ascend', { label: 'Leave model group', actsOn: 'Leaves the current Connection or Assembly drill-down and restores the saved selection scopes', group: 'In the Tekla Parser selection bar', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
52
|
+
def('tekla-parser.hierarchy-load-more', { label: 'Load more model objects', actsOn: 'Adds the next authenticated page of {instance} to the Tekla Parser hierarchy', group: 'In the Tekla Parser hierarchy', persistence: 'none', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
46
53
|
def('tekla-parser.inspector-toggle', { label: 'Toggle the Properties panel', actsOn: 'Collapses or opens the read-only Properties panel', group: 'In the Properties panel', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
47
54
|
def('tekla-parser.authority', { label: 'Model authority', actsOn: 'Switches between an available working and approved snapshot', group: 'In the Tekla Parser header', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
|
48
55
|
def('tekla-parser.audit-filter', { label: 'Filter import findings', actsOn: 'Shows {instance} findings in the read-only import audit', anyInstance: 'all', group: 'In the Tekla Parser Audit pane', persistence: 'local', interaction: 'instant', risk: [], guidance: 'on-demand' });
|
package/dist/web/instructor.js
CHANGED
|
@@ -887,7 +887,7 @@
|
|
|
887
887
|
'In the confidence report', 'In the Ask AI panel', 'In the Ask AI dialog', 'In the Favourites dialog',
|
|
888
888
|
// the read-only Revit model editor
|
|
889
889
|
'In the Revit model header', 'In the Revit model toolbar', 'In the Revit Saved views panel', 'In the Revit model coordinate HUD', 'In the Revit model selection bar', 'In the Revit model snapping bar', 'In the Revit spatial controls',
|
|
890
|
-
'In the Tekla Parser header', 'In the Tekla Parser model toolbar', 'In the Tekla Parser Saved views panel', 'In the Tekla Parser coordinate HUD', 'In the Tekla Parser selection bar', 'In the Tekla Parser snapping bar', 'In the Tekla Parser spatial controls', 'In the Tekla Parser Audit pane',
|
|
890
|
+
'In the Tekla Parser header', 'In the Tekla Parser hierarchy', 'In the Tekla Parser model toolbar', 'In the Tekla Parser Saved views panel', 'In the Tekla Parser coordinate HUD', 'In the Tekla Parser selection bar', 'In the Tekla Parser snapping bar', 'In the Tekla Parser spatial controls', 'In the Tekla Parser Audit pane',
|
|
891
891
|
// the drawing filter
|
|
892
892
|
'In the Drawing Filter header', 'In a Drawing Filter message',
|
|
893
893
|
'In the Drawing Filter panel', 'On the Drawing Filter canvas',
|
package/dist/web/left-pane.js
CHANGED
|
@@ -744,12 +744,27 @@
|
|
|
744
744
|
if (node.kind === 'label' || node.kind === 'note') {
|
|
745
745
|
const copy = document.createElement('div'); copy.className = node.kind === 'label' ? 'revit-explorer-label' : 'left-model-empty'; copy.setAttribute('role', 'presentation'); copy.textContent = node.label; parent.append(copy); continue;
|
|
746
746
|
}
|
|
747
|
+
if (node.kind === 'more' && typeof node.pageKey === 'string') {
|
|
748
|
+
const more = document.createElement('button'); more.type = 'button'; more.className = 'left-model-row left-model-load-more';
|
|
749
|
+
more.setAttribute('role', 'treeitem');
|
|
750
|
+
more.textContent = node.label; more.dataset.commandId = `shell.model-load-more#${commandInstance(node.pageKey)}`;
|
|
751
|
+
more.dataset.commandInstanceLabel = node.label;
|
|
752
|
+
more.addEventListener('click', () => {
|
|
753
|
+
const seenPaths = new Set([...modelContent.querySelectorAll('[data-occurrence-path]')].map((row) => row.dataset.occurrencePath));
|
|
754
|
+
const requestId = sendAction({ action: 'load-more', pageKey: node.pageKey, datasetKey: state.datasetKey });
|
|
755
|
+
if (requestId) pendingActions.set(requestId, { kind: 'load-more', seenPaths });
|
|
756
|
+
});
|
|
757
|
+
parent.append(more); continue;
|
|
758
|
+
}
|
|
747
759
|
const row = document.createElement('button'); row.type = 'button'; row.className = 'left-model-row';
|
|
748
760
|
const instance = node.entityId || node.groupId || node.label;
|
|
749
761
|
row.dataset.commandId = node.entityId
|
|
750
|
-
?
|
|
762
|
+
? `${Array.isArray(node.children) ? 'shell.model-hierarchy-drill' : 'shell.model-item'}#${commandInstance(instance)}`
|
|
751
763
|
: `shell.model-group#${commandInstance(instance)}`;
|
|
752
764
|
row.dataset.commandInstanceLabel = node.label;
|
|
765
|
+
if (Array.isArray(node.occurrencePath) && node.occurrencePath.length && node.occurrencePath.every((id) => typeof id === 'string')) {
|
|
766
|
+
row.dataset.occurrencePath = JSON.stringify(node.occurrencePath);
|
|
767
|
+
}
|
|
753
768
|
if (typeof node.tip === 'string' && node.tip) row.dataset.tip = node.tip;
|
|
754
769
|
const label = document.createElement('span'); label.className = 'row-label'; label.textContent = node.label;
|
|
755
770
|
if (node.entityId && node.objectFields && ['name', 'profile', 'id'].every((key) => node.objectFields[key] == null || typeof node.objectFields[key] === 'string')) {
|
|
@@ -774,9 +789,78 @@
|
|
|
774
789
|
row.append(label);
|
|
775
790
|
}
|
|
776
791
|
if (node.count != null) { const count = document.createElement('span'); count.className = 'explorer-count'; count.textContent = String(node.count); row.append(count); }
|
|
792
|
+
if (Array.isArray(node.children)) {
|
|
793
|
+
const branch = document.createElement('div'); branch.className = 'left-model-branch'; branch.setAttribute('role', 'none');
|
|
794
|
+
const disclosureKey = `${state.datasetKey}:${state.tab}:${node.groupId || node.entityId || node.label}`;
|
|
795
|
+
const expanded = groupDisclosure.has(disclosureKey) ? groupDisclosure.get(disclosureKey) : !!node.expanded;
|
|
796
|
+
row.setAttribute('role', 'treeitem'); row.setAttribute('aria-expanded', String(expanded));
|
|
797
|
+
if (node.entityId) {
|
|
798
|
+
row.dataset.entityId = node.entityId;
|
|
799
|
+
row.classList.toggle('selected', selectedIdsOf(state.snapshot).includes(node.entityId));
|
|
800
|
+
row.setAttribute('aria-selected', String(selectedIdsOf(state.snapshot).includes(node.entityId)));
|
|
801
|
+
if (node.entityId === state.snapshot?.selectedId) row.setAttribute('aria-current', 'true');
|
|
802
|
+
}
|
|
803
|
+
const disclosure = document.createElement('span'); disclosure.className = 'left-model-disclosure'; disclosure.setAttribute('aria-hidden', 'true');
|
|
804
|
+
disclosure.dataset.tip = `${expanded ? 'Collapse' : 'Expand'} ${node.label}`;
|
|
805
|
+
row.prepend(disclosure);
|
|
806
|
+
const children = document.createElement('div'); children.className = 'left-model-children'; children.setAttribute('role', 'group'); children.hidden = !expanded; append(node.children, children);
|
|
807
|
+
const requestLazyChildren = () => {
|
|
808
|
+
if (row.getAttribute('aria-busy') === 'true') return;
|
|
809
|
+
const outstanding = [...pendingActions.values()].some((pending) => pending.kind === 'expand' && pending.disclosureKey === disclosureKey);
|
|
810
|
+
if (outstanding) { row.setAttribute('aria-busy', 'true'); return; }
|
|
811
|
+
row.setAttribute('aria-busy', 'true');
|
|
812
|
+
const requestId = sendAction({ action: 'expand', groupId: node.groupId, datasetKey: state.datasetKey });
|
|
813
|
+
if (requestId) pendingActions.set(requestId, { kind: 'expand', row, disclosureKey, commandId: row.dataset.commandId });
|
|
814
|
+
else row.removeAttribute('aria-busy');
|
|
815
|
+
};
|
|
816
|
+
const toggle = (force = null) => {
|
|
817
|
+
if (node.lazy && !node.children.length) { requestLazyChildren(); return; }
|
|
818
|
+
const open = force ?? row.getAttribute('aria-expanded') !== 'true'; row.setAttribute('aria-expanded', String(open)); children.hidden = !open;
|
|
819
|
+
disclosure.dataset.tip = `${open ? 'Collapse' : 'Expand'} ${node.label}`; groupDisclosure.set(disclosureKey, open);
|
|
820
|
+
};
|
|
821
|
+
disclosure.addEventListener('click', (event) => { event.preventDefault(); event.stopPropagation(); if (event.detail > 1) return; toggle(); });
|
|
822
|
+
disclosure.addEventListener('dblclick', (event) => { event.preventDefault(); event.stopPropagation(); });
|
|
823
|
+
row.addEventListener('click', (event) => {
|
|
824
|
+
if (event.detail > 1) return;
|
|
825
|
+
if (node.entityId) selectRow(node, event);
|
|
826
|
+
else {
|
|
827
|
+
toggle();
|
|
828
|
+
if (node.selectable === true) sendAction({ action: 'select-group', groupId: node.groupId, datasetKey: state.datasetKey });
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
if (node.entityId) row.addEventListener('dblclick', (event) => {
|
|
832
|
+
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) { event.preventDefault(); return; }
|
|
833
|
+
event.preventDefault(); toggle(true);
|
|
834
|
+
sendAction({ action: 'drill', entityId: node.entityId, occurrencePath: node.occurrencePath, datasetKey: state.datasetKey });
|
|
835
|
+
});
|
|
836
|
+
row.addEventListener('keydown', (event) => {
|
|
837
|
+
if (event.key === 'ArrowRight') {
|
|
838
|
+
event.preventDefault();
|
|
839
|
+
if (row.getAttribute('aria-expanded') !== 'true') toggle(true);
|
|
840
|
+
else if (node.entityId) sendAction({ action: 'drill', entityId: node.entityId, occurrencePath: node.occurrencePath, datasetKey: state.datasetKey });
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
if (event.key === 'ArrowLeft') {
|
|
844
|
+
if (row.getAttribute('aria-expanded') === 'true') { event.preventDefault(); event.stopPropagation(); toggle(false); }
|
|
845
|
+
else if (node.entityId && Number(state.snapshot?.drillDepth) > 0) {
|
|
846
|
+
event.preventDefault(); event.stopPropagation(); sendAction({ action: 'ascend', datasetKey: state.datasetKey });
|
|
847
|
+
}
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
if (event.key === 'Escape' && node.entityId) {
|
|
851
|
+
event.preventDefault(); event.stopPropagation();
|
|
852
|
+
sendAction({ action: Number(state.snapshot?.drillDepth) > 0 ? 'ascend' : 'clear-selection', datasetKey: state.datasetKey });
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
row.__toggleTreeItem = toggle;
|
|
856
|
+
branch.append(row, children); parent.append(branch);
|
|
857
|
+
if (expanded && node.lazy && !node.children.length) requestLazyChildren();
|
|
858
|
+
continue;
|
|
859
|
+
}
|
|
777
860
|
if (node.entityId) {
|
|
778
861
|
row.dataset.entityId = node.entityId;
|
|
779
862
|
row.classList.toggle('selected', selectedIdsOf(state.snapshot).includes(node.entityId));
|
|
863
|
+
row.setAttribute('aria-selected', String(selectedIdsOf(state.snapshot).includes(node.entityId)));
|
|
780
864
|
if (node.entityId === state.snapshot?.selectedId) row.setAttribute('aria-current', 'true');
|
|
781
865
|
const gridControl = state.snapshot?.gridVisibility?.entityId === node.entityId ? renderGridVisibility(state.snapshot.gridVisibility) : null;
|
|
782
866
|
const item = document.createElement('div'); item.setAttribute('role', 'listitem');
|
|
@@ -788,41 +872,30 @@
|
|
|
788
872
|
row.setAttribute('aria-expanded', String(expanded)); gridControl.hidden = !expanded;
|
|
789
873
|
row.addEventListener('click', (event) => {
|
|
790
874
|
const open = row.getAttribute('aria-expanded') !== 'true'; row.setAttribute('aria-expanded', String(open)); gridControl.hidden = !open;
|
|
791
|
-
groupDisclosure.set(disclosureKey, open); selectRow(node
|
|
875
|
+
groupDisclosure.set(disclosureKey, open); selectRow(node, event);
|
|
792
876
|
});
|
|
793
877
|
item.append(row, gridControl);
|
|
794
|
-
} else {
|
|
878
|
+
} else {
|
|
879
|
+
row.setAttribute('role', 'treeitem');
|
|
880
|
+
row.addEventListener('click', (event) => selectRow(node, event));
|
|
881
|
+
row.addEventListener('keydown', (event) => {
|
|
882
|
+
if (event.key !== 'Escape' && event.key !== 'ArrowLeft') return;
|
|
883
|
+
if (Number(state.snapshot?.drillDepth) > 0) {
|
|
884
|
+
event.preventDefault(); event.stopPropagation(); sendAction({ action: 'ascend', datasetKey: state.datasetKey });
|
|
885
|
+
} else if (event.key === 'Escape') {
|
|
886
|
+
event.preventDefault(); event.stopPropagation(); sendAction({ action: 'clear-selection', datasetKey: state.datasetKey });
|
|
887
|
+
}
|
|
888
|
+
});
|
|
889
|
+
item.append(row);
|
|
890
|
+
}
|
|
795
891
|
parent.append(item); continue;
|
|
796
892
|
}
|
|
797
|
-
|
|
798
|
-
const branch = document.createElement('div'); branch.className = 'left-model-branch'; branch.setAttribute('role', 'listitem');
|
|
799
|
-
const disclosureKey = `${state.datasetKey}:${state.tab}:${node.groupId || node.label}`;
|
|
800
|
-
const expanded = groupDisclosure.has(disclosureKey) ? groupDisclosure.get(disclosureKey) : !!node.expanded;
|
|
801
|
-
row.setAttribute('aria-expanded', String(expanded));
|
|
802
|
-
const children = document.createElement('div'); children.className = 'left-model-children'; children.setAttribute('role', 'list'); children.hidden = !expanded; append(node.children, children);
|
|
803
|
-
const requestLazyChildren = () => {
|
|
804
|
-
if (row.getAttribute('aria-busy') === 'true') return;
|
|
805
|
-
const outstanding = [...pendingActions.values()].some((pending) => pending.kind === 'expand' && pending.disclosureKey === disclosureKey);
|
|
806
|
-
if (outstanding) { row.setAttribute('aria-busy', 'true'); return; }
|
|
807
|
-
row.setAttribute('aria-busy', 'true');
|
|
808
|
-
const requestId = sendAction({ action: 'expand', groupId: node.groupId, datasetKey: state.datasetKey });
|
|
809
|
-
if (requestId) pendingActions.set(requestId, { kind: 'expand', row, disclosureKey, commandId: row.dataset.commandId });
|
|
810
|
-
else row.removeAttribute('aria-busy');
|
|
811
|
-
};
|
|
812
|
-
row.addEventListener('click', () => {
|
|
813
|
-
if (node.lazy && !node.children.length) { requestLazyChildren(); return; }
|
|
814
|
-
const open = row.getAttribute('aria-expanded') !== 'true'; row.setAttribute('aria-expanded', String(open)); children.hidden = !open;
|
|
815
|
-
groupDisclosure.set(disclosureKey, open);
|
|
816
|
-
if (node.selectable === true) sendAction({ action: 'select-group', groupId: node.groupId, datasetKey: state.datasetKey });
|
|
817
|
-
});
|
|
818
|
-
branch.append(row, children); parent.append(branch);
|
|
819
|
-
if (expanded && node.lazy && !node.children.length) requestLazyChildren();
|
|
820
|
-
} else {
|
|
893
|
+
else {
|
|
821
894
|
const item = document.createElement('div'); item.setAttribute('role', 'listitem'); item.append(row); parent.append(item);
|
|
822
895
|
}
|
|
823
896
|
}
|
|
824
897
|
};
|
|
825
|
-
const tree = document.createElement('div'); tree.className = 'left-model-tree'; tree.setAttribute('role', '
|
|
898
|
+
const tree = document.createElement('div'); tree.className = 'left-model-tree'; tree.setAttribute('role', 'tree');
|
|
826
899
|
const count = nodes.reduce((sum, node) => sum + (Number(node?.count) || (node?.entityId ? 1 : 0)), 0);
|
|
827
900
|
tree.setAttribute('aria-label', count ? `Model index, ${count} items` : 'Model index');
|
|
828
901
|
append(nodes, tree); host.append(tree); host.scrollTop = scrollTop;
|
|
@@ -985,21 +1058,38 @@
|
|
|
985
1058
|
// A list row click, as in a file explorer: Ctrl (⌘) adds or removes the row, Shift takes every row from the last one
|
|
986
1059
|
// clicked to this one in the order shown (rows in closed groups are skipped), and Ctrl+Shift adds that range. The
|
|
987
1060
|
// main window works out the ids because it draws the rows; the editor selects them.
|
|
988
|
-
function selectRow(
|
|
1061
|
+
function selectRow(node, event) {
|
|
1062
|
+
if ((event.ctrlKey || event.metaKey) && event.shiftKey) { event.preventDefault(); return false; }
|
|
1063
|
+
const id = node.entityId;
|
|
989
1064
|
const current = pendingSelectIds ?? selectedIdsOf(state.snapshot), add = event.ctrlKey || event.metaKey;
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
.
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1065
|
+
const pathOf = (row) => {
|
|
1066
|
+
try {
|
|
1067
|
+
const path = JSON.parse(row.dataset.occurrencePath || 'null');
|
|
1068
|
+
return Array.isArray(path) && path.length && path.every((part) => typeof part === 'string') ? path : [row.dataset.entityId];
|
|
1069
|
+
} catch { return [row.dataset.entityId]; }
|
|
1070
|
+
};
|
|
1071
|
+
const clickedOccurrence = { entityId: id, occurrencePath: Array.isArray(node.occurrencePath) ? [...node.occurrencePath] : [id] };
|
|
1072
|
+
let ids; let occurrences;
|
|
1073
|
+
const hierarchyOccurrence = Number.isInteger(state.snapshot?.drillDepth) && Array.isArray(node.occurrencePath) && node.occurrencePath.length > 0;
|
|
1074
|
+
if (event.shiftKey && hierarchyOccurrence) {
|
|
1075
|
+
occurrences = [clickedOccurrence]; ids = [...new Set([...current, id])];
|
|
1076
|
+
selectAnchor = JSON.stringify(clickedOccurrence.occurrencePath);
|
|
1077
|
+
} else if (event.shiftKey && selectAnchor) {
|
|
1078
|
+
const order = [...modelContent.querySelectorAll('[data-entity-id]')].filter((row) => !row.closest('[hidden]'))
|
|
1079
|
+
.map((row) => ({ entityId: row.dataset.entityId, occurrencePath: pathOf(row) }));
|
|
1080
|
+
const keys = order.map((item) => JSON.stringify(item.occurrencePath)); const clickedKey = JSON.stringify(clickedOccurrence.occurrencePath);
|
|
1081
|
+
const from = keys.indexOf(selectAnchor), to = keys.indexOf(clickedKey);
|
|
1082
|
+
if (from < 0) selectAnchor = clickedKey;
|
|
1083
|
+
occurrences = from < 0 || to < 0 ? [clickedOccurrence] : order.slice(Math.min(from, to), Math.max(from, to) + 1);
|
|
1084
|
+
const range = occurrences.map((item) => item.entityId);
|
|
997
1085
|
ids = add ? [...new Set([...current, ...range])] : range;
|
|
998
1086
|
} else {
|
|
999
1087
|
ids = !add ? [id] : current.includes(id) ? current.filter((other) => other !== id) : [...current, id];
|
|
1000
|
-
selectAnchor =
|
|
1088
|
+
occurrences = [clickedOccurrence]; selectAnchor = JSON.stringify(clickedOccurrence.occurrencePath);
|
|
1001
1089
|
}
|
|
1002
|
-
|
|
1090
|
+
const operation = event.ctrlKey || event.metaKey ? 'toggle' : event.shiftKey ? 'add' : 'replace';
|
|
1091
|
+
if (sendAction({ action: 'select', entityId: id, entityIds: ids, occurrence: clickedOccurrence, occurrences, operation })) pendingSelectIds = ids;
|
|
1092
|
+
return true;
|
|
1003
1093
|
}
|
|
1004
1094
|
function sendAction(action) {
|
|
1005
1095
|
const requestId = `${state.generation}:${++nextActionId}`;
|
|
@@ -1047,6 +1137,11 @@
|
|
|
1047
1137
|
else window.Instructor?.clear?.();
|
|
1048
1138
|
}
|
|
1049
1139
|
}
|
|
1140
|
+
if (pending?.kind === 'load-more' && data.ok) {
|
|
1141
|
+
const firstNew = [...modelContent.querySelectorAll('[role="treeitem"][data-occurrence-path]')]
|
|
1142
|
+
.find((row) => !pending.seenPaths.has(row.dataset.occurrencePath));
|
|
1143
|
+
firstNew?.focus();
|
|
1144
|
+
}
|
|
1050
1145
|
if (!data.ok) status.textContent = data.message || 'That model action is no longer available.';
|
|
1051
1146
|
// The frame stays empty, so say so where the tab would be — for the tab still shown, not an earlier one.
|
|
1052
1147
|
if (pending?.kind === 'panel' && !data.ok && pending.key === panelShown) {
|
|
@@ -1080,13 +1175,16 @@
|
|
|
1080
1175
|
state.snapshot.focusEntityId = typeof data.focusEntityId === 'string' ? data.focusEntityId : null;
|
|
1081
1176
|
state.snapshot.geometrySelectionIds = data.geometrySelectionIds.filter((id) => typeof id === 'string');
|
|
1082
1177
|
}
|
|
1178
|
+
if (Number.isInteger(data.drillDepth) && data.drillDepth >= 0) state.snapshot.drillDepth = data.drillDepth;
|
|
1083
1179
|
state.snapshot.subjects = data.subjects && typeof data.subjects === 'object' ? data.subjects : null;
|
|
1084
1180
|
}
|
|
1085
1181
|
announceSelection();
|
|
1086
1182
|
pendingSelectIds = null;
|
|
1087
1183
|
const picked = selectedIdsOf(data);
|
|
1088
1184
|
modelContent.querySelectorAll('[data-entity-id]').forEach((row) => {
|
|
1089
|
-
|
|
1185
|
+
const isSelected = picked.includes(row.dataset.entityId);
|
|
1186
|
+
row.classList.toggle('selected', isSelected);
|
|
1187
|
+
if (row.getAttribute('role') === 'treeitem') row.setAttribute('aria-selected', String(isSelected));
|
|
1090
1188
|
if (row.dataset.entityId === data.selectedId) row.setAttribute('aria-current', 'true'); else row.removeAttribute('aria-current');
|
|
1091
1189
|
});
|
|
1092
1190
|
if (state.followSelection && state.snapshot?.selectedIds?.length === 1) { renderModel(); revealSelectedEntity(); }
|
|
@@ -157,6 +157,16 @@ body:has(.model-inspector-resizer.drag) .model-inspector-panel,body:has(.model-i
|
|
|
157
157
|
.model-select-bar button:focus-visible,.model-snap-bar button:focus-visible,.model-module-actions button:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:1px}
|
|
158
158
|
.model-select-bar button .car{position:absolute;right:1px;bottom:0;font-size:8px;opacity:.7;pointer-events:none}
|
|
159
159
|
.model-select-bar button .seldot{position:absolute;top:2px;right:2px;width:6px;height:6px;border-radius:50%;background:var(--brand,var(--accent,#60a5fa));box-shadow:0 0 0 1.5px var(--panel)}
|
|
160
|
+
.model-selection-scope{display:flex;align-items:center;gap:1px;padding-right:3px;margin-right:2px;border-right:1px solid var(--line)}
|
|
161
|
+
.model-selection-scope button{width:auto;min-width:42px;grid-template-columns:16px auto;gap:3px;padding:0 5px;font-size:10px;font-weight:650;letter-spacing:.02em}
|
|
162
|
+
.model-selection-scope button svg{width:15px;height:15px}
|
|
163
|
+
.model-scope-short{line-height:1;white-space:nowrap}
|
|
164
|
+
.model-select-bar .model-scope-ascend{width:auto;height:28px;padding:0 8px;font-size:10px;font-weight:700}
|
|
165
|
+
.model-scope-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
166
|
+
.tekla-hierarchy-disclosure{display:grid;place-items:center;width:22px;min-width:22px;align-self:stretch;border-radius:4px;color:var(--mut,var(--muted));cursor:pointer;padding:0;font-size:14px}
|
|
167
|
+
.tekla-hierarchy-disclosure:hover{background:rgba(148,163,184,.12);color:var(--text)}
|
|
168
|
+
.tekla-hierarchy-disclosure:focus-visible{outline:2px solid var(--brand,var(--accent,#60a5fa));outline-offset:-2px}
|
|
169
|
+
.tekla-hierarchy-branch>.revit-tree-children{margin-left:11px;border-left:1px solid var(--line)}
|
|
160
170
|
.model-snap-bar button{color:var(--model-snap-ink,#22d3ee)}
|
|
161
171
|
.model-snap-bar [data-snap3d]{font-size:11px;font-weight:700;letter-spacing:.02em;margin-left:4px;border-left:1px solid var(--line);border-radius:0 5px 5px 0;padding-left:4px;box-sizing:border-box;width:32px}
|
|
162
172
|
.model-module-actions{gap:5px}
|