@pstdio/ui 0.24.2 → 0.25.0

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.
Files changed (56) hide show
  1. package/dist/{MermaidComponent-DSvPk-J8.js → MermaidComponent-BVdDqDRU.js} +2 -2
  2. package/dist/{MermaidComponent-DSvPk-J8.js.map → MermaidComponent-BVdDqDRU.js.map} +1 -1
  3. package/dist/chat-ui.js +15 -14
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/activity/activity-comment.d.ts +10 -2
  6. package/dist/components/activity/index.d.ts +3 -1
  7. package/dist/components/activity/resource-activity-feed.d.ts +58 -0
  8. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +1 -1
  9. package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
  10. package/dist/data-table.js +4 -4
  11. package/dist/{edit-mode-data-table-2E4GSOou.js → edit-mode-data-table-B8UpWb7i.js} +3 -3
  12. package/dist/{edit-mode-data-table-2E4GSOou.js.map → edit-mode-data-table-B8UpWb7i.js.map} +1 -1
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +1867 -1634
  15. package/dist/index.js.map +1 -1
  16. package/dist/{kanban-renderer-toolbar-Dcbxujbk.js → kanban-renderer-toolbar-DzY6THJY.js} +2 -2
  17. package/dist/{kanban-renderer-toolbar-Dcbxujbk.js.map → kanban-renderer-toolbar-DzY6THJY.js.map} +1 -1
  18. package/dist/kanban-renderer.js +4 -4
  19. package/dist/{lazy-markdown-editor-DSlelhHV.js → lazy-markdown-editor-ClZPZuaU.js} +2 -2
  20. package/dist/{lazy-markdown-editor-DSlelhHV.js.map → lazy-markdown-editor-ClZPZuaU.js.map} +1 -1
  21. package/dist/{markdown-editor-BHoRATej.js → markdown-editor-CAVqJ9yR.js} +2 -2
  22. package/dist/{markdown-editor-BHoRATej.js.map → markdown-editor-CAVqJ9yR.js.map} +1 -1
  23. package/dist/{markdown-Cli3KGu9.js → markdown-gNucAjnF.js} +9 -9
  24. package/dist/{markdown-Cli3KGu9.js.map → markdown-gNucAjnF.js.map} +1 -1
  25. package/dist/{param-editor-CaRflJ3e.js → param-editor-CTx3mDxQ.js} +2 -2
  26. package/dist/{param-editor-CaRflJ3e.js.map → param-editor-CTx3mDxQ.js.map} +1 -1
  27. package/dist/{param-editor-field-DVQlXbid.js → param-editor-field-DteDEyeU.js} +2 -2
  28. package/dist/{param-editor-field-DVQlXbid.js.map → param-editor-field-DteDEyeU.js.map} +1 -1
  29. package/dist/prompt-input-DNpRL5tI.js +564 -0
  30. package/dist/prompt-input-DNpRL5tI.js.map +1 -0
  31. package/dist/rich-message-CuPiKxKX.js +78 -0
  32. package/dist/rich-message-CuPiKxKX.js.map +1 -0
  33. package/dist/rich-text.js +24 -23
  34. package/dist/rich-text.js.map +1 -1
  35. package/dist/theme/primitives/colors.d.ts +0 -23
  36. package/dist/theme/recipes/activity-comment.d.ts +36 -0
  37. package/dist/theme/recipes/alert.d.ts +1 -1
  38. package/dist/theme/recipes/dialog.d.ts +1 -1
  39. package/dist/theme/recipes/drawer.d.ts +1 -1
  40. package/dist/theme/recipes/menu.d.ts +1 -1
  41. package/dist/theme/recipes/popover.d.ts +1 -1
  42. package/dist/theme/recipes/progress-circle.d.ts +3 -3
  43. package/dist/theme/recipes/switch.d.ts +1 -1
  44. package/dist/theme/recipes/timeline.d.ts +1 -1
  45. package/dist/theme/recipes/tooltip.d.ts +1 -1
  46. package/dist/theme/recipes/window-title-bar.d.ts +1 -1
  47. package/dist/{theme-B5OVwYEU.js → theme-Dc7hVvMC.js} +118 -808
  48. package/dist/theme-Dc7hVvMC.js.map +1 -0
  49. package/dist/theme.js +1 -1
  50. package/package.json +2 -2
  51. package/dist/rich-message-gWYlm8Ji.js +0 -628
  52. package/dist/rich-message-gWYlm8Ji.js.map +0 -1
  53. package/dist/theme/recipes/landing-story.d.ts +0 -10
  54. package/dist/theme/recipes/landing-tool-demo.d.ts +0 -1
  55. package/dist/theme/recipes/landing.d.ts +0 -23
  56. package/dist/theme-B5OVwYEU.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-input-DNpRL5tI.js","sources":["../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"],"sourcesContent":["export const INSERT_REFERENCE = \"INSERT_REFERENCE\";\nexport const INSERT_BLOCK = \"INSERT_BLOCK\";\n","import { createCommand } from \"lexical\";\nimport { INSERT_BLOCK, INSERT_REFERENCE } from \"./events\";\n\nexport const INSERT_REFERENCE_COMMAND = createCommand(INSERT_REFERENCE);\n\nexport const INSERT_BLOCK_COMMAND = createCommand(INSERT_BLOCK);\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 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","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 { $isElementNode, type RootNode } from \"lexical\";\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 { ScrollArea } from \"@/components/primitives/scroll-area\";\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 <ScrollArea\n zIndex=\"1000\"\n position=\"absolute\"\n layerStyle=\"modal\"\n maxHeight={\"24rem\"}\n showHorizontalScrollbar={false}\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 </ScrollArea>\n );\n};\n","import type { ReferenceResourceType } from \"../../../prompt-input\";\nimport 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: ReferenceResourceType;\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 type { ReferenceResourceType } from \"../../prompt-input\";\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: ReferenceResourceType;\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 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","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 type { ReferenceResourceType } from \"../../prompt-input\";\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: ReferenceResourceType) => 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: ReferenceResourceType;\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 ReferenceResourceType = \"table\" | \"connector\" | \"file\";\n\nexport type ReferenceItem = {\n resourceId: string;\n resourceType: ReferenceResourceType;\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: ReferenceResourceType) => 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"],"names":["INSERT_REFERENCE","INSERT_BLOCK","INSERT_REFERENCE_COMMAND","createCommand","INSERT_BLOCK_COMMAND","convertCommentElement","element","node","$createCommentNode","style","setFormat","textAlign","CommentNode","ElementNode","getType","clone","__key","createDOM","config","document","createElement","addClassNamesToElement","theme","comment","updateDOM","importDOM","blockquote","conversion","priority","exportDOM","editor","isHTMLElement","isEmpty","append","formatType","getFormatType","direction","getDirection","dir","importJSON","serializedNode","format","setIndent","indent","setDirection","exportJSON","type","getTextContent","replace","insertNewAfter","_","restoreSelection","newBlock","$createParagraphNode","insertAfter","collapseAtStart","paragraph","children","getChildren","forEach","child","insertCommentBlock","_blockType","nodeToReplace","selection","$getSelection","commentNode","nodeParent","getParent","remove","selectEnd","$isRangeSelection","$setBlocksType","useCommentCommands","$","_c","useLexicalComposerContext","t0","t1","mergeRegister","registerCommand","_temp","COMMAND_PRIORITY_LOW","useEffect","event","optionId","useCommentSchema","registerNodeTransform","invalidChildren","filter","length","update","_temp2","child_0","CommentPlugin","$getTextContent","root","textContent","childrenLength","i","$isElementNode","isInline","getReferenceMarker","name","referenceId","shouldAppendParagraphBreak","Boolean","traverseSerializedNode","referenceMarker","text","Array","isArray","getTextFromSerializedEditorState","state","parsed","JSON","parse","emptyEditorState","version","textFormat","undefined","generateEditorStateFromString","input","trim","split","map","line","detail","mode","stringify","ImperativeAPIPlugin","editorRef","previousTextRef","t2","setEditorValue","value","parseEditorState","setEditorState","current","focus","defaultSelection","useImperativeHandle","shouldSubmitOnEnter","key","ctrlKey","metaKey","shiftKey","altKey","KeyboardShortcutPlugin","onSubmit","KEY_DOWN_COMMAND","preventDefault","COMMAND_PRIORITY_HIGH","menuSortOrder","getSortedMenuOptions","options","sort","a","b","indexOf","group","option","index","reduce","acc","bucket","push","ReferenceMenuItem","props","id","isSelected","onClick","onMouseEnter","setRefElement","secondaryLabel","primaryLabel","tabIndex","t3","bg","t4","jsx","Tooltip","Text","t5","t6","t7","t8","Flex","ReferenceMenu","selectedIndex","onSelectItem","onMouseEnterItem","table","connector","hasResults","getElementById","scrollIntoView","behavior","block","T0","ScrollArea","t9","Symbol","for","base","md","t10","t11","jsxs","Fragment","Box","description","t12","option_0","t13","localFilter","data","q","m","toLowerCase","includes","useContextLookup","queryString","items","baseOptions","res","resourceId","resourceType","VALID_PUNCTUATION","TRIGGERS","join","VALID_CHARS","VALID_JOINS","LENGTH_LIMIT","TriggerRegex","RegExp","AliasRegex","checkForTriggers","minMatchLength","match","exec","maybeLeadingWhitespace","matchingString","leadOffset","replaceableString","SUGGESTION_LIST_LENGTH_LIMIT","ReferenceMenuPlugin","setQueryString","useState","searchResults","selectedOption","closeMenu","dispatchCommand","onSelectOption","checkForTrigger","slice","menuOptions","LexicalTypeaheadMenuPlugin","anchorElementRef","selectOptionAndCleanUp","setHighlightedIndex","ReactDOM","createPortal","i_0","ReferenceNode","TextNode","__referenceId","__name","constructor","isKeyboardSelectable","canBeEmpty","canInsertTextAfter","canInsertTextBefore","span","reference","setAttribute","prevNode","dom","_editor","el","domNode","hasAttribute","$convertReferenceElement","getAttribute","$createReferenceNode","$insertExistingReference","refNode","ReferencePlugin","onAddReference","promptInputTheme","baseTheme","nodes","MarkNode","BasePromptEditor","ref","defaultState","debug","isEditable","placeholder","onChange","onError","references","namespace","editorState","editable","initialConfig","useRef","Kbd","placeholderNode","HistoryPlugin","ContentEditable","RichTextPlugin","LexicalErrorBoundary","OnChangePlugin","read","$getRoot","rawText","toJSON","ToggleEditablePlugin","t14","t15","t16","t17","t18","TreeViewPlugin","t19","LexicalComposer","PromptEditor","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;AAAO,MAAMA,KAAmB,oBACnBC,KAAe,gBCEfC,KAA2BC,GAAcH,EAAgB,GAEzDI,KAAuBD,GAAcF,EAAY;ACa9D,SAASI,GAAsBC,GAA2C;AACxE,QAAMC,IAAOC,EAAAA;AACb,SAAIF,EAAQG,UAAU,QACpBF,EAAKG,UAAUJ,EAAQG,MAAME,SAA8B,GAEtD;AAAA,IAAEJ,MAAAA;AAAAA,EAAAA;AACX;AAEO,MAAMK,UAAoBC,GAAY;AAAA,EAC3C,OAAOC,UAAkB;AACvB,WAAO;AAAA,EACT;AAAA,EAEA,OAAOC,MAAMR,GAAgC;AAC3C,WAAO,IAAIK,EAAYL,EAAKS,KAAK;AAAA,EACnC;AAAA,EAEAC,UAAUC,GAAmC;AAC3C,UAAMZ,IAAUa,SAASC,cAAc,YAAY;AACnDC,WAAAA,GAAuBf,GAASY,EAAOI,MAAMC,OAAO,GAC7CjB;AAAAA,EACT;AAAA,EAEAkB,YAAqB;A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UAAA8N,KAClD2B,IAAA3B,IAAQ,gBAAApH,EAACgJ,IAAA,CAAA,CAAc,IAAvB,IAA+B1P,QAAA8N,GAAA9N,QAAAyP,KAAAA,IAAAzP,EAAA,EAAA;AAAA,MAAA2P;AAAA,SAAA3P,EAAA,EAAA,MAAAuO,KAAAvO,EAAA,EAAA,MAAAoI,KAAApI,UAAAqI,KAAArI,EAAA,EAAA,MAAA0I,KAAA1I,EAAA,EAAA,MAAA4I,KAAA5I,EAAA,EAAA,MAAAsP,KAAAtP,EAAA,EAAA,MAAAuP,KAAAvP,EAAA,EAAA,MAAAwP,KAAAxP,UAAAyP,KA9BpCE,IAAA,gBAAAjJ,EAACO,IAAA,EAAe,WAAA,UAAwB,gBAAA,iBAAsB,OAAA,QAAgB,UAAA,YAC5E,UAAA,gBAAAqB,EAACsH,IAAA,EAA+BrB,eAAAA,GAC9BvH,UAAAA;AAAAA,IAAAA;AAAAA,IACAoB;AAAAA,IAKAC;AAAAA,IAgBAK;AAAAA,IACAE;AAAAA,IACAyG;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACAC;AAAAA,IACCC;AAAAA,EAAAA,EAAAA,CACH,EAAA,CACF,GAAOzP,QAAAuO,GAAAvO,QAAAoI,GAAApI,QAAAqI,GAAArI,QAAA0I,GAAA1I,QAAA4I,GAAA5I,QAAAsP,GAAAtP,QAAAuP,GAAAvP,QAAAwP,GAAAxP,QAAAyP,GAAAzP,QAAA2P,KAAAA,IAAA3P,EAAA,EAAA,GAhCP2P;AAgCO,GAIEE,KAAeC,GAAWnC,EAAgB;AAzDuC,SAAApN,KAAA;AAAA;"}
