@walkthru-earth/objex 1.3.1 → 1.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.
Files changed (184) hide show
  1. package/LICENSE +5 -0
  2. package/README.md +20 -12
  3. package/dist/components/browser/FileTreeSidebar.svelte +32 -17
  4. package/dist/components/layout/AboutSheet.svelte +5 -2
  5. package/dist/components/layout/ConnectionDialog.svelte +1 -1
  6. package/dist/components/layout/SettingsSheet.svelte +237 -0
  7. package/dist/components/layout/SettingsSheet.svelte.d.ts +6 -0
  8. package/dist/components/layout/Sidebar.svelte +73 -6
  9. package/dist/components/layout/Sidebar.svelte.d.ts +4 -1
  10. package/dist/components/layout/StatusBar.svelte +1 -1
  11. package/dist/components/layout/TabBar.svelte +2 -2
  12. package/dist/components/ui/context-menu/context-menu-radio-group.svelte.d.ts +1 -1
  13. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte.d.ts +1 -1
  14. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +1 -1
  15. package/dist/components/ui/input/input.svelte.d.ts +1 -1
  16. package/dist/components/ui/resizable/index.d.ts +1 -1
  17. package/dist/components/ui/resizable/index.js +2 -2
  18. package/dist/components/ui/slider/index.d.ts +3 -0
  19. package/dist/components/ui/slider/index.js +5 -0
  20. package/dist/components/ui/slider/range-slider.svelte +94 -0
  21. package/dist/components/ui/slider/range-slider.svelte.d.ts +21 -0
  22. package/dist/components/ui/slider/slider.svelte +83 -0
  23. package/dist/components/ui/slider/slider.svelte.d.ts +7 -0
  24. package/dist/components/viewers/ArchiveViewer.svelte +2 -2
  25. package/dist/components/viewers/CodeViewer.svelte +31 -22
  26. package/dist/components/viewers/CogControls.svelte +338 -184
  27. package/dist/components/viewers/CogControls.svelte.d.ts +33 -10
  28. package/dist/components/viewers/CogViewer.svelte +263 -112
  29. package/dist/components/viewers/CopcViewer.svelte +1 -1
  30. package/dist/components/viewers/FlatGeobufViewer.svelte +1 -1
  31. package/dist/components/viewers/GeoParquetMapViewer.svelte +6 -6
  32. package/dist/components/viewers/GeoParquetMapViewer.svelte.d.ts +1 -1
  33. package/dist/components/viewers/ImageViewer.svelte +2 -2
  34. package/dist/components/viewers/MarkdownViewer.svelte +12 -9
  35. package/dist/components/viewers/MediaViewer.svelte +2 -2
  36. package/dist/components/viewers/ModelViewer.svelte +1 -1
  37. package/dist/components/viewers/MultiCogViewer.svelte +467 -102
  38. package/dist/components/viewers/MultiCogViewer.svelte.d.ts +1 -1
  39. package/dist/components/viewers/NotebookViewer.svelte +6 -3
  40. package/dist/components/viewers/PdfViewer.svelte +2 -2
  41. package/dist/components/viewers/PmtilesViewer.svelte +3 -6
  42. package/dist/components/viewers/RawViewer.svelte +6 -3
  43. package/dist/components/viewers/StacMapViewer.svelte +1 -1
  44. package/dist/components/viewers/StacMosaicViewer.svelte +1760 -408
  45. package/dist/components/viewers/StacMosaicViewer.svelte.d.ts +1 -1
  46. package/dist/components/viewers/StacTabViewer.svelte +24 -13
  47. package/dist/components/viewers/StacTabViewer.svelte.d.ts +1 -1
  48. package/dist/components/viewers/TableGrid.svelte +4 -4
  49. package/dist/components/viewers/TableStatusBar.svelte +1 -1
  50. package/dist/components/viewers/TableToolbar.svelte +1 -1
  51. package/dist/components/viewers/TableViewer.svelte +25 -17
  52. package/dist/components/viewers/TableViewer.svelte.d.ts +1 -0
  53. package/dist/components/viewers/ViewerRouter.svelte +16 -8
  54. package/dist/components/viewers/ZarrMapViewer.svelte +11 -9
  55. package/dist/components/viewers/ZarrViewer.svelte +4 -4
  56. package/dist/components/viewers/cog/ChannelPicker.svelte +83 -0
  57. package/dist/components/viewers/cog/ChannelPicker.svelte.d.ts +13 -0
  58. package/dist/components/viewers/cog/PixelInspectorPanel.svelte +87 -0
  59. package/dist/components/viewers/cog/PixelInspectorPanel.svelte.d.ts +17 -0
  60. package/dist/components/viewers/cog/buildRgbLayer.d.ts +78 -0
  61. package/dist/components/viewers/cog/buildRgbLayer.js +176 -0
  62. package/dist/components/viewers/map/AttributeTable.svelte +1 -1
  63. package/dist/components/viewers/map/MapContainer.svelte +37 -11
  64. package/dist/components/viewers/pmtiles/PmtilesArchiveView.svelte +1 -1
  65. package/dist/components/viewers/pmtiles/PmtilesTileInspector.svelte +1 -1
  66. package/dist/components/viewers/stac/StacDatetimeBar.svelte +175 -0
  67. package/dist/components/viewers/stac/StacDatetimeBar.svelte.d.ts +10 -0
  68. package/dist/components/viewers/stac/StacFilterPanel.svelte +243 -0
  69. package/dist/components/viewers/stac/StacFilterPanel.svelte.d.ts +14 -0
  70. package/dist/components/viewers/stac/StacItemInspector.svelte +223 -0
  71. package/dist/components/viewers/stac/StacItemInspector.svelte.d.ts +10 -0
  72. package/dist/components/viewers/stac/StacItemStrip.svelte +228 -0
  73. package/dist/components/viewers/stac/StacItemStrip.svelte.d.ts +12 -0
  74. package/dist/file-icons/index.d.ts +1 -1
  75. package/dist/file-icons/index.js +1 -1
  76. package/dist/i18n/ar.js +110 -2
  77. package/dist/i18n/en.js +110 -2
  78. package/dist/index.d.ts +2 -28
  79. package/dist/index.js +7 -23
  80. package/dist/query/engine.d.ts +10 -0
  81. package/dist/query/source.js +1 -1
  82. package/dist/query/stac-source-factory.d.ts +65 -0
  83. package/dist/query/stac-source-factory.js +77 -0
  84. package/dist/query/stac-source-parquet.d.ts +135 -0
  85. package/dist/query/stac-source-parquet.js +465 -0
  86. package/dist/query/wasm.d.ts +8 -0
  87. package/dist/query/wasm.js +304 -2
  88. package/dist/storage/presign.js +1 -1
  89. package/dist/storage/providers.js +5 -5
  90. package/dist/stores/config.svelte.d.ts +15 -0
  91. package/dist/stores/config.svelte.js +46 -0
  92. package/dist/stores/connections.svelte.d.ts +2 -2
  93. package/dist/stores/connections.svelte.js +1 -2
  94. package/dist/stores/files.svelte.d.ts +1 -1
  95. package/dist/stores/files.svelte.js +1 -1
  96. package/dist/stores/query-history.svelte.js +1 -1
  97. package/dist/stores/settings.svelte.d.ts +16 -1
  98. package/dist/stores/settings.svelte.js +104 -48
  99. package/dist/stores/tabs.svelte.d.ts +3 -0
  100. package/dist/stores/tabs.svelte.js +17 -0
  101. package/dist/utils/cog-histogram.d.ts +121 -0
  102. package/dist/utils/cog-histogram.js +424 -0
  103. package/dist/utils/cog.d.ts +177 -20
  104. package/dist/utils/cog.js +361 -76
  105. package/dist/utils/colormap-sprite.d.ts +0 -9
  106. package/dist/utils/colormap-sprite.js +0 -21
  107. package/dist/utils/deck.d.ts +16 -12
  108. package/dist/utils/deck.js +10 -4
  109. package/dist/utils/pmtiles-tile.js +2 -2
  110. package/dist/utils/{url.d.ts → signed-url.d.ts} +15 -1
  111. package/dist/utils/{url.js → signed-url.js} +32 -10
  112. package/dist/utils/url-state.d.ts +36 -0
  113. package/dist/utils/url-state.js +72 -2
  114. package/dist/utils/zarr-tab.d.ts +1 -2
  115. package/dist/utils/zarr-tab.js +1 -2
  116. package/dist/utils/zarr.d.ts +0 -17
  117. package/dist/utils/zarr.js +1 -45
  118. package/package.json +55 -84
  119. package/dist/components/browser/Breadcrumb.svelte +0 -50
  120. package/dist/components/browser/Breadcrumb.svelte.d.ts +0 -7
  121. package/dist/components/browser/CreateFolderDialog.svelte +0 -98
  122. package/dist/components/browser/CreateFolderDialog.svelte.d.ts +0 -6
  123. package/dist/components/browser/DeleteConfirmDialog.svelte +0 -90
  124. package/dist/components/browser/DeleteConfirmDialog.svelte.d.ts +0 -8
  125. package/dist/components/browser/DropZone.svelte +0 -83
  126. package/dist/components/browser/DropZone.svelte.d.ts +0 -7
  127. package/dist/components/browser/FileBrowser.svelte +0 -252
  128. package/dist/components/browser/FileBrowser.svelte.d.ts +0 -3
  129. package/dist/components/browser/FileRow.svelte +0 -117
  130. package/dist/components/browser/FileRow.svelte.d.ts +0 -9
  131. package/dist/components/browser/RenameDialog.svelte +0 -101
  132. package/dist/components/browser/RenameDialog.svelte.d.ts +0 -8
  133. package/dist/components/browser/SearchBar.svelte +0 -40
  134. package/dist/components/browser/SearchBar.svelte.d.ts +0 -6
  135. package/dist/components/browser/UploadButton.svelte +0 -65
  136. package/dist/components/browser/UploadButton.svelte.d.ts +0 -3
  137. package/dist/query/stac-geoparquet.d.ts +0 -31
  138. package/dist/query/stac-geoparquet.js +0 -136
  139. package/dist/utils/clipboard.d.ts +0 -13
  140. package/dist/utils/clipboard.js +0 -38
  141. package/dist/utils/cloud-url.d.ts +0 -27
  142. package/dist/utils/cloud-url.js +0 -61
  143. package/dist/utils/cog-pure.d.ts +0 -25
  144. package/dist/utils/cog-pure.js +0 -35
  145. package/dist/utils/column-types.d.ts +0 -5
  146. package/dist/utils/column-types.js +0 -137
  147. package/dist/utils/connection-identity.d.ts +0 -51
  148. package/dist/utils/connection-identity.js +0 -97
  149. package/dist/utils/error.d.ts +0 -8
  150. package/dist/utils/error.js +0 -12
  151. package/dist/utils/evidence-context.d.ts +0 -22
  152. package/dist/utils/evidence-context.js +0 -56
  153. package/dist/utils/export.d.ts +0 -22
  154. package/dist/utils/export.js +0 -76
  155. package/dist/utils/file-sort.d.ts +0 -20
  156. package/dist/utils/file-sort.js +0 -41
  157. package/dist/utils/format.d.ts +0 -24
  158. package/dist/utils/format.js +0 -78
  159. package/dist/utils/geoarrow.d.ts +0 -32
  160. package/dist/utils/geoarrow.js +0 -672
  161. package/dist/utils/geometry-type.d.ts +0 -52
  162. package/dist/utils/geometry-type.js +0 -76
  163. package/dist/utils/hex.d.ts +0 -10
  164. package/dist/utils/hex.js +0 -27
  165. package/dist/utils/host-detection.d.ts +0 -23
  166. package/dist/utils/host-detection.js +0 -95
  167. package/dist/utils/local-storage.d.ts +0 -16
  168. package/dist/utils/local-storage.js +0 -37
  169. package/dist/utils/markdown-sql.d.ts +0 -30
  170. package/dist/utils/markdown-sql.js +0 -72
  171. package/dist/utils/notebook.d.ts +0 -59
  172. package/dist/utils/notebook.js +0 -211
  173. package/dist/utils/parquet-metadata.d.ts +0 -64
  174. package/dist/utils/parquet-metadata.js +0 -262
  175. package/dist/utils/stac-geoparquet.d.ts +0 -90
  176. package/dist/utils/stac-geoparquet.js +0 -223
  177. package/dist/utils/stac-hydrate.d.ts +0 -38
  178. package/dist/utils/stac-hydrate.js +0 -243
  179. package/dist/utils/stac.d.ts +0 -136
  180. package/dist/utils/stac.js +0 -176
  181. package/dist/utils/storage-url.d.ts +0 -90
  182. package/dist/utils/storage-url.js +0 -568
  183. package/dist/utils/wkb.d.ts +0 -43
  184. package/dist/utils/wkb.js +0 -359
