@pisell/private-materials 6.3.217 → 6.3.218

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.
@@ -5,12 +5,12 @@ import { getResourceTitle } from "../../utils.js";
5
5
  import ProgressBar from "../../../eventBooking/components/progressBar/index.js";
6
6
  import { contextUtils, useAppointmentBookingProduct, useAppointmentBookingSetting, useAppointmentBookingStep, useInterceptBrowserBack, useShopDiscount } from "../../hooks.js";
7
7
  import { useAppointmentBookingContext } from "../../context.js";
8
- import React, { useMemo, useRef } from "react";
9
- import { locales } from "@pisell/utils";
8
+ import React, { useCallback, useEffect, useMemo, useRef } from "react";
9
+ import { locales, sendWarningLog } from "@pisell/utils";
10
10
  import "./index.less";
11
11
  //#region src/components/appointmentBooking/components/Header/index.tsx
12
12
  const Header = () => {
13
- var _context$appHelper, _context$appHelper$is, _currentStep$step3, _currentStep$index;
13
+ var _context$appHelper, _context$appHelper$is, _utils$getData, _utils$getData2, _utils$getStore, _utils$getStore$getSt, _currentStep$step3, _currentStep$index;
14
14
  const { currentStep, appointmentBooking, setTimes, carts, currentStepParams, currentSelectedResources } = useAppointmentBookingContext();
15
15
  const shopDiscount = useShopDiscount();
16
16
  const context = useEngineContext();
@@ -19,7 +19,63 @@ const Header = () => {
19
19
  const { checkProductType } = useAppointmentBookingProduct();
20
20
  const utils = contextUtils();
21
21
  const progressBarRef = useRef(null);
22
- const isIOS = Boolean((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$is = _context$appHelper.isIOS) === null || _context$appHelper$is === void 0 ? void 0 : _context$appHelper$is.call(_context$appHelper));
22
+ const userAgent = typeof navigator === "undefined" ? "" : navigator.userAgent;
23
+ const appHelperIsIOS = Boolean((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$is = _context$appHelper.isIOS) === null || _context$appHelper$is === void 0 ? void 0 : _context$appHelper$is.call(_context$appHelper));
24
+ const isIOS = /iPad|iPhone|iPod/.test(userAgent) || typeof navigator !== "undefined" && navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
25
+ const shopId = (_utils$getData = (_utils$getData2 = utils.getData) === null || _utils$getData2 === void 0 ? void 0 : _utils$getData2.call(utils, "shop_id")) !== null && _utils$getData !== void 0 ? _utils$getData : (_utils$getStore = utils.getStore) === null || _utils$getStore === void 0 || (_utils$getStore = _utils$getStore.call(utils)) === null || _utils$getStore === void 0 || (_utils$getStore$getSt = _utils$getStore.getState) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.call(_utils$getStore)) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.global) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.shop) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.id;
26
+ const isBackDiagnosisShop = String(shopId) === "8610";
27
+ const logBackDiagnosis = useCallback((event) => {
28
+ if (!isBackDiagnosisShop || typeof window === "undefined") return;
29
+ const diagnostics = {
30
+ event,
31
+ shopId,
32
+ href: window.location.href,
33
+ isIOS,
34
+ appHelperIsIOS,
35
+ userAgent
36
+ };
37
+ console.info("[appointment-booking][back-diagnosis]", diagnostics);
38
+ sendWarningLog({
39
+ title: "Shop8610-appointment-back-diagnosis",
40
+ content: [
41
+ {
42
+ key: "event",
43
+ value: event
44
+ },
45
+ {
46
+ key: "shopId",
47
+ value: String(shopId)
48
+ },
49
+ {
50
+ key: "href",
51
+ value: diagnostics.href
52
+ },
53
+ {
54
+ key: "isIOS",
55
+ value: String(isIOS)
56
+ },
57
+ {
58
+ key: "appHelperIsIOS",
59
+ value: String(appHelperIsIOS)
60
+ },
61
+ {
62
+ key: "userAgent",
63
+ value: userAgent
64
+ }
65
+ ]
66
+ }).catch((error) => {
67
+ console.warn("[appointment-booking][back-diagnosis] send log failed", error);
68
+ });
69
+ }, [
70
+ appHelperIsIOS,
71
+ isBackDiagnosisShop,
72
+ isIOS,
73
+ shopId,
74
+ userAgent
75
+ ]);
76
+ useEffect(() => {
77
+ logBackDiagnosis("header-mounted");
78
+ }, [logBackDiagnosis]);
23
79
  /**
24
80
  * @title: 获取资源名称
25
81
  * @description:
@@ -115,7 +171,8 @@ const Header = () => {
115
171
  onBack: handleBack,
116
172
  onExit: () => {
117
173
  var _progressBarRef$curre;
118
- return (_progressBarRef$curre = progressBarRef.current) === null || _progressBarRef$curre === void 0 ? void 0 : _progressBarRef$curre.triggerClose();
174
+ logBackDiagnosis("back-trap-exit");
175
+ (_progressBarRef$curre = progressBarRef.current) === null || _progressBarRef$curre === void 0 || _progressBarRef$curre.triggerClose();
119
176
  }
120
177
  });
121
178
  return /* @__PURE__ */ React.createElement(ProgressBar, {
package/es/index.js CHANGED
@@ -106,7 +106,6 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
106
106
  import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
107
107
  import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
108
108
  import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
109
- import "./plus/pisellReservation/index.js";
110
109
  import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
111
110
  import pisellAdyenDashboard_default from "./plus/pisellAdyenDashboard/index.js";
112
111
  import weekday from "dayjs/plugin/weekday";
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
259
259
  return rows;
260
260
  }
261
261
  //#endregion
262
- export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingStatusToCardStatus, hostBookingUiPatchFromRecord, isMonitorScheduleBookingSkipped, mergeBookingsForResourceRecord };
262
+ export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, isMonitorScheduleBookingSkipped, mergeBookingsForResourceRecord };
@@ -79,4 +79,4 @@ function toastFloorPlanLoadError(err) {
79
79
  PisellToast({ content: err instanceof Error ? err.message : String(err) });
80
80
  }
