UNPKG

@copilotkit/a2ui-renderer

Version:

A2UI Renderer for CopilotKit - render A2UI surfaces in React applications

1 lines 1.44 kB
{"version":3,"file":"define.mjs","names":[],"sources":["../../src/web-components/define.ts"],"sourcesContent":["import { CpkA2uiBoundComponent } from \"./bound-component\";\nimport { CpkA2uiNode } from \"./node\";\nimport { CpkA2uiSurface } from \"./surface\";\n\nexport const CPK_A2UI_SURFACE_TAG = \"cpk-a2ui-surface\";\nexport const CPK_A2UI_NODE_TAG = \"cpk-a2ui-node\";\nexport const CPK_A2UI_BOUND_COMPONENT_TAG = \"cpk-a2ui-bound-component\";\n\nexport function defineA2UIWebComponents(): void {\n if (!customElements.get(CPK_A2UI_BOUND_COMPONENT_TAG)) {\n customElements.define(CPK_A2UI_BOUND_COMPONENT_TAG, CpkA2uiBoundComponent);\n }\n if (!customElements.get(CPK_A2UI_NODE_TAG)) {\n customElements.define(CPK_A2UI_NODE_TAG, CpkA2uiNode);\n }\n if (!customElements.get(CPK_A2UI_SURFACE_TAG)) {\n customElements.define(CPK_A2UI_SURFACE_TAG, CpkA2uiSurface);\n }\n}\n\nexport { CpkA2uiSurface, CpkA2uiNode, CpkA2uiBoundComponent };\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"cpk-a2ui-surface\": CpkA2uiSurface;\n \"cpk-a2ui-node\": CpkA2uiNode;\n \"cpk-a2ui-bound-component\": CpkA2uiBoundComponent;\n }\n}\n"],"mappings":";;;;;AAIA,MAAa,uBAAuB;AACpC,MAAa,oBAAoB;AACjC,MAAa,+BAA+B;AAE5C,SAAgB,0BAAgC;AAC9C,KAAI,CAAC,eAAe,IAAI,6BAA6B,CACnD,gBAAe,OAAO,8BAA8B,sBAAsB;AAE5E,KAAI,CAAC,eAAe,IAAI,kBAAkB,CACxC,gBAAe,OAAO,mBAAmB,YAAY;AAEvD,KAAI,CAAC,eAAe,IAAI,qBAAqB,CAC3C,gBAAe,OAAO,sBAAsB,eAAe"}