@@ -0,0 +1,78 @@
1
+ import { jsx as e, jsxs as T } from "react/jsx-runtime";
2
+ import { s as E, c as g, M as b, e as k, a as w, C as R, I as L, E as M, b as S, T as v, d as y } from "./markdown-gNucAjnF.js";
3
+ import { Flex as U } from "@chakra-ui/react";
4
+ import { ClickableLinkPlugin as I } from "@lexical/react/LexicalClickableLinkPlugin";
5
+ import { LexicalComposer as B } from "@lexical/react/LexicalComposer";
6
+ import { LexicalErrorBoundary as H } from "@lexical/react/LexicalErrorBoundary";
7
+ import { HorizontalRulePlugin as _ } from "@lexical/react/LexicalHorizontalRulePlugin";
8
+ import { LinkPlugin as j } from "@lexical/react/LexicalLinkPlugin";
9
+ import { ListPlugin as D } from "@lexical/react/LexicalListPlugin";
10
+ import { OnChangePlugin as F } from "@lexical/react/LexicalOnChangePlugin";
11
+ import { RichTextPlugin as O } from "@lexical/react/LexicalRichTextPlugin";
12
+ import { TabIndentationPlugin as $ } from "@lexical/react/LexicalTabIndentationPlugin";
13
+ import { $addUpdateTag as f, $getRoot as A } from "lexical";
14
+ import { useEffect as G, useRef as N } from "react";
15
+ import { c as W } from "react/compiler-runtime";
16
+ import { useLexicalComposerContext as q } from "@lexical/react/LexicalComposerContext";
17
+ function z(m) {
18
+ const o = W(5), {
19
+ value: i,
20
+ onUpdate: a
21
+ } = m, [t] = q();
22
+ let r, n;
23
+ return o[0] !== t || o[1] !== a || o[2] !== i ? (r = () => {
24
+ t && t.update(() => a(i), {
25
+ tag: "history-merge"
26
+ });
27
+ }, n = [i, t, a], o[0] = t, o[1] = a, o[2] = i, o[3] = r, o[4] = n) : (r = o[3], n = o[4]), G(r, n), null;
28
+ }
29
+ const u = "markdown-source-import";
30
+ function ce(m) {
31
+ const {
32
+ debug: o = !1,
33
+ defaultState: i = "",
34
+ fullWidth: a = !1,
35
+ isEditable: t = !1,
36
+ resolveMarkdownUrl: r,
37
+ onChange: n
38
+ } = m, {
39
+ frontmatter: p,
40
+ body: d
41
+ } = E(i), h = t && !!n, s = N(null);
42
+ return s.current ??= g(d, r), /* @__PURE__ */ e(U, { className: "rich-text", "data-rich-message": "true", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "hidden", children: /* @__PURE__ */ e(b, { resolver: r, children: /* @__PURE__ */ T(B, { initialConfig: {
43
+ namespace: "RICH_MESSAGE",
44
+ nodes: w,
45
+ editorState: () => {
46
+ f(u), s.current?.importToLexical();
47
+ },
48
+ onError: (l) => console.error(l),
49
+ editable: t,
50
+ theme: k
51
+ }, children: [
52
+ /* @__PURE__ */ e(z, { value: d, onUpdate: (l) => {
53
+ const c = g(l, r);
54
+ s.current = c, f(u), c.importToLexical();
55
+ } }),
56
+ /* @__PURE__ */ e(j, {}),
57
+ /* @__PURE__ */ e(I, { newTab: !0 }),
58
+ /* @__PURE__ */ e(D, {}),
59
+ t ? /* @__PURE__ */ e($, { maxIndent: 7 }) : null,
60
+ /* @__PURE__ */ e(_, {}),
61
+ /* @__PURE__ */ e(R, {}),
62
+ /* @__PURE__ */ e(L, {}),
63
+ /* @__PURE__ */ e(M, {}),
64
+ /* @__PURE__ */ e(O, { contentEditable: /* @__PURE__ */ e(S, { fullWidth: a, isRichMessage: !0 }), ErrorBoundary: H }),
65
+ h ? /* @__PURE__ */ e(F, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (l, c, C) => {
66
+ C.has(u) || l.read(() => {
67
+ const x = A(), P = s.current?.exportFromLexical(x) ?? "";
68
+ n?.(p + P);
69
+ });
70
+ } }) : null,
71
+ /* @__PURE__ */ e(v, { isEditable: t }),
72
+ o && /* @__PURE__ */ e(y, {})
73
+ ] }) }) });
74
+ }
75
+ export {
76
+ ce as RichMessage
77
+ };
78
+ //# sourceMappingURL=rich-message-CuPiKxKX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rich-message-CuPiKxKX.js","sources":["../src/components/rich-text/shared/plugins/StateUpdatePlugin.tsx","../src/components/rich-text/rich-message/rich-message.tsx"],"sourcesContent":["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 \"../theme/rich-text-theme.css\";\n\nimport { Flex } from \"@chakra-ui/react\";\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 { $addUpdateTag, $getRoot } from \"lexical\";\nimport { useRef } from \"react\";\nimport { ContentEditable } from \"../shared/components/content-editable\";\nimport { editorNodes, editorTheme } from \"../shared/editor-config\";\nimport { createMarkdownSourceDocument } from \"../shared/markdown-source-document\";\nimport type { MarkdownUrlResolver } from \"../shared/markdown-url\";\nimport { MarkdownUrlProvider } from \"../shared/markdown-url-context\";\nimport { ImportCodeBlocksPlugin } from \"../shared/plugins/CodePlugin/CodeBlockPlugin\";\nimport { CodeHighlightingPlugin } from \"../shared/plugins/CodePlugin/CodeHighlightingPlugin\";\nimport { EquationPlugin } from \"../shared/plugins/EquationPlugin/EquationPlugin\";\nimport StateUpdatePlugin from \"../shared/plugins/StateUpdatePlugin\";\nimport ToggleEditablePlugin from \"../shared/plugins/ToggleEditablePlugin\";\nimport { TreeViewPlugin } from \"../shared/plugins/TreeViewPlugin/TreeViewPlugin\";\nimport { splitFrontmatter } from \"../utils/markdown\";\n\nexport interface RichMessageProps {\n debug?: boolean;\n defaultState: string;\n fullWidth?: boolean;\n isEditable?: boolean;\n resolveMarkdownUrl?: MarkdownUrlResolver;\n onChange?: (value: string) => void;\n}\n\nconst SOURCE_IMPORT_TAG = \"markdown-source-import\";\n\nexport function RichMessage(props: RichMessageProps) {\n const {\n debug = false,\n defaultState = \"\",\n fullWidth = false,\n isEditable = false,\n resolveMarkdownUrl,\n onChange,\n } = props;\n const { frontmatter, body } = splitFrontmatter(defaultState);\n const shouldTrackChanges = isEditable && Boolean(onChange);\n const sourceDocumentRef = useRef<ReturnType<typeof createMarkdownSourceDocument> | null>(null);\n sourceDocumentRef.current ??= createMarkdownSourceDocument(body, resolveMarkdownUrl);\n\n const initialConfig = {\n namespace: \"RICH_MESSAGE\",\n nodes: editorNodes,\n editorState: () => {\n $addUpdateTag(SOURCE_IMPORT_TAG);\n sourceDocumentRef.current?.importToLexical();\n },\n onError: (error: Error) => console.error(error),\n editable: isEditable,\n theme: editorTheme,\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 <MarkdownUrlProvider resolver={resolveMarkdownUrl}>\n <LexicalComposer initialConfig={initialConfig}>\n <StateUpdatePlugin\n value={body}\n onUpdate={(value: string) => {\n const sourceDocument = createMarkdownSourceDocument(value, resolveMarkdownUrl);\n sourceDocumentRef.current = sourceDocument;\n $addUpdateTag(SOURCE_IMPORT_TAG);\n sourceDocument.importToLexical();\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, _editor, tags) => {\n if (tags.has(SOURCE_IMPORT_TAG)) return;\n editorState.read(() => {\n const root = $getRoot();\n const markdownBody = sourceDocumentRef.current?.exportFromLexical(root) ?? \"\";\n onChange?.(frontmatter + markdownBody);\n });\n }}\n />\n ) : null}\n <ToggleEditablePlugin isEditable={isEditable} />\n {debug && <TreeViewPlugin />}\n </LexicalComposer>\n </MarkdownUrlProvider>\n </Flex>\n );\n}\n"],"names":["StateUpdatePlugin","t0","$","_c","value","onUpdate","editor","useLexicalComposerContext","t1","t2","update","tag","useEffect","SOURCE_IMPORT_TAG","RichMessage","props","debug","defaultState","fullWidth","isEditable","resolveMarkdownUrl","onChange","frontmatter","body","splitFrontmatter","shouldTrackChanges","Boolean","sourceDocumentRef","useRef","current","createMarkdownSourceDocument","jsx","Flex","MarkdownUrlProvider","jsxs","LexicalComposer","namespace","nodes","editorNodes","editorState","$addUpdateTag","importToLexical","onError","error","console","editable","theme","editorTheme","sourceDocument","LinkPlugin","ClickableLinkPlugin","ListPlugin","TabIndentationPlugin","HorizontalRulePlugin","CodeHighlightingPlugin","ImportCodeBlocksPlugin","EquationPlugin","RichTextPlugin","ContentEditable","LexicalErrorBoundary","OnChangePlugin","_editor","tags","has","read","root","$getRoot","markdownBody","exportFromLexical","ToggleEditablePlugin","TreeViewPlugin"],"mappings":";;;;;;;;;;;;;;;;AAQA,SAAeA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA,GAA2B;AAAA,IAAAC,OAAAA;AAAAA,IAAAC,UAAAA;AAAAA,EAAAA,IAAAJ,GACxC,CAAAK,CAAA,IAAiBC,EAAAA;AAA4B,MAAAC,GAAAC;AAAA,SAAAP,EAAA,CAAA,MAAAI,KAAAJ,SAAAG,KAAAH,EAAA,CAAA,MAAAE,KAEnCI,IAAAA,MAAA;AACR,IAAKF,KAILA,EAAMI,OAAQ,MAAML,EAASD,CAAK,GAAG;AAAA,MAAAO,KAAO;AAAA,IAAA,CAAiB;AAAA,EAAC,GA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,CAAkB;AAC7EO,MAAAA,EAAkBE,UAAUmB,GAC5BR,EAAc3B,CAAiB,GAC/BmC,EAAeP,gBAAAA;AAAAA,IACjB,GAAE;AAAA,sBAEHQ,GAAA,EAAU;AAAA,IACX,gBAAAlB,EAACmB,GAAA,EAAoB,QAAM,GAAA,CAAA;AAAA,sBAC1BC,GAAA,EAAU;AAAA,IACVhC,IAAa,gBAAAY,EAACqB,GAAA,EAAqB,WAAW,GAAE,IAAM;AAAA,sBACtDC,GAAA,EAAoB;AAAA,sBACpBC,GAAA,EAAsB;AAAA,sBACtBC,GAAA,EAAsB;AAAA,sBACtBC,GAAA,EAAc;AAAA,IACf,gBAAAzB,EAAC0B,GAAA,EACC,iBAAiB,gBAAA1B,EAAC2B,GAAA,EAAgB,WAAAxC,GAAsB,eAAa,GAAA,CAAA,GACrE,eAAeyC,EAAAA,CAAqB;AAAA,IAErClC,IACC,gBAAAM,EAAC6B,GAAA,EACC,uBAAqB,IACrB,6BAA6B,IAC7B,UAAU,CAACrB,GAAasB,GAASC,MAAS;AACxC,MAAIA,EAAKC,IAAIlD,CAAiB,KAC9B0B,EAAYyB,KAAK,MAAM;AACrB,cAAMC,IAAOC,EAAAA,GACPC,IAAexC,EAAkBE,SAASuC,kBAAkBH,CAAI,KAAK;AAC3E5C,QAAAA,IAAWC,IAAc6C,CAAY;AAAA,MACvC,CAAC;AAAA,IACH,GAAE,IAEF;AAAA,IACJ,gBAAApC,EAACsC,KAAqB,YAAAlD,GAAuB;AAAA,IAC5CH,uBAAUsD,GAAA,CAAA,CAAc;AAAA,EAAA,EAAA,CAC3B,GACF,GACF;AAEJ;"}
package/dist/rich-text.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as o, jsxs as Y } from "react/jsx-runtime";
2
2
  import { c as U } from "react/compiler-runtime";
