@licklist/design 0.70.0 → 0.70.2

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.
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
7
7
  import * as Config from '@licklist/core/dist/Config';
8
8
  import { FaEye, FaExternalLinkAlt, FaEdit, FaCopy, FaTrashAlt } from 'react-icons/fa';
9
9
  import { TipTapEditor } from '../../tiptap-editor/TipTapEditor.js';
10
- import { getStatisticInfo, formatContentWithoutTags, EVENT_DESCRIPTION_SIZE } from './utils.js';
10
+ import { getStatisticInfo, formatContent, EVENT_DESCRIPTION_SIZE } from './utils.js';
11
11
  import { ReactComponent as SvgChartBar } from '../../assets/dashboard/chartBar.svg.js';
12
12
 
13
13
  function _object_without_properties(source, excluded) {
@@ -45,7 +45,7 @@ function EventCard(param) {
45
45
  "totalViews"
46
46
  ]);
47
47
  var memoedContent = useMemo(function() {
48
- return formatContentWithoutTags(description, EVENT_DESCRIPTION_SIZE);
48
+ return formatContent(description, EVENT_DESCRIPTION_SIZE);
49
49
  }, [
50
50
  description
51
51
  ]);
@@ -1,8 +1,8 @@
1
1
  import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper';
2
- export declare function formatContent(content: any, maxSymbols: any): any;
3
- export declare const formatContentWithoutTags: (content: any, maxLength?: number) => any;
4
2
  export declare const MIN_EVENT_DESCRIPTION_SIZE = 150;
5
3
  export declare const EVENT_DESCRIPTION_SIZE = 350;
