@nika-js/onlymap 0.11.11 → 0.12.0

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.
Files changed (55) hide show
  1. package/README.md +9 -3
  2. package/dist/attribute-resolution.d.ts +2 -0
  3. package/dist/{basemap-QT4ua-dL.js → basemap-CtDse0mW.js} +1514 -1462
  4. package/dist/basemap.d.ts +41 -1
  5. package/dist/cartograph.js +362 -321
  6. package/dist/cartograph.standalone.js +1995 -1914
  7. package/dist/{cityjson-k-z1r6c0.js → cityjson-DMc_dwu1.js} +1 -1
  8. package/dist/{crs-BzE_KP4M.js → crs-D5FyQfEu.js} +74 -7
  9. package/dist/{crs-ChglCB3O.js → crs-ZdDBJ2EY.js} +39 -36
  10. package/dist/data-layer.d.ts +36 -3
  11. package/dist/elements/om-map.d.ts +2 -1
  12. package/dist/geoparquet-BTHYX1ET.js +30 -0
  13. package/dist/geoparquet.d.ts +6 -7
  14. package/dist/{globe-view-BSGTUqWc.js → globe-view-KrKNOmVs.js} +11 -11
  15. package/dist/hillshade-CijRdYyU.js +209 -0
  16. package/dist/html-data.d.ts +1 -1
  17. package/dist/{ifc-DXwePQRv.js → ifc-sisRo7I7.js} +1 -1
  18. package/dist/{index-Bxue4Psc.js → index-21KGElDr.js} +9 -9
  19. package/dist/{index-DjYxw-8H.js → index-A45DtXly.js} +18 -18
  20. package/dist/{index-Dwc4s3mc.js → index-BPa2CC8T.js} +20 -20
  21. package/dist/{index-DudIuhJa.js → index-B_Vhebf7.js} +1 -1
  22. package/dist/{index-DBt_2x-w.js → index-Bfocr1_A.js} +106 -106
  23. package/dist/{index-CevWTqBO.js → index-DMc81n9B.js} +14362 -13782
  24. package/dist/{index-D1ZjhP2H.js → index-DS6VUGi6.js} +11 -11
  25. package/dist/{index-BO7MtTkn.js → index-DoGY-Vgi.js} +3 -3
  26. package/dist/{index-Bzypgr1v.js → index-eHYe06mM.js} +1 -1
  27. package/dist/index.d.ts +3 -2
  28. package/dist/ir.d.ts +6 -0
  29. package/dist/layer-registry.d.ts +21 -0
  30. package/dist/layers/warped-bitmap-layer.d.ts +27 -0
  31. package/dist/{lerc-DQuf93SN.js → lerc-DjrPALEj.js} +1 -1
  32. package/dist/onlymap.standalone.js +53019 -52455
  33. package/dist/onlymapjs.js +86 -84
  34. package/dist/parse-manifest.d.ts +12 -9
  35. package/dist/{post-process-effect-B3j_nBzy.js → post-process-effect-Be1qa2DD.js} +5 -5
  36. package/dist/programmatic.d.ts +12 -0
  37. package/dist/projection.d.ts +44 -1
  38. package/dist/{raster-pipeline-CusoihQ3.js → raster-pipeline-DspBYxwc.js} +1 -1
  39. package/dist/{raster-CvAJ-h_g.js → raster-zC3qXBrs.js} +3 -3
  40. package/dist/react/om-layer.d.ts +4 -0
  41. package/dist/react/om-map.d.ts +2 -0
  42. package/dist/react.js +225 -218
  43. package/dist/runtime-core.d.ts +24 -0
  44. package/dist/source-crs.d.ts +99 -0
  45. package/dist/{text-on-path-D9u5SYCo.js → text-on-path-D0_URrD2.js} +1 -1
  46. package/dist/{zarr-DWb_nikR.js → zarr-DopOhzfY.js} +2 -2
  47. package/docs/cartography.md +106 -1
  48. package/llms.txt +2 -1
  49. package/onlymapjs.attributes.json +2 -0
  50. package/onlymapjs.html-data.json +26 -4
  51. package/package.json +1 -1
  52. package/skills/onlymapjs/SKILL.md +4 -2
  53. package/skills/onlymapjs/references/syntax.md +16 -1
  54. package/dist/geoparquet-hOsdfZJa.js +0 -35
  55. package/dist/hillshade-D2Ps3Nim.js +0 -298
