@helpai/elements 0.73.0 → 1.1.1

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
@@ -41,7 +41,7 @@ interface ClientStorage {
41
41
  * populated {@link Strings} map. UI components then read `strings.send` as a
42
42
  * normal property access — no per-render lookup, no per-render allocation.
43
43
  */
44
- 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" | "talkToOperator" | "connectingOperator" | "noOperatorAvailable" | "chattingWithOperator" | "cancelOperatorRequest" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "errorRateLimited" | "loading" | "thinking" | "thoughts" | "toolResult" | "sources" | "feedbackUp" | "feedbackDown" | "feedbackThanks" | "copy" | "copied" | "collapseSidebar" | "expandSidebar" | "formSubmit" | "formSkip" | "formSubmitted" | "formSkipped" | "formFillOut" | "formRequired" | "formInvalidEmail" | "formInvalidTel" | "formInvalidUrl" | "formInvalidNumber" | "formTooShort" | "formTooLong" | "formNumberTooSmall" | "formNumberTooLarge" | "formPatternMismatch" | "formChooseAtLeast" | "formChooseAtMost" | "formOther" | "formOtherPlaceholder" | "inputRequired" | "inputBadge" | "inputAnswered" | "inputSkipped" | "inputSubmit" | "inputSubmitHint" | "inputSkip" | "showOptions" | "hideOptions" | "qtypeText" | "qtypeEmail" | "qtypePhone" | "qtypeNumber" | "qtypeDate" | "qtypeChooseOne" | "qtypeChooseAny" | "qtypeBoolean" | "confirmYes" | "confirmNo" | "approve" | "reject" | "approvalPrompt" | "approvalBody" | "approvalYourResponse" | "approvalEditHint" | "approvalSubmitting" | "edit" | "toolParameters" | "statusAwaiting" | "statusResponded" | "statusCompleted" | "statusDenied" | "statusError" | "statusRunning" | "statusSuperseded" | "tabHome" | "tabConversations" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "homeStatus" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
44
+ 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" | "loadMoreConversations" | "conversationLoading" | "loadPreviousMessages" | "conversationClosed" | "startNewConversation" | "talkToOperator" | "connectingOperator" | "noOperatorAvailable" | "chattingWithOperator" | "cancelOperatorRequest" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "errorRateLimited" | "loading" | "thinking" | "thoughts" | "toolResult" | "sources" | "feedbackUp" | "feedbackDown" | "feedbackThanks" | "copy" | "copied" | "collapseSidebar" | "expandSidebar" | "formSubmit" | "formSkip" | "formSubmitted" | "formSkipped" | "formFillOut" | "formRequired" | "formInvalidEmail" | "formInvalidTel" | "formInvalidUrl" | "formInvalidNumber" | "formTooShort" | "formTooLong" | "formNumberTooSmall" | "formNumberTooLarge" | "formPatternMismatch" | "formChooseAtLeast" | "formChooseAtMost" | "formOther" | "formOtherPlaceholder" | "inputRequired" | "inputBadge" | "inputAnswered" | "inputSkipped" | "inputSubmit" | "inputSubmitHint" | "inputSkip" | "showOptions" | "hideOptions" | "qtypeText" | "qtypeEmail" | "qtypePhone" | "qtypeNumber" | "qtypeDate" | "qtypeChooseOne" | "qtypeChooseAny" | "qtypeBoolean" | "confirmYes" | "confirmNo" | "approve" | "reject" | "approvalPrompt" | "approvalBody" | "approvalYourResponse" | "approvalEditHint" | "approvalSubmitting" | "edit" | "toolParameters" | "statusAwaiting" | "statusResponded" | "statusCompleted" | "statusDenied" | "statusError" | "statusRunning" | "statusSuperseded" | "tabHome" | "tabConversations" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "homeStatus" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
45
45
  /** A partial map for one locale — what overrides look like on the wire. */
46
46
  type LocaleStrings = Partial<Record<StringKey, string>>;
47
47
  /**
@@ -849,9 +849,11 @@ interface Endpoints {
849
849
  * use the widget: events, pages, devices, locales, funnels.
850
850
  *
851
851
  * Privacy contract (enforced in `src/core/tracking.ts`):
852
- * - never sends message text, form values, or any user content —
852
+ * - never sends message text or form values —
853
853
  * event payloads pass through a static per-event allowlist;
854
- * - the only identifier is the widget's existing anonymous `visitorId`;
854
+ * - the only visitor identifier is the widget's existing anonymous
855
+ * `visitorId`; deployment and anonymous conversation ids provide context;
856
+ * - page metadata is origin + pathname, with query/hash removed;
855
857
  * - geo + browser are derived server-side (IP + User-Agent header),
856
858
  * never collected client-side;
857
859
  * - `navigator.globalPrivacyControl` / Do-Not-Track force it off
@@ -871,8 +873,9 @@ interface TrackingOptions {
871
873
  */
872
874
  endpoint?: string;
873
875
  /**
874
- * Per-visitor sampling 0..1. `0.25` tracks ~a quarter of visitors
875
- * (decided once per page load, so funnels stay intact). Default `1`.
876
+ * Per-widget-runtime sampling 0..1. `0.25` samples roughly a quarter of
877
+ * mounted runtimes; one decision is reused for that runtime's funnel.
878
+ * Default `1`.
876
879
  */
877
880
  sampleRate?: number;
878
881
  /**
@@ -1793,9 +1796,9 @@ declare const widgetSettingsSchema: z.ZodObject<{
1793
1796
  type: z.ZodEnum<{
1794
1797
  number: "number";
1795
1798
  url: "url";
1799
+ email: "email";
1796
1800
  date: "date";
1797
1801
  text: "text";
1798
- email: "email";
1799
1802
  tel: "tel";
1800
1803
  time: "time";
1801
1804
  textarea: "textarea";
@@ -1858,8 +1861,8 @@ declare const widgetSettingsSchema: z.ZodObject<{
1858
1861
  modules: z.ZodOptional<z.ZodArray<z.ZodObject<{
1859
1862
  label: z.ZodString;
1860
1863
  layout: z.ZodEnum<{
1861
- chat: "chat";
1862
1864
  home: "home";
1865
+ chat: "chat";
1863
1866
  help: "help";
1864
1867
  news: "news";
1865
1868
  }>;
@@ -2128,9 +2131,9 @@ declare const widgetConfigSchema: z.ZodObject<{
2128
2131
  type: z.ZodEnum<{
2129
2132
  number: "number";
2130
2133
  url: "url";
2134
+ email: "email";
2131
2135
  date: "date";
2132
2136
  text: "text";
2133
- email: "email";
2134
2137
  tel: "tel";
2135
2138
  time: "time";
2136
2139
  textarea: "textarea";
@@ -2193,8 +2196,8 @@ declare const widgetConfigSchema: z.ZodObject<{
2193
2196
  modules: z.ZodOptional<z.ZodArray<z.ZodObject<{
2194
2197
  label: z.ZodString;
2195
2198
  layout: z.ZodEnum<{
2196
- chat: "chat";
2197
2199
  home: "home";
2200
+ chat: "chat";
2198
2201
  help: "help";
2199
2202
  news: "news";
2200
2203
  }>;
@@ -2462,9 +2465,9 @@ declare const widgetConfigPartialSchema: z.ZodObject<{
2462
2465
  type: z.ZodEnum<{
2463
2466
  number: "number";
2464
2467
  url: "url";
2468
+ email: "email";
2465
2469
  date: "date";
2466
2470
  text: "text";
2467
- email: "email";
2468
2471
  tel: "tel";
2469
2472
  time: "time";
2470
2473
  textarea: "textarea";
@@ -2527,8 +2530,8 @@ declare const widgetConfigPartialSchema: z.ZodObject<{
2527
2530
  modules: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
2528
2531
  label: z.ZodString;
2529
2532
  layout: z.ZodEnum<{
2530
- chat: "chat";
2531
2533
  home: "home";
2534
+ chat: "chat";
2532
2535
  help: "help";
2533
2536
  news: "news";
2534
2537
  }>;
@@ -2756,9 +2759,9 @@ declare const widgetSettingsPartialSchema: z.ZodObject<{
2756
2759
  type: z.ZodEnum<{
2757
2760
  number: "number";
2758
2761
  url: "url";
2762
+ email: "email";
2759
2763
  date: "date";
2760
2764
  text: "text";
2761
- email: "email";
2762
2765
  tel: "tel";
2763
2766
  time: "time";
2764
2767
  textarea: "textarea";
@@ -2821,8 +2824,8 @@ declare const widgetSettingsPartialSchema: z.ZodObject<{
2821
2824
  modules: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
2822
2825
  label: z.ZodString;
2823
2826
  layout: z.ZodEnum<{
2824
- chat: "chat";
2825
2827
  home: "home";
2828
+ chat: "chat";
2826
2829
  help: "help";
2827
2830
  news: "news";
2828
2831
  }>;
@@ -3096,8 +3099,8 @@ declare const serverConfigSchema: z.ZodObject<{
3096
3099
  modules: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
3097
3100
  label: z.ZodString;
3098
3101
  layout: z.ZodEnum<{
3099
- chat: "chat";
3100
3102
  home: "home";
3103
+ chat: "chat";
3101
3104
  help: "help";
3102
3105
  news: "news";
3103
3106
  }>;
@@ -3382,8 +3385,8 @@ declare const handshakeResponseSchema: z.ZodObject<{
3382
3385
  modules: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
3383
3386
  label: z.ZodString;
3384
3387
  layout: z.ZodEnum<{
3385
- chat: "chat";
3386
3388
  home: "home";
3389
+ chat: "chat";
3387
3390
  help: "help";
3388
3391
  news: "news";
3389
3392
  }>;