@antscorp/antsomi-ui 2.0.41 → 2.0.42

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.
@@ -10,6 +10,7 @@ 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
12
  import { EmptyData } from '../../molecules';
13
+ import clsx from 'clsx';
13
14
  export const ActivityTimeline = (props) => {
14
15
  const { timelines = [], isLoading = false, title = translate(translations._BLOCK_TIMELINE_CUS), timezone = getPortalTimeZone(), objectName = '_THIS_PERSON_UPPERCASE', onFetchMore, eventTracking: eventTrackingProp = [], header, className, } = props;
15
16
  let { timelineAvailable } = props;
@@ -96,5 +97,5 @@ export const ActivityTimeline = (props) => {
96
97
  }
97
98
  return (_jsxs(_Fragment, { children: [header, showMainContent(timelines, objectName), showBottomComponent()] }));
98
99
  };
99
- return (_jsxs(StyledRoot, { className: className, children: [_jsx(StyldTitle, { children: title }), renderContent()] }));
100
+ return (_jsxs(StyledRoot, { className: clsx(className, 'activity-timeline'), children: [_jsx(StyldTitle, { children: title }), renderContent()] }));
100
101
  };
@@ -39,18 +39,13 @@ export const getValuesReplace = (objectReplace, data) => {
39
39
  });
40
40
  return values;
41
41
  };
42
- const sliceName = (name, positionSlice) => {
43
- const validateName = (name || 'N/A').replace(/https|http|www|\/\/|:/gi, '');
44
- if (positionSlice === 0 ||
45
- validateName === 'N/A' ||
46
- (positionSlice > validateName.length && validateName !== 'N/A') ||
47
- positionSlice === validateName.length) {
48
- return name;
49
- }
50
- if (validateName[positionSlice] === ' ') {
51
- return `${validateName.slice(0, positionSlice - 1)}...`;
52
- }
53
- return `${validateName.slice(0, positionSlice)}...`;
42
+ const parseUrl = (params) => {
43
+ const { name = 'N/A' } = params;
44
+ const validateName = name.replace(/https|http|www|\/\/|:/gi, '');
45
+ if (validateName !== 'N/A') {
46
+ return validateName;
47
+ }
48
+ return name;
54
49
  };
55
50
  export const getStringHtmlByType = (item, eType = 'product') => {
56
51
  const validateDate = item || {};
@@ -63,7 +58,7 @@ export const getStringHtmlByType = (item, eType = 'product') => {
63
58
  return `<span class="title-no-url">${label}</span>`;
64
59
  }
65
60
  if (label === 'N/A') {
66
- return `<a class="title-have-url" href=${encodeURI(url)} target="_blank">${sliceName(url, 20)}</a>`;
61
+ return `<a class="title-have-url" href=${encodeURI(url)} target="_blank">${parseUrl({ name: url })}</a>`;
67
62
  }
68
63
  return `<a class="title-have-url" href=${url} target="_blank">${url}</a>`;
69
64
  };
@@ -179,6 +174,8 @@ export const getInfoEvent = (eType, itemEvent, eventTracking, customerName, conf
179
174
  itemEvent.pageType === 'view' ||
180
175
  itemEvent.pageType === 'add_to_cart') {
181
176
  // PAGETYPE CLICK OR VIEW
177
+ // eslint-disable-next-line no-console
178
+ console.log('itemEvent.items[0]', itemEvent);
182
179
  data.product_name = getStringHtmlByType(itemEvent.items[0], eType);
183
180
  }
184
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "2.0.41",
3
+ "version": "2.0.42",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -157,16 +157,16 @@
157
157
  "@babel/preset-typescript": "^7.23.3",
158
158
  "@commitlint/cli": "17.5.0",
159
159
  "@commitlint/config-conventional": "17.4.4",
160
- "@storybook/addon-docs": "^8.2.9",
160
+ "@storybook/addon-docs": "^8.4.2",
161
161
  "@storybook/addon-essentials": "^8.2.9",
162
- "@storybook/addon-links": "^8.2.9",
162
+ "@storybook/addon-links": "^8.4.2",
163
163
  "@storybook/addon-styling-webpack": "^1.0.0",
164
164
  "@storybook/addon-webpack5-compiler-babel": "^3.0.3",
165
- "@storybook/blocks": "^8.2.9",
166
- "@storybook/manager-api": "^8.2.9",
167
- "@storybook/react": "^8.2.9",
168
- "@storybook/react-webpack5": "^8.2.9",
169
- "@storybook/theming": "^8.2.9",
165
+ "@storybook/blocks": "^8.4.2",
166
+ "@storybook/manager-api": "^8.4.2",
167
+ "@storybook/react": "^8.4.2",
168
+ "@storybook/react-webpack5": "^8.4.2",
169
+ "@storybook/theming": "^8.4.2",
170
170
  "@testing-library/dom": "^10.4.0",
171
171
  "@testing-library/jest-dom": "^6.5.0",
172
172
  "@testing-library/react": "^16.0.0",
@@ -227,7 +227,7 @@
227
227
  "react-router-dom": "5.1.0 || 6.14.2",
228
228
  "sass": "^1.77.8",
229
229
  "sass-loader": "^16.0.1",
230
- "storybook": "8.4.2",
230
+ "storybook": "^8.4.2",
231
231
  "style-loader": "^4.0.0",
232
232
  "styled-components": "^5.3.9",
233
233
  "terser-webpack-plugin": "^5.3.10",