3
- import { e as ee, a as te, C as oe, I as ne, E as re, b as ie } from "./markdown-Cli3KGu9.js";
4
- import { Box as j, Flex as le, Table as T, Text as F, Textarea as se } from "@chakra-ui/react";
3
+ import { e as ee, a as te, C as oe, I as ne, E as re, b as ie } from "./markdown-gNucAjnF.js";
4
+ import { Box as R, Flex as le, Table as T, Text as F, Textarea as se } from "@chakra-ui/react";
5
5
  import { LexicalCollaboration as ae } from "@lexical/react/LexicalCollaborationContext";
6
6
  import { CollaborationPluginV2__EXPERIMENTAL as ce } from "@lexical/react/LexicalCollaborationPlugin";
7
7
  import { LexicalComposer as de } from "@lexical/react/LexicalComposer";
@@ -14,10 +14,11 @@ import { TabIndentationPlugin as ge } from "@lexical/react/LexicalTabIndentation
14
14
  import { useRef as be, useState as q, useEffect as J } from "react";
15
15
  import { WebsocketProvider as xe } from "y-websocket";
16
16
  import * as Se from "yjs";
17
- import { C as ye, F as we } from "./markdown-editor-BHoRATej.js";
18
- import { M as Ze } from "./markdown-editor-BHoRATej.js";
19
- import { L as tt } from "./lazy-markdown-editor-DSlelhHV.js";
20
- import { R as nt, P as rt, R as it, g as lt, a as st } from "./rich-message-gWYlm8Ji.js";
17
+ import { C as ye, F as we } from "./markdown-editor-CAVqJ9yR.js";
18
+ import { M as Ze } from "./markdown-editor-CAVqJ9yR.js";
19
+ import { L as tt } from "./lazy-markdown-editor-ClZPZuaU.js";
20
+ import { P as nt, g as rt, a as it } from "./prompt-input-DNpRL5tI.js";
21
+ import { RichMessage as st, RichMessage as at } from "./rich-message-CuPiKxKX.js";
21
22
  import { S as K } from "./browser-storage-DPtOQJx0.js";
