@widgetic/chat 0.1.34 → 0.1.36

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.
@@ -2,12 +2,18 @@ import type { ChatMessage, ChatContext } from '../types/index.js';
2
2
  import type { ClarificationSuggestion, DesignControlRequest, VersionRating } from '../types/message.js';
3
3
  import { type VersionThumb } from '../utils/versionRatings.js';
4
4
  import type { Snippet } from 'svelte';
5
+ import { type GenerationPlanWire } from '../utils/generationPlan.js';
5
6
  interface Props {
6
7
  class?: string;
7
8
  messages: ChatMessage[];
8
9
  isLoading?: boolean;
9
- /** True after the conversation list/messages finished initializing — gates the empty state so suggestions never flash at mount. */
10
+ /** True after the conversation list/messages finished initializing. */
10
11
  isInitialized?: boolean;
12
+ /**
13
+ * The empty-state suggestions. Stays false from the first paint.
14
+ * The parent sets it only after the message read, and only when that read was empty.
15
+ */
16
+ showEmptyState?: boolean;
11
17
  context: ChatContext;
12
18
  isCompleted?: boolean;
13
19
  /**
@@ -37,26 +43,33 @@ interface Props {
37
43
  /**
38
44
  * Every saved version for this widget. When one prompt produced two versions
39
45
  * but the chat stored only one user message, the missing older version is
40
- * shown as its own turn so "You are here" can land on it.
46
+ * shown as its own turn, so each version has its own place in the list.
41
47
  */
42
48
  versionTimeline?: Array<{
43
49
  version: number;
44
50
  sha: string;
45
51
  prompt: string;
46
52
  }>;
47
- /** Dropdown selection. The badge follows this version, not only a commit sha. */
48
- viewingVersion?: number | null;
49
53
  /** When false, hide commit hashes next to the version label (user mode). */
50
54
  showCommitMeta?: boolean;
51
- /** True while codegen / send is in flight — suppresses premature Retry. */
55
+ /** True while codegen / send is in flight — no icons are drawn under the last message and no restore is offered. */
52
56
  isGenerating?: boolean;
53
57
  /** Tail of the model stream for the generation in flight. Empty when it is only thinking. */
54
58
  generationStream?: string;
59
+ /** Rolling tail of streamed model reasoning during codegen. */
60
+ generationThinking?: string;
61
+ /** Gateway build plan while codegen runs; `null` hides the card. */
62
+ generationPlan?: GenerationPlanWire | null;
55
63
  onSuggestionSelected?: (suggestion: string) => void;
64
+ /**
65
+ * Draws a restore icon on the messages the person sent, shown when the pointer is over the message. Pressing it asks the host to
66
+ * put the widget back to how it was BEFORE that message: called with the id of the saved reply that stands for that earlier state
67
+ * and its place in `messages`. Without it no restore icon is drawn.
68
+ */
56
69
  onRestoreCheckpoint?: (messageId: string, messageIndex: number) => void;
57
70
  /**
58
- * Gives each version a thumbs up and a thumbs down next to its name. Called with the id of the assistant message that
59
- * announced the version and the thumb that was pressed; the host keeps the rating. Without it no thumbs are drawn.
71
+ * Gives the last message a thumbs up and a thumbs down (next to copy and regenerate). Called with the id of the assistant message
72
+ * that announced the version and the thumb that was pressed; the host keeps the rating. Without it no thumbs are drawn.
60
73
  */
61
74
  onRateVersion?: (messageId: string, pressed: VersionThumb) => void;
62
75
  /** The rating each version has, by the id of the message that announced it: what the thumbs show as pressed. */
@@ -0,0 +1,125 @@
1
+ <script lang="ts">
2
+ /**
3
+ * One small icon button of the chat's message rows: copy, regenerate, the two thumbs and the restore icon. It is the only place
4
+ * these icons get their look, so the five can never drift apart.
5
+ *
6
+ * The button names itself (`label`) for a screen reader and shows the same words as a tooltip, above the button (a row of icons) or
7
+ * on the side the line starts (an icon at the end of a row, where a tooltip above would cover the message it belongs to).
8
+ * The label is already in the language of the chat: the parent asks the catalog for it.
9
+ */
10
+ import type { Snippet } from 'svelte';
11
+
12
+ interface Props {
13
+ /** What the button does: its accessible name and its tooltip. */
14
+ label: string;
15
+ onclick: (event: MouseEvent) => void;
16
+ /** Where the tooltip opens. `start` is the side the line starts on, so it turns around on a right to left screen. */
17
+ tooltipSide?: 'above' | 'start';
18
+ /** For a toggle (a thumb): whether it is chosen. Left out, the button is a plain button. */
19
+ pressed?: boolean;
20
+ children: Snippet;
21
+ }
22
+
23
+ let { label, onclick, tooltipSide = 'above', pressed = undefined, children }: Props = $props();
24
+ </script>
25
+
26
+ <button
27
+ type="button"
28
+ class={['wc-icon-btn', { 'wc-icon-btn-tip-start': tooltipSide === 'start' }]}
29
+ aria-label={label}
30
+ aria-pressed={pressed}
31
+ data-tooltip={label}
32
+ {onclick}
33
+ >
34
+ {@render children()}
35
+ </button>
36
+
37
+ <style>
38
+ .wc-icon-btn {
39
+ position: relative;
40
+ display: inline-flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ width: 28px;
44
+ height: 28px;
45
+ padding: 0;
46
+ border: 0;
47
+ border-radius: 8px;
48
+ background: transparent;
49
+ color: #6b7280;
50
+ cursor: pointer;
51
+ transition: background-color 0.15s ease, color 0.15s ease;
52
+ }
53
+
54
+ .wc-icon-btn:hover {
55
+ background: rgba(107, 114, 128, 0.16);
56
+ color: #111827;
57
+ }
58
+
59
+ .wc-icon-btn:focus-visible {
60
+ outline: 2px solid #93c5fd;
61
+ outline-offset: 1px;
62
+ }
63
+
64
+ /* A chosen thumb: the icon is filled by its own markup, and the button reads darker. */
65
+ .wc-icon-btn[aria-pressed='true'] {
66
+ color: #111827;
67
+ }
68
+
69
+ /* The tooltip: the button's own words, a moment after the pointer rests on it (or at once for the keyboard). */
70
+ .wc-icon-btn::after {
71
+ content: attr(data-tooltip);
72
+ position: absolute;
73
+ z-index: 20;
74
+ bottom: calc(100% + 6px);
75
+ left: 50%;
76
+ transform: translateX(-50%);
77
+ padding: 4px 8px;
78
+ border: 1px solid #e5e7eb;
79
+ border-radius: 8px;
80
+ background: #ffffff;
81
+ color: #111827;
82
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
83
+ font-size: 11px;
84
+ font-weight: 500;
85
+ line-height: 1.2;
86
+ white-space: nowrap;
87
+ pointer-events: none;
88
+ opacity: 0;
89
+ visibility: hidden;
90
+ transition: opacity 0.1s ease;
91
+ }
92
+
93
+ .wc-icon-btn:hover::after {
94
+ opacity: 1;
95
+ visibility: visible;
96
+ transition-delay: 0.3s;
97
+ }
98
+
99
+ .wc-icon-btn:focus-visible::after {
100
+ opacity: 1;
101
+ visibility: visible;
102
+ }
103
+
104
+ .wc-icon-btn-tip-start::after {
105
+ top: 50%;
106
+ bottom: auto;
107
+ left: auto;
108
+ inset-inline-end: calc(100% + 6px);
109
+ transform: translateY(-50%);
110
+ }
111
+
112
+ /* A finger has no hover: no tooltip is left behind after a tap. */
113
+ @media (hover: none) {
114
+ .wc-icon-btn::after {
115
+ display: none;
116
+ }
117
+ }
118
+
119
+ @media (prefers-reduced-motion: reduce) {
120
+ .wc-icon-btn,
121
+ .wc-icon-btn::after {
122
+ transition: none;
123
+ }
124
+ }
125
+ </style>
@@ -0,0 +1,22 @@
1
+ /**
2
+ * One small icon button of the chat's message rows: copy, regenerate, the two thumbs and the restore icon. It is the only place
3
+ * these icons get their look, so the five can never drift apart.
4
+ *
5
+ * The button names itself (`label`) for a screen reader and shows the same words as a tooltip, above the button (a row of icons) or
6
+ * on the side the line starts (an icon at the end of a row, where a tooltip above would cover the message it belongs to).
7
+ * The label is already in the language of the chat: the parent asks the catalog for it.
8
+ */
9
+ import type { Snippet } from 'svelte';
10
+ interface Props {
11
+ /** What the button does: its accessible name and its tooltip. */
12
+ label: string;
13
+ onclick: (event: MouseEvent) => void;
14
+ /** Where the tooltip opens. `start` is the side the line starts on, so it turns around on a right to left screen. */
15
+ tooltipSide?: 'above' | 'start';
16
+ /** For a toggle (a thumb): whether it is chosen. Left out, the button is a plain button. */
17
+ pressed?: boolean;
18
+ children: Snippet;
19
+ }
20
+ declare const IconButton: import("svelte").Component<Props, {}, "">;
21
+ type IconButton = ReturnType<typeof IconButton>;
22
+ export default IconButton;
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import type { VersionRating } from '../types/message.js';
3
+ import { useChatLanguage } from '../i18n/language.js';
4
+ import { copyTextToClipboard } from '../utils/messageActions.js';
5
+ import type { VersionThumb } from '../utils/versionRatings.js';
6
+ import { MessageRatingActions } from '@widgetic/design-system/components/chat/index';
7
+
8
+ const { t } = useChatLanguage();
9
+
10
+ interface Props {
11
+ copyText: string;
12
+ canRegenerate: boolean;
13
+ onRegenerate: () => void;
14
+ ratedMessageId: string | null;
15
+ rating?: VersionRating;
16
+ onRate: (messageId: string, pressed: VersionThumb) => void;
17
+ }
18
+
19
+ let { copyText, canRegenerate, onRegenerate, ratedMessageId, rating = 'none', onRate }: Props = $props();
20
+
21
+ async function handleCopy() {
22
+ try {
23
+ await copyTextToClipboard(copyText);
24
+ } catch (error) {
25
+ console.warn('[Chat] Copy of the message failed:', error);
26
+ }
27
+ }
28
+ </script>
29
+
30
+ <div role="group" aria-label={$t('chat.messages.actions')}>
31
+ <MessageRatingActions
32
+ {copyText}
33
+ {canRegenerate}
34
+ {ratedMessageId}
35
+ {rating}
36
+ onCopy={copyText !== '' ? handleCopy : undefined}
37
+ onRegenerate={canRegenerate ? onRegenerate : undefined}
38
+ onRate={ratedMessageId ? onRate : undefined}
39
+ messages={{
40
+ copy: $t('chat.messages.copy'),
41
+ copied: $t('chat.messages.copied'),
42
+ regenerate: $t('chat.messages.regenerate'),
43
+ rateGroup: $t('chat.messages.rateGroup'),
44
+ rateUp: $t('chat.messages.rateUp'),
45
+ rateDown: $t('chat.messages.rateDown')
46
+ }}
47
+ />
48
+ </div>
@@ -0,0 +1,13 @@
1
+ import type { VersionRating } from '../types/message.js';
2
+ import type { VersionThumb } from '../utils/versionRatings.js';
3
+ interface Props {
4
+ copyText: string;
5
+ canRegenerate: boolean;
6
+ onRegenerate: () => void;
7
+ ratedMessageId: string | null;
8
+ rating?: VersionRating;
9
+ onRate: (messageId: string, pressed: VersionThumb) => void;
10
+ }
11
+ declare const MessageActions: import("svelte").Component<Props, {}, "">;
12
+ type MessageActions = ReturnType<typeof MessageActions>;
13
+ export default MessageActions;
@@ -0,0 +1,44 @@
1
+ <script lang="ts">
2
+ import { ChatHeader } from '@widgetic/design-system/components/chat/index';
3
+ import { useChatLanguage } from '../i18n/language.js';
4
+
5
+ interface Props {
6
+ title?: string;
7
+ showConsole?: boolean;
8
+ consoleOpen?: boolean;
9
+ onToggleConsole?: () => void;
10
+ onNewConversation?: () => void;
11
+ onOpenHistory?: () => void;
12
+ onTitleClick?: () => void;
13
+ }
14
+
15
+ let {
16
+ title = '',
17
+ showConsole = false,
18
+ consoleOpen = false,
19
+ onToggleConsole,
20
+ onNewConversation,
21
+ onOpenHistory,
22
+ onTitleClick
23
+ }: Props = $props();
24
+
25
+ const { t } = useChatLanguage();
26
+ </script>
27
+
28
+ <ChatHeader
29
+ layout="panel"
30
+ class="border-border bg-background border-b"
31
+ title={title}
32
+ {showConsole}
33
+ {consoleOpen}
34
+ onToggleConsole={onToggleConsole}
35
+ onNewChat={onNewConversation}
36
+ onHistory={onOpenHistory}
37
+ onTitleClick={onTitleClick}
38
+ messages={{
39
+ newChat: $t('chat.header.newConversationTitle'),
40
+ history: $t('chat.header.switchConversation'),
41
+ console: $t('chat.header.console'),
42
+ openHistory: $t('chat.header.switchConversation')
43
+ }}
44
+ />
@@ -0,0 +1,12 @@
1
+ interface Props {
2
+ title?: string;
3
+ showConsole?: boolean;
4
+ consoleOpen?: boolean;
5
+ onToggleConsole?: () => void;
6
+ onNewConversation?: () => void;
7
+ onOpenHistory?: () => void;
8
+ onTitleClick?: () => void;
9
+ }
10
+ declare const PanelChatHeader: import("svelte").Component<Props, {}, "">;
11
+ type PanelChatHeader = ReturnType<typeof PanelChatHeader>;
12
+ export default PanelChatHeader;
@@ -1,199 +1,47 @@
1
1
  <script lang="ts">
2
2
  import { createEventDispatcher } from 'svelte';
3
- import { chatLog } from '../utils/logger.js';
4
3
  import type { ChatContext } from '../types/context.js';
5
4
  import { useChatLanguage } from '../i18n/language.js';
6
5
  import { suggestionKeysFor, suggestionTitleKeyFor } from '../i18n/suggestions.js';
7
- import { dirForUserText, useTextDirection } from '@widgetic/design-system/components/textDirection';
6
+ import { SuggestionCard } from '@widgetic/design-system/components/chat/index';
8
7
 
9
- // The words of the ideas, in the language of the chat above
10
8
  const { t } = useChatLanguage();
11
9
 
12
- // The way the screen is read: a suggestion is a sentence the assistant wrote, and reads by its own first letter on a right to left screen.
13
- const textDirection = useTextDirection();
14
-
15
- // Props
16
10
  interface Props {
17
11
  context: ChatContext;
18
12
  visible?: boolean;
19
13
  onHide?: () => void;
20
14
  }
21
-
15
+
22
16
  let { context, visible = true, onHide }: Props = $props();
23
-
17
+
24
18
  const dispatch = createEventDispatcher();
25
-
19
+
26
20
  function handleSuggestionClick(suggestion: string) {
27
- // chatLog('Suggestion clicked:', suggestion);
28
21
  dispatch('suggestionSelected', { suggestion });
29
22
  }
30
-
31
- // Get suggestions for current context
23
+
32
24
  let suggestionKeys = $derived(suggestionKeysFor(context.type));
33
25
  let titleKey = $derived(suggestionTitleKeyFor(context.type));
34
26
  </script>
35
27
 
36
28
  {#if visible && suggestionKeys.length > 0}
37
- <div class="suggestion-container">
38
- <div class="suggestion-header">
39
- <h4 class="suggestion-title">
29
+ <div class="suggestion-container flex w-full max-w-full flex-col gap-1">
30
+ <div class="flex items-center justify-between gap-2">
31
+ <h4 class="text-caption text-muted-foreground">
40
32
  {$t(titleKey)}
41
33
  </h4>
42
34
  {#if onHide}
43
- <button
44
- class="hide-suggestions-btn"
45
- onclick={onHide}
46
- >
35
+ <button type="button" class="text-caption text-muted-foreground hover:text-foreground" onclick={onHide}>
47
36
  {$t('chat.suggestions.hide')}
48
37
  </button>
49
38
  {/if}
50
39
  </div>
51
-
52
- <div class="suggestion-grid">
40
+ <div class="flex w-full flex-col gap-1">
53
41
  {#each suggestionKeys as suggestionKey (suggestionKey)}
54
42
  {@const suggestion = $t(suggestionKey)}
55
- <button
56
- class="suggestion-button"
57
- onclick={() => handleSuggestionClick(suggestion)}
58
- title={suggestion}
59
- >
60
- <span class="suggestion-text" dir={dirForUserText($textDirection)}>{suggestion}</span>
61
- <svg class="suggestion-arrow" viewBox="0 0 20 20" fill="currentColor">
62
- <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
63
- </svg>
64
- </button>
43
+ <SuggestionCard title={suggestion} onclick={() => handleSuggestionClick(suggestion)} />
65
44
  {/each}
66
45
  </div>
67
-
68
46
  </div>
69
47
  {/if}
70
-
71
- <style>
72
- .suggestion-container {
73
- padding: 1.5rem;
74
- background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
75
- border-radius: 0.75rem;
76
- border: 1px solid #e2e8f0;
77
- margin: 1rem;
78
- }
79
-
80
- .suggestion-header {
81
- display: flex;
82
- flex-direction: column;
83
- align-items: center;
84
- gap: 0.5rem;
85
- margin-bottom: 1rem;
86
- }
87
-
88
- .suggestion-title {
89
- font-size: 0.875rem;
90
- font-weight: 600;
91
- color: #1e293b;
92
- margin: 0;
93
- display: flex;
94
- align-items: center;
95
- gap: 0.5rem;
96
- text-align: center;
97
- }
98
-
99
- .hide-suggestions-btn {
100
- font-size: 0.75rem;
101
- color: #64748b;
102
- background: none;
103
- border: 1px solid #e2e8f0;
104
- border-radius: 9999px;
105
- padding: 0.25rem 0.75rem;
106
- cursor: pointer;
107
- transition: all 0.15s ease;
108
- white-space: nowrap;
109
- }
110
-
111
- .hide-suggestions-btn:hover {
112
- color: #374151;
113
- border-color: #cbd5e1;
114
- background: #f8fafc;
115
- }
116
-
117
- .suggestion-grid {
118
- display: grid;
119
- gap: 0.75rem;
120
- grid-template-columns: 1fr;
121
- }
122
-
123
- .suggestion-button {
124
- display: flex;
125
- align-items: center;
126
- justify-content: space-between;
127
- padding: 0.875rem 1rem;
128
- background: white;
129
- border: 1px solid #e2e8f0;
130
- border-radius: 0.5rem;
131
- color: #374151;
132
- font-size: 0.875rem;
133
- text-align: start;
134
- cursor: pointer;
135
- transition: all 0.2s ease;
136
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
137
- }
138
-
139
- .suggestion-button:hover {
140
- background: #f8fafc;
141
- border-color: #3b82f6;
142
- color: #1d4ed8;
143
- transform: translateY(-1px);
144
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
145
- }
146
-
147
- .suggestion-button:active {
148
- transform: translateY(0);
149
- }
150
-
151
- .suggestion-text {
152
- flex: 1;
153
- line-height: 1.4;
154
- }
155
-
156
- .suggestion-arrow {
157
- width: 1rem;
158
- height: 1rem;
159
- margin-inline-start: 0.75rem;
160
- opacity: 0.5;
161
- transition: all 0.2s ease;
162
- flex-shrink: 0;
163
- }
164
-
165
- .suggestion-button:hover .suggestion-arrow {
166
- opacity: 1;
167
- transform: translateX(2px);
168
- }
169
-
170
-
171
- /* Responsive adjustments */
172
- @media (min-width: 400px) {
173
- .suggestion-grid {
174
- grid-template-columns: 1fr;
175
- }
176
- }
177
-
178
- /* Animation for initial appearance */
179
- .suggestion-container {
180
- animation: fadeInUp 0.3s ease-out;
181
- }
182
-
183
- @keyframes fadeInUp {
184
- from {
185
- opacity: 0;
186
- transform: translateY(10px);
187
- }
188
- to {
189
- opacity: 1;
190
- transform: translateY(0);
191
- }
192
- }
193
-
194
- /* Focus styles for accessibility */
195
- .suggestion-button:focus-visible {
196
- outline: none;
197
- box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.1);
198
- }
199
- </style>
@@ -3,17 +3,17 @@ import { type MessageOverrides, type MessageProblem } from '@widgetic/design-sys
3
3
  * Called by the root component of a chat while it is created, so everything inside it speaks the page's language.
4
4
  * It gives back the words as stores and `update(settings)` for when the page sets the language again.
5
5
  */
6
- export declare const provideChatLanguage: (initial: import("@widgetic/design-system/i18n").I18nSettings) => import("@widgetic/design-system/i18n").I18nHandle<"chat.contextType.frame" | "chat.contextType.text" | "chat.contextType.image" | "chat.contextType.document" | "chat.contextType.canvas" | "chat.header.typeChat" | "chat.header.switchConversation" | "chat.header.conversations" | "chat.header.new" | "chat.header.untitled" | "chat.header.newConversationTitle" | "chat.header.newConversation" | "chat.header.close" | "chat.contextPreview.expand" | "chat.conversation.defaultTitle" | "chat.messages.startTitle" | "chat.messages.startHint" | "chat.messages.loadingHistory" | "chat.messages.thinking" | "chat.messages.viewing" | "chat.messages.viewingTitle" | "chat.messages.attachmentMissingTitle" | "chat.messages.attachmentMissingLabel" | "chat.messages.attachmentMissingCaption" | "chat.messages.retry" | "chat.messages.retryPromptTitle" | "chat.messages.retryLastTitle" | "chat.messages.upgrade" | "chat.messages.upgradeTitle" | "chat.messages.commitId" | "chat.messages.restore" | "chat.messages.restoreTitle" | "chat.messages.alreadyHead" | "chat.messages.rateGroup" | "chat.messages.rateUp" | "chat.messages.rateDown" | "chat.messages.version" | "chat.messages.restoredFrom" | "chat.messages.previousVersion" | "chat.suggestions.title.frame" | "chat.suggestions.title.text" | "chat.suggestions.title.image" | "chat.suggestions.title.document" | "chat.suggestions.title.other" | "chat.suggestions.hide" | "chat.suggestions.frame.generateCode" | "chat.suggestions.frame.improveLayout" | "chat.suggestions.frame.addInteractivity" | "chat.suggestions.frame.makeResponsive" | "chat.suggestions.frame.addAnimations" | "chat.suggestions.text.improveWriting" | "chat.suggestions.text.checkGrammar" | "chat.suggestions.text.alternativePhrasing" | "chat.suggestions.text.summarize" | "chat.suggestions.text.expand" | "chat.suggestions.image.describe" | "chat.suggestions.image.altText" | "chat.suggestions.image.improveDesign" | "chat.suggestions.image.toCode" | "chat.suggestions.image.extractText" | "chat.suggestions.document.summarize" | "chat.suggestions.document.keyPoints" | "chat.suggestions.document.checkErrors" | "chat.suggestions.document.improve" | "chat.suggestions.document.outline" | "chat.suggestions.other.ask" | "chat.suggestions.other.improve" | "chat.suggestions.other.explain" | "chat.suggestions.other.understand" | "chat.suggestions.other.options" | "chat.input.placeholder" | "chat.input.stop" | "chat.input.sending" | "chat.input.send" | "chat.actions.screenshot" | "chat.actions.screenshotTitle" | "chat.actions.screenshotLabel" | "chat.actions.record" | "chat.actions.stop" | "chat.actions.startRecordingTitle" | "chat.actions.stopRecordingTitle" | "chat.actions.startRecordingLabel" | "chat.actions.stopRecordingLabel" | "chat.actions.upload" | "chat.actions.uploadTitle" | "chat.actions.uploadLabel" | "chat.actions.selector" | "chat.actions.selectorTitle" | "chat.actions.selectorActiveTitle" | "chat.actions.selectorLabel" | "chat.selector.removeElement" | "chat.selector.clearAll" | "chat.actions.complete" | "chat.actions.completed" | "chat.actions.markCompleteTitle" | "chat.actions.markActiveTitle" | "chat.actions.markCompleteLabel" | "chat.actions.markActiveLabel" | "chat.resize.label" | "chat.resize.title" | "chat.attachment.alt" | "chat.attachment.untitled" | "chat.attachment.fileFallback" | "chat.attachment.namelessAlt" | "chat.attachment.previewAlt" | "chat.attachment.pdfTitle" | "chat.attachment.noVideo" | "chat.attachment.view" | "chat.attachment.viewFile" | "chat.attachment.more" | "chat.attachment.remove" | "chat.attachment.close" | "chat.size.bytes" | "chat.size.kb" | "chat.size.mb" | "chat.size.gb" | "chat.code.copy" | "chat.code.copyTitle" | "chat.code.copied" | "chat.status.active" | "chat.status.completed" | "chat.status.processing" | "chat.status.error" | "chat.status.messageCount" | "chat.error.dismiss" | "chat.error.retryLoad" | "chat.error.loadHistory" | "chat.error.initialize" | "chat.error.loadConversations" | "chat.error.loadConversation" | "chat.error.sendMessage" | "chat.error.sendSuggestion" | "chat.error.screenshotUnavailable" | "chat.error.screenshotFailed" | "chat.error.screenshotActionFailed" | "chat.error.recordingStartFailed" | "chat.error.recordingStopFailed" | "chat.error.recordingActionFailed" | "chat.error.actionFailed" | "chat.error.statusUpdateFailed" | "chat.error.restoreFailed">;
6
+ export declare const provideChatLanguage: any;
7
7
  /**
8
8
  * Called by a part of the chat while it is created. Gives its words as stores, so a part that is already on the screen
9
9
  * changes when the page sets the language again. Outside a chat (a part used on its own) it speaks English.
10
10
  */
11
- export declare const useChatLanguage: () => import("@widgetic/design-system/i18n").I18nContext<"chat.contextType.frame" | "chat.contextType.text" | "chat.contextType.image" | "chat.contextType.document" | "chat.contextType.canvas" | "chat.header.typeChat" | "chat.header.switchConversation" | "chat.header.conversations" | "chat.header.new" | "chat.header.untitled" | "chat.header.newConversationTitle" | "chat.header.newConversation" | "chat.header.close" | "chat.contextPreview.expand" | "chat.conversation.defaultTitle" | "chat.messages.startTitle" | "chat.messages.startHint" | "chat.messages.loadingHistory" | "chat.messages.thinking" | "chat.messages.viewing" | "chat.messages.viewingTitle" | "chat.messages.attachmentMissingTitle" | "chat.messages.attachmentMissingLabel" | "chat.messages.attachmentMissingCaption" | "chat.messages.retry" | "chat.messages.retryPromptTitle" | "chat.messages.retryLastTitle" | "chat.messages.upgrade" | "chat.messages.upgradeTitle" | "chat.messages.commitId" | "chat.messages.restore" | "chat.messages.restoreTitle" | "chat.messages.alreadyHead" | "chat.messages.rateGroup" | "chat.messages.rateUp" | "chat.messages.rateDown" | "chat.messages.version" | "chat.messages.restoredFrom" | "chat.messages.previousVersion" | "chat.suggestions.title.frame" | "chat.suggestions.title.text" | "chat.suggestions.title.image" | "chat.suggestions.title.document" | "chat.suggestions.title.other" | "chat.suggestions.hide" | "chat.suggestions.frame.generateCode" | "chat.suggestions.frame.improveLayout" | "chat.suggestions.frame.addInteractivity" | "chat.suggestions.frame.makeResponsive" | "chat.suggestions.frame.addAnimations" | "chat.suggestions.text.improveWriting" | "chat.suggestions.text.checkGrammar" | "chat.suggestions.text.alternativePhrasing" | "chat.suggestions.text.summarize" | "chat.suggestions.text.expand" | "chat.suggestions.image.describe" | "chat.suggestions.image.altText" | "chat.suggestions.image.improveDesign" | "chat.suggestions.image.toCode" | "chat.suggestions.image.extractText" | "chat.suggestions.document.summarize" | "chat.suggestions.document.keyPoints" | "chat.suggestions.document.checkErrors" | "chat.suggestions.document.improve" | "chat.suggestions.document.outline" | "chat.suggestions.other.ask" | "chat.suggestions.other.improve" | "chat.suggestions.other.explain" | "chat.suggestions.other.understand" | "chat.suggestions.other.options" | "chat.input.placeholder" | "chat.input.stop" | "chat.input.sending" | "chat.input.send" | "chat.actions.screenshot" | "chat.actions.screenshotTitle" | "chat.actions.screenshotLabel" | "chat.actions.record" | "chat.actions.stop" | "chat.actions.startRecordingTitle" | "chat.actions.stopRecordingTitle" | "chat.actions.startRecordingLabel" | "chat.actions.stopRecordingLabel" | "chat.actions.upload" | "chat.actions.uploadTitle" | "chat.actions.uploadLabel" | "chat.actions.selector" | "chat.actions.selectorTitle" | "chat.actions.selectorActiveTitle" | "chat.actions.selectorLabel" | "chat.selector.removeElement" | "chat.selector.clearAll" | "chat.actions.complete" | "chat.actions.completed" | "chat.actions.markCompleteTitle" | "chat.actions.markActiveTitle" | "chat.actions.markCompleteLabel" | "chat.actions.markActiveLabel" | "chat.resize.label" | "chat.resize.title" | "chat.attachment.alt" | "chat.attachment.untitled" | "chat.attachment.fileFallback" | "chat.attachment.namelessAlt" | "chat.attachment.previewAlt" | "chat.attachment.pdfTitle" | "chat.attachment.noVideo" | "chat.attachment.view" | "chat.attachment.viewFile" | "chat.attachment.more" | "chat.attachment.remove" | "chat.attachment.close" | "chat.size.bytes" | "chat.size.kb" | "chat.size.mb" | "chat.size.gb" | "chat.code.copy" | "chat.code.copyTitle" | "chat.code.copied" | "chat.status.active" | "chat.status.completed" | "chat.status.processing" | "chat.status.error" | "chat.status.messageCount" | "chat.error.dismiss" | "chat.error.retryLoad" | "chat.error.loadHistory" | "chat.error.initialize" | "chat.error.loadConversations" | "chat.error.loadConversation" | "chat.error.sendMessage" | "chat.error.sendSuggestion" | "chat.error.screenshotUnavailable" | "chat.error.screenshotFailed" | "chat.error.screenshotActionFailed" | "chat.error.recordingStartFailed" | "chat.error.recordingStopFailed" | "chat.error.recordingActionFailed" | "chat.error.actionFailed" | "chat.error.statusUpdateFailed" | "chat.error.restoreFailed">;
11
+ export declare const useChatLanguage: any;
12
12
  /**
13
13
  * The English `t` of the chat, for code that has no component around it. The screens of the chat get their words, in the
14
14
  * page's language, from `useChatLanguage`.
15
15
  */
16
- export declare const translateEnglish: import("@widgetic/design-system/i18n").Translate<"chat.contextType.frame" | "chat.contextType.text" | "chat.contextType.image" | "chat.contextType.document" | "chat.contextType.canvas" | "chat.header.typeChat" | "chat.header.switchConversation" | "chat.header.conversations" | "chat.header.new" | "chat.header.untitled" | "chat.header.newConversationTitle" | "chat.header.newConversation" | "chat.header.close" | "chat.contextPreview.expand" | "chat.conversation.defaultTitle" | "chat.messages.startTitle" | "chat.messages.startHint" | "chat.messages.loadingHistory" | "chat.messages.thinking" | "chat.messages.viewing" | "chat.messages.viewingTitle" | "chat.messages.attachmentMissingTitle" | "chat.messages.attachmentMissingLabel" | "chat.messages.attachmentMissingCaption" | "chat.messages.retry" | "chat.messages.retryPromptTitle" | "chat.messages.retryLastTitle" | "chat.messages.upgrade" | "chat.messages.upgradeTitle" | "chat.messages.commitId" | "chat.messages.restore" | "chat.messages.restoreTitle" | "chat.messages.alreadyHead" | "chat.messages.rateGroup" | "chat.messages.rateUp" | "chat.messages.rateDown" | "chat.messages.version" | "chat.messages.restoredFrom" | "chat.messages.previousVersion" | "chat.suggestions.title.frame" | "chat.suggestions.title.text" | "chat.suggestions.title.image" | "chat.suggestions.title.document" | "chat.suggestions.title.other" | "chat.suggestions.hide" | "chat.suggestions.frame.generateCode" | "chat.suggestions.frame.improveLayout" | "chat.suggestions.frame.addInteractivity" | "chat.suggestions.frame.makeResponsive" | "chat.suggestions.frame.addAnimations" | "chat.suggestions.text.improveWriting" | "chat.suggestions.text.checkGrammar" | "chat.suggestions.text.alternativePhrasing" | "chat.suggestions.text.summarize" | "chat.suggestions.text.expand" | "chat.suggestions.image.describe" | "chat.suggestions.image.altText" | "chat.suggestions.image.improveDesign" | "chat.suggestions.image.toCode" | "chat.suggestions.image.extractText" | "chat.suggestions.document.summarize" | "chat.suggestions.document.keyPoints" | "chat.suggestions.document.checkErrors" | "chat.suggestions.document.improve" | "chat.suggestions.document.outline" | "chat.suggestions.other.ask" | "chat.suggestions.other.improve" | "chat.suggestions.other.explain" | "chat.suggestions.other.understand" | "chat.suggestions.other.options" | "chat.input.placeholder" | "chat.input.stop" | "chat.input.sending" | "chat.input.send" | "chat.actions.screenshot" | "chat.actions.screenshotTitle" | "chat.actions.screenshotLabel" | "chat.actions.record" | "chat.actions.stop" | "chat.actions.startRecordingTitle" | "chat.actions.stopRecordingTitle" | "chat.actions.startRecordingLabel" | "chat.actions.stopRecordingLabel" | "chat.actions.upload" | "chat.actions.uploadTitle" | "chat.actions.uploadLabel" | "chat.actions.selector" | "chat.actions.selectorTitle" | "chat.actions.selectorActiveTitle" | "chat.actions.selectorLabel" | "chat.selector.removeElement" | "chat.selector.clearAll" | "chat.actions.complete" | "chat.actions.completed" | "chat.actions.markCompleteTitle" | "chat.actions.markActiveTitle" | "chat.actions.markCompleteLabel" | "chat.actions.markActiveLabel" | "chat.resize.label" | "chat.resize.title" | "chat.attachment.alt" | "chat.attachment.untitled" | "chat.attachment.fileFallback" | "chat.attachment.namelessAlt" | "chat.attachment.previewAlt" | "chat.attachment.pdfTitle" | "chat.attachment.noVideo" | "chat.attachment.view" | "chat.attachment.viewFile" | "chat.attachment.more" | "chat.attachment.remove" | "chat.attachment.close" | "chat.size.bytes" | "chat.size.kb" | "chat.size.mb" | "chat.size.gb" | "chat.code.copy" | "chat.code.copyTitle" | "chat.code.copied" | "chat.status.active" | "chat.status.completed" | "chat.status.processing" | "chat.status.error" | "chat.status.messageCount" | "chat.error.dismiss" | "chat.error.retryLoad" | "chat.error.loadHistory" | "chat.error.initialize" | "chat.error.loadConversations" | "chat.error.loadConversation" | "chat.error.sendMessage" | "chat.error.sendSuggestion" | "chat.error.screenshotUnavailable" | "chat.error.screenshotFailed" | "chat.error.screenshotActionFailed" | "chat.error.recordingStartFailed" | "chat.error.recordingStopFailed" | "chat.error.recordingActionFailed" | "chat.error.actionFailed" | "chat.error.statusUpdateFailed" | "chat.error.restoreFailed">;
16
+ export declare const translateEnglish: any;
17
17
  /**
18
18
  * Checks a page's `messages` against the chat's catalog without showing anything: a key that does not exist (with the
19
19
  * nearest real one), a value that is not text, a template that does not parse, or one that asks for a value the message