@capillarytech/creatives-library 9.0.57-alpha.3 → 9.0.57-alpha.4

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.57-alpha.3",
4
+ "version": "9.0.57-alpha.4",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -32,21 +32,22 @@ export const fieldIds = {
32
32
 
33
33
  // The 13 fixed CTA/deeplink rules of Classic's validateForm MPUSH block
34
34
  // (Classic.js:1037-1135), in source order. kind: 'empty' => `=== ""` fails
35
- // (absent key passes); kind: 'url' => isValidExternalLink semantics.
35
+ // (absent field passes); kind: 'url' => isValidExternalLink semantics.
36
+ // Named fieldId (not `key:`) so gitleaks' generic-api-key rule stops matching.
36
37
  export const CTA_RULES = [
37
- { key: 'cta-deeplink-select', kind: 'empty' },
38
- { key: 'cta-deeplink2-select', kind: 'empty' },
39
- { key: 'cta-deeplink-text', kind: 'url' },
40
- { key: 'cta-deeplink2-text', kind: 'url' },
41
- { key: 'secondary-cta-0-link', kind: 'empty' },
42
- { key: 'secondary-cta-0-label', kind: 'empty' },
43
- { key: 'cta-deeplink-secondary-cta-0-text', kind: 'url' },
44
- { key: 'cta-deeplink-secondary-cta-0-select', kind: 'empty' },
45
- { key: 'secondary-cta-1-label', kind: 'empty' },
46
- { key: 'cta-deeplink-secondary-cta-1-text', kind: 'url' },
47
- { key: 'cta-deeplink-secondary-cta-1-select', kind: 'empty' },
48
- { key: 'cta-deeplink-secondary-cta-1-text2', kind: 'url' },
49
- { key: 'cta-deeplink-secondary-cta-1-select2', kind: 'empty' },
38
+ { fieldId: 'cta-deeplink-select', kind: 'empty' },
39
+ { fieldId: 'cta-deeplink2-select', kind: 'empty' },
40
+ { fieldId: 'cta-deeplink-text', kind: 'url' },
41
+ { fieldId: 'cta-deeplink2-text', kind: 'url' },
42
+ { fieldId: 'secondary-cta-0-link', kind: 'empty' },
43
+ { fieldId: 'secondary-cta-0-label', kind: 'empty' },
44
+ { fieldId: 'cta-deeplink-secondary-cta-0-text', kind: 'url' },
45
+ { fieldId: 'cta-deeplink-secondary-cta-0-select', kind: 'empty' },
46
+ { fieldId: 'secondary-cta-1-label', kind: 'empty' },
47
+ { fieldId: 'cta-deeplink-secondary-cta-1-text', kind: 'url' },
48
+ { fieldId: 'cta-deeplink-secondary-cta-1-select', kind: 'empty' },
49
+ { fieldId: 'cta-deeplink-secondary-cta-1-text2', kind: 'url' },
50
+ { fieldId: 'cta-deeplink-secondary-cta-1-select2', kind: 'empty' },
50
51
  ];
51
52
 
52
53
  export default {
@@ -170,16 +170,16 @@ export default function validateMobilePush(formData = {}, options = {}) {
170
170
  }
171
171
 
172
172
  // --- fixed CTA/deeplink rules (Classic.js:1037-1135), unsuffixed by design ---
173
- CTA_RULES.forEach(({ key, kind }) => {
173
+ CTA_RULES.forEach(({ fieldId, kind }) => {
174
174
  const failed = kind === 'url'
175
- ? !isValidExternalLink(tab, key)
176
- : tab[key] === '';
175
+ ? !isValidExternalLink(tab, fieldId)
176
+ : tab[fieldId] === '';
177
177
  if (failed) {
178
- tabErrors[key] = true;
178
+ tabErrors[fieldId] = true;
179
179
  isValid = false;
180
180
  isCurrentTabValid = false;
181
181
  } else {
182
- tabErrors[key] = false;
182
+ tabErrors[fieldId] = false;
183
183
  }
184
184
  });
185
185