documentation/components/source/composition-elements.ts

1/** Real composition members exclude measurement and inspection decoration. */
2export const compositionSelector = ".node,.leaf";
3
4export function compositionMembers(element: HTMLElement): HTMLElement[] {
5  return [...element.children].filter(
6    (child): child is HTMLElement =>
7      child instanceof HTMLElement && child.matches(compositionSelector),
8  );
9}
10
11/** Names are local to the rendered composition's anchor-scope. */
12export function compositionAnchorName(path: string): string {
13  return `--axiomatic-node-${path.replaceAll(".", "-")}`;
14}