@nika-js/onlymap 0.3.5 → 0.4.1
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/README.md +5 -4
- package/dist/{LercDecode.es-C1xVetIa.js → LercDecode.es-B35eeLUh.js} +1 -1
- package/dist/{basemap-BkoYlZXu.js → basemap--znNIrJq.js} +8 -2
- package/dist/basemap.d.ts +8 -1
- package/dist/ctx.d.ts +4 -0
- package/dist/elements/om-map.d.ts +33 -3
- package/dist/elements/om-widget.d.ts +15 -0
- package/dist/external-store.d.ts +95 -0
- package/dist/{index-i_KAvtQZ.js → index-BKiyX-jQ.js} +10349 -10051
- package/dist/{index-CY7o8j7i.js → index-C8twrrDP.js} +2 -2
- package/dist/{index-Ck0N90Ri.js → index-CHmCCmPV.js} +1 -1
- package/dist/{index-BJvRiLIi.js → index-ClqgDar6.js} +1 -1
- package/dist/{index-DAx8ax6u.js → index-_K3U-Ww1.js} +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/{lerc-DWGhMWvo.js → lerc-filCwJiM.js} +2 -2
- package/dist/onlymap.standalone.js +14343 -14039
- package/dist/onlymapjs.js +57 -48
- package/dist/programmatic.d.ts +42 -5
- package/dist/{raster-Da1auFQH.js → raster-xUPg8Z-C.js} +2 -2
- package/dist/react/context.d.ts +5 -3
- package/dist/react/om-map.d.ts +2 -0
- package/dist/react/om-widget.d.ts +4 -1
- package/dist/react.js +216 -186
- package/dist/runtime-core.d.ts +9 -2
- package/dist/version.d.ts +1 -1
- package/dist/widget-layout.d.ts +62 -0
- package/docs/external-stores.md +135 -0
- package/docs/react.md +3 -1
- package/llms.txt +3 -3
- package/onlymapjs.html-data.json +36 -1
- package/package.json +11 -6
- package/skills/onlymapjs/SKILL.md +2 -2
- package/skills/onlymapjs/references/react.md +4 -3
- package/skills/onlymapjs/references/syntax.md +1 -1
package/dist/onlymapjs.js
CHANGED
|
@@ -1,58 +1,67 @@
|
|
|
1
|
-
import { ay as e, az as r, aA as o, aB as t,
|
|
1
|
+
import { ay as e, az as r, aA as o, aB as t, aC as i, aq as n, aD as b, aE as l, aF as S, aG as L, aH as p, aI as c, aJ as g, aK as m, aL as T, aM as y, aN as E, ap as A, aO as I, ax as u, aP as d, W as M, aQ as _, aR as C, aS as D, aT as O, aU as f, aV as x, aW as N, aX as h, aY as B, aZ as G, a_ as R, a$ as W, b0 as v, b1 as w, b2 as Y, b3 as F, b4 as P, b5 as k, b6 as z, b7 as H, b8 as J, b9 as V, ba as q, bb as K, bc as U, bd as j, be as Q, bf as X, bg as Z, bh as $, bi as aa, bj as sa, bk as ea, bl as ra, bm as oa, bn as ta, bo as ia, bp as na, bq as ba, br as la, bs as Sa, bt as La } from "./index-BKiyX-jQ.js";
|
|
2
2
|
export {
|
|
3
|
-
e as
|
|
4
|
-
r as
|
|
5
|
-
o as
|
|
6
|
-
t as
|
|
7
|
-
i as
|
|
8
|
-
n as
|
|
9
|
-
b as
|
|
10
|
-
l as
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
e as ALL_POSITION_VALUES,
|
|
4
|
+
r as AccessorCache,
|
|
5
|
+
o as BitmapLayer,
|
|
6
|
+
t as COORDINATE_SYSTEM,
|
|
7
|
+
i as CompileError,
|
|
8
|
+
n as CompositeLayer,
|
|
9
|
+
b as GeoJsonLayer,
|
|
10
|
+
l as IconLayer,
|
|
11
|
+
S as LEGACY_POSITION_ALIASES,
|
|
12
|
+
L as LIGHTING_PRESET_NAMES,
|
|
13
|
+
p as Layer,
|
|
14
|
+
c as LayerExtension,
|
|
15
|
+
g as MANAGED_SLOTS,
|
|
13
16
|
m as MapController,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
T as OmMap,
|
|
18
|
+
y as ScatterplotLayer,
|
|
19
|
+
E as ScenegraphLayer,
|
|
20
|
+
A as SimpleMeshLayer,
|
|
21
|
+
I as Tile3DLayer,
|
|
19
22
|
u as TileLayer,
|
|
20
|
-
d as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
d as WIDGET_STYLE_KEY_NAMES,
|
|
24
|
+
M as WebMercatorViewport,
|
|
25
|
+
_ as arrowTableToColumnar,
|
|
26
|
+
C as asRows,
|
|
27
|
+
D as compileExpression,
|
|
28
|
+
O as compileFullJsAccessorBlockInSandbox,
|
|
25
29
|
f as computeTimeline,
|
|
26
30
|
x as configureBasemap,
|
|
27
|
-
|
|
31
|
+
N as configureData,
|
|
28
32
|
h as configureLicense,
|
|
29
33
|
B as configureTelemetry,
|
|
30
|
-
|
|
34
|
+
G as descriptorToIR,
|
|
31
35
|
R as destroySandbox,
|
|
32
|
-
|
|
36
|
+
W as evaluateInSandbox,
|
|
33
37
|
v as getBasemap,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
38
|
+
w as getEntitlements,
|
|
39
|
+
Y as getLayerSchema,
|
|
40
|
+
F as getTerrain,
|
|
41
|
+
P as isBrowser,
|
|
42
|
+
k as isColumnar,
|
|
43
|
+
z as isStoreToken,
|
|
44
|
+
H as loadRasterModule,
|
|
45
|
+
J as mountForTest,
|
|
46
|
+
V as normalizeData,
|
|
47
|
+
q as parseDurationMs,
|
|
48
|
+
K as parseTerrainAttrs,
|
|
49
|
+
U as parseWidgetStyle,
|
|
50
|
+
j as registerAction,
|
|
51
|
+
Q as registerBasemap,
|
|
52
|
+
X as registerFormat,
|
|
53
|
+
Z as registerLayer,
|
|
54
|
+
$ as registerSource,
|
|
55
|
+
aa as registerTerrain,
|
|
56
|
+
sa as registerWidget,
|
|
57
|
+
ea as resolveLighting,
|
|
58
|
+
ra as resolveSlot,
|
|
59
|
+
oa as rowAt,
|
|
60
|
+
ta as sandboxHtml,
|
|
61
|
+
ia as slotContainerStyle,
|
|
62
|
+
na as slotLayout,
|
|
63
|
+
ba as snapshotIR,
|
|
64
|
+
la as solarAzElDegrees,
|
|
65
|
+
Sa as validateManifest,
|
|
66
|
+
La as validateManifestString
|
|
58
67
|
};
|
package/dist/programmatic.d.ts
CHANGED
|
@@ -18,8 +18,10 @@ import { type CameraOptions } from "./runtime-core";
|
|
|
18
18
|
import { type LightingIR, type LightingOptions } from "./scene-lighting";
|
|
19
19
|
import type { TerrainIR } from "./terrain";
|
|
20
20
|
import { type SnapshotOptions } from "./snapshot";
|
|
21
|
+
import { type TokenStore, type ViewOrigin, type ViewportSnapshot, type DataVersionSnapshot } from "./external-store";
|
|
21
22
|
import type { LayerIR } from "./ir";
|
|
22
23
|
import { type RuntimeContext } from "./ctx";
|
|
24
|
+
import type { LayerMetaSnapshot } from "./ctx";
|
|
23
25
|
import type { Selection } from "./selection";
|
|
24
26
|
import type { ValidationEntry } from "./validation";
|
|
25
27
|
import type { MapViewport } from "./basemap";
|
|
@@ -96,9 +98,12 @@ export interface MapControllerOptions {
|
|
|
96
98
|
/**
|
|
97
99
|
* Camera settled (trailing-debounced, the `om-view-changed` twin) — for
|
|
98
100
|
* camera persistence. Per-frame viewport churn goes to `watch(["viewport"])`;
|
|
99
|
-
* this fires once with the destination.
|
|
101
|
+
* this fires once with the destination. `origin` is "user" when ANY change
|
|
102
|
+
* in the settled burst came from a canvas gesture (a drag's inertia tail
|
|
103
|
+
* alone must not relabel the gesture), "programmatic" for pure API/story
|
|
104
|
+
* moves — the echo-suppression signal for store bridges.
|
|
100
105
|
*/
|
|
101
|
-
onViewChange?: (view: CameraState) => void;
|
|
106
|
+
onViewChange?: (view: CameraState, origin: ViewOrigin) => void;
|
|
102
107
|
/** Scene lighting (spec: "Scene Lighting") — the lighting* attributes' programmatic twin; omit for deck's default lights. */
|
|
103
108
|
lighting?: LightingOptions;
|
|
104
109
|
}
|
|
@@ -131,7 +136,18 @@ export declare class MapController {
|
|
|
131
136
|
private commitPending;
|
|
132
137
|
private destroyed;
|
|
133
138
|
private firstCommitDone;
|
|
134
|
-
private
|
|
139
|
+
private readonly stores;
|
|
140
|
+
/** Origin of the most recent viewport change FRAME — latched through the settle tracker for snapshot reads. */
|
|
141
|
+
private lastViewOrigin;
|
|
142
|
+
/**
|
|
143
|
+
* Shared settle/burst tracker (the `om-view-changed` twin) — ALWAYS armed,
|
|
144
|
+
* onViewChange or not: the burst latch also feeds the viewport snapshot's
|
|
145
|
+
* `origin`, so it must reset on settle even for store-only consumers.
|
|
146
|
+
*/
|
|
147
|
+
private readonly viewSettle;
|
|
148
|
+
private onViewChange?;
|
|
149
|
+
/** Per-layer data version counters (`data:<id>` snapshots) — bumped on every data change, monotonic for the controller's lifetime. */
|
|
150
|
+
private readonly dataVersions;
|
|
135
151
|
private readyFired;
|
|
136
152
|
private resolveReady;
|
|
137
153
|
readonly ready: Promise<void>;
|
|
@@ -153,6 +169,29 @@ export declare class MapController {
|
|
|
153
169
|
*/
|
|
154
170
|
watch(tokens: readonly string[], notify: (ctx: RuntimeContext) => void): () => void;
|
|
155
171
|
private notifyWatchers;
|
|
172
|
+
/**
|
|
173
|
+
* Per-token `{subscribe, getSnapshot}` store — the framework-free surface
|
|
174
|
+
* for `useSyncExternalStore`, MobX autoruns, Redux listeners, Zustand
|
|
175
|
+
* mirrors (recipes: docs/external-stores.md). Snapshots are cached
|
|
176
|
+
* immutable PLAIN DATA: `getSnapshot()` returns the SAME reference until
|
|
177
|
+
* this token's next change event, and never contains closures — rich
|
|
178
|
+
* reads (`project`, `data()`, `stats()`) stay on `ctx`. Tokens:
|
|
179
|
+
* - "viewport" → ViewportSnapshot (camera + bounds + origin)
|
|
180
|
+
* - "selection" → Selection | null
|
|
181
|
+
* - "layers" → LayerMetaSnapshot[] (what ctx.layers builds)
|
|
182
|
+
* - "data:<layerId>" → {version, rows} — a VERSION STAMP, not the rows
|
|
183
|
+
* (mirroring row arrays into a store per tick is the anti-pattern the
|
|
184
|
+
* Redux performance guidance warns about; fetch rows via ctx.data()).
|
|
185
|
+
* `history` is deliberately NOT a store here — the app owns state on the
|
|
186
|
+
* programmatic front-end. Calling twice for one token returns the
|
|
187
|
+
* identical store object.
|
|
188
|
+
*/
|
|
189
|
+
getStore(token: "viewport"): TokenStore<ViewportSnapshot>;
|
|
190
|
+
getStore(token: "selection"): TokenStore<Selection | null>;
|
|
191
|
+
getStore(token: "layers"): TokenStore<LayerMetaSnapshot[]>;
|
|
192
|
+
getStore(token: `data:${string}`): TokenStore<DataVersionSnapshot>;
|
|
193
|
+
getStore(token: string): TokenStore<unknown>;
|
|
194
|
+
private buildViewportSnapshot;
|
|
156
195
|
/** The RuntimeContext contract (HU5) — identical to what HTML widget scripts receive as `ctx`. */
|
|
157
196
|
buildCtx(): RuntimeContext;
|
|
158
197
|
/** Picked object, normalized to flat — same path as OmMapElement (GeoJSON properties lifted; columnar rows materialized). */
|
|
@@ -216,6 +255,4 @@ export declare class MapController {
|
|
|
216
255
|
/** Projects a lng/lat through the current viewport — undefined before the viewport resolves. */
|
|
217
256
|
project(lngLat: [number, number]): [number, number] | undefined;
|
|
218
257
|
destroy(): void;
|
|
219
|
-
/** Trailing-debounced onViewChange — see MapControllerOptions.onViewChange. */
|
|
220
|
-
private scheduleViewChange;
|
|
221
258
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { w as kt, t as Ni, f as Oi, m as Ri } from "./mgrs-BY9bIvp4.js";
|
|
2
|
-
import { an as Fi, ao as zi, ap as Ks, aq as Ws, ar as Di, b as Bi, as as Ui, l as es, at as ki, d as qi, au as Ki, av as Wi, aw as Xi, ax as Xs } from "./index-
|
|
2
|
+
import { an as Fi, ao as zi, ap as Ks, aq as Ws, ar as Di, b as Bi, as as Ui, l as es, at as ki, d as qi, au as Ki, av as Wi, aw as Xi, ax as Xs } from "./index-BKiyX-jQ.js";
|
|
3
3
|
function Hi(t, e, s) {
|
|
4
4
|
const { projectedCorners: i } = e, { topLeft: a, topRight: r, bottomRight: o, bottomLeft: n } = i, h = s(a[0], a[1]), l = s(r[0], r[1]), c = s(o[0], o[1]), u = s(n[0], n[1]), d = [
|
|
5
5
|
h,
|
|
@@ -2377,7 +2377,7 @@ it.set(G.Zstd, () => import("./zstd-jXobGRcq.js").then((t) => t.decode));
|
|
|
2377
2377
|
it.set(G.Jpeg, () => Promise.resolve(ke));
|
|
2378
2378
|
it.set(G.Jpeg6, () => Promise.resolve(ke));
|
|
2379
2379
|
it.set(G.Webp, () => Promise.resolve(ke));
|
|
2380
|
-
it.set(G.Lerc, () => import("./lerc-
|
|
2380
|
+
it.set(G.Lerc, () => import("./lerc-filCwJiM.js").then((t) => t.l).then((t) => t.decode));
|
|
2381
2381
|
async function qe(t, e, s) {
|
|
2382
2382
|
const i = it.get(e);
|
|
2383
2383
|
if (!i)
|
package/dist/react/context.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { MapController, LayerDescriptor } from "@nika-js/onlymap";
|
|
2
|
-
|
|
2
|
+
import type { ManagedSlot } from "@nika-js/onlymap";
|
|
3
|
+
/** A managed slot (spec: "Widget Layout Manager"), a legacy corner alias, or the author-styled `manual` tier. */
|
|
4
|
+
export type WidgetPosition = ManagedSlot | "manual" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
3
5
|
export interface OmMapContextValue {
|
|
4
6
|
controller: MapController;
|
|
5
7
|
layers: LayerRegistry;
|
|
6
8
|
/** The pane <OmOverlay> portals into — absolutely positioned above the canvas, pointer-events: none. */
|
|
7
9
|
overlayPane: HTMLDivElement;
|
|
8
|
-
/**
|
|
9
|
-
corners: Readonly<Record<
|
|
10
|
+
/** Slot containers <OmWidget> portals into (filled as OmMap's own DOM mounts). */
|
|
11
|
+
corners: Readonly<Record<ManagedSlot, HTMLDivElement | null>>;
|
|
10
12
|
}
|
|
11
13
|
export declare const OmMapContext: import("react").Context<OmMapContextValue | null>;
|
|
12
14
|
export declare function useOmMapContext(caller: string): OmMapContextValue;
|
package/dist/react/om-map.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface OmMapProps {
|
|
|
18
18
|
width?: number;
|
|
19
19
|
height?: number;
|
|
20
20
|
};
|
|
21
|
+
/** Layout-token sugar, the `widget-style` attribute's twin: `"gap:10 opacity:0.9"` → `--om-widget-*` custom properties on the widget layer. */
|
|
22
|
+
widgetStyle?: string;
|
|
21
23
|
className?: string;
|
|
22
24
|
style?: CSSProperties;
|
|
23
25
|
children?: ReactNode;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import { type WidgetPosition } from "./context";
|
|
3
3
|
export interface OmWidgetProps {
|
|
4
|
+
/** A managed slot (`top-start` … `bottom-end`), a legacy corner alias, or `manual`. Default `top-start`. */
|
|
4
5
|
position?: WidgetPosition;
|
|
6
|
+
/** Deterministic in-slot ordering (flex `order`); default is mount order. */
|
|
7
|
+
order?: number;
|
|
5
8
|
className?: string;
|
|
6
9
|
style?: CSSProperties;
|
|
7
10
|
children?: ReactNode;
|
|
8
11
|
}
|
|
9
|
-
export declare function OmWidget({ position, className, style, children }: OmWidgetProps): ReactNode;
|
|
12
|
+
export declare function OmWidget({ position, order, className, style, children }: OmWidgetProps): ReactNode;
|