@nika-js/onlymap 0.6.1 → 0.6.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/README.md +28 -15
  3. package/dist/{LercDecode.es-CJnypw8j.js → LercDecode.es-BOJJr6Gx.js} +1 -1
  4. package/dist/{basemap-DrQ0-eyR.js → basemap-BofXgXxy.js} +13 -3
  5. package/dist/basemap.d.ts +10 -1
  6. package/dist/clip-box-controller.d.ts +94 -0
  7. package/dist/clip-box.d.ts +109 -0
  8. package/dist/data-layer.d.ts +11 -3
  9. package/dist/draw-controller.d.ts +75 -1
  10. package/dist/draw.d.ts +22 -4
  11. package/dist/elements/om-map.d.ts +19 -0
  12. package/dist/elements/om-overlay.d.ts +12 -0
  13. package/dist/geodesy.d.ts +29 -3
  14. package/dist/{geoparquet-Dix4lTNy.js → geoparquet-DapHATA0.js} +1 -1
  15. package/dist/html-data.d.ts +2 -2
  16. package/dist/{index-1UgNlfGR.js → index-7B-6Cbzu.js} +30958 -27910
  17. package/dist/{index-B_1PPJgC.js → index-BF9iO8Tq.js} +1 -1
  18. package/dist/{index-BQMjW5w0.js → index-BmX6IId3.js} +1 -1
  19. package/dist/{index-CXPaeisL.js → index-SPJVn_n_.js} +1 -1
  20. package/dist/{index-CAuT5j9Y.js → index-xmJjZxQJ.js} +2 -2
  21. package/dist/index.d.ts +5 -2
  22. package/dist/ir-snapshot.d.ts +3 -1
  23. package/dist/layers/bim-layer.d.ts +30 -7
  24. package/dist/layers/feature-mesh-layer.d.ts +1 -1
  25. package/dist/layers/popup-layer.d.ts +13 -0
  26. package/dist/legend-spec.d.ts +1 -1
  27. package/dist/{lerc-CbTjQ7uI.js → lerc-C6k7EzSN.js} +2 -2
  28. package/dist/license.d.ts +12 -5
  29. package/dist/measure-controller.d.ts +458 -4
  30. package/dist/onlymap.standalone.js +54016 -50958
  31. package/dist/onlymapjs.js +18 -17
  32. package/dist/parse-manifest.d.ts +3 -0
  33. package/dist/programmatic.d.ts +17 -3
  34. package/dist/{raster-0b0nSHUh.js → raster-Cuzhibe2.js} +2 -2
  35. package/dist/{raster-pipeline-D8siq7-4.js → raster-pipeline-DLrnJK8y.js} +1 -1
  36. package/dist/react/om-layer.d.ts +6 -1
  37. package/dist/react.js +167 -160
  38. package/dist/region-export-controller.d.ts +37 -0
  39. package/dist/region-export.d.ts +56 -0
  40. package/dist/runtime-core.d.ts +150 -0
  41. package/dist/selection.d.ts +11 -1
  42. package/dist/site-placement.d.ts +22 -0
  43. package/dist/snapping.d.ts +88 -0
  44. package/dist/terrain-heightfield.d.ts +53 -0
  45. package/dist/terrain-sample.d.ts +30 -0
  46. package/dist/terrain.d.ts +6 -1
  47. package/dist/units.d.ts +27 -0
  48. package/dist/version.d.ts +1 -1
  49. package/dist/volumetrics-run.d.ts +13 -0
  50. package/dist/volumetrics-worker.d.ts +1 -0
  51. package/dist/volumetrics.d.ts +201 -0
  52. package/dist/{zarr-DCYro_Vs.js → zarr-CUzEX8fB.js} +2 -2
  53. package/docs/3d-assets.md +48 -0
  54. package/docs/live-data.md +9 -1
  55. package/docs/testing.md +2 -0
  56. package/llms.txt +10 -5
  57. package/onlymapjs.html-data.json +161 -2
  58. package/package.json +4 -2
  59. package/skills/onlymapjs/SKILL.md +11 -1
  60. package/skills/onlymapjs/references/react.md +1 -1
  61. package/skills/onlymapjs/references/syntax.md +20 -8
