@pstdio/ui 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MermaidComponent-x3aKzNXm.js → MermaidComponent-DDCxR-Gs.js} +2 -2
- package/dist/{MermaidComponent-x3aKzNXm.js.map → MermaidComponent-DDCxR-Gs.js.map} +1 -1
- package/dist/chat-ui.js +742 -726
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +1 -0
- package/dist/components/app-shell/command-palette.d.ts +16 -0
- package/dist/components/app-shell/file-tree.d.ts +7 -0
- package/dist/components/app-shell/mock-chat.d.ts +2 -0
- package/dist/components/app-shell/mock-data.d.ts +37 -0
- package/dist/components/app-shell/pages/project-list-page.d.ts +7 -0
- package/dist/components/app-shell/pages/sessions-page.d.ts +6 -0
- package/dist/components/app-shell/pages/settings-page.d.ts +5 -0
- package/dist/components/app-shell/pages/ticket-details-page.d.ts +7 -0
- package/dist/components/app-shell/pages/tickets-page.d.ts +7 -0
- package/dist/components/app-shell/pages/workspace-page.d.ts +1 -0
- package/dist/components/app-shell/resizable-panel.d.ts +13 -0
- package/dist/components/chat-ui/components/ai-message.d.ts +7 -5
- package/dist/components/chat-ui/components/chat-input.d.ts +1 -0
- package/dist/components/chat-ui/components/chat-panel.d.ts +1 -0
- package/dist/components/chat-ui/mocks/library/index.d.ts +10 -0
- package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -2
- package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
- package/dist/components/content-placeholder.d.ts +1 -0
- package/dist/components/header.d.ts +7 -0
- package/dist/components/list-row/list-row-actions.d.ts +10 -0
- package/dist/components/list-row/list-row.d.ts +2 -0
- package/dist/components/list-row/list-row.types.d.ts +85 -0
- package/dist/components/{sidebar-tree → list-row}/searchable-action-menu.d.ts +2 -2
- package/dist/components/panel-header.constants.d.ts +1 -1
- package/dist/components/resource-context-menu.d.ts +1 -2
- package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -3
- package/dist/components/sidebar/sidebar.store.d.ts +2 -0
- package/dist/components/sidebar/sidebar.types.d.ts +10 -4
- package/dist/components/tickets/tickets-workspace.d.ts +1 -0
- package/dist/components/tree-list/tree-list.d.ts +18 -0
- package/dist/components/tree-list/tree-list.types.d.ts +29 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +2474 -2381
- package/dist/index.js.map +1 -1
- package/dist/{rich-message-CoXTd5kw.js → rich-message-DeJwzVeV.js} +3 -3
- package/dist/rich-message-DeJwzVeV.js.map +1 -0
- package/dist/rich-text.js +2 -2
- package/dist/style.css +1 -1
- package/dist/theme/custom/index.d.ts +3 -0
- package/dist/theme/custom/monokai.json.d.ts +80 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/primitives/colors.d.ts +6 -0
- package/dist/theme/recipes/button.d.ts +28 -0
- package/dist/theme/recipes/kbd.d.ts +41 -0
- package/dist/theme/tokens/colors.d.ts +18 -6
- package/dist/{theme-BLGUwVOD.js → theme-Dq4r3aRE.js} +241 -135
- package/dist/theme-Dq4r3aRE.js.map +1 -0
- package/dist/theme.js +4 -2
- package/dist/utils/apply-theme-preference.d.ts +20 -2
- package/dist/utils/theme-preference.d.ts +4 -2
- package/package.json +1 -2
- package/dist/components/drawer-inline.d.ts +0 -24
- package/dist/components/file-selector.d.ts +0 -12
- package/dist/components/menu-item.d.ts +0 -42
- package/dist/components/pstdio-logo.d.ts +0 -2
- package/dist/components/sidebar-tree/sidebar-node-content.d.ts +0 -9
- package/dist/components/sidebar-tree/sidebar-tree.d.ts +0 -13
- package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +0 -68
- package/dist/rich-message-CoXTd5kw.js.map +0 -1
- package/dist/theme-BLGUwVOD.js.map +0 -1
|
@@ -299,7 +299,7 @@ const xe = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, rn = {
|
|
|
299
299
|
if (e[2] !== s || e[3] !== h || e[4] !== a) {
|
|
300
300
|
const p = a ? s.split(`
|
|
301
301
|
`) : [s];
|
|
302
|
-
u = /* @__PURE__ */ l(w, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: X, lineHeight: "1.5", overflowY: h ? "hidden" : "auto", background: "bg.
|
|
302
|
+
u = /* @__PURE__ */ l(w, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: X, lineHeight: "1.5", overflowY: h ? "hidden" : "auto", background: "bg.code", borderRadius: "md", width: "100%", children: a ? /* @__PURE__ */ l(w, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: p.map(ln) }) : /* @__PURE__ */ l(w, { as: "code", children: s }) }), e[2] = s, e[3] = h, e[4] = a, e[5] = u;
|
|
303
303
|
} else
|
|
304
304
|
u = e[5];
|
|
305
305
|
return u;
|
|
@@ -540,7 +540,7 @@ function Ge() {
|
|
|
540
540
|
function un(n) {
|
|
541
541
|
return n instanceof K;
|
|
542
542
|
}
|
|
543
|
-
const mn = vt(() => import("./MermaidComponent-
|
|
543
|
+
const mn = vt(() => import("./MermaidComponent-DDCxR-Gs.js"));
|
|
544
544
|
class J extends Y {
|
|
545
545
|
__code;
|
|
546
546
|
static getType() {
|
|
@@ -1509,4 +1509,4 @@ export {
|
|
|
1509
1509
|
tt as n,
|
|
1510
1510
|
vn as s
|
|
1511
1511
|
};
|
|
1512
|
-
//# sourceMappingURL=rich-message-
|
|
1512
|
+
//# sourceMappingURL=rich-message-DeJwzVeV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-message-DeJwzVeV.js","sources":["../src/components/rich-text/shared/components/content-editable.tsx","../src/components/resource-badge.tsx","../src/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkNode.tsx","../src/components/rich-text/markdown-editor/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.ts","../src/components/rich-text/theme/rich-text-theme.tsx","../src/components/rich-text/shared/components/default-rich-text-components.tsx","../src/components/rich-text/shared/nodes/DataTableNode.tsx","../src/components/rich-text/shared/plugins/EquationPlugin/EquationNode.tsx","../src/components/rich-text/shared/plugins/EquationPlugin/EquationPlugin.tsx","../src/components/rich-text/shared/plugins/HorizontalRulePlugin/HorizontalRuleNode.ts","../src/components/rich-text/shared/plugins/MermaidPlugin/MermaidNode.tsx","../src/components/rich-text/shared/plugins/HorizontalRulePlugin/horizontalRule.ts","../src/components/rich-text/shared/transformers/markdown-transformers.ts","../src/components/rich-text/shared/editor-config.ts","../src/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.tsx","../src/components/rich-text/shared/plugins/CodePlugin/CodeHighlightingPlugin.tsx","../src/components/rich-text/shared/plugins/ToggleEditablePlugin.tsx","../src/components/rich-text/shared/plugins/TreeViewPlugin/TreeViewPlugin.tsx","../src/components/rich-text/utils/markdown.ts","../src/components/rich-text/prompt-input/events.ts","../src/components/rich-text/prompt-input/commands.ts","../src/components/rich-text/prompt-input/plugins/CommentPlugin/nodes/CommentNode/CommentNode.tsx","../src/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentCommands.ts","../src/components/rich-text/prompt-input/plugins/CommentPlugin/hooks/useCommentSchema.ts","../src/components/rich-text/prompt-input/plugins/CommentPlugin/CommentPlugin.tsx","../src/components/rich-text/prompt-input/utils.ts","../src/components/rich-text/prompt-input/plugins/ImperativeAPIPlugin.tsx","../src/components/rich-text/prompt-input/plugins/keyboard-shortcuts.ts","../src/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.tsx","../src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/constants.ts","../src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/getSortedMenuOptions.ts","../src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenuItem.tsx","../src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/components/ReferenceMenu/ReferenceMenu.tsx","../src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/hooks/useContextLookup.tsx","../src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/utils/checkForTriggers.ts","../src/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.tsx","../src/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.tsx","../src/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.tsx","../src/components/rich-text/prompt-input/theme/prompt-input-theme.ts","../src/components/rich-text/prompt-input/prompt-input.tsx","../src/components/rich-text/shared/plugins/StateUpdatePlugin.tsx","../src/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkNode.tsx","../src/components/rich-text/rich-message/plugins/ReferenceLinkPlugin/ReferenceLinkTransformer.ts","../src/components/rich-text/rich-message/rich-message.tsx"],"sourcesContent":["import { Box, chakra } from \"@chakra-ui/react\";\nimport { ContentEditable as LexicalContentEditable } from \"@lexical/react/LexicalContentEditable\";\nimport { ScrollArea } from \"@/components/scroll-area\";\n\nconst StyledEditable = chakra(LexicalContentEditable);\n\ninterface ContentEditableProps {\n onRef?: (elem: HTMLDivElement) => void;\n fullWidth?: boolean;\n padding?: string;\n isRichMessage?: boolean;\n scrollable?: boolean;\n}\n\nexport function ContentEditable({\n onRef,\n fullWidth = false,\n padding,\n isRichMessage = false,\n scrollable = true,\n}: ContentEditableProps) {\n const editor = (\n <Box ref={onRef} width=\"100%\" minH=\"100%\" padding={padding}>\n <StyledEditable\n data-testid=\"content-editable\"\n height=\"fit-content\"\n minH=\"100%\"\n width=\"100%\"\n maxWidth={fullWidth ? \"100%\" : \"720px\"}\n marginInline={fullWidth ? \"0\" : \"auto\"}\n textStyle=\"paragraph/M/regular\"\n fontSize=\"calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale))\"\n position=\"relative\"\n outline=\"none\"\n />\n </Box>\n );\n\n if (!scrollable) return editor;\n\n return (\n <ScrollArea\n className=\"rich-text\"\n data-rich-message={isRichMessage ? \"true\" : undefined}\n height=\"100%\"\n minH=\"0\"\n position=\"relative\"\n contentProps={{ width: \"100%\", minH: \"100%\" }}\n >\n {editor}\n </ScrollArea>\n );\n}\n","import type { HTMLChakraProps } from \"@chakra-ui/react\";\nimport { chakra, IconButton, Spacer, Text } from \"@chakra-ui/react\";\nimport type { LucideIcon } from \"lucide-react\";\nimport { AlertTriangle, X } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { getFileTypeIcon } from \"../utils/get-file-type-icon\";\nimport { Tooltip } from \"./tooltip\";\n\nconst SIZE_STYLES = {\n sm: {\n container: {\n height: \"20px\",\n lineHeight: { base: \"20px\" },\n px: \"2xs\",\n },\n iconSize: 12,\n textStyle: \"xs\",\n },\n md: {\n container: {\n height: \"24px\",\n lineHeight: { base: \"24px\" },\n px: \"xs\",\n },\n iconSize: 14,\n textStyle: \"sm\",\n },\n} as const;\n\nconst TONE_STYLES = {\n neutral: {\n color: \"color.primary\",\n bg: \"bg.muted\",\n _hover: {\n bg: \"bg.emphasized\",\n },\n },\n accent: {\n color: \"var(--schub-foreground-accent)\",\n bg: \"var(--schub-accent-subtle)\",\n _hover: {\n bg: \"var(--schub-accent-subtle)\",\n },\n },\n} as const;\n\nexport interface MissingResourceBadgeProps {\n referenceId: string;\n onRemove?: (referenceId: string) => void;\n}\n\n/**\n * Shown when a reference points to a resource that no longer exists\n */\nexport const MissingResourceBadge = (props: MissingResourceBadgeProps) => {\n const { referenceId, onRemove } = props;\n return (\n <chakra.span\n height=\"24px\"\n lineHeight={{ base: \"24px\" }}\n gap=\"2xs\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n paddingX=\"xs\"\n borderRadius=\"xs\"\n color={`fg.error`}\n bg={`bg.accent-secondary.red-light`}\n _hover={{\n bg: `bg.accent-secondary.red-light`,\n }}\n >\n <chakra.span mr=\"xs\" display=\"inline-flex\">\n <AlertTriangle size={14} />\n </chakra.span>\n <Text maxW={{ base: \"17.5rem\" }} textOverflow=\"ellipsis\" whiteSpace=\"nowrap\" overflow=\"hidden\">\n Missing Reference\n </Text>\n <Spacer />\n {onRemove && (\n <IconButton\n color=\"fg.error\"\n aria-label=\"Remove reference\"\n size=\"2xs\"\n ml=\"sm\"\n variant=\"ghost\"\n _hover={{\n bg: \"transparent\",\n }}\n onClick={(e) => {\n e.stopPropagation();\n onRemove?.(referenceId);\n }}\n >\n <X size={12} />\n </IconButton>\n )}\n </chakra.span>\n );\n};\n\nexport type ResourceBadgeSize = keyof typeof SIZE_STYLES;\nexport type ResourceBadgeTone = keyof typeof TONE_STYLES;\n\nexport interface ResourceBadgeProps extends Omit<HTMLChakraProps<\"span\">, \"onSelect\"> {\n fileName: string;\n onRemove?: (fileName: string) => void;\n onSelect?: (fileName: string) => void;\n size?: ResourceBadgeSize;\n tone?: ResourceBadgeTone;\n icon?: ReactNode;\n}\n\nconst DEFAULT_SIZE: ResourceBadgeSize = \"md\";\nconst DEFAULT_TONE: ResourceBadgeTone = \"neutral\";\n\nexport const ResourceBadge = (props: ResourceBadgeProps) => {\n const { fileName, onSelect, onRemove, size = DEFAULT_SIZE, tone = DEFAULT_TONE, icon, ...rest } = props;\n const IconComp: LucideIcon = getFileTypeIcon(fileName);\n const sizeStyles = SIZE_STYLES[size];\n const toneStyles = TONE_STYLES[tone];\n\n return (\n <chakra.span\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n borderRadius=\"xs\"\n gap=\"2xs\"\n cursor={onSelect ? \"pointer\" : \"default\"}\n {...toneStyles}\n {...sizeStyles.container}\n onClick={(e) => {\n e.stopPropagation();\n onSelect?.(fileName);\n }}\n {...rest}\n >\n <chakra.span mr=\"xs\" display=\"inline-flex\">\n {icon ?? <IconComp size={sizeStyles.iconSize} />}\n </chakra.span>\n <Tooltip content={fileName}>\n <Text\n maxW={{ base: \"14rem\" }}\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n overflow=\"hidden\"\n textStyle={sizeStyles.textStyle}\n >\n {fileName}\n </Text>\n </Tooltip>\n <Spacer />\n {onRemove && (\n <IconButton\n aria-label=\"Remove reference\"\n size=\"2xs\"\n ml=\"xs\"\n variant=\"ghost\"\n _hover={{\n bg: \"transparent\",\n }}\n onClick={(e) => {\n e.stopPropagation();\n onRemove?.(fileName);\n }}\n >\n <X size={12} />\n </IconButton>\n )}\n </chakra.span>\n );\n};\n","import { Box } from \"@chakra-ui/react\";\nimport {\n DecoratorNode,\n type EditorConfig,\n type LexicalEditor,\n type LexicalNode,\n type NodeKey,\n type SerializedLexicalNode,\n type Spread,\n} from \"lexical\";\nimport type { ReactElement } from \"react\";\nimport { ResourceBadge } from \"../../../../resource-badge\";\n\nexport type SerializedReferenceLinkNode = Spread<\n {\n href: string;\n label?: string;\n },\n SerializedLexicalNode\n>;\n\nexport class ReferenceLinkNode extends DecoratorNode<ReactElement> {\n __href: string;\n __label?: string;\n\n static getType(): string {\n return \"reference-link\";\n }\n\n static clone(node: ReferenceLinkNode): ReferenceLinkNode {\n return new ReferenceLinkNode(node.__href, node.__label, node.__key);\n }\n\n constructor(href: string, label?: string, key?: NodeKey) {\n super(key);\n this.__href = href;\n this.__label = label;\n }\n\n createDOM(_config: EditorConfig, _editor: LexicalEditor): HTMLElement {\n return document.createElement(\"span\");\n }\n\n updateDOM(_prevNode: ReferenceLinkNode, _dom: HTMLElement, _config: EditorConfig): boolean {\n return false;\n }\n\n getTextContent(): string {\n const label = this.__label ?? this.__href;\n return `{{link('${label}')}}`;\n }\n\n exportJSON(): SerializedReferenceLinkNode {\n return {\n type: ReferenceLinkNode.getType(),\n version: 1,\n href: this.__href,\n label: this.__label,\n };\n }\n\n static importJSON(serializedNode: SerializedReferenceLinkNode): ReferenceLinkNode {\n return $createReferenceLinkNode(serializedNode.href, serializedNode.label);\n }\n\n decorate(_editor: LexicalEditor, _config: EditorConfig): ReactElement {\n const href = this.__href;\n const fileName = href.split(\"/\").pop();\n const label = fileName || \"unknown\";\n const isExternal = /^https?:\\/\\//i.test(href);\n const isProjectFile = /^#?\\$PROJECT\\//i.test(href);\n\n return (\n <Box width=\"fit-content\" display=\"inline-block\">\n <ResourceBadge\n fileName={label}\n onSelect={() => {\n if (isExternal) {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n } else if (isProjectFile) {\n const projectPath = href.replace(/^#?\\$PROJECT\\//i, \"\");\n const event = new CustomEvent(\"ui:open-project-file\", { detail: projectPath });\n window.dispatchEvent(event);\n } else {\n window.location.assign(href);\n }\n }}\n />\n </Box>\n );\n }\n}\n\nexport function $createReferenceLinkNode(href: string, label?: string): ReferenceLinkNode {\n return new ReferenceLinkNode(href, label);\n}\n\nexport function $isReferenceLinkNode(node: LexicalNode | null | undefined): node is ReferenceLinkNode {\n return node instanceof ReferenceLinkNode;\n}\n","import type { TextMatchTransformer } from \"@lexical/markdown\";\nimport { $createReferenceLinkNode, $isReferenceLinkNode, ReferenceLinkNode } from \"./ReferenceLinkNode\";\n\n// Matches {{link('xxx')}} or {{ link(\"xxx\") }}\nconst LINK_REGEXP = /\\{\\{\\s*link\\((['\"])([^'\"\\s]+)\\1\\)\\s*\\}\\}/;\n\nexport const REFERENCE_LINK_TRANSFORMER: TextMatchTransformer = {\n dependencies: [ReferenceLinkNode],\n export: (node) => {\n if ($isReferenceLinkNode(node)) {\n const href = (node as ReferenceLinkNode).__href;\n const label = (node as ReferenceLinkNode).__label ?? href;\n // Export back to token form so markdown roundtrips\n if (label) {\n return `{{link('${label}')}}`;\n }\n return `{{link('${href}')}}`;\n }\n return null;\n },\n regExp: LINK_REGEXP,\n importRegExp: LINK_REGEXP,\n replace: (textNode, match) => {\n const value = match[2];\n // For now we assume value is both label and href; if it looks like a URL, use as href.\n const looksLikeUrl = /^(https?:\\/\\/|\\/)/i.test(value);\n const href = looksLikeUrl ? value : `#${value}`;\n const label = value;\n textNode.replace($createReferenceLinkNode(href, label));\n },\n type: \"text-match\",\n};\n","import type { EditorThemeClasses } from \"lexical\";\n\nimport \"./rich-text-theme.css\";\n\nconst theme: EditorThemeClasses = {\n code: \"rich-text__code\",\n codeHighlight: {\n atrule: \"rich-text__tokenAttr\",\n attr: \"rich-text__tokenAttr\",\n boolean: \"rich-text__tokenProperty\",\n builtin: \"rich-text__tokenSelector\",\n cdata: \"rich-text__tokenComment\",\n char: \"rich-text__tokenSelector\",\n class: \"rich-text__tokenFunction\",\n \"class-name\": \"rich-text__tokenFunction\",\n comment: \"rich-text__tokenComment\",\n constant: \"rich-text__tokenProperty\",\n deleted: \"rich-text__tokenProperty\",\n doctype: \"rich-text__tokenComment\",\n entity: \"rich-text__tokenOperator\",\n function: \"rich-text__tokenFunction\",\n important: \"rich-text__tokenVariable\",\n inserted: \"rich-text__tokenSelector\",\n keyword: \"rich-text__tokenAttr\",\n namespace: \"rich-text__tokenVariable\",\n number: \"rich-text__tokenProperty\",\n operator: \"rich-text__tokenOperator\",\n prolog: \"rich-text__tokenComment\",\n property: \"rich-text__tokenProperty\",\n punctuation: \"rich-text__tokenPunctuation\",\n regex: \"rich-text__tokenVariable\",\n selector: \"rich-text__tokenSelector\",\n string: \"rich-text__tokenSelector\",\n symbol: \"rich-text__tokenProperty\",\n tag: \"rich-text__tokenProperty\",\n url: \"rich-text__tokenOperator\",\n variable: \"rich-text__tokenVariable\",\n },\n embedBlock: {\n base: \"rich-text__embedBlock\",\n focus: \"rich-text__embedBlockFocus\",\n },\n list: {\n checklist: \"rich-text__checklist\",\n listitem: \"rich-text__listItem\",\n listitemChecked: \"rich-text__listItemChecked\",\n listitemUnchecked: \"rich-text__listItemUnchecked\",\n nested: {\n listitem: \"rich-text__nestedListItem\",\n },\n olDepth: [\"rich-text__ol1\", \"rich-text__ol2\", \"rich-text__ol3\", \"rich-text__ol4\", \"rich-text__ol5\"],\n ol: \"rich-text__ol\",\n ul: \"rich-text__ul\",\n },\n heading: {\n h1: \"rich-text__h1\",\n h2: \"rich-text__h2\",\n h3: \"rich-text__h3\",\n },\n paragraph: \"rich-text__p\",\n text: {\n underline: \"rich-text__textUnderline\",\n italic: \"rich-text__textItalic\",\n code: \"rich-text__textCode\",\n },\n link: \"rich-text__link\",\n quote: \"rich-text__quote\",\n reference: \"rich-text__reference\",\n table: \"rich-text__table\",\n tableCell: \"rich-text__tableCell\",\n tableRow: \"rich-text__tableRow\",\n tableCellHeader: \"rich-text__tableCellHeader\",\n layoutContainer: \"rich-text__layoutContainer\",\n layoutItem: \"rich-text__layoutItem\",\n draggableBlockDemo: {\n row: \"rich-text__row\",\n content: \"rich-text__content\",\n },\n};\n\nexport default theme;\n","import { Box, Table, Text, Textarea } from \"@chakra-ui/react\";\nimport type { CodeEditorProps, DataTableProps } from \"../types/rich-text-components\";\n\nconst scaledSmallFontSize = \"calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))\";\n\nconst formatValue = (value: unknown) => {\n if (value === null || value === undefined) return \"-\";\n if (typeof value === \"string\") return value.length ? value : \"-\";\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value).toUpperCase();\n if (value instanceof Date) return value.toISOString();\n return JSON.stringify(value);\n};\n\nexport const DefaultRichTextCodeEditor = (props: CodeEditorProps) => {\n const { defaultCode = \"\", isEditable = false, showLineNumbers = false, disableScroll = false } = props;\n\n if (isEditable) {\n return (\n <Textarea\n defaultValue={defaultCode}\n fontFamily=\"mono\"\n fontSize={scaledSmallFontSize}\n resize=\"vertical\"\n minHeight=\"100%\"\n />\n );\n }\n\n const lines = showLineNumbers ? defaultCode.split(\"\\n\") : [defaultCode];\n\n return (\n <Box\n as=\"pre\"\n margin={0}\n padding=\"sm\"\n fontFamily=\"mono\"\n fontSize={scaledSmallFontSize}\n lineHeight=\"1.5\"\n overflowY={disableScroll ? \"hidden\" : \"auto\"}\n background=\"bg.code\"\n borderRadius=\"md\"\n width=\"100%\"\n >\n {showLineNumbers ? (\n <Box as=\"code\" display=\"grid\" gridTemplateColumns=\"auto 1fr\" columnGap=\"sm\">\n {lines.map((line, index) => (\n <Box as=\"span\" key={`${index}-${line}`} display=\"contents\">\n <Text as=\"span\" color=\"fg.muted\" textAlign=\"right\" fontSize=\"inherit\">\n {index + 1}\n </Text>\n <Text as=\"span\" fontSize=\"inherit\">\n {line.length ? line : \" \"}\n </Text>\n </Box>\n ))}\n </Box>\n ) : (\n <Box as=\"code\">{defaultCode}</Box>\n )}\n </Box>\n );\n};\n\nexport const DefaultRichTextDataTable = (props: DataTableProps) => {\n const { data, fullWidth = false, noBorder = false, hiddenColumns = [] } = props;\n\n if (!data.length) {\n return (\n <Box padding=\"sm\" borderWidth={noBorder ? \"0\" : \"1px\"} borderColor=\"border.muted\">\n <Text textStyle=\"label/S/regular\" fontSize={scaledSmallFontSize} color=\"fg.muted\">\n No data\n </Text>\n </Box>\n );\n }\n\n const hiddenSet = new Set(hiddenColumns);\n const columns = Object.keys(data[0] ?? {}).filter((key) => !hiddenSet.has(key));\n\n return (\n <Table.ScrollArea overflowX=\"auto\" maxWidth=\"100%\">\n <Table.Root\n size=\"sm\"\n width={fullWidth ? \"100%\" : \"fit-content\"}\n borderWidth={noBorder ? \"0\" : \"1px\"}\n borderColor=\"border.muted\"\n >\n <Table.Header>\n <Table.Row background=\"bg.muted\">\n {columns.map((column) => (\n <Table.ColumnHeader key={column} textTransform=\"none\" paddingX=\"xs\" paddingY=\"2xs\">\n <Text textStyle=\"label/S/medium\" fontSize={scaledSmallFontSize}>\n {column}\n </Text>\n </Table.ColumnHeader>\n ))}\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {data.map((row, rowIndex) => (\n <Table.Row key={`${rowIndex}-${columns.join(\"-\")}`}>\n {columns.map((column) => (\n <Table.Cell key={`${rowIndex}-${column}`} paddingX=\"xs\" paddingY=\"2xs\">\n <Text textStyle=\"paragraph/S/regular\" fontSize={scaledSmallFontSize}>\n {formatValue(row[column])}\n </Text>\n </Table.Cell>\n ))}\n </Table.Row>\n ))}\n </Table.Body>\n </Table.Root>\n </Table.ScrollArea>\n );\n};\n","import { DecoratorNode, type NodeKey, type SerializedLexicalNode, type Spread } from \"lexical\";\nimport type React from \"react\";\nimport { DefaultRichTextDataTable } from \"../components/default-rich-text-components\";\nimport type { RowData } from \"../types/rich-text-components\";\n\nexport type { RowData } from \"../types/rich-text-components\";\n\nexport class DataTableNode extends DecoratorNode<React.JSX.Element> {\n __data: RowData[];\n\n static getType() {\n return \"data_table\";\n }\n\n static clone(node: DataTableNode) {\n return new DataTableNode(node.__data, node.__key);\n }\n\n constructor(data: RowData[], key?: NodeKey) {\n super(key);\n this.__data = data;\n }\n\n getData(): RowData[] {\n return this.__data;\n }\n\n createDOM(): HTMLElement {\n return document.createElement(\"div\");\n }\n\n updateDOM(): boolean {\n return false;\n }\n\n decorate() {\n return <DefaultRichTextDataTable fullWidth isReadOnly data={this.__data} />;\n }\n\n exportJSON(): SerializedDataTableNode {\n return {\n type: \"data_table\",\n version: 1,\n data: this.__data,\n };\n }\n\n static importJSON(json: SerializedDataTableNode) {\n return new DataTableNode(json.data);\n }\n\n getTextContent(): string {\n // Convert table data to a readable text representation\n if (!this.__data.length) return \"\";\n\n const headers = Object.keys(this.__data[0]);\n const headerRow = headers.join(\" | \");\n const separator = headers.map(() => \"---\").join(\" | \");\n const dataRows = this.__data.map((row) => headers.map((header) => String(row[header] || \"\")).join(\" | \"));\n\n return [headerRow, separator, ...dataRows].join(\"\\n\");\n }\n}\n\nexport type SerializedDataTableNode = Spread<{ data: RowData[] }, SerializedLexicalNode>;\n\nexport function $createDataTableNode(data: RowData[]) {\n return new DataTableNode(data);\n}\n\nexport function $isDataTableNode(node: unknown): node is DataTableNode {\n return node instanceof DataTableNode;\n}\n","import katex from \"katex\";\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n EditorConfig,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from \"lexical\";\nimport { $applyNodeReplacement, DecoratorNode, type DOMExportOutput } from \"lexical\";\nimport * as React from \"react\";\nimport { Suspense } from \"react\";\n\nconst EquationComponent = React.lazy(() => import(\"./EquationComponent\"));\n\nexport type SerializedEquationNode = Spread<\n {\n equation: string;\n inline: boolean;\n },\n SerializedLexicalNode\n>;\n\nfunction $convertEquationElement(domNode: HTMLElement): null | DOMConversionOutput {\n let equation = domNode.getAttribute(\"data-lexical-equation\");\n const inline = domNode.getAttribute(\"data-lexical-inline\") === \"true\";\n\n // Decode the equation from base64\n equation = atob(equation || \"\");\n\n if (equation) {\n const node = $createEquationNode(equation, inline);\n return { node };\n }\n\n return null;\n}\n\nexport class EquationNode extends DecoratorNode<React.ReactNode> {\n __equation: string;\n __inline: boolean;\n\n static getType(): string {\n return \"equation\";\n }\n\n static clone(node: EquationNode): EquationNode {\n return new EquationNode(node.__equation, node.__inline, node.__key);\n }\n\n constructor(equation: string, inline?: boolean, key?: NodeKey) {\n super(key);\n this.__equation = equation;\n this.__inline = inline ?? false;\n }\n\n static importJSON(serializedNode: SerializedEquationNode): EquationNode {\n return $createEquationNode(serializedNode.equation, serializedNode.inline);\n }\n\n exportJSON(): SerializedEquationNode {\n return {\n equation: this.getEquation(),\n inline: this.__inline,\n type: \"equation\",\n version: 1,\n };\n }\n\n createDOM(_config: EditorConfig): HTMLElement {\n const element = document.createElement(this.__inline ? \"span\" : \"div\");\n\n // EquationNodes should implement `user-action:none` in their CSS to avoid issues with deletion on Android.\n element.className = \"editor-equation\";\n return element;\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement(this.__inline ? \"span\" : \"div\");\n\n // Encode the equation as base64 to avoid issues with special characters\n const equation = btoa(this.__equation);\n element.setAttribute(\"data-lexical-equation\", equation);\n element.setAttribute(\"data-lexical-inline\", `${this.__inline}`);\n katex.render(this.__equation, element, {\n displayMode: !this.__inline, // true === block display //\n errorColor: \"#cc0000\",\n output: \"html\",\n strict: \"warn\",\n throwOnError: false,\n trust: false,\n });\n\n return { element };\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n div: (domNode: HTMLElement) => {\n if (!domNode.hasAttribute(\"data-lexical-equation\")) {\n return null;\n }\n\n return {\n conversion: $convertEquationElement,\n priority: 2,\n };\n },\n span: (domNode: HTMLElement) => {\n if (!domNode.hasAttribute(\"data-lexical-equation\")) {\n return null;\n }\n\n return {\n conversion: $convertEquationElement,\n priority: 1,\n };\n },\n };\n }\n\n updateDOM(prevNode: EquationNode): boolean {\n // If the inline property changes, replace the element\n return this.__inline !== prevNode.__inline;\n }\n\n getTextContent(): string {\n return this.__equation;\n }\n\n getEquation(): string {\n return this.__equation;\n }\n\n setEquation(equation: string): void {\n const writable = this.getWritable();\n writable.__equation = equation;\n }\n\n isInline(): boolean {\n return this.__inline;\n }\n\n decorate() {\n return (\n <Suspense fallback={null}>\n <EquationComponent equation={this.__equation} inline={this.__inline} />\n </Suspense>\n );\n }\n}\n\nexport function $createEquationNode(equation = \"\", inline = false): EquationNode {\n const equationNode = new EquationNode(equation, inline);\n return $applyNodeReplacement(equationNode);\n}\n\nexport function $isEquationNode(node: LexicalNode | null | undefined): node is EquationNode {\n return node instanceof EquationNode;\n}\n","import \"./EquationPlugin.css\";\n\nimport type { MultilineElementTransformer, TextMatchTransformer } from \"@lexical/markdown\";\nimport { $createEquationNode, $isEquationNode, EquationNode } from \"./EquationNode.tsx\";\n\nexport const EQUATION_INLINE: TextMatchTransformer = {\n dependencies: [EquationNode],\n export: (node) => {\n if ($isEquationNode(node) && node.isInline()) {\n return `\\\\( ${node.getEquation().trim()} \\\\)`;\n }\n return null;\n },\n importRegExp: /\\\\\\((.*?)\\\\\\)/,\n regExp: /\\\\\\((.*?)\\\\\\)/,\n replace: (textNode, match) => {\n const equationNode = $createEquationNode(match[1].trim(), true);\n textNode.replace(equationNode);\n },\n type: \"text-match\",\n};\n\nexport const EQUATION_MULTILINE: MultilineElementTransformer = {\n dependencies: [EquationNode],\n regExpStart: /\\\\\\[/,\n regExpEnd: /\\\\]/,\n export: (node) => {\n if ($isEquationNode(node) && !node.isInline()) {\n return `\\\\[ ${node.getEquation().trim()} \\\\]`;\n }\n return null;\n },\n replace: (rootNode, _children, _startMatch, _endMatch, linesInBetween) => {\n if (linesInBetween) {\n rootNode.append($createEquationNode(linesInBetween.join(\" \"), false));\n return true;\n }\n return false;\n },\n type: \"multiline-element\",\n};\n\nexport function EquationPlugin(): null {\n return null;\n}\n","import {\n type EditorConfig,\n ElementNode,\n type LexicalEditor,\n type LexicalNode,\n type SerializedElementNode,\n type Spread,\n} from \"lexical\";\n\nexport type SerializedHRNode = Spread<SerializedElementNode, SerializedElementNode>;\n\nexport class HRNode extends ElementNode {\n static getType() {\n return \"hr\";\n }\n\n static clone(node: HRNode) {\n return new HRNode(node?.__key);\n }\n\n static importJSON(_serializedNode: SerializedHRNode) {\n return $createHRNode();\n }\n\n exportJSON(): SerializedHRNode {\n return {\n ...super.exportJSON(),\n };\n }\n\n createDOM(_config: EditorConfig, _editor: LexicalEditor): HTMLElement {\n const element = document.createElement(\"hr\");\n element.style = \"margin: 2rem 0;\";\n return element;\n }\n\n updateDOM(_prevNode: unknown, _dom: HTMLElement, _config: EditorConfig): boolean {\n return false;\n }\n\n decorate(_editor: LexicalEditor) {\n return null;\n }\n}\n\nexport function $createHRNode(): HRNode {\n return new HRNode();\n}\n\nexport function $isHRNode(node: LexicalNode | null | undefined): node is HRNode {\n return node instanceof HRNode;\n}\n","import type { LexicalNode, NodeKey, SerializedLexicalNode } from \"lexical\";\nimport { $applyNodeReplacement, DecoratorNode } from \"lexical\";\nimport type { ReactNode } from \"react\";\nimport { lazy, Suspense } from \"react\";\n\nconst MermaidComponent = lazy(() => import(\"./MermaidComponent\"));\n\nexport interface SerializedMermaidNode extends SerializedLexicalNode {\n type: \"mermaid\";\n code: string;\n version: 1;\n}\n\nexport class MermaidNode extends DecoratorNode<ReactNode> {\n __code: string;\n\n static getType() {\n return \"mermaid\";\n }\n\n static clone(node: MermaidNode) {\n return new MermaidNode(node.__code, node.__key);\n }\n\n constructor(code: string, key?: NodeKey) {\n super(key);\n this.__code = code;\n }\n\n createDOM() {\n return document.createElement(\"div\");\n }\n\n updateDOM() {\n return false;\n }\n\n static importJSON(serializedNode: SerializedMermaidNode): MermaidNode {\n return new MermaidNode(serializedNode.code);\n }\n\n exportJSON(): SerializedMermaidNode {\n return {\n type: \"mermaid\",\n code: this.__code,\n version: 1,\n };\n }\n\n getTextContent() {\n return `\\`\\`\\`mermaid\\n${this.__code}\\n\\`\\`\\``;\n }\n\n getCode() {\n return this.__code;\n }\n\n setCode(code: string) {\n const writable = this.getWritable();\n writable.__code = code;\n }\n\n decorate() {\n return (\n <Suspense fallback={null}>\n <MermaidComponent code={this.__code} nodeKey={this.__key} />\n </Suspense>\n );\n }\n}\n\nexport function $createMermaidNode(code = \"\") {\n const mermaidNode = new MermaidNode(code);\n return $applyNodeReplacement(mermaidNode);\n}\n\nexport function $isMermaidNode(node: LexicalNode | null | undefined): node is MermaidNode {\n return node instanceof MermaidNode;\n}\n","import type { ElementTransformer } from \"@lexical/markdown\";\nimport type { LexicalNode } from \"lexical\";\nimport { $createHRNode, $isHRNode, HRNode } from \"./HorizontalRuleNode\";\n\nexport const HR: ElementTransformer = {\n dependencies: [HRNode],\n export: (node: LexicalNode) => {\n return $isHRNode(node) ? \"***\" : null;\n },\n regExp: /^(---|\\*\\*\\*|___)\\s?$/,\n replace: (parentNode) => {\n const line = $createHRNode();\n parentNode.replace(line);\n },\n type: \"element\",\n};\n","import { $createAutoLinkNode, $isAutoLinkNode, AutoLinkNode } from \"@lexical/link\";\nimport type { ElementTransformer, TextMatchTransformer } from \"@lexical/markdown\";\nimport { $createTextNode, TextNode } from \"lexical\";\nimport { $createDataTableNode, $isDataTableNode, type RowData } from \"../nodes/DataTableNode\";\nimport { HR } from \"../plugins/HorizontalRulePlugin/horizontalRule\";\n\nexport const TABLE: ElementTransformer = {\n dependencies: [],\n export: (node, _traverseChildren) => {\n if ($isDataTableNode(node)) {\n const data = node.getData();\n\n if (!data.length) return \"\";\n\n const headers = Object.keys(data[0]);\n const headerRow = headers.join(\" | \");\n const separator = headers.map(() => \"---\").join(\" | \");\n const dataRows = data.map((row) => headers.map((header) => String(row[header] || \"\")).join(\" | \"));\n\n return [`| ${headerRow} |`, `| ${separator} |`, ...dataRows.map((row) => `| ${row} |`)].join(\"\\n\");\n }\n\n return null;\n },\n regExp: /^\\s*(\\|.+\\|)\\s*$/,\n replace: (parentNode, _children, match, _isImport) => {\n const previousNode = parentNode.getPreviousSibling();\n const isTableDelimiter = /^\\|?\\s*:?-{3,}:?\\s*(?:\\|\\s*:?-{3,}:?\\s*)*\\|?$/gm.test(match[0]);\n\n // if it is a delimiter, remove it\n if (isTableDelimiter) {\n parentNode.remove();\n return;\n }\n\n // Parse current row\n const cells = match[0]\n .split(\"|\")\n .slice(1, -1)\n .map((cell) => cell.trim());\n\n if (previousNode?.getType() === \"data_table\" && $isDataTableNode(previousNode)) {\n // Add row to existing table\n const existingData = previousNode.getData();\n const newRow: RowData = {};\n\n // Check if we have a placeholder row with empty values (created from headers)\n const isPlaceholderRow =\n existingData.length === 1 && Object.values(existingData[0]).every((value) => value === \"\");\n\n // Get headers from existing data structure\n const headers = existingData.length > 0 ? Object.keys(existingData[0]) : cells.map((_, index) => `col_${index}`);\n\n cells.forEach((cell, index) => {\n const header = headers[index] || `col_${index}`;\n newRow[header] = cell;\n });\n\n // If we had a placeholder row, replace it; otherwise append\n const newTableData = isPlaceholderRow ? [newRow] : [...existingData, newRow];\n const newTableNode = $createDataTableNode(newTableData);\n previousNode.replace(newTableNode);\n parentNode.remove();\n } else {\n // Create new table - treat first row as headers\n // Create a temporary empty row with these headers, which will be replaced when actual data comes\n const newRow: RowData = {};\n cells.forEach((cell, index) => {\n newRow[cell || `col_${index}`] = \"\";\n });\n\n const tableNode = $createDataTableNode([newRow]);\n parentNode.replace(tableNode);\n }\n },\n type: \"element\",\n};\n\nexport const UNDERLINE_INS_TAG: TextMatchTransformer = {\n dependencies: [TextNode],\n export: (node, _children) => {\n if (node instanceof TextNode) {\n let markdownText = node.getTextContent();\n\n if (node.hasFormat(\"bold\")) {\n markdownText = `**${markdownText}**`;\n } else if (node.hasFormat(\"italic\")) {\n markdownText = `*${markdownText}*`;\n } else if (node.hasFormat(\"underline\")) {\n markdownText = `<ins>${markdownText}</ins>`;\n } else {\n return null;\n }\n\n return markdownText;\n }\n return null;\n },\n regExp: /<ins>(.*)<\\/ins>/,\n importRegExp: /<ins>(.*)<\\/ins>/,\n replace: (node, match) => {\n const textNode = $createTextNode(match[1]);\n textNode.toggleFormat(\"underline\");\n node.replace(textNode);\n },\n type: \"text-match\",\n};\n\nexport const UNDERLINE_U_TAG: TextMatchTransformer = {\n dependencies: [TextNode],\n export: (_node, _children) => {\n return null;\n },\n regExp: /<u>(.*)<\\/u>/,\n importRegExp: /<u>(.*)<\\/u>/,\n replace: (node, match) => {\n const textNode = $createTextNode(match[1]);\n textNode.toggleFormat(\"underline\");\n node.replace(textNode);\n },\n type: \"text-match\",\n};\n\nconst BARE_URL_REGEXP = /https?:\\/\\/[^\\s<>\"']*[^\\s<>\"'.,:;\"')\\]}]/;\n\nexport const BARE_URL: TextMatchTransformer = {\n dependencies: [AutoLinkNode],\n export: (node, exportChildren) => {\n if (!$isAutoLinkNode(node)) {\n return null;\n }\n\n return exportChildren(node);\n },\n regExp: BARE_URL_REGEXP,\n importRegExp: BARE_URL_REGEXP,\n replace: (textNode, match) => {\n const href = match[0];\n const autoLinkNode = $createAutoLinkNode(href);\n const linkTextNode = $createTextNode(href);\n\n linkTextNode.setFormat(textNode.getFormat());\n autoLinkNode.append(linkTextNode);\n textNode.replace(autoLinkNode);\n },\n type: \"text-match\",\n};\n\nexport const TRANSFORMERS_EXTENDED = [TABLE, HR, UNDERLINE_INS_TAG, UNDERLINE_U_TAG, BARE_URL];\n","import { CodeHighlightNode, CodeNode } from \"@lexical/code\";\nimport { AutoLinkNode, LinkNode } from \"@lexical/link\";\nimport { ListItemNode, ListNode } from \"@lexical/list\";\nimport { CHECK_LIST, TRANSFORMERS } from \"@lexical/markdown\";\nimport { HeadingNode, QuoteNode } from \"@lexical/rich-text\";\nimport type { Klass, LexicalNode } from \"lexical\";\nimport { REFERENCE_LINK_TRANSFORMER, ReferenceLinkNode } from \"../markdown-editor/plugins/ReferenceLinkPlugin\";\nimport theme from \"../theme/rich-text-theme\";\nimport { DataTableNode } from \"./nodes/DataTableNode\";\nimport { EquationNode } from \"./plugins/EquationPlugin/EquationNode\";\nimport { EQUATION_INLINE, EQUATION_MULTILINE } from \"./plugins/EquationPlugin/EquationPlugin\";\nimport { HRNode } from \"./plugins/HorizontalRulePlugin/HorizontalRuleNode\";\nimport { MermaidNode } from \"./plugins/MermaidPlugin/MermaidNode\";\nimport { TRANSFORMERS_EXTENDED } from \"./transformers/markdown-transformers\";\n\nexport const editorNodes: Array<Klass<LexicalNode>> = [\n QuoteNode,\n LinkNode,\n AutoLinkNode,\n DataTableNode,\n HeadingNode,\n ListNode,\n ListItemNode,\n CodeNode,\n CodeHighlightNode,\n MermaidNode,\n EquationNode,\n HRNode,\n ReferenceLinkNode,\n];\n\nexport const editorTransformers = [\n CHECK_LIST,\n ...TRANSFORMERS,\n ...TRANSFORMERS_EXTENDED,\n EQUATION_INLINE,\n EQUATION_MULTILINE,\n REFERENCE_LINK_TRANSFORMER,\n];\n\nexport const editorTheme = theme;\n","import { CodeNode } from \"@lexical/code\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { $nodesOfType } from \"lexical\";\nimport { useEffect } from \"react\";\nimport { MermaidNode } from \"../MermaidPlugin/MermaidNode\";\n\nfunction isMermaidLanguage(language: string) {\n return language.trim().toLowerCase() === \"mermaid\";\n}\n\nexport function replaceCodeNodeWithMermaidNode(node: CodeNode) {\n const language = node.getLanguage() ?? \"plaintext\";\n if (!isMermaidLanguage(language)) {\n return false;\n }\n\n node.replace(new MermaidNode(node.getTextContent()));\n return true;\n}\n\nexport function ImportCodeBlocksPlugin() {\n const [editor] = useLexicalComposerContext();\n\n useEffect(() => {\n editor.update(() => {\n const codeNodes = $nodesOfType(CodeNode);\n for (const n of codeNodes) {\n replaceCodeNodeWithMermaidNode(n);\n }\n });\n }, [editor]);\n\n return null;\n}\n","import { registerCodeHighlighting } from \"@lexical/code\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { useEffect } from \"react\";\n\nexport function CodeHighlightingPlugin() {\n const [editor] = useLexicalComposerContext();\n\n useEffect(() => {\n return registerCodeHighlighting(editor);\n }, [editor]);\n\n return null;\n}\n","import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { useEffect } from \"react\";\n\nexport default function ToggleEditablePlugin({ isEditable }: { isEditable: boolean }) {\n const [editor] = useLexicalComposerContext();\n\n useEffect(() => {\n editor.setEditable(isEditable);\n }, [isEditable, editor]);\n\n return null;\n}\n","import { Box } from \"@chakra-ui/react\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { TreeView } from \"@lexical/react/LexicalTreeView\";\n\nexport function TreeViewPlugin() {\n const [editor] = useLexicalComposerContext();\n return (\n <Box fontSize=\"xs\" color=\"fg.muted\" padding=\"4\">\n <TreeView\n treeTypeButtonClassName=\"debug-treetype-button\"\n timeTravelButtonClassName=\"debug-timetravel-button\"\n timeTravelPanelButtonClassName=\"debug-timetravel-button\"\n timeTravelPanelClassName=\"debug-timetravel-panel\"\n timeTravelPanelSliderClassName=\"debug-timetravel-slider\"\n viewClassName=\"tree-view-output\"\n editor={editor}\n />\n </Box>\n );\n}\n","const FRONTMATTER_PATTERN = /^---\\s*\\n([\\s\\S]*?)\\n---\\s*(?:\\n|$)/;\n\nconst FENCE_PATTERN = /^```/;\nconst LIST_ITEM_PATTERN = /^([ \\t]*)((?:[-*+])|(?:\\d+\\.))\\s+/;\nconst INDENTED_LINE_PATTERN = /^([ \\t]+)/;\n\ninterface ActiveListIndent {\n normalizedIndentWidth: number;\n sourceIndentWidth: number;\n}\n\ninterface MarkdownListState {\n isInCodeFence: boolean;\n activeListIndents: ActiveListIndent[];\n}\n\nfunction getExpandedIndentWidth(indent: string) {\n let width = 0;\n\n for (const char of indent) {\n width += char === \"\\t\" ? 4 : 1;\n }\n\n return width;\n}\n\nfunction findParentIndent(activeListIndents: ActiveListIndent[], sourceIndentWidth: number) {\n return [...activeListIndents].reverse().find((indent) => indent.sourceIndentWidth < sourceIndentWidth);\n}\n\nfunction toNormalizedIndent(indent: string, normalizedWidth: number, sourceWidth: number) {\n if (normalizedWidth === sourceWidth && !indent.includes(\"\\t\")) return indent;\n return \" \".repeat(normalizedWidth);\n}\n\nfunction normalizeIndentedContinuation(line: string, activeListIndents: ActiveListIndent[]) {\n const indentedLineMatch = line.match(INDENTED_LINE_PATTERN);\n if (!indentedLineMatch) {\n if (line.trim() !== \"\") {\n activeListIndents.length = 0;\n }\n\n return line;\n }\n\n const sourceIndentWidth = getExpandedIndentWidth(indentedLineMatch[1]);\n const parentLevel = findParentIndent(activeListIndents, sourceIndentWidth);\n if (!parentLevel) return line;\n\n const normalizedIndentWidth = sourceIndentWidth + (parentLevel.normalizedIndentWidth - parentLevel.sourceIndentWidth);\n const normalizedIndent = toNormalizedIndent(indentedLineMatch[1], normalizedIndentWidth, sourceIndentWidth);\n\n if (normalizedIndent === indentedLineMatch[1]) return line;\n\n return `${normalizedIndent}${line.slice(indentedLineMatch[1].length)}`;\n}\n\nfunction normalizeListItem(line: string, match: RegExpMatchArray, activeListIndents: ActiveListIndent[]) {\n const sourceIndentWidth = getExpandedIndentWidth(match[1]);\n\n while (activeListIndents.length && activeListIndents.at(-1)!.sourceIndentWidth > sourceIndentWidth) {\n activeListIndents.pop();\n }\n\n const currentLevel = activeListIndents.at(-1);\n if (currentLevel?.sourceIndentWidth === sourceIndentWidth) {\n return `${toNormalizedIndent(match[1], currentLevel.normalizedIndentWidth, sourceIndentWidth)}${line.slice(match[1].length)}`;\n }\n\n const parentLevel = activeListIndents.at(-1);\n const indentStep = sourceIndentWidth - (parentLevel?.sourceIndentWidth ?? 0);\n let normalizedIndentWidth = sourceIndentWidth;\n\n if (parentLevel && indentStep === 2 && !match[1].includes(\"\\t\")) {\n normalizedIndentWidth = parentLevel.normalizedIndentWidth + 4;\n }\n\n activeListIndents.push({ normalizedIndentWidth, sourceIndentWidth });\n\n return `${toNormalizedIndent(match[1], normalizedIndentWidth, sourceIndentWidth)}${line.slice(match[1].length)}`;\n}\n\nfunction normalizeMarkdownLine(line: string, state: MarkdownListState) {\n if (FENCE_PATTERN.test(line.trimStart())) {\n state.isInCodeFence = !state.isInCodeFence;\n return line;\n }\n\n if (state.isInCodeFence) return line;\n\n const match = line.match(LIST_ITEM_PATTERN);\n if (!match) return normalizeIndentedContinuation(line, state.activeListIndents);\n\n return normalizeListItem(line, match, state.activeListIndents);\n}\n\nexport function normalizeMarkdownListIndentation(content: string) {\n const lines = content.split(\"\\n\");\n const state: MarkdownListState = { isInCodeFence: false, activeListIndents: [] };\n\n return lines.map((line) => normalizeMarkdownLine(line, state)).join(\"\\n\");\n}\n\nexport function splitFrontmatter(content: string) {\n const match = content.match(FRONTMATTER_PATTERN);\n if (!match) {\n return { frontmatter: \"\", body: content };\n }\n return {\n frontmatter: match[0],\n body: content.slice(match[0].length),\n };\n}\n","export const FOCUS_EDITOR = \"FOCUS_EDITOR\";\nexport const UPLOAD_FILE = \"UPLOAD_FILE\";\nexport const OPEN_CONTEXT = \"OPEN_CONTEXT\";\nexport const DROP_EVENT = \"DROP_EVENT\";\n\n// prompt actions\nexport const RUN_PROMPT = \"RUN_PROMPT\";\nexport const UPDATE_FORMAT = \"UPDATE_FORMAT\";\nexport const UPDATE_BEHAVIOR = \"UPDATE_BEHAVIOR\";\nexport const INSERT_PROMPT = \"INSERT_PROMPT\";\nexport const RENAME_PROMPT = \"RENAME_PROMPT\";\nexport const DUPLICATE_PROMPT = \"DUPLICATE_PROMPT\";\nexport const DELETE_PROMPT = \"DELETE_PROMPT\";\n\n// reference actions\nexport const DELETE_REFERENCES = \"DELETE_REFERENCES\";\nexport const RENAME_REFERENCES = \"RENAME_REFERENCES\";\nexport const INSERT_REFERENCE = \"INSERT_REFERENCE\";\n\n// block actions\nexport const INSERT_BLOCK = \"INSERT_BLOCK\";\n","import { createCommand } from \"lexical\";\nimport {\n DELETE_PROMPT,\n DELETE_REFERENCES,\n DUPLICATE_PROMPT,\n INSERT_BLOCK,\n INSERT_PROMPT,\n INSERT_REFERENCE,\n OPEN_CONTEXT,\n RENAME_PROMPT,\n RENAME_REFERENCES,\n RUN_PROMPT,\n UPDATE_BEHAVIOR,\n UPDATE_FORMAT,\n UPLOAD_FILE,\n} from \"./events\";\n\nexport const UPLOAD_FILE_COMMAND = createCommand(UPLOAD_FILE);\nexport const OPEN_CONTEXT_COMMAND = createCommand(OPEN_CONTEXT);\n\n// prompt actions\nexport const RUN_PROMPT_COMMAND = createCommand(RUN_PROMPT);\nexport const UPDATE_FORMAT_COMMAND = createCommand(UPDATE_FORMAT);\nexport const UPDATE_BEHAVIOR_COMMAND = createCommand(UPDATE_BEHAVIOR);\nexport const INSERT_PROMPT_COMMAND = createCommand(INSERT_PROMPT);\nexport const RENAME_PROMPT_COMMAND = createCommand(RENAME_PROMPT);\nexport const DUPLICATE_PROMPT_COMMAND = createCommand(DUPLICATE_PROMPT);\nexport const DELETE_PROMPT_COMMAND = createCommand(DELETE_PROMPT);\n\n// reference actions\nexport const DELETE_REFERENCES_COMMAND = createCommand(DELETE_REFERENCES);\nexport const RENAME_REFERENCES_COMMAND = createCommand(RENAME_REFERENCES);\nexport const INSERT_REFERENCE_COMMAND = createCommand(INSERT_REFERENCE);\n\n// block actions\nexport const INSERT_BLOCK_COMMAND = createCommand(INSERT_BLOCK);\n\n// placeholder actions\nexport const INSERT_NEW_FILE_PLACEHOLDER = \"INSERT_NEW_FILE_PLACEHOLDER\";\nexport const INSERT_NEW_TEXT_PLACEHOLDER = \"INSERT_NEW_TEXT_PLACEHOLDER\";\nexport const INSERT_PLACEHOLDER_REFERENCE = \"INSERT_PLACEHOLDER_REFERENCE\";\nexport const INSERT_NEW_FILE_PLACEHOLDER_COMMAND = createCommand(INSERT_NEW_FILE_PLACEHOLDER);\nexport const INSERT_NEW_TEXT_PLACEHOLDER_COMMAND = createCommand(INSERT_NEW_TEXT_PLACEHOLDER);\nexport const INSERT_PLACEHOLDER_REFERENCE_COMMAND = createCommand(INSERT_PLACEHOLDER_REFERENCE);\n","import { addClassNamesToElement } from \"@lexical/utils\";\nimport {\n $createParagraphNode,\n type DOMConversionMap,\n type DOMConversionOutput,\n type DOMExportOutput,\n type EditorConfig,\n type ElementFormatType,\n ElementNode,\n isHTMLElement,\n type LexicalEditor,\n type LexicalNode,\n type ParagraphNode,\n type RangeSelection,\n type SerializedElementNode,\n} from \"lexical\";\n\nexport type SerializedCommentNode = SerializedElementNode;\n\nfunction convertCommentElement(element: HTMLElement): DOMConversionOutput {\n const node = $createCommentNode();\n if (element.style !== null) {\n node.setFormat(element.style.textAlign as ElementFormatType);\n }\n return { node };\n}\n\nexport class CommentNode extends ElementNode {\n static getType(): string {\n return \"comment\";\n }\n\n static clone(node: CommentNode): CommentNode {\n return new CommentNode(node.__key);\n }\n\n createDOM(config: EditorConfig): HTMLElement {\n const element = document.createElement(\"blockquote\");\n addClassNamesToElement(element, config.theme.comment);\n return element;\n }\n\n updateDOM(): boolean {\n return false;\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n blockquote: () => ({\n conversion: convertCommentElement,\n priority: 0,\n }),\n };\n }\n\n exportDOM(editor: LexicalEditor): DOMExportOutput {\n const { element } = super.exportDOM(editor);\n\n if (element && isHTMLElement(element)) {\n if (this.isEmpty()) {\n element.append(document.createElement(\"br\"));\n }\n\n const formatType = this.getFormatType();\n element.style.textAlign = formatType;\n\n const direction = this.getDirection();\n if (direction) {\n element.dir = direction;\n }\n }\n\n return {\n element,\n };\n }\n\n static importJSON(serializedNode: SerializedCommentNode): CommentNode {\n const node = $createCommentNode();\n node.setFormat(serializedNode.format);\n node.setIndent(serializedNode.indent);\n node.setDirection(serializedNode.direction);\n return node;\n }\n\n exportJSON(): SerializedElementNode {\n return {\n ...super.exportJSON(),\n type: \"comment\",\n };\n }\n\n getTextContent(): string {\n const originalText = super.getTextContent();\n // escape { and } symbols\n const withEscapedReferences = originalText.replace(/([{}])/g, \"\\\\$1\");\n return `{{! ${withEscapedReferences} }}`;\n }\n\n // mutation\n\n insertNewAfter(_: RangeSelection, restoreSelection?: boolean): ParagraphNode {\n const newBlock = $createParagraphNode();\n const direction = this.getDirection();\n newBlock.setDirection(direction);\n this.insertAfter(newBlock, restoreSelection);\n return newBlock;\n }\n\n collapseAtStart(): true {\n const paragraph = $createParagraphNode();\n const children = this.getChildren();\n children.forEach((child) => {\n paragraph.append(child);\n });\n this.replace(paragraph);\n return true;\n }\n}\n\nexport function $createCommentNode(): CommentNode {\n return new CommentNode();\n}\n\nexport function $isCommentNode(node: LexicalNode | null | undefined): node is CommentNode {\n return node instanceof CommentNode;\n}\n","import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { $setBlocksType } from \"@lexical/selection\";\nimport { mergeRegister } from \"@lexical/utils\";\nimport { $getSelection, $isRangeSelection, COMMAND_PRIORITY_LOW, type TextNode } from \"lexical\";\nimport { useEffect } from \"react\";\nimport { INSERT_BLOCK_COMMAND } from \"../../../commands\";\nimport { $createCommentNode } from \"../nodes/CommentNode/CommentNode\";\n\nexport const insertCommentBlock = (_blockType: string, nodeToReplace?: TextNode) => {\n const selection = $getSelection();\n const commentNode = $createCommentNode();\n\n if (nodeToReplace) {\n const nodeParent = nodeToReplace.getParent();\n nodeParent?.replace(commentNode, true);\n nodeToReplace.remove();\n commentNode.selectEnd();\n return;\n }\n\n if ($isRangeSelection(selection)) {\n $setBlocksType(selection, $createCommentNode);\n }\n};\n\ntype InsertBlockEvent = {\n optionId: string;\n nodeToReplace?: TextNode;\n};\n\nexport function useCommentCommands(): null {\n const [editor] = useLexicalComposerContext();\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n INSERT_BLOCK_COMMAND,\n (event: InsertBlockEvent) => {\n const { optionId, nodeToReplace } = event;\n insertCommentBlock(optionId, nodeToReplace);\n return false;\n },\n COMMAND_PRIORITY_LOW,\n ),\n );\n }, [editor]);\n\n return null;\n}\n","import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { mergeRegister } from \"@lexical/utils\";\nimport { $createParagraphNode } from \"lexical\";\nimport { useEffect } from \"react\";\nimport { CommentNode } from \"../nodes/CommentNode/CommentNode\";\n\nexport const useCommentSchema = () => {\n const [editor] = useLexicalComposerContext();\n\n useEffect(() => {\n return mergeRegister(\n editor.registerNodeTransform(CommentNode, (node) => {\n const children = node.getChildren();\n\n /**\n * Comment nodes cannot have other comments as children\n */\n const invalidChildren = children.filter((child) => child.getType() === \"comment\");\n\n if (invalidChildren.length > 0) {\n editor.update(() => {\n invalidChildren.forEach((child) => {\n child.replace($createParagraphNode(), true);\n });\n });\n }\n }),\n );\n }, [editor]);\n};\n","import { useCommentCommands } from \"./hooks/useCommentCommands\";\nimport { useCommentSchema } from \"./hooks/useCommentSchema\";\n\nexport function CommentPlugin(): null {\n useCommentSchema();\n useCommentCommands();\n return null;\n}\n","import { $getRoot, $isElementNode, ElementNode, type Klass, type LexicalNode, type RootNode } from \"lexical\";\n\nexport function $getAllNodesOfType<T extends LexicalNode>(nodeType: Klass<T>) {\n const root = $getRoot();\n const nodesOfType: T[] = [];\n\n const traverse = (node: LexicalNode) => {\n if (node instanceof nodeType) {\n nodesOfType.push(node as T);\n }\n if (node instanceof ElementNode) {\n node.getChildren?.().forEach(traverse);\n }\n };\n\n traverse(root);\n return nodesOfType;\n}\n\nexport const $getTextContent = (root: RootNode) => {\n let textContent = \"\";\n const children = root.getChildren();\n const childrenLength = children.length;\n for (let i = 0; i < childrenLength; i++) {\n const child = children[i];\n textContent += child.getTextContent();\n if ($isElementNode(child) && i !== childrenLength - 1 && !child.isInline()) {\n textContent += \"\\n\";\n }\n }\n return textContent;\n};\n\ntype SerializedNode = {\n type?: string;\n text?: string;\n name?: string;\n referenceId?: string;\n children?: SerializedNode[];\n};\n\ntype SerializedRoot = {\n root?: SerializedNode;\n};\n\nconst getReferenceMarker = (node: SerializedNode) => {\n if (node.type !== \"reference\") return null;\n return `#${node.name ?? node.referenceId ?? \"\"}`;\n};\n\nconst shouldAppendParagraphBreak = (node: SerializedNode) => {\n return node.type === \"paragraph\" && Boolean(node.children?.length);\n};\n\nconst traverseSerializedNode = (node: SerializedNode): string => {\n if (node.type === \"comment\") {\n return \"\";\n }\n\n const referenceMarker = getReferenceMarker(node);\n if (referenceMarker !== null) {\n return referenceMarker;\n }\n\n let text = typeof node.text === \"string\" ? node.text : \"\";\n const children = node.children;\n if (!Array.isArray(children)) return text;\n\n const childrenLength = children.length;\n for (let i = 0; i < childrenLength; i += 1) {\n const child = children[i];\n if (child.type === \"comment\") {\n if (i !== childrenLength - 1) {\n text += \"\\n\";\n }\n continue;\n }\n\n text += traverseSerializedNode(child);\n if (shouldAppendParagraphBreak(child)) {\n text += \"\\n\";\n }\n }\n\n return text;\n};\n\nexport const getTextFromSerializedEditorState = (state: string): string => {\n try {\n const parsed = JSON.parse(state) as SerializedRoot;\n return traverseSerializedNode(parsed.root ?? {});\n } catch {\n return \"\";\n }\n};\n\nexport const emptyEditorState = {\n root: {\n direction: \"ltr\",\n format: \"\",\n indent: 0,\n type: \"root\",\n version: 1,\n children: [\n {\n type: \"paragraph\",\n version: 1,\n format: \"\",\n indent: 0,\n textFormat: undefined,\n direction: null,\n children: [],\n },\n ],\n },\n};\n\nexport function generateEditorStateFromString(input = \"\") {\n if (!input.trim()) {\n return JSON.parse(JSON.stringify(emptyEditorState));\n }\n\n // Split on line breaks → one paragraph per line\n const paragraphs = input.split(/\\r?\\n/);\n\n const children = paragraphs.map((line) => ({\n type: \"paragraph\",\n version: 1,\n format: \"\",\n indent: 0,\n textFormat: undefined,\n direction: null,\n children: line\n ? [\n {\n type: \"text\",\n version: 1,\n text: line,\n format: \"\",\n detail: 0,\n mode: \"normal\",\n style: \"\",\n },\n ]\n : [],\n }));\n\n return {\n root: {\n direction: \"ltr\",\n format: \"\",\n indent: 0,\n type: \"root\",\n version: 1,\n children,\n },\n };\n}\n","import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { useImperativeHandle } from \"react\";\nimport { generateEditorStateFromString, getTextFromSerializedEditorState } from \"../utils\";\n\nexport interface PromptEditorRef {\n setEditorValue: (value: string) => void;\n}\n\nexport function ImperativeAPIPlugin({\n editorRef,\n previousTextRef,\n}: {\n editorRef: React.ForwardedRef<PromptEditorRef>;\n previousTextRef: React.MutableRefObject<string>;\n}) {\n const [editor] = useLexicalComposerContext();\n\n useImperativeHandle(\n editorRef,\n () => ({\n setEditorValue: (value: string) => {\n const state = editor.parseEditorState(JSON.stringify(generateEditorStateFromString(value)));\n editor.setEditorState(state);\n previousTextRef.current = getTextFromSerializedEditorState(value);\n editor.focus(undefined, { defaultSelection: \"rootEnd\" });\n },\n }),\n [editor, previousTextRef],\n );\n\n return null;\n}\n","type KeyDownLikeEvent = {\n key: string;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n altKey: boolean;\n};\n\nexport const shouldSubmitOnEnter = (event: KeyDownLikeEvent) => {\n if (event.key !== \"Enter\") return false;\n\n return !event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey;\n};\n","import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { COMMAND_PRIORITY_HIGH, KEY_DOWN_COMMAND } from \"lexical\";\nimport { useEffect } from \"react\";\nimport { shouldSubmitOnEnter } from \"./keyboard-shortcuts\";\n\nexport interface KeyboardShortcutPluginProps {\n onSubmit?: () => void;\n}\n\nexport function KeyboardShortcutPlugin({ onSubmit }: KeyboardShortcutPluginProps) {\n const [editor] = useLexicalComposerContext();\n\n useEffect(() => {\n return editor.registerCommand(\n KEY_DOWN_COMMAND,\n (event: KeyboardEvent) => {\n if (shouldSubmitOnEnter(event)) {\n event.preventDefault();\n onSubmit?.();\n return true;\n }\n\n return false;\n },\n COMMAND_PRIORITY_HIGH,\n );\n }, [editor, onSubmit]);\n\n return null;\n}\n","import type { MenuOptionGroup } from \"./ReferenceMenuOption\";\n\nexport const menuSortOrder: MenuOptionGroup[] = [\"table\", \"connector\"];\n","import { menuSortOrder } from \"../constants\";\nimport type { MenuOptionGroup, ReferenceMenuOption } from \"../ReferenceMenuOption\";\n\nexport const getSortedMenuOptions = (options: ReferenceMenuOption[]) => {\n const sortedOptions = options\n .sort((a, b) => menuSortOrder.indexOf(a.group) - menuSortOrder.indexOf(b.group))\n .map((option, index) => ({ ...option, index }) as ReferenceMenuOption);\n\n const groupedOptions = sortedOptions.reduce(\n (acc, option) => {\n const bucket = acc[option.group] ?? [];\n bucket.push(option);\n acc[option.group] = bucket;\n return acc;\n },\n {} as Record<MenuOptionGroup, ReferenceMenuOption[]>,\n );\n\n return groupedOptions;\n};\n","import { Flex, Text, Tooltip } from \"@chakra-ui/react\";\n\ninterface ReferenceMenuItemProps {\n id: string;\n isSelected: boolean;\n onClick: () => void;\n onMouseEnter: () => void;\n primaryLabel: string;\n secondaryLabel?: string;\n setRefElement: (element: HTMLDivElement) => void;\n tabIndex: number;\n}\n\nexport function ReferenceMenuItem(props: ReferenceMenuItemProps) {\n const { id, isSelected, onClick, onMouseEnter, setRefElement, secondaryLabel, primaryLabel, tabIndex = -1 } = props;\n\n return (\n <Flex\n direction=\"column\"\n cursor=\"pointer\"\n gap=\"2xs\"\n padding=\"2xs\"\n paddingX=\"sm\"\n bg={isSelected ? \"bg.active\" : \"transparent\"}\n _hover={{ bg: isSelected ? \"bg.active\" : \"bg.hover\" }}\n tabIndex={tabIndex}\n ref={setRefElement}\n role=\"option\"\n aria-selected={isSelected}\n id={id}\n onMouseEnter={onMouseEnter}\n onClick={onClick}\n >\n <Tooltip.Root>\n <Tooltip.Trigger>\n <Text mt=\"1px\" lineClamp={1} textOverflow=\"ellipsis\" textStyle=\"label/M/regular\">\n {primaryLabel}\n </Text>\n </Tooltip.Trigger>\n <Tooltip.Positioner>\n <Tooltip.Content>{primaryLabel}</Tooltip.Content>\n </Tooltip.Positioner>\n </Tooltip.Root>\n {secondaryLabel && (\n <Text lineClamp={2} textOverflow=\"ellipsis\" textStyle=\"label/S/regular\" color=\"fg.muted\">\n {secondaryLabel}\n </Text>\n )}\n </Flex>\n );\n}\n","import { Box, Text } from \"@chakra-ui/react\";\nimport { useEffect } from \"react\";\nimport type { ReferenceMenuOption } from \"../../ReferenceMenuOption\";\nimport { getSortedMenuOptions } from \"../../utils/getSortedMenuOptions\";\nimport { ReferenceMenuItem } from \"./ReferenceMenuItem\";\n\ninterface ReferenceMenuProps {\n options: ReferenceMenuOption[];\n selectedIndex: number | null;\n onSelectItem: (option: ReferenceMenuOption, index: number) => void;\n onMouseEnterItem: (index: number) => void;\n}\n\nexport const ReferenceMenu = (props: ReferenceMenuProps) => {\n const { options, selectedIndex, onSelectItem, onMouseEnterItem } = props;\n const { table = [], connector = [] } = getSortedMenuOptions(options);\n\n const hasResults = [...table, ...connector].length;\n\n /** scroll to the selected item if necessary */\n useEffect(() => {\n document\n .getElementById(`typeahead-item-${selectedIndex}`)\n ?.scrollIntoView({ behavior: \"instant\", block: \"nearest\" });\n }, [selectedIndex]);\n\n return (\n <Box\n zIndex=\"1000\"\n position=\"absolute\"\n layerStyle=\"modal\"\n overflow=\"auto\"\n maxHeight={\"24rem\"}\n minWidth={{\n base: \"100vw\",\n md: \"264px\",\n }}\n >\n {!hasResults && <Text>No results</Text>}\n {!!table.length && (\n <>\n <Text paddingTop=\"xs\" paddingBottom=\"2xs\" paddingX=\"sm\" color=\"fg.muted\" textStyle=\"label/S/medium\">\n Tables\n </Text>\n <Box>\n {table.map((option) => {\n return (\n <ReferenceMenuItem\n id={`typeahead-item-${option.index}`}\n isSelected={selectedIndex === option.index}\n onClick={() => onSelectItem(option, option.index)}\n onMouseEnter={() => onMouseEnterItem(option.index)}\n key={option.id}\n primaryLabel={option.name}\n secondaryLabel={option.description}\n setRefElement={option.setRefElement}\n tabIndex={-1}\n />\n );\n })}\n </Box>\n </>\n )}\n {!!connector.length && (\n <>\n <Text paddingTop=\"xs\" paddingBottom=\"2xs\" paddingX=\"sm\" color=\"fg.muted\" textStyle=\"label/S/medium\">\n Data Sources\n </Text>\n <Box>\n {connector.map((option) => {\n return (\n <ReferenceMenuItem\n id={`typeahead-item-${option.index}`}\n isSelected={selectedIndex === option.index}\n onClick={() => onSelectItem(option, option.index)}\n onMouseEnter={() => onMouseEnterItem(option.index)}\n key={option.id}\n primaryLabel={option.name}\n secondaryLabel={option.description}\n setRefElement={option.setRefElement}\n tabIndex={-1}\n />\n );\n })}\n </Box>\n </>\n )}\n </Box>\n );\n};\n","import type { ReferenceMenuOption } from \"../ReferenceMenuOption\";\n\nconst localFilter = (data: ReferenceMenuOption[], q: string) =>\n data.filter((m) => m.name.replace(/ /g, \"_\").toLowerCase().includes(q.toLowerCase()));\n\n/**\n * Search across all resources and menu options\n *\n * @param queryString\n * @returns\n */\nexport function useContextLookup(\n queryString: string | null,\n items: {\n resourceId: string;\n resourceType: \"table\" | \"connector\";\n name: string;\n description?: string;\n }[] = [],\n) {\n const baseOptions: ReferenceMenuOption[] = items.map(\n (res, index): ReferenceMenuOption => ({\n id: res.resourceId,\n key: res.resourceId,\n index,\n group: res.resourceType,\n name: res.name,\n description: res.description,\n setRefElement: () => {},\n }),\n );\n\n if (queryString == null || queryString === \"\") {\n return baseOptions;\n }\n\n return localFilter(baseOptions, queryString);\n}\n","import type { MenuTextMatch } from \"@lexical/react/LexicalTypeaheadMenuPlugin\";\n\nconst VALID_PUNCTUATION = \"\\\\.\\\\-<>_:\";\nconst TRIGGERS = [\"#\"].join(\"\");\n\nconst VALID_CHARS = `[^${TRIGGERS}${VALID_PUNCTUATION}\\\\s]`;\nconst VALID_JOINS = `(?:[${VALID_PUNCTUATION}]|)`;\n\nconst LENGTH_LIMIT = 75;\n\nconst TriggerRegex = new RegExp(`(^|\\\\s|\\\\()([${TRIGGERS}]((?:${VALID_CHARS}${VALID_JOINS}){0,${LENGTH_LIMIT}}))$`);\n\nconst AliasRegex = new RegExp(`(^|\\\\s|\\\\()([${TRIGGERS}]((?:${VALID_CHARS}){0,${LENGTH_LIMIT}}))$`);\n\n/**\n * lexical will run this function on text nodes\n *\n * @param text\n * @param minMatchLength\n * @returns\n */\nexport function checkForTriggers(text: string, minMatchLength: number): MenuTextMatch | null {\n let match = TriggerRegex.exec(text);\n\n if (match === null) {\n match = AliasRegex.exec(text);\n }\n\n if (match !== null) {\n // The strategy ignores leading whitespace but we need to know it's\n // length to add it to the leadOffset\n const maybeLeadingWhitespace = match[1];\n const matchingString = match[3];\n\n if (matchingString.length >= minMatchLength) {\n return {\n leadOffset: match.index + maybeLeadingWhitespace.length,\n matchingString,\n replaceableString: match[2],\n };\n }\n }\n\n return null;\n}\n","import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { LexicalTypeaheadMenuPlugin } from \"@lexical/react/LexicalTypeaheadMenuPlugin\";\nimport type { TextNode } from \"lexical\";\nimport { useState } from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { INSERT_REFERENCE_COMMAND } from \"../../commands\";\nimport { ReferenceMenu } from \"./components/ReferenceMenu/ReferenceMenu\";\nimport { useContextLookup } from \"./hooks/useContextLookup\";\nimport type { ReferenceMenuOption } from \"./ReferenceMenuOption\";\nimport { checkForTriggers } from \"./utils/checkForTriggers\";\n\nconst SUGGESTION_LIST_LENGTH_LIMIT = 20;\n\ntype Props = {\n items?: Array<{\n resourceId: string;\n resourceType: \"table\" | \"connector\";\n name: string;\n description?: string;\n }>;\n};\n\nexport function ReferenceMenuPlugin({ items = [] }: Props) {\n const [queryString, setQueryString] = useState<string | null>(null);\n const [editor] = useLexicalComposerContext();\n const searchResults = useContextLookup(queryString, items);\n\n /**\n * triggers when the user selects an option in the context menu\n */\n const onSelectOption = (\n selectedOption: ReferenceMenuOption,\n nodeToReplace: TextNode | null,\n closeMenu: () => void,\n ) => {\n editor.update(() => {\n if (!nodeToReplace) return;\n\n editor.dispatchCommand(INSERT_REFERENCE_COMMAND, {\n resourceId: selectedOption.id,\n resourceType: selectedOption.group,\n name: selectedOption.name,\n nodeToReplace,\n });\n\n closeMenu();\n });\n };\n\n /**\n * checks text nodes and return nodes matching the trigger\n */\n const checkForTrigger = (text: string) => {\n return checkForTriggers(text, 0);\n };\n\n /**\n * define the options to display in the context menu\n */\n const menuOptions = searchResults.slice(0, SUGGESTION_LIST_LENGTH_LIMIT);\n\n return (\n <LexicalTypeaheadMenuPlugin<ReferenceMenuOption>\n onQueryChange={setQueryString}\n onSelectOption={onSelectOption}\n triggerFn={checkForTrigger}\n options={menuOptions}\n menuRenderFn={(anchorElementRef, { options, selectedIndex, selectOptionAndCleanUp, setHighlightedIndex }) => {\n if (!anchorElementRef.current) return null;\n return ReactDOM.createPortal(\n <ReferenceMenu\n options={options}\n selectedIndex={selectedIndex}\n onSelectItem={(option, i) => {\n setHighlightedIndex(i);\n selectOptionAndCleanUp(option);\n }}\n onMouseEnterItem={(i) => {\n setHighlightedIndex(i);\n }}\n />,\n anchorElementRef.current,\n );\n }}\n />\n );\n}\n","import { addClassNamesToElement } from \"@lexical/utils\";\nimport {\n type DOMConversionMap,\n type DOMConversionOutput,\n type DOMExportOutput,\n type EditorConfig,\n type LexicalEditor,\n type LexicalNode,\n type NodeKey,\n type SerializedTextNode,\n type Spread,\n TextNode,\n} from \"lexical\";\n\ntype SerializedReferenceNode = Spread<\n {\n referenceId: string;\n name: string;\n },\n SerializedTextNode\n>;\n\nexport class ReferenceNode extends TextNode {\n __referenceId: string;\n __name: string;\n\n static getType(): string {\n return \"reference\";\n }\n\n static clone(node: ReferenceNode): ReferenceNode {\n return new ReferenceNode(node.__referenceId, node.__name, node.__key);\n }\n\n constructor(referenceId: string, name: string, key?: NodeKey) {\n super(name, key);\n this.__referenceId = referenceId;\n this.__name = name;\n }\n\n isKeyboardSelectable(): boolean {\n return false;\n }\n\n canBeEmpty(): boolean {\n return false;\n }\n\n canInsertTextAfter(): boolean {\n return false;\n }\n\n canInsertTextBefore(): boolean {\n return false;\n }\n\n createDOM(config: EditorConfig): HTMLElement {\n const span = document.createElement(\"span\");\n addClassNamesToElement(span, config.theme.reference);\n span.setAttribute(\"data-reference-id\", this.__referenceId);\n span.setAttribute(\"data-name\", this.__name);\n span.textContent = `#${this.__name}`;\n return span;\n }\n\n updateDOM(prevNode: ReferenceNode, dom: HTMLElement): boolean {\n if (prevNode.__name !== this.__name || prevNode.__referenceId !== this.__referenceId) {\n dom.setAttribute(\"data-reference-id\", this.__referenceId);\n dom.setAttribute(\"data-name\", this.__name);\n dom.textContent = `#${this.__name}`;\n }\n\n return false;\n }\n\n exportDOM(_editor: LexicalEditor): DOMExportOutput {\n const el = document.createElement(\"span\");\n el.setAttribute(\"data-reference-id\", this.__referenceId);\n el.setAttribute(\"data-name\", this.__name);\n el.textContent = `#${this.__name}`;\n return { element: el };\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n span: (domNode: HTMLElement) => {\n if (!domNode.hasAttribute(\"data-reference-id\") || !domNode.hasAttribute(\"data-name\")) {\n return null;\n }\n return {\n conversion: $convertReferenceElement,\n priority: 1,\n };\n },\n };\n }\n\n static importJSON(serializedNode: SerializedReferenceNode): ReferenceNode {\n const node = new ReferenceNode(serializedNode.referenceId, serializedNode.name);\n return node;\n }\n\n exportJSON(): SerializedReferenceNode {\n return {\n ...super.exportJSON(),\n type: \"reference\",\n referenceId: this.__referenceId,\n name: this.__name,\n };\n }\n\n getTextContent(): string {\n return `#${this.__name}`;\n }\n}\n\nfunction $convertReferenceElement(domNode: HTMLElement): DOMConversionOutput | null {\n const referenceId = domNode.getAttribute(\"data-reference-id\");\n const name = domNode.getAttribute(\"data-name\");\n if (!referenceId || !name) return null;\n return { node: $createReferenceNode(referenceId, name) };\n}\n\nexport function $createReferenceNode(referenceId: string, name: string): ReferenceNode {\n return new ReferenceNode(referenceId, name);\n}\n\nexport function $isReferenceNode(node: LexicalNode | null | undefined): node is ReferenceNode {\n return node instanceof ReferenceNode;\n}\n","import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { mergeRegister } from \"@lexical/utils\";\nimport { COMMAND_PRIORITY_LOW, type LexicalNode } from \"lexical\";\nimport { type PropsWithChildren, useEffect } from \"react\";\nimport { INSERT_REFERENCE_COMMAND } from \"../../commands\";\nimport { $createReferenceNode } from \"./nodes/ReferenceNode/ReferenceNode\";\n\nexport const $insertExistingReference = (nodeToReplace: LexicalNode, resourceId: string, name: string) => {\n const refNode = $createReferenceNode(resourceId, name);\n\n if (nodeToReplace) {\n nodeToReplace?.replace(refNode);\n nodeToReplace.remove();\n refNode.selectEnd();\n return;\n }\n};\n\nexport function ReferencePlugin(\n props: PropsWithChildren<{ onAddReference?: (resourceId: string, resourceType: \"table\" | \"connector\") => void }>,\n) {\n const { onAddReference } = props;\n const [editor] = useLexicalComposerContext();\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n INSERT_REFERENCE_COMMAND,\n (event: {\n resourceId: string;\n resourceType: \"table\" | \"connector\";\n name: string;\n nodeToReplace: LexicalNode;\n }) => {\n const { resourceId, resourceType, name, nodeToReplace } = event;\n\n editor.update(() => {\n $insertExistingReference(nodeToReplace, resourceId, name);\n });\n\n onAddReference?.(resourceId, resourceType);\n return true;\n },\n COMMAND_PRIORITY_LOW,\n ),\n );\n }, [editor, onAddReference]);\n\n return null;\n}\n","import type { EditorThemeClasses } from \"lexical\";\nimport baseTheme from \"../../theme/rich-text-theme\";\nimport \"./prompt-input-theme.css\";\n\nconst promptInputTheme: EditorThemeClasses = {\n ...baseTheme,\n // Override paragraph class to remove margins specifically for prompt input\n paragraph: \"rich-text__p rich-text__p--no-margin\",\n};\n\nexport default promptInputTheme;\n","import { Flex, Kbd, Text } from \"@chakra-ui/react\";\nimport { MarkNode } from \"@lexical/mark\";\nimport { LexicalComposer } from \"@lexical/react/LexicalComposer\";\nimport { LexicalErrorBoundary } from \"@lexical/react/LexicalErrorBoundary\";\nimport { HistoryPlugin } from \"@lexical/react/LexicalHistoryPlugin\";\nimport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\nimport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\nimport { $getRoot } from \"lexical\";\nimport type { ReactElement } from \"react\";\nimport { type ForwardRefRenderFunction, forwardRef, useRef } from \"react\";\nimport { ContentEditable } from \"../shared/components/content-editable\";\nimport ToggleEditablePlugin from \"../shared/plugins/ToggleEditablePlugin\";\nimport { TreeViewPlugin } from \"../shared/plugins/TreeViewPlugin/TreeViewPlugin\";\nimport { CommentPlugin } from \"./plugins/CommentPlugin/CommentPlugin\";\nimport { CommentNode } from \"./plugins/CommentPlugin/nodes/CommentNode/CommentNode\";\nimport { ImperativeAPIPlugin, type PromptEditorRef } from \"./plugins/ImperativeAPIPlugin\";\nimport { KeyboardShortcutPlugin } from \"./plugins/KeyboardShortcutPlugin\";\nimport { ReferenceMenuPlugin } from \"./plugins/ReferenceMenuPlugin/ReferenceMenuPlugin\";\nimport { ReferenceNode } from \"./plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode\";\nimport { ReferencePlugin } from \"./plugins/ReferencePlugin/ReferencePlugin\";\nimport theme from \"./theme/prompt-input-theme\";\nimport { $getTextContent, getTextFromSerializedEditorState } from \"./utils\";\n\nexport type ReferenceItem = {\n resourceId: string;\n resourceType: \"table\" | \"connector\";\n name: string;\n description?: string;\n};\n\nexport interface PromptEditorProps {\n defaultState: string;\n debug?: boolean;\n isEditable?: boolean;\n placeholder?: ReactElement | ((isEditable: boolean) => ReactElement | null);\n onChange?: (text: string, state: object) => void;\n onError?: (error: Error) => void;\n onSubmit?: () => void;\n /** Dynamic list of references (tables, connectors) shown when typing # */\n references?: ReferenceItem[];\n /** Optional app callback when a reference is inserted */\n onAddReference?: (resourceId: string, resourceType: \"table\" | \"connector\") => void;\n}\n\nconst nodes = [CommentNode, MarkNode, ReferenceNode];\n\nexport const BasePromptEditor: ForwardRefRenderFunction<PromptEditorRef, PromptEditorProps> = (props, ref) => {\n const { defaultState, debug = false, isEditable = true, placeholder } = props;\n const { onChange, onError = () => {}, onSubmit, references = [], onAddReference } = props;\n\n const initialConfig = {\n namespace: \"PROMPT_EDITOR\",\n nodes,\n editorState: defaultState,\n editable: isEditable,\n onError,\n theme,\n };\n\n const previousTextRef = useRef<string>(getTextFromSerializedEditorState(defaultState));\n const placeholderNode: ReactElement | ((isEditable: boolean) => ReactElement | null) = placeholder ?? (\n <Text textStyle=\"label/M/regular\" color=\"fg.subtle\" pointerEvents=\"none\" position=\"absolute\" top=\"0\">\n Type your query here or press <Kbd color=\"fg.subtle\">#</Kbd> to add a reference.\n </Text>\n );\n\n return (\n <Flex direction=\"column\" justifyContent=\"space-between\" width=\"100%\" position=\"relative\">\n <LexicalComposer initialConfig={initialConfig}>\n <HistoryPlugin />\n <RichTextPlugin\n contentEditable={<ContentEditable fullWidth />}\n placeholder={placeholderNode}\n ErrorBoundary={LexicalErrorBoundary}\n />\n <OnChangePlugin\n ignoreSelectionChange\n ignoreHistoryMergeTagChange={false}\n onChange={(editorState) => {\n editorState.read(() => {\n // handle comment blocks properly\n const root = $getRoot();\n const rawText = $getTextContent(root);\n\n if (rawText !== previousTextRef.current) {\n previousTextRef.current = rawText;\n onChange?.(rawText, editorState.toJSON());\n }\n });\n }}\n />\n <ImperativeAPIPlugin editorRef={ref} previousTextRef={previousTextRef} />\n <ToggleEditablePlugin isEditable={isEditable} />\n <CommentPlugin />\n <KeyboardShortcutPlugin onSubmit={onSubmit} />\n <ReferenceMenuPlugin items={references} />\n <ReferencePlugin onAddReference={onAddReference} />\n {debug ? <TreeViewPlugin /> : \"\"}\n </LexicalComposer>\n </Flex>\n );\n};\n\nexport const PromptEditor = forwardRef(BasePromptEditor);\n\nexport type { PromptEditorRef } from \"./plugins/ImperativeAPIPlugin\";\n","import { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { useEffect } from \"react\";\n\ntype StateUpdatePluginProps = {\n value: string;\n onUpdate: (value: string) => void;\n};\n\nexport default function StateUpdatePlugin({ value, onUpdate }: StateUpdatePluginProps) {\n const [editor] = useLexicalComposerContext();\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n editor.update(() => onUpdate(value), { tag: \"history-merge\" });\n }, [value, editor, onUpdate]);\n\n return null;\n}\n","import { Box } from \"@chakra-ui/react\";\nimport {\n DecoratorNode,\n type EditorConfig,\n type LexicalEditor,\n type LexicalNode,\n type NodeKey,\n type SerializedLexicalNode,\n type Spread,\n} from \"lexical\";\nimport type { ReactElement } from \"react\";\nimport { ResourceBadge } from \"../../../../resource-badge\";\n\nexport type SerializedReferenceLinkNode = Spread<\n {\n href: string;\n label?: string;\n },\n SerializedLexicalNode\n>;\n\nexport class ReferenceLinkNode extends DecoratorNode<ReactElement> {\n __href: string;\n __label?: string;\n\n static getType(): string {\n return \"reference-link\";\n }\n\n static clone(node: ReferenceLinkNode): ReferenceLinkNode {\n return new ReferenceLinkNode(node.__href, node.__label, node.__key);\n }\n\n constructor(href: string, label?: string, key?: NodeKey) {\n super(key);\n this.__href = href;\n this.__label = label;\n }\n\n createDOM(_config: EditorConfig, _editor: LexicalEditor): HTMLElement {\n return document.createElement(\"span\");\n }\n\n updateDOM(_prevNode: ReferenceLinkNode, _dom: HTMLElement, _config: EditorConfig): boolean {\n return false;\n }\n\n getTextContent(): string {\n const label = this.__label ?? this.__href;\n return `{{link('${label}')}}`;\n }\n\n exportJSON(): SerializedReferenceLinkNode {\n return {\n type: ReferenceLinkNode.getType(),\n version: 1,\n href: this.__href,\n label: this.__label,\n };\n }\n\n static importJSON(serializedNode: SerializedReferenceLinkNode): ReferenceLinkNode {\n return $createReferenceLinkNode(serializedNode.href, serializedNode.label);\n }\n\n decorate(_editor: LexicalEditor, _config: EditorConfig): ReactElement {\n const href = this.__href;\n const fileName = href.split(\"/\").pop();\n const label = fileName || \"unknown\";\n const isExternal = /^https?:\\/\\//i.test(href);\n const isProjectFile = /^#?\\$PROJECT\\//i.test(href);\n\n return (\n <Box width=\"fit-content\" display=\"inline-block\">\n <ResourceBadge\n fileName={label}\n onSelect={() => {\n if (isExternal) {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n } else if (isProjectFile) {\n const projectPath = href.replace(/^#?\\$PROJECT\\//i, \"\");\n const event = new CustomEvent(\"ui:open-project-file\", { detail: projectPath });\n window.dispatchEvent(event);\n } else {\n window.location.assign(href);\n }\n }}\n />\n </Box>\n );\n }\n}\n\nexport function $createReferenceLinkNode(href: string, label?: string): ReferenceLinkNode {\n return new ReferenceLinkNode(href, label);\n}\n\nexport function $isReferenceLinkNode(node: LexicalNode | null | undefined): node is ReferenceLinkNode {\n return node instanceof ReferenceLinkNode;\n}\n","import type { TextMatchTransformer } from \"@lexical/markdown\";\nimport { $createReferenceLinkNode, $isReferenceLinkNode, ReferenceLinkNode } from \"./ReferenceLinkNode\";\n\n// Matches {{link('xxx')}} or {{ link(\"xxx\") }}\nconst LINK_REGEXP = /\\{\\{\\s*link\\((['\"])([^'\"\\s]+)\\1\\)\\s*\\}\\}/;\n\nexport const REFERENCE_LINK_TRANSFORMER: TextMatchTransformer = {\n dependencies: [ReferenceLinkNode],\n export: (node) => {\n if ($isReferenceLinkNode(node)) {\n const href = (node as ReferenceLinkNode).__href;\n const label = (node as ReferenceLinkNode).__label ?? href;\n // Export back to token form so markdown roundtrips\n if (label) {\n return `{{link('${label}')}}`;\n }\n return `{{link('${href}')}}`;\n }\n return null;\n },\n regExp: LINK_REGEXP,\n importRegExp: LINK_REGEXP,\n replace: (textNode, match) => {\n const value = match[2];\n // For now we assume value is both label and href; if it looks like a URL, use as href.\n const looksLikeUrl = /^(https?:\\/\\/|\\/)/i.test(value);\n const href = looksLikeUrl ? value : `#${value}`;\n const label = value;\n textNode.replace($createReferenceLinkNode(href, label));\n },\n type: \"text-match\",\n};\n","import \"../theme/rich-text-theme.css\";\n\nimport { Flex } from \"@chakra-ui/react\";\nimport { CodeHighlightNode, CodeNode } from \"@lexical/code\";\nimport { AutoLinkNode, LinkNode } from \"@lexical/link\";\nimport { ListItemNode, ListNode } from \"@lexical/list\";\nimport { $convertFromMarkdownString, $convertToMarkdownString, TRANSFORMERS } from \"@lexical/markdown\";\nimport { ClickableLinkPlugin } from \"@lexical/react/LexicalClickableLinkPlugin\";\nimport { LexicalComposer } from \"@lexical/react/LexicalComposer\";\nimport { LexicalErrorBoundary } from \"@lexical/react/LexicalErrorBoundary\";\nimport { HorizontalRulePlugin } from \"@lexical/react/LexicalHorizontalRulePlugin\";\nimport { LinkPlugin } from \"@lexical/react/LexicalLinkPlugin\";\nimport { ListPlugin } from \"@lexical/react/LexicalListPlugin\";\nimport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\nimport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\nimport { TabIndentationPlugin } from \"@lexical/react/LexicalTabIndentationPlugin\";\nimport { HeadingNode, QuoteNode } from \"@lexical/rich-text\";\nimport { $getRoot } from \"lexical\";\nimport { ContentEditable } from \"../shared/components/content-editable\";\nimport { DataTableNode } from \"../shared/nodes/DataTableNode\";\nimport { ImportCodeBlocksPlugin } from \"../shared/plugins/CodePlugin/CodeBlockPlugin\";\nimport { CodeHighlightingPlugin } from \"../shared/plugins/CodePlugin/CodeHighlightingPlugin\";\nimport { EquationNode } from \"../shared/plugins/EquationPlugin/EquationNode\";\nimport { EQUATION_INLINE, EQUATION_MULTILINE, EquationPlugin } from \"../shared/plugins/EquationPlugin/EquationPlugin\";\nimport { HRNode } from \"../shared/plugins/HorizontalRulePlugin/HorizontalRuleNode\";\nimport { MermaidNode } from \"../shared/plugins/MermaidPlugin/MermaidNode\";\nimport StateUpdatePlugin from \"../shared/plugins/StateUpdatePlugin\";\nimport ToggleEditablePlugin from \"../shared/plugins/ToggleEditablePlugin\";\nimport { TreeViewPlugin } from \"../shared/plugins/TreeViewPlugin/TreeViewPlugin\";\nimport { TRANSFORMERS_EXTENDED } from \"../shared/transformers/markdown-transformers\";\nimport theme from \"../theme/rich-text-theme\";\nimport { normalizeMarkdownListIndentation, splitFrontmatter } from \"../utils/markdown\";\nimport { REFERENCE_LINK_TRANSFORMER, ReferenceLinkNode } from \"./plugins/ReferenceLinkPlugin\";\n\nexport interface RichMessageProps {\n debug?: boolean;\n defaultState: string;\n fullWidth?: boolean;\n isEditable?: boolean;\n onChange?: (value: string) => void;\n}\n\nconst transformers = [\n ...TRANSFORMERS,\n ...TRANSFORMERS_EXTENDED,\n EQUATION_INLINE,\n EQUATION_MULTILINE,\n REFERENCE_LINK_TRANSFORMER,\n];\n\nexport function RichMessage(props: RichMessageProps) {\n const { debug = false, defaultState = \"\", fullWidth = false, isEditable = false, onChange } = props;\n const { frontmatter, body } = splitFrontmatter(defaultState);\n const shouldTrackChanges = isEditable && Boolean(onChange);\n\n const initialConfig = {\n namespace: \"RICH_MESSAGE\",\n nodes: [\n QuoteNode,\n LinkNode,\n AutoLinkNode,\n DataTableNode,\n HeadingNode,\n ListNode,\n ListItemNode,\n CodeNode,\n CodeHighlightNode,\n MermaidNode,\n EquationNode,\n HRNode,\n ReferenceLinkNode,\n ],\n editorState: () => {\n return $convertFromMarkdownString(normalizeMarkdownListIndentation(body), transformers, undefined, false);\n },\n onError: (error: Error) => console.error(error),\n editable: isEditable,\n theme,\n };\n\n return (\n <Flex\n className=\"rich-text\"\n data-rich-message=\"true\"\n justifyContent=\"space-between\"\n width=\"100%\"\n maxWidth=\"100%\"\n height=\"100%\"\n position=\"relative\"\n direction=\"column\"\n overflow=\"hidden\"\n >\n <LexicalComposer initialConfig={initialConfig}>\n <StateUpdatePlugin\n value={body}\n onUpdate={(value: string) => {\n $convertFromMarkdownString(normalizeMarkdownListIndentation(value), transformers, undefined, false);\n }}\n />\n <LinkPlugin />\n <ClickableLinkPlugin newTab />\n <ListPlugin />\n {isEditable ? <TabIndentationPlugin maxIndent={7} /> : null}\n <HorizontalRulePlugin />\n <CodeHighlightingPlugin />\n <ImportCodeBlocksPlugin />\n <EquationPlugin />\n <RichTextPlugin\n contentEditable={<ContentEditable fullWidth={fullWidth} isRichMessage />}\n ErrorBoundary={LexicalErrorBoundary}\n />\n {shouldTrackChanges ? (\n <OnChangePlugin\n ignoreSelectionChange\n ignoreHistoryMergeTagChange={false}\n onChange={(editorState) => {\n editorState.read(() => {\n const root = $getRoot();\n const markdownBody = $convertToMarkdownString(transformers, root);\n onChange?.(frontmatter + markdownBody);\n });\n }}\n />\n ) : null}\n <ToggleEditablePlugin isEditable={isEditable} />\n {debug && <TreeViewPlugin />}\n </LexicalComposer>\n </Flex>\n );\n}\n"],"names":["StyledEditable","chakra","LexicalContentEditable","ContentEditable","t0","$","_c","onRef","fullWidth","t1","padding","isRichMessage","t2","scrollable","t3","undefined","t4","t5","t6","jsx","t7","Box","editor","t8","t9","Symbol","for","width","minH","t10","ScrollArea","SIZE_STYLES","sm","container","height","lineHeight","base","px","iconSize","textStyle","md","TONE_STYLES","neutral","color","bg","_hover","accent","DEFAULT_SIZE","DEFAULT_TONE","ResourceBadge","props","fileName","icon","onRemove","onSelect","rest","size","tone","getFileTypeIcon","IconComp","sizeStyles","toneStyles","e","stopPropagation","Text","Tooltip","Spacer","t11","IconButton","e_0","X","t12","jsxs","ReferenceLinkNode","DecoratorNode","__href","__label","getType","clone","node","__key","constructor","href","label","key","createDOM","_config","_editor","document","createElement","updateDOM","_prevNode","_dom","getTextContent","exportJSON","type","version","importJSON","serializedNode","$createReferenceLinkNode","decorate","split","pop","isExternal","test","isProjectFile","window","open","projectPath","replace","event","CustomEvent","detail","dispatchEvent","location","assign","$isReferenceLinkNode","LINK_REGEXP","REFERENCE_LINK_TRANSFORMER","dependencies","export","regExp","importRegExp","textNode","match","value","theme","code","codeHighlight","atrule","attr","boolean","builtin","cdata","char","class","comment","constant","deleted","doctype","entity","function","important","inserted","keyword","namespace","number","operator","prolog","property","punctuation","regex","selector","string","symbol","tag","url","variable","embedBlock","focus","list","checklist","listitem","listitemChecked","listitemUnchecked","nested","olDepth","ol","ul","heading","h1","h2","h3","paragraph","text","underline","italic","link","quote","reference","table","tableCell","tableRow","tableCellHeader","layoutContainer","layoutItem","draggableBlockDemo","row","content","scaledSmallFontSize","formatValue","length","String","toUpperCase","Date","toISOString","JSON","stringify","DefaultRichTextCodeEditor","defaultCode","isEditable","showLineNumbers","disableScroll","Textarea","lines","map","_temp","DefaultRichTextDataTable","data","noBorder","hiddenColumns","Set","hiddenSet","Object","keys","filter","has","columns","Table","_temp2","rowIndex","column_0","column","join","line","index","DataTableNode","__data","getData","json","headers","headerRow","separator","dataRows","header","$createDataTableNode","$isDataTableNode","EquationComponent","React","lazy","$convertEquationElement","domNode","equation","getAttribute","inline","atob","$createEquationNode","EquationNode","__equation","__inline","getEquation","element","className","exportDOM","btoa","setAttribute","katex","render","displayMode","errorColor","output","strict","throwOnError","trust","importDOM","div","hasAttribute","conversion","priority","span","prevNode","setEquation","writable","getWritable","isInline","Suspense","equationNode","$applyNodeReplacement","$isEquationNode","EQUATION_INLINE","trim","EQUATION_MULTILINE","regExpStart","regExpEnd","rootNode","_children","_startMatch","_endMatch","linesInBetween","append","EquationPlugin","HRNode","ElementNode","_serializedNode","$createHRNode","style","$isHRNode","MermaidComponent","MermaidNode","__code","getCode","setCode","$isMermaidNode","HR","parentNode","TABLE","_traverseChildren","_isImport","previousNode","getPreviousSibling","remove","cells","slice","cell","existingData","newRow","isPlaceholderRow","values","every","_","forEach","newTableData","newTableNode","tableNode","UNDERLINE_INS_TAG","TextNode","markdownText","hasFormat","$createTextNode","toggleFormat","UNDERLINE_U_TAG","_node","BARE_URL_REGEXP","BARE_URL","AutoLinkNode","exportChildren","$isAutoLinkNode","autoLinkNode","$createAutoLinkNode","linkTextNode","setFormat","getFormat","TRANSFORMERS_EXTENDED","editorNodes","QuoteNode","LinkNode","HeadingNode","ListNode","ListItemNode","CodeNode","CodeHighlightNode","editorTransformers","CHECK_LIST","TRANSFORMERS","editorTheme","isMermaidLanguage","language","toLowerCase","replaceCodeNodeWithMermaidNode","getLanguage","ImportCodeBlocksPlugin","useLexicalComposerContext","update","useEffect","codeNodes","$nodesOfType","n","CodeHighlightingPlugin","registerCodeHighlighting","ToggleEditablePlugin","setEditable","TreeViewPlugin","TreeView","FRONTMATTER_PATTERN","FENCE_PATTERN","LIST_ITEM_PATTERN","INDENTED_LINE_PATTERN","getExpandedIndentWidth","indent","findParentIndent","activeListIndents","sourceIndentWidth","reverse","find","toNormalizedIndent","normalizedWidth","sourceWidth","includes","repeat","normalizeIndentedContinuation","indentedLineMatch","parentLevel","normalizedIndentWidth","normalizedIndent","normalizeListItem","at","currentLevel","indentStep","push","normalizeMarkdownLine","state","trimStart","isInCodeFence","normalizeMarkdownListIndentation","splitFrontmatter","frontmatter","body","UPLOAD_FILE","OPEN_CONTEXT","RUN_PROMPT","UPDATE_FORMAT","UPDATE_BEHAVIOR","INSERT_PROMPT","RENAME_PROMPT","DUPLICATE_PROMPT","DELETE_PROMPT","DELETE_REFERENCES","RENAME_REFERENCES","INSERT_REFERENCE","INSERT_BLOCK","createCommand","INSERT_REFERENCE_COMMAND","INSERT_BLOCK_COMMAND","INSERT_NEW_FILE_PLACEHOLDER","INSERT_NEW_TEXT_PLACEHOLDER","INSERT_PLACEHOLDER_REFERENCE","convertCommentElement","$createCommentNode","textAlign","CommentNode","config","addClassNamesToElement","blockquote","isHTMLElement","isEmpty","formatType","getFormatType","direction","getDirection","dir","format","setIndent","setDirection","insertNewAfter","restoreSelection","newBlock","$createParagraphNode","insertAfter","collapseAtStart","children","getChildren","child","insertCommentBlock","_blockType","nodeToReplace","selection","$getSelection","commentNode","nodeParent","getParent","selectEnd","$isRangeSelection","$setBlocksType","useCommentCommands","mergeRegister","registerCommand","COMMAND_PRIORITY_LOW","optionId","useCommentSchema","registerNodeTransform","invalidChildren","child_0","CommentPlugin","$getTextContent","root","textContent","childrenLength","i","$isElementNode","getReferenceMarker","name","referenceId","shouldAppendParagraphBreak","Boolean","traverseSerializedNode","referenceMarker","Array","isArray","getTextFromSerializedEditorState","parsed","parse","emptyEditorState","textFormat","generateEditorStateFromString","input","mode","ImperativeAPIPlugin","editorRef","previousTextRef","setEditorValue","parseEditorState","setEditorState","current","defaultSelection","useImperativeHandle","shouldSubmitOnEnter","ctrlKey","metaKey","shiftKey","altKey","KeyboardShortcutPlugin","onSubmit","KEY_DOWN_COMMAND","preventDefault","COMMAND_PRIORITY_HIGH","menuSortOrder","getSortedMenuOptions","options","sort","a","b","indexOf","group","option","reduce","acc","bucket","ReferenceMenuItem","id","isSelected","onClick","onMouseEnter","setRefElement","secondaryLabel","primaryLabel","tabIndex","Flex","ReferenceMenu","selectedIndex","onSelectItem","onMouseEnterItem","connector","hasResults","getElementById","scrollIntoView","behavior","block","T0","Fragment","description","option_0","t13","localFilter","q","m","useContextLookup","queryString","items","baseOptions","res","resourceId","resourceType","VALID_PUNCTUATION","TRIGGERS","VALID_CHARS","VALID_JOINS","LENGTH_LIMIT","TriggerRegex","RegExp","AliasRegex","checkForTriggers","minMatchLength","exec","maybeLeadingWhitespace","matchingString","leadOffset","replaceableString","SUGGESTION_LIST_LENGTH_LIMIT","ReferenceMenuPlugin","setQueryString","useState","searchResults","selectedOption","closeMenu","dispatchCommand","onSelectOption","checkForTrigger","menuOptions","LexicalTypeaheadMenuPlugin","anchorElementRef","selectOptionAndCleanUp","setHighlightedIndex","ReactDOM","createPortal","i_0","ReferenceNode","__referenceId","__name","isKeyboardSelectable","canBeEmpty","canInsertTextAfter","canInsertTextBefore","dom","el","$convertReferenceElement","$createReferenceNode","$insertExistingReference","refNode","ReferencePlugin","onAddReference","promptInputTheme","baseTheme","nodes","MarkNode","BasePromptEditor","ref","defaultState","debug","placeholder","onChange","onError","references","editorState","editable","initialConfig","useRef","Kbd","placeholderNode","HistoryPlugin","RichTextPlugin","LexicalErrorBoundary","OnChangePlugin","read","$getRoot","rawText","toJSON","t14","t15","t16","t17","t18","t19","LexicalComposer","PromptEditor","forwardRef","StateUpdatePlugin","onUpdate","transformers","RichMessage","shouldTrackChanges","$convertFromMarkdownString","LinkPlugin","ClickableLinkPlugin","ListPlugin","TabInd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A,YACC,WAAA,UACD,UAAA,UAET,UAAA,gBAAAhd,EAAC0jB,IAAA,EAA+BlB,eAAAA,GAC9BzlB,UAAAA;AAAAA,IAAAA;AAAAA,IAMAC;AAAAA,IACAK;AAAAA,IACAsC;AAAAA,IACCI;AAAAA,IACDge;AAAAA,IACAqF;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IAICC;AAAAA,IAaDC;AAAAA,IACCiB;AAAAA,EAAAA,EAAAA,CACH,EAAA,CACF,GAAO7oB,QAAA2mB,GAAA3mB,QAAAkE,GAAAlE,QAAA0nB,GAAA1nB,QAAA2nB,GAAA3nB,QAAA4nB,GAAA5nB,QAAA6oB,GAAA7oB,QAAAkB,GAAAlB,QAAA8oB,KAAAA,IAAA9oB,EAAA,EAAA,GA9CP8oB;AA8CO;AA7EJ,SAAAxb,GAAA9F,GAAA;AA8CK6gB,EAAAA,GAA2BvP,GAAiCtR,CAAK,GAAG0gB,IAAcxnB,QAAW,EAAK;AAAC;AA9CxG,SAAA+L,GAAAsc,GAAA;AAAA,SAyBwBC,QAAOD,MAAOA,CAAK;AAAC;"}
|
package/dist/rich-text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as ie } from "react/jsx-runtime";
|
|
2
2
|
import { c as ee } from "react/compiler-runtime";
|
|
3
|
-
import { e as he, a as ge, C as ve, I as Ce, E as be, b as xe, s as Fe, n as $e, c as fe, T as De, d as je } from "./rich-message-
|
|
4
|
-
import { D as vo, f as Co, R as bo, P as xo, R as Eo, g as To, h as yo } from "./rich-message-
|
|
3
|
+
import { e as he, a as ge, C as ve, I as Ce, E as be, b as xe, s as Fe, n as $e, c as fe, T as De, d as je } from "./rich-message-DeJwzVeV.js";
|
|
4
|
+
import { D as vo, f as Co, R as bo, P as xo, R as Eo, g as To, h as yo } from "./rich-message-DeJwzVeV.js";
|
|
5
5
|
import { IconButton as $, Stack as We, Text as Z, Box as Ee, Flex as de } from "@chakra-ui/react";
|
|
6
6
|
import { LexicalCollaboration as Ue } from "@lexical/react/LexicalCollaborationContext";
|
|
7
7
|
import { CollaborationPluginV2__EXPERIMENTAL as Ke } from "@lexical/react/LexicalCollaborationPlugin";
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rich-text__ltr{text-align:left}.rich-text__rtl{text-align:right}.rich-text{--rich-text-font-scale: 1;--rich-text-list-indent: 1.5rem;font-size:calc(1rem * var(--rich-text-font-scale))}.rich-text[data-rich-message=true]{--rich-text-font-scale: .9}.rich-text[data-rich-message=true] .rich-text__p:last-child{margin-bottom:0}.rich-text__paragraph{margin:0;position:relative}.rich-text__quote{margin:0;margin-top:var(--chakra-spacing-xl, 1.5rem);margin-left:var(--chakra-spacing-sm, .75rem);margin-bottom:var(--chakra-spacing-xl, 1.5rem);font-size:calc(15px * var(--rich-text-font-scale));color:var(--chakra-colors-fg-muted);border-left:4px solid var(--chakra-colors-border);padding-left:16px}.rich-text__indent{--lexical-indent-base-value: 40px}.rich-text__textBold{font-weight:700}.rich-text__reference{font:inherit;border-bottom:1px dotted currentColor;opacity:.9;white-space:nowrap}.rich-text__textStrikethrough{text-decoration:line-through}.rich-text__textUnderlineStrikethrough{text-decoration:underline line-through}.rich-text__textSubscript{font-size:.8em;vertical-align:sub}.rich-text__textSuperscript{font-size:.8em;vertical-align:super}.rich-text__textCode{background-color:var(--chakra-colors-bg-code);padding:1px .25rem;font-family:var(--chakra-fonts-mono);font-size:.94em}.rich-text__link{color:var(--chakra-colors-blue-600);text-decoration:none;cursor:pointer}.rich-text__link:hover{text-decoration:underline}.rich-text__code{background-color:var(--chakra-colors-bg-muted);font-family:var(--chakra-fonts-mono);display:block;padding:8px 8px 8px 52px;line-height:1.53;font-size:calc(13px * var(--rich-text-font-scale));margin:0;margin-top:var(--chakra-spacing-md, 1rem);margin-bottom:var(--chakra-spacing-md, 1rem);overflow-x:auto;position:relative;tab-size:2}.rich-text__code:before{content:attr(data-gutter);position:absolute;background-color:var(--chakra-colors-bg-subtle);left:0;top:0;bottom:0;border-right:1px solid var(--chakra-colors-border);padding:8px;color:var(--chakra-colors-fg-muted);white-space:pre-wrap;text-align:right;min-width:25px}.rich-text__table{border-collapse:collapse;border-spacing:0;color:var(--chakra-colors-fg);font-size:calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale));line-height:21px;overflow-y:auto;overflow-x:auto;table-layout:fixed;width:max-content}.rich-text__tableSelection *::selection{background-color:transparent}.rich-text__tableSelected{outline:2px solid var(--chakra-colors-blue-500)}.rich-text__tableCell{border:1px solid var(--chakra-colors-border);vertical-align:top;text-align:start;padding:6px 8px;position:relative;outline:none}.rich-text__tableCellSortedIndicator{display:block;opacity:.5;position:absolute;bottom:0;left:0;width:100%;height:4px;background-color:var(--chakra-colors-bg)}.rich-text__tableCellResizer{position:absolute;right:-4px;height:100%;width:8px;cursor:ew-resize;z-index:10;top:0}.rich-text__tableCellHeader{background-color:var(--chakra-colors-bg-muted);font-weight:400;text-align:start}.rich-text__tableCellSelected{background-color:var(--chakra-colors-blue-100)}.rich-text__tableCellPrimarySelected{border:2px solid var(--chakra-colors-blue-500);display:block;height:calc(100% - 2px);position:absolute;width:calc(100% - 2px);left:-1px;top:-1px;z-index:2}.rich-text__tableCellEditing{box-shadow:var(--chakra-shadows-sm);border-radius:3px}.rich-text__tableAddColumns,.rich-text__tableAddRows{position:absolute;background-color:var(--chakra-colors-bg-muted);animation:table-controls .2s ease;border:0;cursor:pointer}.rich-text__tableAddColumns{top:0;width:20px;height:100%;right:-25px}.rich-text__tableAddColumns:after{background-size:contain;background-position:center;background-repeat:no-repeat;display:block;content:" ";position:absolute;top:0;left:0;width:100%;height:100%;opacity:.4}.rich-text__tableAddRows{bottom:-25px;width:calc(100% - 25px);height:20px;left:0}.rich-text__tableAddRows:after{background-size:contain;background-position:center;background-repeat:no-repeat;display:block;content:" ";position:absolute;top:0;left:0;width:100%;height:100%;opacity:.4}.rich-text__tableAddColumns:hover,.rich-text__tableAddRows:hover{background-color:var(--chakra-colors-blue-100)}@keyframes table-controls{0%{opacity:0}to{opacity:1}}.rich-text__tableCellResizeRuler{display:block;position:absolute;width:1px;background-color:var(--chakra-colors-blue-500);height:100%;top:0}.rich-text__tableCellActionButtonContainer{display:block;right:5px;top:6px;position:absolute;z-index:4;width:20px;height:20px}.rich-text__tableCellActionButton{background-color:var(--chakra-colors-bg-muted);display:block;border:0;border-radius:20px;width:20px;height:20px;color:var(--chakra-colors-fg);cursor:pointer}.rich-text__tableCellActionButton:hover{background-color:var(--chakra-colors-bg-subtle)}.rich-text__characterLimit{display:inline;background-color:var(--chakra-colors-red-100)}ul.rich-text__ul,ul.rich-text__checklist,ol.rich-text__ol,ol.rich-text__ol1,ol.rich-text__ol2,ol.rich-text__ol3,ol.rich-text__ol4,ol.rich-text__ol5{list-style-position:outside;padding-inline-start:var(--rich-text-list-indent);margin-top:var(--chakra-spacing-3, .75rem);margin-bottom:var(--chakra-spacing-3, .75rem)}ul.rich-text__ul{list-style-type:disc}ol.rich-text__ol,ol.rich-text__ol1{list-style-type:decimal}ol.rich-text__ol2{list-style-type:upper-alpha}ol.rich-text__ol3{list-style-type:lower-alpha}ol.rich-text__ol4{list-style-type:upper-roman}ol.rich-text__ol5{list-style-type:lower-roman}li.rich-text__listItem{display:list-item;list-style-position:outside;padding-inline-start:var(--chakra-spacing-1, .25rem)}li.rich-text__listItemUnchecked,li.rich-text__listItemChecked{position:relative;list-style-type:none;padding-left:26px;outline:none}li.rich-text__listItemUnchecked:before,li.rich-text__listItemChecked:before{content:"";position:absolute;left:0;top:2px;width:18px;height:18px;border-radius:var(--chakra-radii-xs, 4px);cursor:pointer}li.rich-text__listItemUnchecked:before{border:1px solid var(--chakra-colors-border)}li.rich-text__listItemChecked:before{background:var(--chakra-colors-fg);border:1px solid var(--chakra-colors-fg)}li.rich-text__listItemChecked:after{content:"";position:absolute;left:0;top:2px;width:18px;height:18px;cursor:pointer;background-color:var(--chakra-colors-bg);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");-webkit-mask-size:12px 12px;mask-size:12px 12px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}ul.rich-text__ul :where(ul,ol),ul.rich-text__checklist :where(ul,ol),ol.rich-text__ol :where(ul,ol),ol.rich-text__ol1 :where(ul,ol),ol.rich-text__ol2 :where(ul,ol),ol.rich-text__ol3 :where(ul,ol),ol.rich-text__ol4 :where(ul,ol),ol.rich-text__ol5 :where(ul,ol){padding-inline-start:var(--rich-text-list-indent)}li.rich-text__nestedListItem{list-style-type:none;padding-inline-start:0}.rich-text__nestedListItem:before,.rich-text__nestedListItem:after{display:none}.rich-text__tokenComment{color:var(--chakra-colors-gray-500)}.rich-text__tokenPunctuation{color:var(--chakra-colors-gray-400)}.rich-text__tokenProperty{color:var(--chakra-colors-purple-600)}.rich-text__tokenSelector{color:var(--chakra-colors-green-600)}.rich-text__tokenOperator{color:var(--chakra-colors-orange-600)}.rich-text__tokenAttr{color:var(--chakra-colors-blue-600)}.rich-text__tokenVariable{color:var(--chakra-colors-yellow-600)}.rich-text__tokenFunction{color:var(--chakra-colors-pink-600)}.rich-text__mark{background:var(--chakra-colors-yellow-100);border-bottom:2px solid var(--chakra-colors-yellow-200);padding-bottom:2px}.rich-text__markOverlap{background:var(--chakra-colors-yellow-200);border-bottom:2px solid var(--chakra-colors-yellow-300)}.rich-text__mark.selected{background:var(--chakra-colors-yellow-300);border-bottom:2px solid var(--chakra-colors-yellow-400)}.rich-text__markOverlap.selected{background:var(--chakra-colors-yellow-400);border-bottom:2px solid var(--chakra-colors-yellow-400)}.rich-text__layoutContainer{display:grid;gap:var(--chakra-spacing-2, .5rem)}.rich-text__layoutItem{border-radius:var(--chakra-radii-sm)}.rich-text__layoutItem>:first-child{margin-top:0;margin-bottom:0}.draggable-block-demo__row{display:flex;gap:var(--chakra-spacing-3, .75rem);padding-block:var(--chakra-spacing-2, .5rem);padding-inline:var(--chakra-spacing-4, 1rem);position:relative;transition:box-shadow .14s ease}.rich-text__row{border-radius:var(--chakra-radii-lg)}.draggable-block-demo__row:focus-within{box-shadow:0 0 0 2px var(--chakra-colors-blue-200)}.draggable-block-demo__content,.rich-text__content{position:relative;flex:1 1 0;transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.draggable-block-demo__content--empty{color:var(--chakra-colors-fg-muted);border-style:dashed;background:var(--chakra-colors-bg-subtle)}.draggable-block-demo__handle-slot{position:absolute;inset:0;width:0;height:0;pointer-events:none}.draggable-block-demo__handle-controls{position:absolute;pointer-events:none;opacity:0;transform:translate(-10000px,-10000px);z-index:11;display:flex;flex-direction:column;align-items:center;gap:8px}.draggable-block-demo__floating-handle,.draggable-block-demo__delete-button{pointer-events:auto}.draggable-block-demo__floating-handle{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:var(--chakra-radii-sm);border:1px solid var(--chakra-colors-border);background:var(--chakra-colors-bg);color:var(--chakra-colors-fg-muted);box-shadow:var(--chakra-shadows-sm);cursor:grab;transition:box-shadow .12s ease,transform .12s ease}.draggable-block-demo__floating-handle:active{cursor:grabbing}.draggable-block-demo__handle-icon{margin-left:-4px;display:inline-block;font-size:calc(12px * var(--rich-text-font-scale));letter-spacing:-4px;-webkit-user-select:none;user-select:none}.draggable-block-demo__delete-button{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:var(--chakra-radii-sm);border:1px solid var(--chakra-colors-red-200);background:var(--chakra-colors-red-50);color:var(--chakra-colors-red-600);cursor:pointer;box-shadow:var(--chakra-shadows-xs);transition:background .12s ease,border-color .12s ease}.draggable-block-demo__delete-button:hover{background:var(--chakra-colors-red-100);border-color:var(--chakra-colors-red-300)}.draggable-block-demo__delete-icon{font-size:calc(16px * var(--rich-text-font-scale));line-height:1;-webkit-user-select:none;user-select:none}.draggable-block-demo__gap{position:absolute;left:0;width:100%;height:28px;display:flex;justify-content:center;align-items:center;pointer-events:auto;opacity:0;transition:opacity .12s ease}.draggable-block-demo__gap-line{width:100%;border-top:1px dashed var(--chakra-colors-border);position:absolute;top:50%;transform:translateY(-50%)}.draggable-block-demo__gap-button{pointer-events:auto;border:1px solid var(--chakra-colors-border);background:var(--chakra-colors-bg);border-radius:999px;width:20px;height:20px;font-size:calc(18px * var(--rich-text-font-scale));line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--chakra-colors-fg-muted);box-shadow:var(--chakra-shadows-xs);transition:background .12s ease,color .12s ease}.draggable-block-demo__gap:hover,.draggable-block-demo__gap.is-active{opacity:1}.draggable-block-demo__gap-button:hover{background:var(--chakra-colors-bg-subtle);color:var(--chakra-colors-fg)}.draggable-block-demo__indicator{position:absolute;background:var(--chakra-colors-blue-500);pointer-events:none;border-radius:2px;z-index:12}.draggable-block-demo__indicator--horizontal{height:2px}.draggable-block-demo__indicator--vertical{width:2px}.rich-text__h1{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-4xl) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:120%;color:var(--chakra-colors-fg);margin-top:2.5rem;margin-bottom:var(--chakra-spacing-md, 1rem)}.rich-text__h1:first-of-type{margin-top:0}.rich-text__h1_2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-3xl) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:120%;color:var(--chakra-colors-fg);margin-top:var(--chakra-spacing-3, .75rem);margin-bottom:var(--chakra-spacing-2, .5rem)}.rich-text__h2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-3xl) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:120%;color:var(--chakra-colors-fg, var(--chakra-colors-fg));margin-top:var(--chakra-spacing-lg, 1.5rem);margin-bottom:var(--chakra-spacing-md, 1rem)}.rich-text__h2_2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-2xl) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:120%;color:var(--chakra-colors-fg, var(--chakra-colors-fg));margin-top:var(--chakra-spacing-2, .5rem);margin-bottom:var(--chakra-spacing-1, .125rem)}.rich-text__h3{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-lg) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:100%;color:var(--chakra-colors-fg, var(--chakra-colors-fg));margin-top:var(--chakra-spacing-lg, 1.5rem);margin-bottom:var(--chakra-spacing-md, 1rem)}.rich-text__h3_2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-lg) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:100%;color:var(--chakra-colors-fg, var(--chakra-colors-fg));margin-top:var(--chakra-spacing-2, .5rem)}.rich-text__p{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale));line-height:171%;letter-spacing:.14px;margin:0;margin-top:var(--chakra-spacing-3, .75rem);margin-bottom:var(--chakra-spacing-3, .75rem)}.rich-text__p:first-child{margin-top:0}.rich-text__p:only-child{margin-bottom:0}.rich-text[data-rich-message=true] .rich-text__quote{margin-top:var(--chakra-spacing-3, .75rem);margin-left:var(--chakra-spacing-3, .75rem);margin-bottom:var(--chakra-spacing-3, .75rem)}.rich-text[data-rich-message=true] .rich-text__code{margin-top:8px;margin-bottom:8px}.rich-text[data-rich-message=true] .rich-text__h1{font-size:calc(var(--chakra-font-sizes-3xl) * var(--rich-text-font-scale));margin-top:var(--chakra-spacing-5, 1.5rem);margin-bottom:var(--chakra-spacing-4, 1rem)}.rich-text[data-rich-message=true] .rich-text__h2{font-size:calc(var(--chakra-font-sizes-2xl) * var(--rich-text-font-scale));margin-top:var(--chakra-spacing-4, 1rem);margin-bottom:var(--chakra-spacing-3, .75rem)}.rich-text[data-rich-message=true] .rich-text__h3{margin-top:var(--chakra-spacing-4, 1rem);margin-bottom:var(--chakra-spacing-3, .75rem)}.rich-text__p2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale));line-height:171%;letter-spacing:.14px;margin:0}.rich-text__textUnderline{text-decoration:underline}.rich-text__textItalic{font-style:italic}span.editor-equation{display:inline-block}.editor-equation span{cursor:inherit}.editor-equation{-webkit-user-select:none;user-select:none}.katex-display{overflow-x:auto;overflow-y:hidden}.code-block-actions{z-index:1001;opacity:.95}.code-block-actions button{box-shadow:var(--chakra-shadows-sm)}.floating-text-format-toolbar{display:flex;position:absolute;top:0;left:0;z-index:1000;opacity:0;pointer-events:none;background-color:var(--chakra-colors-bg);border-radius:8px;border:1px solid var(--chakra-colors-border-muted);box-shadow:0 5px 10px #0000001a;transition:opacity .2s;will-change:transform;padding:4px;gap:2px}.floating-text-format-toolbar.active{opacity:1;pointer-events:auto}.floating-text-format-toolbar button[data-active]{background-color:var(--chakra-colors-bg-accent-primary-medium);color:var(--chakra-colors-text-selectable-primary)}.rich-text__p--no-margin{margin:0}
|
|
1
|
+
.rich-text__ltr{text-align:left}.rich-text__rtl{text-align:right}.rich-text{--rich-text-font-scale: 1;--rich-text-list-indent: 1.5rem;font-size:calc(1rem * var(--rich-text-font-scale))}.rich-text[data-rich-message=true]{--rich-text-font-scale: .9}.rich-text[data-rich-message=true] .rich-text__p:last-child{margin-bottom:0}.rich-text__paragraph{margin:0;position:relative}.rich-text__quote{margin:0;margin-top:var(--chakra-spacing-xl, 1.5rem);margin-left:var(--chakra-spacing-sm, .75rem);margin-bottom:var(--chakra-spacing-xl, 1.5rem);font-size:calc(15px * var(--rich-text-font-scale));color:var(--chakra-colors-fg-muted);border-left:4px solid var(--chakra-colors-border);padding-left:16px}.rich-text__indent{--lexical-indent-base-value: 40px}.rich-text__textBold{font-weight:700}.rich-text__reference{font:inherit;border-bottom:1px dotted currentColor;opacity:.9;white-space:nowrap}.rich-text__textStrikethrough{text-decoration:line-through}.rich-text__textUnderlineStrikethrough{text-decoration:underline line-through}.rich-text__textSubscript{font-size:.8em;vertical-align:sub}.rich-text__textSuperscript{font-size:.8em;vertical-align:super}.rich-text__textCode{background-color:var(--chakra-colors-bg-code);padding:1px .25rem;font-family:var(--chakra-fonts-mono);font-size:.94em}.rich-text__link{color:var(--chakra-colors-blue-600);text-decoration:none;cursor:pointer}.rich-text__link:hover{text-decoration:underline}.rich-text__code{background-color:var(--chakra-colors-bg-code);font-family:var(--chakra-fonts-mono);display:block;padding:8px 8px 8px 52px;line-height:1.53;font-size:calc(13px * var(--rich-text-font-scale));margin:0;margin-top:var(--chakra-spacing-md, 1rem);margin-bottom:var(--chakra-spacing-md, 1rem);overflow-x:auto;position:relative;tab-size:2}.rich-text__code:before{content:attr(data-gutter);position:absolute;background-color:var(--chakra-colors-bg-subtle);left:0;top:0;bottom:0;border-right:1px solid var(--chakra-colors-border);padding:8px;color:var(--chakra-colors-fg-muted);white-space:pre-wrap;text-align:right;min-width:25px}.rich-text__table{border-collapse:collapse;border-spacing:0;color:var(--chakra-colors-fg);font-size:calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale));line-height:21px;overflow-y:auto;overflow-x:auto;table-layout:fixed;width:max-content}.rich-text__tableSelection *::selection{background-color:transparent}.rich-text__tableSelected{outline:2px solid var(--chakra-colors-blue-500)}.rich-text__tableCell{border:1px solid var(--chakra-colors-border);vertical-align:top;text-align:start;padding:6px 8px;position:relative;outline:none}.rich-text__tableCellSortedIndicator{display:block;opacity:.5;position:absolute;bottom:0;left:0;width:100%;height:4px;background-color:var(--chakra-colors-bg)}.rich-text__tableCellResizer{position:absolute;right:-4px;height:100%;width:8px;cursor:ew-resize;z-index:10;top:0}.rich-text__tableCellHeader{background-color:var(--chakra-colors-bg-muted);font-weight:400;text-align:start}.rich-text__tableCellSelected{background-color:var(--chakra-colors-blue-100)}.rich-text__tableCellPrimarySelected{border:2px solid var(--chakra-colors-blue-500);display:block;height:calc(100% - 2px);position:absolute;width:calc(100% - 2px);left:-1px;top:-1px;z-index:2}.rich-text__tableCellEditing{box-shadow:var(--chakra-shadows-sm);border-radius:3px}.rich-text__tableAddColumns,.rich-text__tableAddRows{position:absolute;background-color:var(--chakra-colors-bg-muted);animation:table-controls .2s ease;border:0;cursor:pointer}.rich-text__tableAddColumns{top:0;width:20px;height:100%;right:-25px}.rich-text__tableAddColumns:after{background-size:contain;background-position:center;background-repeat:no-repeat;display:block;content:" ";position:absolute;top:0;left:0;width:100%;height:100%;opacity:.4}.rich-text__tableAddRows{bottom:-25px;width:calc(100% - 25px);height:20px;left:0}.rich-text__tableAddRows:after{background-size:contain;background-position:center;background-repeat:no-repeat;display:block;content:" ";position:absolute;top:0;left:0;width:100%;height:100%;opacity:.4}.rich-text__tableAddColumns:hover,.rich-text__tableAddRows:hover{background-color:var(--chakra-colors-blue-100)}@keyframes table-controls{0%{opacity:0}to{opacity:1}}.rich-text__tableCellResizeRuler{display:block;position:absolute;width:1px;background-color:var(--chakra-colors-blue-500);height:100%;top:0}.rich-text__tableCellActionButtonContainer{display:block;right:5px;top:6px;position:absolute;z-index:4;width:20px;height:20px}.rich-text__tableCellActionButton{background-color:var(--chakra-colors-bg-muted);display:block;border:0;border-radius:20px;width:20px;height:20px;color:var(--chakra-colors-fg);cursor:pointer}.rich-text__tableCellActionButton:hover{background-color:var(--chakra-colors-bg-subtle)}.rich-text__characterLimit{display:inline;background-color:var(--chakra-colors-red-100)}ul.rich-text__ul,ul.rich-text__checklist,ol.rich-text__ol,ol.rich-text__ol1,ol.rich-text__ol2,ol.rich-text__ol3,ol.rich-text__ol4,ol.rich-text__ol5{list-style-position:outside;padding-inline-start:var(--rich-text-list-indent);margin-top:var(--chakra-spacing-3, .75rem);margin-bottom:var(--chakra-spacing-3, .75rem)}ul.rich-text__ul{list-style-type:disc}ol.rich-text__ol,ol.rich-text__ol1{list-style-type:decimal}ol.rich-text__ol2{list-style-type:upper-alpha}ol.rich-text__ol3{list-style-type:lower-alpha}ol.rich-text__ol4{list-style-type:upper-roman}ol.rich-text__ol5{list-style-type:lower-roman}li.rich-text__listItem{display:list-item;list-style-position:outside;padding-inline-start:var(--chakra-spacing-1, .25rem)}li.rich-text__listItemUnchecked,li.rich-text__listItemChecked{position:relative;list-style-type:none;padding-left:26px;outline:none}li.rich-text__listItemUnchecked:before,li.rich-text__listItemChecked:before{content:"";position:absolute;left:0;top:2px;width:18px;height:18px;border-radius:var(--chakra-radii-xs, 4px);cursor:pointer}li.rich-text__listItemUnchecked:before{border:1px solid var(--chakra-colors-border)}li.rich-text__listItemChecked:before{background:var(--chakra-colors-fg);border:1px solid var(--chakra-colors-fg)}li.rich-text__listItemChecked:after{content:"";position:absolute;left:0;top:2px;width:18px;height:18px;cursor:pointer;background-color:var(--chakra-colors-bg);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");-webkit-mask-size:12px 12px;mask-size:12px 12px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}ul.rich-text__ul :where(ul,ol),ul.rich-text__checklist :where(ul,ol),ol.rich-text__ol :where(ul,ol),ol.rich-text__ol1 :where(ul,ol),ol.rich-text__ol2 :where(ul,ol),ol.rich-text__ol3 :where(ul,ol),ol.rich-text__ol4 :where(ul,ol),ol.rich-text__ol5 :where(ul,ol){padding-inline-start:var(--rich-text-list-indent)}li.rich-text__nestedListItem{list-style-type:none;padding-inline-start:0}.rich-text__nestedListItem:before,.rich-text__nestedListItem:after{display:none}.rich-text__tokenComment{color:var(--chakra-colors-gray-500)}.rich-text__tokenPunctuation{color:var(--chakra-colors-gray-400)}.rich-text__tokenProperty{color:var(--chakra-colors-purple-600)}.rich-text__tokenSelector{color:var(--chakra-colors-green-600)}.rich-text__tokenOperator{color:var(--chakra-colors-orange-600)}.rich-text__tokenAttr{color:var(--chakra-colors-blue-600)}.rich-text__tokenVariable{color:var(--chakra-colors-yellow-600)}.rich-text__tokenFunction{color:var(--chakra-colors-pink-600)}.rich-text__mark{background:var(--chakra-colors-yellow-100);border-bottom:2px solid var(--chakra-colors-yellow-200);padding-bottom:2px}.rich-text__markOverlap{background:var(--chakra-colors-yellow-200);border-bottom:2px solid var(--chakra-colors-yellow-300)}.rich-text__mark.selected{background:var(--chakra-colors-yellow-300);border-bottom:2px solid var(--chakra-colors-yellow-400)}.rich-text__markOverlap.selected{background:var(--chakra-colors-yellow-400);border-bottom:2px solid var(--chakra-colors-yellow-400)}.rich-text__layoutContainer{display:grid;gap:var(--chakra-spacing-2, .5rem)}.rich-text__layoutItem{border-radius:var(--chakra-radii-sm)}.rich-text__layoutItem>:first-child{margin-top:0;margin-bottom:0}.draggable-block-demo__row{display:flex;gap:var(--chakra-spacing-3, .75rem);padding-block:var(--chakra-spacing-2, .5rem);padding-inline:var(--chakra-spacing-4, 1rem);position:relative;transition:box-shadow .14s ease}.rich-text__row{border-radius:var(--chakra-radii-lg)}.draggable-block-demo__row:focus-within{box-shadow:0 0 0 2px var(--chakra-colors-blue-200)}.draggable-block-demo__content,.rich-text__content{position:relative;flex:1 1 0;transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.draggable-block-demo__content--empty{color:var(--chakra-colors-fg-muted);border-style:dashed;background:var(--chakra-colors-bg-subtle)}.draggable-block-demo__handle-slot{position:absolute;inset:0;width:0;height:0;pointer-events:none}.draggable-block-demo__handle-controls{position:absolute;pointer-events:none;opacity:0;transform:translate(-10000px,-10000px);z-index:11;display:flex;flex-direction:column;align-items:center;gap:8px}.draggable-block-demo__floating-handle,.draggable-block-demo__delete-button{pointer-events:auto}.draggable-block-demo__floating-handle{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:var(--chakra-radii-sm);border:1px solid var(--chakra-colors-border);background:var(--chakra-colors-bg);color:var(--chakra-colors-fg-muted);box-shadow:var(--chakra-shadows-sm);cursor:grab;transition:box-shadow .12s ease,transform .12s ease}.draggable-block-demo__floating-handle:active{cursor:grabbing}.draggable-block-demo__handle-icon{margin-left:-4px;display:inline-block;font-size:calc(12px * var(--rich-text-font-scale));letter-spacing:-4px;-webkit-user-select:none;user-select:none}.draggable-block-demo__delete-button{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:var(--chakra-radii-sm);border:1px solid var(--chakra-colors-red-200);background:var(--chakra-colors-red-50);color:var(--chakra-colors-red-600);cursor:pointer;box-shadow:var(--chakra-shadows-xs);transition:background .12s ease,border-color .12s ease}.draggable-block-demo__delete-button:hover{background:var(--chakra-colors-red-100);border-color:var(--chakra-colors-red-300)}.draggable-block-demo__delete-icon{font-size:calc(16px * var(--rich-text-font-scale));line-height:1;-webkit-user-select:none;user-select:none}.draggable-block-demo__gap{position:absolute;left:0;width:100%;height:28px;display:flex;justify-content:center;align-items:center;pointer-events:auto;opacity:0;transition:opacity .12s ease}.draggable-block-demo__gap-line{width:100%;border-top:1px dashed var(--chakra-colors-border);position:absolute;top:50%;transform:translateY(-50%)}.draggable-block-demo__gap-button{pointer-events:auto;border:1px solid var(--chakra-colors-border);background:var(--chakra-colors-bg);border-radius:999px;width:20px;height:20px;font-size:calc(18px * var(--rich-text-font-scale));line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--chakra-colors-fg-muted);box-shadow:var(--chakra-shadows-xs);transition:background .12s ease,color .12s ease}.draggable-block-demo__gap:hover,.draggable-block-demo__gap.is-active{opacity:1}.draggable-block-demo__gap-button:hover{background:var(--chakra-colors-bg-subtle);color:var(--chakra-colors-fg)}.draggable-block-demo__indicator{position:absolute;background:var(--chakra-colors-blue-500);pointer-events:none;border-radius:2px;z-index:12}.draggable-block-demo__indicator--horizontal{height:2px}.draggable-block-demo__indicator--vertical{width:2px}.rich-text__h1{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-4xl) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:120%;color:var(--chakra-colors-fg);margin-top:2.5rem;margin-bottom:var(--chakra-spacing-md, 1rem)}.rich-text__h1:first-of-type{margin-top:0}.rich-text__h1_2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-3xl) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:120%;color:var(--chakra-colors-fg);margin-top:var(--chakra-spacing-3, .75rem);margin-bottom:var(--chakra-spacing-2, .5rem)}.rich-text__h2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-3xl) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:120%;color:var(--chakra-colors-fg, var(--chakra-colors-fg));margin-top:var(--chakra-spacing-lg, 1.5rem);margin-bottom:var(--chakra-spacing-md, 1rem)}.rich-text__h2_2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-2xl) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:120%;color:var(--chakra-colors-fg, var(--chakra-colors-fg));margin-top:var(--chakra-spacing-2, .5rem);margin-bottom:var(--chakra-spacing-1, .125rem)}.rich-text__h3{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-lg) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:100%;color:var(--chakra-colors-fg, var(--chakra-colors-fg));margin-top:var(--chakra-spacing-lg, 1.5rem);margin-bottom:var(--chakra-spacing-md, 1rem)}.rich-text__h3_2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-lg) * var(--rich-text-font-scale));font-weight:var(--chakra-font-weights-medium);line-height:100%;color:var(--chakra-colors-fg, var(--chakra-colors-fg));margin-top:var(--chakra-spacing-2, .5rem)}.rich-text__p{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale));line-height:171%;letter-spacing:.14px;margin:0;margin-top:var(--chakra-spacing-3, .75rem);margin-bottom:var(--chakra-spacing-3, .75rem)}.rich-text__p:first-child{margin-top:0}.rich-text__p:only-child{margin-bottom:0}.rich-text[data-rich-message=true] .rich-text__quote{margin-top:var(--chakra-spacing-3, .75rem);margin-left:var(--chakra-spacing-3, .75rem);margin-bottom:var(--chakra-spacing-3, .75rem)}.rich-text[data-rich-message=true] .rich-text__code{margin-top:8px;margin-bottom:8px}.rich-text[data-rich-message=true] .rich-text__h1{font-size:calc(var(--chakra-font-sizes-3xl) * var(--rich-text-font-scale));margin-top:var(--chakra-spacing-5, 1.5rem);margin-bottom:var(--chakra-spacing-4, 1rem)}.rich-text[data-rich-message=true] .rich-text__h2{font-size:calc(var(--chakra-font-sizes-2xl) * var(--rich-text-font-scale));margin-top:var(--chakra-spacing-4, 1rem);margin-bottom:var(--chakra-spacing-3, .75rem)}.rich-text[data-rich-message=true] .rich-text__h3{margin-top:var(--chakra-spacing-4, 1rem);margin-bottom:var(--chakra-spacing-3, .75rem)}.rich-text__p2{font-family:var(--chakra-fonts-body);font-size:calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale));line-height:171%;letter-spacing:.14px;margin:0}.rich-text__textUnderline{text-decoration:underline}.rich-text__textItalic{font-style:italic}span.editor-equation{display:inline-block}.editor-equation span{cursor:inherit}.editor-equation{-webkit-user-select:none;user-select:none}.katex-display{overflow-x:auto;overflow-y:hidden}.code-block-actions{z-index:1001;opacity:.95}.code-block-actions button{box-shadow:var(--chakra-shadows-sm)}.floating-text-format-toolbar{display:flex;position:absolute;top:0;left:0;z-index:1000;opacity:0;pointer-events:none;background-color:var(--chakra-colors-bg);border-radius:8px;border:1px solid var(--chakra-colors-border-muted);box-shadow:0 5px 10px #0000001a;transition:opacity .2s;will-change:transform;padding:4px;gap:2px}.floating-text-format-toolbar.active{opacity:1;pointer-events:auto}.floating-text-format-toolbar button[data-active]{background-color:var(--chakra-colors-bg-accent-primary-medium);color:var(--chakra-colors-text-selectable-primary)}.rich-text__p--no-margin{margin:0}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"id": "monokai",
|
|
3
|
+
"mode": "dark",
|
|
4
|
+
"tokens": {
|
|
5
|
+
"colors.fg": "#F8F8F2",
|
|
6
|
+
"colors.fg.muted": "#75715E",
|
|
7
|
+
"colors.fg.subtle": "#A59F85",
|
|
8
|
+
"colors.fg.inverted": "#272822",
|
|
9
|
+
"colors.fg.blue-dark": "#66D9EF",
|
|
10
|
+
"colors.bg": "#272822",
|
|
11
|
+
"colors.bg.muted": "#34352E",
|
|
12
|
+
"colors.bg.subtle": "#1F201B",
|
|
13
|
+
"colors.bg.hover": "#3E3D32",
|
|
14
|
+
"colors.bg.active": "#49483E",
|
|
15
|
+
"colors.bg.code": "#1F201B",
|
|
16
|
+
"colors.bg.emphasized": "#49483E",
|
|
17
|
+
"colors.bg.inverted": "#F8F8F2",
|
|
18
|
+
"colors.bg.panel": "#1F201B",
|
|
19
|
+
"colors.bg.dark": "#1F201B",
|
|
20
|
+
"colors.bg.button.primary.default": "#E6DB74",
|
|
21
|
+
"colors.bg.button.primary.hover": "#F4E98A",
|
|
22
|
+
"colors.bg.button.primary.pressed": "#CFC25F",
|
|
23
|
+
"colors.bg.menu-item.hover": "#3E3D32",
|
|
24
|
+
"colors.bg.menu-item.focus": "#3E3D32",
|
|
25
|
+
"colors.bg.menu-item.selected": "#49483E",
|
|
26
|
+
"colors.bg.accent-primary.default": "#E6DB74",
|
|
27
|
+
"colors.bg.accent-primary.hover": "#F4E98A",
|
|
28
|
+
"colors.bg.accent-primary.pressed": "#CFC25F",
|
|
29
|
+
"colors.bg.accent-primary.very-light": "#3B3A2B",
|
|
30
|
+
"colors.bg.accent-primary.light": "#494531",
|
|
31
|
+
"colors.bg.accent-primary.medium": "#E6DB74",
|
|
32
|
+
"colors.bg.accent-primary.dark": "#F4E98A",
|
|
33
|
+
"colors.bg.accent-secondary.grey-dark": "#272822",
|
|
34
|
+
"colors.bg.accent-secondary.grey-light": "#34352E",
|
|
35
|
+
"colors.bg.accent-secondary.red-very-light": "#3A1F1F",
|
|
36
|
+
"colors.bg.accent-secondary.red-light": "#4A2424",
|
|
37
|
+
"colors.bg.accent-secondary.pink-light": "#4A2039",
|
|
38
|
+
"colors.bg.accent-secondary.pink-medium": "#F92672",
|
|
39
|
+
"colors.bg.accent-secondary.blue-very-light": "#243A3D",
|
|
40
|
+
"colors.bg.accent-secondary.blue-light": "#26464A",
|
|
41
|
+
"colors.bg.accent-secondary.blue-medium": "#66D9EF",
|
|
42
|
+
"colors.bg.accent-secondary.blue-dark": "#66D9EF",
|
|
43
|
+
"colors.bg.accent-secondary.cyan-light": "#26464A",
|
|
44
|
+
"colors.bg.accent-secondary.green-light": "#33401F",
|
|
45
|
+
"colors.bg.accent-secondary.yellow-light": "#494531",
|
|
46
|
+
"colors.bg.accent-secondary.yellow-medium": "#E6DB74",
|
|
47
|
+
"colors.bg.accent-secondary.yellow-dark": "#F4E98A",
|
|
48
|
+
"colors.bg.accent-secondary.sand-light": "#3E3D32",
|
|
49
|
+
"colors.border": "#5B594A",
|
|
50
|
+
"colors.border.muted": "#49483E",
|
|
51
|
+
"colors.border.subtle": "#3E3D32",
|
|
52
|
+
"colors.border.inverted": "#CFCFC2",
|
|
53
|
+
"colors.border.accent-light": "#66D9EF",
|
|
54
|
+
"colors.border.accent": "#66D9EF",
|
|
55
|
+
"colors.blue.border": "#66D9EF",
|
|
56
|
+
"colors.orange.contrast": "#272822",
|
|
57
|
+
"colors.orange.fg": "#FD971F",
|
|
58
|
+
"colors.orange.subtle": "#493522",
|
|
59
|
+
"colors.orange.muted": "#5A3C20",
|
|
60
|
+
"colors.orange.emphasized": "#7A4D1D",
|
|
61
|
+
"colors.orange.solid": "#FD971F",
|
|
62
|
+
"colors.orange.focusRing": "#FD971F",
|
|
63
|
+
"colors.orange.border": "#FD971F",
|
|
64
|
+
"colors.vis.text.primary": "#F8F8F2",
|
|
65
|
+
"colors.vis.text.secondary": "#CFCFC2",
|
|
66
|
+
"colors.vis.grid": "#49483E",
|
|
67
|
+
"colors.vis.axis": "#A59F85",
|
|
68
|
+
"colors.vis.categorical.1": "#66D9EF",
|
|
69
|
+
"colors.vis.categorical.2": "#FD971F",
|
|
70
|
+
"colors.vis.categorical.3": "#AE81FF",
|
|
71
|
+
"colors.vis.categorical.4": "#F92672",
|
|
72
|
+
"colors.vis.categorical.5": "#E6DB74",
|
|
73
|
+
"colors.vis.categorical.6": "#A6E22E",
|
|
74
|
+
"colors.vis.categorical.7": "#75715E",
|
|
75
|
+
"colors.text.selectable.primary": "#272822"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
;
|
|
79
|
+
|
|
80
|
+
export default _default;
|