tek-wallet 0.0.670 → 0.0.672

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.
@@ -51,6 +51,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.RequireConnect = RequireConnect;
52
52
  var jsx_runtime_1 = require("react/jsx-runtime");
53
53
  var DrawerComponent_1 = __importStar(require("../DrawerComponent"));
54
+ var uuid_1 = require("uuid");
54
55
  var AuthView_1 = __importDefault(require("../../views/AuthView"));
55
56
  var useWalletData_1 = __importDefault(require("../../../hooks/useWalletData"));
56
57
  var react_1 = require("react");
@@ -63,6 +64,8 @@ function RequireConnect(_a) {
63
64
  var authViewRef = (0, react_1.useRef)(null);
64
65
  var initPasscodeRef = (0, react_1.useRef)(null);
65
66
  var _b = (0, useWalletData_1.default)(), isInitPasscode = _b.isInitPasscode, isSSO = _b.isSSO, isAuthenticated = _b.isAuthenticated;
67
+ var idPrefixRef = (0, react_1.useRef)("id-".concat((0, uuid_1.v4)()));
68
+ var idPrefix = idPrefixRef.current;
66
69
  var backAuthView = function () {
67
70
  var _a;
68
71
  (_a = authViewRef.current) === null || _a === void 0 ? void 0 : _a.close();
@@ -83,7 +86,17 @@ function RequireConnect(_a) {
83
86
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative" }, sx), component: component || "div", children: [children, (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "absolute", inset: 0, zIndex: 10 }, onClick: handleOpenAuthView, children: (0, jsx_runtime_1.jsxs)(DrawerComponent_1.default, { ref: authViewRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, onClick: stopPropagation, children: [isSSO && (0, jsx_runtime_1.jsx)(AuthViewSignIn_1.default, { onBack: backAuthView, onSignIn: signIn }), !isSSO && (0, jsx_runtime_1.jsx)(AuthView_1.default, { onBack: backAuthView })] }) })] }) }));
84
87
  }
85
88
  if (!isInitPasscode) {
86
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative" }, sx), component: component || "div", children: [children, (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: initPasscodeRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, trigger: (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { autoFocus: true, useBrowserInput: false, htmlFor: "init-passcode-keyboard", style: { width: "100%", height: "100%", position: "absolute", inset: 0 }, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: "100%", height: "100%", position: "absolute", inset: 0 } }) }), children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { isInitPasscode: true, onBack: handleBackInitPasscodeView }) })] }));
89
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative" }, sx), component: component || "div", onClick: function () {
90
+ var _a;
91
+ (_a = initPasscodeRef.current) === null || _a === void 0 ? void 0 : _a.open();
92
+ }, children: [children, (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { autoFocus: true, useBrowserInput: false, htmlFor: "".concat(idPrefix, "-init-passcode-keyboard"), style: {
93
+ position: "absolute",
94
+ inset: 0,
95
+ zIndex: 10,
96
+ display: "block",
97
+ }, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}) }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: initPasscodeRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
98
+ display: "block",
99
+ }, children: (0, jsx_runtime_1.jsx)(material_1.Box, { onClick: stopPropagation, children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { isInitPasscode: true, onBack: handleBackInitPasscodeView, idPrefix: idPrefix }) }) })] }));
87
100
  }
88
101
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
89
102
  }
@@ -2,6 +2,7 @@ import { GeneralProps } from "../../../types/ui";
2
2
  interface ChangePasscodeViewProps extends GeneralProps {
3
3
  onBack: () => void;
4
4
  isInitPasscode?: boolean;
5
+ idPrefix?: string;
5
6
  }