4
+ export declare const EMOJI_REGEX: RegExp;
5
+ export declare const formatContent: (content: any, maxLength?: number) => any;
6
6
  /**
7
7
  * Calculate the total number of views from the given dates and event statistic.
8
8
  *
@@ -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,EAA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
@@ -47,26 +47,22 @@ function _unsupported_iterable_to_array(o, minLen) {
47
47
  if (n === "Map" || n === "Set") return Array.from(n);
48
48
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
49
49
  }
50
- function formatContent(content, maxSymbols) {
51
- if (!content) return '';
52
- if (content.length > maxSymbols) return "".concat(content.slice(0, maxSymbols), "...");
53
- return content;
54
- }
55
- var formatContentWithoutTags = function(content) {
50
+ var EVENT_DESCRIPTION_SIZE = 350;
51
+ var EMOJI_REGEX = /<span data-emoji-replacer=""><img[^>]*alt="([^"]+)"[^>]*><\/span>/g;
52
+ var formatContent = function(content) {
56
53
  var maxLength = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : EVENT_DESCRIPTION_SIZE;
57
54
  if (!content) return '';
58
- if (content < maxLength) return content;
59
- var text = content.replace(/<[^>]*>/g, '');
60
- var trimmedText = text.trim().replace(/&nbsp;|[^a-zA-Z0-9\s]/g, '').replace(/\s\s+/g, ' ');
61
- var words = trimmedText.slice(0, maxLength).split(' ');
62
- var contentWithMinLength = content.slice(0, MIN_EVENT_DESCRIPTION_SIZE);
63
- var index = String(content).indexOf(words[words.length - 2]);
64
- var slicedContent = content.slice(0, index);
65
- var minSizeContent = contentWithMinLength.length > slicedContent.length ? contentWithMinLength : slicedContent;
66
- return minSizeContent.concat('...');
55
+ var replacedContent = replaceEmojiImagesWithText(content);
56
+ if (replacedContent.length <= maxLength) {
57
+ return replacedContent;
58
+ }
59
+ return replacedContent.slice(0, maxLength).concat('...');
67
60
  };
68
- var MIN_EVENT_DESCRIPTION_SIZE = 150;
69
- var EVENT_DESCRIPTION_SIZE = 350;
61
+ function replaceEmojiImagesWithText(text) {
62
+ return text.replace(EMOJI_REGEX, function(_, emojiText) {
63
+ return emojiText;
64
+ });
65
+ }
70
66
  /**
71
67
  * Calculate the total number of views from the given dates and event statistic.
72
68
  *
@@ -140,4 +136,4 @@ var EVENT_DESCRIPTION_SIZE = 350;
140
136
  };
141
137
  };
142
138
 
143
- export { EVENT_DESCRIPTION_SIZE, MIN_EVENT_DESCRIPTION_SIZE, calculateTotalSoldAndAmount, calculateTotalViews, formatContent, formatContentWithoutTags, getStatisticInfo };
139
+ export { EMOJI_REGEX, EVENT_DESCRIPTION_SIZE, calculateTotalSoldAndAmount, calculateTotalViews, formatContent, getStatisticInfo };
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper';
3
+ import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper';
3
4
  export declare const LAYOUT_GRID = "grid";
4
5
  export declare const LAYOUT_LIST = "list";
5
6
  export type ActivityCardProps = {
@@ -12,6 +13,7 @@ export type ActivityCardProps = {
12
13
  layout?: typeof LAYOUT_GRID | typeof LAYOUT_LIST;
13
14
  availableTimes?: string | null;
14
15
  image?: Image | null;
16
+ resources?: ZoneResourcesAvailability;
15
17
  };
16
- export declare const ActivityCard: ({ title, duration, price, description, availableTimes, image, onSelect, isSelected, layout, }: ActivityCardProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const ActivityCard: ({ title, duration, price, description, availableTimes, image, onSelect, isSelected, layout, resources, }: ActivityCardProps) => import("react/jsx-runtime").JSX.Element;
17
19
  //# sourceMappingURL=ActivityCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActivityCard.d.ts","sourceRoot":"","sources":["../../../src/iframe/activity-card/ActivityCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAA;AAE5E,eAAO,MAAM,WAAW,SAAS,CAAA;AACjC,eAAO,MAAM,WAAW,SAAS,CAAA;AAEjC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,CAAA;IAChB,Q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, jsx } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
+ import { AvailabilityIndicator } from '../../availability-indicator/AvailabilityIndicator.js';
3
4
 
4
5
  var LAYOUT_GRID = 'grid';
5
6
  var LAYOUT_LIST = 'list';
6
7
  var ActivityCard = function(param) {
7
- var title = param.title, duration = param.duration, price = param.price, description = param.description, availableTimes = param.availableTimes, image = param.image, onSelect = param.onSelect, isSelected = param.isSelected, _param_layout = param.layout, layout = _param_layout === void 0 ? LAYOUT_GRID : _param_layout;
8
+ var title = param.title, duration = param.duration, price = param.price, description = param.description, availableTimes = param.availableTimes, image = param.image, onSelect = param.onSelect, isSelected = param.isSelected, _param_layout = param.layout, layout = _param_layout === void 0 ? LAYOUT_GRID : _param_layout, resources = param.resources;
8
9
  if (layout === LAYOUT_GRID) {
9
10
  return /*#__PURE__*/ jsxs("button", {
10
11
  type: "button",
@@ -32,6 +33,9 @@ var ActivityCard = function(param) {
32
33
  description && /*#__PURE__*/ jsx("div", {
33
34
  className: "mt-2 activity-card-description",
34
35
  children: description
36
+ }),
37
+ resources && /*#__PURE__*/ jsx(AvailabilityIndicator, {
38
+ resources: resources
35
39
  })
36
40
  ]
37
41
  })
@@ -68,6 +72,9 @@ var ActivityCard = function(param) {
68
72
  description && /*#__PURE__*/ jsx("div", {
69
73
  className: "mt-2 activity-card-description",
70
74
  children: description
75
+ }),
76
+ resources && /*#__PURE__*/ jsx(AvailabilityIndicator, {
77
+ resources: resources
71
78
  })
72
79
  ]
73
80
  }),
@@ -1,5 +1,4 @@
1
1
  import { FieldValues, RefCallBack, UseFormClearErrors } from 'react-hook-form';
