/** * Web Component wrapper for AISelect (hand-crafted WC adapter). * Custom element: * * Wraps the React component with AIInteractionProvider so the * useAIInteraction() hook has context outside of AIMessage. * * @generated by scripts/generate-wc-components.ts * DO NOT EDIT MANUALLY */ import React from 'react'; import { AIInteractionProvider, AISelect, type SelectBlockSchema, } from '../components'; import { BaseCompoundWC, camelToKebab, dispatchEvent, installPropAccessors, type PropDefs, registerWC, } from './_shared'; const PROP_DEFS: PropDefs = { schema: 'json', }; class AISelectWC extends BaseCompoundWC { get propDefs(): PropDefs { return PROP_DEFS; } static get observedAttributes(): string[] { return Object.keys(PROP_DEFS).map(camelToKebab); } protected _renderReact(): React.ReactElement { const props = this._readAllProps(); const schema = props.schema as SelectBlockSchema | undefined; if (!schema || typeof schema !== 'object' || !schema.id) { return React.createElement(React.Fragment); } const handleInteraction = (event: unknown): void => { dispatchEvent(this, 'interaction', event); }; return React.createElement( AIInteractionProvider, { onInteraction: handleInteraction }, React.createElement(AISelect, { schema }), ); } } installPropAccessors(AISelectWC, PROP_DEFS); registerWC('hf-ai-select', AISelectWC); export { AISelectWC }; export default AISelectWC;