@@ -4,7 +4,7 @@
4
4
  * - GeoJSON overlay: used by FlatGeobufViewer
5
5
  * - GeoArrow overlay: used by GeoParquetMapViewer (zero-copy DuckDB → GPU pipeline)
6
6
  */
7
- import type { GeoArrowResult } from './geoarrow.js';
7
+ import type { GeoArrowResult } from '@walkthru-earth/objex-utils';
8
8
  /**
9
9
  * Create an onHover callback that toggles the cursor on the MapLibre canvas.
10
10
  * With `interleaved: false`, deck.gl's own canvas has pointer-events: none,
@@ -35,17 +35,21 @@ export declare function loadDeckModules(): Promise<{
35
35
  }>;
36
36
  /** Lazy-load GeoArrow deck.gl layers + MapboxOverlay + GeoJsonLayer (for selection). */
37
37
  export declare function loadGeoArrowModules(): Promise<{
38
- GeoArrowArcLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowArcLayer;
39
- GeoArrowColumnLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowColumnLayer;
40
- _GeoArrowH3HexagonLayer: typeof import("@geoarrow/deck.gl-layers")._GeoArrowH3HexagonLayer;
41
- GeoArrowHeatmapLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowHeatmapLayer;
42
- GeoArrowPathLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowPathLayer;
43
- GeoArrowPointCloudLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowPointCloudLayer;
44
- GeoArrowPolygonLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowPolygonLayer;
45
- GeoArrowScatterplotLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowScatterplotLayer;
46
- GeoArrowSolidPolygonLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowSolidPolygonLayer;
47
- _GeoArrowTextLayer: typeof import("@geoarrow/deck.gl-layers")._GeoArrowTextLayer;
48
- GeoArrowTripsLayer: typeof import("@geoarrow/deck.gl-layers").GeoArrowTripsLayer;
38
+ GeoArrowA5Layer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowA5Layer;
39
+ GeoArrowArcLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowArcLayer;
40
+ GeoArrowColumnLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowColumnLayer;
41
+ GeoArrowGeohashLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowGeohashLayer;
42
+ GeoArrowH3HexagonLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowH3HexagonLayer;
43
+ GeoArrowHeatmapLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowHeatmapLayer;
44
+ GeoArrowPathLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowPathLayer;
45
+ GeoArrowPointCloudLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowPointCloudLayer;
46
+ GeoArrowPolygonLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowPolygonLayer;
47
+ GeoArrowS2Layer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowS2Layer;
48
+ GeoArrowScatterplotLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowScatterplotLayer;
49
+ GeoArrowSolidPolygonLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowSolidPolygonLayer;
50
+ initEarcutPool: typeof import("@geoarrow/deck.gl-geoarrow").initEarcutPool;
51
+ _GeoArrowTextLayer: typeof import("@geoarrow/deck.gl-geoarrow")._GeoArrowTextLayer;
52
+ GeoArrowTripsLayer: typeof import("@geoarrow/deck.gl-geoarrow").GeoArrowTripsLayer;
49
53
  MapboxOverlay: typeof import("@deck.gl/mapbox").MapboxOverlay;
50
54
  GeoJsonLayer: typeof import("@deck.gl/layers").GeoJsonLayer;
51
55
  }>;
