quantum-component-library 1.4.65 → 1.4.66

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/hooks.cjs CHANGED
@@ -1 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),c=require("./services-human-DFPelsei.cjs"),l=require("./types.cjs");require("./lodash-vendor-CfNg9qwP.cjs");require("./moment-vendor-1cRqq0AH.cjs");const f=require("./graphql-vendor-CSrUjvOC.cjs"),p=require("urql"),P=require("./providers.cjs");require("./react-jsx-runtime-vendor-Dszzpdy0.cjs");require("./graphql-kPu5QxaL.cjs");const d=(e,s)=>u.useMemo(()=>e.flatMap(o=>c.getEnabledJointPlanes(o,s).map(t=>({id:{joint:o},plane:t,...c.getDefaultJointRange(o,t),sensorOnly:s===l.AngleDataSource.Sensor}))),[e,s]),b=(e,s)=>{const n=u.useMemo(()=>{const t=c.getAllAvailableLimbs();return e.filter(a=>t.some(r=>r.id===a))},[e]);return u.useMemo(()=>n.flatMap(t=>c.getEnabledSegmentPlanes(t,s).map(a=>({id:{segment:t},plane:a,...c.getDefaultLimbRange(t,a),sensorOnly:s===l.AngleDataSource.Sensor}))),[n,s])},S=()=>{const e=u.useMemo(()=>c.getAllAvailableLimbs(),[]),s=u.useMemo(()=>c.getAllAvailablePoseJoints(),[]),n=b(e.map(r=>r.id),l.AngleDataSource.Pose),o=d(s.map(r=>r.id),l.AngleDataSource.Pose),t=b(e.map(r=>r.id),l.AngleDataSource.Sensor),a=d(s.map(r=>r.id),l.AngleDataSource.Sensor);return u.useMemo(()=>{const r=new Map;return[...o,...n].forEach(i=>{const m="joint"in i.id?`joint:${i.id.joint}:${i.plane}`:`segment:${i.id.segment}:${i.plane}`;r.set(m,{...i,sensorOnly:!1})}),[...a,...t].forEach(i=>{const m="joint"in i.id?`joint:${i.id.joint}:${i.plane}`:`segment:${i.id.segment}:${i.plane}`;r.has(m)||r.set(m,{...i,sensorOnly:!0})}),Array.from(r.values())},[o,n,a,t])},h=({url:e,getAuthToken:s})=>new p.Client({url:e,requestPolicy:"cache-and-network",exchanges:[f.authExchange(n=>{const o=s();return Promise.resolve({addAuthToOperation(t){return o?n.appendHeaders(t,{Authorization:`Bearer ${o}`}):t},didAuthError:t=>/unauthorized/gi.test(t?.message),refreshAuth:()=>Promise.resolve()})}),p.fetchExchange]}),q=({url:e,getAuthToken:s})=>u.useMemo(()=>h({url:e,getAuthToken:s}),[e,s]),g=e=>{const s=c.getAllAvailableJoints();return u.useMemo(()=>s.filter(n=>n.id==="NavalSpine"||n.id==="ChestSpine"?!1:c.limbsRequiredForJoints[n.id].every(t=>e.includes(t))),[e,s])},L=e=>{const s=u.useMemo(()=>e.map(l.sensorLocationToLimbId).filter(o=>!!o),[e]);return g(s)},A=e=>u.useMemo(()=>{const n=c.getAllAvailableLimbs(),o=e.map(l.sensorLocationToLimbId);return n.filter(t=>o.includes(t.id))},[e]),O=e=>{const s=A(e),n=L(e),o=d(n.map(a=>a.id),l.AngleDataSource.Sensor),t=b(s.map(a=>a.id),l.AngleDataSource.Sensor);return[...o,...t]},v=()=>{const e=u.useContext(P.UiLabelContext);if(e===void 0)throw new Error("useUiLabelContext must be used within a UiLabelProvider");return e};exports.useAllPartParameters=S;exports.useGraphqlClient=q;exports.useJointsForLimbIds=g;exports.useJointsForSensorLocations=L;exports.useLimbsForSensorLocations=A;exports.usePartOptionsForJoints=d;exports.usePartOptionsForLimbs=b;exports.usePartOptionsForSensorLocations=O;exports.useUiLabelContext=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),c=require("./services-human-DFPelsei.cjs"),l=require("./types.cjs");require("./lodash-vendor-CfNg9qwP.cjs");require("./moment-vendor-1cRqq0AH.cjs");const L=require("./graphql-vendor-CSrUjvOC.cjs"),f=require("urql"),A=require("./providers.cjs");require("./react-jsx-runtime-vendor-Dszzpdy0.cjs");require("./graphql-kPu5QxaL.cjs");const d=(e,t)=>u.useMemo(()=>e.flatMap(i=>c.getEnabledJointPlanes(i,t).map(n=>({id:{joint:i},plane:n,...c.getDefaultJointRange(i,n),sensorOnly:t===l.AngleDataSource.Sensor}))),[e,t]),b=(e,t)=>{const o=u.useMemo(()=>{const n=c.getAllAvailableLimbs();return e.filter(a=>n.some(r=>r.id===a))},[e]);return u.useMemo(()=>o.flatMap(n=>c.getEnabledSegmentPlanes(n,t).map(a=>({id:{segment:n},plane:a,...c.getDefaultLimbRange(n,a),sensorOnly:t===l.AngleDataSource.Sensor}))),[o,t])},S=()=>{const e=u.useMemo(()=>c.getAllAvailableLimbs(),[]),t=u.useMemo(()=>c.getAllAvailablePoseJoints(),[]),o=b(e.map(r=>r.id),l.AngleDataSource.Pose),i=d(t.map(r=>r.id),l.AngleDataSource.Pose),n=b(e.map(r=>r.id),l.AngleDataSource.Sensor),a=d(t.map(r=>r.id),l.AngleDataSource.Sensor);return u.useMemo(()=>{const r=new Map;return[...i,...o].forEach(s=>{const m="joint"in s.id?`joint:${s.id.joint}:${s.plane}`:`segment:${s.id.segment}:${s.plane}`;r.set(m,{...s,sensorOnly:!1})}),[...a,...n].forEach(s=>{const m="joint"in s.id?`joint:${s.id.joint}:${s.plane}`:`segment:${s.id.segment}:${s.plane}`;r.has(m)||r.set(m,{...s,sensorOnly:!0})}),Array.from(r.values())},[i,o,a,n])},q=({url:e,getAuthToken:t,getRefreshToken:o,onSessionRefreshed:i,onAuthError:n})=>new f.Client({url:e,requestPolicy:"cache-and-network",exchanges:[L.authExchange(async a=>({addAuthToOperation(r){const s=t();return s?a.appendHeaders(r,{Authorization:`Bearer ${s}`}):r},didAuthError:r=>r.graphQLErrors.some(s=>s.extensions?.code==="UNAUTHORIZED"||s.extensions?.code==="UNAUTHENTICATED"||s.message.includes("Unauthorized")),refreshAuth:async()=>{const r=o();if(!r){n();return}try{const s=await a.mutate(`mutation Refresh($refreshToken: String!) {
2
+ refresh(refreshToken: $refreshToken) {
3
+ session {
4
+ accessToken
5
+ refreshToken
6
+ }
7
+ }
8
+ }`,{refreshToken:r});s.data?.refresh?.session?i(s.data.refresh.session.accessToken,s.data.refresh.session.refreshToken):(console.error("Refresh failed:",s.error),n())}catch(s){console.error("Refresh handling error:",s),n()}}})),f.fetchExchange]}),O=({url:e,getAuthToken:t,getRefreshToken:o,onSessionRefreshed:i,onAuthError:n})=>u.useMemo(()=>q({url:e,getAuthToken:t,getRefreshToken:o,onSessionRefreshed:i,onAuthError:n}),[e,t,o,i,n]),p=e=>{const t=c.getAllAvailableJoints();return u.useMemo(()=>t.filter(o=>o.id==="NavalSpine"||o.id==="ChestSpine"?!1:c.limbsRequiredForJoints[o.id].every(n=>e.includes(n))),[e,t])},g=e=>{const t=u.useMemo(()=>e.map(l.sensorLocationToLimbId).filter(i=>!!i),[e]);return p(t)},h=e=>u.useMemo(()=>{const o=c.getAllAvailableLimbs(),i=e.map(l.sensorLocationToLimbId);return o.filter(n=>i.includes(n.id))},[e]),P=e=>{const t=h(e),o=g(e),i=d(o.map(a=>a.id),l.AngleDataSource.Sensor),n=b(t.map(a=>a.id),l.AngleDataSource.Sensor);return[...i,...n]},y=()=>{const e=u.useContext(A.UiLabelContext);if(e===void 0)throw new Error("useUiLabelContext must be used within a UiLabelProvider");return e};exports.useAllPartParameters=S;exports.useGraphqlClient=O;exports.useJointsForLimbIds=p;exports.useJointsForSensorLocations=g;exports.useLimbsForSensorLocations=h;exports.usePartOptionsForJoints=d;exports.usePartOptionsForLimbs=b;exports.usePartOptionsForSensorLocations=P;exports.useUiLabelContext=y;
package/dist/hooks.js CHANGED
@@ -1,127 +1,158 @@
1
- import { useMemo as l, useContext as b } from "react";
2
- import { h as g, i as h, j as p, k as L, l as P, m as O, n as A, o as J } from "./services-human-D5IllQkM.js";
3
- import { AngleDataSource as m, sensorLocationToLimbId as f } from "./types.js";
1
+ import { useMemo as l, useContext as h } from "react";
2
+ import { h as b, i as g, j as f, k as L, l as O, m as P, n as T, o as y } from "./services-human-D5IllQkM.js";
3
+ import { AngleDataSource as c, sensorLocationToLimbId as p } from "./types.js";
4
4
  import "./lodash-vendor-CY4G3-79.js";
