@trycourier/courier-ui-inbox 2.4.0 → 2.4.2

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.
@@ -38,6 +38,7 @@ export declare class CourierInboxPopupMenu extends CourierBaseElement implements
38
38
  private _style?;
39
39
  private _datastoreListener?;
40
40
  private _totalUnreadCount;
41
+ private _feeds?;
41
42
  private _popupMenuButtonFactory?;
42
43
  static get observedAttributes(): string[];
43
44
  constructor();
@@ -11,10 +11,14 @@ import { CourierInboxDataStoreListener } from './datastore-listener';
11
11
  */
12
12
  export declare class CourierInboxDatastore {
13
13
  private static readonly TAG;
14
+ private static readonly OPEN_BATCH_DELAY_MS;
15
+ private static readonly OPEN_BATCH_MAX_SIZE;
14
16
  private static instance;
15
17
  private _datasets;
16
18
  private _listeners;
17
19
  private _removeMessageEventListener?;
20
+ private _pendingOpenMessageIds;
21
+ private _openBatchTimer;
18
22
  /**
19
23
  * Global message store is a map of Message ID to Message for all messages
20
24
  * that have been loaded.
@@ -83,11 +87,18 @@ export declare class CourierInboxDatastore {
83
87
  }): Promise<void>;
84
88
  /**
85
89
  * Mark a message as opened.
90
+ *
91
+ * The local state is updated optimistically and the server call is
92
+ * batched: multiple opens arriving within a short window
93
+ * are collected and flushed as a single GraphQL request.
94
+ *
86
95
  * @param message - The message to mark as opened
87
96
  */
88
97
  openMessage({ message }: {
89
98
  message: InboxMessage;
90
- }): Promise<void>;
99
+ }): void;
100
+ private scheduleBatchOpen;
101
+ private flushBatchOpen;
91
102
  /**
92
103
  * Unarchive a message.
93
104
  * @param message - The message to unarchive
package/dist/index.d.ts CHANGED
@@ -13,5 +13,6 @@ export * from './datastore/inbox-datastore';
13
13
  export * from './datastore/datastore-listener';
14
14
  export * from './datastore/datatore-events';
15
15
  export { Courier };
16
- export type { CourierProps, CourierClientOptions, CourierBrand, CourierApiUrls, CourierUserPreferences, CourierUserPreferencesStatus, CourierUserPreferencesChannel, CourierUserPreferencesPaging, CourierUserPreferencesTopic, CourierUserPreferencesTopicResponse, CourierDevice, CourierToken, CourierGetInboxMessageResponse, CourierGetInboxMessagesResponse, InboxMessage, InboxAction, InboxMessageEventEnvelope, } from '@trycourier/courier-js';
16
+ export type { CourierProps, CourierClientOptions, CourierBrand, CourierApiRegion, CourierApiUrls, CourierUserPreferences, CourierUserPreferencesStatus, CourierUserPreferencesChannel, CourierUserPreferencesPaging, CourierUserPreferencesTopic, CourierUserPreferencesTopicResponse, CourierDevice, CourierToken, CourierGetInboxMessageResponse, CourierGetInboxMessagesResponse, InboxMessage, InboxAction, InboxMessageEventEnvelope, } from '@trycourier/courier-js';
17
+ export { DEFAULT_COURIER_API_URLS, EU_COURIER_API_URLS, getCourierApiUrls, getCourierApiUrlsForRegion } from '@trycourier/courier-js';
17
18
  export type { CourierComponentThemeMode } from '@trycourier/courier-ui-core';