@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
@@ -1,4 +1,4 @@
1
- import { ag as Be, ah as le, ai as ce, aj as De, ak as Oe, al as ke } from "./index-1UgNlfGR.js";
1
+ import { ag as Be, ah as le, ai as ce, aj as De, ak as Oe, al as ke } from "./index-7B-6Cbzu.js";
2
2
  import { y as ve, a as he, z as G, R as J, A as ue, C as Fe, F as je, n as xe, S as Ie, E as Ne } from "./recordbatch-Bpc0uxFn.js";
3
3
  import { g as V, a as fe, b as Le, c as Ue, d as Me, e as qe, m as Ve } from "./table-accessors-CYWTzpQI.js";
4
4
  import { c as $e } from "./convert-arrow-schema-DrAihRf9.js";
@@ -1,4 +1,4 @@
1
- import { ak as Bt, ax as Xt, ay as Yt, az as Us } from "./index-1UgNlfGR.js";
1
+ import { ak as Bt, ax as Xt, ay as Yt, az as Us } from "./index-7B-6Cbzu.js";
2
2
  import { w as gs, t as Hs, f as Ws, m as Qs } from "./mgrs-BY9bIvp4.js";
3
3
  import { c as Xs } from "./convert-arrow-schema-DrAihRf9.js";
4
4
  import { y as Ys, A as bt, a as Ks, z as Vs, R as Zs } from "./recordbatch-Bpc0uxFn.js";
