@capillarytech/creatives-library 9.0.28 → 9.0.29-alpha.2
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/constants/unified.js +29 -0
- package/global-styles.js +1 -1
- package/package.json +1 -1
- package/services/tests/api.test.js +35 -20
- package/utils/commonUtils.js +22 -1
- package/utils/rcsPayloadUtils.js +99 -0
- package/utils/templateVarUtils.js +198 -0
- package/utils/tests/rcsPayloadUtils.test.js +243 -0
- package/utils/tests/templateVarUtils.test.js +204 -0
- package/v2Components/CapActionButton/constants.js +20 -1
- package/v2Components/CapActionButton/index.js +193 -144
- package/v2Components/CapActionButton/index.scss +232 -14
- package/v2Components/CapActionButton/messages.js +19 -3
- package/v2Components/CapActionButton/tests/index.test.js +42 -18
- package/v2Components/CapImageUpload/index.js +2 -2
- package/v2Components/CapTagList/index.js +9 -0
- package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +70 -48
- package/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +8 -2
- package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +214 -21
- package/v2Components/CommonTestAndPreview/DeliverySettings/constants.js +16 -0
- package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +83 -9
- package/v2Components/CommonTestAndPreview/DeliverySettings/messages.js +30 -0
- package/v2Components/CommonTestAndPreview/DeliverySettings/utils/parseSenderDetailsResponse.js +58 -11
- package/v2Components/CommonTestAndPreview/SendTestMessage.js +10 -5
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +186 -22
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +381 -80
- package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +155 -8
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +11 -0
- package/v2Components/CommonTestAndPreview/constants.js +35 -2
- package/v2Components/CommonTestAndPreview/index.js +770 -231
- package/v2Components/CommonTestAndPreview/messages.js +45 -3
- package/v2Components/CommonTestAndPreview/previewApiUtils.js +59 -0
- package/v2Components/CommonTestAndPreview/sagas.js +25 -6
- package/v2Components/CommonTestAndPreview/tests/CommonTestAndPreview.addTestCustomer.test.js +1 -0
- package/v2Components/CommonTestAndPreview/tests/CustomValuesEditor.test.js +412 -257
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/ModifyDeliverySettings.test.js +337 -63
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/index.test.js +118 -5
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/utils/parseSenderDetailsResponse.test.js +341 -0
- package/v2Components/CommonTestAndPreview/tests/PreviewSection.test.js +8 -1
- package/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +108 -15
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/RcsPreviewContent.test.js +281 -283
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +199 -1
- package/v2Components/CommonTestAndPreview/tests/index.test.js +133 -4
- package/v2Components/CommonTestAndPreview/tests/previewApiUtils.test.js +67 -0
- package/v2Components/CommonTestAndPreview/tests/sagas.test.js +31 -24
- package/v2Components/CommonTestAndPreview/tests/utils.test.js +151 -0
- package/v2Components/CommonTestAndPreview/utils.js +84 -0
- package/v2Components/SmsFallback/SmsFallbackLocalSelector.js +91 -0
- package/v2Components/SmsFallback/constants.js +94 -0
- package/v2Components/SmsFallback/index.js +958 -0
- package/v2Components/SmsFallback/index.scss +266 -0
- package/v2Components/SmsFallback/messages.js +78 -0
- package/v2Components/SmsFallback/smsFallbackUtils.js +120 -0
- package/v2Components/SmsFallback/tests/SmsFallbackLocalSelector.test.js +50 -0
- package/v2Components/SmsFallback/tests/rcsSmsFallback.acceptance.test.js +147 -0
- package/v2Components/SmsFallback/tests/smsFallbackHandlers.test.js +304 -0
- package/v2Components/SmsFallback/tests/smsFallbackUi.test.js +208 -0
- package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +309 -0
- package/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +471 -0
- package/v2Components/SmsFallback/useLocalTemplateList.js +92 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +45 -25
- package/v2Components/TemplatePreview/constants.js +2 -0
- package/v2Components/TemplatePreview/index.js +147 -32
- package/v2Components/TemplatePreview/tests/index.test.js +142 -0
- package/v2Components/TestAndPreviewSlidebox/CustomValuesEditor.js +6 -6
- package/v2Components/TestAndPreviewSlidebox/index.js +13 -1
- package/v2Components/TestAndPreviewSlidebox/sagas.js +11 -4
- package/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +3 -1
- package/v2Components/VarSegmentMessageEditor/constants.js +2 -0
- package/v2Components/VarSegmentMessageEditor/index.js +125 -0
- package/v2Components/VarSegmentMessageEditor/index.scss +46 -0
- package/v2Containers/CommunicationFlow/Tests/CommunicationFlow.test.js +4 -1
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/DeliverySettingsSection.test.js +4 -0
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/SenderDetails.test.js +20 -20
- package/v2Containers/CreativesContainer/CreativesSlideBoxWrapper.js +27 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +37 -4
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +14 -5
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +36 -5
- package/v2Containers/CreativesContainer/constants.js +11 -0
- package/v2Containers/CreativesContainer/embeddedSlideboxUtils.js +77 -0
- package/v2Containers/CreativesContainer/index.js +328 -106
- package/v2Containers/CreativesContainer/index.scss +102 -1
- package/v2Containers/CreativesContainer/tests/CreativesSlideBoxWrapper.test.js +58 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.localTemplates.test.js +90 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.smsDltPreview.test.js +73 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +37 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +103 -34
- package/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +193 -15
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +88 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +549 -57
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +20 -15
- package/v2Containers/CreativesContainer/tests/embeddedSlideboxUtils.test.js +258 -0
- package/v2Containers/CreativesContainer/tests/index.test.js +71 -9
- package/v2Containers/CreativesContainer/tests/useLocalTemplatesProp.test.js +125 -0
- package/v2Containers/Email/index.js +3 -63
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +4 -9
- package/v2Containers/MobilePush/Create/test/saga.test.js +2 -2
- package/v2Containers/Rcs/carouselUtils.js +256 -0
- package/v2Containers/Rcs/components/CarouselCard.js +315 -0
- package/v2Containers/Rcs/components/CarouselCardButtons.js +93 -0
- package/v2Containers/Rcs/components/CarouselCardMedia.js +136 -0
- package/v2Containers/Rcs/components/CarouselCharacterCount.js +31 -0
- package/v2Containers/Rcs/components/CarouselDimensionSelection.js +80 -0
- package/v2Containers/Rcs/constants.js +137 -16
- package/v2Containers/Rcs/index.js +1912 -958
- package/v2Containers/Rcs/index.scss +443 -8
- package/v2Containers/Rcs/messages.js +45 -22
- package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +522 -0
- package/v2Containers/Rcs/tests/CarouselCard.test.js +465 -0
- package/v2Containers/Rcs/tests/CarouselCardButtons.test.js +211 -0
- package/v2Containers/Rcs/tests/CarouselCardMedia.test.js +160 -0
- package/v2Containers/Rcs/tests/CarouselCharacterCount.test.js +50 -0
- package/v2Containers/Rcs/tests/CarouselDimensionSelection.test.js +119 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +74176 -39409
- package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap +10 -74
- package/v2Containers/Rcs/tests/carouselUtils.test.js +916 -0
- package/v2Containers/Rcs/tests/index.test.js +400 -40
- package/v2Containers/Rcs/tests/mockData.js +38 -0
- package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +873 -0
- package/v2Containers/Rcs/tests/utils.test.js +762 -30
- package/v2Containers/Rcs/utils.js +571 -12
- package/v2Containers/Sms/Create/index.js +115 -48
- package/v2Containers/Sms/smsFormDataHelpers.js +67 -0
- package/v2Containers/Sms/tests/smsFormDataHelpers.test.js +253 -0
- package/v2Containers/SmsTrai/Create/index.js +9 -4
- package/v2Containers/SmsTrai/Edit/constants.js +2 -0
- package/v2Containers/SmsTrai/Edit/index.js +678 -169
- package/v2Containers/SmsTrai/Edit/index.scss +126 -0
- package/v2Containers/SmsTrai/Edit/messages.js +14 -4
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +5615 -3014
- package/v2Containers/SmsWrapper/index.js +37 -8
- package/v2Containers/TagList/index.js +5 -0
- package/v2Containers/Templates/TemplatesActionBar.js +101 -0
- package/v2Containers/Templates/_templates.scss +196 -12
- package/v2Containers/Templates/actions.js +11 -0
- package/v2Containers/Templates/constants.js +2 -0
- package/v2Containers/Templates/index.js +131 -59
- package/v2Containers/Templates/sagas.js +57 -13
- package/v2Containers/Templates/tests/TemplatesActionBar.test.js +129 -0
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1060 -1015
- package/v2Containers/Templates/tests/sagas.test.js +199 -16
- package/v2Containers/Templates/tests/smsTemplatesListApi.test.js +180 -0
- package/v2Containers/Templates/utils/smsTemplatesListApi.js +79 -0
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +72 -1
- package/v2Containers/TemplatesV2/index.js +88 -25
- package/v2Containers/TemplatesV2/tests/TemplatesV2.localTemplates.test.js +131 -0
- package/v2Containers/WeChat/MapTemplates/test/saga.test.js +9 -9
- package/v2Containers/Whatsapp/index.js +3 -20
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +578 -34
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
3
4
|
import messages from "./messages";
|
|
4
5
|
|
|
5
6
|
export const RCS = 'RCS';
|
|
@@ -20,11 +21,6 @@ export const TEMPLATE_HEADER_MAX_LENGTH = 60;
|
|
|
20
21
|
export const TEMPLATE_MESSAGE_MAX_LENGTH = 1024;
|
|
21
22
|
export const UNSUBSCRIBE_TEXT_LENGTH = 36;
|
|
22
23
|
|
|
23
|
-
export const RCS_DLT_MODE = {
|
|
24
|
-
TEMPLATES: 'templates',
|
|
25
|
-
EDIT: 'editTemplate',
|
|
26
|
-
};
|
|
27
|
-
|
|
28
24
|
export const RCS_STATUSES = {
|
|
29
25
|
approved: 'approved',
|
|
30
26
|
rejected: 'rejected',
|
|
@@ -34,18 +30,16 @@ export const RCS_STATUSES = {
|
|
|
34
30
|
awaitingApproval: 'awaitingApproval',
|
|
35
31
|
};
|
|
36
32
|
|
|
33
|
+
export const HOST_ICS="rcsicsbulk";
|
|
34
|
+
export const HOST_INFOBIP="rcsinfobipbulk";
|
|
35
|
+
|
|
37
36
|
export const contentType = {
|
|
38
37
|
text_message: 'text_message',
|
|
39
38
|
rich_card: 'rich_card',
|
|
40
|
-
carousel: '
|
|
39
|
+
carousel: 'CAROUSEL',
|
|
41
40
|
};
|
|
42
41
|
|
|
43
42
|
export const STATUS_OPTIONS = [
|
|
44
|
-
// {
|
|
45
|
-
// key: 'created',
|
|
46
|
-
// value: RCS_STATUSES.awaitingApproval,
|
|
47
|
-
// label: <FormattedMessage {...messages.created} />,
|
|
48
|
-
// },
|
|
49
43
|
{
|
|
50
44
|
key: 'approved',
|
|
51
45
|
value: RCS_STATUSES.approved,
|
|
@@ -72,12 +66,45 @@ export const RCS_MEDIA_TYPES = {
|
|
|
72
66
|
NONE: 'NONE',
|
|
73
67
|
IMAGE: 'IMAGE',
|
|
74
68
|
VIDEO: 'VIDEO',
|
|
69
|
+
TEXT: 'TEXT',
|
|
75
70
|
};
|
|
76
71
|
|
|
77
|
-
|
|
78
|
-
export const
|
|
72
|
+
/** Match `{{…}}` placeholders including Liquid-style names (e.g. `tag.FORMAT_1`). Must align with split + `isAnyTemplateVarToken` / SMS fallback. */
|
|
73
|
+
export const rcsVarRegex = /\{\{[^}]+\}\}/g;
|
|
74
|
+
/** True when the whole string is a single RCS/mustache token (used when testing segment tokens). */
|
|
75
|
+
export const rcsVarTestRegex = /^\{\{[^}]+\}\}$/;
|
|
76
|
+
|
|
77
|
+
/** Matches all `{{N}}` numeric-index variable tokens in a template string (global). */
|
|
78
|
+
export const RCS_NUMERIC_VAR_TOKEN_REGEX = /\{\{(\d+)\}\}/g;
|
|
79
|
+
/** `cardVarMapped` slot keys that are numeric only (legacy ordering). */
|
|
80
|
+
export const RCS_NUMERIC_VAR_NAME_REGEX = /^\d+$/;
|
|
81
|
+
/**
|
|
82
|
+
* Semantic Liquid-style keys on RCS `cardVarMapped` (same class as `{{…}}` inner names in the
|
|
83
|
+
* editor). Carousel slots are now keyed by global position (see `computeCarouselVarSlotKeys`), a
|
|
84
|
+
* plain number, so this only needs to match bare semantic names — the optional `cN::` prefix is
|
|
85
|
+
* kept solely so `pickRcsCardVarMappedEntries` doesn't drop legacy scoped keys from older payloads.
|
|
86
|
+
*/
|
|
87
|
+
export const RCS_CARD_VAR_MAPPED_SEMANTIC_KEY_REGEX = /^(?:c\d+::)?[\w.()]+$/;
|
|
88
|
+
/** Escape all special RegExp characters in an arbitrary string before using it in `new RegExp(...)`. */
|
|
89
|
+
export const REGEX_SPECIAL_CHARS_ESCAPE_PATTERN = /[-/\\^$*+?.()|[\]{}]/g;
|
|
90
|
+
/** Entire string is wrapped in `{{…}}` mustache delimiters (allows any content including `}`). */
|
|
91
|
+
export const RCS_MUSTACHE_WRAPPED_REGEX = /^\{\{[\s\S]*\}\}$/;
|
|
92
|
+
/** Strip leading `{{` and trailing `}}` from a token. */
|
|
93
|
+
export const RCS_STRIP_MUSTACHE_DELIMITERS_REGEX = /^\{\{|\}\}$/g;
|
|
94
|
+
|
|
95
|
+
export const JS_TYPES = {
|
|
96
|
+
STRING: 'string',
|
|
97
|
+
NUMBER: 'number',
|
|
98
|
+
OBJECT: 'object',
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** Tag-popover target: title vs description field (matches `onTagSelect` `field` argument). */
|
|
102
|
+
export const RCS_TAG_AREA_FIELD_TITLE = 'title';
|
|
103
|
+
export const RCS_TAG_AREA_FIELD_DESC = 'desc';
|
|
104
|
+
|
|
79
105
|
export const TEMPLATE_DESC_MAX_LENGTH = 2500;
|
|
80
|
-
|
|
106
|
+
/** Resolved SMS fallback body cap. Must allow multi-segment DLT (>160); aligns with TRAI / `TEMPLATE_MESSAGE_MAX_LENGTH`. */
|
|
107
|
+
export const FALLBACK_MESSAGE_MAX_LENGTH = TEMPLATE_MESSAGE_MAX_LENGTH;
|
|
81
108
|
export const TEMPLATE_TITLE_MAX_LENGTH = 200;
|
|
82
109
|
export const TEMPLATE_BUTTON_TEXT_MAX_LENGTH = 25;
|
|
83
110
|
export const CTA = 'CTA';
|
|
@@ -92,10 +119,12 @@ export const ALLOWED_IMAGE_EXTENSIONS_REGEX = (/\.(png|jpg|jpeg|gif)$/i);
|
|
|
92
119
|
export const RCS_IMG_WIDTH = 1440;
|
|
93
120
|
export const RCS_IMG_HEIGHT = 1024;
|
|
94
121
|
export const RCS_IMG_SIZE = 2000000; // 2MB
|
|
122
|
+
export const RCS_CAROUSEL_IMG_SIZE = 1 * 1024 * 1024; // 1MB
|
|
95
123
|
export const MAX_FILE_SIZE_MB = 10;
|
|
96
124
|
export const MAX_FILE_SIZE_BYTES = MAX_FILE_SIZE_MB * 1024 * 1024;
|
|
97
125
|
export const ALLOWED_EXTENSIONS_VIDEO_REGEX = (/\.(mp4)$/i);
|
|
98
126
|
export const RCS_VIDEO_SIZE = 10 * 1024 * 1024;
|
|
127
|
+
export const RCS_CAROUSEL_VIDEO_SIZE = 5 * 1024 * 1024; // 5MB
|
|
99
128
|
export const RCS_THUMBNAIL_MIN_SIZE = 40 * 1024;
|
|
100
129
|
export const RCS_THUMBNAIL_MAX_SIZE = 100 * 1024;
|
|
101
130
|
|
|
@@ -142,13 +171,38 @@ export const RCS_IMAGE_DIMENSIONS = {
|
|
|
142
171
|
},
|
|
143
172
|
};
|
|
144
173
|
|
|
174
|
+
// Carousel image dimensions (pixel values shown in UI). Keys follow `${HEIGHT}_${WIDTH}`.
|
|
175
|
+
// HEIGHT: SHORT|MEDIUM, WIDTH: SMALL|MEDIUM
|
|
176
|
+
export const RCS_CAROUSEL_IMAGE_DIMENSIONS = {
|
|
177
|
+
SHORT_SMALL: {
|
|
178
|
+
width: 1160,
|
|
179
|
+
height: 720,
|
|
180
|
+
description: 'Image (1160 x 720)',
|
|
181
|
+
},
|
|
182
|
+
SHORT_MEDIUM: {
|
|
183
|
+
width: 1800,
|
|
184
|
+
height: 720,
|
|
185
|
+
description: 'Image (1800 x 720)',
|
|
186
|
+
},
|
|
187
|
+
MEDIUM_SMALL: {
|
|
188
|
+
width: 770,
|
|
189
|
+
height: 720,
|
|
190
|
+
description: 'Image (770 x 720)',
|
|
191
|
+
},
|
|
192
|
+
MEDIUM_MEDIUM: {
|
|
193
|
+
width: 1280,
|
|
194
|
+
height: 720,
|
|
195
|
+
description: 'Image (1280 x 720)',
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
|
|
145
199
|
export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
146
200
|
SHORT_HEIGHT: {
|
|
147
|
-
width: 770,
|
|
148
|
-
height: 257,
|
|
149
201
|
type: 'SHORT_HEIGHT',
|
|
150
202
|
heightType: 'SHORT',
|
|
151
203
|
label: 'Vertical Short',
|
|
204
|
+
width: 1140,
|
|
205
|
+
height: 448,
|
|
152
206
|
description: 'Thumbnail (770 x 257)',
|
|
153
207
|
orientation: 'VERTICAL',
|
|
154
208
|
maxFileSize: 100 * 1024,
|
|
@@ -189,6 +243,29 @@ export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
|
189
243
|
},
|
|
190
244
|
};
|
|
191
245
|
|
|
246
|
+
// Carousel thumbnail dimensions for video cards (pixel values shown in UI).
|
|
247
|
+
// Keys follow `${HEIGHT}_${WIDTH}`.
|
|
248
|
+
// Human-readable labels: formatMessage(messages.rcsCarouselVideoThumbnailLabel, { width, height })
|
|
249
|
+
// or formatRcsCarouselVideoThumbnailLabel(formatMessage, entry) from ./utils.
|
|
250
|
+
export const RCS_CAROUSEL_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
251
|
+
SHORT_SMALL: {
|
|
252
|
+
width: 718,
|
|
253
|
+
height: 448,
|
|
254
|
+
},
|
|
255
|
+
SHORT_MEDIUM: {
|
|
256
|
+
width: 1140,
|
|
257
|
+
height: 448,
|
|
258
|
+
},
|
|
259
|
+
MEDIUM_SMALL: {
|
|
260
|
+
width: 480,
|
|
261
|
+
height: 448,
|
|
262
|
+
},
|
|
263
|
+
MEDIUM_MEDIUM: {
|
|
264
|
+
width: 796,
|
|
265
|
+
height: 448,
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
|
|
192
269
|
const prefix = 'app/v2Containers/Rcs';
|
|
193
270
|
export const UPLOAD_RCS_ASSET_REQUEST = `${prefix}/UPLOAD_RCS_ASSET_REQUEST`;
|
|
194
271
|
export const UPLOAD_RCS_ASSET_SUCCESS = `${prefix}/UPLOAD_RCS_ASSET_SUCCESS`;
|
|
@@ -215,6 +292,7 @@ export const CLEAR_EDIT_RESPONSE_REQUEST = `${prefix}/Edit/CLEAR_EDIT_RESPONSE_R
|
|
|
215
292
|
export const AI_CONTENT_BOT_DISABLED = "AI_CONTENT_BOT_DISABLED";
|
|
216
293
|
|
|
217
294
|
export const RCS_TEXT_MESSAGE_MAX_LENGTH = 160;
|
|
295
|
+
export const RCS_TEXT_MESSAGE_MAX_LENGTH_INFOBIP = 3072;
|
|
218
296
|
export const RCS_RICH_CARD_MAX_LENGTH = 2000;
|
|
219
297
|
export const MAX_BUTTONS = 4;
|
|
220
298
|
|
|
@@ -250,3 +328,46 @@ export const RCS_BUTTON_TYPES = {
|
|
|
250
328
|
PHONE_NUMBER: 'PHONE_NUMBER',
|
|
251
329
|
CTA: 'CTA',
|
|
252
330
|
};
|
|
331
|
+
|
|
332
|
+
/** Default action row for carousel card 1 (mandatory button UX): phone CTA, unsaved until user completes + Save. */
|
|
333
|
+
export const RCS_CAROUSEL_FIRST_CARD_DEFAULT_SUGGESTIONS = [
|
|
334
|
+
{
|
|
335
|
+
index: 0,
|
|
336
|
+
type: RCS_BUTTON_TYPES.PHONE_NUMBER,
|
|
337
|
+
text: '',
|
|
338
|
+
phoneNumber: '',
|
|
339
|
+
url: null,
|
|
340
|
+
postback: '',
|
|
341
|
+
isSaved: false,
|
|
342
|
+
},
|
|
343
|
+
];
|
|
344
|
+
|
|
345
|
+
export const MAX_RCS_CAROUSEL_ALLOWED = 10;
|
|
346
|
+
// Uploads for RCS are stored in redux under dynamic keys `uploadedAssetData${index}`.
|
|
347
|
+
// Carousel needs per-card indices; otherwise all cards "restore" the last uploaded asset
|
|
348
|
+
// and show the same media/thumbnail.
|
|
349
|
+
export const RCS_CAROUSEL_ASSET_INDEX_BASE = 10; // keep away from standalone indices 0 (media) and 1 (thumbnail)
|
|
350
|
+
|
|
351
|
+
export const RCS_CAROUSEL_INITIAL_CARD = {
|
|
352
|
+
title: '',
|
|
353
|
+
description: '',
|
|
354
|
+
mediaType: RCS_MEDIA_TYPES.IMAGE, // per-card
|
|
355
|
+
imageSrc: '',
|
|
356
|
+
videoAsset: {}, // CapVideoUpload object shape
|
|
357
|
+
thumbnailSrc: '',
|
|
358
|
+
suggestions: [],
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
export const RCS_CAROUSEL_INITIAL_FIRST_CARD = {
|
|
362
|
+
...RCS_CAROUSEL_INITIAL_CARD,
|
|
363
|
+
suggestions: cloneDeep(RCS_CAROUSEL_FIRST_CARD_DEFAULT_SUGGESTIONS),
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
export const CAROUSEL_HEIGHT_OPTIONS = [
|
|
367
|
+
{ value: 'SHORT', label: 'Short' },
|
|
368
|
+
{ value: 'MEDIUM', label: 'Medium' },
|
|
369
|
+
];
|
|
370
|
+
export const CAROUSEL_WIDTH_OPTIONS = [
|
|
371
|
+
{ value: 'SMALL', label: 'Small' },
|
|
372
|
+
{ value: 'MEDIUM', label: 'Medium' },
|
|
373
|
+
];
|