@pisell/private-materials 6.12.434 → 6.12.436

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.
Files changed (27) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +2 -2
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +2 -2
  9. package/es/components/vendingMachine/CustomerScreens.js +16 -12
  10. package/es/components/vendingMachine/customer.less +23 -25
  11. package/es/components/venueBookingSales/VenueBookingShared.js +3 -2
  12. package/es/components/venueBookingSales/presentation.js +27 -1
  13. package/es/plus/pisellReservation/utils/calendarBookingSelection.js +4 -4
  14. package/es/plus/saasDevice/devicePasscodes/model.js +4 -4
  15. package/es/plus/venueBookingDesign/shared/CheckoutBenefits.js +2 -27
  16. package/es/plus/venueBookingDesign/shared/Layout.js +3 -33
  17. package/es/plus/venueBookingDesign/shared/kiosk-viewport.js +60 -7
  18. package/es/plus/walletPassGallery/components/timelineSection/index.js +4 -4
  19. package/es/pro/skuDetailModal/flow/calendarEntry.js +2 -2
  20. package/lib/components/vendingMachine/CustomerScreens.js +9 -5
  21. package/lib/components/vendingMachine/customer.less +23 -25
  22. package/lib/components/venueBookingSales/VenueBookingShared.js +2 -1
  23. package/lib/components/venueBookingSales/presentation.js +27 -0
  24. package/lib/plus/venueBookingDesign/shared/CheckoutBenefits.js +1 -26
  25. package/lib/plus/venueBookingDesign/shared/Layout.js +2 -32
  26. package/lib/plus/venueBookingDesign/shared/kiosk-viewport.js +60 -7
  27. package/package.json +2 -2
@@ -70,6 +70,8 @@
70
70
 
71
71
  .vm-customer-idle {
72
72
  position: relative;
73
+ display: flex;
74
+ flex-direction: column;
73
75
  width: 100%;
74
76
  height: 100%;
75
77
  overflow: hidden;
@@ -144,9 +146,9 @@
144
146
  display: grid;
145
147
  grid-template-rows: auto minmax(200px, 1fr) auto;
146
148
  row-gap: 32px;
147
- height: 100%;
149
+ flex: 1 0 auto;
148
150
  min-height: min-content;
149
- padding: 48px 40px 40px;
151
+ padding: 28px 40px 40px;
150
152
  }
151
153
  .vm-customer-idle-header,
152
154
  .vm-customer-idle-actions,
@@ -214,10 +216,9 @@
214
216
  }