@@ -1,4 +1,4 @@
1
- import { ae as _t, af as Ct } from "./index-1UgNlfGR.js";
1
+ import { ae as _t, af as Ct } from "./index-7B-6Cbzu.js";
2
2
  function Yt(e, r, t = 2, i, o = "xy") {
3
3
  const s = r && r.length, l = s ? r[0] * t : e.length;
4
4
  let c = Ut(e, 0, l, t, !0, i && i[0], o);
@@ -1,5 +1,5 @@
1
- import { i as E, j as S, k as R, o as N, p as h, q as w, s as O, t as W, v as x, w as I, x as B, y as _, A as P, B as k, E as $, F as z, H as v, I as F, J as C, K as U, N as p, O as M } from "./index-1UgNlfGR.js";
2
- import { P as $e, R as ze, _ as ve, Q as Ce, S as Ue, T as Me, U as je, X as De, Y as Je, Z as qe, $ as He, a0 as Ve, a1 as Ge, a2 as Ke, a3 as Qe, a4 as Xe, a5 as Ye, a6 as Ze, a7 as et, a8 as tt, a9 as nt, aa as rt, ab as at, ac as st, ad as ot } from "./index-1UgNlfGR.js";
1
+ import { i as E, j as S, k as R, o as N, p as h, q as w, s as O, t as W, v as x, w as I, x as B, y as _, A as P, B as k, E as $, F as z, H as v, I as F, J as C, K as U, N as p, O as M } from "./index-7B-6Cbzu.js";
2
+ import { P as $e, R as ze, _ as ve, Q as Ce, S as Ue, T as Me, U as je, X as De, Y as Je, Z as qe, $ as He, a0 as Ve, a1 as Ge, a2 as Ke, a3 as Qe, a4 as Xe, a5 as Ye, a6 as Ze, a7 as et, a8 as tt, a9 as nt, aa as rt, ab as at, ac as st, ad as ot } from "./index-7B-6Cbzu.js";
3
3
  import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
4
4
  async function J(t, e, n = {}, r = {}) {
5
5
  const a = E(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ import "./widgets/built-in";
16
16
  import "./widgets/ifc";
17
17
  import "./widgets/ifc-clash";
18
18
  import "./measure-controller";
19
+ import "./region-export-controller";
19
20
  import "./elements/om-map";
20
21
  import "./elements/om-layer";
21
22
  import "./elements/om-widget";
@@ -35,6 +36,7 @@ import { configureTelemetry } from "./telemetry";
35
36
  import { configureLicense } from "./license";
36
37
  import { validateManifestString } from "./validation";
37
38
  import { snapshotIR } from "./ir-snapshot";
39
+ import { snapshotDescriptorIR } from "./programmatic";
38
40
  import { resolveImageOverlay } from "./image-overlay";
39
41
  export { registerLayer, getLayerSchema } from "./layer-registry";
40
42
  export type { LayerSchema, PropDescriptor, PropKind } from "./layer-registry";
@@ -66,9 +68,9 @@ export declare function configureIfc(options: {
66
68
  }): Promise<void>;
67
69
  export type { TelemetryConfig, TelemetrySnapshot } from "./telemetry";
68
70
  export { configureLicense, getEntitlements } from "./license";
69
- export type { Entitlements } from "./license";
71
+ export type { Entitlements, LicenseIdentity } from "./license";
70
72
  export type { RuntimeContext } from "./ctx";
71
- export { MapController, descriptorToIR } from "./programmatic";
73
+ export { MapController, descriptorToIR, snapshotDescriptorIR } from "./programmatic";
72
74
  export type { LayerDescriptor, MapControllerOptions, CameraState, OverlayPositioner, PickListener } from "./programmatic";
73
75
  export { MANAGED_SLOTS, LEGACY_POSITION_ALIASES, ALL_POSITION_VALUES, FOLD_SIDES, resolveSlot, slotLayout, slotContainerStyle, foldSideForSlot, foldToggleSlot, foldDrawerStyle, foldPanelStyle, foldToggleStyle, resolveFoldBreakpointPx, shouldFoldAtWidth, DEFAULT_FOLD_BREAKPOINT_PX, FOLD_HYSTERESIS_PX, parseWidgetStyle, WIDGET_STYLE_KEY_NAMES, } from "./widget-layout";
74
76
  export type { ManagedSlot, WidgetSlot, FoldSide, SlotLayout, WidgetStyleParse } from "./widget-layout";
@@ -127,6 +129,7 @@ export declare const OmMap: {
127
129
  configureLicense: typeof configureLicense;
128
130
  validate: typeof validateManifestString;
129
131
  snapshotIR: typeof snapshotIR;
132
+ snapshotDescriptorIR: typeof snapshotDescriptorIR;
130
133
  resolveImageOverlay: typeof resolveImageOverlay;
131
134
  loadRasterModule: typeof loadRasterModule;
132
135
  };
@@ -22,7 +22,7 @@
22
22
  * (snapshots are side-effect-free; a URL-backed layer shows the same empty
23
23
  * placeholder the live Q6 pre-fetch state has).
24
24
  */
25
- import type { LayerMeta, LayerFilter, LayerAssetState } from "./ir";
25
+ import type { LayerIR, LayerMeta, LayerFilter, LayerAssetState } from "./ir";
26
26
  import type { Shape } from "./expr";
27
27
  export interface LayerIRSnapshot {
28
28
  id: string;
@@ -49,6 +49,8 @@ export interface LayerIRSnapshot {
49
49
  props: Record<string, unknown>;
50
50
  updateTriggers: Record<string, string>;
51
51
  }
52
+ /** Convert one already-resolved layer IR to the public deterministic JSON-safe form. */
53
+ export declare function snapshotLayerIR(ir: LayerIR): LayerIRSnapshot;
52
54
  /**
53
55
  * Resolves a manifest to JSON-safe layer IR snapshots.
54
56
  *
@@ -11,13 +11,34 @@
11
11
  * Two things fall out of using the loader rather than a static tileset:
12
12
  *
13
13
  * - No `site-origin`/`site-heading`/`site-scale` needed. `loadIfc` already
14
- * reads the file's own georeference and bakes it into the tileset it
15
- * returns (or falls back honestly when the file declares none) — the
16
- * attributes exist for OVERRIDING a wrong or missing reading, not for
17
- * restating what was already computed. (Not wired up in this first pass:
18
- * an authored `site-origin` on a `BIMLayer` is currently ignored rather
19
- * than overriding the loader's own placement — an honest, documented gap
20
- * rather than a half-built override path.)
14
+ * reads the file's own georeference and bakes the HORIZONTAL placement
15
+ * (eastings/northings/heading/scale) into the tileset it returns (or
16
+ * falls back honestly when the file declares none). `site-origin` itself
17
+ * is NOT wired up on `BIMLayer` (an authored one is ignored) it rides
18
+ * runtime-core.ts's `tilesetBakedFrame`/`tilesetPlacementMatrix`
19
+ * machinery, which reads a tileset.json's baked root transform
20
+ * SYNCHRONOUSLY off the layer's `data` prop at construction time, and
21
+ * BIMLayer's tileset is an in-browser blob URL that doesn't exist until
22
+ * `loadIfc` resolves asynchronously inside `updateState` below — an
23
+ * honest, documented gap rather than a half-built override path.
24
+ * - The VERTICAL placement, by contrast, IS automatic — matching how the
25
+ * BIM workbench's `ifc-loader` WIDGET already behaves, not a separate
26
+ * opt-in. `IfcMapConversion`'s `OrthogonalHeight` (this model's real
27
+ * absolute elevation) is computed by `loadIfc` but left out of the
28
+ * tileset's own baked transform (see that field's doc comment in
29
+ * src/ifc.ts) — correct on a flat, no-`terrain` basemap (a local Z≈0
30
+ * model sits right on a Z=0 ground plane), wrong once a REAL terrain
31
+ * surface is active (whose elevation at any inhabited location is
32
+ * essentially never 0 — the model ends up buried inside the mesh).
33
+ * `runtime-core.ts` reports whether terrain is active via a
34
+ * `terrainActive` prop (the same `carriesGeoreference`-gated channel
35
+ * `onGeoreference` already rides); `renderLayers` below applies
36
+ * `OrthogonalHeight` as an ENU re-placement AT the model's own already-
37
+ * correct lon/lat (same site point, just a non-zero height component)
38
+ * only when that prop is true — reusing `tilesetPlacementMatrix`, the
39
+ * exact mechanism `ifc-loader`'s own manual `site-origin` override rides,
40
+ * just triggered automatically instead of requiring the author (or a
41
+ * widget) to compute and restate a number that's already known.
21
42
  * - The outline overlay is automatic. `loadIfc` already returns an
22
43
  * `edgesUrl` alongside the tileset; a separate `<om-layer type="PathLayer"
23
44
  * data="…/edges.json">` was only ever there because a plain Tile3DLayer
@@ -65,6 +86,8 @@ interface LoadedBim {
65
86
  lonLat: [number, number];
66
87
  heading: number;
67
88
  scale: number;
89
+ /** The file's own `IfcMapConversion.OrthogonalHeight`, undefined when it never declared one — see renderLayers' `terrainActive` handling. */
90
+ orthogonalHeight?: number;
68
91
  revoke(): void;
69
92
  }
70
93
  export interface BIMLayerProps {
@@ -207,7 +207,7 @@ export declare class FeatureMeshLayer extends CompositeLayer<FeatureMeshLayerOut
207
207
  }> | null;
208
208
  texture: string | HTMLCanvasElement | import("@luma.gl/core").Texture | import("@luma.gl/core").TextureProps | HTMLImageElement | ImageData | HTMLVideoElement | ImageBitmap | Promise<import("@deck.gl/core").TextureSource>;
209
209
  textureParameters: import("@luma.gl/core").SamplerProps | null;
210
- getPosition: readonly [number, number, number] | readonly [number, number] | Readonly<Float32Array<ArrayBufferLike>> | Readonly<Float64Array<ArrayBufferLike>> | import("@deck.gl/core").AccessorFunction<unknown, import("@deck.gl/core").Position>;
210
+ getPosition: readonly [number, number] | readonly [number, number, number] | Readonly<Float32Array<ArrayBufferLike>> | Readonly<Float64Array<ArrayBufferLike>> | import("@deck.gl/core").AccessorFunction<unknown, import("@deck.gl/core").Position>;
211
211
  getColor: readonly [number, number, number] | readonly [number, number, number, number] | Readonly<Uint8Array<ArrayBufferLike>> | Readonly<Uint8ClampedArray<ArrayBufferLike>> | import("@deck.gl/core").AccessorFunction<unknown, import("@deck.gl/core").Color>;
212
212
  getOrientation: readonly [number, number, number] | import("@deck.gl/core").AccessorFunction<unknown, readonly [number, number, number]>;
213
213
  getScale: readonly [number, number, number] | import("@deck.gl/core").AccessorFunction<unknown, readonly [number, number, number]>;
@@ -31,6 +31,19 @@ export interface PopupLayerProps {
31
31
  getSubtext?: ((d: unknown) => string) | null;
32
32
  getColor?: unknown;
33
33
  getSize?: unknown;
34
+ /**
35
+ * Overrides the layout's default `[x, y]` screen-pixel offset. Not
36
+ * attribute-exposed (an internal escape hatch, set via `patchAnimatedProps`
37
+ * — same non-string-prop-injection precedent as a SimpleMeshLayer's
38
+ * `mesh`) — the volume gizmo's elevation tooltip uses this so it clears
39
+ * the gizmo mesh by a CONSTANT pixel gap at every zoom, which a world-space
40
+ * (meters) offset can't do: at low zoom a fixed meter offset shrinks to
41
+ * fewer pixels than the badge itself needs, causing exactly the overlap a
42
+ * real user reported.
43
+ */
44
+ pixelOffset?: [number, number];
45
+ /** Raw WebGL/GPU state passthrough (e.g. `{ depthTest: false }`) — same internal escape hatch as `pixelOffset`, not attribute-exposed. */
46
+ parameters?: Record<string, unknown>;
34
47
  updateTriggers?: Record<string, unknown>;
35
48
  }
36
49
  export declare class PopupLayer extends CompositeLayer<PopupLayerProps> {
@@ -45,7 +45,7 @@ export type LegendSpec = {
45
45
  * THE LEGEND, not the map (the map samples the GPU sprite; a 1-D CSS
46
46
  * gradient bar only needs a few stops and the eye fills in the rest).
47
47
  * Matplotlib reference colors at 0/.25/.5/.75/1. The sprite ships ~107
48
- * colormaps; this curated dozen covers the ones worth suggesting — an
48
+ * colormaps; this curated set covers the ones worth suggesting — an
49
49
  * authored name outside it still RENDERS (sprite lookup), it just gets the
50
50
  * single-swatch legend fallback.
51
51
  */
@@ -1,4 +1,4 @@
1
- import { C as a, D as s } from "./raster-0b0nSHUh.js";
1
+ import { C as a, D as s } from "./raster-Cuzhibe2.js";
2
2
  const D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
3
  __proto__: null
4
4
  }, Symbol.toStringTag, { value: "Module" }));
@@ -8,7 +8,7 @@ var t;
8
8
  })(t || (t = {}));
