@repzo/widget-react-native 1.0.9 → 1.2.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 (191) hide show
  1. package/CHANGELOG.md +400 -0
  2. package/README.md +104 -5
  3. package/lib/commonjs/agent-ui-blocks.js +2 -1
  4. package/lib/commonjs/agent-ui-blocks.js.map +1 -1
  5. package/lib/commonjs/api/client.js +25 -0
  6. package/lib/commonjs/api/client.js.map +1 -1
  7. package/lib/commonjs/attachments/pickers.js +3 -6
  8. package/lib/commonjs/attachments/pickers.js.map +1 -1
  9. package/lib/commonjs/device-id.js +31 -3
  10. package/lib/commonjs/device-id.js.map +1 -1
  11. package/lib/commonjs/i18n.js +40 -4
  12. package/lib/commonjs/i18n.js.map +1 -1
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/locales.js +34 -1
  15. package/lib/commonjs/locales.js.map +1 -1
  16. package/lib/commonjs/push/push-notifications.js +9 -8
  17. package/lib/commonjs/push/push-notifications.js.map +1 -1
  18. package/lib/commonjs/state/widget-store.js +507 -26
  19. package/lib/commonjs/state/widget-store.js.map +1 -1
  20. package/lib/commonjs/storage.js +13 -1
  21. package/lib/commonjs/storage.js.map +1 -1
  22. package/lib/commonjs/types.js +20 -2
  23. package/lib/commonjs/types.js.map +1 -1
  24. package/lib/commonjs/ui/WidgetProvider.js +138 -49
  25. package/lib/commonjs/ui/WidgetProvider.js.map +1 -1
  26. package/lib/commonjs/ui/components/AgentUiBlocks.js +35 -15
  27. package/lib/commonjs/ui/components/AgentUiBlocks.js.map +1 -1
  28. package/lib/commonjs/ui/components/Launcher.js +4 -1
  29. package/lib/commonjs/ui/components/Launcher.js.map +1 -1
  30. package/lib/commonjs/ui/components/Markdown.js +32 -2
  31. package/lib/commonjs/ui/components/Markdown.js.map +1 -1
  32. package/lib/commonjs/ui/components/Post.js +1241 -0
  33. package/lib/commonjs/ui/components/Post.js.map +1 -0
  34. package/lib/commonjs/ui/components/RatingCard.js +6 -3
  35. package/lib/commonjs/ui/components/RatingCard.js.map +1 -1
  36. package/lib/commonjs/ui/hooks/use-widget-insets.js +0 -1
  37. package/lib/commonjs/ui/hooks/use-widget-insets.js.map +1 -1
  38. package/lib/commonjs/ui/screens/chat/ChatView.js +67 -29
  39. package/lib/commonjs/ui/screens/chat/ChatView.js.map +1 -1
  40. package/lib/commonjs/ui/utils/html.js +9 -1
  41. package/lib/commonjs/ui/utils/html.js.map +1 -1
  42. package/lib/commonjs/ui/utils/native-gradient.js +0 -1
  43. package/lib/commonjs/ui/utils/native-gradient.js.map +1 -1
  44. package/lib/commonjs/ui/utils/post-html.js +276 -0
  45. package/lib/commonjs/ui/utils/post-html.js.map +1 -0
  46. package/lib/commonjs/ui/utils/safe-url.js +16 -0
  47. package/lib/commonjs/ui/utils/safe-url.js.map +1 -1
  48. package/lib/module/agent-ui-blocks.js +2 -1
  49. package/lib/module/agent-ui-blocks.js.map +1 -1
  50. package/lib/module/api/client.js +25 -0
  51. package/lib/module/api/client.js.map +1 -1
  52. package/lib/module/attachments/pickers.js +3 -6
  53. package/lib/module/attachments/pickers.js.map +1 -1
  54. package/lib/module/device-id.js +31 -3
  55. package/lib/module/device-id.js.map +1 -1
  56. package/lib/module/i18n.js +40 -4
  57. package/lib/module/i18n.js.map +1 -1
  58. package/lib/module/index.js.map +1 -1
  59. package/lib/module/locales.js +34 -1
  60. package/lib/module/locales.js.map +1 -1
  61. package/lib/module/push/push-notifications.js +9 -8
  62. package/lib/module/push/push-notifications.js.map +1 -1
  63. package/lib/module/state/widget-store.js +507 -25
  64. package/lib/module/state/widget-store.js.map +1 -1
  65. package/lib/module/storage.js +13 -1
  66. package/lib/module/storage.js.map +1 -1
  67. package/lib/module/types.js +20 -2
  68. package/lib/module/types.js.map +1 -1
  69. package/lib/module/ui/WidgetProvider.js +139 -50
  70. package/lib/module/ui/WidgetProvider.js.map +1 -1
  71. package/lib/module/ui/components/AgentUiBlocks.js +35 -15
  72. package/lib/module/ui/components/AgentUiBlocks.js.map +1 -1
  73. package/lib/module/ui/components/Launcher.js +4 -1
  74. package/lib/module/ui/components/Launcher.js.map +1 -1
  75. package/lib/module/ui/components/Markdown.js +32 -3
  76. package/lib/module/ui/components/Markdown.js.map +1 -1
  77. package/lib/module/ui/components/Post.js +1236 -0
  78. package/lib/module/ui/components/Post.js.map +1 -0
  79. package/lib/module/ui/components/RatingCard.js +6 -3
  80. package/lib/module/ui/components/RatingCard.js.map +1 -1
  81. package/lib/module/ui/hooks/use-widget-insets.js +0 -1
  82. package/lib/module/ui/hooks/use-widget-insets.js.map +1 -1
  83. package/lib/module/ui/screens/chat/ChatView.js +68 -30
  84. package/lib/module/ui/screens/chat/ChatView.js.map +1 -1
  85. package/lib/module/ui/utils/html.js +9 -2
  86. package/lib/module/ui/utils/html.js.map +1 -1
  87. package/lib/module/ui/utils/native-gradient.js +0 -1
  88. package/lib/module/ui/utils/native-gradient.js.map +1 -1
  89. package/lib/module/ui/utils/post-html.js +271 -0
  90. package/lib/module/ui/utils/post-html.js.map +1 -0
  91. package/lib/module/ui/utils/safe-url.js +15 -0
  92. package/lib/module/ui/utils/safe-url.js.map +1 -1
  93. package/lib/typescript/commonjs/agent-ui-blocks.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/api/client.d.ts +19 -1
  95. package/lib/typescript/commonjs/api/client.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/attachments/pickers.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/device-id.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/i18n.d.ts +35 -1
  99. package/lib/typescript/commonjs/i18n.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/index.d.ts +1 -1
  101. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/locales.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/push/push-notifications.d.ts +6 -2
  104. package/lib/typescript/commonjs/push/push-notifications.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/state/widget-store.d.ts +97 -8
  106. package/lib/typescript/commonjs/state/widget-store.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/storage.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/types.d.ts +91 -8
  109. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/ui/WidgetProvider.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/ui/components/AgentUiBlocks.d.ts +14 -0
  112. package/lib/typescript/commonjs/ui/components/AgentUiBlocks.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/ui/components/Launcher.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/ui/components/Markdown.d.ts +8 -0
  115. package/lib/typescript/commonjs/ui/components/Markdown.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/ui/components/Post.d.ts +69 -0
  117. package/lib/typescript/commonjs/ui/components/Post.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/ui/components/RatingCard.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/ui/hooks/use-widget-insets.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts +10 -0
  122. package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/ui/utils/html.d.ts +1 -0
  124. package/lib/typescript/commonjs/ui/utils/html.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/ui/utils/native-gradient.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/ui/utils/post-html.d.ts +54 -0
  127. package/lib/typescript/commonjs/ui/utils/post-html.d.ts.map +1 -0
  128. package/lib/typescript/commonjs/ui/utils/safe-url.d.ts +6 -0
  129. package/lib/typescript/commonjs/ui/utils/safe-url.d.ts.map +1 -1
  130. package/lib/typescript/module/agent-ui-blocks.d.ts.map +1 -1
  131. package/lib/typescript/module/api/client.d.ts +19 -1
  132. package/lib/typescript/module/api/client.d.ts.map +1 -1
  133. package/lib/typescript/module/attachments/pickers.d.ts.map +1 -1
  134. package/lib/typescript/module/device-id.d.ts.map +1 -1
  135. package/lib/typescript/module/i18n.d.ts +35 -1
  136. package/lib/typescript/module/i18n.d.ts.map +1 -1
  137. package/lib/typescript/module/index.d.ts +1 -1
  138. package/lib/typescript/module/index.d.ts.map +1 -1
  139. package/lib/typescript/module/locales.d.ts.map +1 -1
  140. package/lib/typescript/module/push/push-notifications.d.ts +6 -2
  141. package/lib/typescript/module/push/push-notifications.d.ts.map +1 -1
  142. package/lib/typescript/module/state/widget-store.d.ts +97 -8
  143. package/lib/typescript/module/state/widget-store.d.ts.map +1 -1
  144. package/lib/typescript/module/storage.d.ts.map +1 -1
  145. package/lib/typescript/module/types.d.ts +91 -8
  146. package/lib/typescript/module/types.d.ts.map +1 -1
  147. package/lib/typescript/module/ui/WidgetProvider.d.ts.map +1 -1
  148. package/lib/typescript/module/ui/components/AgentUiBlocks.d.ts +14 -0
  149. package/lib/typescript/module/ui/components/AgentUiBlocks.d.ts.map +1 -1
  150. package/lib/typescript/module/ui/components/Launcher.d.ts.map +1 -1
  151. package/lib/typescript/module/ui/components/Markdown.d.ts +8 -0
  152. package/lib/typescript/module/ui/components/Markdown.d.ts.map +1 -1
  153. package/lib/typescript/module/ui/components/Post.d.ts +69 -0
  154. package/lib/typescript/module/ui/components/Post.d.ts.map +1 -0
  155. package/lib/typescript/module/ui/components/RatingCard.d.ts.map +1 -1
  156. package/lib/typescript/module/ui/hooks/use-widget-insets.d.ts.map +1 -1
  157. package/lib/typescript/module/ui/screens/chat/ChatView.d.ts.map +1 -1
  158. package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts +10 -0
  159. package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts.map +1 -1
  160. package/lib/typescript/module/ui/utils/html.d.ts +1 -0
  161. package/lib/typescript/module/ui/utils/html.d.ts.map +1 -1
  162. package/lib/typescript/module/ui/utils/native-gradient.d.ts.map +1 -1
  163. package/lib/typescript/module/ui/utils/post-html.d.ts +54 -0
  164. package/lib/typescript/module/ui/utils/post-html.d.ts.map +1 -0
  165. package/lib/typescript/module/ui/utils/safe-url.d.ts +6 -0
  166. package/lib/typescript/module/ui/utils/safe-url.d.ts.map +1 -1
  167. package/package.json +14 -4
  168. package/src/agent-ui-blocks.ts +2 -1
  169. package/src/api/client.ts +27 -0
  170. package/src/attachments/pickers.ts +3 -6
  171. package/src/device-id.ts +34 -3
  172. package/src/i18n.ts +39 -2
  173. package/src/index.tsx +4 -0
  174. package/src/locales.ts +33 -0
  175. package/src/push/push-notifications.ts +10 -8
  176. package/src/state/widget-store.ts +480 -24
  177. package/src/storage.ts +18 -1
  178. package/src/types.ts +91 -8
  179. package/src/ui/WidgetProvider.tsx +166 -48
  180. package/src/ui/components/AgentUiBlocks.tsx +40 -12
  181. package/src/ui/components/Launcher.tsx +6 -1
  182. package/src/ui/components/Markdown.tsx +34 -3
  183. package/src/ui/components/Post.tsx +943 -0
  184. package/src/ui/components/RatingCard.tsx +6 -2
  185. package/src/ui/hooks/use-widget-insets.ts +0 -1
  186. package/src/ui/screens/chat/ChatView.tsx +77 -42
  187. package/src/ui/screens/chat/ChatView.types.ts +10 -0
  188. package/src/ui/utils/html.ts +10 -2
  189. package/src/ui/utils/native-gradient.ts +0 -1
  190. package/src/ui/utils/post-html.ts +256 -0
  191. package/src/ui/utils/safe-url.ts +15 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,400 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@repzo/widget-react-native`, newest first.
4
+
5
+ - **Upgrading** says what you have to do when you move to that version. A
6
+ version without it is a drop-in update.
7
+ - **Older versions** says what visitors see in apps that haven't updated yet.
8
+ - Versions follow [semver](https://semver.org): patch and minor releases don't
9
+ require code changes in your app. When a new feature shows up by default, it
10
+ comes with an opt-out and an **Upgrading** note. Anything breaking waits for
11
+ a major release and comes with step-by-step upgrade notes.
12
+
13
+ ## Unreleased
14
+
15
+ ## 1.2.0 — 2026-10-08
16
+
17
+ ### Added
18
+
19
+ - **Send posts in the app.** Posts made under Send → Post with "Show on:
20
+ Mobile" appear over the app as a badge, a snippet card or the full post. A
21
+ small post opens as a sheet and a large one as a full screen, with
22
+ paragraphs, lists, code, a button and social links, plus a reply box or
23
+ reactions. Replies go to the inbox, where the team
24
+ answers; the whole conversation (their replies and the team's answers,
25
+ live) shows under the post, with "Continue in Messenger". Answers read
26
+ under the open post count as read; one with only attachments stays unread
27
+ for the Messenger. A reaction answers the post: the emoji pops, it says thanks, and
28
+ the post goes. ⌄ (or swiping its top down, tapping outside a sheet, or
29
+ Android's back button) minimizes it to its pill or card, where it stays on
30
+ later launches too; × closes it for good. A post push ("Add push notification on mobile") opens the post
31
+ when tapped. Links and buttons in a post go through `onOpenUrl` like links in
32
+ messages, so a post button can open a screen in your app. Turn posts off
33
+ with `boot({ posts: false })`.
34
+
35
+ ### Upgrading
36
+
37
+ - **Posts show over the app by default.** They need `<RepzoWidgetProvider>`
38
+ (already required for in-app notifications). Nothing changes until a post
39
+ is set live for Mobile in Workstation. To keep them off:
40
+
41
+ ```ts
42
+ await RepzoWidget.boot({ channelAccountId: '<widget id>', posts: false });
43
+ ```
44
+
45
+ ### Older versions
46
+
47
+ - Apps on 1.1.0 or older don't show posts, and Workstation doesn't send them
48
+ post pushes. Nothing changes for them.
49
+
50
+ ## 1.1.0 — 2026-10-05
51
+
52
+ ### Added
53
+
54
+ - **More of the widget is translatable.** Order totals, appointment pickers,
55
+ quote validity, the "Share details" form and the launcher's screen-reader
56
+ label now use translatable text: Workstation translations override it, and
57
+ Arabic ships built in. English text is unchanged.
58
+ - **`expo-crypto` support.** On runtimes without a `crypto` global (Hermes
59
+ without a polyfill), the anonymous device id now comes from `expo-crypto`
60
+ when the app has it installed, instead of `Math.random`. It's a new optional
61
+ peer: nothing changes for apps without it.
62
+
63
+ ### Changed
64
+
65
+ - This changelog now ships inside the package
66
+ (`node_modules/@repzo/widget-react-native/CHANGELOG.md`).
67
+ - Long conversations stay responsive: typing a message or a live update no
68
+ longer re-renders every message in the thread.
69
+ - After **Done**, the rating card stays closed, including when the visitor
70
+ reopens the conversation. Tapping the chosen face opens the comment box
71
+ again.
72
+
73
+ ### Fixed
74
+
75
+ - Editor hover docs for `RepzoWidgetErrorCode` show again (1.0.6 detached them).
76
+ - The offline message shows in the visitor's language when Workstation has a
77
+ translation for it, the same way the welcome text does.
78
+ - The SDK reports its real version to Workstation again. 1.0.6 to 1.0.9
79
+ reported themselves as 1.0.5.
80
+ - Characters written as numeric HTML entities, such as emoji (`&#128512;`,
81
+ `&#x1F600;`), now show correctly in messages.
82
+ - Product photos in agent cards, and the avatar on a live "joined the
83
+ conversation" line, now load when Workstation sends a relative path.
84
+
85
+ ### Security
86
+
87
+ - A link whose text reads as a web address on a different site than the one
88
+ it opens now shows the real address, so `[yourbank.com](https://other.example)`
89
+ in a reply can't pass for your bank.
90
+ - Product photos in agent cards and the avatar on a live "joined" line only
91
+ load from `http`/`https` addresses, like every other image in the widget.
92
+ - Development builds warn once when the visitor token is about to be stored
93
+ in plain text (no secure storage adapter), and when the device id has to
94
+ fall back to `Math.random`.
95
+
96
+ ### Upgrading
97
+
98
+ - **Two new development-build warnings.** They never show in release builds.
99
+ To clear them, store the token in the Keychain/Keystore and give the SDK a
100
+ secure random source:
101
+
102
+ ```ts
103
+ import * as SecureStore from 'expo-secure-store';
104
+
105
+ RepzoWidget.setSecureStorageAdapter({
106
+ getItem: (key) => SecureStore.getItemAsync(key),
107
+ setItem: (key, value) => SecureStore.setItemAsync(key, value),
108
+ removeItem: (key) => SecureStore.deleteItemAsync(key),
109
+ });
110
+ ```
111
+
112
+ ```sh
113
+ npx expo install expo-crypto
114
+ ```
115
+
116
+ Bare React Native apps can instead install `react-native-get-random-values`
117
+ and `import 'react-native-get-random-values';` at the top of `index.js`.
118
+
119
+ ## 1.0.9 — 2026-10-05
120
+
121
+ ### Added
122
+
123
+ - **Signup dates.** `loginUserWithUserAttributes()` (and `boot({ user })`)
124
+ take an optional `signedUpAt`: a `Date`, unix seconds or milliseconds, or
125
+ an ISO string. Workstation shows it as "Signed up" in the inbox.
126
+
127
+ ### Known issues
128
+
129
+ - This version reports itself to Workstation as `1.0.5` in its `sdkVersion`.
130
+
131
+ ## 1.0.8 — 2026-10-04
132
+
133
+ ### Added
134
+
135
+ - **Account identification.** `loginUserWithUserAttributes()` (and
136
+ `boot({ user })`) take an optional `account: { id, name?, website? }` that
137
+ links the visitor to their company in Workstation. Accounts are matched by
138
+ `id`, so a renamed account updates the same record. New exported type
139
+ `WidgetUserAccount`.
140
+
141
+ ### Changed
142
+
143
+ - The identity verification docs now say to sign `userId` when you send one,
144
+ and `email` only when you don't.
145
+
146
+ ### Known issues
147
+
148
+ - This version reports itself to Workstation as `1.0.5` in its `sdkVersion`.
149
+
150
+ ## 1.0.7 — 2026-10-04
151
+
152
+ ### Changed
153
+
154
+ - The rating card's comment is optional. With nothing typed, its button reads
155
+ **Done** and closes the comment box. The face (and reason) are already
156
+ saved.
157
+
158
+ ### Known issues
159
+
160
+ - This version reports itself to Workstation as `1.0.5` in its `sdkVersion`.
161
+
162
+ ## 1.0.6 — 2026-10-04
163
+
164
+ ### Added
165
+
166
+ - **Conversation ratings.** Two minutes after a teammate closes a
167
+ conversation, a rating card can appear in the thread: five faces from
168
+ Terrible to Amazing. Tapping a face saves it right away. After a bad rating
169
+ (Terrible or Bad) the visitor can pick a reason, labelled in their language.
170
+ An optional comment locks the rating. Once the change window passes, or the
171
+ rating is locked, the card says so instead of accepting changes. Workstation
172
+ sends the card. There is nothing to set up in the app.
173
+
174
+ ### Older versions
175
+
176
+ - Apps on 1.0.5 or older show the rating request as a plain system line and
177
+ the visitor can't answer it.
178
+
179
+ ### Known issues
180
+
181
+ - This version reports itself to Workstation as `1.0.5` in its `sdkVersion`.
182
+
183
+ ## 1.0.5 — 2026-10-01
184
+
185
+ ### Fixed
186
+
187
+ - The home screen logo and background image now load. They used to resolve
188
+ against the wrong host, so the logo never showed.
189
+ - The home logo keeps its own shape (40 px tall, up to 152 px wide) and sits
190
+ flush left, like the web widget.
191
+
192
+ ### Changed
193
+
194
+ - The home and chat screens paint the brand header under the status bar
195
+ instead of a white strip above it. Other screens keep a white top. Status
196
+ bar icons follow the header colour. On Android the messenger is translucent,
197
+ so the inset isn't applied twice.
198
+ - "Fade background to blend in" now fades smoothly, with no visible band.
199
+
200
+ ## 1.0.4 — 2026-10-01
201
+
202
+ Includes 1.0.2 and 1.0.3, which were tagged in git but never published to npm.
203
+
204
+ ### Added
205
+
206
+ - **Sent** and **Seen** receipts under the visitor's messages.
207
+ - Chat header: the workspace name with up to three teammate avatars until a
208
+ teammate joins, then that teammate's photo, name and own presence
209
+ (Active / Away). "Waiting for a teammate" shows while the visitor is waiting
210
+ for a person to reply.
211
+ - Messages a teammate deleted show "This message was deleted" instead of
212
+ disappearing.
213
+ - The welcome greeting, introduction, start button and reply-time text use the
214
+ visitor's language when Workstation has translations for it. Otherwise they
215
+ fall back to the default language.
216
+ - New exported fields: `Conversation.workspaceName`, `teamAvatars`,
217
+ `agentOnline` and `Message.deletedAt`. All optional, because older
218
+ Workstation deployments don't send them.
219
+
220
+ ## 1.0.1 — 2026-09-29
221
+
222
+ The same code was briefly tagged in git as `v1.1.0` to `v1.2.1` before the
223
+ version number was reset. Those versions were never on npm. If you installed
224
+ one of those tags from git, switch to npm 1.0.1 or later.
225
+
226
+ ### Added
227
+
228
+ - **Photo and file attachments** from a paperclip button in the composer. It
229
+ uses `expo-image-picker` and `expo-document-picker` when the app has them,
230
+ or your own picker through `boot({ attachments: { pick } })`. Limits are 5
231
+ files per message, 1.5 MB each and 6 MB in total. With the optional
232
+ `expo-image-manipulator`, photos are shrunk to fit. A failed send keeps its
233
+ attachments in the composer for a retry. New optional peers:
234
+ `expo-image-picker`, `expo-document-picker`, `expo-file-system`,
235
+ `expo-image-manipulator`.
236
+ - Image attachments open in a full-screen viewer inside the messenger. Other
237
+ files still open externally.
238
+ - **In-app notifications**: when a team reply arrives while the app is open
239
+ and the messenger is closed, a card slides up. Tapping it opens the
240
+ conversation; swiping it dismisses it. Replies that arrived while the app
241
+ was closed get the card once at launch. New `boot({ inAppNotifications })`
242
+ option and `useWidgetState().inAppNotification`.
243
+ - New exported types: `AttachmentSource`, `InAppNotification`,
244
+ `RepzoPickedFile`, `RepzoWidgetAttachmentOptions`.
245
+
246
+ ### Changed
247
+
248
+ - `withRepzoWidget` (`@repzo/widget-react-native/metro`) only turns on Metro's
249
+ `allowOptionalDependencies` now. The custom resolver it installed in 1.0.0
250
+ crashed Expo development builds at startup with
251
+ `Property 'MessageQueue' doesn't exist`. The standard Expo and React Native
252
+ Metro configs don't need the wrapper at all.
253
+
254
+ ### Upgrading from 1.0.0
255
+
256
+ - **In-app notification cards are on by default.** They need
257
+ `<RepzoWidgetProvider>` mounted at the root. To keep 1.0.0's behaviour:
258
+
259
+ ```ts
260
+ await RepzoWidget.boot({ channelAccountId: '<widget id>', inAppNotifications: false });
261
+ ```
262
+
263
+ - **The attach button appears by itself** if your app already has
264
+ `expo-image-picker` or `expo-document-picker` and the channel allows
265
+ attachments. Taking photos needs `NSCameraUsageDescription` in `Info.plist`.
266
+ To hide the button:
267
+
268
+ ```ts
269
+ await RepzoWidget.boot({ channelAccountId: '<widget id>', attachments: { enabled: false } });
270
+ ```
271
+
272
+ - **If you added `withRepzoWidget` to `metro.config.js` for 1.0.0**, you can
273
+ remove it if you use the standard Expo or React Native config, or keep it,
274
+ since it's harmless now. Restart Metro with a clean cache afterwards
275
+ (`npx expo start --clear` or `npx react-native start --reset-cache`).
276
+
277
+ ## 1.0.0 — 2026-09-28
278
+
279
+ First release on npm. Earlier versions were installed from git tags.
280
+
281
+ ### Changed
282
+
283
+ - Realtime runs on React Native's built-in streaming `XMLHttpRequest`. The
284
+ package no longer depends on `react-native-sse`, so it has no runtime
285
+ dependencies of its own.
286
+ - `react-native-safe-area-context` is an optional peer, used for safe-area
287
+ insets when installed.
288
+ - New `@repzo/widget-react-native/metro` helper (`withRepzoWidget`). Replaced
289
+ in 1.0.1, so use 1.0.1 or later.
290
+
291
+ ### Fixed
292
+
293
+ - The live connection reconnects with backoff after network failures and
294
+ dropped streams.
295
+ - Loading older messages no longer races with new ones.
296
+
297
+ ### Upgrading from 0.1.x (git installs)
298
+
299
+ - Install from npm instead of the git URL, and go straight to 1.0.1 or later:
300
+
301
+ ```sh
302
+ npm uninstall @repzo/widget-react-native
303
+ npm install @repzo/widget-react-native
304
+ ```
305
+
306
+ ## 0.1.x — git-tag releases (2026-09-16 to 2026-09-27)
307
+
308
+ These were installed from git tags and never published to npm.
309
+
310
+ ### 0.1.11 — 2026-09-27
311
+
312
+ - Fixed: the web design flashed on mobile at launch. The cached theme now
313
+ remembers which channel, server and platform it came from, and the old cache
314
+ is cleared once.
315
+
316
+ ### 0.1.10 — 2026-09-27
317
+
318
+ Includes 0.1.9, which was never tagged.
319
+
320
+ - Security: sign-in, sign-out and boot calls run one at a time, and the last
321
+ call wins. `logout()` revokes the token, removes the push registration,
322
+ wipes visitor data and rotates the device id. New `setSecureStorageAdapter`
323
+ keeps the token in Keychain/Keystore. Typed error codes
324
+ (`messenger_api_disabled`, `identity_verification_failed`). New `onOpenUrl`
325
+ boot option.
326
+ - Reliability: an error screen with Retry instead of a chat that only looks
327
+ usable. No duplicate sends while a conversation is being created. Replies
328
+ always land in the right thread. Opening a thread reports the read to the
329
+ server. Error boundaries keep a bad message from crashing the host app.
330
+
331
+ **Upgrading — breaking changes:**
332
+
333
+ - `getUnreadConversationCount()` now returns the number of conversations with
334
+ unread replies. For the old number (total unread messages) use
335
+ `getUnreadMessageCount()`.
336
+ - Links in messages only open `https:`, `http:`, `mailto:` and `tel:`. To open
337
+ your own deep links, pass `onOpenUrl` and return `true` for links you
338
+ handled:
339
+
340
+ ```ts
341
+ await RepzoWidget.boot({
342
+ channelAccountId: '<widget id>',
343
+ onOpenUrl: (url) => {
344
+ if (!url.startsWith('myapp://')) return false;
345
+ Linking.openURL(url);
346
+ return true;
347
+ },
348
+ });
349
+ ```
350
+
351
+ - `boot()` throws for a plain `http://` `baseUrl` outside `__DEV__` builds
352
+ (local addresses excepted). Use `https://`.
353
+ - Call `await RepzoWidget.logout()` in your sign-out flow, before the next
354
+ person can use the device.
355
+ - Recommended: store the token in Keychain/Keystore with
356
+ `setSecureStorageAdapter` (see the README).
357
+
358
+ ### 0.1.8 — 2026-09-23
359
+
360
+ - The last theme is cached on the device, so relaunches paint your colours
361
+ instantly.
362
+
363
+ ### 0.1.7 — 2026-09-23
364
+
365
+ - Opening a conversation lands on the newest message. "Load earlier" keeps
366
+ your place.
367
+
368
+ ### 0.1.6 — 2026-09-23
369
+
370
+ - Unread counts come from the server, so replies that arrived while the app
371
+ was killed count after a cold start.
372
+ - New `ConversationDidRead` event, for clearing that conversation's push
373
+ notification.
374
+
375
+ ### 0.1.5 — 2026-09-23
376
+
377
+ - Supports the modular API of `@react-native-firebase/messaging` v26.
378
+
379
+ ### 0.1.4 — 2026-09-22
380
+
381
+ - FCM push notifications: `boot({ push })` and `setPushToken()`. New optional
382
+ peer `@react-native-firebase/messaging`.
383
+
384
+ ### 0.1.3 — 2026-09-22
385
+
386
+ - New `MessageDidArrive` event for team replies. Replayed messages after a
387
+ reconnect no longer count twice.
388
+
389
+ ### 0.1.2 — 2026-09-21
390
+
391
+ - Home and pre-chat screens, RTL layout support.
392
+
393
+ ### 0.1.1 — 2026-09-16
394
+
395
+ - `baseUrl` defaults to production Workstation, so `boot()` only needs
396
+ `channelAccountId`. `present()` before `boot()` is a warned no-op.
397
+
398
+ ### 0.1.0 — 2026-09-16
399
+
400
+ - First standalone release.
package/README.md CHANGED
@@ -21,10 +21,14 @@ in your Repzo Inbox and agent replies arrive live.
21
21
  - Session resume, anonymous → identified migration, HMAC identity verification
