@cyberskill/shared 1.200.0 → 1.201.1
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/magic-string.es-D_iPNVbJ.cjs +10 -0
- package/dist/magic-string.es-cELbkQ5L.js +901 -0
- package/dist/{path.constant-Y6ImOuVK.cjs → path.constant-BT9ilH7U.cjs} +2 -2
- package/dist/{path.constant-CFKXX6cG.js → path.constant-C43rx8PK.js} +58 -59
- package/dist/src/config/vitest/vitest.unit.cjs +1 -1
- package/dist/src/config/vitest/vitest.unit.js +1 -1
- package/dist/src/config/vitest/vitest.unit.setup.cjs +1 -1
- package/dist/src/config/vitest/vitest.unit.setup.js +1 -1
- package/dist/src/node/cli/cli.util.cjs +2 -2
- package/dist/src/node/cli/cli.util.js +21 -21
- package/dist/src/node/command/command.util.cjs +1 -1
- package/dist/src/node/command/command.util.js +1 -1
- package/dist/src/node/command/index.cjs +1 -1
- package/dist/src/node/command/index.js +1 -1
- package/dist/src/node/mongo/mongo.util.cjs +1 -1
- package/dist/src/node/mongo/mongo.util.js +1 -1
- package/dist/src/node/package/index.cjs +1 -1
- package/dist/src/node/package/index.js +1 -1
- package/dist/src/node/package/package.util.cjs +1 -1
- package/dist/src/node/package/package.util.js +1 -1
- package/dist/src/node/path/index.cjs +1 -1
- package/dist/src/node/path/index.js +20 -21
- package/dist/src/node/path/path.constant.cjs +1 -1
- package/dist/src/node/path/path.constant.d.ts +0 -1
- package/dist/src/node/path/path.constant.js +25 -26
- package/dist/src/node/upload/upload.util.cjs +1 -1
- package/dist/src/node/upload/upload.util.js +1 -1
- package/dist/src/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/src/react/apollo-client/apollo-client.util.js +29 -29
- package/dist/src/react/apollo-client/index.cjs +1 -1
- package/dist/src/react/apollo-client/index.d.ts +1 -0
- package/dist/src/react/apollo-client/index.js +17 -15
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +3 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.js +20 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +1 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +6 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js +6 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -0
- package/dist/src/react/apollo-client-nextjs/{apollo-client.util.d.ts → apollo-client-nextjs.util.d.ts} +1 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.js +24 -0
- package/dist/src/react/apollo-client-nextjs/index.cjs +1 -1
- package/dist/src/react/apollo-client-nextjs/index.d.ts +2 -2
- package/dist/src/react/apollo-client-nextjs/index.js +4 -4
- package/dist/src/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/src/react/apollo-error/apollo-error.component.js +15 -8
- package/dist/src/react/loading/loading.component.cjs +2 -2
- package/dist/src/react/loading/loading.component.js +36 -30
- package/package.json +7 -14
- package/dist/magic-string.es-CyLHbrL2.js +0 -871
- package/dist/magic-string.es-hjygV5wN.cjs +0 -10
- package/dist/src/react/apollo-client-nextjs/apollo-client.component.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client.component.d.ts +0 -3
- package/dist/src/react/apollo-client-nextjs/apollo-client.component.js +0 -32
- package/dist/src/react/apollo-client-nextjs/apollo-client.util.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client.util.js +0 -30
- package/dist/src/react/apollo-error/apollo-error.module.cjs +0 -1
- package/dist/src/react/apollo-error/apollo-error.module.js +0 -17
- package/dist/src/react/loading/loading.module.cjs +0 -1
- package/dist/src/react/loading/loading.module.js +0 -27
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var k = (t, e, n) => e in t ?
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var y = Object.getOwnPropertySymbols;
|
|
3
|
+
var T = Object.prototype.hasOwnProperty, G = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var k = (t, e, n) => e in t ? C(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, N = (t, e) => {
|
|
5
5
|
for (var n in e || (e = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var n of
|
|
6
|
+
T.call(e, n) && k(t, n, e[n]);
|
|
7
|
+
if (y)
|
|
8
|
+
for (var n of y(e))
|
|
9
9
|
G.call(e, n) && k(t, n, e[n]);
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var U = (t, e, n) => k(t, typeof e != "symbol" ? e + "" : e, n);
|
|
13
13
|
import { ApolloError as R, ApolloClient as I, InMemoryCache as P } from "@apollo/client/core/core.cjs";
|
|
14
|
-
import { ApolloLink as
|
|
14
|
+
import { ApolloLink as b, split as S, from as _ } from "@apollo/client/link/core/core.cjs";
|
|
15
15
|
import { onError as F } from "@apollo/client/link/error/error.cjs";
|
|
16
16
|
import { HttpLink as H } from "@apollo/client/link/http/http.cjs";
|
|
17
17
|
import { removeTypenameFromVariables as M } from "@apollo/client/link/remove-typename/remove-typename.cjs";
|
|
@@ -19,15 +19,14 @@ import { GraphQLWsLink as O } from "@apollo/client/link/subscriptions/subscripti
|
|
|
19
19
|
import { getMainDefinition as J } from "@apollo/client/utilities/utilities.cjs";
|
|
20
20
|
import { createClient as W } from "graphql-ws";
|
|
21
21
|
import $ from "react";
|
|
22
|
-
import "../apollo-error/apollo-error.context.js";
|
|
23
22
|
import { showGlobalApolloError as q } from "../apollo-error/apollo-error.util.js";
|
|
24
23
|
import { log as l } from "../log/log.util.js";
|
|
25
|
-
import { toast as
|
|
26
|
-
import { GRAPHQL_URI_DEFAULT as
|
|
27
|
-
class V extends
|
|
24
|
+
import { toast as x } from "react-hot-toast";
|
|
25
|
+
import { GRAPHQL_URI_DEFAULT as D } from "./apollo-client.constant.js";
|
|
26
|
+
class V extends b {
|
|
28
27
|
constructor() {
|
|
29
28
|
super(...arguments);
|
|
30
|
-
|
|
29
|
+
U(this, "count", 0);
|
|
31
30
|
}
|
|
32
31
|
request(n, a) {
|
|
33
32
|
const u = Date.now();
|
|
@@ -39,18 +38,18 @@ class V extends g {
|
|
|
39
38
|
}
|
|
40
39
|
function j(t) {
|
|
41
40
|
const { uri: e, wsUrl: n, customLinks: a } = t, u = new V(), p = F(({ graphQLErrors: o, networkError: i, protocolErrors: m, operation: r }) => {
|
|
42
|
-
var
|
|
43
|
-
const
|
|
41
|
+
var A, h;
|
|
42
|
+
const v = (r == null ? void 0 : r.operationName) || "Unknown";
|
|
44
43
|
if (o && o.forEach(({ message: s, locations: f, path: L }) => {
|
|
45
44
|
l.error(
|
|
46
|
-
`[GraphQL error] ${
|
|
45
|
+
`[GraphQL error] ${v}: ${s}, Location: ${JSON.stringify(f, null, 4)}, Path: ${L}`
|
|
47
46
|
);
|
|
48
47
|
}), m && m.forEach(({ message: s, extensions: f }) => {
|
|
49
48
|
l.error(
|
|
50
49
|
`[Protocol error]: ${s}, Extensions: ${JSON.stringify(f, null, 4)}`
|
|
51
50
|
);
|
|
52
51
|
}), i && l.error(`[Network error]: ${i}`), o || m || i) {
|
|
53
|
-
const s = ((
|
|
52
|
+
const s = ((A = o == null ? void 0 : o[0]) == null ? void 0 : A.message) || ((h = m == null ? void 0 : m[0]) == null ? void 0 : h.message) || (i == null ? void 0 : i.message) || "Unexpected error", f = new R({
|
|
54
53
|
graphQLErrors: o || [],
|
|
55
54
|
protocolErrors: m || [],
|
|
56
55
|
clientErrors: [],
|
|
@@ -60,33 +59,34 @@ function j(t) {
|
|
|
60
59
|
operation: r
|
|
61
60
|
}
|
|
62
61
|
});
|
|
63
|
-
|
|
62
|
+
x.error((L) => /* @__PURE__ */ $.createElement($.Fragment, null, s, " ", /* @__PURE__ */ $.createElement(
|
|
64
63
|
"button",
|
|
65
64
|
{
|
|
66
65
|
type: "button",
|
|
66
|
+
className: "text-blue-500 hover:text-blue-700",
|
|
67
67
|
onClick: () => {
|
|
68
68
|
setTimeout(() => {
|
|
69
69
|
q(f);
|
|
70
|
-
}, 0),
|
|
70
|
+
}, 0), x.dismiss(L.id);
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"Show Details"
|
|
74
74
|
)));
|
|
75
75
|
}
|
|
76
76
|
}), d = M();
|
|
77
|
-
e || l.warn(`[Apollo] No GraphQL URI provided — using "${
|
|
77
|
+
e || l.warn(`[Apollo] No GraphQL URI provided — using "${D}" as default`);
|
|
78
78
|
const c = new H({
|
|
79
|
-
uri: e != null ? e :
|
|
79
|
+
uri: e != null ? e : D,
|
|
80
80
|
credentials: "include"
|
|
81
|
-
}),
|
|
81
|
+
}), g = n ? new O(W({ url: n })) : b.empty(), w = g instanceof b ? S(
|
|
82
82
|
({ query: o }) => {
|
|
83
83
|
const i = J(o);
|
|
84
84
|
return i.kind === "OperationDefinition" && i.operation === "subscription";
|
|
85
85
|
},
|
|
86
|
-
|
|
86
|
+
g,
|
|
87
87
|
c
|
|
88
88
|
) : c;
|
|
89
|
-
return
|
|
89
|
+
return w === c && n && l.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."), [
|
|
90
90
|
u,
|
|
91
91
|
// 🪵 custom logger
|
|
92
92
|
p,
|
|
@@ -95,13 +95,13 @@ function j(t) {
|
|
|
95
95
|
// 🧼 cleans up __typename
|
|
96
96
|
...a != null ? a : [],
|
|
97
97
|
// 🔗 custom links
|
|
98
|
-
|
|
98
|
+
w
|
|
99
99
|
// 📡 HTTP vs WS routing
|
|
100
100
|
];
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function se(t = {}) {
|
|
103
103
|
const e = _(j(t));
|
|
104
|
-
return new I(
|
|
104
|
+
return new I(N({
|
|
105
105
|
link: e,
|
|
106
106
|
cache: new P()
|
|
107
107
|
}, t));
|
|
@@ -109,5 +109,5 @@ function le(t = {}) {
|
|
|
109
109
|
export {
|
|
110
110
|
V as DevLoggerLink,
|
|
111
111
|
j as createApolloLinks,
|
|
112
|
-
|
|
112
|
+
se as getClient
|
|
113
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./apollo-client.component.cjs"),o=require("./apollo-client.constant.cjs"),t=require("./apollo-client.context.cjs");require("react");const r=require("./apollo-client.util.cjs"),e=require("@apollo/client/react/hooks/hooks.cjs");exports.ApolloProvider=u.ApolloProvider;exports.GRAPHQL_URI_DEFAULT=o.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,"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});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./apollo-client.component.cjs"),o=require("./apollo-client.constant.cjs"),t=require("./apollo-client.context.cjs");require("react");const r=require("./apollo-client.util.cjs"),n=require("@apollo/client/cache/cache.cjs"),e=require("@apollo/client/react/hooks/hooks.cjs");exports.ApolloProvider=u.ApolloProvider;exports.GRAPHQL_URI_DEFAULT=o.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:()=>n.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});
|
|
@@ -4,4 +4,5 @@ export * from './apollo-client.context.js';
|
|
|
4
4
|
export * from './apollo-client.hook.js';
|
|
5
5
|
export * from './apollo-client.type.js';
|
|
6
6
|
export * from './apollo-client.util.js';
|
|
7
|
+
export { makeVar } from '@apollo/client/cache/cache.cjs';
|
|
7
8
|
export { useApolloClient, useBackgroundQuery, useFragment, useLazyQuery, useLoadableQuery, useMutation, useQuery, useQueryRefHandlers, useReactiveVar, useReadQuery, useSubscription, useSuspenseFragment, useSuspenseQuery } from '@apollo/client/react/hooks/hooks.cjs';
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { ApolloProvider as u } from "./apollo-client.component.js";
|
|
2
|
-
import { GRAPHQL_URI_DEFAULT as
|
|
2
|
+
import { GRAPHQL_URI_DEFAULT as s } from "./apollo-client.constant.js";
|
|
3
3
|
import { ApolloClientContext as n, ApolloClientProvider as p } from "./apollo-client.context.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { DevLoggerLink as
|
|
6
|
-
import {
|
|
5
|
+
import { DevLoggerLink as i, createApolloLinks as m, getClient as y } from "./apollo-client.util.js";
|
|
6
|
+
import { makeVar as f } from "@apollo/client/cache/cache.cjs";
|
|
7
|
+
import { useApolloClient as A, useBackgroundQuery as L, useFragment as d, useLazyQuery as g, useLoadableQuery as C, useMutation as R, useQuery as c, useQueryRefHandlers as k, useReactiveVar as v, useReadQuery as F, useSubscription as P, useSuspenseFragment as S, useSuspenseQuery as b } from "@apollo/client/react/hooks/hooks.cjs";
|
|
7
8
|
export {
|
|
8
9
|
n as ApolloClientContext,
|
|
9
10
|
p as ApolloClientProvider,
|
|
10
11
|
u as ApolloProvider,
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
i as DevLoggerLink,
|
|
13
|
+
s as GRAPHQL_URI_DEFAULT,
|
|
13
14
|
m as createApolloLinks,
|
|
14
15
|
y as getClient,
|
|
16
|
+
f as makeVar,
|
|
15
17
|
A as useApolloClient,
|
|
16
18
|
L as useBackgroundQuery,
|
|
17
19
|
d as useFragment,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
g as useLazyQuery,
|
|
21
|
+
C as useLoadableQuery,
|
|
22
|
+
R as useMutation,
|
|
23
|
+
c as useQuery,
|
|
24
|
+
k as useQueryRefHandlers,
|
|
25
|
+
v as useReactiveVar,
|
|
26
|
+
F as useReadQuery,
|
|
27
|
+
P as useSubscription,
|
|
28
|
+
S as useSuspenseFragment,
|
|
29
|
+
b as useSuspenseQuery
|
|
28
30
|
};
|
|
@@ -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-error/apollo-error.component.cjs");require("../apollo-error/apollo-error.context.cjs");const c=require("../apollo-error/apollo-error.provider.cjs"),i=require("react-hot-toast"),a=require("./apollo-client-nextjs.util.cjs");function p({options:r,children:o}){const t=e.useMemo(()=>()=>a.getClient(r||{}),[r]);return e.createElement(e.Fragment,null,e.createElement(c.ApolloErrorProvider,null,e.createElement(l.ApolloNextAppProvider,{makeClient:t},o),e.createElement(n.ApolloErrorComponent,null)),e.createElement(i.Toaster,{position:"top-right"}))}exports.ApolloProvider=p;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ApolloNextAppProvider as l } from "@apollo/client-integration-nextjs";
|
|
2
|
+
import e, { useMemo as m } from "react";
|
|
3
|
+
import { ApolloErrorComponent as n } from "../apollo-error/apollo-error.component.js";
|
|
4
|
+
import "../apollo-error/apollo-error.context.js";
|
|
5
|
+
import { ApolloErrorProvider as p } from "../apollo-error/apollo-error.provider.js";
|
|
6
|
+
import { Toaster as i } from "react-hot-toast";
|
|
7
|
+
import { getClient as a } from "./apollo-client-nextjs.util.js";
|
|
8
|
+
function s({
|
|
9
|
+
options: r,
|
|
10
|
+
children: o
|
|
11
|
+
}) {
|
|
12
|
+
const t = m(
|
|
13
|
+
() => () => a(r || {}),
|
|
14
|
+
[r]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement(l, { makeClient: t }, o), /* @__PURE__ */ e.createElement(n, null)), /* @__PURE__ */ e.createElement(i, { position: "top-right" }));
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
s as ApolloProvider
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@apollo/client-integration-nextjs"),l=require("./apollo-client-nextjs.util.cjs"),i=(e={})=>t.registerApolloClient(()=>l.getClient(e));exports.makeClient=i;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { I_ApolloOptions } from '../apollo-client/index.js';
|
|
2
|
+
export declare const makeClient: (options?: I_ApolloOptions) => {
|
|
3
|
+
getClient: () => import('@apollo/client-integration-nextjs').ApolloClient<unknown>;
|
|
4
|
+
query: <T = any, TVariables extends import('@apollo/client').OperationVariables = import('@apollo/client').OperationVariables>(options: import('@apollo/client').QueryOptions<TVariables, T>) => Promise<import('@apollo/client').ApolloQueryResult<import('@apollo/client').MaybeMasked<T>>>;
|
|
5
|
+
PreloadQuery: import('@apollo/client-integration-nextjs').PreloadQueryComponent;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var l=Object.getOwnPropertySymbols;var a=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;var o=(t,e,n)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,r=(t,e)=>{for(var n in e||(e={}))a.call(e,n)&&o(t,n,e[n]);if(l)for(var n of l(e))s.call(e,n)&&o(t,n,e[n]);return t};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@apollo/client-integration-nextjs"),u=require("@apollo/client/link/core/core.cjs"),C=require("../apollo-client/apollo-client.util.cjs");function g(t={}){const e=u.from(C.createApolloLinks(t));return new c.ApolloClient(r({link:e,cache:new c.InMemoryCache},t))}exports.getClient=g;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ApolloClient } from '@apollo/client-integration-nextjs';
|
|
2
2
|
import { I_ApolloOptions } from '../apollo-client/index.js';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function getClient(options?: I_ApolloOptions): ApolloClient<unknown>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var n = Object.getOwnPropertySymbols;
|
|
3
|
+
var l = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var t = (e, o, r) => o in e ? i(e, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[o] = r, m = (e, o) => {
|
|
5
|
+
for (var r in o || (o = {}))
|
|
6
|
+
l.call(o, r) && t(e, r, o[r]);
|
|
7
|
+
if (n)
|
|
8
|
+
for (var r of n(o))
|
|
9
|
+
c.call(o, r) && t(e, r, o[r]);
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
12
|
+
import { ApolloClient as f, InMemoryCache as p } from "@apollo/client-integration-nextjs";
|
|
13
|
+
import { from as a } from "@apollo/client/link/core/core.cjs";
|
|
14
|
+
import { createApolloLinks as C } from "../apollo-client/apollo-client.util.js";
|
|
15
|
+
function A(e = {}) {
|
|
16
|
+
const o = a(C(e));
|
|
17
|
+
return new f(m({
|
|
18
|
+
link: o,
|
|
19
|
+
cache: new p()
|
|
20
|
+
}, e));
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
A as getClient
|
|
24
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./apollo-client.component.cjs"),t=require("./apollo-client.util.cjs");exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./apollo-client-nextjs.component.cjs"),t=require("./apollo-client-nextjs.util.cjs");exports.ApolloProvider=e.ApolloProvider;exports.getClient=t.getClient;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './apollo-client.component.js';
|
|
2
|
-
export * from './apollo-client.util.js';
|
|
1
|
+
export * from './apollo-client-nextjs.component.js';
|
|
2
|
+
export * from './apollo-client-nextjs.util.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ApolloProvider as e } from "./apollo-client-nextjs.component.js";
|
|
2
|
+
import { getClient as l } from "./apollo-client-nextjs.util.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
e as ApolloProvider,
|
|
5
|
+
l as getClient
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),s=require("./apollo-error.context.cjs"),t=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),s=require("./apollo-error.context.cjs"),t={"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"};function m(){const o=e.use(s.ApolloErrorContext),r=o==null?void 0:o.error;if(!r)return null;const n=(c,l)=>l!=null&&l.length?e.createElement("div",null,e.createElement("strong",null,c,":"),e.createElement("ul",null,l.map(a=>e.createElement("li",{key:a.message},a.message)))):null;return e.createElement("div",{className:t["modal-backdrop"]},e.createElement("div",{className:t["modal-content"]},e.createElement("button",{type:"button",className:t["btn-close"],onClick:o.hideError},"✕"),e.createElement("div",{className:t["error-title"]},e.createElement("button",{type:"button",className:t["btn-retry"],onClick:()=>window.location.reload()},"Reload")," ",r.message),e.createElement("div",{className:t["error-details"]},r.networkError&&e.createElement("pre",{className:"network"},e.createElement("strong",null,"Network Error:")," ",r.networkError.message),n("GraphQL Errors",[...r.graphQLErrors]),n("Protocol Errors",[...r.protocolErrors]),n("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,11 +1,18 @@
|
|
|
1
|
-
import e, { use as
|
|
2
|
-
import { ApolloErrorContext as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import e, { use as s } from "react";
|
|
2
|
+
import { ApolloErrorContext as m } from "./apollo-error.context.js";
|
|
3
|
+
const t = {
|
|
4
|
+
"modal-backdrop": "_modal-backdrop_8fveh_1",
|
|
5
|
+
"modal-content": "_modal-content_8fveh_11",
|
|
6
|
+
"btn-close": "_btn-close_8fveh_22",
|
|
7
|
+
"error-title": "_error-title_8fveh_36",
|
|
8
|
+
"btn-retry": "_btn-retry_8fveh_41",
|
|
9
|
+
"error-details": "_error-details_8fveh_54"
|
|
10
|
+
};
|
|
11
|
+
function i() {
|
|
12
|
+
const o = s(m), r = o == null ? void 0 : o.error;
|
|
6
13
|
if (!r)
|
|
7
14
|
return null;
|
|
8
|
-
const
|
|
15
|
+
const n = (c, l) => l != null && l.length ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", null, c, ":"), /* @__PURE__ */ e.createElement("ul", null, l.map((a) => /* @__PURE__ */ e.createElement("li", { key: a.message }, a.message)))) : null;
|
|
9
16
|
return /* @__PURE__ */ e.createElement("div", { className: t["modal-backdrop"] }, /* @__PURE__ */ e.createElement("div", { className: t["modal-content"] }, /* @__PURE__ */ e.createElement(
|
|
10
17
|
"button",
|
|
11
18
|
{
|
|
@@ -22,8 +29,8 @@ function p() {
|
|
|
22
29
|
onClick: () => window.location.reload()
|
|
23
30
|
},
|
|
24
31
|
"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),
|
|
32
|
+
), " ", 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), n("GraphQL Errors", [...r.graphQLErrors]), n("Protocol Errors", [...r.protocolErrors]), n("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
33
|
}
|
|
27
34
|
export {
|
|
28
|
-
|
|
35
|
+
i as ApolloErrorComponent
|
|
29
36
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var y=Object.defineProperty;var o=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var d=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var n in t||(t={}))m.call(t,n)&&d(e,n,t[n]);if(o)for(var n of o(t))u.call(t,n)&&d(e,n,t[n]);return e};var g=(e,t)=>{var n={};for(var c in e)m.call(e,c)&&t.indexOf(c)<0&&(n[c]=e[c]);if(e!=null&&o)for(var c of o(e))t.indexOf(c)<0&&u.call(e,c)&&(n[c]=e[c]);return n};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("clsx"),r=require("react"),k="_fullscreen_1ank4_1",L="_block_1ank4_2",b="_container_1ank4_35",N="_ring_1ank4_45",h="_message_1ank4_69",s={fullscreen:k,block:L,container:b,ring:N,message:h};function p(){if(document.getElementById("noscroll-style"))return;const e=document.createElement("style");e.id="noscroll-style",e.innerHTML=`
|
|
2
2
|
.noscroll {
|
|
3
3
|
overflow: hidden !important;
|
|
4
4
|
height: 100vh !important;
|
|
5
5
|
}
|
|
6
|
-
`,document.head.appendChild(e)}function
|
|
6
|
+
`,document.head.appendChild(e)}function x(S){var a=S,{full:e=!1,block:t=!1,className:n="",message:c="Loading"}=a,_=g(a,["full","block","className","message"]);r.useEffect(()=>{if(e){document.body.classList.add("noscroll");const i=E=>E.preventDefault();return document.addEventListener("contextmenu",i),()=>{document.body.classList.remove("noscroll"),document.removeEventListener("contextmenu",i)}}},[e]),r.useEffect(()=>{p()},[]);function l(){return r.createElement("div",f({className:s.container},_),r.createElement("div",{className:s.ring}),r.createElement("div",{className:s.ring}),r.createElement("div",{className:s.ring}),r.createElement("div",{className:s.ring}),c&&r.createElement("div",{className:s.message},c))}return e?r.createElement("div",{className:v(s.fullscreen,n)},l()):t?r.createElement("div",{className:v(s.block,n)},l()):l()}exports.Loading=x;
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var s = Object.getOwnPropertySymbols;
|
|
3
3
|
var d = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var m = (e,
|
|
5
|
-
for (var
|
|
6
|
-
d.call(
|
|
7
|
-
if (
|
|
8
|
-
for (var
|
|
9
|
-
u.call(
|
|
4
|
+
var m = (e, t, n) => t in e ? y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t) => {
|
|
5
|
+
for (var n in t || (t = {}))
|
|
6
|
+
d.call(t, n) && m(e, n, t[n]);
|
|
7
|
+
if (s)
|
|
8
|
+
for (var n of s(t))
|
|
9
|
+
u.call(t, n) && m(e, n, t[n]);
|
|
10
10
|
return e;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
for (var
|
|
15
|
-
d.call(e,
|
|
16
|
-
if (e != null &&
|
|
17
|
-
for (var
|
|
18
|
-
|
|
19
|
-
return
|
|
12
|
+
var _ = (e, t) => {
|
|
13
|
+
var n = {};
|
|
14
|
+
for (var c in e)
|
|
15
|
+
d.call(e, c) && t.indexOf(c) < 0 && (n[c] = e[c]);
|
|
16
|
+
if (e != null && s)
|
|
17
|
+
for (var c of s(e))
|
|
18
|
+
t.indexOf(c) < 0 && u.call(e, c) && (n[c] = e[c]);
|
|
19
|
+
return n;
|
|
20
20
|
};
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
import g from "clsx";
|
|
22
|
+
import r, { useEffect as v } from "react";
|
|
23
|
+
const p = "_fullscreen_1ank4_1", L = "_block_1ank4_2", N = "_container_1ank4_35", h = "_ring_1ank4_45", b = "_message_1ank4_69", o = {
|
|
24
|
+
fullscreen: p,
|
|
25
|
+
block: L,
|
|
26
|
+
container: N,
|
|
27
|
+
ring: h,
|
|
28
|
+
message: b
|
|
29
|
+
};
|
|
30
|
+
function x() {
|
|
25
31
|
if (document.getElementById("noscroll-style"))
|
|
26
32
|
return;
|
|
27
33
|
const e = document.createElement("style");
|
|
@@ -32,24 +38,24 @@ function N() {
|
|
|
32
38
|
}
|
|
33
39
|
`, document.head.appendChild(e);
|
|
34
40
|
}
|
|
35
|
-
function
|
|
36
|
-
var
|
|
37
|
-
|
|
41
|
+
function w(C) {
|
|
42
|
+
var a = C, { full: e = !1, block: t = !1, className: n = "", message: c = "Loading" } = a, E = _(a, ["full", "block", "className", "message"]);
|
|
43
|
+
v(() => {
|
|
38
44
|
if (e) {
|
|
39
45
|
document.body.classList.add("noscroll");
|
|
40
|
-
const i = (
|
|
46
|
+
const i = (k) => k.preventDefault();
|
|
41
47
|
return document.addEventListener("contextmenu", i), () => {
|
|
42
48
|
document.body.classList.remove("noscroll"), document.removeEventListener("contextmenu", i);
|
|
43
49
|
};
|
|
44
50
|
}
|
|
45
|
-
}, [e]),
|
|
46
|
-
|
|
51
|
+
}, [e]), v(() => {
|
|
52
|
+
x();
|
|
47
53
|
}, []);
|
|
48
|
-
function
|
|
49
|
-
return /* @__PURE__ */
|
|
54
|
+
function l() {
|
|
55
|
+
return /* @__PURE__ */ r.createElement("div", f({ className: o.container }, E), /* @__PURE__ */ r.createElement("div", { className: o.ring }), /* @__PURE__ */ r.createElement("div", { className: o.ring }), /* @__PURE__ */ r.createElement("div", { className: o.ring }), /* @__PURE__ */ r.createElement("div", { className: o.ring }), c && /* @__PURE__ */ r.createElement("div", { className: o.message }, c));
|
|
50
56
|
}
|
|
51
|
-
return e ? /* @__PURE__ */
|
|
57
|
+
return e ? /* @__PURE__ */ r.createElement("div", { className: g(o.fullscreen, n) }, l()) : t ? /* @__PURE__ */ r.createElement("div", { className: g(o.block, n) }, l()) : l();
|
|
52
58
|
}
|
|
53
59
|
export {
|
|
54
|
-
|
|
60
|
+
w as Loading
|
|
55
61
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberskill/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.201.1",
|
|
5
5
|
"description": "CyberSkill Shared",
|
|
6
6
|
"author": "Stephen Cheng",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
"url": "https://github.com/cyberskill-world/shared/issues"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
|
-
"./favicon": {
|
|
18
|
-
"import": "./dist/favicon/favicon.ico",
|
|
19
|
-
"require": "./dist/favicon/favicon.ico"
|
|
20
|
-
},
|
|
21
17
|
"./config": {
|
|
22
18
|
"types": "./dist/src/config/index.d.ts",
|
|
23
19
|
"import": "./dist/src/config/index.js",
|
|
@@ -128,6 +124,11 @@
|
|
|
128
124
|
"import": "./dist/src/react/apollo-client-nextjs/index.js",
|
|
129
125
|
"require": "./dist/src/react/apollo-client-nextjs/index.cjs"
|
|
130
126
|
},
|
|
127
|
+
"./react/apollo-client-nextjs/rsc": {
|
|
128
|
+
"types": "./dist/src/react/apollo-client-nextjs/apollo-client-nextjs-rsc.d.ts",
|
|
129
|
+
"import": "./dist/src/react/apollo-client-nextjs/apollo-client-nextjs-rsc.js",
|
|
130
|
+
"require": "./dist/src/react/apollo-client-nextjs/apollo-client-nextjs-rsc.cjs"
|
|
131
|
+
},
|
|
131
132
|
"./react/apollo-error": {
|
|
132
133
|
"types": "./dist/src/react/apollo-error/index.d.ts",
|
|
133
134
|
"import": "./dist/src/react/apollo-error/index.js",
|
|
@@ -181,11 +182,6 @@
|
|
|
181
182
|
"./style.css": {
|
|
182
183
|
"import": "./dist/style.css",
|
|
183
184
|
"require": "./dist/style.css"
|
|
184
|
-
},
|
|
185
|
-
"./tsconfig.base.json": {
|
|
186
|
-
"types": "./dist/tsconfig.base.json",
|
|
187
|
-
"import": "./dist/tsconfig.base.json",
|
|
188
|
-
"require": "./dist/tsconfig.base.json"
|
|
189
185
|
}
|
|
190
186
|
},
|
|
191
187
|
"bin": {
|
|
@@ -238,7 +234,7 @@
|
|
|
238
234
|
"globals": "16.2.0",
|
|
239
235
|
"graphql": "16.11.0",
|
|
240
236
|
"graphql-ws": "6.0.5",
|
|
241
|
-
"i18next": "25.
|
|
237
|
+
"i18next": "25.3.0",
|
|
242
238
|
"jsdom": "26.1.0",
|
|
243
239
|
"localforage": "1.10.0",
|
|
244
240
|
"migrate-mongo": "12.1.3",
|
|
@@ -297,9 +293,6 @@
|
|
|
297
293
|
"glob": "11.0.3",
|
|
298
294
|
"lint-staged": "16.1.2",
|
|
299
295
|
"node-modules-inspector": "1.0.0",
|
|
300
|
-
"playwright": "1.53.1",
|
|
301
|
-
"postcss": "8.5.6",
|
|
302
|
-
"postcss-modules": "6.0.1",
|
|
303
296
|
"sass": "1.89.2",
|
|
304
297
|
"simple-git-hooks": "2.13.0",
|
|
305
298
|
"tsx": "4.20.3",
|