@antscorp/antsomi-ui 1.3.7-beta.6 → 1.3.7-beta.61

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 (159) hide show
  1. package/es/components/atoms/Input/Input.js +3 -1
  2. package/es/components/atoms/InputDynamic/InputDynamic.js +3 -3
  3. package/es/components/icons/LazyIcon/LazyIcon.d.ts +2 -0
  4. package/es/components/icons/LazyIcon/LazyIcon.js +2 -0
  5. package/es/components/icons/QRCodeManagementIcon.d.ts +3 -0
  6. package/es/components/icons/QRCodeManagementIcon.js +7 -0
  7. package/es/components/icons/QRSetDashboardIcon.d.ts +3 -0
  8. package/es/components/icons/QRSetDashboardIcon.js +7 -0
  9. package/es/components/icons/index.d.ts +2 -0
  10. package/es/components/icons/index.js +2 -0
  11. package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +28 -2
  12. package/es/components/molecules/AddDynamicContent/constants.d.ts +2 -0
  13. package/es/components/molecules/AddDynamicContent/constants.js +2 -0
  14. package/es/components/molecules/ColorPicker/index.d.ts +2 -0
  15. package/es/components/molecules/ColorPicker/index.js +8 -3
  16. package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +1 -0
  17. package/es/components/molecules/EmojiPopover/EmojiPopover.js +2 -2
  18. package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
  19. package/es/components/molecules/EmojiPopover/styled.js +1 -1
  20. package/es/components/molecules/HeaderV2/HeaderV2.d.ts +1 -1
  21. package/es/components/molecules/Modal/Modal.js +7 -1
  22. package/es/components/molecules/SearchPopover/SearchPopover.js +2 -2
  23. package/es/components/molecules/SearchPopover/styled.d.ts +12 -1
  24. package/es/components/molecules/SearchPopover/styled.js +1 -2
  25. package/es/components/molecules/SearchPopover/types.d.ts +4 -3
  26. package/es/components/molecules/Select/Select.js +1 -1
  27. package/es/components/molecules/ShareAccess/ShareAccess.d.ts +2 -1
  28. package/es/components/molecules/ShareAccess/ShareAccess.js +12 -9
  29. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +5 -5
  30. package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +2 -2
  31. package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +2 -1
  32. package/es/components/molecules/ShareAccess/index.d.ts +1 -0
  33. package/es/components/molecules/ShareAccess/reducer.d.ts +1 -1
  34. package/es/components/molecules/ShareAccess/reducer.js +7 -4
  35. package/es/components/molecules/ShareAccess/types.d.ts +22 -0
  36. package/es/components/molecules/ShareAccess/utils.d.ts +3 -1
  37. package/es/components/molecules/ShareAccess/utils.js +35 -2
  38. package/es/components/molecules/TagifyInput/TagifyInput.js +48 -27
  39. package/es/components/molecules/TagifyInput/types.d.ts +14 -8
  40. package/es/components/molecules/TagifyInput/utils.d.ts +6 -1
  41. package/es/components/molecules/TagifyInput/utils.js +19 -0
  42. package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +1 -0
  43. package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +3 -7
  44. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +10 -10
  45. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +46 -327
  46. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.d.ts +9 -0
  47. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.js +5 -0
  48. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.d.ts +23 -0
  49. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.js +81 -0
  50. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.d.ts +24 -0
  51. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.js +32 -0
  52. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.d.ts +26 -0
  53. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.js +93 -0
  54. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.d.ts +24 -0
  55. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.js +94 -0
  56. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.d.ts +7 -0
  57. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.js +132 -0
  58. package/es/components/molecules/VirtualizedMenu/styled.js +14 -3
  59. package/es/components/molecules/VirtualizedMenu/types.d.ts +1 -0
  60. package/es/components/molecules/VirtualizedMenu/utils.d.ts +1 -0
  61. package/es/components/molecules/VirtualizedMenu/utils.js +1 -0
  62. package/es/components/molecules/index.d.ts +1 -0
  63. package/es/components/organism/AccountSharing/AccountSharing.d.ts +1 -0
  64. package/es/components/organism/AccountSharing/AccountSharing.js +11 -4
  65. package/es/components/organism/AccountSharing/styled.js +1 -1
  66. package/es/components/organism/ActivityTimeline/ActivityTimeline.js +3 -3
  67. package/es/components/organism/ActivityTimeline/constants.d.ts +9 -9
  68. package/es/components/organism/ActivityTimeline/constants.js +3 -3
  69. package/es/components/organism/ActivityTimeline/index.d.ts +530 -1
  70. package/es/components/organism/ActivityTimeline/index.js +9 -1
  71. package/es/components/organism/ActivityTimeline/utils.js +175 -8
  72. package/es/components/organism/LeftMenu/LeftMenu.js +3 -3
  73. package/es/components/organism/LeftMenu/hooks/usePermission.js +1 -1
  74. package/es/components/organism/LeftMenu/types/index.d.ts +7 -0
  75. package/es/components/organism/LeftMenu/utils/index.js +1 -1
  76. package/es/components/organism/Login/Login.js +12 -3
  77. package/es/components/organism/Login/components/SignIn/SignIn.js +2 -2
  78. package/es/components/organism/Login/types/index.d.ts +2 -0
  79. package/es/components/organism/TextEditor/TextEditor.d.ts +9 -2
  80. package/es/components/organism/TextEditor/TextEditor.js +203 -42
  81. package/es/components/organism/TextEditor/constants.d.ts +9 -0
  82. package/es/components/organism/TextEditor/constants.js +66 -0
  83. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +6 -128
  84. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +7 -292
  85. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +1 -1
  86. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +4 -0
  87. package/es/components/organism/TextEditor/extensions/Link.js +33 -14
  88. package/es/components/organism/TextEditor/extensions/ListItem.d.ts +10 -0
  89. package/es/components/organism/TextEditor/extensions/ListItem.js +93 -0
  90. package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +5 -6
  91. package/es/components/organism/TextEditor/extensions/SmartTag.js +96 -4
  92. package/es/components/organism/TextEditor/hooks/useColorSet.js +7 -0
  93. package/es/components/organism/TextEditor/hooks/useMarkTracking.js +2 -1
  94. package/es/components/organism/TextEditor/index.d.ts +7 -5
  95. package/es/components/organism/TextEditor/index.scss +4 -7
  96. package/es/components/organism/TextEditor/provider.d.ts +1 -0
  97. package/es/components/organism/TextEditor/provider.js +6 -3
  98. package/es/components/organism/TextEditor/store.d.ts +11 -4
  99. package/es/components/organism/TextEditor/store.js +22 -2
  100. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/froala-legacy-format.settings.json +95 -0
  101. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.d.ts +111 -0
  102. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.js +82 -0
  103. package/es/components/organism/TextEditor/stories/shared.d.ts +64 -0
  104. package/es/components/organism/TextEditor/stories/shared.js +57 -0
  105. package/es/components/organism/TextEditor/styled.d.ts +1 -1
  106. package/es/components/organism/TextEditor/styled.js +1 -0
  107. package/es/components/organism/TextEditor/types.d.ts +161 -11
  108. package/es/components/organism/TextEditor/types.js +1 -0
  109. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +2 -1
  110. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +80 -51
  111. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +1 -1
  112. package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +1 -1
  113. package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +2 -2
  114. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +12 -2
  115. package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.d.ts +16 -0
  116. package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.js +61 -0
  117. package/es/components/organism/TextEditor/ui/LinkInsertForm/index.d.ts +2 -0
  118. package/es/components/organism/TextEditor/ui/LinkInsertForm/index.js +1 -0
  119. package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.d.ts +9 -0
  120. package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.js +126 -0
  121. package/es/components/organism/TextEditor/ui/LinkPopover/index.d.ts +2 -0
  122. package/es/components/organism/TextEditor/ui/LinkPopover/index.js +1 -0
  123. package/es/components/organism/TextEditor/ui/Popover/Popover.js +1 -1
  124. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +1 -3
  125. package/es/components/organism/TextEditor/ui/Toolbar/{Toolbar.d.ts → FormattingToolbar.d.ts} +3 -4
  126. package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.js +90 -0
  127. package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.d.ts +10 -0
  128. package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.js +39 -0
  129. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +4 -3
  130. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +1 -0
  131. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +2 -2
  132. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +6 -1
  133. package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +2 -1
  134. package/es/components/organism/TextEditor/ui/Toolbar/index.js +2 -1
  135. package/es/components/organism/TextEditor/utils/documentState.d.ts +14 -0
  136. package/es/components/organism/TextEditor/utils/documentState.js +25 -0
  137. package/es/components/organism/TextEditor/utils/htmlProcessing.js +60 -0
  138. package/es/components/organism/TextEditor/utils/link.d.ts +10 -1
  139. package/es/components/organism/TextEditor/utils/link.js +161 -7
  140. package/es/components/organism/TextEditor/utils/menu.js +2 -1
  141. package/es/components/organism/TextEditor/utils/selection.js +3 -2
  142. package/es/components/organism/TextEditor/utils/smartTag.js +2 -1
  143. package/es/components/organism/index.d.ts +1 -1
  144. package/es/hooks/index.d.ts +1 -1
  145. package/es/hooks/index.js +1 -1
  146. package/es/providers/ConfigProvider/ConfigProvider.d.ts +4 -0
  147. package/es/providers/ConfigProvider/ConfigProvider.js +2 -3
  148. package/es/providers/ConfigProvider/GlobalStyle.d.ts +2 -2
  149. package/es/providers/ConfigProvider/GlobalStyle.js +67 -64
  150. package/es/services/MediaTemplateDesign/UploadFile/index.js +4 -4
  151. package/es/utils/common.d.ts +1 -1
  152. package/es/utils/common.js +3 -3
  153. package/es/utils/cookie.js +2 -1
  154. package/package.json +18 -23
  155. package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.d.ts +0 -1
  156. package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.js +0 -1
  157. package/es/components/organism/TextEditor/ui/BubbleToolbar/index.d.ts +0 -0
  158. package/es/components/organism/TextEditor/ui/BubbleToolbar/index.js +0 -1
  159. package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +0 -39
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-underscore-dangle */
2
2
  import { DATA_EVENT, mapTranslateCode } from './constants';