22
23
  function ve() {
23
24
  const t = U(1);
@@ -104,8 +105,8 @@ function Ye(t) {
104
105
  const X = m;
105
106
  let _;
106
107
  e[14] !== d || e[15] !== n || e[16] !== X || e[17] !== p || e[18] !== c ? (_ = /* @__PURE__ */ o(ce, { id: n, doc: d, provider: X, __shouldBootstrapUnsafe: !1, username: c, cursorColor: p }), e[14] = d, e[15] = n, e[16] = X, e[17] = p, e[18] = c, e[19] = _) : _ = e[19];
107
- let W, A, M, N, H, I;
108
- e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ o(pe, {}), A = /* @__PURE__ */ o(ue, {}), M = /* @__PURE__ */ o(ge, { maxIndent: 7 }), N = /* @__PURE__ */ o(fe, {}), H = /* @__PURE__ */ o(oe, {}), I = /* @__PURE__ */ o(ne, {}), e[20] = W, e[21] = A, e[22] = M, e[23] = N, e[24] = H, e[25] = I) : (W = e[20], A = e[21], M = e[22], N = e[23], H = e[24], I = e[25]);
108
+ let M, W, A, N, H, I;
109
+ e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ o(pe, {}), W = /* @__PURE__ */ o(ue, {}), A = /* @__PURE__ */ o(ge, { maxIndent: 7 }), N = /* @__PURE__ */ o(fe, {}), H = /* @__PURE__ */ o(oe, {}), I = /* @__PURE__ */ o(ne, {}), e[20] = M, e[21] = W, e[22] = A, e[23] = N, e[24] = H, e[25] = I) : (M = e[20], W = e[21], A = e[22], N = e[23], H = e[24], I = e[25]);
109
110
  let k;
110
111
  e[26] !== r ? (k = /* @__PURE__ */ o(ye, { anchorElem: r }), e[26] = r, e[27] = k) : k = e[27];
111
112
  let D;
@@ -113,28 +114,28 @@ function Ye(t) {
113
114
  let O;
114
115
  e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ o(ie, { fullWidth: !1 }), e[29] = O) : O = e[29];
115
116
  let P;
116
- e[30] !== w || e[31] !== C ? (P = C && w ? /* @__PURE__ */ o(j, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: w }) : null, e[30] = w, e[31] = C, e[32] = P) : P = e[32];
117
+ e[30] !== w || e[31] !== C ? (P = C && w ? /* @__PURE__ */ o(R, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: w }) : null, e[30] = w, e[31] = C, e[32] = P) : P = e[32];
117
118
  let z;
118
119
  e[33] !== P ? (z = /* @__PURE__ */ o(he, { contentEditable: O, placeholder: P, ErrorBoundary: me }), e[33] = P, e[34] = z) : z = e[34];
119
- let R;
120
- e[35] !== r ? (R = r ? /* @__PURE__ */ o(we, { anchorElem: r }) : null, e[35] = r, e[36] = R) : R = e[36];
120
+ let j;
121
+ e[35] !== r ? (j = r ? /* @__PURE__ */ o(we, { anchorElem: r }) : null, e[35] = r, e[36] = j) : j = e[36];
121
122
  let V;
122
- return e[37] !== _ || e[38] !== k || e[39] !== z || e[40] !== R ? (V = /* @__PURE__ */ Y(le, { ref: s, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
123
+ return e[37] !== _ || e[38] !== k || e[39] !== z || e[40] !== j ? (V = /* @__PURE__ */ Y(le, { ref: s, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
123
124
  B,
124
125
  /* @__PURE__ */ o(de, { initialConfig: Q, children: /* @__PURE__ */ Y(ae, { children: [
125
126
  _,
127
+ M,
126
128
  W,
127
129
  A,
128
- M,
129
130
  N,
130
131
  H,
131
132
  I,
132
133
  k,
133
134
  D,
134
135
  z,
135
- R
136
+ j
136
137
  ] }) })
137
- ] }), e[37] = _, e[38] = k, e[39] = z, e[40] = R, e[41] = V) : V = e[41], V;
138
+ ] }), e[37] = _, e[38] = k, e[39] = z, e[40] = j, e[41] = V) : V = e[41], V;
138
139
  }
