@inappstory/react-sdk 1.7.3 → 1.7.5

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.
Files changed (30) hide show
  1. package/dist/index.esm.mjs +28784 -4
  2. package/dist/index.esm.mjs.map +1 -0
  3. package/dist/index.umd.js +2 -2
  4. package/dist/types/appearance-manager/appearanceCommon.d.ts +69 -3
  5. package/dist/types/appearance-manager/gameReader.d.ts +83 -4
  6. package/dist/types/appearance-manager/goodsWidget.d.ts +84 -1
  7. package/dist/types/appearance-manager/sharePanel.d.ts +133 -7
  8. package/dist/types/appearance-manager/storiesList.d.ts +303 -5
  9. package/dist/types/appearance-manager/storyReader.d.ts +260 -0
  10. package/dist/types/events.d.ts +212 -0
  11. package/dist/types/ias-container/IasContainer.d.ts +24 -0
  12. package/dist/types/ias-container/appearanceOptionsProps.d.ts +20 -1
  13. package/dist/types/ias-container/index.d.ts +1 -2
  14. package/dist/types/ias-container/storyManagerEventsProps.d.ts +110 -4
  15. package/dist/types/in-app-messaging/iamErrors.d.ts +49 -45
  16. package/dist/types/in-app-messaging/inAppMessaging.d.ts +166 -0
  17. package/dist/types/index.d.ts +2 -1
  18. package/dist/types/story-list/FavoriteStoryList.d.ts +51 -1
  19. package/dist/types/story-list/StoryList.d.ts +169 -0
  20. package/dist/types/story-list/UGCStoryList.d.ts +61 -0
  21. package/dist/types/story-list/navigationViewModel.d.ts +43 -0
  22. package/dist/types/story-list/storyCardViewModel.d.ts +87 -3
  23. package/dist/types/story-list/storyListApi.d.ts +3 -2
  24. package/dist/types/story-list/storyListLoadStatus.ts +47 -10
  25. package/dist/types/storyManager.d.ts +191 -6
  26. package/package.json +6 -2
  27. package/plugins/dotLottie/iasDotLottiePlugin.umd.js +1 -1
  28. package/plugins/videoOnDemand/iasVideoOnDemandPlugin.umd.js +1 -1
  29. package/dist/types/appearance-manager/storyReader.ts +0 -125
  30. package/dist/types/ias-container/publicEvents.d.ts +0 -104
@@ -1,103 +1,330 @@
1
1
  import { Option, RecursivePartial } from "../global";
2
2
 
3
+ /**
4
+ * Slider alignment in the stories list.
5
+ */
3
6
  export declare enum StoriesListSliderAlign {
4
7
  CENTER = "center",
5
- /** @deprecated */
8
+ /** @deprecated Use START or END instead */
6
9
  LEFT = "left",
7
- /** @deprecated */
10
+ /** @deprecated Use START or END instead */
8
11
  RIGHT = "right",
9
12
  START = "start",
10
13
  END = "end"
11
14
  }
12
15
 
16
+ /**
17
+ * Card view variants for the stories list.
18
+ */
13
19
  export declare enum StoriesListCardViewVariant {
14
20
  CIRCLE = "circle",
15
21
  QUAD = "quad",
16
22
  RECTANGLE = "rectangle"
17
23
  }
18
24
 
25
+ /**
26
+ * Text alignment options for the card title.
27
+ */
19
28
  export declare enum StoriesListCardTitleTextAlign {
20
- /** @deprecated */
29
+ /** @deprecated Use START, END, or CENTER instead */
21
30
  LEFT = "left",
22
- /** @deprecated */
31
+ /** @deprecated Use START, END, or CENTER instead */
23
32
  RIGHT = "right",
24
33
  CENTER = "center",
25
34
  START = "start",
26
35
  END = "end"
27
36
  }
28
37
 
38
+ /**
39
+ * Position options for the card title.
40
+ */
29
41
  export declare enum StoriesListCardTitlePosition {
30
42
  CARD_INSIDE_BOTTOM = "cardInsideBottom",
31
43
  CARD_OUTSIDE_TOP = "cardOutsideTop",
32
44
  CARD_OUTSIDE_BOTTOM = "cardOutsideBottom"
33
45
  }
34
46
 
47
+ /**
48
+ * Cover quality options for the card.
49
+ */
35
50
  export declare enum StoriesListCardCoverQuality {
36
51
  Medium = "medium",
37
52
  High = "high"
38
53
  }
