@cyberskill/shared 2.15.0 → 2.17.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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"error-container":"_error-container_oofeh_1","error-details-button":"_error-details-button_oofeh_8"};exports.default=e;
@@ -0,0 +1,7 @@
1
+ const r = {
2
+ "error-container": "_error-container_oofeh_1",
3
+ "error-details-button": "_error-details-button_oofeh_8"
4
+ };
5
+ export {
6
+ r as default
7
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@apollo/client/core"),p=require("@apollo/client/link"),w=require("@apollo/client/link/error"),h=require("@apollo/client/link/remove-typename"),y=require("@apollo/client/link/subscriptions"),_=require("apollo-upload-client/createUploadLink.mjs"),q=require("graphql"),b=require("graphql-ws"),c=require("react"),v=require("rxjs"),m=require("./apollo-client.constant.cjs"),E=require("../apollo-error/apollo-error.util.cjs"),l=require("../log/log.util.cjs"),f=require("react-hot-toast");var P=Object.defineProperty,g=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,L=(e,r,o)=>r in e?P(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,T=(e,r)=>{for(var o in r||(r={}))A.call(r,o)&&L(e,o,r[o]);if(g)for(var o of g(r))O.call(r,o)&&L(e,o,r[o]);return e};const C=new p.ApolloLink((e,r)=>(e.setContext({start:new Date}),r(e).pipe(v.tap(()=>{const o=new Date().getTime()-e.getContext().start;l.log.info(`Operation ${e.operationName} took ${o}ms to complete`)})))),S=new w.ErrorLink(({error:e,operation:r})=>{const o=(r==null?void 0:r.operationName)||"Unknown";let t="";a.CombinedGraphQLErrors.is(e)?e.errors.forEach(({message:n,locations:i,path:s},u)=>{u===0&&(t=n),l.log.error(`[GraphQL error] ${o}: ${n}, Location: ${JSON.stringify(i,null,4)}, Path: ${s}`)}):a.CombinedProtocolErrors.is(e)?e.errors.forEach(({message:n,extensions:i},s)=>{s===0&&(t=n),l.log.error(`[Protocol error]: ${n}, Extensions: ${JSON.stringify(i,null,4)}`)}):a.ServerError.is(e)?(t=e.message,l.log.error(`[Server error]: ${e.message}`)):(t=e.message,l.log.error(`[Network error]: ${e.message}`)),e&&t&&typeof window!="undefined"&&f.toast.error(n=>c.createElement(c.Fragment,null,t," ",c.createElement("button",{type:"button",className:"text-blue-500 hover:text-blue-700",onClick:()=>{setTimeout(()=>{E.showGlobalApolloError(e)},0),f.toast.dismiss(n.id)}},"Show Details")))});function k(e){const{uri:r,wsUrl:o,customLinks:t}=e,n=new h.RemoveTypenameFromVariablesLink;r||l.log.warn(`[Apollo] No GraphQL URI provided — using "${m.GRAPHQL_URI_DEFAULT}" as default`);const i=_({uri:r!=null?r:m.GRAPHQL_URI_DEFAULT,credentials:"include",headers:{"apollo-require-preflight":"true"}}),s=o?new y.GraphQLWsLink(b.createClient({url:o})):p.ApolloLink.empty(),u=o?p.ApolloLink.split(({operationType:d})=>d===q.OperationTypeNode.SUBSCRIPTION,s,i):i;return o&&u===i&&l.log.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[C,S,n,...t!=null?t:[],u]}function $(e){const r=p.ApolloLink.from(k(e));return new a.ApolloClient(T({link:r,cache:new a.InMemoryCache},e))}exports.createApolloLinks=k;exports.getClient=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@apollo/client/core"),p=require("@apollo/client/link"),_=require("@apollo/client/link/error"),y=require("@apollo/client/link/remove-typename"),q=require("@apollo/client/link/subscriptions"),h=require("graphql"),v=require("graphql-ws"),c=require("react"),E=require("rxjs"),m=require("./apollo-client.constant.cjs"),f=require("./apollo-client.module.scss.cjs"),b=require("./links/upload.cjs"),P=require("../apollo-error/apollo-error.util.cjs"),l=require("../log/log.util.cjs"),d=require("react-hot-toast");var A=Object.defineProperty,L=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,g=(e,r,o)=>r in e?A(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o,T=(e,r)=>{for(var o in r||(r={}))C.call(r,o)&&g(e,o,r[o]);if(L)for(var o of L(r))O.call(r,o)&&g(e,o,r[o]);return e};const N=new p.ApolloLink((e,r)=>(e.setContext({start:new Date}),r(e).pipe(E.tap(()=>{const o=new Date().getTime()-e.getContext().start;l.log.info(`Operation ${e.operationName} took ${o}ms to complete`)})))),$=new _.ErrorLink(({error:e,operation:r})=>{const o=(r==null?void 0:r.operationName)||"Unknown";let t="";a.CombinedGraphQLErrors.is(e)?e.errors.forEach(({message:n,locations:i,path:s},u)=>{u===0&&(t=n),l.log.error(`[GraphQL error] ${o}: ${n}, Location: ${JSON.stringify(i,null,4)}, Path: ${s}`)}):a.CombinedProtocolErrors.is(e)?e.errors.forEach(({message:n,extensions:i},s)=>{s===0&&(t=n),l.log.error(`[Protocol error]: ${n}, Extensions: ${JSON.stringify(i,null,4)}`)}):a.ServerError.is(e)?(t=e.message,l.log.error(`[Server error]: ${e.message}`)):(t=e.message,l.log.error(`[Network error]: ${e.message}`)),e&&t&&typeof window!="undefined"&&d.toast.error(n=>c.createElement("div",{className:f.default["error-container"]},t,c.createElement("button",{type:"button",className:f.default["error-details-button"],onClick:()=>{setTimeout(()=>{P.showGlobalApolloError(e)},0),d.toast.dismiss(n.id)}},"Error Details")))});function k(e){const{uri:r,wsUrl:o,customLinks:t}=e,n=new y.RemoveTypenameFromVariablesLink;r||l.log.warn(`[Apollo] No GraphQL URI provided — using "${m.GRAPHQL_URI_DEFAULT}" as default`);const i=b.createUploadLink({uri:r!=null?r:m.GRAPHQL_URI_DEFAULT,credentials:"include",headers:{"apollo-require-preflight":"true"}}),s=o?new q.GraphQLWsLink(v.createClient({url:o})):p.ApolloLink.empty(),u=o?p.ApolloLink.split(({operationType:w})=>w===h.OperationTypeNode.SUBSCRIPTION,s,i):i;return o&&u===i&&l.log.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[N,$,n,...t!=null?t:[],u]}function S(e){const r=p.ApolloLink.from(k(e));return new a.ApolloClient(T({link:r,cache:new a.InMemoryCache},e))}exports.createApolloLinks=k;exports.getClient=S;
@@ -1,85 +1,86 @@
1
- import { ApolloClient as L, InMemoryCache as k, CombinedGraphQLErrors as h, CombinedProtocolErrors as g, ServerError as y } from "@apollo/client/core";
1
+ import { ApolloClient as k, InMemoryCache as y, CombinedGraphQLErrors as g, CombinedProtocolErrors as h, ServerError as v } from "@apollo/client/core";
2
2
  import { ApolloLink as m } from "@apollo/client/link";
3
- import { ErrorLink as v } from "@apollo/client/link/error";
3
+ import { ErrorLink as E } from "@apollo/client/link/error";
4
4
  import { RemoveTypenameFromVariablesLink as _ } from "@apollo/client/link/remove-typename";
5
- import { GraphQLWsLink as b } from "@apollo/client/link/subscriptions";
6
- import E from "apollo-upload-client/createUploadLink.mjs";
7
- import { OperationTypeNode as O } from "graphql";
8
- import { createClient as P } from "graphql-ws";
5
+ import { GraphQLWsLink as O } from "@apollo/client/link/subscriptions";
6
+ import { OperationTypeNode as P } from "graphql";
7
+ import { createClient as b } from "graphql-ws";
9
8
  import p from "react";
10
- import { tap as C } from "rxjs";
9
+ import { tap as N } from "rxjs";
11
10
  import { GRAPHQL_URI_DEFAULT as f } from "./apollo-client.constant.js";
12
- import { showGlobalApolloError as N } from "../apollo-error/apollo-error.util.js";
13
- import { log as l } from "../log/log.util.js";
14
- import { toast as c } from "react-hot-toast";
15
- var $ = Object.defineProperty, u = Object.getOwnPropertySymbols, S = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable, w = (r, e, o) => e in r ? $(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o, A = (r, e) => {
11
+ import c from "./apollo-client.module.scss.js";
12
+ import { createUploadLink as C } from "./links/upload.js";
13
+ import { showGlobalApolloError as $ } from "../apollo-error/apollo-error.util.js";
14
+ import { log as s } from "../log/log.util.js";
15
+ import { toast as u } from "react-hot-toast";
16
+ var T = Object.defineProperty, d = Object.getOwnPropertySymbols, S = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable, w = (r, e, o) => e in r ? T(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o, U = (r, e) => {
16
17
  for (var o in e || (e = {}))
17
18
  S.call(e, o) && w(r, o, e[o]);
18
- if (u)
19
- for (var o of u(e))
20
- T.call(e, o) && w(r, o, e[o]);
19
+ if (d)
20
+ for (var o of d(e))
21
+ A.call(e, o) && w(r, o, e[o]);
21
22
  return r;
22
23
  };
23
- const U = new m((r, e) => (r.setContext({ start: /* @__PURE__ */ new Date() }), e(r).pipe(
24
- C(() => {
24
+ const I = new m((r, e) => (r.setContext({ start: /* @__PURE__ */ new Date() }), e(r).pipe(
25
+ N(() => {
25
26
  const o = (/* @__PURE__ */ new Date()).getTime() - r.getContext().start;
26
- l.info(`Operation ${r.operationName} took ${o}ms to complete`);
27
+ s.info(`Operation ${r.operationName} took ${o}ms to complete`);
27
28
  })
28
- ))), I = new v(({ error: r, operation: e }) => {
29
+ ))), R = new E(({ error: r, operation: e }) => {
29
30
  const o = (e == null ? void 0 : e.operationName) || "Unknown";
30
31
  let t = "";
31
- h.is(r) ? r.errors.forEach(({ message: n, locations: i, path: s }, a) => {
32
- a === 0 && (t = n), l.error(
33
- `[GraphQL error] ${o}: ${n}, Location: ${JSON.stringify(i, null, 4)}, Path: ${s}`
32
+ g.is(r) ? r.errors.forEach(({ message: n, locations: i, path: l }, a) => {
33
+ a === 0 && (t = n), s.error(
34
+ `[GraphQL error] ${o}: ${n}, Location: ${JSON.stringify(i, null, 4)}, Path: ${l}`
34
35
  );
35
- }) : g.is(r) ? r.errors.forEach(({ message: n, extensions: i }, s) => {
36
- s === 0 && (t = n), l.error(
36
+ }) : h.is(r) ? r.errors.forEach(({ message: n, extensions: i }, l) => {
37
+ l === 0 && (t = n), s.error(
37
38
  `[Protocol error]: ${n}, Extensions: ${JSON.stringify(i, null, 4)}`
38
39
  );
39
- }) : y.is(r) ? (t = r.message, l.error(`[Server error]: ${r.message}`)) : (t = r.message, l.error(`[Network error]: ${r.message}`)), r && t && typeof window != "undefined" && c.error((n) => /* @__PURE__ */ p.createElement(p.Fragment, null, t, " ", /* @__PURE__ */ p.createElement(
40
+ }) : v.is(r) ? (t = r.message, s.error(`[Server error]: ${r.message}`)) : (t = r.message, s.error(`[Network error]: ${r.message}`)), r && t && typeof window != "undefined" && u.error((n) => /* @__PURE__ */ p.createElement("div", { className: c["error-container"] }, t, /* @__PURE__ */ p.createElement(
40
41
  "button",
41
42
  {
42
43
  type: "button",
43
- className: "text-blue-500 hover:text-blue-700",
44
+ className: c["error-details-button"],
44
45
  onClick: () => {
45
46
  setTimeout(() => {
46
- N(r);
47
- }, 0), c.dismiss(n.id);
47
+ $(r);
48
+ }, 0), u.dismiss(n.id);
48
49
  }
49
50
  },
50
- "Show Details"
51
+ "Error Details"
51
52
  )));
52
53
  });
53
- function R(r) {
54
+ function G(r) {
54
55
  const { uri: e, wsUrl: o, customLinks: t } = r, n = new _();
55
- e || l.warn(`[Apollo] No GraphQL URI provided — using "${f}" as default`);
56
- const i = E({
56
+ e || s.warn(`[Apollo] No GraphQL URI provided — using "${f}" as default`);
57
+ const i = C({
57
58
  uri: e != null ? e : f,
58
59
  credentials: "include",
59
60
  headers: {
60
61
  "apollo-require-preflight": "true"
61
62
  }
62
- }), s = o ? new b(P({ url: o })) : m.empty(), a = o ? m.split(
63
- ({ operationType: d }) => d === O.SUBSCRIPTION,
64
- s,
63
+ }), l = o ? new O(b({ url: o })) : m.empty(), a = o ? m.split(
64
+ ({ operationType: L }) => L === P.SUBSCRIPTION,
65
+ l,
65
66
  i
66
67
  ) : i;
67
- return o && a === i && l.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."), [
68
- U,
68
+ return o && a === i && s.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."), [
69
69
  I,
70
+ R,
70
71
  n,
71
72
  ...t != null ? t : [],
72
73
  a
73
74
  ];
74
75
  }
75
- function K(r) {
76
- const e = m.from(R(r));
77
- return new L(A({
76
+ function Y(r) {
77
+ const e = m.from(G(r));
78
+ return new k(U({
78
79
  link: e,
79
- cache: new k()
80
+ cache: new y()
80
81
  }, r));
81
82
  }
82
83
  export {
83
- R as createApolloLinks,
84
- K as getClient
84
+ G as createApolloLinks,
85
+ Y as getClient
85
86
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./apollo-client.component.cjs"),n=require("./apollo-client.constant.cjs"),r=require("./apollo-client.context.cjs"),t=require("./apollo-client.util.cjs"),o=require("@apollo/client/cache"),e=require("@apollo/client/react");exports.ApolloProvider=u.ApolloProvider;exports.GRAPHQL_URI_DEFAULT=n.GRAPHQL_URI_DEFAULT;exports.ApolloClientContext=r.ApolloClientContext;exports.ApolloClientProvider=r.ApolloClientProvider;exports.createApolloLinks=t.createApolloLinks;exports.getClient=t.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});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./apollo-client.component.cjs"),n=require("./apollo-client.constant.cjs"),r=require("./apollo-client.context.cjs"),t=require("./apollo-client.util.cjs"),o=require("@apollo/client/cache"),e=require("@apollo/client/react"),l=require("./links/upload.cjs");exports.ApolloProvider=u.ApolloProvider;exports.GRAPHQL_URI_DEFAULT=n.GRAPHQL_URI_DEFAULT;exports.ApolloClientContext=r.ApolloClientContext;exports.ApolloClientProvider=r.ApolloClientProvider;exports.createApolloLinks=t.createApolloLinks;exports.getClient=t.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});exports.createUploadLink=l.createUploadLink;
@@ -4,5 +4,6 @@ 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 * from './links/index.js';
7
8
  export { makeVar } from '@apollo/client/cache';
8
9
  export { useApolloClient, useBackgroundQuery, useFragment, useLazyQuery, useLoadableQuery, useMutation, useQuery, useQueryRefHandlers, useReactiveVar, useReadQuery, useSubscription, useSuspenseFragment, useSuspenseQuery } from '@apollo/client/react';
@@ -1,25 +1,27 @@
1
1
  import { ApolloProvider as o } from "./apollo-client.component.js";
2
- import { GRAPHQL_URI_DEFAULT as s } from "./apollo-client.constant.js";
2
+ import { GRAPHQL_URI_DEFAULT as t } from "./apollo-client.constant.js";
3
3
  import { ApolloClientContext as l, ApolloClientProvider as a } from "./apollo-client.context.js";
4
- import { createApolloLinks as p, getClient as i } from "./apollo-client.util.js";
5
- import { makeVar as y } from "@apollo/client/cache";
6
- import { useApolloClient as f, useBackgroundQuery as x, useFragment as A, useLazyQuery as d, useLoadableQuery as C, useMutation as L, useQuery as R, useQueryRefHandlers as c, useReactiveVar as g, useReadQuery as k, useSubscription as v, useSuspenseFragment as F, useSuspenseQuery as P } from "@apollo/client/react";
4
+ import { createApolloLinks as n, getClient as i } from "./apollo-client.util.js";
5
+ import { makeVar as f } from "@apollo/client/cache";
6
+ import { useApolloClient as y, useBackgroundQuery as Q, useFragment as d, useLazyQuery as A, useLoadableQuery as L, useMutation as c, useQuery as C, useQueryRefHandlers as R, useReactiveVar as g, useReadQuery as k, useSubscription as v, useSuspenseFragment as F, useSuspenseQuery as P } from "@apollo/client/react";
7
+ import { createUploadLink as U } from "./links/upload.js";
7
8
  export {
8
9
  l as ApolloClientContext,
9
10
  a as ApolloClientProvider,
10
11
  o as ApolloProvider,
11
- s as GRAPHQL_URI_DEFAULT,
12
- p as createApolloLinks,
12
+ t as GRAPHQL_URI_DEFAULT,
13
+ n as createApolloLinks,
14
+ U as createUploadLink,
13
15
  i as getClient,
14
- y as makeVar,
15
- f as useApolloClient,
16
- x as useBackgroundQuery,
17
- A as useFragment,
18
- d as useLazyQuery,
19
- C as useLoadableQuery,
20
- L as useMutation,
21
- R as useQuery,
22
- c as useQueryRefHandlers,
16
+ f as makeVar,
17
+ y as useApolloClient,
18
+ Q as useBackgroundQuery,
19
+ d as useFragment,
20
+ A as useLazyQuery,
21
+ L as useLoadableQuery,
22
+ c as useMutation,
23
+ C as useQuery,
24
+ R as useQueryRefHandlers,
23
25
  g as useReactiveVar,
24
26
  k as useReadQuery,
25
27
  v as useSubscription,
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./upload.cjs");exports.createUploadLink=e.createUploadLink;
@@ -0,0 +1 @@
1
+ export * from './upload.js';
@@ -0,0 +1,4 @@
1
+ import { createUploadLink as r } from "./upload.js";
2
+ export {
3
+ r as createUploadLink
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("@apollo/client/link"),c=require("@apollo/client/link/http"),w=require("@apollo/client/utilities"),T=require("extract-files/extractFiles.mjs"),j=require("extract-files/isExtractableFile.mjs");var G=Object.defineProperty,_=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,E=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,h=(n,e)=>{for(var t in e||(e={}))H.call(e,t)&&E(n,t,e[t]);if(_)for(var t of _(e))J.call(e,t)&&E(n,t,e[t]);return n};function N(){if(typeof AbortController=="undefined")return{controller:!1,signal:!1};const n=new AbortController,e=n.signal;return{controller:n,signal:e}}function z(n,e,t){"name"in t?n.append(e,t,t.name):n.append(e,t)}function B({uri:n="/graphql",useGETForQueries:e,isExtractableFile:t=j,FormData:v,formDataAppendFile:F=z,print:S=c.defaultPrinter,fetch:q,fetchOptions:x,credentials:P,headers:A,includeExtensions:C}={}){const I={http:{includeExtensions:C},options:x,credentials:P,headers:A};return new L.ApolloLink(l=>{const p=l.getContext(),{clientAwareness:{name:g,version:m}={},headers:k}=p,U={http:p.http,options:p.fetchOptions,credentials:p.credentials,headers:h(h(h({},g&&{"apollographql-client-name":g}),m&&{"apollographql-client-version":m}),k)},{options:o,body:b}=c.selectHttpOptionsAndBodyInternal(l,S,c.fallbackHttpConfig,I,U),{clone:y,files:f}=T(b,t,"");let u=c.selectURI(l,n);if(f.size){o.headers&&delete o.headers["content-type"];const a=v||FormData,i=new a;i.append("operations",JSON.stringify(y));const r={};let d=0;f.forEach(O=>{r[++d]=O}),i.append("map",JSON.stringify(r)),d=0,f.forEach((O,R)=>{F(i,String(++d),R)}),o.body=i}else if(e&&!l.query.definitions.some(a=>a.kind==="OperationDefinition"&&a.operation==="mutation")&&(o.method="GET"),o.method==="GET"){const{newURI:a,parseError:i}=c.rewriteURIForGET(u,b);if(i)return new w.Observable(r=>{r.error(i)});u=a}else o.body=JSON.stringify(y);const{controller:s}=N();typeof s!="boolean"&&(o.signal&&(o.signal.aborted?s.abort():o.signal.addEventListener("abort",()=>{s.abort()},{once:!0})),o.signal=s.signal);const D=q||fetch;return new w.Observable(a=>{let i;return D(u,o).then(r=>(l.setContext({response:r}),r)).then(c.parseAndCheckHttpResponse(l)).then(r=>{a.next(r),a.complete()}).catch(r=>{i||(r.result&&r.result.errors&&r.result.data&&a.next(r.result),a.error(r))}),()=>{i=!0,typeof s!="boolean"&&s.abort()}})})}exports.createUploadLink=B;
@@ -0,0 +1,76 @@
1
+ import { BaseHttpLink } from '@apollo/client/link/http';
2
+ import { ExtractableFile } from 'extract-files/isExtractableFile.mjs';
3
+ import { ApolloLink } from '@apollo/client/link';
4
+ /**
5
+ * Creates a
6
+ * [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link)
7
+ * for [Apollo Client](https://www.apollographql.com/docs/react) that fetches a
8
+ * [GraphQL multipart request](https://github.com/jaydenseric/graphql-multipart-request-spec)
9
+ * if the GraphQL variables contain files (by default
10
+ * [`FileList`](https://developer.mozilla.org/en-US/docs/Web/API/FileList),
11
+ * [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File), or
12
+ * [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) instances),
13
+ * or else fetches a regular
14
+ * [GraphQL POST or GET request](https://www.apollographql.com/docs/apollo-server/workflow/requests)
15
+ * (depending on the config and GraphQL operation).
16
+ *
17
+ * Some of the options are similar to the
18
+ * [`createHttpLink` options](https://www.apollographql.com/docs/react/api/link/apollo-link-http/#httplink-constructor-options).
19
+ * @see [GraphQL multipart request spec](https://github.com/jaydenseric/graphql-multipart-request-spec).
20
+ * @param {object} options Options.
21
+ * @param {Parameters<typeof selectURI>[1]} [options.uri] GraphQL endpoint URI.
22
+ * Defaults to `"/graphql"`.
23
+ * @param {boolean} [options.useGETForQueries] Should GET be used to fetch
24
+ * queries, if there are no files to upload.
25
+ * @param {ExtractableFileMatcher} [options.isExtractableFile] Matches
26
+ * extractable files in the GraphQL operation. Defaults to
27
+ * {@linkcode isExtractableFile}.
28
+ * @param {typeof FormData} [options.FormData]
29
+ * [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData)
30
+ * class. Defaults to the {@linkcode FormData} global.
31
+ * @param {FormDataFileAppender} [options.formDataAppendFile]
32
+ * Customizes how extracted files are appended to the
33
+ * [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData)
34
+ * instance. Defaults to {@linkcode formDataAppendFile}.
35
+ * @param {import("@apollo/client/link/http/selectHttpOptionsAndBody.js").Printer} [options.print]
36
+ * Prints the GraphQL query or mutation AST to a string for transport.
37
+ * Defaults to {@linkcode defaultPrinter}.
38
+ * @param {typeof fetch} [options.fetch] [`fetch`](https://fetch.spec.whatwg.org)
39
+ * implementation. Defaults to the {@linkcode fetch} global.
40
+ * @param {RequestInit} [options.fetchOptions] `fetch` options; overridden by
41
+ * upload requirements.
42
+ * @param {string} [options.credentials] Overrides
43
+ * {@linkcode RequestInit.credentials credentials} in
44
+ * {@linkcode fetchOptions}.
45
+ * @param {{ [headerName: string]: string }} [options.headers] Merges with and
46
+ * overrides {@linkcode RequestInit.headers headers} in
47
+ * {@linkcode fetchOptions}.
48
+ * @param {boolean} [options.includeExtensions] Toggles sending `extensions`
49
+ * fields to the GraphQL server. Defaults to `false`.
50
+ * @returns A [terminating Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/#the-terminating-link).
51
+ * @example
52
+ * A basic Apollo Client setup:
53
+ *
54
+ * ```js
55
+ * import { ApolloClient, InMemoryCache } from "@apollo/client";
56
+ * import createUploadLink from "apollo-upload-client/createUploadLink.mjs";
57
+ *
58
+ * const client = new ApolloClient({
59
+ * cache: new InMemoryCache(),
60
+ * link: createUploadLink(),
61
+ * });
62
+ * ```
63
+ */
64
+ export declare function createUploadLink({ uri: fetchUri, useGETForQueries, isExtractableFile: customIsExtractableFile, FormData: CustomFormData, formDataAppendFile: customFormDataAppendFile, print, fetch: customFetch, fetchOptions, credentials, headers, includeExtensions, }?: {
65
+ uri?: string;
66
+ useGETForQueries?: boolean;
67
+ isExtractableFile?: (value: unknown) => value is ExtractableFile;
68
+ FormData?: typeof FormData;
69
+ formDataAppendFile?: (formData: FormData, fieldName: string, file: ExtractableFile) => void;
70
+ print?: BaseHttpLink.Printer;
71
+ fetch?: typeof fetch;
72
+ fetchOptions?: RequestInit;
73
+ credentials?: RequestCredentials;
74
+ headers?: Record<string, string>;
75
+ includeExtensions?: boolean;
76
+ }): ApolloLink;
@@ -0,0 +1,111 @@
1
+ import { ApolloLink as q } from "@apollo/client/link";
2
+ import { selectHttpOptionsAndBodyInternal as G, defaultPrinter as H, fallbackHttpConfig as J, selectURI as L, rewriteURIForGET as N, parseAndCheckHttpResponse as T } from "@apollo/client/link/http";
3
+ import { Observable as O } from "@apollo/client/utilities";
4
+ import j from "extract-files/extractFiles.mjs";
5
+ import z from "extract-files/isExtractableFile.mjs";
6
+ var B = Object.defineProperty, w = Object.getOwnPropertySymbols, V = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable, _ = (n, t, e) => t in n ? B(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, m = (n, t) => {
7
+ for (var e in t || (t = {}))
8
+ V.call(t, e) && _(n, e, t[e]);
9
+ if (w)
10
+ for (var e of w(t))
11
+ K.call(t, e) && _(n, e, t[e]);
12
+ return n;
13
+ };
14
+ function M() {
15
+ if (typeof AbortController == "undefined")
16
+ return { controller: !1, signal: !1 };
17
+ const n = new AbortController(), t = n.signal;
18
+ return { controller: n, signal: t };
19
+ }
20
+ function Q(n, t, e) {
21
+ "name" in e ? n.append(t, e, e.name) : n.append(t, e);
22
+ }
23
+ function tt({
24
+ uri: n = "/graphql",
25
+ useGETForQueries: t,
26
+ isExtractableFile: e = z,
27
+ FormData: E,
28
+ formDataAppendFile: x = Q,
29
+ print: F = H,
30
+ fetch: v,
31
+ fetchOptions: A,
32
+ credentials: C,
33
+ headers: P,
34
+ includeExtensions: S
35
+ } = {}) {
36
+ const I = {
37
+ http: { includeExtensions: S },
38
+ options: A,
39
+ credentials: C,
40
+ headers: P
41
+ };
42
+ return new q((l) => {
43
+ const p = l.getContext(), {
44
+ // Apollo Studio client awareness `name` and `version` can be configured
45
+ // via `ApolloClient` constructor options:
46
+ // https://www.apollographql.com/docs/graphos/metrics/client-awareness/#setup
47
+ clientAwareness: { name: u, version: h } = {},
48
+ headers: D
49
+ } = p, R = {
50
+ http: p.http,
51
+ options: p.fetchOptions,
52
+ credentials: p.credentials,
53
+ headers: m(m(m({}, u && { "apollographql-client-name": u }), h && { "apollographql-client-version": h }), D)
54
+ }, { options: o, body: g } = G(
55
+ l,
56
+ F,
57
+ J,
58
+ I,
59
+ R
60
+ ), { clone: y, files: c } = j(g, e, "");
61
+ let f = L(l, n);
62
+ if (c.size) {
63
+ o.headers && delete o.headers["content-type"];
64
+ const a = E || FormData, i = new a();
65
+ i.append("operations", JSON.stringify(y));
66
+ const r = {};
67
+ let d = 0;
68
+ c.forEach((b) => {
69
+ r[++d] = b;
70
+ }), i.append("map", JSON.stringify(r)), d = 0, c.forEach((b, k) => {
71
+ x(i, String(++d), k);
72
+ }), o.body = i;
73
+ } else if (t && !l.query.definitions.some(
74
+ (a) => a.kind === "OperationDefinition" && a.operation === "mutation"
75
+ ) && (o.method = "GET"), o.method === "GET") {
76
+ const { newURI: a, parseError: i } = N(f, g);
77
+ if (i)
78
+ return new O((r) => {
79
+ r.error(i);
80
+ });
81
+ f = a;
82
+ } else
83
+ o.body = JSON.stringify(y);
84
+ const { controller: s } = M();
85
+ typeof s != "boolean" && (o.signal && (o.signal.aborted ? s.abort() : o.signal.addEventListener(
86
+ "abort",
87
+ () => {
88
+ s.abort();
89
+ },
90
+ {
91
+ // Prevent a memory leak if the user configured abort controller
92
+ // is long lasting, or controls multiple things.
93
+ once: !0
94
+ }
95
+ )), o.signal = s.signal);
96
+ const U = v || fetch;
97
+ return new O((a) => {
98
+ let i;
99
+ return U(f, o).then((r) => (l.setContext({ response: r }), r)).then(T(l)).then((r) => {
100
+ a.next(r), a.complete();
101
+ }).catch((r) => {
102
+ i || (r.result && r.result.errors && r.result.data && a.next(r.result), a.error(r));
103
+ }), () => {
104
+ i = !0, typeof s != "boolean" && s.abort();
105
+ };
106
+ });
107
+ });
108
+ }
109
+ export {
110
+ tt as createUploadLink
111
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),a=require("./apollo-error.context.cjs"),r=require("./apollo-error.module.scss.cjs");function s(){const o=t.use(a.ApolloErrorContext),e=o==null?void 0:o.error;if(!e)return null;const n="locations"in e||"path"in e||"extensions"in e,l="message"in e?e.message:"Unknown error occurred";return t.createElement("div",{className:r.default["modal-backdrop"]},t.createElement("div",{className:r.default["modal-content"]},t.createElement("button",{type:"button",className:r.default["btn-close"],onClick:o.hideError},"✕"),t.createElement("div",{className:r.default["error-title"]},t.createElement("button",{type:"button",className:r.default["btn-retry"],onClick:()=>window.location.reload()},"Reload")," ",l),t.createElement("div",{className:r.default["error-details"]},n&&"locations"in e&&e.locations&&t.createElement("pre",{className:"locations"},t.createElement("strong",null,"Locations:")," ",JSON.stringify(e.locations,null,4)),n&&"path"in e&&e.path&&t.createElement("pre",{className:"path"},t.createElement("strong",null,"Path:")," ",JSON.stringify(e.path,null,4)),n&&"extensions"in e&&e.extensions&&t.createElement("pre",{className:"extensions"},t.createElement("strong",null,"Extensions:")," ",JSON.stringify(e.extensions,null,4)),!n&&t.createElement("pre",{className:"error-details"},t.createElement("strong",null,"Error Details:")," ",JSON.stringify(e,null,4)))))}exports.ApolloErrorComponent=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),a=require("../../util/validate/validate.util.cjs"),s=require("./apollo-error.context.cjs"),r=require("./apollo-error.module.scss.cjs");function i(){const l=t.use(s.ApolloErrorContext),e=l==null?void 0:l.error;if(!e)return null;const n="locations"in e||"path"in e||"extensions"in e,o="message"in e?e.message:"Unknown error occurred";return t.createElement("div",{className:r.default["modal-backdrop"]},t.createElement("div",{className:r.default["modal-content"]},t.createElement("button",{type:"button",className:r.default["btn-close"],onClick:l.hideError},"✕"),t.createElement("div",{className:r.default["error-title"]},t.createElement("button",{type:"button",className:r.default["btn-retry"],onClick:()=>window.location.reload()},"Reload")," ",!a.validate.isEmpty(e)&&o),t.createElement("div",{className:r.default["error-details"]},n&&"locations"in e&&e.locations&&t.createElement("pre",{className:"locations"},t.createElement("strong",null,"Locations:")," ",JSON.stringify(e.locations,null,4)),n&&"path"in e&&e.path&&t.createElement("pre",{className:"path"},t.createElement("strong",null,"Path:")," ",JSON.stringify(e.path,null,4)),n&&"extensions"in e&&e.extensions&&t.createElement("pre",{className:"extensions"},t.createElement("strong",null,"Extensions:")," ",JSON.stringify(e.extensions,null,4)),!n&&t.createElement("pre",{className:"error-details"},t.createElement("strong",null,"Error Details:")," ",a.validate.isEmpty(e)?o:JSON.stringify(e,null,4)))))}exports.ApolloErrorComponent=i;
@@ -1,8 +1,9 @@
1
- import t, { use as s } from "react";
2
- import { ApolloErrorContext as a } from "./apollo-error.context.js";
1
+ import t, { use as a } from "react";
2
+ import { validate as s } from "../../util/validate/validate.util.js";
3
+ import { ApolloErrorContext as i } from "./apollo-error.context.js";
3
4
  import n from "./apollo-error.module.scss.js";
4
- function p() {
5
- const o = s(a), e = o == null ? void 0 : o.error;
5
+ function u() {
6
+ const o = a(i), e = o == null ? void 0 : o.error;
6
7
  if (!e)
7
8
  return null;
8
9
  const r = "locations" in e || "path" in e || "extensions" in e, l = "message" in e ? e.message : "Unknown error occurred";
@@ -22,8 +23,8 @@ function p() {
22
23
  onClick: () => window.location.reload()
23
24
  },
24
25
  "Reload"
25
- ), " ", l), /* @__PURE__ */ t.createElement("div", { className: n["error-details"] }, r && "locations" in e && e.locations && /* @__PURE__ */ t.createElement("pre", { className: "locations" }, /* @__PURE__ */ t.createElement("strong", null, "Locations:"), " ", JSON.stringify(e.locations, null, 4)), r && "path" in e && e.path && /* @__PURE__ */ t.createElement("pre", { className: "path" }, /* @__PURE__ */ t.createElement("strong", null, "Path:"), " ", JSON.stringify(e.path, null, 4)), r && "extensions" in e && e.extensions && /* @__PURE__ */ t.createElement("pre", { className: "extensions" }, /* @__PURE__ */ t.createElement("strong", null, "Extensions:"), " ", JSON.stringify(e.extensions, null, 4)), !r && /* @__PURE__ */ t.createElement("pre", { className: "error-details" }, /* @__PURE__ */ t.createElement("strong", null, "Error Details:"), " ", JSON.stringify(e, null, 4)))));
26
+ ), " ", !s.isEmpty(e) && l), /* @__PURE__ */ t.createElement("div", { className: n["error-details"] }, r && "locations" in e && e.locations && /* @__PURE__ */ t.createElement("pre", { className: "locations" }, /* @__PURE__ */ t.createElement("strong", null, "Locations:"), " ", JSON.stringify(e.locations, null, 4)), r && "path" in e && e.path && /* @__PURE__ */ t.createElement("pre", { className: "path" }, /* @__PURE__ */ t.createElement("strong", null, "Path:"), " ", JSON.stringify(e.path, null, 4)), r && "extensions" in e && e.extensions && /* @__PURE__ */ t.createElement("pre", { className: "extensions" }, /* @__PURE__ */ t.createElement("strong", null, "Extensions:"), " ", JSON.stringify(e.extensions, null, 4)), !r && /* @__PURE__ */ t.createElement("pre", { className: "error-details" }, /* @__PURE__ */ t.createElement("strong", null, "Error Details:"), " ", s.isEmpty(e) ? l : JSON.stringify(e, null, 4)))));
26
27
  }
27
28
  export {
28
- p as ApolloErrorComponent
29
+ u as ApolloErrorComponent
29
30
  };
@@ -1 +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;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"modal-backdrop":"_modal-backdrop_1i2kc_1","modal-content":"_modal-content_1i2kc_11","btn-close":"_btn-close_1i2kc_22","error-title":"_error-title_1i2kc_36","btn-retry":"_btn-retry_1i2kc_40","error-details":"_error-details_1i2kc_53"};exports.default=e;
@@ -1,11 +1,11 @@
1
- const e = {
2
- "modal-backdrop": "_modal-backdrop_8fveh_1",
3
- "modal-content": "_modal-content_8fveh_11",
4
- "btn-close": "_btn-close_8fveh_22",
5
- "error-title": "_error-title_8fveh_36",
6
- "btn-retry": "_btn-retry_8fveh_41",
7
- "error-details": "_error-details_8fveh_54"
1
+ const t = {
2
+ "modal-backdrop": "_modal-backdrop_1i2kc_1",
3
+ "modal-content": "_modal-content_1i2kc_11",
4
+ "btn-close": "_btn-close_1i2kc_22",
5
+ "error-title": "_error-title_1i2kc_36",
6
+ "btn-retry": "_btn-retry_1i2kc_40",
7
+ "error-details": "_error-details_1i2kc_53"
8
8
  };
9
9
  export {
10
- e as default
10
+ t as default
11
11
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- ._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3);backdrop-filter:blur(20px) saturate(200%);display:flex;justify-content:center;align-items:center;width:100%;height:100%;animation:_overlay-fade-in_b1d9o_1 .5s ease-out;border:1.5px solid rgba(255,255,255,.35);box-shadow:0 4px 32px #1f26872e,inset 0 1.5px 8px #ffffff40}._full_b1d9o_1,._block_b1d9o_2{pointer-events:none}._full_b1d9o_1{position:fixed;inset:0}._block_b1d9o_2{position:absolute;width:100%;height:100%;left:50%;top:50%;transform:translate(-50%,-50%);background:#ffffff1a;backdrop-filter:blur(4px)}._container_b1d9o_40{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;padding:1rem;gap:1.5rem;text-align:center}._container_b1d9o_40 ._ring_b1d9o_50{width:clamp(60px,10vw,150px);height:clamp(60px,10vw,150px);border:2px solid transparent;border-radius:50%;position:absolute;transition:transform .3s ease}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(1){border-bottom:8px solid hsl(315,90%,60%);animation:_rotate1_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(2){border-bottom:8px solid hsl(345,90%,50%);animation:_rotate2_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(3){border-bottom:8px solid hsl(180,80%,40%);animation:_rotate3_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(4){border-bottom:8px solid hsl(40,100%,45%);animation:_rotate4_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._message_b1d9o_74{font-weight:700;color:#2f2f37;text-shadow:0 1px 2px rgba(255,255,255,.8);animation:_text-fade_b1d9o_1 2s ease-in-out infinite alternate;word-break:break-word;hyphens:auto}@keyframes _rotate1_b1d9o_1{0%{transform:rotateX(50deg) rotate(110deg)}to{transform:rotateX(50deg) rotate(470deg)}}@keyframes _rotate2_b1d9o_1{0%{transform:rotateX(20deg) rotateY(50deg) rotate(20deg)}to{transform:rotateX(20deg) rotateY(50deg) rotate(380deg)}}@keyframes _rotate3_b1d9o_1{0%{transform:rotateX(40deg) rotateY(130deg) rotate(450deg)}to{transform:rotateX(40deg) rotateY(130deg) rotate(90deg)}}@keyframes _rotate4_b1d9o_1{0%{transform:rotateX(70deg) rotate(270deg)}to{transform:rotateX(70deg) rotate(630deg)}}@keyframes _text-fade_b1d9o_1{0%{opacity:.6}to{opacity:1}}@keyframes _overlay-fade-in_b1d9o_1{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){._ring_b1d9o_50,._message_b1d9o_74,._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{animation:none!important}}._modal-backdrop_8fveh_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22:hover{color:#f87171}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36{font-size:1.75rem;font-weight:700;margin-bottom:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._main_8fveh_72{color:#fca5a5}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._network_8fveh_75{color:#fde68a}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._extra_8fveh_78{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 ul{padding-left:1rem;color:#fda4af;list-style:disc}
1
+ ._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3);backdrop-filter:blur(20px) saturate(200%);display:flex;justify-content:center;align-items:center;width:100%;height:100%;animation:_overlay-fade-in_b1d9o_1 .5s ease-out;border:1.5px solid rgba(255,255,255,.35);box-shadow:0 4px 32px #1f26872e,inset 0 1.5px 8px #ffffff40}._full_b1d9o_1,._block_b1d9o_2{pointer-events:none}._full_b1d9o_1{position:fixed;inset:0}._block_b1d9o_2{position:absolute;width:100%;height:100%;left:50%;top:50%;transform:translate(-50%,-50%);background:#ffffff1a;backdrop-filter:blur(4px)}._container_b1d9o_40{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;padding:1rem;gap:1.5rem;text-align:center}._container_b1d9o_40 ._ring_b1d9o_50{width:clamp(60px,10vw,150px);height:clamp(60px,10vw,150px);border:2px solid transparent;border-radius:50%;position:absolute;transition:transform .3s ease}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(1){border-bottom:8px solid hsl(315,90%,60%);animation:_rotate1_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(2){border-bottom:8px solid hsl(345,90%,50%);animation:_rotate2_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(3){border-bottom:8px solid hsl(180,80%,40%);animation:_rotate3_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(4){border-bottom:8px solid hsl(40,100%,45%);animation:_rotate4_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._message_b1d9o_74{font-weight:700;color:#2f2f37;text-shadow:0 1px 2px rgba(255,255,255,.8);animation:_text-fade_b1d9o_1 2s ease-in-out infinite alternate;word-break:break-word;hyphens:auto}@keyframes _rotate1_b1d9o_1{0%{transform:rotateX(50deg) rotate(110deg)}to{transform:rotateX(50deg) rotate(470deg)}}@keyframes _rotate2_b1d9o_1{0%{transform:rotateX(20deg) rotateY(50deg) rotate(20deg)}to{transform:rotateX(20deg) rotateY(50deg) rotate(380deg)}}@keyframes _rotate3_b1d9o_1{0%{transform:rotateX(40deg) rotateY(130deg) rotate(450deg)}to{transform:rotateX(40deg) rotateY(130deg) rotate(90deg)}}@keyframes _rotate4_b1d9o_1{0%{transform:rotateX(70deg) rotate(270deg)}to{transform:rotateX(70deg) rotate(630deg)}}@keyframes _text-fade_b1d9o_1{0%{opacity:.6}to{opacity:1}}@keyframes _overlay-fade-in_b1d9o_1{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){._ring_b1d9o_50,._message_b1d9o_74,._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{animation:none!important}}._modal-backdrop_1i2kc_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._btn-close_1i2kc_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._btn-close_1i2kc_22:hover{color:#f87171}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-title_1i2kc_36{font-weight:700;margin-bottom:1rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-title_1i2kc_36 ._btn-retry_1i2kc_40{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-title_1i2kc_36 ._btn-retry_1i2kc_40:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 pre._main_1i2kc_71{color:#fca5a5}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 pre._network_1i2kc_74{color:#fde68a}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 pre._extra_1i2kc_77{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_1i2kc_1 ._modal-content_1i2kc_11 ._error-details_1i2kc_53 ul{padding-left:1rem;color:#fda4af;list-style:disc}._error-container_oofeh_1{display:flex;align-items:center;justify-content:center;gap:.5rem}._error-details-button_oofeh_8{display:inline-flex;align-items:center;justify-content:center;padding:.5rem 1rem;background-color:#ef4444;color:#fff;border:2px solid #dc2626;border-radius:.5rem;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease-in-out}._error-details-button_oofeh_8:hover{background-color:#dc2626;border-color:#b91c1c;transform:translateY(-1px);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}._error-details-button_oofeh_8:active{transform:translateY(0);box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f}._error-details-button_oofeh_8:focus{outline:none;ring:2px;ring-color:#fca5a5;ring-offset:2px}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cyberskill/shared",
3
3
  "type": "module",
4
- "version": "2.15.0",
4
+ "version": "2.17.0",
5
5
  "description": "CyberSkill Shared",
6
6
  "author": "Stephen Cheng",
7
7
  "license": "MIT",
@@ -221,7 +221,6 @@
221
221
  "@nestjs/core": "11.1.6",
222
222
  "@userback/widget": "0.3.11",
223
223
  "@vitejs/plugin-react-swc": "4.0.1",
224
- "apollo-upload-client": "18.0.1",
225
224
  "body-parser": "2.2.0",
226
225
  "chalk": "5.6.0",
227
226
  "clsx": "2.1.1",
@@ -238,6 +237,7 @@
238
237
  "express": "5.1.0",
239
238
  "express-session": "1.18.2",
240
239
  "express-useragent": "1.0.15",
240
+ "extract-files": "13.0.0",
241
241
  "fs-extra": "11.3.1",
242
242
  "globals": "16.3.0",
243
243
  "graphql": "16.11.0",
@@ -275,7 +275,6 @@
275
275
  "@next/eslint-plugin-next": "15.5.0",
276
276
  "@testing-library/jest-dom": "6.8.0",
277
277
  "@testing-library/react": "16.3.0",
278
- "@types/apollo-upload-client": "18.0.0",
279
278
  "@types/body-parser": "1.19.6",
280
279
  "@types/compression": "1.8.1",
281
280
  "@types/cookie-parser": "1.4.9",
@@ -284,6 +283,7 @@
284
283
  "@types/express": "5.0.3",
285
284
  "@types/express-session": "1.18.2",
286
285
  "@types/express-useragent": "1.0.5",
286
+ "@types/extract-files": "13.0.1",
287
287
  "@types/fs-extra": "11.0.4",
288
288
  "@types/graphql-upload": "17.0.0",
289
289
  "@types/lodash-es": "4.17.12",