22
22
  - Shared-device safe: logout revokes the token and wipes all visitor data; tokens can live in Keychain/Keystore
23
23
  - Live agent replies, typing indicators, unread badges (server-backed counts)
24
+ - Sent/Seen receipts, teammate avatars and presence, deleted-message placeholders
24
25
  - Catches up after a dropped connection or a trip to the background — no missed or duplicated replies
25
26
  - Agent UI blocks: product cards, slot pickers, lead forms, quotes, receipts
26
27
  - **Photo and file attachments** (optional — with `expo-image-picker` / `expo-document-picker`, or your own picker)
28
+ - **In-app notification cards** for new replies while the messenger is closed
29
+ - **Posts** from Workstation over the app, with replies or emoji reactions
27
30
  - **Push notifications via FCM** (optional — needs `@react-native-firebase/messaging` in the host app)
31
+ - Conversation ratings after a teammate closes the chat
28
32
  - Theme cached on-device, so relaunches paint your colors instantly
29
33
  - Events for building your own badge, in-app banner, and tray cleanup
30
34
 
@@ -41,9 +45,15 @@ in your Repzo Inbox and agent replies arrive live.
41
45
  | `expo-document-picker` | optional — "File" attachments |
42
46
  | `expo-file-system` | optional — reads picked files as base64 (falls back to `fetch` without it) |
