@helpai/elements 0.15.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/configurator.mjs +17 -2
- package/elements-web-component.esm.js +25 -25
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +25 -25
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +25 -25
- package/elements.esm.js.map +3 -3
- package/elements.js +25 -25
- package/elements.js.map +3 -3
- package/index.d.ts +34 -3
- package/index.mjs +168 -49
- package/package.json +1 -1
- package/schema.d.ts +52 -49
- package/schema.json +29 -2
- package/schema.mjs +17 -2
- package/style.css +3 -3
- package/web-component.mjs +167 -49
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, L as Link, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial } from './deployment-
|
|
1
|
+
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, L as Link, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial } from './deployment-DvzmRV7E.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -40,7 +40,7 @@ interface ClientStorage {
|
|
|
40
40
|
* populated {@link Strings} map. UI components then read `strings.send` as a
|
|
41
41
|
* normal property access — no per-render lookup, no per-render allocation.
|
|
42
42
|
*/
|
|
43
|
-
type StringKey = "launcherOpen" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "scrollToBottom" | "popOut" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyBack" | "conversationLoading" | "conversationClosed" | "startNewConversation" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "errorRateLimited" | "loading" | "thinking" | "thoughts" | "usedTool" | "collapseSidebar" | "expandSidebar" | "formSubmit" | "formSkip" | "formRequired" | "formInvalidEmail" | "formInvalidTel" | "formInvalidUrl" | "formInvalidNumber" | "formTooShort" | "formTooLong" | "formNumberTooSmall" | "formNumberTooLarge" | "formPatternMismatch" | "formChooseAtLeast" | "formChooseAtMost" | "formOther" | "formOtherPlaceholder" | "inputRequired" | "inputSubmit" | "inputSkip" | "inputSubmitted" | "approvalRequired" | "approve" | "reject" | "approved" | "rejected" | "approvalReason" | "stepNoLongerActive" | "tabHome" | "tabConversations" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
|
|
43
|
+
type StringKey = "launcherOpen" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "scrollToBottom" | "popOut" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "textSize" | "textSizeSmall" | "textSizeNormal" | "textSizeLarge" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyBack" | "conversationLoading" | "conversationClosed" | "startNewConversation" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "errorRateLimited" | "loading" | "thinking" | "thoughts" | "usedTool" | "collapseSidebar" | "expandSidebar" | "formSubmit" | "formSkip" | "formSubmitted" | "formSkipped" | "formRequired" | "formInvalidEmail" | "formInvalidTel" | "formInvalidUrl" | "formInvalidNumber" | "formTooShort" | "formTooLong" | "formNumberTooSmall" | "formNumberTooLarge" | "formPatternMismatch" | "formChooseAtLeast" | "formChooseAtMost" | "formOther" | "formOtherPlaceholder" | "inputRequired" | "inputSubmit" | "inputSkip" | "inputSubmitted" | "approvalRequired" | "approve" | "reject" | "approved" | "rejected" | "approvalReason" | "stepNoLongerActive" | "tabHome" | "tabConversations" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
|
|
44
44
|
/** A partial map for one locale — what overrides look like on the wire. */
|
|
45
45
|
type LocaleStrings = Partial<Record<StringKey, string>>;
|
|
46
46
|
/**
|
|
@@ -109,6 +109,8 @@ interface UserPrefs {
|
|
|
109
109
|
soundMuted?: boolean;
|
|
110
110
|
/** Theme picked from the theme switcher. */
|
|
111
111
|
themeMode?: "auto" | "light" | "dark";
|
|
112
|
+
/** Text size picked from the text-size switcher. */
|
|
113
|
+
textSize?: "small" | "normal" | "large";
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
/**
|
|
@@ -176,6 +178,21 @@ type WirePart = {
|
|
|
176
178
|
errorText?: string;
|
|
177
179
|
approval?: ToolApproval;
|
|
178
180
|
};
|
|
181
|
+
/**
|
|
182
|
+
* One recorded form submission, returned on `/ai/agent/start-conversation`
|
|
183
|
+
* (alongside `messages`) so the widget can re-place the collapsed
|
|
184
|
+
* "form submitted" marker at its chronological spot in the timeline.
|
|
185
|
+
* Values are NOT echoed back — the marker is pure indication.
|
|
186
|
+
*/
|
|
187
|
+
interface FormSubmissionRecord {
|
|
188
|
+
formId: string;
|
|
189
|
+
/** The trigger kind that surfaced the form. */
|
|
190
|
+
trigger: string;
|
|
191
|
+
/** True when the visitor skipped instead of answering. */
|
|
192
|
+
skipped?: boolean;
|
|
193
|
+
/** Epoch ms — same clock + name as {@link WireMessage.createdAt}. */
|
|
194
|
+
createdAt?: number;
|
|
195
|
+
}
|
|
179
196
|
/** One-shot bot persona shown in the panel header. */
|
|
180
197
|
interface ConversationAgent {
|
|
181
198
|
name: string;
|
|
@@ -237,6 +254,13 @@ interface StartConversationResponse {
|
|
|
237
254
|
/** Page-mode sidebar blocks (navigation, link cards). Backend ships it whenever the deployment renders the page-shell sidebar. */
|
|
238
255
|
blocks?: Record<string, unknown>;
|
|
239
256
|
messages?: WireMessage[];
|
|
257
|
+
/**
|
|
258
|
+
* Form submissions recorded for this conversation (via
|
|
259
|
+
* `/ai/agent/submit-form`), returned like `messages` so the widget can
|
|
260
|
+
* reconstruct the timeline on resume — each renders as a collapsed
|
|
261
|
+
* "form submitted" marker at its chronological position.
|
|
262
|
+
*/
|
|
263
|
+
formSubmissions?: FormSubmissionRecord[];
|
|
240
264
|
/**
|
|
241
265
|
* Server's authoritative copy of the visitor's preferences. When present,
|
|
242
266
|
* client adopts it (overrides local cache) and re-applies it to the UI
|
|
@@ -291,6 +315,8 @@ type Position = "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
|
291
315
|
* Page mode reads `site` and `blocks` from the start-conversation response.
|
|
292
316
|
*/
|
|
293
317
|
type Mode = "floating" | "inline" | "standalone" | "page" | "modal" | "drawer";
|
|
318
|
+
/** End-user text-size preference — scales the whole type ramp. */
|
|
319
|
+
type TextSize = "small" | "normal" | "large";
|
|
294
320
|
/** Theme preference. `auto` follows `prefers-color-scheme`. */
|
|
295
321
|
type ThemePreference = "auto" | "light" | "dark";
|
|
296
322
|
/**
|
|
@@ -331,9 +357,10 @@ interface WelcomeOptions {
|
|
|
331
357
|
* - `sound` — Toggle notification sounds + haptics on/off (switch-style).
|
|
332
358
|
* - `language` — Switch the UI locale at runtime.
|
|
333
359
|
* - `theme` — Cycle `auto` / `light` / `dark`.
|
|
360
|
+
* - `textSize` — Cycle `normal` / `large` / `small`.
|
|
334
361
|
* - `close` — Close the floating panel.
|
|
335
362
|
*/
|
|
336
|
-
type ActionName = "clear" | "expand" | "fullscreen" | "popOut" | "sound" | "history" | "language" | "theme" | "close";
|
|
363
|
+
type ActionName = "clear" | "expand" | "fullscreen" | "popOut" | "sound" | "history" | "language" | "theme" | "textSize" | "close";
|
|
337
364
|
/**
|
|
338
365
|
* The header's enabled actions. Unlisted actions are hidden; order is
|
|
339
366
|
* irrelevant. Per-mode defaults (`DEFAULT_ACTIONS_BY_MODE`) pick a sensible
|
|
@@ -1062,6 +1089,8 @@ interface ResolvedOptions {
|
|
|
1062
1089
|
pageContext?: PageContext;
|
|
1063
1090
|
position: Position;
|
|
1064
1091
|
themeMode: ThemePreference;
|
|
1092
|
+
/** Active text size. Default `normal`; the end-user's pick overrides at runtime. */
|
|
1093
|
+
textSize: TextSize;
|
|
1065
1094
|
themeOverrides: ThemeOverrides;
|
|
1066
1095
|
mode: Mode;
|
|
1067
1096
|
iframe: boolean;
|
|
@@ -1295,6 +1324,8 @@ interface EventMap {
|
|
|
1295
1324
|
localeChange: string;
|
|
1296
1325
|
/** End-user picked a different theme mode (`auto` / `light` / `dark`). */
|
|
1297
1326
|
themeChange: ThemePreference;
|
|
1327
|
+
/** End-user picked a different text size (`small` / `normal` / `large`). */
|
|
1328
|
+
textSizeChange: TextSize;
|
|
1298
1329
|
/** End-user toggled the global sound mute. */
|
|
1299
1330
|
soundToggle: {
|
|
1300
1331
|
muted: boolean;
|