@licklist/design 0.44.537 → 0.44.538

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 +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,CAAC;AAGlG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,wBAAwB,2CASpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM;;;;CA6Bb,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAGlG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,wBAAwB,2CAYpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM;;;;CA6Bb,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon");exports.EVENT_DESCRIPTION_SIZE=300,exports.formatContent=function(t,o){return t?t.length>o?"".concat(t.slice(0,o),"..."):t:""},exports.formatContentWithoutTags=function(t,o){if(void 0===o&&(o=300),!t)return"";if(t<o)return t;var r=t.replace(/<[^>]*>/g,"").trim().replace(/\s\s+/g," ").slice(0,o).split(" "),e=String(t).indexOf(r[r.length-2]);return t.slice(0,e).concat("...")},exports.getStatisticInfo=function(r,e){var i,n,a,l,u=0,c=0;if(!r)return{totalViews:0,totalSold:0,totalAmount:0};var s=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_FORMAT);l=(null===(i=r.views[s])||void 0===i?void 0:i.pageViews)||0;var d=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_TIME_FULL_FORMAT);return null===(a=null===(n=null==r?void 0:r.productCategorySummary)||void 0===n?void 0:n[d])||void 0===a||a.forEach((function(t){var o=t.totalPerCategory,r=t.productsSummary,e=void 0===r?[]:r;c+=o||0,null==e||e.forEach((function(t){var o=t.productsSold;u+=o}))})),{totalViews:l,totalSold:u,totalAmount:c}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon");exports.EVENT_DESCRIPTION_SIZE=300,exports.formatContent=function(t,o){return t?t.length>o?"".concat(t.slice(0,o),"..."):t:""},exports.formatContentWithoutTags=function(t,o){if(void 0===o&&(o=300),!t)return"";if(t<o)return t;var r=t.replace(/<[^>]*>/g,"").trim().replace(/&nbsp;|[^a-zA-Z0-9\s]/g,"").replace(/\s\s+/g," ").slice(0,o).split(" "),e=String(t).indexOf(r[r.length-2]);return t.slice(0,e).concat("...")},exports.getStatisticInfo=function(r,e){var i,n,a,l,u=0,s=0;if(!r)return{totalViews:0,totalSold:0,totalAmount:0};var c=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_FORMAT);l=(null===(i=r.views[c])||void 0===i?void 0:i.pageViews)||0;var d=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_TIME_FULL_FORMAT);return null===(a=null===(n=null==r?void 0:r.productCategorySummary)||void 0===n?void 0:n[d])||void 0===a||a.forEach((function(t){var o=t.totalPerCategory,r=t.productsSummary,e=void 0===r?[]:r;s+=o||0,null==e||e.forEach((function(t){var o=t.productsSold;u+=o}))})),{totalViews:l,totalSold:u,totalAmount:s}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.537",
3
+ "version": "0.44.538",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -12,7 +12,10 @@ export const formatContentWithoutTags = (content, maxLength = 300) => {
12
12
  if (!content) return "";
13
13
  if (content < maxLength) return content;
14
14
  const text = content.replace(/<[^>]*>/g, "");
15
- const trimmedText = text.trim().replace(/\s\s+/g, " ");
15
+ const trimmedText = text
16
+ .trim()
17
+ .replace(/&nbsp;|[^a-zA-Z0-9\s]/g, "")
18
+ .replace(/\s\s+/g, " ");
16
19
 
17
20
  const words = trimmedText.slice(0, maxLength).split(" ");
18
21
  const index = String(content).indexOf(words[words.length - 2]);