refactor: functional style in exporter.js and subobject-kinds.js
This commit is contained in:
@@ -1,9 +1,3 @@
|
||||
// Group a node's sub-objects by KIND (the SLOT side of SLOT.SUBTYPE in the AST).
|
||||
// Per the editor design: items sharing a kind share one pane; different kinds
|
||||
// produce separate panes whose handles render in the AppShell bottom bar.
|
||||
// Each group is { kind, items: [{ kind, node, label, hasChildren, readOnly? }] }.
|
||||
// The returned order is the display order for the handle bar.
|
||||
|
||||
export const KIND_LABEL = {
|
||||
tuning: 'TU',
|
||||
stage: 'ST',
|
||||
@@ -30,10 +24,10 @@ export function getKindGroups(node) {
|
||||
]});
|
||||
}
|
||||
|
||||
const stage = [];
|
||||
if (node.stageCone) stage.push({ kind: 'stage', node: node.stageCone, label: 'cone (orchestra)', hasChildren: false });
|
||||
for (const sv of (node.stageVoices ?? []))
|
||||
stage.push({ kind: 'stage', node: sv, label: sv.name, hasChildren: false });
|
||||
const stage = [
|
||||
...(node.stageCone ? [{ kind: 'stage', node: node.stageCone, label: 'cone (orchestra)', hasChildren: false }] : []),
|
||||
...(node.stageVoices ?? []).map(sv => ({ kind: 'stage', node: sv, label: sv.name, hasChildren: false })),
|
||||
];
|
||||
if (stage.length) groups.push({ kind: 'stage', items: stage });
|
||||
|
||||
if (node.instruments.length) {
|
||||
|
||||
Reference in New Issue
Block a user