@antscorp/antsomi-ui 1.3.7-beta.7 → 1.3.7-beta.9

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { PayloadInfo } from '@antscorp/antsomi-ui/es/types';
2
3
  import { TDisplayFormat } from '../../types';
3
4
  export type DisplayFormatProps = {
@@ -17,7 +17,7 @@ import '@yaireo/tagify/dist/tagify.css';
17
17
  // Styled
18
18
  import { TagTextArea, TagifyWrapper, WrapperPlaceHolder } from './styled';
19
19
  // Utils
20
- import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCustomTagType, sanitizeTagAttributes, getTagAttributes, applyTagAttributes, getTagContentAttributes, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, } from './utils';
20
+ import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCustomTagType, sanitizeTagAttributes, getTagAttributes, applyTagAttributes, getTagContentAttributes, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, extractTagValues, } from './utils';
21
21
  import { acceptablePatternChecking, detectURLRegex, getCachedRegex, getCustomTagId, getPersonalizeTagInfo, getShortLinkTagInfo, patternHandlers, } from './patternHandlers';
22
22
  // Constants
23
23
  import { DETECT_LINK, EMOJI, PERSONALIZE_PTN, SHORT_LINK, SHORT_LINK_PTN, SHORT_LINK_V2, TAG_TYPE, UNSUBSCRIBE_WHATSAPP, defaultCssVariables, tagifyDefaultProps, TAG_CUSTOM_ATTRIBUTES, } from './constants';
@@ -25,7 +25,7 @@ const { CUSTOM_TAG } = TAG_TYPE;
25
25
  const { PREPARING_ST, INVALID_TAG, MESSAGE_TAG, FORCE_SHOW_TOOLTIP } = TAG_CUSTOM_ATTRIBUTES;
