@capillarytech/creatives-library 8.0.226 → 8.0.228

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.226",
4
+ "version": "8.0.228",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -235,7 +235,7 @@ export const checkIfSupportedTag = (checkingTag, injectedTags) => {
235
235
  });
236
236
 
237
237
  return result;
238
- };
238
+ }
239
239
 
240
240
  const indexOfEnd = (targetString, string) => {
241
241
  let io = targetString.indexOf(string);
@@ -4,10 +4,11 @@ export const UPLOAD = 'upload';
4
4
  export const USE_EDITOR = 'useEditor';
5
5
  export const COPY_PRIMARY_LANGUAGE = 'copyPrimaryLanguage';
6
6
  export const GLOBAL_CONVERT_OPTIONS = {
7
- selectors: [
8
- ...[1, 2, 3, 4, 5, 6].map(level => ({
9
- selector: `h${level}`,
10
- options: { uppercase: false }
11
- }))
12
- ]
13
- };
7
+ wordwrap: null,
8
+ selectors: [
9
+ ...[1, 2, 3, 4, 5, 6].map((level) => ({
10
+ selector: `h${level}`,
11
+ options: { uppercase: false },
12
+ })),
13
+ ],
14
+ };
@@ -54,7 +54,7 @@ import { containsBase64Images } from '../../utils/content';
54
54
  import { SMS, MOBILE_PUSH, LINE, ENABLE_AI_SUGGESTIONS,AI_CONTENT_BOT_DISABLED, EMAIL, LIQUID_SUPPORTED_CHANNELS, INAPP } from '../../v2Containers/CreativesContainer/constants';
55
55
  import globalMessages from '../../v2Containers/Cap/messages';
56
56
  import { convert } from 'html-to-text';
57
- import { OUTBOUND, ADD_LANGUAGE, UPLOAD, USE_EDITOR, COPY_PRIMARY_LANGUAGE } from './constants';
57
+ import { OUTBOUND, ADD_LANGUAGE, UPLOAD, USE_EDITOR, COPY_PRIMARY_LANGUAGE, GLOBAL_CONVERT_OPTIONS } from './constants';
58
58
  import { GET_TRANSLATION_MAPPED } from '../../constants/unified';
59
59
  import moment from 'moment';
60
60
  import { CUSTOMER_BARCODE_TAG , COPY_OF, ENTRY_TRIGGER_TAG_REGEX, SKIP_TAGS_REGEX_GROUPS} from '../../constants/unified';
@@ -1491,6 +1491,16 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1491
1491
  if (tag?.match(ENTRY_TRIGGER_TAG_REGEX)) {
1492
1492
  return false;
1493
1493
  }
1494
+
1495
+ // Skip specific tags for email channel
1496
+ const isEmailChannel = this.props?.schema?.channel?.toUpperCase() === EMAIL;
1497
+ if (isEmailChannel) {
1498
+ const emailSkipTags = ['image', 'info', 'teaser', 'desc'];
1499
+ if (emailSkipTags.includes(tag?.toLowerCase())) {
1500
+ return true;
1501
+ }
1502
+ }
1503
+
1494
1504
  // Use some() to check if any pattern matches (stops on first match)
1495
1505
  return SKIP_TAGS_REGEX_GROUPS.some((group) => {
1496
1506
  // Create a new RegExp for each test to avoid state issues with global flag
@@ -1516,7 +1526,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1516
1526
  response.unsupportedTags = [];
1517
1527
  response.isBraceError = false;
1518
1528
  response.isContentEmpty = false;
1519
- const contentForValidation = isEmail ? convert(content) : content ;
1529
+ const contentForValidation = isEmail ? convert(content, GLOBAL_CONVERT_OPTIONS) : content ;
1520
1530
  if(tags && tags.length) {
1521
1531
  _.forEach(tags, (tag) => {
1522
1532
  _.forEach(tag.definition.supportedModules, (module) => {