215
217
  .vm-customer-idle-copy {
216
218
  flex-shrink: 0;
217
- margin-top: 56px;
219
+ margin-top: 36px;
218
220
  h1 {
219
221
  font-size: 64px;
220
- line-height: 1;
221
222
  display: -webkit-box;
222
223
  -webkit-box-orient: vertical;
223
224
  -webkit-line-clamp: 3;
@@ -301,30 +302,25 @@
301
302
  background: rgba(255, 255, 255, 0.8);
302
303
  line-height: 1.4;
303
304
  }
304
- .vm-customer-canvas .vm-customer-technical-support {
305
- position: absolute;
305
+ .vm-customer-technical-support {
306
+ --pisell-brand-inset: clamp(18px, 4.44cqw, 64px);
307
+ --pisell-brand-font-size: clamp(12px, 2.04cqw, 28px);
308
+ --pisell-brand-top-height: clamp(50px, 10.37cqw, 148px);
309
+ --pisell-brand-top-gap: clamp(14px, 2.41cqw, 34px);
310
+ --pisell-brand-top-logo-width: clamp(76px, 16.67cqw, 240px);
311
+ position: relative;
306
312
  z-index: 3;
307
- top: 0;
308
- left: 0;
309
- width: 100%;
313
+ flex: none;
314
+ min-width: 0;
315
+ height: var(--pisell-brand-top-height);
310
316
  margin: 0;
311
317
  border: 0;
312
- padding: 6px 0;
313
- background-color: rgba(0, 0, 0, 0.31);
314
- color: #fff;
315
- font-size: 16px;
316
- line-height: normal;
317
- text-align: center;
318
- touch-action: manipulation;
319
- user-select: none;
320
- &:focus-visible {
321
- outline-offset: -3px;
318
+ padding: 0;
319
+
320
+ .pisell-brand__content::before {
321
+ --brand-surface: #efe8fc;
322
322
  }
323
323
  }
324
- .vm-customer-canvas .vm-customer-home > .vm-customer-technical-support {
325
- position: relative;
326
- flex-shrink: 0;
327
- }
328
324
  .vm-customer-canvas .vm-customer-idle-hitarea {
329
325
  position: absolute;
330
326
  z-index: 2;
@@ -352,6 +348,8 @@
352
348
  padding: 0 var(--vm-customer-gutter);
353
349
  }
354
350
  .vm-customer-home-toolbar {
351
+ position: relative;
352
+ z-index: 3;
355
353
  justify-content: space-between;
356
354
  gap: 24px;
357
355
  > .vm-customer-brand {
@@ -619,10 +617,10 @@
619
617
  .vm-customer-idle-layout {
620
618
  grid-template-rows: auto minmax(160px, 1fr) auto;
621
619
  gap: 24px;
622
- padding: 40px 20px 24px;
620
+ padding-inline: 20px;
621
+ padding-bottom: 24px;
623
622
  }
624
623
  .vm-customer-idle-copy {
625
- margin-top: 32px;
626
624
  h1 {
627
625
  font-size: 44px;
628
626
  }
@@ -233,6 +233,7 @@ function VenuePreviewCatalog({ runtime, preview, showFilters }) {
233
233
  function VenueCatalog({ runtime, showFilters = true, formatAmount = runtime.amount }) {
234
234
  var _runtime$engine;
235
235
  const { mode, locale, context, variant, scopeKey, date, main, props, productQuantities, disabled, text, partyMain, composer, run, openProduct } = runtime;
236
+ const descriptionPreview = (0, react.useMemo)(() => require_presentation.createDescriptionTextResolver(locale), [scopeKey, locale]);
236
237
  const displayProducts = require_useVenueCatalogPromotions.useVenueCatalogPromotions(main.products, runtime.sales.bookingTicket, (_runtime$engine = runtime.engine) === null || _runtime$engine === void 0 || (_runtime$engine = _runtime$engine.appHelper) === null || _runtime$engine === void 0 || (_runtime$engine = _runtime$engine.utils) === null || _runtime$engine === void 0 ? void 0 : _runtime$engine.promotionEvaluator, locale);
237
238
  const renderCard = (0, react.useMemo)(() => require_catalogPresentation.createVenueCatalogCardRenderer({
238
239
  mode,
@@ -297,7 +298,7 @@ function VenueCatalog({ runtime, showFilters = true, formatAmount = runtime.amou
297
298
  const selected = mode === "party" && Number((_composer$detail$id = composer === null || composer === void 0 ? void 0 : composer.detail.id) !== null && _composer$detail$id !== void 0 ? _composer$detail$id : partyMain === null || partyMain === void 0 ? void 0 : partyMain.line.product_id) === Number(product.id);
298
299
  return {
299
300
  disabled: disabled || main.loading || !!main.error || !canOpen,
300
- description: require_presentation.descriptionText(product.description, locale),
301
+ description: descriptionPreview(product.description),
301
302
  businessInfo: mode === "party" && capacity.partySize || capacity.durationMinutes ? /* @__PURE__ */ react.default.createElement("div", { className: "party-meta venue-booking-sales__facts" }, mode === "party" && capacity.partySize && /* @__PURE__ */ react.default.createElement("span", null, /* @__PURE__ */ react.default.createElement(_phosphor_icons_react.Users, {
302
303
  size: 15,
303
304
  "aria-hidden": "true"
@@ -14,12 +14,38 @@ function localizedText(value, locale) {
14
14
  function descriptionText(value, locale) {
15
15
  const text = localizedText(value, locale);
16
16
  if (typeof DOMParser === "undefined") return text.replace(/<br\s*\/?\s*>|<\/(?:p|div|li|h[1-6])>/gi, "\n").replace(/<[^>]*>/g, "").trim();
17
+ if (!/[<&\r\0]/.test(text)) return text.replace(/\n{3,}/g, "\n\n").trim();
17
18
  const body = new DOMParser().parseFromString(text, "text/html").body;
18
19
  body.querySelectorAll("script, style, template").forEach((node) => node.remove());
19
20
  body.querySelectorAll("br").forEach((node) => node.replaceWith("\n"));
20
21
  body.querySelectorAll("p, div, li, h1, h2, h3, h4, h5, h6, blockquote, tr").forEach((node) => node.append("\n"));
21
22
  return (body.textContent || "").replace(/\n{3,}/g, "\n\n").trim();
22
23
  }
24
+ /** One catalog owns this cache; retain strings only, never parsed Documents.
25
+ * Key the actual localized copy so updates to an existing product are visible. */
26
+ function createDescriptionTextResolver(locale) {
27
+ const previews = /* @__PURE__ */ new Map();
28
+ const maxEntries = 64;
29
+ const maxCharacters = 256e3;
30
+ let characters = 0;
31
+ return (value) => {
32
+ const text = localizedText(value, locale);
33
+ if (typeof DOMParser === "undefined" || !/[<&\r\0]/.test(text)) return descriptionText(text, locale);
34
+ const cached = previews.get(text);
35
+ if (cached !== void 0) return cached;
36
+ const preview = descriptionText(text, locale);
37
+ const size = text.length + preview.length;
38
+ if (size > maxCharacters) return preview;
39
+ while (previews.size >= maxEntries || characters + size > maxCharacters) {
40
+ const oldest = previews.keys().next().value;
41
+ characters -= oldest.length + previews.get(oldest).length;
42
+ previews.delete(oldest);
43
+ }
44
+ previews.set(text, preview);
45
+ characters += size;
46
+ return preview;
47
+ };
48
+ }
23
49
  const emptyConfiguration = (productId) => ({
24
50
  skuValue: {
25
51
  product_id: productId,
@@ -48,6 +74,7 @@ function dateInTimezone(timezone) {
48
74
  return `${part("year")}-${part("month")}-${part("day")}`;
49
75
  }
50
76
  //#endregion
77
+ exports.createDescriptionTextResolver = createDescriptionTextResolver;
51
78
  exports.dateInTimezone = dateInTimezone;
52
79
  exports.descriptionText = descriptionText;
53
80
  exports.emptyConfiguration = emptyConfiguration;
@@ -66,34 +66,9 @@ function CheckoutBenefits({ status, needsAttention = false, hidden = false, disa
66
66
  const currentStatus = status !== null && status !== void 0 ? status : t("benefitsTitle");
67
67
  const inviteAttention = !noticed && !disabled && !needsAttention;
68
68
  (0, react.useLayoutEffect)(() => {
69
- var _window$visualViewpor;
70
69
  const element = trigger.current;
71
70
  if (!element) return;
72
- const scope = element.closest(".booking-ui");
73
- const measure = () => {
74
- const height = kiosk ? require_kiosk_viewport.kioskLogicalElementHeight(element) : element.getBoundingClientRect().height;
75
- if (height > 0) scope === null || scope === void 0 || scope.style.setProperty("--checkout-benefits-height", `${height}px`);
76
- };
77
- const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(measure);
78
- observer === null || observer === void 0 || observer.observe(element);
79
- const bodyObserver = kiosk ? new MutationObserver(measure) : void 0;
80
- bodyObserver === null || bodyObserver === void 0 || bodyObserver.observe(document.body, {
81
- attributes: true,
82
- attributeFilter: ["style", "class"]
83
- });
84
- window.addEventListener("resize", measure);
85
- if (kiosk) (_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.addEventListener("resize", measure);
86
- if (kiosk) document.body.addEventListener("transitionend", measure);
87
- measure();
88
- return () => {
89
- var _window$visualViewpor2;
90
- observer === null || observer === void 0 || observer.disconnect();
91
- bodyObserver === null || bodyObserver === void 0 || bodyObserver.disconnect();
92
- window.removeEventListener("resize", measure);
93
- (_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.removeEventListener("resize", measure);
94
- document.body.removeEventListener("transitionend", measure);
95
- scope === null || scope === void 0 || scope.style.removeProperty("--checkout-benefits-height");
96
- };
71
+ return require_kiosk_viewport.observeReservedElementHeight(element, "--checkout-benefits-height", kiosk);
97
72
  }, [kiosk]);
98
73
  const close = () => {
99
74
  setOpen(false);
@@ -10,39 +10,9 @@ function MobileActionBar({ lang, children, className = "" }) {
10
10
  const kiosk = ((_useOptionalBookingUI = require_context.useOptionalBookingUI()) === null || _useOptionalBookingUI === void 0 ? void 0 : _useOptionalBookingUI.presentationPlatform) === "kiosk";
11
11
  const ref = (0, react.useRef)(null);
12
12
  (0, react.useLayoutEffect)(() => {
13
- var _window$visualViewpor;
14
13
  const bar = ref.current;
15
- const scope = bar.closest(".booking-ui");
16
- let frame = 0;
17
- const measure = () => {
18
- const height = kiosk ? require_kiosk_viewport.kioskLogicalElementHeight(bar) : bar.getBoundingClientRect().height;
19
- if (height > 0) scope === null || scope === void 0 || scope.style.setProperty("--mobile-action-bar-height", `${height}px`);
20
- };
21
- const schedule = () => {
22
- cancelAnimationFrame(frame);
23
- frame = requestAnimationFrame(measure);
24
- };
25
- const observer = new ResizeObserver(schedule);
26
- observer.observe(bar);
27
- const bodyObserver = kiosk ? new MutationObserver(schedule) : void 0;
28
- bodyObserver === null || bodyObserver === void 0 || bodyObserver.observe(document.body, {
29
- attributes: true,
30
- attributeFilter: ["style", "class"]
31
- });
32
- window.addEventListener("resize", schedule);
33
- if (kiosk) (_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.addEventListener("resize", schedule);
34
- if (kiosk) document.body.addEventListener("transitionend", schedule);
35
- measure();
36
- return () => {
37
- var _window$visualViewpor2;
38
- cancelAnimationFrame(frame);
39
- observer.disconnect();
40
- bodyObserver === null || bodyObserver === void 0 || bodyObserver.disconnect();
41
- window.removeEventListener("resize", schedule);
42
- (_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.removeEventListener("resize", schedule);
43
- document.body.removeEventListener("transitionend", schedule);
44
- scope === null || scope === void 0 || scope.style.removeProperty("--mobile-action-bar-height");
45
- };
14
+ if (!bar) return;
15
+ return require_kiosk_viewport.observeReservedElementHeight(bar, "--mobile-action-bar-height", kiosk);
46
16
  }, [kiosk]);
47
17
  return /* @__PURE__ */ react.default.createElement("div", {
48
18
  ref,
@@ -17,11 +17,64 @@ function getKioskBodyScaleY(preferTarget = true) {
17
17
  function kioskLogicalElementHeight(element) {
18
18
  return element.getBoundingClientRect().height / getKioskBodyScaleY(false);
19
19
  }
20
+ /** Reserve layout space without re-reading transformed geometry on every animation. */
21
+ function observeReservedElementHeight(element, property, kiosk) {
22
+ var _window$visualViewpor;
23
+ const scope = element.closest(".booking-ui");
24
+ if (!scope) return () => {};
25
+ let frame = 0;
26
+ let lastHeight = 0;
27
+ let borderBoxHeight;
28
+ const measure = () => {
29
+ frame = 0;
30
+ const height = kiosk && borderBoxHeight !== void 0 ? borderBoxHeight : kiosk ? kioskLogicalElementHeight(element) : element.getBoundingClientRect().height;
31
+ const next = Math.round(height * 64) / 64;
32
+ if (next > 0 && next !== lastHeight) {
33
+ lastHeight = next;
34
+ scope.style.setProperty(property, `${next}px`);
35
+ }
36
+ };
37
+ const schedule = () => {
38
+ if (!frame) frame = requestAnimationFrame(measure);
39
+ };
40
+ const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver((entries) => {
41
+ if (kiosk) {
42
+ const entry = entries.find((item) => item.target === element);
43
+ const box = entry === null || entry === void 0 ? void 0 : entry.borderBoxSize;
44
+ const size = Array.isArray(box) ? box[0] : box;
45
+ if (size && Number.isFinite(size.blockSize)) borderBoxHeight = size.blockSize;
46
+ }
47
+ schedule();
48
+ });
49
+ observer === null || observer === void 0 || observer.observe(element, { box: "border-box" });
50
+ const bodyObserver = kiosk ? new MutationObserver(schedule) : void 0;
51
+ bodyObserver === null || bodyObserver === void 0 || bodyObserver.observe(document.body, {
52
+ attributes: true,
53
+ attributeFilter: ["style", "class"]
54
+ });
55
+ const finishScaleTransition = (event) => {
56
+ if (event.target === document.body && event.propertyName === "transform") schedule();
57
+ };
58
+ window.addEventListener("resize", schedule);
59
+ if (kiosk) (_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.addEventListener("resize", schedule);
60
+ if (kiosk) document.body.addEventListener("transitionend", finishScaleTransition);
61
+ measure();
62
+ return () => {
63
+ var _window$visualViewpor2;
64
+ cancelAnimationFrame(frame);
65
+ observer === null || observer === void 0 || observer.disconnect();
66
+ bodyObserver === null || bodyObserver === void 0 || bodyObserver.disconnect();
67
+ window.removeEventListener("resize", schedule);
68
+ (_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.removeEventListener("resize", schedule);
69
+ document.body.removeEventListener("transitionend", finishScaleTransition);
70
+ scope.style.removeProperty(property);
71
+ };
72
+ }
20
73
  /** Read the host's logical viewport; never add a second page scale or keyboard deduction. */
21
74
  function useKioskViewportHeight(root, enabled) {
22
75
  const [height, setHeight] = (0, react.useState)();
23
76
  (0, react.useLayoutEffect)(() => {
24
- var _window$visualViewpor2;
77
+ var _window$visualViewpor4;
25
78
  if (!enabled || !root) {
26
79
  setHeight(void 0);
27
80
  return;
@@ -29,9 +82,9 @@ function useKioskViewportHeight(root, enabled) {
29
82
  let frame = 0;
30
83
  const container = root.parentElement;
31
84
  const measure = () => {
32
- var _window$visualViewpor;
85
+ var _window$visualViewpor3;
33
86
  const scale = getKioskBodyScaleY();
34
- const visibleHeight = ((_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 ? void 0 : _window$visualViewpor.height) || window.innerHeight;
87
+ const visibleHeight = ((_window$visualViewpor3 = window.visualViewport) === null || _window$visualViewpor3 === void 0 ? void 0 : _window$visualViewpor3.height) || window.innerHeight;
35
88
  const logicalHeight = visibleHeight / scale;
36
89
  const containerHeight = (container === null || container === void 0 ? void 0 : container.clientHeight) || window.innerHeight;
37
90
  const next = Math.abs(scale - 1) < .001 ? `min(var(--app-content-height, ${containerHeight}px), ${visibleHeight}px)` : `${logicalHeight}px`;
@@ -52,21 +105,21 @@ function useKioskViewportHeight(root, enabled) {
52
105
  const containerObserver = typeof ResizeObserver === "undefined" || !container ? void 0 : new ResizeObserver(schedule);
53
106
  containerObserver === null || containerObserver === void 0 || containerObserver.observe(container);
54
107
  window.addEventListener("resize", schedule);
55
- (_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.addEventListener("resize", schedule);
108
+ (_window$visualViewpor4 = window.visualViewport) === null || _window$visualViewpor4 === void 0 || _window$visualViewpor4.addEventListener("resize", schedule);
56
109
  document.body.addEventListener("transitionend", finishScaleTransition);
57
110
  measure();
58
111
  return () => {
59
- var _window$visualViewpor3;
112
+ var _window$visualViewpor5;
60
113
  cancelAnimationFrame(frame);
61
114
  bodyObserver.disconnect();
62
115
  containerObserver === null || containerObserver === void 0 || containerObserver.disconnect();
63
116
  window.removeEventListener("resize", schedule);
64
- (_window$visualViewpor3 = window.visualViewport) === null || _window$visualViewpor3 === void 0 || _window$visualViewpor3.removeEventListener("resize", schedule);
117
+ (_window$visualViewpor5 = window.visualViewport) === null || _window$visualViewpor5 === void 0 || _window$visualViewpor5.removeEventListener("resize", schedule);
65
118
  document.body.removeEventListener("transitionend", finishScaleTransition);
66
119
  };
67
120
  }, [enabled, root]);
68
121
  return enabled ? height : void 0;
69
122
  }
70
123
  //#endregion
71
- exports.kioskLogicalElementHeight = kioskLogicalElementHeight;
124
+ exports.observeReservedElementHeight = observeReservedElementHeight;
72
125
  exports.useKioskViewportHeight = useKioskViewportHeight;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.12.434",
3
+ "version": "6.12.436",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -76,8 +76,8 @@
76
76
  "use-sync-external-store": "^1.6.0",
77
77
  "@pisell/pi-payment-sdk": "0.0.4",
78
78
  "@pisell/icon": "0.0.11",
79
+ "@pisell/materials": "6.12.97",
79
80
  "@pisell/utils": "3.0.7",
80
- "@pisell/materials": "6.12.96",
81
81
  "@pisell/date-picker": "3.0.12"
82
82
  },
83
83
  "peerDependencies": {