139
140
  function Ce(t) {
140
141
  return console.error(t);
@@ -157,7 +158,7 @@ const $ = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", Te
157
158
  if (e[2] !== a || e[3] !== f || e[4] !== l) {
158
159
  const r = l ? a.split(`
159
160
  `) : [a];
160
- c = /* @__PURE__ */ o(j, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: $, lineHeight: "1.5", background: "bg.code", borderRadius: "md", width: "100%", overflowY: f ? "hidden" : void 0, children: l ? /* @__PURE__ */ o(j, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: r.map(_e) }) : /* @__PURE__ */ o(j, { as: "code", children: a }) }), e[2] = a, e[3] = f, e[4] = l, e[5] = c;
161
+ c = /* @__PURE__ */ o(R, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: $, lineHeight: "1.5", background: "bg.code", borderRadius: "md", width: "100%", overflowY: f ? "hidden" : void 0, children: l ? /* @__PURE__ */ o(R, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: r.map(_e) }) : /* @__PURE__ */ o(R, { as: "code", children: a }) }), e[2] = a, e[3] = f, e[4] = l, e[5] = c;
161
162
  } else
162
163
  c = e[5];
163
164
  const p = c;
@@ -180,7 +181,7 @@ const $ = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", Te
180
181
  let b;
181
182
  e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ o(F, { textStyle: "label/S/regular", fontSize: $, color: "fg.muted", children: "No data" }), e[2] = b) : b = e[2];
182
183
  let u;
183
- return e[3] !== i ? (u = /* @__PURE__ */ o(j, { padding: "sm", borderWidth: i, borderColor: "border.subtle", children: b }), e[3] = i, e[4] = u) : u = e[4], u;
184
+ return e[3] !== i ? (u = /* @__PURE__ */ o(R, { padding: "sm", borderWidth: i, borderColor: "border.subtle", children: b }), e[3] = i, e[4] = u) : u = e[4], u;
184
185
  }
185
186
  let c;
186
187
  e[5] !== f ? (c = new Set(f), e[5] = f, e[6] = c) : c = e[6];
@@ -207,7 +208,7 @@ const $ = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", Te
207
208
  ] }) }), e[21] = m, e[22] = C, e[23] = L, e[24] = d, e[25] = v) : v = e[25], v;
208
209
  };
