@talk2view/sdk 0.14.0 → 0.16.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/README.md +336 -69
- package/dist/assistant-ui/convert.d.ts +40 -0
- package/dist/assistant-ui/convert.d.ts.map +1 -0
- package/dist/assistant-ui/convert.js +113 -0
- package/dist/assistant-ui/convert.js.map +1 -0
- package/dist/assistant-ui/dictation.d.ts +39 -0
- package/dist/assistant-ui/dictation.d.ts.map +1 -0
- package/dist/assistant-ui/dictation.js +128 -0
- package/dist/assistant-ui/dictation.js.map +1 -0
- package/dist/assistant-ui/index.d.ts +43 -0
- package/dist/assistant-ui/index.d.ts.map +1 -0
- package/dist/assistant-ui/index.js +227 -0
- package/dist/assistant-ui/index.js.map +1 -0
- package/dist/auth.d.ts +38 -3
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +101 -16
- package/dist/auth.js.map +1 -1
- package/dist/chat/auth-gate.d.ts +42 -0
- package/dist/chat/auth-gate.d.ts.map +1 -0
- package/dist/chat/auth-gate.js +93 -0
- package/dist/chat/auth-gate.js.map +1 -0
- package/dist/chat/chat.d.ts +36 -0
- package/dist/chat/chat.d.ts.map +1 -0
- package/dist/chat/chat.js +124 -0
- package/dist/chat/chat.js.map +1 -0
- package/dist/chat/composer-extras.d.ts +23 -0
- package/dist/chat/composer-extras.d.ts.map +1 -0
- package/dist/chat/composer-extras.js +48 -0
- package/dist/chat/composer-extras.js.map +1 -0
- package/dist/chat/hooks/use-attachment-src.d.ts +2 -0
- package/dist/chat/hooks/use-attachment-src.d.ts.map +1 -0
- package/dist/chat/hooks/use-attachment-src.js +38 -0
- package/dist/chat/hooks/use-attachment-src.js.map +1 -0
- package/dist/chat/hooks/use-copy-to-clipboard.d.ts +8 -0
- package/dist/chat/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/chat/hooks/use-copy-to-clipboard.js +16 -0
- package/dist/chat/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/chat/index.d.ts +32 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +35 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/inject-styles.d.ts +2 -0
- package/dist/chat/inject-styles.d.ts.map +1 -0
- package/dist/chat/inject-styles.js +23 -0
- package/dist/chat/inject-styles.js.map +1 -0
- package/dist/chat/launcher.d.ts +37 -0
- package/dist/chat/launcher.d.ts.map +1 -0
- package/dist/chat/launcher.js +343 -0
- package/dist/chat/launcher.js.map +1 -0
- package/dist/chat/lib/cn.d.ts +19 -0
- package/dist/chat/lib/cn.d.ts.map +1 -0
- package/dist/chat/lib/cn.js +20 -0
- package/dist/chat/lib/cn.js.map +1 -0
- package/dist/chat/lib/dictation-phase.d.ts +9 -0
- package/dist/chat/lib/dictation-phase.d.ts.map +1 -0
- package/dist/chat/lib/dictation-phase.js +33 -0
- package/dist/chat/lib/dictation-phase.js.map +1 -0
- package/dist/chat/lib/guard.d.ts +4 -0
- package/dist/chat/lib/guard.d.ts.map +1 -0
- package/dist/chat/lib/guard.js +41 -0
- package/dist/chat/lib/guard.js.map +1 -0
- package/dist/chat/lib/launcher-variant.d.ts +33 -0
- package/dist/chat/lib/launcher-variant.d.ts.map +1 -0
- package/dist/chat/lib/launcher-variant.js +109 -0
- package/dist/chat/lib/launcher-variant.js.map +1 -0
- package/dist/chat/lib/portal-host.d.ts +13 -0
- package/dist/chat/lib/portal-host.d.ts.map +1 -0
- package/dist/chat/lib/portal-host.js +58 -0
- package/dist/chat/lib/portal-host.js.map +1 -0
- package/dist/chat/markdown.d.ts +32 -0
- package/dist/chat/markdown.d.ts.map +1 -0
- package/dist/chat/markdown.js +18 -0
- package/dist/chat/markdown.js.map +1 -0
- package/dist/chat/provider.d.ts +113 -0
- package/dist/chat/provider.d.ts.map +1 -0
- package/dist/chat/provider.js +176 -0
- package/dist/chat/provider.js.map +1 -0
- package/dist/chat/tool-fallback.d.ts +39 -0
- package/dist/chat/tool-fallback.d.ts.map +1 -0
- package/dist/chat/tool-fallback.js +167 -0
- package/dist/chat/tool-fallback.js.map +1 -0
- package/dist/chat/ui/avatar.d.ts +12 -0
- package/dist/chat/ui/avatar.d.ts.map +1 -0
- package/dist/chat/ui/avatar.js +24 -0
- package/dist/chat/ui/avatar.js.map +1 -0
- package/dist/chat/ui/button.d.ts +9 -0
- package/dist/chat/ui/button.d.ts.map +1 -0
- package/dist/chat/ui/button.js +35 -0
- package/dist/chat/ui/button.js.map +1 -0
- package/dist/chat/ui/collapsible.d.ts +6 -0
- package/dist/chat/ui/collapsible.d.ts.map +1 -0
- package/dist/chat/ui/collapsible.js +13 -0
- package/dist/chat/ui/collapsible.js.map +1 -0
- package/dist/chat/ui/dialog.d.ts +18 -0
- package/dist/chat/ui/dialog.d.ts.map +1 -0
- package/dist/chat/ui/dialog.js +42 -0
- package/dist/chat/ui/dialog.js.map +1 -0
- package/dist/chat/ui/input.d.ts +4 -0
- package/dist/chat/ui/input.d.ts.map +1 -0
- package/dist/chat/ui/input.js +8 -0
- package/dist/chat/ui/input.js.map +1 -0
- package/dist/chat/ui/skeleton.d.ts +3 -0
- package/dist/chat/ui/skeleton.d.ts.map +1 -0
- package/dist/chat/ui/skeleton.js +7 -0
- package/dist/chat/ui/skeleton.js.map +1 -0
- package/dist/chat/ui/textarea.d.ts +4 -0
- package/dist/chat/ui/textarea.d.ts.map +1 -0
- package/dist/chat/ui/textarea.js +7 -0
- package/dist/chat/ui/textarea.js.map +1 -0
- package/dist/chat/ui/tooltip.d.ts +7 -0
- package/dist/chat/ui/tooltip.d.ts.map +1 -0
- package/dist/chat/ui/tooltip.js +22 -0
- package/dist/chat/ui/tooltip.js.map +1 -0
- package/dist/chat/vendor/attachment.aui.d.ts +5 -0
- package/dist/chat/vendor/attachment.aui.d.ts.map +1 -0
- package/dist/chat/vendor/attachment.aui.js +79 -0
- package/dist/chat/vendor/attachment.aui.js.map +1 -0
- package/dist/chat/vendor/file.d.ts +41 -0
- package/dist/chat/vendor/file.d.ts.map +1 -0
- package/dist/chat/vendor/file.js +137 -0
- package/dist/chat/vendor/file.js.map +1 -0
- package/dist/chat/vendor/follow-up-suggestions.aui.d.ts +3 -0
- package/dist/chat/vendor/follow-up-suggestions.aui.d.ts.map +1 -0
- package/dist/chat/vendor/follow-up-suggestions.aui.js +45 -0
- package/dist/chat/vendor/follow-up-suggestions.aui.js.map +1 -0
- package/dist/chat/vendor/image.d.ts +47 -0
- package/dist/chat/vendor/image.d.ts.map +1 -0
- package/dist/chat/vendor/image.js +258 -0
- package/dist/chat/vendor/image.js.map +1 -0
- package/dist/chat/vendor/markdown-text.d.ts +8 -0
- package/dist/chat/vendor/markdown-text.d.ts.map +1 -0
- package/dist/chat/vendor/markdown-text.js +73 -0
- package/dist/chat/vendor/markdown-text.js.map +1 -0
- package/dist/chat/vendor/reasoning.aui.d.ts +22 -0
- package/dist/chat/vendor/reasoning.aui.d.ts.map +1 -0
- package/dist/chat/vendor/reasoning.aui.js +56 -0
- package/dist/chat/vendor/reasoning.aui.js.map +1 -0
- package/dist/chat/vendor/reasoning.d.ts +35 -0
- package/dist/chat/vendor/reasoning.d.ts.map +1 -0
- package/dist/chat/vendor/reasoning.js +112 -0
- package/dist/chat/vendor/reasoning.js.map +1 -0
- package/dist/chat/vendor/thread-list.aui.d.ts +37 -0
- package/dist/chat/vendor/thread-list.aui.d.ts.map +1 -0
- package/dist/chat/vendor/thread-list.aui.js +154 -0
- package/dist/chat/vendor/thread-list.aui.js.map +1 -0
- package/dist/chat/vendor/thread.aui.d.ts +47 -0
- package/dist/chat/vendor/thread.aui.d.ts.map +1 -0
- package/dist/chat/vendor/thread.aui.js +176 -0
- package/dist/chat/vendor/thread.aui.js.map +1 -0
- package/dist/chat/vendor/tool-fallback.aui.d.ts +39 -0
- package/dist/chat/vendor/tool-fallback.aui.d.ts.map +1 -0
- package/dist/chat/vendor/tool-fallback.aui.js +251 -0
- package/dist/chat/vendor/tool-fallback.aui.js.map +1 -0
- package/dist/chat/vendor/tool-group.aui.d.ts +34 -0
- package/dist/chat/vendor/tool-group.aui.d.ts.map +1 -0
- package/dist/chat/vendor/tool-group.aui.js +60 -0
- package/dist/chat/vendor/tool-group.aui.js.map +1 -0
- package/dist/chat/vendor/tooltip-icon-button.d.ts +8 -0
- package/dist/chat/vendor/tooltip-icon-button.d.ts.map +1 -0
- package/dist/chat/vendor/tooltip-icon-button.js +11 -0
- package/dist/chat/vendor/tooltip-icon-button.js.map +1 -0
- package/dist/chat/views/account.d.ts +6 -0
- package/dist/chat/views/account.d.ts.map +1 -0
- package/dist/chat/views/account.js +128 -0
- package/dist/chat/views/account.js.map +1 -0
- package/dist/chat/views/settings.d.ts +2 -0
- package/dist/chat/views/settings.d.ts.map +1 -0
- package/dist/chat/views/settings.js +104 -0
- package/dist/chat/views/settings.js.map +1 -0
- package/dist/chat/views/thread-list.d.ts +10 -0
- package/dist/chat/views/thread-list.d.ts.map +1 -0
- package/dist/chat/views/thread-list.js +21 -0
- package/dist/chat/views/thread-list.js.map +1 -0
- package/dist/chat/welcome.d.ts +10 -0
- package/dist/chat/welcome.d.ts.map +1 -0
- package/dist/chat/welcome.js +9 -0
- package/dist/chat/welcome.js.map +1 -0
- package/dist/chat-css.d.ts +1 -0
- package/dist/chat-css.js +1 -0
- package/dist/chat.css +2 -0
- package/dist/chat.isolated.css +3819 -0
- package/dist/chat.raw.css +3829 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +5 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +28 -6
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +68 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +236 -35
- package/dist/index.js.map +1 -1
- package/dist/react/T2VProvider.d.ts +2 -2
- package/dist/react/T2VProvider.d.ts.map +1 -1
- package/dist/react/T2VProvider.js +1 -1
- package/dist/react/T2VProvider.js.map +1 -1
- package/dist/react/index.d.ts +14 -14
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +7 -7
- package/dist/react/index.js.map +1 -1
- package/dist/react/usePartnerConfig.d.ts +1 -1
- package/dist/react/usePartnerConfig.d.ts.map +1 -1
- package/dist/react/usePartnerConfig.js +1 -1
- package/dist/react/usePartnerConfig.js.map +1 -1
- package/dist/react/useT2VAuth.d.ts +8 -1
- package/dist/react/useT2VAuth.d.ts.map +1 -1
- package/dist/react/useT2VAuth.js +25 -6
- package/dist/react/useT2VAuth.js.map +1 -1
- package/dist/react/useT2VChat.d.ts +3 -3
- package/dist/react/useT2VChat.d.ts.map +1 -1
- package/dist/react/useT2VChat.js +1 -1
- package/dist/react/useT2VChat.js.map +1 -1
- package/dist/react/useT2VTools.d.ts +1 -1
- package/dist/react/useT2VTools.d.ts.map +1 -1
- package/dist/react/useT2VTools.js +1 -1
- package/dist/react/useT2VTools.js.map +1 -1
- package/dist/react/useUserPreferences.d.ts +1 -1
- package/dist/react/useUserPreferences.d.ts.map +1 -1
- package/dist/react/useUserPreferences.js +1 -1
- package/dist/react/useUserPreferences.js.map +1 -1
- package/dist/sessions.d.ts +3 -3
- package/dist/sessions.d.ts.map +1 -1
- package/dist/sessions.js +6 -2
- package/dist/sessions.js.map +1 -1
- package/dist/skills.d.ts +2 -2
- package/dist/skills.d.ts.map +1 -1
- package/dist/streaming.d.ts +1 -1
- package/dist/streaming.d.ts.map +1 -1
- package/dist/tools.d.ts +2 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +119 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/components/ApprovalCard.d.ts +1 -1
- package/dist/ui/components/ApprovalCard.d.ts.map +1 -1
- package/dist/ui/components/ChatHeader.js +1 -1
- package/dist/ui/components/ChatHeader.js.map +1 -1
- package/dist/ui/components/ChatPanel.d.ts +1 -1
- package/dist/ui/components/ChatPanel.d.ts.map +1 -1
- package/dist/ui/components/ChatPanel.js +14 -13
- package/dist/ui/components/ChatPanel.js.map +1 -1
- package/dist/ui/components/ChatWidget.d.ts +1 -1
- package/dist/ui/components/ChatWidget.d.ts.map +1 -1
- package/dist/ui/components/ChatWidget.js +2 -2
- package/dist/ui/components/ChatWidget.js.map +1 -1
- package/dist/ui/components/Composer.d.ts.map +1 -1
- package/dist/ui/components/Composer.js +13 -6
- package/dist/ui/components/Composer.js.map +1 -1
- package/dist/ui/components/LoginForm.d.ts.map +1 -1
- package/dist/ui/components/LoginForm.js +19 -5
- package/dist/ui/components/LoginForm.js.map +1 -1
- package/dist/ui/components/MarkdownRenderer.d.ts +4 -0
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -1
- package/dist/ui/components/MarkdownRenderer.js +7 -35
- package/dist/ui/components/MarkdownRenderer.js.map +1 -1
- package/dist/ui/components/MessageActions.js +1 -1
- package/dist/ui/components/MessageActions.js.map +1 -1
- package/dist/ui/components/MessageBubble.d.ts +1 -1
- package/dist/ui/components/MessageBubble.d.ts.map +1 -1
- package/dist/ui/components/MessageBubble.js +9 -9
- package/dist/ui/components/MessageBubble.js.map +1 -1
- package/dist/ui/components/MessageList.js +2 -2
- package/dist/ui/components/MessageList.js.map +1 -1
- package/dist/ui/components/SettingsPanel.js +4 -4
- package/dist/ui/components/SettingsPanel.js.map +1 -1
- package/dist/ui/components/Talk2View.d.ts +1 -1
- package/dist/ui/components/Talk2View.d.ts.map +1 -1
- package/dist/ui/components/Talk2View.js +16 -12
- package/dist/ui/components/Talk2View.js.map +1 -1
- package/dist/ui/components/ThinkingBlock.js +2 -2
- package/dist/ui/components/ThinkingBlock.js.map +1 -1
- package/dist/ui/components/WelcomeScreen.js +2 -2
- package/dist/ui/components/WelcomeScreen.js.map +1 -1
- package/dist/ui/context.d.ts +4 -2
- package/dist/ui/context.d.ts.map +1 -1
- package/dist/ui/context.js.map +1 -1
- package/dist/ui/index.d.ts +27 -26
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +21 -20
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/safeMarkdown.d.ts +17 -0
- package/dist/ui/safeMarkdown.d.ts.map +1 -0
- package/dist/ui/safeMarkdown.js +196 -0
- package/dist/ui/safeMarkdown.js.map +1 -0
- package/dist/ui/theme.d.ts +1 -1
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/utils.d.ts +1 -1
- package/dist/ui/utils.d.ts.map +1 -1
- package/package.json +64 -5
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* `<Talk2ViewChatLauncher>` — the floating mark in the corner of a page, and the
|
|
5
|
+
* panel it opens.
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { Talk2ViewChatLauncher } from '@talk2view/sdk/chat';
|
|
9
|
+
* import '@talk2view/sdk/chat.css';
|
|
10
|
+
*
|
|
11
|
+
* <Talk2ViewChatLauncher partnerKey="pk_live_…" keepClearOf="#cookie-banner" />
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Inside the panel is exactly what `<Talk2ViewChat>` renders — the same header,
|
|
15
|
+
* views and thread — so everything that works in a side panel works here. What
|
|
16
|
+
* this file adds is the frame: a fixed anchor that rides above whatever the
|
|
17
|
+
* integrator names, a popover that stays open when the page behind it is
|
|
18
|
+
* clicked, a full-screen sheet on a phone, and a panel the visitor can resize.
|
|
19
|
+
*/
|
|
20
|
+
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
21
|
+
import { ChevronDownIcon, XIcon } from 'lucide-react';
|
|
22
|
+
import { useAuiEvent } from '@assistant-ui/react';
|
|
23
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
24
|
+
import { TooltipIconButton } from './vendor/tooltip-icon-button.js';
|
|
25
|
+
import { cn } from './lib/cn.js';
|
|
26
|
+
import { usePortalHost } from './lib/portal-host.js';
|
|
27
|
+
import { ChatProvider, useChatContext } from './provider.js';
|
|
28
|
+
import { ChatShell } from './chat.js';
|
|
29
|
+
import { DEFAULT_LAUNCHER_COLOURWAY, LauncherOptionsContext, markLauncherOpened, useLauncherColourway, useLauncherOpened, useLauncherOptions, } from './lib/launcher-variant.js';
|
|
30
|
+
export function Talk2ViewChatLauncher(props) {
|
|
31
|
+
const { label = 'Ask Talk2View', colourway = DEFAULT_LAUNCHER_COLOURWAY, visitorColourway = false, keepClearOf, sheetBelow = 640,
|
|
32
|
+
// Taken out of the rest so they never reach `new Talk2View()`, which is
|
|
33
|
+
// handed everything the provider does not recognise.
|
|
34
|
+
...chat } = props;
|
|
35
|
+
const options = useMemo(() => ({ colourway, visitorColourway }), [colourway, visitorColourway]);
|
|
36
|
+
return (_jsx(ChatProvider, { ...chat, children: _jsx(LauncherOptionsContext.Provider, { value: options, children: _jsx(LauncherFrame, { label: label, keepClearOf: keepClearOf, sheetBelow: sheetBelow, fontFamily: chat.fontFamily, className: chat.className, footer: chat.footer }) }) }));
|
|
37
|
+
}
|
|
38
|
+
const LauncherFrame = ({ label, keepClearOf, sheetBelow, fontFamily, className, footer, }) => {
|
|
39
|
+
const [open, setOpen] = useState(false);
|
|
40
|
+
const [view, setView] = useState('thread');
|
|
41
|
+
// Read from a client subscription, which must not re-subscribe on every open.
|
|
42
|
+
const openRef = useRef(open);
|
|
43
|
+
openRef.current = open;
|
|
44
|
+
const popupRef = useRef(null);
|
|
45
|
+
const portalHost = usePortalHost();
|
|
46
|
+
const sheet = useIsSheet(sheetBelow);
|
|
47
|
+
const clearance = useKeepClearOf(keepClearOf);
|
|
48
|
+
const opened = useLauncherOpened();
|
|
49
|
+
const { size, reset, handleProps } = usePanelSize(popupRef);
|
|
50
|
+
const options = useLauncherOptions();
|
|
51
|
+
const colourway = useLauncherColourway(options.colourway, options.visitorColourway);
|
|
52
|
+
const { client, dark } = useChatContext();
|
|
53
|
+
// Every way in goes through here: the panel opens on the thread, and the
|
|
54
|
+
// label has done its job.
|
|
55
|
+
const openPanel = useCallback(() => {
|
|
56
|
+
setView('thread');
|
|
57
|
+
markLauncherOpened();
|
|
58
|
+
setOpen(true);
|
|
59
|
+
}, []);
|
|
60
|
+
// A guest who cannot go on — the partner allows no guests, or this one has
|
|
61
|
+
// used their allowance — needs to see the way in. `ChatShell` already puts the
|
|
62
|
+
// Account view up by itself; what it cannot do is open a panel it does not own.
|
|
63
|
+
//
|
|
64
|
+
// An approval is the same shape and worse: the agent stops and waits for an
|
|
65
|
+
// answer, and a visitor who closed the panel mid-run sees nothing at all —
|
|
66
|
+
// not the card, not a reason for the silence. The panel is unmounted while
|
|
67
|
+
// closed, so the card inside it cannot ask for itself; only this can.
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const offs = [
|
|
70
|
+
client.on('anonymousUnavailable', openPanel),
|
|
71
|
+
client.on('demoLimitReached', openPanel),
|
|
72
|
+
// Fires with null when a decision is answered, too — that is not a reason
|
|
73
|
+
// to reopen a panel the visitor has just closed. And only the CLOSED
|
|
74
|
+
// panel needs this: an open one has a `ChatShell` in it, which brings the
|
|
75
|
+
// thread back by itself and knows not to interrupt a half-typed sign-in.
|
|
76
|
+
client.on('approvalChange', (approval) => {
|
|
77
|
+
if (approval && !openRef.current)
|
|
78
|
+
openPanel();
|
|
79
|
+
}),
|
|
80
|
+
];
|
|
81
|
+
return () => offs.forEach((off) => off());
|
|
82
|
+
}, [client, openPanel]);
|
|
83
|
+
// A run started from the host's own UI — their hero input, a toolbar button —
|
|
84
|
+
// brings the panel up so the visitor can see the answer arrive.
|
|
85
|
+
useAuiEvent('thread.runStart', openPanel);
|
|
86
|
+
// A sheet covers the whole screen, so the page behind it must not scroll.
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!open || !sheet)
|
|
89
|
+
return;
|
|
90
|
+
const previous = document.documentElement.style.overflow;
|
|
91
|
+
document.documentElement.style.overflow = 'hidden';
|
|
92
|
+
return () => {
|
|
93
|
+
document.documentElement.style.overflow = previous;
|
|
94
|
+
};
|
|
95
|
+
}, [open, sheet]);
|
|
96
|
+
// The host page's font unless the integrator names one; nothing is fetched.
|
|
97
|
+
const font = fontFamily ? { ['--t2v-font']: fontFamily } : undefined;
|
|
98
|
+
const anchorStyle = useMemo(() => clearance ? { ...font, translate: `0 -${clearance}px` } : font,
|
|
99
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
100
|
+
[fontFamily, clearance]);
|
|
101
|
+
// A sheet is the whole screen; a remembered size would only fight it.
|
|
102
|
+
const sized = !sheet && size;
|
|
103
|
+
const panelStyle = useMemo(() => sized
|
|
104
|
+
? {
|
|
105
|
+
...font,
|
|
106
|
+
// Custom properties, not `width`/`height`: the panel's own size
|
|
107
|
+
// utilities are armoured !important, which an inline declaration
|
|
108
|
+
// cannot beat. chat.src.css reads these back under `[data-sized]`.
|
|
109
|
+
['--t2v-panel-width']: `${sized.width}px`,
|
|
110
|
+
['--t2v-panel-height']: `${sized.height}px`,
|
|
111
|
+
}
|
|
112
|
+
: font,
|
|
113
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
114
|
+
[fontFamily, sized]);
|
|
115
|
+
const labelled = !!label && !opened && !open && !sheet;
|
|
116
|
+
return (_jsxs(PopoverPrimitive.Root, { open: open, onOpenChange: (next, details) => {
|
|
117
|
+
// Clicking the page, or tabbing into it, is not a request to throw away
|
|
118
|
+
// a conversation: only the launcher, the Close button and Escape close.
|
|
119
|
+
if (!next && (details.reason === 'outside-press' || details.reason === 'focus-out')) {
|
|
120
|
+
details.cancel();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (next)
|
|
124
|
+
openPanel();
|
|
125
|
+
else
|
|
126
|
+
setOpen(false);
|
|
127
|
+
}, children: [_jsx("div", { className: cn('t2v-chat aui-root aui-modal-anchor', className), style: anchorStyle, "data-sheet": sheet ? '' : undefined, children: _jsx(PopoverPrimitive.Trigger, { render: (triggerProps, state) => (_jsx(LauncherButton, { ...triggerProps, open: state.open, label: label, labelled: labelled, colourway: colourway })) }) }), _jsx(PopoverPrimitive.Portal, { container: portalHost, children: _jsx(PopoverPrimitive.Positioner, { side: "top", align: "end", sideOffset: 16, positionMethod: "fixed", className: "aui-modal-positioner isolate z-[999999]", "data-sheet": sheet ? '' : undefined, children: _jsxs(PopoverPrimitive.Popup, { ref: popupRef, "aria-label": "Talk2View chat", "data-sheet": sheet ? '' : undefined, "data-sized": sized ? '' : undefined, style: panelStyle, className: cn(
|
|
128
|
+
// `dark` again, on the panel itself: it is a `.t2v-chat` element,
|
|
129
|
+
// and a `.t2v-chat` declaration on the element beats the dark
|
|
130
|
+
// tokens inherited from the portal host around it. Without this
|
|
131
|
+
// the tile went dark and the panel stayed white.
|
|
132
|
+
't2v-chat group/modal aui-root aui-modal-content', dark && 'dark', 'bg-popover text-popover-foreground ring-foreground/10 z-50 flex flex-col gap-0 overflow-clip overscroll-contain rounded-xl p-0 text-base antialiased shadow-[0_16px_48px_-24px_rgb(0_0_0/0.25)] ring-1 outline-none dark:shadow-[0_16px_48px_-24px_rgb(0_0_0/0.6)]', 'h-[clamp(31.25rem,72dvh,47.5rem)] max-h-(--available-height) w-[clamp(25rem,30vw,30rem)] max-w-[calc(100vw-2rem)]', 'origin-(--transform-origin) data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-open:slide-in-from-bottom-2 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-closed:slide-out-to-bottom-2 transition-none ease-[cubic-bezier(0.32,0.72,0,1)] data-closed:duration-200 data-open:duration-300 motion-reduce:animate-none', '[&_.aui-thread-root]:bg-inherit [&_.aui-thread-viewport-footer]:bg-popover [&_[data-slot=aui\\_thread-viewport]]:[scrollbar-gutter:stable_both-edges]'), children: [_jsx(ChatShell, { view: view, onViewChange: setView, footer: footer,
|
|
133
|
+
// The sheet covers the launcher, so it needs its own way out.
|
|
134
|
+
headerEnd: sheet ? (_jsx(PopoverPrimitive.Close, { render: _jsx(TooltipIconButton, { tooltip: "Close", side: "bottom", className: "aui-modal-close text-muted-foreground hover:text-foreground size-9 rounded-md p-0" }), children: _jsx(XIcon, { className: "size-5" }) })) : undefined }), sheet ? null : _jsx(PanelResizeHandle, { ...handleProps, onDoubleClick: reset })] }) }) })] }));
|
|
135
|
+
};
|
|
136
|
+
/* ── the sheet ──────────────────────────────────────────────────────────────
|
|
137
|
+
Driven from JS rather than a media query, because the width at which the
|
|
138
|
+
panel becomes a sheet is the integrator's to choose. The rules it switches
|
|
139
|
+
are keyed on `data-sheet` in chat.src.css. */
|
|
140
|
+
function useIsSheet(sheetBelow) {
|
|
141
|
+
const query = `(max-width: ${sheetBelow}px)`;
|
|
142
|
+
const subscribe = useCallback((onChange) => {
|
|
143
|
+
if (typeof window === 'undefined' || !window.matchMedia)
|
|
144
|
+
return () => { };
|
|
145
|
+
const media = window.matchMedia(query);
|
|
146
|
+
media.addEventListener('change', onChange);
|
|
147
|
+
return () => media.removeEventListener('change', onChange);
|
|
148
|
+
}, [query]);
|
|
149
|
+
const read = useCallback(() => (typeof window !== 'undefined' && window.matchMedia ? window.matchMedia(query).matches : false), [query]);
|
|
150
|
+
return useSyncExternalStore(subscribe, read, () => false);
|
|
151
|
+
}
|
|
152
|
+
/* ── keeping clear ──────────────────────────────────────────────────────────
|
|
153
|
+
A cookie banner is pinned to the bottom edge too, and its buttons sit exactly
|
|
154
|
+
where the launcher does. The height is measured rather than assumed, because
|
|
155
|
+
a banner stacks on a phone; the element is re-resolved on DOM changes,
|
|
156
|
+
because it usually arrives after the page has settled and goes away the
|
|
157
|
+
moment the visitor answers it. */
|
|
158
|
+
function useKeepClearOf(selector) {
|
|
159
|
+
const [height, setHeight] = useState(0);
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (!selector || typeof document === 'undefined')
|
|
162
|
+
return;
|
|
163
|
+
let element = null;
|
|
164
|
+
let frame = 0;
|
|
165
|
+
const measure = () => setHeight(element?.isConnected ? element.offsetHeight : 0);
|
|
166
|
+
const observer = new ResizeObserver(measure);
|
|
167
|
+
const resolve = () => {
|
|
168
|
+
frame = 0;
|
|
169
|
+
let found = null;
|
|
170
|
+
try {
|
|
171
|
+
found = document.querySelector(selector);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
// A selector the host mistyped: keep clear of nothing rather than throw.
|
|
175
|
+
found = null;
|
|
176
|
+
}
|
|
177
|
+
if (found === element)
|
|
178
|
+
return;
|
|
179
|
+
if (element)
|
|
180
|
+
observer.unobserve(element);
|
|
181
|
+
element = found;
|
|
182
|
+
if (element)
|
|
183
|
+
observer.observe(element);
|
|
184
|
+
measure();
|
|
185
|
+
};
|
|
186
|
+
resolve();
|
|
187
|
+
const mutations = new MutationObserver(() => {
|
|
188
|
+
// One resolve per frame, whatever the host's own rendering is doing.
|
|
189
|
+
if (!frame)
|
|
190
|
+
frame = requestAnimationFrame(resolve);
|
|
191
|
+
});
|
|
192
|
+
mutations.observe(document.body, { childList: true, subtree: true });
|
|
193
|
+
return () => {
|
|
194
|
+
if (frame)
|
|
195
|
+
cancelAnimationFrame(frame);
|
|
196
|
+
mutations.disconnect();
|
|
197
|
+
observer.disconnect();
|
|
198
|
+
};
|
|
199
|
+
}, [selector]);
|
|
200
|
+
return height;
|
|
201
|
+
}
|
|
202
|
+
const SIZE_STORAGE_KEY = 't2v-launcher-size';
|
|
203
|
+
const MIN_SIZE = { width: 320, height: 400 };
|
|
204
|
+
/** The launcher and its offsets sit below the panel; the height leaves room. */
|
|
205
|
+
const VIEWPORT_INSET = { width: 32, height: 96 };
|
|
206
|
+
const RESIZE_STEP = 16;
|
|
207
|
+
const clampSize = ({ width, height }) => ({
|
|
208
|
+
width: Math.round(Math.max(MIN_SIZE.width, Math.min(width, window.innerWidth - VIEWPORT_INSET.width))),
|
|
209
|
+
height: Math.round(Math.max(MIN_SIZE.height, Math.min(height, window.innerHeight - VIEWPORT_INSET.height))),
|
|
210
|
+
});
|
|
211
|
+
const readStoredSize = () => {
|
|
212
|
+
if (typeof window === 'undefined')
|
|
213
|
+
return null;
|
|
214
|
+
try {
|
|
215
|
+
const stored = JSON.parse(window.localStorage.getItem(SIZE_STORAGE_KEY) ?? 'null');
|
|
216
|
+
if (typeof stored !== 'object' || stored === null)
|
|
217
|
+
return null;
|
|
218
|
+
const { width, height } = stored;
|
|
219
|
+
if (typeof width !== 'number' || typeof height !== 'number')
|
|
220
|
+
return null;
|
|
221
|
+
return clampSize({ width, height });
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
const storeSize = (size) => {
|
|
228
|
+
try {
|
|
229
|
+
if (size)
|
|
230
|
+
window.localStorage.setItem(SIZE_STORAGE_KEY, JSON.stringify(size));
|
|
231
|
+
else
|
|
232
|
+
window.localStorage.removeItem(SIZE_STORAGE_KEY);
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
// Without storage the size lasts until the page reloads.
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
const isRtl = (element) => getComputedStyle(element).direction === 'rtl';
|
|
239
|
+
function usePanelSize(contentRef) {
|
|
240
|
+
const [size, setSize] = useState(readStoredSize);
|
|
241
|
+
const dragRef = useRef(null);
|
|
242
|
+
const commitSize = (next) => {
|
|
243
|
+
setSize(next);
|
|
244
|
+
storeSize(next);
|
|
245
|
+
};
|
|
246
|
+
const sizeFromPointer = (drag, event) => clampSize({
|
|
247
|
+
width: drag.width - (event.clientX - drag.x) * drag.direction,
|
|
248
|
+
height: drag.height - (event.clientY - drag.y),
|
|
249
|
+
});
|
|
250
|
+
const takeDrag = (event) => {
|
|
251
|
+
const drag = dragRef.current;
|
|
252
|
+
if (!drag || drag.pointerId !== event.pointerId)
|
|
253
|
+
return null;
|
|
254
|
+
dragRef.current = null;
|
|
255
|
+
return drag;
|
|
256
|
+
};
|
|
257
|
+
const reset = () => {
|
|
258
|
+
dragRef.current = null;
|
|
259
|
+
commitSize(null);
|
|
260
|
+
};
|
|
261
|
+
return {
|
|
262
|
+
size,
|
|
263
|
+
reset,
|
|
264
|
+
handleProps: {
|
|
265
|
+
onPointerDown: (event) => {
|
|
266
|
+
const content = contentRef.current;
|
|
267
|
+
if (event.button !== 0 || !content)
|
|
268
|
+
return;
|
|
269
|
+
const rect = content.getBoundingClientRect();
|
|
270
|
+
dragRef.current = {
|
|
271
|
+
pointerId: event.pointerId,
|
|
272
|
+
x: event.clientX,
|
|
273
|
+
y: event.clientY,
|
|
274
|
+
width: rect.width,
|
|
275
|
+
height: rect.height,
|
|
276
|
+
direction: isRtl(content) ? -1 : 1,
|
|
277
|
+
last: null,
|
|
278
|
+
};
|
|
279
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
},
|
|
282
|
+
onPointerMove: (event) => {
|
|
283
|
+
const drag = dragRef.current;
|
|
284
|
+
if (!drag || drag.pointerId !== event.pointerId)
|
|
285
|
+
return;
|
|
286
|
+
// A click is a pointerdown, a pointermove that never moved, and a
|
|
287
|
+
// pointerup: without this it would commit the size it already has.
|
|
288
|
+
if (!drag.last && event.clientX === drag.x && event.clientY === drag.y)
|
|
289
|
+
return;
|
|
290
|
+
drag.last = sizeFromPointer(drag, event);
|
|
291
|
+
setSize(drag.last);
|
|
292
|
+
},
|
|
293
|
+
onPointerUp: (event) => {
|
|
294
|
+
const drag = takeDrag(event);
|
|
295
|
+
if (!drag)
|
|
296
|
+
return;
|
|
297
|
+
if (drag.last || event.clientX !== drag.x || event.clientY !== drag.y) {
|
|
298
|
+
commitSize(sizeFromPointer(drag, event));
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
onPointerCancel: (event) => {
|
|
302
|
+
const drag = takeDrag(event);
|
|
303
|
+
if (drag?.last)
|
|
304
|
+
commitSize(drag.last);
|
|
305
|
+
},
|
|
306
|
+
onKeyDown: (event) => {
|
|
307
|
+
const content = contentRef.current;
|
|
308
|
+
if (!content)
|
|
309
|
+
return;
|
|
310
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
311
|
+
event.preventDefault();
|
|
312
|
+
reset();
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const step = event.shiftKey ? RESIZE_STEP * 4 : RESIZE_STEP;
|
|
316
|
+
const rtl = isRtl(content);
|
|
317
|
+
const changes = {
|
|
318
|
+
ArrowUp: [0, step],
|
|
319
|
+
ArrowDown: [0, -step],
|
|
320
|
+
[rtl ? 'ArrowRight' : 'ArrowLeft']: [step, 0],
|
|
321
|
+
[rtl ? 'ArrowLeft' : 'ArrowRight']: [-step, 0],
|
|
322
|
+
};
|
|
323
|
+
const change = changes[event.key];
|
|
324
|
+
if (!change)
|
|
325
|
+
return;
|
|
326
|
+
event.preventDefault();
|
|
327
|
+
const rect = content.getBoundingClientRect();
|
|
328
|
+
commitSize(clampSize({ width: rect.width + change[0], height: rect.height + change[1] }));
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
const PanelResizeHandle = (props) => (_jsx("button", { type: "button", "aria-label": "Resize the chat panel", className: "aui-modal-resize-handle group-hover/modal:border-foreground/15 hover:border-foreground/40 focus-visible:border-ring absolute start-0 top-0 z-10 size-6 cursor-nwse-resize touch-none rounded-ss-xl border-s-2 border-t-2 border-transparent transition-colors outline-none [clip-path:polygon(0_0,100%_0,100%_6px,6px_6px,6px_100%,0_100%)] motion-reduce:transition-none rtl:cursor-nesw-resize rtl:[clip-path:polygon(0_0,100%_0,100%_100%,calc(100%_-_6px)_100%,calc(100%_-_6px)_6px,0_6px)]", ...props }));
|
|
334
|
+
/** The Talk2View V-mark — the same path as the brand's logomark. */
|
|
335
|
+
const Talk2ViewMark = (props) => (_jsx("svg", { viewBox: "0 0 112 82", fill: "none", "aria-hidden": "true", ...props, children: _jsx("path", { d: "M112 59H76L69 82H43L36 59H0V0H112V59ZM11 11V48H45L56 80L67 48H101V11H11Z", fill: "currentColor" }) }));
|
|
336
|
+
const LauncherButton = forwardRef(({ open, label, labelled, colourway, ...rest }, ref) => {
|
|
337
|
+
const tooltip = open ? 'Close Talk2View' : 'Open Talk2View';
|
|
338
|
+
return (_jsxs(TooltipIconButton, { variant: "ghost", tooltip: tooltip, side: "left", ...rest, ref: ref, "data-launcher-variant": colourway, "data-labelled": labelled ? '' : undefined, className: "aui-modal-button h-full w-auto gap-0 rounded-none border-0 p-0 shadow-[0_6px_20px_-8px_rgb(2_28_37/0.55)] transition-[scale] duration-150 ease-out active:scale-96 motion-reduce:transition-none", children: [_jsxs("span", { className: "relative flex size-16 shrink-0 items-center justify-center", children: [_jsx(Talk2ViewMark, { "data-open": open ? '' : undefined, "data-closed": open ? undefined : '', className: "aui-modal-button-closed-icon absolute size-auto h-[29px] w-[40px] transition-[scale,opacity,filter] duration-200 ease-[cubic-bezier(0.2,0,0,1)] data-closed:scale-100 data-closed:opacity-100 data-closed:blur-[0px] data-open:scale-25 data-open:opacity-0 data-open:blur-[4px] motion-reduce:transition-none" }), _jsx(ChevronDownIcon, { "data-open": open ? '' : undefined, "data-closed": open ? undefined : '', className: "aui-modal-button-open-icon absolute size-7 transition-[scale,opacity,filter] duration-200 ease-[cubic-bezier(0.2,0,0,1)] data-closed:scale-25 data-closed:opacity-0 data-closed:blur-[4px] data-open:scale-100 data-open:opacity-100 data-open:blur-[0px] motion-reduce:transition-none" })] }), label ? (
|
|
339
|
+
// 0fr → 1fr animates the width of text whose size isn't known up front.
|
|
340
|
+
_jsx("span", { "aria-hidden": "true", className: cn('aui-modal-button-label grid transition-[grid-template-columns] duration-300 ease-out motion-reduce:transition-none', labelled ? 'grid-cols-[1fr]' : 'grid-cols-[0fr]'), children: _jsx("span", { className: "overflow-hidden text-lg font-medium whitespace-nowrap", children: _jsxs("span", { className: "pe-6", children: [_jsx("span", { className: "t2v-launcher-label", children: label }), _jsx("span", { className: "t2v-launcher-cursor", children: "_" })] }) }) })) : null] }));
|
|
341
|
+
});
|
|
342
|
+
LauncherButton.displayName = 'LauncherButton';
|
|
343
|
+
//# sourceMappingURL=launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../src/chat/launcher.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACR,oBAAoB,GAQrB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,cAAc,EAA2B,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,SAAS,EAAiB,MAAM,WAAW,CAAC;AACrD,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,GAGnB,MAAM,2BAA2B,CAAC;AAkBnC,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACrE,MAAM,EACJ,KAAK,GAAG,eAAe,EACvB,SAAS,GAAG,0BAA0B,EACtC,gBAAgB,GAAG,KAAK,EACxB,WAAW,EACX,UAAU,GAAG,GAAG;IAChB,wEAAwE;IACxE,qDAAqD;IACrD,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,MAAM,OAAO,GAAG,OAAO,CACrB,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,EACvC,CAAC,SAAS,EAAE,gBAAgB,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ACR,GAAG,EAAE,GAAG,2BACe,SAAS,mBACjB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EACxC,SAAS,EAAC,kMAAkM,aAE5M,gBAAM,SAAS,EAAC,4DAA4D,aAI1E,KAAC,aAAa,iBACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,iBACnB,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAClC,SAAS,EAAC,gTAAgT,GAC1T,EACF,KAAC,eAAe,iBACH,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,iBACnB,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAClC,SAAS,EAAC,yRAAyR,GACnS,IACG,EACN,KAAK,CAAC,CAAC,CAAC;YACP,wEAAwE;YACxE,8BACc,MAAM,EAClB,SAAS,EAAE,EAAE,CACX,oHAAoH,EACpH,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CACjD,YAED,eAAM,SAAS,EAAC,uDAAuD,YACrE,gBAAM,SAAS,EAAC,MAAM,aACpB,eAAM,SAAS,EAAC,oBAAoB,YAAE,KAAK,GAAQ,EACnD,eAAM,SAAS,EAAC,qBAAqB,kBAAS,IACzC,GACF,GACF,CACR,CAAC,CAAC,CAAC,IAAI,IACU,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ClassValue } from 'clsx';
|
|
2
|
+
/**
|
|
3
|
+
* Join class names, last one winning within a Tailwind family — shadcn's `cn`.
|
|
4
|
+
*
|
|
5
|
+
* The design doc's decision 7 dropped `tailwind-merge` on the grounds that a
|
|
6
|
+
* package owning every class name in its subtree has no conflicts to reconcile.
|
|
7
|
+
* The vendored components disprove it: one composer button arrives carrying
|
|
8
|
+
* `size-8` (ui/button's icon variant), `size-6` (tooltip-icon-button) and
|
|
9
|
+
* `size-7` (the caller), plus `rounded-lg` and `rounded-full`. All of them are
|
|
10
|
+
* real rules, armour marks all of them `!important`, and the winner is then
|
|
11
|
+
* Tailwind's own source order — so the button rendered 32px and square where the
|
|
12
|
+
* website renders 28px and round. Order in the string, which is what every
|
|
13
|
+
* shadcn-registry file is written against, only decides with this merge.
|
|
14
|
+
*
|
|
15
|
+
* Cost, measured on a Vite app that renders <Talk2ViewChat> and nothing else:
|
|
16
|
+
* 407.1 KB gzip without it, 416.2 KB with — 9.1 KB, ~2%.
|
|
17
|
+
*/
|
|
18
|
+
export declare const cn: (...inputs: ClassValue[]) => string;
|
|
19
|
+
//# sourceMappingURL=cn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../../src/chat/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,KAAG,MAA+B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
/**
|
|
4
|
+
* Join class names, last one winning within a Tailwind family — shadcn's `cn`.
|
|
5
|
+
*
|
|
6
|
+
* The design doc's decision 7 dropped `tailwind-merge` on the grounds that a
|
|
7
|
+
* package owning every class name in its subtree has no conflicts to reconcile.
|
|
8
|
+
* The vendored components disprove it: one composer button arrives carrying
|
|
9
|
+
* `size-8` (ui/button's icon variant), `size-6` (tooltip-icon-button) and
|
|
10
|
+
* `size-7` (the caller), plus `rounded-lg` and `rounded-full`. All of them are
|
|
11
|
+
* real rules, armour marks all of them `!important`, and the winner is then
|
|
12
|
+
* Tailwind's own source order — so the button rendered 32px and square where the
|
|
13
|
+
* website renders 28px and round. Order in the string, which is what every
|
|
14
|
+
* shadcn-registry file is written against, only decides with this merge.
|
|
15
|
+
*
|
|
16
|
+
* Cost, measured on a Vite app that renders <Talk2ViewChat> and nothing else:
|
|
17
|
+
* 407.1 KB gzip without it, 416.2 KB with — 9.1 KB, ~2%.
|
|
18
|
+
*/
|
|
19
|
+
export const cn = (...inputs) => twMerge(clsx(inputs));
|
|
20
|
+
//# sourceMappingURL=cn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","sourceRoot":"","sources":["../../../src/chat/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAoB,EAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Talk2ViewDictationPhase } from '../../assistant-ui/index.js';
|
|
2
|
+
export interface DictationPhaseStore {
|
|
3
|
+
set: (phase: Talk2ViewDictationPhase) => void;
|
|
4
|
+
get: () => Talk2ViewDictationPhase;
|
|
5
|
+
subscribe: (listener: () => void) => () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createDictationPhaseStore(): DictationPhaseStore;
|
|
8
|
+
export declare function useDictationPhase(store: DictationPhaseStore): Talk2ViewDictationPhase;
|
|
9
|
+
//# sourceMappingURL=dictation-phase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictation-phase.d.ts","sourceRoot":"","sources":["../../../src/chat/lib/dictation-phase.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC9C,GAAG,EAAE,MAAM,uBAAuB,CAAC;IACnC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CACjD;AAED,wBAAgB,yBAAyB,IAAI,mBAAmB,CAiB/D;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,uBAAuB,CAErF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the current dictation is up to. assistant-ui says "listening" from the
|
|
3
|
+
* mic tap until the transcript lands; the SDK's adapter also reports the wait in
|
|
4
|
+
* between, and the composer's voice button shows it.
|
|
5
|
+
*
|
|
6
|
+
* One store per chat, held in the chat's context — two chats on one page
|
|
7
|
+
* (a task pane and a launcher, say) each dictate on their own.
|
|
8
|
+
*/
|
|
9
|
+
import { useSyncExternalStore } from 'react';
|
|
10
|
+
export function createDictationPhaseStore() {
|
|
11
|
+
let phase = 'idle';
|
|
12
|
+
const listeners = new Set();
|
|
13
|
+
return {
|
|
14
|
+
set: (next) => {
|
|
15
|
+
if (next === phase)
|
|
16
|
+
return;
|
|
17
|
+
phase = next;
|
|
18
|
+
listeners.forEach((notify) => notify());
|
|
19
|
+
},
|
|
20
|
+
get: () => phase,
|
|
21
|
+
subscribe: (listener) => {
|
|
22
|
+
listeners.add(listener);
|
|
23
|
+
return () => {
|
|
24
|
+
listeners.delete(listener);
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const IDLE = () => 'idle';
|
|
30
|
+
export function useDictationPhase(store) {
|
|
31
|
+
return useSyncExternalStore(store.subscribe, store.get, IDLE);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=dictation-phase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictation-phase.js","sourceRoot":"","sources":["../../../src/chat/lib/dictation-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAS7C,MAAM,UAAU,yBAAyB;IACvC,IAAI,KAAK,GAA4B,MAAM,CAAC;IAC5C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;IACxC,OAAO;QACL,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;YACZ,IAAI,IAAI,KAAK,KAAK;gBAAE,OAAO;YAC3B,KAAK,GAAG,IAAI,CAAC;YACb,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK;QAChB,SAAS,EAAE,CAAC,QAAQ,EAAE,EAAE;YACtB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACxB,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC7B,CAAC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,MAAe,CAAC;AAEnC,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IAC1D,OAAO,oBAAoB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../../src/chat/lib/guard.ts"],"names":[],"mappings":"AAaA,sFAAsF;AACtF,eAAO,MAAM,gBAAgB,eAAuC,CAAC;AAcrE,wBAAgB,oBAAoB,IAAI,IAAI,CAiB3C"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two physical copies of `@assistant-ui/react` on one page fail silently: each
|
|
3
|
+
* copy has its own React context, so the chat mounts, renders, and then does
|
|
4
|
+
* nothing — the runtime provider fills one context and the components read the
|
|
5
|
+
* other. It happens when a host app installs its own incompatible version
|
|
6
|
+
* beside ours and npm cannot dedupe them.
|
|
7
|
+
*
|
|
8
|
+
* The check is a module-identity comparison, not a counter: a second copy is a
|
|
9
|
+
* different module namespace object, which is exactly the thing that breaks.
|
|
10
|
+
* It runs in development only, where the fix (align the versions) is made.
|
|
11
|
+
*/
|
|
12
|
+
import * as assistantUi from '@assistant-ui/react';
|
|
13
|
+
/** Where the first-loaded copy stamps itself. Exported so tests can stage a clash. */
|
|
14
|
+
export const ASSISTANT_UI_KEY = Symbol.for('talk2view.assistant-ui');
|
|
15
|
+
const inProduction = () => {
|
|
16
|
+
try {
|
|
17
|
+
return typeof process !== 'undefined' && process?.env?.NODE_ENV === 'production';
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export function assertOneAssistantUi() {
|
|
24
|
+
if (inProduction())
|
|
25
|
+
return;
|
|
26
|
+
const globals = globalThis;
|
|
27
|
+
const first = globals[ASSISTANT_UI_KEY];
|
|
28
|
+
if (first === undefined) {
|
|
29
|
+
globals[ASSISTANT_UI_KEY] = assistantUi;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (first === assistantUi)
|
|
33
|
+
return;
|
|
34
|
+
throw new Error('Two copies of @assistant-ui/react are loaded. The Talk2View chat and the ' +
|
|
35
|
+
'rest of your app each got their own, so messages, tools and dictation ' +
|
|
36
|
+
'will not reach the UI. Install one version both can share — ' +
|
|
37
|
+
'`npm ls @assistant-ui/react` shows which copies exist, and matching the ' +
|
|
38
|
+
"version @talk2view/sdk depends on lets npm collapse them into one. " +
|
|
39
|
+
'(This check does not run in production builds.)');
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.js","sourceRoot":"","sources":["../../../src/chat/lib/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AAEnD,sFAAsF;AACtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;AAMrE,MAAM,YAAY,GAAG,GAAY,EAAE;IACjC,IAAI,CAAC;QACH,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,EAAE,GAAG,EAAE,QAAQ,KAAK,YAAY,CAAC;IACnF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,oBAAoB;IAClC,IAAI,YAAY,EAAE;QAAE,OAAO;IAC3B,MAAM,OAAO,GAAG,UAAgD,CAAC;IACjE,MAAM,KAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACxC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,CAAC,gBAAgB,CAAC,GAAG,WAAW,CAAC;QACxC,OAAO;IACT,CAAC;IACD,IAAI,KAAK,KAAK,WAAW;QAAE,OAAO;IAClC,MAAM,IAAI,KAAK,CACb,2EAA2E;QACzE,wEAAwE;QACxE,8DAA8D;QAC9D,0EAA0E;QAC1E,qEAAqE;QACrE,iDAAiD,CACpD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const LAUNCHER_COLOURWAYS: readonly ["smoke-teal", "teal-smoke", "teal-white"];
|
|
2
|
+
export type LauncherColourway = (typeof LAUNCHER_COLOURWAYS)[number];
|
|
3
|
+
export declare const DEFAULT_LAUNCHER_COLOURWAY: LauncherColourway;
|
|
4
|
+
export declare const LAUNCHER_COLOURWAY_LABELS: Record<LauncherColourway, string>;
|
|
5
|
+
/** Remember the visitor's choice and repaint every launcher on the page. */
|
|
6
|
+
export declare function setLauncherColourway(colourway: LauncherColourway): void;
|
|
7
|
+
/**
|
|
8
|
+
* The colourway to paint: the visitor's, when the integrator allows one, else
|
|
9
|
+
* the integrator's. A remembered choice is ignored — not deleted — when the
|
|
10
|
+
* integrator takes the option away, so turning it back on restores it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useLauncherColourway(fallback: LauncherColourway, visitorChoice: boolean): LauncherColourway;
|
|
13
|
+
export declare function markLauncherOpened(): void;
|
|
14
|
+
/**
|
|
15
|
+
* True once this visitor has opened the chat. Renders as true on a server, so a
|
|
16
|
+
* returning visitor never sees the label flash in and back out on hydration.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useLauncherOpened(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* What the launcher tells the rest of the chat about itself. Settings reads it
|
|
21
|
+
* to decide whether to offer the colour picker — and it lives here, not in
|
|
22
|
+
* `launcher.tsx`, so `views/settings.tsx` can import it without a cycle.
|
|
23
|
+
*/
|
|
24
|
+
export interface LauncherOptions {
|
|
25
|
+
/** The integrator's colourway: where the picker starts, and the fallback. */
|
|
26
|
+
colourway: LauncherColourway;
|
|
27
|
+
/** Whether the end-user may change it. */
|
|
28
|
+
visitorColourway: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare const LauncherOptionsContext: import("react").Context<LauncherOptions>;
|
|
31
|
+
/** The launcher around this chat. The defaults mean "there isn't one". */
|
|
32
|
+
export declare const useLauncherOptions: () => LauncherOptions;
|
|
33
|
+
//# sourceMappingURL=launcher-variant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher-variant.d.ts","sourceRoot":"","sources":["../../../src/chat/lib/launcher-variant.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,mBAAmB,qDAAsD,CAAC;AACvF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AACrE,eAAO,MAAM,0BAA0B,EAAE,iBAAgC,CAAC;AAE1E,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAIvE,CAAC;AA4BF,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAOvE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,iBAAiB,EAC3B,aAAa,EAAE,OAAO,GACrB,iBAAiB,CAGnB;AAqBD,wBAAgB,kBAAkB,IAAI,IAAI,CAOzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,SAAS,EAAE,iBAAiB,CAAC;IAC7B,0CAA0C;IAC1C,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAOD,eAAO,MAAM,sBAAsB,0CAA8C,CAAC;AAElF,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,QAAO,eAAqD,CAAC"}
|