@capillarytech/creatives-library 9.0.0 → 9.0.2-beta.0

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.0",
4
+ "version": "9.0.2-beta.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -33,6 +33,7 @@
33
33
  }
34
34
  .creatives-inapp-message {
35
35
  margin-top : $CAP_SPACE_12;
36
+ position: relative;
36
37
  .inapp-message-header {
37
38
  display: flex;
38
39
  align-items: center;
@@ -51,9 +52,9 @@
51
52
  }
52
53
  .cap-custom-image-upload {
53
54
  .dragger-button.re-upload {
54
- top: 13rem;
55
+ top: 15.8rem;
55
56
  position: absolute;
56
- right: -1rem;
57
+ margin-left: 20vw;
57
58
  color: $FONT_COLOR_05;
58
59
  }
59
60
  }
@@ -2671,7 +2671,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2671
2671
  document.querySelector(`#${parentID} #fileName`).click();
2672
2672
  };
2673
2673
  handleOk = (ev) => {
2674
- const id = ev.target.id;
2674
+ // antd v6 wraps button text in a <span>; use currentTarget so the button id resolves.
2675
+ const id = (ev.currentTarget && ev.currentTarget.id) || ev.target.id;
2675
2676
  this.setState({showModal: false});
2676
2677
  if (id === "android" && this.state.androidValid) {
2677
2678
  this.onSubmitWrapper({singleTab: id});
@@ -2706,7 +2707,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
2706
2707
  }
2707
2708
  };
2708
2709
  handleCancel = (ev) => {
2709
- const id = ev.target.id;
2710
+ // antd v6 wraps button text in a <span>; use currentTarget so the button id resolves.
2711
+ const id = (ev.currentTarget && ev.currentTarget.id) || ev.target.id;
2710
2712
  this.setState({showModal: false});
2711
2713
  if (id === 'template-back-confirm-modal') {
2712
2714
  const response = {
@@ -644,7 +644,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
644
644
  src={smsMobileAndroid}
645
645
  alt={this.props.intl.formatMessage(messages.previewGenerated)}
646
646
  />
647
- <CapRow useLegacy className="msg-container sms">
647
+ <CapRow className="msg-container sms">
648
648
  <CapRow useLegacy className={"message-pop sms"}>
649
649
  {content &&
650
650
  content.length &&
@@ -1187,6 +1187,11 @@
1187
1187
  gap: $CAP_SPACE_12;
1188
1188
  flex-shrink: 0;
1189
1189
  margin-right: $CAP_SPACE_32;
1190
+
1191
+ .archive-template-button {
1192
+ column-gap: $CAP_SPACE_12;
1193
+ align-items: center;
1194
+ }
1190
1195
  }
1191
1196
 
1192
1197
  .archived-mode-header {
@@ -2719,7 +2719,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
2719
2719
  </CapLabel>
2720
2720
  <CapButton
2721
2721
  type="primary"
2722
- prefix={<CapIcon type="archive" size="m" />}
2722
+ className="archive-template-button"
2723
+ prefix={<CapIcon type="archive" size="s" />}
2723
2724
  onClick={() => this.handleBulkArchiveAction({ ids: selectedIdsArrayLocal, count: selectedCountLocal, isUnarchive: isArchivedModeLocal })}
2724
2725
  >
2725
2726
  <span className="archive-btn-label">
@@ -890,7 +890,7 @@ export class MapTemplates extends React.Component { // eslint-disable-line react
890
890
  }
891
891
 
892
892
  getMappedEvent(id, event) {
893
- return (this.state.map[id] && this.state.map[id][event] ? this.state.map[id][event] : () => {});
893
+ return this.state.map[id]?.[event] ?? (() => {});
894
894
  }
895
895
 
896
896
  handleOnTagsContextChange = (data) => {
@@ -963,18 +963,22 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
963
963
  <CapLabel>{formatMessage(messages.ctaDesc)}</CapLabel>
964
964
  </div>
965
965
  {isBtnTypeCta && (
966
- <CapWhatsappCTA
967
- ctaData={ctaData}
968
- updateHandler={updateHandler}
969
- deleteHandler={deleteHandler}
970
- isEditFlow={isEditFlow}
971
- hostName={host}
972
- tags={tags || []}
973
- injectedTags={injectedTags || {}}
974
- selectedOfferDetails={selectedOfferDetails}
975
- eventContextTags={eventContextTags}
976
- waitEventContextTags={waitEventContextTags}
977
- />
966
+ // Panel sits inside the radio option's <label>; preventDefault stops the
967
+ // <label> re-dispatching chevron-icon clicks to the radio (focus-steal → dropdown flicker).
968
+ <div role="presentation" onClick={(e) => e.preventDefault()}>
969
+ <CapWhatsappCTA
970
+ ctaData={ctaData}
971
+ updateHandler={updateHandler}
972
+ deleteHandler={deleteHandler}
973
+ isEditFlow={isEditFlow}
974
+ hostName={host}
975
+ tags={tags || []}
976
+ injectedTags={injectedTags || {}}
977
+ selectedOfferDetails={selectedOfferDetails}
978
+ eventContextTags={eventContextTags}
979
+ waitEventContextTags={waitEventContextTags}
980
+ />
981
+ </div>
978
982
  )}
979
983
  </>
980
984
  ),
@@ -990,12 +994,16 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
990
994
  <CapLabel>{formatMessage(messages.quickReplyDesc)}</CapLabel>
991
995
  </div>
992
996
  {isBtnTypeQuickReply && (
993
- <CapWhatsappQuickReply
994
- quickReplyData={quickReplyData}
995
- isEditFlow={isEditFlow}
996
- renderMessageLength={renderMessageLength}
997
- setQuickReplyData={setQuickReplyData}
998
- />
997
+ // Same label-forwarding guard as the CTA panel: this is nested inside the
998
+ // radio option's <label>, so cancel the synthetic click it would send to the radio.
999
+ <div role="presentation" onClick={(e) => e.preventDefault()}>
1000
+ <CapWhatsappQuickReply
1001
+ quickReplyData={quickReplyData}
1002
+ isEditFlow={isEditFlow}
1003
+ renderMessageLength={renderMessageLength}
1004
+ setQuickReplyData={setQuickReplyData}
1005
+ />
1006
+ </div>
999
1007
  )}
1000
1008
  </>
1001
1009
  ),
@@ -34,6 +34,7 @@
34
34
 
35
35
  .zalo-warning-message-label {
36
36
  display: flex;
37
+ align-items: center;
37
38
  }
38
39
 
39
40
  .alert-icon-zalo {