@dxos/react-ui-chat 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.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.
- package/dist/lib/index.mjs +39 -39
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/types/src/components/ChatDialog/ChatDialog.d.ts +4 -4
- package/dist/types/src/components/ChatDialog/ChatDialog.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatDialog/index.d.ts +1 -1
- package/dist/types/src/components/ChatDialog/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatEditor/ChatEditor.d.ts +3 -3
- package/dist/types/src/components/ChatEditor/ChatEditor.d.ts.map +1 -1
- package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts +2 -2
- package/dist/types/src/components/ChatEditor/commands.d.ts.map +1 -1
- package/dist/types/src/components/ChatEditor/index.d.ts +4 -4
- package/dist/types/src/components/ChatEditor/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatEditor/useChatExtensions.d.ts +1 -1
- package/dist/types/src/components/ChatEditor/useChatExtensions.d.ts.map +1 -1
- package/dist/types/src/components/ChatStatus/ChatStatus.d.ts +6 -6
- package/dist/types/src/components/ChatStatus/ChatStatus.d.ts.map +1 -1
- package/dist/types/src/components/ChatStatus/ChatStatus.stories.d.ts +1 -1
- package/dist/types/src/components/ChatStatus/ChatStatus.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatStatus/ChatStatusContext.d.ts +1 -1
- package/dist/types/src/components/ChatStatus/ChatStatusContext.d.ts.map +1 -1
- package/dist/types/src/components/ChatStatus/index.d.ts +3 -3
- package/dist/types/src/components/ChatStatus/index.d.ts.map +1 -1
- package/dist/types/src/components/ChatStatusIndicator/ChatStatusIndicator.d.ts +3 -3
- package/dist/types/src/components/ChatStatusIndicator/ChatStatusIndicator.d.ts.map +1 -1
- package/dist/types/src/components/ChatStatusIndicator/ChatStatusIndicator.stories.d.ts +18 -0
- package/dist/types/src/components/ChatStatusIndicator/ChatStatusIndicator.stories.d.ts.map +1 -0
- package/dist/types/src/components/ChatStatusIndicator/index.d.ts +1 -1
- package/dist/types/src/components/ChatStatusIndicator/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -21
- package/src/components/ChatDialog/ChatDialog.stories.tsx +10 -7
- package/src/components/ChatDialog/ChatDialog.tsx +32 -30
- package/src/components/ChatDialog/index.ts +1 -1
- package/src/components/ChatEditor/ChatEditor.stories.tsx +6 -6
- package/src/components/ChatEditor/ChatEditor.tsx +4 -4
- package/src/components/ChatEditor/commands.test.ts +1 -1
- package/src/components/ChatEditor/commands.ts +3 -2
- package/src/components/ChatEditor/index.ts +4 -4
- package/src/components/ChatEditor/useChatExtensions.ts +6 -5
- package/src/components/ChatStatus/ChatStatus.stories.tsx +7 -6
- package/src/components/ChatStatus/ChatStatus.tsx +11 -10
- package/src/components/ChatStatus/ChatStatusContext.ts +2 -3
- package/src/components/ChatStatus/format.test.ts +1 -1
- package/src/components/ChatStatus/index.ts +3 -3
- package/src/components/ChatStatusIndicator/ChatStatusIndicator.stories.tsx +47 -0
- package/src/components/ChatStatusIndicator/ChatStatusIndicator.tsx +15 -11
- package/src/components/ChatStatusIndicator/index.ts +1 -1
- package/src/components/index.ts +4 -4
- package/src/index.ts +1 -1
- package/src/translations.ts +2 -2
package/dist/lib/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { createContext } from "@radix-ui/react-context";
|
|
2
1
|
import { forwardRef, useEffect, useImperativeHandle, useMemo, useState } from "react";
|
|
3
|
-
import { Dialog, Icon, IconButton, Tooltip, useControlledState, useThemeContext, useTimeout } from "@dxos/react-ui";
|
|
4
2
|
import { ResizeHandle, resizeAttributes, sizeStyle } from "@dxos/react-ui-dnd";
|
|
3
|
+
import * as Button from "@dxos/react-ui/Button";
|
|
4
|
+
import * as Dialog from "@dxos/react-ui/Dialog";
|
|
5
|
+
import * as Hooks from "@dxos/react-ui/Hooks";
|
|
6
|
+
import * as Icon$1 from "@dxos/react-ui/Icon";
|
|
5
7
|
import { mx } from "@dxos/ui-theme";
|
|
6
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
9
|
import { acceptCompletion, autocompletion, completionKeymap, completionStatus, currentCompletions, selectedCompletionIndex, setSelectedCompletion } from "@codemirror/autocomplete";
|
|
@@ -12,20 +14,20 @@ import { invariant } from "@dxos/invariant";
|
|
|
12
14
|
import { createBasicExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown, formattingKeymap, submit, xmlFormatting } from "@dxos/ui-editor";
|
|
13
15
|
import { isTruthy } from "@dxos/util";
|
|
14
16
|
import { Editor } from "@dxos/react-ui-editor";
|
|
15
|
-
import {
|
|
17
|
+
import { ShapeSpinner } from "@dxos/react-ui-components";
|
|
18
|
+
import * as Tooltip from "@dxos/react-ui/Tooltip";
|
|
16
19
|
//#region src/components/ChatDialog/ChatDialog.tsx
|
|
17
|
-
var preventDefault = (event) => event.preventDefault();
|
|
18
20
|
var Endcap = ({ children }) => {
|
|
19
21
|
return /* @__PURE__ */ jsx("div", {
|
|
20
22
|
className: "grid w-[var(--dx-rail-action)] h-[var(--dx-rail-action)] items-center justify-center",
|
|
21
23
|
children
|
|
22
24
|
});
|
|
23
25
|
};
|
|
24
|
-
var [ChatDialogContextProvider, useChatDialogContext] = createContext("ChatDialog");
|
|
26
|
+
var [ChatDialogContextProvider, useChatDialogContext] = Hooks.createContext("ChatDialog");
|
|
25
27
|
var ChatDialogRoot = ({ children, open: openProp = false, expanded: expandedProp = false, onOpenChange, onExpandedChange, onEscape }) => {
|
|
26
28
|
const [size, setSize] = useState("min-content");
|
|
27
|
-
const [open, setOpen] = useControlledState(openProp, onOpenChange);
|
|
28
|
-
const [expanded, setExpanded] = useControlledState(expandedProp, onExpandedChange);
|
|
29
|
+
const [open, setOpen] = Hooks.useControlledState(openProp, onOpenChange);
|
|
30
|
+
const [expanded, setExpanded] = Hooks.useControlledState(expandedProp, onExpandedChange);
|
|
29
31
|
return /* @__PURE__ */ jsx(ChatDialogContextProvider, {
|
|
30
32
|
open,
|
|
31
33
|
setOpen,
|
|
@@ -36,18 +38,15 @@ var ChatDialogRoot = ({ children, open: openProp = false, expanded: expandedProp
|
|
|
36
38
|
children: /* @__PURE__ */ jsx(Dialog.Root, {
|
|
37
39
|
modal: false,
|
|
38
40
|
open,
|
|
39
|
-
onOpenChange: setOpen,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
onInteractOutside: preventDefault,
|
|
49
|
-
children
|
|
50
|
-
})
|
|
41
|
+
onOpenChange: ({ open }) => setOpen(open),
|
|
42
|
+
onEscapeKeyDown: onEscape,
|
|
43
|
+
onInteractOutside: (event) => event.preventDefault(),
|
|
44
|
+
children: /* @__PURE__ */ jsx(Dialog.Content, {
|
|
45
|
+
size: "md",
|
|
46
|
+
placement: "end",
|
|
47
|
+
scrim: false,
|
|
48
|
+
classNames: "grid grid-rows-[var(--dx-rail-action)_1fr_min-content] p-0 overflow-hidden box-content",
|
|
49
|
+
children
|
|
51
50
|
})
|
|
52
51
|
})
|
|
53
52
|
});
|
|
@@ -59,13 +58,13 @@ var ChatDialogHeader = ({ classNames, title }) => {
|
|
|
59
58
|
return /* @__PURE__ */ jsxs("div", {
|
|
60
59
|
className: mx("grid grid-cols-[var(--dx-rail-action)_1fr_min-content] items-center overflow-hidden", classNames),
|
|
61
60
|
children: [
|
|
62
|
-
/* @__PURE__ */ jsx(Endcap, { children: /* @__PURE__ */ jsx(Dialog.
|
|
61
|
+
/* @__PURE__ */ jsx(Endcap, { children: /* @__PURE__ */ jsx(Dialog.CloseTrigger, { children: /* @__PURE__ */ jsx(Icon$1.Icon, { icon: "ph--x--regular" }) }) }),
|
|
63
62
|
/* @__PURE__ */ jsx(Dialog.Title, {
|
|
64
|
-
classNames: "flex w-full justify-center text-sm text-
|
|
63
|
+
classNames: "flex w-full justify-center text-sm text-fg-subtle select-none cursor-pointer",
|
|
65
64
|
onClick: () => setExpanded((expanded) => !expanded),
|
|
66
65
|
children: title
|
|
67
66
|
}),
|
|
68
|
-
/* @__PURE__ */ jsx(Endcap, { children: /* @__PURE__ */ jsx(
|
|
67
|
+
/* @__PURE__ */ jsx(Endcap, { children: /* @__PURE__ */ jsx(Button.Root, {
|
|
69
68
|
variant: "ghost",
|
|
70
69
|
icon: "ph--caret-up--regular",
|
|
71
70
|
iconOnly: true,
|
|
@@ -84,7 +83,7 @@ var ChatDialogContent = ({ children, classNames }) => {
|
|
|
84
83
|
setSize(expanded ? "min-content" : 0);
|
|
85
84
|
}, [expanded]);
|
|
86
85
|
return /* @__PURE__ */ jsxs("div", {
|
|
87
|
-
className: mx("border-t border-b border-
|
|
86
|
+
className: mx("border-t border-b border-separator-subtle", "transition ease-in-out duration-0 [&:not([data-dx-resizing=\"true\"])]:duration-200", classNames),
|
|
88
87
|
style: {
|
|
89
88
|
...sizeStyle(size, "vertical", true),
|
|
90
89
|
maxBlockSize: "calc(100dvh - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 14rem)"
|
|
@@ -124,7 +123,7 @@ var matchCommands = (all, token) => token.startsWith("$") || token.startsWith("/
|
|
|
124
123
|
* typing `/` at the start of the prompt offers registered slash commands.
|
|
125
124
|
*/
|
|
126
125
|
var commandMark = Decoration.mark({
|
|
127
|
-
class: "dx-tag",
|
|
126
|
+
class: "dx-tag dx-tag-inline mx-0.5",
|
|
128
127
|
attributes: {
|
|
129
128
|
"data-hue": "blue",
|
|
130
129
|
"style": "margin-block: -5px;",
|
|
@@ -321,7 +320,8 @@ var ReferenceWidget = class extends WidgetType {
|
|
|
321
320
|
//#endregion
|
|
322
321
|
//#region src/components/ChatEditor/useChatExtensions.ts
|
|
323
322
|
var useChatExtensions = ({ extensions, markdown = false, lineWrapping = false, placeholder, onSubmit }) => {
|
|
324
|
-
const
|
|
323
|
+
const themeMode = Hooks.useThemeMode();
|
|
324
|
+
const onSubmitRef = Hooks.useDynamicRef(onSubmit);
|
|
325
325
|
return useMemo(() => [
|
|
326
326
|
createThemeExtensions({
|
|
327
327
|
themeMode,
|
|
@@ -339,14 +339,14 @@ var useChatExtensions = ({ extensions, markdown = false, lineWrapping = false, p
|
|
|
339
339
|
formattingKeymap()
|
|
340
340
|
],
|
|
341
341
|
extensions,
|
|
342
|
-
submit({ onSubmit })
|
|
342
|
+
submit({ onSubmit: (text) => onSubmitRef.current?.(text) })
|
|
343
343
|
].flat().filter(isTruthy), [
|
|
344
344
|
themeMode,
|
|
345
345
|
markdown,
|
|
346
346
|
lineWrapping,
|
|
347
347
|
placeholder,
|
|
348
348
|
extensions,
|
|
349
|
-
|
|
349
|
+
onSubmitRef
|
|
350
350
|
]);
|
|
351
351
|
};
|
|
352
352
|
//#endregion
|
|
@@ -370,7 +370,7 @@ var ChatEditor = forwardRef(({ classNames, autoFocus, extensions: extensionsProp
|
|
|
370
370
|
});
|
|
371
371
|
//#endregion
|
|
372
372
|
//#region src/components/ChatStatus/ChatStatusContext.ts
|
|
373
|
-
var [ChatStatusProvider, useChatStatusContext] = createContext("ChatStatus");
|
|
373
|
+
var [ChatStatusProvider, useChatStatusContext] = Hooks.createContext("ChatStatus");
|
|
374
374
|
//#endregion
|
|
375
375
|
//#region src/components/ChatStatus/format.ts
|
|
376
376
|
var SECOND = 1e3;
|
|
@@ -412,7 +412,7 @@ var Root = forwardRef(({ classNames, children, defaultRunning = true }, forwarde
|
|
|
412
412
|
elapsed,
|
|
413
413
|
running,
|
|
414
414
|
children: /* @__PURE__ */ jsx("span", {
|
|
415
|
-
className: mx("inline-flex items-center gap-2 text-
|
|
415
|
+
className: mx("inline-flex items-center gap-2 text-fg-muted font-mono tabular-nums", classNames),
|
|
416
416
|
children
|
|
417
417
|
})
|
|
418
418
|
});
|
|
@@ -421,11 +421,11 @@ Root.displayName = "ChatChatStatus.Root";
|
|
|
421
421
|
/**
|
|
422
422
|
* Animated leading indicator. Defaults to a halo-pulse dot. Pass children to override.
|
|
423
423
|
*/
|
|
424
|
-
var Icon
|
|
424
|
+
var Icon = ({ classNames, children }) => {
|
|
425
425
|
if (children !== void 0) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
426
426
|
return /* @__PURE__ */ jsx("span", {
|
|
427
427
|
"aria-hidden": "true",
|
|
428
|
-
className: mx("inline-block size-2 rounded-full bg-current animate-
|
|
428
|
+
className: mx("inline-block size-2 rounded-full bg-current text-info-text animate-pulse", classNames)
|
|
429
429
|
});
|
|
430
430
|
};
|
|
431
431
|
/**
|
|
@@ -458,30 +458,30 @@ var Text = ({ classNames, children }) => /* @__PURE__ */ jsx("span", {
|
|
|
458
458
|
});
|
|
459
459
|
var ChatStatus = {
|
|
460
460
|
Root,
|
|
461
|
-
Icon
|
|
461
|
+
Icon,
|
|
462
462
|
Stopwatch,
|
|
463
463
|
Separator,
|
|
464
464
|
Text
|
|
465
465
|
};
|
|
466
466
|
//#endregion
|
|
467
467
|
//#region src/components/ChatStatusIndicator/ChatStatusIndicator.tsx
|
|
468
|
-
var
|
|
468
|
+
var ANIMATION_PERIOD = 3e3;
|
|
469
469
|
var ChatStatusIndicator = ({ classNames, preset, processing, error, ...props }) => {
|
|
470
470
|
const [init, setInit] = useState(false);
|
|
471
471
|
useEffect(() => setInit(false), [preset]);
|
|
472
|
-
useTimeout(async () => {
|
|
472
|
+
Hooks.useTimeout(async () => {
|
|
473
473
|
setInit(true);
|
|
474
|
-
},
|
|
474
|
+
}, ANIMATION_PERIOD / 2, [preset]);
|
|
475
475
|
return /* @__PURE__ */ jsxs("div", {
|
|
476
476
|
className: mx("relative flex", classNames),
|
|
477
|
-
children: [/* @__PURE__ */ jsx(
|
|
478
|
-
duration:
|
|
479
|
-
state: !init ? "
|
|
477
|
+
children: [/* @__PURE__ */ jsx(ShapeSpinner, {
|
|
478
|
+
duration: ANIMATION_PERIOD,
|
|
479
|
+
state: !init ? "alert" : error ? "error" : processing ? "thinking" : "ready",
|
|
480
480
|
...props
|
|
481
481
|
}), error && /* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
482
482
|
asChild: true,
|
|
483
483
|
content: error.message,
|
|
484
|
-
children: /* @__PURE__ */ jsx("div", { className: "
|
|
484
|
+
children: /* @__PURE__ */ jsx("div", { className: "dx-cover" })
|
|
485
485
|
})]
|
|
486
486
|
});
|
|
487
487
|
};
|
package/dist/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/components/ChatDialog/ChatDialog.tsx","../../src/components/ChatEditor/commands.ts","../../src/components/ChatEditor/references.ts","../../src/components/ChatEditor/useChatExtensions.ts","../../src/components/ChatEditor/ChatEditor.tsx","../../src/components/ChatStatus/ChatStatusContext.ts","../../src/components/ChatStatus/format.ts","../../src/components/ChatStatus/ChatStatus.tsx","../../src/components/ChatStatusIndicator/ChatStatusIndicator.tsx"],"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 2026 DXOS.org\n//\n\nimport {\n type CompletionContext,\n type CompletionResult,\n acceptCompletion,\n autocompletion,\n completionStatus,\n currentCompletions,\n selectedCompletionIndex,\n setSelectedCompletion,\n} from '@codemirror/autocomplete';\nimport { type Extension, Prec } from '@codemirror/state';\nimport { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate, keymap } from '@codemirror/view';\n\nexport type CommandData = { sentinel: string; description?: string };\n\n/** Pure prefix matcher, exported for tests. */\nexport const matchCommands = (all: CommandData[], token: string): CommandData[] =>\n token.startsWith('$') || token.startsWith('/') ? all.filter(({ sentinel }) => sentinel.startsWith(token)) : [];\n\nexport type CommandsOptions = { getCommands: () => CommandData[] };\n\n/**\n * Command completion: typing `$` offers the bound context's instruction sentinels anywhere;\n * typing `/` at the start of the prompt offers registered slash commands.\n */\nconst commandMark = Decoration.mark({\n class: 'dx-tag',\n // Baseline alignment puts the pill's text on the line's baseline; the negative block margin\n // cancels the padded pill's line-box growth (same recipe as `.dx-tag--anchor` in CodeMirror).\n attributes: {\n 'data-hue': 'blue',\n 'style': 'margin-block: -5px;',\n 'font-family': 'var(--dx-font-mono, monospace)',\n },\n});\n\n/** Decorates a prompt-leading registered command token as a tag. */\nconst commandDecorations = (getCommands: () => CommandData[]) => {\n const build = (view: EditorView): DecorationSet => {\n const match = /^[$/][\\w:-]+/.exec(view.state.doc.line(1).text);\n return match && getCommands().some(({ sentinel }) => sentinel === match[0])\n ? Decoration.set([commandMark.range(0, match[0].length)])\n : Decoration.none;\n };\n return ViewPlugin.fromClass(\n class {\n decorations: DecorationSet;\n constructor(view: EditorView) {\n this.decorations = build(view);\n }\n update(update: ViewUpdate) {\n if (update.docChanged) {\n this.decorations = build(update.view);\n }\n }\n },\n {\n decorations: (instance) => instance.decorations,\n // Atomic: the cursor steps over the tag as one unit and backspace removes it whole.\n provide: (plugin) => EditorView.atomicRanges.of((view) => view.plugin(plugin)?.decorations ?? Decoration.none),\n },\n );\n};\n\n/** Two-column command/description layout; shared column widths via subgrid. */\nconst commandTooltipTheme = EditorView.theme({\n '.cm-tooltip-autocomplete > ul': {\n display: 'grid',\n gridTemplateColumns: 'max-content 1fr',\n columnGap: '0.75rem',\n },\n '.cm-tooltip-autocomplete > ul > li': {\n display: 'grid',\n gridTemplateColumns: 'subgrid',\n gridColumn: 'span 2',\n alignItems: 'center',\n },\n '.cm-tooltip-autocomplete .cm-completionLabel': {\n fontFamily: 'var(--dx-font-mono, monospace)',\n },\n '.cm-tooltip-autocomplete .cm-completionDetail': {\n fontStyle: 'normal',\n fontSize: '0.875rem',\n marginInlineStart: '0',\n },\n});\n\nexport const commands = ({ getCommands }: CommandsOptions): Extension => [\n commandTooltipTheme,\n commandDecorations(getCommands),\n autocompletion({\n // The prompt sits at the bottom of its panel, so the list opens upward.\n aboveCursor: true,\n override: [\n (context: CompletionContext): CompletionResult | null => {\n const word = context.matchBefore(/[$/][\\w:-]*/);\n if (!word || (word.from === word.to && !context.explicit)) {\n return null;\n }\n // Slash commands are prompt-leading only, so a mid-sentence path fragment never completes.\n if (context.state.sliceDoc(word.from, word.from + 1) === '/' && word.from !== 0) {\n return null;\n }\n const options = matchCommands(getCommands(), context.state.sliceDoc(word.from, word.to));\n if (options.length === 0) {\n return null;\n }\n return {\n from: word.from,\n // Accepting appends the separator space, so the arguments can be typed immediately.\n options: options.map(({ sentinel, description }) => ({\n label: sentinel,\n detail: description,\n apply: `${sentinel} `,\n })),\n };\n },\n ],\n }),\n // Arrow navigation stops at the ends of the list rather than cycling.\n Prec.highest(\n keymap.of([\n {\n key: 'ArrowDown',\n run: (view) => {\n if (completionStatus(view.state) !== 'active') {\n return false;\n }\n const index = selectedCompletionIndex(view.state);\n if (index === null) {\n return false;\n }\n if (index < currentCompletions(view.state).length - 1) {\n view.dispatch({ effects: setSelectedCompletion(index + 1) });\n }\n return true;\n },\n },\n {\n key: 'ArrowUp',\n run: (view) => {\n if (completionStatus(view.state) !== 'active') {\n return false;\n }\n const index = selectedCompletionIndex(view.state);\n if (index === null) {\n return false;\n }\n if (index > 0) {\n view.dispatch({ effects: setSelectedCompletion(index - 1) });\n }\n return true;\n },\n },\n ]),\n ),\n // The host editor's `submit()` extension also binds Enter at `Prec.highest`; ties between equal\n // precedences break by extension order, so the caller must place this extension ahead of `submit()`.\n // `completionStatus`/`acceptCompletion` are imported from the same module as `autocompletion()` above\n // (not re-derived in a different package) so this always reads the completion state `autocompletion()`\n // actually wrote — a cross-package import of the same-named API can resolve to a distinct bundled\n // copy of `@codemirror/autocomplete` under some bundler configurations, silently reading `null`.\n Prec.highest(\n keymap.of([\n {\n key: 'Enter',\n run: (view) => (completionStatus(view.state) === 'active' ? acceptCompletion(view) : false),\n },\n ]),\n ),\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 { useMemo } from 'react';\n\nimport { useThemeContext } from '@dxos/react-ui';\nimport {\n createBasicExtensions,\n createMarkdownExtensions,\n createThemeExtensions,\n decorateMarkdown,\n formattingKeymap,\n submit,\n xmlFormatting,\n} from '@dxos/ui-editor';\nimport { isTruthy } from '@dxos/util';\n\nimport { type ChatEditorProps } from './ChatEditor';\n\n// Kept out of `ChatEditor.tsx`: react-refresh only fast-refreshes a module whose\n// exports are all components, so values exported beside them force a full page reload on\n// every edit.\n\nexport const useChatExtensions = ({\n extensions,\n markdown = false,\n lineWrapping = false,\n placeholder,\n onSubmit,\n}: ChatEditorProps) => {\n const { themeMode } = useThemeContext();\n return useMemo<Extension[]>(\n () =>\n [\n createThemeExtensions({ themeMode, syntaxHighlighting: markdown }),\n createBasicExtensions({ bracketMatching: false, lineWrapping, placeholder }),\n xmlFormatting(),\n markdown && [createMarkdownExtensions(), decorateMarkdown(), formattingKeymap()],\n // Caller extensions (e.g. `commands()`'s completion-aware Enter binding) must precede\n // `submit()`: both bind Enter at `Prec.highest`, and CodeMirror breaks precedence ties by\n // extension order, so listing `submit()` first would always win and swallow the keystroke.\n extensions,\n submit({ onSubmit }),\n ]\n .flat()\n .filter(isTruthy),\n [themeMode, markdown, lineWrapping, placeholder, extensions, onSubmit],\n );\n};\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Extension } from '@codemirror/state';\nimport React, { forwardRef } from 'react';\n\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { Editor, type EditorController, type UseTextEditorProps } from '@dxos/react-ui-editor';\nimport { type BasicExtensionsOptions, type SubmitOptions } from '@dxos/ui-editor';\n\nimport { type ReferencesOptions } from './references';\nimport { useChatExtensions } from './useChatExtensions';\n\nexport interface ChatEditorController extends EditorController {}\n\nexport type ChatEditorProps = ThemedClassName<\n {\n extensions?: Extension;\n references?: ReferencesOptions;\n /** Enable inline markdown formatting (decoration, syntax highlighting, and formatting shortcuts). */\n markdown?: boolean;\n } & (SubmitOptions &\n Pick<UseTextEditorProps, 'id' | 'autoFocus'> &\n Pick<BasicExtensionsOptions, 'lineWrapping' | 'placeholder'>)\n>;\n\nexport const ChatEditor = forwardRef<ChatEditorController, ChatEditorProps>(\n (\n {\n classNames,\n autoFocus,\n extensions: extensionsProp,\n markdown = false,\n lineWrapping = false,\n placeholder,\n onSubmit,\n },\n forwardRef,\n ) => {\n const extensions = useChatExtensions({ extensions: extensionsProp, markdown, 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';\n\n// Kept out of `ChatStatus.tsx`: react-refresh only fast-refreshes a module whose exports are all\n// components, so a context and its hook exported beside them force a full page reload on every edit.\n\n//\n// Context\n//\n\nexport type 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\nexport const [ChatStatusProvider, useChatStatusContext] = createContext<ChatStatusContextValue>('ChatStatus');\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","//\n// Copyright 2025 DXOS.org\n//\n\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 { ChatStatusProvider, useChatStatusContext } from './ChatStatusContext';\nimport { formatElapsed } from './format';\n\nconst TICK_MS = 1_000;\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\nimport React, { useEffect, useState } from 'react';\n\nimport { type ThemedClassName, Tooltip, useTimeout } from '@dxos/react-ui';\n// Leaf import (not the package barrel): the barrel re-exports QueryEditor/QueryForm, which pull the\n// heavy @dxos/ai + @dxos/echo-query stack (tiktoken wasm, etc.) — inappropriate for lean consumers\n// like the browser extension. Importing the Spinner leaf keeps that graph out.\nimport { Spinner, type SpinnerProps } from '@dxos/react-ui-components/Spinner';\nimport { mx } from '@dxos/ui-theme';\n\nconst period = 3_000;\n\nexport type ChatStatusIndicatorProps = ThemedClassName<\n {\n preset?: string;\n processing?: boolean;\n error?: Error;\n } & Pick<SpinnerProps, 'size' | 'onClick'>\n>;\n\nexport const ChatStatusIndicator = ({ classNames, preset, processing, error, ...props }: ChatStatusIndicatorProps) => {\n const [init, setInit] = useState(false);\n useEffect(() => setInit(false), [preset]);\n useTimeout(\n async () => {\n setInit(true);\n },\n period / 2,\n [preset],\n );\n\n return (\n <div className={mx('relative flex', classNames)}>\n <Spinner duration={period} state={!init ? 'flash' : error ? 'error' : processing ? 'spin' : 'pulse'} {...props} />\n {error && (\n <Tooltip.Trigger asChild content={error.message}>\n <div className='absolute inset-0' />\n </Tooltip.Trigger>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAWA,IAAM,kBAAkB,UAAiB,MAAM,eAAe;AAG9D,IAAM,UAAU,EAAE,eAAkC;CAClD,OACE,oBAAC,OAAD;EAAK,WAAU;EACZ;CACE,CAAA;AAET;AAeA,IAAM,CAAC,2BAA2B,wBAAwB,cAAsC,YAAY;AAc5G,IAAM,kBAAkB,EACtB,UACA,MAAM,WAAW,OACjB,UAAU,eAAe,OACzB,cACA,kBACA,eACyB;CACzB,MAAM,CAAC,MAAM,WAAW,SAAe,aAAa;CACpD,MAAM,CAAC,MAAM,WAAW,mBAA4B,UAAU,YAAY;CAC1E,MAAM,CAAC,UAAU,eAAe,mBAA4B,cAAc,gBAAgB;CAI1F,OACE,oBAAC,2BAAD;EACQ;EACG;EACC;EACG;EACP;EACG;EAET,UAAA,oBAAC,OAAO,MAAR;GAAa,OAAO;GAAa;GAAM,cAAc;GACnD,UAAA,oBAAC,OAAD;IAAK,WAAU;IAAwD,oBAAiB;IACtF,UAAA,oBAAC,OAAO,SAAR;KACE,MAAK;KACL,iBAAA;KACA,YAAY,CACV,4GACF;KACA,iBAAiB;KACjB,mBAAmB;KAElB;IACa,CAAA;GACb,CAAA;EACM,CAAA;CACY,CAAA;AAE/B;AAEA,eAAe,cAAc;AAM7B,IAAM,0BAA0B;AAMhC,IAAM,oBAAoB,EAAE,YAAY,YAAmC;CACzE,MAAM,EAAE,UAAU,gBAAgB,qBAAqB,uBAAuB;CAE9E,OACE,qBAAC,OAAD;EACE,WAAW,GAAG,uFAAuF,UAAU;EADjH,UAAA;GAGE,oBAAC,QAAD,EAAA,UACE,oBAAC,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M,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,gBAAgB,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC;CACxC,WACE,YAAY;EACV,QAAQ,IAAI;CACd,GACA,SAAS,GACT,CAAC,MAAM,CACT;CAEA,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,iBAAiB,UAAU;EAA9C,UAAA,CACE,oBAAC,SAAD;GAAS,UAAU;GAAQ,OAAO,CAAC,OAAO,UAAU,QAAQ,UAAU,aAAa,SAAS;GAAS,GAAI;EAAQ,CAAA,GAChH,SACC,oBAAC,QAAQ,SAAT;GAAiB,SAAA;GAAQ,SAAS,MAAM;GACtC,UAAA,oBAAC,OAAD,EAAK,WAAU,mBAAoB,CAAA;EACpB,CAAA,CAEhB;;AAET"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/components/ChatDialog/ChatDialog.tsx","../../src/components/ChatEditor/commands.ts","../../src/components/ChatEditor/references.ts","../../src/components/ChatEditor/useChatExtensions.ts","../../src/components/ChatEditor/ChatEditor.tsx","../../src/components/ChatStatus/ChatStatusContext.ts","../../src/components/ChatStatus/format.ts","../../src/components/ChatStatus/ChatStatus.tsx","../../src/components/ChatStatusIndicator/ChatStatusIndicator.tsx"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type Dispatch, type PropsWithChildren, type SetStateAction, useEffect, useState } from 'react';\n\nimport { ResizeHandle, type Size, resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';\nimport * as Button from '@dxos/react-ui/Button';\nimport * as Dialog from '@dxos/react-ui/Dialog';\nimport * as Hooks from '@dxos/react-ui/Hooks';\nimport * as Icon from '@dxos/react-ui/Icon';\nimport type * as Util from '@dxos/react-ui/Util';\nimport { mx } from '@dxos/ui-theme';\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] = Hooks.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] = Hooks.useControlledState<boolean>(openProp, onOpenChange);\n const [expanded, setExpanded] = Hooks.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\n modal={false}\n open={open}\n onOpenChange={({ open }) => setOpen(open)}\n onEscapeKeyDown={onEscape}\n onInteractOutside={(event) => event.preventDefault()}\n >\n <Dialog.Content\n size='md'\n placement='end'\n scrim={false}\n classNames='grid grid-rows-[var(--dx-rail-action)_1fr_min-content] p-0 overflow-hidden box-content'\n >\n {children}\n </Dialog.Content>\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 = Util.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.CloseTrigger>\n <Icon.Icon icon='ph--x--regular' />\n </Dialog.CloseTrigger>\n </Endcap>\n <Dialog.Title\n classNames='flex w-full justify-center text-sm text-fg-subtle select-none cursor-pointer'\n onClick={() => setExpanded((expanded) => !expanded)}\n >\n {title}\n </Dialog.Title>\n <Endcap>\n <Button.Root\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 = Util.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-separator-subtle',\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 = Util.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 2026 DXOS.org\n//\n\nimport {\n type CompletionContext,\n type CompletionResult,\n acceptCompletion,\n autocompletion,\n completionStatus,\n currentCompletions,\n selectedCompletionIndex,\n setSelectedCompletion,\n} from '@codemirror/autocomplete';\nimport { type Extension, Prec } from '@codemirror/state';\nimport { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate, keymap } from '@codemirror/view';\n\nexport type CommandData = { sentinel: string; description?: string };\n\n/** Pure prefix matcher, exported for tests. */\nexport const matchCommands = (all: CommandData[], token: string): CommandData[] =>\n token.startsWith('$') || token.startsWith('/') ? all.filter(({ sentinel }) => sentinel.startsWith(token)) : [];\n\nexport type CommandsOptions = { getCommands: () => CommandData[] };\n\n/**\n * Command completion: typing `$` offers the bound context's instruction sentinels anywhere;\n * typing `/` at the start of the prompt offers registered slash commands.\n */\nconst commandMark = Decoration.mark({\n // Inline in text, so the pill keeps its own inset from the words either side.\n class: 'dx-tag dx-tag-inline mx-0.5',\n // Baseline alignment puts the pill's text on the line's baseline; the negative block margin\n // cancels the padded pill's line-box growth (same recipe as `.dx-tag-anchor` in CodeMirror).\n attributes: {\n 'data-hue': 'blue',\n 'style': 'margin-block: -5px;',\n 'font-family': 'var(--dx-font-mono, monospace)',\n },\n});\n\n/** Decorates a prompt-leading registered command token as a tag. */\nconst commandDecorations = (getCommands: () => CommandData[]) => {\n const build = (view: EditorView): DecorationSet => {\n const match = /^[$/][\\w:-]+/.exec(view.state.doc.line(1).text);\n return match && getCommands().some(({ sentinel }) => sentinel === match[0])\n ? Decoration.set([commandMark.range(0, match[0].length)])\n : Decoration.none;\n };\n return ViewPlugin.fromClass(\n class {\n decorations: DecorationSet;\n constructor(view: EditorView) {\n this.decorations = build(view);\n }\n update(update: ViewUpdate) {\n if (update.docChanged) {\n this.decorations = build(update.view);\n }\n }\n },\n {\n decorations: (instance) => instance.decorations,\n // Atomic: the cursor steps over the tag as one unit and backspace removes it whole.\n provide: (plugin) => EditorView.atomicRanges.of((view) => view.plugin(plugin)?.decorations ?? Decoration.none),\n },\n );\n};\n\n/** Two-column command/description layout; shared column widths via subgrid. */\nconst commandTooltipTheme = EditorView.theme({\n '.cm-tooltip-autocomplete > ul': {\n display: 'grid',\n gridTemplateColumns: 'max-content 1fr',\n columnGap: '0.75rem',\n },\n '.cm-tooltip-autocomplete > ul > li': {\n display: 'grid',\n gridTemplateColumns: 'subgrid',\n gridColumn: 'span 2',\n alignItems: 'center',\n },\n '.cm-tooltip-autocomplete .cm-completionLabel': {\n fontFamily: 'var(--dx-font-mono, monospace)',\n },\n '.cm-tooltip-autocomplete .cm-completionDetail': {\n fontStyle: 'normal',\n fontSize: '0.875rem',\n marginInlineStart: '0',\n },\n});\n\nexport const commands = ({ getCommands }: CommandsOptions): Extension => [\n commandTooltipTheme,\n commandDecorations(getCommands),\n autocompletion({\n // The prompt sits at the bottom of its panel, so the list opens upward.\n aboveCursor: true,\n override: [\n (context: CompletionContext): CompletionResult | null => {\n const word = context.matchBefore(/[$/][\\w:-]*/);\n if (!word || (word.from === word.to && !context.explicit)) {\n return null;\n }\n // Slash commands are prompt-leading only, so a mid-sentence path fragment never completes.\n if (context.state.sliceDoc(word.from, word.from + 1) === '/' && word.from !== 0) {\n return null;\n }\n const options = matchCommands(getCommands(), context.state.sliceDoc(word.from, word.to));\n if (options.length === 0) {\n return null;\n }\n return {\n from: word.from,\n // Accepting appends the separator space, so the arguments can be typed immediately.\n options: options.map(({ sentinel, description }) => ({\n label: sentinel,\n detail: description,\n apply: `${sentinel} `,\n })),\n };\n },\n ],\n }),\n // Arrow navigation stops at the ends of the list rather than cycling.\n Prec.highest(\n keymap.of([\n {\n key: 'ArrowDown',\n run: (view) => {\n if (completionStatus(view.state) !== 'active') {\n return false;\n }\n const index = selectedCompletionIndex(view.state);\n if (index === null) {\n return false;\n }\n if (index < currentCompletions(view.state).length - 1) {\n view.dispatch({ effects: setSelectedCompletion(index + 1) });\n }\n return true;\n },\n },\n {\n key: 'ArrowUp',\n run: (view) => {\n if (completionStatus(view.state) !== 'active') {\n return false;\n }\n const index = selectedCompletionIndex(view.state);\n if (index === null) {\n return false;\n }\n if (index > 0) {\n view.dispatch({ effects: setSelectedCompletion(index - 1) });\n }\n return true;\n },\n },\n ]),\n ),\n // The host editor's `submit()` extension also binds Enter at `Prec.highest`; ties between equal\n // precedences break by extension order, so the caller must place this extension ahead of `submit()`.\n // `completionStatus`/`acceptCompletion` are imported from the same module as `autocompletion()` above\n // (not re-derived in a different package) so this always reads the completion state `autocompletion()`\n // actually wrote — a cross-package import of the same-named API can resolve to a distinct bundled\n // copy of `@codemirror/autocomplete` under some bundler configurations, silently reading `null`.\n Prec.highest(\n keymap.of([\n {\n key: 'Enter',\n run: (view) => (completionStatus(view.state) === 'active' ? acceptCompletion(view) : false),\n },\n ]),\n ),\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 { useMemo } from 'react';\n\nimport * as Hooks from '@dxos/react-ui/Hooks';\nimport {\n createBasicExtensions,\n createMarkdownExtensions,\n createThemeExtensions,\n decorateMarkdown,\n formattingKeymap,\n submit,\n xmlFormatting,\n} from '@dxos/ui-editor';\nimport { isTruthy } from '@dxos/util';\n\nimport { type ChatEditorProps } from './ChatEditor.tsx';\n\n// Kept out of `ChatEditor.tsx`: react-refresh only fast-refreshes a module whose\n// exports are all components, so values exported beside them force a full page reload on\n// every edit.\n\nexport const useChatExtensions = ({\n extensions,\n markdown = false,\n lineWrapping = false,\n placeholder,\n onSubmit,\n}: ChatEditorProps) => {\n const themeMode = Hooks.useThemeMode();\n const onSubmitRef = Hooks.useDynamicRef(onSubmit);\n return useMemo<Extension[]>(\n () =>\n [\n createThemeExtensions({ themeMode, syntaxHighlighting: markdown }),\n createBasicExtensions({ bracketMatching: false, lineWrapping, placeholder }),\n xmlFormatting(),\n markdown && [createMarkdownExtensions(), decorateMarkdown(), formattingKeymap()],\n // Caller extensions (e.g. `commands()`'s completion-aware Enter binding) must precede\n // `submit()`: both bind Enter at `Prec.highest`, and CodeMirror breaks precedence ties by\n // extension order, so listing `submit()` first would always win and swallow the keystroke.\n extensions,\n submit({ onSubmit: (text) => onSubmitRef.current?.(text) }),\n ]\n .flat()\n .filter(isTruthy),\n [themeMode, markdown, lineWrapping, placeholder, extensions, onSubmitRef],\n );\n};\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Extension } from '@codemirror/state';\nimport React, { forwardRef } from 'react';\n\nimport { Editor, type EditorController, type UseTextEditorProps } from '@dxos/react-ui-editor';\nimport type * as Util from '@dxos/react-ui/Util';\nimport { type BasicExtensionsOptions, type SubmitOptions } from '@dxos/ui-editor';\n\nimport { type ReferencesOptions } from './references.ts';\nimport { useChatExtensions } from './useChatExtensions.ts';\n\nexport interface ChatEditorController extends EditorController {}\n\nexport type ChatEditorProps = Util.ThemedClassName<\n {\n extensions?: Extension;\n references?: ReferencesOptions;\n /** Enable inline markdown formatting (decoration, syntax highlighting, and formatting shortcuts). */\n markdown?: boolean;\n } & (SubmitOptions &\n Pick<UseTextEditorProps, 'id' | 'autoFocus'> &\n Pick<BasicExtensionsOptions, 'lineWrapping' | 'placeholder'>)\n>;\n\nexport const ChatEditor = forwardRef<ChatEditorController, ChatEditorProps>(\n (\n {\n classNames,\n autoFocus,\n extensions: extensionsProp,\n markdown = false,\n lineWrapping = false,\n placeholder,\n onSubmit,\n },\n forwardRef,\n ) => {\n const extensions = useChatExtensions({ extensions: extensionsProp, markdown, 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","import * as Hooks from '@dxos/react-ui/Hooks';\n//\n// Copyright 2025 DXOS.org\n//\n\n// Kept out of `ChatStatus.tsx`: react-refresh only fast-refreshes a module whose exports are all\n// components, so a context and its hook exported beside them force a full page reload on every edit.\n\n//\n// Context\n//\n\nexport type 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\nexport const [ChatStatusProvider, useChatStatusContext] = Hooks.createContext<ChatStatusContextValue>('ChatStatus');\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","//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type PropsWithChildren, type Ref, forwardRef, useEffect, useImperativeHandle, useState } from 'react';\n\nimport type * as Util from '@dxos/react-ui/Util';\nimport { mx } from '@dxos/ui-theme';\n\nimport { ChatStatusProvider, useChatStatusContext } from './ChatStatusContext.ts';\nimport { formatElapsed } from './format.ts';\n\nconst TICK_MS = 1_000;\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 = Util.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-fg-muted 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 = Util.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\n return (\n <span\n aria-hidden='true'\n className={mx('inline-block size-2 rounded-full bg-current text-info-text animate-pulse', classNames)}\n />\n );\n};\n\n//\n// Stopwatch\n//\n\nexport type StopwatchProps = Util.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 = Util.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 = Util.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\nimport React, { useEffect, useState } from 'react';\n\nimport { ShapeSpinner, type SpinnerProps } from '@dxos/react-ui-components';\nimport * as Hooks from '@dxos/react-ui/Hooks';\nimport * as Tooltip from '@dxos/react-ui/Tooltip';\nimport type * as Util from '@dxos/react-ui/Util';\nimport { mx } from '@dxos/ui-theme';\n\nconst ANIMATION_PERIOD = 3_000;\n\nexport type ChatStatusIndicatorProps = Util.ThemedClassName<\n {\n // TODO(burdon): Preset (model) triggers reset.\n preset?: string;\n processing?: boolean;\n error?: Error;\n } & Pick<SpinnerProps, 'size' | 'onClick'>\n>;\n\nexport const ChatStatusIndicator = ({ classNames, preset, processing, error, ...props }: ChatStatusIndicatorProps) => {\n const [init, setInit] = useState(false);\n useEffect(() => setInit(false), [preset]);\n Hooks.useTimeout(\n async () => {\n setInit(true);\n },\n ANIMATION_PERIOD / 2,\n [preset],\n );\n\n return (\n <div className={mx('relative flex', classNames)}>\n <ShapeSpinner\n duration={ANIMATION_PERIOD}\n state={!init ? 'alert' : error ? 'error' : processing ? 'thinking' : 'ready'}\n {...props}\n />\n {error && (\n <Tooltip.Trigger asChild content={error.message}>\n <div className='dx-cover' />\n </Tooltip.Trigger>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAeA,IAAM,UAAU,EAAE,eAAkC;CAClD,OACE,oBAAC,OAAD;EAAK,WAAU;EACZ;CACE,CAAA;AAET;AAeA,IAAM,CAAC,2BAA2B,wBAAwB,MAAM,cAAsC,YAAY;AAclH,IAAM,kBAAkB,EACtB,UACA,MAAM,WAAW,OACjB,UAAU,eAAe,OACzB,cACA,kBACA,eACyB;CACzB,MAAM,CAAC,MAAM,WAAW,SAAe,aAAa;CACpD,MAAM,CAAC,MAAM,WAAW,MAAM,mBAA4B,UAAU,YAAY;CAChF,MAAM,CAAC,UAAU,eAAe,MAAM,mBAA4B,cAAc,gBAAgB;CAIhG,OACE,oBAAC,2BAAD;EACQ;EACG;EACC;EACG;EACP;EACG;EAET,UAAA,oBAAC,OAAO,MAAR;GACE,OAAO;GACD;GACN,eAAe,EAAE,WAAW,QAAQ,IAAI;GACxC,iBAAiB;GACjB,oBAAoB,UAAU,MAAM,eAAe;GAEnD,UAAA,oBAAC,OAAO,SAAR;IACE,MAAK;IACL,WAAU;IACV,OAAO;IACP,YAAW;IAEV;GACa,CAAA;EACL,CAAA;CACY,CAAA;AAE/B;AAEA,eAAe,cAAc;AAM7B,IAAM,0BAA0B;AAMhC,IAAM,oBAAoB,EAAE,YAAY,YAAmC;CACzE,MAAM,EAAE,UAAU,gBAAgB,qBAAqB,uBAAuB;C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AW,GAAG,UAAU;CAAI;AAAe,CAAA;AAMvG,IAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;AACF;;;AC5JA,IAAM,mBAAmB;AAWzB,IAAa,uBAAuB,EAAE,YAAY,QAAQ,YAAY,OAAO,GAAG,YAAsC;CACpH,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CACtC,gBAAgB,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC;CACxC,MAAM,WACJ,YAAY;EACV,QAAQ,IAAI;CACd,GACA,mBAAmB,GACnB,CAAC,MAAM,CACT;CAEA,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,iBAAiB,UAAU;EAA9C,UAAA,CACE,oBAAC,cAAD;GACE,UAAU;GACV,OAAO,CAAC,OAAO,UAAU,QAAQ,UAAU,aAAa,aAAa;GACrE,GAAI;EACL,CAAA,GACA,SACC,oBAAC,QAAQ,SAAT;GAAiB,SAAA;GAAQ,SAAS,MAAM;GACtC,UAAA,oBAAC,OAAD,EAAK,WAAU,WAAY,CAAA;EACZ,CAAA,CAEhB;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.mjs","names":[],"sources":["../../src/translations.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport
|
|
1
|
+
{"version":3,"file":"translations.mjs","names":[],"sources":["../../src/translations.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport type * as Theme from '@dxos/react-ui/Theme';\n\nexport const translationKey = '@dxos/react-ui-chat';\n\nexport const translations = [\n {\n 'en-US': {\n [translationKey]: {},\n },\n },\n] as const satisfies Theme.Resource[];\n"],"mappings":";AAMA,IAAa,iBAAiB;AAE9B,IAAa,eAAe,CAC1B,EACE,SAAS,GACN,iBAAiB,CAAC,EACrB,EACF,CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import type * as Util from '@dxos/react-ui/Util';
|
|
3
3
|
type ChatDialogRootProps = PropsWithChildren<{
|
|
4
4
|
open?: boolean;
|
|
5
5
|
expanded?: boolean;
|
|
@@ -11,19 +11,19 @@ declare const ChatDialogRoot: {
|
|
|
11
11
|
({ children, open: openProp, expanded: expandedProp, onOpenChange, onExpandedChange, onEscape, }: ChatDialogRootProps): React.JSX.Element;
|
|
12
12
|
displayName: string;
|
|
13
13
|
};
|
|
14
|
-
type ChatDialogHeaderProps = ThemedClassName<{
|
|
14
|
+
type ChatDialogHeaderProps = Util.ThemedClassName<{
|
|
15
15
|
title?: string;
|
|
16
16
|
}>;
|
|
17
17
|
declare const ChatDialogHeader: {
|
|
18
18
|
({ classNames, title }: ChatDialogHeaderProps): React.JSX.Element;
|
|
19
19
|
displayName: string;
|
|
20
20
|
};
|
|
21
|
-
type ChatDialogContentProps = ThemedClassName<PropsWithChildren>;
|
|
21
|
+
type ChatDialogContentProps = Util.ThemedClassName<PropsWithChildren>;
|
|
22
22
|
declare const ChatDialogContent: {
|
|
23
23
|
({ children, classNames }: ChatDialogContentProps): React.JSX.Element;
|
|
24
24
|
displayName: string;
|
|
25
25
|
};
|
|
26
|
-
type ChatDialogFooterProps = ThemedClassName<PropsWithChildren>;
|
|
26
|
+
type ChatDialogFooterProps = Util.ThemedClassName<PropsWithChildren>;
|
|
27
27
|
declare const ChatDialogFooter: {
|
|
28
28
|
({ children, classNames }: ChatDialogFooterProps): React.JSX.Element;
|
|
29
29
|
displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/ChatDialog.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/ChatDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAiB,KAAK,iBAAiB,EAA4C,MAAM,OAAO,CAAC;AAO/G,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAC;AA+BjD,KAAK,mBAAmB,GAAG,iBAAiB,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC,CAAC;AAEH,QAAA,MAAM,cAAc;sGAOjB,mBAAmB;;CAkCrB,CAAC;AAUF,KAAK,qBAAqB,GAAG,IAAI,CAAC,eAAe,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,QAAA,MAAM,gBAAgB;4BAA2B,qBAAqB;;CA8BrE,CAAC;AAUF,KAAK,sBAAsB,GAAG,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAEtE,QAAA,MAAM,iBAAiB;+BAA8B,sBAAsB;;CA8B1E,CAAC;AAUF,KAAK,qBAAqB,GAAG,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAErE,QAAA,MAAM,gBAAgB;+BAA8B,qBAAqB;;CAExE,CAAC;AAQF,eAAO,MAAM,UAAU;IACrB,IAAI;IACJ,MAAM;IACN,OAAO;IACP,MAAM;CACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDialog.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/ChatDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatDialog.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/ChatDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAcxC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC8B,CAAC;eAE1B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './ChatDialog';
|
|
1
|
+
export * from './ChatDialog.tsx';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
3
|
import { type EditorController, type UseTextEditorProps } from '@dxos/react-ui-editor';
|
|
4
|
+
import type * as Util from '@dxos/react-ui/Util';
|
|
5
5
|
import { type BasicExtensionsOptions, type SubmitOptions } from '@dxos/ui-editor';
|
|
6
|
-
import { type ReferencesOptions } from './references';
|
|
6
|
+
import { type ReferencesOptions } from './references.ts';
|
|
7
7
|
export interface ChatEditorController extends EditorController {
|
|
8
8
|
}
|
|
9
|
-
export type ChatEditorProps = ThemedClassName<{
|
|
9
|
+
export type ChatEditorProps = Util.ThemedClassName<{
|
|
10
10
|
extensions?: Extension;
|
|
11
11
|
references?: ReferencesOptions;
|
|
12
12
|
/** Enable inline markdown formatting (decoration, syntax highlighting, and formatting shortcuts). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/ChatEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"ChatEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/ChatEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAU,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,sBAAsB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;CAAG;AAEjE,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAChD;IACE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,qGAAqG;IACrG,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,CAAC,aAAa,GAChB,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,WAAW,CAAC,GAC5C,IAAI,CAAC,sBAAsB,EAAE,cAAc,GAAG,aAAa,CAAC,CAAC,CAChE,CAAC;AAEF,eAAO,MAAM,UAAU;iBATN,SAAS;iBACT,iBAAiB;IAC9B,qGAAqG;eAC1F,OAAO;;;8CA4BrB,CAAC"}
|
|
@@ -4,11 +4,11 @@ declare const meta: {
|
|
|
4
4
|
title: string;
|
|
5
5
|
component: React.ForwardRefExoticComponent<Omit<{
|
|
6
6
|
extensions?: import("@codemirror/state").Extension;
|
|
7
|
-
references?: import("./references").ReferencesOptions;
|
|
7
|
+
references?: import("./references.ts").ReferencesOptions;
|
|
8
8
|
markdown?: boolean;
|
|
9
9
|
} & import("@dxos/ui-editor").SubmitOptions & Pick<import("@dxos/react-ui-editor").UseTextEditorProps, "autoFocus" | "id"> & Pick<import("@dxos/ui-editor").BasicExtensionsOptions, "lineWrapping" | "placeholder">, "className"> & {
|
|
10
10
|
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
11
|
-
} & React.RefAttributes<import("./ChatEditor").ChatEditorController>>;
|
|
11
|
+
} & React.RefAttributes<import("./ChatEditor.tsx").ChatEditorController>>;
|
|
12
12
|
decorators: import("@storybook/react").Decorator[];
|
|
13
13
|
parameters: {
|
|
14
14
|
layout: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/commands.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,SAAS,EAAQ,MAAM,mBAAmB,CAAC;AAGzD,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,+CAA+C;AAC/C,eAAO,MAAM,aAAa,QAAS,WAAW,EAAE,SAAS,MAAM,KAAG,WAAW,EACmC,CAAC;AAEjH,MAAM,MAAM,eAAe,GAAG;IAAE,WAAW,EAAE,MAAM,WAAW,EAAE,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/commands.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,SAAS,EAAQ,MAAM,mBAAmB,CAAC;AAGzD,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,+CAA+C;AAC/C,eAAO,MAAM,aAAa,QAAS,WAAW,EAAE,SAAS,MAAM,KAAG,WAAW,EACmC,CAAC;AAEjH,MAAM,MAAM,eAAe,GAAG;IAAE,WAAW,EAAE,MAAM,WAAW,EAAE,CAAA;CAAE,CAAC;AAqEnE,eAAO,MAAM,QAAQ,oBAAqB,eAAe,KAAG,SAmF3D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './commands';
|
|
2
|
-
export * from './references';
|
|
3
|
-
export * from './useChatExtensions';
|
|
4
|
-
export * from './ChatEditor';
|
|
1
|
+
export * from './commands.ts';
|
|
2
|
+
export * from './references.ts';
|
|
3
|
+
export * from './useChatExtensions.ts';
|
|
4
|
+
export * from './ChatEditor.tsx';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
|
-
import { type ChatEditorProps } from './ChatEditor';
|
|
2
|
+
import { type ChatEditorProps } from './ChatEditor.tsx';
|
|
3
3
|
export declare const useChatExtensions: ({ extensions, markdown, lineWrapping, placeholder, onSubmit, }: ChatEditorProps) => Extension[];
|
|
4
4
|
//# sourceMappingURL=useChatExtensions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatExtensions.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/useChatExtensions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAenD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useChatExtensions.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/useChatExtensions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAenD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMxD,eAAO,MAAM,iBAAiB,mEAM3B,eAAe,gBAoBjB,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import type * as Util from '@dxos/react-ui/Util';
|
|
3
3
|
export type ChatStatusController = {
|
|
4
4
|
/** Resume the tick. No-op if already running. */
|
|
5
5
|
start: () => void;
|
|
6
6
|
/** Pause the tick. The reported `elapsed` freezes at its last value. */
|
|
7
7
|
stop: () => void;
|
|
8
8
|
};
|
|
9
|
-
export type RootProps = ThemedClassName<PropsWithChildren<{
|
|
9
|
+
export type RootProps = Util.ThemedClassName<PropsWithChildren<{
|
|
10
10
|
/** Whether the tick starts running on mount. Defaults to `true`. */
|
|
11
11
|
defaultRunning?: boolean;
|
|
12
12
|
}>>;
|
|
13
|
-
export type IconProps = ThemedClassName<PropsWithChildren>;
|
|
13
|
+
export type IconProps = Util.ThemedClassName<PropsWithChildren>;
|
|
14
14
|
/**
|
|
15
15
|
* Animated leading indicator. Defaults to a halo-pulse dot. Pass children to override.
|
|
16
16
|
*/
|
|
17
17
|
declare const Icon: ({ classNames, children }: IconProps) => React.JSX.Element;
|
|
18
|
-
export type StopwatchProps = ThemedClassName<{
|
|
18
|
+
export type StopwatchProps = Util.ThemedClassName<{
|
|
19
19
|
/** Seconds to add to the context elapsed value before formatting. Defaults to 0. */
|
|
20
20
|
offset?: number;
|
|
21
21
|
}>;
|
|
@@ -25,12 +25,12 @@ export type StopwatchProps = ThemedClassName<{
|
|
|
25
25
|
* Marked `aria-live='off'` so screen readers don't announce every tick.
|
|
26
26
|
*/
|
|
27
27
|
declare const Stopwatch: ({ classNames, offset }: StopwatchProps) => React.JSX.Element;
|
|
28
|
-
export type SeparatorProps = ThemedClassName<unknown>;
|
|
28
|
+
export type SeparatorProps = Util.ThemedClassName<unknown>;
|
|
29
29
|
/**
|
|
30
30
|
* Middle-dot separator. Decorative — `aria-hidden`.
|
|
31
31
|
*/
|
|
32
32
|
declare const Separator: ({ classNames }: SeparatorProps) => React.JSX.Element;
|
|
33
|
-
export type TextProps = ThemedClassName<PropsWithChildren>;
|
|
33
|
+
export type TextProps = Util.ThemedClassName<PropsWithChildren>;
|
|
34
34
|
/**
|
|
35
35
|
* Generic text node — useful for token counts and other inline metadata.
|
|
36
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatStatus/ChatStatus.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAkE,MAAM,OAAO,CAAC;AAEtH,OAAO,
|
|
1
|
+
{"version":3,"file":"ChatStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatStatus/ChatStatus.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAkE,MAAM,OAAO,CAAC;AAEtH,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAC;AAYjD,MAAM,MAAM,oBAAoB,GAAG;IACjC,iDAAiD;IACjD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,wEAAwE;IACxE,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAMF,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAC1C,iBAAiB,CAAC;IAChB,oEAAoE;IACpE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC,CACH,CAAC;AAyDF,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAEhE;;GAEG;AACH,QAAA,MAAM,IAAI,6BAA8B,SAAS,sBAWhD,CAAC;AAMF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC;IAChD,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH;;;;GAIG;AACH,QAAA,MAAM,SAAS,2BAAgC,cAAc,sBAO5D,CAAC;AAMF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AAE3D;;GAEG;AACH,QAAA,MAAM,SAAS,mBAAoB,cAAc,sBAIhD,CAAC;AAMF,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAEhE;;GAEG;AACH,QAAA,MAAM,IAAI,6BAA8B,SAAS,sBAAuD,CAAC;AAMzG,eAAO,MAAM,UAAU;;QAnInB,oEAAoE;yBACnD,OAAO;;;;;;;;CAwI3B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type ChatStatusController } from './ChatStatus';
|
|
3
|
+
import { type ChatStatusController } from './ChatStatus.tsx';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
6
|
component: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatStatus.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatStatus/ChatStatus.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAiB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatStatus.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatStatus/ChatStatus.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAiB,MAAM,OAAO,CAAC;AAOtC,OAAO,EAAc,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGzE,QAAA,MAAM,IAAI;;;;;;;;;QAQN,MAAM;;CAE8B,CAAC;eAE1B,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAsBF,eAAO,MAAM,cAAc,EAAE,KAa5B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAWzB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAkBxB,CAAC"}
|
|
@@ -5,6 +5,6 @@ export type ChatStatusContextValue = {
|
|
|
5
5
|
running: boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare const ChatStatusProvider: import("react").FC<ChatStatusContextValue & {
|
|
8
|
-
children
|
|
8
|
+
children?: import("react").ReactNode;
|
|
9
9
|
}>, useChatStatusContext: (consumerName: string) => ChatStatusContextValue;
|
|
10
10
|
//# sourceMappingURL=ChatStatusContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatStatusContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatStatus/ChatStatusContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatStatusContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatStatus/ChatStatusContext.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,sBAAsB,GAAG;IACnC,kGAAkG;IAClG,OAAO,EAAE,MAAM,CAAC;IAChB,kGAAkG;IAClG,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAO,kBAAkB;;IAAE,oBAAoB,kDAA6D,CAAC"}
|