3
3
  import { get } from 'lodash';
4
- import { translate, translations } from '@antscorp/antsomi-ui/es/locales';
4
+ import { translate, translations } from '@antscorp/antsomi-locales';
5
5
  import { safeParse } from '@antscorp/antsomi-ui/es/utils';
6
6
  import { formatDate, formatUTCDateTZ } from '@antscorp/antsomi-ui/es/utils/date';
7
7
  import { getPortalFormatDateTimeLong, getPortalTimeZone, } from '@antscorp/antsomi-ui/es/utils/portal';
@@ -163,9 +163,9 @@ const handlePageEvent = (itemEvent, data) => {
163
163
  if (itemEvent.pageType === 'view') {
164
164
  const validateExtra = itemEvent.extra || {};
165
165
  const locationUrl = safeParse(validateExtra.location_url, '');
166
- const pageTitle = safeParse(validateExtra.page_title, '');
166
+ const pageType = safeParse(validateExtra.page_type, '');
167
167
  // Use page_title if available, otherwise fallback to location_url
168
- const pageTypeText = pageTitle.length > 0 ? pageTitle : locationUrl;
168
+ const pageTypeText = pageType.length > 0 ? pageType : locationUrl;
169
169
  // Build clickable link to location_url
170
170
  if (locationUrl.length > 0 && pageTypeText.length > 0) {
171
171
  data.page_type = `<a class="title-have-url" href="${encodeURI(locationUrl)}" target="_blank">${pageTypeText}</a>`;
@@ -222,10 +222,175 @@ const handleStoreEvent = (itemEvent, data) => {
222
222
  }
223
223
  };
224
224
  const handleScreenviewEvent = (itemEvent, validateExtra, data) => {
225
- if (itemEvent.pageType === 'view' && validateExtra.screen_type) {
226
- data.screen_type = validateExtra.screen_type;
227
- // Add event_source_name from insightPropertyName
225
+ if (itemEvent.pageType === 'view') {
228
226
  data.event_source_name = safeParse(itemEvent.insightPropertyName, 'N/A');
227
+ if (validateExtra.screen_type) {
228
+ data.screen_type = validateExtra.screen_type;
229
+ }
230
+ }
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);
229
394
  }
230
395
  };
231
396
  const handleEventTrackingCode = (eventTracking, keyTitleEvent, validateExtra, valuesReplace, infoEvent, config) => {
@@ -352,7 +517,7 @@ const processEventByType = (eType, itemEvent, validateExtra, data) => {
352
517
  handleScreenviewEvent(itemEvent, validateExtra, data);
353
518
  }
354
519
  };
355
- const buildInfoEvent = (infoEvent, eventTracking, keyTitleEvent, validateExtra, data, config) => {
520
+ const buildInfoEvent = (infoEvent, eventTracking, keyTitleEvent, validateExtra, data, config, eType, pageType, isVisitorProfile) => {
356
521
  let valuesReplace = {};
357
522
  if (infoEvent) {
358
523
  infoEvent.iconName = get(eventTracking, `map.${keyTitleEvent}.iconUrl`);
@@ -374,6 +539,7 @@ const buildInfoEvent = (infoEvent, eventTracking, keyTitleEvent, validateExtra,
374
539
  valuesReplace = getValuesReplace(infoEvent.objectReplace, data);
375
540
  handleEventTrackingCode(eventTracking, keyTitleEvent, validateExtra, valuesReplace, infoEvent, config);
376
541
  }
542
+ handleCustomEventByEcEa(eType, pageType, validateExtra, valuesReplace, infoEvent, isVisitorProfile);
377
543
  return { infoEvent, valuesReplace };
378
544
  };
379
545
  const buildFullContentEvent = (infoEvent, titleEvent, valuesReplace, data) => {
@@ -402,6 +568,7 @@ const calculateSlideSettings = (itemEvent, infoEvent) => {
402
568
  export const getInfoEvent = (params) => {
403
569
  const { eType, itemEvent, eventTracking, config, customerName: customerNameParam } = params;
404
570
  const customerName = customerNameParam || '_THIS_PERSON_UPPERCASE';
571
+ const isVisitorProfile = customerName === '_THIS_PERSON_UPPERCASE';
405
572
  // Step 1: Prepare initial data and extract common fields
406
573
  const { keyTitleEvent, validateExtra, titleEvent: initialTitleEvent, data, } = prepareInitialData(itemEvent, eType, eventTracking, customerName);
407
574
  // Step 2: Update titleEvent if eventTracking has a mapping
@@ -413,7 +580,7 @@ export const getInfoEvent = (params) => {
413
580
  processEventByType(eType, itemEvent, validateExtra, data);
414
581
  // Step 4: Build infoEvent and valuesReplace
415
582
  let infoEvent = DATA_EVENT.map[`${itemEvent.pageType} ${eType}`];
416
- 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);
417
584
  infoEvent = processedInfoEvent;
418
585
  // Step 5: Build full content event text
419
586
  const fullContentEvent = buildFullContentEvent(infoEvent, titleEvent, valuesReplace, data);
@@ -20,7 +20,7 @@ import { renderMenuIcon } from './utils';
20
20
  const SubLogoAntsomi = 'https://st-media-template.antsomi.com/icons/antsomi/antsomi.png';
21
21
  const homePermissionCode = 'DASHBOARD';
22
22
  export const LeftMenuComponent = memo(props => {
23
- const { show = true, style, className, customization, showLogo = true, onClickLogo } = props;
23
+ const { show = true, style, className, customization, showLogo = true, footer, onClickLogo, } = props;
24
24
  const { showMenuPopover = true, showButtonExpand = true, type, items = [], onMenuItemClick, } = customization || {};
25
25
  const appHoverMenuChildren = useLeftMenuContext(store => store.appHoverMenuChildren);
26
26
  const customHoverMenuChildren = useLeftMenuContext(store => store.customHoverMenuChildren);
@@ -99,9 +99,9 @@ export const LeftMenuComponent = memo(props => {
99
99
  }
100
100
  return null;
101
101
  };
102
- return (_jsxs(LeftMenuNavWrapper, { "$show": show, style: style, "$isExpandMenu": state.isExpandMenu, className: className, children: [_jsxs(LeftMenuNav, { className: "left-menu-nav", children: [_jsxs(FeatureMenuWrapper, { vertical: true, onMouseEnter: () => onShowPopover(), onMouseLeave: onMouseLeave, children: [showLogo && (_jsx(NavLogoWrapper, { align: "center", justify: "center", onMouseEnter: onHoverMenuBar, onClick: onClickLogo, children: _jsx("div", { className: "image-wrapper", children: _jsx("img", { src: SubLogoAntsomi, alt: "Antsomi sub logo" }) }) })), _jsxs(FeatureMenu, { role: "menu", className: "antsomi-scroll-box", children: [_jsx("div", { className: "menu-content scroll-content", children: renderAppMenuItems() }), _jsx("div", { className: "nav-blank", onMouseEnter: onHoverMenuBar }), showMenuPopover && (_jsx(PopoverWrapper, { show: state.isShowPopover && !isEmpty(hoverMenuChildren), hasMarginTop: type !== 'recommendation', className: "antsomi-scroll-box antsomi-child-menu-popover", children: _jsx("div", { className: "scroll-content", style: { width: '200px', maxHeight: '100%' }, children: childHoverMenu }) }))] }), _jsx("div", { style: { flexShrink: 0 }, children: renderSettings() })] }), showButtonExpand && (_jsx(ExpandWrapper, { onMouseEnter: onMouseLeave, children: _jsx(Icon, { type: "icon-ants-expand-more", style: {
102
+ return (_jsxs(LeftMenuNavWrapper, { "$show": show, style: style, "$isExpandMenu": state.isExpandMenu, className: className, children: [_jsxs(LeftMenuNav, { className: "left-menu-nav", children: [_jsxs(FeatureMenuWrapper, { vertical: true, onMouseEnter: () => onShowPopover(), onMouseLeave: onMouseLeave, children: [showLogo && (_jsx(NavLogoWrapper, { align: "center", justify: "center", onMouseEnter: onHoverMenuBar, onClick: onClickLogo, children: _jsx("div", { className: "image-wrapper", children: _jsx("img", { src: SubLogoAntsomi, alt: "Antsomi sub logo" }) }) })), _jsxs(FeatureMenu, { role: "menu", className: "antsomi-scroll-box", children: [_jsx("div", { className: "menu-content scroll-content", children: renderAppMenuItems() }), _jsx("div", { className: "nav-blank", onMouseEnter: onHoverMenuBar }), showMenuPopover && (_jsx(PopoverWrapper, { show: state.isShowPopover && !isEmpty(hoverMenuChildren), hasMarginTop: type !== 'recommendation', className: "antsomi-scroll-box antsomi-child-menu-popover", children: _jsx("div", { className: "scroll-content", style: { width: '200px', maxHeight: '100%' }, children: childHoverMenu }) }))] }), footer === undefined && _jsx("div", { style: { flexShrink: 0 }, children: renderSettings() })] }), footer !== undefined ? (_jsx("div", { style: { flexShrink: 0 }, children: footer })) : showButtonExpand ? (_jsx(ExpandWrapper, { onMouseEnter: onMouseLeave, children: _jsx(Icon, { type: "icon-ants-expand-more", style: {
103
103
  cursor: 'pointer',
104
104
  fontSize: '20px',
105
105
  transform: `rotate(${state.isExpandMenu ? '90deg' : '270deg'})`,
106
- }, onClick: onToggleChildMenu }) }))] }), _jsx(ChildMenuWrapper, { isExpand: state.isExpandMenu, isMarginTop: showLogo, className: "antsomi-scroll-box", children: _jsx("div", { className: "scroll-content", style: { width: '200px', maxHeight: '100%' }, children: childActiveMenu }) })] }));
106
+ }, onClick: onToggleChildMenu }) })) : null] }), _jsx(ChildMenuWrapper, { isExpand: state.isExpandMenu, isMarginTop: showLogo, className: "antsomi-scroll-box", children: _jsx("div", { className: "scroll-content", style: { width: '200px', maxHeight: '100%' }, children: childActiveMenu }) })] }));
107
107
  }, (prevProps, nextProps) => isEqual(prevProps, nextProps));
@@ -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,
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { AppConfigProviderProps } from '@antscorp/antsomi-ui/es/providers';
2
3
  import { FeatureMenuPermission, TFeatureMenu } from '@antscorp/antsomi-ui/es/models/LeftMenu';
3
4
  export type TMenuItem = Omit<Partial<TFeatureMenu>, 'children' | keyof TRequireMenuItemKey> & {
@@ -37,6 +38,12 @@ export interface LeftMenuProps {
37
38
  style?: React.CSSProperties;
38
39
  className?: string;
39
40
  showLogo?: boolean;
41
+ /**
42
+ * Custom content rendered at the bottom of the primary menu rail.
43
+ * When provided, it replaces the default Settings item and Expand button.
44
+ * Pass `null` to hide the default footer without rendering a replacement.
45
+ */
46
+ footer?: ReactNode;
40
47
  customization?: {
41
48
  type?: TLeftMenuType;
42
49
  showButtonExpand?: boolean;
@@ -84,7 +84,7 @@ export const recursivePermissionMenu = (menuItems, menuPermissions) => {
84
84
  ...item,
85
85
  ...(isArray(item.children)
86
86
  ? {
87
- children: recursivePermissionMenu(sortBy(item.children || [], ['level_position']), menuPermissions),
87
+ children: recursivePermissionMenu(sortBy(item.children || [], [item => Number(item.level_position)]), menuPermissions),
88
88
  }
89
89
  : {}),
90
90
  }))
@@ -208,7 +208,10 @@ export const Login = props => {
208
208
  if (menus && menus.length) {
209
209
  handleLoginData(dataLogin, !isCallbackUrl && !isHomePageUrl, selectedNetworkRef.current && selectedNetworkRef.current.networkId);
210
210
  if (onLoginSuccess && typeof onLoginSuccess === 'function') {
211
- onLoginSuccess(dataLogin);
211
+ onLoginSuccess({
212
+ ...dataLogin,
213
+ networkId: selectedNetworkRef.current?.networkId ?? networkId,
214
+ });
212
215
  setLoadingSkip(false);
213
216
  }
214
217
  else if (isCallbackUrl && callbackUrl) {
@@ -242,7 +245,10 @@ export const Login = props => {
242
245
  handleLoginData(dataLogin, !isCallbackUrl && !isHomePageUrl, selectedNetworkRef.current && selectedNetworkRef.current.networkId);
243
246
  setLoadingSkip(false);
244
247
  if (onLoginSuccess && typeof onLoginSuccess === 'function') {
245
- onLoginSuccess(dataLogin);
248
+ onLoginSuccess({
249
+ ...dataLogin,
250
+ networkId: selectedNetworkRef.current?.networkId ?? networkId,
251
+ });
246
252
  }
247
253
  else if (isCallbackUrl && callbackUrl) {
248
254
  navigateTo(callbackUrl);
@@ -263,7 +269,10 @@ export const Login = props => {
263
269
  setLoadingSkip(false);
264
270
  handleLoginData(dataLogin, !isCallbackUrl && !isHomePageUrl, selectedNetworkRef.current && selectedNetworkRef.current.networkId);
265
271
  if (onLoginSuccess && typeof onLoginSuccess === 'function') {
266
- onLoginSuccess(dataLogin);
272
+ onLoginSuccess({
273
+ ...dataLogin,
274
+ networkId: selectedNetworkRef.current?.networkId ?? networkId,
275
+ });
267
276
  }
268
277
  else if (isCallbackUrl && callbackUrl) {
269
278
  navigateTo(callbackUrl);
@@ -72,10 +72,10 @@ export const SignIn = props => {
72
72
  message: 'Please enter your email',
73
73
  pattern: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
74
74
  },
75
- ], children: _jsx(StyleInput, { isMobile: isMobile, placeholder: "Email" }) }), _jsx(Form.Item, { name: "password", rules: [
75
+ ], children: _jsx(StyleInput, { autoComplete: "username", name: "email", type: "text", isMobile: isMobile, placeholder: "Email" }) }), _jsx(Form.Item, { name: "password", rules: [
76
76
  { required: true, message: 'Please enter your password' },
77
77
  { min: 6, message: 'Password must be at least 6 characters long' },
78
- ], style: { marginTop: 15 }, children: _jsx(StyleInput.Password, { placeholder: "Password", iconRender: visible => visible ? (_jsx(Icon, { type: "icon-ants-eye", style: {
78
+ ], style: { marginTop: 15 }, children: _jsx(StyleInput.Password, { name: "password", autoComplete: "current-password", placeholder: "Password", iconRender: visible => visible ? (_jsx(Icon, { type: "icon-ants-eye", style: {
79
79
  color: '#595959',
80
80
  } })) : (_jsx(Icon, { type: "icon-ants-invisible", style: {
81
81
  color: '#595959',
@@ -19,6 +19,8 @@ export interface LoginData {
19
19
  G2FA: number;
20
20
  status: boolean;
21
21
  errorCode: string;
22
+ /** The networkId (portalId) of the network the user logged into */
23
+ networkId?: number | string;
22
24
  [key: string]: any;
23
25
  }
24
26
  export interface Account {
@@ -1,3 +1,10 @@
1
1
  import React from 'react';
2
- import { TextEditorProps, TextEditorRef } from './types';
3
- export declare const TextEditor: React.MemoExoticComponent<React.ForwardRefExoticComponent<TextEditorProps & React.RefAttributes<TextEditorRef>>>;
2
+ import { type TextEditorProviderRefHandler } from './provider';
3
+ import { type TextEditorProps, type TextEditorRef, type TextEditorWithProviderRef } from './types';
4
+ export declare const TextEditor: React.ForwardRefExoticComponent<TextEditorProps & {
5
+ colors?: string[] | undefined;
6
+ onChangeColors?: ((colors: string[]) => void) | undefined;
7
+ } & React.RefAttributes<TextEditorWithProviderRef>> & {
8
+ Provider: React.ForwardRefExoticComponent<import("./provider").TextEditorProviderProps & React.RefAttributes<TextEditorProviderRefHandler>>;
9
+ Internal: React.MemoExoticComponent<React.ForwardRefExoticComponent<TextEditorProps & React.RefAttributes<TextEditorRef>>>;
10
+ };