2
- import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper';
3
2
  import { Product, ProductCategory } from '@licklist/plugins/dist/types/context/sale/menuSteps';
4
3
  interface FormOrderItem {
5
4
  id: number;
@@ -7,7 +6,6 @@ interface FormOrderItem {
7
6
  price: number;
8
7
  productCategoryId: number;
9
8
  hasDeposit?: boolean;
10
- zoneId?: Zone['id'];
11
9
  deposit?: number | null;
12
10
  quantity: number;
13
11
  capacity?: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"ProductQuantityInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAA;AAC7E,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAA;AAG5D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAA;IACzB,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAA;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,aAAa,CAAA;CAC3B;AAED,eAAO,MAAM,oBAAoB,gGAQ9B,yBAAyB,4CAiE3B,CAAA"}
1
+ {"version":3,"file":"ProductQuantityInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAA;AAG5D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAA;IACzB,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAA;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,aAAa,CAAA;CAC3B;AAED,eAAO,MAAM,oBAAoB,gGAQ9B,yBAAyB,4CAiE3B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ryft-form.d.ts","sourceRoot":"","sources":["../../../../src/iframe/ryft/utils/ryft-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEzD,UAAU,0BACR,SAAQ,IAAI,CACV,oBAAoB,EACpB,uBAAuB,GAAG,oBAAoB,CAC/C;IACD,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAA;IACtB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,+BAA+B,CAAC,EAAE,OAAO,CAAA;CAC1C;AAED,eAAO,MAAM,0BAA0B,wGAMpC,0BAA0B,SA4E5B,CAAA"}
1
+ {"version":3,"file":"ryft-form.d.ts","sourceRoot":"","sources":["../../../../src/iframe/ryft/utils/ryft-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEzD,UAAU,0BACR,SAAQ,IAAI,CACV,oBAAoB,EACpB,uBAAuB,GAAG,oBAAoB,CAC/C;IACD,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAA;IACtB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,+BAA+B,CAAC,EAAE,OAAO,CAAA;CAC1C;AAED,eAAO,MAAM,0BAA0B,wGAMpC,0BAA0B,SA6E5B,CAAA"}
@@ -60,6 +60,7 @@ var injectComponentsInRyftForm = function(param) {
60
60
  var applePayButton = document.createElement('button');
61
61
  applePayButton.id = 'apple-pay';
62
62
  applePayButton.type = 'button';
63
+ applePayButton.style.opacity = !isDisableButton ? '1' : '0.6';
63
64
  applePayButton.className = 'bg-dark btn btn-primary apple-pay-button';
64
65
  applePayButton.textContent = t('Events:payWithApple');
65
66
  applePayButton.onclick = onApplePayButtonClick;
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAOzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAA;AAG5G,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAA;AAiBrF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAA;CAClD;AAED,UAAU,2BAA2B;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,4BAA4B,EAAE,OAAO,CAAA;IACrC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,mFAKnB,2BAA2B,4CAuP7B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,WAAW,EACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBxB,CAAA"}
1
+ {"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/product-set/control/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAOzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAA;AAG5G,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAA;AAiBrF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAA;CAClD;AAED,UAAU,2BAA2B;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;IACtB,4BAA4B,EAAE,OAAO,CAAA;IACrC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,mFAKnB,2BAA2B,4CAyP7B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,WAAW,EACX,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBxB,CAAA"}
@@ -216,7 +216,7 @@ function _ts_generator(thisArg, body) {
216
216
  }
217
217
  var DateInput = function(param) {
218
218
  var isEventEditProductSet = param.isEventEditProductSet, isLoading = param.isLoading, workHours = param.workHours, providerHasBookingManagement = param.providerHasBookingManagement;
219
- var _errors_menuRecurrences__availableTimes, _errors_menuRecurrences_, _errors_menuRecurrences, _errors_menuRecurrences1;
219
+ var _errors_menuRecurrences, _errors_menuRecurrences_root, _errors_menuRecurrences1, _errors_menuRecurrences__availableTimes, _errors_menuRecurrences_, _errors_menuRecurrences2;
220
220
  var _useFormContext = useFormContext(), control = _useFormContext.control, register = _useFormContext.register, errors = _useFormContext.formState.errors, getValues = _useFormContext.getValues, setValue = _useFormContext.setValue, clearErrors = _useFormContext.clearErrors;
221
221
  var _useFieldArray = useFieldArray({
222
222
  name: 'menuRecurrences',
@@ -359,6 +359,7 @@ var DateInput = function(param) {
359
359
  }));
360
360
  }, 100);
361
361
  };
362
+ var errorMessage = ((_errors_menuRecurrences = errors.menuRecurrences) === null || _errors_menuRecurrences === void 0 ? void 0 : _errors_menuRecurrences.message) || ((_errors_menuRecurrences1 = errors.menuRecurrences) === null || _errors_menuRecurrences1 === void 0 ? void 0 : (_errors_menuRecurrences_root = _errors_menuRecurrences1.root) === null || _errors_menuRecurrences_root === void 0 ? void 0 : _errors_menuRecurrences_root.message);
362
363
  return /*#__PURE__*/ jsxs(Form.Group, {
363
364
  children: [
364
365
  /*#__PURE__*/ jsx(Form.Label, {
@@ -381,7 +382,7 @@ var DateInput = function(param) {
381
382
  isLoading: isLoading,
382
383
  ref: availableTimesFormRef,
383
384
  defaultValues: availableTimes,
384
- errorMessage: errors === null || errors === void 0 ? void 0 : (_errors_menuRecurrences = errors.menuRecurrences) === null || _errors_menuRecurrences === void 0 ? void 0 : (_errors_menuRecurrences_ = _errors_menuRecurrences["".concat(editState === null || editState === void 0 ? void 0 : editState.index)]) === null || _errors_menuRecurrences_ === void 0 ? void 0 : (_errors_menuRecurrences__availableTimes = _errors_menuRecurrences_.availableTimes) === null || _errors_menuRecurrences__availableTimes === void 0 ? void 0 : _errors_menuRecurrences__availableTimes.message,
385
+ errorMessage: errors === null || errors === void 0 ? void 0 : (_errors_menuRecurrences2 = errors.menuRecurrences) === null || _errors_menuRecurrences2 === void 0 ? void 0 : (_errors_menuRecurrences_ = _errors_menuRecurrences2["".concat(editState === null || editState === void 0 ? void 0 : editState.index)]) === null || _errors_menuRecurrences_ === void 0 ? void 0 : (_errors_menuRecurrences__availableTimes = _errors_menuRecurrences_.availableTimes) === null || _errors_menuRecurrences__availableTimes === void 0 ? void 0 : _errors_menuRecurrences__availableTimes.message,
385
386
  clearErrorMessage: function() {
386
387
  return clearErrors("menuRecurrences.".concat(editState === null || editState === void 0 ? void 0 : editState.index, ".availableTimes"));
387
388
  }
@@ -436,7 +437,7 @@ var DateInput = function(param) {
436
437
  }))),
437
438
  /*#__PURE__*/ jsx("div", {
438
439
  className: "manual-form-error",
439
- children: (_errors_menuRecurrences1 = errors.menuRecurrences) === null || _errors_menuRecurrences1 === void 0 ? void 0 : _errors_menuRecurrences1.message
440
+ children: errorMessage
440
441
  })
441
442
  ]
442
443
  })
@@ -15,3 +15,12 @@
15
15
  }
16
16
  }
