@nika-js/onlymap 0.6.13 → 0.6.15

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 (36) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{LercDecode.es-DB1mYTrm.js → LercDecode.es-BWmtr6fp.js} +1 -1
  3. package/dist/attribute-resolution.d.ts +2 -0
  4. package/dist/{basemap-CDp9EsvL.js → basemap-DQeUv-pk.js} +1 -1
  5. package/dist/clip-box-controller.d.ts +1 -1
  6. package/dist/clip-box.d.ts +0 -32
  7. package/dist/data-layer.d.ts +0 -17
  8. package/dist/effects.d.ts +1 -0
  9. package/dist/elements/om-map.d.ts +0 -20
  10. package/dist/elements/om-story.d.ts +0 -18
  11. package/dist/expr/errors.d.ts +3 -0
  12. package/dist/field-access.d.ts +10 -0
  13. package/dist/geodesy.d.ts +11 -0
  14. package/dist/{geoparquet-CI3o8X5-.js → geoparquet-DsYXvvEo.js} +1 -1
  15. package/dist/{index-Dio4lUCZ.js → index-BTJy4dWy.js} +1 -1
  16. package/dist/{index-CnKC1yuV.js → index-Bnkk4jcp.js} +26197 -26173
  17. package/dist/{index-Bue-53Xo.js → index-CbHslg3u.js} +1 -1
  18. package/dist/{index-BJh0t_nt.js → index-DMRuqiXV.js} +2 -2
  19. package/dist/{index-DMu0qL9C.js → index-gMV11Nr5.js} +1 -1
  20. package/dist/layer-registry.d.ts +10 -0
  21. package/dist/layers/marker-icons.d.ts +0 -2
  22. package/dist/legend-spec.d.ts +1 -6
  23. package/dist/{lerc-B1LFm9ra.js → lerc-Cw1YMyb0.js} +2 -2
  24. package/dist/onlymap.standalone.js +33282 -33258
  25. package/dist/onlymapjs.js +1 -1
  26. package/dist/programmatic.d.ts +0 -16
  27. package/dist/{raster-DQ1dS7mZ.js → raster-BJaQlAzq.js} +2 -2
  28. package/dist/{raster-pipeline-mXzwFf0A.js → raster-pipeline-BCVaME9y.js} +1 -1
  29. package/dist/react.js +215 -232
  30. package/dist/runtime-core.d.ts +37 -0
  31. package/dist/site-placement.d.ts +0 -2
  32. package/dist/version.d.ts +1 -1
  33. package/dist/{zarr-BSoVUvcs.js → zarr-C6xeWGwX.js} +2 -2
  34. package/package.json +1 -1
  35. package/skills/onlymapjs/SKILL.md +1 -1
  36. package/skills/onlymapjs/references/syntax.md +2 -2
package/dist/react.js CHANGED
@@ -1,210 +1,210 @@
1
- var Ee = Object.defineProperty;
2
- var Fe = (e, t, s) => t in e ? Ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var oe = (e, t, s) => Fe(e, typeof t != "symbol" ? t + "" : t, s);
1
+ var Re = Object.defineProperty;
2
+ var Fe = (t, e, s) => e in t ? Re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
+ var oe = (t, e, s) => Fe(t, typeof e != "symbol" ? e + "" : e, s);
4
4
  import { jsxs as X, jsx as O } from "react/jsx-runtime";
5
- import { createContext as Re, useContext as xe, forwardRef as Ce, useRef as h, useState as j, useId as ce, useCallback as se, useMemo as L, useLayoutEffect as ie, useEffect as R, useImperativeHandle as Te, useSyncExternalStore as de } from "react";
6
- import { MANAGED_SLOTS as Pe, slotContainerStyle as ke, FOLD_SIDES as A, MapController as Le, parseWidgetStyle as Me, foldToggleSlot as $e, foldToggleStyle as je, foldPanelStyle as De, foldDrawerStyle as _e, resolveFoldBreakpointPx as Ae, shouldFoldAtWidth as Ie, DEFAULT_FOLD_BREAKPOINT_PX as ze, resolveSlot as Ke, foldSideForSlot as He, isStoreToken as Ne } from "@nika-js/onlymap";
5
+ import { createContext as Pe, useContext as xe, forwardRef as Ce, useRef as b, useState as $, useId as ce, useCallback as se, useMemo as M, useLayoutEffect as ie, useEffect as F, useImperativeHandle as Te, useSyncExternalStore as de } from "react";
6
+ import { MANAGED_SLOTS as ke, slotContainerStyle as Me, FOLD_SIDES as A, MapController as je, parseWidgetStyle as Le, foldToggleSlot as $e, foldToggleStyle as De, foldPanelStyle as _e, foldDrawerStyle as Ae, resolveFoldBreakpointPx as Ie, shouldFoldAtWidth as Ke, DEFAULT_FOLD_BREAKPOINT_PX as ze, resolveSlot as He, foldSideForSlot as Ne, isStoreToken as We } from "@nika-js/onlymap";
7
7
  import { createPortal as ue } from "react-dom";