39
54
 
55
+ /**
56
+ * Stories list scrolling direction.
57
+ */
40
58
  export declare enum StoriesListDirection {
59
+ /** Vertical layout */
41
60
  COLUMN = "vertical",
61
+ /** Horizontal layout */
42
62
  ROW = "horizontal"
43
63
  }
44
64
 
65
+ /**
66
+ * Configuration options for the stories list.
67
+ */
45
68
  export type StoriesListOptions = RecursivePartial<{
69
+ /**
70
+ * Direction of the stories list.
71
+ * @default StoriesListDirection.ROW
72
+ */
46
73
  direction: StoriesListDirection | "vertical" | "horizontal";
74
+
75
+ /**
76
+ * Card options.
77
+ */
47
78
  card: StoriesListCardOptions;
79
+
80
+ /**
81
+ * Favorite card options.
82
+ */
48
83
  favoriteCard: StoriesListFavoriteCardOptions;
84
+
85
+ /**
86
+ * Layout options for the list.
87
+ */
49
88
  layout: {
89
+ /**
90
+ * Height of the list (number or string, e.g., "auto").
91
+ * @default "auto"
92
+ */
50
93
  height: number | string;
94
+
95
+ /**
96
+ * Background color of the list.
97
+ * @default "transparent"
98
+ */
51
99
  backgroundColor: string;
100
+
101
+ /**
102
+ * Slider alignment.
103
+ * @default StoriesListSliderAlign.START
104
+ */
52
105
  sliderAlign: StoriesListSliderAlign | "left" | "center" | "right" | "start" | "end";
53
106
  };
107
+
108
+ /**
109
+ * Horizontal padding (left and right).
110
+ * @default 20
111
+ */
54
112
  sidePadding: number;
113
+
114
+ /**
115
+ * Top padding.
116
+ * @default 20
117
+ */
55
118
  topPadding: number;
119
+
120
+ /**
121
+ * Bottom padding.
122
+ * @default 20
123
+ */
56
124
  bottomPadding: number;
125
+
126
+ /**
127
+ * Bottom margin of the entire list container.
128
+ * @default 17
129
+ */
57
130
  bottomMargin: number;
131
+
132
+ /**
133
+ * Navigation settings.
134
+ */
58
135
  navigation: {
59
- speed: number;
136
+ /**
137
+ * Show navigation controls (arrows).
138
+ * @default false
139
+ */
60
140
  showControls: boolean;
141
+
142
+ /**
143
+ * Size of navigation controls.
144
+ * @default 48
145
+ */
61
146
  controlsSize: number;
147
+
148
+ /**
149
+ * Background color of navigation controls.
150
+ * @default "white"
151
+ */
62
152
  controlsBackgroundColor: string;
153
+
154
+ /**
155
+ * Color of navigation controls icons.
156
+ * @default "black"
157
+ */
63
158
  controlsColor: string;
64
159
  };
160
+
161
+ /**
162
+ * User-generated content card options.
163
+ */
65
164
  ugcCard: StoriesListUgcCardOptions;
165
+
166
+ /**
167
+ * Automatically scroll the list when a story is closed.
168
+ * @default true
169
+ */
66
170
  autoScrollOnStoryClose: boolean;
67
171
  }>;
68
172
 