5
5
  import "./moment-vendor-DMLRxgRE.js";
6
- import { a as v } from "./graphql-vendor-ipMKtdBu.js";
7
- import { Client as x, fetchExchange as y } from "urql";
8
- import { UiLabelContext as S } from "./providers.js";
6
+ import { a as A } from "./graphql-vendor-ipMKtdBu.js";
7
+ import { Client as k, fetchExchange as x } from "urql";
8
+ import { UiLabelContext as J } from "./providers.js";
9
9
  import "./react-jsx-runtime-vendor-OVHDjVDe.js";
10
10
  import "./graphql-DAkuEEbq.js";
11
- const c = (e, s) => l(
11
+ const u = (e, t) => l(
12
12
  () => e.flatMap(
13
- (o) => g(o, s).map((t) => ({
14
- id: { joint: o },
15
- plane: t,
16
- ...h(o, t),
17
- sensorOnly: s === m.Sensor
13
+ (i) => b(i, t).map((n) => ({
14
+ id: { joint: i },
15
+ plane: n,
16
+ ...g(i, n),
17
+ sensorOnly: t === c.Sensor
18
18
  }))
19
19
  ),
20
- [e, s]
21
- ), d = (e, s) => {
22
- const n = l(() => {
23
- const t = p();
24
- return e.filter((a) => t.some((r) => r.id === a));
20
+ [e, t]
21
+ ), d = (e, t) => {
22
+ const o = l(() => {
23
+ const n = f();
24
+ return e.filter((a) => n.some((r) => r.id === a));
25
25
  }, [e]);
26
26
  return l(
27
- () => n.flatMap(
28
- (t) => L(t, s).map((a) => ({
29
- id: { segment: t },
27
+ () => o.flatMap(
28
+ (n) => L(n, t).map((a) => ({
29
+ id: { segment: n },
30
30
  plane: a,
31
- ...P(t, a),
32
- sensorOnly: s === m.Sensor
31
+ ...O(n, a),
32
+ sensorOnly: t === c.Sensor
33
33
  }))
34
34
  ),
35
- [n, s]
35
+ [o, t]
36
36
  );
37
- }, B = () => {
38
- const e = l(() => p(), []), s = l(() => O(), []), n = d(
37
+ }, N = () => {
38
+ const e = l(() => f(), []), t = l(() => P(), []), o = d(
39
39
  e.map((r) => r.id),
40
- m.Pose
41
- ), o = c(
42
- s.map((r) => r.id),
43
- m.Pose
44
- ), t = d(
40
+ c.Pose
41
+ ), i = u(
42
+ t.map((r) => r.id),
43
+ c.Pose
44
+ ), n = d(
45
45
  e.map((r) => r.id),
46
- m.Sensor
47
- ), a = c(
48
- s.map((r) => r.id),
49
- m.Sensor
46
+ c.Sensor
47
+ ), a = u(
48
+ t.map((r) => r.id),
49
+ c.Sensor
50
50
  );
51
51
  return l(() => {
52
52
  const r = /* @__PURE__ */ new Map();
53
- return [...o, ...n].forEach((i) => {
54
- const u = "joint" in i.id ? `joint:${i.id.joint}:${i.plane}` : `segment:${i.id.segment}:${i.plane}`;
55
- r.set(u, { ...i, sensorOnly: !1 });
56
- }), [...a, ...t].forEach((i) => {
57
- const u = "joint" in i.id ? `joint:${i.id.joint}:${i.plane}` : `segment:${i.id.segment}:${i.plane}`;
58
- r.has(u) || r.set(u, { ...i, sensorOnly: !0 });
53
+ return [...i, ...o].forEach((s) => {
54
+ const m = "joint" in s.id ? `joint:${s.id.joint}:${s.plane}` : `segment:${s.id.segment}:${s.plane}`;
55
+ r.set(m, { ...s, sensorOnly: !1 });
56
+ }), [...a, ...n].forEach((s) => {
57
+ const m = "joint" in s.id ? `joint:${s.id.joint}:${s.plane}` : `segment:${s.id.segment}:${s.plane}`;
58
+ r.has(m) || r.set(m, { ...s, sensorOnly: !0 });
59
59
  }), Array.from(r.values());
60
60
  }, [
61
+ i,
61
62
  o,
62
- n,
63
63
  a,
64
- t
64
+ n
65
65
  ]);
66
66
  }, $ = ({
67
67
  url: e,
68
- getAuthToken: s
69
- }) => new x({
68
+ getAuthToken: t,
69
+ getRefreshToken: o,
70
+ onSessionRefreshed: i,
71
+ onAuthError: n
72
+ }) => new k({
70
73
  url: e,
71
74
  requestPolicy: "cache-and-network",
72
75
  exchanges: [
73
- v((n) => {
74
- const o = s();
75
- return Promise.resolve({
76
- addAuthToOperation(t) {
77
- return o ? n.appendHeaders(t, {
78
- Authorization: `Bearer ${o}`
79
- }) : t;
80
- },
81
- didAuthError: (t) => /unauthorized/gi.test(t?.message),
82
- refreshAuth: () => Promise.resolve()
83
- });
84
- }),
85
- y
76
+ A(async (a) => ({
77
+ addAuthToOperation(r) {
78
+ const s = t();
79
+ return s ? a.appendHeaders(r, {
80
+ Authorization: `Bearer ${s}`
81
+ }) : r;
82
+ },
83
+ didAuthError: (r) => r.graphQLErrors.some(
84
+ (s) => s.extensions?.code === "UNAUTHORIZED" || s.extensions?.code === "UNAUTHENTICATED" || s.message.includes("Unauthorized")
85
+ ),
86
+ refreshAuth: async () => {
87
+ const r = o();
88
+ if (!r) {
89
+ n();
90
+ return;
91
+ }
92
+ try {
93
+ const s = await a.mutate(
94
+ `mutation Refresh($refreshToken: String!) {
95
+ refresh(refreshToken: $refreshToken) {
96
+ session {
97
+ accessToken
98
+ refreshToken
99
+ }
100
+ }
101
+ }`,
102
+ { refreshToken: r }
103
+ );
104
+ s.data?.refresh?.session ? i(
105
+ s.data.refresh.session.accessToken,
106
+ s.data.refresh.session.refreshToken
107
+ ) : (console.error("Refresh failed:", s.error), n());
108
+ } catch (s) {
109
+ console.error("Refresh handling error:", s), n();
110
+ }
111
+ }
112
+ })),
113
+ x
86
114
  ]
87
- }), G = ({
115
+ }), H = ({
88
116
  url: e,
89
- getAuthToken: s
117
+ getAuthToken: t,
118
+ getRefreshToken: o,
119
+ onSessionRefreshed: i,
120
+ onAuthError: n
90
121
  }) => l(
91
- () => $({ url: e, getAuthToken: s }),
92
- [e, s]
122
+ () => $({ url: e, getAuthToken: t, getRefreshToken: o, onSessionRefreshed: i, onAuthError: n }),
123
+ [e, t, o, i, n]
93
124
  ), C = (e) => {
94
- const s = A();
95
- return l(() => s.filter((n) => n.id === "NavalSpine" || n.id === "ChestSpine" ? !1 : J[n.id].every((t) => e.includes(t))), [e, s]);
125
+ const t = T();
126
+ return l(() => t.filter((o) => o.id === "NavalSpine" || o.id === "ChestSpine" ? !1 : y[o.id].every((n) => e.includes(n))), [e, t]);
96
127
  }, E = (e) => {
97
- const s = l(() => e.map(f).filter((o) => !!o), [e]);
98
- return C(s);
99
- }, F = (e) => l(() => {
100
- const n = p(), o = e.map(f);
101
- return n.filter((t) => o.includes(t.id));
102
- }, [e]), H = (e) => {
103
- const s = F(e), n = E(e), o = c(
104
- n.map((a) => a.id),
105
- m.Sensor
106
- ), t = d(
107
- s.map((a) => a.id),
108
- m.Sensor
128
+ const t = l(() => e.map(p).filter((i) => !!i), [e]);
129
+ return C(t);
130
+ }, S = (e) => l(() => {
131
+ const o = f(), i = e.map(p);
132
+ return o.filter((n) => i.includes(n.id));
133
+ }, [e]), z = (e) => {
134
+ const t = S(e), o = E(e), i = u(
135
+ o.map((a) => a.id),
136
+ c.Sensor
137
+ ), n = d(
138
+ t.map((a) => a.id),
139
+ c.Sensor
109
140
  );
110
- return [...o, ...t];
111
- }, N = () => {
112
- const e = b(S);
141
+ return [...i, ...n];
142
+ }, B = () => {
143
+ const e = h(J);
113
144
  if (e === void 0)
114
145
  throw new Error("useUiLabelContext must be used within a UiLabelProvider");
115
146
  return e;
116
147
  };
117
148
  export {
118
- B as useAllPartParameters,
119
- G as useGraphqlClient,
149
+ N as useAllPartParameters,
150
+ H as useGraphqlClient,
120
151
  C as useJointsForLimbIds,
121
152
  E as useJointsForSensorLocations,
122
- F as useLimbsForSensorLocations,
123
- c as usePartOptionsForJoints,
153
+ S as useLimbsForSensorLocations,
154
+ u as usePartOptionsForJoints,
124
155
  d as usePartOptionsForLimbs,
125
- H as usePartOptionsForSensorLocations,
126
- N as useUiLabelContext
156
+ z as usePartOptionsForSensorLocations,
157
+ B as useUiLabelContext
127
158
  };
@@ -1,5 +1,8 @@
1
1
  import { Client } from 'urql';
2
- export declare const useGraphqlClient: ({ url, getAuthToken, }: {
2
+ export declare const useGraphqlClient: ({ url, getAuthToken, getRefreshToken, onSessionRefreshed, onAuthError, }: {
3
3
  url: string;
4
- getAuthToken: () => string;
4
+ getAuthToken: () => string | null;
5
+ getRefreshToken: () => string | null;
6
+ onSessionRefreshed: (accessToken: string, refreshToken?: string) => void;
7
+ onAuthError: () => void;
5
8
  }) => Client;
@@ -1,7 +1,10 @@
1
1
  import { ChakraProviderProps } from '@chakra-ui/react';
2
2
  interface QuantumLibraryProviderProps {
3
3
  url: string;
4
- getAuthToken: () => string;
4
+ getAuthToken: () => string | null;
5
+ getRefreshToken: () => string | null;
6
+ onSessionRefreshed: (accessToken: string, refreshToken?: string) => void;
7
+ onAuthError: () => void;
5
8
  chakraProviderProps: Omit<ChakraProviderProps, "children">;
6
9
  }
7
10
  export declare const QuantumLibraryProvider: React.FC<React.PropsWithChildren<QuantumLibraryProviderProps>>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./react-jsx-runtime-vendor-Dszzpdy0.cjs"),o=require("./graphql-kPu5QxaL.cjs"),s=require("react"),l=require("urql"),m=require("@chakra-ui/react"),v=require("./hooks.cjs"),c=require("./generated.cjs"),d=s.createContext(void 0),x=({children:n})=>{const[{data:t,fetching:e}]=l.useQuery({query:o.GET_METADATA_BY_KEY,variables:{key:"ui_label"}}),r=s.useCallback(b=>{if(e)return"Loading...";const u=c.getFragmentData(o.METADATA_GROUP_FRAGMENT,t?.getMetadataByKey);return u?c.getFragmentData(o.METADATA_ITEM_FRAGMENT,u.data).find(g=>g.value===b)?.label??"":""},[t,e]),i=s.useMemo(()=>({getLabel:r,isLoading:e}),[r,e]);return a.jsxRuntimeExports.jsx(d.Provider,{value:i,children:n})},E=({children:n,url:t,getAuthToken:e,chakraProviderProps:r})=>{const i=v.useGraphqlClient({url:t,getAuthToken:e});return a.jsxRuntimeExports.jsx(l.Provider,{value:i,children:a.jsxRuntimeExports.jsx(m.ChakraProvider,{...r,children:a.jsxRuntimeExports.jsx(x,{children:n})})})};exports.QuantumLibraryProvider=E;exports.UiLabelContext=d;exports.UiLabelProvider=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./react-jsx-runtime-vendor-Dszzpdy0.cjs"),u=require("./graphql-kPu5QxaL.cjs"),c=require("react"),x=require("urql"),v=require("@chakra-ui/react"),E=require("./hooks.cjs"),d=require("./generated.cjs"),b=c.createContext(void 0),g=({children:i})=>{const[{data:t,fetching:e}]=x.useQuery({query:u.GET_METADATA_BY_KEY,variables:{key:"ui_label"}}),r=c.useCallback(s=>{if(e)return"Loading...";const a=d.getFragmentData(u.METADATA_GROUP_FRAGMENT,t?.getMetadataByKey);return a?d.getFragmentData(u.METADATA_ITEM_FRAGMENT,a.data).find(m=>m.value===s)?.label??"":""},[t,e]),o=c.useMemo(()=>({getLabel:r,isLoading:e}),[r,e]);return n.jsxRuntimeExports.jsx(b.Provider,{value:o,children:i})},q=({children:i,url:t,getAuthToken:e,getRefreshToken:r,onSessionRefreshed:o,onAuthError:s,chakraProviderProps:a})=>{const l=E.useGraphqlClient({url:t,getAuthToken:e,getRefreshToken:r,onSessionRefreshed:o,onAuthError:s});return n.jsxRuntimeExports.jsx(x.Provider,{value:l,children:n.jsxRuntimeExports.jsx(v.ChakraProvider,{...a,children:n.jsxRuntimeExports.jsx(g,{children:i})})})};exports.QuantumLibraryProvider=q;exports.UiLabelContext=b;exports.UiLabelProvider=g;
package/dist/providers.js CHANGED
@@ -1,44 +1,44 @@
1
- import { j as a } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
- import { G as u, M as d, a as c } from "./graphql-DAkuEEbq.js";
3
- import { createContext as f, useCallback as p, useMemo as A } from "react";
4
- import { useQuery as v, Provider as x } from "urql";
5
- import { ChakraProvider as T } from "@chakra-ui/react";
6
- import { useGraphqlClient as E } from "./hooks.js";
7
- import { getFragmentData as s } from "./generated.js";
8
- const M = f(
1
+ import { j as o } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
+ import { G as d, M as c, a as f } from "./graphql-DAkuEEbq.js";
3
+ import { createContext as p, useCallback as A, useMemo as v } from "react";
4
+ import { useQuery as x, Provider as T } from "urql";
5
+ import { ChakraProvider as E } from "@chakra-ui/react";
6
+ import { useGraphqlClient as M } from "./hooks.js";
7
+ import { getFragmentData as l } from "./generated.js";
8
+ const b = p(
9
9
  void 0
10
- ), b = ({ children: o }) => {
11
- const [{ data: t, fetching: e }] = v({
12
- query: u,
10
+ ), _ = ({ children: i }) => {
11
+ const [{ data: t, fetching: e }] = x({
12
+ query: d,
13
13
  variables: { key: "ui_label" }
14
- }), r = p(
15
- (m) => {
14
+ }), r = A(
15
+ (s) => {
16
16
  if (e)
17
17
  return "Loading...";
18
- const n = s(
19
- d,
18
+ const a = l(
19
+ c,
20
20
  t?.getMetadataByKey
21
21
  );
22
- return n ? s(
23
- c,
24
- n.data
25
- ).find((l) => l.value === m)?.label ?? "" : "";
22
+ return a ? l(
23
+ f,
24
+ a.data
25
+ ).find((u) => u.value === s)?.label ?? "" : "";
26
26
  },
27
27
  [t, e]
28
- ), i = A(
28
+ ), n = v(
29
29
  () => ({
30
30
  getLabel: r,
31
31
  isLoading: e
32
32
  }),
33
33
  [r, e]
34
34
  );
35
- return /* @__PURE__ */ a.jsx(M.Provider, { value: i, children: o });
36
- }, C = ({ children: o, url: t, getAuthToken: e, chakraProviderProps: r }) => {
37
- const i = E({ url: t, getAuthToken: e });
38
- return /* @__PURE__ */ a.jsx(x, { value: i, children: /* @__PURE__ */ a.jsx(T, { ...r, children: /* @__PURE__ */ a.jsx(b, { children: o }) }) });
35
+ return /* @__PURE__ */ o.jsx(b.Provider, { value: n, children: i });
36
+ }, C = ({ children: i, url: t, getAuthToken: e, getRefreshToken: r, onSessionRefreshed: n, onAuthError: s, chakraProviderProps: a }) => {
37
+ const m = M({ url: t, getAuthToken: e, getRefreshToken: r, onSessionRefreshed: n, onAuthError: s });
38
+ return /* @__PURE__ */ o.jsx(T, { value: m, children: /* @__PURE__ */ o.jsx(E, { ...a, children: /* @__PURE__ */ o.jsx(_, { children: i }) }) });
39
39
  };
40
40
  export {
41
41
  C as QuantumLibraryProvider,
42
- M as UiLabelContext,
43
- b as UiLabelProvider
42
+ b as UiLabelContext,
43
+ _ as UiLabelProvider
44
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quantum-component-library",
3
- "version": "1.4.65",
3
+ "version": "1.4.66",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.cjs",