@capillarytech/creatives-library 8.0.271 → 8.0.272
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/assets/Android.png +0 -0
- package/assets/iOS.png +0 -0
- package/constants/unified.js +2 -1
- package/initialReducer.js +2 -0
- package/package.json +1 -1
- package/services/api.js +10 -0
- package/services/tests/api.test.js +34 -0
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +17 -35
- package/tests/integration/TemplateCreation/api-response.js +31 -1
- package/tests/integration/TemplateCreation/msw-handler.js +2 -0
- package/utils/common.js +5 -0
- package/utils/commonUtils.js +28 -5
- package/utils/tests/commonUtil.test.js +224 -0
- package/utils/transformTemplateConfig.js +0 -10
- package/v2Components/CapDeviceContent/index.js +61 -56
- package/v2Components/CapTagList/index.js +6 -1
- package/v2Components/CapTagListWithInput/index.js +5 -1
- package/v2Components/CapTagListWithInput/messages.js +1 -1
- package/v2Components/CapWhatsappCTA/tests/index.test.js +5 -0
- package/v2Components/ErrorInfoNote/constants.js +1 -0
- package/v2Components/ErrorInfoNote/index.js +402 -72
- package/v2Components/ErrorInfoNote/messages.js +32 -6
- package/v2Components/ErrorInfoNote/style.scss +278 -6
- package/v2Components/FormBuilder/tests/index.test.js +13 -4
- package/v2Components/HtmlEditor/HTMLEditor.js +418 -99
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +870 -0
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +1882 -133
- package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +27 -16
- package/v2Components/HtmlEditor/_htmlEditor.scss +108 -45
- package/v2Components/HtmlEditor/_index.lazy.scss +0 -1
- package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +23 -102
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +148 -140
- package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +2 -1
- package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
- package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +9 -1
- package/v2Components/HtmlEditor/components/EditorToolbar/index.js +31 -6
- package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +22 -0
- package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +4 -7
- package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +35 -45
- package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +1 -3
- package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
- package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +7 -6
- package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +7 -10
- package/v2Components/HtmlEditor/components/PreviewPane/index.js +22 -43
- package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/_validationErrorDisplay.scss +18 -0
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +36 -31
- package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +46 -34
- package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +6 -0
- package/v2Components/HtmlEditor/components/ValidationPanel/index.js +52 -46
- package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +277 -0
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +295 -0
- package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +51 -0
- package/v2Components/HtmlEditor/constants.js +45 -20
- package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +373 -16
- package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +351 -16
- package/v2Components/HtmlEditor/hooks/useEditorContent.js +5 -2
- package/v2Components/HtmlEditor/hooks/useInAppContent.js +88 -146
- package/v2Components/HtmlEditor/hooks/useValidation.js +213 -56
- package/v2Components/HtmlEditor/index.js +1 -1
- package/v2Components/HtmlEditor/messages.js +102 -94
- package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +214 -45
- package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +134 -0
- package/v2Components/HtmlEditor/utils/contentSanitizer.js +40 -41
- package/v2Components/HtmlEditor/utils/htmlValidator.js +71 -72
- package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +158 -124
- package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +23 -25
- package/v2Components/HtmlEditor/utils/validationAdapter.js +66 -41
- package/v2Components/HtmlEditor/utils/validationConstants.js +38 -0
- package/v2Components/MobilePushPreviewV2/constants.js +6 -0
- package/v2Components/MobilePushPreviewV2/index.js +33 -7
- package/v2Components/TemplatePreview/_templatePreview.scss +55 -24
- package/v2Components/TemplatePreview/index.js +47 -32
- package/v2Components/TemplatePreview/messages.js +4 -0
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +1 -0
- package/v2Containers/BeeEditor/index.js +172 -90
- package/v2Containers/BeePopupEditor/_beePopupEditor.scss +14 -0
- package/v2Containers/BeePopupEditor/constants.js +10 -0
- package/v2Containers/BeePopupEditor/index.js +194 -0
- package/v2Containers/BeePopupEditor/tests/index.test.js +627 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +127 -51
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +156 -13
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +2 -1
- package/v2Containers/CreativesContainer/constants.js +1 -0
- package/v2Containers/CreativesContainer/index.js +251 -47
- package/v2Containers/CreativesContainer/messages.js +8 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +11 -2
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +38 -50
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +103 -0
- package/v2Containers/Email/actions.js +7 -0
- package/v2Containers/Email/constants.js +5 -1
- package/v2Containers/Email/index.js +234 -29
- package/v2Containers/Email/messages.js +32 -0
- package/v2Containers/Email/reducer.js +12 -1
- package/v2Containers/Email/sagas.js +61 -7
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +2 -0
- package/v2Containers/Email/tests/reducer.test.js +46 -0
- package/v2Containers/Email/tests/sagas.test.js +320 -29
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +1246 -0
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +212 -21
- package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +40 -74
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +2472 -0
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +520 -0
- package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +2 -67
- package/v2Containers/EmailWrapper/constants.js +2 -0
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +627 -79
- package/v2Containers/EmailWrapper/index.js +103 -23
- package/v2Containers/EmailWrapper/messages.js +65 -1
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +955 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +596 -82
- package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +376 -0
- package/v2Containers/InApp/__tests__/sagas.test.js +363 -0
- package/v2Containers/InApp/actions.js +7 -0
- package/v2Containers/InApp/constants.js +20 -4
- package/v2Containers/InApp/index.js +802 -360
- package/v2Containers/InApp/index.scss +4 -3
- package/v2Containers/InApp/messages.js +7 -3
- package/v2Containers/InApp/reducer.js +21 -3
- package/v2Containers/InApp/sagas.js +29 -9
- package/v2Containers/InApp/selectors.js +25 -5
- package/v2Containers/InApp/tests/index.test.js +154 -50
- package/v2Containers/InApp/tests/reducer.test.js +34 -0
- package/v2Containers/InApp/tests/sagas.test.js +61 -9
- package/v2Containers/InApp/tests/selectors.test.js +612 -0
- package/v2Containers/InAppWrapper/components/InAppWrapperView.js +151 -0
- package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +267 -0
- package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +23 -0
- package/v2Containers/InAppWrapper/constants.js +16 -0
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +473 -0
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +198 -0
- package/v2Containers/InAppWrapper/index.js +148 -0
- package/v2Containers/InAppWrapper/messages.js +49 -0
- package/v2Containers/InappAdvance/index.js +1099 -0
- package/v2Containers/InappAdvance/index.scss +10 -0
- package/v2Containers/InappAdvance/tests/index.test.js +448 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +9 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +12 -0
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4 -0
- package/v2Containers/TagList/index.js +62 -19
- package/v2Containers/Templates/_templates.scss +60 -1
- package/v2Containers/Templates/index.js +89 -4
- package/v2Containers/Templates/messages.js +4 -0
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +4 -2
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +34 -0
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +0 -152
- package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +0 -214
|
@@ -69,7 +69,7 @@ const CapDeviceContent = (props) => {
|
|
|
69
69
|
templateDescErrorHandler,
|
|
70
70
|
templateTitleError,
|
|
71
71
|
setTemplateTitleError,
|
|
72
|
-
isAiContentBotDisabled
|
|
72
|
+
isAiContentBotDisabled,
|
|
73
73
|
} = props || {};
|
|
74
74
|
const { TextArea } = CapInput;
|
|
75
75
|
const { formatMessage } = intl;
|
|
@@ -167,21 +167,22 @@ const CapDeviceContent = (props) => {
|
|
|
167
167
|
return (
|
|
168
168
|
<>
|
|
169
169
|
<CapRow className="creatives-device-content">
|
|
170
|
-
|
|
170
|
+
<CapLink
|
|
171
171
|
title={isAndroid
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
? formatMessage(messages.copyContentFromIOS)
|
|
173
|
+
: formatMessage(messages.copyCotentFromAndroid)}
|
|
174
174
|
className="inapp-copy-content"
|
|
175
175
|
onClick={onCopyTitleAndContent}
|
|
176
|
-
|
|
176
|
+
/>
|
|
177
177
|
<CapRow className="creatives-inapp-title">
|
|
178
178
|
<CapColumn
|
|
179
|
-
|
|
179
|
+
className="inapp-content-main"
|
|
180
180
|
>
|
|
181
181
|
<CapHeading type="h5" className="inapp-title">
|
|
182
182
|
{formatMessage(messages.title)}
|
|
183
183
|
</CapHeading>
|
|
184
|
-
{getTagList(0)}
|
|
184
|
+
{getTagList(0)}
|
|
185
|
+
{/* here 0 signifies the tags for template title */}
|
|
185
186
|
</CapColumn>
|
|
186
187
|
<CapInput
|
|
187
188
|
id="inapp-title-name-input"
|
|
@@ -213,7 +214,7 @@ const CapDeviceContent = (props) => {
|
|
|
213
214
|
</CapRow>
|
|
214
215
|
<CapRow className={`creatives-inapp-message ${!isMediaTypeImage && "message-bottom-margin"}`}>
|
|
215
216
|
<CapColumn
|
|
216
|
-
|
|
217
|
+
className="inapp-message-header"
|
|
217
218
|
>
|
|
218
219
|
<CapHeading type="h5" className="inapp-message-header-style">
|
|
219
220
|
{formatMessage(messages.message)}
|
|
@@ -222,37 +223,37 @@ const CapDeviceContent = (props) => {
|
|
|
222
223
|
{/* here 1 signifies the tags for template message */}
|
|
223
224
|
</CapColumn>
|
|
224
225
|
<div className="inapp-create-template-message-input-wrapper">
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
/>
|
|
240
|
-
{!isAiContentBotDisabled && (
|
|
241
|
-
<CapAskAira.ContentGenerationBot
|
|
242
|
-
text={templateMessage || ""}
|
|
243
|
-
setText={(text) => {
|
|
244
|
-
onTemplateMessageChange({ target: { value: text } });
|
|
245
|
-
}}
|
|
246
|
-
iconPlacement="float-br"
|
|
247
|
-
iconSize="1.6rem"
|
|
248
|
-
rootStyle={{
|
|
249
|
-
bottom: "0.2rem",
|
|
250
|
-
right: "0.2rem",
|
|
251
|
-
left: "auto",
|
|
252
|
-
position: "absolute",
|
|
253
|
-
}}
|
|
226
|
+
<TextArea
|
|
227
|
+
id="inapp-create-template-message-input"
|
|
228
|
+
className="inapp-create-template-message-input"
|
|
229
|
+
placeholder={formatMessage(messages.textAreaInputPlaceholder)}
|
|
230
|
+
onChange={onTemplateMessageChange}
|
|
231
|
+
value={templateMessage || ""}
|
|
232
|
+
autosize={{ minRows: 5, maxRows: 5 }}
|
|
233
|
+
errorMessage={
|
|
234
|
+
templateMessageError && (
|
|
235
|
+
<CapError className="inapp-template-message-error">
|
|
236
|
+
{templateMessageError}
|
|
237
|
+
</CapError>
|
|
238
|
+
)
|
|
239
|
+
}
|
|
254
240
|
/>
|
|
255
|
-
|
|
241
|
+
{!isAiContentBotDisabled && (
|
|
242
|
+
<CapAskAira.ContentGenerationBot
|
|
243
|
+
text={templateMessage || ""}
|
|
244
|
+
setText={(text) => {
|
|
245
|
+
onTemplateMessageChange({ target: { value: text } });
|
|
246
|
+
}}
|
|
247
|
+
iconPlacement="float-br"
|
|
248
|
+
iconSize="1.6rem"
|
|
249
|
+
rootStyle={{
|
|
250
|
+
bottom: "0.2rem",
|
|
251
|
+
right: "0.2rem",
|
|
252
|
+
left: "auto",
|
|
253
|
+
position: "absolute",
|
|
254
|
+
}}
|
|
255
|
+
/>
|
|
256
|
+
)}
|
|
256
257
|
</div>
|
|
257
258
|
{isMediaTypeImage && (
|
|
258
259
|
<>
|
|
@@ -279,14 +280,16 @@ const CapDeviceContent = (props) => {
|
|
|
279
280
|
</CapRow>
|
|
280
281
|
</CapRow>
|
|
281
282
|
<CapRow className="inapp-action-link">
|
|
282
|
-
<CapCheckbox onChange={onActionLinkCheckBoxChange} checked={addActionLink}/>
|
|
283
|
+
<CapCheckbox onChange={onActionLinkCheckBoxChange} checked={addActionLink} />
|
|
283
284
|
<CapRow className="inapp-render-heading">
|
|
284
285
|
<CapHeader
|
|
285
|
-
title={
|
|
286
|
-
<
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
title={(
|
|
287
|
+
<CapRow type="flex">
|
|
288
|
+
<CapHeading type="h4">
|
|
289
|
+
{formatMessage(messages.addActionLink)}
|
|
290
|
+
</CapHeading>
|
|
291
|
+
</CapRow>
|
|
292
|
+
)}
|
|
290
293
|
description={<CapLabel type="label3">{formatMessage(messages.addActionLinkDesc)}</CapLabel>}
|
|
291
294
|
/>
|
|
292
295
|
{addActionLink && (
|
|
@@ -310,19 +313,21 @@ const CapDeviceContent = (props) => {
|
|
|
310
313
|
<CapRow className="inapp-cta-button">
|
|
311
314
|
<CapHeader
|
|
312
315
|
className="inapp-render-heading-cta-button"
|
|
313
|
-
title={
|
|
314
|
-
<
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
316
|
+
title={(
|
|
317
|
+
<CapRow type="flex">
|
|
318
|
+
<CapHeading type="h4">
|
|
319
|
+
{formatMessage(messages.btnLabel)}
|
|
320
|
+
</CapHeading>
|
|
321
|
+
<CapHeading
|
|
322
|
+
type="h6"
|
|
323
|
+
className="inapp-optional-label"
|
|
324
|
+
>
|
|
325
|
+
{formatMessage(messages.optional)}
|
|
326
|
+
</CapHeading>
|
|
327
|
+
</CapRow>
|
|
328
|
+
)}
|
|
324
329
|
description={<CapLabel type="label3">{formatMessage(messages.btnDesc)}</CapLabel>}
|
|
325
|
-
|
|
330
|
+
/>
|
|
326
331
|
<CapRadioGroup
|
|
327
332
|
options={BUTTON_RADIO_OPTIONS}
|
|
328
333
|
value={buttonType}
|
|
@@ -227,6 +227,10 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
227
227
|
|
|
228
228
|
togglePopoverVisibility = (visible) => {
|
|
229
229
|
this.setState({visible});
|
|
230
|
+
// Call onVisibleChange callback if provided (for triggering API calls when popover opens)
|
|
231
|
+
if (this.props.onVisibleChange) {
|
|
232
|
+
this.props.onVisibleChange(visible);
|
|
233
|
+
}
|
|
230
234
|
};
|
|
231
235
|
|
|
232
236
|
renderDynamicTagFlow = () => {
|
|
@@ -468,7 +472,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
468
472
|
onVisibleChange={this.togglePopoverVisibility}
|
|
469
473
|
content={contentSection}
|
|
470
474
|
trigger="click"
|
|
471
|
-
placement={channel === EMAIL.toUpperCase() ? "leftTop" : "rightTop"}
|
|
475
|
+
placement={this.props.popoverPlacement || (channel === EMAIL.toUpperCase() ? "leftTop" : "rightTop")}
|
|
472
476
|
>
|
|
473
477
|
<CapTooltip
|
|
474
478
|
title={
|
|
@@ -535,6 +539,7 @@ CapTagList.propTypes = {
|
|
|
535
539
|
channel: PropTypes.string,
|
|
536
540
|
disabled: PropTypes.bool,
|
|
537
541
|
fetchingSchemaError: PropTypes.bool,
|
|
542
|
+
popoverPlacement: PropTypes.string,
|
|
538
543
|
};
|
|
539
544
|
|
|
540
545
|
CapTagList.defaultValue = {
|
|
@@ -48,13 +48,14 @@ export const CapTagListWithInput = (props) => {
|
|
|
48
48
|
showTagList = true,
|
|
49
49
|
showInput = true,
|
|
50
50
|
inputProps = {},
|
|
51
|
+
popoverPlacement,
|
|
51
52
|
} = props;
|
|
52
53
|
|
|
53
54
|
const { formatMessage } = intl;
|
|
54
55
|
|
|
55
56
|
return (
|
|
56
57
|
<CapColumn style={containerStyle}>
|
|
57
|
-
<CapRow
|
|
58
|
+
<CapRow align="middle" type="flex">
|
|
58
59
|
{showHeading && headingText && (
|
|
59
60
|
<CapHeading type={headingType} style={headingStyle}>
|
|
60
61
|
{headingText}
|
|
@@ -76,6 +77,7 @@ export const CapTagListWithInput = (props) => {
|
|
|
76
77
|
selectedOfferDetails={selectedOfferDetails}
|
|
77
78
|
eventContextTags={eventContextTags}
|
|
78
79
|
style={tagListStyle}
|
|
80
|
+
popoverPlacement={popoverPlacement}
|
|
79
81
|
/>
|
|
80
82
|
)}
|
|
81
83
|
</CapRow>
|
|
@@ -136,6 +138,7 @@ CapTagListWithInput.propTypes = {
|
|
|
136
138
|
showHeading: PropTypes.bool,
|
|
137
139
|
showTagList: PropTypes.bool,
|
|
138
140
|
showInput: PropTypes.bool,
|
|
141
|
+
popoverPlacement: PropTypes.string,
|
|
139
142
|
};
|
|
140
143
|
|
|
141
144
|
CapTagListWithInput.defaultProps = {
|
|
@@ -164,6 +167,7 @@ CapTagListWithInput.defaultProps = {
|
|
|
164
167
|
showTagList: true,
|
|
165
168
|
showInput: true,
|
|
166
169
|
inputProps: {},
|
|
170
|
+
popoverPlacement: undefined,
|
|
167
171
|
};
|
|
168
172
|
|
|
169
173
|
export default injectIntl(CapTagListWithInput);
|
|
@@ -4,6 +4,11 @@ import '@testing-library/jest-dom';
|
|
|
4
4
|
import { render, screen, fireEvent } from '../../../utils/test-utils';
|
|
5
5
|
import { CapWhatsappCTA } from '../index';
|
|
6
6
|
|
|
7
|
+
// Mock the missing reducer
|
|
8
|
+
jest.mock('@capillarytech/cap-ui-library/CapCollapsibleLeftNavigation/reducer', () => {
|
|
9
|
+
return (state = {}) => state;
|
|
10
|
+
}, { virtual: true });
|
|
11
|
+
|
|
7
12
|
const updateHandler = jest.fn();
|
|
8
13
|
const deleteHandler = jest.fn();
|
|
9
14
|
const initializeComponent = (
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const LIQUID_DOC_URL = 'https://docs.capillarytech.com/docs/add-dynamic-content-using-liquid';
|