17
17
  }
18
+
19
+
20
+
21
+ .activity-card {
22
+ .availability-indicator {
23
+ margin-top: 0.5rem;
24
+ justify-content: flex-start;
25
+ }
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.70.0",
3
+ "version": "0.70.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -44,7 +44,7 @@
44
44
  "peerDependencies": {
45
45
  "@licklist/core": "0.30.3",
46
46
  "@licklist/eslint-config": "0.5.6",
47
- "@licklist/plugins": "0.33.4",
47
+ "@licklist/plugins": "0.33.5",
48
48
  "lodash": "4.17.21",
49
49
  "luxon": "3.5.0",
50
50
  "react": "17.0.2",
@@ -63,7 +63,7 @@
63
63
  "@fortawesome/free-solid-svg-icons": "5.15.2",
64
64
  "@licklist/core": "0.30.3",
65
65
  "@licklist/eslint-config": "0.5.6",
66
- "@licklist/plugins": "0.33.4",
66
+ "@licklist/plugins": "0.33.5",
67
67
  "@mantine/core": "6.0.22",
68
68
  "@mantine/hooks": "6.0.22",
69
69
  "@mdx-js/react": "1.6.22",
@@ -206,4 +206,4 @@
206
206
  "node": "20.9.0",
207
207
  "yarn": "4.4.0"
208
208
  }
209
- }
209
+ }
@@ -23,7 +23,7 @@ import { Sale } from '../../types/bookings'
23
23
  import { TipTapEditor } from '../../tiptap-editor/TipTapEditor'