81
81
  //#endregion
82
- export { PISELL_RESERVATION_FLOOR_PLAN_CODE, buildDefaultReservationFloorPlanPostBody, ensureShopFloorPlanByCode, putShopFloorPlan, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
82
+ export { PISELL_RESERVATION_FLOOR_PLAN_CODE, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
@@ -927,4 +927,4 @@ function getReservationDataSourceFormColumns() {
927
927
  ];
928
928
  }
929
929
  //#endregion
930
- export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationSceneElements, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
930
+ export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
@@ -0,0 +1 @@
1
+ export { };
@@ -9,4 +9,4 @@ interface AuthModalProps {}
9
9
  */
10
10
  declare const AuthModal: React.FC<AuthModalProps>;
11
11
  //#endregion
12
- export { AuthModal };
12
+ export { AuthModal, AuthModalProps };
@@ -1,4 +1,3 @@
1
- import { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LoginFormData, OAuthConfig, PhoneAuthConfig, RegisterFormData, UIConfig, VerificationMethod } from "./shared/types.js";
2
1
  import { Login2, Login2Config, Login2Events, Login2Props } from "./Login2.js";
3
2
  import { Register2, Register2Config, Register2Events, Register2Props } from "./Register2.js";
4
- import { AuthModal } from "./AuthModal.js";
3
+ import { AuthModal, AuthModalProps } from "./AuthModal.js";
@@ -226,4 +226,4 @@ interface RegisterFormData {
226
226
  verification_token?: string;
227
227
  }
228
228
  //#endregion
229
- export { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
229
+ export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig };
@@ -12,7 +12,7 @@ let _pisell_utils = require("@pisell/utils");
12
12
  require("./index.less");
13
13
  //#region src/components/appointmentBooking/components/Header/index.tsx
14
14
  const Header = () => {
15
- var _context$appHelper, _context$appHelper$is, _currentStep$step3, _currentStep$index;
15
+ var _context$appHelper, _context$appHelper$is, _utils$getData, _utils$getData2, _utils$getStore, _utils$getStore$getSt, _currentStep$step3, _currentStep$index;
16
16
  const { currentStep, appointmentBooking, setTimes, carts, currentStepParams, currentSelectedResources } = require_context.useAppointmentBookingContext();
17
17
  const shopDiscount = require_hooks.useShopDiscount();
18
18
  const context = require_useEngineContext.default();
@@ -21,7 +21,63 @@ const Header = () => {
21
21
  const { checkProductType } = require_hooks.useAppointmentBookingProduct();
22
22
  const utils = require_hooks.contextUtils();
23
23
  const progressBarRef = (0, react.useRef)(null);
24
- const isIOS = Boolean((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$is = _context$appHelper.isIOS) === null || _context$appHelper$is === void 0 ? void 0 : _context$appHelper$is.call(_context$appHelper));
24
+ const userAgent = typeof navigator === "undefined" ? "" : navigator.userAgent;
25
+ const appHelperIsIOS = Boolean((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$is = _context$appHelper.isIOS) === null || _context$appHelper$is === void 0 ? void 0 : _context$appHelper$is.call(_context$appHelper));
26
+ const isIOS = /iPad|iPhone|iPod/.test(userAgent) || typeof navigator !== "undefined" && navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
27
+ const shopId = (_utils$getData = (_utils$getData2 = utils.getData) === null || _utils$getData2 === void 0 ? void 0 : _utils$getData2.call(utils, "shop_id")) !== null && _utils$getData !== void 0 ? _utils$getData : (_utils$getStore = utils.getStore) === null || _utils$getStore === void 0 || (_utils$getStore = _utils$getStore.call(utils)) === null || _utils$getStore === void 0 || (_utils$getStore$getSt = _utils$getStore.getState) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.call(_utils$getStore)) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.global) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.shop) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.id;
28
+ const isBackDiagnosisShop = String(shopId) === "8610";
29
+ const logBackDiagnosis = (0, react.useCallback)((event) => {
30
+ if (!isBackDiagnosisShop || typeof window === "undefined") return;
31
+ const diagnostics = {
32
+ event,
33
+ shopId,
34
+ href: window.location.href,
35
+ isIOS,
36
+ appHelperIsIOS,
37
+ userAgent
38
+ };
39
+ console.info("[appointment-booking][back-diagnosis]", diagnostics);
40
+ (0, _pisell_utils.sendWarningLog)({
41
+ title: "Shop8610-appointment-back-diagnosis",
42
+ content: [
43
+ {
44
+ key: "event",
45
+ value: event
46
+ },
47
+ {
48
+ key: "shopId",
49
+ value: String(shopId)
50
+ },
51
+ {
52
+ key: "href",
53
+ value: diagnostics.href
54
+ },
55
+ {
56
+ key: "isIOS",
57
+ value: String(isIOS)
58
+ },
59
+ {
60
+ key: "appHelperIsIOS",
61
+ value: String(appHelperIsIOS)
62
+ },
63
+ {
64
+ key: "userAgent",
65
+ value: userAgent
66
+ }
67
+ ]
68
+ }).catch((error) => {
69
+ console.warn("[appointment-booking][back-diagnosis] send log failed", error);
70
+ });
71
+ }, [
72
+ appHelperIsIOS,
73
+ isBackDiagnosisShop,
74
+ isIOS,
75
+ shopId,
76
+ userAgent
77
+ ]);
78
+ (0, react.useEffect)(() => {
79
+ logBackDiagnosis("header-mounted");
80
+ }, [logBackDiagnosis]);
25
81
  /**
26
82
  * @title: 获取资源名称
27
83
  * @description:
@@ -117,7 +173,8 @@ const Header = () => {
117
173
  onBack: handleBack,
118
174
  onExit: () => {
119
175
  var _progressBarRef$curre;
120
- return (_progressBarRef$curre = progressBarRef.current) === null || _progressBarRef$curre === void 0 ? void 0 : _progressBarRef$curre.triggerClose();
176
+ logBackDiagnosis("back-trap-exit");
177
+ (_progressBarRef$curre = progressBarRef.current) === null || _progressBarRef$curre === void 0 || _progressBarRef$curre.triggerClose();
121
178
  }
122
179
  });
123
180
  return /* @__PURE__ */ react.default.createElement(require_index.default, {
package/package.json CHANGED
@@ -1,6 +1,21 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.3.217",
3
+ "version": "6.3.218",
4
+ "scripts": {
5
+ "dev": "father dev",
6
+ "build": "father build",
7
+ "lowcode:dev": "build-scripts start --config ./build.lowcode.js",
8
+ "lowcode:build": "build-scripts build --config ./build.lowcode.js",
9
+ "build:tsdown": "tsdown",
10
+ "lowcode:rsdev": "rsbuild dev",
11
+ "lowcode:rsbuild": "rsbuild build",
12
+ "test": "vitest",
13
+ "test:run": "vitest run",
14
+ "test:coverage": "vitest run --coverage",
15
+ "test:ui": "vitest --ui",
16
+ "storybook": "storybook dev -p 6006",
17
+ "build-storybook": "storybook build"
18
+ },
4
19
  "main": "./lib/index.js",
5
20
  "module": "./es/index.js",
6
21
  "types": "./lib/index.d.ts",
@@ -63,6 +78,10 @@
63
78
  "dependencies": {
64
79
  "@adyen/adyen-platform-experience-web": "1.12.2",
65
80
  "antd": "5.10.1",
81
+ "@pisell/utils": "workspace:*",
82
+ "@pisell/materials": "workspace:*",
83
+ "@pisell/icon": "workspace:*",
84
+ "@pisell/date-picker": "workspace:*",
66
85
  "@ant-design/icons": "^5.6.1",
67
86
  "@dnd-kit/core": "^6.0.8",
68
87
  "@dnd-kit/modifiers": "^6.0.1",
@@ -78,11 +97,7 @@
78
97
  "react-infinite-scroll-component": "^6.1.0",
79
98
  "react-resizable": "^3.0.5",
80
99
  "react-zoom-pan-pinch": "^3.7.0",
81
- "styled-components": "^6.0.0-rc.3",
82
- "@pisell/utils": "3.0.5",
83
- "@pisell/materials": "6.3.49",
84
- "@pisell/icon": "0.0.11",
85
- "@pisell/date-picker": "3.0.8"
100
+ "styled-components": "^6.0.0-rc.3"
86
101
  },
87
102
  "peerDependencies": {
88
103
  "react": "^18.0.0",
@@ -90,20 +105,5 @@
90
105
  },
91
106
  "componentConfig": {
92
107
  "materialSchema": "https://unpkg.com/@pisell/materials@1.0.1/build/lowcode/assets-prod.json"
93
- },
94
- "scripts": {
95
- "dev": "father dev",
96
- "build": "father build",
97
- "lowcode:dev": "build-scripts start --config ./build.lowcode.js",
98
- "lowcode:build": "build-scripts build --config ./build.lowcode.js",
99
- "build:tsdown": "tsdown",
100
- "lowcode:rsdev": "rsbuild dev",
101
- "lowcode:rsbuild": "rsbuild build",
102
- "test": "vitest",
103
- "test:run": "vitest run",
104
- "test:coverage": "vitest run --coverage",
105
- "test:ui": "vitest --ui",
106
- "storybook": "storybook dev -p 6006",
107
- "build-storybook": "storybook build"
108
108
  }
109
109
  }
@@ -1,17 +0,0 @@
1
- import "./floorRoomCard/mapRowToFloorRoomCardData.js";
2
- import "./floorRoomCard/ReservationFloorRoomCard.js";
3
- import "./floorMap/reservationMock.js";
4
- import "./floorMap/floorPlanApi.js";
5
- import "./reservationConstants.js";
6
- import "./serve/formResourcePage.js";
7
- import "./data/bookingToReservationTables.js";
8
- import "./data/formResourceToReservationTables.js";
9
- import "./data/salesEmbeddedResourceToTableRows.js";
10
- import "./floorMap/reservationCards.js";
11
- import "./PisellReservation.js";
12
- import "./PisellReservationBookingPage.js";
13
- import "./PisellVenueControlPage.js";
14
- import "./PisellVenueWallPage.js";
15
- import "./PisellReservationTablePage.js";
16
- import "./components/SelectFloorMapResourceDialog.js";
17
- export {};