6
7
  export declare const ChangePasscodeView: (props: ChangePasscodeViewProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export default ChangePasscodeView;
@@ -106,18 +106,18 @@ var ChildPageLayout_1 = __importDefault(require("../../layouts/ChildPageLayout")
106
106
  var xhub_keyboard_1 = require("xhub-keyboard");
107
107
  var passcodeLength = 6;
108
108
  var ChangePasscodeView = function (props) {
109
- var _a = props.isInitPasscode, isInitPasscode = _a === void 0 ? false : _a;
109
+ var _a = props.isInitPasscode, isInitPasscode = _a === void 0 ? false : _a, _b = props.idPrefix, idPrefix = _b === void 0 ? "" : _b;
110
110
  var initStep = (0, react_2.useRef)(isInitPasscode ? type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE : type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE);
111
111
  var pageTitle = isInitPasscode ? const_1.PAGE_TITLE_FOR_INIT_PASSCODE : const_1.PAGE_TITLE_FOR_CHANGE_PASSCODE;
112
112
  var stepsContent = isInitPasscode ? const_2.STEPS_CONTENT_FOR_INIT_PASSCODE : const_1.STEPS_CONTENT_FOR_CHANGE_PASSCODE;
113
113
  var theme = (0, ThemeProvider_1.useTheme)();
114
- var _b = (0, react_2.useState)(""), oldPasscode = _b[0], setOldPasscode = _b[1];
115
- var _c = (0, react_2.useState)(""), newPasscode = _c[0], setNewPasscode = _c[1];
116
- var _d = (0, react_2.useState)(""), confirmPasscode = _d[0], setConfirmPasscode = _d[1];
114
+ var _c = (0, react_2.useState)(""), oldPasscode = _c[0], setOldPasscode = _c[1];
115
+ var _d = (0, react_2.useState)(""), newPasscode = _d[0], setNewPasscode = _d[1];
116
+ var _e = (0, react_2.useState)(""), confirmPasscode = _e[0], setConfirmPasscode = _e[1];
117
117
  var swiperControlledRef = (0, react_2.useRef)(null);
118
118
  var childPageLayoutRef = (0, react_2.useRef)(null);
119
- var _e = (0, react_2.useState)(initStep.current), currentStep = _e[0], setCurrentStep = _e[1];
120
- var _f = (0, react_2.useState)(null), error = _f[0], setError = _f[1];
119
+ var _f = (0, react_2.useState)(initStep.current), currentStep = _f[0], setCurrentStep = _f[1];
120
+ var _g = (0, react_2.useState)(null), error = _g[0], setError = _g[1];
121
121
  var updateWalletDetail = (0, useWalletData_1.default)().updateWalletDetail;
122
122
  var resetValue = function () {
123
123
  var _a;
@@ -300,8 +300,8 @@ var ChangePasscodeView = function (props) {
300
300
  return { value: confirmPasscode, onChange: handleConfirmPasscodeChange };
301
301
  }
302
302
  };
303
- var _g = getValueAndHandlerByStep(currentStep), value = _g.value, onChange = _g.onChange;
304
- var keyboardId = (0, react_2.useMemo)(function () { return (isInitPasscode ? "init-passcode-keyboard" : "change-passcode-keyboard"); }, [isInitPasscode]);
303
+ var _h = getValueAndHandlerByStep(currentStep), value = _h.value, onChange = _h.onChange;
304
+ var keyboardId = (0, react_2.useMemo)(function () { return "".concat(idPrefix, "-").concat(isInitPasscode ? "init" : "change", "-passcode-keyboard"); }, [isInitPasscode, idPrefix]);
305
305
  return ((0, jsx_runtime_1.jsx)(xhub_keyboard_1.Keyboard, { id: keyboardId, keyboardType: xhub_keyboard_1.KeyboardType.Text, layoutType: xhub_keyboard_1.LayoutType.Integer, value: value, onChange: onChange, viewFullHeight: true, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { ref: childPageLayoutRef, header: (0, jsx_runtime_1.jsx)(PageHeader_1.default, { overrideBack: handleBack, title: pageTitle, renderBack: function (Back) { return ((0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: Back })); } }), children: (0, jsx_runtime_1.jsx)(DefaultPageLayout_1.default, { sx: __assign({ display: "flex", flexDirection: "column", gap: "1rem", height: "100%" }, props.sx), children: (0, jsx_runtime_1.jsxs)(SwiperControlled_1.default, { ref: swiperControlledRef, disableSwipe: true, initialActiveTab: currentStep, sx: { height: "100%" }, swiperStyle: {
306
306
  flex: 1,
307
307
  }, children: [(0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.670",
3
+ "version": "0.0.672",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -60,6 +60,7 @@
60
60
  "swiper": "^11.2.4",
61
61
  "ton-core": "^0.53.0",
62
62
  "ton-crypto": "^3.2.0",
63
+ "uuid": "^11.1.0",
63
64
  "xhub-keyboard": "^0.0.19"
64
65
  },
65
66
  "peerDependencies": {