@capillarytech/creatives-library 9.0.41-alpha.1 → 9.0.41

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": "9.0.41-alpha.1",
4
+ "version": "9.0.41",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -9,6 +9,7 @@ import {
9
9
  getCarouselButtonsWithTitles,
10
10
  getCarouselButtonSlotCount,
11
11
  } from '../utils';
12
+ import { DEFAULT_CAROUSEL_TITLE_LINE_HEIGHT_PX } from '../constants';
12
13
 
13
14
  const ViberCarouselPreviewCards = ({ cards = [] }) => {
14
15
  const previewCards = Array.isArray(cards) && cards.length ? cards : [{}];
@@ -28,7 +29,7 @@ const ViberCarouselPreviewCards = ({ cards = [] }) => {
28
29
  return;
29
30
  }
30
31
  const { lineHeight } = window.getComputedStyle(node);
31
- const parsedLineHeight = parseFloat(lineHeight) || 18;
32
+ const parsedLineHeight = parseFloat(lineHeight) || DEFAULT_CAROUSEL_TITLE_LINE_HEIGHT_PX;
32
33
  const lines = Math.min(2, Math.max(1, Math.round(node?.scrollHeight / parsedLineHeight)));
33
34
  if (lines > maxLines) {
34
35
  maxLines = lines;
@@ -228,6 +228,8 @@ export const CHANNEL_NAME_MOBILE_PUSH = 'MOBILE_PUSH';
228
228
  export const DEFAULT_SENDER = 'test1';
229
229
  export const VIBER_API_SCENARIO_KEY = 'viber-api';
230
230
  export const VIBER_USER_ID_PATTERN = '{{viber_user_id}}';
231
+ /** Fallback title line-height (px) when computed style is unavailable. */
232
+ export const DEFAULT_CAROUSEL_TITLE_LINE_HEIGHT_PX = 18;
231
233
  export const UNSUBSCRIBE_TAG_NAME = 'unsubscribe';
232
234
  export const IN_APP_CHANNEL_NAME = 'in-app';
233
235
  export const MOBILE_PUSH_CHANNEL_NAME = 'mobile push';