@capillarytech/creatives-library 8.0.345-alpha.5 → 8.0.345-alpha.7
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
|
@@ -705,14 +705,27 @@ export function SlideBoxContent(props) {
|
|
|
705
705
|
// and getDetails?type=BEE_PLUGIN would never fire. Routing BEE
|
|
706
706
|
// templates through the direct <Email> path — which is already
|
|
707
707
|
// battle-tested for the CKEditor flow — sidesteps that entirely.
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
console.log('[SlideBoxContent] templateData.base.is_drag_drop:', templateData?.base?.is_drag_drop);
|
|
711
|
-
console.log('[SlideBoxContent] typeof templateData.base.is_drag_drop:', typeof templateData?.base?.is_drag_drop);
|
|
712
|
-
console.log('[SlideBoxContent] is_drag_drop === true:', templateData?.base?.is_drag_drop === true);
|
|
713
|
-
console.log('[SlideBoxContent] is_drag_drop === 1:', templateData?.base?.is_drag_drop === 1);
|
|
708
|
+
const vBase = templateData?.versions?.base;
|
|
709
|
+
const vBaseActiveTab = vBase?.activeTab || vBase?.selectedLanguages?.[0] || 'en';
|
|
714
710
|
const isBEETemplate = templateData?.base?.is_drag_drop === true
|
|
715
|
-
|| templateData?.base?.is_drag_drop === 1
|
|
711
|
+
|| templateData?.base?.is_drag_drop === 1
|
|
712
|
+
|| vBase?.[vBaseActiveTab]?.is_drag_drop === true
|
|
713
|
+
|| vBase?.[vBaseActiveTab]?.is_drag_drop === 1;
|
|
714
|
+
console.log('[SlideBoxContent] BEE routing debug', {
|
|
715
|
+
supportCKEditor,
|
|
716
|
+
'templateData._id': templateData?._id,
|
|
717
|
+
'templateData.type': templateData?.type,
|
|
718
|
+
'templateData.base': templateData?.base,
|
|
719
|
+
'templateData.base.is_drag_drop': templateData?.base?.is_drag_drop,
|
|
720
|
+
'templateData.base.drag_drop_id': templateData?.base?.drag_drop_id,
|
|
721
|
+
vBase,
|
|
722
|
+
vBaseActiveTab,
|
|
723
|
+
'vBase[vBaseActiveTab]': vBase?.[vBaseActiveTab],
|
|
724
|
+
'vBase[vBaseActiveTab].is_drag_drop': vBase?.[vBaseActiveTab]?.is_drag_drop,
|
|
725
|
+
'vBase[vBaseActiveTab].drag_drop_id': vBase?.[vBaseActiveTab]?.drag_drop_id,
|
|
726
|
+
isBEETemplate,
|
|
727
|
+
routingTo: (supportCKEditor || isBEETemplate) ? 'Email (direct)' : 'EmailWrapper',
|
|
728
|
+
});
|
|
716
729
|
if (supportCKEditor || isBEETemplate) {
|
|
717
730
|
return (
|
|
718
731
|
<Email
|
|
@@ -966,10 +966,13 @@ export class Creatives extends React.Component {
|
|
|
966
966
|
case constants.EMAIL:
|
|
967
967
|
if (template?.value?.base) {
|
|
968
968
|
let emailBase = template.value.base;
|
|
969
|
-
const { html_content } = emailBase || {};
|
|
969
|
+
const { html_content, drag_drop_id: formDragDropId } = emailBase || {};
|
|
970
970
|
if (!html_content) {
|
|
971
971
|
emailBase = templateRecords.base;
|
|
972
972
|
}
|
|
973
|
+
if (!emailBase.drag_drop_id && formDragDropId) {
|
|
974
|
+
emailBase = { ...emailBase, drag_drop_id: formDragDropId };
|
|
975
|
+
}
|
|
973
976
|
const newHtmlContent = await updateImagesInHtml(html_content);
|
|
974
977
|
templateData = {
|
|
975
978
|
...templateData, ...emailBase, emailBody: newHtmlContent, emailSubject: (emailBase && emailBase.subject) ? emailBase.subject : '',
|
|
@@ -1639,6 +1639,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1639
1639
|
if (content.id) {
|
|
1640
1640
|
tmpData.id = content.id;
|
|
1641
1641
|
}
|
|
1642
|
+
if (content.drag_drop_id) {
|
|
1643
|
+
tmpData.drag_drop_id = content.drag_drop_id;
|
|
1644
|
+
}
|
|
1642
1645
|
}
|
|
1643
1646
|
newFormData.base = _.cloneDeep(tmpData);
|
|
1644
1647
|
newFormData.secondary_templates.push({template_data: tmpData});
|
|
@@ -65,11 +65,11 @@ const useEmailWrapper = ({
|
|
|
65
65
|
location,
|
|
66
66
|
emailActions,
|
|
67
67
|
Email,
|
|
68
|
+
templateData,
|
|
68
69
|
params,
|
|
69
70
|
isEditEmail = true,
|
|
70
71
|
}) => {
|
|
71
72
|
// State management
|
|
72
|
-
console.log('[SlideBoxContent] mode:', isFullMode);
|
|
73
73
|
const [templateName, setTemplateName] = useState('');
|
|
74
74
|
const [isTemplateNameEmpty, setIsTemplateNameEmpty] = useState(true);
|
|
75
75
|
const [selectedCreateMode, setSelectedCreateMode] = useState('');
|
|
@@ -103,9 +103,7 @@ const useEmailWrapper = ({
|
|
|
103
103
|
}, [onEnterTemplateName, onRemoveTemplateName]);
|
|
104
104
|
|
|
105
105
|
useEffect(() => () => {
|
|
106
|
-
|
|
107
|
-
emailActions.clearStoreValues();
|
|
108
|
-
}
|
|
106
|
+
emailActions.clearStoreValues();
|
|
109
107
|
}, []);
|
|
110
108
|
|
|
111
109
|
// Check BEE enabled status from API response
|
|
@@ -728,7 +726,6 @@ const useEmailWrapper = ({
|
|
|
728
726
|
location: routeParams,
|
|
729
727
|
route: { name: 'email' },
|
|
730
728
|
params: emailParams,
|
|
731
|
-
templateData,
|
|
732
729
|
isGetFormData,
|
|
733
730
|
getFormdata,
|
|
734
731
|
getFormSubscriptionData: getFormdata,
|