@licklist/design 0.69.6 → 0.69.7
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,6 +1,7 @@
|
|
|
1
1
|
import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper';
|
|
2
2
|
export declare function formatContent(content: any, maxSymbols: any): any;
|
|
3
3
|
export declare const formatContentWithoutTags: (content: any, maxLength?: number) => any;
|
|
4
|
+
export declare const MIN_EVENT_DESCRIPTION_SIZE = 150;
|
|
4
5
|
export declare const EVENT_DESCRIPTION_SIZE = 350;
|
|
5
6
|
/**
|
|
6
7
|
* Calculate the total number of views from the given dates and event statistic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAA;AAGjG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAA;AAGjG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,wBAAwB,2CAkBpC,CAAA;AAED,eAAO,MAAM,0BAA0B,MAAM,CAAA;AAC7C,eAAO,MAAM,sBAAsB,MAAM,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UACvB,MAAM,EAAE,kBACC,cAAc,KAC7B,MAIA,CAAA;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,UAC/B,MAAM,EAAE,kBACC,cAAc,KAC7B,CAAC,MAAM,EAAE,MAAM,CAejB,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM,KACX;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;CA4BpB,CAAA"}
|
|
@@ -59,9 +59,13 @@ var formatContentWithoutTags = function(content) {
|
|
|
59
59
|
var text = content.replace(/<[^>]*>/g, '');
|
|
60
60
|
var trimmedText = text.trim().replace(/ |[^a-zA-Z0-9\s]/g, '').replace(/\s\s+/g, ' ');
|
|
61
61
|
var words = trimmedText.slice(0, maxLength).split(' ');
|
|
62
|
+
var contentWithMinLength = content.slice(0, MIN_EVENT_DESCRIPTION_SIZE);
|
|
62
63
|
var index = String(content).indexOf(words[words.length - 2]);
|
|
63
|
-
|
|
64
|
+
var slicedContent = content.slice(0, index);
|
|
65
|
+
var minSizeContent = contentWithMinLength.length > slicedContent.length ? contentWithMinLength : slicedContent;
|
|
66
|
+
return minSizeContent.concat('...');
|
|
64
67
|
};
|
|
68
|
+
var MIN_EVENT_DESCRIPTION_SIZE = 150;
|
|
65
69
|
var EVENT_DESCRIPTION_SIZE = 350;
|
|
66
70
|
/**
|
|
67
71
|
* Calculate the total number of views from the given dates and event statistic.
|
|
@@ -136,4 +140,4 @@ var EVENT_DESCRIPTION_SIZE = 350;
|
|
|
136
140
|
};
|
|
137
141
|
};
|
|
138
142
|
|
|
139
|
-
export { EVENT_DESCRIPTION_SIZE, calculateTotalSoldAndAmount, calculateTotalViews, formatContent, formatContentWithoutTags, getStatisticInfo };
|
|
143
|
+
export { EVENT_DESCRIPTION_SIZE, MIN_EVENT_DESCRIPTION_SIZE, calculateTotalSoldAndAmount, calculateTotalViews, formatContent, formatContentWithoutTags, getStatisticInfo };
|
package/package.json
CHANGED
|
@@ -21,10 +21,14 @@ export const formatContentWithoutTags = (
|
|
|
21
21
|
.replace(/\s\s+/g, ' ')
|
|
22
22
|
|
|
23
23
|
const words = trimmedText.slice(0, maxLength).split(' ')
|
|
24
|
+
const contentWithMinLength = content.slice(0, MIN_EVENT_DESCRIPTION_SIZE)
|
|
24
25
|
const index = String(content).indexOf(words[words.length - 2])
|
|
25
|
-
|
|
26
|
+
const slicedContent = content.slice(0, index)
|
|
27
|
+
const minSizeContent = contentWithMinLength.length > slicedContent.length ? contentWithMinLength : slicedContent
|
|
28
|
+
return minSizeContent.concat('...')
|
|
26
29
|
}
|
|
27
30
|
|
|
31
|
+
export const MIN_EVENT_DESCRIPTION_SIZE = 150
|
|
28
32
|
export const EVENT_DESCRIPTION_SIZE = 350
|
|
29
33
|
|
|
30
34
|
/**
|
package/yarn.lock
CHANGED
|
@@ -8187,8 +8187,8 @@ __metadata:
|
|
|
8187
8187
|
linkType: hard
|
|
8188
8188
|
|
|
8189
8189
|
"chromatic@npm:^11.4.0":
|
|
8190
|
-
version: 11.12.
|
|
8191
|
-
resolution: "chromatic@npm:11.12.
|
|
8190
|
+
version: 11.12.6
|
|
8191
|
+
resolution: "chromatic@npm:11.12.6"
|
|
8192
8192
|
peerDependencies:
|
|
8193
8193
|
"@chromatic-com/cypress": ^0.*.* || ^1.0.0
|
|
8194
8194
|
"@chromatic-com/playwright": ^0.*.* || ^1.0.0
|
|
@@ -8201,7 +8201,7 @@ __metadata:
|
|
|
8201
8201
|
chroma: dist/bin.js
|
|
8202
8202
|
chromatic: dist/bin.js
|
|
8203
8203
|
chromatic-cli: dist/bin.js
|
|
8204
|
-
checksum: 10c0/
|
|
8204
|
+
checksum: 10c0/7d161c52bc239ac6e8380f9a64533dd3792819d8f103d0083a805d5c9ece0844787eedd45c19c41e69d0ef0a3756051fa3e5c1f2fc9630d60f2ada4d5452e929
|
|
8205
8205
|
languageName: node
|
|
8206
8206
|
linkType: hard
|
|
8207
8207
|
|
|
@@ -9808,9 +9808,9 @@ __metadata:
|
|
|
9808
9808
|
linkType: hard
|
|
9809
9809
|
|
|
9810
9810
|
"electron-to-chromium@npm:^1.3.564, electron-to-chromium@npm:^1.5.28":
|
|
9811
|
-
version: 1.5.
|
|
9812
|
-
resolution: "electron-to-chromium@npm:1.5.
|
|
9813
|
-
checksum: 10c0/
|
|
9811
|
+
version: 1.5.41
|
|
9812
|
+
resolution: "electron-to-chromium@npm:1.5.41"
|
|
9813
|
+
checksum: 10c0/97b82383963029e6ed0bd7a71eb527f640c8cf658c9e43c776b0257b3c65e366590ac54135683a21e4474a156b8be78717d6e94d3c1def84b69f92bf48f2390f
|
|
9814
9814
|
languageName: node
|
|
9815
9815
|
linkType: hard
|
|
9816
9816
|
|