@antscorp/antsomi-ui 2.0.114 → 2.0.116

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.
Files changed (48) hide show
  1. package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.d.ts +5 -0
  2. package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.js +15 -0
  3. package/es/components/atoms/SelectAssociatedTag/SelectTag.d.ts +4 -0
  4. package/es/components/atoms/SelectAssociatedTag/SelectTag.js +26 -0
  5. package/es/components/atoms/SelectAssociatedTag/constants.d.ts +11 -0
  6. package/es/components/atoms/SelectAssociatedTag/constants.js +42 -0
  7. package/es/components/atoms/SelectAssociatedTag/index.d.ts +3 -0
  8. package/es/components/atoms/SelectAssociatedTag/index.js +2 -0
  9. package/es/components/atoms/SelectAssociatedTag/styled.d.ts +7 -0
  10. package/es/components/atoms/SelectAssociatedTag/styled.js +60 -0
  11. package/es/components/atoms/SelectAssociatedTag/types.d.ts +76 -0
  12. package/es/components/atoms/SelectAssociatedTag/types.js +1 -0
  13. package/es/components/atoms/index.d.ts +1 -0
  14. package/es/components/atoms/index.js +1 -0
  15. package/es/components/icons/CircleInfoIcon.js +2 -2
  16. package/es/components/icons/LazyIcon/LazyIcon.d.ts +2 -0
  17. package/es/components/icons/LazyIcon/LazyIcon.js +2 -0
  18. package/es/components/molecules/AddDynamicContent/styled.d.ts +12 -1
  19. package/es/components/molecules/DisplayFormat/styled.d.ts +12 -1
  20. package/es/components/molecules/InputSelectAttribute/index.d.ts +25 -0
  21. package/es/components/molecules/InputSelectAttribute/index.js +124 -0
  22. package/es/components/molecules/InputSelectAttribute/styled.d.ts +14 -0
  23. package/es/components/molecules/InputSelectAttribute/styled.js +33 -0
  24. package/es/components/molecules/Modal/Modal.d.ts +11 -11
  25. package/es/components/molecules/Modal/Modal.js +11 -9
  26. package/es/components/molecules/Select/Select.js +1 -1
  27. package/es/components/molecules/SelectV2/styled.d.ts +3 -1
  28. package/es/components/molecules/SelectV2/styled.js +2 -2
  29. package/es/components/molecules/TagifyInput/TagifyInput.js +159 -71
  30. package/es/components/molecules/TagifyInput/constants.d.ts +24 -2
  31. package/es/components/molecules/TagifyInput/constants.js +25 -2
  32. package/es/components/molecules/TagifyInput/patternHandlers.d.ts +12 -6
  33. package/es/components/molecules/TagifyInput/patternHandlers.js +88 -43
  34. package/es/components/molecules/TagifyInput/types.d.ts +24 -3
  35. package/es/components/molecules/TagifyInput/utils.d.ts +10 -1
  36. package/es/components/molecules/TagifyInput/utils.js +82 -4
  37. package/es/components/molecules/TagifyInput/utils.style.js +81 -96
  38. package/es/components/molecules/index.d.ts +1 -0
  39. package/es/components/molecules/index.js +1 -0
  40. package/es/components/organism/AccountSharing/AccountSharing.js +18 -10
  41. package/es/components/organism/ActivityTimeline/utils.js +168 -2
  42. package/es/components/organism/LeftMenu/components/HomeMenu/styled.d.ts +12 -1
  43. package/es/components/organism/LeftMenu/hooks/usePermission.js +1 -1
  44. package/es/components/organism/LeftMenu/utils/index.js +1 -1
  45. package/es/components/organism/PreviewTemplateModal/styled.d.ts +12 -1
  46. package/es/components/organism/SQLGeneration/components/styled.d.ts +12 -1
  47. package/es/utils/cookie.js +9 -0
  48. package/package.json +6 -6
@@ -3,7 +3,7 @@ import { css } from 'styled-components';
3
3
  import { isString } from 'lodash';
4
4
  // Constants
5
5
  import { globalToken } from '@antscorp/antsomi-ui/es/constants';
6
- import { DETECT_LINK, EMOJI, INVALID_TAG, MIN_H_WRAPPER, NO_VIEW_TAG, READONLY_TAG, REMOVED_TAG, SHORT_LINK, SHORT_LINK_TYPE, SHORT_LINK_V2, TAG_COLOR, TAG_H, TAG_TYPE, } from './constants';
6
+ import { DETECT_LINK, EMOJI, ERROR_TAG, MIN_H_WRAPPER, READONLY_TAG, SHORT_LINK, SHORT_LINK_TYPE, SHORT_LINK_V2, TAG_COLOR, TAG_H, TAG_TYPE, WARNING_TAG, TAG_TYPE_LIST, PREPARING_ST, } from './constants';
7
7
  export const getTagifyStyled = ({ $maxHeight, $tagifyFullWidth }) => css `
8
8
  ${$maxHeight &&
9
9
  css `
