@vitessce/vit-s 3.8.7 → 3.8.9

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
@@ -32251,7 +32251,7 @@ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
32251
32251
  CoordinationType$1.HIERARCHY_LEVELS
32252
32252
  ]
32253
32253
  });
32254
- const version = "3.8.7";
32254
+ const version = "3.8.9";
32255
32255
  const META_VERSION = {
32256
32256
  version
32257
32257
  };
@@ -44474,7 +44474,7 @@ function useClosestVitessceContainerSize(ref, sidebarWidth) {
44474
44474
  clientHeight: componentHeight,
44475
44475
  clientWidth: componentWidth
44476
44476
  } = ref.current.closest(`.${VITESSCE_CONTAINER}`);
44477
- setWidth(componentWidth - sidebarWidth);
44477
+ setWidth(componentWidth - (sidebarWidth ?? 0));
44478
44478
  setHeight(componentHeight);
44479
44479
  }
44480
44480
  }
@@ -47617,7 +47617,20 @@ class FlatFileSystemStore {
47617
47617
  const buffer = await file.arrayBuffer();
47618
47618
  return new Uint8Array(buffer);
47619
47619
  }
47620
- // TODO: implement getRange
47620
+ async getRange(key, range2) {
47621
+ const file = this.files.find((f2) => `/${f2.relpath}` === key);
47622
+ if (!file) return void 0;
47623
+ const buffer = await file.arrayBuffer();
47624
+ if ("suffixLength" in range2) {
47625
+ const { suffixLength } = range2;
47626
+ return new Uint8Array(buffer, buffer.byteLength - suffixLength, suffixLength);
47627
+ }
47628
+ if ("offset" in range2 && "length" in range2) {
47629
+ const { offset: offset2, length: length2 } = range2;
47630
+ return new Uint8Array(buffer, offset2, length2);
47631
+ }
47632
+ throw new Error("Invalid rangeQuery value.");
47633
+ }
47621
47634
  }
47622
47635
  function createOnDrop(setters, isFileInput = false, isConfigInput = false) {
47623
47636
  return async (e2) => {
package/dist-tsc/hooks.js CHANGED
@@ -148,7 +148,7 @@ export function useClosestVitessceContainerSize(ref, sidebarWidth) {
148
148
  function onWindowResize() {
149
149
  if (ref.current) {
150
150
  const { clientHeight: componentHeight, clientWidth: componentWidth, } = ref.current.closest(`.${VITESSCE_CONTAINER}`);
151
- setWidth(componentWidth - sidebarWidth);
151
+ setWidth(componentWidth - (sidebarWidth ?? 0));
152
152
  setHeight(componentHeight);
153
153
  }
154
154
  }
@@ -1 +1 @@
1
- {"version":3,"file":"on-drop.d.ts","sourceRoot":"","sources":["../src/on-drop.js"],"names":[],"mappings":"AAoEA;;;;;;;;;;GAUG;AACH,sCARG;IAA0B,aAAa;IACb,SAAS;CACnC,gBAAQ,OAAO,kBAEP,OAAO,6BAyHjB"}
1
+ {"version":3,"file":"on-drop.d.ts","sourceRoot":"","sources":["../src/on-drop.js"],"names":[],"mappings":"AAkFA;;;;;;;;;;GAUG;AACH,sCARG;IAA0B,aAAa;IACb,SAAS;CACnC,gBAAQ,OAAO,kBAEP,OAAO,6BAyHjB"}
@@ -14,6 +14,22 @@ class FlatFileSystemStore {
14
14
  const buffer = await file.arrayBuffer();
15
15
  return new Uint8Array(buffer);
16
16
  }
17
+ async getRange(key, range) {
18
+ // The list of files does not prefix its paths with slashes.
19
+ const file = this.files.find(f => `/${f.relpath}` === key);
20
+ if (!file)
21
+ return undefined;
22
+ const buffer = await file.arrayBuffer();
23
+ if ('suffixLength' in range) {
24
+ const { suffixLength } = range;
25
+ return new Uint8Array(buffer, buffer.byteLength - suffixLength, suffixLength);
26
+ }
27
+ if ('offset' in range && 'length' in range) {
28
+ const { offset, length } = range;
29
+ return new Uint8Array(buffer, offset, length);
30
+ }
31
+ throw new Error('Invalid rangeQuery value.');
32
+ }
17
33
  }
18
34
  /*
19
35
  // Get a file handle to a file in a directory.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/vit-s",
3
- "version": "3.8.7",
3
+ "version": "3.8.9",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -30,16 +30,16 @@
30
30
  "react-error-boundary": "^5.0.0",
31
31
  "@placemarkio/flat-drop-files": "^1.0.2",
32
32
  "zarrita": "0.5.4",
33
- "@vitessce/styles": "3.8.7",
34
- "@vitessce/abstract": "3.8.7",
35
- "@vitessce/error": "3.8.7",
36
- "@vitessce/constants-internal": "3.8.7",
37
- "@vitessce/plugins": "3.8.7",
38
- "@vitessce/schemas": "3.8.7",
39
- "@vitessce/utils": "3.8.7",
40
- "@vitessce/sets-utils": "3.8.7",
41
- "@vitessce/config": "3.8.7",
42
- "@vitessce/globals": "3.8.7"
33
+ "@vitessce/styles": "3.8.9",
34
+ "@vitessce/abstract": "3.8.9",
35
+ "@vitessce/error": "3.8.9",
36
+ "@vitessce/constants-internal": "3.8.9",
37
+ "@vitessce/plugins": "3.8.9",
38
+ "@vitessce/schemas": "3.8.9",
39
+ "@vitessce/utils": "3.8.9",
40
+ "@vitessce/sets-utils": "3.8.9",
41
+ "@vitessce/config": "3.8.9",
42
+ "@vitessce/globals": "3.8.9"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@testing-library/jest-dom": "^6.6.3",
@@ -48,7 +48,7 @@
48
48
  "react-dom": "18.3.1",
49
49
  "vite": "^7.0.0",
50
50
  "vitest": "^3.1.4",
51
- "@vitessce/types": "3.8.7"
51
+ "@vitessce/types": "3.8.9"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
package/src/hooks.js CHANGED
@@ -180,7 +180,7 @@ export function useClosestVitessceContainerSize(ref, sidebarWidth) {
180
180
  const {
181
181
  clientHeight: componentHeight, clientWidth: componentWidth,
182
182
  } = ref.current.closest(`.${VITESSCE_CONTAINER}`);
183
- setWidth(componentWidth - sidebarWidth);
183
+ setWidth(componentWidth - (sidebarWidth ?? 0));
184
184
  setHeight(componentHeight);
185
185
  }
186
186
  }
package/src/on-drop.js CHANGED
@@ -17,7 +17,21 @@ class FlatFileSystemStore {
17
17
  return new Uint8Array(buffer);
18
18
  }
19
19
 
20
- // TODO: implement getRange
20
+ async getRange(key, range) {
21
+ // The list of files does not prefix its paths with slashes.
22
+ const file = this.files.find(f => `/${f.relpath}` === key);
23
+ if (!file) return undefined;
24
+ const buffer = await file.arrayBuffer();
25
+ if ('suffixLength' in range) {
26
+ const { suffixLength } = range;
27
+ return new Uint8Array(buffer, buffer.byteLength - suffixLength, suffixLength);
28
+ }
29
+ if ('offset' in range && 'length' in range) {
30
+ const { offset, length } = range;
31
+ return new Uint8Array(buffer, offset, length);
32
+ }
33
+ throw new Error('Invalid rangeQuery value.');
34
+ }
21
35
  }
22
36
 
23
37
  /*