@trycourier/courier-ui-inbox 2.4.8 → 2.4.10

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.
@@ -3,6 +3,7 @@ import { CourierInboxHeaderFactoryProps, CourierInboxListItemActionFactoryProps,
3
3
  import { CourierInboxFeed } from '../types/inbox-data-set';
4
4
  import { CourierInboxTheme } from '../types/courier-inbox-theme';
5
5
  import { CourierComponentThemeMode, CourierBaseElement } from '@trycourier/courier-ui-core';
6
+ import { InboxMessage } from '@trycourier/courier-js';
6
7
  import { CourierInboxHeaderAction, CourierInboxListItemAction } from '../types/inbox-defaults';
7
8
  export type CourierInboxPopupAlignment = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center' | 'center-right' | 'center-left' | 'center-center';
8
9
  export declare class CourierInboxPopupMenu extends CourierBaseElement implements CourierInboxDatastoreEvents {
@@ -39,6 +40,10 @@ export declare class CourierInboxPopupMenu extends CourierBaseElement implements
39
40
  private _datastoreListener?;
40
41
  private _totalUnreadCount;
41
42
  private _feeds?;
43
+ /** Preview mode: forward injected messages to the inner inbox; never touch the shared datastore. */
44
+ private _isPreview;
45
+ private _previewMessages?;
46
+ private _previewUnreadCount?;
42
47
  private _popupMenuButtonFactory?;
43
48
  static get observedAttributes(): string[];
44
49
  constructor();
@@ -48,6 +53,13 @@ export declare class CourierInboxPopupMenu extends CourierBaseElement implements
48
53
  private refreshTheme;
49
54
  static getStyles(theme: CourierInboxTheme, width: string, height: string): string;
50
55
  attributeChangedCallback(name: string, _: string, newValue: string): void;
56
+ /**
57
+ * Render injected "dummy" inbox messages in the popup and skip all
58
+ * network/realtime + the shared datastore. Pass `null` to clear preview mode.
59
+ */
60
+ setPreviewData(messages: InboxMessage[] | null, options?: {
61
+ unreadCount?: number;
62
+ }): void;
51
63
  /**
52
64
  * Called when the per-dataset unread count changes.
53
65
  * Triggers a render to update the factory with latest feeds data
@@ -1,3 +1,4 @@
1
+ import { InboxMessage } from '@trycourier/courier-js';
1
2
  import { CourierBaseElement, CourierComponentThemeMode } from '@trycourier/courier-ui-core';
2
3
  import { CourierInboxFeed } from '../types/inbox-data-set';
3
4
  import { CourierInboxHeaderFactoryProps, CourierInboxHeaderFeed, CourierInboxListItemActionFactoryProps, CourierInboxListItemFactoryProps, CourierInboxPaginationItemFactoryProps, CourierInboxStateEmptyFactoryProps, CourierInboxStateErrorFactoryProps, CourierInboxStateLoadingFactoryProps } from '../types/factories';
@@ -99,6 +100,9 @@ export declare class CourierInbox extends CourierBaseElement {
99
100
  private _datastoreListener;
100
101
  private _authListener;
101
102
  private _feeds;
103
+ /** When true, render injected preview messages and skip all network/realtime + the shared datastore. */
104
+ private _isPreview;
105
+ private _previewDataSet?;
102
106
  private _header?;
103
107
  private _headerFactory;
104
108
  private _actions;
@@ -215,5 +219,15 @@ export declare class CourierInbox extends CourierBaseElement {
215
219
  * Forces a reload of the inbox data, bypassing the cache.
216
220
  */
217
221
  refresh(): Promise<void>;
222
+ /**
223
+ * Render injected "dummy" inbox messages and skip all network/realtime + the
224
+ * shared datastore (so a live inbox elsewhere is unaffected). Pass `null` to
225
+ * clear preview mode.
226
+ */
227
+ setPreviewData(messages: InboxMessage[] | null, options?: {
228
+ unreadCount?: number;
229
+ }): void;
230
+ /** Render the current preview dataset into the list + header (preview mode only). */
231
+ private renderPreview;
218
232
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
219
233
  }