24
24
  import {
25
25
  EVENT_DESCRIPTION_SIZE,
26
- formatContentWithoutTags,
26
+ formatContent,
27
27
  getStatisticInfo,
28
28
  } from './utils'
29
29
  import { ReactComponent as ChartBarIcon } from '../../assets/dashboard/chartBar.svg'
@@ -66,7 +66,7 @@ export function EventCard({
66
66
  const { formatNumber, formatDate } = useIntl()
67
67
  const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date)
68
68
  const memoedContent = useMemo(
69
- () => formatContentWithoutTags(description, EVENT_DESCRIPTION_SIZE),
69
+ () => formatContent(description, EVENT_DESCRIPTION_SIZE),
70
70
  [description],
71
71
  )
72
72
 
@@ -2,34 +2,25 @@ import { DATE_FORMAT, DATE_TIME_FULL_FORMAT } from '@licklist/core/dist/Config'
2
2
  import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper'
3
3
  import { DateTime } from 'luxon'
4
4
 
5
- export function formatContent(content, maxSymbols) {
6
- if (!content) return ''
7
- if (content.length > maxSymbols) return `${content.slice(0, maxSymbols)}...`
8
- return content
9
- }
5
+ export const MIN_EVENT_DESCRIPTION_SIZE = 150;
6
+ export const EVENT_DESCRIPTION_SIZE = 350;
7
+ export const EMOJI_REGEX = /<span data-emoji-replacer=""><img[^>]*alt="([^"]+)"[^>]*><\/span>/g;
10
8
 
11
- export const formatContentWithoutTags = (
12
- content,
13
- maxLength = EVENT_DESCRIPTION_SIZE,
14
- ) => {
15
- if (!content) return ''
16
- if (content < maxLength) return content
17
- const text = content.replace(/<[^>]*>/g, '')
18
- const trimmedText = text
19
- .trim()
20
- .replace(/&nbsp;|[^a-zA-Z0-9\s]/g, '')
21
- .replace(/\s\s+/g, ' ')
9
+ export const formatContent = (content, maxLength = EVENT_DESCRIPTION_SIZE) => {
10
+ if (!content) return '';
22
11
 
23
- const words = trimmedText.slice(0, maxLength).split(' ')
24
- const contentWithMinLength = content.slice(0, MIN_EVENT_DESCRIPTION_SIZE)
25
- const index = String(content).indexOf(words[words.length - 2])
26
- const slicedContent = content.slice(0, index)
27
- const minSizeContent = contentWithMinLength.length > slicedContent.length ? contentWithMinLength : slicedContent
28
- return minSizeContent.concat('...')
29
- }
12
+ const replacedContent = replaceEmojiImagesWithText(content);
13
+
14
+ if (replacedContent.length <= maxLength) {
15
+ return replacedContent;
16
+ }
30
17
 
31
- export const MIN_EVENT_DESCRIPTION_SIZE = 150
32
- export const EVENT_DESCRIPTION_SIZE = 350
18
+ return replacedContent.slice(0, maxLength).concat('...');
19
+ };
20
+
21
+ function replaceEmojiImagesWithText(text) {
22
+ return text.replace(EMOJI_REGEX, (_, emojiText) => emojiText);
23
+ }
33
24
 
