@cyberskill/shared 1.210.0 → 1.211.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/config/commitlint/index.cjs +1 -0
- package/dist/config/config.type.cjs +1 -0
- package/dist/config/config.util.cjs +1 -0
- package/dist/config/config.util.js +35 -26
- package/dist/config/env/env.constant.cjs +1 -0
- package/dist/config/env/env.util.cjs +1 -0
- package/dist/config/env/index.cjs +1 -0
- package/dist/config/eslint/index.cjs +1 -0
- package/dist/config/eslint/index.js +12 -4
- package/dist/config/graphql-codegen/graphql-codegen.util.cjs +1 -0
- package/dist/config/graphql-codegen/graphql-codegen.util.js +33 -28
- package/dist/config/graphql-codegen/index.cjs +1 -0
- package/dist/config/index.cjs +1 -0
- package/dist/config/lint-staged/index.cjs +1 -0
- package/dist/config/vitest/index.cjs +1 -0
- package/dist/config/vitest/vitest.e2e.cjs +1 -0
- package/dist/config/vitest/vitest.e2e.js +16 -9
- package/dist/config/vitest/vitest.unit.cjs +1 -0
- package/dist/config/vitest/vitest.unit.js +18 -11
- package/dist/constant/common.cjs +1 -0
- package/dist/constant/common.js +1 -1
- package/dist/constant/index.cjs +1 -0
- package/dist/constant/response-status.cjs +1 -0
- package/dist/node/apollo-server/apollo-server.util.cjs +1 -0
- package/dist/node/apollo-server/apollo-server.util.js +48 -21
- package/dist/node/apollo-server/index.cjs +1 -0
- package/dist/node/cli/index.cjs +6 -0
- package/dist/node/cli/index.js +140 -90
- package/dist/node/command/command.type.cjs +1 -0
- package/dist/node/command/command.util.cjs +2 -0
- package/dist/node/command/command.util.js +148 -117
- package/dist/node/command/index.cjs +1 -0
- package/dist/node/express/express.util.cjs +1 -0
- package/dist/node/express/express.util.js +70 -37
- package/dist/node/express/index.cjs +1 -0
- package/dist/node/fs/fs.util.cjs +1 -0
- package/dist/node/fs/fs.util.js +55 -40
- package/dist/node/fs/index.cjs +1 -0
- package/dist/node/log/index.cjs +1 -0
- package/dist/node/log/log.type.cjs +1 -0
- package/dist/node/log/log.util.cjs +1 -0
- package/dist/node/log/log.util.js +31 -30
- package/dist/node/mongo/index.cjs +1 -0
- package/dist/node/mongo/mongo.constant.cjs +1 -0
- package/dist/node/mongo/mongo.type.cjs +1 -0
- package/dist/node/mongo/mongo.util.cjs +5 -0
- package/dist/node/mongo/mongo.util.js +433 -365
- package/dist/node/package/index.cjs +1 -0
- package/dist/node/package/package.type.cjs +1 -0
- package/dist/node/package/package.util.cjs +1 -0
- package/dist/node/package/package.util.js +224 -195
- package/dist/node/path/index.cjs +1 -0
- package/dist/node/path/path.constant.cjs +1 -0
- package/dist/node/path/path.constant.js +205 -183
- package/dist/node/path/path.util.cjs +1 -0
- package/dist/node/storage/index.cjs +1 -0
- package/dist/node/storage/storage.util.cjs +1 -0
- package/dist/node/storage/storage.util.js +70 -40
- package/dist/node/upload/index.cjs +1 -0
- package/dist/node/upload/upload.type.cjs +1 -0
- package/dist/node/upload/upload.util.cjs +1 -0
- package/dist/node/upload/upload.util.js +119 -91
- package/dist/node/ws/index.cjs +1 -0
- package/dist/node/ws/ts.util.cjs +1 -0
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@24.0.13_@vitest_browser@3.2.4_jiti@2.4.2_j_cac3da623d5688a51c0b1a2270e144db/node_modules/vitest/dist/config.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.constant.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.context.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.util.cjs +1 -0
- package/dist/react/apollo-client/apollo-client.util.js +74 -64
- package/dist/react/apollo-client/index.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -0
- package/dist/react/apollo-client-nextjs/apollo-client-nextjs.util.js +18 -11
- package/dist/react/apollo-client-nextjs/index.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.component.js +6 -6
- package/dist/react/apollo-error/apollo-error.context.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.hook.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.module.scss.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.provider.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.util.cjs +1 -0
- package/dist/react/apollo-error/apollo-error.util.js +1 -1
- package/dist/react/apollo-error/index.cjs +1 -0
- package/dist/react/i18next/i18next.hook.cjs +1 -0
- package/dist/react/i18next/i18next.util.cjs +1 -0
- package/dist/react/i18next/index.cjs +1 -0
- package/dist/react/loading/index.cjs +1 -0
- package/dist/react/loading/loading.component.cjs +6 -0
- package/dist/react/loading/loading.component.js +36 -19
- package/dist/react/loading/loading.context.cjs +1 -0
- package/dist/react/loading/loading.hook.cjs +1 -0
- package/dist/react/loading/loading.module.scss.cjs +1 -0
- package/dist/react/loading/loading.provider.cjs +1 -0
- package/dist/react/log/index.cjs +1 -0
- package/dist/react/log/log.util.cjs +1 -0
- package/dist/react/log/log.util.js +4 -4
- package/dist/react/next-intl/index.cjs +1 -0
- package/dist/react/next-intl/next-intl.constant.cjs +1 -0
- package/dist/react/next-intl/next-intl.context.cjs +1 -0
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -0
- package/dist/react/next-intl/next-intl.hoc.js +23 -14
- package/dist/react/next-intl/next-intl.hook.cjs +1 -0
- package/dist/react/next-intl/next-intl.provider.cjs +1 -0
- package/dist/react/next-intl/next-intl.provider.js +7 -7
- package/dist/react/storage/index.cjs +1 -0
- package/dist/react/storage/storage.hook.cjs +1 -0
- package/dist/react/storage/storage.hook.js +57 -41
- package/dist/react/storage/storage.util.cjs +1 -0
- package/dist/react/storage/storage.util.js +50 -25
- package/dist/react/toast/index.cjs +1 -0
- package/dist/react/userback/index.cjs +1 -0
- package/dist/react/userback/userback.component.cjs +1 -0
- package/dist/react/userback/userback.component.js +42 -18
- package/dist/style.css +1 -1
- package/dist/typescript/common.type.cjs +1 -0
- package/dist/typescript/index.cjs +1 -0
- package/dist/util/common/common.util.cjs +1 -0
- package/dist/util/common/common.util.js +37 -29
- package/dist/util/common/index.cjs +1 -0
- package/dist/util/index.cjs +1 -0
- package/dist/util/object/index.cjs +1 -0
- package/dist/util/object/object.util.cjs +1 -0
- package/dist/util/object/object.util.js +55 -49
- package/dist/util/serializer/index.cjs +1 -0
- package/dist/util/serializer/serializer.util.cjs +1 -0
- package/dist/util/string/index.cjs +1 -0
- package/dist/util/string/string.util.cjs +1 -0
- package/dist/util/string/string.util.js +46 -36
- package/dist/util/validate/index.cjs +1 -0
- package/dist/util/validate/validate.util.cjs +1 -0
- package/package.json +69 -35
|
@@ -1,126 +1,154 @@
|
|
|
1
|
-
import { E_UploadType as
|
|
2
|
-
import { dirname as
|
|
3
|
-
import { pathExistsSync as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { E_UploadType as f } from "./upload.type.js";
|
|
2
|
+
import { dirname as E } from "../path/path.util.js";
|
|
3
|
+
import { pathExistsSync as x, mkdirSync as z, createWriteStream as h } from "../fs/fs.util.js";
|
|
4
|
+
var O = Object.defineProperty, v = Object.getOwnPropertySymbols, _ = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable, w = (i, r, e) => r in i ? O(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e, y = (i, r) => {
|
|
5
|
+
for (var e in r || (r = {}))
|
|
6
|
+
_.call(r, e) && w(i, e, r[e]);
|
|
7
|
+
if (v)
|
|
8
|
+
for (var e of v(r))
|
|
9
|
+
I.call(r, e) && w(i, e, r[e]);
|
|
10
|
+
return i;
|
|
11
|
+
}, g = (i, r, e) => new Promise((t, l) => {
|
|
12
|
+
var n = (o) => {
|
|
13
|
+
try {
|
|
14
|
+
a(e.next(o));
|
|
15
|
+
} catch (c) {
|
|
16
|
+
l(c);
|
|
17
|
+
}
|
|
18
|
+
}, s = (o) => {
|
|
19
|
+
try {
|
|
20
|
+
a(e.throw(o));
|
|
21
|
+
} catch (c) {
|
|
22
|
+
l(c);
|
|
23
|
+
}
|
|
24
|
+
}, a = (o) => o.done ? t(o.value) : Promise.resolve(o.value).then(n, s);
|
|
25
|
+
a((e = e.apply(i, r)).next());
|
|
26
|
+
});
|
|
27
|
+
function L(i) {
|
|
28
|
+
return g(this, null, function* () {
|
|
29
|
+
return new Promise((r, e) => {
|
|
30
|
+
let t = 0;
|
|
31
|
+
i.on("data", (l) => {
|
|
32
|
+
t += l.length;
|
|
33
|
+
}), i.on("end", () => r(t)), i.on("error", e);
|
|
34
|
+
});
|
|
10
35
|
});
|
|
11
36
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
37
|
+
function S(i, r) {
|
|
38
|
+
const e = i.lastIndexOf(".");
|
|
39
|
+
if (e === -1)
|
|
15
40
|
return !1;
|
|
16
|
-
const
|
|
17
|
-
return
|
|
41
|
+
const t = i.substring(e + 1).toLowerCase();
|
|
42
|
+
return r.includes(t);
|
|
18
43
|
}
|
|
19
|
-
function
|
|
20
|
-
const { filename:
|
|
21
|
-
if (!
|
|
44
|
+
function P(i, r, e) {
|
|
45
|
+
const { filename: t, fileSize: l } = i, n = r[e], { allowedExtensions: s, sizeLimit: a } = n;
|
|
46
|
+
if (!S(t, s))
|
|
22
47
|
return {
|
|
23
48
|
isValid: !1,
|
|
24
|
-
error: `File extension not allowed for ${
|
|
49
|
+
error: `File extension not allowed for ${e.toLowerCase()} files. Allowed extensions: ${s.join(", ")}`
|
|
25
50
|
};
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
51
|
+
if (l !== void 0 && l > a) {
|
|
52
|
+
const o = Math.round(a / 1048576);
|
|
28
53
|
return {
|
|
29
54
|
isValid: !1,
|
|
30
|
-
error: `File size exceeds limit for ${
|
|
55
|
+
error: `File size exceeds limit for ${e.toLowerCase()} files. Maximum size: ${o}MB`
|
|
31
56
|
};
|
|
32
57
|
}
|
|
33
58
|
return { isValid: !0 };
|
|
34
59
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
[
|
|
60
|
+
function b(i) {
|
|
61
|
+
const r = {
|
|
62
|
+
[f.IMAGE]: {
|
|
38
63
|
allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "svg"],
|
|
39
64
|
sizeLimit: 5242880
|
|
40
65
|
// 5MB
|
|
41
66
|
},
|
|
42
|
-
[
|
|
67
|
+
[f.VIDEO]: {
|
|
43
68
|
allowedExtensions: ["mp4", "avi", "mov", "wmv", "flv", "webm"],
|
|
44
69
|
sizeLimit: 524288e3
|
|
45
70
|
// 500MB
|
|
46
71
|
},
|
|
47
|
-
[
|
|
72
|
+
[f.DOCUMENT]: {
|
|
48
73
|
allowedExtensions: ["pdf", "doc", "docx", "txt", "rtf"],
|
|
49
74
|
sizeLimit: 10485760
|
|
50
75
|
// 10MB
|
|
51
76
|
},
|
|
52
|
-
[
|
|
77
|
+
[f.OTHER]: {
|
|
53
78
|
allowedExtensions: ["zip", "rar", "tar", "gz"],
|
|
54
79
|
sizeLimit: 5242880
|
|
55
80
|
// 5MB
|
|
56
81
|
}
|
|
57
|
-
}
|
|
82
|
+
};
|
|
83
|
+
return y(y({}, r), i);
|
|
58
84
|
}
|
|
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
|
-
|
|
85
|
+
function V(i) {
|
|
86
|
+
return g(this, null, function* () {
|
|
87
|
+
const { path: r, file: e, config: t, type: l } = i;
|
|
88
|
+
if (!r || typeof r != "string")
|
|
89
|
+
return {
|
|
90
|
+
success: !1,
|
|
91
|
+
message: "Invalid path provided",
|
|
92
|
+
result: ""
|
|
93
|
+
};
|
|
94
|
+
if (!e || typeof e != "object")
|
|
95
|
+
return {
|
|
96
|
+
success: !1,
|
|
97
|
+
message: "Invalid file provided",
|
|
98
|
+
result: ""
|
|
99
|
+
};
|
|
100
|
+
if (t) {
|
|
101
|
+
const n = [f.IMAGE, f.VIDEO, f.DOCUMENT, f.OTHER];
|
|
102
|
+
for (const s of n) {
|
|
103
|
+
if (!t[s] || !Array.isArray(t[s].allowedExtensions) || t[s].allowedExtensions.length === 0)
|
|
104
|
+
return {
|
|
105
|
+
success: !1,
|
|
106
|
+
message: `Invalid config for ${s.toLowerCase()} files`,
|
|
107
|
+
result: ""
|
|
108
|
+
};
|
|
109
|
+
if (typeof t[s].sizeLimit != "number" || t[s].sizeLimit <= 0)
|
|
110
|
+
return {
|
|
111
|
+
success: !1,
|
|
112
|
+
message: `Invalid size limit for ${s.toLowerCase()} files`,
|
|
113
|
+
result: ""
|
|
114
|
+
};
|
|
115
|
+
}
|
|
88
116
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
117
|
+
try {
|
|
118
|
+
const n = yield (yield e).file, { filename: s, createReadStream: a } = n;
|
|
119
|
+
if (t) {
|
|
120
|
+
const m = a(), u = yield L(m), p = P(
|
|
121
|
+
{ filename: s, fileSize: u },
|
|
122
|
+
t,
|
|
123
|
+
l
|
|
124
|
+
);
|
|
125
|
+
if (!p.isValid)
|
|
126
|
+
return {
|
|
127
|
+
success: !1,
|
|
128
|
+
message: p.error || "File validation failed",
|
|
129
|
+
result: ""
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const o = E(r);
|
|
133
|
+
x(o) || z(o, { recursive: !0 });
|
|
134
|
+
const c = a(), d = h(r);
|
|
135
|
+
return c.pipe(d), yield new Promise((m, u) => {
|
|
136
|
+
d.on("finish", () => m()), d.on("error", u), c.on("error", u);
|
|
137
|
+
}), {
|
|
138
|
+
success: !0,
|
|
139
|
+
message: "File uploaded successfully",
|
|
140
|
+
result: r
|
|
141
|
+
};
|
|
142
|
+
} catch (n) {
|
|
143
|
+
return {
|
|
144
|
+
success: !1,
|
|
145
|
+
message: n instanceof Error ? n.message : "File upload failed",
|
|
146
|
+
result: ""
|
|
147
|
+
};
|
|
104
148
|
}
|
|
105
|
-
|
|
106
|
-
w(f) || x(f, { recursive: !0 });
|
|
107
|
-
const m = l(), d = E(s);
|
|
108
|
-
return m.pipe(d), await new Promise((u, c) => {
|
|
109
|
-
d.on("finish", () => u()), d.on("error", c), m.on("error", c);
|
|
110
|
-
}), {
|
|
111
|
-
success: !0,
|
|
112
|
-
message: "File uploaded successfully",
|
|
113
|
-
result: s
|
|
114
|
-
};
|
|
115
|
-
} catch (o) {
|
|
116
|
-
return {
|
|
117
|
-
success: !1,
|
|
118
|
-
message: o instanceof Error ? o.message : "File upload failed",
|
|
119
|
-
result: ""
|
|
120
|
-
};
|
|
121
|
-
}
|
|
149
|
+
});
|
|
122
150
|
}
|
|
123
151
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
152
|
+
b as createUploadConfig,
|
|
153
|
+
V as upload
|
|
126
154
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ts.util.cjs");exports.createWSServer=e.createWSServer;exports.initGraphQLWS=e.initGraphQLWS;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("graphql-ws/use/ws"),t=require("ws");function S(e){return new t.WebSocketServer({server:e.server,path:e.path})}function a(e){return r.useServer({schema:e.schema},e.server)}exports.createWSServer=S;exports.initGraphQLWS=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){return e}exports.defineConfig=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@apollo/client/react/react.cjs"),e=require("react"),n=require("./apollo-client.context.cjs"),i=require("./apollo-client.util.cjs"),a=require("../apollo-error/apollo-error.provider.cjs"),c=require("../apollo-error/apollo-error.component.cjs"),u=require("react-hot-toast");function p({options:r,children:t}){const o=e.useMemo(()=>i.getClient(r||{}),[r]);return e.createElement(e.Fragment,null,e.createElement(a.ApolloErrorProvider,null,e.createElement(n.ApolloClientProvider,{client:o},e.createElement(l.ApolloProvider,{client:o},t)),e.createElement(c.ApolloErrorComponent,null)),e.createElement(u.Toaster,{position:"top-right"}))}exports.ApolloProvider=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="/graphql";exports.GRAPHQL_URI_DEFAULT=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=e.createContext(null);function n({client:o,children:l}){return e.createElement(t,{value:o},l)}exports.ApolloClientContext=t;exports.ApolloClientProvider=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("@apollo/client/core/core.cjs"),u=require("@apollo/client/link/core/core.cjs"),T=require("@apollo/client/link/error/error.cjs"),j=require("@apollo/client/link/remove-typename/remove-typename.cjs"),D=require("@apollo/client/link/subscriptions/subscriptions.cjs"),N=require("@apollo/client/utilities/utilities.cjs"),C=require("apollo-upload-client/createUploadLink.mjs"),S=require("graphql-ws"),L=require("react"),I=require("../apollo-error/apollo-error.util.cjs"),q=require("./apollo-client.constant.cjs"),s=require("../log/log.util.cjs"),A=require("react-hot-toast");var R=Object.defineProperty,P=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,w=(n,e,r)=>e in n?R(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,F=(n,e)=>{for(var r in e||(e={}))x.call(e,r)&&w(n,r,e[r]);if(P)for(var r of P(e))G.call(e,r)&&w(n,r,e[r]);return n},H=(n,e,r)=>w(n,typeof e!="symbol"?e+"":e,r);class O extends u.ApolloLink{constructor(){super(...arguments),H(this,"count",0)}request(e,r){const c=Date.now();return this.count+=1,r(e).map(p=>{const f=Date.now()-c,m=e.operationName||"Unnamed";return s.log.info(`[Apollo] #${this.count}: ${m} (${f}ms)`),p})}}function $(n){const{uri:e,wsUrl:r,customLinks:c}=n,p=new O,f=T.onError(({graphQLErrors:t,networkError:o,protocolErrors:i,operation:g})=>{var h,k;const U=(g==null?void 0:g.operationName)||"Unknown";if(t&&t.forEach(({message:l,locations:a,path:_})=>{s.log.error(`[GraphQL error] ${U}: ${l}, Location: ${JSON.stringify(a,null,4)}, Path: ${_}`)}),i&&i.forEach(({message:l,extensions:a})=>{s.log.error(`[Protocol error]: ${l}, Extensions: ${JSON.stringify(a,null,4)}`)}),o&&s.log.error(`[Network error]: ${o}`),t||i||o){const l=((h=t==null?void 0:t[0])==null?void 0:h.message)||((k=i==null?void 0:i[0])==null?void 0:k.message)||(o==null?void 0:o.message)||"Unexpected error",a=new v.ApolloError({graphQLErrors:t||[],protocolErrors:i||[],clientErrors:[],networkError:o||null,errorMessage:l,extraInfo:{operation:g}});typeof window!="undefined"&&A.toast.error(_=>L.createElement(L.Fragment,null,l," ",L.createElement("button",{type:"button",className:"text-blue-500 hover:text-blue-700",onClick:()=>{setTimeout(()=>{I.showGlobalApolloError(a)},0),A.toast.dismiss(_.id)}},"Show Details")))}}),m=j.removeTypenameFromVariables();e||s.log.warn(`[Apollo] No GraphQL URI provided — using "${q.GRAPHQL_URI_DEFAULT}" as default`);const d=C({uri:e!=null?e:q.GRAPHQL_URI_DEFAULT,credentials:"include",headers:{"apollo-require-preflight":"true"}}),b=r?new D.GraphQLWsLink(S.createClient({url:r})):u.ApolloLink.empty(),y=b instanceof u.ApolloLink?u.split(({query:t})=>{const o=N.getMainDefinition(t);return o.kind==="OperationDefinition"&&o.operation==="subscription"},b,d):d;return y===d&&r&&s.log.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[p,f,m,...c!=null?c:[],y]}function M(n={}){const e=u.from($(n));return new v.ApolloClient(F({link:e,cache:new v.InMemoryCache},n))}exports.DevLoggerLink=O;exports.createApolloLinks=$;exports.getClient=M;
|
|
@@ -1,101 +1,111 @@
|
|
|
1
|
-
import { ApolloError as
|
|
2
|
-
import { ApolloLink as
|
|
3
|
-
import { onError as
|
|
4
|
-
import { removeTypenameFromVariables as
|
|
5
|
-
import { GraphQLWsLink as
|
|
6
|
-
import { getMainDefinition as
|
|
7
|
-
import
|
|
8
|
-
import { createClient as
|
|
9
|
-
import
|
|
10
|
-
import { showGlobalApolloError as
|
|
11
|
-
import { GRAPHQL_URI_DEFAULT as
|
|
12
|
-
import { log as
|
|
13
|
-
import { toast as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { ApolloError as A, ApolloClient as N, InMemoryCache as U } from "@apollo/client/core/core.cjs";
|
|
2
|
+
import { ApolloLink as g, split as x, from as D } from "@apollo/client/link/core/core.cjs";
|
|
3
|
+
import { onError as C } from "@apollo/client/link/error/error.cjs";
|
|
4
|
+
import { removeTypenameFromVariables as I } from "@apollo/client/link/remove-typename/remove-typename.cjs";
|
|
5
|
+
import { GraphQLWsLink as S } from "@apollo/client/link/subscriptions/subscriptions.cjs";
|
|
6
|
+
import { getMainDefinition as T } from "@apollo/client/utilities/utilities.cjs";
|
|
7
|
+
import G from "apollo-upload-client/createUploadLink.mjs";
|
|
8
|
+
import { createClient as R } from "graphql-ws";
|
|
9
|
+
import w from "react";
|
|
10
|
+
import { showGlobalApolloError as F } from "../apollo-error/apollo-error.util.js";
|
|
11
|
+
import { GRAPHQL_URI_DEFAULT as k } from "./apollo-client.constant.js";
|
|
12
|
+
import { log as s } from "../log/log.util.js";
|
|
13
|
+
import { toast as O } from "react-hot-toast";
|
|
14
|
+
var M = Object.defineProperty, P = Object.getOwnPropertySymbols, j = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable, L = (r, e, o) => e in r ? M(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o, H = (r, e) => {
|
|
15
|
+
for (var o in e || (e = {}))
|
|
16
|
+
j.call(e, o) && L(r, o, e[o]);
|
|
17
|
+
if (P)
|
|
18
|
+
for (var o of P(e))
|
|
19
|
+
q.call(e, o) && L(r, o, e[o]);
|
|
20
|
+
return r;
|
|
21
|
+
}, J = (r, e, o) => L(r, typeof e != "symbol" ? e + "" : e, o);
|
|
22
|
+
class V extends g {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments), J(this, "count", 0);
|
|
25
|
+
}
|
|
26
|
+
request(e, o) {
|
|
17
27
|
const m = Date.now();
|
|
18
|
-
return this.count += 1,
|
|
19
|
-
const
|
|
20
|
-
return
|
|
28
|
+
return this.count += 1, o(e).map((u) => {
|
|
29
|
+
const c = Date.now() - m, p = e.operationName || "Unnamed";
|
|
30
|
+
return s.info(`[Apollo] #${this.count}: ${p} (${c}ms)`), u;
|
|
21
31
|
});
|
|
22
32
|
}
|
|
23
33
|
}
|
|
24
|
-
function
|
|
25
|
-
const { uri:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
function W(r) {
|
|
35
|
+
const { uri: e, wsUrl: o, customLinks: m } = r, u = new V(), c = C(({ graphQLErrors: t, networkError: n, protocolErrors: i, operation: d }) => {
|
|
36
|
+
var h, y;
|
|
37
|
+
const $ = (d == null ? void 0 : d.operationName) || "Unknown";
|
|
38
|
+
if (t && t.forEach(({ message: l, locations: a, path: v }) => {
|
|
39
|
+
s.error(
|
|
40
|
+
`[GraphQL error] ${$}: ${l}, Location: ${JSON.stringify(a, null, 4)}, Path: ${v}`
|
|
30
41
|
);
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
`[Protocol error]: ${
|
|
42
|
+
}), i && i.forEach(({ message: l, extensions: a }) => {
|
|
43
|
+
s.error(
|
|
44
|
+
`[Protocol error]: ${l}, Extensions: ${JSON.stringify(a, null, 4)}`
|
|
34
45
|
);
|
|
35
|
-
}),
|
|
36
|
-
const
|
|
37
|
-
graphQLErrors:
|
|
38
|
-
protocolErrors:
|
|
46
|
+
}), n && s.error(`[Network error]: ${n}`), t || i || n) {
|
|
47
|
+
const l = ((h = t == null ? void 0 : t[0]) == null ? void 0 : h.message) || ((y = i == null ? void 0 : i[0]) == null ? void 0 : y.message) || (n == null ? void 0 : n.message) || "Unexpected error", a = new A({
|
|
48
|
+
graphQLErrors: t || [],
|
|
49
|
+
protocolErrors: i || [],
|
|
39
50
|
clientErrors: [],
|
|
40
|
-
networkError:
|
|
41
|
-
errorMessage:
|
|
51
|
+
networkError: n || null,
|
|
52
|
+
errorMessage: l,
|
|
42
53
|
extraInfo: {
|
|
43
|
-
operation:
|
|
54
|
+
operation: d
|
|
44
55
|
}
|
|
45
56
|
});
|
|
46
|
-
typeof window
|
|
57
|
+
typeof window != "undefined" && O.error((v) => /* @__PURE__ */ w.createElement(w.Fragment, null, l, " ", /* @__PURE__ */ w.createElement(
|
|
47
58
|
"button",
|
|
48
59
|
{
|
|
49
60
|
type: "button",
|
|
50
61
|
className: "text-blue-500 hover:text-blue-700",
|
|
51
62
|
onClick: () => {
|
|
52
63
|
setTimeout(() => {
|
|
53
|
-
|
|
54
|
-
}, 0),
|
|
64
|
+
F(a);
|
|
65
|
+
}, 0), O.dismiss(v.id);
|
|
55
66
|
}
|
|
56
67
|
},
|
|
57
68
|
"Show Details"
|
|
58
69
|
)));
|
|
59
70
|
}
|
|
60
|
-
}), p =
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
uri:
|
|
71
|
+
}), p = I();
|
|
72
|
+
e || s.warn(`[Apollo] No GraphQL URI provided — using "${k}" as default`);
|
|
73
|
+
const f = G({
|
|
74
|
+
uri: e != null ? e : k,
|
|
64
75
|
credentials: "include",
|
|
65
76
|
headers: {
|
|
66
77
|
"apollo-require-preflight": "true"
|
|
67
78
|
}
|
|
68
|
-
}),
|
|
69
|
-
({ query:
|
|
70
|
-
const
|
|
71
|
-
return
|
|
79
|
+
}), _ = o ? new S(R({ url: o })) : g.empty(), b = _ instanceof g ? x(
|
|
80
|
+
({ query: t }) => {
|
|
81
|
+
const n = T(t);
|
|
82
|
+
return n.kind === "OperationDefinition" && n.operation === "subscription";
|
|
72
83
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
) :
|
|
76
|
-
return
|
|
77
|
-
|
|
84
|
+
_,
|
|
85
|
+
f
|
|
86
|
+
) : f;
|
|
87
|
+
return b === f && o && s.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."), [
|
|
88
|
+
u,
|
|
78
89
|
// 🪵 custom logger
|
|
79
|
-
|
|
90
|
+
c,
|
|
80
91
|
// ⚠️ Apollo's error handling
|
|
81
92
|
p,
|
|
82
93
|
// 🧼 cleans up __typename
|
|
83
|
-
...m
|
|
94
|
+
...m != null ? m : [],
|
|
84
95
|
// 🔗 custom links
|
|
85
|
-
|
|
96
|
+
b
|
|
86
97
|
// 📡 HTTP vs WS routing (includes uploadLink)
|
|
87
98
|
];
|
|
88
99
|
}
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
return new
|
|
92
|
-
link:
|
|
93
|
-
cache: new
|
|
94
|
-
|
|
95
|
-
});
|
|
100
|
+
function ie(r = {}) {
|
|
101
|
+
const e = D(W(r));
|
|
102
|
+
return new N(H({
|
|
103
|
+
link: e,
|
|
104
|
+
cache: new U()
|
|
105
|
+
}, r));
|
|
96
106
|
}
|
|
97
107
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
V as DevLoggerLink,
|
|
109
|
+
W as createApolloLinks,
|
|
110
|
+
ie as getClient
|
|
101
111
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./apollo-client.component.cjs"),n=require("./apollo-client.constant.cjs"),t=require("./apollo-client.context.cjs"),r=require("./apollo-client.util.cjs"),o=require("@apollo/client/cache/cache.cjs"),e=require("@apollo/client/react/hooks/hooks.cjs");exports.ApolloProvider=u.ApolloProvider;exports.GRAPHQL_URI_DEFAULT=n.GRAPHQL_URI_DEFAULT;exports.ApolloClientContext=t.ApolloClientContext;exports.ApolloClientProvider=t.ApolloClientProvider;exports.DevLoggerLink=r.DevLoggerLink;exports.createApolloLinks=r.createApolloLinks;exports.getClient=r.getClient;Object.defineProperty(exports,"makeVar",{enumerable:!0,get:()=>o.makeVar});Object.defineProperty(exports,"useApolloClient",{enumerable:!0,get:()=>e.useApolloClient});Object.defineProperty(exports,"useBackgroundQuery",{enumerable:!0,get:()=>e.useBackgroundQuery});Object.defineProperty(exports,"useFragment",{enumerable:!0,get:()=>e.useFragment});Object.defineProperty(exports,"useLazyQuery",{enumerable:!0,get:()=>e.useLazyQuery});Object.defineProperty(exports,"useLoadableQuery",{enumerable:!0,get:()=>e.useLoadableQuery});Object.defineProperty(exports,"useMutation",{enumerable:!0,get:()=>e.useMutation});Object.defineProperty(exports,"useQuery",{enumerable:!0,get:()=>e.useQuery});Object.defineProperty(exports,"useQueryRefHandlers",{enumerable:!0,get:()=>e.useQueryRefHandlers});Object.defineProperty(exports,"useReactiveVar",{enumerable:!0,get:()=>e.useReactiveVar});Object.defineProperty(exports,"useReadQuery",{enumerable:!0,get:()=>e.useReadQuery});Object.defineProperty(exports,"useSubscription",{enumerable:!0,get:()=>e.useSubscription});Object.defineProperty(exports,"useSuspenseFragment",{enumerable:!0,get:()=>e.useSuspenseFragment});Object.defineProperty(exports,"useSuspenseQuery",{enumerable:!0,get:()=>e.useSuspenseQuery});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@apollo/client-integration-nextjs"),e=require("react"),n=require("./apollo-client-nextjs.util.cjs"),i=require("../apollo-error/apollo-error.provider.cjs"),a=require("../apollo-error/apollo-error.component.cjs"),u=require("react-hot-toast");function p({options:r,children:o}){const t=e.useMemo(()=>()=>n.getClient(r||{}),[r]);return e.createElement(e.Fragment,null,e.createElement(i.ApolloErrorProvider,null,e.createElement(l.ApolloNextAppProvider,{makeClient:t},o),e.createElement(a.ApolloErrorComponent,null)),e.createElement(u.Toaster,{position:"top-right"}))}exports.ApolloProvider=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@apollo/client-integration-nextjs"),i=require("./apollo-client-nextjs.util.cjs"),l=(e={})=>t.registerApolloClient(()=>i.getClient(e));exports.makeClient=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@apollo/client-integration-nextjs"),a=require("@apollo/client/link/core/core.cjs"),i=require("../apollo-client/apollo-client.util.cjs");var c=Object.defineProperty,n=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,l=(r,e,t)=>e in r?c(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,s=(r,e)=>{for(var t in e||(e={}))p.call(e,t)&&l(r,t,e[t]);if(n)for(var t of n(e))u.call(e,t)&&l(r,t,e[t]);return r};function _(r={}){const e=a.from(i.createApolloLinks(r));return new o.ApolloClient(s({link:e,cache:new o.InMemoryCache},r))}exports.getClient=_;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import { ApolloClient as
|
|
2
|
-
import { from as
|
|
3
|
-
import { createApolloLinks as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { ApolloClient as a, InMemoryCache as p } from "@apollo/client-integration-nextjs";
|
|
2
|
+
import { from as l } from "@apollo/client/link/core/core.cjs";
|
|
3
|
+
import { createApolloLinks as f } from "../apollo-client/apollo-client.util.js";
|
|
4
|
+
var i = Object.defineProperty, t = Object.getOwnPropertySymbols, m = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable, n = (e, r, o) => r in e ? i(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, _ = (e, r) => {
|
|
5
|
+
for (var o in r || (r = {}))
|
|
6
|
+
m.call(r, o) && n(e, o, r[o]);
|
|
7
|
+
if (t)
|
|
8
|
+
for (var o of t(r))
|
|
9
|
+
c.call(r, o) && n(e, o, r[o]);
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
12
|
+
function v(e = {}) {
|
|
13
|
+
const r = l(f(e));
|
|
14
|
+
return new a(_({
|
|
15
|
+
link: r,
|
|
16
|
+
cache: new p()
|
|
17
|
+
}, e));
|
|
11
18
|
}
|
|
12
19
|
export {
|
|
13
|
-
|
|
20
|
+
v as getClient
|
|
14
21
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./apollo-client-nextjs.component.cjs"),o=require("./apollo-client-nextjs.util.cjs");exports.ApolloProvider=e.ApolloProvider;exports.getClient=o.getClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),c=require("./apollo-error.context.cjs"),t=require("./apollo-error.module.scss.cjs");function m(){const o=e.use(c.ApolloErrorContext),r=o==null?void 0:o.error;if(!r)return null;const l=(s,n)=>n!=null&&n.length?e.createElement("div",null,e.createElement("strong",null,s,":"),e.createElement("ul",null,n.map(a=>e.createElement("li",{key:a.message},a.message)))):null;return e.createElement("div",{className:t.default["modal-backdrop"]},e.createElement("div",{className:t.default["modal-content"]},e.createElement("button",{type:"button",className:t.default["btn-close"],onClick:o.hideError},"✕"),e.createElement("div",{className:t.default["error-title"]},e.createElement("button",{type:"button",className:t.default["btn-retry"],onClick:()=>window.location.reload()},"Reload")," ",r.message),e.createElement("div",{className:t.default["error-details"]},r.networkError&&e.createElement("pre",{className:"network"},e.createElement("strong",null,"Network Error:")," ",r.networkError.message),l("GraphQL Errors",[...r.graphQLErrors]),l("Protocol Errors",[...r.protocolErrors]),l("Client Errors",[...r.clientErrors]),r.extraInfo&&e.createElement("pre",{className:"extra"},e.createElement("strong",null,"Extra Info:")," ",JSON.stringify(r.extraInfo,null,4)))))}exports.ApolloErrorComponent=m;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import e, { use as c } from "react";
|
|
2
2
|
import { ApolloErrorContext as m } from "./apollo-error.context.js";
|
|
3
3
|
import t from "./apollo-error.module.scss.js";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
4
|
+
function d() {
|
|
5
|
+
const o = c(m), r = o == null ? void 0 : o.error;
|
|
6
6
|
if (!r)
|
|
7
7
|
return null;
|
|
8
|
-
const
|
|
8
|
+
const l = (s, n) => n != null && n.length ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", null, s, ":"), /* @__PURE__ */ e.createElement("ul", null, n.map((a) => /* @__PURE__ */ e.createElement("li", { key: a.message }, a.message)))) : null;
|
|
9
9
|
return /* @__PURE__ */ e.createElement("div", { className: t["modal-backdrop"] }, /* @__PURE__ */ e.createElement("div", { className: t["modal-content"] }, /* @__PURE__ */ e.createElement(
|
|
10
10
|
"button",
|
|
11
11
|
{
|
|
12
12
|
type: "button",
|
|
13
13
|
className: t["btn-close"],
|
|
14
|
-
onClick:
|
|
14
|
+
onClick: o.hideError
|
|
15
15
|
},
|
|
16
16
|
"✕"
|
|
17
17
|
), /* @__PURE__ */ e.createElement("div", { className: t["error-title"] }, /* @__PURE__ */ e.createElement(
|
|
@@ -22,8 +22,8 @@ function p() {
|
|
|
22
22
|
onClick: () => window.location.reload()
|
|
23
23
|
},
|
|
24
24
|
"Reload"
|
|
25
|
-
), " ", r.message), /* @__PURE__ */ e.createElement("div", { className: t["error-details"] }, r.networkError && /* @__PURE__ */ e.createElement("pre", { className: "network" }, /* @__PURE__ */ e.createElement("strong", null, "Network Error:"), " ", r.networkError.message),
|
|
25
|
+
), " ", r.message), /* @__PURE__ */ e.createElement("div", { className: t["error-details"] }, r.networkError && /* @__PURE__ */ e.createElement("pre", { className: "network" }, /* @__PURE__ */ e.createElement("strong", null, "Network Error:"), " ", r.networkError.message), l("GraphQL Errors", [...r.graphQLErrors]), l("Protocol Errors", [...r.protocolErrors]), l("Client Errors", [...r.clientErrors]), r.extraInfo && /* @__PURE__ */ e.createElement("pre", { className: "extra" }, /* @__PURE__ */ e.createElement("strong", null, "Extra Info:"), " ", JSON.stringify(r.extraInfo, null, 4)))));
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
d as ApolloErrorComponent
|
|
29
29
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),t=o.createContext(void 0);exports.ApolloErrorContext=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),e=require("./apollo-error.context.cjs");function t(){const r=o.use(e.ApolloErrorContext);if(!r)throw new Error("useApolloError must be used within ApolloErrorProvider");return r}exports.useApolloError=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"modal-backdrop":"_modal-backdrop_8fveh_1","modal-content":"_modal-content_8fveh_11","btn-close":"_btn-close_8fveh_22","error-title":"_error-title_8fveh_36","btn-retry":"_btn-retry_8fveh_41","error-details":"_error-details_8fveh_54"};exports.default=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),u=require("./apollo-error.context.cjs"),n=require("./apollo-error.util.cjs");function a({children:l}){const[e,o]=r.useState(null);r.useEffect(()=>{n.setGlobalApolloErrorCallback(o)},[]);const t=r.useMemo(()=>({error:e,showError:o,hideError:()=>o(null)}),[e]);return r.createElement(u.ApolloErrorContext,{value:t},l)}exports.ApolloErrorProvider=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let o=null;function r(l){o=l}function a(l){o==null||o(l)}exports.setGlobalApolloErrorCallback=r;exports.showGlobalApolloError=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./apollo-error.component.cjs"),l=require("./apollo-error.context.cjs"),e=require("./apollo-error.hook.cjs"),p=require("./apollo-error.provider.cjs"),o=require("./apollo-error.util.cjs");exports.ApolloErrorComponent=r.ApolloErrorComponent;exports.ApolloErrorContext=l.ApolloErrorContext;exports.useApolloError=e.useApolloError;exports.ApolloErrorProvider=p.ApolloErrorProvider;exports.setGlobalApolloErrorCallback=o.setGlobalApolloErrorCallback;exports.showGlobalApolloError=o.showGlobalApolloError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react-i18next"),t=e.useTranslation;exports.useTranslateI18next=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("i18next"),i=require("react-i18next");function n(e){return t.use(i.initReactI18next).init(e)}exports.initI18next=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./i18next.hook.cjs"),t=require("./i18next.util.cjs");exports.useTranslateI18next=e.useTranslateI18next;exports.initI18next=t.initI18next;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./loading.component.cjs"),e=require("./loading.context.cjs"),i=require("./loading.hook.cjs"),n=require("./loading.provider.cjs");exports.Loading=o.Loading;exports.LoadingContext=e.LoadingContext;exports.useLoading=i.useLoading;exports.LoadingProvider=n.LoadingProvider;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("clsx"),a=require("react"),l=require("./loading.module.scss.cjs");var _=Object.defineProperty,o=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,m=(e,r,t)=>r in e?_(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,p=(e,r)=>{for(var t in r||(r={}))f.call(r,t)&&m(e,t,r[t]);if(o)for(var t of o(r))u.call(r,t)&&m(e,t,r[t]);return e},y=(e,r)=>{var t={};for(var n in e)f.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&o)for(var n of o(e))r.indexOf(n)<0&&u.call(e,n)&&(t[n]=e[n]);return t};function E(){if(document.getElementById("noscroll-style"))return;const e=document.createElement("style");e.id="noscroll-style",e.innerHTML=`
|
|
2
|
+
.noscroll {
|
|
3
|
+
overflow: hidden !important;
|
|
4
|
+
height: 100vh !important;
|
|
5
|
+
}
|
|
6
|
+
`,document.head.appendChild(e)}function N(e){var r=e,{full:t=!1,className:n="",message:i="Loading"}=r,v=y(r,["full","className","message"]);a.useEffect(()=>{if(t){document.body.classList.add("noscroll");const c=g=>g.preventDefault();return document.addEventListener("contextmenu",c),()=>{document.body.classList.remove("noscroll"),document.removeEventListener("contextmenu",c)}}},[t]),a.useEffect(()=>{E()},[]);function s(){return a.createElement("div",p({className:l.default.container},v),a.createElement("div",{className:l.default.ring}),a.createElement("div",{className:l.default.ring}),a.createElement("div",{className:l.default.ring}),a.createElement("div",{className:l.default.ring}),i&&a.createElement("div",{className:l.default.message},i))}return t?a.createElement("div",{className:d(l.default.full,n)},s()):a.createElement("div",{className:d(l.default.block,n)},s())}exports.Loading=N;
|