@smartico/public-api 0.0.433 → 0.0.434

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.
@@ -943,7 +943,9 @@ const InboxMessageBodyTransform = item => {
943
943
  icon: item.image,
944
944
  title: item.title,
945
945
  preview_body: item.body,
946
- custom_data: IntUtils.JsonOrText(item == null ? void 0 : item.custom_data)
946
+ custom_data: IntUtils.JsonOrText(item == null ? void 0 : item.custom_data),
947
+ show_preview: item.show_preview,
948
+ show_duration_sec: item.show_duration_sec
947
949
  };
948
950
  if (item.action === 'dp:inbox') {
949
951
  if (item.additional_buttons && item.additional_buttons.length) {
@@ -9225,6 +9227,16 @@ class WSAPIInbox extends WSAPILeaderBoard {
9225
9227
  * for safe execution — that helper handles URL vs deep-link
9226
9228
  * routing.
9227
9229
  *
9230
+ * **Preview vs silent delivery**
9231
+ * Every message belongs in your inbox list. `show_preview` decides
9232
+ * whether it should also pop up briefly when it arrives:
9233
+ * - `show_preview !== false` → show a preview popup for
9234
+ * `show_duration_sec ?? 7` seconds.
9235
+ * - `show_preview === false` → store it silently, with no popup.
9236
+ * These fields are returned exactly as the operator configured them;
9237
+ * a missing value means the default above, the same as the default
9238
+ * Smartico UI.
9239
+ *
9228
9240
  * **Idempotency / Side effects**: safe. Read-only HTTP fetch.
9229
9241
  *
9230
9242
  * **UI guidance**: see [UI Guide — `getInboxMessageBody`](../../docs/ui/inbox/UIGuide_getInboxMessageBody.md).
@@ -9250,6 +9262,12 @@ class WSAPIInbox extends WSAPILeaderBoard {
9250
9262
  * console.log('[smartico] simple message — show preview_body + single CTA wired to:', body.action,
9251
9263
  * '— execute via _smartico.dp(body.action)');
9252
9264
  * }
9265
+ *
9266
+ * if (body.show_preview !== false) {
9267
+ * console.log('[smartico] new message — show a preview popup for', body.show_duration_sec ?? 7, 'seconds');
9268
+ * } else {
9269
+ * console.log('[smartico] new message — store it in the inbox silently, no popup');
9270
+ * }
9253
9271
  * ```
9254
9272
  */
9255
9273
  async getInboxMessageBody(messageGuid) {