@nika-js/onlymap 0.8.3 → 0.8.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.
@@ -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-DgHzTg2n.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-DgHzTg2n.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-D5Fqn_eZ.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-D5Fqn_eZ.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
@@ -34,7 +34,7 @@ import { registerBasemap, configureBasemap } from "./basemap-registry";
34
34
  import { registerTerrain } from "./terrain";
35
35
  import { registerRoutingProvider } from "./providers";
36
36
  import { configureTelemetry } from "./telemetry";
37
- import { configureLicense } from "./license";
37
+ import { configureLicense, setKeepBadge, badgeMode } from "./license";
38
38
  import { validateManifestString } from "./validation";
39
39
  import { snapshotIR } from "./ir-snapshot";
40
40
  import { snapshotDescriptorIR } from "./programmatic";
@@ -70,8 +70,8 @@ export declare function configureIfc(options: {
70
70
  wasmPath?: string;
71
71
  }): Promise<void>;
72
72
  export type { TelemetryConfig, TelemetrySnapshot } from "./telemetry";
73
- export { configureLicense, getEntitlements, subscribeLicense } from "./license";
74
- export type { Entitlements, LicenseIdentity } from "./license";
73
+ export { configureLicense, getEntitlements, subscribeLicense, setKeepBadge, badgeMode } from "./license";
74
+ export type { Entitlements, LicenseIdentity, BadgeMode } from "./license";
75
75
  export type { RuntimeContext } from "./ctx";
76
76
  export { MapController, descriptorToIR, snapshotDescriptorIR } from "./programmatic";
77
77
  export type { LayerDescriptor, MapControllerOptions, CameraState, OverlayPositioner, PickListener } from "./programmatic";
@@ -135,6 +135,8 @@ export declare const OmMap: {
135
135
  configureData: typeof configureData;
136
136
  configureTelemetry: typeof configureTelemetry;
137
137
  configureLicense: typeof configureLicense;
138
+ setKeepBadge: typeof setKeepBadge;
139
+ badgeMode: typeof badgeMode;
138
140
  validate: typeof validateManifestString;
139
141
  snapshotIR: typeof snapshotIR;
140
142
  snapshotDescriptorIR: typeof snapshotDescriptorIR;
@@ -1,4 +1,4 @@
1
- import { C as a, D as s } from "./raster-6vW4_NSI.js";
1
+ import { C as a, D as s } from "./raster-B_wekCHv.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-DW-G7u1_.js");
11
+ const e = await import("./LercDecode.es-BKustV-1.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
@@ -40,7 +40,11 @@
40
40
  * commercial distribution (hosted OR packaged) requires a key regardless
41
41
  * of whether gates fired. The badge stays on in every context (it is the
42
42
  * attribution obligation, not a cap). App-identity keys for packaged apps
43
- * are the onlymap-native roadmap's `apps` claim.
43
+ * are the onlymap-native roadmap's `apps` claim. REVISED 2026-09-21: badge
44
+ * removal is an entitlement a paid plan GRANTS, not one it imposes —
45
+ * `setKeepBadge` / `keep-badge` lets a paid deployment keep crediting
46
+ * OnlyMap, rendering the credit WITHOUT the free-tier license sentence
47
+ * (see `badgeMode`). It is an author choice, never part of `Entitlements`.
44
48
  *
45
49
  * Failure semantics: invalid/expired/mismatched keys → free tier + one
46
50
  * console warning — never a broken map. While a key verifies (WebCrypto
@@ -80,6 +84,47 @@ export declare function setHostedContextForTests(hosted: boolean | null): void;
80
84
  export declare function getEntitlements(): Readonly<Entitlements>;
81
85
  /** True while a key is being verified — gates fail open so a paid page never flashes violations. */
82
86
  export declare function licenseSettled(): boolean;
87
+ /**
88
+ * How the attribution badge should render — the ONE predicate every badge
89
+ * surface reads (the map badge, the cartograph's foot credit), so they can
90
+ * never disagree about the same license.
91
+ *
92
+ * - `pending` — a key is still verifying. Deliberately its OWN state and
93
+ * not folded into `hidden`: the two surfaces want opposite
94
+ * things here, and that is a rendering policy rather than a
95
+ * license fact. The map badge shows nothing (no unlock
96
+ * flash on a paid page); the cartograph shows the credit
97
+ * (no flash-of-nothing on a free sheet). Folding it in is
98
+ * what made an earlier cut of this predicate unusable by
99
+ * the second surface — a third one would have forked again.
100
+ * - `hidden` — a paid plan, no opt-in: no badge.
101
+ * - `obligation` — free/dev tier: the badge is a CONDITION of the free
102
+ * non-commercial license (LICENSE.md §3), and says so.
103
+ * - `voluntary` — a paid plan that opted back in. The credit WITHOUT the
104
+ * "free for non-commercial use" sentence, which would be
105
+ * false about that deployment.
106
+ *
107
+ * `opts.keepBadge` is the CALLER's own opt-in (its element's `keep-badge`),
108
+ * OR-ed with the page-wide preference — so a surface can opt in for itself
109
+ * without reaching for a global, and `setKeepBadge` still covers a page that
110
+ * has no markup route.
111
+ */
112
+ export type BadgeMode = "pending" | "hidden" | "obligation" | "voluntary";
113
+ export declare function badgeMode(opts?: {
114
+ keepBadge?: boolean;
115
+ }): BadgeMode;
116
+ /**
117
+ * Keep the badge on a plan that has earned the right to drop it (DECIDED
118
+ * 2026-09-21): badge removal is an entitlement a paid plan GRANTS, not a
119
+ * requirement it imposes, so an author who wants to keep crediting OnlyMap
120
+ * can. Deliberately NOT part of `Entitlements` — that struct describes what
121
+ * the license grants, and this is an author's choice layered on top, so a
122
+ * key's meaning never depends on page markup.
123
+ *
124
+ * No effect on a free plan: there the badge is the obligation, and this
125
+ * cannot turn it off.
126
+ */
127
+ export declare function setKeepBadge(on: boolean): void;
83
128
  /** Notified whenever entitlements settle or change (RuntimeCore re-reconciles; the badge re-evaluates). */
84
129
  export declare function subscribeLicense(fn: () => void): () => void;
85
130
  /** `*` matches anything; `*.acme.com` matches acme.com and every subdomain; otherwise exact. */