@deck.gl/widgets 9.0.0-beta.2 → 9.0.0-beta.3

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.
@@ -0,0 +1,2 @@
1
+ export declare const IconButton: (props: any) => import("preact").JSX.Element;
2
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,8CActB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "preact/jsx-runtime";
2
+ export const IconButton = props => {
3
+ const { className, label, onClick } = props;
4
+ return (_jsx("div", { className: "deck-widget-button-border", children: _jsx("button", { className: `deck-widget-button ${className}`, type: "button", onClick: onClick, title: label, children: _jsx("div", { className: "deck-widget-icon" }) }) }));
5
+ };
package/dist/dist.dev.js CHANGED
@@ -53,8 +53,8 @@ var __exports__ = (() => {
53
53
 
54
54
  // ../core/bundle/peer-dependency.ts
55
55
  var peer_dependency_exports = {};
56
- var import_core = __toESM(require_core());
57
- __reExport(peer_dependency_exports, __toESM(require_core()));
56
+ var import_core = __toESM(require_core(), 1);
57
+ __reExport(peer_dependency_exports, __toESM(require_core(), 1));
58
58
  if (!import_core.Layer) {
59
59
  throw new Error("@deck.gl/core is not found");
60
60
  }
@@ -63,7 +63,7 @@ var __exports__ = (() => {
63
63
  __reExport(bundle_exports, peer_dependency_exports);
64
64
 
65
65
  // src/fullscreen-widget.tsx
66
- var import_core2 = __toESM(require_core());
66
+ var import_core2 = __toESM(require_core(), 1);
67
67
 
68
68
  // ../../node_modules/preact/dist/preact.module.js
69
69
  var n;
@@ -89,16 +89,16 @@ var __exports__ = (() => {
89
89
  l2 && l2.removeChild(n2);
90
90
  }
91
91
  function y(l2, u2, t2) {
92
- var i2, o2, r2, f2 = {};
92
+ var i2, o3, r2, f2 = {};
93
93
  for (r2 in u2)
94
- "key" == r2 ? i2 = u2[r2] : "ref" == r2 ? o2 = u2[r2] : f2[r2] = u2[r2];
94
+ "key" == r2 ? i2 = u2[r2] : "ref" == r2 ? o3 = u2[r2] : f2[r2] = u2[r2];
95
95
  if (arguments.length > 2 && (f2.children = arguments.length > 3 ? n.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps)
96
96
  for (r2 in l2.defaultProps)
97
97
  void 0 === f2[r2] && (f2[r2] = l2.defaultProps[r2]);
98
- return d(l2, f2, i2, o2, null);
98
+ return d(l2, f2, i2, o3, null);
99
99
  }
100
- function d(n2, t2, i2, o2, r2) {
101
- var f2 = { type: n2, props: t2, key: i2, ref: o2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: null == r2 ? ++u : r2 };
100
+ function d(n2, t2, i2, o3, r2) {
101
+ var f2 = { type: n2, props: t2, key: i2, ref: o3, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: null == r2 ? ++u : r2 };
102
102
  return null == r2 && null != l.vnode && l.vnode(f2), f2;
103
103
  }
104
104
  function k(n2) {
@@ -130,39 +130,39 @@ var __exports__ = (() => {
130
130
  (!n2.__d && (n2.__d = true) && i.push(n2) && !x.__r++ || o !== l.debounceRendering) && ((o = l.debounceRendering) || r)(x);
131
131
  }
132
132
  function x() {
133
- var n2, l2, u2, t2, o2, r2, e2, c2, s2;
133
+ var n2, l2, u2, t2, o3, r2, e2, c2, s2;
134
134
  for (i.sort(f); n2 = i.shift(); )
135
- n2.__d && (l2 = i.length, t2 = void 0, o2 = void 0, r2 = void 0, c2 = (e2 = (u2 = n2).__v).__e, (s2 = u2.__P) && (t2 = [], o2 = [], (r2 = v({}, e2)).__v = e2.__v + 1, L(s2, e2, r2, u2.__n, void 0 !== s2.ownerSVGElement, null != e2.__h ? [c2] : null, t2, null == c2 ? g(e2) : c2, e2.__h, o2), M(t2, e2, o2), e2.__e != c2 && m(e2)), i.length > l2 && i.sort(f));
135
+ n2.__d && (l2 = i.length, t2 = void 0, o3 = void 0, r2 = void 0, c2 = (e2 = (u2 = n2).__v).__e, (s2 = u2.__P) && (t2 = [], o3 = [], (r2 = v({}, e2)).__v = e2.__v + 1, L(s2, e2, r2, u2.__n, void 0 !== s2.ownerSVGElement, null != e2.__h ? [c2] : null, t2, null == c2 ? g(e2) : c2, e2.__h, o3), M(t2, e2, o3), e2.__e != c2 && m(e2)), i.length > l2 && i.sort(f));
136
136
  x.__r = 0;
137
137
  }
138
- function P(n2, l2, u2, t2, i2, o2, r2, f2, e2, a2, v2) {
139
- var p2, y2, _, b2, m2, w2, x2, P2, S, H2 = 0, I2 = t2 && t2.__k || s, T2 = I2.length, j2 = T2, z2 = l2.length;
138
+ function P(n2, l2, u2, t2, i2, o3, r2, f2, e2, a2, v2) {
139
+ var p2, y2, _2, b2, m2, w2, x2, P2, S, H2 = 0, I2 = t2 && t2.__k || s, T2 = I2.length, j2 = T2, z2 = l2.length;
140
140
  for (u2.__k = [], p2 = 0; p2 < z2; p2++)
141
- null != (b2 = u2.__k[p2] = null == (b2 = l2[p2]) || "boolean" == typeof b2 || "function" == typeof b2 ? null : "string" == typeof b2 || "number" == typeof b2 || "bigint" == typeof b2 ? d(null, b2, null, null, b2) : h(b2) ? d(k, { children: b2 }, null, null, null) : b2.__b > 0 ? d(b2.type, b2.props, b2.key, b2.ref ? b2.ref : null, b2.__v) : b2) ? (b2.__ = u2, b2.__b = u2.__b + 1, -1 === (P2 = A(b2, I2, x2 = p2 + H2, j2)) ? _ = c : (_ = I2[P2] || c, I2[P2] = void 0, j2--), L(n2, b2, _, i2, o2, r2, f2, e2, a2, v2), m2 = b2.__e, (y2 = b2.ref) && _.ref != y2 && (_.ref && O(_.ref, null, b2), v2.push(y2, b2.__c || m2, b2)), null != m2 && (null == w2 && (w2 = m2), (S = _ === c || null === _.__v) ? -1 == P2 && H2-- : P2 !== x2 && (P2 === x2 + 1 ? H2++ : P2 > x2 ? j2 > z2 - x2 ? H2 += P2 - x2 : H2-- : H2 = P2 < x2 && P2 == x2 - 1 ? P2 - x2 : 0), x2 = p2 + H2, "function" != typeof b2.type || P2 === x2 && _.__k !== b2.__k ? "function" == typeof b2.type || P2 === x2 && !S ? void 0 !== b2.__d ? (e2 = b2.__d, b2.__d = void 0) : e2 = m2.nextSibling : e2 = $(n2, m2, e2) : e2 = C(b2, e2, n2), "function" == typeof u2.type && (u2.__d = e2))) : (_ = I2[p2]) && null == _.key && _.__e && (_.__e == e2 && (e2 = g(_)), q(_, _, false));
141
+ null != (b2 = u2.__k[p2] = null == (b2 = l2[p2]) || "boolean" == typeof b2 || "function" == typeof b2 ? null : "string" == typeof b2 || "number" == typeof b2 || "bigint" == typeof b2 ? d(null, b2, null, null, b2) : h(b2) ? d(k, { children: b2 }, null, null, null) : b2.__b > 0 ? d(b2.type, b2.props, b2.key, b2.ref ? b2.ref : null, b2.__v) : b2) ? (b2.__ = u2, b2.__b = u2.__b + 1, -1 === (P2 = A(b2, I2, x2 = p2 + H2, j2)) ? _2 = c : (_2 = I2[P2] || c, I2[P2] = void 0, j2--), L(n2, b2, _2, i2, o3, r2, f2, e2, a2, v2), m2 = b2.__e, (y2 = b2.ref) && _2.ref != y2 && (_2.ref && O(_2.ref, null, b2), v2.push(y2, b2.__c || m2, b2)), null != m2 && (null == w2 && (w2 = m2), (S = _2 === c || null === _2.__v) ? -1 == P2 && H2-- : P2 !== x2 && (P2 === x2 + 1 ? H2++ : P2 > x2 ? j2 > z2 - x2 ? H2 += P2 - x2 : H2-- : H2 = P2 < x2 && P2 == x2 - 1 ? P2 - x2 : 0), x2 = p2 + H2, "function" != typeof b2.type || P2 === x2 && _2.__k !== b2.__k ? "function" == typeof b2.type || P2 === x2 && !S ? void 0 !== b2.__d ? (e2 = b2.__d, b2.__d = void 0) : e2 = m2.nextSibling : e2 = $(n2, m2, e2) : e2 = C(b2, e2, n2), "function" == typeof u2.type && (u2.__d = e2))) : (_2 = I2[p2]) && null == _2.key && _2.__e && (_2.__e == e2 && (e2 = g(_2)), q(_2, _2, false));
142
142
  for (u2.__e = w2, p2 = T2; p2--; )
143
143
  null != I2[p2] && ("function" == typeof u2.type && null != I2[p2].__e && I2[p2].__e == u2.__d && (u2.__d = I2[p2].__e.nextSibling), q(I2[p2], I2[p2]));
144
144
  }
145
145
  function C(n2, l2, u2) {
146
- for (var t2, i2 = n2.__k, o2 = 0; i2 && o2 < i2.length; o2++)
147
- (t2 = i2[o2]) && (t2.__ = n2, l2 = "function" == typeof t2.type ? C(t2, l2, u2) : $(u2, t2.__e, l2));
146
+ for (var t2, i2 = n2.__k, o3 = 0; i2 && o3 < i2.length; o3++)
147
+ (t2 = i2[o3]) && (t2.__ = n2, l2 = "function" == typeof t2.type ? C(t2, l2, u2) : $(u2, t2.__e, l2));
148
148
  return l2;
149
149
  }
150
150
  function $(n2, l2, u2) {
151
151
  return null == u2 || u2.parentNode !== n2 ? n2.insertBefore(l2, null) : l2 == u2 && null != l2.parentNode || n2.insertBefore(l2, u2), l2.nextSibling;
152
152
  }
153
153
  function A(n2, l2, u2, t2) {
154
- var i2 = n2.key, o2 = n2.type, r2 = u2 - 1, f2 = u2 + 1, e2 = l2[u2];
155
- if (null === e2 || e2 && i2 == e2.key && o2 === e2.type)
154
+ var i2 = n2.key, o3 = n2.type, r2 = u2 - 1, f2 = u2 + 1, e2 = l2[u2];
155
+ if (null === e2 || e2 && i2 == e2.key && o3 === e2.type)
156
156
  return u2;
157
157
  if (t2 > (null != e2 ? 1 : 0))
158
158
  for (; r2 >= 0 || f2 < l2.length; ) {
159
159
  if (r2 >= 0) {
160
- if ((e2 = l2[r2]) && i2 == e2.key && o2 === e2.type)
160
+ if ((e2 = l2[r2]) && i2 == e2.key && o3 === e2.type)
161
161
  return r2;
162
162
  r2--;
163
163
  }
164
164
  if (f2 < l2.length) {
165
- if ((e2 = l2[f2]) && i2 == e2.key && o2 === e2.type)
165
+ if ((e2 = l2[f2]) && i2 == e2.key && o3 === e2.type)
166
166
  return f2;
167
167
  f2++;
168
168
  }
@@ -170,17 +170,17 @@ var __exports__ = (() => {
170
170
  return -1;
171
171
  }
172
172
  function H(n2, l2, u2, t2, i2) {
173
- var o2;
174
- for (o2 in u2)
175
- "children" === o2 || "key" === o2 || o2 in l2 || T(n2, o2, null, u2[o2], t2);
176
- for (o2 in l2)
177
- i2 && "function" != typeof l2[o2] || "children" === o2 || "key" === o2 || "value" === o2 || "checked" === o2 || u2[o2] === l2[o2] || T(n2, o2, l2[o2], u2[o2], t2);
173
+ var o3;
174
+ for (o3 in u2)
175
+ "children" === o3 || "key" === o3 || o3 in l2 || T(n2, o3, null, u2[o3], t2);
176
+ for (o3 in l2)
177
+ i2 && "function" != typeof l2[o3] || "children" === o3 || "key" === o3 || "value" === o3 || "checked" === o3 || u2[o3] === l2[o3] || T(n2, o3, l2[o3], u2[o3], t2);
178
178
  }
179
179
  function I(n2, l2, u2) {
180
180
  "-" === l2[0] ? n2.setProperty(l2, null == u2 ? "" : u2) : n2[l2] = null == u2 ? "" : "number" != typeof u2 || a.test(l2) ? u2 : u2 + "px";
181
181
  }
182
182
  function T(n2, l2, u2, t2, i2) {
183
- var o2;
183
+ var o3;
184
184
  n:
185
185
  if ("style" === l2)
186
186
  if ("string" == typeof u2)
@@ -194,7 +194,7 @@ var __exports__ = (() => {
194
194
  t2 && u2[l2] === t2[l2] || I(n2.style, l2, u2[l2]);
195
195
  }
196
196
  else if ("o" === l2[0] && "n" === l2[1])
197
- o2 = l2 !== (l2 = l2.replace(/Capture$/, "")), l2 = l2.toLowerCase() in n2 ? l2.toLowerCase().slice(2) : l2.slice(2), n2.l || (n2.l = {}), n2.l[l2 + o2] = u2, u2 ? t2 || n2.addEventListener(l2, o2 ? z : j, o2) : n2.removeEventListener(l2, o2 ? z : j, o2);
197
+ o3 = l2 !== (l2 = l2.replace(/Capture$/, "")), l2 = l2.toLowerCase() in n2 ? l2.toLowerCase().slice(2) : l2.slice(2), n2.l || (n2.l = {}), n2.l[l2 + o3] = u2, u2 ? t2 || n2.addEventListener(l2, o3 ? z : j, o3) : n2.removeEventListener(l2, o3 ? z : j, o3);
198
198
  else if ("dangerouslySetInnerHTML" !== l2) {
199
199
  if (i2)
200
200
  l2 = l2.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
@@ -213,15 +213,15 @@ var __exports__ = (() => {
213
213
  function z(n2) {
214
214
  return this.l[n2.type + true](l.event ? l.event(n2) : n2);
215
215
  }
216
- function L(n2, u2, t2, i2, o2, r2, f2, e2, c2, s2) {
217
- var a2, p2, y2, d2, _, g2, m2, w2, x2, C2, S, $2, A2, H2, I2, T2 = u2.type;
216
+ function L(n2, u2, t2, i2, o3, r2, f2, e2, c2, s2) {
217
+ var a2, p2, y2, d2, _2, g2, m2, w2, x2, C2, S, $2, A2, H2, I2, T2 = u2.type;
218
218
  if (void 0 !== u2.constructor)
219
219
  return null;
220
220
  null != t2.__h && (c2 = t2.__h, e2 = u2.__e = t2.__e, u2.__h = null, r2 = [e2]), (a2 = l.__b) && a2(u2);
221
221
  n:
222
222
  if ("function" == typeof T2)
223
223
  try {
224
- if (w2 = u2.props, x2 = (a2 = T2.contextType) && i2[a2.__c], C2 = a2 ? x2 ? x2.props.value : a2.__ : i2, t2.__c ? m2 = (p2 = u2.__c = t2.__c).__ = p2.__E : ("prototype" in T2 && T2.prototype.render ? u2.__c = p2 = new T2(w2, C2) : (u2.__c = p2 = new b(w2, C2), p2.constructor = T2, p2.render = B), x2 && x2.sub(p2), p2.props = w2, p2.state || (p2.state = {}), p2.context = C2, p2.__n = i2, y2 = p2.__d = true, p2.__h = [], p2._sb = []), null == p2.__s && (p2.__s = p2.state), null != T2.getDerivedStateFromProps && (p2.__s == p2.state && (p2.__s = v({}, p2.__s)), v(p2.__s, T2.getDerivedStateFromProps(w2, p2.__s))), d2 = p2.props, _ = p2.state, p2.__v = u2, y2)
224
+ if (w2 = u2.props, x2 = (a2 = T2.contextType) && i2[a2.__c], C2 = a2 ? x2 ? x2.props.value : a2.__ : i2, t2.__c ? m2 = (p2 = u2.__c = t2.__c).__ = p2.__E : ("prototype" in T2 && T2.prototype.render ? u2.__c = p2 = new T2(w2, C2) : (u2.__c = p2 = new b(w2, C2), p2.constructor = T2, p2.render = B), x2 && x2.sub(p2), p2.props = w2, p2.state || (p2.state = {}), p2.context = C2, p2.__n = i2, y2 = p2.__d = true, p2.__h = [], p2._sb = []), null == p2.__s && (p2.__s = p2.state), null != T2.getDerivedStateFromProps && (p2.__s == p2.state && (p2.__s = v({}, p2.__s)), v(p2.__s, T2.getDerivedStateFromProps(w2, p2.__s))), d2 = p2.props, _2 = p2.state, p2.__v = u2, y2)
225
225
  null == T2.getDerivedStateFromProps && null != p2.componentWillMount && p2.componentWillMount(), null != p2.componentDidMount && p2.__h.push(p2.componentDidMount);
226
226
  else {
227
227
  if (null == T2.getDerivedStateFromProps && w2 !== d2 && null != p2.componentWillReceiveProps && p2.componentWillReceiveProps(w2, C2), !p2.__e && (null != p2.shouldComponentUpdate && false === p2.shouldComponentUpdate(w2, p2.__s, C2) || u2.__v === t2.__v)) {
@@ -233,7 +233,7 @@ var __exports__ = (() => {
233
233
  break n;
234
234
  }
235
235
  null != p2.componentWillUpdate && p2.componentWillUpdate(w2, p2.__s, C2), null != p2.componentDidUpdate && p2.__h.push(function() {
236
- p2.componentDidUpdate(d2, _, g2);
236
+ p2.componentDidUpdate(d2, _2, g2);
237
237
  });
238
238
  }
239
239
  if (p2.context = C2, p2.props = w2, p2.__P = n2, p2.__e = false, $2 = l.__r, A2 = 0, "prototype" in T2 && T2.prototype.render) {
@@ -244,12 +244,12 @@ var __exports__ = (() => {
244
244
  do {
245
245
  p2.__d = false, $2 && $2(u2), a2 = p2.render(p2.props, p2.state, p2.context), p2.state = p2.__s;
246
246
  } while (p2.__d && ++A2 < 25);
247
- p2.state = p2.__s, null != p2.getChildContext && (i2 = v(v({}, i2), p2.getChildContext())), y2 || null == p2.getSnapshotBeforeUpdate || (g2 = p2.getSnapshotBeforeUpdate(d2, _)), P(n2, h(I2 = null != a2 && a2.type === k && null == a2.key ? a2.props.children : a2) ? I2 : [I2], u2, t2, i2, o2, r2, f2, e2, c2, s2), p2.base = u2.__e, u2.__h = null, p2.__h.length && f2.push(p2), m2 && (p2.__E = p2.__ = null);
247
+ p2.state = p2.__s, null != p2.getChildContext && (i2 = v(v({}, i2), p2.getChildContext())), y2 || null == p2.getSnapshotBeforeUpdate || (g2 = p2.getSnapshotBeforeUpdate(d2, _2)), P(n2, h(I2 = null != a2 && a2.type === k && null == a2.key ? a2.props.children : a2) ? I2 : [I2], u2, t2, i2, o3, r2, f2, e2, c2, s2), p2.base = u2.__e, u2.__h = null, p2.__h.length && f2.push(p2), m2 && (p2.__E = p2.__ = null);
248
248
  } catch (n3) {
249
249
  u2.__v = null, (c2 || null != r2) && (u2.__e = e2, u2.__h = !!c2, r2[r2.indexOf(e2)] = null), l.__e(n3, u2, t2);
250
250
  }
251
251
  else
252
- null == r2 && u2.__v === t2.__v ? (u2.__k = t2.__k, u2.__e = t2.__e) : u2.__e = N(t2.__e, u2, t2, i2, o2, r2, f2, c2, s2);
252
+ null == r2 && u2.__v === t2.__v ? (u2.__k = t2.__k, u2.__e = t2.__e) : u2.__e = N(t2.__e, u2, t2, i2, o3, r2, f2, c2, s2);
253
253
  (a2 = l.diffed) && a2(u2);
254
254
  }
255
255
  function M(n2, u2, t2) {
@@ -265,9 +265,9 @@ var __exports__ = (() => {
265
265
  }
266
266
  });
267
267
  }
268
- function N(l2, u2, t2, i2, o2, r2, f2, e2, s2) {
269
- var a2, v2, y2, d2 = t2.props, _ = u2.props, k2 = u2.type, b2 = 0;
270
- if ("svg" === k2 && (o2 = true), null != r2) {
268
+ function N(l2, u2, t2, i2, o3, r2, f2, e2, s2) {
269
+ var a2, v2, y2, d2 = t2.props, _2 = u2.props, k2 = u2.type, b2 = 0;
270
+ if ("svg" === k2 && (o3 = true), null != r2) {
271
271
  for (; b2 < r2.length; b2++)
272
272
  if ((a2 = r2[b2]) && "setAttribute" in a2 == !!k2 && (k2 ? a2.localName === k2 : 3 === a2.nodeType)) {
273
273
  l2 = a2, r2[b2] = null;
@@ -276,24 +276,24 @@ var __exports__ = (() => {
276
276
  }
277
277
  if (null == l2) {
278
278
  if (null === k2)
279
- return document.createTextNode(_);
280
- l2 = o2 ? document.createElementNS("http://www.w3.org/2000/svg", k2) : document.createElement(k2, _.is && _), r2 = null, e2 = false;
279
+ return document.createTextNode(_2);
280
+ l2 = o3 ? document.createElementNS("http://www.w3.org/2000/svg", k2) : document.createElement(k2, _2.is && _2), r2 = null, e2 = false;
281
281
  }
282
282
  if (null === k2)
283
- d2 === _ || e2 && l2.data === _ || (l2.data = _);
283
+ d2 === _2 || e2 && l2.data === _2 || (l2.data = _2);
284
284
  else {
285
- if (r2 = r2 && n.call(l2.childNodes), v2 = (d2 = t2.props || c).dangerouslySetInnerHTML, y2 = _.dangerouslySetInnerHTML, !e2) {
285
+ if (r2 = r2 && n.call(l2.childNodes), v2 = (d2 = t2.props || c).dangerouslySetInnerHTML, y2 = _2.dangerouslySetInnerHTML, !e2) {
286
286
  if (null != r2)
287
287
  for (d2 = {}, b2 = 0; b2 < l2.attributes.length; b2++)
288
288
  d2[l2.attributes[b2].name] = l2.attributes[b2].value;
289
289
  (y2 || v2) && (y2 && (v2 && y2.__html == v2.__html || y2.__html === l2.innerHTML) || (l2.innerHTML = y2 && y2.__html || ""));
290
290
  }
291
- if (H(l2, _, d2, o2, e2), y2)
291
+ if (H(l2, _2, d2, o3, e2), y2)
292
292
  u2.__k = [];
293
- else if (P(l2, h(b2 = u2.props.children) ? b2 : [b2], u2, t2, i2, o2 && "foreignObject" !== k2, r2, f2, r2 ? r2[0] : t2.__k && g(t2, 0), e2, s2), null != r2)
293
+ else if (P(l2, h(b2 = u2.props.children) ? b2 : [b2], u2, t2, i2, o3 && "foreignObject" !== k2, r2, f2, r2 ? r2[0] : t2.__k && g(t2, 0), e2, s2), null != r2)
294
294
  for (b2 = r2.length; b2--; )
295
295
  null != r2[b2] && p(r2[b2]);
296
- e2 || ("value" in _ && void 0 !== (b2 = _.value) && (b2 !== l2.value || "progress" === k2 && !b2 || "option" === k2 && b2 !== d2.value) && T(l2, "value", b2, d2.value, false), "checked" in _ && void 0 !== (b2 = _.checked) && b2 !== l2.checked && T(l2, "checked", b2, d2.checked, false));
296
+ e2 || ("value" in _2 && void 0 !== (b2 = _2.value) && (b2 !== l2.value || "progress" === k2 && !b2 || "option" === k2 && b2 !== d2.value) && T(l2, "value", b2, d2.value, false), "checked" in _2 && void 0 !== (b2 = _2.checked) && b2 !== l2.checked && T(l2, "checked", b2, d2.checked, false));
297
297
  }
298
298
  return l2;
299
299
  }
@@ -305,7 +305,7 @@ var __exports__ = (() => {
305
305
  }
306
306
  }
307
307
  function q(n2, u2, t2) {
308
- var i2, o2;
308
+ var i2, o3;
309
309
  if (l.unmount && l.unmount(n2), (i2 = n2.ref) && (i2.current && i2.current !== n2.__e || O(i2, null, u2)), null != (i2 = n2.__c)) {
310
310
  if (i2.componentWillUnmount)
311
311
  try {
@@ -316,22 +316,22 @@ var __exports__ = (() => {
316
316
  i2.base = i2.__P = null, n2.__c = void 0;
317
317
  }
318
318
  if (i2 = n2.__k)
319
- for (o2 = 0; o2 < i2.length; o2++)
320
- i2[o2] && q(i2[o2], u2, t2 || "function" != typeof n2.type);
319
+ for (o3 = 0; o3 < i2.length; o3++)
320
+ i2[o3] && q(i2[o3], u2, t2 || "function" != typeof n2.type);
321
321
  t2 || null == n2.__e || p(n2.__e), n2.__ = n2.__e = n2.__d = void 0;
322
322
  }
323
323
  function B(n2, l2, u2) {
324
324
  return this.constructor(n2, u2);
325
325
  }
326
326
  function D(u2, t2, i2) {
327
- var o2, r2, f2, e2;
328
- l.__ && l.__(u2, t2), r2 = (o2 = "function" == typeof i2) ? null : i2 && i2.__k || t2.__k, f2 = [], e2 = [], L(t2, u2 = (!o2 && i2 || t2).__k = y(k, null, [u2]), r2 || c, c, void 0 !== t2.ownerSVGElement, !o2 && i2 ? [i2] : r2 ? null : t2.firstChild ? n.call(t2.childNodes) : null, f2, !o2 && i2 ? i2 : r2 ? r2.__e : t2.firstChild, o2, e2), M(f2, u2, e2);
327
+ var o3, r2, f2, e2;
328
+ l.__ && l.__(u2, t2), r2 = (o3 = "function" == typeof i2) ? null : i2 && i2.__k || t2.__k, f2 = [], e2 = [], L(t2, u2 = (!o3 && i2 || t2).__k = y(k, null, [u2]), r2 || c, c, void 0 !== t2.ownerSVGElement, !o3 && i2 ? [i2] : r2 ? null : t2.firstChild ? n.call(t2.childNodes) : null, f2, !o3 && i2 ? i2 : r2 ? r2.__e : t2.firstChild, o3, e2), M(f2, u2, e2);
329
329
  }
330
330
  n = s.slice, l = { __e: function(n2, l2, u2, t2) {
331
- for (var i2, o2, r2; l2 = l2.__; )
331
+ for (var i2, o3, r2; l2 = l2.__; )
332
332
  if ((i2 = l2.__c) && !i2.__)
333
333
  try {
334
- if ((o2 = i2.constructor) && null != o2.getDerivedStateFromError && (i2.setState(o2.getDerivedStateFromError(n2)), r2 = i2.__d), null != i2.componentDidCatch && (i2.componentDidCatch(n2, t2 || {}), r2 = i2.__d), r2)
334
+ if ((o3 = i2.constructor) && null != o3.getDerivedStateFromError && (i2.setState(o3.getDerivedStateFromError(n2)), r2 = i2.__d), null != i2.componentDidCatch && (i2.componentDidCatch(n2, t2 || {}), r2 = i2.__d), r2)
335
335
  return i2.__E = i2;
336
336
  } catch (l3) {
337
337
  n2 = l3;
@@ -348,31 +348,40 @@ var __exports__ = (() => {
348
348
  return n2.__v.__b - l2.__v.__b;
349
349
  }, x.__r = 0, e = 0;
350
350
 
351
+ // ../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
352
+ var _ = 0;
353
+ function o2(o3, e2, n2, t2, f2, l2) {
354
+ var s2, u2, a2 = {};
355
+ for (u2 in e2)
356
+ "ref" == u2 ? s2 = e2[u2] : a2[u2] = e2[u2];
357
+ var i2 = { type: o3, props: a2, key: n2, ref: s2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --_, __source: f2, __self: l2 };
358
+ if ("function" == typeof o3 && (s2 = o3.defaultProps))
359
+ for (u2 in s2)
360
+ void 0 === a2[u2] && (a2[u2] = s2[u2]);
361
+ return l.vnode && l.vnode(i2), i2;
362
+ }
363
+
351
364
  // src/components.tsx
352
365
  var IconButton = (props) => {
353
- const {
354
- className,
355
- label,
356
- onClick
357
- } = props;
358
- return React.createElement("div", {
359
- className: "deck-widget-button-border"
360
- }, React.createElement("button", {
361
- className: `deck-widget-button ${className}`,
362
- type: "button",
363
- onClick,
364
- title: label
365
- }, React.createElement("div", {
366
- className: "deck-widget-icon"
367
- })));
366
+ const { className, label, onClick } = props;
367
+ return /* @__PURE__ */ o2("div", { className: "deck-widget-button-border", children: /* @__PURE__ */ o2(
368
+ "button",
369
+ {
370
+ className: `deck-widget-button ${className}`,
371
+ type: "button",
372
+ onClick,
373
+ title: label,
374
+ children: /* @__PURE__ */ o2("div", { className: "deck-widget-icon" })
375
+ }
376
+ ) });
368
377
  };
369
378
 
370
379
  // src/fullscreen-widget.tsx
371
380
  var FullscreenWidget = class {
372
- id = "fullscreen";
373
- placement = "top-left";
374
- fullscreen = false;
375
381
  constructor(props) {
382
+ this.id = "fullscreen";
383
+ this.placement = "top-left";
384
+ this.fullscreen = false;
376
385
  this.id = props.id || "fullscreen";
377
386
  this.placement = props.placement || "top-left";
378
387
  props.enterLabel = props.enterLabel || "Enter Fullscreen";
@@ -380,13 +389,8 @@ var __exports__ = (() => {
380
389
  props.style = props.style || {};
381
390
  this.props = props;
382
391
  }
383
- onAdd({
384
- deck
385
- }) {
386
- const {
387
- style,
388
- className
389
- } = this.props;
392
+ onAdd({ deck }) {
393
+ const { style, className } = this.props;
390
394
  const el = document.createElement("div");
391
395
  el.classList.add("deck-widget", "deck-widget-fullscreen");
392
396
  if (className)
@@ -406,19 +410,19 @@ var __exports__ = (() => {
406
410
  document.removeEventListener("fullscreenchange", this.onFullscreenChange.bind(this));
407
411
  }
408
412
  update() {
409
- const {
410
- enterLabel,
411
- exitLabel
412
- } = this.props;
413
+ const { enterLabel, exitLabel } = this.props;
413
414
  const el = this.element;
414
415
  if (!el) {
415
416
  return;
416
417
  }
417
- const ui = React.createElement(IconButton, {
418
- onClick: this.handleClick.bind(this),
419
- label: this.fullscreen ? exitLabel : enterLabel,
420
- className: this.fullscreen ? "deck-widget-fullscreen-exit" : "deck-widget-fullscreen-enter"
421
- });
418
+ const ui = /* @__PURE__ */ o2(
419
+ IconButton,
420
+ {
421
+ onClick: this.handleClick.bind(this),
422
+ label: this.fullscreen ? exitLabel : enterLabel,
423
+ className: this.fullscreen ? "deck-widget-fullscreen-exit" : "deck-widget-fullscreen-enter"
424
+ }
425
+ );
422
426
  D(ui, el);
423
427
  }
424
428
  setProps(props) {
@@ -436,7 +440,9 @@ var __exports__ = (() => {
436
440
  Object.entries(oldProps.style).map(([key]) => el.style.removeProperty(key));
437
441
  }
438
442
  if (props.style) {
439
- Object.entries(props.style).map(([key, value]) => el.style.setProperty(key, value));
443
+ Object.entries(props.style).map(
444
+ ([key, value]) => el.style.setProperty(key, value)
445
+ );
440
446
  }
441
447
  }
442
448
  }
@@ -464,9 +470,7 @@ var __exports__ = (() => {
464
470
  async requestFullscreen() {
465
471
  const container = this.getContainer();
466
472
  if (container?.requestFullscreen) {
467
- await container.requestFullscreen({
468
- navigationUI: "hide"
469
- });
473
+ await container.requestFullscreen({ navigationUI: "hide" });
470
474
  } else {
471
475
  this.togglePseudoFullscreen();
472
476
  }
@@ -0,0 +1,108 @@
1
+ import { jsx as _jsx } from "preact/jsx-runtime";
2
+ /* global document */
3
+ import { _deepEqual as deepEqual } from '@deck.gl/core';
4
+ import { render } from 'preact';
5
+ import { IconButton } from "./components.js";
6
+ export class FullscreenWidget {
7
+ constructor(props) {
8
+ this.id = 'fullscreen';
9
+ this.placement = 'top-left';
10
+ this.fullscreen = false;
11
+ this.id = props.id || 'fullscreen';
12
+ this.placement = props.placement || 'top-left';
13
+ props.enterLabel = props.enterLabel || 'Enter Fullscreen';
14
+ props.exitLabel = props.exitLabel || 'Exit Fullscreen';
15
+ props.style = props.style || {};
16
+ this.props = props;
17
+ }
18
+ onAdd({ deck }) {
19
+ const { style, className } = this.props;
20
+ const el = document.createElement('div');
21
+ el.classList.add('deck-widget', 'deck-widget-fullscreen');
22
+ if (className)
23
+ el.classList.add(className);
24
+ if (style) {
25
+ Object.entries(style).map(([key, value]) => el.style.setProperty(key, value));
26
+ }
27
+ this.deck = deck;
28
+ this.element = el;
29
+ this.update();
30
+ document.addEventListener('fullscreenchange', this.onFullscreenChange.bind(this));
31
+ return el;
32
+ }
33
+ onRemove() {
34
+ this.deck = undefined;
35
+ this.element = undefined;
36
+ document.removeEventListener('fullscreenchange', this.onFullscreenChange.bind(this));
37
+ }
38
+ update() {
39
+ const { enterLabel, exitLabel } = this.props;
40
+ const el = this.element;
41
+ if (!el) {
42
+ return;
43
+ }
44
+ const ui = (_jsx(IconButton, { onClick: this.handleClick.bind(this), label: this.fullscreen ? exitLabel : enterLabel, className: this.fullscreen ? 'deck-widget-fullscreen-exit' : 'deck-widget-fullscreen-enter' }));
45
+ render(ui, el);
46
+ }
47
+ setProps(props) {
48
+ const oldProps = this.props;
49
+ const el = this.element;
50
+ if (el) {
51
+ if (oldProps.className !== props.className) {
52
+ if (oldProps.className)
53
+ el.classList.remove(oldProps.className);
54
+ if (props.className)
55
+ el.classList.add(props.className);
56
+ }
57
+ if (!deepEqual(oldProps.style, props.style, 1)) {
58
+ if (oldProps.style) {
59
+ Object.entries(oldProps.style).map(([key]) => el.style.removeProperty(key));
60
+ }
61
+ if (props.style) {
62
+ Object.entries(props.style).map(([key, value]) => el.style.setProperty(key, value));
63
+ }
64
+ }
65
+ }
66
+ Object.assign(this.props, props);
67
+ }
68
+ getContainer() {
69
+ return this.props.container || this.deck?.getCanvas()?.parentElement;
70
+ }
71
+ onFullscreenChange() {
72
+ const prevFullscreen = this.fullscreen;
73
+ const fullscreen = document.fullscreenElement === this.getContainer();
74
+ if (prevFullscreen !== fullscreen) {
75
+ this.fullscreen = !this.fullscreen;
76
+ }
77
+ this.update();
78
+ }
79
+ async handleClick() {
80
+ if (this.fullscreen) {
81
+ await this.exitFullscreen();
82
+ }
83
+ else {
84
+ await this.requestFullscreen();
85
+ }
86
+ this.update();
87
+ }
88
+ async requestFullscreen() {
89
+ const container = this.getContainer();
90
+ if (container?.requestFullscreen) {
91
+ await container.requestFullscreen({ navigationUI: 'hide' });
92
+ }
93
+ else {
94
+ this.togglePseudoFullscreen();
95
+ }
96
+ }
97
+ async exitFullscreen() {
98
+ if (document.exitFullscreen) {
99
+ await document.exitFullscreen();
100
+ }
101
+ else {
102
+ this.togglePseudoFullscreen();
103
+ }
104
+ }
105
+ togglePseudoFullscreen() {
106
+ this.getContainer()?.classList.toggle('deck-pseudo-fullscreen');
107
+ }
108
+ }