@pisell/private-materials 6.12.484 → 6.12.485

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 (67) 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.js +10 -10
  6. package/build/lowcode/view.js +10 -10
  7. package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
  8. package/es/components/bigSale/components/ProductList/index.js +1 -0
  9. package/es/components/bigSale/components/TimeBar/index.js +1 -0
  10. package/es/components/bigSale/dialog.js +1 -0
  11. package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
  12. package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
  13. package/es/components/bigSale/index.js +1 -0
  14. package/es/components/bigSale/templates/Kiosk/index.js +1 -0
  15. package/es/components/kiosk/components/Shell/useKioskMemberAction.js +1 -0
  16. package/es/components/kiosk/sales/KioskSaleSession.js +1 -0
  17. package/es/components/kiosk/sales/useCheckout.js +1 -0
  18. package/es/components/kiosk/sales/useSaleSessionExit.js +1 -0
  19. package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
  20. package/es/components/smartLocker/components/PendingOperationsNotice.js +1 -1
  21. package/es/components/smartLocker/index.js +1 -1
  22. package/es/components/smartLocker/locales.js +35 -6
  23. package/es/components/smartLocker/pages/StaffLockersPage.js +1 -1
  24. package/es/components/smartLocker/runtime/controller.js +2 -11
  25. package/es/components/smartLocker/runtime/runtime.js +2 -4
  26. package/es/components/venueBookingSales/checkout/VenueBookingHolderStep.js +1 -0
  27. package/es/components/venueBookingSales/checkout/useVenueBookingCheckout.js +1 -0
  28. package/es/components/venueBookingSales/checkout/useVenueCustomerAccess.js +1 -0
  29. package/es/components/venueBookingSales/checkout/useVenueKioskCheckout.js +1 -0
  30. package/es/components/venueBookingSales/extras/VenueExtraDetailModal.js +1 -0
  31. package/es/components/venueBookingSales/useVenueBookingSession.js +1 -0
  32. package/es/index.js +2 -0
  33. package/es/plus/multiCurrencySettlement/index.js +1 -1
  34. package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
  35. package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
  36. package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
  37. package/es/plus/pisellReservation/floorRoomCard/endingSoonHighlight.js +4 -4
  38. package/es/plus/pisellReservation/index.js +17 -0
  39. package/es/plus/pisellReservation/utils/calendarBookingSelection.js +4 -4
  40. package/es/plus/saasDevice/devicePasscodes/model.js +4 -4
  41. package/es/plus/saleDetail/Base.js +1 -0
  42. package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
  43. package/es/plus/saleDetail/components/DetailActions/PrintAction.js +1 -0
  44. package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
  45. package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
  46. package/es/plus/saleDetail/index.js +1 -0
  47. package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
  48. package/es/plus/saleDetail/tmpl/B/index.js +1 -0
  49. package/es/plus/salesSdk/index.js +54 -0
  50. package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
  51. package/es/plus/salesSdk/utils/bookingDate.js +1 -1
  52. package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
  53. package/es/plus/walletPassGallery/components/timelineSection/index.js +4 -4
  54. package/es/pro/Login2.0/AuthModal.d.ts +1 -1
  55. package/es/pro/Login2.0/index.d.ts +2 -2
  56. package/es/pro/Login2.0/shared/types.d.ts +1 -1
  57. package/es/pro/skuDetailModal/flow/calendarEntry.js +2 -2
  58. package/es/pro/skuDetailModal/flow/registry.d.ts +1 -1
  59. package/lib/components/smartLocker/components/PendingOperationsNotice.js +1 -1
  60. package/lib/components/smartLocker/index.js +1 -1
  61. package/lib/components/smartLocker/locales.js +35 -6
  62. package/lib/components/smartLocker/pages/StaffLockersPage.js +1 -1
  63. package/lib/components/smartLocker/runtime/controller.js +2 -11
  64. package/lib/components/smartLocker/runtime/runtime.js +2 -4
  65. package/lib/pro/skuDetailModal/flow/registry.d.ts +1 -1
  66. package/package.json +2 -2
  67. package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