8
- const fe = Re(null);
9
- function W(e) {
10
- const t = xe(fe);
11
- if (!t) throw new Error(`[onlymapjs] ${e} must be rendered inside <OmMap>.`);
12
- return t;
8
+ const fe = Pe(null);
9
+ function W(t) {
10
+ const e = xe(fe);
11
+ if (!e) throw new Error(`[onlymapjs] ${t} must be rendered inside <OmMap>.`);
12
+ return e;
13
13
  }
14
- function Q(e, t) {
15
- if (e === t) return !0;
16
- const s = Object.keys(e ?? {}), o = Object.keys(t ?? {});
17
- return s.length !== o.length ? !1 : s.every((i) => e[i] === t[i]);
14
+ function Q(t, e) {
15
+ if (t === e) return !0;
16
+ const s = Object.keys(t ?? {}), n = Object.keys(e ?? {});
17
+ return s.length !== n.length ? !1 : s.every((i) => t[i] === e[i]);
18
18
  }
19
- function We(e, t) {
20
- const { props: s, updateTriggers: o, ...i } = e, { props: m, updateTriggers: c, ...l } = t;
21
- return Q(i, l) && Q(s, m) && Q(o, c);
19
+ function Be(t, e) {
20
+ const { props: s, updateTriggers: n, ...i } = t, { props: p, updateTriggers: c, ...l } = e;
21
+ return Q(i, l) && Q(s, p) && Q(n, c);
22
22
  }
23
23
  class qe {
24
- constructor(t) {
24
+ constructor(e) {
25
25
  oe(this, "descriptors", /* @__PURE__ */ new Map());
26
- this.controller = t;
26
+ this.controller = e;
27
27
  }
28
- upsert(t) {
29
- const s = this.descriptors.get(t.id);
30
- s && We(s, t) || (this.descriptors.set(t.id, t), this.controller.setLayers([...this.descriptors.values()]));
28
+ upsert(e) {
29
+ const s = this.descriptors.get(e.id);
30
+ s && Be(s, e) || (this.descriptors.set(e.id, e), this.controller.setLayers([...this.descriptors.values()]));
31
31
  }
32
- remove(t) {
33
- this.descriptors.delete(t) && this.controller.setLayers([...this.descriptors.values()]);
32
+ remove(e) {
33
+ this.descriptors.delete(e) && this.controller.setLayers([...this.descriptors.values()]);
34
34
  }
35
35
  }
36
- const N = Pe, Ve = Object.fromEntries(N.map((e) => [e, ke(e)])), ae = { display: "flex", pointerEvents: "none", order: 2147483647 }, Be = Object.fromEntries(A.map((e) => [e, null]));
37
- function Je(e) {
38
- const t = e.querySelector(
36
+ const N = ke, Ve = Object.fromEntries(N.map((t) => [t, Me(t)])), ae = { display: "flex", pointerEvents: "none", order: 2147483647 }, Je = Object.fromEntries(A.map((t) => [t, null]));
37
+ function Ye(t) {
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
- t ? t.focus() : (e.tabIndex = -1, e.focus());
41
+ e ? e.focus() : (t.tabIndex = -1, t.focus());
42
42
  }
43
- function Ye(e, t) {
44
- return Object.entries(t).some(([s, o]) => o !== void 0 && e[s] !== o);
43
+ function Ge(t, e) {
44
+ return Object.entries(e).some(([s, n]) => n !== void 0 && t[s] !== n);
45
45
  }
46
- const nt = Ce(function(t, s) {
47
- const { center: o, zoom: i, pitch: m, bearing: c, basemap: l, basemapKey: g, attribution: p, headless: d, widgetStyle: x, widgetsHidden: v, widgetsFold: b = !0, className: y, style: C, children: w } = t, E = h(null), P = h(null), [a, M] = j(null), [k, q] = j(null), [T, D] = j(
46
+ const ot = Ce(function(e, s) {
47
+ const { center: n, zoom: i, pitch: p, bearing: c, basemap: l, basemapKey: m, attribution: h, headless: d, widgetStyle: P, widgetsHidden: v, widgetsFold: g = !0, className: y, style: x, children: w } = e, E = b(null), T = b(null), [a, j] = $(null), [k, B] = $(null), [C, D] = $(
48
48
  () => Object.fromEntries(N.map((r) => [r, null]))
49
- ), [F, I] = j(!1), [V, me] = j(Be), [ge, ye] = j(
49
+ ), [R, I] = $(!1), [q, me] = $(Je), [ye, ge] = $(
50
50
  () => Object.fromEntries(A.map((r) => [r, 0]))
51
- ), [be, B] = j(null), Z = `om-react-fold-${ce().replaceAll(":", "")}`, he = h(new Map(A.map((r) => [r, /* @__PURE__ */ new Set()]))), ee = d ? JSON.stringify(d) : "", z = h({
51
+ ), [be, V] = $(null), Z = `om-react-fold-${ce().replaceAll(":", "")}`, he = b(new Map(A.map((r) => [r, /* @__PURE__ */ new Set()]))), ee = d ? JSON.stringify(d) : "", K = b({
52
52
  badge: null,
53
53
  attribution: null
54
- }), pe = se((r) => {
55
- q((n) => n === r ? n : r);
56
- }, []), ve = L(
54
+ }), ve = se((r) => {
55
+ B((o) => o === r ? o : r);
56
+ }, []), Se = M(
57
57
  () => Object.fromEntries(
58
58
  N.map((r) => [
59
59
  r,
60
- (n) => {
61
- D((u) => u[r] === n ? u : { ...u, [r]: n });
60
+ (o) => {
61
+ D((u) => u[r] === o ? u : { ...u, [r]: o });
62
62
  }
63
63
  ])
64
64
  ),
65
65
  []
66
- ), Se = L(
66
+ ), Oe = M(
67
67
  () => Object.fromEntries(
68
68
  A.map((r) => [
69
69
  r,
70
- (n) => {
71
- me((u) => u[r] === n ? u : { ...u, [r]: n });
70
+ (o) => {
71
+ me((u) => u[r] === o ? u : { ...u, [r]: o });
72
72
  }
73
73
  ])
74
74
  ),
75
75
  []
76
- ), te = se((r, n, u) => {
76
+ ), te = se((r, o, u) => {
77
77
  const f = he.current.get(r), S = f.size;
78
- u ? f.add(n) : f.delete(n), f.size !== S && ye((_) => ({ ..._, [r]: f.size }));
78
+ u ? f.add(o) : f.delete(o), f.size !== S && ge((_) => ({ ..._, [r]: f.size }));
79
79
  }, []);
80
80
  ie(() => {
81
81
  const r = E.current;
82
82
  if (!r) return;
83
- let n, u = ze;
83
+ let o, u = ze;
84
84
  const f = (_) => {
85
85
  const U = getComputedStyle(r).getPropertyValue("--om-widget-fold-breakpoint").trim();
86
- U !== n && (n = U, u = Ae(U, r)), I((we) => b && Ie(_, u, we));
86
+ U !== o && (o = U, u = Ie(U, r)), I((Ee) => g && Ke(_, u, Ee));
87
87
  };
88
88
  if (f(r.getBoundingClientRect().width || (d ? d === !0 ? 800 : d.width ?? 800 : 0)), typeof ResizeObserver > "u") return;
89
89
  const S = new ResizeObserver(([_]) => f(_.contentRect.width));
90
90
  return S.observe(r), () => S.disconnect();
91
- }, [b, ee]), R(() => {
92
- (!F || v) && B(null);
93
- }, [F, v]);
94
- const re = h({ center: o, zoom: i, pitch: m, bearing: c });
95
- re.current = { center: o, zoom: i, pitch: m, bearing: c };
96
- const K = h(t.onReady);
97
- K.current = t.onReady;
98
- const $ = h(t.onViewStateChange);
99
- $.current = t.onViewStateChange;
100
- const H = h(t.onRuntimeError);
101
- H.current = t.onRuntimeError;
102
- const J = h(l);
91
+ }, [g, ee]), F(() => {
92
+ (!R || v) && V(null);
93
+ }, [R, v]);
94
+ const re = b({ center: n, zoom: i, pitch: p, bearing: c });
95
+ re.current = { center: n, zoom: i, pitch: p, bearing: c };
96
+ const z = b(e.onReady);
97
+ z.current = e.onReady;
98
+ const L = b(e.onViewStateChange);
99
+ L.current = e.onViewStateChange;
100
+ const H = b(e.onRuntimeError);
101
+ H.current = e.onRuntimeError;
102
+ const J = b(l);
103
103
  J.current = l;
104
- const Y = h(void 0);
104
+ const Y = b(void 0);
105
105
  ie(() => {
106
- if (!P.current) return;
106
+ if (!T.current) return;
107
107
  const r = re.current;
108
108
  Y.current = J.current;
109
- const n = new Le(P.current, {
109
+ const o = new je(T.current, {
110
110
  center: r.center,
111
111
  zoom: r.zoom,
112
112
  pitch: r.pitch,
113
113
  bearing: r.bearing,
114
114
  basemap: J.current,
115
- basemapKey: g,
116
- attribution: p,
115
+ basemapKey: m,
116
+ attribution: h,
117
117
  headless: d ? d === !0 ? {} : d : void 0,
118
118
  chromeHosts: {
119
- badge: z.current.badge ?? void 0,
120
- attribution: z.current.attribution ?? void 0
119
+ badge: K.current.badge ?? void 0,
120
+ attribution: K.current.attribution ?? void 0
121
121
  },
122
122
  onRuntimeError: (f) => {
123
123
  var S;
124
124
  return (S = H.current) == null ? void 0 : S.call(H, f);
125
125
  }
126
126
  });
127
- M(n);
127
+ j(o);
128
128
  let u = !0;
129
- return n.ready.then(() => {
129
+ return o.ready.then(() => {
130
130
  var f;
131
- u && ((f = K.current) == null || f.call(K));
131
+ u && ((f = z.current) == null || f.call(z));
132
132
  }), () => {
133
- u = !1, M(null), n.destroy();
133
+ u = !1, j(null), o.destroy();
134
134
  };
135
- }, [ee]), R(() => {
135
+ }, [ee]), F(() => {
136
136
  !a || Y.current === l || (Y.current = l, a.setBasemap(l ?? null));
137
- }, [a, l]), Te(s, () => a, [a]), R(() => {
137
+ }, [a, l]), Te(s, () => a, [a]), F(() => {
138
138
  if (!a) return;
139
- const r = { longitude: o == null ? void 0 : o[0], latitude: o == null ? void 0 : o[1], zoom: i, pitch: m, bearing: c };
140
- Ye(a.getViewState(), r) && a.setView(r);
141
- }, [a, o == null ? void 0 : o[0], o == null ? void 0 : o[1], i, m, c]), R(() => {
139
+ const r = { longitude: n == null ? void 0 : n[0], latitude: n == null ? void 0 : n[1], zoom: i, pitch: p, bearing: c };
140
+ Ge(a.getViewState(), r) && a.setView(r);
141
+ }, [a, n == null ? void 0 : n[0], n == null ? void 0 : n[1], i, p, c]), F(() => {
142
142
  var r;
143
143
  if (a)
144
- return (r = $.current) == null || r.call($, a.getViewState()), a.getStore("viewport").subscribe(() => {
145
- var n;
146
- return (n = $.current) == null ? void 0 : n.call($, a.getViewState());
144
+ return (r = L.current) == null || r.call(L, a.getViewState()), a.getStore("viewport").subscribe(() => {
145
+ var o;
146
+ return (o = L.current) == null ? void 0 : o.call(L, a.getViewState());
147
147
  });
148
148
  }, [a]);
149
- const Oe = L(
149
+ const we = M(
150
150
  () => ({
151
151
  position: "absolute",
152
152
  inset: 0,
153
153
  zIndex: 20,
154
154
  pointerEvents: "none",
155
155
  opacity: "var(--om-widget-opacity, 1)",
156
- ...x ? Me(x).properties : void 0
156
+ ...P ? Le(P).properties : void 0
157
157
  }),
158
- [x]
159
- ), G = L(() => a ? new qe(a) : null, [a]), ne = L(
160
- () => a && G && k ? { controller: a, layers: G, overlayPane: k, corners: T, widgetsHidden: !!v, widgetsFolded: F, foldPanels: V, registerFoldedWidget: te } : null,
161
- [a, G, k, T, v, F, V, te]
158
+ [P]
159
+ ), G = M(() => a ? new qe(a) : null, [a]), ne = M(
160
+ () => a && G && k ? { controller: a, layers: G, overlayPane: k, corners: C, widgetsHidden: !!v, widgetsFolded: R, foldPanels: q, registerFoldedWidget: te } : null,
161
+ [a, G, k, C, v, R, q, te]
162
162
  );
163
- return /* @__PURE__ */ X("div", { ref: E, className: y, style: { position: "relative", overflow: "hidden", ...C }, children: [
164
- /* @__PURE__ */ O("div", { ref: P, style: { position: "absolute", inset: 0 } }),
163
+ return /* @__PURE__ */ X("div", { ref: E, className: y, style: { position: "relative", overflow: "hidden", ...x }, children: [
164
+ /* @__PURE__ */ O("div", { ref: T, style: { position: "absolute", inset: 0 } }),
165
165
  /* @__PURE__ */ O(
166
166
  "div",
167
167
  {
168
- ref: pe,
168
+ ref: ve,
169
169
  style: { position: "absolute", top: 0, left: 0, zIndex: 10, pointerEvents: "none" }
170
170
  }
171
171
  ),
172
- /* @__PURE__ */ O("div", { "data-om-widget-layer": "", style: Oe, children: N.map((r) => /* @__PURE__ */ X(
172
+ /* @__PURE__ */ O("div", { "data-om-widget-layer": "", style: we, children: N.map((r) => /* @__PURE__ */ X(
173
173
  "div",
174
174
  {
175
175
  "data-om-widget-slot": r,
176
- ref: ve[r],
176
+ ref: Se[r],
177
177
  style: {
178
178
  ...Ve[r],
179
- ...F && r === "bottom-end" ? { bottom: "calc(var(--om-widget-inset-y, 12px) + 28px)" } : void 0
179
+ ...R && r === "bottom-end" ? { bottom: "calc(var(--om-widget-inset-y, 12px) + 28px)" } : void 0
180
180
  },
181
181
  children: [
182
- F && A.filter((n) => $e(n) === r && ge[n] > 0).map((n) => {
183
- const u = be === n;
182
+ R && A.filter((o) => $e(o) === r && ye[o] > 0).map((o) => {
183
+ const u = be === o;
184
184
  return /* @__PURE__ */ X(
185
185
  "div",
186
186
  {
187
- "data-om-fold-drawer": n,
188
- style: { ..._e(n), display: v ? "none" : "flex" },
187
+ "data-om-fold-drawer": o,
188
+ style: { ...Ae(o), display: v ? "none" : "flex" },
189
189
  onKeyDown: (f) => {
190
190
  var S;
191
- f.key !== "Escape" || !u || (B(null), (S = f.currentTarget.querySelector("[data-om-fold-toggle]")) == null || S.focus(), f.preventDefault(), f.stopPropagation());
191
+ f.key !== "Escape" || !u || (V(null), (S = f.currentTarget.querySelector("[data-om-fold-toggle]")) == null || S.focus(), f.preventDefault(), f.stopPropagation());
192
192
  },
193
193
  children: [
194
194
  /* @__PURE__ */ O(
195
195
  "button",
196
196
  {
197
197
  type: "button",
198
- "data-om-fold-toggle": n,
198
+ "data-om-fold-toggle": o,
199
199
  "aria-expanded": u,
200
- "aria-controls": `${Z}-${n}`,
201
- "aria-label": `${u ? "Close" : "Open"} ${n} map controls`,
202
- style: je(),
200
+ "aria-controls": `${Z}-${o}`,
201
+ "aria-label": `${u ? "Close" : "Open"} ${o} map controls`,
202
+ style: De(),
203
203
  onClick: () => {
204
- B(u ? null : n), u || requestAnimationFrame(() => {
204
+ V(u ? null : o), u || requestAnimationFrame(() => {
205
205
  var S;
206
- const f = (S = E.current) == null ? void 0 : S.querySelector(`[data-om-fold-panel="${n}"]`);
207
- f && Je(f);
206
+ const f = (S = E.current) == null ? void 0 : S.querySelector(`[data-om-fold-panel="${o}"]`);
207
+ f && Ye(f);
208
208
  });
209
209
  },
210
210
  children: "⋯"
@@ -213,26 +213,26 @@ const nt = Ce(function(t, s) {
213
213
  /* @__PURE__ */ O(
214
214
  "div",
215
215
  {
216
- id: `${Z}-${n}`,
217
- ref: Se[n],
218
- "data-om-fold-panel": n,
216
+ id: `${Z}-${o}`,
217
+ ref: Oe[o],
218
+ "data-om-fold-panel": o,
219
219
  role: "region",
220
- "aria-label": `${n} map controls`,
220
+ "aria-label": `${o} map controls`,
221
221
  hidden: !u,
222
- style: { ...De(n), display: u ? "flex" : "none" }
222
+ style: { ..._e(o), display: u ? "flex" : "none" }
223
223
  }
224
224
  )
225
225
  ]
226
226
  },
227
- `fold-${n}`
227
+ `fold-${o}`
228
228
  );
229
229
  }),
230
230
  r === "bottom-start" && /* @__PURE__ */ O(
231
231
  "div",
232
232
  {
233
233
  "data-om-mandated-chrome": "badge",
234
- ref: (n) => {
235
- z.current.badge = n;
234
+ ref: (o) => {
235
+ K.current.badge = o;
236
236
  },
237
237
  style: ae
238
238
  }
@@ -241,8 +241,8 @@ const nt = Ce(function(t, s) {
241
241
  "div",
242
242
  {
243
243
  "data-om-mandated-chrome": "attribution",
244
- ref: (n) => {
245
- z.current.attribution = n;
244
+ ref: (o) => {
245
+ K.current.attribution = o;
246
246
  },
247
247
  style: ae
248
248
  }
@@ -253,109 +253,92 @@ const nt = Ce(function(t, s) {
253
253
  )) }),
254
254
  ne && /* @__PURE__ */ O(fe.Provider, { value: ne, children: w })
255
255
  ] });
256
- }), Ge = /* @__PURE__ */ new Set([
257
- "id",
258
- "type",
259
- "data",
260
- "label",
261
- "color",
262
- "filterField",
263
- "filterRange",
264
- "filterSoftRange",
265
- "filterFields",
266
- "filterCategoryField",
267
- "filterCategories",
268
- "filterCategoryFields",
269
- "dash",
270
- "dashJustified",
271
- "source",
272
- "streamKey",
273
- "flush",
274
- "refresh",
275
- "terrain",
276
- "updateTriggers",
277
- "onClick",
278
- "onHover"
279
- ]);
280
- function Ue(e) {
281
- const t = {};
282
- for (const [s, o] of Object.entries(e))
283
- !Ge.has(s) && o !== void 0 && (t[s] = o);
284
- return {
285
- id: e.id,
286
- type: e.type,
287
- data: e.data,
288
- label: e.label,
289
- color: e.color,
290
- filterField: e.filterField,
291
- filterRange: e.filterRange,
292
- filterSoftRange: e.filterSoftRange,
293
- filterFields: e.filterFields,
294
- filterCategoryField: e.filterCategoryField,
295
- filterCategories: e.filterCategories,
296
- filterCategoryFields: e.filterCategoryFields,
297
- dash: e.dash,
298
- dashJustified: e.dashJustified,
299
- source: e.source,
300
- key: e.streamKey,
301
- flush: e.flush,
302
- refresh: e.refresh,
303
- terrain: e.terrain,
304
- updateTriggers: e.updateTriggers,
305
- ...Object.keys(t).length > 0 ? { props: t } : {}
306
- };
256
+ }), pe = {
257
+ id: "id",
258
+ type: "type",
259
+ data: "data",
260
+ label: "label",
261
+ color: "color",
262
+ filterField: "filterField",
263
+ filterRange: "filterRange",
264
+ filterSoftRange: "filterSoftRange",
265
+ filterFields: "filterFields",
266
+ filterCategoryField: "filterCategoryField",
267
+ filterCategories: "filterCategories",
268
+ filterCategoryFields: "filterCategoryFields",
269
+ dash: "dash",
270
+ dashJustified: "dashJustified",
271
+ classifyBy: "classifyBy",
272
+ classifyScale: "classifyScale",
273
+ classifyClasses: "classifyClasses",
274
+ classifyRamp: "classifyRamp",
275
+ source: "source",
276
+ streamKey: "key",
277
+ flush: "flush",
278
+ refresh: "refresh",
279
+ terrain: "terrain",
280
+ updateTriggers: "updateTriggers"
281
+ }, Ue = /* @__PURE__ */ new Set([...Object.keys(pe), "onClick", "onHover"]);
282
+ function Xe(t) {
283
+ const e = {};
284
+ for (const [n, i] of Object.entries(t))
285
+ !Ue.has(n) && i !== void 0 && (e[n] = i);
286
+ const s = {};
287
+ for (const [n, i] of Object.entries(pe))
288
+ s[i] = t[n];
289
+ return Object.keys(e).length > 0 && (s.props = e), s;
307
290
  }
308
- function ot(e) {
309
- const { controller: t, layers: s } = W("OmLayer"), { id: o } = e, i = Ue(e);
310
- R(() => {
291
+ function st(t) {
292
+ const { controller: e, layers: s } = W("OmLayer"), { id: n } = t, i = Xe(t);
293
+ F(() => {
311
294
  s.upsert(i);
312
- }), R(() => () => s.remove(o), [s, o]);
313
- const m = h(e.onClick);
314
- m.current = e.onClick;
315
- const c = h(e.onHover);
316
- return c.current = e.onHover, R(
317
- () => t.watchPicks((l) => {
318
- var g, p, d;
295
+ }), F(() => () => s.remove(n), [s, n]);
296
+ const p = b(t.onClick);
297
+ p.current = t.onClick;
298
+ const c = b(t.onHover);
299
+ return c.current = t.onHover, F(
300
+ () => e.watchPicks((l) => {
301
+ var m, h, d;
319
302
  if (l === null) {
320
- (g = c.current) == null || g.call(c, null);
303
+ (m = c.current) == null || m.call(c, null);
321
304
  return;
322
305
  }
323
- l.layerId === o && (l.type === "click" ? (p = m.current) == null || p.call(m, l) : (d = c.current) == null || d.call(c, l));
306
+ l.layerId === n && (l.type === "click" ? (h = p.current) == null || h.call(p, l) : (d = c.current) == null || d.call(c, l));
324
307
  }),
325
- [t, o]
308
+ [e, n]
326
309
  ), null;
327
310
  }
328
- function st({ position: e = "top-start", order: t, fold: s, className: o, style: i, children: m }) {
329
- const { corners: c, widgetsHidden: l, widgetsFolded: g, foldPanels: p, registerFoldedWidget: d } = W("OmWidget"), x = ce(), v = Ke(e) ?? "top-start", b = g && v !== "manual" && s !== "never", y = v === "manual" ? null : He(v);
330
- if (R(() => {
311
+ function it({ position: t = "top-start", order: e, fold: s, className: n, style: i, children: p }) {
312
+ const { corners: c, widgetsHidden: l, widgetsFolded: m, foldPanels: h, registerFoldedWidget: d } = W("OmWidget"), P = ce(), v = He(t) ?? "top-start", g = m && v !== "manual" && s !== "never", y = v === "manual" ? null : Ne(v);
313
+ if (F(() => {
331
314
  if (y)
332
- return d(y, x, b), () => d(y, x, !1);
333
- }, [y, x, b, d]), v === "manual")
334
- return /* @__PURE__ */ O("div", { className: o, style: { pointerEvents: "auto", ...i }, children: m });
335
- const C = b && y ? p[y] : c[v];
336
- return C ? ue(
315
+ return d(y, P, g), () => d(y, P, !1);
316
+ }, [y, P, g, d]), v === "manual")
317
+ return /* @__PURE__ */ O("div", { className: n, style: { pointerEvents: "auto", ...i }, children: p });
318
+ const x = g && y ? h[y] : c[v];
319
+ return x ? ue(
337
320
  /* @__PURE__ */ O(
338
321
  "div",
339
322
  {
340
323
  "data-om-react-widget": "",
341
- "data-om-fold-origin-slot": b ? v : void 0,
342
- className: o,
324
+ "data-om-fold-origin-slot": g ? v : void 0,
325
+ className: n,
343
326
  style: {
344
- ...t !== void 0 ? { order: t } : void 0,
327
+ ...e !== void 0 ? { order: e } : void 0,
345
328
  ...i,
346
329
  pointerEvents: l ? "none" : (i == null ? void 0 : i.pointerEvents) ?? "auto",
347
330
  visibility: l ? "hidden" : i == null ? void 0 : i.visibility
348
331
  },
349
- children: m
332
+ children: p
350
333
  }
351
334
  ),
352
- C
335
+ x
353
336
  ) : null;
354
337
  }
355
- function le(e, t, s, o) {
356
- return t && (e == null ? void 0 : e.layerId) !== t ? !1 : !s || (e ? e.type : o) === s;
338
+ function le(t, e, s, n) {
339
+ return e && (t == null ? void 0 : t.layerId) !== e ? !1 : !s || (t ? t.type : n) === s;
357
340
  }
358
- const Xe = {
341
+ const Qe = {
359
342
  "top-left": "translate(0, 0)",
360
343
  "top-center": "translate(-50%, 0)",
361
344
  "top-right": "translate(-100%, 0)",
@@ -366,52 +349,52 @@ const Xe = {
366
349
  "bottom-center": "translate(-50%, -100%)",
367
350
  "bottom-right": "translate(-100%, -100%)"
368
351
  };
369
- function it(e) {
370
- const { controller: t, overlayPane: s } = W("OmOverlay"), o = h(null), i = h(void 0), m = h(e);
371
- m.current = e;
372
- const c = L(() => {
373
- const b = t.getStore("selection");
374
- let y, C, w = null;
352
+ function at(t) {
353
+ const { controller: e, overlayPane: s } = W("OmOverlay"), n = b(null), i = b(void 0), p = b(t);
354
+ p.current = t;
355
+ const c = M(() => {
356
+ const g = e.getStore("selection");
357
+ let y, x, w = null;
375
358
  return {
376
- subscribe: b.subscribe,
359
+ subscribe: g.subscribe,
377
360
  getSnapshot: () => {
378
- const E = b.getSnapshot(), { anchorFrom: P, layer: a, selectionType: M } = m.current, k = `${P ?? ""}|${a ?? ""}|${M ?? ""}`;
379
- return (E !== y || k !== C) && (y = E, C = k, P === "selection" && le(E, a, M, t.getLastPickType()) && (w = E)), w;
361
+ const E = g.getSnapshot(), { anchorFrom: T, layer: a, selectionType: j } = p.current, k = `${T ?? ""}|${a ?? ""}|${j ?? ""}`;
362
+ return (E !== y || k !== x) && (y = E, x = k, T === "selection" && le(E, a, j, e.getLastPickType()) && (w = E)), w;
380
363
  }
381
364
  };
382
- }, [t]), l = de(
365
+ }, [e]), l = de(
383
366
  c.subscribe,
384
367
  c.getSnapshot,
385
368
  c.getSnapshot
386
369
  );
387
- R(
388
- () => t.registerOverlay((b, y, C) => {
389
- const w = o.current;
370
+ F(
371
+ () => e.registerOverlay((g, y, x) => {
372
+ const w = n.current;
390
373
  if (!w) return;
391
- const { anchor: E, anchorFrom: P, layer: a, selectionType: M, visible: k = !0, anchorOffset: q } = m.current;
392
- let T;
393
- if (P === "selection" ? (le(y, a, M, C) && (i.current = (y == null ? void 0 : y.coordinate) ?? void 0), T = i.current) : T = E, !k || !T || !b) {
374
+ const { anchor: E, anchorFrom: T, layer: a, selectionType: j, visible: k = !0, anchorOffset: B } = p.current;
375
+ let C;
376
+ if (T === "selection" ? (le(y, a, j, x) && (i.current = (y == null ? void 0 : y.coordinate) ?? void 0), C = i.current) : C = E, !k || !C || !g) {
394
377
  w.style.visibility = "hidden";
395
378
  return;
396
379
  }
397
- const [D, F, I] = b.project([T[0], T[1], T[2] ?? 0]);
398
- if (!(D >= 0 && D <= b.width && F >= 0 && F <= b.height) || I !== void 0 && I < 0) {
380
+ const [D, R, I] = g.project([C[0], C[1], C[2] ?? 0]);
381
+ if (!(D >= 0 && D <= g.width && R >= 0 && R <= g.height) || I !== void 0 && I < 0) {
399
382
  w.style.visibility = "hidden";
400
383
  return;
401
384
  }
402
- w.style.visibility = "visible", w.style.transform = `translate(${D}px, ${F}px) ${Xe[q ?? "bottom-center"]}`;
385
+ w.style.visibility = "visible", w.style.transform = `translate(${D}px, ${R}px) ${Qe[B ?? "bottom-center"]}`;
403
386
  }),
404
- [t]
405
- ), R(() => {
406
- t.refreshOverlays();
387
+ [e]
388
+ ), F(() => {
389
+ e.refreshOverlays();
407
390
  });
408
- const { children: g, className: p, style: d, interactive: x = !0 } = e, v = typeof g == "function" ? g(l) : g;
391
+ const { children: m, className: h, style: d, interactive: P = !0 } = t, v = typeof m == "function" ? m(l) : m;
409
392
  return ue(
410
393
  /* @__PURE__ */ O(
411
394
  "div",
412
395
  {
413
- ref: o,
414
- className: p,
396
+ ref: n,
397
+ className: h,
415
398
  style: {
416
399
  position: "absolute",
417
400
  top: 0,
@@ -419,7 +402,7 @@ function it(e) {
419
402
  visibility: "hidden",
420
403
  // hidden until the first flush positions it — never flashes at the origin
421
404
  willChange: "transform",
422
- pointerEvents: x ? "auto" : "none",
405
+ pointerEvents: P ? "auto" : "none",
423
406
  ...d
424
407
  },
425
408
  children: v
@@ -428,29 +411,29 @@ function it(e) {
428
411
  s
429
412
  );
430
413
  }
431
- function at(e = []) {
432
- const { controller: t } = W("useOmMap"), s = e.join(" "), o = L(() => {
433
- const c = (s ? s.split(" ") : []).flatMap((g) => Ne(g) ? [t.getStore(g)] : (console.warn(`[onlymapjs] useOmMap: "${g}" is not a watch token on the React front-end — expected viewport, selection, layers, or data:<layerId>.`), []));
414
+ function lt(t = []) {
415
+ const { controller: e } = W("useOmMap"), s = t.join(" "), n = M(() => {
416
+ const c = (s ? s.split(" ") : []).flatMap((m) => We(m) ? [e.getStore(m)] : (console.warn(`[onlymapjs] useOmMap: "${m}" is not a watch token on the React front-end — expected viewport, selection, layers, or data:<layerId>.`), []));
434
417
  let l;
435
418
  return {
436
- subscribe: (g) => {
437
- const p = c.map((d) => d.subscribe(g));
419
+ subscribe: (m) => {
420
+ const h = c.map((d) => d.subscribe(m));
438
421
  return () => {
439
- for (const d of p) d();
422
+ for (const d of h) d();
440
423
  };
441
424
  },
442
425
  getSnapshot: () => {
443
- const g = c.map((p) => p.getSnapshot());
444
- return (!l || g.some((p, d) => p !== l[d])) && (l = g), l;
426
+ const m = c.map((h) => h.getSnapshot());
427
+ return (!l || m.some((h, d) => h !== l[d])) && (l = m), l;
445
428
  }
446
429
  };
447
- }, [t, s]), i = de(o.subscribe, o.getSnapshot, o.getSnapshot);
448
- return L(() => t.buildCtx(), [t, i]);
430
+ }, [e, s]), i = de(n.subscribe, n.getSnapshot, n.getSnapshot);
431
+ return M(() => e.buildCtx(), [e, i]);
449
432
  }
450
433
  export {
451
- ot as OmLayer,
452
- nt as OmMap,
453
- it as OmOverlay,
454
- st as OmWidget,
455
- at as useOmMap
434
+ st as OmLayer,
435
+ ot as OmMap,
436
+ at as OmOverlay,
437
+ it as OmWidget,
438
+ lt as useOmMap
456
439
  };