quantum-component-library 1.4.68 → 1.4.69

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/index.js CHANGED
@@ -1,149 +1,150 @@
1
1
  import "./other-CPHWCRXi.js";
2
2
  import { ActivityList as s, CopyActivityForm as o, CopyModuleForm as i, ModuleForm as r, ParameterEditList as n, ParameterEditSelect as m, UpsertActivityForm as l, UpsertModuleForm as g } from "./components.js";
3
- import { useAllPartParameters as p, useGraphqlClient as b, useJointsForLimbIds as c, useJointsForSensorLocations as A, useLimbsForSensorLocations as T, usePartOptionsForJoints as u, usePartOptionsForLimbs as P, usePartOptionsForSensorLocations as S, useUiLabelContext as h } from "./hooks.js";
4
- import { QuantumLibraryProvider as y, UiLabelContext as F, UiLabelProvider as N } from "./providers.js";
5
- import { g as v, m as f, a as x } from "./services-action-CfZFwhy-.js";
6
- import { n as D, j as k, m as E, u as U, t as M, U as C, s as O, w as R, v as j, J as H, O as W, i as z, l as B, h as K, k as q, Q as V, P as w, x as G, b as Q, a as X, T as Y, R as Z, d as _, W as $, V as ee, e as ae, L as te, K as se, y as oe, c as ie, g as re, S as ne, f as me, M as le, N as ge, D as de, G as pe, F as be, E as ce, q as Ae, r as Te, p as ue, o as Pe, B as Se, C as he, H as Le, z as ye, A as Fe, I as Ne } from "./services-human-D5IllQkM.js";
7
- import { reportKindName as ve } from "./services.js";
8
- import { AngleDataSource as xe, analysisStatBuilder as Ie, areThresholdsEmpty as De, availablePlanes as ke, axes as Ee, canBeVerticalForce as Ue, dimensionName as Me, dimensionToLegacy as Ce, getAnalysisName as Oe, getAnalysisPartIdNoSide as Re, getJointIdNoSide as je, getJointIdWithSide as He, getLimbIdNoSide as We, getLimbIdWithSide as ze, getPointSide as Be, isDeviceEqual as Ke, isLimbTrackingFrame as qe, isSyncError as Ve, jointAngle as we, jointOrLimbHasThreshold as Ge, jointOrLimbThresholdCount as Qe, limbAngle as Xe, mkUnit as Ye, partAndPlaneHasThreshold as Ze, partIdName as _e, partIdToJointLimbId as $e, partIdToString as ea, partKinds as aa, planes as ta, sensorLocationName as sa, sensorLocationToLimbId as oa, thresholdForPart as ia, thresholdFragmentsToThresholds as ra, thresholdsToInput as na, tryMkUnit as ma, updateThreshold as la } from "./types.js";
9
- import { c as da } from "./utils-cn-CgdSr4hO.js";
10
- import { d as ba, n as ca, j as Aa, g as Ta, h as ua, i as Pa, k as Sa, m as ha, a as La, e as ya, c as Fa, b as Na, p as Ja, r as va, s as fa, l as xa, f as Ia } from "./utils-conversion-BQfLNP0g.js";
11
- import { m as ka } from "./utils-memo-DtXdOqCT.js";
12
- import { p as Ua, a as Ma, t as Ca, b as Oa } from "./utils-parameters-DkefNhWo.js";
13
- import { c as ja, p as Ha } from "./utils-text-CN3zLiZ7.js";
3
+ import { refreshSession as p, useAllPartParameters as b, useGraphqlClient as c, useJointsForLimbIds as A, useJointsForSensorLocations as T, useLimbsForSensorLocations as u, usePartOptionsForJoints as P, usePartOptionsForLimbs as S, usePartOptionsForSensorLocations as h, useUiLabelContext as L } from "./hooks.js";
4
+ import { QuantumLibraryProvider as F, UiLabelContext as N, UiLabelProvider as J } from "./providers.js";
5
+ import { g as f, m as x, a as I } from "./services-action-CfZFwhy-.js";
6
+ import { n as k, j as E, m as U, u as M, t as C, U as O, s as R, w as j, v as H, J as W, O as z, i as B, l as K, h as q, k as V, Q as w, P as G, x as Q, b as X, a as Y, T as Z, R as _, d as $, W as ee, V as ae, e as te, L as se, K as oe, y as ie, c as re, g as ne, S as me, f as le, M as ge, N as de, D as pe, G as be, F as ce, E as Ae, q as Te, r as ue, p as Pe, o as Se, B as he, C as Le, H as ye, z as Fe, A as Ne, I as Je } from "./services-human-D5IllQkM.js";
7
+ import { reportKindName as fe } from "./services.js";
8
+ import { AngleDataSource as Ie, analysisStatBuilder as De, areThresholdsEmpty as ke, availablePlanes as Ee, axes as Ue, canBeVerticalForce as Me, dimensionName as Ce, dimensionToLegacy as Oe, getAnalysisName as Re, getAnalysisPartIdNoSide as je, getJointIdNoSide as He, getJointIdWithSide as We, getLimbIdNoSide as ze, getLimbIdWithSide as Be, getPointSide as Ke, isDeviceEqual as qe, isLimbTrackingFrame as Ve, isSyncError as we, jointAngle as Ge, jointOrLimbHasThreshold as Qe, jointOrLimbThresholdCount as Xe, limbAngle as Ye, mkUnit as Ze, partAndPlaneHasThreshold as _e, partIdName as $e, partIdToJointLimbId as ea, partIdToString as aa, partKinds as ta, planes as sa, sensorLocationName as oa, sensorLocationToLimbId as ia, thresholdForPart as ra, thresholdFragmentsToThresholds as na, thresholdsToInput as ma, tryMkUnit as la, updateThreshold as ga } from "./types.js";
9
+ import { c as pa } from "./utils-cn-CgdSr4hO.js";
10
+ import { d as ca, n as Aa, j as Ta, g as ua, h as Pa, i as Sa, k as ha, m as La, a as ya, e as Fa, c as Na, b as Ja, p as va, r as fa, s as xa, l as Ia, f as Da } from "./utils-conversion-BQfLNP0g.js";
11
+ import { m as Ea } from "./utils-memo-DtXdOqCT.js";
12
+ import { p as Ma, a as Ca, t as Oa, b as Ra } from "./utils-parameters-DkefNhWo.js";
13
+ import { c as Ha, p as Wa } from "./utils-text-CN3zLiZ7.js";
14
14
  export {
15
15
  s as ActivityList,
16
- xe as AngleDataSource,
16
+ Ie as AngleDataSource,
17
17
  o as CopyActivityForm,
18
18
  i as CopyModuleForm,
19
19
  r as ModuleForm,
20
20
  n as ParameterEditList,
21
21
  m as ParameterEditSelect,
22
- y as QuantumLibraryProvider,
23
- F as UiLabelContext,
24
- N as UiLabelProvider,
22
+ F as QuantumLibraryProvider,
23
+ N as UiLabelContext,
24
+ J as UiLabelProvider,
25
25
  l as UpsertActivityForm,
26
26
  g as UpsertModuleForm,
27
- Ie as analysisStatBuilder,
28
- De as areThresholdsEmpty,
29
- ke as availablePlanes,
30
- Ee as axes,
31
- Ue as canBeVerticalForce,
32
- ja as capitalizeAll,
33
- da as cn,
34
- ba as degToRad,
35
- Me as dimensionName,
36
- Ce as dimensionToLegacy,
37
- v as getActivityKindFromActivityType,
38
- D as getAllAvailableJoints,
39
- k as getAllAvailableLimbs,
40
- E as getAllAvailablePoseJoints,
41
- U as getAllAvailablePoseLimbs,
42
- M as getAllAvailableSensorJoints,
43
- Oe as getAnalysisName,
44
- Re as getAnalysisPartIdNoSide,
45
- C as getAngleDirectionNames,
46
- O as getAvailableLimbsForLimbIds,
47
- R as getAvailablePoseJointsForLimbIds,
48
- j as getAvailableSensorJointsForLimbIds,
49
- H as getAxis,
50
- W as getDefaultAngleSource,
51
- z as getDefaultJointRange,
52
- B as getDefaultLimbRange,
53
- K as getEnabledJointPlanes,
54
- q as getEnabledSegmentPlanes,
55
- ca as getFormatterForParameter,
56
- V as getHumanBodyAngle,
57
- w as getIsDefaultAngleAllowed,
58
- G as getJointAngleDirectionAbbr,
59
- Q as getJointAngleDirectionName,
60
- je as getJointIdNoSide,
61
- He as getJointIdWithSide,
62
- X as getJointNameWithPlane,
63
- Y as getJointOrSegmentNameWithPlane,
64
- Z as getJointPlaneName,
65
- We as getLimbIdNoSide,
66
- ze as getLimbIdWithSide,
67
- _ as getNormativeJointRange,
68
- $ as getParameterAngleDirectionName,
69
- ee as getParameterDirectionNames,
70
- ae as getPartName,
71
- te as getPartNameNoSide,
72
- se as getPlane,
73
- Be as getPointSide,
74
- oe as getSegmentAngleDirectionAbbr,
75
- ie as getSegmentAngleDirectionName,
76
- re as getSegmentNameWithPlane,
77
- ne as getSegmentXyzName,
78
- me as getSuggestedSensorLocations,
79
- le as getTypicalRom,
80
- ge as getTypicalRomSize,
81
- Aa as getUnitFormatted,
82
- Ta as getUnitValueFormatted,
83
- ua as hourMinSecStrToMs,
84
- Pa as inchesToMeters,
85
- de as isAxis,
86
- Ke as isDeviceEqual,
87
- pe as isJoint,
88
- be as isLimb,
89
- qe as isLimbTrackingFrame,
90
- ce as isPlane,
91
- Ve as isSyncError,
92
- we as jointAngle,
93
- Ae as jointNames,
94
- Ge as jointOrLimbHasThreshold,
95
- Qe as jointOrLimbThresholdCount,
96
- Te as jointsUsedByLimbs,
97
- Sa as kgToPounds,
98
- Xe as limbAngle,
99
- ue as limbNames,
100
- Pe as limbsRequiredForJoints,
101
- f as mapActivityTypeEnumToLabel,
102
- x as mapSessionTypeEnumToLabel,
103
- ka as memo,
104
- ha as metersToInches,
105
- Se as mkAccelerationPart,
106
- he as mkAngularVelocityPart,
107
- Le as mkHumanPart,
108
- ye as mkJointPart,
109
- Fe as mkLimbPart,
110
- Ye as mkUnit,
111
- La as msToDurationStr,
112
- ya as msToHourMinSecStr,
113
- Fa as msToPrettyStr,
114
- Na as msToTimestampStr,
115
- Ua as parameterToThreshold,
116
- Ma as parametersToThresholds,
117
- Ze as partAndPlaneHasThreshold,
118
- _e as partIdName,
119
- $e as partIdToJointLimbId,
120
- ea as partIdToString,
121
- aa as partKinds,
122
- Ne as planeOrAxis,
123
- ta as planes,
124
- Ha as pluralize,
125
- Ja as poundsToKg,
126
- va as radToDeg,
127
- ve as reportKindName,
128
- fa as sToTimestampStr,
129
- xa as safelyConvertEnum,
130
- Ia as secondsToTimestampStr,
131
- sa as sensorLocationName,
132
- oa as sensorLocationToLimbId,
133
- ia as thresholdForPart,
134
- ra as thresholdFragmentsToThresholds,
135
- Ca as thresholdToParameter,
136
- na as thresholdsToInput,
137
- Oa as thresholdsToParameters,
138
- ma as tryMkUnit,
139
- la as updateThreshold,
140
- p as useAllPartParameters,
141
- b as useGraphqlClient,
142
- c as useJointsForLimbIds,
143
- A as useJointsForSensorLocations,
144
- T as useLimbsForSensorLocations,
145
- u as usePartOptionsForJoints,
146
- P as usePartOptionsForLimbs,
147
- S as usePartOptionsForSensorLocations,
148
- h as useUiLabelContext
27
+ De as analysisStatBuilder,
28
+ ke as areThresholdsEmpty,
29
+ Ee as availablePlanes,
30
+ Ue as axes,
31
+ Me as canBeVerticalForce,
32
+ Ha as capitalizeAll,
33
+ pa as cn,
34
+ ca as degToRad,
35
+ Ce as dimensionName,
36
+ Oe as dimensionToLegacy,
37
+ f as getActivityKindFromActivityType,
38
+ k as getAllAvailableJoints,
39
+ E as getAllAvailableLimbs,
40
+ U as getAllAvailablePoseJoints,
41
+ M as getAllAvailablePoseLimbs,
42
+ C as getAllAvailableSensorJoints,
43
+ Re as getAnalysisName,
44
+ je as getAnalysisPartIdNoSide,
45
+ O as getAngleDirectionNames,
46
+ R as getAvailableLimbsForLimbIds,
47
+ j as getAvailablePoseJointsForLimbIds,
48
+ H as getAvailableSensorJointsForLimbIds,
49
+ W as getAxis,
50
+ z as getDefaultAngleSource,
51
+ B as getDefaultJointRange,
52
+ K as getDefaultLimbRange,
53
+ q as getEnabledJointPlanes,
54
+ V as getEnabledSegmentPlanes,
55
+ Aa as getFormatterForParameter,
56
+ w as getHumanBodyAngle,
57
+ G as getIsDefaultAngleAllowed,
58
+ Q as getJointAngleDirectionAbbr,
59
+ X as getJointAngleDirectionName,
60
+ He as getJointIdNoSide,
61
+ We as getJointIdWithSide,
62
+ Y as getJointNameWithPlane,
63
+ Z as getJointOrSegmentNameWithPlane,
64
+ _ as getJointPlaneName,
65
+ ze as getLimbIdNoSide,
66
+ Be as getLimbIdWithSide,
67
+ $ as getNormativeJointRange,
68
+ ee as getParameterAngleDirectionName,
69
+ ae as getParameterDirectionNames,
70
+ te as getPartName,
71
+ se as getPartNameNoSide,
72
+ oe as getPlane,
73
+ Ke as getPointSide,
74
+ ie as getSegmentAngleDirectionAbbr,
75
+ re as getSegmentAngleDirectionName,
76
+ ne as getSegmentNameWithPlane,
77
+ me as getSegmentXyzName,
78
+ le as getSuggestedSensorLocations,
79
+ ge as getTypicalRom,
80
+ de as getTypicalRomSize,
81
+ Ta as getUnitFormatted,
82
+ ua as getUnitValueFormatted,
83
+ Pa as hourMinSecStrToMs,
84
+ Sa as inchesToMeters,
85
+ pe as isAxis,
86
+ qe as isDeviceEqual,
87
+ be as isJoint,
88
+ ce as isLimb,
89
+ Ve as isLimbTrackingFrame,
90
+ Ae as isPlane,
91
+ we as isSyncError,
92
+ Ge as jointAngle,
93
+ Te as jointNames,
94
+ Qe as jointOrLimbHasThreshold,
95
+ Xe as jointOrLimbThresholdCount,
96
+ ue as jointsUsedByLimbs,
97
+ ha as kgToPounds,
98
+ Ye as limbAngle,
99
+ Pe as limbNames,
100
+ Se as limbsRequiredForJoints,
101
+ x as mapActivityTypeEnumToLabel,
102
+ I as mapSessionTypeEnumToLabel,
103
+ Ea as memo,
104
+ La as metersToInches,
105
+ he as mkAccelerationPart,
106
+ Le as mkAngularVelocityPart,
107
+ ye as mkHumanPart,
108
+ Fe as mkJointPart,
109
+ Ne as mkLimbPart,
110
+ Ze as mkUnit,
111
+ ya as msToDurationStr,
112
+ Fa as msToHourMinSecStr,
113
+ Na as msToPrettyStr,
114
+ Ja as msToTimestampStr,
115
+ Ma as parameterToThreshold,
116
+ Ca as parametersToThresholds,
117
+ _e as partAndPlaneHasThreshold,
118
+ $e as partIdName,
119
+ ea as partIdToJointLimbId,
120
+ aa as partIdToString,
121
+ ta as partKinds,
122
+ Je as planeOrAxis,
123
+ sa as planes,
124
+ Wa as pluralize,
125
+ va as poundsToKg,
126
+ fa as radToDeg,
127
+ p as refreshSession,
128
+ fe as reportKindName,
129
+ xa as sToTimestampStr,
130
+ Ia as safelyConvertEnum,
131
+ Da as secondsToTimestampStr,
132
+ oa as sensorLocationName,
133
+ ia as sensorLocationToLimbId,
134
+ ra as thresholdForPart,
135
+ na as thresholdFragmentsToThresholds,
136
+ Oa as thresholdToParameter,
137
+ ma as thresholdsToInput,
138
+ Ra as thresholdsToParameters,
139
+ la as tryMkUnit,
140
+ ga as updateThreshold,
141
+ b as useAllPartParameters,
142
+ c as useGraphqlClient,
143
+ A as useJointsForLimbIds,
144
+ T as useJointsForSensorLocations,
145
+ u as useLimbsForSensorLocations,
146
+ P as usePartOptionsForJoints,
147
+ S as usePartOptionsForLimbs,
148
+ h as usePartOptionsForSensorLocations,
149
+ L as useUiLabelContext
149
150
  };