@@ -51,7 +51,7 @@ export async function loadDeckModules() {
51
51
  export async function loadGeoArrowModules() {
52
52
  const [{ MapboxOverlay }, geoarrowLayers, { GeoJsonLayer }] = await Promise.all([
53
53
  import('@deck.gl/mapbox'),
54
- import('@geoarrow/deck.gl-layers'),
54
+ import('@geoarrow/deck.gl-geoarrow'),
55
55
  import('@deck.gl/layers')
56
56
  ]);
57
57
  return { MapboxOverlay, GeoJsonLayer, ...geoarrowLayers };
@@ -60,6 +60,12 @@ export async function loadGeoArrowModules() {
60
60
  function createLayerForResult(modules, result, layerId, onClick, onHover) {
61
61
  const { GeoArrowScatterplotLayer, GeoArrowPathLayer, GeoArrowPolygonLayer } = modules;
62
62
  const { table, geometryType, sourceIndices } = result;
63
+ // @geoarrow/deck.gl-geoarrow 0.4+ takes a single Arrow RecordBatch as `data`,
64
+ // not a Table. buildSingleTable() always assembles one batch per table, so the
65
+ // row index stays 0..N-1 and the sourceIndices click mapping is unaffected.
66
+ const batch = table.batches[0];
67
+ if (!batch)
68
+ return null;
63
69
  const { fill, line } = colorsForType(geometryType);
64
70
  const handleClick = (info) => {
65
71
  if (!onClick)
@@ -71,7 +77,7 @@ function createLayerForResult(modules, result, layerId, onClick, onHover) {
71
77
  if (geometryType === 'point' || geometryType === 'multipoint') {
72
78
  return new GeoArrowScatterplotLayer({
73
79
  id: layerId,
74
- data: table,
80
+ data: batch,
75
81
  getFillColor: fill,
76
82
  getRadius: 6,
77
83
  radiusUnits: 'pixels',
@@ -88,7 +94,7 @@ function createLayerForResult(modules, result, layerId, onClick, onHover) {
88
94
  else if (geometryType === 'linestring' || geometryType === 'multilinestring') {
89
95
  return new GeoArrowPathLayer({
90
96
  id: layerId,
91
- data: table,
97
+ data: batch,
92
98
  getColor: line,
93
99
  getWidth: 2.5,
94
100
  widthUnits: 'pixels',
@@ -104,7 +110,7 @@ function createLayerForResult(modules, result, layerId, onClick, onHover) {
104
110
  else {
105
111
  return new GeoArrowPolygonLayer({
106
112
  id: layerId,
107
- data: table,
113
+ data: batch,
108
114
  getFillColor: fill,
109
115
  getLineColor: line,
110
116
  getLineWidth: 2,
@@ -18,11 +18,11 @@ export async function decodeMvtTile(pmtiles, z, x, y) {
18
18
  const bytes = new Uint8Array(resp.data);
19
19
  const rawSize = bytes.length;
20
20
  // Lazy-load @mapbox/vector-tile + pbf (only when inspector is opened)
21
- const [{ VectorTile }, { default: Pbf }] = await Promise.all([
21
+ const [{ VectorTile }, { PbfReader }] = await Promise.all([
22
22
  import('@mapbox/vector-tile'),
23
23
  import('pbf')
24
24
  ]);
25
- const tile = new VectorTile(new Pbf(bytes));
25
+ const tile = new VectorTile(new PbfReader(bytes));
26
26
  const layers = [];
27
27
  for (const [name, vtLayer] of Object.entries(tile.layers)) {
28
28
  const features = [];
@@ -1,4 +1,18 @@
1
- import type { Tab } from '../types.js';
1
+ import type { Connection, Tab } from '../types.js';
2
+ /**
3
+ * Build an HTTPS URL for a file in a given connection. Provider-aware via
4
+ * `buildProviderBaseUrl` (AWS, GCS, R2, Wasabi, B2, DO, Storj, Contabo, Hetzner,
5
+ * Linode, OVH, MinIO), with the Azure container/blob + SAS special case. This is
6
+ * the single source of truth shared by `buildHttpsUrl` (tab-based) and the
7
+ * FileTreeSidebar "Copy HTTP URL" action, so neither can drift back to a
8
+ * hardcoded AWS fallback for non-AWS providers.
9
+ *
10
+ * @param opts.encode percent-encode each path segment (for copy-to-clipboard).
11
+ * Off by default to preserve the raw streaming-URL behavior viewers rely on.
12
+ */
13
+ export declare function buildHttpsUrlForConnection(conn: Connection, path: string, opts?: {
14
+ encode?: boolean;
15
+ }): string;
2
16
  /**
3
17
  * Build an HTTPS URL for a tab's file.
4
18
  * Works for any viewer that needs an HTTP-accessible URL (COG, PMTiles, Zarr, etc.)
@@ -1,8 +1,38 @@
1
+ import { getNativeScheme, safeDecodeURIComponent } from '@walkthru-earth/objex-utils';
1
2
  import { presignHttpsUrl } from '../storage/presign.js';
2
3
  import { buildProviderBaseUrl, isPubliclyStreamable } from '../storage/providers.js';
3
4
  import { connections } from '../stores/connections.svelte.js';
4
5
  import { credentialStore } from '../stores/credentials.svelte.js';
5
- import { getNativeScheme, safeDecodeURIComponent } from './cloud-url.js';
6
+ /** Percent-encode each path segment, preserving the slashes between them. */
7
+ function encodeKeyPath(key) {
8
+ return key
9
+ .split('/')
10
+ .map((s) => encodeURIComponent(s))
11
+ .join('/');
12
+ }
13
+ /**
14
+ * Build an HTTPS URL for a file in a given connection. Provider-aware via
15
+ * `buildProviderBaseUrl` (AWS, GCS, R2, Wasabi, B2, DO, Storj, Contabo, Hetzner,
16
+ * Linode, OVH, MinIO), with the Azure container/blob + SAS special case. This is
17
+ * the single source of truth shared by `buildHttpsUrl` (tab-based) and the
18
+ * FileTreeSidebar "Copy HTTP URL" action, so neither can drift back to a
19
+ * hardcoded AWS fallback for non-AWS providers.
20
+ *
21
+ * @param opts.encode percent-encode each path segment (for copy-to-clipboard).
22
+ * Off by default to preserve the raw streaming-URL behavior viewers rely on.
23
+ */
24
+ export function buildHttpsUrlForConnection(conn, path, opts) {
25
+ const cleanPath = path.replace(/^\//, '');
26
+ const finalPath = opts?.encode ? encodeKeyPath(cleanPath) : cleanPath;
27
+ // Azure: <endpoint>/<container>/<blob>, append SAS if available
28
+ if (conn.provider === 'azure') {
29
+ const base = conn.endpoint
30
+ ? `${conn.endpoint.replace(/\/$/, '')}/${conn.bucket}/${finalPath}`
31
+ : `https://${conn.bucket}.blob.core.windows.net/${finalPath}`;
32
+ return appendAzureSas(base, conn.id);
33
+ }
34
+ return `${buildProviderBaseUrl(conn.provider, conn.endpoint, conn.bucket, conn.region)}/${finalPath}`;
35
+ }
6
36
  /**
7
37
  * Build an HTTPS URL for a tab's file.
8
38
  * Works for any viewer that needs an HTTP-accessible URL (COG, PMTiles, Zarr, etc.)
@@ -11,15 +41,7 @@ export function buildHttpsUrl(tab) {
11
41
  const conn = tab.connectionId ? connections.getById(tab.connectionId) : null;
12
42
  if (!conn)
13
43
  return tab.path;
14
- const cleanPath = tab.path.replace(/^\//, '');
15
- // Azure: <endpoint>/<container>/<blob>, append SAS if available
16
- if (conn.provider === 'azure') {
17
- const base = conn.endpoint
18
- ? `${conn.endpoint.replace(/\/$/, '')}/${conn.bucket}/${cleanPath}`
19
- : `https://${conn.bucket}.blob.core.windows.net/${cleanPath}`;
20
- return appendAzureSas(base, conn.id);
21
- }
22
- return `${buildProviderBaseUrl(conn.provider, conn.endpoint, conn.bucket, conn.region)}/${cleanPath}`;
44
+ return buildHttpsUrlForConnection(conn, tab.path);
23
45
  }
24
46
  /**
25
47
  * Async counterpart of `buildHttpsUrl`. For `signed-s3` connections, returns a
@@ -28,8 +28,40 @@ export declare function syncUrlParam(conn: Connection, prefix?: string): void;
28
28
  export declare function updateUrlView(view: string): void;
29
29
  /**
30
30
  * Read the current #hash view mode from the URL.
31
+ *
32
+ * The hash is parsed as `#<mode>?<viewParams>`, where `<mode>` is the viewer
33
+ * token (`map`, `stac-map`, `code`, `multicog`, ...) and `<viewParams>` is an
34
+ * optional URLSearchParams-shaped string used by viewers that want richer
35
+ * shareable state (e.g. MultiCogViewer encoding its chosen R/G/B asset keys).
36
+ * Returns just the mode string for backwards compatibility; per-viewer
37
+ * params are retrieved via `getUrlViewParams()`.
31
38
  */
32
39
  export declare function getUrlView(): string;
40
+ /**
41
+ * Pick a viewer's `viewMode` from the current URL hash, validated against the
42
+ * viewer's known token vocabulary. Centralises the "is this hash one of the
43
+ * modes I support?" decision so each viewer doesn't reimplement string-match
44
+ * ternary chains, and so we have one place to enforce the invariant: an
45
+ * explicit hash is honoured exactly, an unknown or empty hash falls back to
46
+ * `defaultMode` WITHOUT rewriting the URL. Viewers that mount transiently
47
+ * while another viewer farther up the stack is being chosen (e.g. CodeViewer
48
+ * during ViewerRouter's async STAC detection) MUST NOT clobber a hash they
49
+ * don't understand, because that hash is owned by the eventual viewer.
50
+ */
51
+ export declare function pickViewMode<T extends string>(validModes: readonly T[], defaultMode: T): T;
52
+ /**
53
+ * Read viewer-specific params from the URL hash query-string portion.
54
+ *
55
+ * Format: `#<mode>?k1=v1&k2=v2`. Returns a `URLSearchParams` so callers can
56
+ * `.get(key)` cleanly and merge their own state into it.
57
+ */
58
+ export declare function getUrlViewParams(): URLSearchParams;
59
+ /**
60
+ * Update the hash with both a mode and an optional set of viewer params.
61
+ * Empty / null `params` writes just `#<mode>`. Existing hash params are
62
+ * fully replaced — pass the merged set in.
63
+ */
64
+ export declare function updateUrlViewParams(view: string, params?: URLSearchParams | null): void;
33
65
  /**
34
66
  * Read the prefix (file/folder path) from the ?url= param.
35
67
  */
@@ -40,6 +72,10 @@ export declare function getUrlPrefix(): string;
40
72
  * auto-migration is in progress (see `+page.svelte` tab-sync effect).
41
73
  */
42
74
  export declare function hasUrlParam(): boolean;
75
+ /**
76
+ * Read the `?panel=` param (e.g. `?panel=settings`) to auto-open a panel on load.
77
+ */
78
+ export declare function getPanelParam(): string | null;
43
79
  /**
44
80
  * Clear all URL state params.
45
81
  */
@@ -9,9 +9,9 @@
9
9
  *
10
10
  * Uses SvelteKit's replaceState to avoid conflicts with the router.
11
11
  */
12
+ import { parseStorageUrl } from '@walkthru-earth/objex-utils';
12
13
  import { replaceState } from '$app/navigation';
13
14
  import { buildProviderBaseUrl } from '../storage/providers.js';
14
- import { parseStorageUrl } from './storage-url.js';
15
15
  /**
16
16
  * Build the base HTTPS URL for a connection (endpoint + bucket).
17
17
  */
@@ -68,15 +68,74 @@ export function updateUrlView(view) {
68
68
  }
69
69
  /**
70
70
  * Read the current #hash view mode from the URL.
71
+ *
72
+ * The hash is parsed as `#<mode>?<viewParams>`, where `<mode>` is the viewer
73
+ * token (`map`, `stac-map`, `code`, `multicog`, ...) and `<viewParams>` is an
74
+ * optional URLSearchParams-shaped string used by viewers that want richer
75
+ * shareable state (e.g. MultiCogViewer encoding its chosen R/G/B asset keys).
76
+ * Returns just the mode string for backwards compatibility; per-viewer
77
+ * params are retrieved via `getUrlViewParams()`.
71
78
  */
72
79
  export function getUrlView() {
73
80
  try {
74
- return window.location.hash.replace('#', '');
81
+ const raw = window.location.hash.replace('#', '');
82
+ const q = raw.indexOf('?');
83
+ return q >= 0 ? raw.slice(0, q) : raw;
75
84
  }
76
85
  catch {
77
86
  return '';
78
87
  }
79
88
  }
89
+ /**
90
+ * Pick a viewer's `viewMode` from the current URL hash, validated against the
91
+ * viewer's known token vocabulary. Centralises the "is this hash one of the
92
+ * modes I support?" decision so each viewer doesn't reimplement string-match
93
+ * ternary chains, and so we have one place to enforce the invariant: an
94
+ * explicit hash is honoured exactly, an unknown or empty hash falls back to
95
+ * `defaultMode` WITHOUT rewriting the URL. Viewers that mount transiently
96
+ * while another viewer farther up the stack is being chosen (e.g. CodeViewer
97
+ * during ViewerRouter's async STAC detection) MUST NOT clobber a hash they
98
+ * don't understand, because that hash is owned by the eventual viewer.
99
+ */
100
+ export function pickViewMode(validModes, defaultMode) {
101
+ const view = getUrlView();
102
+ if (view && validModes.includes(view))
103
+ return view;
104
+ return defaultMode;
105
+ }
106
+ /**
107
+ * Read viewer-specific params from the URL hash query-string portion.
108
+ *
109
+ * Format: `#<mode>?k1=v1&k2=v2`. Returns a `URLSearchParams` so callers can
110
+ * `.get(key)` cleanly and merge their own state into it.
111
+ */
112
+ export function getUrlViewParams() {
113
+ try {
114
+ const raw = window.location.hash.replace('#', '');
115
+ const q = raw.indexOf('?');
116
+ if (q < 0)
117
+ return new URLSearchParams();
118
+ return new URLSearchParams(raw.slice(q + 1));
119
+ }
120
+ catch {
121
+ return new URLSearchParams();
122
+ }
123
+ }
124
+ /**
125
+ * Update the hash with both a mode and an optional set of viewer params.
126
+ * Empty / null `params` writes just `#<mode>`. Existing hash params are
127
+ * fully replaced — pass the merged set in.
128
+ */
129
+ export function updateUrlViewParams(view, params) {
130
+ const qs = params?.toString();
131
+ writeLocation((url) => {
132
+ if (!view) {
133
+ url.hash = '';
134
+ return;
135
+ }
136
+ url.hash = qs ? `${view}?${qs}` : view;
137
+ });
138
+ }
80
139
  /**
81
140
  * Read the prefix (file/folder path) from the ?url= param.
82
141
  */
@@ -105,6 +164,17 @@ export function hasUrlParam() {
105
164
  return false;
106
165
  }
107
166
  }
167
+ /**
168
+ * Read the `?panel=` param (e.g. `?panel=settings`) to auto-open a panel on load.
169
+ */
170
+ export function getPanelParam() {
171
+ try {
172
+ return new URL(window.location.href).searchParams.get('panel');
173
+ }
174
+ catch {
175
+ return null;
176
+ }
177
+ }
108
178
  /**
109
179
  * Clear all URL state params.
110
180
  */
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Zarr tab-opening helper.
3
- * Centralizes Zarr store tab creation to avoid duplicating the same logic
4
- * across FileBrowser, FileRow, FileTreeSidebar, and +page.svelte.
3
+ * Centralizes Zarr store tab creation across FileTreeSidebar and +page.svelte.
5
4
  *
6
5
  * Kept separate from zarr.ts to avoid adding a store dependency to a pure utility.
7
6
  */
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Zarr tab-opening helper.
3
- * Centralizes Zarr store tab creation to avoid duplicating the same logic
4
- * across FileBrowser, FileRow, FileTreeSidebar, and +page.svelte.
3
+ * Centralizes Zarr store tab creation across FileTreeSidebar and +page.svelte.
5
4
  *
6
5
  * Kept separate from zarr.ts to avoid adding a store dependency to a pure utility.
7
6
  */
@@ -61,23 +61,6 @@ export interface GeoZarrInfo {
61
61
  * caller to the `@carbonplan/zarr-layer` fallback.
62
62
  */
63
63
  export declare function detectGeoZarr(hierarchy: ZarrHierarchy): GeoZarrInfo | null;
64
- /**
65
- * Convert a decoded GeoZarr tile (band-planar or packed RGB) into RGBA
66
- * `ImageData` for deck.gl-zarr's `renderTile` callback. Input is expected to
67
- * be a Uint8 or Uint16 typed array with either 3 interleaved bytes per pixel
68
- * or 3 planar bands of width*height values.
69
- *
70
- * For 16-bit data the caller supplies the rescale range so the CPU
71
- * normalization matches what the GPU `LinearRescale` module would produce.
72
- */
73
- export declare function zarrTileToImageData(raw: ArrayLike<number> & {
74
- length: number;
75
- }, width: number, height: number, opts?: {
76
- layout?: 'packed' | 'planar';
77
- bands?: 1 | 3;
78
- rescaleMin?: number;
79
- rescaleMax?: number;
80
- }): ImageData;
81
64
  /** Dimension-like variable names treated as coordinates. */
82
65
  export declare const DIM_LIKE_NAMES: Set<string>;
83
66
  /** Guess dimension names from shape length when metadata is absent. */
@@ -4,7 +4,7 @@
4
4
  * Builds a hierarchical tree of groups and arrays from consolidated metadata
5
5
  * (Zarr v2 .zmetadata, v3 zarr.json), with zarrita fallback for non-consolidated stores.
6
6
  */
7
- import { formatFileSize } from './format.js';
7
+ import { formatFileSize } from '@walkthru-earth/objex-utils';
8
8
  // ---------------------------------------------------------------------------
9
9
  // Register numcodecs-wrapped codecs with zarrita's codec registry.
10
10
  // Zarr v3 stores produced by Python's zarr-python may wrap codecs with the
@@ -163,50 +163,6 @@ function isGeoZarrAttrs(attrs) {
163
163
  Boolean(attrs.crs_wkt);
164
164
  return hasMultiscales && hasSpatial && hasCrs;
165
165
  }
166
- /**
167
- * Convert a decoded GeoZarr tile (band-planar or packed RGB) into RGBA
168
- * `ImageData` for deck.gl-zarr's `renderTile` callback. Input is expected to
169
- * be a Uint8 or Uint16 typed array with either 3 interleaved bytes per pixel
170
- * or 3 planar bands of width*height values.
171
- *
172
- * For 16-bit data the caller supplies the rescale range so the CPU
173
- * normalization matches what the GPU `LinearRescale` module would produce.
174
- */
175
- export function zarrTileToImageData(raw, width, height, opts = {}) {
176
- const bands = opts.bands ?? 3;
177
- const layout = opts.layout ?? 'packed';
178
- const min = opts.rescaleMin ?? 0;
179
- const max = opts.rescaleMax ?? 255;
180
- const range = max - min || 1;
181
- const pixelCount = width * height;
182
- const rgba = new Uint8ClampedArray(pixelCount * 4);
183
- for (let i = 0; i < pixelCount; i++) {
184
- let r = 0;
185
- let g = 0;
186
- let b = 0;
187
- if (bands === 1) {
188
- const v = Number(raw[i]);
189
- r = g = b = (v - min) / range;
190
- }
191
- else if (layout === 'planar') {
192
- r = (Number(raw[i]) - min) / range;
193
- g = (Number(raw[pixelCount + i]) - min) / range;
194
- b = (Number(raw[2 * pixelCount + i]) - min) / range;
195
- }
196
- else {
197
- const base = i * 3;
198
- r = (Number(raw[base]) - min) / range;
199
- g = (Number(raw[base + 1]) - min) / range;
200
- b = (Number(raw[base + 2]) - min) / range;
201
- }
202
- const idx = i * 4;
203
- rgba[idx] = Math.round(Math.max(0, Math.min(1, r)) * 255);
204
- rgba[idx + 1] = Math.round(Math.max(0, Math.min(1, g)) * 255);
205
- rgba[idx + 2] = Math.round(Math.max(0, Math.min(1, b)) * 255);
206
- rgba[idx + 3] = 255;
207
- }
208
- return new ImageData(rgba, width, height);
209
- }
210
166
  // ---------------------------------------------------------------------------
211
167
  // Kept helpers
212
168
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@walkthru-earth/objex",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Svelte 5 components and utilities for exploring geospatial object storage — S3, GCS, Azure, R2",
5
5
  "author": "Youssef Harby <yharby@walkthru.earth>",
6
6
  "license": "CC-BY-4.0",
@@ -27,41 +27,6 @@
27
27
  "svelte": "./dist/query/engine.js",
28
28
  "import": "./dist/query/engine.js"
29
29
  },
30
- "./utils/wkb": {
31
- "types": "./dist/utils/wkb.d.ts",
32
- "svelte": "./dist/utils/wkb.js",
33
- "import": "./dist/utils/wkb.js"
34
- },
35
- "./utils/geoarrow": {
36
- "types": "./dist/utils/geoarrow.d.ts",
37
- "svelte": "./dist/utils/geoarrow.js",
38
- "import": "./dist/utils/geoarrow.js"
39
- },
40
- "./utils/storage-url": {
41
- "types": "./dist/utils/storage-url.d.ts",
42
- "svelte": "./dist/utils/storage-url.js",
43
- "import": "./dist/utils/storage-url.js"
44
- },
45
- "./utils/parquet-metadata": {
46
- "types": "./dist/utils/parquet-metadata.d.ts",
47
- "svelte": "./dist/utils/parquet-metadata.js",
48
- "import": "./dist/utils/parquet-metadata.js"
49
- },
50
- "./utils/format": {
51
- "types": "./dist/utils/format.d.ts",
52
- "svelte": "./dist/utils/format.js",
53
- "import": "./dist/utils/format.js"
54
- },
55
- "./utils/hex": {
56
- "types": "./dist/utils/hex.d.ts",
57
- "svelte": "./dist/utils/hex.js",
58
- "import": "./dist/utils/hex.js"
59
- },
60
- "./utils/column-types": {
61
- "types": "./dist/utils/column-types.d.ts",
62
- "svelte": "./dist/utils/column-types.js",
63
- "import": "./dist/utils/column-types.js"
64
- },
65
30
  "./file-icons": {
66
31
  "types": "./dist/file-icons/index.d.ts",
67
32
  "svelte": "./dist/file-icons/index.js",
@@ -123,85 +88,91 @@
123
88
  }
124
89
  },
125
90
  "devDependencies": {
126
- "@biomejs/biome": "^2.4.13",
127
- "@changesets/changelog-github": "^0.5.2",
91
+ "@biomejs/biome": "^2.4.16",
92
+ "@changesets/changelog-github": "^0.7.0",
128
93
  "@changesets/cli": "^2.31.0",
129
94
  "@fontsource/cairo": "^5.2.7",
130
95
  "@internationalized/date": "^3.12.1",
131
- "@lucide/svelte": "^0.561.0",
96
+ "@lucide/svelte": "^1.17.0",
132
97
  "@sveltejs/adapter-static": "^3.0.10",
133
- "@sveltejs/kit": "^2.58.0",
98
+ "@sveltejs/kit": "^2.61.1",
134
99
  "@sveltejs/package": "^2.5.7",
135
100
  "@sveltejs/vite-plugin-svelte": "^6.2.4",
136
101
  "@tailwindcss/forms": "^0.5.11",
137
102
  "@tailwindcss/typography": "^0.5.19",
138
- "@tailwindcss/vite": "^4.2.4",
139
- "bits-ui": "^2.18.0",
103
+ "@tailwindcss/vite": "^4.3.0",
104
+ "@types/node": "^25.9.1",
105
+ "bits-ui": "^2.18.1",
140
106
  "clsx": "^2.1.1",
141
- "knip": "^6.6.2",
142
- "lefthook": "^2.1.6",
107
+ "knip": "^6.14.2",
108
+ "lefthook": "^2.1.8",
143
109
  "paneforge": "^1.0.2",
144
- "posthog-js": "^1.371.3",
145
- "publint": "^0.3.18",
146
- "svelte": "^5.55.5",
147
- "svelte-check": "^4.4.6",
148
- "tailwind-merge": "^3.5.0",
110
+ "posthog-js": "^1.376.3",
111
+ "publint": "^0.3.21",
112
+ "svelte": "^5.55.10",
113
+ "svelte-check": "^4.4.8",
114
+ "tailwind-merge": "^3.6.0",
149
115
  "tailwind-variants": "^3.2.2",
150
- "tailwindcss": "^4.2.4",
116
+ "tailwindcss": "^4.3.0",
151
117
  "tw-animate-css": "^1.4.0",
152
- "typescript": "^5.9.3",
153
- "vite": "^7.3.2"
118
+ "typescript": "^6.0.3",
119
+ "vite": "^7.3.3"
154
120
  },
155
121
  "dependencies": {
156
- "@babylonjs/core": "^8.56.2",
157
- "@babylonjs/loaders": "^8.56.2",
158
- "@carbonplan/zarr-layer": "^0.4.3",
159
- "@codemirror/autocomplete": "^6.20.1",
122
+ "@babylonjs/core": "^9.10.0",
123
+ "@babylonjs/loaders": "^9.10.0",
124
+ "babylonjs-gltf2interface": "^9.10.0",
125
+ "@carbonplan/zarr-layer": "^0.5.0",
126
+ "@chunkd/middleware": "^11.3.1",
127
+ "@chunkd/source": "^11.4.1",
128
+ "@chunkd/source-http": "^11.4.1",
129
+ "@codemirror/autocomplete": "^6.20.2",
160
130
  "@codemirror/commands": "^6.10.3",
161
131
  "@codemirror/lang-sql": "^6.10.0",
162
132
  "@codemirror/language": "^6.12.3",
163
133
  "@codemirror/state": "^6.6.0",
164
134
  "@codemirror/theme-one-dark": "^6.1.3",
165
- "@codemirror/view": "^6.41.1",
166
- "@deck.gl/core": "^9.3.1",
167
- "@deck.gl/geo-layers": "^9.3.1",
168
- "@deck.gl/layers": "^9.3.1",
169
- "@deck.gl/mapbox": "^9.3.1",
170
- "@deck.gl/mesh-layers": "^9.3.1",
171
- "@developmentseed/deck.gl-geotiff": "0.6.0-alpha.1",
172
- "@developmentseed/deck.gl-raster": "0.6.0-alpha.1",
173
- "@developmentseed/deck.gl-zarr": "0.6.0-alpha.1",
174
- "@developmentseed/epsg": "0.6.0-alpha.1",
175
- "@developmentseed/geotiff": "0.6.0-alpha.1",
176
- "@developmentseed/proj": "0.6.0-alpha.1",
177
- "@duckdb/duckdb-wasm": "1.33.1-dev53.0",
178
- "@geoarrow/deck.gl-layers": "^0.3.2",
135
+ "@codemirror/view": "^6.43.0",
136
+ "@deck.gl/core": "^9.3.2",
137
+ "@deck.gl/geo-layers": "^9.3.2",
138
+ "@deck.gl/layers": "^9.3.2",
139
+ "@deck.gl/mapbox": "^9.3.2",
140
+ "@deck.gl/mesh-layers": "^9.3.2",
141
+ "@developmentseed/deck.gl-geotiff": "0.7.0",
142
+ "@developmentseed/deck.gl-raster": "0.7.0",
143
+ "@developmentseed/deck.gl-zarr": "0.7.0",
144
+ "@developmentseed/epsg": "0.7.0",
145
+ "@developmentseed/geotiff": "0.7.0",
146
+ "@developmentseed/proj": "0.7.0",
147
+ "@duckdb/duckdb-wasm": "1.33.1-dev55.0",
148
+ "@geoarrow/deck.gl-geoarrow": "^0.4.1",
179
149
  "@luma.gl/core": "^9.3.3",
180
- "@mapbox/vector-tile": "^2.0.4",
181
- "@milkdown/kit": "^7.20.0",
182
- "@milkdown/theme-nord": "^7.20.0",
150
+ "@mapbox/vector-tile": "^3.0.0",
151
+ "@milkdown/kit": "^7.21.1",
152
+ "@milkdown/theme-nord": "^7.21.1",
183
153
  "@repeaterjs/repeater": "^3.0.6",
184
154
  "@zip.js/zip.js": "^2.8.26",
185
155
  "ansi_up": "^6.0.6",
186
156
  "apache-arrow": "^21.1.0",
187
157
  "aws4fetch": "^1.0.20",
188
158
  "chart.js": "^4.5.1",
189
- "deck.gl": "^9.3.1",
159
+ "deck.gl": "^9.3.2",
190
160
  "flatgeobuf": "^4.4.0",
191
- "hyparquet": "^1.25.6",
161
+ "hyparquet": "^1.26.0",
192
162
  "hyparquet-compressors": "^1.1.1",
193
163
  "lz-string": "^1.5.0",
194
164
  "maplibre-gl": "^5.24.0",
195
- "marked": "^17.0.6",
196
- "mermaid": "^11.14.0",
197
- "pbf": "^4.0.1",
198
- "pdfjs-dist": "^5.6.205",
165
+ "marked": "^18.0.4",
166
+ "mermaid": "^11.15.0",
167
+ "pbf": "^5.0.0",
168
+ "pdfjs-dist": "^5.7.284",
199
169
  "pmtiles": "^4.4.1",
200
170
  "proj4": "^2.20.8",
201
- "shiki": "^3.23.0",
202
- "sql-formatter": "^15.7.3",
203
- "yaml": "^2.8.3",
204
- "zarrita": "^0.7.2"
171
+ "shiki": "^4.1.0",
172
+ "sql-formatter": "^15.8.0",
173
+ "yaml": "^2.9.0",
174
+ "zarrita": "^0.7.3",
175
+ "@walkthru-earth/objex-utils": "1.4.0"
205
176
  },
206
177
  "scripts": {
207
178
  "dev": "vite dev",
@@ -215,6 +186,6 @@
215
186
  "format": "biome format --write src/ packages/",
216
187
  "format:check": "biome format src/ packages/",
217
188
  "deadcode": "knip",
218
- "ci:publish": "pnpm run package && pnpm --filter @walkthru-earth/objex-utils run build && pnpm publish -r --access public --no-git-checks --provenance"
189
+ "ci:publish": "pnpm --filter @walkthru-earth/objex-utils run build && pnpm run package && pnpm publish -r --access public --no-git-checks --provenance"
219
190
  }
220
191
  }