@fxi/zartigl 0.10.0 → 0.10.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.
package/README.md CHANGED
@@ -24,7 +24,7 @@ ARCO layers of [MapX](https://app.mapx.org).
24
24
  | Runtime library | `src/lib/` | `@fxi/zartigl`: the `Zartigl` facade, Zarr/WMTS/GeoVideo layers, shaders, particle simulation, point queries |
25
25
  | Catalog | `src/catalog/`, `scripts/catalog_builder/` | `@fxi/zartigl/catalog` presets and the tools that discover, describe, and validate entries |
26
26
  | GeoVideo pipeline | `scripts/geovideo/`, `.github/workflows/geovideo.yml` | Single renders and incremental archives published to S3, rendered daily on a self-hosted runner |
27
- | Demos | `src/demo-prod/`, `src/demo-story/` | Technical demo and narrative story, deployed to GitHub Pages |
27
+ | Demos | `src/explorer/`, `src/demo-story/` | Catalog explorer and narrative story, deployed to GitHub Pages |
28
28
  | MapX integration | `src/mapx/` | Widget and standalone snippet generation for reproducible MapX views |
29
29
 
30
30
  ## Features
package/dist/catalog.d.ts CHANGED
@@ -21,6 +21,9 @@ export declare interface Catalog {
21
21
 
22
22
  export declare const catalog: Catalog;
23
23
 
24
+ /** Live catalog of schema 2; a schema 3 would publish under `v3/`. */
25
+ export declare const CATALOG_URL = "https://sos-ch-gva-2.exo.io/mapx-zartigl/catalog/v2/catalog.json";
26
+
24
27
  export declare interface CatalogEntry {
25
28
  id: string;
26
29
  aliases?: string[];
@@ -129,6 +132,9 @@ export declare interface CatalogZarrSource extends CatalogSourceBase {
129
132
  variables: CatalogVariables;
130
133
  }
131
134
 
135
+ /** -1, 0 or 1 as `a` is older than, equal to or newer than `b` (x.y.z). */
136
+ export declare function compareVersions(a: string, b: string): number;
137
+
132
138
  /** The keys of `style` whose value differs from `base`'s. */
133
139
  export declare function diffStyle(style: LayerStyleInput, base: LayerStyle): LayerStyleInput;
134
140
 
@@ -174,6 +180,29 @@ export declare interface LayerStyleInput {
174
180
  raster?: Partial<RasterStyle>;
175
181
  }
176
182
 
183
+ /**
184
+ * The live catalog, or `fallback` (the bundled catalog) when it cannot be
185
+ * fetched or is not a schema 2 catalog. A catalog that needs a newer engine
186
+ * still loads, with a warning: its new style keys degrade, they do not fail.
187
+ */
188
+ export declare function loadCatalog(url?: string, options?: LoadCatalogOptions): Promise<LoadedCatalog>;
189
+
190
+ export declare interface LoadCatalogOptions {
191
+ /** Give up on the live catalog after this delay. */
192
+ timeoutMs?: number;
193
+ /** Used when the live catalog cannot be read; the bundled one by default. */
194
+ fallback?: Catalog;
195
+ /** Where warnings go; console.warn by default. */
196
+ warn?: (message: string) => void;
197
+ /** For tests: the fetch to use. */
198
+ fetch?: typeof fetch;
199
+ }
200
+
201
+ export declare interface LoadedCatalog {
202
+ catalog: Catalog;
203
+ source: "remote" | "bundled";
204
+ }
205
+
177
206
  export declare type LocalizedText = Record<string, string>;
178
207
 
179
208
  /**
@@ -206,6 +235,14 @@ export declare interface ParseLayerStyleOptions {
206
235
  particles?: readonly (keyof ParticleStyle)[];
207
236
  raster?: readonly (keyof RasterStyle)[];
208
237
  };
238
+ /**
239
+ * Keys that are not style keys at all: "throw" (default), or "drop" them
240
+ * with a warning, so a style written for a newer engine still renders with
241
+ * an older one. Invalid values of known keys always throw.
242
+ */
243
+ unknownKeys?: "throw" | "drop";
244
+ /** Where dropped keys are reported; console.warn by default. */
245
+ warn?: (message: string) => void;
209
246
  }
210
247
 
211
248
  /** Style keys, for checks against other definitions of the same shape. */
@@ -246,6 +283,11 @@ export declare function pickPreferredSource(entry: CatalogEntry, request?: Sourc
246
283
  */
247
284
  export declare function pickSourceByPriority(entry: CatalogEntry, priority: readonly CatalogSource["type"][], request?: SourceTimeRequest): CatalogSource | undefined;
248
285
 
286
+ /** A published catalog: the catalog plus the oldest engine that renders it all. */
287
+ export declare type PublishedCatalog = Catalog & {
288
+ minEngine?: string;
289
+ };
290
+
249
291
  export declare const RASTER_STYLE_KEYS: (keyof RasterStyle)[];
250
292
 
251
293
  export declare interface RasterStyle {