@pisell/private-materials 6.3.217 → 6.3.219

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, {
@@ -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.219",
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
  }