@nika-js/onlymap 0.6.13 → 0.6.15

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 (36) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{LercDecode.es-DB1mYTrm.js → LercDecode.es-BWmtr6fp.js} +1 -1
  3. package/dist/attribute-resolution.d.ts +2 -0
  4. package/dist/{basemap-CDp9EsvL.js → basemap-DQeUv-pk.js} +1 -1
  5. package/dist/clip-box-controller.d.ts +1 -1
  6. package/dist/clip-box.d.ts +0 -32
  7. package/dist/data-layer.d.ts +0 -17
  8. package/dist/effects.d.ts +1 -0
  9. package/dist/elements/om-map.d.ts +0 -20
  10. package/dist/elements/om-story.d.ts +0 -18
  11. package/dist/expr/errors.d.ts +3 -0
  12. package/dist/field-access.d.ts +10 -0
  13. package/dist/geodesy.d.ts +11 -0
  14. package/dist/{geoparquet-CI3o8X5-.js → geoparquet-DsYXvvEo.js} +1 -1
  15. package/dist/{index-Dio4lUCZ.js → index-BTJy4dWy.js} +1 -1
  16. package/dist/{index-CnKC1yuV.js → index-Bnkk4jcp.js} +26197 -26173
  17. package/dist/{index-Bue-53Xo.js → index-CbHslg3u.js} +1 -1
  18. package/dist/{index-BJh0t_nt.js → index-DMRuqiXV.js} +2 -2
  19. package/dist/{index-DMu0qL9C.js → index-gMV11Nr5.js} +1 -1
  20. package/dist/layer-registry.d.ts +10 -0
  21. package/dist/layers/marker-icons.d.ts +0 -2
  22. package/dist/legend-spec.d.ts +1 -6
  23. package/dist/{lerc-B1LFm9ra.js → lerc-Cw1YMyb0.js} +2 -2
  24. package/dist/onlymap.standalone.js +33282 -33258
  25. package/dist/onlymapjs.js +1 -1
  26. package/dist/programmatic.d.ts +0 -16
  27. package/dist/{raster-DQ1dS7mZ.js → raster-BJaQlAzq.js} +2 -2
  28. package/dist/{raster-pipeline-mXzwFf0A.js → raster-pipeline-BCVaME9y.js} +1 -1
  29. package/dist/react.js +215 -232
  30. package/dist/runtime-core.d.ts +37 -0
  31. package/dist/site-placement.d.ts +0 -2
  32. package/dist/version.d.ts +1 -1
  33. package/dist/{zarr-BSoVUvcs.js → zarr-C6xeWGwX.js} +2 -2
  34. package/package.json +1 -1
  35. package/skills/onlymapjs/SKILL.md +1 -1
  36. package/skills/onlymapjs/references/syntax.md +2 -2
@@ -8,6 +8,31 @@ import type { LayerIR } from "./ir";
8
8
  import { type Selection } from "./selection";
9
9
  import type { ValidationEntry } from "./validation";
10
10
  import type { MapViewport } from "./basemap";
