@capillarytech/creatives-library 8.0.239-alpha.0 → 8.0.239

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 (110) hide show
  1. package/package.json +1 -1
  2. package/services/api.js +0 -5
  3. package/translations/en.json +0 -1
  4. package/utils/transformerUtils.js +0 -42
  5. package/v2Components/CapImageUpload/constants.js +0 -2
  6. package/v2Components/CapImageUpload/index.js +14 -54
  7. package/v2Components/CapImageUpload/index.scss +1 -4
  8. package/v2Components/CapImageUpload/messages.js +0 -4
  9. package/v2Containers/App/constants.js +0 -5
  10. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +0 -1
  11. package/v2Containers/CreativesContainer/SlideBoxContent.js +2 -57
  12. package/v2Containers/CreativesContainer/SlideBoxHeader.js +0 -1
  13. package/v2Containers/CreativesContainer/constants.js +0 -2
  14. package/v2Containers/CreativesContainer/index.js +0 -152
  15. package/v2Containers/CreativesContainer/messages.js +0 -4
  16. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
  17. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
  18. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -25
  19. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -18
  20. package/v2Containers/Rcs/index.js +153 -383
  21. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -46
  22. package/v2Containers/Rcs/tests/index.test.js +168 -0
  23. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +0 -4
  24. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -8
  25. package/v2Containers/Templates/ChannelTypeIllustration.js +1 -13
  26. package/v2Containers/Templates/_templates.scss +0 -203
  27. package/v2Containers/Templates/actions.js +1 -2
  28. package/v2Containers/Templates/constants.js +0 -1
  29. package/v2Containers/Templates/index.js +30 -273
  30. package/v2Containers/Templates/messages.js +0 -24
  31. package/v2Containers/Templates/reducer.js +0 -2
  32. package/v2Containers/Templates/tests/index.test.js +0 -10
  33. package/v2Containers/TemplatesV2/index.js +2 -3
  34. package/v2Containers/TemplatesV2/messages.js +0 -4
  35. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -132
  36. package/v2Components/CapImageUrlUpload/constants.js +0 -19
  37. package/v2Components/CapImageUrlUpload/index.js +0 -455
  38. package/v2Components/CapImageUrlUpload/index.scss +0 -35
  39. package/v2Components/CapImageUrlUpload/messages.js +0 -47
  40. package/v2Containers/WebPush/Create/components/ButtonForm.js +0 -175
  41. package/v2Containers/WebPush/Create/components/ButtonItem.js +0 -101
  42. package/v2Containers/WebPush/Create/components/ButtonList.js +0 -144
  43. package/v2Containers/WebPush/Create/components/_buttons.scss +0 -246
  44. package/v2Containers/WebPush/Create/components/tests/ButtonForm.test.js +0 -554
  45. package/v2Containers/WebPush/Create/components/tests/ButtonItem.test.js +0 -607
  46. package/v2Containers/WebPush/Create/components/tests/ButtonList.test.js +0 -633
  47. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonForm.test.js.snap +0 -666
  48. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonItem.test.js.snap +0 -74
  49. package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonList.test.js.snap +0 -80
  50. package/v2Containers/WebPush/Create/index.js +0 -1727
  51. package/v2Containers/WebPush/Create/index.scss +0 -123
  52. package/v2Containers/WebPush/Create/messages.js +0 -199
  53. package/v2Containers/WebPush/Create/preview/DevicePreviewContent.js +0 -241
  54. package/v2Containers/WebPush/Create/preview/NotificationContainer.js +0 -290
  55. package/v2Containers/WebPush/Create/preview/PreviewContent.js +0 -81
  56. package/v2Containers/WebPush/Create/preview/PreviewControls.js +0 -240
  57. package/v2Containers/WebPush/Create/preview/PreviewDisclaimer.js +0 -23
  58. package/v2Containers/WebPush/Create/preview/WebPushPreview.js +0 -139
  59. package/v2Containers/WebPush/Create/preview/assets/Light.svg +0 -53
  60. package/v2Containers/WebPush/Create/preview/assets/Top.svg +0 -5
  61. package/v2Containers/WebPush/Create/preview/assets/chrome-icon.png +0 -0
  62. package/v2Containers/WebPush/Create/preview/assets/edge-icon.png +0 -0
  63. package/v2Containers/WebPush/Create/preview/assets/firefox-icon.svg +0 -106
  64. package/v2Containers/WebPush/Create/preview/assets/iOS.svg +0 -26
  65. package/v2Containers/WebPush/Create/preview/assets/opera-icon.svg +0 -18
  66. package/v2Containers/WebPush/Create/preview/assets/safari-icon.svg +0 -29
  67. package/v2Containers/WebPush/Create/preview/components/AndroidMobileChromeHeader.js +0 -44
  68. package/v2Containers/WebPush/Create/preview/components/AndroidMobileExpanded.js +0 -110
  69. package/v2Containers/WebPush/Create/preview/components/IOSHeader.js +0 -45
  70. package/v2Containers/WebPush/Create/preview/components/NotificationExpandedContent.js +0 -72
  71. package/v2Containers/WebPush/Create/preview/components/NotificationHeader.js +0 -55
  72. package/v2Containers/WebPush/Create/preview/components/WindowsChromeExpanded.js +0 -70
  73. package/v2Containers/WebPush/Create/preview/components/tests/AndroidMobileExpanded.test.js +0 -512
  74. package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/AndroidMobileExpanded.test.js.snap +0 -77
  75. package/v2Containers/WebPush/Create/preview/config/notificationMappings.js +0 -527
  76. package/v2Containers/WebPush/Create/preview/constants.js +0 -162
  77. package/v2Containers/WebPush/Create/preview/notification-container.scss +0 -104
  78. package/v2Containers/WebPush/Create/preview/preview.scss +0 -409
  79. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-chrome.scss +0 -300
  80. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-edge.scss +0 -12
  81. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-firefox.scss +0 -12
  82. package/v2Containers/WebPush/Create/preview/styles/_android-mobile-opera.scss +0 -12
  83. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-chrome.scss +0 -303
  84. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-edge.scss +0 -11
  85. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-firefox.scss +0 -11
  86. package/v2Containers/WebPush/Create/preview/styles/_android-tablet-opera.scss +0 -11
  87. package/v2Containers/WebPush/Create/preview/styles/_base.scss +0 -188
  88. package/v2Containers/WebPush/Create/preview/styles/_ios.scss +0 -106
  89. package/v2Containers/WebPush/Create/preview/styles/_ipados.scss +0 -107
  90. package/v2Containers/WebPush/Create/preview/styles/_macos-chrome.scss +0 -75
  91. package/v2Containers/WebPush/Create/preview/styles/_windows-chrome.scss +0 -174
  92. package/v2Containers/WebPush/Create/preview/tests/DevicePreviewContent.test.js +0 -909
  93. package/v2Containers/WebPush/Create/preview/tests/NotificationContainer.test.js +0 -1077
  94. package/v2Containers/WebPush/Create/preview/tests/PreviewControls.test.js +0 -723
  95. package/v2Containers/WebPush/Create/preview/tests/WebPushPreview.test.js +0 -943
  96. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/DevicePreviewContent.test.js.snap +0 -128
  97. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/NotificationContainer.test.js.snap +0 -121
  98. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/PreviewControls.test.js.snap +0 -144
  99. package/v2Containers/WebPush/Create/preview/tests/__snapshots__/WebPushPreview.test.js.snap +0 -127
  100. package/v2Containers/WebPush/Create/utils/urlValidation.js +0 -116
  101. package/v2Containers/WebPush/Create/utils/urlValidation.test.js +0 -449
  102. package/v2Containers/WebPush/actions.js +0 -60
  103. package/v2Containers/WebPush/constants.js +0 -108
  104. package/v2Containers/WebPush/index.js +0 -2
  105. package/v2Containers/WebPush/reducer.js +0 -104
  106. package/v2Containers/WebPush/sagas.js +0 -119
  107. package/v2Containers/WebPush/selectors.js +0 -65
  108. package/v2Containers/WebPush/tests/reducer.test.js +0 -863
  109. package/v2Containers/WebPush/tests/sagas.test.js +0 -566
  110. package/v2Containers/WebPush/tests/selectors.test.js +0 -843
