@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.
- package/.vscode/onlymap.code-snippets +4 -4
- package/LICENSE.md +22 -12
- package/README.md +27 -6
- package/dist/actions.d.ts +2 -2
- package/dist/badge.d.ts +4 -0
- package/dist/{basemap-Bn4TmZtQ.js → basemap-BdvB-SHy.js} +1 -1
- package/dist/ctx.d.ts +10 -1
- package/dist/elements/om-map.d.ts +1 -0
- package/dist/error-reporting.d.ts +17 -0
- package/dist/history.d.ts +53 -0
- package/dist/html-data.d.ts +2 -2
- package/dist/{index-3UyMg0Md.js → index-BVQ0s1Zh.js} +1 -1
- package/dist/{index-oE1Kouy1.js → index-BxzDKZpu.js} +14312 -13798
- package/dist/{index-D2zVsZ79.js → index-CJOMgp8k.js} +1 -1
- package/dist/{index-BZs_x9Dx.js → index-CvBHiOGD.js} +2 -2
- package/dist/{index-DSjndBOf.js → index-Vc8QfNEf.js} +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/internal-ids.d.ts +7 -0
- package/dist/ir-diff.d.ts +1 -1
- package/dist/license.d.ts +64 -0
- package/dist/onlymapjs.js +27 -24
- package/dist/onlymapjs.umd.cjs +290 -280
- package/dist/runtime-core.d.ts +6 -0
- package/dist/telemetry-schema.d.ts +53 -0
- package/dist/telemetry.d.ts +60 -0
- package/dist/version.d.ts +8 -0
- package/docs/react.md +1 -0
- package/docs/telemetry.md +78 -0
- package/docs/testing.md +2 -2
- package/llms.txt +4 -3
- package/onlymapjs.html-data.json +32 -0
- package/package.json +6 -3
- package/skills/onlymapjs/SKILL.md +4 -1
- package/skills/onlymapjs/references/syntax.md +8 -0
- package/skills/onlymapjs/references/testing.md +2 -0
|
@@ -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-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
u as
|
|
15
|
-
d as
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
D as
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
};
|