11
+ /**
12
+ * Composes the terrain + clip-box per-layer patches over a layer's own
13
+ * authored props (issue #36 — the 0.6.2 regression this replaces). The old
14
+ * inline merge fabricated an `extensions` key from the two patches ALONE
15
+ * whenever either patch OBJECT existed — and `applyTerrain` emits an identity
16
+ * patch (`extraProps: {}`) for every layer while terrain is INACTIVE, so on
17
+ * every flat map every layer got `extensions: []` spread over its authored
18
+ * array, silently unmounting PathStyleExtension (dash rendered solid) and
19
+ * DataFilterExtension (GPU filters stopped visually applying; widget stats
20
+ * stayed coherent via the CPU predicate, which is what hid it for six
21
+ * releases). Three rules restore the contract the patch builders' own tests
22
+ * already state:
23
+ *
24
+ * 1. An identity patch (no keys) is NOT a patch — authored props, extensions
25
+ * included, flow through untouched (return undefined; the constructor's
26
+ * `...layerProps` already carries them).
27
+ * 2. A patch that carries extensions already APPENDED them to the authored
28
+ * array (applyTerrain/applyClipBox both do) — never rebuild from scratch.
29
+ * 3. Both active: reference-dedup the concatenation — each patch's array
30
+ * starts with the SAME authored instances, and without the dedup a layer
31
+ * under terrain + clip box mounted every authored extension twice.
32
+ *
33
+ * Exported for direct unit testing (the lerpAngle precedent).
34
+ */
35
+ export declare function mergePatchExtraProps(authoredExtensions: unknown[] | undefined, terrainProps: Record<string, unknown> | undefined, clipProps: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
11
36
  /** RouteLayer's own `onRouteResolved` report (spec: "Routing & Tracking") — a normalized Route plus its bounds. `bounds` drives `follow="fit-route"` here; the WHOLE object forwards to `RuntimeCoreCallbacks.onRouteResolved` (the `om-route-resolved` consumer event), so a page can read a provider-resolved route's geometry/distance/duration without re-fetching it. */
12
37
  interface RouteResolvedInfo {
13
38
  geometry?: {
@@ -250,6 +275,9 @@ export declare class RuntimeCore {
250
275
  /** layerId → effect-driven plain-prop patches (the per-frame channel). */
251
276
  private animatedProps;
252
277
  private headless?;
278
+ /** Animated-props flush coalescing (see patchAnimatedProps): patches since the last rebuild / a microtask flush already queued. */
279
+ private animatedDirty;
280
+ private animatedFlushQueued;
253
281
  private destroyed;
254
282
  private viewState;
255
283
  private callbacks;
@@ -369,6 +397,15 @@ export declare class RuntimeCore {
369
397
  * (none ↔ maplibre). Reads/seeds the camera from `this.viewState`.
370
398
  */
371
399
  private initRenderer;
400
+ /**
401
+ * The five pick/drag deck callbacks, shared verbatim by the lazy MapLibre
402
+ * adapter's deckProps and the standalone `new Deck` — one place to edit the
403
+ * pick path (they had drifted into two pasted copies). `onLoad`/`onError`
404
+ * stay per-branch: the basemap path wires load through `basemap.onLoad`.
405
+ * `toSelection`'s `type` param on drag is a required tag, not meaningful —
406
+ * the behavior dispatch (om-map.ts) uses its own "drag" event name.
407
+ */
408
+ private pickCallbacks;
372
409
  /** The current lighting as a deck `effects` array — [] restores deck's default lights. */
373
410
  private buildEffects;
374
411
  /**
@@ -103,5 +103,3 @@ export declare function localOffsetToLngLat(local: readonly [number, number], or
103
103
  */
104
104
  export declare function tilesetPlacementMatrix(baked: Matrix4, p: SitePlacement): Matrix4;
105
105
  export declare function tilesetBakedFrame(url: string, onReady: () => void): Matrix4 | null | undefined;
106
- /** Test seam — the cache is process-wide and would leak between cases. */
107
- export declare function resetSitePlacementCache(): void;
package/dist/version.d.ts CHANGED
@@ -5,4 +5,4 @@
5
5
  * the build rootDir, and a `define` would need repeating across vite/vitest/
6
6
  * vite-node configs.
7
7
  */
8
- export declare const LIBRARY_VERSION = "0.6.13";
8
+ export declare const LIBRARY_VERSION = "0.6.15";
@@ -1,5 +1,5 @@
1
- import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, g as pr, h as mr } from "./raster-pipeline-mXzwFf0A.js";
2
- import { ap as gr } from "./index-CnKC1yuV.js";
1
+ import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, g as pr, h as mr } from "./raster-pipeline-BCVaME9y.js";
2
+ import { ap as gr } from "./index-Bnkk4jcp.js";
3
3
  import $t from "./index-CW1n5LdO.js";
4
4
  var Et;
5
5
  function h(e, t, n) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nika-js/onlymap",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "description": "Declarative deck.gl maps for HTML and React — interactive WebGL mapping with GeoJSON/CSV/Arrow data, MapLibre basemaps, widgets, popups, and live streams from a custom-element manifest or typed React components. TypeScript, no build step.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "publishConfig": {
@@ -23,7 +23,7 @@ Use OnlyMapJS as a declarative HTML map library. Write custom elements such as `
23
23
  </script>
24
24
  ```
25
25
 
26
- For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.6.13` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.6.13/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
26
+ For no-build CDN pages, use the single-file standalone bundle from a raw-file CDN — `https://unpkg.com/@nika-js/onlymap@0.6.15` (the bare package URL serves `dist/onlymap.standalone.js`) — plus `<link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.6.15/dist/onlymapjs.css">`. Never a rebundling CDN (esm.sh, skypack): re-bundling duplicates the deck.gl/luma.gl runtime and every layer fails shader compilation.
27
27
 
28
28
  ## React Projects
29
29
 
@@ -16,8 +16,8 @@ Vite/npm project:
16
16
  Static CDN page (raw-file CDNs only — unpkg/jsDelivr; never esm.sh or another rebundling CDN, which duplicates the WebGL runtime and breaks layer shaders):
17
17
 
18
18
  ```html
19
- <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.6.13/dist/onlymapjs.css">
20
- <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.6.13"></script>
19
+ <link rel="stylesheet" href="https://unpkg.com/@nika-js/onlymap@0.6.15/dist/onlymapjs.css">
20
+ <script type="module" src="https://unpkg.com/@nika-js/onlymap@0.6.15"></script>
21
21
  ```
22
22
 
23
23
  Always include `onlymapjs.css` — it carries the MapLibre basemap styles and the no-JS fallback rules (`<om-fallback>` / default banner). For the fallback to work in script-disabled previews it must load without JavaScript: a real `<link rel="stylesheet">` or inlined `<style>` on no-build pages (a bundler-emitted stylesheet is fine in npm projects).