@capillarytech/creatives-library 8.0.209 → 8.0.210

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/config/app.js CHANGED
@@ -20,7 +20,8 @@ const config = {
20
20
  accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
21
21
  },
22
22
  development: {
23
- api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
23
+ // api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/creatives',
24
+ api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
24
25
  campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
25
26
  campaigns_api_org_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/org/campaign',
26
27
  auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.209",
4
+ "version": "8.0.210",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/services/api.js CHANGED
@@ -264,6 +264,7 @@ export const getUserData = () => {
264
264
 
265
265
  export const createTemplate = ({template}) => {
266
266
  const url = `${API_ENDPOINT}/templates/SMS`;
267
+ console.log("creating template",template);
267
268
  return request(url, getAPICallObject('POST', template));
268
269
  };
269
270
 
@@ -346,6 +347,7 @@ export const getAllTemplates = async ({channel, queryParams = {}}) => {
346
347
 
347
348
  export const deleteTemplate = ({channel, id}) => {
348
349
  const url = `${API_ENDPOINT}/templates/${id}/${channel}`;
350
+ console.log("deleting template", url);
349
351
  return request(url, getAPICallObject('DELETE'));
350
352
  //return API.deleteResource(url);
351
353
  };
@@ -155,21 +155,35 @@ describe('ContentOverlay', () => {
155
155
  it('applies overlay positioning styles', () => {
156
156
  render(<ContentOverlay />);
157
157
  const overlay = document.querySelector('.content-overlay');
158
- const styles = window.getComputedStyle(overlay);
159
- expect(styles.position).toBe('absolute');
160
- expect(styles.backgroundColor).toBeTruthy();
158
+ // Check that the overlay element exists and has the correct CSS class
159
+ expect(overlay).toBeInTheDocument();
160
+ expect(overlay).toHaveClass('content-overlay');
161
+ expect(overlay).toHaveClass('content-overlay--popup'); // default layout type is MODAL which maps to 'popup' class
162
+
163
+ // Check that inline styles from getOverlayStyles() are applied
164
+ const inlineStyles = overlay.style;
165
+ expect(inlineStyles.top).toBe('50%');
166
+ expect(inlineStyles.left).toBe('50%');
167
+ expect(inlineStyles.transform).toBe('translate(-50%, -50%)');
161
168
  });
162
169
 
163
- it('applies iframe styles when content present', () => {
170
+ it('does not apply inline iframe styles (SCSS-managed)', () => {
164
171
  render(<ContentOverlay content="<p>Test</p>" />);
165
172
  const iframe = document.querySelector('iframe');
166
- // Check inline styles directly as jsdom doesn't compute styles properly
167
- expect(iframe.style.width).toBe('100%');
168
- expect(iframe.style.height).toBe('100%');
169
- // border: 'none' might be converted to empty string by React/jsdom
170
- expect(['none', '']).toContain(iframe.style.border);
171
- expect(iframe.style.display).toBe('block');
172
- expect(iframe.style.backgroundColor).toBeTruthy();
173
+
174
+ // Verify iframe styling is managed by SCSS, not inline styles
175
+ // The iframe should have no inline style attribute since all styling
176
+ // (width: 100%, height: 100%, border: none, display: block, backgroundColor)
177
+ // is handled via the .content-overlay iframe CSS rule in _inAppPreviewPane.scss
178
+ expect(iframe.style.cssText).toBe('');
179
+ expect(iframe.hasAttribute('style')).toBe(false);
180
+
181
+ // Ensure no inline style properties are set
182
+ expect(iframe.style.width).toBe('');
183
+ expect(iframe.style.height).toBe('');
184
+ expect(iframe.style.border).toBe('');
185
+ expect(iframe.style.display).toBe('');
186
+ expect(iframe.style.backgroundColor).toBe('');
173
187
  });
174
188
  });
175
189
 
@@ -392,7 +392,9 @@ export function SlideBoxContent(props) {
392
392
  };
393
393
  }
394
394
  default:
395
+ {
395
396
  return get(templateDataObject, `versions.base.content`);
397
+ }
396
398
  }
397
399
  };
398
400
 
@@ -1755,7 +1755,9 @@ const splitTemplateVarString = (str) => {
1755
1755
 
1756
1756
  const uploadRcsImage = useCallback((file, type, fileParams, index) => {
1757
1757
  setImageError(null);
1758
+ const isRcsThumbnail = index === 1;
1758
1759
  actions.uploadRcsAsset(file, type, {
1760
+ isRcsThumbnail,
1759
1761
  ...fileParams,
1760
1762
  dimensionType: selectedDimension,
1761
1763
  orientation: RCS_IMAGE_DIMENSIONS[selectedDimension].orientation,
@@ -1711,6 +1711,7 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
1711
1711
  };
1712
1712
 
1713
1713
  const saveToMessage = () => {
1714
+ console.log("saveToMessage----> createPayload", createPayload());
1714
1715
  getFormData({
1715
1716
  value: createPayload(),
1716
1717
  _id: params?.id,