@inappstory/react-sdk 1.12.0 → 1.13.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.
@@ -54,6 +54,26 @@ export interface IamMessage {
54
54
  type: IamMessageType;
55
55
  }
56
56
 
57
+ /**
58
+ * Client-side overrides applied when opening a message
59
+ */
60
+ export interface IamClientAppearanceOptions {
61
+ /**
62
+ * Custom z-index for the message container (BottomSheet / Modal / Fullscreen / Toast overlay)
63
+ */
64
+ zIndex?: number;
65
+ /**
66
+ * Overrides when the message type is Toast
67
+ */
68
+ toast?: {
69
+ /**
70
+ * Maximum toast width on desktop (pixels)
71
+ * @default 320
72
+ */
73
+ width?: number;
74
+ };
75
+ }
76
+
57
77
  /**
58
78
  * Type mapping of all possible IAM events and their payload structures
59
79
  */
@@ -170,8 +190,10 @@ export interface InAppMessaging {
170
190
  * @param options - Optional display configuration
171
191
  * @param options.showOnlyIfLoaded - If true, only shows messages that were preloaded
172
192
  * @param options.signal - Abort signal to cancel the operation
173
- * @param options.appearance - Appearance options for the message
174
- * @param options.appearance.zIndex - Custom z-index value for the message container (BottomSheet/Modal)
193
+ * @param options.appearance - Client appearance overrides when opening the message
194
+ * @param options.appearance.zIndex - Custom z-index for the message container
195
+ * @param options.appearance.toast - Toast-specific overrides (when message type is Toast)
196
+ * @param options.appearance.toast.width - Max toast width on desktop (px); default 320
175
197
  * @returns Promise resolving to the displayed message
176
198
  * @throws {IamNotFoundByIdError} If no message exists with this ID
177
199
  * @throws {IamMessageOpenError} If this message is already open
@@ -179,7 +201,10 @@ export interface InAppMessaging {
179
201
  * @throws {IamShowOnlyIfLoadedError} If showOnlyIfLoaded=true but message wasn't preloaded
180
202
  * @throws {IamMessageLimitExceededError} If message display limit was reached
181
203
  */
182
- showMessageById(messageId: number | string, options?: { showOnlyIfLoaded?: boolean; signal?: AbortSignal; appearance?: { zIndex?: number }; }): Promise<IamMessage>;
204
+ showMessageById(
205
+ messageId: number | string,
206
+ options?: { showOnlyIfLoaded?: boolean; signal?: AbortSignal; appearance?: IamClientAppearanceOptions }
207
+ ): Promise<IamMessage>;
183
208
 
184
209
  /**
185
210
  * Displays a message associated with an event name
@@ -188,8 +213,10 @@ export interface InAppMessaging {
188
213
  * @param options.showOnlyIfLoaded - If true, only shows messages that were preloaded
189
214
  * @param options.tags - Filter messages by tags
190
215
  * @param options.signal - Abort signal to cancel the operation
191
- * @param options.appearance - Appearance options for the message
192
- * @param options.appearance.zIndex - Custom z-index value for the message container (BottomSheet/Modal)
216
+ * @param options.appearance - Client appearance overrides when opening the message
217
+ * @param options.appearance.zIndex - Custom z-index for the message container
218
+ * @param options.appearance.toast - Toast-specific overrides (when message type is Toast)
219
+ * @param options.appearance.toast.width - Max toast width on desktop (px); default 320
193
220
  * @returns Promise resolving to the displayed message
194
221
  * @throws {IamNotFoundByEventError} If no message exists for this event
195
222
  * @throws {IamFrequencyLimitError} If message frequency limit was exceeded
@@ -199,7 +226,12 @@ export interface InAppMessaging {
199
226
  */
200
227
  showMessageByEvent(
201
228
  eventName: string,
202
- options?: { showOnlyIfLoaded?: boolean; tags?: string[]; signal?: AbortSignal; appearance?: { zIndex?: number }; }
229
+ options?: {
230
+ showOnlyIfLoaded?: boolean;
231
+ tags?: string[];
232
+ signal?: AbortSignal;
233
+ appearance?: IamClientAppearanceOptions;
234
+ }
203
235
  ): Promise<IamMessage>;
204
236
 
205
237
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/react-sdk",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "React SDK",
5
5
  "keywords": [
6
6
  "stories",
@@ -58,7 +58,7 @@
58
58
  "Samsung >= 5"
59
59
  ],
60
60
  "dependencies": {
61
- "@inappstory/slide-api": "^0.1.41",
61
+ "@inappstory/slide-api": "^0.1.42",
62
62
  "async-mutex": "^0.5.0",
63
63
  "bowser": "^2.11.0",
64
64
  "classnames": "^2.5.1",