43
47
  | `expo-image-manipulator` | optional — shrinks photos so camera shots fit the 1.5 MB attachment limit |
48
+ | `expo-crypto` | optional (*1.1.0+*) — secure random source for the anonymous device id when the runtime has no `crypto` global (see below) |
44
49
 
45
50
  Realtime uses React Native’s built-in streaming XMLHttpRequest; there are no bundled runtime dependencies.
46
51
 
52
+ *1.1.0+.* The anonymous device id needs a secure random source. Hermes has no `crypto`
53
+ global, so install `expo-crypto` (Expo), or `react-native-get-random-values`
54
+ imported at the top of `index.js` (bare React Native). Without either, the id
55
+ falls back to `Math.random` and development builds log a warning.
56
+
47
57
  ## Installation
48
58
 
49
59
  Published on npm as
@@ -87,8 +97,7 @@ Expo: no config plugin and no `npx expo prebuild` needed — the SDK itself runs
87
97
  in **Expo Go**. (Push notifications are the one exception: they need a
88
98
  development build, see below.)
89
99
 
90
- To upgrade later: `npm install @repzo/widget-react-native@latest` (or
91
- `yarn upgrade @repzo/widget-react-native --latest`).
100
+ To upgrade later, see [Upgrading](#upgrading).
92
101
 
93
102
  ## Metro setup
94
103
 
@@ -223,6 +232,8 @@ instead — same adapter shape, set **before** the first `boot()`. Without a
223
232
  secure adapter they fall back to the regular store above; with one, a token
224
233
  already in the regular store is moved over on first read. If a secure write
225
234
  fails the token is kept in memory only (never written as plaintext).
235
+ From 1.1.0, development builds log a one-time warning when the token is about
236
+ to be stored without a secure adapter.
226
237
 
227
238
  `expo-secure-store` (`npx expo install expo-secure-store`):
228
239
 
@@ -265,7 +276,7 @@ there simply expires or gets replaced on the next init.
265
276
 
266
277
  ## Links in messages
267
278
 
268
- Agent and AI replies, campaign CTAs and attachments are remote content, so
279
+ Agent and AI replies, campaign CTAs, posts and attachments are remote content, so
269
280
  the SDK only opens `https:`, `http:`, `mailto:` and `tel:` links. Everything
270
281
  else (your own `myapp://` deep links, `intent:`, `sms:`, `file:`,
271
282
  `javascript:`…) is blocked. To route links yourself, pass `onOpenUrl` — it
@@ -287,6 +298,11 @@ await RepzoWidget.boot({
287
298
  Only accept deep links you would be comfortable with *anyone* sending your
288
299
  user in a chat message.
289
300
 
301
+ *1.1.0+.* Link text can't disguise where a link goes: when the text of a link reads as a
302
+ web address on a different site than the one it opens, the widget shows the
303
+ real address instead, so `[yourbank.com](https://other.example)` can't pass for
304
+ your bank. Ordinary link text ("Book here") is shown as written.
305
+
290
306
  ## Attachments
291
307
 
292
308
  Visitors can send photos and files from the paperclip button beside the
@@ -402,6 +418,63 @@ await RepzoWidget.boot({ channelAccountId: '…', inAppNotifications: false });
402
418
  While the app is in the background the system push notification (below) does
403
419
  this job instead.
404
420
 
421
+ ## Posts
422
+
423
+ *1.2.0+.* Posts made in Workstation under **Send → Post** with **Show on: Mobile**
424
+ appear over the app, the same way they do on the website:
425
+
426
+ - **Badge** — a small pill above the bottom edge with the sender and a dot.
427
+ - **Snippet** — a card with the sender and the first words.
428
+ - **Full** — opens right away.
429
+
430
+ Tapping a badge or snippet opens the post: a sheet over the app for **Small**
431
+ posts, a full screen for **Large** ones. It shows paragraphs, lists, code, a
432
+ button and social links, and ends with a reply box or emoji reactions,
433
+ depending on the post's **Reply type**. Replies show under the post and also
434
+ go to an inbox conversation of their own, with the post on top, where your
435
+ team answers. The team's answers show under the post too, live, like a chat,
436
+ with a **Continue in Messenger** link; they also reach the messenger as usual.
437
+ Answers read under the open post count as read. The post shows text only, so
438
+ an answer with only attachments stays unread (badge and in-app card) until the
439
+ visitor opens the conversation in the messenger. Tapping a
440
+ reaction answers the post: the emoji pops, the post says thanks, and a moment
441
+ later it goes (tapping another emoji in that moment changes the pick).
442
+
443
+ **⌄** — or swiping the post's top edge down, tapping outside a sheet, or
444
+ Android's back button — minimizes it: it goes back to its pill (or snippet
445
+ card) and stays there, on later launches too, until the visitor opens it
446
+ again. **×** closes the post for good, and the next post in line (if any) shows.
447
+
448
+ One post shows at a time. The SDK asks for it at start-up, on login/logout
449
+ and when the app comes back to the foreground. The post steps aside while the
450
+ messenger is open. With **Add push notification on mobile** turned on,
451
+ Workstation pushes the post once to each app user it's for when it goes live
452
+ (only to apps on 1.2.0 or later, which can show it).
453
+ Tapping the push opens the post, closing the messenger first if it's open. This
454
+ needs push notifications set up (below).
455
+
456
+ Links and buttons in a post go through the same rules as links in messages
457
+ (see "Links in messages"), so your `onOpenUrl` can route a post button to a
458
+ screen in your app (`myapp://…`).
459
+
460
+ On by default; needs `<RepzoWidgetProvider>` mounted at the root. To turn
461
+ posts off:
462
+
463
+ ```tsx
464
+ await RepzoWidget.boot({ channelAccountId: '…', posts: false });
465
+ ```
466
+
467
+ ## Conversation ratings
468
+
469
+ *1.0.6+.* Two minutes after a teammate closes a conversation, Workstation can
470
+ post a rating card in the thread: five faces from Terrible to Amazing. Tapping
471
+ a face saves it right away. After a bad rating the visitor can pick a reason,
472
+ labelled in their language, and leave a comment. A comment locks the rating.
473
+ The card says so once the rating can no longer change.
474
+
475
+ Workstation sends the card, so there's nothing to set up in the app. Apps on
476
+ 1.0.5 or older show it as a plain system line that can't be answered.
477
+
405
478
  ## Push notifications (optional)
406
479
 
407
480
  Agent replies are pushed **only when the user has no live connection** (app
@@ -541,8 +614,8 @@ sub.remove();
541
614
 
542
615
  | Method | Notes |
543
616
  | --- | --- |
544
- | `boot({ channelAccountId, baseUrl?, user?, push?, onOpenUrl?, attachments? })` | Mints/resumes the session and connects the live stream. Idempotent; safe to call repeatedly. |
545
- | `loginUserWithUserAttributes({ userId?, email?, name?, phone?, userHash?, account? })` | Identifies the visitor; moves anonymous history over. `account: { id, name?, website? }` links them to a CRM account matched by `id`; `signedUpAt` (Date, unix seconds or ISO) shows as "Signed up". A different stored user is signed out first. |
617
+ | `boot({ channelAccountId, baseUrl?, user?, push?, onOpenUrl?, attachments?, inAppNotifications?, posts? })` | Mints/resumes the session and connects the live stream. Idempotent; safe to call repeatedly. |
618
+ | `loginUserWithUserAttributes({ userId?, email?, name?, phone?, userHash?, account?, signedUpAt? })` | Identifies the visitor; moves anonymous history over. `account: { id, name?, website? }` links them to a CRM account matched by `id`; `signedUpAt` (Date, unix seconds or ISO) shows as "Signed up". A different stored user is signed out first. |
546
619
  | `loginUnidentifiedUser()` | Drops the identity (signing out a stored user), fresh anonymous session. |
547
620
  | `updateUser(attributes)` | Custom attributes agents see on the conversation (≤30 keys, 64-char keys, 512-char values). |
548
621
  | `logout()` | Revokes the token, removes the push registration, wipes visitor data, rotates the device id, resets the UI. Await it on sign-out. |
@@ -560,6 +633,32 @@ sub.remove();
560
633
  apps without their own chat entry point — mount it inside a full-screen
561
634
  container, it positions itself absolutely.
562
635
 
636
+ ## Upgrading
637
+
638
+ ```sh
639
+ npm install @repzo/widget-react-native@latest
640
+ # or
641
+ yarn upgrade @repzo/widget-react-native --latest
642
+ ```
643
+
644
+ Patch and minor releases don't need code changes in your app. When a new
645
+ feature shows up by default, it comes with an opt-out, listed below. Anything
646
+ breaking waits for a major release and comes with step-by-step upgrade notes.
647
+ Apps built with an older version keep working as Workstation adds features.
648
+ They just don't show the new ones until you update.
649
+
650
+ Every release, and what to do when you move to it, is in `CHANGELOG.md`,
651
+ which ships inside the package
652
+ (`node_modules/@repzo/widget-react-native/CHANGELOG.md`). Versions that need
653
+ action from you:
654
+
655
+ | Upgrading from | What to do |
656
+ | --- | --- |
657
+ | 0.1.x (installed from git) | Install from npm and go straight to 1.0.1 or later. 0.1.10 also changed `getUnreadConversationCount()`, link handling and `http://` base URLs; see the changelog. |
658
+ | 1.0.0 | In-app notification cards are now on by default (`inAppNotifications: false` turns them off). The attach button appears if `expo-image-picker` or `expo-document-picker` is installed (`attachments: { enabled: false }` hides it). The `withRepzoWidget` Metro wrapper is optional now. |
659
+ | 1.0.9 or older | Nothing required. Development builds now warn once if the visitor token isn't in secure storage, or if the device has no secure random source — see "Secure token storage" and "Requirements". |
660
+ | 1.1.0 or older | Posts from Workstation now show over the app by default, once one is set live for Mobile (`posts: false` turns them off). They need `<RepzoWidgetProvider>` mounted at the root. |
661
+
563
662
  ## Troubleshooting
564
663
 
565
664
  - **No push arrives** — check in this order: `boot()` with `push.enabled` and a
@@ -118,7 +118,8 @@ function getProcedureForm(metadata) {
118
118
  if (!isRecord(form) || !Array.isArray(form.fields) || form.fields.length === 0) return null;
119
119
  return {
120
120
  procedureId: typeof form.procedureId === 'string' ? form.procedureId : '',
121
- procedureName: typeof form.procedureName === 'string' ? form.procedureName : 'Details',
121
+ // Empty when unnamed: the UI shows its translated "Details" instead.
122
+ procedureName: typeof form.procedureName === 'string' ? form.procedureName : '',
122
123
  fields: form.fields.filter(field => field && typeof field.name === 'string').map(field => ({
123
124
  name: field.name,
124
125
  label: typeof field.label === 'string' ? field.label : field.name,
@@ -1 +1 @@
1
- {"version":3,"names":["KNOWN_BLOCK_TYPES","Set","KNOWN_ACTION_TYPES","isRecord","value","Array","isArray","isString","isNumber","Number","isFinite","isOptional","check","undefined","isArrayOf","every","isAction","id","label","type","has","payload","isCommerceItem","name","quantity","unitPrice","lineTotal","isVariant","title","price","currency","isFormField","placeholder","isProvider","isSlot","startTime","endTime","slotToken","staffUserId","isDay","date","slots","isValidBlock","block","product","imageUrl","shortDescription","description","unit","durationMinutes","productId","variants","length","actions","items","subtotal","total","discount","tax","shipping","status","action","submitLabel","fields","statement","channels","serviceId","serviceName","timezone","selectedProviderId","providers","days","amount","serialNumber","contactName","validUntil","reference","nextActions","parseAgentUiBlocks","blocks","normalized","push","getAgentUiBlocks","metadata","agentUiBlocks","getProcedureForm","form","agentProcedureForm","procedureId","procedureName","filter","field","map","includes","required","formatAgentUiActionMessage","String","productName","variantTitle","cartId","module","productType","providerName","quoteId","trim","join","Object","entries","key"],"sourceRoot":"../../src","sources":["agent-ui-blocks.ts"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMA,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAChC,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,yBAAyB,EACzB,eAAe,EACf,iBAAiB,CAClB,CAAC;AAEF,MAAMC,kBAAkB,GAAG,IAAID,GAAG,CAAC,CACjC,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,6BAA6B,EAC7B,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,aAAa,CACd,CAAC;AAEF,SAASE,QAAQA,CAACC,KAAc,EAAoC;EAClE,OAAO,CAAC,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AACtE;;AAEA;AACA;AACA;AACA;;AAEA,MAAMG,QAAQ,GAAIH,KAAc,IAAsB,OAAOA,KAAK,KAAK,QAAQ;AAE/E,MAAMI,QAAQ,GAAIJ,KAAc,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIK,MAAM,CAACC,QAAQ,CAACN,KAAK,CAAC;AAErD,MAAMO,UAAU,GAAGA,CAACP,KAAc,EAAEQ,KAAkC,KACpER,KAAK,KAAKS,SAAS,IAAIT,KAAK,KAAK,IAAI,IAAIQ,KAAK,CAACR,KAAK,CAAC;AAEvD,MAAMU,SAAS,GAAGA,CAACV,KAAc,EAAEQ,KAAiC,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CAAC,KAAK,GAAGwG,GAAG,KAAKZ,MAAM,CAAC5F,KAAK,CAAC,CAACoG,IAAI,CAAC,CAAC,EAAE,CAAC,CACxDC,IAAI,CAAC,IAAI,CAAC,IAAI,sCAAsC;IAE3D,KAAK,aAAa;MAChB,OAAO5C,MAAM,CAAC3C,KAAK;IACrB;MACE,OAAO2C,MAAM,CAAC3C,KAAK;EACvB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["KNOWN_BLOCK_TYPES","Set","KNOWN_ACTION_TYPES","isRecord","value","Array","isArray","isString","isNumber","Number","isFinite","isOptional","check","undefined","isArrayOf","every","isAction","id","label","type","has","payload","isCommerceItem","name","quantity","unitPrice","lineTotal","isVariant","title","price","currency","isFormField","placeholder","isProvider","isSlot","startTime","endTime","slotToken","staffUserId","isDay","date","slots","isValidBlock","block","product","imageUrl","shortDescription","description","unit","durationMinutes","productId","variants","length","actions","items","subtotal","total","discount","tax","shipping","status","action","submitLabel","fields","statement","channels","serviceId","serviceName","timezone","selectedProviderId","providers","days","amount","serialNumber","contactName","validUntil","reference","nextActions","parseAgentUiBlocks","blocks","normalized","push","getAgentUiBlocks","metadata","agentUiBlocks","getProcedureForm","form","agentProcedureForm","procedureId","procedureName","filter","field","map","includes","required","formatAgentUiActionMessage","String","productName","variantTitle","cartId","module","productType","providerName","quoteId","trim","join","Object","entries","key"],"sourceRoot":"../../src","sources":["agent-ui-blocks.ts"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMA,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAChC,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,SAAS,EACT,yBAAyB,EACzB,eAAe,EACf,iBAAiB,CAClB,CAAC;AAEF,MAAMC,kBAAkB,GAAG,IAAID,GAAG,CAAC,CACjC,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,6BAA6B,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,KAAK,cAAc;MACjB,OAAO,kBAAkBN,MAAM,CAAC3E,OAAO,CAACuD,SAAS,IAAIvD,OAAO,CAACkF,OAAO,IAAI,EAAE,CAAC,GAAG,CAACC,IAAI,CAAC,CAAC;IACvF,KAAK,gBAAgB;MACnB,OAAO,mCACLnG,KAAK,CAACC,OAAO,CAACe,OAAO,CAAC4C,QAAQ,CAAC,GAAG5C,OAAO,CAAC4C,QAAQ,CAACwC,IAAI,CAAC,IAAI,CAAC,GAAG,sBAAsB,GACrF;IACL,KAAK,aAAa;MAChB,OAAO5C,MAAM,CAAC3C,KAAK;IACrB,KAAK,gBAAgB;MACnB,OACEwF,MAAM,CAACC,OAAO,CAACtF,OAAO,CAAC,CACpBqE,MAAM,CAAC,CAAC,GAAGtF,KAAK,CAAC,KAAK,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACoG,IAAI,CAAC,CAAC,CAAC,CAChEZ,GAAG,CAAC,CAAC,CAACgB,GAAG,EAAExG,KAAK,CAAC,KAAK,GAAGwG,GAAG,KAAKZ,MAAM,CAAC5F,KAAK,CAAC,CAACoG,IAAI,CAAC,CAAC,EAAE,CAAC,CACxDC,IAAI,CAAC,IAAI,CAAC,IAAI,sCAAsC;IAE3D,KAAK,aAAa;MAChB,OAAO5C,MAAM,CAAC3C,KAAK;IACrB;MACE,OAAO2C,MAAM,CAAC3C,KAAK;EACvB;AACF","ignoreList":[]}
@@ -144,6 +144,31 @@ class WidgetApiClient {
144
144
  return this.request(`/api/widget/outbound/${encodeURIComponent(this.channelAccountId)}`);
145
145
  }
146
146
 
147
+ /**
148
+ * The Send post this visitor should see now, if any.
149
+ * `recheckInMs`: ask again after this long — the shown one stops then.
150
+ */
151
+ getPost() {
152
+ return this.request('/api/widget/send/post?platform=mobile');
153
+ }
154
+
155
+ /**
156
+ * Reports what the visitor did with a post; `hidden` means load the next
157
+ * one. A reply comes back as saved (`reply`) — it's also delivered to the
158
+ * post's conversation in the inbox, where the team answers.
159
+ */
160
+ sendPostInteraction(campaignId, kind, value) {
161
+ return this.request(`/api/widget/send/posts/${encodeURIComponent(campaignId)}/interactions`, {
162
+ method: 'POST',
163
+ body: value === undefined ? {
164
+ kind
165
+ } : {
166
+ kind,
167
+ value
168
+ }
169
+ });
170
+ }
171
+
147
172
  /**
148
173
  * Does NOT store the returned token — the store persists it only once it
149
174
  * knows the identity op that asked for it is still current.