@helpai/elements 0.39.0 → 0.41.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, H as HandshakeResponse, L as Link, S as ServerConfig, b as SiteConfig, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial } from './deployment-CrsbcoCF.js';
1
+ export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, H as HandshakeResponse, L as Link, S as ServerConfig, b as SiteConfig, W as WidgetConfig, c as WidgetConfigPartial, d as WidgetSettings, e as WidgetSettingsPartial } from './deployment-CB6xjMr0.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" | "launcherLabel" | "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" | "historyContinue" | "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" | "formFillOut" | "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" | "homeStatus" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
43
+ type StringKey = "launcherOpen" | "launcherLabel" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "scrollToBottom" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "textSize" | "textSizeSmall" | "textSizeNormal" | "textSizeLarge" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyBack" | "historyContinue" | "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" | "formFillOut" | "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" | "homeStatus" | "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
  /**
@@ -89,6 +89,11 @@ type StringsOverride = LocaleStrings | Partial<Record<string, LocaleStrings>>;
89
89
  * `visitorId` is the deliberate exception: it stays global so the same browser
90
90
  * is one anonymous visitor everywhere (`${brand.cssPrefix}.visitorId`).
91
91
  *
92
+ * A `storageVersion` (when set) folds a `.v<version>` segment into EVERY key —
93
+ * including the global `visitorId` — so bumping it force-resets the entire
94
+ * client-side namespace for all users (a full fresh start: new visitor id,
95
+ * conversation, prefs, panel state). Unset → the unversioned keys.
96
+ *
92
97
  * Storage is pluggable via {@link ClientStorage} — pass a custom adapter
93
98
  * to add encryption, logging, or use a non-localStorage backend.
94
99
  */
@@ -265,14 +270,13 @@ type ResponseMode = "streaming" | "buffered";
265
270
  * - `clear` — Start a new conversation (compose icon).
266
271
  * - `expand` — Toggle `normal` ↔ `expanded` (1.5× panel).
267
272
  * - `fullscreen` — Toggle `normal` ↔ `fullscreen` (viewport fill).
268
- * - `popOut` — Open the conversation in a new browser tab.
269
273
  * - `sound` — Toggle notification sounds + haptics on/off (switch-style).
270
274
  * - `language` — Switch the UI locale at runtime.
271
275
  * - `theme` — Cycle `auto` / `light` / `dark`.
272
276
  * - `textSize` — Cycle `normal` / `large` / `small`.
273
277
  * - `close` — Close the floating panel.
274
278
  */
275
- type ActionName = "clear" | "expand" | "fullscreen" | "popOut" | "sound" | "history" | "language" | "theme" | "textSize" | "close";
279
+ type ActionName = "clear" | "expand" | "fullscreen" | "sound" | "history" | "language" | "theme" | "textSize" | "close";
276
280
  /**
277
281
  * The header's enabled actions. Unlisted actions are hidden; order is
278
282
  * irrelevant. Per-mode defaults (`DEFAULT_ACTIONS_BY_MODE`) pick a sensible
@@ -837,12 +841,6 @@ interface BehaviorOptions {
837
841
  showReasoning?: boolean;
838
842
  /** Show tool/function-call chips in the transcript. Default `false`. */
839
843
  showToolCalls?: boolean;
840
- /**
841
- * Override the URL the `popOut` action opens (carries
842
- * `?conversation=<id>&widgetId=<id>`). Falls back to the brand's
843
- * `BRAND.standaloneUrl` baked at build time. Server-pushable.
844
- */
845
- popOutUrl?: string;
846
844
  }
847
845
  /**
848
846
  * Section: panel header actions — the enabled set (`history`/`close` buttons +
@@ -1155,12 +1153,6 @@ interface ResolvedOptions {
1155
1153
  showReasoning: boolean;
1156
1154
  /** Show tool-call chips in the transcript. Default `false`. */
1157
1155
  showToolCalls: boolean;
1158
- /**
1159
- * Resolved popOut target — `behavior.popOutUrl` if set, else
1160
- * `BRAND.standaloneUrl`, else `""` (the popOut action is hidden
1161
- * when the resolved URL is empty).
1162
- */
1163
- popOutUrl: string;
1164
1156
  features: Required<Omit<FeatureFlags, "tools">> & {
1165
1157
  tools?: Array<string | ToolRef>;
1166
1158
  };
@@ -1248,6 +1240,14 @@ interface ResolvedOptions {
1248
1240
  interface ServerConfig {
1249
1241
  /** Data-API base override — adopted only when the host didn't set one. */
1250
1242
  dataApiBaseUrl?: string;
1243
+ /**
1244
+ * Storage-schema version — the deployment-owned force-reset lever, pushed ONLY
1245
+ * via the handshake (deliberately not an embed attribute / `init` option).
1246
+ * Pushing a new value abandons every client's prior storage namespace
1247
+ * (visitor id, conversation, prefs, panel state, caches) on next load. The
1248
+ * widget stashes it and the next mount folds `.v<version>` into every key.
1249
+ */
1250
+ storageVersion?: string;
1251
1251
  presentation?: PresentationOptions;
1252
1252
  behavior?: BehaviorOptions;
1253
1253
  theme?: ThemePreference | ThemeOverrides;
@@ -1325,8 +1325,6 @@ interface EventMap {
1325
1325
  expand: boolean;
1326
1326
  /** Fullscreen mode toggled. Payload is the new state. */
1327
1327
  fullscreen: boolean;
1328
- /** Widget was popped out into a standalone tab. */
1329
- popOut: void;
1330
1328
  /** End-user dragged the resize grip — payload is the resolved size. */
1331
1329
  resize: {
1332
1330
  width: number;
@@ -1578,14 +1576,6 @@ interface ChatWidgetInstance {
1578
1576
  destroy: () => void;
1579
1577
  /** Toggle fullscreen mode. In `standalone` mode this is a no-op. */
1580
1578
  expand: () => void;
1581
- /**
1582
- * Open the widget in a new browser tab at `behavior.popOutUrl`
1583
- * (mount option / handshake-pushable), or the brand's
1584
- * `BRAND.standaloneUrl` build-time default. Carries the active
1585
- * `chat` + `widgetId` as query params. No-ops when the resolved
1586
- * URL is empty.
1587
- */
1588
- popOut: () => void;
1589
1579
  /**
1590
1580
  * Surface a configured form by id (a form with a `manual` trigger). Lets the
1591
1581
  * host open, say, an appointment or feedback form from its own button. No-op
@@ -1595,7 +1585,7 @@ interface ChatWidgetInstance {
1595
1585
  /**
1596
1586
  * Subscribe to a lifecycle event. Returns an `off` function. See
1597
1587
  * {@link EventMap} for the full set + payload shapes — currently
1598
- * `open | close | message | error | expand | fullscreen | popOut |
1588
+ * `open | close | message | error | expand | fullscreen |
1599
1589
  * handshake | localeChange`.
1600
1590
  */
1601
1591
  on: <E extends EventName>(name: E, fn: (payload: EventMap[E]) => void) => () => void;
@@ -1729,7 +1719,6 @@ declare const brand: {
1729
1719
  readonly tagName: string;
1730
1720
  readonly cssPrefix: string;
1731
1721
  readonly defaultBaseUrl: string;
1732
- readonly standaloneUrl: string;
1733
1722
  readonly displayName: string;
1734
1723
  readonly domain: string;
1735
1724
  readonly siteUrl: string;