wcz-test 6.14.0 → 6.20.0
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/ApprovalStatus-C9HPyMiS.js.map +1 -1
- package/dist/DialogsHooks-Bi8dZoyu.js +338 -0
- package/dist/DialogsHooks-Bi8dZoyu.js.map +1 -0
- package/dist/FileHooks-hWKTwLCr.js +195 -0
- package/dist/FileHooks-hWKTwLCr.js.map +1 -0
- package/dist/FileMeta-G1oT3mYK.js.map +1 -1
- package/dist/{RouterListItemButton-Cx7rXEfm.js → RouterListItemButton-CHS7rofI.js} +4 -4
- package/dist/RouterListItemButton-CHS7rofI.js.map +1 -0
- package/dist/auth-client-B6cIXYDV.js +1417 -0
- package/dist/auth-client-B6cIXYDV.js.map +1 -0
- package/dist/client.d.ts +61 -49
- package/dist/client.js +7 -3
- package/dist/client.js.map +1 -1
- package/dist/components.js +68 -3405
- package/dist/components.js.map +1 -1
- package/dist/env-CoxTjaDr.js.map +1 -1
- package/dist/error-BhAKg8LX-X0sdNXNa.js +195 -0
- package/dist/error-BhAKg8LX-X0sdNXNa.js.map +1 -0
- package/dist/hooks.d.ts +6 -2
- package/dist/hooks.js +35 -1040
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +90 -504
- package/dist/index.js.map +1 -1
- package/dist/manifest.webmanifest +18 -18
- package/dist/models.d.ts +10 -10
- package/dist/models.js +4 -4
- package/dist/models.js.map +1 -1
- package/dist/queries.d.ts +6 -6
- package/dist/queries.js +2 -2
- package/dist/queries.js.map +1 -1
- package/dist/server-mxQ3s5dx-CC81W42s.js +644 -0
- package/dist/server-mxQ3s5dx-CC81W42s.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +8659 -5
- package/dist/server.js.map +1 -1
- package/dist/{utils-JYv9O0GI.js → utils-DKyKGba7.js} +2 -1
- package/dist/utils-DKyKGba7.js.map +1 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.js +9 -0
- package/dist/utils.js.map +1 -0
- package/dist/vite.js +3 -0
- package/dist/vite.js.map +1 -1
- package/package.json +120 -116
- package/dist/DialogsHooks-BlUsVlfv.js +0 -39
- package/dist/DialogsHooks-BlUsVlfv.js.map +0 -1
- package/dist/FileHooks-41k6-RtZ.js +0 -3262
- package/dist/FileHooks-41k6-RtZ.js.map +0 -1
- package/dist/RouterListItemButton-Cx7rXEfm.js.map +0 -1
- package/dist/auth-client-o9U0_qmf.js +0 -79
- package/dist/auth-client-o9U0_qmf.js.map +0 -1
- package/dist/utils-JYv9O0GI.js.map +0 -1
|
@@ -36,6 +36,7 @@ const rootRouteHead = () => ({
|
|
|
36
36
|
});
|
|
37
37
|
const httpClient = axios.create({
|
|
38
38
|
baseURL: clientEnv.VITE_API_URL
|
|
39
|
+
// TODO: Not working in children projects
|
|
39
40
|
});
|
|
40
41
|
const getFieldStatus = (field) => {
|
|
41
42
|
const { meta } = field.state;
|
|
@@ -54,4 +55,4 @@ export {
|
|
|
54
55
|
rootRouteHead as r,
|
|
55
56
|
toKebabCase as t
|
|
56
57
|
};
|
|
57
|
-
//# sourceMappingURL=utils-
|
|
58
|
+
//# sourceMappingURL=utils-DKyKGba7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-DKyKGba7.js","sources":["../src/lib/utils.ts"],"sourcesContent":["import axios from \"axios\";\nimport type { AnyFieldApi } from \"@tanstack/react-form\";\nimport { clientEnv } from \"~/env\";\n\nexport class Platform {\n static get isAndroid() { return /android/i.test(this.userAgent); }\n static get isIOS() { return /iPad|iPhone|iPod/.test(this.userAgent); }\n static get isWindows() { return /windows/i.test(this.userAgent); }\n static get isMacOS() { return /Macintosh|MacIntel|MacPPC|Mac68K/.test(this.userAgent); }\n\n private static get userAgent() { return typeof navigator === \"undefined\" ? \"\" : navigator.userAgent; }\n}\n\nexport const rootRouteHead = () => ({\n meta: [\n { charSet: \"utf-8\" },\n { name: \"viewport\", content: \"width=device-width, initial-scale=1\" },\n { title: clientEnv.VITE_APP_TITLE },\n { name: \"og:type\", content: \"website\" },\n { name: \"og:title\", content: clientEnv.VITE_APP_TITLE },\n { name: \"og:image\", content: \"/favicon-32x32.png\" }\n ],\n links: [\n { rel: \"apple-touch-icon\", sizes: \"180x180\", href: \"/apple-touch-icon.png\", },\n { rel: \"icon\", type: \"image/png\", sizes: \"32x32\", href: \"/favicon-32x32.png\", },\n { rel: \"icon\", type: \"image/png\", sizes: \"16x16\", href: \"/favicon-16x16.png\", },\n { rel: \"manifest\", href: \"/manifest.webmanifest\" },\n { rel: \"icon\", href: \"/favicon.ico\" },\n ],\n});\n\nexport const httpClient = axios.create({\n baseURL: clientEnv.VITE_API_URL // TODO: Not working in children projects\n});\n\n/* Internal Utils */\nexport type FormOmittedProps =\n \"name\" |\n \"value\" |\n \"onChange\" |\n \"onBlur\" |\n \"error\" |\n \"helperText\" |\n \"renderInput\" |\n \"type\" |\n \"aria-label\";\n\nexport const getFieldStatus = (field: AnyFieldApi) => {\n const { meta } = field.state;\n\n const isTouched = meta.isTouched;\n const hasError = !!meta.errors.length;\n const helperText = meta.errors[0]?.message;\n\n return { isTouched, hasError, helperText };\n};\n\nexport const toKebabCase = (str: string): string => {\n return str\n .replaceAll(/([a-z])([A-Z])/g, \"$1-$2\")\n .replaceAll(/[\\s_]+/g, \"-\")\n .replaceAll(/[^a-zA-Z0-9-]/g, \"\")\n .toLowerCase()\n .replaceAll(/-+/g, \"-\")\n .replaceAll(/(^-|-$)/g, \"\");\n};\n"],"names":[],"mappings":";;AAIO,MAAM,SAAS;AAAA,EAClB,WAAW,YAAY;AAAE,WAAO,WAAW,KAAK,KAAK,SAAS;AAAA,EAAG;AAAA,EACjE,WAAW,QAAQ;AAAE,WAAO,mBAAmB,KAAK,KAAK,SAAS;AAAA,EAAG;AAAA,EACrE,WAAW,YAAY;AAAE,WAAO,WAAW,KAAK,KAAK,SAAS;AAAA,EAAG;AAAA,EACjE,WAAW,UAAU;AAAE,WAAO,mCAA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ADDED
package/dist/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/dist/vite.js
CHANGED
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sources":["../src/lib/vite-plugin.ts"],"sourcesContent":["import fs from \"node:fs\";\
|
|
1
|
+
{"version":3,"file":"vite.js","sources":["../src/lib/vite-plugin.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { Resource } from \"i18next\";\nimport type { Plugin } from \"vite\";\n\nexport function viteWczLayout(): Plugin {\n const virtualModuleId = \"virtual:wcz-layout\";\n const resolvedVirtualModuleId = \"\\0\" + virtualModuleId;\n\n let localesPath: string;\n\n return {\n name: \"vite:wcz-layout\",\n enforce: \"pre\",\n configResolved(resolvedConfig) {\n localesPath = path.resolve(resolvedConfig.root, \"src/locales\");\n },\n config() {\n return {\n optimizeDeps: {\n exclude: [virtualModuleId],\n },\n ssr: {\n noExternal: [\"@mui/*\"],\n },\n };\n },\n resolveId(id) {\n if (id === virtualModuleId) return resolvedVirtualModuleId;\n return null;\n },\n load(id) {\n if (id !== resolvedVirtualModuleId) return null;\n\n if (!fs.existsSync(localesPath)) {\n fs.mkdirSync(localesPath, { recursive: true });\n }\n\n const enPath = path.join(localesPath, \"en.json\");\n if (!fs.existsSync(enPath)) {\n fs.writeFileSync(enPath, JSON.stringify({}));\n }\n\n const files = fs.readdirSync(localesPath);\n const jsonFiles = files.filter((f) => f.endsWith(\".json\"));\n\n const resources: Resource = {};\n\n for (const file of jsonFiles) {\n const lang = path.basename(file, \".json\");\n const filePath = path.join(localesPath, file);\n\n try {\n const content = fs.readFileSync(filePath, \"utf-8\");\n const translations = JSON.parse(content);\n resources[lang] = { translation: translations };\n } catch (error) {\n console.error(`[vite:layout] Error parsing ${file}:`, error);\n resources[lang] = { translation: {} };\n }\n\n this.addWatchF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S,OAAO;AACZ,kBAAQ,MAAM,+BAA+B,IAAI,KAAK,KAAK;AAC3D,oBAAU,IAAI,IAAI,EAAE,aAAa,CAAA,EAAC;AAAA,QACtC;AAEA,aAAK,aAAa,QAAQ;AAAA,MAC9B;AAEA,aAAO,4BAA4B,KAAK,UAAU,SAAS,CAAC;AAAA,IAChE;AAAA,EAAA;AAER;"}
|
package/package.json
CHANGED
|
@@ -1,116 +1,120 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "wcz-test",
|
|
3
|
-
"version": "6.
|
|
4
|
-
"private": false,
|
|
5
|
-
"sideEffects": false,
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
|
-
"types": "dist/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.js"
|
|
14
|
-
},
|
|
15
|
-
"./client": {
|
|
16
|
-
"types": "./dist/client.d.ts",
|
|
17
|
-
"import": "./dist/client.js"
|
|
18
|
-
},
|
|
19
|
-
"./server": {
|
|
20
|
-
"types": "./dist/server.d.ts",
|
|
21
|
-
"import": "./dist/server.js"
|
|
22
|
-
},
|
|
23
|
-
"./components": {
|
|
24
|
-
"types": "./dist/components.d.ts",
|
|
25
|
-
"import": "./dist/components.js"
|
|
26
|
-
},
|
|
27
|
-
"./hooks": {
|
|
28
|
-
"types": "./dist/hooks.d.ts",
|
|
29
|
-
"import": "./dist/hooks.js"
|
|
30
|
-
},
|
|
31
|
-
"./models": {
|
|
32
|
-
"types": "./dist/models.d.ts",
|
|
33
|
-
"import": "./dist/models.js"
|
|
34
|
-
},
|
|
35
|
-
"./queries": {
|
|
36
|
-
"types": "./dist/queries.d.ts",
|
|
37
|
-
"import": "./dist/queries.js"
|
|
38
|
-
},
|
|
39
|
-
"./
|
|
40
|
-
"types": "./dist/
|
|
41
|
-
"import": "./dist/
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"@
|
|
90
|
-
"@
|
|
91
|
-
"@
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"react-
|
|
112
|
-
"react-
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "wcz-test",
|
|
3
|
+
"version": "6.20.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./client": {
|
|
16
|
+
"types": "./dist/client.d.ts",
|
|
17
|
+
"import": "./dist/client.js"
|
|
18
|
+
},
|
|
19
|
+
"./server": {
|
|
20
|
+
"types": "./dist/server.d.ts",
|
|
21
|
+
"import": "./dist/server.js"
|
|
22
|
+
},
|
|
23
|
+
"./components": {
|
|
24
|
+
"types": "./dist/components.d.ts",
|
|
25
|
+
"import": "./dist/components.js"
|
|
26
|
+
},
|
|
27
|
+
"./hooks": {
|
|
28
|
+
"types": "./dist/hooks.d.ts",
|
|
29
|
+
"import": "./dist/hooks.js"
|
|
30
|
+
},
|
|
31
|
+
"./models": {
|
|
32
|
+
"types": "./dist/models.d.ts",
|
|
33
|
+
"import": "./dist/models.js"
|
|
34
|
+
},
|
|
35
|
+
"./queries": {
|
|
36
|
+
"types": "./dist/queries.d.ts",
|
|
37
|
+
"import": "./dist/queries.js"
|
|
38
|
+
},
|
|
39
|
+
"./utils": {
|
|
40
|
+
"types": "./dist/utils.d.ts",
|
|
41
|
+
"import": "./dist/utils.js"
|
|
42
|
+
},
|
|
43
|
+
"./vite": {
|
|
44
|
+
"types": "./dist/vite.d.ts",
|
|
45
|
+
"import": "./dist/vite.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist"
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"dev": "vite dev",
|
|
53
|
+
"patch": "npm version patch --git-tag-version false",
|
|
54
|
+
"minor": "npm version minor --git-tag-version false",
|
|
55
|
+
"npm:install": "npm install",
|
|
56
|
+
"npm:update": "npm update",
|
|
57
|
+
"db:studio": "drizzle-kit studio",
|
|
58
|
+
"db:generate": "drizzle-kit generate",
|
|
59
|
+
"db:push": "drizzle-kit push",
|
|
60
|
+
"auth:generate": "npx @better-auth/cli generate --config src/lib/auth/auth.ts --output src/lib/db/schema/auth.ts",
|
|
61
|
+
"build": "vite build --config vite.build.config.ts",
|
|
62
|
+
"prepublishOnly": "npm run build"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@t3-oss/env-core": "^0.13.8",
|
|
66
|
+
"@types/pg": "^8.15.6",
|
|
67
|
+
"axios": "^1.13.2",
|
|
68
|
+
"better-auth": "1.4.1",
|
|
69
|
+
"dayjs": "^1.11.19",
|
|
70
|
+
"drizzle-orm": "^0.44.7",
|
|
71
|
+
"file-saver": "^2.0.5",
|
|
72
|
+
"i18next": "^25.6.3",
|
|
73
|
+
"i18next-browser-languagedetector": "^8.2.0",
|
|
74
|
+
"pg": "^8.16.3",
|
|
75
|
+
"react-dropzone": "^14.3.8",
|
|
76
|
+
"react-i18next": "^16.3.5",
|
|
77
|
+
"react-intersection-observer": "^10.0.0",
|
|
78
|
+
"react-number-format": "^5.4.4",
|
|
79
|
+
"tus-js-client": "^4.3.1",
|
|
80
|
+
"uuidv7": "^1.1.0",
|
|
81
|
+
"zod": "^4.1.13"
|
|
82
|
+
},
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"@tanstack/eslint-config": "^0.3.3",
|
|
85
|
+
"@tanstack/eslint-plugin-query": "^5.91.2",
|
|
86
|
+
"@tanstack/eslint-plugin-router": "^1.139.0",
|
|
87
|
+
"@types/file-saver": "^2.0.7",
|
|
88
|
+
"@types/node": "^22.10.2",
|
|
89
|
+
"@types/react": "^19.2.7",
|
|
90
|
+
"@types/react-dom": "^19.2.3",
|
|
91
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
92
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
93
|
+
"drizzle-kit": "^0.31.7",
|
|
94
|
+
"nitro": "^3.0.1-alpha.1",
|
|
95
|
+
"react-markdown": "^10.1.0",
|
|
96
|
+
"typescript": "^5.9.3",
|
|
97
|
+
"vite": "^7.2.6",
|
|
98
|
+
"vite-plugin-checker": "^0.11.0",
|
|
99
|
+
"vite-plugin-dts": "^4.5.4",
|
|
100
|
+
"vite-plugin-pwa": "^1.2.0",
|
|
101
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
102
|
+
},
|
|
103
|
+
"peerDependencies": {
|
|
104
|
+
"@emotion/react": "11.x",
|
|
105
|
+
"@emotion/styled": "11.x",
|
|
106
|
+
"@mui/icons-material": "7.x",
|
|
107
|
+
"@mui/material": "7.x",
|
|
108
|
+
"@mui/x-data-grid-premium": "8.x",
|
|
109
|
+
"@mui/x-date-pickers-pro": "8.x",
|
|
110
|
+
"@tanstack/query-db-collection": "1.x",
|
|
111
|
+
"@tanstack/react-db": "0.x",
|
|
112
|
+
"@tanstack/react-form": "1.x",
|
|
113
|
+
"@tanstack/react-query": "5.x",
|
|
114
|
+
"@tanstack/react-router": "1.x",
|
|
115
|
+
"@tanstack/react-router-ssr-query": "1.x",
|
|
116
|
+
"@tanstack/react-start": "1.x",
|
|
117
|
+
"react": "19.x",
|
|
118
|
+
"react-dom": "19.x"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEventCallback, Dialog, DialogTitle, DialogContent, DialogActions, Button } from "@mui/material";
|
|
3
|
-
import { createContext, useContext } from "react";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
const DialogsContext = createContext({});
|
|
6
|
-
function AlertDialog({ open, payload, onClose }) {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
return /* @__PURE__ */ jsxs(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), disableRestoreFocus: true, children: [
|
|
9
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: payload.title ?? t("Layout.Dialog.Alert") }),
|
|
10
|
-
/* @__PURE__ */ jsx(DialogContent, { children: payload.message }),
|
|
11
|
-
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, { onClick: () => onClose(), autoFocus: true, children: t("Layout.Dialog.Confirm") }) })
|
|
12
|
-
] });
|
|
13
|
-
}
|
|
14
|
-
function ConfirmDialog({ open, payload, onClose }) {
|
|
15
|
-
const { t } = useTranslation();
|
|
16
|
-
return /* @__PURE__ */ jsxs(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), disableRestoreFocus: true, children: [
|
|
17
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: payload.title ?? t("Layout.Dialog.Confirm") }),
|
|
18
|
-
/* @__PURE__ */ jsx(DialogContent, { children: payload.message }),
|
|
19
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
20
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => onClose(false), children: payload.cancelText ?? t("Layout.Dialog.Cancel") }),
|
|
21
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => onClose(true), autoFocus: true, children: t("Layout.Dialog.Confirm") })
|
|
22
|
-
] })
|
|
23
|
-
] });
|
|
24
|
-
}
|
|
25
|
-
function useDialogs() {
|
|
26
|
-
const { open, close } = useContext(DialogsContext);
|
|
27
|
-
const alert = useEventCallback(
|
|
28
|
-
(message, { ...options } = {}) => open(AlertDialog, { ...options, message })
|
|
29
|
-
);
|
|
30
|
-
const confirm = useEventCallback(
|
|
31
|
-
(message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
|
|
32
|
-
);
|
|
33
|
-
return { alert, confirm, open, close };
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
DialogsContext as D,
|
|
37
|
-
useDialogs as u
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=DialogsHooks-BlUsVlfv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DialogsHooks-BlUsVlfv.js","sources":["../src/contexts/DialogsContext.ts","../src/hooks/DialogsHooks.tsx"],"sourcesContent":["import { createContext } from \"react\";\r\nimport type { CloseDialog, OpenDialog } from \"../hooks/DialogsHooks\";\r\n\r\nexport interface DialogsContextValue {\r\n open: OpenDialog;\r\n close: CloseDialog;\r\n}\r\n\r\nexport const DialogsContext = createContext<DialogsContextValue>({} as DialogsContextValue);","import { Button, Dialog, DialogActions, DialogContent, DialogTitle, useEventCallback } from \"@mui/material\";\r\nimport { useContext } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { DialogsContext } from \"../contexts/DialogsContext\";\r\nimport type { ReactNode } from \"react\";\r\n\r\nexport interface OpenDialogOptions<TResult> {\r\n onClose?: (result: TResult) => Promise<void>;\r\n}\r\n\r\nexport interface AlertOptions {\r\n title?: ReactNode;\r\n}\r\n\r\nexport interface ConfirmOptions {\r\n title?: ReactNode;\r\n cancelText?: ReactNode;\r\n}\r\n\r\nexport interface DialogProps<TPayload = undefined, TResult = void> {\r\n payload: TPayload;\r\n open: boolean;\r\n onClose: (result: TResult) => Promise<void>;\r\n}\r\n\r\nexport type OpenAlertDialog = (message: ReactNode, options?: AlertOptions) => Promise<void>;\r\n\r\nexport type OpenConfirmDialog = (message: ReactNode, options?: ConfirmOptions) => Promise<boolean>;\r\n\r\nexport type DialogComponent<TPayload, TResult> = React.ComponentType<DialogProps<TPayload, TResult>>;\r\n\r\nexport interface OpenDialog {\r\n <TPayload extends undefined, TResult>(Component: DialogComponent<TPayload, TResult>, payload?: TPayload, options?: OpenDialogOptions<TResult>): Promise<TResult>;\r\n <TPayload, TResult>(Component: DialogComponent<TPayload, TResult>, payload: TPayload, options?: OpenDialogOptions<TResult>): Promise<TResult>;\r\n}\r\n\r\nexport type CloseDialog = <TResult>(dialog: Promise<TResult>, result: TResult) => Promise<TResult>;\r\n\r\nexport interface AlertDialogPayload extends AlertOptions {\r\n message: ReactNode;\r\n}\r\n\r\nexport type AlertDialogProps = DialogProps<AlertDialogPayload, void>\r\n\r\nexport function AlertDialog({ open, payload, onClose }: Readonly<AlertDialogProps>) {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n <Dialog maxWidth=\"xs\" fullWidth open={open} onClose={() => onClose()} disableRestoreFocus>\r\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Alert\")}</DialogTitle>\r\n <DialogContent>{payload.message}</DialogContent>\r\n <DialogActions>\r\n <Button onClick={() => onClose()} autoFocus>\r\n {t(\"Layout.Dialog.Confirm\")}\r\n </Button>\r\n </DialogActions>\r\n </Dialog>\r\n );\r\n}\r\n\r\nexport interface ConfirmDialogPayload extends ConfirmOptions {\r\n message: ReactNode;\r\n}\r\n\r\nexport type ConfirmDialogProps = DialogProps<ConfirmDialogPayload, boolean>\r\n\r\nexport function ConfirmDialog({ open, payload, onClose }: Readonly<ConfirmDialogProps>) {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n <Dialog maxWidth=\"xs\" fullWidth open={open} onClose={() => onClose(false)} disableRestoreFocus>\r\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Confirm\")}</DialogTitle>\r\n <DialogContent>{payload.message}</DialogContent>\r\n <DialogActions>\r\n <Button onClick={() => onClose(false)}>\r\n {payload.cancelText ?? t(\"Layout.Dialog.Cancel\")}\r\n </Button>\r\n <Button onClick={() => onClose(true)} autoFocus>\r\n {t(\"Layout.Dialog.Confirm\")}\r\n </Button>\r\n </DialogActions>\r\n </Dialog>\r\n );\r\n}\r\n\r\ninterface DialogHook {\r\n alert: OpenAlertDialog;\r\n confirm: OpenConfirmDialog;\r\n open: OpenDialog;\r\n close: CloseDialog;\r\n}\r\n\r\nexport function useDialogs(): DialogHook {\r\n const { open, close } = useContext(DialogsContext);\r\n\r\n const alert = useEventCallback<OpenAlertDialog>((message, { ...options } = {}) =>\r\n open(AlertDialog, { ...options, message }),\r\n );\r\n\r\n const confirm = useEventCallback<OpenConfirmDialog>((message, { ...options } = {}) =>\r\n open(ConfirmDialog, { ...options, message }),\r\n );\r\n\r\n return { alert, confirm, open, close };\r\n}\r\n"],"names":[],"mappings":";;;;AAQO,MAAM,iBAAiB,cAAmC,CAAA,CAAyB;ACoCnF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