@@ -55,62 +55,62 @@ export const getTagifyInputStyled = ({ $minWidth, $placeholder, $minWidthPlaceho
55
55
 
56
56
  ${$isSingleLineText &&
57
57
  css `
58
- white-space: nowrap;
59
- overflow: auto;
58
+ white-space: nowrap;
59
+ overflow: auto;
60
60
 
61
- br {
62
- display: none;
63
- }
61
+ br {
62
+ display: none;
63
+ }
64
64
 
65
- div, p {
66
- display: inline-block;
67
- white-space: nowrap;
68
- overflow: auto
69
- overflow-y: hidden;
70
- }
71
- `}
65
+ div,
66
+ p {
67
+ display: inline-block;
68
+ white-space: nowrap;
69
+ }
70
+ `}
72
71
  `;
73
- export const getStyledTags = () => {
74
- const getBackgroundColor = (tag) => {
75
- const { type } = tag;
76
- switch (type) {
77
- case TAG_TYPE.SHORT_LINK: {
78
- const { shortlinkType } = tag;
79
- if (!shortlinkType)
80
- break;
81
- return TAG_COLOR[SHORT_LINK][shortlinkType];
82
- }
83
- case TAG_TYPE.SHORT_LINK_V2: {
84
- const { shortlinkType } = tag;
85
- if (!shortlinkType)
86
- break;
87
- return TAG_COLOR[SHORT_LINK_V2][shortlinkType];
88
- }
89
- default: {
90
- if (!type)
91
- return 'white';
92
- return TAG_COLOR[type];
93
- }
72
+ const getBackgroundColor = (tag) => {
73
+ const { type } = tag;
74
+ switch (type) {
75
+ case TAG_TYPE.SHORT_LINK: {
76
+ const { shortlinkType } = tag;
77
+ if (!shortlinkType)
78
+ break;
79
+ return TAG_COLOR[SHORT_LINK][shortlinkType];
94
80
  }
95
- return null;
96
- };
97
- const tagTypes = Object.values(TAG_TYPE);
98
- const backgroundStyles = tagTypes
99
- .map(type => {
100
- const background = getBackgroundColor({ type });
101
- if (!background)
102
- return '';
103
- return `
104
- &[data-tag-type~='${type}'] {
105
- background: ${getBackgroundColor({ type })};
106
- };
107
- `;
108
- })
109
- .join(' ');
81
+ case TAG_TYPE.SHORT_LINK_V2: {
82
+ const { shortlinkType } = tag;
83
+ if (!shortlinkType)
84
+ break;
85
+ return TAG_COLOR[SHORT_LINK_V2][shortlinkType];
86
+ }
87
+ default: {
88
+ if (!type)
89
+ return 'white';
90
+ return TAG_COLOR[type];
91
+ }
92
+ }
93
+ return null;
94
+ };
95
+ const tagListString = TAG_TYPE_LIST.map(tagType => `[data-tag-type~='${tagType}']`).join(',');
96
+ const backgroundStyles = TAG_TYPE_LIST.map(type => {
97
+ const background = getBackgroundColor({ type });
98
+ if (!background)
99
+ return '';
110
100
  return `
101
+ &[data-tag-type~='${type}'] {
102
+ background: ${background};
103
+ }
104
+
105
+ &[data-priority-color-type~='${type}'][data-bg-color-personalize-type~='${type}'] {
106
+ background: ${background};
107
+ }
108
+ `;
109
+ }).join(' ');
110
+ export const getStyledTags = () => `
111
111
  // For case unknown tag
112
112
  &[data-tag-type]:not(:is(
113
- ${tagTypes.map(tagType => `[data-tag-type~='${tagType}']`).join(',')}
113
+ ${tagListString}
114
114
  )) {
115
115
  background: ${globalToken?.accent7};
116
116
  };
@@ -122,45 +122,60 @@ export const getStyledTags = () => {
122
122
  padding: 0;
123
123
  };
124
124
 
125
+ &[data-tag-type~='${DETECT_LINK}'] {
126
+ border-radius: unset;
127
+ max-height: fit-content;
128
+
129
+ .tagify__tag-text {
130
+ max-width: fit-content;
131
+ white-space: normal;
132
+ }
133
+ };
134
+
125
135
  &[data-tag-type~='${TAG_TYPE.SHORT_LINK}'] {
126
136
  &[data-tag-${TAG_TYPE.SHORT_LINK}-type~='${SHORT_LINK_TYPE.INDIVIDUAL}'] {
127
137
  background: ${getBackgroundColor({
128
- type: TAG_TYPE.SHORT_LINK,
129
- shortlinkType: SHORT_LINK_TYPE.INDIVIDUAL,
130
- })};
138
+ type: TAG_TYPE.SHORT_LINK,
139
+ shortlinkType: SHORT_LINK_TYPE.INDIVIDUAL,
140
+ })};
131
141
  };
132
142
 
133
143
  &[data-tag-${TAG_TYPE.SHORT_LINK}-type~='${SHORT_LINK_TYPE.GENERAL}'] {
134
144
  background: ${getBackgroundColor({
135
- type: TAG_TYPE.SHORT_LINK,
136
- shortlinkType: SHORT_LINK_TYPE.GENERAL,
137
- })};
145
+ type: TAG_TYPE.SHORT_LINK,
146
+ shortlinkType: SHORT_LINK_TYPE.GENERAL,
147
+ })};
138
148
  };
139
149
  }
140
150
 
141
151
  &[data-tag-type~='${TAG_TYPE.SHORT_LINK_V2}'] {
142
152
  &[data-tag-${TAG_TYPE.SHORT_LINK_V2}-type~='${SHORT_LINK_TYPE.INDIVIDUAL}'] {
143
153
  background: ${getBackgroundColor({
144
- type: TAG_TYPE.SHORT_LINK_V2,
145
- shortlinkType: SHORT_LINK_TYPE.INDIVIDUAL,
146
- })};
154
+ type: TAG_TYPE.SHORT_LINK_V2,
155
+ shortlinkType: SHORT_LINK_TYPE.INDIVIDUAL,
156
+ })};
147
157
  };
148
158
 
149
159
  &[data-tag-${TAG_TYPE.SHORT_LINK_V2}-type~='${SHORT_LINK_TYPE.GENERAL}'] {
150
160
  background: ${getBackgroundColor({
151
- type: TAG_TYPE.SHORT_LINK_V2,
152
- shortlinkType: SHORT_LINK_TYPE.GENERAL,
153
- })};
161
+ type: TAG_TYPE.SHORT_LINK_V2,
162
+ shortlinkType: SHORT_LINK_TYPE.GENERAL,
163
+ })};
154
164
  };
155
165
  }
156
166
  `;
157
- };
158
167
  export const getTagifyTagStyled = (_wrapperProps) => css `
159
- &[${READONLY_TAG}='true'] {
168
+ &[type='${DETECT_LINK}'] {
169
+ max-width: fit-content;
170
+ height: fit-content;
171
+ }
172
+
173
+ &[${READONLY_TAG}='true'],
174
+ &[${PREPARING_ST}='true'] {
160
175
  cursor: not-allowed;
161
176
  }
162
177
 
163
- &[${REMOVED_TAG}='true'] {
178
+ &[${ERROR_TAG}='true'] {
164
179
  ${({ $tagErrorIcon }) => $tagErrorIcon &&
165
180
  css `
166
181
  > div {
@@ -190,7 +205,7 @@ export const getTagifyTagStyled = (_wrapperProps) => css `
190
205
  `}
191
206
  }
192
207
 
193
- &[${NO_VIEW_TAG}='true'] {
208
+ &[${WARNING_TAG}='true'] {
194
209
  ${({ $tagInvalidIcon }) => $tagInvalidIcon &&
195
210
  css `
196
211
  > div {
@@ -220,36 +235,6 @@ export const getTagifyTagStyled = (_wrapperProps) => css `
220
235
  `}
221
236
  }
222
237
 
223
- &[${INVALID_TAG}='true'] {
224
- ${({ $tagInvalidIcon }) => $tagInvalidIcon &&
225
- css `
226
- > div {
227
- padding-right: 22px;
228
- position: relative;
229
-
230
- > span {
231
- &::after {
232
- content: '';
233
- position: absolute;
234
- top: 50%;
235
- right: 5px;
236
- transform: translateY(calc(-50% - 1px));
237
- width: 14px;
238
- height: 14px;
239
- display: inline-block;
240
- background-image: url(${$tagInvalidIcon});
241
- background-size: contain;
242
- background-repeat: no-repeat;
243
- }
244
- }
245
- }
246
- > div[data-tag-type] {
247
- background-color: white !important;
248
- border: 1px solid red;
249
- }
250
- `}
251
- }
252
-
253
238
  height: ${TAG_H}px;
254
239
  cursor: pointer;
255
240
 
@@ -69,6 +69,7 @@ export * from './EmojiCollections';
69
69
  export * from './EmojiPopover';
70
70
  export * from './DisplayFormat';
71
71
  export * from './CodeStructure';
72
+ export { default as InputSelectAttribute } from './InputSelectAttribute';
72
73
  export * from './FontSizeInput';
73
74
  export * from './ItemNotFound';
74
75
  export { EditorScript } from './EditorScript';
@@ -69,6 +69,7 @@ export * from './EmojiCollections';
69
69
  export * from './EmojiPopover';
70
70
  export * from './DisplayFormat';
71
71
  export * from './CodeStructure';
72
+ export { default as InputSelectAttribute } from './InputSelectAttribute';
72
73
  export * from './FontSizeInput';
73
74
  export * from './ItemNotFound';
74
75
  export { EditorScript } from './EditorScript';
@@ -159,21 +159,29 @@ export const AccountSharing = props => {
159
159
  return arrMenus;
160
160
  };
161
161
  const checkRedirectHomePage = (homePage, data, userId, newNetworkId) => {
162
- const convertedHomePage = String(homePage).replace(/:user_id/g, userId);
162
+ const newHomePage = String(homePage).replace(/:user_id/g, userId);
163
163
  if (!Array.isArray(data) || !data.length) {
164
- window.location.href = convertedHomePage;
164
+ window.location.href = newHomePage;
165
165
  return;
166
166
  }
167
167
  const arrMenus = buildListAppMenus(data, userId);
168
- if (!arrMenus.some(url => convertedHomePage.includes(url))) {
169
- // Redirect to recommendation
170
- if (env !== ENV.DEV) {
171
- window.location.assign(`${CDP_ROUTE[env || 'development']}/gen2/${newNetworkId}/dashboard/recommendation`);
172
- return;
173
- }
174
- // return redirectFirstMenu(data, userId);
168
+ if (arrMenus.some(url => newHomePage.includes(url) || url.includes(newHomePage))) {
169
+ window.location.href = newHomePage;
170
+ return;
171
+ }
172
+ const recommendationPath = `/gen2/${newNetworkId}/dashboard/recommendation`;
173
+ if (newHomePage) {
174
+ const homeUrlObj = new URL(newHomePage);
175
+ window.location.assign(`${homeUrlObj?.origin}${recommendationPath}`);
176
+ return;
175
177
  }
176
- window.location.href = convertedHomePage;
178
+ const targetEnv = {
179
+ 33167: ENV.SANDBOX,
180
+ 564890547: ENV.SANDBOX,
181
+ 564888929: ENV.STAGING,
182
+ 564891336: ENV.STAGING,
183
+ }[+newNetworkId] || ENV.PROD;
184
+ window.location.assign(`${CDP_ROUTE[targetEnv]}${recommendationPath}`);
177
185
  };
178
186
  const getAppsMenus = ({ token, userId, accountId, homePage, newNetworkId }) => {
179
187
  if (permissionDomain && token && userId && accountId) {
@@ -229,6 +229,170 @@ const handleScreenviewEvent = (itemEvent, validateExtra, data) => {
229
229
  }
230
230
  }
231
231
  };
232
+ const handleLeadFormEvent = (validateExtra, valuesReplace, infoEvent) => {
233
+ delete valuesReplace.event_name;
234
+ if (validateExtra.form_name && validateExtra.lead_source) {
235
+ valuesReplace.form_name = validateExtra.form_name;
236
+ valuesReplace.lead_source = validateExtra.lead_source;
237
+ infoEvent.translateCode = translations._EVENT_DES_LEAD_3_INFO;
238
+ }
239
+ else if (validateExtra.lead_source) {
240
+ valuesReplace.lead_source = validateExtra.lead_source;
241
+ infoEvent.translateCode = translations._EVENT_DES_LEAD_2_INFO;
242
+ }
243
+ else {
244
+ infoEvent.translateCode = translations._EVENT_DES_LEAD_0_INFO;
245
+ }
246
+ };
247
+ const handleQrScanEvent = (validateExtra, valuesReplace, infoEvent) => {
248
+ delete valuesReplace.event_name;
249
+ valuesReplace.qr_code_id = validateExtra.qr_code?.id || 'N/A';
250
+ valuesReplace.status = validateExtra.status || 'N/A';
251
+ if (validateExtra.message_content) {
252
+ valuesReplace.message_content = validateExtra.message_content;
253
+ infoEvent.translateCode = translations._EVENT_DES_SCAN_FULL;
254
+ }
255
+ else {
256
+ infoEvent.translateCode = translations._EVENT_DES_SCAN_NO_ERR;
257
+ }
258
+ };
259
+ const handleClickBannerEvent = (validateExtra, valuesReplace, infoEvent) => {
260
+ delete valuesReplace.event_name;
261
+ valuesReplace.position = validateExtra.position || 'N/A';
262
+ infoEvent.translateCode = translations._EVENT_DES_CLICK_BANNER;
263
+ };
264
+ const handleClickButtonEvent = (validateExtra, valuesReplace, infoEvent) => {
265
+ delete valuesReplace.event_name;
266
+ valuesReplace.button_label = validateExtra.button_label || 'N/A';
267
+ valuesReplace.page_cate = validateExtra.page_cate || 'N/A';
268
+ infoEvent.translateCode = translations._EVENT_DES_CLICK_BUTTON;
269
+ };
270
+ const handleViewSchemeEvent = (validateExtra, valuesReplace, infoEvent) => {
271
+ delete valuesReplace.event_name;
272
+ valuesReplace.scheme_code =
273
+ validateExtra.scheme_marketing?.scheme_code ||
274
+ validateExtra.scheme_code ||
275
+ validateExtra.scheme_marketing?.id ||
276
+ 'N/A';
277
+ infoEvent.translateCode = translations._EVENT_DES_VIEW_SCHEME_DETAILS;
278
+ };
279
+ const handleRedeemPointEvent = (validateExtra, valuesReplace, infoEvent, isSuccess) => {
280
+ delete valuesReplace.event_name;
281
+ valuesReplace.scheme_code =
282
+ validateExtra.scheme_marketing?.scheme_code ||
283
+ validateExtra.scheme_code ||
284
+ validateExtra.scheme_marketing?.id ||
285
+ 'N/A';
286
+ if (isSuccess) {
287
+ infoEvent.translateCode = translations._EVENT_DES_REDEEM_SUCCESS;
288
+ }
289
+ else {
290
+ valuesReplace.reason_fail = validateExtra.reason_fail || 'N/A';
291
+ infoEvent.translateCode = translations._EVENT_DES_REDEEM_FAIL;
292
+ }
293
+ };
294
+ const handleUpdateRoleEvent = (validateExtra, valuesReplace, infoEvent, isVisitorProfile) => {
295
+ delete valuesReplace.event_name;
296
+ valuesReplace.visitor_name = isVisitorProfile
297
+ ? translate(translations._THIS_PERSON_UPPERCASE, 'This user')
298
+ : validateExtra.users?.name || valuesReplace.customer_name;
299
+ valuesReplace.name = validateExtra.user_update_name || 'N/A';
300
+ valuesReplace.role = validateExtra.user_update_role || 'N/A';
301
+ infoEvent.translateCode = translations._EVENT_DES_UPDATE_ROLE;
302
+ };
303
+ const handleApproveRequestEvent = (validateExtra, valuesReplace, infoEvent) => {
304
+ delete valuesReplace.event_name;
305
+ valuesReplace.visitor_name = validateExtra.users?.name || valuesReplace.customer_name;
306
+ valuesReplace.name = validateExtra.user_update_name || 'N/A';
307
+ valuesReplace.reason_fail = validateExtra.reason_fail || 'N/A';
308
+ infoEvent.translateCode = translations._EVENT_DES_APPROVE_REQ;
309
+ };
310
+ const handleAddMemberEvent = (validateExtra, valuesReplace, infoEvent) => {
311
+ delete valuesReplace.event_name;
312
+ valuesReplace.visitor_name = valuesReplace.customer_name;
313
+ valuesReplace.customer_name =
314
+ validateExtra.customers?.name || validateExtra.customer_name || 'N/A';
315
+ infoEvent.translateCode = translations._EVENT_DES_ADD_MEM;
316
+ };
317
+ const handleRemoveMemberEvent = (validateExtra, valuesReplace, infoEvent) => {
318
+ delete valuesReplace.event_name;
319
+ valuesReplace.name = validateExtra.user_update_name || 'N/A';
320
+ infoEvent.translateCode = translations._EVENT_DES_REMOVE_MEM;
321
+ };
322
+ const handleRequestAccessEvent = (validateExtra, valuesReplace, infoEvent, isVisitorProfile) => {
323
+ delete valuesReplace.event_name;
324
+ // Visitor page: "This user requested to join {customer_name}"
325
+ // Customer page: "{requester_name} requested to join {customer_name}"
326
+ valuesReplace.visitor_name = isVisitorProfile
327
+ ? valuesReplace.customer_name
328
+ : validateExtra.users?.name || 'A user';
329
+ valuesReplace.customer_name =
330
+ validateExtra.customer_name || validateExtra.customers?.name || valuesReplace.customer_name;
331
+ infoEvent.translateCode = translations._EVENT_DES_REQ_ACCESS;
332
+ };
333
+ const handleShareProgramEvent = (valuesReplace, infoEvent) => {
334
+ delete valuesReplace.event_name;
335
+ infoEvent.translateCode = translations._EVENT_DES_SHARE_PROGRAM;
336
+ };
337
+ const handleEarnRewardEvent = (validateExtra, valuesReplace, infoEvent, isReferrer) => {
338
+ delete valuesReplace.event_name;
339
+ valuesReplace.reward_value = validateExtra.reward_value || 'N/A';
340
+ valuesReplace.reward_type = validateExtra.reward_type || 'N/A';
341
+ if (isReferrer) {
342
+ infoEvent.translateCode = translations._EVENT_DES_EARN_REWARD_REFERRER;
343
+ }
344
+ else {
345
+ infoEvent.translateCode = translations._EVENT_DES_EARN_REWARD_REFEREE;
346
+ }
347
+ };
348
+ const handleCustomEventByEcEa = (eType, pageType, validateExtra, valuesReplace, infoEvent, isVisitorProfile) => {
349
+ if ((eType === 'lead_formated' && pageType === 'sync') ||
350
+ (eType === 'lead_form' && pageType === 'submit')) {
351
+ handleLeadFormEvent(validateExtra, valuesReplace, infoEvent);
352
+ }
353
+ else if (eType === 'qr_code' && pageType === 'scan') {
354
+ handleQrScanEvent(validateExtra, valuesReplace, infoEvent);
355
+ }
356
+ else if (eType === 'banner' && pageType === 'click') {
357
+ handleClickBannerEvent(validateExtra, valuesReplace, infoEvent);
358
+ }
359
+ else if (eType === 'button' && pageType === 'click') {
360
+ handleClickButtonEvent(validateExtra, valuesReplace, infoEvent);
361
+ }
362
+ else if (eType === 'scheme_marketing' && pageType === 'view') {
363
+ handleViewSchemeEvent(validateExtra, valuesReplace, infoEvent);
364
+ }
365
+ else if (eType === 'point' && pageType === 'redeem_point') {
366
+ handleRedeemPointEvent(validateExtra, valuesReplace, infoEvent, true);
367
+ }
368
+ else if (eType === 'point' && pageType === 'redeem_point_fail') {
369
+ handleRedeemPointEvent(validateExtra, valuesReplace, infoEvent, false);
370
+ }
371
+ else if (eType === 'role' && pageType === 'update') {
372
+ handleUpdateRoleEvent(validateExtra, valuesReplace, infoEvent, isVisitorProfile);
373
+ }
374
+ else if (eType === 'request' && pageType === 'approve') {
375
+ handleApproveRequestEvent(validateExtra, valuesReplace, infoEvent);
376
+ }
377
+ else if (eType === 'member' && pageType.toLowerCase() === 'add') {
378
+ handleAddMemberEvent(validateExtra, valuesReplace, infoEvent);
379
+ }
380
+ else if (eType === 'member' && pageType.toLowerCase() === 'remove') {
381
+ handleRemoveMemberEvent(validateExtra, valuesReplace, infoEvent);
382
+ }
383
+ else if (eType === 'access' && pageType === 'request') {
384
+ handleRequestAccessEvent(validateExtra, valuesReplace, infoEvent, isVisitorProfile);
385
+ }
386
+ else if (eType === 'program' && pageType === 'share') {
387
+ handleShareProgramEvent(valuesReplace, infoEvent);
388
+ }
389
+ else if (eType === 'referrer' && pageType === 'earn_reward') {
390
+ handleEarnRewardEvent(validateExtra, valuesReplace, infoEvent, true);
391
+ }
392
+ else if (eType === 'referee' && pageType === 'earn_reward') {
393
+ handleEarnRewardEvent(validateExtra, valuesReplace, infoEvent, false);
394
+ }
395
+ };
232
396
  const handleEventTrackingCode = (eventTracking, keyTitleEvent, validateExtra, valuesReplace, infoEvent, config) => {
233
397
  const { story = {} } = validateExtra;
234
398
  if (eventTracking.map[keyTitleEvent]?.eventTrackingCode === 'promotion_code_sent_tracking') {
@@ -353,7 +517,7 @@ const processEventByType = (eType, itemEvent, validateExtra, data) => {
353
517
  handleScreenviewEvent(itemEvent, validateExtra, data);
354
518
  }
355
519
  };
356
- const buildInfoEvent = (infoEvent, eventTracking, keyTitleEvent, validateExtra, data, config) => {
520
+ const buildInfoEvent = (infoEvent, eventTracking, keyTitleEvent, validateExtra, data, config, eType, pageType, isVisitorProfile) => {
357
521
  let valuesReplace = {};
358
522
  if (infoEvent) {
359
523
  infoEvent.iconName = get(eventTracking, `map.${keyTitleEvent}.iconUrl`);
@@ -375,6 +539,7 @@ const buildInfoEvent = (infoEvent, eventTracking, keyTitleEvent, validateExtra,
375
539
  valuesReplace = getValuesReplace(infoEvent.objectReplace, data);
376
540
  handleEventTrackingCode(eventTracking, keyTitleEvent, validateExtra, valuesReplace, infoEvent, config);
377
541
  }
542
+ handleCustomEventByEcEa(eType, pageType, validateExtra, valuesReplace, infoEvent, isVisitorProfile);
378
543
  return { infoEvent, valuesReplace };
379
544
  };
380
545
  const buildFullContentEvent = (infoEvent, titleEvent, valuesReplace, data) => {
@@ -403,6 +568,7 @@ const calculateSlideSettings = (itemEvent, infoEvent) => {
403
568
  export const getInfoEvent = (params) => {
404
569
  const { eType, itemEvent, eventTracking, config, customerName: customerNameParam } = params;
405
570
  const customerName = customerNameParam || '_THIS_PERSON_UPPERCASE';
571
+ const isVisitorProfile = customerName === '_THIS_PERSON_UPPERCASE';
406
572
  // Step 1: Prepare initial data and extract common fields
407
573
  const { keyTitleEvent, validateExtra, titleEvent: initialTitleEvent, data, } = prepareInitialData(itemEvent, eType, eventTracking, customerName);
408
574
  // Step 2: Update titleEvent if eventTracking has a mapping
@@ -414,7 +580,7 @@ export const getInfoEvent = (params) => {
414
580
  processEventByType(eType, itemEvent, validateExtra, data);
415
581
  // Step 4: Build infoEvent and valuesReplace
416
582
  let infoEvent = DATA_EVENT.map[`${itemEvent.pageType} ${eType}`];
417
- const { infoEvent: processedInfoEvent, valuesReplace } = buildInfoEvent(infoEvent, eventTracking, keyTitleEvent, validateExtra, data, config);
583
+ const { infoEvent: processedInfoEvent, valuesReplace } = buildInfoEvent(infoEvent, eventTracking, keyTitleEvent, validateExtra, data, config, eType, itemEvent.pageType, isVisitorProfile);
418
584
  infoEvent = processedInfoEvent;
419
585
  // Step 5: Build full content event text
420
586
  const fullContentEvent = buildFullContentEvent(infoEvent, titleEvent, valuesReplace, data);
@@ -1,4 +1,15 @@
1
1
  /// <reference types="react" />
2
2
  export declare const HomeMenuWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
3
3
  export declare const CreateButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<import("react").LegacyRef<HTMLElement>>>, any, {}, never>;
4
- export declare const ModalWrapper: import("styled-components").StyledComponent<import("react").ComponentType<any> | keyof import("react").JSX.IntrinsicElements, any, any, any>;
4
+ export declare const ModalWrapper: import("styled-components").StyledComponent<import("react").FC<import("@antscorp/antsomi-ui/es/components/molecules/Modal").ModalProps> & {
5
+ confirm: (props: import("antd").ModalFuncProps) => {
6
+ destroy: () => void;
7
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
8
+ };
9
+ useModal: typeof import("antd/es/modal/useModal").default;
10
+ success: import("antd/es/modal/confirm").ModalFunc;
11
+ info: import("antd/es/modal/confirm").ModalFunc;
12
+ error: import("antd/es/modal/confirm").ModalFunc;
13
+ warning: import("antd/es/modal/confirm").ModalFunc;
14
+ destroyAll: () => void;
15
+ }, any, {}, never>;
@@ -115,7 +115,7 @@ export const usePermission = () => {
115
115
  },
116
116
  });
117
117
  const flattenMenuPermission = flattenMenuArray(menuListPermission || [], 'childs');
118
- const permissionMenu = useMemo(() => recursivePermissionMenu(sortBy(menuList?.rows || [], ['level_position']), flattenMenuPermission), [menuList?.rows, flattenMenuPermission]);
118
+ const permissionMenu = useMemo(() => recursivePermissionMenu(sortBy(menuList?.rows || [], [item => Number(item?.level_position)]), flattenMenuPermission), [menuList?.rows, flattenMenuPermission]);
119
119
  const mappingChildrenMenu = useMemo(() => getMappingAppChildren({
120
120
  menuList: permissionMenu,
121
121
  auth,
@@ -86,7 +86,7 @@ export const recursivePermissionMenu = (menuItems, menuPermissions) => {
86
86
  ...item,
87
87
  ...(isArray(item.children)
88
88
  ? {
89
- children: recursivePermissionMenu(sortBy(item.children || [], ['level_position']), menuPermissions),
89
+ children: recursivePermissionMenu(sortBy(item.children || [], [item => Number(item.level_position)]), menuPermissions),
90
90
  }
91
91
  : {}),
92
92
  }))
@@ -1,4 +1,15 @@
1
1
  /// <reference types="react" />
2
- export declare const ModalContainer: import("styled-components").StyledComponent<import("react").ComponentType<any> | keyof import("react").JSX.IntrinsicElements, any, any, any>;
2
+ export declare const ModalContainer: import("styled-components").StyledComponent<import("react").FC<import("../../molecules/Modal").ModalProps> & {
3
+ confirm: (props: import("antd").ModalFuncProps) => {
4
+ destroy: () => void;
5
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
6
+ };
7
+ useModal: typeof import("antd/es/modal/useModal").default;
8
+ success: import("antd/es/modal/confirm").ModalFunc;
9
+ info: import("antd/es/modal/confirm").ModalFunc;
10
+ error: import("antd/es/modal/confirm").ModalFunc;
11
+ warning: import("antd/es/modal/confirm").ModalFunc;
12
+ destroyAll: () => void;
13
+ }, any, {}, never>;
3
14
  export declare const ModalWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
15
  export declare const ImageWrapper: import("styled-components").StyledComponent<"img", any, {}, never>;
@@ -24,7 +24,18 @@ export declare const CautionLink: import("styled-components").StyledComponent<im
24
24
  export declare const RatingSection: import("styled-components").StyledComponent<"div", any, {}, never>;
25
25
  export declare const RatingText: import("styled-components").StyledComponent<"span", any, {}, never>;
26
26
  export declare const RatingButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<import("react").LegacyRef<HTMLElement>>>, any, {}, never>;
27
- export declare const StyledModal: import("styled-components").StyledComponent<import("react").ComponentType<any> | keyof import("react").JSX.IntrinsicElements, any, any, any>;
27
+ export declare const StyledModal: import("styled-components").StyledComponent<import("react").FC<import("../../../molecules/Modal").ModalProps> & {
28
+ confirm: (props: import("antd").ModalFuncProps) => {
29
+ destroy: () => void;
30
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
31
+ };
32
+ useModal: typeof import("antd/es/modal/useModal").default;
33
+ success: import("antd/es/modal/confirm").ModalFunc;
34
+ info: import("antd/es/modal/confirm").ModalFunc;
35
+ error: import("antd/es/modal/confirm").ModalFunc;
36
+ warning: import("antd/es/modal/confirm").ModalFunc;
37
+ destroyAll: () => void;
38
+ }, any, {}, never>;
28
39
  export declare const ModalDescription: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
29
40
  export declare const SearchSection: import("styled-components").StyledComponent<"div", any, {}, never>;
30
41
  export declare const LanguageSelector: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -27,6 +27,15 @@ export const removeCookieSubDomain = ({ name, env = 'development', cookieOptions
27
27
  secure: true,
28
28
  ...cookieOptions,
29
29
  });
30
+ // Remove redundant cookies setted for full domain
31
+ if (['api_token', 'api_r_token', 'api_pid'].includes(name)) {
32
+ cookies.remove(name, {
33
+ path: '/',
34
+ sameSite: 'none',
35
+ secure: true,
36
+ ...cookieOptions,
37
+ });
38
+ }
30
39
  };
31
40
  export const removeAppCookieSessionSubdomain = (args) => {
32
41
  removeCookieSubDomain(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "2.0.114",
3
+ "version": "2.0.116",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -91,7 +91,7 @@
91
91
  "@tiptap/react": "3.10.2",
92
92
  "@tiptap/starter-kit": "3.10.2",
93
93
  "@tiptap/suggestion": "3.10.2",
94
- "@yaireo/tagify": "^4.31.2",
94
+ "@yaireo/tagify": "4.31.2",
95
95
  "ace-builds": "1.4.14",
96
96
  "animate.css": "^4.1.1",
97
97
  "antd": "5.12.6",
@@ -159,8 +159,8 @@
159
159
  },
160
160
  "devDependencies": {
161
161
  "@antscorp/antsomi-constants": "1.0.8-beta.1",
162
+ "@antscorp/antsomi-locales": "^1.0.92",
162
163
  "@antscorp/eslint-config-antsomi": "1.0.4",
163
- "@antscorp/antsomi-locales": "^1.0.79",
164
164
  "@babel/cli": "^7.23.4",
165
165
  "@babel/core": "^7.21.3",
166
166
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -267,10 +267,10 @@
267
267
  "webpack-cli": "^5.1.4"
268
268
  },
269
269
  "peerDependencies": {
270
+ "@antscorp/antsomi-constants": ">=1.0.8-beta.1",
271
+ "@antscorp/antsomi-locales": ">=1.0.79",
270
272
  "react": ">=16.9.0",
271
273
  "react-dom": ">=16.9.0",
272
- "react-router-dom": ">= 5.1.0",
273
- "@antscorp/antsomi-constants": ">=1.0.8-beta.1",
274
- "@antscorp/antsomi-locales": ">=1.0.79"
274
+ "react-router-dom": ">= 5.1.0"
275
275
  }
276
276
  }