Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

595 B
Raw Blame
import type { GraphicsDocument } from './model';
import { children, roots } from './scene';
import { isShape } from './shapes/registry';

/** Groups have no inherited style. Styling a group explicitly edits its leaves. */
export function selectedShapeIds(
  document: GraphicsDocument,
  selection: readonly string[]
): readonly string[] {
  const result: string[] = [];
  const visit = (id: string) => {
    if (isShape(document.items[id])) result.push(id);
    else for (const child of children(document, id)) visit(child);
  };
  roots(document, selection).forEach(visit);
  return result;
}