9
9
  let l = !1;
10
10
  async function d() {
11
- const e = await import("./LercDecode.es-CJnypw8j.js");
11
+ const e = await import("./LercDecode.es-BOJJr6Gx.js");
12
12
  return l || (await e.load(), l = !0), e;
13
13
  }
14
14
  async function i(e, r) {
package/dist/license.d.ts CHANGED
@@ -7,13 +7,14 @@
7
7
  * unlock flash, CI works offline):
8
8
  *
9
9
  * om_live_<base64url(payload)>.<base64url(signature)>
10
- * payload = { plan, domains: ["acme.com", "*.acme.com" | "*"], exp, keyId }
10
+ * payload = { plan, domains?: ["acme.com", "*.acme.com" | "*"], apps?: ["com.acme.app"], exp, keyId }
11
11
  *
12
12
  * Ed25519 via WebCrypto against the public key embedded below; mint with
13
13
  * dev/tools/sign-license.mjs (private key never in the repo). Keys are
14
- * PUBLISHABLE, origin-restricted via the `domains` claim (the MapTiler
15
- * basemap-key precedent) — they MAY appear in markup, unlike data
16
- * credentials.
14
+ * PUBLISHABLE, deployment-restricted via a web `domains` claim and/or a
15
+ * packaged-app `apps` claim — they MAY appear in markup, unlike data
16
+ * credentials. Native shells must obtain app identity from trusted platform
17
+ * APIs, never from bridge JSON controlled by page code.
17
18
  *
