@nika-js/onlymap 0.4.3 → 0.4.6
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 +44 -11
- package/bin/onlymapjs.mjs +160 -11
- package/dist/{LercDecode.es-peqB7bxk.js → LercDecode.es-B49qauXg.js} +1 -1
- package/dist/{basemap-BeKuGQJs.js → basemap-nJ_ODY7r.js} +168 -163
- package/dist/basemap.d.ts +3 -1
- package/dist/elements/om-map.d.ts +68 -0
- package/dist/{index-BPKvpqIk.js → index-CeOjfL2p.js} +2 -2
- package/dist/{index-DzyVbu_T.js → index-DSkgI4Oc.js} +12996 -12463
- package/dist/{index-BKU3HvOO.js → index-DjlGZov2.js} +1 -1
- package/dist/{index-DVnTYF5u.js → index-o_yRv2lD.js} +1 -1
- package/dist/{index-Dg8SKcgV.js → index-uDJbHjA9.js} +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/layer-registry.d.ts +8 -0
- package/dist/layout-audit.d.ts +53 -0
- package/dist/{lerc-DEpGyngt.js → lerc-CaQOmDCP.js} +2 -2
- package/dist/onlymap.standalone.js +22201 -21663
- package/dist/onlymapjs.js +78 -63
- package/dist/programmatic.d.ts +7 -1
- package/dist/{raster-CX7Y4jtJ.js → raster-DMq8FgiV.js} +2 -2
- package/dist/react/context.d.ts +9 -1
- package/dist/react/om-map.d.ts +3 -1
- package/dist/react/om-widget.d.ts +3 -1
- package/dist/react.js +336 -204
- package/dist/runtime-core.d.ts +20 -1
- package/dist/testing.d.ts +6 -0
- package/dist/version.d.ts +1 -1
- package/dist/widget-layout.d.ts +36 -0
- package/docs/basemaps.md +1 -1
- package/docs/react.md +2 -1
- package/docs/testing.md +13 -1
- package/llms.txt +2 -2
- package/onlymapjs.html-data.json +18 -0
- package/package.json +2 -2
- package/skills/onlymapjs/SKILL.md +3 -2
- package/skills/onlymapjs/references/react.md +2 -2
- package/skills/onlymapjs/references/syntax.md +4 -4
- package/skills/onlymapjs/references/testing.md +16 -0
package/dist/basemap.d.ts
CHANGED
|
@@ -22,8 +22,10 @@ export declare class MapLibreBasemapAdapter {
|
|
|
22
22
|
private overlay;
|
|
23
23
|
/** Our own compact attribution control (spec: "attribution becomes correct, not optional") — undefined when the author opted out. */
|
|
24
24
|
private attribution?;
|
|
25
|
+
private attributionElement?;
|
|
25
26
|
private attributionText?;
|
|
26
27
|
private showAttribution;
|
|
28
|
+
private attributionHost?;
|
|
27
29
|
/**
|
|
28
30
|
* One-time "has the map initialized at least once" flag, set by the first
|
|
29
31
|
* `load` event. Deliberately NOT `this.map.loaded()` — that method means
|
|
@@ -46,7 +48,7 @@ export declare class MapLibreBasemapAdapter {
|
|
|
46
48
|
zoom: number;
|
|
47
49
|
pitch?: number;
|
|
48
50
|
bearing?: number;
|
|
49
|
-
}, deckProps: DeckProps, showAttribution?: boolean);
|
|
51
|
+
}, deckProps: DeckProps, showAttribution?: boolean, attributionHost?: HTMLElement);
|
|
50
52
|
/** Snapshot capture queue for the overlay's deck canvas — see captureComposite. */
|
|
51
53
|
private deckCaptures;
|
|
52
54
|
/** In-flight captureComposite rejects — destroy() settles them so a caller never hangs on a torn-down renderer. */
|
|
@@ -66,6 +66,16 @@ export declare class OmMapElement extends HTMLElementBase {
|
|
|
66
66
|
/** Library-owned stacking layer: one absolutely-positioned flex container per managed slot, created lazily. Rendering plumbing, never authored state. */
|
|
67
67
|
private widgetLayer;
|
|
68
68
|
private readonly slotContainers;
|
|
69
|
+
private readonly mandatedChromeHosts;
|
|
70
|
+
/** Slots that host mandated chrome (badge/attribution) — set at host creation, so the collision-dim exemption is a slot-level flag, not a per-flush DOM scan. */
|
|
71
|
+
private readonly slotsWithMandatedChrome;
|
|
72
|
+
private widgetResizeObserver;
|
|
73
|
+
private widgetsFolded;
|
|
74
|
+
private foldPassPending;
|
|
75
|
+
private inFoldPass;
|
|
76
|
+
private readonly foldMapId;
|
|
77
|
+
private readonly foldedWidgetSlots;
|
|
78
|
+
private readonly foldDrawers;
|
|
69
79
|
/**
|
|
70
80
|
* Is this node layout plumbing (the widget layer, slot containers, or
|
|
71
81
|
* cluster wrappers)? Their childList churn is rendering, not manifest
|
|
@@ -84,7 +94,36 @@ export declare class OmMapElement extends HTMLElementBase {
|
|
|
84
94
|
private readonly slotAnchors;
|
|
85
95
|
/** The widget layer div — lazy, shared by slot containers AND the layout tokens (both lanes put tokens on the layer, never on an authored element). */
|
|
86
96
|
private ensureWidgetLayer;
|
|
97
|
+
private ensureSlotContainer;
|
|
98
|
+
/**
|
|
99
|
+
* Provider attribution and the free-license badge are immutable members of
|
|
100
|
+
* managed slots. Their stable wrappers stay front-end-owned while renderer
|
|
101
|
+
* adapters mount/unmount the actual controls inside.
|
|
102
|
+
*/
|
|
103
|
+
private ensureMandatedChromeHost;
|
|
104
|
+
/** True while an internal reparent (slotting/manual-flip) is moving a widget — its transient disconnect must NOT be read as an author removal. */
|
|
105
|
+
private inSlotReparent;
|
|
106
|
+
/** Wrap an internal reparent: suppress history AND flag it as a move so unregisterWidgetInternal keeps the fold/anchor bookkeeping. */
|
|
107
|
+
private reparent;
|
|
87
108
|
slotWidgetInternal(el: HTMLElement, slot: WidgetSlot): void;
|
|
109
|
+
/** Called by <om-widget> when its live `fold` attribute changes. */
|
|
110
|
+
refreshWidgetFoldInternal(): void;
|
|
111
|
+
private startWidgetFoldObserver;
|
|
112
|
+
private foldBreakpointRaw?;
|
|
113
|
+
private foldBreakpointCache;
|
|
114
|
+
/** Cached breakpoint resolution — re-probes only when the token string actually changes, not on every ResizeObserver tick. */
|
|
115
|
+
private foldBreakpointPx;
|
|
116
|
+
private measureWidgetFold;
|
|
117
|
+
private updateWidgetFoldForWidth;
|
|
118
|
+
/** Lift the bottom-end row clear of the bottom drawer toggle while folded. Applied here AND in the fold pass so a lazily-created bottom-end container still gets it. */
|
|
119
|
+
private syncFoldBottomOffset;
|
|
120
|
+
private scheduleFoldPass;
|
|
121
|
+
private shouldFoldWidget;
|
|
122
|
+
private ensureFoldDrawer;
|
|
123
|
+
private setFoldDrawerOpen;
|
|
124
|
+
private focusFirstIn;
|
|
125
|
+
private restoreFoldedWidget;
|
|
126
|
+
private runFoldPass;
|
|
88
127
|
private clusterPassPending;
|
|
89
128
|
/** Re-entry guard: the pass's own reparenting fires connect callbacks that call back into scheduleClusterPass — self-inflicted, never re-schedule. */
|
|
90
129
|
private inClusterPass;
|
|
@@ -144,6 +183,7 @@ export declare class OmMapElement extends HTMLElementBase {
|
|
|
144
183
|
* modeled (headless has no rects; this no-ops there).
|
|
145
184
|
*/
|
|
146
185
|
private dimSlotsAgainstOverlays;
|
|
186
|
+
/** widgets-toggle can sit in any author-chosen slot, so still scan for it (attribution/badge are covered by the slot flag). */
|
|
147
187
|
private slotHasNeverHidesWidget;
|
|
148
188
|
emit(event: string, payload?: Record<string, unknown>): void;
|
|
149
189
|
/** Recenters (and optionally rezooms) the map — instant, not an animated fly. */
|
|
@@ -190,6 +230,20 @@ export declare class OmMapElement extends HTMLElementBase {
|
|
|
190
230
|
*/
|
|
191
231
|
injectPickInternal(selection: Selection | null): void;
|
|
192
232
|
injectDragPickInternal(selection: Selection): void;
|
|
233
|
+
/** Every click/hover map coordinate (spec: "Manual Drawing"): drives the
|
|
234
|
+
* internal draw controller AND fires the public `om-map-point` event, so
|
|
235
|
+
* consumer capture tools the built-in draw widget doesn't cover
|
|
236
|
+
* (rectangle/circle AOIs) can subscribe. The two consumers are
|
|
237
|
+
* DECOUPLED: the event dispatches first (dispatchEvent isolates a
|
|
238
|
+
* throwing listener), then the draw controller runs — so neither a
|
|
239
|
+
* throwing draw session nor a throwing listener can starve the other.
|
|
240
|
+
* Fires at pointer rate on hover (no debounce — vertex capture needs
|
|
241
|
+
* every point); heavy listeners should throttle their own work. */
|
|
242
|
+
private handleMapPoint;
|
|
243
|
+
/** Harness map-point injection (spec: "Consumer Testing Surface") — the
|
|
244
|
+
* same path a real deck click/hover coordinate takes, so the om-map-point
|
|
245
|
+
* event and custom capture tools are testable without a GPU. */
|
|
246
|
+
injectMapPointInternal(coordinate: [number, number] | null, kind?: "click" | "hover"): void;
|
|
193
247
|
/** Harness setView (spec: "Consumer Testing Surface") — the one path that reaches pitch/bearing. */
|
|
194
248
|
setViewInternal(partial: {
|
|
195
249
|
longitude?: number;
|
|
@@ -274,6 +328,20 @@ declare global {
|
|
|
274
328
|
/** "user" if any change in the settled burst came from a canvas gesture; "programmatic" for pure API/action/story moves. */
|
|
275
329
|
origin: "user" | "programmatic";
|
|
276
330
|
}>;
|
|
331
|
+
/** Every click/hover's map coordinate (null when the pointer is off any
|
|
332
|
+
* geometry deck can unproject) — the consumer hook for custom capture
|
|
333
|
+
* tools beyond the built-in draw widget. */
|
|
334
|
+
"om-map-point": CustomEvent<{
|
|
335
|
+
coordinate: [number, number] | null;
|
|
336
|
+
kind: "click" | "hover";
|
|
337
|
+
}>;
|
|
338
|
+
/** A Tile3DLayer finished loading its root tileset — detail carries the
|
|
339
|
+
* authored layer id and the live deck `Tileset3D` for tools (e.g. region
|
|
340
|
+
* export) that need the real tileset, not the IR. */
|
|
341
|
+
"om-tileset-load": CustomEvent<{
|
|
342
|
+
layerId: string;
|
|
343
|
+
tileset: unknown;
|
|
344
|
+
}>;
|
|
277
345
|
}
|
|
278
346
|
}
|
|
279
347
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as E, j as S, k as R, n as N, o as h, p as w, q as O, s as W, r as x, t as I, v as B, w as _, x as P, y as k, A as $, B as z, E as v, F, H as C, I as U, J as p, K as M } from "./index-
|
|
2
|
-
import { N as $e, R as ze, _ as ve, O as Ce, P as Ue, Q as Me, S as je, T as De, U as Je, X as qe, Y as He, Z as Ve, $ as Ge, a0 as Ke, a1 as Qe, a2 as Xe, a3 as Ye, a4 as Ze, a5 as et, a6 as tt, a7 as nt, a8 as rt, a9 as at, aa as st, ab as ot } from "./index-
|
|
1
|
+
import { i as E, j as S, k as R, n as N, o as h, p as w, q as O, s as W, r as x, t as I, v as B, w as _, x as P, y as k, A as $, B as z, E as v, F, H as C, I as U, J as p, K as M } from "./index-DSkgI4Oc.js";
|
|
2
|
+
import { N as $e, R as ze, _ as ve, O as Ce, P as Ue, Q as Me, S as je, T as De, U as Je, X as qe, Y as He, Z as Ve, $ as Ge, a0 as Ke, a1 as Qe, a2 as Xe, a3 as Ye, a4 as Ze, a5 as et, a6 as tt, a7 as nt, a8 as rt, a9 as at, aa as st, ab as ot } from "./index-DSkgI4Oc.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 };
|