26
26
  const TagifyInput = forwardRef((props, ref) => {
27
27
  // Props
28
- const { initialValue, escapeHTML, status, readonly, readonlyTag, readonlyText, readonlyWhenNotEmpty, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onTagRemove, onChange, onRestoreTagProperty, onBlur, } = props;
28
+ const { initialValue, escapeHTML, status, readonly, readonlyTag, readonlyText, readonlyWhenNotEmpty, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onAddTag, onTagRemove, onChange, onRestoreTagProperty, onBlur, } = props;
29
29
  // States
30
30
  const [isLineBreak, setIsLineBreak] = useState(hasLineBreak(initialValue));
31
31
  const [tooltipRefresher, setTooltipRefresher] = useState(1);
@@ -471,7 +471,7 @@ const TagifyInput = forwardRef((props, ref) => {
471
471
  }, [onTagClick]);
472
472
  const onTagifyRemoveTag = useCallback((event) => {
473
473
  if (event.detail && onTagRemove) {
474
- onTagRemove(event.detail);
474
+ onTagRemove(event.detail, extractTagValues(event.detail.tagify));
475
475
  }
476
476
  }, [onTagRemove]);
477
477
  // Used to trigger replace URL detection and line break
@@ -780,14 +780,10 @@ const TagifyInput = forwardRef((props, ref) => {
780
780
  const hasContent = cleanValue.length > 0;
781
781
  inputEl.setAttribute('contenteditable', hasContent ? 'false' : 'true');
782
782
  }
783
- else if (typeof readonlyText === 'function') {
784
- const isReadonlyText = readonlyText(tagifyRef.current.getCleanValue());
785
- inputEl.setAttribute('contenteditable', isReadonlyText ? 'false' : 'true');
786
- }
787
783
  else if (typeof readonlyText !== 'undefined') {
788
784
  inputEl.setAttribute('contenteditable', readonlyText ? 'false' : 'true');
789
785
  }
790
- }, [readonlyText, readonlyWhenNotEmpty, tagLength]);
786
+ }, [readonlyText, readonlyWhenNotEmpty]);
791
787
  const onTagifyWrapperClick = useCallback(event => {
792
788
  event.preventDefault();
793
789
  event.stopPropagation();
@@ -874,8 +870,11 @@ const TagifyInput = forwardRef((props, ref) => {
874
870
  try {
875
871
  node.dataset.__removed_by_mutation = 'true';
876
872
  const tagData = tagifyRef.current?.getSetTagData(node);
877
- if (tagData && tagData.type === CUSTOM_TAG && !tagData?.__removed) {
878
- onTagRemove({ data: tagData });
873
+ if (tagifyRef.current &&
874
+ tagData &&
875
+ tagData.type === CUSTOM_TAG &&
876
+ !tagData?.__removed) {
877
+ onTagRemove({ data: tagData }, extractTagValues(tagifyRef.current));
879
878
  }
880
879
  }
881
880
  catch (error) {
@@ -987,6 +986,8 @@ const TagifyInput = forwardRef((props, ref) => {
987
986
  tagifyInstance.on('change', onTagifyChangedDebounce);
988
987
  tagifyInstance.on('remove', onTagifyRemoveTag);
989
988
  tagifyInstance.on('keydown', onKeyDown);
989
+ if (onAddTag)
990
+ tagifyInstance.on('add', onAddTag);
990
991
  if (onBlur)
991
992
  tagifyInstance.on('blur', onBlur);
992
993
  }
@@ -998,11 +999,14 @@ const TagifyInput = forwardRef((props, ref) => {
998
999
  tagifyInstance.off('change', onTagifyChangedDebounce);
999
1000
  tagifyInstance.off('remove', onTagifyRemoveTag);
1000
1001
  tagifyInstance.off('keydown', onKeyDown);
1002
+ if (onAddTag)
1003
+ tagifyInstance.off('add', onAddTag);
1001
1004
  if (onBlur)
1002
1005
  tagifyInstance.off('blur', onBlur);
1003
1006
  }
1004
1007
  };
1005
1008
  }, [
1009
+ onAddTag,
1006
1010
  onBlur,
1007
1011
  onTagItemClick,
1008
1012
  onInputTagifyDebounce,
@@ -15,6 +15,10 @@ export type TagStatus = (typeof TAG_STATUS)[keyof typeof TAG_STATUS];
15
15
  export type MapAttributesProps = Record<string, Record<string, any>>;
16
16
  export type StatusType = 'error' | 'success' | 'warning';
17
17
  export type BackgroundColorPersonalizeType = Exclude<keyof typeof TAG_COLOR, 'detect_link' | 'emoji' | 'shortlink'>;
18
+ export interface TagValues {
19
+ listTags: TagDataCustomize[];
20
+ value: string;
21
+ }
18
22
  /**
19
23
  * Interface defining the properties for the Tagify input component.
20
24
  * Provides configuration options and event handlers to manage Tagify's behavior and appearance.
@@ -134,11 +138,16 @@ export interface TagifyInputProps {
134
138
  * Receives the tag detail as parameter, allowing custom actions on tag click.
135
139
  */
136
140
  onTagClick?: (tagDetail: Tagify.ClickEventData<TagDataCustomize>) => void;
141
+ /**
142
+ * Event handler triggered when a tag is added.
143
+ * Receives the tag detail as parameter, allowing custom actions on tag addition.
144
+ */
145
+ onAddTag?: (event: CustomEvent<Tagify.AddEventData<TagDataCustomize>>) => void;
137
146
  /**
138
147
  * Event handler triggered when a tag is removed.
139
148
  * Receives the tag detail as parameter, allowing custom actions on tag removal.
140
149
  */
141
- onTagRemove?: (tagDetail: Tagify.RemoveEventData<TagDataCustomize>) => void;
150
+ onTagRemove?: (tagDetail: Tagify.RemoveEventData<TagDataCustomize>, values: TagValues) => void;
142
151
  /**
143
152
  * Event handler triggered when the input value changes.
144
153
  * Receives the updated input value as a string, allowing for controlled component updates.
@@ -159,7 +168,7 @@ export interface TagifyInputProps {
159
168
  /**
160
169
  * Defines whether the input text is read but not the whole tags.
161
170
  */
162
- readonlyText?: boolean | ((listTags: TagDataCustomize[]) => boolean);
171
+ readonlyText?: boolean;
163
172
  /**
164
173
  * When true, automatically sets the input text to readonly (contenteditable='false')
165
174
  * when the input is not empty (has tags or content).
@@ -1,6 +1,6 @@
1
1
  /// <reference types="yaireo__tagify" />
2
2
  import Tagify from '@yaireo/tagify';
3
- import { AcceptablePattern, TagAttribute, EmojiCollection, EmojiTag, TagDataCustomize, TagProperty, TagType } from './types';
3
+ import { AcceptablePattern, TagAttribute, EmojiCollection, EmojiTag, TagDataCustomize, TagProperty, TagType, TagValues } from './types';
4
4
  /**
5
5
  * Parses the input string and replaces matching patterns with processed tags.
6
6
  * This function iterates over predefined regex patterns and replaces each match
@@ -202,3 +202,4 @@ export declare const getCurrentSelectionAndCloneRange: () => {
202
202
  };
203
203
  export declare const handleTextNodeBackspace: (range: Range) => void;
204
204
  export declare const handleEnterWithNextTag: (range: Range) => void;
205
+ export declare const extractTagValues: (tagify: Tagify<TagDataCustomize>) => TagValues;
@@ -796,3 +796,11 @@ export const handleEnterWithNextTag = (range) => {
796
796
  return;
797
797
  insertZeroWidthSpaceBeforeTag(currentNode);
798
798
  };
799
+ export const extractTagValues = (tagify) => {
800
+ if (!tagify)
801
+ return { listTags: [], value: '' };
802
+ return {
803
+ listTags: tagify.getCleanValue(),
804
+ value: tagify.getInputValue(),
805
+ };
806
+ };
@@ -9,7 +9,7 @@ import { translate, translations } from '@antscorp/antsomi-locales';
9
9
  import { isEmpty } from 'lodash';
10
10
  import { differenceInMonths, formatUTCDateTZ, startOfMonth, subMonths, } from '@antscorp/antsomi-ui/es/utils/date';
11
11
  import { getPortalTimeZone } from '@antscorp/antsomi-ui/es/utils/portal';
12
- import { EmptyData } from '../../molecules';
12
+ import { EmptyData } from '../../molecules/EmptyData';
13
13
  import clsx from 'clsx';
14
14
  export const ActivityTimeline = (props) => {
15
15
  const { timelines = [], isLoading = false, title = translate(translations._BLOCK_TIMELINE_CUS), timezone = getPortalTimeZone(), objectName = '_THIS_PERSON_UPPERCASE', onFetchMore, eventTracking: eventTrackingProp = [], header, className, } = props;
@@ -84,10 +84,10 @@ export const ActivityTimeline = (props) => {
84
84
  lastRef(el);
85
85
  }
86
86
  };
87
- if (item.data.totalActivityCount === 1) {
87
+ if (item.data?.totalActivityCount === 1) {
88
88
  result.push(_jsx(ItemEvent, { ref: setRef, keyItem: key, item: item, objectName: customerName, eventTracking: eventTracking }, key));
89
89
  }
90
- else if (item.data.totalActivityCount > 1) {
90
+ else if (item.data?.totalActivityCount > 1) {
91
91
  result.push(_jsx(ItemGroupEvent, { ref: setRef, keyItem: key, item: item, objectName: customerName, eventTracking: eventTracking }, key));
92
92
  }
93
93
  });
@@ -1,2 +1,531 @@
1
- export { ActivityTimeline } from './ActivityTimeline';
1
+ /// <reference types="react" />
2
2
  export type { ActivityTimeLineProps } from './types';
3
+ export declare const ActivityTimeline: ((props: Partial<{
4
+ isLoading: boolean;
5
+ timelines: import("./types").Timeline[];
6
+ timelineAvailable: boolean;
7
+ timezone: string;
8
+ title: string;
9
+ objectName: string;
10
+ eventTracking: import("./types").EventTracking[];
11
+ onFetchMore: () => Promise<void>;
12
+ longDateTimeFormat: string;
13
+ header: import("react").ReactNode;
14
+ className: string;
15
+ threshold?: number | undefined;
16
+ }>) => import("react/jsx-runtime").JSX.Element) & {
17
+ Utils: Readonly<{
18
+ getInfoEvent: (params: {
19
+ eType: string;
20
+ itemEvent: Record<string, any>;
21
+ eventTracking: import("./types").EventTrackingWithMap;
22
+ config: import("../../..").AppConfigProviderProps;
23
+ customerName?: string | undefined;
24
+ }) => {
25
+ titleEvent: string;
26
+ fullContentEvent: string;
27
+ infoEvent: any;
28
+ validateExtra: any;
29
+ perShow: number;
30
+ limitShowSlide: any;
31
+ };
32
+ }>;
33
+ Constants: Readonly<{
34
+ MAP_LIST_INFO_EVENT: {
35
+ readonly 'click product': {
36
+ readonly eventType: "click product";
37
+ readonly iconCode: "_EVENT_CLICK_PRODUCT";
38
+ readonly translateCode: "_EVENT_DES_CLICK_PRODUCT";
39
+ readonly showSlideImageAndPrice: true;
40
+ readonly showQuantity: false;
41
+ readonly showRevenue: false;
42
+ readonly objectReplace: readonly ["customer_name", "product_name"];
43
+ readonly iconName: "cus highlight_alt";
44
+ readonly backgroundIcon: "#2f8635";
45
+ readonly showRedeem: false;
46
+ readonly limitShowSlide: "full";
47
+ };
48
+ readonly 'view product': {
49
+ readonly eventType: "view product";
50
+ readonly iconCode: "_EVENT_VIEW_PRODUCT";
51
+ readonly translateCode: "_EVENT_DES_VIEW_PRODUCT";
52
+ readonly showSlideImageAndPrice: true;
53
+ readonly showQuantity: false;
54
+ readonly showRevenue: false;
55
+ readonly objectReplace: readonly ["customer_name", "product_name"];
56
+ readonly iconName: "cus desktop_windows";
57
+ readonly backgroundIcon: "#2f8635";
58
+ readonly showRedeem: false;
59
+ readonly limitShowSlide: "full";
60
+ };
61
+ readonly 'add_to_cart product': {
62
+ readonly eventType: "add_to_cart product";
63
+ readonly iconCode: "_EVENT_ADD_TO_CART";
64
+ readonly translateCode: "_EVENT_DES_ADD_TO_CART_PRODUCT";
65
+ readonly showSlideImageAndPrice: true;
66
+ readonly showQuantity: false;
67
+ readonly showRevenue: false;
68
+ readonly objectReplace: readonly ["customer_name", "product_name"];
69
+ readonly iconName: "cus add_shopping_cart";
70
+ readonly backgroundIcon: "#2f8635";
71
+ readonly showRedeem: false;
72
+ readonly limitShowSlide: "full";
73
+ };
74
+ readonly 'remove_cart product': {
75
+ readonly eventType: "remove_cart product";
76
+ readonly iconCode: "_EVENT_REMOVE_CART";
77
+ readonly translateCode: "_EVENT_DES_REMOVE_CART_PRODUCT";
78
+ readonly showSlideImageAndPrice: true;
79
+ readonly showQuantity: false;
80
+ readonly showRevenue: false;
81
+ readonly objectReplace: readonly ["customer_name", "product_name"];
82
+ readonly iconName: "cus remove_shopping_cart";
83
+ readonly backgroundIcon: "#2f8635";
84
+ readonly showRedeem: false;
85
+ readonly limitShowSlide: "full";
86
+ };
87
+ readonly 'view_cart product': {
88
+ readonly eventType: "view_cart product";
89
+ readonly iconCode: "_EVENT_VIEW_CART";
90
+ readonly translateCode: "_EVENT_DES_VIEW_CART_PRODUCT";
91
+ readonly showSlideImageAndPrice: true;
92
+ readonly showQuantity: false;
93
+ readonly showRevenue: false;
94
+ readonly objectReplace: readonly ["customer_name"];
95
+ readonly iconName: "cus shopping_cart";
96
+ readonly backgroundIcon: "#2f8635";
97
+ readonly showRedeem: false;
98
+ readonly limitShowSlide: "full";
99
+ };
100
+ readonly 'checkout_cart product': {
101
+ readonly eventType: "checkout_cart product";
102
+ readonly iconCode: "_EVENT_CHECKOUT_CART";
103
+ readonly translateCode: "_EVENT_DES_CHECKOUT_CART_PRODUCT";
104
+ readonly showSlideImageAndPrice: false;
105
+ readonly showQuantity: false;
106
+ readonly showRevenue: false;
107
+ readonly objectReplace: readonly ["customer_name"];
108
+ readonly iconName: "cus fact_check";
109
+ readonly backgroundIcon: "#2f8635";
110
+ readonly showRedeem: false;
111
+ readonly limitShowSlide: "full";
112
+ };
113
+ readonly 'payment product': {
114
+ readonly eventType: "payment product";
115
+ readonly iconCode: "_EVENT_PAYMENT_PRODUCT";
116
+ readonly translateCode: "_EVENT_DES_PAYMENT_PRODUCT";
117
+ readonly showSlideImageAndPrice: false;
118
+ readonly showQuantity: false;
119
+ readonly showRevenue: false;
120
+ readonly objectReplace: readonly ["customer_name"];
121
+ readonly iconName: "cus payment";
122
+ readonly backgroundIcon: "#2f8635";
123
+ readonly showRedeem: false;
124
+ readonly limitShowSlide: "full";
125
+ };
126
+ readonly 'order_completed product': {
127
+ readonly eventType: "order_completed product";
128
+ readonly iconCode: "_EVENT_ORDER_COMPETE";
129
+ readonly translateCode: "_EVENT_DES_ORDER_COMPLETE_PRODUCT";
130
+ readonly showSlideImageAndPrice: true;
131
+ readonly showQuantity: true;
132
+ readonly showRevenue: false;
133
+ readonly objectReplace: readonly ["customer_name", "order_id"];
134
+ readonly iconName: "cus shopping_bag";
135
+ readonly backgroundIcon: "#2f8635";
136
+ readonly showRedeem: false;
137
+ readonly limitShowSlide: "full";
138
+ };
139
+ readonly 'purchase product': {
140
+ readonly eventType: "purchase product";
141
+ readonly iconCode: "_EVENT_PURCHASE_PRODUCT";
142
+ readonly translateCode: "_EVENT_DES_PURCHASE_PRODUCT";
143
+ readonly showSlideImageAndPrice: true;
144
+ readonly showQuantity: true;
145
+ readonly showRevenue: true;
146
+ readonly objectReplace: readonly ["customer_name", "num_of_products", "order_id"];
147
+ readonly iconName: "cus shopping_cart";
148
+ readonly backgroundIcon: "#2f8635";
149
+ readonly showRedeem: false;
150
+ readonly limitShowSlide: "full";
151
+ };
152
+ readonly 'update order': {
153
+ readonly eventType: "update order";
154
+ readonly iconCode: "_EVENT_UPDATE_ORDER";
155
+ readonly translateCode: "_EVENT_DES_UPDATE_ORDER";
156
+ readonly showSlideImageAndPrice: false;
157
+ readonly showQuantity: false;
158
+ readonly showRevenue: false;
159
+ readonly objectReplace: readonly ["customer_name", "order_id"];
160
+ readonly iconName: "cus shopping_cart";
161
+ readonly backgroundIcon: "#2f8635";
162
+ readonly showRedeem: false;
163
+ readonly limitShowSlide: "full";
164
+ };
165
+ readonly 'refund order': {
166
+ readonly eventType: "refund order";
167
+ readonly iconCode: "_EVENT_REFUND_ORDER";
168
+ readonly translateCode: "_EVENT_DES_REFUND_ORDER";
169
+ readonly showSlideImageAndPrice: false;
170
+ readonly showQuantity: false;
171
+ readonly showRevenue: false;
172
+ readonly objectReplace: readonly ["customer_name", "order_id"];
173
+ readonly iconName: "cus payment";
174
+ readonly backgroundIcon: "#2f8635";
175
+ readonly showRedeem: false;
176
+ readonly limitShowSlide: "full";
177
+ };
178
+ readonly 'cancel order': {
179
+ readonly eventType: "cancel order";
180
+ readonly iconCode: "_EVENT_CANCEL_ORDER";
181
+ readonly translateCode: "_EVENT_DES_CANCEL_ORDER";
182
+ readonly showSlideImageAndPrice: false;
183
+ readonly showQuantity: false;
184
+ readonly showRevenue: false;
185
+ readonly objectReplace: readonly ["customer_name", "order_id"];
186
+ readonly iconName: "cus remove_shopping_cart";
187
+ readonly backgroundIcon: "#2f8635";
188
+ readonly showRedeem: false;
189
+ readonly limitShowSlide: "full";
190
+ };
191
+ readonly 'purchase_offline transaction': {
192
+ readonly eventType: "purchase_offline transaction";
193
+ readonly iconCode: "_EVENT_PURCHASE_OFFLINE";
194
+ readonly translateCode: "_EVENT_DES_PURCHASE_OFFLINE";
195
+ readonly showSlideImageAndPrice: true;
196
+ readonly showQuantity: true;
197
+ readonly showRevenue: true;
198
+ readonly objectReplace: readonly ["customer_name", "num_of_products", "transaction_id", "store_link"];
199
+ readonly iconName: "cus store";
200
+ readonly backgroundIcon: "#2f8635";
201
+ readonly showRedeem: false;
202
+ readonly limitShowSlide: "full";
203
+ };
204
+ readonly 'update transaction': {
205
+ readonly eventType: "update transaction";
206
+ readonly iconCode: "_EVENT_DES_TRANSACTION_COMMON";
207
+ readonly translateCode: "_EVENT_DES_TRANSACTION_COMMON";
208
+ readonly showSlideImageAndPrice: true;
209
+ readonly showQuantity: true;
210
+ readonly showRevenue: true;
211
+ readonly objectReplace: readonly ["event_name", "customer_name", "num_of_products", "transaction_id", "store_link"];
212
+ readonly iconName: "cus store";
213
+ readonly backgroundIcon: "#2f8635";
214
+ readonly showRedeem: false;
215
+ readonly limitShowSlide: "full";
216
+ };
217
+ readonly 'completed transaction': {
218
+ readonly eventType: "update transaction";
219
+ readonly iconCode: "_EVENT_DES_TRANSACTION_COMMON";
220
+ readonly translateCode: "_EVENT_DES_TRANSACTION_COMMON";
221
+ readonly showSlideImageAndPrice: true;
222
+ readonly showQuantity: true;
223
+ readonly showRevenue: true;
224
+ readonly objectReplace: readonly ["event_name", "customer_name", "num_of_products", "transaction_id", "store_link"];
225
+ readonly iconName: "cus store";
226
+ readonly backgroundIcon: "#2f8635";
227
+ readonly showRedeem: false;
228
+ readonly limitShowSlide: "full";
229
+ };
230
+ readonly 'purchase transaction': {
231
+ readonly eventType: "purchase transaction";
232
+ readonly iconCode: "_EVENT_ONLINE_TRANSACTION";
233
+ readonly translateCode: "_EVENT_DES_ONLINE_TRANSACTION";
234
+ readonly showSlideImageAndPrice: true;
235
+ readonly showQuantity: true;
236
+ readonly showRevenue: true;
237
+ readonly objectReplace: readonly ["customer_name", "num_of_products", "order_id"];
238
+ readonly iconName: "cus shopping_cart";
239
+ readonly backgroundIcon: "#2f8635";
240
+ readonly showRedeem: false;
241
+ readonly limitShowSlide: "full";
242
+ };
243
+ readonly 'view page': {
244
+ readonly eventType: "view page";
245
+ readonly iconCode: "_EVENT_VIEW_PAGE";
246
+ readonly translateCode: "_EVENT_DES_VIEW_PAGE";
247
+ readonly showSlideImageAndPrice: false;
248
+ readonly showQuantity: false;
249
+ readonly showRevenue: false;
250
+ readonly objectReplace: readonly ["customer_name", "page_type", "event_source_name"];
251
+ readonly iconName: "cus web_asset";
252
+ readonly backgroundIcon: "#005fd8";
253
+ readonly showRedeem: false;
254
+ readonly limitShowSlide: "full";
255
+ };
256
+ readonly 'search product': {
257
+ readonly eventType: "search product";
258
+ readonly iconCode: "_EVENT_SEARCH_PRODUCT";
259
+ readonly translateCode: "_EVENT_DES_SEARCH_PRODUCT";
260
+ readonly showSlideImageAndPrice: false;
261
+ readonly showQuantity: false;
262
+ readonly showRevenue: false;
263
+ readonly objectReplace: readonly ["customer_name", "keywords"];
264
+ readonly iconName: "cus search";
265
+ readonly backgroundIcon: "#005fd8";
266
+ readonly showRedeem: false;
267
+ readonly limitShowSlide: "full";
268
+ };
269
+ readonly 'product_list_view product': {
270
+ readonly eventType: "product_list_view product";
271
+ readonly iconCode: "_EVENT_PRODUCT_LIST";
272
+ readonly translateCode: "_EVENT_DES_VIEW_PRODUCT_LIST";
273
+ readonly showSlideImageAndPrice: false;
274
+ readonly showQuantity: false;
275
+ readonly showRevenue: false;
276
+ readonly objectReplace: readonly ["customer_name", "product_list"];
277
+ readonly iconName: "cus list";
278
+ readonly backgroundIcon: "#005fd8";
279
+ readonly showRedeem: false;
280
+ readonly limitShowSlide: "full";
281
+ };
282
+ readonly 'send ticket': {
283
+ readonly eventType: "send ticket";
284
+ readonly iconCode: "_EVENT_SEND_TICKET";
285
+ readonly translateCode: "_EVENT_DES_SEND_TICKET";
286
+ readonly showSlideImageAndPrice: false;
287
+ readonly showQuantity: false;
288
+ readonly showRevenue: false;
289
+ readonly objectReplace: readonly ["customer_name", "array_ticket_names"];
290
+ readonly iconName: "cus confirmation_number";
291
+ readonly backgroundIcon: "#add8e6a";
292
+ readonly showRedeem: false;
293
+ readonly limitShowSlide: "full";
294
+ };
295
+ readonly 'call_in call': {
296
+ readonly eventType: "call_in call";
297
+ readonly iconCode: "_EVENT_CALL_IN";
298
+ readonly translateCode: "_EVENT_DES_CAILL_IN_CALL";
299
+ readonly showSlideImageAndPrice: false;
300
+ readonly showQuantity: false;
301
+ readonly showRevenue: false;
302
+ readonly objectReplace: readonly ["customer_name"];
303
+ readonly iconName: "cus phone_callback";
304
+ readonly backgroundIcon: "#ffe4c4";
305
+ readonly showRedeem: false;
306
+ readonly limitShowSlide: "full";
307
+ };
308
+ readonly 'call_out call': {
309
+ readonly eventType: "call_out call";
310
+ readonly iconCode: "_EVENT_CALL_OUT";
311
+ readonly translateCode: "_EVENT_DES_CALL_OUT_CALL";
312
+ readonly showSlideImageAndPrice: false;
313
+ readonly showQuantity: false;
314
+ readonly showRevenue: false;
315
+ readonly objectReplace: readonly ["customer_name"];
316
+ readonly iconName: "cus call";
317
+ readonly backgroundIcon: "#ffe4c4";
318
+ readonly showRedeem: false;
319
+ readonly limitShowSlide: "full";
320
+ };
321
+ readonly 'chat conversation': {
322
+ readonly eventType: "chat conversation";
323
+ readonly iconCode: "_EVENT_CHAT_CONVERSATION";
324
+ readonly translateCode: "_EVENT_DES_CHAT_CONVERSATION";
325
+ readonly showSlideImageAndPrice: false;
326
+ readonly showQuantity: false;
327
+ readonly showRevenue: false;
328
+ readonly objectReplace: readonly ["customer_name", "channel_name"];
329
+ readonly iconName: "cus chat_bubble_outline";
330
+ readonly backgroundIcon: "#a0a9aa";
331
+ readonly showRedeem: false;
332
+ readonly limitShowSlide: "full";
333
+ };
334
+ readonly 'identify user': {
335
+ readonly eventType: "identify user";
336
+ readonly iconCode: "_EVENT_IDENTIFY_USER";
337
+ readonly translateCode: "_EVENT_DES_IDENTIFY_USER";
338
+ readonly showSlideImageAndPrice: false;
339
+ readonly showQuantity: false;
340
+ readonly showRevenue: false;
341
+ readonly objectReplace: readonly ["user_id"];
342
+ readonly iconName: "cus how_to_reg";
343
+ readonly backgroundIcon: "#005eb8";
344
+ readonly showRedeem: false;
345
+ readonly limitShowSlide: "full";
346
+ };
347
+ readonly 'reset_anonymous_id user': {
348
+ readonly eventType: "reset_anonymous_id user";
349
+ readonly iconCode: "_EVENT_RESET_ANONYMOUS_USER";
350
+ readonly translateCode: "_EVENT_DES_RESET_ANONYMOUS_ID_USER";
351
+ readonly showSlideImageAndPrice: false;
352
+ readonly showQuantity: false;
353
+ readonly showRevenue: false;
354
+ readonly objectReplace: readonly ["customer_name", "user_id"];
355
+ readonly iconName: "cus person_add_disabled";
356
+ readonly backgroundIcon: "#005eb8";
357
+ readonly showRedeem: false;
358
+ readonly limitShowSlide: "full";
359
+ };
360
+ readonly 'register lead': {
361
+ readonly eventType: "register lead";
362
+ readonly iconCode: "_EVENT_REGISTER_LEAD";
363
+ readonly translateCode: "_EVENT_DES_REGISTER_LEAD";
364
+ readonly showSlideImageAndPrice: false;
365
+ readonly showQuantity: false;
366
+ readonly showRevenue: false;
367
+ readonly objectReplace: readonly ["customer_name"];
368
+ readonly iconName: "cus assignment_ind";
369
+ readonly backgroundIcon: "#005eb8";
370
+ readonly showRedeem: false;
371
+ readonly limitShowSlide: "full";
372
+ };
373
+ readonly 'sign_in user': {
374
+ readonly eventType: "sign_in user";
375
+ readonly iconCode: "_EVENT_SIGNIN_USER";
376
+ readonly translateCode: "_EVENT_DES_SIGN_IN_USER";
377
+ readonly showSlideImageAndPrice: false;
378
+ readonly showQuantity: false;
379
+ readonly showRevenue: false;
380
+ readonly objectReplace: readonly ["customer_name"];
381
+ readonly iconName: "cus account_circle";
382
+ readonly backgroundIcon: "#005eb8";
383
+ readonly showRedeem: false;
384
+ readonly limitShowSlide: "full";
385
+ };
386
+ readonly 'view pageview': {
387
+ readonly eventType: "view pageview";
388
+ readonly iconCode: "_EVENT_VIEW_PAGE";
389
+ readonly translateCode: "_EVENT_DES_VIEW_PAGE";
390
+ readonly showSlideImageAndPrice: false;
391
+ readonly showQuantity: false;
392
+ readonly showRevenue: false;
393
+ readonly objectReplace: readonly ["customer_name", "page_type", "event_source_name"];
394
+ readonly iconName: "cus web_asset";
395
+ readonly backgroundIcon: "#005fd8";
396
+ readonly showRedeem: false;
397
+ readonly limitShowSlide: "full";
398
+ };
399
+ readonly 'view screenview': {
400
+ readonly eventType: "view screenview";
401
+ readonly iconCode: "";
402
+ readonly translateCode: "_EVENT_VIEW_SCREEN";
403
+ readonly showSlideImageAndPrice: false;
404
+ readonly showQuantity: false;
405
+ readonly showRevenue: false;
406
+ readonly objectReplace: readonly ["customer_name", "screen_type", "event_source_name"];
407
+ readonly iconName: "cus mobile_friendly";
408
+ readonly backgroundIcon: "#005fd8";
409
+ readonly showRedeem: false;
410
+ readonly limitShowSlide: "full";
411
+ };
412
+ readonly 'product_list_view browsing': {
413
+ readonly eventType: "product_list_view browsing";
414
+ readonly iconCode: "_EVENT_VIEW_PAGE";
415
+ readonly translateCode: "_EVENT_VIEW_PRODUCT_LIST";
416
+ readonly showSlideImageAndPrice: false;
417
+ readonly showQuantity: false;
418
+ readonly showRevenue: false;
419
+ readonly objectReplace: readonly ["customer_name"];
420
+ readonly iconName: "cus category";
421
+ readonly backgroundIcon: "#2f8635";
422
+ readonly showRedeem: false;
423
+ readonly limitShowSlide: "full";
424
+ };
425
+ readonly 'view home_page': {
426
+ readonly eventType: "view home_page";
427
+ readonly iconCode: "_EVENT_VIEW_PAGE";
428
+ readonly translateCode: "_EVENT_VIEW_HOME_PAGE";
429
+ readonly showSlideImageAndPrice: false;
430
+ readonly showQuantity: false;
431
+ readonly showRevenue: false;
432
+ readonly objectReplace: readonly ["customer_name"];
433
+ readonly iconName: "cus desktop_windows";
434
+ readonly backgroundIcon: "#005fd8";
435
+ readonly showRedeem: false;
436
+ readonly limitShowSlide: "full";
437
+ };
438
+ readonly 'redeem_point user': {
439
+ readonly eventType: "redeem_point user";
440
+ readonly iconCode: "_EVENT_REDEEM_POINT";
441
+ readonly translateCode: "_EVENT_REDEEM_POINT";
442
+ readonly showSlideImageAndPrice: false;
443
+ readonly showQuantity: false;
444
+ readonly showRevenue: false;
445
+ readonly objectReplace: readonly ["customer_name", "x_point", "transaction_id", "store_link"];
446
+ readonly iconName: "cus redeem";
447
+ readonly backgroundIcon: "#2f8635";
448
+ readonly showRedeem: true;
449
+ };
450
+ readonly 'earn_point user': {
451
+ readonly eventType: "earn_point user";
452
+ readonly iconCode: "_EVENT_EARN_POINT";
453
+ readonly translateCode: "_EVENT_EARN_POINT";
454
+ readonly showSlideImageAndPrice: false;
455
+ readonly showQuantity: false;
456
+ readonly showRevenue: false;
457
+ readonly objectReplace: readonly ["customer_name", "x_point", "transaction_id", "store_link"];
458
+ readonly iconName: "cus redeem";
459
+ readonly backgroundIcon: "#2f8635";
460
+ readonly showRedeem: true;
461
+ };
462
+ readonly 'product_search browsing': {
463
+ readonly eventType: "product_search browsing";
464
+ readonly iconCode: "_EVENT_BROWSING_PRODUCT_SEARCH";
465
+ readonly translateCode: "_EVENT_DES_BROWSING_PRODUCT_SEARCH";
466
+ readonly showSlideImageAndPrice: true;
467
+ readonly showQuantity: false;
468
+ readonly showRevenue: false;
469
+ readonly objectReplace: readonly ["customer_name", "keyword"];
470
+ readonly iconName: "cus list";
471
+ readonly backgroundIcon: "#005fd8";
472
+ readonly showRedeem: false;
473
+ readonly limitShowSlide: 20;
474
+ };
475
+ readonly 'product_list_filter browsing': {
476
+ readonly eventType: "product_list_filter browsing";
477
+ readonly iconCode: "_EVENT_BROWSING_PRODUCT_LIST_FILTER";
478
+ readonly translateCode: "_EVENT_DES_BROWSING_PRODUCT_LIST_FILTER";
479
+ readonly showSlideImageAndPrice: true;
480
+ readonly showQuantity: false;
481
+ readonly showRevenue: false;
482
+ readonly objectReplace: readonly ["customer_name"];
483
+ readonly iconName: "cus list";
484
+ readonly backgroundIcon: "#005fd8";
485
+ readonly showRedeem: false;
486
+ readonly limitShowSlide: 20;
487
+ };
488
+ readonly 'received evoucher': {
489
+ readonly eventType: "received evoucher";
490
+ readonly iconCode: "_EVENT_EVOUCHER_RECEIVED";
491
+ readonly translateCode: "_EVENT_EVOUCHER_RECEIVED";
492
+ readonly showSlideImageAndPrice: true;
493
+ readonly showQuantity: false;
494
+ readonly showRevenue: false;
495
+ readonly objectReplace: readonly ["customer_name", "x_code", "campaign_name"];
496
+ readonly iconName: "cus confirmation_number";
497
+ readonly backgroundIcon: "#2f8635";
498
+ readonly showRedeem: false;
499
+ readonly limitShowSlide: "full";
500
+ };
501
+ readonly 'redeem evoucher': {
502
+ readonly eventType: "redeem evoucher";
503
+ readonly iconCode: "_EVENT_EVOUCHER_REDEEM";
504
+ readonly translateCode: "_EVENT_EVOUCHER_REDEEM_MISS_DATA";
505
+ readonly missDataTranslateCode: "_EVENT_EVOUCHER_REDEEM_MISS_DATA";
506
+ readonly showSlideImageAndPrice: true;
507
+ readonly showQuantity: false;
508
+ readonly showRevenue: false;
509
+ readonly objectReplace: readonly ["customer_name", "store_link"];
510
+ readonly iconName: "cus confirmation_number";
511
+ readonly backgroundIcon: "#2f8635";
512
+ readonly showRedeem: false;
513
+ readonly limitShowSlide: "full";
514
+ };
515
+ readonly 'start_session user': {
516
+ readonly eventType: "start_session user";
517
+ readonly iconCode: "_EVENT_USER_START_SESSION";
518
+ readonly translateCode: "_EVENT_USER_START_SESSION";
519
+ readonly missDataTranslateCode: "_EVENT_EVOUCHER_REDEEM_MISS_DATA";
520
+ readonly showSlideImageAndPrice: true;
521
+ readonly showQuantity: false;
522
+ readonly showRevenue: false;
523
+ readonly objectReplace: readonly ["customer_name"];
524
+ readonly iconName: "cus preview";
525
+ readonly backgroundIcon: "#005eb8";
526
+ readonly showRedeem: false;
527
+ readonly limitShowSlide: "full";
528
+ };
529
+ };
530
+ }>;
531
+ };
@@ -1 +1,9 @@
1
- export { ActivityTimeline } from './ActivityTimeline';
1
+ import { getInfoEvent } from './utils';
2
+ import { MAP_LIST_INFO_EVENT } from './constants';
3
+ import { ActivityTimeline as ActivityTimelineComponent } from './ActivityTimeline';
4
+ const Utils = Object.freeze({ getInfoEvent });
5
+ const Constants = Object.freeze({ MAP_LIST_INFO_EVENT });
6
+ export const ActivityTimeline = Object.assign(ActivityTimelineComponent, {
7
+ Utils,
8
+ Constants,
9
+ });
@@ -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,12 @@ 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') {
226
+ data.customer_name = translate(translations._THIS_PERSON_UPPERCASE, 'This user');
228
227
  data.event_source_name = safeParse(itemEvent.insightPropertyName, 'N/A');
228
+ if (validateExtra.screen_type) {
229
+ data.screen_type = validateExtra.screen_type;
230
+ }
229
231
  }
230
232
  };
231
233
  const handleEventTrackingCode = (eventTracking, keyTitleEvent, validateExtra, valuesReplace, infoEvent, config) => {
@@ -3,4 +3,5 @@
3
3
  * Asynchronously loads the component for TemplateListing
4
4
  *
5
5
  */
6
+ /// <reference types="react" />
6
7
  export declare const TemplateListing: (props: import("./types").TemplateListingProps<{}>) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.7-beta.7",
3
+ "version": "1.3.7-beta.9",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -14,6 +14,9 @@
14
14
  "es",
15
15
  "dist"
16
16
  ],
17
+ "engines": {
18
+ "node": "20.x"
19
+ },
17
20
  "main": "es/index.js",
18
21
  "module": "es/index.js",
19
22
  "unpkg": "dist/index.js",