@vitessce/vit-s 3.3.11 → 3.4.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.
@@ -6,10 +6,12 @@ export default class LoaderResult<LoaderDataType extends unknown> {
6
6
  * @param {LoaderDataType} data
7
7
  * @param {object[]|string|null} url Single URL or array of { url, name } objects.
8
8
  * @param {object|null} coordinationValues
9
+ * @param {RequestInit|null} requestInit
9
10
  */
10
- constructor(data: LoaderDataType, url: object[] | string | null, coordinationValues?: object | null);
11
+ constructor(data: LoaderDataType, url: object[] | string | null, coordinationValues?: object | null, requestInit?: RequestInit | null);
11
12
  data: LoaderDataType;
12
13
  url: string | object[] | null;
13
14
  coordinationValues: object | null;
15
+ requestInit: RequestInit | null;
14
16
  }
15
17
  //# sourceMappingURL=LoaderResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoaderResult.d.ts","sourceRoot":"","sources":["../../src/data/LoaderResult.js"],"names":[],"mappings":"AAEA;;GAEG;AACH,kCAEa,cAAc;IADzB;;;;OAIG;IACH,kBAJW,cAAc,OACd,MAAM,EAAE,GAAC,MAAM,GAAC,IAAI,uBACpB,MAAM,GAAC,IAAI,EAMrB;IAHC,qBAAgB;IAChB,8BAAc;IACd,kCAA4C;CAE/C"}
