@dxos/react-ui-chat 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29

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 (51) hide show
  1. package/dist/lib/browser/index.mjs +232 -224
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/translations.mjs +14 -0
  5. package/dist/lib/browser/translations.mjs.map +7 -0
  6. package/dist/lib/node-esm/index.mjs +232 -224
  7. package/dist/lib/node-esm/index.mjs.map +4 -4
  8. package/dist/lib/node-esm/meta.json +1 -1
  9. package/dist/lib/node-esm/translations.mjs +16 -0
  10. package/dist/lib/node-esm/translations.mjs.map +7 -0
  11. package/dist/types/src/components/ChatDialog/ChatDialog.d.ts +17 -1
  12. package/dist/types/src/components/ChatDialog/ChatDialog.d.ts.map +1 -1
  13. package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts +2 -3
  14. package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts.map +1 -1
  15. package/dist/types/src/components/ChatEditor/ChatEditor.d.ts +7 -8
  16. package/dist/types/src/components/ChatEditor/ChatEditor.d.ts.map +1 -1
  17. package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts +3 -4
  18. package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/ChatEditor/references.d.ts +4 -0
  20. package/dist/types/src/components/ChatEditor/references.d.ts.map +1 -1
  21. package/dist/types/src/components/ChatStatus/ChatStatus.d.ts +40 -0
  22. package/dist/types/src/components/ChatStatus/ChatStatus.d.ts.map +1 -0
  23. package/dist/types/src/components/ChatStatus/ChatStatus.stories.d.ts +27 -0
  24. package/dist/types/src/components/ChatStatus/ChatStatus.stories.d.ts.map +1 -0
  25. package/dist/types/src/components/ChatStatus/format.d.ts +7 -0
  26. package/dist/types/src/components/ChatStatus/format.d.ts.map +1 -0
  27. package/dist/types/src/components/ChatStatus/format.test.d.ts +2 -0
  28. package/dist/types/src/components/ChatStatus/format.test.d.ts.map +1 -0
  29. package/dist/types/src/components/ChatStatus/index.d.ts +3 -0
  30. package/dist/types/src/components/ChatStatus/index.d.ts.map +1 -0
  31. package/dist/types/src/components/index.d.ts +1 -0
  32. package/dist/types/src/components/index.d.ts.map +1 -1
  33. package/dist/types/src/index.d.ts +0 -1
  34. package/dist/types/src/index.d.ts.map +1 -1
  35. package/dist/types/src/translations.d.ts +2 -2
  36. package/dist/types/src/translations.d.ts.map +1 -1
  37. package/dist/types/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +48 -39
  39. package/src/components/ChatDialog/ChatDialog.stories.tsx +4 -6
  40. package/src/components/ChatDialog/ChatDialog.tsx +28 -18
  41. package/src/components/ChatEditor/ChatEditor.stories.tsx +20 -20
  42. package/src/components/ChatEditor/ChatEditor.tsx +34 -64
  43. package/src/components/ChatEditor/references.ts +18 -12
  44. package/src/components/ChatStatus/ChatStatus.stories.tsx +130 -0
  45. package/src/components/ChatStatus/ChatStatus.tsx +183 -0
  46. package/src/components/ChatStatus/format.test.ts +48 -0
  47. package/src/components/ChatStatus/format.ts +27 -0
  48. package/src/components/ChatStatus/index.ts +6 -0
  49. package/src/components/index.ts +1 -0
  50. package/src/index.ts +0 -1
  51. package/src/translations.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/ChatDialog/ChatDialog.tsx", "../../../src/components/ChatEditor/references.ts", "../../../src/components/ChatEditor/ChatEditor.tsx", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type Dispatch, type PropsWithChildren, type SetStateAction, useEffect, useState } from 'react';\n\nimport { Dialog, Icon, IconButton, type ThemedClassName, useControlledState } from '@dxos/react-ui';\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\nimport { mx } from '@dxos/react-ui-theme';\n\nconst preventDefault = (event: Event) => event.preventDefault();\n\n// TODO(burdon): Factor out.\nconst Endcap = ({ children }: PropsWithChildren) => {\n return (\n <div className='grid w-[var(--rail-action)] h-[var(--rail-action)] items-center justify-center'>{children}</div>\n );\n};\n\n//\n// Context\n//\n\ntype ChatDialogContextValue = {\n open: boolean;\n setOpen: Dispatch<SetStateAction<boolean>>;\n expanded: boolean;\n setExpanded: Dispatch<SetStateAction<boolean>>;\n size: Size;\n setSize: Dispatch<SetStateAction<Size>>;\n};\n\nconst [ChatDialogContextProvider, useChatDialogContext] = createContext<ChatDialogContextValue>('ChatDialog');\n\n//\n// Root\n//\n\ntype ChatDialogRootProps = PropsWithChildren<{\n open?: boolean;\n expanded?: boolean;\n onOpenChange?: (open: boolean) => void;\n onExpandedChange?: (expanded: boolean) => void;\n onEscape?: () => void;\n}>;\n\nconst ChatDialogRoot = ({\n children,\n open: _open = false,\n expanded: expandedParam = false,\n onOpenChange,\n onExpandedChange,\n onEscape,\n}: ChatDialogRootProps) => {\n const [size, setSize] = useState<Size>('min-content');\n const [open, setOpen] = useControlledState<boolean>(_open, onOpenChange);\n const [expanded, setExpanded] = useControlledState<boolean>(expandedParam, onExpandedChange);\n\n // NOTE: We set the min size to 5rem (80px), and the header and prompt bar to 40px (i.e., the rail-size) each.\n // The dialog has no vertical padding and has box-content so that when closed it collapses to the size of the header and prompt bar.\n return (\n <ChatDialogContextProvider\n open={open}\n setOpen={setOpen}\n expanded={expanded}\n setExpanded={setExpanded}\n size={size}\n setSize={setSize}\n >\n <Dialog.Root modal={false} open={open} onOpenChange={setOpen}>\n <div role='none' className='dx-dialog__overlay bg-transparent pointer-events-none' data-block-align='end'>\n <Dialog.Content\n inOverlayLayout\n classNames={[\n 'grid grid-rows-[var(--rail-action)_1fr_min-content] p-0 overflow-hidden',\n 'box-content md:is-[35rem] md:max-is-none pointer-events-auto',\n ]}\n onEscapeKeyDown={onEscape}\n onInteractOutside={preventDefault}\n >\n {children}\n </Dialog.Content>\n </div>\n </Dialog.Root>\n </ChatDialogContextProvider>\n );\n};\n\nChatDialogRoot.displayName = 'ChatDialog.Root';\n\n//\n// Header\n//\n\ntype ChatDialogHeaderProps = ThemedClassName<{\n title?: string;\n}>;\n\nconst ChatDialogHeader = ({ classNames, title }: ChatDialogHeaderProps) => {\n const { expanded, setExpanded } = useChatDialogContext(ChatDialogHeader.displayName);\n\n return (\n <div className={mx('grid grid-cols-[var(--rail-action)_1fr_min-content] items-center overflow-hidden', classNames)}>\n <Endcap>\n <Dialog.Close>\n <Icon icon='ph--x--regular' />\n </Dialog.Close>\n </Endcap>\n <Dialog.Title\n classNames='flex w-full justify-center text-sm text-subdued select-none cursor-pointer'\n onClick={() => setExpanded((expanded) => !expanded)}\n >\n {title}\n </Dialog.Title>\n <Endcap>\n <IconButton\n variant='ghost'\n icon='ph--caret-up--regular'\n iconOnly\n classNames={mx('!p-1 [&>svg]:transition [&>svg]:duration-200', expanded && '[&>svg]:rotate-180')}\n label={expanded ? 'Close' : 'Open'}\n onClick={() => setExpanded((expanded) => !expanded)}\n />\n </Endcap>\n </div>\n );\n};\n\nChatDialogHeader.displayName = 'ChatDialog.Header';\n\n//\n// Content\n//\n\ntype ChatDialogContentProps = ThemedClassName<PropsWithChildren>;\n\nconst ChatDialogContent = ({ children, classNames }: ChatDialogContentProps) => {\n const { expanded, size, setSize } = useChatDialogContext(ChatDialogContent.displayName);\n useEffect(() => {\n setSize(expanded ? 'min-content' : 0);\n }, [expanded]);\n\n return (\n <div\n className={mx(\n 'flex flex-col overflow-y-auto border-t border-b border-subduedSeparator',\n 'transition-[block-size] ease-in-out duration-0 [&:not([data-dx-resizing=\"true\"])]:duration-200',\n classNames,\n )}\n style={{\n ...sizeStyle(size, 'vertical', true),\n maxBlockSize: 'calc(100dvh - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 14rem)',\n }}\n {...resizeAttributes}\n >\n <ResizeHandle\n side='block-start'\n iconPosition='center'\n defaultSize='min-content'\n fallbackSize={0}\n minSize={0}\n onSizeChange={setSize}\n />\n {children}\n </div>\n );\n};\n\nChatDialogContent.displayName = 'ChatDialog.Content';\n\n//\n// Footer\n//\n\ntype ChatDialogFooterProps = ThemedClassName<PropsWithChildren>;\n\nconst ChatDialogFooter = ({ children, classNames }: ChatDialogFooterProps) => {\n return <div className={mx(classNames)}>{children}</div>;\n};\n\nChatDialogFooter.displayName = 'ChatDialog.Footer';\n\n//\n// ChatDialog\n//\n\nexport const ChatDialog = {\n Root: ChatDialogRoot,\n Header: ChatDialogHeader,\n Content: ChatDialogContent,\n Footer: ChatDialogFooter,\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type CompletionResult, autocompletion, completionKeymap } from '@codemirror/autocomplete';\nimport { type Extension, RangeSet } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n ViewPlugin,\n type ViewUpdate,\n WidgetType,\n keymap,\n} from '@codemirror/view';\n\nimport { Mutex } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\n\n// TODO(dmaretskyi): Consider adding details renderer for when you hover over the reference.\nexport type ReferenceData = {\n uri: string;\n label: string;\n};\n\nexport interface ReferencesProvider {\n getReferences({ query }: { query: string }): Promise<ReferenceData[]>;\n resolveReference({ uri }: { uri: string }): Promise<ReferenceData | null>;\n}\n\nexport type ReferencesOptions = {\n provider: ReferencesProvider;\n\n /**\n * @default '@'\n */\n triggerCharacter?: string;\n\n /**\n * Prevent the autocomplete from closing when the user blurs the editor.\n * @default false\n */\n debug?: boolean;\n};\n\n/**\n * Lookup object references.\n */\nexport const references = ({ provider, triggerCharacter = '@', debug = false }: ReferencesOptions): Extension => {\n invariant(triggerCharacter.length === 1);\n\n const decorationField = ViewPlugin.fromClass(\n class ReferenceView {\n // TODO(burdon): Why?\n private _mutex = new Mutex();\n\n decorations: DecorationSet = Decoration.set([]);\n\n constructor(view: EditorView) {\n queueMicrotask(async () => {\n const guard = await this._mutex.acquire();\n try {\n this.decorations = await this._computeDecorations(view);\n } finally {\n guard.release();\n }\n });\n }\n\n update(update: ViewUpdate) {\n if (update.docChanged) {\n queueMicrotask(async () => {\n const guard = await this._mutex.acquire();\n try {\n this.decorations = await this._computeDecorations(update.view);\n } finally {\n guard.release();\n }\n });\n }\n }\n\n private async _computeDecorations(view: EditorView): Promise<DecorationSet> {\n const text = view.state.doc.toString();\n const references = text.matchAll(new RegExp(`${triggerCharacter}[a-zA-Z0-9@:]+\\\\s`, 'g'));\n\n const decorations = [];\n for (const match of references) {\n const reference = match[0];\n const uri = reference.slice(1, -1);\n const data = await provider.resolveReference({ uri });\n if (data) {\n decorations.push(\n Decoration.replace({\n widget: new ReferenceWidget(data),\n }).range(match.index!, match.index! + reference.length),\n );\n }\n }\n\n return Decoration.set(decorations);\n }\n },\n {\n decorations: (v) => v.decorations,\n provide: (plugin) => [\n EditorView.atomicRanges.of(\n (view): DecorationSet => view.plugin(decorationField)?.decorations ?? RangeSet.empty,\n ),\n ],\n },\n );\n\n return [\n decorationField,\n\n EditorView.theme({\n '.cm-reference-pill': {\n borderRadius: '0.25rem',\n borderWidth: '1px',\n marginRight: '0.25rem',\n marginLeft: '0.25rem',\n },\n }),\n\n autocompletion({\n tooltipClass: () => 'shadow rounded',\n activateOnTyping: true,\n aboveCursor: true,\n closeOnBlur: !debug,\n override: [\n async (context): Promise<CompletionResult | null> => {\n const match = context.matchBefore(new RegExp(`${triggerCharacter}[a-zA-Z0-9]+`));\n if (!match || match?.to === match?.from) {\n return null;\n }\n\n const query = match.text.slice(1);\n const references = await provider.getReferences({ query });\n return {\n from: match.from,\n filter: false,\n options: references.map((reference) => ({\n label: reference.label,\n apply: `${triggerCharacter}${reference.uri} `,\n })),\n };\n },\n ],\n }),\n\n keymap.of(completionKeymap),\n ];\n};\n\nclass ReferenceWidget extends WidgetType {\n constructor(private data: ReferenceData) {\n super();\n }\n\n override toDOM(): HTMLSpanElement {\n const span = document.createElement('span');\n span.textContent = `@ ${this.data.label}`;\n span.className = 'cm-reference-pill';\n return span;\n }\n\n override eq(other: ReferenceWidget): boolean {\n return other.data.uri === this.data.uri;\n }\n\n override ignoreEvent(): boolean {\n return true;\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Extension } from '@codemirror/state';\nimport React, { forwardRef, useImperativeHandle } from 'react';\n\nimport { type ThemedClassName, useThemeContext } from '@dxos/react-ui';\nimport {\n type AutocompleteOptions,\n type BasicExtensionsOptions,\n type UseTextEditorProps,\n autocomplete,\n createBasicExtensions,\n createThemeExtensions,\n useTextEditor,\n} from '@dxos/react-ui-editor';\nimport { mx } from '@dxos/react-ui-theme';\nimport { isNonNullable } from '@dxos/util';\n\nimport { type ReferencesOptions, references as referencesExtension } from './references';\n\nexport interface ChatEditorController {\n focus(): void;\n getText(): string;\n setText(text: string): void;\n}\n\nexport type ChatEditorProps = ThemedClassName<\n {\n extensions?: Extension;\n references?: ReferencesOptions;\n } & AutocompleteOptions &\n Pick<UseTextEditorProps, 'id' | 'autoFocus'> &\n Pick<BasicExtensionsOptions, 'lineWrapping' | 'placeholder'>\n>;\n\nexport const ChatEditor = forwardRef<ChatEditorController, ChatEditorProps>(\n (\n { classNames, extensions, references, autoFocus, lineWrapping = false, placeholder, onSubmit, onSuggest, onCancel },\n forwardRef,\n ) => {\n const { themeMode } = useThemeContext();\n\n const { parentRef, view } = useTextEditor(\n () => ({\n debug: true,\n autoFocus,\n extensions: [\n createThemeExtensions({ themeMode }),\n autocomplete({ onSubmit, onSuggest, onCancel }),\n references ? referencesExtension({ provider: references.provider }) : [],\n createBasicExtensions({\n bracketMatching: false,\n lineWrapping,\n placeholder,\n }),\n extensions,\n ].filter(isNonNullable),\n }),\n [themeMode, extensions, onSubmit, onSuggest, onCancel],\n );\n\n // Expose editor view.\n useImperativeHandle(forwardRef, () => {\n return {\n focus: () => {\n view?.focus();\n },\n getText: () => view?.state.doc.toString() ?? '',\n setText: (text: string) => {\n view?.dispatch({\n changes: {\n from: 0,\n to: view.state.doc.length,\n insert: text,\n },\n selection: {\n anchor: text.length,\n head: text.length,\n },\n });\n },\n };\n }, [view, onSubmit]);\n\n return <div ref={parentRef} className={mx('is-full', classNames)} />;\n },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nexport const translationKey = 'react-ui-chat';\n\nexport const translations = [\n {\n 'en-US': {\n [translationKey]: {},\n },\n },\n] as const satisfies Resource[];\n"],
