@capillarytech/creatives-library 8.0.343-beta.1 → 8.0.344

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.343-beta.1",
4
+ "version": "8.0.344",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -698,9 +698,16 @@ export function SlideBoxContent(props) {
698
698
  {(isEditEmailWithId || isEmailEditWithContent) && (
699
699
  (() => {
700
700
  const supportCKEditor = commonUtil.hasSupportCKEditor();
701
- // When supportCKEditor is true: Use Email component (legacy flow with CKEditor).
702
- // When supportCKEditor is false: Always use EmailWrapper (BEE or HTML editor, never CKEditor).
703
- if (supportCKEditor) {
701
+ // BEE templates always use the <Email> component directly (the same
702
+ // path the SUPPORT_CK_EDITOR=true branch uses). EmailWrapper's
703
+ // useEmailWrapper strips templateData from props, so library-mode
704
+ // pencil-edit on a BEE template would never reach startTemplateCreation
705
+ // and getDetails?type=BEE_PLUGIN would never fire. Routing BEE
706
+ // templates through the direct <Email> path — which is already
707
+ // battle-tested for the CKEditor flow — sidesteps that entirely.
708
+ const isBEETemplate = templateData?.base?.is_drag_drop === true
709
+ || templateData?.base?.is_drag_drop === 1;
710
+ if (supportCKEditor || isBEETemplate) {
704
711
  return (
705
712
  <Email
706
713
  key="cretives-container-email-edit"
@@ -120,9 +120,8 @@ exports[`Test SlideBoxContent container Email component isTestAndPreviewMode IIF
120
120
  key="cretives-container-email-edit-wrapper"
121
121
  location={
122
122
  Object {
123
- "pathname": "/email/edit/undefined",
123
+ "pathname": "/email/edit/",
124
124
  "query": Object {
125
- "id": undefined,
126
125
  "module": "library",
127
126
  "type": "embedded",
128
127
  },
@@ -171,9 +170,8 @@ exports[`Test SlideBoxContent container Email component isTestAndPreviewMode IIF
171
170
  key="cretives-container-email-edit-wrapper"
172
171
  location={
173
172
  Object {
174
- "pathname": "/email/edit/undefined",
173
+ "pathname": "/email/edit/",
175
174
  "query": Object {
176
- "id": undefined,
177
175
  "module": "library",
178
176
  "type": "embedded",
179
177
  },
@@ -102,6 +102,10 @@ const useEmailWrapper = ({
102
102
  }
103
103
  }, [onEnterTemplateName, onRemoveTemplateName]);
104
104
 
105
+ useEffect(() => () => {
106
+ emailActions.clearStoreValues();
107
+ }, []);
108
+
105
109
  // Check BEE enabled status from API response
106
110
  // BEE is enabled if isDragDrop is true in the API response
107
111
  // This should work for both full mode and library mode
@@ -125,6 +125,7 @@ describe('useEmailWrapper - Edge Cases', () => {
125
125
  getCmsAccounts: jest.fn(),
126
126
  getTemplateDetails: jest.fn(),
127
127
  getCmsSetting: jest.fn(),
128
+ clearStoreValues: jest.fn(),
128
129
  },
129
130
  Email: {
130
131
  isBeeEnabled: undefined,
@@ -79,6 +79,12 @@ describe('useEmailWrapper', () => {
79
79
  setEdmTemplate: jest.fn(),
80
80
  setBEETemplate: jest.fn(),
81
81
  },
82
+ emailActions: {
83
+ getCmsAccounts: jest.fn(),
84
+ getTemplateDetails: jest.fn(),
85
+ getCmsSetting: jest.fn(),
86
+ clearStoreValues: jest.fn(),
87
+ },
82
88
  EmailLayout: null,
83
89
  CmsTemplates: null,
84
90
  SelectedEdmDefaultTemplate: null,
@@ -650,6 +656,7 @@ describe('useEmailWrapper', () => {
650
656
  mockEmailActions = {
651
657
  getTemplateDetails: jest.fn(),
652
658
  getCmsAccounts: jest.fn(),
659
+ clearStoreValues: jest.fn(),
653
660
  };
654
661
 
655
662
  newFlowMockProps = {