{"version":3,"file":"componentUsage.mjs","names":[],"sources":["../../../src/lib/componentUsage.ts"],"sourcesContent":["import type { FlowComponentStatus } from \"@mittwald/flow-react-components/internal\";\nimport type { ComponentRenderedEvent } from \"@mittwald/flow-remote-core\";\n\n/**\n * A Flow component an extension used, as reported by the remote. Renders that\n * arrive through a Flow view are composition rather than usage and are not\n * reported at all.\n */\nexport interface ComponentUsageEvent {\n  /** Display name of the used Flow component, e.g. `\"Button\"`. */\n  component: string;\n  /**\n   * The component's lifecycle status (ADR 0003) from the generated status\n   * registry. `undefined` for components the registry does not track as an\n   * independent contract unit — subcomponents like `TableCell` or `XAxis`.\n   */\n  status?: FlowComponentStatus;\n}\n\nexport type ComponentUsageHandler = (event: ComponentUsageEvent) => void;\n\nexport type ComponentStatusResolver = (\n  component: string,\n) => FlowComponentStatus | undefined;\n\nexport const toComponentUsageEvent = (\n  event: ComponentRenderedEvent,\n  resolveStatus: ComponentStatusResolver,\n): ComponentUsageEvent => ({\n  ...event.data,\n  status: resolveStatus(event.data.component),\n});\n"],"mappings":";;;AAyBA,IAAa,yBACX,OACA,mBACyB;CACzB,GAAG,MAAM;CACT,QAAQ,cAAc,MAAM,KAAK,SAAS;AAC5C"}