@trycourier/courier-ui-inbox 1.0.9-beta → 1.0.11-beta

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.
package/README.md CHANGED
@@ -1,11 +1,9 @@
1
- # `@trycourier/courier-ui-inbox`
2
-
3
- Web components for Courier Inbox.
1
+ <img width="1040" alt="courier-ui-inbox" src="https://github.com/user-attachments/assets/6227249b-d008-4719-bddc-874f34432376" />
4
2
 
5
3
  ## 1. Install
6
4
 
7
5
  ```sh
8
- npm i @trycourier/courier-ui-inbox@1.0.9-beta
6
+ npm i @trycourier/courier-ui-inbox@1.0.11-beta
9
7
  ```
10
8
 
11
9
  > **Using React?** We suggest you use [@trycourier/courier-react](../courier-react/README.md) package instead.
@@ -20,13 +18,9 @@ To use the SDK, you need to generate a JWT (JSON Web Token) for your user. **Thi
20
18
  - When your app needs to authenticate a user, your frontend should make a request to your own backend (e.g., `/api/generate-courier-jwt`).
21
19
 
22
20
  2. **Your backend calls Courier to issue a JWT:**
23
- - In your backend endpoint, use your Courier API Key to call the [Courier JWT Token Endpoint](https://www.courier.com/docs/reference/auth/issue-token) and generate a JWT for the user.
21
+ - In your backend endpoint, use your [Courier API Key](https://app.courier.com/settings/api-keys) to call the [Courier JWT Token Endpoint](https://www.courier.com/docs/reference/auth/issue-token) and generate a JWT for the user.
24
22
  - Your backend then returns the JWT to your frontend.
25
23
 
26
- > **Where do I get my API Key?** Go to your [Courier API Keys](https://app.courier.com/settings/api-keys) page.
27
-
28
- **Example: Quick Testing with cURL**
29
-
30
24
  To quickly test JWT generation (for development only), you can use the following cURL command to call Courier's API directly. **Do not use this in production or from client-side code.**
31
25
 
32
26
  ```sh
@@ -132,7 +126,7 @@ curl --request POST \
132
126
  );
133
127
  });
134
128
 
135
- // Handle message long presses (Useful for mobile web)
129
+ // Handle message long presses. **Only works on devices that support javascript's touch events. This will not work with a mouse cursor.**
136
130
  inbox.onMessageLongPress(({ message, index }) => {
137
131
  alert("Message long pressed at index " + index + ":\n" + JSON.stringify(message, null, 2));
138
132
  });
@@ -2,8 +2,10 @@ import { InboxAction, InboxMessage } from '@trycourier/courier-js';
2
2
  import { CourierBaseElement } from '@trycourier/courier-ui-core';
3
3
  import { CourierInboxFeedType } from '../types/feed-type';
4
4
  import { CourierInboxTheme } from '../types/courier-inbox-theme';
5
+ import { CourierInboxThemeManager } from '../types/courier-inbox-theme-manager';
5
6
  export declare class CourierInboxListItem extends CourierBaseElement {
6
7
  static get id(): string;
8
+ private _themeManager;
7
9
  private _theme;
8
10
  private _message;
9
11
  private _feedType;
@@ -19,7 +21,7 @@ export declare class CourierInboxListItem extends CourierBaseElement {
19
21
  private onItemClick;
20
22
  private onItemLongPress;
21
23
  private onItemActionClick;
22
- constructor(theme: CourierInboxTheme);
24
+ constructor(themeManager: CourierInboxThemeManager);
23
25
  private render;
24
26
  static getStyles(theme: CourierInboxTheme): string;
25
27
  private _setupHoverBehavior;
@@ -28,6 +28,8 @@ export declare class CourierInboxList extends CourierBaseElement {
28
28
  private _listStyles?;
29
29
  private _listItemStyles?;
30
30
  private _listItemMenuStyles?;
31
+ private _errorContainer?;
32
+ private _emptyContainer?;
31
33
  constructor(props: {
32
34
  themeManager: CourierInboxThemeManager;
33
35
  onRefresh: () => void;
@@ -50,6 +52,9 @@ export declare class CourierInboxList extends CourierBaseElement {
50
52
  setErrorNoClient(): void;
51
53
  private handleRetry;
52
54
  private handleRefresh;
55
+ refreshInfoStateThemes(): void;
56
+ get errorProps(): any;
57
+ get emptyProps(): any;
53
58
  private render;
54
59
  setLoadingStateFactory(factory: (props: CourierInboxStateLoadingFactoryProps | undefined | null) => HTMLElement): void;
55
60
  setEmptyStateFactory(factory: (props: CourierInboxStateEmptyFactoryProps | undefined | null) => HTMLElement): void;
@@ -22,6 +22,9 @@ export declare class CourierInboxPopupMenu extends CourierBaseElement implements
22
22
  private _popup?;
23
23
  private _inbox?;
24
24
  private _style?;
25
+ private _onMessageClick?;
26
+ private _onMessageActionClick?;
27
+ private _onMessageLongPress?;
25
28
  private _datastoreListener?;
26
29
  private _popupMenuButtonFactory?;
27
30
  static get observedAttributes(): string[];
@@ -38,6 +41,7 @@ export declare class CourierInboxPopupMenu extends CourierBaseElement implements
38
41
  private isValidPosition;
39
42
  private updatePopupPosition;
40
43
  private togglePopup;
44
+ closePopup(): void;
41
45
  private handleOutsideClick;
42
46
  setContent(element: HTMLElement): void;
43
47
  setSize(width: string, height: string): void;
package/dist/index.d.ts CHANGED
@@ -13,3 +13,4 @@ export * from './datastore/datastore-listener';
13
13
  export * from './datastore/datatore-events';
14
14
  export { Courier } from '@trycourier/courier-js';
15
15
  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 { CourierComponentThemeMode } from '@trycourier/courier-ui-core';