@@ -1,4 +1,24 @@
1
1
  import { Client } from 'urql';
2
+ /**
3
+ * Exchanges the stored refresh token for a fresh pair.
4
+ *
5
+ * Two failures are deliberately treated differently. A rejection from the
6
+ * server means the session is gone and the user must sign in again. Anything
7
+ * else — a dropped connection, a thrown fetch — leaves the session alone: the
8
+ * token was never spent, and the API honours a retry of it for 60 seconds.
9
+ *
10
+ * The retry on rejection covers the two-tab case. Tabs share one session, so
11
+ * whichever tab refreshes first leaves the other holding a token the server has
12
+ * moved past; once the grace window closes, that tab's replay looks like theft
13
+ * and takes the session down for both. Re-reading storage before giving up lets
14
+ * the losing tab pick up the token the winner already stored.
15
+ */
16
+ export declare const refreshSession: ({ mutate, getRefreshToken, onSessionRefreshed, onAuthError, }: {
17
+ mutate: (query: string, variables: object) => Promise<any>;
18
+ getRefreshToken: () => string | null;
19
+ onSessionRefreshed: (accessToken: string, refreshToken?: string) => void;
20
+ onAuthError: () => void;
21
+ }) => Promise<void>;
2
22
  export declare const useGraphqlClient: ({ url, getAuthToken, getRefreshToken, onSessionRefreshed, onAuthError, }: {
3
23
  url: string;
4
24
  getAuthToken: () => string | null;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quantum-component-library",
3
- "version": "1.4.68",
3
+ "version": "1.4.69",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.cjs",
@@ -78,7 +78,9 @@
78
78
  "codegen:qa": "graphql-codegen --config codegen.qa.yml",
79
79
  "codegen:prod": "graphql-codegen --config codegen.prod.yml",
80
80
  "storybook": "storybook dev -p 6006",
81
- "build-storybook": "storybook build"
81
+ "build-storybook": "storybook build",
82
+ "test": "vitest run",
83
+ "test:watch": "vitest"
82
84
  },
83
85
  "dependencies": {
84
86
  "@chakra-ui/react": "^2.10.9",
@@ -128,6 +130,7 @@
128
130
  "typescript-eslint": "^8.39.1",
129
131
  "vite": "^7.1.2",
130
132
  "vite-plugin-dts": "^4.5.4",
131
- "vite-plugin-graphql-codegen": "^3.6.3"
133
+ "vite-plugin-graphql-codegen": "^3.6.3",
134
+ "vitest": "^4.1.10"
132
135
  }
133
136
  }