209
210
  function _e(t, e) {
210
- return /* @__PURE__ */ Y(j, { as: "span", display: "contents", children: [
211
+ return /* @__PURE__ */ Y(R, { as: "span", display: "contents", children: [
211
212
  /* @__PURE__ */ o(F, { as: "span", color: "fg.muted", textAlign: "right", fontSize: "inherit", children: e + 1 }),
212
213
  /* @__PURE__ */ o(F, { as: "span", fontSize: "inherit", children: t.length ? t : " " })
213
214
  ] }, `${e}-${t}`);
@@ -253,11 +254,11 @@ export {
253
254
  Xe as DefaultRichTextDataTable,
254
255
  tt as LazyMarkdownEditor,
255
256
  Ze as MarkdownEditor,
256
- nt as MarkdownPreview,
257
- rt as PromptEditor,
258
- it as RichMessage,
259
- lt as generateEditorStateFromString,
260
- st as getTextFromSerializedEditorState,
257
+ st as MarkdownPreview,
258
+ nt as PromptEditor,
259
+ at as RichMessage,
260
+ rt as generateEditorStateFromString,
261
+ it as getTextFromSerializedEditorState,
261
262
  Ge as inferResourceTypeFromMediaType,
262
263
  Je as mediaTypeFromPath
263
264
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text.js","sources":["../src/components/rich-text/collaborative-markdown-editor/awareness-cursors.tsx","../src/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.tsx","../src/components/rich-text/shared/components/default-rich-text-components.tsx","../src/components/rich-text/utils/inferResourceType.ts","../src/components/rich-text/utils/mediaType.ts"],"sourcesContent":["/**\n * Injects CSS for Yjs awareness cursor rendering in the collaborative editor.\n * @lexical/yjs injects cursor elements with data-* attributes; this styles them.\n */\nexport function AwarenessCursorsCSS() {\n return (\n <style>\n {`\n .collaboration-cursor-container {\n position: relative;\n display: inline;\n }\n\n .collaboration-cursor-caret {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 2px;\n pointer-events: none;\n }\n\n .collaboration-cursor-label {\n position: absolute;\n top: -18px;\n left: -2px;\n padding: 1px 6px;\n font-size: 11px;\n font-weight: 600;\n line-height: 16px;\n white-space: nowrap;\n border-radius: 4px 4px 4px 0;\n color: #fff;\n pointer-events: none;\n user-select: none;\n }\n\n .collaboration-cursor-selection {\n position: absolute;\n pointer-events: none;\n opacity: 0.25;\n }\n `}\n </style>\n );\n}\n","import \"../theme/rich-text-theme.css\";\n\nimport { Box, Flex } from \"@chakra-ui/react\";\nimport { LexicalCollaboration } from \"@lexical/react/LexicalCollaborationContext\";\nimport { CollaborationPluginV2__EXPERIMENTAL } from \"@lexical/react/LexicalCollaborationPlugin\";\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 { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\nimport { TabIndentationPlugin } from \"@lexical/react/LexicalTabIndentationPlugin\";\nimport type { Provider } from \"@lexical/yjs\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { WebsocketProvider } from \"y-websocket\";\nimport * as Y from \"yjs\";\nimport { ContentEditable } from \"../shared/components/content-editable\";\nimport { editorNodes, editorTheme } from \"../shared/editor-config\";\nimport { CodeBlockActionsPlugin } from \"../shared/plugins/CodePlugin/CodeBlockActionsPlugin\";\nimport { ImportCodeBlocksPlugin } from \"../shared/plugins/CodePlugin/CodeBlockPlugin\";\nimport { CodeHighlightingPlugin } from \"../shared/plugins/CodePlugin/CodeHighlightingPlugin\";\nimport { EquationPlugin } from \"../shared/plugins/EquationPlugin/EquationPlugin\";\nimport { FloatingTextFormatToolbarPlugin } from \"../shared/plugins/FloatingTextFormatToolbarPlugin\";\nimport { AwarenessCursorsCSS } from \"./awareness-cursors\";\n\nexport interface CollaborativeMarkdownEditorProps {\n roomId: string;\n wsUrl: string;\n wsParams?: Record<string, string>;\n userName?: string;\n userColor?: string;\n placeholder?: string;\n}\n\nexport function CollaborativeMarkdownEditor(props: CollaborativeMarkdownEditorProps) {\n const { roomId, wsUrl, wsParams = {}, userName = \"Anonymous\", userColor = \"#30bced\", placeholder } = props;\n\n const editorContainerRef = useRef<HTMLDivElement>(null);\n const [floatingToolbarAnchorElem, setFloatingToolbarAnchorElem] = useState<HTMLElement | null>(null);\n const [synced, setSynced] = useState(false);\n\n // Keep collaborative state stable for the component lifetime.\n const [doc] = useState(() => new Y.Doc());\n const [provider] = useState(() => {\n const nextProvider = new WebsocketProvider(wsUrl, roomId, doc, { params: wsParams, connect: false });\n\n nextProvider.on(\"sync\", (isSynced: boolean) => {\n if (isSynced) setSynced(true);\n });\n\n return nextProvider;\n });\n\n // Manage provider connect/disconnect lifecycle\n useEffect(() => {\n provider.connect();\n\n return () => {\n provider.disconnect();\n };\n }, [provider]);\n\n useEffect(() => {\n setFloatingToolbarAnchorElem(editorContainerRef.current);\n }, []);\n\n const initialConfig = {\n namespace: \"COLLABORATIVE_EDITOR\",\n nodes: editorNodes,\n editorState: null,\n onError: (error: Error) => console.error(error),\n editable: true,\n theme: editorTheme,\n };\n\n return (\n <Flex\n ref={editorContainerRef}\n className=\"rich-text\"\n justifyContent=\"space-between\"\n width=\"100%\"\n maxWidth=\"100%\"\n height=\"100%\"\n position=\"relative\"\n direction=\"column\"\n overflow=\"visible\"\n >\n <AwarenessCursorsCSS />\n\n <LexicalComposer initialConfig={initialConfig}>\n <LexicalCollaboration>\n <CollaborationPluginV2__EXPERIMENTAL\n id={roomId}\n doc={doc}\n provider={provider as unknown as Provider}\n __shouldBootstrapUnsafe={false}\n username={userName}\n cursorColor={userColor}\n />\n <LinkPlugin />\n <ListPlugin />\n <TabIndentationPlugin maxIndent={7} />\n <HorizontalRulePlugin />\n <CodeHighlightingPlugin />\n <ImportCodeBlocksPlugin />\n <CodeBlockActionsPlugin anchorElem={floatingToolbarAnchorElem} />\n <EquationPlugin />\n <RichTextPlugin\n contentEditable={<ContentEditable fullWidth={false} />}\n placeholder={\n synced && placeholder ? (\n <Box\n position=\"absolute\"\n top=\"0\"\n color=\"fg.muted\"\n pointerEvents=\"none\"\n userSelect=\"none\"\n textStyle=\"paragraph/M/regular\"\n >\n {placeholder}\n </Box>\n ) : null\n }\n ErrorBoundary={LexicalErrorBoundary}\n />\n {floatingToolbarAnchorElem ? (\n <FloatingTextFormatToolbarPlugin anchorElem={floatingToolbarAnchorElem} />\n ) : null}\n </LexicalCollaboration>\n </LexicalComposer>\n </Flex>\n );\n}\n","import { Box, Table, Text, Textarea } from \"@chakra-ui/react\";\nimport { ScrollArea } from \"@/components/primitives/scroll-area\";\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 const codeBlock = (\n <Box\n as=\"pre\"\n margin={0}\n padding=\"sm\"\n fontFamily=\"mono\"\n fontSize={scaledSmallFontSize}\n lineHeight=\"1.5\"\n background=\"bg.code\"\n borderRadius=\"md\"\n width=\"100%\"\n overflowY={disableScroll ? \"hidden\" : undefined}\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 if (disableScroll) return codeBlock;\n\n return (\n <ScrollArea width=\"100%\" background=\"bg.code\" borderRadius=\"md\" showHorizontalScrollbar>\n {codeBlock}\n </ScrollArea>\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.subtle\">\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 <ScrollArea maxWidth=\"100%\" showHorizontalScrollbar showVerticalScrollbar={false}>\n <Table.Root\n size=\"sm\"\n width={fullWidth ? \"100%\" : \"fit-content\"}\n borderWidth={noBorder ? \"0\" : \"1px\"}\n borderColor=\"border.subtle\"\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 </ScrollArea>\n );\n};\n","import type { ResourceType } from \"../types\";\n\nexport function inferResourceTypeFromMediaType(mediaType: string) {\n const normalized = mediaType.toLowerCase().trim();\n if (!normalized) return \"text\";\n\n if (normalized.startsWith(\"image/\")) return \"image\";\n if (normalized === \"application/pdf\") return \"pdf\";\n if (normalized === \"text/markdown\") return \"markdown\";\n if (normalized === \"text/csv\" || normalized === \"text/tab-separated-values\") return \"table\";\n if (normalized === \"application/json\") return \"json\";\n if (normalized.startsWith(\"text/\")) return \"text\";\n if (normalized.startsWith(\"application/\")) return \"text\";\n\n const fallback: ResourceType = \"text\";\n return fallback;\n}\n","const extensionToMediaType: Record<string, string> = {\n csv: \"text/csv\",\n tsv: \"text/tab-separated-values\",\n json: \"application/json\",\n md: \"text/markdown\",\n markdown: \"text/markdown\",\n txt: \"text/plain\",\n pdf: \"application/pdf\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n gif: \"image/gif\",\n svg: \"image/svg+xml\",\n webp: \"image/webp\",\n mp4: \"video/mp4\",\n mov: \"video/quicktime\",\n ts: \"text/typescript\",\n tsx: \"text/typescript\",\n js: \"text/javascript\",\n jsx: \"text/javascript\",\n sql: \"text/x-sql\",\n yml: \"text/yaml\",\n yaml: \"text/yaml\",\n};\n\nexport function mediaTypeFromPath(path: string) {\n const cleaned = path.split(\"?\")[0]?.split(\"#\")[0] ?? \"\";\n const ext = cleaned.split(\".\").pop()?.toLowerCase();\n if (!ext) return null;\n return extensionToMediaType[ext] ?? null;\n}\n"],"names":["AwarenessCursorsCSS","$","_c","t0","Symbol","for","jsx","CollaborativeMarkdownEditor","props","roomId","wsUrl","wsParams","userName","t1","userColor","t2","placeholder","t3","undefined","editorContainerRef","useRef","floatingToolbarAnchorElem","setFloatingToolbarAnchorElem","useState","synced","setSynced","doc","_temp","t4","nextProvider","WebsocketProvider","params","connect","on","isSynced","provider","t5","t6","disconnect","useEffect","t7","t8","current","t9","namespace","nodes","editorNodes","editorState","onError","_temp2","editable","theme","editorTheme","initialConfig","t10","t11","t12","CollaborationPluginV2__EXPERIMENTAL","t13","t14","t15","t16","t17","t18","LinkPlugin","ListPlugin","TabIndentationPlugin","HorizontalRulePlugin","CodeHighlightingPlugin","ImportCodeBlocksPlugin","t19","CodeBlockActionsPlugin","t20","EquationPlugin","t21","ContentEditable","t22","Box","t23","RichTextPlugin","LexicalErrorBoundary","t24","FloatingTextFormatToolbarPlugin","t25","Flex","LexicalComposer","jsxs","LexicalCollaboration","error","console","Y","Doc","scaledSmallFontSize","formatValue","value","length","String","toUpperCase","Date","toISOString","JSON","stringify","DefaultRichTextCodeEditor","defaultCode","isEditable","showLineNumbers","disableScroll","Textarea","lines","split","map","codeBlock","ScrollArea","DefaultRichTextDataTable","data","fullWidth","noBorder","hiddenColumns","Text","Set","hiddenSet","Object","keys","filter","key","has","columns","Table","row","rowIndex","column_0","column","join","line","index","inferResourceTypeFromMediaType","mediaType","normalized","toLowerCase","trim","startsWith","extensionToMediaType","csv","tsv","json","md","markdown","txt","pdf","png","jpg","jpeg","gif","svg","webp","mp4","mov","ts","tsx","js","sql","yml","yaml","mediaTypeFromPath","path","ext","pop"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIO,SAAAA,KAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA;AAAA,MAAAC;AAAA,SAAAF,EAAA,CAAA,MAAAG,uBAAAC,IAAA,2BAAA,KAEHF,IAAA,gBAAAG,EAAA,WACG,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAA,CAmCH,GAAQL,OAAAE,KAAAA,IAAAF,EAAA,CAAA,GApCRE;AAoCQ;ACRL,SAAAI,GAAAC,GAAA;AAAA,QAAAP,IAAAC,EAAA,EAAA,GACL;AAAA,IAAAO,QAAAA;AAAAA,IAAAC,OAAAA;AAAAA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AACR;AAEO,SAASC,GAAkBC,GAAc;AAE9C,QAAMC,KADUD,EAAKvD,MAAM,GAAG,EAAE,CAAC,GAAGA,MAAM,GAAG,EAAE,CAAC,KAAK,IACjCA,MAAM,GAAG,EAAEyD,IAAAA,GAAO5B,YAAAA;AACtC,SAAK2B,IACExB,GAAqBwB,CAAG,KAAK,OADnB;AAEnB;"}
1
+ {"version":3,"file":"rich-text.js","sources":["../src/components/rich-text/collaborative-markdown-editor/awareness-cursors.tsx","../src/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.tsx","../src/components/rich-text/shared/components/default-rich-text-components.tsx","../src/components/rich-text/utils/inferResourceType.ts","../src/components/rich-text/utils/mediaType.ts"],"sourcesContent":["/**\n * Injects CSS for Yjs awareness cursor rendering in the collaborative editor.\n * @lexical/yjs injects cursor elements with data-* attributes; this styles them.\n */\nexport function AwarenessCursorsCSS() {\n return (\n <style>\n {`\n .collaboration-cursor-container {\n position: relative;\n display: inline;\n }\n\n .collaboration-cursor-caret {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 2px;\n pointer-events: none;\n }\n\n .collaboration-cursor-label {\n position: absolute;\n top: -18px;\n left: -2px;\n padding: 1px 6px;\n font-size: 11px;\n font-weight: 600;\n line-height: 16px;\n white-space: nowrap;\n border-radius: 4px 4px 4px 0;\n color: #fff;\n pointer-events: none;\n user-select: none;\n }\n\n .collaboration-cursor-selection {\n position: absolute;\n pointer-events: none;\n opacity: 0.25;\n }\n `}\n </style>\n );\n}\n","import \"../theme/rich-text-theme.css\";\n\nimport { Box, Flex } from \"@chakra-ui/react\";\nimport { LexicalCollaboration } from \"@lexical/react/LexicalCollaborationContext\";\nimport { CollaborationPluginV2__EXPERIMENTAL } from \"@lexical/react/LexicalCollaborationPlugin\";\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 { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\nimport { TabIndentationPlugin } from \"@lexical/react/LexicalTabIndentationPlugin\";\nimport type { Provider } from \"@lexical/yjs\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { WebsocketProvider } from \"y-websocket\";\nimport * as Y from \"yjs\";\nimport { ContentEditable } from \"../shared/components/content-editable\";\nimport { editorNodes, editorTheme } from \"../shared/editor-config\";\nimport { CodeBlockActionsPlugin } from \"../shared/plugins/CodePlugin/CodeBlockActionsPlugin\";\nimport { ImportCodeBlocksPlugin } from \"../shared/plugins/CodePlugin/CodeBlockPlugin\";\nimport { CodeHighlightingPlugin } from \"../shared/plugins/CodePlugin/CodeHighlightingPlugin\";\nimport { EquationPlugin } from \"../shared/plugins/EquationPlugin/EquationPlugin\";\nimport { FloatingTextFormatToolbarPlugin } from \"../shared/plugins/FloatingTextFormatToolbarPlugin\";\nimport { AwarenessCursorsCSS } from \"./awareness-cursors\";\n\nexport interface CollaborativeMarkdownEditorProps {\n roomId: string;\n wsUrl: string;\n wsParams?: Record<string, string>;\n userName?: string;\n userColor?: string;\n placeholder?: string;\n}\n\nexport function CollaborativeMarkdownEditor(props: CollaborativeMarkdownEditorProps) {\n const { roomId, wsUrl, wsParams = {}, userName = \"Anonymous\", userColor = \"#30bced\", placeholder } = props;\n\n const editorContainerRef = useRef<HTMLDivElement>(null);\n const [floatingToolbarAnchorElem, setFloatingToolbarAnchorElem] = useState<HTMLElement | null>(null);\n const [synced, setSynced] = useState(false);\n\n // Keep collaborative state stable for the component lifetime.\n const [doc] = useState(() => new Y.Doc());\n const [provider] = useState(() => {\n const nextProvider = new WebsocketProvider(wsUrl, roomId, doc, { params: wsParams, connect: false });\n\n nextProvider.on(\"sync\", (isSynced: boolean) => {\n if (isSynced) setSynced(true);\n });\n\n return nextProvider;\n });\n\n // Manage provider connect/disconnect lifecycle\n useEffect(() => {\n provider.connect();\n\n return () => {\n provider.disconnect();\n };\n }, [provider]);\n\n useEffect(() => {\n setFloatingToolbarAnchorElem(editorContainerRef.current);\n }, []);\n\n const initialConfig = {\n namespace: \"COLLABORATIVE_EDITOR\",\n nodes: editorNodes,\n editorState: null,\n onError: (error: Error) => console.error(error),\n editable: true,\n theme: editorTheme,\n };\n\n return (\n <Flex\n ref={editorContainerRef}\n className=\"rich-text\"\n justifyContent=\"space-between\"\n width=\"100%\"\n maxWidth=\"100%\"\n height=\"100%\"\n position=\"relative\"\n direction=\"column\"\n overflow=\"visible\"\n >\n <AwarenessCursorsCSS />\n\n <LexicalComposer initialConfig={initialConfig}>\n <LexicalCollaboration>\n <CollaborationPluginV2__EXPERIMENTAL\n id={roomId}\n doc={doc}\n provider={provider as unknown as Provider}\n __shouldBootstrapUnsafe={false}\n username={userName}\n cursorColor={userColor}\n />\n <LinkPlugin />\n <ListPlugin />\n <TabIndentationPlugin maxIndent={7} />\n <HorizontalRulePlugin />\n <CodeHighlightingPlugin />\n <ImportCodeBlocksPlugin />\n <CodeBlockActionsPlugin anchorElem={floatingToolbarAnchorElem} />\n <EquationPlugin />\n <RichTextPlugin\n contentEditable={<ContentEditable fullWidth={false} />}\n placeholder={\n synced && placeholder ? (\n <Box\n position=\"absolute\"\n top=\"0\"\n color=\"fg.muted\"\n pointerEvents=\"none\"\n userSelect=\"none\"\n textStyle=\"paragraph/M/regular\"\n >\n {placeholder}\n </Box>\n ) : null\n }\n ErrorBoundary={LexicalErrorBoundary}\n />\n {floatingToolbarAnchorElem ? (\n <FloatingTextFormatToolbarPlugin anchorElem={floatingToolbarAnchorElem} />\n ) : null}\n </LexicalCollaboration>\n </LexicalComposer>\n </Flex>\n );\n}\n","import { Box, Table, Text, Textarea } from \"@chakra-ui/react\";\nimport { ScrollArea } from \"@/components/primitives/scroll-area\";\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 const codeBlock = (\n <Box\n as=\"pre\"\n margin={0}\n padding=\"sm\"\n fontFamily=\"mono\"\n fontSize={scaledSmallFontSize}\n lineHeight=\"1.5\"\n background=\"bg.code\"\n borderRadius=\"md\"\n width=\"100%\"\n overflowY={disableScroll ? \"hidden\" : undefined}\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 if (disableScroll) return codeBlock;\n\n return (\n <ScrollArea width=\"100%\" background=\"bg.code\" borderRadius=\"md\" showHorizontalScrollbar>\n {codeBlock}\n </ScrollArea>\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.subtle\">\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 <ScrollArea maxWidth=\"100%\" showHorizontalScrollbar showVerticalScrollbar={false}>\n <Table.Root\n size=\"sm\"\n width={fullWidth ? \"100%\" : \"fit-content\"}\n borderWidth={noBorder ? \"0\" : \"1px\"}\n borderColor=\"border.subtle\"\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 </ScrollArea>\n );\n};\n","import type { ResourceType } from \"../types\";\n\nexport function inferResourceTypeFromMediaType(mediaType: string) {\n const normalized = mediaType.toLowerCase().trim();\n if (!normalized) return \"text\";\n\n if (normalized.startsWith(\"image/\")) return \"image\";\n if (normalized === \"application/pdf\") return \"pdf\";\n if (normalized === \"text/markdown\") return \"markdown\";\n if (normalized === \"text/csv\" || normalized === \"text/tab-separated-values\") return \"table\";\n if (normalized === \"application/json\") return \"json\";\n if (normalized.startsWith(\"text/\")) return \"text\";\n if (normalized.startsWith(\"application/\")) return \"text\";\n\n const fallback: ResourceType = \"text\";\n return fallback;\n}\n","const extensionToMediaType: Record<string, string> = {\n csv: \"text/csv\",\n tsv: \"text/tab-separated-values\",\n json: \"application/json\",\n md: \"text/markdown\",\n markdown: \"text/markdown\",\n txt: \"text/plain\",\n pdf: \"application/pdf\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n gif: \"image/gif\",\n svg: \"image/svg+xml\",\n webp: \"image/webp\",\n mp4: \"video/mp4\",\n mov: \"video/quicktime\",\n ts: \"text/typescript\",\n tsx: \"text/typescript\",\n js: \"text/javascript\",\n jsx: \"text/javascript\",\n sql: \"text/x-sql\",\n yml: \"text/yaml\",\n yaml: \"text/yaml\",\n};\n\nexport function mediaTypeFromPath(path: string) {\n const cleaned = path.split(\"?\")[0]?.split(\"#\")[0] ?? \"\";\n const ext = cleaned.split(\".\").pop()?.toLowerCase();\n if (!ext) return null;\n return extensionToMediaType[ext] ?? null;\n}\n"],"names":["AwarenessCursorsCSS","$","_c","t0","Symbol","for","jsx","CollaborativeMarkdownEditor","props","roomId","wsUrl","wsParams","userName","t1","userColor","t2","placeholder","t3","undefined","editorContainerRef","useRef","floatingToolbarAnchorElem","setFloatingToolbarAnchorElem","useState","synced","setSynced","doc","_temp","t4","nextProvider","WebsocketProvider","params","connect","on","isSynced","provider","t5","t6","disconnect","useEffect","t7","t8","current","t9","namespace","nodes","editorNodes","editorState","onError","_temp2","editable","theme","editorTheme","initialConfig","t10","t11","t12","CollaborationPluginV2__EXPERIMENTAL","t13","t14","t15","t16","t17","t18","LinkPlugin","ListPlugin","TabIndentationPlugin","HorizontalRulePlugin","CodeHighlightingPlugin","ImportCodeBlocksPlugin","t19","CodeBlockActionsPlugin","t20","EquationPlugin","t21","ContentEditable","t22","Box","t23","RichTextPlugin","LexicalErrorBoundary","t24","FloatingTextFormatToolbarPlugin","t25","Flex","LexicalComposer","jsxs","LexicalCollaboration","error","console","Y","Doc","scaledSmallFontSize","formatValue","value","length","String","toUpperCase","Date","toISOString","JSON","stringify","DefaultRichTextCodeEditor","defaultCode","isEditable","showLineNumbers","disableScroll","Textarea","lines","split","map","codeBlock","ScrollArea","DefaultRichTextDataTable","data","fullWidth","noBorder","hiddenColumns","Text","Set","hiddenSet","Object","keys","filter","key","has","columns","Table","row","rowIndex","column_0","column","join","line","index","inferResourceTypeFromMediaType","mediaType","normalized","toLowerCase","trim","startsWith","extensionToMediaType","csv","tsv","json","md","markdown","txt","pdf","png","jpg","jpeg","gif","svg","webp","mp4","mov","ts","tsx","js","sql","yml","yaml","mediaTypeFromPath","path","ext","pop"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIO,SAAAA,KAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA;AAAA,MAAAC;AAAA,SAAAF,EAAA,CAAA,MAAAG,uBAAAC,IAAA,2BAAA,KAEHF,IAAA,gBAAAG,EAAA,WACG,UAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAA,CAmCH,GAAQL,OAAAE,KAAAA,IAAAF,EAAA,CAAA,GApCRE;AAoCQ;ACRL,SAAAI,GAAAC,GAAA;AAAA,QAAAP,IAAAC,EAAA,EAAA,GACL;AAAA,IAAAO,QAAAA;AAAAA,IAAAC,OAAAA;AAAAA,IAAAC,UAAAR;AAAAA,IAAAS,UAAAC;AAAAA,IAAAC,WAAAC;AAAAA,IAAAC,aAAAA;AAAAA,EAAAA,IAAqGR;AAAM,MAAAS;AAAA,EAAAhB,SAAAE,KAApFc,IAAAd,MAAAe,SAAA,CAAA,IAAAf,GAAaF,OAAAE,GAAAF,OAAAgB,KAAAA,IAAAhB,EAAA,CAAA;AAAb,QAAAU,IAAAM,GAAeL,IAAAC,MAAAK,SAAA,cAAAL,G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illustration: {
548
- desktop: {
549
- value: string;
550
- };
551
- page: {
552
- value: string;
553
- };
554
- command: {
555
- value: string;
556
- };
557
- editor: {
558
- value: string;
559
- };
560
- skill: {
561
- value: string;
562
- };
563
- hook: {
564
- value: string;
565
- };
566
- automation: {
567
- value: string;
568
- };
569
- };
570
547
  sand: {
571
548
  DEFAULT: {
572
549
  value: string;
@@ -0,0 +1,36 @@
1
+ export declare const activityCommentSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "body" | "root", {
2
+ tone: {
3
+ default: {
4
+ root: {
5
+ background: "bg";
6
+ borderColor: "border.subtle";
7
+ };
8
+ };
9
+ attention: {
10
+ root: {
11
+ background: "bg.warning";
12
+ borderColor: "border.warning";
13
+ };
14
+ };
15
+ };
16
+ size: {
17
+ comfortable: {
18
+ body: {
19
+ gap: "sm";
20
+ padding: "md";
21
+ };
22
+ content: {
23
+ textStyle: "label/S/regular";
24
+ };
25
+ };
26
+ compact: {
27
+ body: {
28
+ gap: "xs";
29
+ padding: "sm";
30
+ };
31
+ content: {
32
+ textStyle: "label/S/regular";
33
+ };
34
+ };
35
+ };
36
+ }>;
@@ -1 +1 @@
1
- export declare const alertSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "title" | "root" | "indicator" | "description", import('@chakra-ui/react').SlotRecipeVariantRecord<"content" | "title" | "root" | "indicator" | "description">>;
1
+ export declare const alertSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "title" | "root" | "description" | "indicator", import('@chakra-ui/react').SlotRecipeVariantRecord<"content" | "title" | "root" | "description" | "indicator">>;
@@ -1 +1 @@
1
- export declare const dialogSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "body" | "footer" | "header" | "title" | "trigger" | "positioner" | "description" | "backdrop" | "closeTrigger", import('@chakra-ui/react').SlotRecipeVariantRecord<"content" | "body" | "footer" | "header" | "title" | "trigger" | "positioner" | "description" | "backdrop" | "closeTrigger">>;
1
+ export declare const dialogSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "body" | "footer" | "header" | "title" | "description" | "trigger" | "backdrop" | "positioner" | "closeTrigger", import('@chakra-ui/react').SlotRecipeVariantRecord<"content" | "body" | "footer" | "header" | "title" | "description" | "trigger" | "backdrop" | "positioner" | "closeTrigger">>;
@@ -1 +1 @@
1
- export declare const drawerSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "body" | "footer" | "header" | "title" | "trigger" | "positioner" | "description" | "backdrop" | "closeTrigger", import('@chakra-ui/react').SlotRecipeVariantRecord<"content" | "body" | "footer" | "header" | "title" | "trigger" | "positioner" | "description" | "backdrop" | "closeTrigger">>;
1
+ export declare const drawerSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "body" | "footer" | "header" | "title" | "description" | "trigger" | "backdrop" | "positioner" | "closeTrigger", import('@chakra-ui/react').SlotRecipeVariantRecord<"content" | "body" | "footer" | "header" | "title" | "description" | "trigger" | "backdrop" | "positioner" | "closeTrigger">>;
@@ -1 +1 @@
1
- export declare const menuSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "separator" | "trigger" | "arrow" | "arrowTip" | "positioner" | "item" | "indicator" | "contextTrigger" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "triggerItem" | "itemCommand", import('@chakra-ui/react').SlotRecipeVariantRecord<"content" | "separator" | "trigger" | "arrow" | "arrowTip" | "positioner" | "item" | "indicator" | "contextTrigger" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "triggerItem" | "itemCommand">>;
1
+ export declare const menuSlotRecipe: import('@chakra-ui/react').SlotRecipeDefinition<"content" | "trigger" | "positioner" | "arrow" | "arrowTip" | "contextTrigger" | "indicator" | "item" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "separator" | "triggerItem" | "itemCommand", import('@chakra-ui/react').SlotRecipeVariantRecord<"content" | "trigger" | "positioner" | "arrow" | "arrowTip" | "contextTrigger" | "indicator" | "item" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "separator" | "triggerItem" | "itemCommand">>;