34
25
  /**
35
26
  * Calculate the total number of views from the given dates and event statistic.
@@ -1,6 +1,8 @@
1
1
  import { ReactNode } from 'react'
2
2
  import clsx from 'clsx'
3
3
  import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
4
+ import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper'
5
+ import { AvailabilityIndicator } from '../../availability-indicator'
4
6
 
5
7
  export const LAYOUT_GRID = 'grid'
6
8
  export const LAYOUT_LIST = 'list'
@@ -15,6 +17,7 @@ export type ActivityCardProps = {
15
17
  layout?: typeof LAYOUT_GRID | typeof LAYOUT_LIST
16
18
  availableTimes?: string | null
17
19
  image?: Image | null
20
+ resources?: ZoneResourcesAvailability
18
21
  }
19
22
 
20
23
  export const ActivityCard = ({
@@ -27,6 +30,7 @@ export const ActivityCard = ({
27
30
  onSelect,
28
31
  isSelected,
29
32
  layout = LAYOUT_GRID,
33
+ resources,
30
34
  }: ActivityCardProps) => {
31
35
  if (layout === LAYOUT_GRID) {
32
36
  return (
@@ -46,6 +50,7 @@ export const ActivityCard = ({
46
50
  {description && (
47
51
  <div className='mt-2 activity-card-description'>{description}</div>
48
52
  )}
53
+ {resources && <AvailabilityIndicator resources={resources} />}
49
54
  </div>
50
55
  </button>
51
56
  )
@@ -71,6 +76,7 @@ export const ActivityCard = ({
71
76
  {description && (
72
77
  <div className='mt-2 activity-card-description'>{description}</div>
73
78
  )}
79
+ {resources && <AvailabilityIndicator resources={resources} />}
74
80
  </div>
75
81
 
76
82
  <hr className='list-activity-card-hr' />
@@ -2,7 +2,6 @@ import clsx from 'clsx'
2
2
  import { Button } from 'react-bootstrap'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { FieldValues, RefCallBack, UseFormClearErrors } from 'react-hook-form'
5
- import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
6
5
  import {
7
6
  Product,
8
7
  ProductCategory,
@@ -15,7 +14,6 @@ interface FormOrderItem {
15
14
  price: number
16
15
  productCategoryId: number
17
16
  hasDeposit?: boolean
18
- zoneId?: Zone['id']
19
17
  deposit?: number | null
20
18
  quantity: number
21
19
  capacity?: number | null
@@ -86,6 +86,7 @@ export const injectComponentsInRyftForm = ({
86
86
  const applePayButton = document.createElement('button')
87
87
  applePayButton.id = 'apple-pay'
88
88
  applePayButton.type = 'button'
89
+ applePayButton.style.opacity = !isDisableButton ? '1' : '0.6'
89
90
  applePayButton.className = 'bg-dark btn btn-primary apple-pay-button'
90
91
  applePayButton.textContent = t('Events:payWithApple')
91
92
  applePayButton.onclick = onApplePayButtonClick
@@ -195,6 +195,8 @@ export const DateInput = ({
195
195
  }, 100)
196
196
  }
197
197
 
198
+ const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
199
+
198
200
  return (
199
201
  <Form.Group>
200
202
  <Form.Label>
@@ -283,7 +285,7 @@ export const DateInput = ({
283
285
  />
284
286
 
285
287
  <div className='manual-form-error'>
286
- {errors.menuRecurrences?.message}
288
+ {errorMessage}
287
289
  </div>
288
290
  </div>
289
291
  </OverlayTrigger>
@@ -15,3 +15,12 @@
15
15
  }
16
16
  }
17
17
  }
18
+
19
+
20
+
21
+ .activity-card {
22
+ .availability-indicator {
23
+ margin-top: 0.5rem;
24
+ justify-content: flex-start;
25
+ }
26
+ }