@capillarytech/creatives-library 6.9.8 → 6.9.9
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/package.json
CHANGED
|
@@ -40,7 +40,12 @@ function BeeEditor(props) {
|
|
|
40
40
|
const {formatMessage} = intl;
|
|
41
41
|
const UNSUBSCRIBE = 'unsubscribe';
|
|
42
42
|
let beePluginInstance = null;
|
|
43
|
-
const categoryOptions = [
|
|
43
|
+
const categoryOptions = [{key: 'cta', value: 'cta', label: formatMessage(messages.cta)},
|
|
44
|
+
{key: 'footer', value: 'footer', label: formatMessage(messages.footer)},
|
|
45
|
+
{key: 'header', value: 'header', label: formatMessage(messages.header)},
|
|
46
|
+
{key: 'sp', value: 'sp', label: formatMessage(messages.socialPlatform)},
|
|
47
|
+
{key: 'others', value: 'others', label: formatMessage(messages.others)},
|
|
48
|
+
];
|
|
44
49
|
const [visibleTaglist, setVisibleTaglist] = useState(false);
|
|
45
50
|
const [showRowMetaModal, setRowMetaModal] = useState(false);
|
|
46
51
|
const [selectedTag, setSelectedTag] = useState({});
|
|
@@ -77,7 +82,7 @@ function BeeEditor(props) {
|
|
|
77
82
|
},
|
|
78
83
|
},
|
|
79
84
|
mergeTags: {
|
|
80
|
-
label:
|
|
85
|
+
label: formatMessage(messages.addLabel),
|
|
81
86
|
handler: async (resolve, reject) => {
|
|
82
87
|
// this will open tag modal
|
|
83
88
|
await setVisibleTaglist(true);
|
|
@@ -137,9 +142,9 @@ function BeeEditor(props) {
|
|
|
137
142
|
onSave: (jsonFile, htmlFile) => {
|
|
138
143
|
saveBeeData(jsonFile, htmlFile);
|
|
139
144
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
console.log('bee-plugin-container onSaveRows',
|
|
145
|
+
// will use this function on save row feature
|
|
146
|
+
onSaveRow: (rowJSON, rowHTML, pageJSON) => {
|
|
147
|
+
console.log('bee-plugin-container onSaveRows', rowJSON, rowHTML, pageJSON);
|
|
143
148
|
},
|
|
144
149
|
};
|
|
145
150
|
window.BeePlugin.create(tokenData, beeConfig, (instance) => {
|
|
@@ -189,15 +194,12 @@ function BeeEditor(props) {
|
|
|
189
194
|
const onRowChange = useCallback((e) => {
|
|
190
195
|
setRowName(e.target.value);
|
|
191
196
|
});
|
|
192
|
-
// will use this function on save row feature
|
|
193
197
|
const onChangeCategoy = (e) => {
|
|
194
|
-
|
|
198
|
+
setRowCategory(e);
|
|
195
199
|
};
|
|
196
|
-
|
|
197
200
|
const onTagChange = (e) => {
|
|
198
201
|
setRowTags(e.target.value);
|
|
199
202
|
};
|
|
200
|
-
|
|
201
203
|
const contentSection = <>
|
|
202
204
|
<CapInput
|
|
203
205
|
label={<FormattedMessage {...messages.rowName} />}
|
|
@@ -44,4 +44,28 @@ export default defineMessages({
|
|
|
44
44
|
id: `${prefix}.tagPlaceHolder`,
|
|
45
45
|
defaultMessage: 'Enter tags',
|
|
46
46
|
},
|
|
47
|
+
addLabel: {
|
|
48
|
+
id: `${prefix}.addLabel`,
|
|
49
|
+
defaultMessage: 'Add label',
|
|
50
|
+
},
|
|
51
|
+
cta: {
|
|
52
|
+
id: `${prefix}.cta`,
|
|
53
|
+
defaultMessage: 'CTA',
|
|
54
|
+
},
|
|
55
|
+
header: {
|
|
56
|
+
id: `${prefix}.header`,
|
|
57
|
+
defaultMessage: 'Header',
|
|
58
|
+
},
|
|
59
|
+
footer: {
|
|
60
|
+
id: `${prefix}.footer`,
|
|
61
|
+
defaultMessage: 'Footer',
|
|
62
|
+
},
|
|
63
|
+
others: {
|
|
64
|
+
id: `${prefix}.others`,
|
|
65
|
+
defaultMessage: 'Others',
|
|
66
|
+
},
|
|
67
|
+
socialPlatform: {
|
|
68
|
+
id: `${prefix}.socialPlatform`,
|
|
69
|
+
defaultMessage: 'Social platform',
|
|
70
|
+
},
|
|
47
71
|
});
|
|
@@ -3221,7 +3221,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3221
3221
|
if (!beeJson || !beeToken) {
|
|
3222
3222
|
return false;
|
|
3223
3223
|
}
|
|
3224
|
-
console.log('beeJson', beeJson);
|
|
3225
3224
|
let isModuleFilterEnabled = _.get(this.props.location, 'query.type', '') !== 'embedded';
|
|
3226
3225
|
const schemaChannel = _.get(this.props.schema, 'channel', "");
|
|
3227
3226
|
if (schemaChannel === 'EMAIL') {
|
|
@@ -3333,7 +3332,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3333
3332
|
}
|
|
3334
3333
|
|
|
3335
3334
|
});
|
|
3336
|
-
if(!this.props.isEmailLoading && !fields.length) {
|
|
3335
|
+
if(!this.props.isEmailLoading && this.props.schema.channel.toUpperCase() === 'EMAIL' && !fields.length) {
|
|
3337
3336
|
return (
|
|
3338
3337
|
<div style={{ textAlign: 'center' }}>
|
|
3339
3338
|
<CapSpin spinning />
|
|
@@ -66,7 +66,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
populateTags(tagsList) {
|
|
69
|
-
console.log('populating tags', tagsList);
|
|
69
|
+
console.log('populating tags', (tagsList || []).length);
|
|
70
70
|
const mainTags = {};
|
|
71
71
|
|
|
72
72
|
//Form tags object with tag headers
|
|
@@ -81,7 +81,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
81
81
|
} else if (tag['tag-header'] && mainTags[tag.value]) {
|
|
82
82
|
mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
|
|
83
83
|
} else if (!mainTags[tag.value]) {
|
|
84
|
-
console.log('Inside ', tag.label);
|
|
84
|
+
// console.log('Inside ', tag.label);
|
|
85
85
|
mainTags[tag.value] = {
|
|
86
86
|
'tag-header': true,
|
|
87
87
|
"name": tag.label[userLocale] ? tag.label[userLocale] : tag.label.en,
|
|
@@ -229,13 +229,13 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
229
229
|
}
|
|
230
230
|
if (this.props.tags && this.props.tags.length > 0) {
|
|
231
231
|
tags = this.populateTags(this.props.tags);
|
|
232
|
-
console.log('populating tags', tags);
|
|
232
|
+
console.log('populating tags', Object.keys(tags || {}).length);
|
|
233
233
|
}
|
|
234
234
|
if (this.props.selectedOfferDetails && !_.isEmpty(this.props.selectedOfferDetails) && (tags && tags.coupon)) {
|
|
235
235
|
this.transformCouponTags(this.props.selectedOfferDetails, tags);
|
|
236
236
|
}
|
|
237
237
|
tags = _.merge( {}, tags, injectedTags);
|
|
238
|
-
console.log('merged tags', tags);
|
|
238
|
+
console.log('merged tags', Object.keys(tags || {}).length);
|
|
239
239
|
return (
|
|
240
240
|
<div className={this.props.className ? this.props.className : ''}>
|
|
241
241
|
<CapTagList
|