18
19
  * Decisions (spec, RESOLVED 2026-07-14; REVISED 2026-08-05): free tier =
19
20
  * 5 layers / 25k rows per layer / 20 MB fetch; any paid plan hides the
@@ -46,6 +47,10 @@ export interface Entitlements {
46
47
  keyId: string | null;
47
48
  }
48
49
  export declare const FREE_TIER: Entitlements;
50
+ /** Trusted packaged-app identity supplied by the native host, never page/bridge input. */
51
+ export interface LicenseIdentity {
52
+ appId: string;
53
+ }
49
54
  /** The dev context's entitlements: every cap lifted, badge KEPT (attribution is an obligation, not a cap — and it carries the license pointer into shipped artifacts). */
50
55
  export declare const DEV_TIER: Entitlements;
51
56
  /**
@@ -68,12 +73,14 @@ export declare function licenseSettled(): boolean;
68
73
  export declare function subscribeLicense(fn: () => void): () => void;
69
74
  /** `*` matches anything; `*.acme.com` matches acme.com and every subdomain; otherwise exact. */
70
75
  export declare function domainMatches(hostname: string, domains: string[]): boolean;
76
+ /** App/bundle identifiers are platform identities and therefore exact, case-sensitive matches. */
77
+ export declare function appMatches(appId: string, apps: string[]): boolean;
71
78
  /**
72
79
  * Verify a key and swap entitlements. Async because WebCrypto is; gates
73
80
  * fail open until it settles. Any failure lands on the free tier with a
74
81
  * warning — a bad key must never break the map.
75
82
  */
76
- export declare function configureLicense(key: string): Promise<void>;
83
+ export declare function configureLicense(key: string, identity?: LicenseIdentity): Promise<void>;
77
84
  /** One layer whose data the row cap cut down this pass — drives the viewer-facing notice. */
78
85
  export interface TruncatedLayer {
79
86
  id: string;