@geode/opengeodeweb-front 10.36.0-rc.1 → 10.36.0-rc.2

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,6 @@
1
+ // Decodes a base64 string (the back's binary_light_viewable) into raw bytes for vtk.js readers.
2
+ // Uint8Array.fromBase64 would do this natively but is unavailable in Node 22, which runs the tests.
3
+ export function base64ToArrayBuffer(b64: string): ArrayBuffer {
4
+ // Atob returns a "binary string": one char per byte, so each code point is the byte value.
5
+ return Uint8Array.from(atob(b64), (char) => char.codePointAt(0) ?? 0).buffer;
6
+ }
@@ -1,6 +1,7 @@
1
1
  import type { HybridDb, vtkActor as VtkActorInstance } from "./vtk_types";
2
2
  import { requireRenderWindow, useHybridViewerCore } from "./core";
3
3
  import { ACTOR_COLOR } from "./constants";
4
+ import { base64ToArrayBuffer } from "./base64";
4
5
  import { useDataStore } from "@ogw_front/stores/data";
5
6
  import { useViewerStore } from "@ogw_front/stores/viewer";
6
7
  import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
@@ -25,8 +26,11 @@ const useHybridViewerScene = createSharedComposable(() => {
25
26
  return;
26
27
  }
27
28
  const value = await dataStore.item(id);
29
+ if (value.binary_light_viewable === undefined) {
30
+ return;
31
+ }
28
32
  const reader = vtkXMLPolyDataReader();
29
- reader.parseAsArrayBuffer(new TextEncoder().encode(value.binary_light_viewable).buffer);
33
+ reader.parseAsArrayBuffer(base64ToArrayBuffer(value.binary_light_viewable));
30
34
  const actor = vtkActor();
31
35
  const mapper = vtkMapper();
32
36
  // oxlint-disable-next-line no-unsafe-type-assertion -- vtk.js's algorithm interface types getOutputData as `any`; this reader always produces polydata.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.36.0-rc.1",
3
+ "version": "10.36.0-rc.2",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {