@nika-js/onlymap 0.2.2 → 0.2.3

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.
@@ -1,4 +1,4 @@
1
- import { a2 as _t, a3 as Ct } from "./index-oE1Kouy1.js";
1
+ import { a2 as _t, a3 as Ct } from "./index-BxzDKZpu.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,8 +1,8 @@
1
1
  var R = Object.defineProperty;
2
2
  var N = (t, e, r) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var u = (t, e, r) => N(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { c as W, W as x, d as O, e as _, f as m, h as g, j as P, s as z, n as I, k as B, m as k, o as $, p as C, q as F, r as M, u as U, v as D, w as L, x as j, y as v, z as T, A as J } from "./index-oE1Kouy1.js";
5
- import { F as Ue, R as De, _ as je, B as ve, C as Je, D as qe, E as Ve, G as Ge, H as He, I as Ke, J as Qe, K as Xe, L as Ye, M as Ze, N as er, O as rr, P as tr, Q as nr, S as ar, T as sr, U as cr, V as or, X as ir, Y as ur, Z as fr } from "./index-oE1Kouy1.js";
4
+ import { c as W, W as x, d as O, e as _, f as m, h as g, j as P, s as z, n as I, k as B, m as k, o as $, p as C, q as F, r as M, u as U, v as D, w as L, x as j, y as v, z as T, A as J } from "./index-BxzDKZpu.js";
5
+ import { F as Ue, R as De, _ as je, B as ve, C as Je, D as qe, E as Ve, G as Ge, H as He, I as Ke, J as Qe, K as Xe, L as Ye, M as Ze, N as er, O as rr, P as tr, Q as nr, S as ar, T as sr, U as cr, V as or, X as ir, Y as ur, Z as fr } from "./index-BxzDKZpu.js";
6
6
  import { g as q, i as V } from "./table-accessors-DBjWgN0C.js";
7
7
  async function G(t, e, r = {}, n = {}) {
8
8
  const a = W(t), s = x.getWorkerFarm(r), { source: c } = r, o = { name: a, source: c };
@@ -1,7 +1,7 @@
1
1
  var Ri = Object.defineProperty;
2
2
  var Ii = (t, a, i) => a in t ? Ri(t, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[a] = i;
3
3
  var N = (t, a, i) => Ii(t, typeof a != "symbol" ? a + "" : a, i);
4
- import { t as zt, $ as ca, a0 as ua, a1 as wi } from "./index-oE1Kouy1.js";
4
+ import { t as zt, $ as ca, a0 as ua, a1 as wi } from "./index-BxzDKZpu.js";
5
5
  import { c as Si } from "./convert-arrow-schema-CvZ3cT5m.js";
6
6
  import { ai as Ni, af as Nt, h as Ci, au as Pi, a2 as Oi } from "./recordbatch-HRu0SMKp.js";
7
7
  class Ti {
package/dist/index.d.ts CHANGED
@@ -27,6 +27,8 @@ import { registerSource, registerFormat, configureData } from "./data-layer";
27
27
  import { registerWidget } from "./widget-registry";
28
28
  import { registerAction } from "./actions";
29
29
  import { registerBasemap, configureBasemap } from "./basemap-registry";
30
+ import { configureTelemetry } from "./telemetry";
31
+ import { configureLicense } from "./license";
30
32
  import { validateManifestString } from "./validation";
31
33
  import { snapshotIR } from "./ir-snapshot";
32
34
  export { registerLayer, getLayerSchema } from "./layer-registry";
@@ -43,6 +45,10 @@ export { registerWidget } from "./widget-registry";
43
45
  export type { WidgetImpl, WidgetHost } from "./widget-registry";
44
46
  export { registerBasemap, configureBasemap, getBasemap } from "./basemap-registry";
45
47
  export type { BasemapPreset, BasemapStyle } from "./basemap-registry";
48
+ export { configureTelemetry } from "./telemetry";
49
+ export type { TelemetryConfig, TelemetrySnapshot } from "./telemetry";
50
+ export { configureLicense, getEntitlements } from "./license";
51
+ export type { Entitlements } from "./license";
46
52
  export type { RuntimeContext } from "./ctx";
47
53
  export { MapController, descriptorToIR } from "./programmatic";
48
54
  export type { LayerDescriptor, MapControllerOptions, CameraState, OverlayPositioner, PickListener } from "./programmatic";
@@ -83,6 +89,8 @@ export declare const OmMap: {
83
89
  registerBasemap: typeof registerBasemap;
84
90
  configureBasemap: typeof configureBasemap;
85
91
  configureData: typeof configureData;
92
+ configureTelemetry: typeof configureTelemetry;
93
+ configureLicense: typeof configureLicense;
86
94
  validate: typeof validateManifestString;
87
95
  snapshotIR: typeof snapshotIR;
88
96
  };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Runtime-internal id namespace — dependency-free so low-level modules
3
+ * (license gates, data layer) can consult it without importing the action
4
+ * registry. `actions.ts` re-exports it as the historical home.
5
+ */
6
+ /** Ids in this namespace are runtime-managed plumbing — excluded from ctx.layers, telemetry, and license gate counting. */
7
+ export declare const RUNTIME_INTERNAL_PREFIX = "__onlymapjs-";
package/dist/ir-diff.d.ts CHANGED
@@ -10,7 +10,7 @@ import type { LayerIR } from "./ir";
10
10
  export interface LayerIRDiff {
11
11
  /** Layers whose `data` reference changed (or that are new) — fires `data:<id>` tokens. */
12
12
  changedDataIds: Set<string>;
13
- /** A layer was added/removed or toggled visibility — fires the `layers` token. */
13
+ /** A layer was added/removed, toggled visibility, or changed its declarative filter — fires the `layers` token. */
14
14
  layersChanged: boolean;
15
15
  }
16
16
  export declare function diffLayerIRs(previous: ReadonlyMap<string, LayerIR>, next: ReadonlyMap<string, LayerIR>): LayerIRDiff;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * License & entitlements (spec: "Monetization Gates", M1). The single
3
+ * state every gate reads — license parsing/verification and enforcement
4
+ * points stay decoupled.
5
+ *
6
+ * A key IS a signed token (self-verifying — no server round-trip, no
7
+ * unlock flash, CI works offline):
8
+ *
9
+ * om_live_<base64url(payload)>.<base64url(signature)>
10
+ * payload = { plan, domains: ["acme.com", "*.acme.com" | "*"], exp, keyId }
11
+ *
12
+ * Ed25519 via WebCrypto against the public key embedded below; mint with
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.
17
+ *
18
+ * Decisions (spec, RESOLVED 2026-07-14): free tier = 5 layers / 25k rows
19
+ * per layer / 20 MB fetch; any paid plan hides the badge; NO localhost
20
+ * exemption (gates apply identically everywhere — no dev-vs-prod
21
+ * mismatches); violations are per-layer hard drops with loud structured
22
+ * errors; no feature is gated at launch.
23
+ *
24
+ * Failure semantics: invalid/expired/mismatched keys → free tier + one
25
+ * console warning — never a broken map. While a key verifies (WebCrypto
26
+ * is async; sub-millisecond in practice) gates FAIL OPEN so a paid page
27
+ * never flashes gate errors; the settle re-reconciles.
28
+ */
29
+ import type { LayerIR } from "./ir";
30
+ import type { ValidationEntry } from "./validation";
31
+ export interface Entitlements {
32
+ plan: string;
33
+ maxLayers: number;
34
+ maxRowsPerLayer: number;
35
+ maxFetchBytes: number;
36
+ hideBadge: boolean;
37
+ keyId: string | null;
38
+ }
39
+ export declare const FREE_TIER: Entitlements;
40
+ export declare function getEntitlements(): Readonly<Entitlements>;
41
+ /** True while a key is being verified — gates fail open so a paid page never flashes violations. */
42
+ export declare function licenseSettled(): boolean;
43
+ /** Notified whenever entitlements settle or change (RuntimeCore re-reconciles; the badge re-evaluates). */
44
+ export declare function subscribeLicense(fn: () => void): () => void;
45
+ /** `*` matches anything; `*.acme.com` matches acme.com and every subdomain; otherwise exact. */
46
+ export declare function domainMatches(hostname: string, domains: string[]): boolean;
47
+ /**
48
+ * Verify a key and swap entitlements. Async because WebCrypto is; gates
49
+ * fail open until it settles. Any failure lands on the free tier with a
50
+ * warning — a bad key must never break the map.
51
+ */
52
+ export declare function configureLicense(key: string): Promise<void>;
53
+ /**
54
+ * DECIDED violation mode: per-layer hard drop, deterministic — layers past
55
+ * the count cap (manifest order) don't render; an over-cap layer renders
56
+ * NOTHING (never a truncated subset — truncation looks like a data bug and
57
+ * hides the gate). Runtime-internal layers (trace temps, draw preview,
58
+ * tooltip plumbing) neither count nor drop. Violations report once per
59
+ * (layer, reason) through `report` until the violation clears (`warned` is
60
+ * the caller-owned dedup set).
61
+ */
62
+ export declare function applyLicenseGates(irs: LayerIR[], report: (entry: ValidationEntry) => void, warned: Set<string>): LayerIR[];
63
+ export declare function setLicensePublicKeyForTests(rawKey: Uint8Array | null): void;
64
+ export declare function resetLicenseForTests(): void;
package/dist/onlymapjs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { an as e, ao as r, ap as o, aq as t, ar as i, as as n, at as l, au as m, av as c, aw as p, ax as g, ay as u, az as d, aA as x, aB as S, aC as B, aD as C, aE as M, aF as b, aG as f, aH as w, aI as A, aJ as I, aK as T, aL as v, aM as y, aN as D, aO as F, aP as R, aQ as h, aR as E, aS as L } from "./index-oE1Kouy1.js";
1
+ import { an as e, ao as r, ap as o, aq as t, ar as i, as as n, at as l, au as m, av as c, aw as g, ax as p, ay as u, az as d, aA as f, aB as x, aC as S, aD as T, aE as B, aF as C, aG as M, aH as b, aI as w, aJ as y, aK as A, aL as I, aM as v, aN as D, aO as E, aP as F, aQ as L, aR as R, aS as h, aT as z, aU as H, aV as J } from "./index-BxzDKZpu.js";
2
2
  export {
3
3
  e as AccessorCache,
4
4
  r as CompileError,
@@ -9,27 +9,30 @@ export {
9
9
  l as compileExpression,
10
10
  m as compileFullJsAccessorBlockInSandbox,
11
11
  c as computeTimeline,
12
- p as configureBasemap,
13
- g as configureData,
14
- u as descriptorToIR,
15
- d as destroySandbox,
16
- x as evaluateInSandbox,
17
- S as getBasemap,
18
- B as getLayerSchema,
19
- C as isBrowser,
20
- M as isColumnar,
21
- b as mountForTest,
22
- f as normalizeData,
23
- w as parseDurationMs,
24
- A as registerAction,
25
- I as registerBasemap,
26
- T as registerFormat,
27
- v as registerLayer,
28
- y as registerSource,
29
- D as registerWidget,
30
- F as rowAt,
31
- R as sandboxHtml,
32
- h as snapshotIR,
33
- E as validateManifest,
34
- L as validateManifestString
12
+ g as configureBasemap,
13
+ p as configureData,
14
+ u as configureLicense,
15
+ d as configureTelemetry,
16
+ f as descriptorToIR,
17
+ x as destroySandbox,
18
+ S as evaluateInSandbox,
19
+ T as getBasemap,
20
+ B as getEntitlements,
21
+ C as getLayerSchema,
22
+ M as isBrowser,
23
+ b as isColumnar,
24
+ w as mountForTest,
25
+ y as normalizeData,
26
+ A as parseDurationMs,
27
+ I as registerAction,
28
+ v as registerBasemap,
29
+ D as registerFormat,
30
+ E as registerLayer,
31
+ F as registerSource,
32
+ L as registerWidget,
33
+ R as rowAt,
34
+ h as sandboxHtml,
35
+ z as snapshotIR,
36
+ H as validateManifest,
37
+ J as validateManifestString
35
38
  };