package/dist/onlymapjs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aA as e, aB as r, aC as t, aD as o, aE as b, aF as i, ap as l, aG as n, aH as S, aI as E, aJ as T, aK as L, aL as g, aM as c, aN as A, aO as m, aP as _, aQ as d, aR as p, aS as I, aT as y, aU as M, aV as u, aW as D, ao as O, aX as f, aw as N, aY as R, aZ as P, a_ as F, W as h, a$ as B, b0 as C, b1 as G, b2 as U, b3 as W, b4 as v, b5 as x, b6 as w, b7 as Y, b8 as H, b9 as X, ba as k, bb as J, bc as K, bd as V, be as z, bf as Q, bg as Z, bh as $, bi as j, bj as q, bk as aa, bl as sa, bm as ea, bn as ra, bo as ta, bp as oa, bq as ba, br as ia, bs as la, bt as na, bu as Sa, bv as Ea, bw as Ta, bx as La, by as ga, bz as ca, bA as Aa, bB as ma, bC as _a, bD as da, bE as pa, bF as Ia, bG as ya, bH as Ma, bI as ua, bJ as Da, bK as Oa, bL as fa, bM as Na, bN as Ra, bO as Pa, bP as Fa, bQ as ha, bR as Ba, bS as Ca, bT as Ga, bU as Ua, bV as Wa, bW as va, bX as xa, bY as wa, bZ as Ya, b_ as Ha, b$ as Xa, c0 as ka, c1 as Ja } from "./index-1UgNlfGR.js";
1
+ import { aA as e, aB as r, aC as t, aD as o, aE as b, aF as i, ap as l, aG as n, aH as S, aI as E, aJ as T, aK as L, aL as g, aM as c, aN as A, aO as p, aP as m, aQ as _, aR as d, aS as I, aT as y, aU as M, aV as u, aW as D, ao as O, aX as f, aw as N, aY as R, aZ as P, a_ as h, W as F, a$ as B, b0 as C, b1 as G, b2 as U, b3 as W, b4 as v, b5 as x, b6 as w, b7 as Y, b8 as H, b9 as X, ba as k, bb as J, bc as K, bd as V, be as z, bf as Q, bg as Z, bh as $, bi as j, bj as q, bk as aa, bl as sa, bm as ea, bn as ra, bo as ta, bp as oa, bq as ba, br as ia, bs as la, bt as na, bu as Sa, bv as Ea, bw as Ta, bx as La, by as ga, bz as ca, bA as Aa, bB as pa, bC as ma, bD as _a, bE as da, bF as Ia, bG as ya, bH as Ma, bI as ua, bJ as Da, bK as Oa, bL as fa, bM as Na, bN as Ra, bO as Pa, bP as ha, bQ as Fa, bR as Ba, bS as Ca, bT as Ga, bU as Ua, bV as Wa, bW as va, bX as xa, bY as wa, bZ as Ya, b_ as Ha, b$ as Xa, c0 as ka, c1 as Ja, c2 as Ka } from "./index-7B-6Cbzu.js";
2
2
  export {
3
3
  e as ALL_POSITION_VALUES,
4
4
  r as AUDIT_EXEMPTIONS,
@@ -15,10 +15,10 @@ export {
15
15
  g as FOLD_SIDES,
16
16
  c as GeoJsonLayer,
17
17
  A as IconLayer,
18
- m as LEGACY_POSITION_ALIASES,
19
- _ as LIGHTING_PRESET_NAMES,
20
- d as Layer,
21
- p as LayerExtension,
18
+ p as LEGACY_POSITION_ALIASES,
19
+ m as LIGHTING_PRESET_NAMES,
20
+ _ as Layer,
21
+ d as LayerExtension,
22
22
  I as MANAGED_SLOTS,
23
23
  y as MapController,
24
24
  M as OmMap,
@@ -29,8 +29,8 @@ export {
29
29
  N as TileLayer,
30
30
  R as UNIT_SYSTEMS,
31
31
  P as WGS84_MEAN_RADIUS_M,
32
- F as WIDGET_STYLE_KEY_NAMES,
33
- h as WebMercatorViewport,
32
+ h as WIDGET_STYLE_KEY_NAMES,
33
+ F as WebMercatorViewport,
34
34
  B as arrowTableToColumnar,
35
35
  C as asRows,
36
36
  G as auditLayout,
@@ -69,10 +69,10 @@ export {
69
69
  ga as normalizeData,
70
70
  ca as parseDurationMs,
71
71
  Aa as parseTerrainAttrs,
72
- ma as parseUnitSystem,
73
- _a as parseWidgetStyle,
74
- da as pathLengthMeters,
75
- pa as registerAction,
72
+ pa as parseUnitSystem,
73
+ ma as parseWidgetStyle,
74
+ _a as pathLengthMeters,
75
+ da as registerAction,
76
76
  Ia as registerBasemap,
77
77
  ya as registerFormat,
78
78
  Ma as registerLayer,
@@ -83,8 +83,8 @@ export {
83
83
  Na as resolveImageOverlay,
84
84
  Ra as resolveLighting,
85
85
  Pa as resolveSlot,
86
- Fa as ringAreaMeters2,
87
- ha as ringEnclosesPole,
86
+ ha as ringAreaMeters2,
87
+ Fa as ringEnclosesPole,
88
88
  Ba as ringPerimeterMeters,
89
89
  Ca as rowAt,
90
90
  Ga as sandboxHtml,
@@ -94,8 +94,9 @@ export {
94
94
  xa as shouldFoldAtWidth,
95
95
  wa as slotContainerStyle,
96
96
  Ya as slotLayout,
97
- Ha as snapshotIR,
98
- Xa as solarAzElDegrees,
99
- ka as validateManifest,
100
- Ja as validateManifestString
97
+ Ha as snapshotDescriptorIR,
98
+ Xa as snapshotIR,
99
+ ka as solarAzElDegrees,
100
+ Ja as validateManifest,
101
+ Ka as validateManifestString
101
102
  };
@@ -6,6 +6,7 @@
6
6
  * runtime-core.ts never does.
7
7
  */
8
8
  import type { LayerIR } from "./ir";
9
+ import { type DataTransportOwner } from "./data-layer";
9
10
  export interface ParseManifestOptions {
10
11
  /**
11
12
  * IR-snapshot mode (see ir-snapshot.ts): resolve the manifest without side
@@ -15,5 +16,7 @@ export interface ParseManifestOptions {
15
16
  * would evict a concurrently-running live map's compiled accessors).
16
17
  */
17
18
  snapshot?: boolean;
19
+ /** Controller/element identity for descriptor-owned transport lifetime. */
20
+ dataOwner?: DataTransportOwner;
18
21
  }
19
22
  export declare function parseManifest(mapEl: Element, onDataLoaded: () => void, opts?: ParseManifestOptions): LayerIR[];
@@ -25,10 +25,13 @@ import type { LayerMetaSnapshot } from "./ctx";
25
25
  import type { Selection } from "./selection";
26
26
  import type { ValidationEntry } from "./validation";
27
27
  import type { MapViewport } from "./basemap";
28
+ import { type LayerIRSnapshot } from "./ir-snapshot";
28
29
  /**
29
30
  * A layer, declared as a typed value — the programmatic mirror of one
30
- * <om-layer> element. Accessors are plain JS functions (no expression
31
- * language, no trust step first-party code is trusted by definition).
31
+ * <om-layer> element. First-party callers normally use plain JS accessor
32
+ * functions. A schema-declared accessor may alternatively be a restricted
33
+ * OnlyMap expression string; that JSON-safe form is intended for native and
34
+ * cross-process bridges and uses the same compiler as `get-*` attributes.
32
35
  */
33
36
  export interface LayerDescriptor {
34
37
  /** Stable identity — same contract as the `id` attribute. Required. */
@@ -68,7 +71,7 @@ export interface LayerDescriptor {
68
71
  * when an accessor's output changes (the deck-idiomatic contract).
69
72
  */
70
73
  updateTriggers?: Record<string, unknown>;
71
- /** deck.gl props (camelCase), accessors as plain functions passed through. */
74
+ /** deck.gl props (camelCase); accessors may be functions or restricted expression strings. */
72
75
  props?: Record<string, unknown>;
73
76
  /** Per-layer terrain mode (spec: "Terrain") — the `terrain` attribute's twin; absent = the type default. */
74
77
  terrain?: "drape" | "offset" | "off";
@@ -127,6 +130,11 @@ export interface MapControllerOptions {
127
130
  }
128
131
  /** Descriptor → layer IR: the programmatic counterpart of one parse-manifest.ts loop iteration. */
129
132
  export declare function descriptorToIR(desc: LayerDescriptor, onDataLoaded: () => void): LayerIR | null;
133
+ /**
134
+ * Resolve JSON-safe/programmatic descriptors to deterministic snapshots.
135
+ * URL data is represented as an empty pending layer and is never fetched.
136
+ */
137
+ export declare function snapshotDescriptorIR(descriptors: readonly LayerDescriptor[]): LayerIRSnapshot[];
130
138
  /** rAF-batched overlay positioning hook — same flush contract as the DOM front-end's OverlayHost. */
131
139
  export type OverlayPositioner = (viewport: MapViewport | undefined, selection: Selection | null,
132
140
  /** Pointer event behind the latest pick — carries the type of an EMPTY pick (`selection` null), which the selection itself can't. */
@@ -158,6 +166,8 @@ export declare class MapController {
158
166
  private overlayFlushPending;
159
167
  private commitPending;
160
168
  private destroyed;
169
+ private suspended;
170
+ private readonly dataOwner;
161
171
  private firstCommitDone;
162
172
  private readonly stores;
163
173
  /** Origin of the most recent viewport change FRAME — latched through the settle tracker for snapshot reads. */
@@ -282,6 +292,10 @@ export declare class MapController {
282
292
  flyToBounds(bounds: [[number, number], [number, number]], padding?: number, opts?: CameraOptions): void;
283
293
  setView(partial: Partial<CameraState>, opts?: CameraOptions): void;
284
294
  getViewState(): CameraState;
295
+ /** Pause descriptor-owned live transports while retaining canonical map state. */
296
+ suspend(): void;
297
+ /** Reacquire current descriptor transports and reconcile after foregrounding. */
298
+ resume(): void;
285
299
  /** Projects a lng/lat through the current viewport — undefined before the viewport resolves. */
286
300
  project(lngLat: [number, number]): [number, number] | undefined;
287
301
  destroy(): void;
@@ -1,4 +1,4 @@
1
- import { c as re, t as Ae, i as nt, a as Re, s as rt, C as ot, b as it, F as at, A as st, d as lt, R as he, e as ct, p as ut, m as dt, f as ht, g as pt, h as gt } from "./raster-pipeline-D8siq7-4.js";
1
+ import { c as re, t as Ae, i as nt, a as Re, s as rt, C as ot, b as it, F as at, A as st, d as lt, R as he, e as ct, p as ut, m as dt, f as ht, g as pt, h as gt } from "./raster-pipeline-DLrnJK8y.js";
2
2
  import pe from "./index-CW1n5LdO.js";
3
3
  function mt(e, t) {
4
4
  const n = e.length / 3, r = new Uint8ClampedArray(n * 4), o = 0, i = n, a = n * 2;
@@ -1069,7 +1069,7 @@ A.set(m.Zstd, () => import("./zstd-jXobGRcq.js").then((e) => e.decode));
1069
1069
  A.set(m.Jpeg, () => Promise.resolve(oe));
1070
1070
  A.set(m.Jpeg6, () => Promise.resolve(oe));
1071
1071
  A.set(m.Webp, () => Promise.resolve(oe));
1072
- A.set(m.Lerc, () => import("./lerc-CbTjQ7uI.js").then((e) => e.l).then((e) => e.decode));
1072
+ A.set(m.Lerc, () => import("./lerc-C6k7EzSN.js").then((e) => e.l).then((e) => e.decode));
1073
1073
  async function ie(e, t, n) {
1074
1074
  const r = A.get(t);
1075
1075
  if (!r)
@@ -1,5 +1,5 @@
1
1
  import { w as ae } from "./mgrs-BY9bIvp4.js";
2
- import { am as ce, an as le, ao as ee, ap as te, aq as ue, b as he, ar as de, l as Z, as as fe, d as pe, at as me, au as ge, av as ve, aw as ne } from "./index-1UgNlfGR.js";
2
+ import { am as ce, an as le, ao as ee, ap as te, aq as ue, b as he, ar as de, l as Z, as as fe, d as pe, at as me, au as ge, av as ve, aw as ne } from "./index-7B-6Cbzu.js";
3
3
  function Pe(o, e, t) {
4
4
  const { projectedCorners: n } = e, { topLeft: s, topRight: r, bottomRight: a, bottomLeft: i } = n, c = t(s[0], s[1]), u = t(r[0], r[1]), l = t(a[0], a[1]), d = t(i[0], i[1]), f = [
5
5
  c,
@@ -1,4 +1,4 @@
1
- import type { Selection } from "@nika-js/onlymap";
1
+ import type { LayerDescriptor, Selection } from "@nika-js/onlymap";
2
2
  export interface OmLayerProps {
3
3
  /** Stable identity — same contract as the `id` attribute. */
4
4
  id: string;
@@ -20,6 +20,9 @@ export interface OmLayerProps {
20
20
  filterSoftRange?: [number, number];
21
21
  filterCategoryField?: string;
22
22
  filterCategories?: unknown[];
23
+ /** Dashed path styling, mirroring `dash` / `dash-justified`. */
24
+ dash?: [number, number];
25
+ dashJustified?: boolean;
23
26
  /** Stream options for ws(s):// data URLs. `streamKey` is the upsert identity field (the `key` attribute — `key` itself is reserved by React). */
24
27
  source?: string;
25
28
  streamKey?: string;
@@ -37,4 +40,6 @@ export interface OmLayerProps {
37
40
  /** Everything else passes through as deck.gl props (camelCase): getPosition, radiusMinPixels, visible, opacity, pickable, … */
38
41
  [deckProp: string]: unknown;
39
42
  }
43
+ /** @internal Pure React-props → programmatic descriptor adapter used by parity tests. */
44
+ export declare function reactLayerPropsToDescriptor(props: OmLayerProps): LayerDescriptor;
40
45
  export declare function OmLayer(props: OmLayerProps): null;