package/dist/react.js CHANGED
@@ -1,172 +1,177 @@
1
- var Le = Object.defineProperty;
2
- var _e = (t, e, s) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
- var ue = (t, e, s) => _e(t, typeof e != "symbol" ? e + "" : e, s);
4
- import { jsxs as ee, jsx as x } from "react/jsx-runtime";
5
- import { createContext as $e, useContext as je, forwardRef as De, useRef as b, useState as k, useId as ge, useCallback as te, useMemo as $, useLayoutEffect as fe, useEffect as E, useImperativeHandle as Ae, useSyncExternalStore as ye } from "react";
6
- import { MANAGED_SLOTS as ze, slotContainerStyle as Be, FOLD_SIDES as K, MapController as Ie, parseWidgetStyle as Ke, foldToggleSlot as We, foldToggleStyle as He, foldPanelStyle as Ne, foldDrawerStyle as Ve, resolveFoldBreakpointPx as qe, shouldFoldAtWidth as Ge, effectiveFoldBreakpointPx as Je, DEFAULT_FOLD_BREAKPOINT_PX as Ye, bottomEndLiftPx as Xe, FOLD_BOTTOM_CLEARANCE_PX as Ze, resolveSlot as Ue, foldSideForSlot as Qe, isStoreToken as et } from "@nika-js/onlymap";
7
- import { createPortal as be } from "react-dom";
8
- const he = $e(null);
9
- function G(t) {
10
- const e = je(he);
1
+ var _e = Object.defineProperty;
2
+ var $e = (t, e, s) => e in t ? _e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
+ var me = (t, e, s) => $e(t, typeof e != "symbol" ? e + "" : e, s);
4
+ import { jsxs as re, jsx as C } from "react/jsx-runtime";
5
+ import { createContext as Ae, useContext as ze, forwardRef as Be, useRef as y, useState as T, useId as he, useCallback as ne, useMemo as _, useLayoutEffect as ge, useEffect as E, useImperativeHandle as Ie, useSyncExternalStore as ve } from "react";
6
+ import { MANAGED_SLOTS as Ke, slotContainerStyle as We, FOLD_SIDES as W, MapController as He, parseWidgetStyle as Ne, foldToggleSlot as Ve, foldToggleStyle as qe, foldPanelStyle as Ge, foldDrawerStyle as Je, resolveFoldBreakpointPx as Ye, shouldFoldAtWidth as Xe, effectiveFoldBreakpointPx as Ze, DEFAULT_FOLD_BREAKPOINT_PX as Ue, bottomEndLiftPx as Qe, FOLD_BOTTOM_CLEARANCE_PX as et, resolveSlot as tt, foldSideForSlot as rt, isStoreToken as nt } from "@nika-js/onlymap";
7
+ import { createPortal as Se } from "react-dom";
8
+ const Oe = Ae(null);
9
+ function Y(t) {
10
+ const e = ze(Oe);
11
11
  if (!e) throw new Error(`[onlymapjs] ${t} must be rendered inside <OmMap>.`);
12
12
  return e;
13
13
  }
14
- function re(t, e) {
14
+ function oe(t, e) {
15
15
  if (t === e) return !0;
16
16
  const s = Object.keys(t ?? {}), o = Object.keys(e ?? {});
17
17
  return s.length !== o.length ? !1 : s.every((i) => t[i] === e[i]);
18
18
  }
19
- function tt(t, e) {
20
- const { props: s, updateTriggers: o, ...i } = t, { props: g, updateTriggers: u, ...d } = e;
21
- return re(i, d) && re(s, g) && re(o, u);
19
+ function ot(t, e) {
20
+ const { props: s, updateTriggers: o, ...i } = t, { props: g, updateTriggers: p, ...u } = e;
21
+ return oe(i, u) && oe(s, g) && oe(o, p);
22
22
  }
23
- class rt {
23
+ class st {
24
24
  constructor(e) {
25
- ue(this, "descriptors", /* @__PURE__ */ new Map());
25
+ me(this, "descriptors", /* @__PURE__ */ new Map());
26
26
  this.controller = e;
27
27
  }
28
28
  upsert(e) {
29
29
  const s = this.descriptors.get(e.id);
30
- s && tt(s, e) || (this.descriptors.set(e.id, e), this.controller.setLayers([...this.descriptors.values()]));
30
+ s && ot(s, e) || (this.descriptors.set(e.id, e), this.controller.setLayers([...this.descriptors.values()]));
31
31
  }
32
32
  remove(e) {
33
33
  this.descriptors.delete(e) && this.controller.setLayers([...this.descriptors.values()]);
34
34
  }
35
35
  }
36
- const q = ze, nt = Object.fromEntries(q.map((t) => [t, Be(t)])), me = { display: "flex", pointerEvents: "none", order: 2147483647 }, ot = Object.fromEntries(K.map((t) => [t, null]));
37
- function st(t) {
36
+ const J = Ke, it = Object.fromEntries(J.map((t) => [t, We(t)])), ye = { display: "flex", pointerEvents: "none", order: 2147483647 }, at = Object.fromEntries(W.map((t) => [t, null]));
37
+ function lt(t) {
38
38
  const e = t.querySelector(
39
39
  'button:not([disabled]),a[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])'
40
40
  );
41
41
  e ? e.focus() : (t.tabIndex = -1, t.focus());
42
42
  }
43
- function it(t, e) {
43
+ function ct(t, e) {
44
44
  return Object.entries(e).some(([s, o]) => o !== void 0 && t[s] !== o);
45
45
  }
46
- const yt = De(function(e, s) {
47
- const { center: o, zoom: i, pitch: g, bearing: u, basemap: d, basemapKey: y, attribution: h, headless: f, widgetStyle: T, widgetsHidden: v, widgetsFold: m = !0, className: S, style: O, children: w } = e, P = b(null), M = b(null), [c, j] = k(null), [L, J] = k(null), [C, z] = k(
48
- () => Object.fromEntries(q.map((r) => [r, null]))
49
- ), [F, Y] = k(!1), [B, Se] = k({ lift: 0, shift: 0 }), [ne, Oe] = k(ot), [we, Re] = k(
50
- () => Object.fromEntries(K.map((r) => [r, 0]))
51
- ), [Ee, X] = k(null), oe = `om-react-fold-${ge().replaceAll(":", "")}`, Pe = b(new Map(K.map((r) => [r, /* @__PURE__ */ new Set()]))), Ce = b(/* @__PURE__ */ new Map()), [se, Fe] = k(() => /* @__PURE__ */ new Set()), ie = f ? JSON.stringify(f) : "", W = b({
46
+ const vt = Be(function(e, s) {
47
+ const { center: o, zoom: i, pitch: g, bearing: p, basemap: u, projection: f, basemapKey: v, attribution: b, headless: S, widgetStyle: P, widgetsHidden: d, widgetsFold: h = !0, className: O, style: w, children: j } = e, F = y(null), k = y(null), [l, $] = T(null), [B, M] = T(null), [L, I] = T(
48
+ () => Object.fromEntries(J.map((r) => [r, null]))
49
+ ), [x, se] = T(!1), [H, Re] = T({ lift: 0, shift: 0 }), [ie, Ee] = T(at), [Pe, Ce] = T(
50
+ () => Object.fromEntries(W.map((r) => [r, 0]))
51
+ ), [Fe, X] = T(null), ae = `om-react-fold-${he().replaceAll(":", "")}`, xe = y(new Map(W.map((r) => [r, /* @__PURE__ */ new Set()]))), Te = y(/* @__PURE__ */ new Map()), [le, je] = T(() => /* @__PURE__ */ new Set()), ce = S ? JSON.stringify(S) : "", N = y({
52
52
  badge: null,
53
53
  attribution: null
54
- }), xe = te((r) => {
55
- J((n) => n === r ? n : r);
56
- }, []), Te = $(
54
+ }), ke = ne((r) => {
55
+ M((n) => n === r ? n : r);
56
+ }, []), Me = _(
57
57
  () => Object.fromEntries(
58
- q.map((r) => [
58
+ J.map((r) => [
59
59
  r,
60
60
  (n) => {
61
- z((a) => a[r] === n ? a : { ...a, [r]: n });
61
+ I((a) => a[r] === n ? a : { ...a, [r]: n });
62
62
  }
63
63
  ])
64
64
  ),
65
65
  []
66
- ), ke = $(
66
+ ), Le = _(
67
67
  () => Object.fromEntries(
68
- K.map((r) => [
68
+ W.map((r) => [
69
69
  r,
70
70
  (n) => {
71
- Oe((a) => a[r] === n ? a : { ...a, [r]: n });
71
+ Ee((a) => a[r] === n ? a : { ...a, [r]: n });
72
72
  }
73
73
  ])
74
74
  ),
75
75
  []
76
- ), ae = te((r, n, a) => {
77
- const l = Pe.current.get(r), p = l.size;
78
- a ? l.add(n) : l.delete(n), l.size !== p && Re((R) => ({ ...R, [r]: l.size }));
79
- }, []), le = te((r, n, a) => {
80
- const l = Ce.current;
81
- a ? l.set(n, r) : l.delete(n);
82
- const p = new Set(l.values());
83
- Fe((R) => R.size === p.size && [...p].every((_) => R.has(_)) ? R : p);
76
+ ), de = ne((r, n, a) => {
77
+ const c = xe.current.get(r), m = c.size;
78
+ a ? c.add(n) : c.delete(n), c.size !== m && Ce((R) => ({ ...R, [r]: c.size }));
79
+ }, []), ue = ne((r, n, a) => {
80
+ const c = Te.current;
81
+ a ? c.set(n, r) : c.delete(n);
82
+ const m = new Set(c.values());
83
+ je((R) => R.size === m.size && [...m].every((D) => R.has(D)) ? R : m);
84
84
  }, []);
85
- fe(() => {
86
- const r = P.current;
85
+ ge(() => {
86
+ const r = F.current;
87
87
  if (!r) return;
88
- let n, a = Ye;
89
- const l = (R) => {
90
- const _ = getComputedStyle(r).getPropertyValue("--om-widget-fold-breakpoint").trim();
91
- _ !== n && (n = _, a = qe(_, r)), Y((I) => m && Ge(R, Je(a, se), I));
88
+ let n, a = Ue;
89
+ const c = (R) => {
90
+ const D = getComputedStyle(r).getPropertyValue("--om-widget-fold-breakpoint").trim();
91
+ D !== n && (n = D, a = Ye(D, r)), se((K) => h && Xe(R, Ze(a, le), K));
92
92
  };
93
- if (l(r.getBoundingClientRect().width || (f ? f === !0 ? 800 : f.width ?? 800 : 0)), typeof ResizeObserver > "u") return;
94
- const p = new ResizeObserver(([R]) => l(R.contentRect.width));
95
- return p.observe(r), () => p.disconnect();
96
- }, [m, ie, se]), E(() => {
97
- (!F || v) && X(null);
98
- }, [F, v]);
99
- const ce = b({ center: o, zoom: i, pitch: g, bearing: u });
100
- ce.current = { center: o, zoom: i, pitch: g, bearing: u };
101
- const H = b(e.onReady);
102
- H.current = e.onReady;
103
- const D = b(e.onViewStateChange);
104
- D.current = e.onViewStateChange;
105
- const N = b(e.onRuntimeError);
106
- N.current = e.onRuntimeError;
107
- const Z = b(d);
108
- Z.current = d;
109
- const U = b(void 0);
110
- fe(() => {
111
- if (!M.current) return;
112
- const r = ce.current;
113
- U.current = Z.current;
114
- const n = new Ie(M.current, {
93
+ if (c(r.getBoundingClientRect().width || (S ? S === !0 ? 800 : S.width ?? 800 : 0)), typeof ResizeObserver > "u") return;
94
+ const m = new ResizeObserver(([R]) => c(R.contentRect.width));
95
+ return m.observe(r), () => m.disconnect();
96
+ }, [h, ce, le]), E(() => {
97
+ (!x || d) && X(null);
98
+ }, [x, d]);
99
+ const fe = y({ center: o, zoom: i, pitch: g, bearing: p });
100
+ fe.current = { center: o, zoom: i, pitch: g, bearing: p };
101
+ const V = y(e.onReady);
102
+ V.current = e.onReady;
103
+ const A = y(e.onViewStateChange);
104
+ A.current = e.onViewStateChange;
105
+ const q = y(e.onRuntimeError);
106
+ q.current = e.onRuntimeError;
107
+ const Z = y(u);
108
+ Z.current = u;
109
+ const U = y(f);
110
+ U.current = f;
111
+ const Q = y(void 0), ee = y(void 0);
112
+ ge(() => {
113
+ if (!k.current) return;
114
+ const r = fe.current;
115
+ ee.current = Z.current, Q.current = U.current;
116
+ const n = new He(k.current, {
115
117
  center: r.center,
116
118
  zoom: r.zoom,
117
119
  pitch: r.pitch,
118
120
  bearing: r.bearing,
119
121
  basemap: Z.current,
120
- basemapKey: y,
121
- attribution: h,
122
- headless: f ? f === !0 ? {} : f : void 0,
122
+ projection: U.current,
123
+ basemapKey: v,
124
+ attribution: b,
125
+ headless: S ? S === !0 ? {} : S : void 0,
123
126
  chromeHosts: {
124
- badge: W.current.badge ?? void 0,
125
- attribution: W.current.attribution ?? void 0
127
+ badge: N.current.badge ?? void 0,
128
+ attribution: N.current.attribution ?? void 0
126
129
  },
127
- onRuntimeError: (l) => {
128
- var p;
129
- return (p = N.current) == null ? void 0 : p.call(N, l);
130
+ onRuntimeError: (c) => {
131
+ var m;
132
+ return (m = q.current) == null ? void 0 : m.call(q, c);
130
133
  }
131
134
  });
132
- j(n);
135
+ $(n);
133
136
  let a = !0;
134
137
  return n.ready.then(() => {
135
- var l;
136
- a && ((l = H.current) == null || l.call(H));
138
+ var c;
139
+ a && ((c = V.current) == null || c.call(V));
137
140
  }), () => {
138
- a = !1, j(null), n.destroy();
141
+ a = !1, $(null), n.destroy();
139
142
  };
140
- }, [ie]), E(() => {
141
- !c || U.current === d || (U.current = d, c.setBasemap(d ?? null));
142
- }, [c, d]), Ae(s, () => c, [c]), E(() => {
143
- if (!c) return;
144
- const r = { longitude: o == null ? void 0 : o[0], latitude: o == null ? void 0 : o[1], zoom: i, pitch: g, bearing: u };
145
- it(c.getViewState(), r) && c.setView(r);
146
- }, [c, o == null ? void 0 : o[0], o == null ? void 0 : o[1], i, g, u]), E(() => {
143
+ }, [ce]), E(() => {
144
+ !l || ee.current === u || (ee.current = u, l.setBasemap(u ?? null));
145
+ }, [l, u]), E(() => {
146
+ !l || Q.current === f || (Q.current = f, l.setProjection(f ?? null));
147
+ }, [l, f]), Ie(s, () => l, [l]), E(() => {
148
+ if (!l) return;
149
+ const r = { longitude: o == null ? void 0 : o[0], latitude: o == null ? void 0 : o[1], zoom: i, pitch: g, bearing: p };
150
+ ct(l.getViewState(), r) && l.setView(r);
151
+ }, [l, o == null ? void 0 : o[0], o == null ? void 0 : o[1], i, g, p]), E(() => {
147
152
  var r;
148
- if (c)
149
- return (r = D.current) == null || r.call(D, c.getViewState()), c.getStore("viewport").subscribe(() => {
153
+ if (l)
154
+ return (r = A.current) == null || r.call(A, l.getViewState()), l.getStore("viewport").subscribe(() => {
150
155
  var n;
151
- return (n = D.current) == null ? void 0 : n.call(D, c.getViewState());
156
+ return (n = A.current) == null ? void 0 : n.call(A, l.getViewState());
152
157
  });
153
- }, [c]);
154
- const A = C["bottom-start"], V = C["bottom-end"];
158
+ }, [l]);
159
+ const z = L["bottom-start"], G = L["bottom-end"];
155
160
  E(() => {
156
- const r = P.current;
157
- if (!r || !V || typeof ResizeObserver > "u") return;
161
+ const r = F.current;
162
+ if (!r || !G || typeof ResizeObserver > "u") return;
158
163
  const n = () => {
159
- const l = parseFloat(getComputedStyle(r).getPropertyValue("--om-widget-gap-y")) || 8, p = V.getBoundingClientRect(), R = Xe(
160
- (A == null ? void 0 : A.getBoundingClientRect()) ?? null,
161
- p,
162
- F ? Ze : 0,
163
- l
164
- ), _ = R + Math.ceil(p.height) + l;
165
- Se((I) => I.lift === R && I.shift === _ ? I : { lift: R, shift: _ });
164
+ const c = parseFloat(getComputedStyle(r).getPropertyValue("--om-widget-gap-y")) || 8, m = G.getBoundingClientRect(), R = Qe(
165
+ (z == null ? void 0 : z.getBoundingClientRect()) ?? null,
166
+ m,
167
+ x ? et : 0,
168
+ c
169
+ ), D = R + Math.ceil(m.height) + c;
170
+ Re((K) => K.lift === R && K.shift === D ? K : { lift: R, shift: D });
166
171
  }, a = new ResizeObserver(n);
167
- return a.observe(r), a.observe(V), A && a.observe(A), n(), () => a.disconnect();
168
- }, [A, V, F]);
169
- const Me = $(
172
+ return a.observe(r), a.observe(G), z && a.observe(z), n(), () => a.disconnect();
173
+ }, [z, G, x]);
174
+ const De = _(
170
175
  () => ({
171
176
  position: "absolute",
172
177
  inset: 0,
@@ -176,74 +181,74 @@ const yt = De(function(e, s) {
176
181
  // Measured clearance for the floating bottom drawer toggle — the
177
182
  // drawer root reads it through foldDrawerStyle's max() (same wiring
178
183
  // as the HTML lane's widget layer).
179
- "--om-fold-bottom-shift": `${B.shift}px`,
180
- ...T ? Ke(T).properties : void 0
184
+ "--om-fold-bottom-shift": `${H.shift}px`,
185
+ ...P ? Ne(P).properties : void 0
181
186
  }),
182
- [T, B.shift]
183
- ), Q = $(() => c ? new rt(c) : null, [c]), de = $(
184
- () => c && Q && L ? { controller: c, layers: Q, overlayPane: L, corners: C, widgetsHidden: !!v, widgetsFolded: F, foldPanels: ne, registerFoldedWidget: ae, registerSlotWidget: le } : null,
185
- [c, Q, L, C, v, F, ne, ae, le]
187
+ [P, H.shift]
188
+ ), te = _(() => l ? new st(l) : null, [l]), pe = _(
189
+ () => l && te && B ? { controller: l, layers: te, overlayPane: B, corners: L, widgetsHidden: !!d, widgetsFolded: x, foldPanels: ie, registerFoldedWidget: de, registerSlotWidget: ue } : null,
190
+ [l, te, B, L, d, x, ie, de, ue]
186
191
  );
187
- return /* @__PURE__ */ ee("div", { ref: P, className: S, style: { position: "relative", overflow: "hidden", ...O }, children: [
188
- /* @__PURE__ */ x("div", { ref: M, style: { position: "absolute", inset: 0 } }),
189
- /* @__PURE__ */ x(
192
+ return /* @__PURE__ */ re("div", { ref: F, className: O, style: { position: "relative", overflow: "hidden", ...w }, children: [
193
+ /* @__PURE__ */ C("div", { ref: k, style: { position: "absolute", inset: 0 } }),
194
+ /* @__PURE__ */ C(
190
195
  "div",
191
196
  {
192
- ref: xe,
197
+ ref: ke,
193
198
  style: { position: "absolute", top: 0, left: 0, zIndex: 10, pointerEvents: "none" }
194
199
  }
195
200
  ),
196
- /* @__PURE__ */ x("div", { "data-om-widget-layer": "", style: Me, children: q.map((r) => /* @__PURE__ */ ee(
201
+ /* @__PURE__ */ C("div", { "data-om-widget-layer": "", style: De, children: J.map((r) => /* @__PURE__ */ re(
197
202
  "div",
198
203
  {
199
204
  "data-om-widget-slot": r,
200
- ref: Te[r],
205
+ ref: Me[r],
201
206
  style: {
202
- ...nt[r],
203
- ...B.lift > 0 && r === "bottom-end" ? { bottom: `calc(var(--om-widget-inset-y, 12px) + ${B.lift}px)` } : void 0
207
+ ...it[r],
208
+ ...H.lift > 0 && r === "bottom-end" ? { bottom: `calc(var(--om-widget-inset-y, 12px) + ${H.lift}px)` } : void 0
204
209
  },
205
210
  children: [
206
- F && K.filter((n) => We(n) === r && we[n] > 0).map((n) => {
207
- const a = Ee === n;
208
- return /* @__PURE__ */ ee(
211
+ x && W.filter((n) => Ve(n) === r && Pe[n] > 0).map((n) => {
212
+ const a = Fe === n;
213
+ return /* @__PURE__ */ re(
209
214
  "div",
210
215
  {
211
216
  "data-om-fold-drawer": n,
212
- style: { ...Ve(n), display: v ? "none" : "flex" },
213
- onKeyDown: (l) => {
214
- var p;
215
- l.key !== "Escape" || !a || (X(null), (p = l.currentTarget.querySelector("[data-om-fold-toggle]")) == null || p.focus(), l.preventDefault(), l.stopPropagation());
217
+ style: { ...Je(n), display: d ? "none" : "flex" },
218
+ onKeyDown: (c) => {
219
+ var m;
220
+ c.key !== "Escape" || !a || (X(null), (m = c.currentTarget.querySelector("[data-om-fold-toggle]")) == null || m.focus(), c.preventDefault(), c.stopPropagation());
216
221
  },
217
222
  children: [
218
- /* @__PURE__ */ x(
223
+ /* @__PURE__ */ C(
219
224
  "button",
220
225
  {
221
226
  type: "button",
222
227
  "data-om-fold-toggle": n,
223
228
  "aria-expanded": a,
224
- "aria-controls": `${oe}-${n}`,
229
+ "aria-controls": `${ae}-${n}`,
225
230
  "aria-label": `${a ? "Close" : "Open"} ${n} map controls`,
226
- style: He(),
231
+ style: qe(),
227
232
  onClick: () => {
228
233
  X(a ? null : n), a || requestAnimationFrame(() => {
229
- var p;
230
- const l = (p = P.current) == null ? void 0 : p.querySelector(`[data-om-fold-panel="${n}"]`);
231
- l && st(l);
234
+ var m;
235
+ const c = (m = F.current) == null ? void 0 : m.querySelector(`[data-om-fold-panel="${n}"]`);
236
+ c && lt(c);
232
237
  });
233
238
  },
234
239
  children: "⋯"
235
240
  }
236
241
  ),
237
- /* @__PURE__ */ x(
242
+ /* @__PURE__ */ C(
238
243
  "div",
239
244
  {
240
- id: `${oe}-${n}`,
241
- ref: ke[n],
245
+ id: `${ae}-${n}`,
246
+ ref: Le[n],
242
247
  "data-om-fold-panel": n,
243
248
  role: "region",
244
249
  "aria-label": `${n} map controls`,
245
250
  hidden: !a,
246
- style: { ...Ne(n), display: a ? "flex" : "none" }
251
+ style: { ...Ge(n), display: a ? "flex" : "none" }
247
252
  }
248
253
  )
249
254
  ]
@@ -251,33 +256,33 @@ const yt = De(function(e, s) {
251
256
  `fold-${n}`
252
257
  );
253
258
  }),
254
- r === "bottom-start" && /* @__PURE__ */ x(
259
+ r === "bottom-start" && /* @__PURE__ */ C(
255
260
  "div",
256
261
  {
257
262
  "data-om-mandated-chrome": "badge",
258
263
  ref: (n) => {
259
- W.current.badge = n;
264
+ N.current.badge = n;
260
265
  },
261
- style: me
266
+ style: ye
262
267
  }
263
268
  ),
264
- r === "bottom-end" && /* @__PURE__ */ x(
269
+ r === "bottom-end" && /* @__PURE__ */ C(
265
270
  "div",
266
271
  {
267
272
  "data-om-mandated-chrome": "attribution",
268
273
  ref: (n) => {
269
- W.current.attribution = n;
274
+ N.current.attribution = n;
270
275
  },
271
- style: me
276
+ style: ye
272
277
  }
273
278
  )
274
279
  ]
275
280
  },
276
281
  r
277
282
  )) }),
278
- de && /* @__PURE__ */ x(he.Provider, { value: de, children: w })
283
+ pe && /* @__PURE__ */ C(Oe.Provider, { value: pe, children: j })
279
284
  ] });
280
- }), ve = {
285
+ }), we = {
281
286
  id: "id",
282
287
  type: "type",
283
288
  data: "data",
@@ -302,60 +307,62 @@ const yt = De(function(e, s) {
302
307
  refresh: "refresh",
303
308
  terrain: "terrain",
304
309
  visibleZoomRange: "visibleZoomRange",
310
+ crs: "crs",
311
+ crsDef: "crsDef",
305
312
  updateTriggers: "updateTriggers"
306
- }, at = /* @__PURE__ */ new Set([...Object.keys(ve), "onClick", "onHover"]);
307
- function lt(t) {
313
+ }, dt = /* @__PURE__ */ new Set([...Object.keys(we), "onClick", "onHover"]);
314
+ function ut(t) {
308
315
  const e = {};
309
316
  for (const [o, i] of Object.entries(t))
310
- !at.has(o) && i !== void 0 && (e[o] = i);
317
+ !dt.has(o) && i !== void 0 && (e[o] = i);
311
318
  const s = {};
312
- for (const [o, i] of Object.entries(ve))
319
+ for (const [o, i] of Object.entries(we))
313
320
  s[i] = t[o];
314
321
  return Object.keys(e).length > 0 && (s.props = e), s;
315
322
  }
316
- function bt(t) {
317
- const { controller: e, layers: s } = G("OmLayer"), { id: o } = t, i = lt(t);
323
+ function St(t) {
324
+ const { controller: e, layers: s } = Y("OmLayer"), { id: o } = t, i = ut(t);
318
325
  E(() => {
319
326
  s.upsert(i);
320
327
  }), E(() => () => s.remove(o), [s, o]);
321
- const g = b(t.onClick);
328
+ const g = y(t.onClick);
322
329
  g.current = t.onClick;
323
- const u = b(t.onHover);
324
- return u.current = t.onHover, E(
325
- () => e.watchPicks((d) => {
326
- var y, h, f;
327
- if (d === null) {
328
- (y = u.current) == null || y.call(u, null);
330
+ const p = y(t.onHover);
331
+ return p.current = t.onHover, E(
332
+ () => e.watchPicks((u) => {
333
+ var f, v, b;
334
+ if (u === null) {
335
+ (f = p.current) == null || f.call(p, null);
329
336
  return;
330
337
  }
331
- d.layerId === o && (d.type === "click" ? (h = g.current) == null || h.call(g, d) : (f = u.current) == null || f.call(u, d));
338
+ u.layerId === o && (u.type === "click" ? (v = g.current) == null || v.call(g, u) : (b = p.current) == null || b.call(p, u));
332
339
  }),
333
340
  [e, o]
334
341
  ), null;
335
342
  }
336
- function ht({ position: t = "top-start", order: e, fold: s, className: o, style: i, children: g }) {
337
- const { corners: u, widgetsHidden: d, widgetsFolded: y, foldPanels: h, registerFoldedWidget: f, registerSlotWidget: T } = G("OmWidget"), v = ge(), m = Ue(t) ?? "top-start", S = y && m !== "manual" && s !== "never", O = m === "manual" ? null : Qe(m);
343
+ function Ot({ position: t = "top-start", order: e, fold: s, className: o, style: i, children: g }) {
344
+ const { corners: p, widgetsHidden: u, widgetsFolded: f, foldPanels: v, registerFoldedWidget: b, registerSlotWidget: S } = Y("OmWidget"), P = he(), d = tt(t) ?? "top-start", h = f && d !== "manual" && s !== "never", O = d === "manual" ? null : rt(d);
338
345
  if (E(() => {
339
346
  if (O)
340
- return f(O, v, S), () => f(O, v, !1);
341
- }, [O, v, S, f]), E(() => {
342
- if (m !== "manual")
343
- return T(m, v, !0), () => T(m, v, !1);
344
- }, [m, v, T]), m === "manual")
345
- return /* @__PURE__ */ x("div", { className: o, style: { pointerEvents: "auto", ...i }, children: g });
346
- const w = S && O ? h[O] : u[m];
347
- return w ? be(
348
- /* @__PURE__ */ x(
347
+ return b(O, P, h), () => b(O, P, !1);
348
+ }, [O, P, h, b]), E(() => {
349
+ if (d !== "manual")
350
+ return S(d, P, !0), () => S(d, P, !1);
351
+ }, [d, P, S]), d === "manual")
352
+ return /* @__PURE__ */ C("div", { className: o, style: { pointerEvents: "auto", ...i }, children: g });
353
+ const w = h && O ? v[O] : p[d];
354
+ return w ? Se(
355
+ /* @__PURE__ */ C(
349
356
  "div",
350
357
  {
351
358
  "data-om-react-widget": "",
352
- "data-om-fold-origin-slot": S ? m : void 0,
359
+ "data-om-fold-origin-slot": h ? d : void 0,
353
360
  className: o,
354
361
  style: {
355
362
  ...e !== void 0 ? { order: e } : void 0,
356
363
  ...i,
357
- pointerEvents: d ? "none" : (i == null ? void 0 : i.pointerEvents) ?? "auto",
358
- visibility: d ? "hidden" : i == null ? void 0 : i.visibility
364
+ pointerEvents: u ? "none" : (i == null ? void 0 : i.pointerEvents) ?? "auto",
365
+ visibility: u ? "hidden" : i == null ? void 0 : i.visibility
359
366
  },
360
367
  children: g
361
368
  }
@@ -363,13 +370,13 @@ function ht({ position: t = "top-start", order: e, fold: s, className: o, style:
363
370
  w
364
371
  ) : null;
365
372
  }
366
- function ct(t, e) {
373
+ function ft(t, e) {
367
374
  return e !== void 0 && e < 0 && t.isGeospatial !== !1;
368
375
  }
369
- function pe(t, e, s, o) {
376
+ function be(t, e, s, o) {
370
377
  return e && (t == null ? void 0 : t.layerId) !== e ? !1 : !s || (t ? t.type : o) === s;
371
378
  }
372
- const dt = {
379
+ const pt = {
373
380
  "top-left": "translate(0, 0)",
374
381
  "top-center": "translate(-50%, 0)",
375
382
  "top-right": "translate(-100%, 0)",
@@ -380,52 +387,52 @@ const dt = {
380
387
  "bottom-center": "translate(-50%, -100%)",
381
388
  "bottom-right": "translate(-100%, -100%)"
382
389
  };
383
- function vt(t) {
384
- const { controller: e, overlayPane: s } = G("OmOverlay"), o = b(null), i = b(void 0), g = b(t);
390
+ function wt(t) {
391
+ const { controller: e, overlayPane: s } = Y("OmOverlay"), o = y(null), i = y(void 0), g = y(t);
385
392
  g.current = t;
386
- const u = $(() => {
387
- const m = e.getStore("selection");
388
- let S, O, w = null;
393
+ const p = _(() => {
394
+ const d = e.getStore("selection");
395
+ let h, O, w = null;
389
396
  return {
390
- subscribe: m.subscribe,
397
+ subscribe: d.subscribe,
391
398
  getSnapshot: () => {
392
- const P = m.getSnapshot(), { anchorFrom: M, layer: c, selectionType: j } = g.current, L = `${M ?? ""}|${c ?? ""}|${j ?? ""}`;
393
- return (P !== S || L !== O) && (S = P, O = L, M === "selection" && pe(P, c, j, e.getLastPickType()) && (w = P)), w;
399
+ const j = d.getSnapshot(), { anchorFrom: F, layer: k, selectionType: l } = g.current, $ = `${F ?? ""}|${k ?? ""}|${l ?? ""}`;
400
+ return (j !== h || $ !== O) && (h = j, O = $, F === "selection" && be(j, k, l, e.getLastPickType()) && (w = j)), w;
394
401
  }
395
402
  };
396
- }, [e]), d = ye(
397
- u.subscribe,
398
- u.getSnapshot,
399
- u.getSnapshot
403
+ }, [e]), u = ve(
404
+ p.subscribe,
405
+ p.getSnapshot,
406
+ p.getSnapshot
400
407
  );
401
408
  E(
402
- () => e.registerOverlay((m, S, O) => {
409
+ () => e.registerOverlay((d, h, O) => {
403
410
  const w = o.current;
404
411
  if (!w) return;
405
- const { anchor: P, anchorFrom: M, layer: c, selectionType: j, visible: L = !0, anchorOffset: J } = g.current;
406
- let C;
407
- if (M === "selection" ? (pe(S, c, j, O) && (i.current = (S == null ? void 0 : S.coordinate) ?? void 0), C = i.current) : C = P, !L || !C || !m) {
412
+ const { anchor: j, anchorFrom: F, layer: k, selectionType: l, visible: $ = !0, anchorOffset: B } = g.current;
413
+ let M;
414
+ if (F === "selection" ? (be(h, k, l, O) && (i.current = (h == null ? void 0 : h.coordinate) ?? void 0), M = i.current) : M = j, !$ || !M || !d) {
408
415
  w.style.visibility = "hidden";
409
416
  return;
410
417
  }
411
- const [z, F, Y] = m.project([C[0], C[1], C[2] ?? 0]);
412
- if (!(z >= 0 && z <= m.width && F >= 0 && F <= m.height) || ct(m, Y)) {
418
+ const [L, I, x] = d.project([M[0], M[1], M[2] ?? 0]);
419
+ if (!(L >= 0 && L <= d.width && I >= 0 && I <= d.height) || ft(d, x)) {
413
420
  w.style.visibility = "hidden";
414
421
  return;
415
422
  }
416
- w.style.visibility = "visible", w.style.transform = `translate(${z}px, ${F}px) ${dt[J ?? "bottom-center"]}`;
423
+ w.style.visibility = "visible", w.style.transform = `translate(${L}px, ${I}px) ${pt[B ?? "bottom-center"]}`;
417
424
  }),
418
425
  [e]
419
426
  ), E(() => {
420
427
  e.refreshOverlays();
421
428
  });
422
- const { children: y, className: h, style: f, interactive: T = !0 } = t, v = typeof y == "function" ? y(d) : y;
423
- return be(
424
- /* @__PURE__ */ x(
429
+ const { children: f, className: v, style: b, interactive: S = !0 } = t, P = typeof f == "function" ? f(u) : f;
430
+ return Se(
431
+ /* @__PURE__ */ C(
425
432
  "div",
426
433
  {
427
434
  ref: o,
428
- className: h,
435
+ className: v,
429
436
  style: {
430
437
  position: "absolute",
431
438
  top: 0,
@@ -433,38 +440,38 @@ function vt(t) {
433
440
  visibility: "hidden",
434
441
  // hidden until the first flush positions it — never flashes at the origin
435
442
  willChange: "transform",
436
- pointerEvents: T ? "auto" : "none",
437
- ...f
443
+ pointerEvents: S ? "auto" : "none",
444
+ ...b
438
445
  },
439
- children: v
446
+ children: P
440
447
  }
441
448
  ),
442
449
  s
443
450
  );
444
451
  }
445
- function St(t = []) {
446
- const { controller: e } = G("useOmMap"), s = t.join(" "), o = $(() => {
447
- const u = (s ? s.split(" ") : []).flatMap((y) => et(y) ? [e.getStore(y)] : (console.warn(`[onlymapjs] useOmMap: "${y}" is not a watch token on the React front-end — expected viewport, selection, layers, or data:<layerId>.`), []));
448
- let d;
452
+ function Rt(t = []) {
453
+ const { controller: e } = Y("useOmMap"), s = t.join(" "), o = _(() => {
454
+ const p = (s ? s.split(" ") : []).flatMap((f) => nt(f) ? [e.getStore(f)] : (console.warn(`[onlymapjs] useOmMap: "${f}" is not a watch token on the React front-end — expected viewport, selection, layers, or data:<layerId>.`), []));
455
+ let u;
449
456
  return {
450
- subscribe: (y) => {
451
- const h = u.map((f) => f.subscribe(y));
457
+ subscribe: (f) => {
458
+ const v = p.map((b) => b.subscribe(f));
452
459
  return () => {
453
- for (const f of h) f();
460
+ for (const b of v) b();
454
461
  };
455
462
  },
456
463
  getSnapshot: () => {
457
- const y = u.map((h) => h.getSnapshot());
458
- return (!d || y.some((h, f) => h !== d[f])) && (d = y), d;
464
+ const f = p.map((v) => v.getSnapshot());
465
+ return (!u || f.some((v, b) => v !== u[b])) && (u = f), u;
459
466
  }
460
467
  };
461
- }, [e, s]), i = ye(o.subscribe, o.getSnapshot, o.getSnapshot);
462
- return $(() => e.buildCtx(), [e, i]);
468
+ }, [e, s]), i = ve(o.subscribe, o.getSnapshot, o.getSnapshot);
469
+ return _(() => e.buildCtx(), [e, i]);
463
470
  }
464
471
  export {
465
- bt as OmLayer,
466
- yt as OmMap,
467
- vt as OmOverlay,
468
- ht as OmWidget,
469
- St as useOmMap
472
+ St as OmLayer,
473
+ vt as OmMap,
474
+ wt as OmOverlay,
475
+ Ot as OmWidget,
476
+ Rt as useOmMap
470
477
  };