@@ -102,4 +102,4 @@ function buildHolderListRequestKey(params) {
102
102
  });
103
103
  }
104
104
  //#endregion
105
- export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, resolveHolderDisplayConfig };
105
+ export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, pickHolderIdFromBooking, resolveHolderDisplayConfig };
@@ -7,12 +7,12 @@ import React, { useCallback, useEffect, useMemo, useRef } from "react";
7
7
  import { locales } from "@pisell/utils";
8
8
  import { Button, PisellEmpty, PisellModal, PisellStatisticList, Skeleton, Timeline, usePisellConfig } from "@pisell/materials";
9
9
  import { useRequest } from "ahooks";
10
- import utcPlugin from "dayjs/plugin/utc";
11
- import timezonePlugin from "dayjs/plugin/timezone";
10
+ import utc from "dayjs/plugin/utc";
11
+ import timezone from "dayjs/plugin/timezone";
12
12
  import "./index.less";
13
13
  //#region src/plus/walletPassGallery/components/timelineSection/index.tsx
14
- dayjs.extend(timezonePlugin);
15
- dayjs.extend(utcPlugin);
14
+ dayjs.extend(timezone);
15
+ dayjs.extend(utc);
16
16
  const stateTimeUnix = 1723255863;
17
17
  const POLL_INTERVAL = 2e3;
18
18
  const POLL_MAX_TIMES = 5;