@@ -1,527 +0,0 @@
1
- import chromeIcon from '../assets/chrome-icon.png';
2
- import safariIcon from '../assets/safari-icon.svg';
3
- import operaIcon from '../assets/opera-icon.svg';
4
- import firefoxIcon from '../assets/firefox-icon.svg';
5
- import edgeIcon from '../assets/edge-icon.png';
6
- import topSvg from '../assets/Top.svg';
7
- import iosSvg from '../assets/iOS.svg';
8
- import lightSvg from '../assets/Light.svg';
9
- import {
10
- BROWSER_OPTIONS,
11
- } from '../constants';
12
-
13
- // macOS Chrome variant definition
14
- const MACOS_CHROME_VARIANT = {
15
- frameAsset: topSvg,
16
- icon: chromeIcon,
17
- notificationClassName: 'macos-chrome',
18
- states: {
19
- Collapsed: {
20
- supportsExpanded: false,
21
- showMedia: false,
22
- showCtas: false,
23
- position: { custom: { x: 580, y: 57 } },
24
- },
25
- Expanded: {
26
- supportsExpanded: true,
27
- showMedia: true,
28
- showCtas: true,
29
- position: { custom: { x: 580, y: 57 } },
30
- },
31
- },
32
- };
33
-
34
- /**
35
- * Preview variants describe which OS+Browser+State combinations are supported,
36
- * along with assets, style classes, and positioning data.
37
- */
38
- export const PREVIEW_VARIANTS = {
39
- macOS: {
40
- Chrome: MACOS_CHROME_VARIANT,
41
- Safari: {
42
- frameAsset: topSvg,
43
- icon: safariIcon,
44
- notificationClassName: 'macos-safari',
45
- states: {
46
- Collapsed: {
47
- supportsExpanded: false,
48
- showMedia: false,
49
- showCtas: false,
50
- position: { custom: { x: 580, y: 57 } },
51
- },
52
- },
53
- },
54
- Opera: {
55
- frameAsset: topSvg,
56
- icon: operaIcon,
57
- notificationClassName: 'macos-opera',
58
- states: {
59
- Collapsed: {
60
- supportsExpanded: false,
61
- showMedia: false,
62
- showCtas: false,
63
- position: { custom: { x: 580, y: 57 } },
64
- },
65
- Expanded: {
66
- supportsExpanded: true,
67
- showMedia: true,
68
- showCtas: true,
69
- position: { custom: { x: 580, y: 57 } },
70
- },
71
- },
72
- },
73
- Firefox: {
74
- frameAsset: topSvg,
75
- icon: firefoxIcon,
76
- notificationClassName: 'macos-firefox',
77
- states: {
78
- Collapsed: {
79
- supportsExpanded: false,
80
- showMedia: false,
81
- showCtas: false,
82
- position: { custom: { x: 580, y: 57 } },
83
- },
84
- Expanded: {
85
- supportsExpanded: true,
86
- showMedia: true,
87
- showCtas: true,
88
- position: { custom: { x: 580, y: 57 } },
89
- },
90
- },
91
- },
92
- Edge: {
93
- frameAsset: topSvg,
94
- icon: edgeIcon,
95
- notificationClassName: 'macos-edge',
96
- states: {
97
- Collapsed: {
98
- supportsExpanded: false,
99
- showMedia: false,
100
- showCtas: false,
101
- position: { custom: { x: 580, y: 57 } },
102
- },
103
- Expanded: {
104
- supportsExpanded: true,
105
- showMedia: true,
106
- showCtas: true,
107
- position: { custom: { x: 580, y: 57 } },
108
- },
109
- },
110
- },
111
- },
112
- Windows: {
113
- Chrome: {
114
- frameAsset: topSvg,
115
- icon: chromeIcon,
116
- notificationClassName: 'windows-chrome',
117
- states: {
118
- Collapsed: {
119
- supportsExpanded: false,
120
- showMedia: false,
121
- showCtas: false,
122
- position: { custom: { x: 580, bottom: 55 } },
123
- },
124
- Expanded: {
125
- supportsExpanded: true,
126
- showMedia: false,
127
- showCtas: false,
128
- position: { custom: { x: 580, bottom: 55 } },
129
- },
130
- },
131
- },
132
- Firefox: {
133
- frameAsset: topSvg,
134
- icon: firefoxIcon,
135
- notificationClassName: 'windows-firefox',
136
- states: {
137
- Collapsed: {
138
- supportsExpanded: false,
139
- showMedia: false,
140
- showCtas: false,
141
- position: { custom: { x: 580, bottom: 55 } },
142
- },
143
- Expanded: {
144
- supportsExpanded: true,
145
- showMedia: false,
146
- showCtas: false,
147
- position: { custom: { x: 580, bottom: 55 } },
148
- },
149
- },
150
- },
151
- Edge: {
152
- frameAsset: topSvg,
153
- icon: edgeIcon,
154
- notificationClassName: 'windows-edge',
155
- states: {
156
- Collapsed: {
157
- supportsExpanded: false,
158
- showMedia: false,
159
- showCtas: false,
160
- position: { custom: { x: 580, bottom: 55 } },
161
- },
162
- Expanded: {
163
- supportsExpanded: true,
164
- showMedia: false,
165
- showCtas: false,
166
- position: { custom: { x: 580, bottom: 55 } },
167
- },
168
- },
169
- },
170
- Opera: {
171
- frameAsset: topSvg,
172
- icon: operaIcon,
173
- notificationClassName: 'windows-opera',
174
- states: {
175
- Collapsed: {
176
- supportsExpanded: false,
177
- showMedia: false,
178
- showCtas: false,
179
- position: { custom: { x: 580, bottom: 55 } },
180
- },
181
- Expanded: {
182
- supportsExpanded: true,
183
- showMedia: false,
184
- showCtas: false,
185
- position: { custom: { x: 580, bottom: 55 } },
186
- },
187
- },
188
- },
189
- },
190
- 'Android (Mobile)': {
191
- Chrome: {
192
- frameAsset: iosSvg,
193
- icon: chromeIcon,
194
- notificationClassName: 'android-mobile-chrome',
195
- states: {
196
- Collapsed: {
197
- supportsExpanded: false,
198
- showMedia: false,
199
- showCtas: false,
200
- position: { custom: { x: 28, y: 210 } },
201
- },
202
- Expanded: {
203
- supportsExpanded: true,
204
- showMedia: true,
205
- showCtas: false,
206
- position: { custom: { x: 28, y: 210 } },
207
- },
208
- },
209
- },
210
- Firefox: {
211
- frameAsset: iosSvg,
212
- icon: firefoxIcon,
213
- notificationClassName: 'android-mobile-firefox',
214
- states: {
215
- Collapsed: {
216
- supportsExpanded: false,
217
- showMedia: false,
218
- showCtas: false,
219
- position: { custom: { x: 28, y: 210 } },
220
- },
221
- Expanded: {
222
- supportsExpanded: true,
223
- showMedia: true,
224
- showCtas: false,
225
- position: { custom: { x: 28, y: 210 } },
226
- },
227
- },
228
- },
229
- Edge: {
230
- frameAsset: iosSvg,
231
- icon: edgeIcon,
232
- notificationClassName: 'android-mobile-edge',
233
- states: {
234
- Collapsed: {
235
- supportsExpanded: false,
236
- showMedia: false,
237
- showCtas: false,
238
- position: { custom: { x: 28, y: 210 } },
239
- },
240
- Expanded: {
241
- supportsExpanded: true,
242
- showMedia: true,
243
- showCtas: false,
244
- position: { custom: { x: 28, y: 210 } },
245
- },
246
- },
247
- },
248
- Opera: {
249
- frameAsset: iosSvg,
250
- icon: operaIcon,
251
- notificationClassName: 'android-mobile-opera',
252
- states: {
253
- Collapsed: {
254
- supportsExpanded: false,
255
- showMedia: false,
256
- showCtas: false,
257
- position: { custom: { x: 28, y: 210 } },
258
- },
259
- Expanded: {
260
- supportsExpanded: true,
261
- showMedia: true,
262
- showCtas: false,
263
- position: { custom: { x: 28, y: 210 } },
264
- },
265
- },
266
- },
267
- },
268
- 'Android (Tablet)': {
269
- Chrome: {
270
- frameAsset: lightSvg,
271
- icon: chromeIcon,
272
- notificationClassName: 'android-tablet-chrome',
273
- states: {
274
- Collapsed: {
275
- supportsExpanded: false,
276
- showMedia: false,
277
- showCtas: false,
278
- position: { custom: { x: 78, y: 265 } },
279
- },
280
- Expanded: {
281
- supportsExpanded: true,
282
- showMedia: true,
283
- showCtas: false,
284
- position: { custom: { x: 78, y: 265 } },
285
- },
286
- },
287
- },
288
- Firefox: {
289
- frameAsset: lightSvg,
290
- icon: firefoxIcon,
291
- notificationClassName: 'android-tablet-firefox',
292
- states: {
293
- Collapsed: {
294
- supportsExpanded: false,
295
- showMedia: false,
296
- showCtas: false,
297
- position: { custom: { x: 78, y: 265 } },
298
- },
299
- Expanded: {
300
- supportsExpanded: true,
301
- showMedia: true,
302
- showCtas: false,
303
- position: { custom: { x: 78, y: 265 } },
304
- },
305
- },
306
- },
307
- Edge: {
308
- frameAsset: lightSvg,
309
- icon: edgeIcon,
310
- notificationClassName: 'android-tablet-edge',
311
- states: {
312
- Collapsed: {
313
- supportsExpanded: false,
314
- showMedia: false,
315
- showCtas: false,
316
- position: { custom: { x: 78, y: 265 } },
317
- },
318
- Expanded: {
319
- supportsExpanded: true,
320
- showMedia: true,
321
- showCtas: false,
322
- position: { custom: { x: 78, y: 265 } },
323
- },
324
- },
325
- },
326
- Opera: {
327
- frameAsset: lightSvg,
328
- icon: operaIcon,
329
- notificationClassName: 'android-tablet-opera',
330
- states: {
331
- Collapsed: {
332
- supportsExpanded: false,
333
- showMedia: false,
334
- showCtas: false,
335
- position: { custom: { x: 78, y: 265 } },
336
- },
337
- Expanded: {
338
- supportsExpanded: true,
339
- showMedia: true,
340
- showCtas: false,
341
- position: { custom: { x: 78, y: 265 } },
342
- },
343
- },
344
- },
345
- },
346
- iOS: {
347
- Chrome: {
348
- frameAsset: iosSvg,
349
- icon: chromeIcon,
350
- notificationClassName: 'ios-chrome',
351
- states: {
352
- Collapsed: {
353
- supportsExpanded: false,
354
- showMedia: false,
355
- showCtas: false,
356
- position: { custom: { x: 28, y: 210 } },
357
- },
358
- },
359
- },
360
- Safari: {
361
- frameAsset: iosSvg,
362
- icon: safariIcon,
363
- notificationClassName: 'ios-safari',
364
- states: {
365
- Collapsed: {
366
- supportsExpanded: false,
367
- showMedia: false,
368
- showCtas: false,
369
- position: { custom: { x: 28, y: 210 } },
370
- },
371
- },
372
- },
373
- Firefox: {
374
- frameAsset: iosSvg,
375
- icon: firefoxIcon,
376
- notificationClassName: 'ios-firefox',
377
- states: {
378
- Collapsed: {
379
- supportsExpanded: false,
380
- showMedia: false,
381
- showCtas: false,
382
- position: { custom: { x: 28, y: 210 } },
383
- },
384
- },
385
- },
386
- Edge: {
387
- frameAsset: iosSvg,
388
- icon: edgeIcon,
389
- notificationClassName: 'ios-edge',
390
- states: {
391
- Collapsed: {
392
- supportsExpanded: false,
393
- showMedia: false,
394
- showCtas: false,
395
- position: { custom: { x: 28, y: 210 } },
396
- },
397
- },
398
- },
399
- Opera: {
400
- frameAsset: iosSvg,
401
- icon: operaIcon,
402
- notificationClassName: 'ios-opera',
403
- states: {
404
- Collapsed: {
405
- supportsExpanded: false,
406
- showMedia: false,
407
- showCtas: false,
408
- position: { custom: { x: 28, y: 210 } },
409
- },
410
- },
411
- },
412
- },
413
- iPadOS: {
414
- Chrome: {
415
- frameAsset: lightSvg,
416
- icon: chromeIcon,
417
- notificationClassName: 'ipados-chrome',
418
- states: {
419
- Collapsed: {
420
- supportsExpanded: false,
421
- showMedia: false,
422
- showCtas: false,
423
- position: { custom: { x: 78, y: 265 } },
424
- },
425
- },
426
- },
427
- Safari: {
428
- frameAsset: lightSvg,
429
- icon: safariIcon,
430
- notificationClassName: 'ipados-safari',
431
- states: {
432
- Collapsed: {
433
- supportsExpanded: false,
434
- showMedia: false,
435
- showCtas: false,
436
- position: { custom: { x: 78, y: 265 } },
437
- },
438
- },
439
- },
440
- Firefox: {
441
- frameAsset: lightSvg,
442
- icon: firefoxIcon,
443
- notificationClassName: 'ipados-firefox',
444
- states: {
445
- Collapsed: {
446
- supportsExpanded: false,
447
- showMedia: false,
448
- showCtas: false,
449
- position: { custom: { x: 78, y: 265 } },
450
- },
451
- },
452
- },
453
- Edge: {
454
- frameAsset: lightSvg,
455
- icon: edgeIcon,
456
- notificationClassName: 'ipados-edge',
457
- states: {
458
- Collapsed: {
459
- supportsExpanded: false,
460
- showMedia: false,
461
- showCtas: false,
462
- position: { custom: { x: 78, y: 265 } },
463
- },
464
- },
465
- },
466
- Opera: {
467
- frameAsset: lightSvg,
468
- icon: operaIcon,
469
- notificationClassName: 'ipados-opera',
470
- states: {
471
- Collapsed: {
472
- supportsExpanded: false,
473
- showMedia: false,
474
- showCtas: false,
475
- position: { custom: { x: 78, y: 265 } },
476
- },
477
- },
478
- },
479
- },
480
- // TODO: Add additional OS + browser variants here. Ensure positioning stays anchored to the device frame.
481
- };
482
-
483
- /**
484
- * Returns the browser options allowed for a given OS.
485
- * Safari is supported on macOS, iOS, and iPadOS.
486
- * All browsers are supported on macOS, iOS, and iPadOS: Chrome, Safari, Opera, Firefox, Edge.
487
- * Other OSes exclude Safari.
488
- */
489
- export const getBrowserOptionsForOS = (os) => {
490
- if (os === 'macOS' || os === 'iOS' || os === 'iPadOS') {
491
- return BROWSER_OPTIONS;
492
- }
493
- return BROWSER_OPTIONS.filter((option) => option.value !== 'Safari');
494
- };
495
-
496
- /**
497
- * Returns the supported states for an OS+Browser pair.
498
- */
499
- export const getSupportedStates = (os, browser) => {
500
- const states = PREVIEW_VARIANTS[os]?.[browser]?.states;
501
- return states ? Object.keys(states) : [];
502
- };
503
-
504
- /**
505
- * Given a desired state, returns the best-fit state that is supported.
506
- */
507
- export const coerceStateForVariant = (os, browser, desiredState) => {
508
- const supportedStates = getSupportedStates(os, browser);
509
- if (!supportedStates.length) return null;
510
- if (supportedStates.includes(desiredState)) return desiredState;
511
- return supportedStates[0];
512
- };
513
-
514
- /**
515
- * Fetches the resolved variant config for OS+Browser+State.
516
- * Returns { variant, stateKey, stateConfig } or null if unsupported.
517
- */
518
- export const getResolvedVariant = (os, browser, state) => {
519
- const variant = PREVIEW_VARIANTS[os]?.[browser];
520
- if (!variant) return null;
521
- const stateKey = coerceStateForVariant(os, browser, state);
522
- if (!stateKey) return null;
523
- const stateConfig = variant.states[stateKey];
524
- return { variant, stateKey, stateConfig };
525
- };
526
-
527
-
@@ -1,162 +0,0 @@
1
- /**
2
- * Preview Constants
3
- *
4
- * Centralized constants for preview dropdown options and device configurations.
5
- * This file ensures DRY (Don't Repeat Yourself) principles by providing
6
- * a single source of truth for all preview-related options.
7
- */
8
-
9
- /**
10
- * Operating System Options
11
- * Available OS/Device types for preview selection
12
- */
13
- export const OS_OPTIONS = [
14
- { value: 'macOS', label: 'macOS' },
15
- { value: 'iOS', label: 'iOS' },
16
- { value: 'iPadOS', label: 'iPadOS' },
17
- { value: 'Windows', label: 'Windows' },
18
- { value: 'Android (Mobile)', label: 'Android (Mobile)' },
19
- { value: 'Android (Tablet)', label: 'Android (Tablet)' },
20
- ];
21
-
22
- /**
23
- * Browser Options
24
- * Available browsers for preview selection
25
- */
26
- export const BROWSER_OPTIONS = [
27
- { value: 'Chrome', label: 'Chrome' },
28
- { value: 'Firefox', label: 'Firefox' },
29
- { value: 'Edge', label: 'Edge' },
30
- { value: 'Safari', label: 'Safari' },
31
- { value: 'Opera', label: 'Opera' },
32
- ];
33
-
34
- /**
35
- * Notification State Options
36
- * Available states for notification preview (Collapsed/Expanded)
37
- */
38
- export const STATE_OPTIONS = [
39
- { value: 'Collapsed', label: 'Collapsed' },
40
- { value: 'Expanded', label: 'Expanded' },
41
- ];
42
-
43
- /**
44
- * Notification State Values
45
- * Individual state constants for use in components
46
- */
47
- export const NOTIFICATION_STATE_COLLAPSED = 'Collapsed';
48
- export const NOTIFICATION_STATE_EXPANDED = 'Expanded';
49
-
50
- /**
51
- * Default Selection Values
52
- */
53
- export const DEFAULT_OS = 'macOS';
54
- export const DEFAULT_BROWSER = 'Chrome';
55
- export const DEFAULT_STATE = 'Collapsed';
56
-
57
- /**
58
- * Layout Mode Constants
59
- * Available layout modes for PreviewControls component
60
- */
61
- export const LAYOUT_MODE = {
62
- INLINE: 'inline',
63
- NEW_ROW: 'newRow',
64
- COMPACT: 'compact',
65
- };
66
-
67
- /**
68
- * Select Width Constants
69
- * Width values for dropdown selects based on layout mode
70
- */
71
- export const SELECT_WIDTH = {
72
- COMPACT: '11rem',
73
- FULL: '100%',
74
- };
75
-
76
-
77
- /**
78
- * Device Frame Dimensions (in pixels)
79
- *
80
- * These are the natural dimensions of the device frame SVG assets.
81
- * Used for calculating notification positions relative to device frames.
82
- *
83
- * Note: These dimensions are based on the actual rendered SVG sizes.
84
- * If SVG assets are updated, these values should be updated accordingly.
85
- */
86
- export const DEVICE_FRAME_DIMENSIONS = {
87
- // Top.svg - Used for macOS and Windows
88
- 'macOS': { width: 952, height: 647 },
89
- 'Windows': { width: 952, height: 647 },
90
- // iOS.svg - Used for iOS and Android (Mobile)
91
- 'iOS': { width: 380, height: 778 },
92
- 'Android (Mobile)': { width: 380, height: 778 },
93
- // Light.svg - Used for iPadOS and Android (Tablet)
94
- 'iPadOS': { width: 640, height: 888 },
95
- 'Android (Tablet)': { width: 640, height: 888 },
96
- };
97
-
98
- /**
99
- * Operating System Name Constants
100
- * Individual OS name values for use in components
101
- */
102
- export const OS_MACOS = 'macOS';
103
- export const OS_IOS = 'iOS';
104
- export const OS_IPADOS = 'iPadOS';
105
- export const OS_WINDOWS = 'Windows';
106
- export const OS_ANDROID_MOBILE = 'Android (Mobile)';
107
- export const OS_ANDROID_TABLET = 'Android (Tablet)';
108
-
109
- /**
110
- * Browser Name Constants
111
- * Individual browser name values for use in components
112
- */
113
- export const BROWSER_CHROME = 'Chrome';
114
- export const BROWSER_FIREFOX = 'Firefox';
115
- export const BROWSER_EDGE = 'Edge';
116
- export const BROWSER_SAFARI = 'Safari';
117
- export const BROWSER_OPERA = 'Opera';
118
-
119
- /**
120
- * Browser Name Constants (lowercase)
121
- * Lowercase browser names used in class names and comparisons
122
- */
123
- export const BROWSER_CHROME_LOWER = 'chrome';
124
- export const BROWSER_FIREFOX_LOWER = 'firefox';
125
- export const BROWSER_EDGE_LOWER = 'edge';
126
- export const BROWSER_SAFARI_LOWER = 'safari';
127
- export const BROWSER_OPERA_LOWER = 'opera';
128
-
129
- /**
130
- * Browsers that Support Brand Icon
131
- * List of browsers that support brand icon display
132
- */
133
- export const BRAND_ICON_SUPPORTED_BROWSERS = [
134
- BROWSER_CHROME_LOWER,
135
- BROWSER_EDGE_LOWER,
136
- BROWSER_OPERA_LOWER,
137
- BROWSER_FIREFOX_LOWER,
138
- ];
139
-
140
- /**
141
- * Browser Display Name Mapping
142
- * Maps browser names to their full display names for UI
143
- */
144
- export const BROWSER_DISPLAY_NAMES = {
145
- [BROWSER_CHROME]: 'Google Chrome',
146
- [BROWSER_FIREFOX]: 'Mozilla Firefox',
147
- [BROWSER_EDGE]: 'Microsoft Edge',
148
- [BROWSER_OPERA]: 'Opera',
149
- };
150
-
151
-
152
- /**
153
- * Dummy CTA Button Data
154
- * Placeholder data for CTA buttons in expanded notification preview
155
- * TODO: Replace with actual CTA buttons from form/props
156
- */
157
- export const DUMMY_CTA_BUTTONS = [
158
- { id: '1', label: 'Features', icon: '⚡' },
159
- { id: '2', label: 'Signup for Free', icon: '📋' },
160
- ];
161
-
162
-