@opexa/portal-components 0.0.270 → 0.0.273
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.
- package/dist/client/hooks/useCamera.d.ts +1 -1
- package/dist/client/hooks/useCamera.js +51 -43
- package/dist/client/hooks/usePxToRemConverter.d.ts +2 -0
- package/dist/client/hooks/usePxToRemConverter.js +18 -0
- package/dist/client/hooks/useRect.d.ts +5 -0
- package/dist/client/hooks/useRect.js +45 -0
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/PisoPayWithdrawal/PisoPayWithdrawal.js +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/VentajaWithdrawal/VentajaWithdrawal.js +1 -1
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.client.d.ts +15 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.client.js +100 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.d.ts +2 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageField.js +11 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageFieldContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/IdFrontImageFieldContext.js +2 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/index.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/index.js +1 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/useIdFrontImageField.d.ts +18 -0
- package/dist/components/SignUp/SignUpKYC/IdFrontImageField/useIdFrontImageField.js +88 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.client.d.ts +15 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.client.js +113 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.d.ts +2 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageField.js +11 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageFieldContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/SelfieImageFieldContext.js +2 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/index.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/index.js +1 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.d.ts +19 -0
- package/dist/components/SignUp/SignUpKYC/SelfieImageField/useSelfieImageField.js +186 -0
- package/dist/components/SignUp/SignUpKYC/SignUpKYC.lazy.js +3 -12
- package/dist/components/SignUp/SignUpKYC/SignUpKYCContext.d.ts +2 -3
- package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpKYC/SignUpKYCForm.js +464 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.js +11 -46
- package/dist/components/shared/SelfieImageField/SelfieImageField.client.js +20 -72
- package/dist/handlers/index.d.ts +7 -7
- package/dist/next.config.js +0 -8
- package/dist/ui/AlertDialog/AlertDialog.d.ts +88 -88
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/Avatar/Avatar.d.ts +9 -9
- package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +72 -72
- package/dist/ui/Carousel/carousel.recipe.d.ts +8 -8
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +88 -88
- package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Field/Field.d.ts +21 -21
- package/dist/ui/Field/field.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +307 -307
- package/dist/ui/Menu/menu.recipe.d.ts +17 -17
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/QrCode/QrCode.d.ts +25 -25
- package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +2 -4
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Image from 'next/image';
|
|
3
|
-
import {
|
|
3
|
+
import { useRef } from 'react';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { usePxToRemConverter } from '../../../client/hooks/usePxToRemConverter.js';
|
|
6
|
+
import { useRect } from '../../../client/hooks/useRect.js';
|
|
5
7
|
import { Camera01Icon } from '../../../icons/Camera01Icon.js';
|
|
6
8
|
import { CameraOffIcon } from '../../../icons/CameraOffIcon.js';
|
|
7
9
|
import { CheckCircleIcon } from '../../../icons/CheckCircleIcon.js';
|
|
@@ -93,80 +95,26 @@ function Camera() {
|
|
|
93
95
|
* -------------------------------------
|
|
94
96
|
*/
|
|
95
97
|
function Video() {
|
|
96
|
-
const id = useId();
|
|
97
98
|
const context = useSelfieImageFieldContext();
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const pxToRem = usePxToRemConverter();
|
|
100
|
+
const videoRect = useRect(context.camera.videoRef);
|
|
101
|
+
const guideWidth = videoRect.width <= 0 || videoRect.height <= 0
|
|
102
|
+
? 0
|
|
103
|
+
: videoRect.width > videoRect.height
|
|
104
|
+
? videoRect.height
|
|
105
|
+
: videoRect.width;
|
|
106
|
+
const rootRef = useRef(null);
|
|
107
|
+
const rootRect = useRect(rootRef, {
|
|
108
|
+
enabled: guideWidth > 0,
|
|
103
109
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const guide = context.guideRef.current;
|
|
107
|
-
const mask = context.maskRef.current;
|
|
108
|
-
if (!guide || !mask)
|
|
109
|
-
return;
|
|
110
|
-
const guideRect = guide.getBoundingClientRect();
|
|
111
|
-
const maskRect = mask.getBoundingClientRect();
|
|
112
|
-
const x = guideRect.left - maskRect.left;
|
|
113
|
-
const y = guideRect.top - maskRect.top;
|
|
114
|
-
const width = guideRect.width;
|
|
115
|
-
const height = guideRect.height;
|
|
116
|
-
if (width && height) {
|
|
117
|
-
setMaskBox({
|
|
118
|
-
x,
|
|
119
|
-
y,
|
|
120
|
-
width,
|
|
121
|
-
height,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const observer = new ResizeObserver(update);
|
|
126
|
-
if (context.guideRef.current)
|
|
127
|
-
observer.observe(context.guideRef.current);
|
|
128
|
-
if (context.maskRef.current)
|
|
129
|
-
observer.observe(context.maskRef.current);
|
|
130
|
-
requestAnimationFrame(update);
|
|
131
|
-
return () => observer.disconnect();
|
|
132
|
-
}, [context.guideRef, context.maskRef]);
|
|
133
|
-
const [videoSize, setVideoSize] = useState({
|
|
134
|
-
width: 0,
|
|
135
|
-
height: 0,
|
|
110
|
+
const guideRect = useRect(context.guideRef, {
|
|
111
|
+
enabled: guideWidth > 0,
|
|
136
112
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return;
|
|
141
|
-
const updateVideoWidth = () => {
|
|
142
|
-
const rect = video.getBoundingClientRect();
|
|
143
|
-
setVideoSize({
|
|
144
|
-
width: rect.width,
|
|
145
|
-
height: rect.height,
|
|
146
|
-
});
|
|
147
|
-
};
|
|
148
|
-
video.addEventListener('loadedmetadata', updateVideoWidth);
|
|
149
|
-
video.addEventListener('resize', updateVideoWidth);
|
|
150
|
-
return () => {
|
|
151
|
-
video.removeEventListener('loadedmetadata', updateVideoWidth);
|
|
152
|
-
video.removeEventListener('resize', updateVideoWidth);
|
|
153
|
-
};
|
|
154
|
-
}, [context.camera.videoRef]);
|
|
155
|
-
const guideWidth = videoSize.width <= 0 || videoSize.height <= 0
|
|
156
|
-
? 0
|
|
157
|
-
: videoSize.width > videoSize.height
|
|
158
|
-
? videoSize.height
|
|
159
|
-
: videoSize.width;
|
|
160
|
-
return (_jsxs("div", { className: twMerge('relative h-auto w-full overflow-hidden', !context.camera.data && !context.camera.error && !context.camera.loading
|
|
113
|
+
const x = (rootRect.width - guideRect.width) / 2;
|
|
114
|
+
const y = (rootRect.height - guideRect.height) / 2;
|
|
115
|
+
return (_jsxs("div", { ref: rootRef, className: twMerge('relative h-auto w-full overflow-hidden', !context.camera.data && !context.camera.error && !context.camera.loading
|
|
161
116
|
? 'block'
|
|
162
|
-
: 'hidden'), children: [_jsx("
|
|
163
|
-
|
|
164
|
-
WebkitMask: `url(#${id})`,
|
|
165
|
-
maskRepeat: 'no-repeat',
|
|
166
|
-
WebkitMaskRepeat: 'no-repeat',
|
|
167
|
-
WebkitTransform: 'translateZ(0)',
|
|
168
|
-
willChange: 'transform',
|
|
169
|
-
} }), _jsx("div", { ref: context.guideRef, className: twMerge('border-utility-warning-700 absolute left-1/2 top-1/2 z-20 aspect-square -translate-x-1/2 -translate-y-1/2 rounded-md border-4 border-dashed', context.faceFound && 'border-utility-success-700', guideWidth <= 0 ? 'hidden' : 'block'), style: {
|
|
170
|
-
width: `calc(${guideWidth}px - 2rem)`,
|
|
117
|
+
: 'hidden'), children: [_jsx("div", { className: "pointer-events-none absolute left-0 right-0 top-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 right-0 z-20 bg-black/60 backdrop-blur-sm", style: { height: `${pxToRem(y)}rem` } }), _jsx("div", { className: "pointer-events-none absolute left-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("div", { className: "pointer-events-none absolute right-0 z-20 bg-black/60 backdrop-blur-sm", style: { top: y, bottom: y, width: `${pxToRem(x)}rem` } }), _jsx("video", { ...context.camera.videoProps }), _jsx("div", { ref: context.guideRef, className: twMerge('border-utility-warning-700 absolute left-1/2 top-1/2 z-20 aspect-square -translate-x-1/2 -translate-y-1/2 border-4 border-dashed', context.faceFound && 'border-utility-success-700', guideWidth <= 0 ? 'hidden' : 'block'), style: {
|
|
118
|
+
width: `calc(${pxToRem(guideWidth)}rem - 2rem)`,
|
|
171
119
|
} })] }));
|
|
172
120
|
}
|
package/dist/handlers/index.d.ts
CHANGED
|
@@ -6,26 +6,26 @@ interface Context {
|
|
|
6
6
|
params: Promise<Params>;
|
|
7
7
|
}
|
|
8
8
|
export declare const GET: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
|
|
9
|
+
ok: true;
|
|
10
|
+
data?: never;
|
|
11
|
+
} | {
|
|
9
12
|
ok: false;
|
|
10
13
|
message: string;
|
|
11
14
|
__error?: unknown;
|
|
12
|
-
} | {
|
|
13
|
-
ok: true;
|
|
14
|
-
data: Record<string, unknown>;
|
|
15
15
|
}> | NextResponse<{
|
|
16
16
|
ok: false;
|
|
17
17
|
message: string;
|
|
18
18
|
__error?: unknown;
|
|
19
19
|
} | {
|
|
20
20
|
ok: true;
|
|
21
|
-
data:
|
|
21
|
+
data: Record<string, unknown>;
|
|
22
22
|
}> | NextResponse<{
|
|
23
|
-
ok: true;
|
|
24
|
-
data?: never;
|
|
25
|
-
} | {
|
|
26
23
|
ok: false;
|
|
27
24
|
message: string;
|
|
28
25
|
__error?: unknown;
|
|
26
|
+
} | {
|
|
27
|
+
ok: true;
|
|
28
|
+
data: import("../types").Session;
|
|
29
29
|
}>>;
|
|
30
30
|
export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
|
|
31
31
|
ok: true;
|
package/dist/next.config.js
CHANGED
|
@@ -48,14 +48,6 @@ export const config = {
|
|
|
48
48
|
compiler: {
|
|
49
49
|
removeConsole: process.env.NODE_ENV === 'production',
|
|
50
50
|
},
|
|
51
|
-
webpack(config) {
|
|
52
|
-
config.resolve.fallback = {
|
|
53
|
-
fs: false,
|
|
54
|
-
path: false,
|
|
55
|
-
crypto: false,
|
|
56
|
-
};
|
|
57
|
-
return config;
|
|
58
|
-
},
|
|
59
51
|
};
|
|
60
52
|
export function extendConfig(userConfig) {
|
|
61
53
|
return {
|