@mrrocket/sdk 0.18.0 → 0.22.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +36 -1
  3. package/dist/api-client.d.ts +28 -4
  4. package/dist/api-client.js +30 -13
  5. package/dist/api-client.js.map +1 -1
  6. package/dist/browser/mrrocket-flows.js +8 -3
  7. package/dist/browser/mrrocket-messenger.js +38 -5
  8. package/dist/browser/mrrocket.js +1 -1
  9. package/dist/browser.d.ts +2 -2
  10. package/dist/browser.js +2 -1
  11. package/dist/browser.js.map +1 -1
  12. package/dist/client.d.ts +17 -1
  13. package/dist/client.js +25 -5
  14. package/dist/client.js.map +1 -1
  15. package/dist/core.d.ts +5 -1
  16. package/dist/core.js +1 -1
  17. package/dist/core.js.map +1 -1
  18. package/dist/feedback.js +161 -119
  19. package/dist/feedback.js.map +1 -1
  20. package/dist/flows-ui.d.ts +1 -1
  21. package/dist/flows-ui.js +100 -72
  22. package/dist/flows-ui.js.map +1 -1
  23. package/dist/flows-web.js +2 -1
  24. package/dist/flows-web.js.map +1 -1
  25. package/dist/flows.d.ts +38 -6
  26. package/dist/flows.js +51 -17
  27. package/dist/flows.js.map +1 -1
  28. package/dist/i18n.d.ts +22 -0
  29. package/dist/i18n.js +74 -0
  30. package/dist/i18n.js.map +1 -0
  31. package/dist/index.d.ts +4 -1
  32. package/dist/index.js +5 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/messenger-ui.d.ts +9 -3
  35. package/dist/messenger-ui.js +324 -152
  36. package/dist/messenger-ui.js.map +1 -1
  37. package/dist/messenger.d.ts +3 -1
  38. package/dist/messenger.js +3 -2
  39. package/dist/messenger.js.map +1 -1
  40. package/dist/onboarding-report.d.ts +19 -0
  41. package/dist/onboarding-report.js +23 -0
  42. package/dist/onboarding-report.js.map +1 -0
  43. package/dist/onboarding-state.d.ts +3 -0
  44. package/dist/onboarding-state.js +7 -1
  45. package/dist/onboarding-state.js.map +1 -1
  46. package/dist/paywall.js +2 -1
  47. package/dist/paywall.js.map +1 -1
  48. package/dist/react-native/index.d.cts +93 -8
  49. package/dist/react-native/index.d.ts +93 -8
  50. package/dist/react-native/index.js +819 -511
  51. package/dist/react-native/index.js.map +1 -1
  52. package/dist/server.d.ts +4 -2
  53. package/dist/server.js +2 -2
  54. package/dist/server.js.map +1 -1
  55. package/dist/styles-css.d.ts +1 -1
  56. package/dist/styles-css.js +35 -2
  57. package/dist/styles-css.js.map +1 -1
  58. package/dist/survey.js +18 -14
  59. package/dist/survey.js.map +1 -1
  60. package/dist/ui.d.ts +2 -0
  61. package/dist/ui.js +15 -12
  62. package/dist/ui.js.map +1 -1
  63. package/package.json +6 -3
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/i18n.ts"],"sourcesContent":["/**\n * The SDK's own words in the visitor's language. English is the source: `t(\"Send\")` answers the translation the config\n * brought, or \"Send\". Plurals are separate source words (\"1 reply\", \"{n} replies\"), never glued together. Every literal\n * passed to `t` and `tf` is listed in words.ts for the server (scripts/check-words.mjs keeps the two equal).\n *\n * The state sits on `globalThis` because the script tag's files (sdk.js, sdk-flows.js, sdk-messenger.js) are separate\n * bundles: the words sdk.js read must reach the dialogs it loads later. Only the browser and the app write to it: on\n * a server this object is shared by all requests.\n */\ninterface Shared {\n words?: Record<string, string>;\n /** The language the server chose, like \"de\". */\n lang?: string;\n /** The app's own choice (`setLocale`, the `locale` option). */\n locale?: string;\n /** React Native: the phone's language. */\n device?: string;\n version: number;\n onWords: Set<() => void>;\n onLocale: Set<() => void>;\n}\n\nconst g = globalThis as unknown as { __mrrocketI18n?: Shared };\nconst s: Shared = (g.__mrrocketI18n ??= { version: 0, onWords: new Set(), onLocale: new Set() });\n\nconst tell = (listeners: Set<() => void>) => {\n for (const fn of [...listeners]) {\n try {\n fn();\n } catch {\n // One renderer must not stop another.\n }\n }\n};\n\n/** The translation, or the English word. */\nexport const t = (word: string): string => s.words?.[word] || word;\n\n/** The same, then fills `{n}`-style placeholders. */\nexport const tf = (word: string, vars: Record<string, string | number>): string => t(word).replace(/\\{(\\w+)\\}/g, (all, k: string) => (k in vars ? String(vars[k]) : all));\n\n/** Replaces the dictionary; `lang` is the language it is in. */\nexport const setWords = (words?: Record<string, string>, lang?: string) => {\n const same = s.lang === lang && JSON.stringify(s.words ?? {}) === JSON.stringify(words ?? {});\n s.words = words;\n s.lang = lang;\n if (same) return;\n s.version++;\n tell(s.onWords);\n};\n\n/** \"de_AT\" reads as \"de-AT\"; something that is no language tag counts as none (dates would throw on it). */\nconst tidy = (locale?: string) => {\n const tag = locale?.trim().replace(/_/g, \"-\");\n if (!tag) return undefined;\n try {\n return Intl.getCanonicalLocales(tag)[0];\n } catch (e) {\n return e instanceof RangeError ? undefined : tag;\n }\n};\n\n/** An app with its own language switch says the language here; undefined goes back to the device's. Re-reads the config. */\nexport const setLocale = (locale?: string) => {\n const next = tidy(locale);\n if (next === s.locale) return;\n s.locale = next;\n s.version++;\n tell(s.onWords);\n tell(s.onLocale);\n};\n\n/** React Native: the phone's language, used unless the app chose one. */\nexport const setDeviceLocale = (locale?: string) => {\n s.device = tidy(locale);\n};\n\n/** The app's choice, else the phone's (React Native), else the browser's. */\nexport const currentLocale = (): string | undefined => s.locale ?? s.device ?? ((typeof navigator !== \"undefined\" && navigator.language) || undefined);\n\n/** `&lang=de-AT` for a URL that already has a query, or nothing while no language is known. */\nexport const langParam = () => {\n const l = currentLocale();\n return l ? `&lang=${encodeURIComponent(l)}` : \"\";\n};\n\n/** The language the words on screen are in, for `lang` on the SDK's own root elements. */\nexport const wordsLang = () => s.lang;\n\n/** Grows whenever the words or the language change. */\nexport const wordsVersion = () => s.version;\n\n/** Runs when the words or the language changed: what is on screen draws again. Returns how to stop. */\nexport const onWords = (fn: () => void) => {\n s.onWords.add(fn);\n return () => {\n s.onWords.delete(fn);\n };\n};\n\n/** Runs when the app chose another language: the config is read again. Returns how to stop. */\nexport const onLocale = (fn: () => void) => {\n s.onLocale.add(fn);\n return () => {\n s.onLocale.delete(fn);\n };\n};\n"],"mappings":";AAsBA,IAAM,IAAI;AACV,IAAM,IAAa,EAAE,mBAAmB,EAAE,SAAS,GAAG,SAAS,oBAAI,IAAI,GAAG,UAAU,oBAAI,IAAI,EAAE;AAE9F,IAAM,OAAO,CAAC,cAA+B;AACzC,aAAW,MAAM,CAAC,GAAG,SAAS,GAAG;AAC7B,QAAI;AACA,SAAG;AAAA,IACP,QAAQ;AAAA,IAER;AAAA,EACJ;AACJ;AAGO,IAAM,IAAI,CAAC,SAAyB,EAAE,QAAQ,IAAI,KAAK;AAGvD,IAAM,KAAK,CAAC,MAAc,SAAkD,EAAE,IAAI,EAAE,QAAQ,cAAc,CAAC,KAAK,MAAe,KAAK,OAAO,OAAO,KAAK,CAAC,CAAC,IAAI,GAAI;AAGjK,IAAM,WAAW,CAAC,OAAgC,SAAkB;AACvE,QAAM,OAAO,EAAE,SAAS,QAAQ,KAAK,UAAU,EAAE,SAAS,CAAC,CAAC,MAAM,KAAK,UAAU,SAAS,CAAC,CAAC;AAC5F,IAAE,QAAQ;AACV,IAAE,OAAO;AACT,MAAI,KAAM;AACV,IAAE;AACF,OAAK,EAAE,OAAO;AAClB;AAGA,IAAM,OAAO,CAAC,WAAoB;AAC9B,QAAM,MAAM,QAAQ,KAAK,EAAE,QAAQ,MAAM,GAAG;AAC5C,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI;AACA,WAAO,KAAK,oBAAoB,GAAG,EAAE,CAAC;AAAA,EAC1C,SAAS,GAAG;AACR,WAAO,aAAa,aAAa,SAAY;AAAA,EACjD;AACJ;AAGO,IAAM,YAAY,CAAC,WAAoB;AAC1C,QAAM,OAAO,KAAK,MAAM;AACxB,MAAI,SAAS,EAAE,OAAQ;AACvB,IAAE,SAAS;AACX,IAAE;AACF,OAAK,EAAE,OAAO;AACd,OAAK,EAAE,QAAQ;AACnB;AAGO,IAAM,kBAAkB,CAAC,WAAoB;AAChD,IAAE,SAAS,KAAK,MAAM;AAC1B;AAGO,IAAM,gBAAgB,MAA0B,EAAE,UAAU,EAAE,WAAY,OAAO,cAAc,eAAe,UAAU,YAAa;AAGrI,IAAM,YAAY,MAAM;AAC3B,QAAM,IAAI,cAAc;AACxB,SAAO,IAAI,SAAS,mBAAmB,CAAC,CAAC,KAAK;AAClD;AAGO,IAAM,YAAY,MAAM,EAAE;AAG1B,IAAM,eAAe,MAAM,EAAE;AAG7B,IAAM,UAAU,CAAC,OAAmB;AACvC,IAAE,QAAQ,IAAI,EAAE;AAChB,SAAO,MAAM;AACT,MAAE,QAAQ,OAAO,EAAE;AAAA,EACvB;AACJ;AAGO,IAAM,WAAW,CAAC,OAAmB;AACxC,IAAE,SAAS,IAAI,EAAE;AACjB,SAAO,MAAM;AACT,MAAE,SAAS,OAAO,EAAE;AAAA,EACxB;AACJ;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,13 @@
1
- export { type ChangelogEntry, type ChatMessage, type ChatThread, type CockpitProviderProps, type CockpitUser, type FeedbackBoardInfo, type FeedbackBoardProps, type FeedbackComment, type FeedbackList, type FeedbackPost, type FeedbackRoadmap, type FeedbackWidgetProps, type MessengerProps, type PostStatus, type SurveyAnswer, type SurveyDefinition, type SurveyQuestion, type SurveyQuestionKind, CockpitProvider, Experiment, FeedbackBoard, FeedbackWidget, Messenger, Survey, Text, WIDGET_CSS, createApi, useCancelFlow, useCockpit, useFeedback, useFlag, useFlagVariant, useMessenger, useOnboarding, usePaywall, usePush, useStyles, useVariant, } from "./browser.js";
1
+ export { type ChangelogEntry, type ChatMessage, type ChatSummary, type ChatThread, type CockpitProviderProps, type CockpitUser, type FeedbackBoardInfo, type FeedbackBoardProps, type FeedbackComment, type FeedbackList, type FeedbackPost, type FeedbackRoadmap, type FeedbackWidgetProps, type MessengerProps, type PostStatus, type SurveyAnswer, type SurveyDefinition, type SurveyQuestion, type SurveyQuestionKind, CockpitProvider, Experiment, FeedbackBoard, FeedbackWidget, Messenger, Survey, Text, WIDGET_CSS, createApi, useCancelFlow, useCockpit, useFeedback, useFlag, useFlagVariant, useMessenger, useOnboarding, useOnboardingReport, usePaywall, usePush, useStyles, useVariant, } from "./browser.js";
2
2
  export type { PushResult, PushStatus, WebPushOptions } from "./push-web.js";
3
+ /** 0.21.0: the language of the SDK's words, for an app with its own language switch. */
4
+ export { currentLocale, setLocale } from "./i18n.js";
3
5
  /** `identify(id, props, { hash })` (0.16.0); the hash comes from `userHash()` in `@mrrocket/sdk/next/server`. */
4
6
  export type { IdentifyOptions } from "./identity.js";
5
7
  export { type CockpitConfig, type CockpitEvent, type ConsentChoice, type ConsentMode, type ReplayConfig, type ErrorReport, type ExperimentConfig, type FlagCondition, type FlagConditionSet, type FlagConfig, type FlagPerson, type RedirectConfig, type RedirectDecision, type VariantConfig, type VariantId, EMBED_PARAM, EXPOSURE_PARAM, SDK_VERSION, ID_COOKIE, PREVIEW_PARAM, SESSION_COOKIE, assign, evaluateFlag, parsePreview, previewHref, redirectFor, } from "./core.js";
6
8
  export { type CancelFlowConfig, type CancelFlowOptions, type CancelFlowResult, type CancelOffer, type InAppMessage, type OnboardingFlow, type OnboardingStep, type FlowMedia, type TourPlacement, type TaskOpens, type FlowIcon, type FinishAnimation, type OnboardingQuestion, type OnboardingItemState, videoEmbed, } from "./flows.js";
7
9
  export type { UseOnboarding } from "./onboarding-state.js";
10
+ export type { OnboardingReport, OnboardingReportOptions, OnboardingReportType } from "./onboarding-report.js";
8
11
  export { FLOW_ICONS, FLOW_ICON_NAMES, type BuiltinIcon } from "./icons.js";
9
12
  export type { FlowsTheme } from "./flows-ui.js";
10
13
  export { PAYWALL_EVENT, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult } from "./paywall.js";
package/dist/index.js CHANGED
@@ -16,11 +16,13 @@ import {
16
16
  useFlagVariant,
17
17
  useMessenger,
18
18
  useOnboarding,
19
+ useOnboardingReport,
19
20
  usePaywall,
20
21
  usePush,
21
22
  useStyles,
22
23
  useVariant
23
24
  } from "./browser.js";
25
+ import { currentLocale, setLocale } from "./i18n.js";
24
26
  import {
25
27
  EMBED_PARAM,
26
28
  EXPOSURE_PARAM,
@@ -67,6 +69,7 @@ export {
67
69
  WIDGET_CSS,
68
70
  assign,
69
71
  createApi,
72
+ currentLocale,
70
73
  evaluateFlag,
71
74
  getReferral,
72
75
  parsePreview,
@@ -75,6 +78,7 @@ export {
75
78
  redirectFor,
76
79
  referralForCheckout,
77
80
  referralLink,
81
+ setLocale,
78
82
  useCancelFlow,
79
83
  useCockpit,
80
84
  useFeedback,
@@ -82,6 +86,7 @@ export {
82
86
  useFlagVariant,
83
87
  useMessenger,
84
88
  useOnboarding,
89
+ useOnboardingReport,
85
90
  usePaywall,
86
91
  usePush,
87
92
  useStyles,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type ChangelogEntry,\n type ChatMessage,\n type ChatThread,\n type CockpitProviderProps,\n type CockpitUser,\n type FeedbackBoardInfo,\n type FeedbackBoardProps,\n type FeedbackComment,\n type FeedbackList,\n type FeedbackPost,\n type FeedbackRoadmap,\n type FeedbackWidgetProps,\n type MessengerProps,\n type PostStatus,\n type SurveyAnswer,\n type SurveyDefinition,\n type SurveyQuestion,\n type SurveyQuestionKind,\n CockpitProvider,\n Experiment,\n FeedbackBoard,\n FeedbackWidget,\n Messenger,\n Survey,\n Text,\n WIDGET_CSS,\n createApi,\n useCancelFlow,\n useCockpit,\n useFeedback,\n useFlag,\n useFlagVariant,\n useMessenger,\n useOnboarding,\n usePaywall,\n usePush,\n useStyles,\n useVariant,\n} from \"./browser\";\nexport type { PushResult, PushStatus, WebPushOptions } from \"./push-web\";\n/** `identify(id, props, { hash })` (0.16.0); the hash comes from `userHash()` in `@mrrocket/sdk/next/server`. */\nexport type { IdentifyOptions } from \"./identity\";\nexport {\n type CockpitConfig,\n type CockpitEvent,\n type ConsentChoice,\n type ConsentMode,\n type ReplayConfig,\n type ErrorReport,\n type ExperimentConfig,\n type FlagCondition,\n type FlagConditionSet,\n type FlagConfig,\n type FlagPerson,\n type RedirectConfig,\n type RedirectDecision,\n type VariantConfig,\n type VariantId,\n EMBED_PARAM,\n EXPOSURE_PARAM,\n SDK_VERSION,\n ID_COOKIE,\n PREVIEW_PARAM,\n SESSION_COOKIE,\n assign,\n evaluateFlag,\n parsePreview,\n previewHref,\n redirectFor,\n} from \"./core\";\nexport {\n type CancelFlowConfig,\n type CancelFlowOptions,\n type CancelFlowResult,\n type CancelOffer,\n type InAppMessage,\n type OnboardingFlow,\n type OnboardingStep,\n type FlowMedia,\n type TourPlacement,\n type TaskOpens,\n type FlowIcon,\n type FinishAnimation,\n type OnboardingQuestion,\n type OnboardingItemState,\n videoEmbed,\n} from \"./flows\";\nexport type { UseOnboarding } from \"./onboarding-state\";\nexport { FLOW_ICONS, FLOW_ICON_NAMES, type BuiltinIcon } from \"./icons\";\nexport type { FlowsTheme } from \"./flows-ui\";\nexport { PAYWALL_EVENT, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult } from \"./paywall\";\nexport {\n type AttributionMode,\n type CheckoutReferral,\n type Referral,\n REFERRAL_COOKIE,\n getReferral,\n readReferralCookie,\n referralForCheckout,\n referralLink,\n} from \"./referral\";\n"],"mappings":";AAAA;AAAA,EAmBI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAIP;AAAA,EAgBI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP;AAAA,EAeI;AAAA,OACG;AAEP,SAAS,YAAY,uBAAyC;AAE9D,SAAS,qBAAsH;AAC/H;AAAA,EAII;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n type ChangelogEntry,\n type ChatMessage,\n type ChatSummary,\n type ChatThread,\n type CockpitProviderProps,\n type CockpitUser,\n type FeedbackBoardInfo,\n type FeedbackBoardProps,\n type FeedbackComment,\n type FeedbackList,\n type FeedbackPost,\n type FeedbackRoadmap,\n type FeedbackWidgetProps,\n type MessengerProps,\n type PostStatus,\n type SurveyAnswer,\n type SurveyDefinition,\n type SurveyQuestion,\n type SurveyQuestionKind,\n CockpitProvider,\n Experiment,\n FeedbackBoard,\n FeedbackWidget,\n Messenger,\n Survey,\n Text,\n WIDGET_CSS,\n createApi,\n useCancelFlow,\n useCockpit,\n useFeedback,\n useFlag,\n useFlagVariant,\n useMessenger,\n useOnboarding,\n useOnboardingReport,\n usePaywall,\n usePush,\n useStyles,\n useVariant,\n} from \"./browser\";\nexport type { PushResult, PushStatus, WebPushOptions } from \"./push-web\";\n/** 0.21.0: the language of the SDK's words, for an app with its own language switch. */\nexport { currentLocale, setLocale } from \"./i18n\";\n/** `identify(id, props, { hash })` (0.16.0); the hash comes from `userHash()` in `@mrrocket/sdk/next/server`. */\nexport type { IdentifyOptions } from \"./identity\";\nexport {\n type CockpitConfig,\n type CockpitEvent,\n type ConsentChoice,\n type ConsentMode,\n type ReplayConfig,\n type ErrorReport,\n type ExperimentConfig,\n type FlagCondition,\n type FlagConditionSet,\n type FlagConfig,\n type FlagPerson,\n type RedirectConfig,\n type RedirectDecision,\n type VariantConfig,\n type VariantId,\n EMBED_PARAM,\n EXPOSURE_PARAM,\n SDK_VERSION,\n ID_COOKIE,\n PREVIEW_PARAM,\n SESSION_COOKIE,\n assign,\n evaluateFlag,\n parsePreview,\n previewHref,\n redirectFor,\n} from \"./core\";\nexport {\n type CancelFlowConfig,\n type CancelFlowOptions,\n type CancelFlowResult,\n type CancelOffer,\n type InAppMessage,\n type OnboardingFlow,\n type OnboardingStep,\n type FlowMedia,\n type TourPlacement,\n type TaskOpens,\n type FlowIcon,\n type FinishAnimation,\n type OnboardingQuestion,\n type OnboardingItemState,\n videoEmbed,\n} from \"./flows\";\nexport type { UseOnboarding } from \"./onboarding-state\";\nexport type { OnboardingReport, OnboardingReportOptions, OnboardingReportType } from \"./onboarding-report\";\nexport { FLOW_ICONS, FLOW_ICON_NAMES, type BuiltinIcon } from \"./icons\";\nexport type { FlowsTheme } from \"./flows-ui\";\nexport { PAYWALL_EVENT, type PaywallConfig, type PaywallOptions, type PaywallPage, type PaywallPlan, type PaywallResult } from \"./paywall\";\nexport {\n type AttributionMode,\n type CheckoutReferral,\n type Referral,\n REFERRAL_COOKIE,\n getReferral,\n readReferralCookie,\n referralForCheckout,\n referralLink,\n} from \"./referral\";\n"],"mappings":";AAAA;AAAA,EAoBI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,SAAS,eAAe,iBAAiB;AAGzC;AAAA,EAgBI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP;AAAA,EAeI;AAAA,OACG;AAGP,SAAS,YAAY,uBAAyC;AAE9D,SAAS,qBAAsH;AAC/H;AAAA,EAII;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;","names":[]}
@@ -7,6 +7,9 @@
7
7
  * count on the launcher and a preview card above it. Opening, closing, switching and new messages move softly
8
8
  * (none of it with reduced motion).
9
9
  *
10
+ * A visitor can have several conversations (0.19): Home's "Ask a question" starts a new one, the field inside a chat
11
+ * answers in that chat, and Home and Messages list the others.
12
+ *
10
13
  * Plain DOM, no React, so `<Messenger />` (Next.js) and the script tag share it; both load it only when it is used (a
11
14
  * dynamic import, and `sdk-messenger.js` for the script tag). Every text is set with textContent; articles arrive as
12
15
  * blocks, never HTML.
@@ -41,6 +44,8 @@ export interface MessengerUiOptions {
41
44
  replyTime?: "minutes" | "hours" | "day";
42
45
  /** The Help tab with the product's published help articles (default true; hidden while there are none). */
43
46
  help?: boolean;
47
+ /** The Updates tab with your published changelog (default true; hidden while there are none). */
48
+ updates?: boolean;
44
49
  /** A short sound when an answer arrives (default true). */
45
50
  sound?: boolean;
46
51
  /** A preview of a new answer above the closed launcher (default true). */
@@ -73,8 +78,8 @@ export interface MessengerUiOptions {
73
78
  opened?: MessengerView;
74
79
  }
75
80
  /** What the messenger asks the server (createApi's part it uses). */
76
- export type MessengerClient = Pick<Api, "chat" | "sendChat" | "uploadChatFile" | "attachmentUrl" | "articles" | "article" | "rateArticle" | "messengerLook">;
77
- export type MessengerView = "home" | "messages" | "help";
81
+ export type MessengerClient = Pick<Api, "chat" | "sendChat" | "uploadChatFile" | "attachmentUrl" | "articles" | "article" | "rateArticle" | "messengerLook" | "changelog">;
82
+ export type MessengerView = "home" | "messages" | "help" | "updates";
78
83
  export interface MessengerHandle {
79
84
  /** Opens the panel, on Home or the given tab; `{ article }` opens a help article. */
80
85
  open(view?: MessengerView | {
@@ -89,6 +94,7 @@ export interface MessengerHandle {
89
94
  * Mounts the messenger with its look from MRRocket (Support › Messenger) underneath what the code passes: an option the
90
95
  * code sets wins, one it leaves out comes from MRRocket, then the default. Calls made before the look arrived wait.
91
96
  * A repeat visit starts with the look this browser saw last; a look that arrives later than that (changed, or slower
92
- * than LOOK_WAIT_MS) replaces the launcher while the panel is closed, or once it closes.
97
+ * than LOOK_WAIT_MS) replaces the launcher while the panel is closed, or once it closes. New words or another language
98
+ * do the same: the messenger is built anew, with the look read again in another language.
93
99
  */
94
100
  export declare const mountMessenger: (o: MessengerUiOptions) => MessengerHandle;