5
- "mappings": ";;AAIA,SAASA,qBAAqB;AAC9B,OAAOC,SAAqEC,WAAWC,gBAAgB;AAEvG,SAASC,QAAQC,MAAMC,YAAkCC,0BAA0B;AACnF,SAASC,cAAyBC,kBAAkBC,iBAAiB;AACrE,SAASC,UAAU;AAEnB,IAAMC,iBAAiB,CAACC,UAAiBA,MAAMD,eAAc;AAG7D,IAAME,SAAS,CAAC,EAAEC,SAAQ,MAAqB;;;AAC7C,WACE,sBAAA,cAACC,OAAAA;MAAIC,WAAU;OAAkFF,QAAAA;;;;AAErG;AAeA,IAAM,CAACG,2BAA2BC,oBAAAA,IAAwBC,cAAsC,YAAA;AAchG,IAAMC,iBAAiB,CAAC,EACtBN,UACAO,MAAMC,QAAQ,OACdC,UAAUC,gBAAgB,OAC1BC,cACAC,kBACAC,SAAQ,MACY;;;AACpB,UAAM,CAACC,MAAMC,OAAAA,IAAWC,SAAe,aAAA;AACvC,UAAM,CAACT,MAAMU,OAAAA,IAAWC,mBAA4BV,OAAOG,YAAAA;AAC3D,UAAM,CAACF,UAAUU,WAAAA,IAAeD,mBAA4BR,eAAeE,gBAAAA;AAI3E,WACE,sBAAA,cAACT,2BAAAA;MACCI;MACAU;MACAR;MACAU;MACAL;MACAC;OAEA,sBAAA,cAACK,OAAOC,MAAI;MAACC,OAAO;MAAOf;MAAYI,cAAcM;OACnD,sBAAA,cAAChB,OAAAA;MAAIsB,MAAK;MAAOrB,WAAU;MAAwDsB,oBAAiB;OAClG,sBAAA,cAACJ,OAAOK,SAAO;MACbC,i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AoB;UAAEC,UAAUhB,YAAWgB;QAAS,CAAA,IAAK,CAAA;QACtEC,sBAAsB;UACpBC,iBAAiB;UACjBhB;UACAC;QACF,CAAA;QACAJ;QACAoB,OAAOC,aAAAA;IACX,IACA;MAACb;MAAWR;MAAYK;MAAUC;MAAWC;KAAS;AAIxDe,wBAAoBxB,aAAY,MAAA;AAC9B,aAAO;QACLyB,OAAO,MAAA;AACLZ,gBAAMY,MAAAA;QACR;QACAC,SAAS,MAAMb,MAAMc,MAAMC,IAAIC,SAAAA,KAAc;QAC7CC,SAAS,CAACC,SAAAA;AACRlB,gBAAMmB,SAAS;YACbC,SAAS;cACPC,MAAM;cACNC,IAAItB,KAAKc,MAAMC,IAAIQ;cACnBC,QAAQN;YACV;YACAO,WAAW;cACTC,QAAQR,KAAKK;cACbI,MAAMT,KAAKK;YACb;UACF,CAAA;QACF;MACF;IACF,GAAG;MAACvB;MAAMN;KAAS;AAEnB,WAAO,gBAAAkC,OAAA,cAACC,OAAAA;MAAIC,KAAK/B;MAAWgC,WAAWC,IAAG,WAAW5C,UAAAA;;;;;AACvD,CAAA;;;ACjFK,IAAM6C,iBAAiB;AAEvB,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,cAAAA,GAAiB,CAAC;IACrB;EACF;;",
6
- "names": ["createContext", "React", "useEffect", "useState", "Dialog", "Icon", "IconButton", "useControlledState", "ResizeHandle", "resizeAttributes", "sizeStyle", "mx", "preventDefault", "event", "Endcap", "children", "div", "className", "ChatDialogContextProvider", "useChatDialogContext", "createContext", "ChatDialogRoot", "open", "_open", "expanded", "expandedParam", "onOpenChange", "onExpandedChange", "onEscape", "size", "setSize", "useState", "setOpen", "useControlledState", "setExpanded", "Dialog", "Root", "modal", "role", "data-block-align", "Content", "inOverlayLayout", "classNames", "onEscapeKeyDown", "onInteractOutside", "displayName", "ChatDialogHeader", "title", "mx", "Close", "Icon", "icon", "Title", "onClick", "IconButton", "variant", "iconOnly", "label", "ChatDialogContent", "useEffect", "style", "sizeStyle", "maxBlockSize", "resizeAttributes", "ResizeHandle", "side", "iconPosition", "defaultSize", "fallbackSize", "minSize", "onSizeChange", "ChatDialogFooter", "ChatDialog", "Header", "Footer", "autocompletion", "completionKeymap", "RangeSet", "Decoration", "EditorView", "ViewPlugin", "WidgetType", "keymap", "Mutex", "invariant", "references", "provider", "triggerCharacter", "debug", "length", "decorationField", "fromClass", "ReferenceView", "update", "docChanged", "queueMicrotask", "guard", "_mutex", "acquire", "decorations", "_computeDecorations", "view", "release", "text", "state", "doc", "toString", "matchAll", "RegExp", "match", "reference", "uri", "slice", "data", "resolveReference", "push", "replace", "widget", "ReferenceWidget", "range", "index", "set", "v", "provide", "plugin", "atomicRanges", "of", "empty", "theme", "borderRadius", "borderWidth", "marginRight", "marginLeft", "tooltipClass", "activateOnTyping", "aboveCursor", "closeOnBlur", "override", "context", "matchBefore", "to", "from", "query", "getReferences", "filter", "options", "map", "label", "apply", "toDOM", "span", "document", "createElement", "textContent", "className", "eq", "other", "ignoreEvent", "React", "forwardRef", "useImperativeHandle", "useThemeContext", "autocomplete", "createBasicExtensions", "createThemeExtensions", "useTextEditor", "mx", "isNonNullable", "ChatEditor", "forwardRef", "classNames", "extensions", "references", "autoFocus", "lineWrapping", "placeholder", "onSubmit", "onSuggest", "onCancel", "themeMode", "useThemeContext", "parentRef", "view", "useTextEditor", "debug", "createThemeExtensions", "autocomplete", "referencesExtension", "provider", "createBasicExtensions", "bracketMatching", "filter", "isNonNullable", "useImperativeHandle", "focus", "getText", "state", "doc", "toString", "setText", "text", "dispatch", "changes", "from", "to", "length", "insert", "selection", "anchor", "head", "React", "div", "ref", "className", "mx", "translationKey", "translations"]
3
+ "sources": ["../../../src/components/ChatDialog/ChatDialog.tsx", "../../../src/components/ChatEditor/references.ts", "../../../src/components/ChatEditor/ChatEditor.tsx", "../../../src/components/ChatStatus/ChatStatus.tsx", "../../../src/components/ChatStatus/format.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type Dispatch, type PropsWithChildren, type SetStateAction, useEffect, useState } from 'react';\n\nimport { Dialog, Icon, IconButton, type ThemedClassName, useControlledState } from '@dxos/react-ui';\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\nimport { mx } from '@dxos/ui-theme';\n\nconst preventDefault = (event: Event) => event.preventDefault();\n\n// TODO(burdon): Factor out.\nconst Endcap = ({ children }: PropsWithChildren) => {\n return (\n <div className='grid w-[var(--dx-rail-action)] h-[var(--dx-rail-action)] items-center justify-center'>\n {children}\n </div>\n );\n};\n\n//\n// Context\n//\n\ntype ChatDialogContextValue = {\n open: boolean;\n setOpen: Dispatch<SetStateAction<boolean>>;\n expanded: boolean;\n setExpanded: Dispatch<SetStateAction<boolean>>;\n size: Size;\n setSize: Dispatch<SetStateAction<Size>>;\n};\n\nconst [ChatDialogContextProvider, useChatDialogContext] = createContext<ChatDialogContextValue>('ChatDialog');\n\n//\n// Root\n//\n\ntype ChatDialogRootProps = PropsWithChildren<{\n open?: boolean;\n expanded?: boolean;\n onOpenChange?: (open: boolean) => void;\n onExpandedChange?: (expanded: boolean) => void;\n onEscape?: () => void;\n}>;\n\nconst ChatDialogRoot = ({\n children,\n open: openProp = false,\n expanded: expandedProp = false,\n onOpenChange,\n onExpandedChange,\n onEscape,\n}: ChatDialogRootProps) => {\n const [size, setSize] = useState<Size>('min-content');\n const [open, setOpen] = useControlledState<boolean>(openProp, onOpenChange);\n const [expanded, setExpanded] = useControlledState<boolean>(expandedProp, onExpandedChange);\n\n // NOTE: We set the min size to 5rem (80px), and the header and prompt bar to 40px (i.e., the rail-size) each.\n // The dialog has no vertical padding and has box-content so that when closed it collapses to the size of the header and prompt bar.\n return (\n <ChatDialogContextProvider\n open={open}\n setOpen={setOpen}\n expanded={expanded}\n setExpanded={setExpanded}\n size={size}\n setSize={setSize}\n >\n <Dialog.Root modal={false} open={open} onOpenChange={setOpen}>\n <div className='dx-dialog__overlay bg-transparent pointer-events-none' data-block-align='end'>\n <Dialog.Content\n size='md'\n inOverlayLayout\n classNames={[\n 'grid grid-rows-[var(--dx-rail-action)_1fr_min-content] p-0 overflow-hidden box-content pointer-events-auto',\n ]}\n onEscapeKeyDown={onEscape}\n onInteractOutside={preventDefault}\n >\n {children}\n </Dialog.Content>\n </div>\n </Dialog.Root>\n </ChatDialogContextProvider>\n );\n};\n\nChatDialogRoot.displayName = 'ChatDialog.Root';\n\n//\n// Header\n//\n\nconst CHAT_DIALOG_HEADER_NAME = 'ChatDialog.Header';\n\ntype ChatDialogHeaderProps = ThemedClassName<{\n title?: string;\n}>;\n\nconst ChatDialogHeader = ({ classNames, title }: ChatDialogHeaderProps) => {\n const { expanded, setExpanded } = useChatDialogContext(CHAT_DIALOG_HEADER_NAME);\n\n return (\n <div\n className={mx('grid grid-cols-[var(--dx-rail-action)_1fr_min-content] items-center overflow-hidden', classNames)}\n >\n <Endcap>\n <Dialog.Close>\n <Icon icon='ph--x--regular' />\n </Dialog.Close>\n </Endcap>\n <Dialog.Title\n classNames='flex w-full justify-center text-sm text-subdued select-none cursor-pointer'\n onClick={() => setExpanded((expanded) => !expanded)}\n >\n {title}\n </Dialog.Title>\n <Endcap>\n <IconButton\n variant='ghost'\n icon='ph--caret-up--regular'\n iconOnly\n classNames={mx('p-1! [&>svg]:transition [&>svg]:duration-200', expanded && '[&>svg]:rotate-180')}\n label={expanded ? 'Close' : 'Open'}\n onClick={() => setExpanded((expanded) => !expanded)}\n />\n </Endcap>\n </div>\n );\n};\n\nChatDialogHeader.displayName = CHAT_DIALOG_HEADER_NAME;\n\n//\n// Content\n//\n\nconst CHAT_DIALOG_CONTENT_NAME = 'ChatDialog.Content';\n\ntype ChatDialogContentProps = ThemedClassName<PropsWithChildren>;\n\nconst ChatDialogContent = ({ children, classNames }: ChatDialogContentProps) => {\n const { expanded, size, setSize } = useChatDialogContext(CHAT_DIALOG_CONTENT_NAME);\n useEffect(() => {\n setSize(expanded ? 'min-content' : 0);\n }, [expanded]);\n\n return (\n <div\n className={mx(\n 'border-t border-b border-subdued-separator',\n 'transition ease-in-out duration-0 [&:not([data-dx-resizing=\"true\"])]:duration-200',\n classNames,\n )}\n style={{\n ...sizeStyle(size, 'vertical', true),\n maxBlockSize: 'calc(100dvh - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 14rem)',\n }}\n {...resizeAttributes}\n >\n <ResizeHandle\n side='block-start'\n iconPosition='center'\n defaultSize='min-content'\n fallbackSize={0}\n minSize={0}\n onSizeChange={setSize}\n />\n {children}\n </div>\n );\n};\n\nChatDialogContent.displayName = CHAT_DIALOG_CONTENT_NAME;\n\n//\n// Footer\n//\n\nconst CHAT_DIALOG_FOOTER_NAME = 'ChatDialog.Footer';\n\ntype ChatDialogFooterProps = ThemedClassName<PropsWithChildren>;\n\nconst ChatDialogFooter = ({ children, classNames }: ChatDialogFooterProps) => {\n return <div className={mx(classNames)}>{children}</div>;\n};\n\nChatDialogFooter.displayName = CHAT_DIALOG_FOOTER_NAME;\n\n//\n// ChatDialog\n//\n\nexport const ChatDialog = {\n Root: ChatDialogRoot,\n Header: ChatDialogHeader,\n Content: ChatDialogContent,\n Footer: ChatDialogFooter,\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type CompletionResult, autocompletion, completionKeymap } from '@codemirror/autocomplete';\nimport { type Extension, RangeSet } from '@codemirror/state';\nimport {\n Decoration,\n type DecorationSet,\n EditorView,\n ViewPlugin,\n type ViewUpdate,\n WidgetType,\n keymap,\n} from '@codemirror/view';\n\nimport { Mutex } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\n\n// TODO(dmaretskyi): Consider adding details renderer for when you hover over the reference.\nexport type ReferenceData = {\n uri: string; // TODO(burdon): Rename dxn.\n label: string;\n};\n\n/**\n * @deprecated\n */\n// TODO(burdon): Remove.\nexport interface ReferencesProvider {\n getReferences({ query }: { query: string }): Promise<ReferenceData[]>;\n resolveReference({ uri }: { uri: string }): Promise<ReferenceData | null>;\n}\n\nexport type ReferencesOptions = {\n provider: ReferencesProvider;\n\n /**\n * @default '@'\n */\n triggerCharacter?: string;\n\n /**\n * Prevent the autocomplete from closing when the user blurs the editor.\n * @default false\n */\n debug?: boolean;\n};\n\n/**\n * Lookup object references.\n * @deprecated\n */\n// TODO(burdon): Remove.\nexport const references = ({ provider, triggerCharacter = '@', debug = false }: ReferencesOptions): Extension => {\n invariant(triggerCharacter.length === 1);\n\n const decorationField = ViewPlugin.fromClass(\n class ReferenceView {\n // TODO(burdon): Why?\n private _mutex = new Mutex();\n\n decorations: DecorationSet = Decoration.set([]);\n\n constructor(view: EditorView) {\n queueMicrotask(async () => {\n const guard = await this._mutex.acquire();\n try {\n this.decorations = await this._computeDecorations(view);\n } finally {\n guard.release();\n }\n });\n }\n\n update(update: ViewUpdate) {\n if (update.docChanged) {\n queueMicrotask(async () => {\n const guard = await this._mutex.acquire();\n try {\n this.decorations = await this._computeDecorations(update.view);\n } finally {\n guard.release();\n }\n });\n }\n }\n\n private async _computeDecorations(view: EditorView): Promise<DecorationSet> {\n const text = view.state.doc.toString();\n const references = text.matchAll(new RegExp(`${triggerCharacter}[a-zA-Z0-9@:]+\\\\s`, 'g'));\n\n const decorations = [];\n for (const match of references) {\n const reference = match[0];\n const uri = reference.slice(1, -1);\n const data = await provider.resolveReference({ uri });\n if (data) {\n decorations.push(\n Decoration.replace({\n widget: new ReferenceWidget(data),\n }).range(match.index!, match.index! + reference.length),\n );\n }\n }\n\n return Decoration.set(decorations);\n }\n },\n {\n decorations: (v) => v.decorations,\n provide: () => [\n EditorView.atomicRanges.of(\n (view): DecorationSet => view.plugin(decorationField)?.decorations ?? RangeSet.empty,\n ),\n ],\n },\n );\n\n return [\n decorationField,\n\n EditorView.theme({\n '.cm-reference-pill': {\n borderRadius: '0.25rem',\n borderWidth: '1px',\n marginRight: '0.25rem',\n marginLeft: '0.25rem',\n },\n }),\n\n autocompletion({\n tooltipClass: () => 'shadow rounded-sm',\n activateOnTyping: true,\n aboveCursor: true,\n closeOnBlur: !debug,\n override: [\n async (context): Promise<CompletionResult | null> => {\n const match = context.matchBefore(new RegExp(`${triggerCharacter}[a-zA-Z0-9]+`));\n if (!match || match?.to === match?.from) {\n return null;\n }\n\n const query = match.text.slice(1);\n const references = await provider.getReferences({ query });\n return {\n from: match.from,\n filter: false,\n options: references.map((reference) => ({\n label: reference.label,\n apply: `${triggerCharacter}${reference.uri} `,\n })),\n };\n },\n ],\n }),\n\n keymap.of(completionKeymap),\n ];\n};\n\nclass ReferenceWidget extends WidgetType {\n constructor(private data: ReferenceData) {\n super();\n }\n\n override ignoreEvent() {\n return true;\n }\n\n override eq(other: this) {\n return this.data.uri === other.data.uri;\n }\n\n override toDOM() {\n const span = document.createElement('span');\n span.textContent = `@${this.data.label}`;\n span.className = 'cm-reference-pill';\n return span;\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Extension } from '@codemirror/state';\nimport React, { forwardRef, useMemo } from 'react';\n\nimport { type ThemedClassName, useThemeContext } from '@dxos/react-ui';\nimport { Editor, type EditorController, type UseTextEditorProps } from '@dxos/react-ui-editor';\nimport {\n type BasicExtensionsOptions,\n type SubmitOptions,\n createBasicExtensions,\n createThemeExtensions,\n submit,\n xmlFormatting,\n} from '@dxos/ui-editor';\nimport { isTruthy } from '@dxos/util';\n\nimport { type ReferencesOptions } from './references';\n\nexport interface ChatEditorController extends EditorController {}\n\nexport type ChatEditorProps = ThemedClassName<\n {\n extensions?: Extension;\n references?: ReferencesOptions;\n } & (SubmitOptions &\n Pick<UseTextEditorProps, 'id' | 'autoFocus'> &\n Pick<BasicExtensionsOptions, 'lineWrapping' | 'placeholder'>)\n>;\n\nexport const useChatExtensions = ({ extensions, lineWrapping = false, placeholder, onSubmit }: ChatEditorProps) => {\n const { themeMode } = useThemeContext();\n return useMemo<Extension[]>(\n () =>\n [\n createThemeExtensions({ themeMode }),\n createBasicExtensions({ bracketMatching: false, lineWrapping, placeholder }),\n xmlFormatting(),\n submit({ onSubmit }),\n extensions,\n ].filter(isTruthy),\n [themeMode, extensions, onSubmit],\n );\n};\n\nexport const ChatEditor = forwardRef<ChatEditorController, ChatEditorProps>(\n ({ classNames, autoFocus, extensions: extensionsProp, lineWrapping = false, placeholder, onSubmit }, forwardRef) => {\n const extensions = useChatExtensions({ extensions: extensionsProp, lineWrapping, placeholder, onSubmit });\n\n // TODO(burdon): Popover.\n return (\n <Editor.Root ref={forwardRef}>\n <Editor.View classNames={classNames} autoFocus={autoFocus} extensions={extensions} />\n </Editor.Root>\n );\n },\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport React, { type PropsWithChildren, type Ref, forwardRef, useEffect, useImperativeHandle, useState } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { formatElapsed } from './format';\n\nconst TICK_MS = 1_000;\n\n//\n// Context\n//\n\ntype ChatStatusContextValue = {\n /** Whole seconds elapsed since ChatStatus.Root mounted. Only advances while `running` is true. */\n elapsed: number;\n /** Whether the ChatStatus.Root tick is currently active. Toggled via the ChatStatusController. */\n running: boolean;\n};\n\nconst [ChatStatusProvider, useChatStatusContext] = createContext<ChatStatusContextValue>('ChatStatus');\n\nexport { useChatStatusContext };\n\n//\n// Controller\n//\n\nexport type ChatStatusController = {\n /** Resume the tick. No-op if already running. */\n start: () => void;\n /** Pause the tick. The reported `elapsed` freezes at its last value. */\n stop: () => void;\n};\n\n//\n// Root\n//\n\nexport type RootProps = ThemedClassName<\n PropsWithChildren<{\n /** Whether the tick starts running on mount. Defaults to `true`. */\n defaultRunning?: boolean;\n }>\n>;\n\nconst Root = forwardRef<ChatStatusController, RootProps>(\n ({ classNames, children, defaultRunning = true }: RootProps, forwardedRef: Ref<ChatStatusController>) => {\n const [elapsed, setElapsed] = useState(0);\n const [running, setRunning] = useState(defaultRunning);\n\n useEffect(() => {\n if (!running) {\n return;\n }\n\n // Anchor to a wall-clock timestamp so `elapsed` self-corrects after\n // tab-throttling: browsers clamp setTimeout to >=1s in inactive tabs\n // and >=1min when the page is hidden, so a count-the-ticks approach\n // would under-report after a background period. Computing elapsed from\n // (Date.now() - startedAt) restores the true wall-clock value on the\n // next fired tick. The initial elapsed (preserved across stop/start)\n // is folded into the anchor so paused intervals are excluded.\n const startedAt = Date.now() - elapsed * TICK_MS;\n let timeout: ReturnType<typeof setTimeout>;\n const tick = () => {\n setElapsed(Math.floor((Date.now() - startedAt) / TICK_MS));\n timeout = setTimeout(tick, TICK_MS - (Date.now() % TICK_MS));\n };\n timeout = setTimeout(tick, TICK_MS - (Date.now() % TICK_MS));\n return () => clearTimeout(timeout);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `elapsed` is\n // captured once at resume; depending on it would restart the timer on\n // every tick.\n }, [running]);\n\n useImperativeHandle(\n forwardedRef,\n () => ({\n start: () => setRunning(true),\n stop: () => setRunning(false),\n }),\n [],\n );\n\n return (\n <ChatStatusProvider elapsed={elapsed} running={running}>\n <span className={mx('inline-flex items-center gap-2 text-description font-mono tabular-nums', classNames)}>\n {children}\n </span>\n </ChatStatusProvider>\n );\n },\n);\n\nRoot.displayName = 'ChatChatStatus.Root';\n\n//\n// Icon\n//\n\nexport type IconProps = ThemedClassName<PropsWithChildren>;\n\n/**\n * Animated leading indicator. Defaults to a halo-pulse dot. Pass children to override.\n */\nconst Icon = ({ classNames, children }: IconProps) => {\n if (children !== undefined) {\n return <>{children}</>;\n }\n return (\n <span\n aria-hidden='true'\n className={mx('inline-block size-2 rounded-full bg-current animate-halo-pulse', classNames)}\n />\n );\n};\n\n//\n// Stopwatch\n//\n\nexport type StopwatchProps = ThemedClassName<{\n /** Seconds to add to the context elapsed value before formatting. Defaults to 0. */\n offset?: number;\n}>;\n\n/**\n * Elapsed-time display, driven by the ChatStatus.Root context tick.\n * Use `offset` to shift the displayed value; remount `ChatStatus.Root` to reset the underlying counter.\n * Marked `aria-live='off'` so screen readers don't announce every tick.\n */\nconst Stopwatch = ({ classNames, offset = 0 }: StopwatchProps) => {\n const { elapsed } = useChatStatusContext('ChatChatStatus.Stopwatch');\n return (\n <span aria-live='off' className={mx(classNames)}>\n {formatElapsed((elapsed + offset) * 1_000)}\n </span>\n );\n};\n\n//\n// Separator\n//\n\nexport type SeparatorProps = ThemedClassName<unknown>;\n\n/**\n * Middle-dot separator. Decorative — `aria-hidden`.\n */\nconst Separator = ({ classNames }: SeparatorProps) => (\n <span aria-hidden='true' className={mx('opacity-50', classNames)}>\n ·\n </span>\n);\n\n//\n// Text\n//\n\nexport type TextProps = ThemedClassName<PropsWithChildren>;\n\n/**\n * Generic text node — useful for token counts and other inline metadata.\n */\nconst Text = ({ classNames, children }: TextProps) => <span className={mx(classNames)}>{children}</span>;\n\n//\n// ChatStatus\n//\n\nexport const ChatStatus = {\n Root,\n Icon,\n Stopwatch,\n Separator,\n Text,\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nconst SECOND = 1_000;\nconst MINUTE = 60 * SECOND;\nconst HOUR = 60 * MINUTE;\n\n/**\n * Formats elapsed milliseconds as a human-readable duration.\n * Tiers: `Ns` (< 60s), `Nm Xs` (< 60m), `Nh Xm` (≥ 60m).\n * Negative inputs clamp to `0s`.\n */\nexport const formatElapsed = (ms: number): string => {\n const safe = Math.max(0, ms);\n if (safe < MINUTE) {\n return `${Math.floor(safe / SECOND)}s`;\n }\n if (safe < HOUR) {\n const m = Math.floor(safe / MINUTE);\n const s = Math.floor((safe % MINUTE) / SECOND);\n return `${m}m ${s}s`;\n }\n const h = Math.floor(safe / HOUR);\n const m = Math.floor((safe % HOUR) / MINUTE);\n return `${h}h ${m}m`;\n};\n"],
5
+ "mappings": ";AAIA,SAASA,qBAAqB;AAC9B,OAAOC,SAAqEC,WAAWC,gBAAgB;AAEvG,SAASC,QAAQC,MAAMC,YAAkCC,0BAA0B;AACnF,SAASC,cAAyBC,kBAAkBC,iBAAiB;AACrE,SAASC,UAAU;AAEnB,IAA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AAA,MAAGtB,QAAAA;EACZ;AACA,SACE,gBAAAsB,OAAA,cAACE,QAAAA;IACCM,eAAY;IACZL,WAAWC,IAAG,kEAAkE3B,UAAAA;;AAGtF;AAgBA,IAAMgC,YAAY,CAAC,EAAEhC,YAAYiC,SAAS,EAAC,MAAkB;AAC3D,QAAM,EAAE7B,QAAO,IAAK8B,qBAAqB,0BAAA;AACzC,SACE,gBAAAX,OAAA,cAACE,QAAAA;IAAKU,aAAU;IAAMT,WAAWC,IAAG3B,UAAAA;KACjCoC,eAAehC,UAAU6B,UAAU,GAAA,CAAA;AAG1C;AAWA,IAAMI,YAAY,CAAC,EAAErC,WAAU,MAC7B,gBAAAuB,OAAA,cAACE,QAAAA;EAAKM,eAAY;EAAOL,WAAWC,IAAG,cAAc3B,UAAAA;GAAa,MAAA;AAcpE,IAAMsC,OAAO,CAAC,EAAEtC,YAAYC,SAAQ,MAAkB,gBAAAsB,OAAA,cAACE,QAAAA;EAAKC,WAAWC,IAAG3B,UAAAA;GAAcC,QAAAA;AAMjF,IAAMsC,aAAa;EACxBzC;EACA+B,MAAAA;EACAG;EACAK;EACAC;AACF;",
6
+ "names": ["createContext", "React", "useEffect", "useState", "Dialog", "Icon", "IconButton", "useControlledState", "ResizeHandle", "resizeAttributes", "sizeStyle", "mx", "preventDefault", "event", "Endcap", "children", "div", "className", "ChatDialogContextProvider", "useChatDialogContext", "ChatDialogRoot", "open", "openProp", "expanded", "expandedProp", "onOpenChange", "onExpandedChange", "onEscape", "size", "setSize", "setOpen", "setExpanded", "Root", "modal", "data-block-align", "Content", "inOverlayLayout", "classNames", "onEscapeKeyDown", "onInteractOutside", "displayName", "CHAT_DIALOG_HEADER_NAME", "ChatDialogHeader", "title", "Close", "icon", "Title", "onClick", "variant", "iconOnly", "label", "CHAT_DIALOG_CONTENT_NAME", "ChatDialogContent", "style", "maxBlockSize", "side", "iconPosition", "defaultSize", "fallbackSize", "minSize", "onSizeChange", "CHAT_DIALOG_FOOTER_NAME", "ChatDialogFooter", "ChatDialog", "Header", "Footer", "autocompletion", "completionKeymap", "RangeSet", "Decoration", "EditorView", "ViewPlugin", "WidgetType", "keymap", "Mutex", "invariant", "decorationField", "fromClass", "ReferenceView", "_mutex", "view", "queueMicrotask", "guard", "decorations", "_computeDecorations", "update", "text", "matchAll", "references", "match", "reference", "uri", "data", "provider", "widget", "index", "atomicRanges", "borderRadius", "marginRight", "marginLeft", "activateOnTyping", "aboveCursor", "closeOnBlur", "debug", "override", "context", "query", "filter", "options", "label", "apply", "triggerCharacter", "ignoreEvent", "other", "toDOM", "span", "className", "React", "forwardRef", "useMemo", "useThemeContext", "Editor", "createBasicExtensions", "createThemeExtensions", "submit", "xmlFormatting", "isTruthy", "useChatExtensions", "extensions", "lineWrapping", "placeholder", "onSubmit", "themeMode", "bracketMatching", "filter", "ChatEditor", "classNames", "autoFocus", "extensionsProp", "Root", "ref", "View", "createContext", "React", "forwardRef", "useEffect", "useImperativeHandle", "useState", "mx", "SECOND", "MINUTE", "HOUR", "formatElapsed", "ms", "safe", "Math", "max", "floor", "m", "s", "h", "TICK_MS", "ChatStatusProvider", "useChatStatusContext", "createContext", "Root", "forwardRef", "classNames", "children", "defaultRunning", "forwardedRef", "elapsed", "setElapsed", "useState", "running", "setRunning", "useEffect", "startedAt", "Date", "now", "TICK_MS", "timeout", "tick", "Math", "floor", "setTimeout", "clearTimeout", "useImperativeHandle", "start", "stop", "React", "ChatStatusProvider", "span", "className", "mx", "displayName", "Icon", "undefined", "aria-hidden", "Stopwatch", "offset", "useChatStatusContext", "aria-live", "formatElapsed", "Separator", "Text", "ChatStatus"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/components/ChatDialog/ChatDialog.tsx":{"bytes":17762,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/ChatDialog/index.ts":{"bytes":480,"imports":[{"path":"src/components/ChatDialog/ChatDialog.tsx","kind":"import-statement","original":"./ChatDialog"}],"format":"esm"},"src/components/ChatEditor/references.ts":{"bytes":16344,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/components/ChatEditor/ChatEditor.tsx":{"bytes":8814,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/components/ChatEditor/references.ts","kind":"import-statement","original":"./references"}],"format":"esm"},"src/components/ChatEditor/index.ts":{"bytes":574,"imports":[{"path":"src/components/ChatEditor/references.ts","kind":"import-statement","original":"./references"},{"path":"src/components/ChatEditor/ChatEditor.tsx","kind":"import-statement","original":"./ChatEditor"}],"format":"esm"},"src/components/index.ts":{"bytes":563,"imports":[{"path":"src/components/ChatDialog/index.ts","kind":"import-statement","original":"./ChatDialog"},{"path":"src/components/ChatEditor/index.ts","kind":"import-statement","original":"./ChatEditor"}],"format":"esm"},"src/translations.ts":{"bytes":1041,"imports":[],"format":"esm"},"src/index.ts":{"bytes":558,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22282},"dist/lib/browser/index.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["ChatDialog","ChatEditor","references","translationKey","translations"],"entryPoint":"src/index.ts","inputs":{"src/components/ChatDialog/ChatDialog.tsx":{"bytesInOutput":4874},"src/components/ChatDialog/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/ChatEditor/references.ts":{"bytesInOutput":3999},"src/components/ChatEditor/index.ts":{"bytesInOutput":0},"src/components/ChatEditor/ChatEditor.tsx":{"bytesInOutput":2035},"src/index.ts":{"bytesInOutput":0},"src/translations.ts":{"bytesInOutput":118}},"bytes":11305}}}
1
+ {"inputs":{"src/components/ChatDialog/ChatDialog.tsx":{"bytes":17382,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/ChatDialog/index.ts":{"bytes":382,"imports":[{"path":"src/components/ChatDialog/ChatDialog.tsx","kind":"import-statement","original":"./ChatDialog"}],"format":"esm"},"src/components/ChatEditor/references.ts":{"bytes":15988,"imports":[{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true}],"format":"esm"},"src/components/ChatEditor/ChatEditor.tsx":{"bytes":5885,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/ChatEditor/index.ts":{"bytes":476,"imports":[{"path":"src/components/ChatEditor/references.ts","kind":"import-statement","original":"./references"},{"path":"src/components/ChatEditor/ChatEditor.tsx","kind":"import-statement","original":"./ChatEditor"}],"format":"esm"},"src/components/ChatStatus/format.ts":{"bytes":2700,"imports":[],"format":"esm"},"src/components/ChatStatus/ChatStatus.tsx":{"bytes":13936,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/components/ChatStatus/format.ts","kind":"import-statement","original":"./format"}],"format":"esm"},"src/components/ChatStatus/index.ts":{"bytes":464,"imports":[{"path":"src/components/ChatStatus/ChatStatus.tsx","kind":"import-statement","original":"./ChatStatus"},{"path":"src/components/ChatStatus/format.ts","kind":"import-statement","original":"./format"}],"format":"esm"},"src/components/index.ts":{"bytes":566,"imports":[{"path":"src/components/ChatDialog/index.ts","kind":"import-statement","original":"./ChatDialog"},{"path":"src/components/ChatEditor/index.ts","kind":"import-statement","original":"./ChatEditor"},{"path":"src/components/ChatStatus/index.ts","kind":"import-statement","original":"./ChatStatus"}],"format":"esm"},"src/index.ts":{"bytes":382,"imports":[{"path":"src/components/index.ts","kind":"import-statement","original":"./components"}],"format":"esm"},"src/translations.ts":{"bytes":968,"imports":[],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":28815},"dist/lib/browser/index.mjs":{"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-dnd","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/autocomplete","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"exports":["ChatDialog","ChatEditor","ChatStatus","formatElapsed","references","useChatExtensions","useChatStatusContext"],"entryPoint":"src/index.ts","inputs":{"src/components/ChatDialog/ChatDialog.tsx":{"bytesInOutput":4368},"src/components/ChatDialog/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0},"src/components/ChatEditor/references.ts":{"bytesInOutput":3675},"src/components/ChatEditor/index.ts":{"bytesInOutput":0},"src/components/ChatEditor/ChatEditor.tsx":{"bytesInOutput":1243},"src/components/ChatStatus/ChatStatus.tsx":{"bytesInOutput":2424},"src/components/ChatStatus/format.ts":{"bytesInOutput":455},"src/components/ChatStatus/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0}},"bytes":12592},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":523},"dist/lib/browser/translations.mjs":{"imports":[],"exports":["translationKey","translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":124}},"bytes":234}}}
@@ -0,0 +1,14 @@
1
+ // src/translations.ts
2
+ var translationKey = "@dxos/react-ui-chat";
3
+ var translations = [
4
+ {
5
+ "en-US": {
6
+ [translationKey]: {}
7
+ }
8
+ }
9
+ ];
10
+ export {
11
+ translationKey,
12
+ translations
13
+ };
14
+ //# sourceMappingURL=translations.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/translations.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nexport const translationKey = '@dxos/react-ui-chat';\n\nexport const translations = [\n {\n 'en-US': {\n [translationKey]: {},\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";AAMO,IAAMA,iBAAiB;AAEvB,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACD,cAAAA,GAAiB,CAAC;IACrB;EACF;;",
6
+ "names": ["translationKey", "translations"]
7
+ }