@capillarytech/creatives-library 8.0.345-alpha.16 → 8.0.345-alpha.17
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/package.json +1 -1
- package/services/tests/api.test.js +13 -0
- package/utils/commonUtils.js +19 -1
- package/utils/rcsPayloadUtils.js +92 -0
- package/utils/templateVarUtils.js +201 -0
- package/utils/tests/rcsPayloadUtils.test.js +226 -0
- package/utils/tests/templateVarUtils.test.js +204 -0
- package/v2Components/CapActionButton/constants.js +7 -0
- package/v2Components/CapActionButton/index.js +167 -109
- package/v2Components/CapActionButton/index.scss +157 -6
- package/v2Components/CapActionButton/messages.js +19 -3
- package/v2Components/CapActionButton/tests/index.test.js +41 -17
- package/v2Components/CapTagList/index.js +10 -0
- package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +70 -49
- package/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +8 -2
- package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +207 -21
- package/v2Components/CommonTestAndPreview/DeliverySettings/constants.js +16 -0
- package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +85 -10
- package/v2Components/CommonTestAndPreview/DeliverySettings/messages.js +30 -0
- package/v2Components/CommonTestAndPreview/DeliverySettings/utils/parseSenderDetailsResponse.js +79 -11
- package/v2Components/CommonTestAndPreview/SendTestMessage.js +10 -5
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +160 -15
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +341 -76
- package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +133 -4
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +11 -0
- package/v2Components/CommonTestAndPreview/constants.js +38 -2
- package/v2Components/CommonTestAndPreview/index.js +676 -186
- package/v2Components/CommonTestAndPreview/messages.js +45 -3
- package/v2Components/CommonTestAndPreview/previewApiUtils.js +59 -0
- package/v2Components/CommonTestAndPreview/sagas.js +15 -6
- package/v2Components/CommonTestAndPreview/tests/CustomValuesEditor.test.js +308 -284
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/ModifyDeliverySettings.test.js +231 -65
- 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 +34 -13
- 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 +132 -4
- package/v2Components/CommonTestAndPreview/tests/previewApiUtils.test.js +67 -0
- package/v2Components/CommonTestAndPreview/tests/sagas.test.js +2 -2
- package/v2Components/FormBuilder/index.js +8 -10
- package/v2Components/SmsFallback/SmsFallbackLocalSelector.js +87 -0
- package/v2Components/SmsFallback/constants.js +73 -0
- package/v2Components/SmsFallback/index.js +955 -0
- package/v2Components/SmsFallback/index.scss +265 -0
- package/v2Components/SmsFallback/messages.js +78 -0
- package/v2Components/SmsFallback/smsFallbackUtils.js +118 -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 +197 -0
- package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +277 -0
- package/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +422 -0
- package/v2Components/SmsFallback/useLocalTemplateList.js +92 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +33 -23
- package/v2Components/TemplatePreview/constants.js +2 -0
- package/v2Components/TemplatePreview/index.js +143 -28
- package/v2Components/TemplatePreview/tests/index.test.js +142 -0
- 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/CreativesContainer/CreativesSlideBoxWrapper.js +43 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +36 -4
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +10 -1
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +29 -4
- package/v2Containers/CreativesContainer/constants.js +9 -0
- package/v2Containers/CreativesContainer/embeddedSlideboxUtils.js +67 -0
- package/v2Containers/CreativesContainer/index.js +294 -96
- package/v2Containers/CreativesContainer/index.scss +51 -1
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.localTemplates.test.js +90 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +78 -34
- package/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +79 -16
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +8 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +357 -98
- 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/reducer.js +3 -12
- package/v2Containers/Email/sagas.js +4 -9
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -4
- package/v2Containers/Email/tests/reducer.test.js +0 -47
- package/v2Containers/Email/tests/sagas.test.js +6 -146
- package/v2Containers/Rcs/constants.js +119 -10
- package/v2Containers/Rcs/index.js +2456 -815
- package/v2Containers/Rcs/index.scss +276 -6
- package/v2Containers/Rcs/messages.js +34 -3
- package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +225 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +98018 -70073
- package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap +0 -5
- package/v2Containers/Rcs/tests/index.test.js +152 -121
- package/v2Containers/Rcs/tests/mockData.js +38 -0
- package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +318 -0
- package/v2Containers/Rcs/tests/utils.test.js +646 -30
- package/v2Containers/Rcs/utils.js +478 -11
- package/v2Containers/Sms/Create/index.js +100 -40
- 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 +636 -130
- package/v2Containers/SmsTrai/Edit/index.scss +121 -0
- package/v2Containers/SmsTrai/Edit/messages.js +14 -4
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4328 -2375
- package/v2Containers/SmsWrapper/index.js +37 -8
- package/v2Containers/TagList/index.js +6 -0
- package/v2Containers/Templates/TemplatesActionBar.js +101 -0
- package/v2Containers/Templates/_templates.scss +163 -2
- package/v2Containers/Templates/actions.js +11 -0
- package/v2Containers/Templates/constants.js +2 -0
- package/v2Containers/Templates/index.js +119 -54
- package/v2Containers/Templates/sagas.js +57 -12
- package/v2Containers/Templates/tests/TemplatesActionBar.test.js +120 -0
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1043 -1079
- package/v2Containers/Templates/tests/sagas.test.js +193 -123
- 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 +86 -23
- package/v2Containers/TemplatesV2/tests/TemplatesV2.localTemplates.test.js +131 -0
- package/v2Containers/Whatsapp/index.js +3 -20
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +578 -34
|
@@ -3,7 +3,6 @@ import { expectSaga } from 'redux-saga-test-plan';
|
|
|
3
3
|
import { takeLatest } from 'redux-saga/effects';
|
|
4
4
|
import * as matchers from 'redux-saga-test-plan/matchers';
|
|
5
5
|
import { throwError } from 'redux-saga-test-plan/providers';
|
|
6
|
-
import { fromJS } from 'immutable';
|
|
7
6
|
import * as types from '../constants';
|
|
8
7
|
import * as sagas from '../sagas';
|
|
9
8
|
import { v2EmailDuplicateTemplateSaga, v2EmailSagas } from '../sagas';
|
|
@@ -710,14 +709,10 @@ describe('getCmsSetting saga', () => {
|
|
|
710
709
|
|
|
711
710
|
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
712
711
|
.provide([
|
|
713
|
-
{
|
|
714
|
-
select(effect, next) {
|
|
715
|
-
return fromJS({ cmsAccountsLoaded: true, isBeeEnabled: true });
|
|
716
|
-
},
|
|
717
|
-
},
|
|
718
712
|
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
719
713
|
])
|
|
720
|
-
.put({ type: types.
|
|
714
|
+
.put({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled: true })
|
|
715
|
+
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: fakeResponse.data.response.cmsDetails })
|
|
721
716
|
.run();
|
|
722
717
|
});
|
|
723
718
|
|
|
@@ -732,14 +727,10 @@ describe('getCmsSetting saga', () => {
|
|
|
732
727
|
|
|
733
728
|
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
734
729
|
.provide([
|
|
735
|
-
{
|
|
736
|
-
select(effect, next) {
|
|
737
|
-
return fromJS({ cmsAccountsLoaded: true, isBeeEnabled: false });
|
|
738
|
-
},
|
|
739
|
-
},
|
|
740
730
|
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
741
731
|
])
|
|
742
|
-
.put({ type: types.
|
|
732
|
+
.put({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled: false })
|
|
733
|
+
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: fakeResponse.data.response.cmsDetails })
|
|
743
734
|
.run();
|
|
744
735
|
});
|
|
745
736
|
|
|
@@ -752,14 +743,10 @@ describe('getCmsSetting saga', () => {
|
|
|
752
743
|
|
|
753
744
|
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
754
745
|
.provide([
|
|
755
|
-
{
|
|
756
|
-
select(effect, next) {
|
|
757
|
-
return fromJS({ cmsAccountsLoaded: true, isBeeEnabled: false });
|
|
758
|
-
},
|
|
759
|
-
},
|
|
760
746
|
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
761
747
|
])
|
|
762
|
-
.put({ type: types.
|
|
748
|
+
.put({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled: false })
|
|
749
|
+
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: undefined })
|
|
763
750
|
.run();
|
|
764
751
|
});
|
|
765
752
|
|
|
@@ -768,138 +755,11 @@ describe('getCmsSetting saga', () => {
|
|
|
768
755
|
|
|
769
756
|
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
770
757
|
.provide([
|
|
771
|
-
{
|
|
772
|
-
select(effect, next) {
|
|
773
|
-
return fromJS({ cmsAccountsLoaded: true, isBeeEnabled: true });
|
|
774
|
-
},
|
|
775
|
-
},
|
|
776
758
|
[matchers.call.fn(Api.getCmsTemplateSettingsV2), throwError(fakeError)],
|
|
777
759
|
])
|
|
778
760
|
.put({ type: types.GET_CMS_EDITOR_DETAILS_FAILURE, error: fakeError })
|
|
779
761
|
.run();
|
|
780
762
|
});
|
|
781
|
-
|
|
782
|
-
it('should wait for accounts when fetchingCmsAccounts is true and cmsAccountsLoaded is false (accounts succeed)', () => {
|
|
783
|
-
const fakeResponse = {
|
|
784
|
-
data: { response: { cmsDetails: { type: 'bee', settings: {} } } },
|
|
785
|
-
};
|
|
786
|
-
let selectCallCount = 0;
|
|
787
|
-
|
|
788
|
-
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
789
|
-
.provide([
|
|
790
|
-
{
|
|
791
|
-
select(effect, next) {
|
|
792
|
-
selectCallCount += 1;
|
|
793
|
-
if (selectCallCount === 1) {
|
|
794
|
-
return fromJS({ cmsAccountsLoaded: false, fetchingCmsAccounts: true, isBeeEnabled: null });
|
|
795
|
-
}
|
|
796
|
-
return fromJS({ cmsAccountsLoaded: true, fetchingCmsAccounts: false, isBeeEnabled: true });
|
|
797
|
-
},
|
|
798
|
-
},
|
|
799
|
-
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
800
|
-
])
|
|
801
|
-
.dispatch({ type: types.GET_CMS_ACCOUNTS_SUCCESS, isBeeEnabled: true })
|
|
802
|
-
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: { type: 'bee', settings: {} }, isBeeEnabled: true })
|
|
803
|
-
.run();
|
|
804
|
-
});
|
|
805
|
-
|
|
806
|
-
it('should wait for accounts when fetchingCmsAccounts is true and cmsAccountsLoaded is false (accounts fail)', () => {
|
|
807
|
-
const fakeResponse = {
|
|
808
|
-
data: { response: { cmsDetails: { type: 'ck', settings: {} } } },
|
|
809
|
-
};
|
|
810
|
-
let selectCallCount = 0;
|
|
811
|
-
|
|
812
|
-
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
813
|
-
.provide([
|
|
814
|
-
{
|
|
815
|
-
select(effect, next) {
|
|
816
|
-
selectCallCount += 1;
|
|
817
|
-
if (selectCallCount === 1) {
|
|
818
|
-
return fromJS({ cmsAccountsLoaded: false, fetchingCmsAccounts: true, isBeeEnabled: null });
|
|
819
|
-
}
|
|
820
|
-
return fromJS({ cmsAccountsLoaded: true, fetchingCmsAccounts: false, isBeeEnabled: false });
|
|
821
|
-
},
|
|
822
|
-
},
|
|
823
|
-
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
824
|
-
])
|
|
825
|
-
.dispatch({ type: types.GET_CMS_ACCOUNTS_FAILURE })
|
|
826
|
-
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: { type: 'ck', settings: {} }, isBeeEnabled: false })
|
|
827
|
-
.run();
|
|
828
|
-
});
|
|
829
|
-
|
|
830
|
-
it('should skip wait and use isBEEAppEnableFromAction as fallback when cmsAccountsLoaded is false but fetchingCmsAccounts is false', () => {
|
|
831
|
-
const fakeResponse = {
|
|
832
|
-
data: { response: { cmsDetails: { type: 'bee', settings: {} } } },
|
|
833
|
-
};
|
|
834
|
-
|
|
835
|
-
return expectSaga(sagas.getCmsSetting, { ...basePayload, isBEEAppEnable: true })
|
|
836
|
-
.provide([
|
|
837
|
-
{
|
|
838
|
-
select(effect, next) {
|
|
839
|
-
return fromJS({ cmsAccountsLoaded: false, fetchingCmsAccounts: false, isBeeEnabled: null });
|
|
840
|
-
},
|
|
841
|
-
},
|
|
842
|
-
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
843
|
-
])
|
|
844
|
-
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: { type: 'bee', settings: {} }, isBeeEnabled: true })
|
|
845
|
-
.run();
|
|
846
|
-
});
|
|
847
|
-
|
|
848
|
-
it('should use state isBeeEnabled (null) and fall back to isBEEAppEnableFromAction via ?? operator', () => {
|
|
849
|
-
const fakeResponse = {
|
|
850
|
-
data: { response: { cmsDetails: { type: 'bee', settings: {} } } },
|
|
851
|
-
};
|
|
852
|
-
|
|
853
|
-
return expectSaga(sagas.getCmsSetting, { ...basePayload, isBEEAppEnable: true })
|
|
854
|
-
.provide([
|
|
855
|
-
{
|
|
856
|
-
select(effect, next) {
|
|
857
|
-
return fromJS({ cmsAccountsLoaded: true, fetchingCmsAccounts: false, isBeeEnabled: null });
|
|
858
|
-
},
|
|
859
|
-
},
|
|
860
|
-
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
861
|
-
])
|
|
862
|
-
.call(Api.getCmsTemplateSettingsV2, basePayload.cmsType, basePayload.projectId, basePayload.cmsMode, basePayload.langId, basePayload.isEdmSupport, true)
|
|
863
|
-
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: { type: 'bee', settings: {} }, isBeeEnabled: true })
|
|
864
|
-
.run();
|
|
865
|
-
});
|
|
866
|
-
|
|
867
|
-
it('should use state isBeeEnabled false over isBEEAppEnableFromAction true via ?? operator (false is not null/undefined)', () => {
|
|
868
|
-
const fakeResponse = {
|
|
869
|
-
data: { response: { cmsDetails: { type: 'bee', settings: {} } } },
|
|
870
|
-
};
|
|
871
|
-
|
|
872
|
-
return expectSaga(sagas.getCmsSetting, { ...basePayload, isBEEAppEnable: true })
|
|
873
|
-
.provide([
|
|
874
|
-
{
|
|
875
|
-
select(effect, next) {
|
|
876
|
-
return fromJS({ cmsAccountsLoaded: true, fetchingCmsAccounts: false, isBeeEnabled: false });
|
|
877
|
-
},
|
|
878
|
-
},
|
|
879
|
-
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
880
|
-
])
|
|
881
|
-
.call(Api.getCmsTemplateSettingsV2, basePayload.cmsType, basePayload.projectId, basePayload.cmsMode, basePayload.langId, basePayload.isEdmSupport, false)
|
|
882
|
-
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: { type: 'bee', settings: {} }, isBeeEnabled: true })
|
|
883
|
-
.run();
|
|
884
|
-
});
|
|
885
|
-
|
|
886
|
-
it('should derive isBeeEnabled false when cmsDetails type is undefined', () => {
|
|
887
|
-
const fakeResponse = {
|
|
888
|
-
data: { response: { cmsDetails: { settings: {} } } },
|
|
889
|
-
};
|
|
890
|
-
|
|
891
|
-
return expectSaga(sagas.getCmsSetting, basePayload)
|
|
892
|
-
.provide([
|
|
893
|
-
{
|
|
894
|
-
select(effect, next) {
|
|
895
|
-
return fromJS({ cmsAccountsLoaded: true, fetchingCmsAccounts: false, isBeeEnabled: true });
|
|
896
|
-
},
|
|
897
|
-
},
|
|
898
|
-
[matchers.call.fn(Api.getCmsTemplateSettingsV2), fakeResponse],
|
|
899
|
-
])
|
|
900
|
-
.put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: { settings: {} }, isBeeEnabled: false })
|
|
901
|
-
.run();
|
|
902
|
-
});
|
|
903
763
|
});
|
|
904
764
|
|
|
905
765
|
|
|
@@ -34,18 +34,32 @@ export const RCS_STATUSES = {
|
|
|
34
34
|
awaitingApproval: 'awaitingApproval',
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
export const HOST_ICS="rcsicsbulk";
|
|
38
|
+
export const HOST_INFOBIP="rcsinfobipbulk";
|
|
39
|
+
|
|
37
40
|
export const contentType = {
|
|
38
41
|
text_message: 'text_message',
|
|
39
42
|
rich_card: 'rich_card',
|
|
40
43
|
carousel: 'carousel',
|
|
41
44
|
};
|
|
42
45
|
|
|
46
|
+
export const CHANNELS = [
|
|
47
|
+
'email',
|
|
48
|
+
'mPush',
|
|
49
|
+
'viber',
|
|
50
|
+
'whatsapp',
|
|
51
|
+
'zalo',
|
|
52
|
+
'facebook',
|
|
53
|
+
'rcs',
|
|
54
|
+
'inApp',
|
|
55
|
+
'line',
|
|
56
|
+
'weChat',
|
|
57
|
+
'callTask',
|
|
58
|
+
'FTP',
|
|
59
|
+
'webpush',
|
|
60
|
+
];
|
|
61
|
+
|
|
43
62
|
export const STATUS_OPTIONS = [
|
|
44
|
-
// {
|
|
45
|
-
// key: 'created',
|
|
46
|
-
// value: RCS_STATUSES.awaitingApproval,
|
|
47
|
-
// label: <FormattedMessage {...messages.created} />,
|
|
48
|
-
// },
|
|
49
63
|
{
|
|
50
64
|
key: 'approved',
|
|
51
65
|
value: RCS_STATUSES.approved,
|
|
@@ -74,10 +88,31 @@ export const RCS_MEDIA_TYPES = {
|
|
|
74
88
|
VIDEO: 'VIDEO',
|
|
75
89
|
};
|
|
76
90
|
|
|
77
|
-
|
|
78
|
-
export const
|
|
91
|
+
/** Match `{{…}}` placeholders including Liquid-style names (e.g. `tag.FORMAT_1`). Must align with split + `isAnyTemplateVarToken` / SMS fallback. */
|
|
92
|
+
export const rcsVarRegex = /\{\{[^}]+\}\}/g;
|
|
93
|
+
/** True when the whole string is a single RCS/mustache token (used when testing segment tokens). */
|
|
94
|
+
export const rcsVarTestRegex = /^\{\{[^}]+\}\}$/;
|
|
95
|
+
|
|
96
|
+
/** Matches all `{{N}}` numeric-index variable tokens in a template string (global). */
|
|
97
|
+
export const RCS_NUMERIC_VAR_TOKEN_REGEX = /\{\{(\d+)\}\}/g;
|
|
98
|
+
/** `cardVarMapped` slot keys that are numeric only (legacy ordering). */
|
|
99
|
+
export const RCS_NUMERIC_VAR_NAME_REGEX = /^\d+$/;
|
|
100
|
+
/** Semantic Liquid-style keys on RCS `cardVarMapped` (same class as `{{…}}` inner names in the editor). */
|
|
101
|
+
export const RCS_CARD_VAR_MAPPED_SEMANTIC_KEY_REGEX = /^[\w.]+$/;
|
|
102
|
+
/** Escape `RegExp` metacharacters when building a pattern from user/tag text. */
|
|
103
|
+
export const RCS_REGEX_META_CHARS_PATTERN = /[.*+?^${}()|[\]\\]/g;
|
|
104
|
+
/** Entire string is a single `{{tag}}` token (value still a placeholder). */
|
|
105
|
+
export const RCS_SINGLE_MUSTACHE_PLACEHOLDER_REGEX = /^\{\{[^}]+\}\}$/;
|
|
106
|
+
/** Strip leading `{{` and trailing `}}` from a token. */
|
|
107
|
+
export const RCS_STRIP_MUSTACHE_DELIMITERS_REGEX = /^\{\{|\}\}$/g;
|
|
108
|
+
|
|
109
|
+
/** Tag-popover target: title vs description field (matches `onTagSelect` `field` argument). */
|
|
110
|
+
export const RCS_TAG_AREA_FIELD_TITLE = 'title';
|
|
111
|
+
export const RCS_TAG_AREA_FIELD_DESC = 'desc';
|
|
112
|
+
|
|
79
113
|
export const TEMPLATE_DESC_MAX_LENGTH = 2500;
|
|
80
|
-
|
|
114
|
+
/** Resolved SMS fallback body cap. Must allow multi-segment DLT (>160); aligns with TRAI / `TEMPLATE_MESSAGE_MAX_LENGTH`. */
|
|
115
|
+
export const FALLBACK_MESSAGE_MAX_LENGTH = TEMPLATE_MESSAGE_MAX_LENGTH;
|
|
81
116
|
export const TEMPLATE_TITLE_MAX_LENGTH = 200;
|
|
82
117
|
export const TEMPLATE_BUTTON_TEXT_MAX_LENGTH = 25;
|
|
83
118
|
export const CTA = 'CTA';
|
|
@@ -92,10 +127,12 @@ export const ALLOWED_IMAGE_EXTENSIONS_REGEX = (/\.(png|jpg|jpeg|gif)$/i);
|
|
|
92
127
|
export const RCS_IMG_WIDTH = 1440;
|
|
93
128
|
export const RCS_IMG_HEIGHT = 1024;
|
|
94
129
|
export const RCS_IMG_SIZE = 2000000; // 2MB
|
|
130
|
+
export const RCS_CAROUSEL_IMG_SIZE = 1 * 1024 * 1024; // 1MB
|
|
95
131
|
export const MAX_FILE_SIZE_MB = 10;
|
|
96
132
|
export const MAX_FILE_SIZE_BYTES = MAX_FILE_SIZE_MB * 1024 * 1024;
|
|
97
133
|
export const ALLOWED_EXTENSIONS_VIDEO_REGEX = (/\.(mp4)$/i);
|
|
98
134
|
export const RCS_VIDEO_SIZE = 10 * 1024 * 1024;
|
|
135
|
+
export const RCS_CAROUSEL_VIDEO_SIZE = 5 * 1024 * 1024; // 5MB
|
|
99
136
|
export const RCS_THUMBNAIL_MIN_SIZE = 40 * 1024;
|
|
100
137
|
export const RCS_THUMBNAIL_MAX_SIZE = 100 * 1024;
|
|
101
138
|
|
|
@@ -142,13 +179,38 @@ export const RCS_IMAGE_DIMENSIONS = {
|
|
|
142
179
|
},
|
|
143
180
|
};
|
|
144
181
|
|
|
182
|
+
// Carousel image dimensions (pixel values shown in UI). Keys follow `${HEIGHT}_${WIDTH}`.
|
|
183
|
+
// HEIGHT: SHORT|MEDIUM, WIDTH: SMALL|MEDIUM
|
|
184
|
+
export const RCS_CAROUSEL_IMAGE_DIMENSIONS = {
|
|
185
|
+
SHORT_SMALL: {
|
|
186
|
+
width: 1160,
|
|
187
|
+
height: 720,
|
|
188
|
+
description: 'Image (1160 x 720)',
|
|
189
|
+
},
|
|
190
|
+
SHORT_MEDIUM: {
|
|
191
|
+
width: 1800,
|
|
192
|
+
height: 720,
|
|
193
|
+
description: 'Image (1800 x 720)',
|
|
194
|
+
},
|
|
195
|
+
MEDIUM_SMALL: {
|
|
196
|
+
width: 770,
|
|
197
|
+
height: 720,
|
|
198
|
+
description: 'Image (770 x 720)',
|
|
199
|
+
},
|
|
200
|
+
MEDIUM_MEDIUM: {
|
|
201
|
+
width: 1280,
|
|
202
|
+
height: 720,
|
|
203
|
+
description: 'Image (1280 x 720)',
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
145
207
|
export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
146
208
|
SHORT_HEIGHT: {
|
|
147
|
-
width: 770,
|
|
148
|
-
height: 257,
|
|
149
209
|
type: 'SHORT_HEIGHT',
|
|
150
210
|
heightType: 'SHORT',
|
|
151
211
|
label: 'Vertical Short',
|
|
212
|
+
width: 1140,
|
|
213
|
+
height: 448,
|
|
152
214
|
description: 'Thumbnail (770 x 257)',
|
|
153
215
|
orientation: 'VERTICAL',
|
|
154
216
|
maxFileSize: 100 * 1024,
|
|
@@ -189,6 +251,29 @@ export const RCS_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
|
189
251
|
},
|
|
190
252
|
};
|
|
191
253
|
|
|
254
|
+
// Carousel thumbnail dimensions for video cards (pixel values shown in UI).
|
|
255
|
+
// Keys follow `${HEIGHT}_${WIDTH}`.
|
|
256
|
+
// Human-readable labels: formatMessage(messages.rcsCarouselVideoThumbnailLabel, { width, height })
|
|
257
|
+
// or formatRcsCarouselVideoThumbnailLabel(formatMessage, entry) from ./utils.
|
|
258
|
+
export const RCS_CAROUSEL_VIDEO_THUMBNAIL_DIMENSIONS = {
|
|
259
|
+
SHORT_SMALL: {
|
|
260
|
+
width: 718,
|
|
261
|
+
height: 448,
|
|
262
|
+
},
|
|
263
|
+
SHORT_MEDIUM: {
|
|
264
|
+
width: 1140,
|
|
265
|
+
height: 448,
|
|
266
|
+
},
|
|
267
|
+
MEDIUM_SMALL: {
|
|
268
|
+
width: 480,
|
|
269
|
+
height: 448,
|
|
270
|
+
},
|
|
271
|
+
MEDIUM_MEDIUM: {
|
|
272
|
+
width: 796,
|
|
273
|
+
height: 448,
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
|
|
192
277
|
const prefix = 'app/v2Containers/Rcs';
|
|
193
278
|
export const UPLOAD_RCS_ASSET_REQUEST = `${prefix}/UPLOAD_RCS_ASSET_REQUEST`;
|
|
194
279
|
export const UPLOAD_RCS_ASSET_SUCCESS = `${prefix}/UPLOAD_RCS_ASSET_SUCCESS`;
|
|
@@ -215,6 +300,7 @@ export const CLEAR_EDIT_RESPONSE_REQUEST = `${prefix}/Edit/CLEAR_EDIT_RESPONSE_R
|
|
|
215
300
|
export const AI_CONTENT_BOT_DISABLED = "AI_CONTENT_BOT_DISABLED";
|
|
216
301
|
|
|
217
302
|
export const RCS_TEXT_MESSAGE_MAX_LENGTH = 160;
|
|
303
|
+
export const RCS_TEXT_MESSAGE_MAX_LENGTH_INFOBIP = 3072;
|
|
218
304
|
export const RCS_RICH_CARD_MAX_LENGTH = 2000;
|
|
219
305
|
export const MAX_BUTTONS = 4;
|
|
220
306
|
|
|
@@ -250,3 +336,26 @@ export const RCS_BUTTON_TYPES = {
|
|
|
250
336
|
PHONE_NUMBER: 'PHONE_NUMBER',
|
|
251
337
|
CTA: 'CTA',
|
|
252
338
|
};
|
|
339
|
+
|
|
340
|
+
/** Default action row for carousel card 1 (mandatory button UX): phone CTA, unsaved until user completes + Save. */
|
|
341
|
+
export const RCS_CAROUSEL_FIRST_CARD_DEFAULT_SUGGESTIONS = [
|
|
342
|
+
{
|
|
343
|
+
index: 0,
|
|
344
|
+
type: RCS_BUTTON_TYPES.PHONE_NUMBER,
|
|
345
|
+
text: '',
|
|
346
|
+
phoneNumber: '',
|
|
347
|
+
url: null,
|
|
348
|
+
postback: '',
|
|
349
|
+
isSaved: false,
|
|
350
|
+
},
|
|
351
|
+
];
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
export const CAROUSEL_HEIGHT_OPTIONS = [
|
|
355
|
+
{ value: 'SHORT', label: 'Short' },
|
|
356
|
+
{ value: 'MEDIUM', label: 'Medium' },
|
|
357
|
+
];
|
|
358
|
+
export const CAROUSEL_WIDTH_OPTIONS = [
|
|
359
|
+
{ value: 'SMALL', label: 'Small' },
|
|
360
|
+
{ value: 'MEDIUM', label: 'Medium' },
|
|
361
|
+
];
|