@@ -14,4 +14,4 @@ interface AuthModalProps {
14
14
  */
15
15
  declare const AuthModal: React.FC<AuthModalProps>;
16
16
  //#endregion
17
- export { AuthModal, AuthModalProps };
17
+ export { AuthModal };
@@ -1,4 +1,4 @@
1
- import { AuthMethodType, VerificationMethod } from "./shared/types.js";
1
+ import { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LoginFormData, OAuthConfig, PhoneAuthConfig, RegisterFormData, UIConfig, VerificationMethod } from "./shared/types.js";
2
2
  import { Login2, Login2Config, Login2Events, Login2Props } from "./Login2.js";
3
3
  import { Register2, Register2Config, Register2Events, Register2Props } from "./Register2.js";
4
- import { AuthModal, AuthModalProps } from "./AuthModal.js";
4
+ import { AuthModal } from "./AuthModal.js";
@@ -226,4 +226,4 @@ interface RegisterFormData {
226
226
  verification_token?: string;
227
227
  }
228
228
  //#endregion
229
- export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
229
+ export { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
@@ -1,9 +1,9 @@
1
1
  import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
2
  import { isMultiDayProduct } from "../../../components/booking/info2/service/addService/utils.js";
3
3
  import dayjs from "dayjs";
4
- import utcPlugin from "dayjs/plugin/utc";
4
+ import utc from "dayjs/plugin/utc";
5
5
  //#region src/pro/skuDetailModal/flow/calendarEntry.ts
6
- dayjs.extend(utcPlugin);
6
+ dayjs.extend(utc);
7
7
  /** Calendar timestamps belong to the shop clock, rather than the browser clock. */
8
8
  function calendarDateTime(value) {
9
9
  const matched = value.match(/(Z|([+-])(\d{2}):(\d{2}))$/i);
@@ -19,7 +19,7 @@ declare const flowModuleRegistry: {
19
19
  readonly Component: _$react.FC<FlowModuleProps<string>>;
20
20
  readonly initializeWhileInactive: true;
21
21
  readonly hardRequires: ("productData" | "booking.selectedCandidate")[];
22
- readonly refreshOn: ("quantity" | "productData" | "skuValue" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
22
+ readonly refreshOn: ("productData" | "skuValue" | "quantity" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
23
23
  readonly isApplicable: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
24
24
  readonly canInitialize: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
25
25
  readonly refresh: (context: SelectionFlowContextValue<string>, module: CompiledSelectionFlowModuleConfig<string>) => Promise<void>;
@@ -9,7 +9,7 @@ react = require_runtime.__toESM(react);
9
9
  function PendingOperationsNotice() {
10
10
  const runtime = require_context.useLockerRuntime();
11
11
  const state = runtime.useSnapshot((value) => value);
12
- const { text } = require_locales.useSmartLockerLocale();
12
+ const { text } = require_locales.useSmartLockerLocale(runtime.presentation.employee);
13
13
  const navigate = runtime.useNavigate();
14
14
  const memberId = runtime.getMemberId(state);
15
15
  const issues = (state.pendingOperations || []).filter(({ operation }) => {
@@ -80,8 +80,8 @@ function CustomerRoute({ runtime }) {
80
80
  }
81
81
  function MountedLocker(props) {
82
82
  var _location$state, _location$state2;
83
- const { text, locale } = require_locales.useSmartLockerLocale();
84
83
  const { employee } = props;
84
+ const { text, locale } = require_locales.useSmartLockerLocale(employee);
85
85
  const callbacks = (0, react.useRef)(props);
86
86
  callbacks.current = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props), {}, { context: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props.context), {}, { locale: props.context.locale || locale }) });
87
87
  const runtime = (0, react.useMemo)(() => require_runtime$1.createLockerRuntime(props, () => callbacks.current), [props.service]);
@@ -36,19 +36,48 @@ const translations = {
36
36
  pt: require_pt.default,
37
37
  ja: require_ja.default
38
38
  };
39
- function getSmartLockerText(key, values = {}, locale = "en") {
40
- var _dictionary$key;
41
- return ((_dictionary$key = (translations[locale] || require_en.default)[key]) !== null && _dictionary$key !== void 0 ? _dictionary$key : require_en.default[key]).replace(/\{(\w+)\}/g, (match, name) => {
39
+ const staffSupportKeys = new Set([
40
+ "lockerPreparationPending",
41
+ "lockerBusinessSyncPending",
42
+ "lockerCancellationPending",
43
+ "lockerSaleConfigurationPending",
44
+ "lockerMenuConfigurationPending",
45
+ "lockerInventoryUnavailable",
46
+ "lockerStorageUnavailable",
47
+ "lockerDoorUnavailable",
48
+ "lockerOrderUnresolved",
49
+ "doorStatusIsUnknownAskStaffToCheckIt",
50
+ "aDoorHasAnUnknownStatusAskStaffTo",
51
+ "lockersUnavailablePleaseAskAStaffMemberForHelp",
52
+ "operationFailed"
53
+ ]);
54
+ const technicianTerms = {
55
+ en: [["a staff member", "a technician"], ["staff", "a technician"]],
56
+ "zh-CN": [["工作人员", "技术人员"], ["员工", "技术人员"]],
57
+ "zh-HK": [
58
+ ["工作人員", "技術人員"],
59
+ ["職員", "技術人員"],
60
+ ["員工", "技術人員"]
61
+ ],
62
+ pt: [["funcionário", "técnico"], ["equipe", "equipe técnica"]],
63
+ ja: [["スタッフ", "技術スタッフ"]]
64
+ };
65
+ function getSmartLockerText(key, values = {}, locale = "en", employee = false) {
66
+ var _dictionary$key, _technicianTerms;
67
+ const dictionary = translations[locale] || require_en.default;
68
+ const message = (_dictionary$key = dictionary[key]) !== null && _dictionary$key !== void 0 ? _dictionary$key : require_en.default[key];
69
+ const terms = dictionary[key] == null ? technicianTerms.en : (_technicianTerms = technicianTerms[locale]) !== null && _technicianTerms !== void 0 ? _technicianTerms : technicianTerms.en;
70
+ return (employee && staffSupportKeys.has(key) ? terms.reduce((copy, [staff, technician]) => copy.replace(staff, technician), message) : message).replace(/\{(\w+)\}/g, (match, name) => {
42
71
  var _values$name;
43
72
  return String((_values$name = values[name]) !== null && _values$name !== void 0 ? _values$name : match);
44
73
  });
45
74
  }
46
- function useSmartLockerLocale() {
75
+ function useSmartLockerLocale(employee = false) {
47
76
  const locale = require_useLocale.default();
48
77
  return (0, react.useMemo)(() => ({
49
78
  locale,
50
- text: (key, values) => getSmartLockerText(key, values, locale)
51
- }), [locale]);
79
+ text: (key, values) => getSmartLockerText(key, values, locale, employee)
80
+ }), [locale, employee]);
52
81
  }
53
82
  //#endregion
54
83
  exports.SMART_LOCKER_LOCALES = SMART_LOCKER_LOCALES;
@@ -16,7 +16,7 @@ react = require_runtime.__toESM(react);
16
16
  //#region src/components/smartLocker/pages/StaffLockersPage.tsx
17
17
  const StaffLockersPage = () => {
18
18
  var _lockerFilters$find$i, _lockerFilters$find, _searchParams$get$toU, _searchParams$get, _lockerFilters$find2, _items$find, _ref;
19
- const { text } = require_locales.useSmartLockerLocale();
19
+ const { text } = require_locales.useSmartLockerLocale(true);
20
20
  const runtime = require_context.useLockerRuntime();
21
21
  const state = runtime.useSnapshot((currentState) => currentState);
22
22
  const [searchParams, setSearchParams] = runtime.useSearchParams();
@@ -55,7 +55,6 @@ function createLockerController({ context, service, operator, employee }, router
55
55
  let unsubscribe;
56
56
  let sessionVersion = 0;
57
57
  const jobs = /* @__PURE__ */ new Map();
58
- const staffOperations = /* @__PURE__ */ new Map();
59
58
  const busy = () => [...jobs.keys()].some((key) => key.startsWith("auth:") || key.startsWith("retry:") || key.startsWith("cancel:") || key === "prepare" || key.startsWith("staff:") && key !== "staff:batch-doors");
60
59
  const report = (error) => {
61
60
  if (alive && !require_errors.isAbortError(error)) store.setState({ error: require_errors.getLockerError(error) });
@@ -113,7 +112,6 @@ function createLockerController({ context, service, operator, employee }, router
113
112
  yield service.finishOperation(context, operation, signal);
114
113
  (_operationAborts$get = operationAborts.get(operation.id)) === null || _operationAborts$get === void 0 || _operationAborts$get.abort();
115
114
  operationAborts.delete(operation.id);
116
- for (const [id, value] of staffOperations) if (value.id === operation.id) staffOperations.delete(id);
117
115
  });
118
116
  return function finishOperation(_x6, _x7) {
119
117
  return _ref3.apply(this, arguments);
@@ -369,7 +367,6 @@ function createLockerController({ context, service, operator, employee }, router
369
367
  store.setState({ openingCollectionOperationId: void 0 });
370
368
  operationAborts.forEach((abort) => abort.abort());
371
369
  operationAborts.clear();
372
- staffOperations.clear();
373
370
  customerOperation = void 0;
374
371
  identificationInput = void 0;
375
372
  service.releaseCustomerSession(context, customerSessionId);
@@ -599,12 +596,10 @@ function createLockerController({ context, service, operator, employee }, router
599
596
  if (!((_state$staffAccess = state.staffAccess) === null || _state$staffAccess === void 0 ? void 0 : _state$staffAccess.canOperateSmartLockers) || state.openAllRequest || state.staffOpens[id] === "unknown") return;
600
597
  store.setState({ staffPending: [...state.staffPending, id] });
601
598
  try {
602
- let operation = staffOperations.get(id);
603
- if (!operation || state.staffOpens[id] !== "failed") operation = yield prepareOperation((lifetime) => service.prepareStaffOpen(context, [id], operator, lifetime, true), signal);
604
- staffOperations.set(id, operation);
599
+ const operation = yield prepareOperation((lifetime) => service.prepareStaffOpen(context, [id], operator, lifetime, true), signal);
605
600
  const result = yield readDoor(operation, id, signal);
606
601
  if (alive && !signal.aborted) store.setState((current) => ({ staffOpens: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, current.staffOpens), {}, { [id]: result }) }));
607
- if (result !== "failed") yield finishOperation(operation, signal);
602
+ yield finishOperation(operation, signal);
608
603
  } finally {
609
604
  if (alive && !signal.aborted) store.setState((current) => ({ staffPending: current.staffPending.filter((item) => item !== id) }));
610
605
  }
@@ -626,10 +621,6 @@ function createLockerController({ context, service, operator, employee }, router
626
621
  var _model$getLocker;
627
622
  return state.staffOpens[id] === "unknown" || ((_model$getLocker = model.getLocker(state, id)) === null || _model$getLocker === void 0 ? void 0 : _model$getLocker.door) === "unknown";
628
623
  })) throw new require_errors.LockerServiceError("aDoorHasAnUnknownStatusAskStaffTo");
629
- for (const id of ids) {
630
- const previous = staffOperations.get(id);
631
- if (previous && state.staffOpens[id] === "failed") yield finishOperation(previous, signal);
632
- }
633
624
  const operation = yield prepareOperation((lifetime) => service.prepareStaffOpen(context, ids, operator, lifetime, true), signal);
634
625
  if (!alive || signal.aborted) return false;
635
626
  store.setState({ openAllRequest: {
@@ -11,7 +11,7 @@ const _excluded = ["openingInstructions"];
11
11
  /** State and async operations live for one entrance, independently of presentation changes. */
12
12
  function createLockerRuntime(options, readProps) {
13
13
  const router = require_router.createLockerRouter(options.employee ? "/staff/lockers" : "/");
14
- const text = (key, values) => require_locales.getSmartLockerText(key, values, readProps().context.locale);
14
+ const text = (key, values) => require_locales.getSmartLockerText(key, values, readProps().context.locale, options.employee);
15
15
  const controller = require_controller.createLockerController(options, router, text);
16
16
  const { store, model } = controller;
17
17
  const help = require_store.createStore({ reason: null });
@@ -45,9 +45,7 @@ function createLockerRuntime(options, readProps) {
45
45
  deviceLabel: location && !/[@@]/.test(deviceName) ? `${deviceName} @ ${location}` : deviceName
46
46
  };
47
47
  },
48
- text(key, values) {
49
- return require_locales.getSmartLockerText(key, values, readProps().context.locale);
50
- },
48
+ text,
51
49
  getElementById(id) {
52
50
  var _root$current;
53
51
  return (_root$current = root.current) === null || _root$current === void 0 ? void 0 : _root$current.querySelector(`[id="${id.replace(/["\\]/g, "")}"]`);
@@ -19,7 +19,7 @@ declare const flowModuleRegistry: {
19
19
  readonly Component: _$react.FC<FlowModuleProps<string>>;
20
20
  readonly initializeWhileInactive: true;
21
21
  readonly hardRequires: ("productData" | "booking.selectedCandidate")[];
22
- readonly refreshOn: ("quantity" | "productData" | "skuValue" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
22
+ readonly refreshOn: ("productData" | "skuValue" | "quantity" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
23
23
  readonly isApplicable: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
24
24
  readonly canInitialize: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
25
25
  readonly refresh: (context: SelectionFlowContextValue<string>, module: CompiledSelectionFlowModuleConfig<string>) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.12.484",
3
+ "version": "6.12.485",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -75,8 +75,8 @@
75
75
  "styled-components": "^6.0.0-rc.3",
76
76
  "use-sync-external-store": "^1.6.0",
77
77
  "@pisell/pi-payment-sdk": "0.0.5",
78
- "@pisell/materials": "6.12.107",
79
78
  "@pisell/utils": "3.0.7",
79
+ "@pisell/materials": "6.12.107",
80
80
  "@pisell/date-picker": "3.0.12",
81
81
  "@pisell/icon": "0.0.11"
82
82
  },
@@ -1 +0,0 @@
1
- export { };