1
+ {"version":3,"file":"LoaderResult.d.ts","sourceRoot":"","sources":["../../src/data/LoaderResult.js"],"names":[],"mappings":"AAEA;;GAEG;AACH,kCAEa,cAAc;IADzB;;;;;OAKG;IACH,kBALW,cAAc,OACd,MAAM,EAAE,GAAC,MAAM,GAAC,IAAI,uBACpB,MAAM,GAAC,IAAI,gBACX,WAAW,GAAC,IAAI,EAO1B;IAJC,qBAAgB;IAChB,8BAAc;IACd,kCAA4C;IAC5C,gCAA8B;CAEjC"}
@@ -7,10 +7,12 @@ export default class LoaderResult {
7
7
  * @param {LoaderDataType} data
8
8
  * @param {object[]|string|null} url Single URL or array of { url, name } objects.
9
9
  * @param {object|null} coordinationValues
10
+ * @param {RequestInit|null} requestInit
10
11
  */
11
- constructor(data, url, coordinationValues = null) {
12
+ constructor(data, url, coordinationValues = null, requestInit = null) {
12
13
  this.data = data;
13
14
  this.url = url;
14
15
  this.coordinationValues = coordinationValues;
16
+ this.requestInit = requestInit;
15
17
  }
16
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"data-hook-utils.d.ts","sourceRoot":"","sources":["../src/data-hook-utils.js"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,4BAFW,mBAAmB,yBAS7B;AAED;;;;;;;;;;GAUG;AACH,8CATW,MAAM,WAGN,MAAM,iBAGN,MAAM,QAiBhB;AAGD,oDAuBC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,uBAkDhB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,gEAyFhB;AAED,+FAGC;oCAnPM,mBAAmB"}
1
+ {"version":3,"file":"data-hook-utils.d.ts","sourceRoot":"","sources":["../src/data-hook-utils.js"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,4BAFW,mBAAmB,yBAS7B;AAED;;;;;;;;;;GAUG;AACH,8CATW,MAAM,WAGN,MAAM,iBAGN,MAAM,QAiBhB;AAGD,oDAuBC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,uBAoDhB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,yDAhBW,MAAM,WAEN,MAAM,cAEN,OAAO,uBAEP,MAAM,6BAGN,MAAM,gEAyFhB;AAED,+FAGC;oCArPM,mBAAmB"}
@@ -53,11 +53,11 @@ export async function dataQueryFn(ctx) {
53
53
  const payload = await loader.load();
54
54
  if (!payload)
55
55
  return placeholderObject; // TODO: throw error instead?
56
- const { data, url, coordinationValues } = payload;
56
+ const { data, url, requestInit, coordinationValues } = payload;
57
57
  // Status: success
58
58
  // Array of objects like { url, name }.
59
59
  const urls = (Array.isArray(url) ? url : [{ url, name: dataType }]).filter(d => d.url);
60
- return { data, coordinationValues, urls };
60
+ return { data, coordinationValues, urls, requestInit };
61
61
  }
62
62
  // No loader was found.
63
63
  if (isRequired) {
@@ -112,6 +112,7 @@ export function useDataType(dataType, loaders, dataset, isRequired, coordination
112
112
  const loadedData = data?.data || placeholderObject;
113
113
  const coordinationValues = data?.coordinationValues;
114
114
  const urls = data?.urls;
115
+ const requestInit = data?.requestInit;
115
116
  useEffect(() => {
116
117
  initCoordinationSpace(coordinationValues, coordinationSetters, initialCoordinationValues);
117
118
  }, [coordinationValues]);
@@ -121,7 +122,7 @@ export function useDataType(dataType, loaders, dataset, isRequired, coordination
121
122
  }
122
123
  }, [error, setWarning]);
123
124
  const dataStatus = isFetching ? STATUS.LOADING : status;
124
- return [loadedData, dataStatus, urls];
125
+ return [loadedData, dataStatus, urls, requestInit];
125
126
  }
126
127
  /**
127
128
  * Get data from a cells data type loader,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/vit-s",
3
- "version": "3.3.11",
3
+ "version": "3.4.0",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -29,11 +29,11 @@
29
29
  "uuid": "^9.0.0",
30
30
  "zustand": "^3.5.10",
31
31
  "react-aria": "^3.28.0",
32
- "@vitessce/constants-internal": "3.3.11",
33
- "@vitessce/plugins": "3.3.11",
34
- "@vitessce/schemas": "3.3.11",
35
- "@vitessce/utils": "3.3.11",
36
- "@vitessce/config": "3.3.11"
32
+ "@vitessce/constants-internal": "3.4.0",
33
+ "@vitessce/schemas": "3.4.0",
34
+ "@vitessce/plugins": "3.4.0",
35
+ "@vitessce/utils": "3.4.0",
36
+ "@vitessce/config": "3.4.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@testing-library/jest-dom": "^5.16.4",
@@ -41,7 +41,7 @@
41
41
  "react": "^18.0.0",
42
42
  "vite": "^4.3.0",
43
43
  "vitest": "^0.32.2",
44
- "@vitessce/types": "3.3.11"
44
+ "@vitessce/types": "3.4.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
@@ -8,10 +8,12 @@ export default class LoaderResult {
8
8
  * @param {LoaderDataType} data
9
9
  * @param {object[]|string|null} url Single URL or array of { url, name } objects.
10
10
  * @param {object|null} coordinationValues
11
+ * @param {RequestInit|null} requestInit
11
12
  */
12
- constructor(data, url, coordinationValues = null) {
13
+ constructor(data, url, coordinationValues = null, requestInit = null) {
13
14
  this.data = data;
14
15
  this.url = url;
15
16
  this.coordinationValues = coordinationValues;
17
+ this.requestInit = requestInit;
16
18
  }
17
19
  }
@@ -66,11 +66,11 @@ export async function dataQueryFn(ctx) {
66
66
  // TODO: can cacheing logic be removed from all loaders?
67
67
  const payload = await loader.load();
68
68
  if (!payload) return placeholderObject; // TODO: throw error instead?
69
- const { data, url, coordinationValues } = payload;
69
+ const { data, url, requestInit, coordinationValues } = payload;
70
70
  // Status: success
71
71
  // Array of objects like { url, name }.
72
72
  const urls = (Array.isArray(url) ? url : [{ url, name: dataType }]).filter(d => d.url);
73
- return { data, coordinationValues, urls };
73
+ return { data, coordinationValues, urls, requestInit };
74
74
  }
75
75
  // No loader was found.
76
76
  if (isRequired) {
@@ -129,6 +129,8 @@ export function useDataType(
129
129
 
130
130
  const coordinationValues = data?.coordinationValues;
131
131
  const urls = data?.urls;
132
+ const requestInit = data?.requestInit;
133
+
132
134
 
133
135
  useEffect(() => {
134
136
  initCoordinationSpace(
@@ -145,7 +147,7 @@ export function useDataType(
145
147
  }, [error, setWarning]);
146
148
 
147
149
  const dataStatus = isFetching ? STATUS.LOADING : status;
148
- return [loadedData, dataStatus, urls];
150
+ return [loadedData, dataStatus, urls, requestInit];
149
151
  }
150
152
 
151
153
  /**