import { ComponentPlugin, ComponentPluginFactory } from '@teleporthq/teleport-types' import * as types from '@babel/types' import { AI_MESSAGE_CLASS_RE, findChatStyleTemplate, isChatComponent } from './style-template-utils' /** * Styles the markdown the AI chat bubble renders. * * The assistant's replies are markdown, rendered by a `markdown-node` * (`markdown-to-jsx`) whose children — links, lists, bold text — are created * at RUNTIME. They carry no styled-jsx scope class, and a generated site's own * global resets (`a { text-decoration: none; color: inherit }`, * `ul { list-style: none }`, `p { margin: 0 }` are all common) flatten them * into plain-looking text, so a perfectly-formatted answer reads as if * markdown never happened. * * The chat component is built from UIDL nodes whose styles are strictly * per-node, so descendant rules cannot be expressed there. This plugin appends * them to the component's existing `