@capillarytech/creatives-library 9.0.51-alpha.0 → 9.0.52

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.51-alpha.0",
4
+ "version": "9.0.52",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -2287,7 +2287,7 @@ export class Creatives extends React.Component {
2287
2287
  const isJourneyModule = (this.props.messageDetails?.type || '').toLowerCase() === constants.JOURNEY;
2288
2288
  if (!isFullMode && isJourneyModule) {
2289
2289
  const currentChannelNorm = (currentChannel || '').toLowerCase();
2290
- const journeyChannelsToHide = ['wechat'].filter((ch) => ch !== currentChannelNorm);
2290
+ const journeyChannelsToHide = [constants.WECHAT.toLowerCase()].filter((ch) => ch !== currentChannelNorm);
2291
2291
  updatedChannelsToHide = [...new Set([...updatedChannelsToHide, ...journeyChannelsToHide])];
2292
2292
  }
2293
2293
 
@@ -198,12 +198,6 @@ export const buildCarouselCardContentForPayload = (carouselData, {
198
198
  const titleTokens = cardTitle.match(rcsVarRegex) ?? [];
199
199
  const descTokens = cardDescription.match(rcsVarRegex) ?? [];
200
200
  if (titleTokens.length > 0 || descTokens.length > 0) {
201
- // The persisted API contract requires every {{...}} in title/description to be a plain
202
- // numeric slot ({{1}}, {{2}}, …) — the actual tag/value belongs only in cardVarMapped. A
203
- // slot can still hold a non-numeric/legacy token here (hand-typed, or picked before this
204
- // card had a numeric slot for it) since the carousel tag-picker never rewrites card text.
205
- // Rename only those to the next free number for this card, leaving already-numeric slots
206
- // (and the card's normal case) untouched.
207
201
  const usedNumbers = new Set(
208
202
  [...titleTokens, ...descTokens]
209
203
  .map(getVarNameFromToken)
@@ -1569,12 +1569,6 @@ export const Rcs = (props) => {
1569
1569
  if (isNumericPlaceholderSlot) return;
1570
1570
 
1571
1571
  if (tagAreaField === RCS_TAG_AREA_FIELD_TITLE || tagAreaField === RCS_TAG_AREA_FIELD_DESC) {
1572
- // Legacy slot that already holds a named tag (e.g. {{first_name}}) is replaced by
1573
- // field-local position, since a name-based replace would also overwrite other slots
1574
- // sharing that same tag name. The persisted API contract requires title/description to
1575
- // only ever contain {{1}}, {{2}}, … — the actual tag lives in cardVarMapped (written
1576
- // above) — so normalize the slot text to its numeric token instead of re-embedding the
1577
- // tag name, self-healing any legacy/hand-typed token the moment it's touched here.
1578
1572
  const fieldOffsetForSlot = tagAreaField === RCS_TAG_AREA_FIELD_TITLE
1579
1573
  ? 0
1580
1574
  : (templateTitle?.match(rcsVarRegex) ?? []).length;
@@ -359,15 +359,6 @@ export function resolveRcsCardPreviewStrings(
359
359
  };
360
360
  }
361
361
 
362
- /**
363
- * Campaign consumer payload: pass each card's `title` / `description` through unchanged — per the
364
- * API contract (see `createPayload`), they only ever contain sequential numeric slot placeholders
365
- * (`{{1}}`, `{{2}}`, …), never a tag name or literal value baked into the text. Personalization tag
366
- * references and literal values alike live solely in the emitted `cardVarMapped`, so the backend
367
- * resolves every slot from that map. `cardVarMapped` is filtered to this card's own numeric/semantic
368
- * entries via `pickRcsCardVarMappedEntries` (drops stray/SMS-fallback keys). Text-only cards
369
- * (`mediaType` NONE/TEXT) never surface a title to consumers, matching the editor's own display.
370
- */
371
362
  export function mapRcsCardContentForConsumerWithResolvedTags(cardContentArray) {
372
363
  const list = Array.isArray(cardContentArray) ? cardContentArray : [];
373
364
  return list.map((card) => {
@@ -473,7 +473,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
473
473
 
474
474
  // opening the create slidebox based on query params
475
475
  const queryItems = getObjFromQueryParams(location.search);
476
- if ([INAPP_LOWERCASE, WHATSAPP_LOWERCASE].includes(queryItems.channel) && queryItems.mode === CREATE) {
476
+ if ([INAPP_LOWERCASE, WHATSAPP_LOWERCASE, RCS_LOWERCASE].includes(queryItems.channel) && queryItems.mode === CREATE) {
477
477
  this.createTemplate();
478
478
  }
479
479
 
@@ -219,8 +219,8 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
219
219
 
220
220
  componentDidMount() {
221
221
  const queryItems = getObjFromQueryParams(location.search);
222
- if (queryItems.channel === WHATSAPP) {
223
- this.channelChange(WHATSAPP);
222
+ if ([WHATSAPP, RCS].includes(queryItems.channel)) {
223
+ this.channelChange(queryItems.channel);
224
224
  }
225
225
  if (this.props?.isFullMode) {
226
226
  this.props.templateActions.getCdnTransformationConfig();