@nika-js/onlymap 0.6.1 → 0.6.4

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 (63) hide show
  1. package/CHANGELOG.md +106 -1
  2. package/README.md +28 -15
  3. package/dist/{LercDecode.es-CJnypw8j.js → LercDecode.es-D5in29tf.js} +1 -1
  4. package/dist/{basemap-DrQ0-eyR.js → basemap-C0pFT3AO.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 +34 -4
  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 +20 -0
  12. package/dist/elements/om-overlay.d.ts +12 -0
  13. package/dist/geodesy.d.ts +32 -3
  14. package/dist/{geoparquet-Dix4lTNy.js → geoparquet-By98JVB0.js} +1 -1
  15. package/dist/html-data.d.ts +2 -2
  16. package/dist/{index-BQMjW5w0.js → index-Bx9GFkrn.js} +1 -1
  17. package/dist/{index-CXPaeisL.js → index-CqC4sW_k.js} +1 -1
  18. package/dist/{index-1UgNlfGR.js → index-Cxo9mCw_.js} +30947 -27785
  19. package/dist/{index-B_1PPJgC.js → index-olfncHIq.js} +1 -1
  20. package/dist/{index-CAuT5j9Y.js → index-tnlYDALL.js} +2 -2
  21. package/dist/index.d.ts +8 -3
  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-gKDDtc69.js} +2 -2
  28. package/dist/license.d.ts +25 -4
  29. package/dist/measure-controller.d.ts +482 -4
  30. package/dist/onlymap.standalone.js +53976 -50804
  31. package/dist/onlymapjs.js +42 -40
  32. package/dist/parse-manifest.d.ts +3 -0
  33. package/dist/programmatic.d.ts +34 -5
  34. package/dist/{raster-0b0nSHUh.js → raster-Cl5m3KsC.js} +2 -2
  35. package/dist/{raster-pipeline-D8siq7-4.js → raster-pipeline-hJGxIwYx.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-hRDavRGV.js} +2 -2
  53. package/docs/3d-assets.md +49 -1
  54. package/docs/live-data.md +26 -1
  55. package/docs/react.md +9 -1
  56. package/docs/testing.md +2 -0
  57. package/llms.txt +10 -5
  58. package/onlymapjs.html-data.json +161 -2
  59. package/package.json +4 -2
  60. package/skills/onlymapjs/SKILL.md +11 -1
  61. package/skills/onlymapjs/references/react.md +2 -2
  62. package/skills/onlymapjs/references/syntax.md +20 -8
  63. package/skills/onlymapjs/references/testing.md +6 -0
@@ -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-Cxo9mCw_.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,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-Cxo9mCw_.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-Cxo9mCw_.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,10 +68,12 @@ 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";
75
+ export { releaseDataOwner } from "./data-layer";
76
+ export type { DataTransportOwner } from "./data-layer";
73
77
  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
78
  export type { ManagedSlot, WidgetSlot, FoldSide, SlotLayout, WidgetStyleParse } from "./widget-layout";
75
79
  export { auditLayout, settleLayout, DEFAULT_AUDIT_WIDTHS, EDGE_TOLERANCE_PX, AUDIT_EXEMPTIONS } from "./layout-audit";
@@ -83,7 +87,7 @@ export type { MapViewport } from "./basemap";
83
87
  export { registerAction } from "./actions";
84
88
  export { distanceMeters, pathLengthMeters, ringAreaMeters2, ringPerimeterMeters, ringEnclosesPole, midpoint, getMeasureRadiusMeters, setMeasureRadiusMeters, WGS84_MEAN_RADIUS_M, type LngLat, } from "./geodesy";
85
89
  export { formatLength, formatArea, niceNumber, scaleBarStep, parseUnitSystem, UNIT_SYSTEMS, type UnitSystem } from "./units";
86
- export type { MeasureMode, MeasureReadout } from "./measure-controller";
90
+ export type { MeasureMode, MeasureReadout, ProfilePoint } from "./measure-controller";
87
91
  export type { ActionHandler } from "./actions";
88
92
  export { validateManifestString, validateManifest } from "./validation";
89
93
  export type { ValidationResult, ValidationEntry } from "./validation";
@@ -127,6 +131,7 @@ export declare const OmMap: {
127
131
  configureLicense: typeof configureLicense;
128
132
  validate: typeof validateManifestString;
129
133
  snapshotIR: typeof snapshotIR;
134
+ snapshotDescriptorIR: typeof snapshotDescriptorIR;
130
135
  resolveImageOverlay: typeof resolveImageOverlay;
131
136
  loadRasterModule: typeof loadRasterModule;
132
137
  };
@@ -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-Cl5m3KsC.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-D5in29tf.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,14 +7,29 @@
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
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
16
  * credentials.
17
17
  *
18
+ * The two claims are NOT equally enforceable, and neither is a security
19
+ * boundary. `domains` is checked against a hostname the browser pins;
20
+ * `apps` is checked against an identifier the caller passes in, so any page
21
+ * holding the key can assert any app id (bundle ids are public and app
22
+ * bundles unpack trivially). Native shells must therefore read app identity
23
+ * from trusted platform APIs, never from bridge JSON controlled by page
24
+ * code — but that is a host obligation this module cannot verify. No
25
+ * origin-sniffing gate guards it either: packaged hosts land on origins
26
+ * indistinguishable from the web (Capacitor Android serves http://localhost,
27
+ * WebViewAssetLoader serves any configured https domain), so a heuristic
28
+ * would downgrade paying customers to the free tier — and the packaged
29
+ * contexts worth protecting already lift every cap as DEV contexts below.
30
+ * Both claims are deterrents that make reuse attributable via `keyId`;
31
+ * packaged-app enforcement is LEGAL, not technical (see LICENSE.md).
32
+ *
18
33
  * Decisions (spec, RESOLVED 2026-07-14; REVISED 2026-08-05): free tier =
19
34
  * 5 layers / 25k rows per layer / 20 MB fetch; any paid plan hides the
20
35
  * badge; violations are per-layer hard drops with loud structured errors;
@@ -46,6 +61,10 @@ export interface Entitlements {
46
61
  keyId: string | null;
47
62
  }
48
63
  export declare const FREE_TIER: Entitlements;
64
+ /** Trusted packaged-app identity supplied by the native host, never page/bridge input. */
65
+ export interface LicenseIdentity {
66
+ appId: string;
67
+ }
49
68
  /** 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
69
  export declare const DEV_TIER: Entitlements;
51
70
  /**
@@ -68,12 +87,14 @@ export declare function licenseSettled(): boolean;
68
87
  export declare function subscribeLicense(fn: () => void): () => void;
69
88
  /** `*` matches anything; `*.acme.com` matches acme.com and every subdomain; otherwise exact. */
70
89
  export declare function domainMatches(hostname: string, domains: string[]): boolean;
90
+ /** App/bundle identifiers are platform identities and therefore exact, case-sensitive matches. */
91
+ export declare function appMatches(appId: string, apps: string[]): boolean;
71
92
  /**
72
93
  * Verify a key and swap entitlements. Async because WebCrypto is; gates
73
94
  * fail open until it settles. Any failure lands on the free tier with a
74
95
  * warning — a bad key must never break the map.
75
96
  */
76
- export declare function configureLicense(key: string): Promise<void>;
97
+ export declare function configureLicense(key: string, identity?: LicenseIdentity): Promise<void>;
77
98
  /** One layer whose data the row cap cut down this pass — drives the viewer-facing notice. */
78
99
  export interface TruncatedLayer {
79
100
  id: string;