173
+ /**
174
+ * Options for individual story cards.
175
+ */
69
176
  export type StoriesListCardOptions = RecursivePartial<{
70
177
  title: {
178
+ /**
179
+ * Padding around the title.
180
+ * @default 10.6
181
+ */
71
182
  padding: string | number;
183
+
184
+ /**
185
+ * CSS font property for the title.
186
+ * @default '16px system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
187
+ */
72
188
  font: string;
189
+
190
+ /**
191
+ * Whether to display the title.
192
+ * @default true
193
+ */
73
194
  display: boolean;
195
+
196
+ /**
197
+ * Text alignment for the title.
198
+ * @default StoriesListCardTitleTextAlign.START
199
+ */
74
200
  textAlign: StoriesListCardTitleTextAlign | "left" | "center" | "right" | "start" | "end";
201
+
202
+ /**
203
+ * Position of the title relative to the card.
204
+ * @default StoriesListCardTitlePosition.CARD_INSIDE_BOTTOM
205
+ */
75
206
  position: StoriesListCardTitlePosition | "cardInsideBottom" | "cardOutsideTop" | "cardOutsideBottom";
207
+
208
+ /**
209
+ * Maximum number of lines shown in the title.
210
+ * @default 4
211
+ */
76
212
  lineClamp: number;
77
213
  };
214
+
215
+ /**
216
+ * Gap between cards.
217
+ * @default 10
218
+ */
78
219
  gap: number;
220
+
221
+ /**
222
+ * Card height in pixels.
223
+ * @default 178
224
+ */
79
225
  height: number;
226
+
227
+ /**
228
+ * Aspect ratio of the card (width / height).
229
+ * @default null
230
+ */
80
231
  aspectRatio: number;
232
+
233
+ /**
234
+ * Quality of the card cover image.
235
+ * @default StoriesListCardCoverQuality.High
236
+ */
81
237
  coverQuality: StoriesListCardCoverQuality | "medium" | "high";
238
+
239
+ /**
240
+ * Enables lazy loading for the card cover image.
241
+ * @default false
242
+ */
82
243
  coverLazyLoading: boolean;
244
+
245
+ /**
246
+ * Visual variant of the card.
247
+ * @default StoriesListCardViewVariant.RECTANGLE
248
+ */
83
249
  variant: StoriesListCardViewVariant | "circle" | "quad" | "rectangle";
250
+
251
+ /**
252
+ * Card border settings.
253
+ */
84
254
  border: {
255
+ /**
256
+ * Border radius in pixels.
257
+ * @default 21
258
+ */
85
259
  radius: number;
260
+
261
+ /**
262
+ * Border color.
263
+ * @default "black"
264
+ */
86
265
  color: string;
266
+
267
+ /**
268
+ * Border width in pixels.
269
+ * @default 2
270
+ */
87
271
  width: number;
272
+
273
+ /**
274
+ * Gap between border and card content in pixels.
275
+ * @default 5
276
+ */
88
277
  gap: number;
278
+
279
+ /**
280
+ * Border gradient, if applicable.
281
+ * @default null
282
+ */
89
283
  gradient: string;
90
284
  };
285
+
286
+ /**
287
+ * CSS box-shadow property for the card.
288
+ * @default null
289
+ */
91
290
  boxShadow: string;
291
+
292
+ /**
293
+ * CSS drop-shadow property for the card.
294
+ * @default null
295
+ */
92
296
  dropShadow: string;
297
+
298
+ /**
299
+ * Opacity of the card (0 to 1).
300
+ * @default null
301
+ */
93
302
  opacity: number;
303
+
304
+ /**
305
+ * Mask settings for the card.
306
+ */
94
307
  mask: {
308
+ /**
309
+ * Mask color.
310
+ * @default null
311
+ */
95
312
  color: string;
313
+
314
+ /**
315
+ * Linear gradient for the mask.
316
+ * @default null
317
+ */
96
318
  linearGradient: {
97
319
  direction: string;
98
320
  points: Array<string>;
99
321
  };
100
322
  };
323
+
324
+ /**
325
+ * SVG masks for the card.
326
+ * @default null
327
+ */
101
328
  svgMask: {
102
329
  cardMask: string;
103
330
  overlayMask: Array<{
@@ -105,24 +332,95 @@ export type StoriesListCardOptions = RecursivePartial<{
105
332
  background: string;
106
333
  }>;
107
334
  };
335
+
336
+ /**
337
+ * Styles applied to the card when it is in the "opened" state.
338
+ */
108
339
  opened: {
340
+ /**
341
+ * Border settings for the opened card.
342
+ * These override the default border settings when the card is opened.
343
+ * All properties are optional and if null, the default card border settings are used.
344
+ */
109
345
  border: {
346
+ /**
347
+ * Border radius for the opened card.
348
+ * @default null (inherits from default card border radius)
349
+ */
110
350
  radius: number;
351
+
352
+ /**
353
+ * Border color for the opened card.
354
+ * @default null (inherits from default card border color)
355
+ */
111
356
  color: string;
357
+
358
+ /**
359
+ * Border width for the opened card.
360
+ * @default null (inherits from default card border width)
361
+ */
112
362
  width: number;
363
+
364
+ /**
365
+ * Gap between border and content for the opened card.
366
+ * @default null (inherits from default card border gap)
367
+ */
113
368
  gap: number;
369
+
370
+ /**
371
+ * Border gradient for the opened card.
372
+ * @default null (inherits from default card border gradient)
373
+ */
114
374
  gradient: string;
115
375
  };
376
+
377
+ /**
378
+ * CSS box-shadow property for the opened card.
379
+ * This shadow is applied instead of the default boxShadow when the card is opened.
380
+ * @default null (inherits from default card boxShadow)
381
+ */
116
382
  boxShadow: string;
383
+
384
+ /**
385
+ * CSS drop-shadow property for the opened card.
386
+ * Overrides default dropShadow when opened.
387
+ * @default null (inherits from default card dropShadow)
388
+ */
117
389
  dropShadow: string;
390
+
391
+ /**
392
+ * Opacity of the opened card (0 to 1).
393
+ * Overrides default opacity when opened.
394
+ * @default null (inherits from default card opacity)
395
+ */
118
396
  opacity: number;
397
+
398
+ /**
399
+ * Mask settings for the opened card.
400
+ * Overrides default mask when opened.
401
+ */
119
402
  mask: {
403
+ /**
404
+ * Mask color for the opened card.
405
+ * @default null (inherits from default mask color)
406
+ */
120
407
  color: string;
408
+
409
+ /**
410
+ * Linear gradient mask for the opened card.
411
+ * @default null (inherits from default mask linear gradient)
412
+ */
121
413
  linearGradient: {
122
414
  direction: string;
123
415
  points: Array<string>;
124
416
  };
125
417
  };
418
+
419
+ /**
420
+ * SVG masks for the opened card.
421
+ * Overrides default svgMask when opened.
422
+ * @default null (inherits from default svgMask)
423
+ */
126
424
  svgMask: {
127
425
  cardMask: string;
128
426
  overlayMask: Array<{
@@ -0,0 +1,260 @@
1
+ import { CloseButtonPosition } from "./appearanceCommon";
2
+ import { SharePanel } from "./sharePanel";
3
+ import { Nullable, RecursivePartial } from "../global";
4
+
5
+ /**
6
+ * Defines the swipe animation style used when navigating between stories.
7
+ *
8
+ * This affects the visual transition effect when the user swipes to the next or previous story.
9
+ */
10
+ export declare enum StoryReaderSwipeStyle {
11
+ /**
12
+ * Flat swipe with no 3D or overlay effects.
13
+ * Simple, fast, and performance-optimized.
14
+ */
15
+ FLAT = "flat",
16
+
17
+ /**
18
+ * Cover swipe where the next story over the current one.
19
+ * Offers a layered visual effect.
20
+ */
21
+ COVER = "cover",
22
+
23
+ /**
24
+ * 3D cube rotation effect between stories.
25
+ * Visually rich but more performance-intensive.
26
+ */
27
+ CUBE = "cube"
28
+ }
29
+ /**
30
+ * Enum representing story reader layout variants
31
+ *
32
+ * @property {string} Classic - Classic display variant (default)
33
+ * @property {string} Modern - Modern experimental display variant
34
+ */
35
+ export declare enum StoryReaderLayout {
36
+ /** Classic display variant (default) */
37
+ Classic = "classic",
38
+
39
+ /** Modern experimental display variant */
40
+ Modern = "modern"
41
+ }
42
+
43
+ /**
44
+ * Appearance options for Story Reader.
45
+ */
46
+ export type StoryReaderOptions = RecursivePartial<{
47
+ /**
48
+ * Position of the close button.
49
+ *
50
+ * @default CloseButtonPosition.END
51
+ */
52
+ closeButtonPosition: CloseButtonPosition | "left" | "right";
53
+
54
+ /**
55
+ * Swipe animation style for switching between stories.
56
+ *
57
+ * @default StoryReaderSwipeStyle.FLAT
58
+ */
59
+ scrollStyle: StoryReaderSwipeStyle | "flat" | "cover" | "cube";
60
+
61
+ /**
62
+ * Vertical offset for the timeline block (in pixels).
63
+ * @default 8
64
+ */
65
+ timelineBlockTopOffset: Nullable<number>;
66
+
67
+ /**
68
+ * Vertical offset for the bottom action panel (in pixels).
69
+ * @default 0
70
+ */
71
+ actionPanelBottomOffset: Nullable<number>;
72
+
73
+ /**
74
+ * Border radius applied to the story container (in pixels).
75
+ *
76
+ * @default 12
77
+ */
78
+ borderRadius: number;
79
+
80
+ /**
81
+ * Enables the experimental modern layout variant.
82
+ *
83
+ * @default false
84
+ * @deprecated Use `layout` property instead
85
+ */
86
+ useExperimentalModernVariant: boolean;
87
+
88
+ /**
89
+ * Layout style for rendering stories.
90
+ * Can be `'classic'` or `'modern'`.
91
+ *
92
+ * @default StoryReaderLayout.Classic
93
+ */
94
+ layout: StoryReaderLayout;
95
+
96
+ /**
97
+ * Loader configuration, supports default and custom options.
98
+ */
99
+ loader: {
100
+ default: {
101
+ /**
102
+ * Primary loader color.
103
+ * @default #FFF
104
+ */
105
+ color: string;
106
+ /**
107
+ * Accent loader color.
108
+ * @default transparent
109
+ */
110
+ accentColor: string;
111
+ };
112
+ };
113
+
114
+ /**
115
+ * Whether the story list should loop back to the beginning after the last story.
116
+ *
117
+ * @default false
118
+ */
119
+ recycleStoriesList: boolean;
120
+
121
+ /**
122
+ * Automatically closes the viewer after the last slide, using a timer.
123
+ *
124
+ * @default false
125
+ */
126
+ closeOnLastSlideByTimer: boolean;
127
+
128
+ /**
129
+ * Configuration for the share panel.
130
+ * @see https://docs.inappstory.com/sdk-guides/react-sdk/share-panel.html
131
+ */
132
+ sharePanel: SharePanel<string>;
133
+
134
+ /**
135
+ * Global backdrop settings for all slides.
136
+ */
137
+ commonBackdrop: {
138
+ /**
139
+ * Background color.
140
+ * @default
141
+ * rgba(51, 51, 51, 1)
142
+ */
143
+ color: string;
144
+ /**
145
+ * CSS backdrop filter (e.g., `blur(10px)`).
146
+ * @default null
147
+ */
148
+ backdropFilter: string;
149
+ };
150
+
151
+ /**
152
+ * Slide-specific backdrop settings.
153
+ */
154
+ slideBackdrop: {
155
+ /**
156
+ * Opacity of the backdrop layer.
157
+ * @default 0.56
158
+ */
159
+ opacity: number;
160
+ /**
161
+ * Blur intensity applied to the backdrop.
162
+ * @default 30
163
+ */
164
+ blur: number;
165
+ /**
166
+ * Array of CSS linear-gradient strings used as overlays.
167
+ * @default
168
+ * ["rgba(0, 0, 0, 0.1) 0%", "rgba(0, 0, 0, 0.9) 100%"]
169
+ */
170
+ linearGradientOverlay: string[];
171
+ };
172
+
173
+ /**
174
+ * Close button configuration.
175
+ */
176
+ closeButton: {
177
+ svgSrc: {
178
+ /**
179
+ * Base (default) SVG icon for the close button.
180
+ */
181
+ baseState: string;
182
+ };
183
+ };
184
+
185
+ /**
186
+ * Like button configuration.
187
+ */
188
+ likeButton: {
189
+ svgSrc: {
190
+ /**
191
+ * SVG icon for the default (inactive) state.
192
+ */
193
+ baseState: string;
194
+ /**
195
+ * SVG icon for the active (liked) state.
196
+ */
197
+ activeState: string;
198
+ };
199
+ };
200
+
201
+ /**
202
+ * Dislike button configuration.
203
+ */
204
+ dislikeButton: {
205
+ svgSrc: {
206
+ /**
207
+ * SVG icon for the default (inactive) state.
208
+ */
209
+ baseState: string;
210
+ /**
211
+ * SVG icon for the active (disliked) state.
212
+ */
213
+ activeState: string;
214
+ };
215
+ };
216
+
217
+ /**
218
+ * Favorite button configuration.
219
+ */
220
+ favoriteButton: {
221
+ svgSrc: {
222
+ /**
223
+ * SVG icon for the default (not-favorited) state.
224
+ */
225
+ baseState: string;
226
+ /**
227
+ * SVG icon for the active (favorited) state.
228
+ */
229
+ activeState: string;
230
+ };
231
+ };
232
+
233
+ /**
234
+ * Mute button configuration.
235
+ */
236
+ muteButton: {
237
+ svgSrc: {
238
+ /**
239
+ * SVG icon for the unmuted state.
240
+ */
241
+ baseState: string;
242
+ /**
243
+ * SVG icon for the muted state.
244
+ */
245
+ activeState: string;
246
+ };
247
+ };
248
+
249
+ /**
250
+ * Share button configuration.
251
+ */
252
+ shareButton: {
253
+ svgSrc: {
254
+ /**
255
+ * SVG icon for the share button.
256
+ */
257
+ baseState: string;
258
+ };
259
+ };
260
+ }>;