@deck.gl/widgets 9.2.0-beta.2 → 9.2.0-beta.4

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 (125) hide show
  1. package/dist/compass-widget.d.ts +1 -1
  2. package/dist/compass-widget.d.ts.map +1 -1
  3. package/dist/compass-widget.js +0 -1
  4. package/dist/compass-widget.js.map +1 -1
  5. package/dist/context-menu-widget.d.ts +2 -2
  6. package/dist/context-menu-widget.d.ts.map +1 -1
  7. package/dist/context-menu-widget.js +4 -1
  8. package/dist/context-menu-widget.js.map +1 -1
  9. package/dist/dist.dev.js +965 -900
  10. package/dist/fps-widget.d.ts +5 -6
  11. package/dist/fps-widget.d.ts.map +1 -1
  12. package/dist/fps-widget.js +14 -15
  13. package/dist/fps-widget.js.map +1 -1
  14. package/dist/fullscreen-widget.d.ts +2 -0
  15. package/dist/fullscreen-widget.d.ts.map +1 -1
  16. package/dist/fullscreen-widget.js +7 -3
  17. package/dist/fullscreen-widget.js.map +1 -1
  18. package/dist/geocoder-widget.d.ts +4 -3
  19. package/dist/geocoder-widget.d.ts.map +1 -1
  20. package/dist/geocoder-widget.js +3 -4
  21. package/dist/geocoder-widget.js.map +1 -1
  22. package/dist/gimbal-widget.d.ts +7 -5
  23. package/dist/gimbal-widget.d.ts.map +1 -1
  24. package/dist/gimbal-widget.js +15 -10
  25. package/dist/gimbal-widget.js.map +1 -1
  26. package/dist/index.cjs +685 -668
  27. package/dist/index.cjs.map +4 -4
  28. package/dist/index.d.ts +7 -7
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +12 -9
  31. package/dist/index.js.map +1 -1
  32. package/dist/info-widget.d.ts +9 -9
  33. package/dist/info-widget.d.ts.map +1 -1
  34. package/dist/info-widget.js +7 -9
  35. package/dist/info-widget.js.map +1 -1
  36. package/dist/lib/components/button-group.d.ts +1 -1
  37. package/dist/lib/components/button-group.d.ts.map +1 -1
  38. package/dist/lib/components/button-group.js +1 -1
  39. package/dist/lib/components/button-group.js.map +1 -1
  40. package/dist/lib/components/grouped-icon-button.d.ts +5 -3
  41. package/dist/lib/components/grouped-icon-button.d.ts.map +1 -1
  42. package/dist/lib/components/grouped-icon-button.js +3 -3
  43. package/dist/lib/components/grouped-icon-button.js.map +1 -1
  44. package/dist/lib/components/icon-button.d.ts +5 -6
  45. package/dist/lib/components/icon-button.d.ts.map +1 -1
  46. package/dist/lib/components/icon-button.js +1 -1
  47. package/dist/lib/components/icon-button.js.map +1 -1
  48. package/dist/lib/components/icon-menu.d.ts +2 -2
  49. package/dist/lib/components/icon-menu.d.ts.map +1 -1
  50. package/dist/lib/components/icon-menu.js +4 -19
  51. package/dist/lib/components/icon-menu.js.map +1 -1
  52. package/dist/lib/components/simple-menu.js +1 -1
  53. package/dist/lib/components/simple-menu.js.map +1 -1
  54. package/dist/loading-widget.d.ts +4 -2
  55. package/dist/loading-widget.d.ts.map +1 -1
  56. package/dist/loading-widget.js +5 -3
  57. package/dist/loading-widget.js.map +1 -1
  58. package/dist/reset-view-widget.d.ts +9 -11
  59. package/dist/reset-view-widget.d.ts.map +1 -1
  60. package/dist/reset-view-widget.js +5 -4
  61. package/dist/reset-view-widget.js.map +1 -1
  62. package/dist/scale-widget.d.ts +6 -3
  63. package/dist/scale-widget.d.ts.map +1 -1
  64. package/dist/scale-widget.js +3 -2
  65. package/dist/scale-widget.js.map +1 -1
  66. package/dist/screenshot-widget.d.ts +4 -2
  67. package/dist/screenshot-widget.d.ts.map +1 -1
  68. package/dist/screenshot-widget.js +3 -1
  69. package/dist/screenshot-widget.js.map +1 -1
  70. package/dist/splitter-widget.d.ts +1 -1
  71. package/dist/splitter-widget.d.ts.map +1 -1
  72. package/dist/splitter-widget.js +0 -2
  73. package/dist/splitter-widget.js.map +1 -1
  74. package/dist/stats-widget.d.ts +6 -1
  75. package/dist/stats-widget.d.ts.map +1 -1
  76. package/dist/stats-widget.js +11 -4
  77. package/dist/stats-widget.js.map +1 -1
  78. package/dist/stylesheet.css +53 -35
  79. package/dist/theme-widget.d.ts +3 -1
  80. package/dist/theme-widget.d.ts.map +1 -1
  81. package/dist/theme-widget.js +6 -3
  82. package/dist/theme-widget.js.map +1 -1
  83. package/dist/themes.d.ts +10 -0
  84. package/dist/themes.d.ts.map +1 -1
  85. package/dist/themes.js +12 -4
  86. package/dist/themes.js.map +1 -1
  87. package/dist/timeline-widget.d.ts +10 -32
  88. package/dist/timeline-widget.d.ts.map +1 -1
  89. package/dist/timeline-widget.js +6 -2
  90. package/dist/timeline-widget.js.map +1 -1
  91. package/dist/view-selector-widget.d.ts +2 -0
  92. package/dist/view-selector-widget.d.ts.map +1 -1
  93. package/dist/view-selector-widget.js +14 -13
  94. package/dist/view-selector-widget.js.map +1 -1
  95. package/dist/zoom-widget.d.ts +1 -2
  96. package/dist/zoom-widget.d.ts.map +1 -1
  97. package/dist/zoom-widget.js +7 -5
  98. package/dist/zoom-widget.js.map +1 -1
  99. package/dist.min.js +2 -3
  100. package/package.json +2 -2
  101. package/src/compass-widget.tsx +1 -1
  102. package/src/context-menu-widget.tsx +7 -3
  103. package/src/fps-widget.tsx +26 -17
  104. package/src/fullscreen-widget.tsx +9 -3
  105. package/src/geocoder-widget.tsx +7 -7
  106. package/src/gimbal-widget.tsx +16 -11
  107. package/src/index.ts +15 -10
  108. package/src/info-widget.tsx +17 -17
  109. package/src/lib/components/button-group.tsx +2 -2
  110. package/src/lib/components/grouped-icon-button.tsx +9 -6
  111. package/src/lib/components/icon-button.tsx +5 -6
  112. package/src/lib/components/icon-menu.tsx +12 -30
  113. package/src/lib/components/simple-menu.tsx +1 -1
  114. package/src/loading-widget.tsx +9 -5
  115. package/src/reset-view-widget.tsx +18 -16
  116. package/src/scale-widget.tsx +9 -5
  117. package/src/screenshot-widget.tsx +7 -3
  118. package/src/splitter-widget.tsx +1 -3
  119. package/src/stats-widget.tsx +18 -5
  120. package/src/stylesheet.css +53 -35
  121. package/src/theme-widget.tsx +9 -4
  122. package/src/themes.ts +15 -4
  123. package/src/timeline-widget.tsx +19 -42
  124. package/src/view-selector-widget.tsx +58 -15
  125. package/src/zoom-widget.tsx +8 -6
package/dist/index.cjs CHANGED
@@ -63,15 +63,15 @@ var import_preact = require("preact");
63
63
  // dist/lib/components/button-group.js
64
64
  var import_jsx_runtime = require("preact/jsx-runtime");
65
65
  var ButtonGroup = (props) => {
66
- const { children, orientation } = props;
66
+ const { children, orientation = "horizontal" } = props;
67
67
  return (0, import_jsx_runtime.jsx)("div", { className: `deck-widget-button-group ${orientation}`, children });
68
68
  };
69
69
 
70
70
  // dist/lib/components/grouped-icon-button.js
71
71
  var import_jsx_runtime2 = require("preact/jsx-runtime");
72
72
  var GroupedIconButton = (props) => {
73
- const { className, label, onClick } = props;
74
- return (0, import_jsx_runtime2.jsx)("button", { className: `deck-widget-icon-button ${className || ""}`, type: "button", onClick, title: label, children: (0, import_jsx_runtime2.jsx)("div", { className: "deck-widget-icon" }) });
73
+ const { className = "", label, onClick, children } = props;
74
+ return (0, import_jsx_runtime2.jsx)("button", { className: `deck-widget-icon-button ${className}`, type: "button", onClick, title: label, children: children ? children : (0, import_jsx_runtime2.jsx)("div", { className: "deck-widget-icon" }) });
75
75
  };
76
76
 
77
77
  // dist/zoom-widget.js
@@ -80,10 +80,8 @@ var ZoomWidget = class extends import_core.Widget {
80
80
  super(props, ZoomWidget.defaultProps);
81
81
  this.className = "deck-widget-zoom";
82
82
  this.placement = "top-left";
83
- this.viewId = null;
84
83
  this.viewports = {};
85
- this.viewId = props.viewId ?? this.viewId;
86
- this.placement = props.placement ?? this.placement;
84
+ this.setProps(this.props);
87
85
  }
88
86
  setProps(props) {
89
87
  this.placement = props.placement ?? this.placement;
@@ -105,7 +103,9 @@ var ZoomWidget = class extends import_core.Widget {
105
103
  };
106
104
  if (this.props.transitionDuration > 0) {
107
105
  nextViewState.transitionDuration = this.props.transitionDuration;
108
- nextViewState.transitionInterpolator = "latitude" in nextViewState ? new import_core.FlyToInterpolator() : new import_core.LinearInterpolator();
106
+ nextViewState.transitionInterpolator = "latitude" in nextViewState ? new import_core.FlyToInterpolator() : new import_core.LinearInterpolator({
107
+ transitionProps: ["zoom"]
108
+ });
109
109
  }
110
110
  this.setViewState(viewId, nextViewState);
111
111
  }
@@ -132,7 +132,7 @@ ZoomWidget.defaultProps = {
132
132
  transitionDuration: 200,
133
133
  zoomInLabel: "Zoom In",
134
134
  zoomOutLabel: "Zoom Out",
135
- viewId: void 0
135
+ viewId: null
136
136
  };
137
137
 
138
138
  // dist/reset-view-widget.js
@@ -143,7 +143,7 @@ var import_core2 = require("@deck.gl/core");
143
143
  // dist/lib/components/icon-button.js
144
144
  var import_jsx_runtime4 = require("preact/jsx-runtime");
145
145
  var IconButton = (props) => {
146
- const { className, label, onClick, children } = props;
146
+ const { className = "", label, onClick, children } = props;
147
147
  return (0, import_jsx_runtime4.jsx)("div", { className: "deck-widget-button", children: (0, import_jsx_runtime4.jsx)("button", { className: `deck-widget-icon-button ${className}`, type: "button", onClick, title: label, children: children ? children : (0, import_jsx_runtime4.jsx)("div", { className: "deck-widget-icon" }) }) });
148
148
  };
149
149
 
@@ -153,10 +153,11 @@ var ResetViewWidget = class extends import_core2.Widget {
153
153
  super(props, ResetViewWidget.defaultProps);
154
154
  this.className = "deck-widget-reset-view";
155
155
  this.placement = "top-left";
156
- this.placement = props.placement ?? this.placement;
156
+ this.setProps(this.props);
157
157
  }
158
158
  setProps(props) {
159
159
  this.placement = props.placement ?? this.placement;
160
+ this.viewId = props.viewId ?? this.viewId;
160
161
  super.setProps(props);
161
162
  }
162
163
  onRenderHTML(rootElement) {
@@ -168,9 +169,9 @@ var ResetViewWidget = class extends import_core2.Widget {
168
169
  this.setViewState(initialViewState);
169
170
  }
170
171
  setViewState(viewState) {
171
- const viewId = this.props.viewId || (viewState == null ? void 0 : viewState.id) || "default-view";
172
+ const viewId = this.props.viewId || "default-view";
172
173
  const nextViewState = {
173
- ...viewState
174
+ ...viewId !== "default-view" ? viewState == null ? void 0 : viewState[viewId] : viewState
174
175
  // only works for geospatial?
175
176
  // transitionDuration: this.props.transitionDuration,
176
177
  // transitionInterpolator: new FlyToInterpolator()
@@ -184,19 +185,18 @@ ResetViewWidget.defaultProps = {
184
185
  placement: "top-left",
185
186
  label: "Reset View",
186
187
  initialViewState: void 0,
187
- viewId: void 0
188
+ viewId: null
188
189
  };
189
190
 
190
- // dist/compass-widget.js
191
+ // dist/gimbal-widget.js
191
192
  var import_jsx_runtime6 = require("preact/jsx-runtime");
192
193
  var import_core3 = require("@deck.gl/core");
193
194
  var import_preact3 = require("preact");
194
- var CompassWidget = class extends import_core3.Widget {
195
+ var GimbalWidget = class extends import_core3.Widget {
195
196
  constructor(props = {}) {
196
- super(props, CompassWidget.defaultProps);
197
- this.className = "deck-widget-compass";
197
+ super(props, GimbalWidget.defaultProps);
198
+ this.className = "deck-widget-gimbal";
198
199
  this.placement = "top-left";
199
- this.viewId = null;
200
200
  this.viewports = {};
201
201
  this.setProps(this.props);
202
202
  }
@@ -209,90 +209,30 @@ var CompassWidget = class extends import_core3.Widget {
209
209
  var _a;
210
210
  const viewId = this.viewId || ((_a = Object.values(this.viewports)[0]) == null ? void 0 : _a.id) || "default-view";
211
211
  const widgetViewport = this.viewports[viewId];
212
- const [rz, rx] = this.getRotation(widgetViewport);
213
- const ui = (0, import_jsx_runtime6.jsx)("div", { className: "deck-widget-button", style: { perspective: 100 }, children: (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
212
+ const { rotationOrbit, rotationX } = this.getNormalizedRotation(widgetViewport);
213
+ const ui = (0, import_jsx_runtime6.jsx)("div", { className: "deck-widget-button", style: { perspective: 100, pointerEvents: "auto" }, children: (0, import_jsx_runtime6.jsxs)("button", { type: "button", onClick: () => {
214
214
  for (const viewport of Object.values(this.viewports)) {
215
- this.handleCompassReset(viewport);
215
+ this.resetOrbitView(viewport);
216
216
  }
217
- }, title: this.props.label, style: { transform: `rotateX(${rx}deg)` }, children: (0, import_jsx_runtime6.jsx)("svg", { fill: "none", width: "100%", height: "100%", viewBox: "0 0 26 26", children: (0, import_jsx_runtime6.jsxs)("g", { transform: `rotate(${rz},13,13)`, children: [(0, import_jsx_runtime6.jsx)("path", { d: "M10 13.0001L12.9999 5L15.9997 13.0001H10Z", fill: "var(--icon-compass-north-color, rgb(240, 92, 68))" }), (0, import_jsx_runtime6.jsx)("path", { d: "M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z", fill: "var(--icon-compass-south-color, rgb(204, 204, 204))" })] }) }) }) });
218
- (0, import_preact3.render)(ui, rootElement);
219
- }
220
- onViewportChange(viewport) {
221
- if (!viewport.equals(this.viewports[viewport.id])) {
222
- this.viewports[viewport.id] = viewport;
223
- this.updateHTML();
224
- }
225
- }
226
- getRotation(viewport) {
227
- if (viewport instanceof import_core3.WebMercatorViewport) {
228
- return [-viewport.bearing, viewport.pitch];
229
- } else if (viewport instanceof import_core3._GlobeViewport) {
230
- return [0, Math.max(-80, Math.min(80, viewport.latitude))];
231
- }
232
- return [0, 0];
233
- }
234
- handleCompassReset(viewport) {
235
- const viewId = this.viewId || viewport.id || "default-view";
236
- if (viewport instanceof import_core3.WebMercatorViewport) {
237
- const nextViewState = {
238
- ...viewport,
239
- bearing: 0,
240
- ...this.getRotation(viewport)[0] === 0 ? { pitch: 0 } : {},
241
- transitionDuration: this.props.transitionDuration,
242
- transitionInterpolator: new import_core3.FlyToInterpolator()
243
- };
244
- this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });
245
- }
246
- }
247
- };
248
- CompassWidget.defaultProps = {
249
- ...import_core3.Widget.defaultProps,
250
- id: "compass",
251
- placement: "top-left",
252
- viewId: null,
253
- label: "Reset Compass",
254
- transitionDuration: 200
255
- };
256
-
257
- // dist/gimbal-widget.js
258
- var import_jsx_runtime7 = require("preact/jsx-runtime");
259
- var import_core4 = require("@deck.gl/core");
260
- var import_preact4 = require("preact");
261
- var GimbalWidget = class extends import_core4.Widget {
262
- constructor(props = {}) {
263
- super(props, GimbalWidget.defaultProps);
264
- this.className = "deck-widget-gimbal";
265
- this.placement = "top-left";
266
- this.viewId = null;
267
- this.setProps(this.props);
268
- }
269
- setProps(props) {
270
- this.placement = props.placement ?? this.placement;
271
- this.viewId = props.viewId ?? this.viewId;
272
- super.setProps(props);
273
- }
274
- onRenderHTML(rootElement) {
275
- const { rotationOrbit, rotationX } = this.getNormalizedRotation();
276
- const ui = (0, import_jsx_runtime7.jsx)("div", { className: "deck-widget-button", style: { perspective: 100, pointerEvents: "auto" }, children: (0, import_jsx_runtime7.jsxs)("button", { type: "button", onClick: () => {
277
- this.resetOrbitView();
278
- }, title: this.props.label, style: { position: "relative", width: 26, height: 26 }, children: [(0, import_jsx_runtime7.jsx)("svg", { className: "gimbal-outer-ring", width: "100%", height: "100%", viewBox: "0 0 26 26", style: {
217
+ }, title: this.props.label, style: { position: "relative", width: 26, height: 26 }, children: [(0, import_jsx_runtime6.jsx)("svg", { className: "gimbal-outer-ring", width: "100%", height: "100%", viewBox: "0 0 26 26", style: {
279
218
  position: "absolute",
280
219
  top: 0,
281
220
  left: 0,
282
221
  transform: `rotateY(${rotationOrbit}deg)`
283
- }, children: (0, import_jsx_runtime7.jsx)("circle", { cx: "13", cy: "13", r: "10", stroke: "var(--icon-gimbal-outer-color, rgb(68, 92, 204))", strokeWidth: this.props.strokeWidth, fill: "none" }) }), (0, import_jsx_runtime7.jsx)("svg", { className: "gimbal-inner-ring", width: "100%", height: "100%", viewBox: "0 0 26 26", style: {
222
+ }, children: (0, import_jsx_runtime6.jsx)("circle", { cx: "13", cy: "13", r: "10", stroke: "var(--icon-gimbal-outer-color, rgb(68, 92, 204))", strokeWidth: this.props.strokeWidth, fill: "none" }) }), (0, import_jsx_runtime6.jsx)("svg", { className: "gimbal-inner-ring", width: "100%", height: "100%", viewBox: "0 0 26 26", style: {
284
223
  position: "absolute",
285
224
  top: 0,
286
225
  left: 0,
287
226
  transform: `rotateX(${rotationX}deg)`
288
- }, children: (0, import_jsx_runtime7.jsx)("circle", { cx: "13", cy: "13", r: "7", stroke: "var(--icon-gimbal-inner-color, rgb(240, 92, 68))", strokeWidth: this.props.strokeWidth, fill: "none" }) })] }) });
289
- (0, import_preact4.render)(ui, rootElement);
227
+ }, children: (0, import_jsx_runtime6.jsx)("circle", { cx: "13", cy: "13", r: "7", stroke: "var(--icon-gimbal-inner-color, rgb(240, 92, 68))", strokeWidth: this.props.strokeWidth, fill: "none" }) })] }) });
228
+ (0, import_preact3.render)(ui, rootElement);
290
229
  }
291
230
  onViewportChange(viewport) {
231
+ this.viewports[viewport.id] = viewport;
292
232
  this.updateHTML();
293
233
  }
294
- resetOrbitView() {
295
- const viewId = this.getViewId();
234
+ resetOrbitView(viewport) {
235
+ const viewId = this.getViewId(viewport);
296
236
  const viewState = this.getViewState(viewId);
297
237
  if ("rotationOrbit" in viewState || "rotationX" in viewState) {
298
238
  const nextViewState = {
@@ -300,15 +240,15 @@ var GimbalWidget = class extends import_core4.Widget {
300
240
  rotationOrbit: 0,
301
241
  rotationX: 0,
302
242
  transitionDuration: this.props.transitionDuration,
303
- transitionInterpolator: new import_core4.LinearInterpolator({
243
+ transitionInterpolator: new import_core3.LinearInterpolator({
304
244
  transitionProps: ["rotationOrbit", "rotationX"]
305
245
  })
306
246
  };
307
247
  this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });
308
248
  }
309
249
  }
310
- getNormalizedRotation() {
311
- const viewState = this.getViewState(this.getViewId());
250
+ getNormalizedRotation(viewport) {
251
+ const viewState = this.getViewState(this.getViewId(viewport));
312
252
  const [rz, rx] = this.getRotation(viewState);
313
253
  const rotationOrbit = normalizeAndClampAngle(rz);
314
254
  const rotationX = normalizeAndClampAngle(rx);
@@ -321,8 +261,8 @@ var GimbalWidget = class extends import_core4.Widget {
321
261
  return [0, 0];
322
262
  }
323
263
  // Move to Widget/WidgetManager?
324
- getViewId() {
325
- const viewId = this.viewId || "OrbitView";
264
+ getViewId(viewport) {
265
+ const viewId = this.viewId || (viewport == null ? void 0 : viewport.id) || "OrbitView";
326
266
  return viewId;
327
267
  }
328
268
  getViewState(viewId) {
@@ -340,10 +280,10 @@ var GimbalWidget = class extends import_core4.Widget {
340
280
  }
341
281
  };
342
282
  GimbalWidget.defaultProps = {
343
- ...import_core4.Widget.defaultProps,
283
+ ...import_core3.Widget.defaultProps,
344
284
  id: "gimbal",
345
285
  placement: "top-left",
346
- viewId: void 0,
286
+ viewId: null,
347
287
  label: "Gimbal",
348
288
  strokeWidth: 1.5,
349
289
  transitionDuration: 200
@@ -362,6 +302,72 @@ function normalizeAndClampAngle(angle) {
362
302
  return normalized;
363
303
  }
364
304
 
305
+ // dist/compass-widget.js
306
+ var import_jsx_runtime7 = require("preact/jsx-runtime");
307
+ var import_core4 = require("@deck.gl/core");
308
+ var import_preact4 = require("preact");
309
+ var CompassWidget = class extends import_core4.Widget {
310
+ constructor(props = {}) {
311
+ super(props, CompassWidget.defaultProps);
312
+ this.className = "deck-widget-compass";
313
+ this.placement = "top-left";
314
+ this.viewports = {};
315
+ this.setProps(this.props);
316
+ }
317
+ setProps(props) {
318
+ this.placement = props.placement ?? this.placement;
319
+ this.viewId = props.viewId ?? this.viewId;
320
+ super.setProps(props);
321
+ }
322
+ onRenderHTML(rootElement) {
323
+ var _a;
324
+ const viewId = this.viewId || ((_a = Object.values(this.viewports)[0]) == null ? void 0 : _a.id) || "default-view";
325
+ const widgetViewport = this.viewports[viewId];
326
+ const [rz, rx] = this.getRotation(widgetViewport);
327
+ const ui = (0, import_jsx_runtime7.jsx)("div", { className: "deck-widget-button", style: { perspective: 100 }, children: (0, import_jsx_runtime7.jsx)("button", { type: "button", onClick: () => {
328
+ for (const viewport of Object.values(this.viewports)) {
329
+ this.handleCompassReset(viewport);
330
+ }
331
+ }, title: this.props.label, style: { transform: `rotateX(${rx}deg)` }, children: (0, import_jsx_runtime7.jsx)("svg", { fill: "none", width: "100%", height: "100%", viewBox: "0 0 26 26", children: (0, import_jsx_runtime7.jsxs)("g", { transform: `rotate(${rz},13,13)`, children: [(0, import_jsx_runtime7.jsx)("path", { d: "M10 13.0001L12.9999 5L15.9997 13.0001H10Z", fill: "var(--icon-compass-north-color, rgb(240, 92, 68))" }), (0, import_jsx_runtime7.jsx)("path", { d: "M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z", fill: "var(--icon-compass-south-color, rgb(204, 204, 204))" })] }) }) }) });
332
+ (0, import_preact4.render)(ui, rootElement);
333
+ }
334
+ onViewportChange(viewport) {
335
+ if (!viewport.equals(this.viewports[viewport.id])) {
336
+ this.viewports[viewport.id] = viewport;
337
+ this.updateHTML();
338
+ }
339
+ }
340
+ getRotation(viewport) {
341
+ if (viewport instanceof import_core4.WebMercatorViewport) {
342
+ return [-viewport.bearing, viewport.pitch];
343
+ } else if (viewport instanceof import_core4._GlobeViewport) {
344
+ return [0, Math.max(-80, Math.min(80, viewport.latitude))];
345
+ }
346
+ return [0, 0];
347
+ }
348
+ handleCompassReset(viewport) {
349
+ const viewId = this.viewId || viewport.id || "default-view";
350
+ if (viewport instanceof import_core4.WebMercatorViewport) {
351
+ const nextViewState = {
352
+ ...viewport,
353
+ bearing: 0,
354
+ ...this.getRotation(viewport)[0] === 0 ? { pitch: 0 } : {},
355
+ transitionDuration: this.props.transitionDuration,
356
+ transitionInterpolator: new import_core4.FlyToInterpolator()
357
+ };
358
+ this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });
359
+ }
360
+ }
361
+ };
362
+ CompassWidget.defaultProps = {
363
+ ...import_core4.Widget.defaultProps,
364
+ id: "compass",
365
+ placement: "top-left",
366
+ viewId: null,
367
+ label: "Reset Compass",
368
+ transitionDuration: 200
369
+ };
370
+
365
371
  // dist/scale-widget.js
366
372
  var import_jsx_runtime8 = require("preact/jsx-runtime");
367
373
  var import_preact5 = require("preact");
@@ -374,10 +380,11 @@ var ScaleWidget = class extends import_core5.Widget {
374
380
  this.scaleWidth = 10;
375
381
  this.scaleValue = 0;
376
382
  this.scaleText = "";
377
- this.placement = props.placement ?? this.placement;
383
+ this.setProps(this.props);
378
384
  }
379
385
  setProps(props) {
380
386
  this.placement = props.placement ?? this.placement;
387
+ this.viewId = props.viewId ?? this.viewId;
381
388
  super.setProps(props);
382
389
  }
383
390
  onRenderHTML(rootElement) {
@@ -409,7 +416,7 @@ ScaleWidget.defaultProps = {
409
416
  id: "scale",
410
417
  placement: "bottom-left",
411
418
  label: "Scale",
412
- onCapture: void 0
419
+ viewId: null
413
420
  };
414
421
  function getMetersPerPixel(latitude, zoom) {
415
422
  const earthCircumference = 40075016686e-3;
@@ -730,17 +737,16 @@ var GeocoderWidget = class extends import_core6.Widget {
730
737
  }
731
738
  };
732
739
  this.viewports = {};
733
- this.placement = this.props.placement ?? this.placement;
734
740
  this.setProps(this.props);
735
- this.geocoder = getGeocoder(this.props);
736
741
  }
737
742
  setProps(props) {
738
- super.setProps(props);
739
743
  this.placement = props.placement ?? this.placement;
744
+ this.viewId = props.viewId ?? this.viewId;
740
745
  this.geocoder = getGeocoder(this.props);
741
746
  if (this.geocoder.requiresApiKey && !this.props.apiKey) {
742
747
  throw new Error(`API key is required for the ${this.geocoder.name} geocoder`);
743
748
  }
749
+ super.setProps(props);
744
750
  }
745
751
  onRenderHTML(rootElement) {
746
752
  const menuItems = this.props._geolocation ? [CURRENT_LOCATION2, ...this.geocodeHistory.addressHistory] : [...this.geocodeHistory.addressHistory];
@@ -794,7 +800,7 @@ var GeocoderWidget = class extends import_core6.Widget {
794
800
  GeocoderWidget.defaultProps = {
795
801
  ...import_core6.Widget.defaultProps,
796
802
  id: "geocoder",
797
- viewId: void 0,
803
+ viewId: null,
798
804
  placement: "top-left",
799
805
  label: "Geocoder",
800
806
  transitionDuration: 200,
@@ -833,7 +839,7 @@ var FullscreenWidget = class extends import_core8.Widget {
833
839
  this.className = "deck-widget-fullscreen";
834
840
  this.placement = "top-left";
835
841
  this.fullscreen = false;
836
- this.placement = props.placement ?? this.placement;
842
+ this.setProps(this.props);
837
843
  }
838
844
  onAdd() {
839
845
  document.addEventListener("fullscreenchange", this.onFullscreenChange.bind(this));
@@ -842,10 +848,13 @@ var FullscreenWidget = class extends import_core8.Widget {
842
848
  document.removeEventListener("fullscreenchange", this.onFullscreenChange.bind(this));
843
849
  }
844
850
  onRenderHTML(rootElement) {
845
- (0, import_preact7.render)((0, import_jsx_runtime11.jsx)(IconButton, { onClick: this.handleClick.bind(this), label: this.fullscreen ? this.props.exitLabel : this.props.enterLabel, className: this.fullscreen ? "deck-widget-fullscreen-exit" : "deck-widget-fullscreen-enter" }), rootElement);
851
+ (0, import_preact7.render)((0, import_jsx_runtime11.jsx)(IconButton, { onClick: () => {
852
+ this.handleClick().catch((err) => import_core8.log.error(err)());
853
+ }, label: this.fullscreen ? this.props.exitLabel : this.props.enterLabel, className: this.fullscreen ? "deck-widget-fullscreen-exit" : "deck-widget-fullscreen-enter" }), rootElement);
846
854
  }
847
855
  setProps(props) {
848
856
  this.placement = props.placement ?? this.placement;
857
+ this.viewId = props.viewId ?? this.viewId;
849
858
  super.setProps(props);
850
859
  }
851
860
  getContainer() {
@@ -892,298 +901,212 @@ FullscreenWidget.defaultProps = {
892
901
  ...import_core8.Widget.defaultProps,
893
902
  id: "fullscreen",
894
903
  placement: "top-left",
904
+ viewId: null,
895
905
  enterLabel: "Enter Fullscreen",
896
906
  exitLabel: "Exit Fullscreen",
897
907
  container: void 0
898
908
  };
899
909
 
900
- // dist/screenshot-widget.js
910
+ // dist/splitter-widget.js
901
911
  var import_jsx_runtime12 = require("preact/jsx-runtime");
902
912
  var import_preact8 = require("preact");
913
+ var import_hooks2 = require("preact/hooks");
903
914
  var import_core9 = require("@deck.gl/core");
904
- var ScreenshotWidget = class extends import_core9.Widget {
905
- constructor(props = {}) {
906
- super(props, ScreenshotWidget.defaultProps);
907
- this.className = "deck-widget-screenshot";
908
- this.placement = "top-left";
909
- this.placement = props.placement ?? this.placement;
915
+ var SplitterWidget = class extends import_core9.Widget {
916
+ constructor(props) {
917
+ super(props, SplitterWidget.defaultProps);
918
+ this.className = "deck-widget-splitter";
919
+ this.placement = "fill";
910
920
  }
911
921
  setProps(props) {
912
- this.placement = props.placement ?? this.placement;
913
922
  super.setProps(props);
914
923
  }
915
924
  onRenderHTML(rootElement) {
916
- (0, import_preact8.render)((0, import_jsx_runtime12.jsx)(IconButton, { className: "deck-widget-camera", label: this.props.label, onClick: this.handleClick.bind(this) }), rootElement);
917
- }
918
- handleClick() {
919
- if (this.props.onCapture) {
920
- this.props.onCapture(this);
921
- return;
922
- }
923
- const dataURL = this.captureScreenToDataURL(this.props.imageFormat);
924
- if (dataURL) {
925
- this.downloadDataURL(dataURL, this.props.filename);
926
- }
927
- }
928
- /** @note only captures canvas contents, not HTML DOM or CSS styles */
929
- captureScreenToDataURL(imageFormat) {
930
- var _a;
931
- const canvas = (_a = this.deck) == null ? void 0 : _a.getCanvas();
932
- return canvas == null ? void 0 : canvas.toDataURL(imageFormat);
933
- }
934
- /** Download a data URL */
935
- downloadDataURL(dataURL, filename) {
936
- const link = document.createElement("a");
937
- link.href = dataURL;
938
- link.download = filename;
939
- link.click();
925
+ rootElement.style.position = "absolute";
926
+ rootElement.style.top = "0";
927
+ rootElement.style.left = "0";
928
+ rootElement.style.width = "100%";
929
+ rootElement.style.height = "100%";
930
+ rootElement.style.margin = "0px";
931
+ (0, import_preact8.render)((0, import_jsx_runtime12.jsx)(Splitter, { orientation: this.props.orientation, initialSplit: this.props.initialSplit, onChange: this.props.onChange, onDragStart: this.props.onDragStart, onDragEnd: this.props.onDragEnd }), rootElement);
940
932
  }
941
933
  };
942
- ScreenshotWidget.defaultProps = {
934
+ SplitterWidget.defaultProps = {
943
935
  ...import_core9.Widget.defaultProps,
944
- id: "screenshot",
945
- placement: "top-left",
946
- label: "Screenshot",
947
- filename: "screenshot.png",
948
- imageFormat: "image/png",
949
- onCapture: void 0
950
- };
951
-
952
- // dist/loading-widget.js
953
- var import_jsx_runtime13 = require("preact/jsx-runtime");
954
- var import_preact9 = require("preact");
955
- var import_core10 = require("@deck.gl/core");
956
- var LoadingWidget = class extends import_core10.Widget {
957
- constructor(props = {}) {
958
- super(props, LoadingWidget.defaultProps);
959
- this.className = "deck-widget-loading";
960
- this.placement = "top-left";
961
- this.loading = true;
962
- this.placement = props.placement ?? this.placement;
963
- }
964
- setProps(props) {
965
- this.placement = props.placement ?? this.placement;
966
- super.setProps(props);
967
- }
968
- onRenderHTML(rootElement) {
969
- (0, import_preact9.render)(
970
- // TODO(ibgreen) - this should not be a button, but styling is so nested that it is easier to reuse this component.
971
- this.loading && (0, import_jsx_runtime13.jsx)(IconButton, { className: "deck-widget-spinner-icon", label: this.props.label, onClick: this.handleClick.bind(this) }),
972
- rootElement
973
- );
974
- }
975
- onRedraw({ layers }) {
976
- const loading = !layers.some((layer) => !layer.isLoaded);
977
- if (loading !== this.loading) {
978
- this.loading = loading;
979
- this.updateHTML();
980
- }
981
- }
982
- // TODO(ibgreen) - this should not be a button, see above.
983
- handleClick() {
936
+ id: "splitter-widget",
937
+ viewId1: "",
938
+ viewId2: "",
939
+ orientation: "vertical",
940
+ initialSplit: 0.5,
941
+ onChange: () => {
942
+ },
943
+ onDragStart: () => {
944
+ },
945
+ onDragEnd: () => {
984
946
  }
985
947
  };
986
- LoadingWidget.defaultProps = {
987
- ...import_core10.Widget.defaultProps,
988
- id: "loading",
989
- placement: "top-left",
990
- label: "Loading layer data"
991
- };
992
-
993
- // dist/fps-widget.js
994
- var import_core11 = require("@deck.gl/core");
995
- var FpsWidget = class extends import_core11.Widget {
996
- constructor(props = {}) {
997
- super(props, FpsWidget.defaultProps);
998
- this.className = "deck-widget-fps";
999
- this.placement = "top-left";
1000
- this._lastFps = -1;
1001
- this.placement = props.placement ?? this.placement;
1002
- }
1003
- setProps(props) {
1004
- if (props.placement) {
1005
- this.placement = props.placement;
1006
- }
1007
- super.setProps(props);
1008
- }
1009
- onAdd({}) {
1010
- this._lastFps = this._getFps();
1011
- this.updateHTML();
1012
- }
1013
- onRenderHTML(rootElement) {
1014
- const fps = this._getFps();
1015
- rootElement.innerText = `FPS:
1016
- ${fps}`;
1017
- rootElement.style.backgroundColor = "white";
1018
- rootElement.style.fontFamily = "monospace";
1019
- rootElement.style.fontSize = "8px";
1020
- rootElement.style.fontWeight = "700";
1021
- }
1022
- onRedraw({}) {
1023
- const fps = this._getFps();
1024
- if (fps !== this._lastFps) {
1025
- this._lastFps = fps;
1026
- this.updateHTML();
948
+ function Splitter({ orientation, initialSplit, onChange, onDragStart, onDragEnd }) {
949
+ const [split, setSplit] = (0, import_hooks2.useState)(initialSplit);
950
+ const dragging = (0, import_hooks2.useRef)(false);
951
+ const containerRef = (0, import_hooks2.useRef)(null);
952
+ const handleDragStart = (event) => {
953
+ dragging.current = true;
954
+ onDragStart == null ? void 0 : onDragStart();
955
+ document.addEventListener("mousemove", handleDragging);
956
+ document.addEventListener("mouseup", handleDragEnd);
957
+ event.preventDefault();
958
+ };
959
+ const handleDragging = (event) => {
960
+ if (!dragging.current || !containerRef.current)
961
+ return;
962
+ const rect = containerRef.current.getBoundingClientRect();
963
+ let newSplit;
964
+ if (orientation === "vertical") {
965
+ newSplit = (event.clientX - rect.left) / rect.width;
966
+ } else {
967
+ newSplit = (event.clientY - rect.top) / rect.height;
1027
968
  }
1028
- }
1029
- _getFps() {
1030
- return Math.round(this.deck.metrics.fps ?? 0);
1031
- }
1032
- };
1033
- FpsWidget.defaultProps = {
1034
- ...import_core11.Widget.defaultProps,
1035
- id: "fps",
1036
- placement: "top-left"
1037
- };
969
+ newSplit = Math.min(Math.max(newSplit, 0.05), 0.95);
970
+ setSplit(newSplit);
971
+ onChange == null ? void 0 : onChange(newSplit);
972
+ };
973
+ const handleDragEnd = (event) => {
974
+ if (!dragging.current)
975
+ return;
976
+ dragging.current = false;
977
+ onDragEnd == null ? void 0 : onDragEnd();
978
+ document.removeEventListener("mousemove", handleDragging);
979
+ document.removeEventListener("mouseup", handleDragEnd);
980
+ };
981
+ const splitterStyle = orientation === "vertical" ? {
982
+ position: "absolute",
983
+ top: 0,
984
+ bottom: 0,
985
+ left: `${split * 100}%`,
986
+ width: "4px",
987
+ cursor: "col-resize",
988
+ background: "#ccc",
989
+ zIndex: 10,
990
+ pointerEvents: "auto",
991
+ boxShadow: "inset -1px 0 0 white, inset 1px 0 0 white"
992
+ } : {
993
+ position: "absolute",
994
+ left: 0,
995
+ right: 0,
996
+ top: `${split * 100}%`,
997
+ height: "4px",
998
+ cursor: "row-resize",
999
+ background: "#ccc",
1000
+ zIndex: 10,
1001
+ pointerEvents: "auto",
1002
+ boxShadow: "inset -1px 0 0 white, inset 1px 0 0 white"
1003
+ };
1004
+ const containerStyle = {
1005
+ position: "absolute",
1006
+ top: 0,
1007
+ left: 0,
1008
+ right: 0,
1009
+ bottom: 0
1010
+ };
1011
+ return (0, import_jsx_runtime12.jsx)("div", { ref: containerRef, style: containerStyle, children: (0, import_jsx_runtime12.jsx)("div", { style: splitterStyle, onMouseDown: handleDragStart }) });
1012
+ }
1038
1013
 
1039
- // dist/theme-widget.js
1014
+ // dist/view-selector-widget.js
1040
1015
  var import_jsx_runtime14 = require("preact/jsx-runtime");
1041
- var import_core12 = require("@deck.gl/core");
1042
- var import_core13 = require("@deck.gl/core");
1043
- var import_preact10 = require("preact");
1016
+ var import_preact9 = require("preact");
1017
+ var import_core10 = require("@deck.gl/core");
1044
1018
 
1045
- // dist/themes.js
1046
- var LightTheme = {
1047
- "--widget-margin": "12px",
1048
- "--button-size": "28px",
1049
- "--button-corner-radius": "8px",
1050
- "--button-background": "#fff",
1051
- "--button-stroke": "rgba(255, 255, 255, 0.3)",
1052
- "--button-inner-stroke": "unset",
1053
- "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25)",
1054
- "--button-backdrop-filter": "unset",
1055
- "--button-icon-idle": "rgba(97, 97, 102, 1)",
1056
- "--button-icon-hover": "rgba(24, 24, 26, 1)",
1057
- "--icon-compass-north-color": "rgb(240, 92, 68)",
1058
- "--icon-compass-south-color": "rgb(204, 204, 204)"
1059
- };
1060
- var DarkTheme = {
1061
- "--widget-margin": "12px",
1062
- "--button-size": "28px",
1063
- "--button-corner-radius": "8px",
1064
- "--button-background": "rgba(18, 18, 20, 1)",
1065
- "--button-stroke": "rgba(18, 18, 20, 0.30)",
1066
- "--button-inner-stroke": "unset",
1067
- "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25)",
1068
- "--button-backdrop-filter": "unset",
1069
- "--button-icon-idle": "rgba(158, 157, 168, 1)",
1070
- "--button-icon-hover": "rgba(215, 214, 229, 1)",
1071
- "--icon-compass-north-color": "rgb(240, 92, 68)",
1072
- "--icon-compass-south-color": "rgb(200, 199, 209)"
1073
- };
1074
- var LightGlassTheme = {
1075
- "--widget-margin": "12px",
1076
- "--button-size": "28px",
1077
- "--button-corner-radius": "8px",
1078
- "--button-background": "rgba(255, 255, 255, 0.6)",
1079
- "--button-stroke": "rgba(255, 255, 255, 0.3)",
1080
- "--button-inner-stroke": "1px solid rgba(255, 255, 255, 0.6)",
1081
- "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset",
1082
- "--button-backdrop-filter": "blur(4px)",
1083
- "--button-icon-idle": "rgba(97, 97, 102, 1)",
1084
- "--button-icon-hover": "rgba(24, 24, 26, 1)",
1085
- "--icon-compass-north-color": "rgb(240, 92, 68)",
1086
- "--icon-compass-south-color": "rgb(204, 204, 204)"
1087
- };
1088
- var DarkGlassTheme = {
1089
- "--widget-margin": "12px",
1090
- "--button-size": "28px",
1091
- "--button-corner-radius": "8px",
1092
- "--button-background": "rgba(18, 18, 20, 0.75)",
1093
- "--button-stroke": "rgba(18, 18, 20, 0.30)",
1094
- "--button-inner-stroke": "1px solid rgba(18, 18, 20, 0.75)",
1095
- "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset",
1096
- "--button-backdrop-filter": "blur(4px)",
1097
- "--button-icon-idle": "rgba(158, 157, 168, 1)",
1098
- "--button-icon-hover": "rgba(215, 214, 229, 1)",
1099
- "--icon-compass-north-color": "rgb(240, 92, 68)",
1100
- "--icon-compass-south-color": "rgb(200, 199, 209)"
1101
- };
1019
+ // dist/lib/components/icon-menu.js
1020
+ var import_jsx_runtime13 = require("preact/jsx-runtime");
1021
+ var import_hooks3 = require("preact/hooks");
1022
+ function IconMenu(props) {
1023
+ const [menuOpen, setMenuOpen] = (0, import_hooks3.useState)(false);
1024
+ const containerRef = (0, import_hooks3.useRef)(null);
1025
+ const handleClickOutside = (event) => {
1026
+ if (containerRef.current && !containerRef.current.contains(event.target)) {
1027
+ setMenuOpen(false);
1028
+ }
1029
+ };
1030
+ (0, import_hooks3.useEffect)(() => {
1031
+ document.addEventListener("mousedown", handleClickOutside);
1032
+ return () => {
1033
+ document.removeEventListener("mousedown", handleClickOutside);
1034
+ };
1035
+ }, [containerRef]);
1036
+ const [selectedItem, setSelectedItem] = (0, import_hooks3.useState)(props.initialItem);
1037
+ const handleSelectItem = (item) => {
1038
+ setSelectedItem(item);
1039
+ setMenuOpen(false);
1040
+ props.onItemSelected(item);
1041
+ };
1042
+ const handleButtonClick = () => setMenuOpen(!menuOpen);
1043
+ const selectedMenuItem = props.menuItems.find((item) => item.value === selectedItem);
1044
+ const label = props.label || (selectedMenuItem == null ? void 0 : selectedMenuItem.label) || "";
1045
+ const icon = props.icon || (selectedMenuItem == null ? void 0 : selectedMenuItem.icon);
1046
+ return (0, import_jsx_runtime13.jsxs)("div", { style: { position: "relative", display: "inline-block" }, ref: containerRef, children: [(0, import_jsx_runtime13.jsx)(IconButton, { className: props.className, label, onClick: handleButtonClick, children: icon }), menuOpen && (0, import_jsx_runtime13.jsx)("div", { className: "deck-widget-icon-menu", children: (0, import_jsx_runtime13.jsx)(ButtonGroup, { orientation: "vertical", children: props.menuItems.map((item) => (0, import_jsx_runtime13.jsx)(GroupedIconButton, { label: item.label, onClick: () => handleSelectItem(item.value), children: item.icon }, item.value)) }) })] });
1047
+ }
1102
1048
 
1103
- // dist/theme-widget.js
1104
- var ThemeWidget = class extends import_core13.Widget {
1049
+ // dist/view-selector-widget.js
1050
+ var ViewSelectorWidget = class extends import_core10.Widget {
1105
1051
  constructor(props = {}) {
1106
- super(props, ThemeWidget.defaultProps);
1107
- this.className = "deck-widget-theme";
1052
+ super(props, ViewSelectorWidget.defaultProps);
1053
+ this.className = "deck-widget-view-selector";
1108
1054
  this.placement = "top-left";
1109
- this.themeMode = "dark";
1110
- this.placement = props.placement ?? this.placement;
1111
- this.themeMode = this._getInitialThemeMode();
1055
+ this.handleSelectMode = (viewMode) => {
1056
+ this.viewMode = viewMode;
1057
+ this.updateHTML();
1058
+ this.props.onViewModeChange(viewMode);
1059
+ };
1060
+ this.viewMode = this.props.initialViewMode;
1061
+ this.setProps(this.props);
1112
1062
  }
1113
- // eslint-disable-next-line complexity
1114
1063
  setProps(props) {
1115
- const { lightModeTheme, darkModeTheme } = this.props;
1116
1064
  this.placement = props.placement ?? this.placement;
1065
+ this.viewId = props.viewId ?? this.viewId;
1117
1066
  super.setProps(props);
1118
- switch (this.themeMode) {
1119
- case "light":
1120
- if (props.lightModeTheme && !(0, import_core12._deepEqual)(props.lightModeTheme, lightModeTheme, 1)) {
1121
- this._setThemeMode("light");
1122
- }
1123
- break;
1124
- case "dark":
1125
- if (props.darkModeTheme && !(0, import_core12._deepEqual)(props.darkModeTheme, darkModeTheme, 1)) {
1126
- this._setThemeMode("dark");
1127
- }
1128
- break;
1129
- }
1130
1067
  }
1131
1068
  onRenderHTML(rootElement) {
1132
- const { lightModeLabel, darkModeLabel } = this.props;
1133
- (0, import_preact10.render)((0, import_jsx_runtime14.jsx)(IconButton, { onClick: this._handleClick.bind(this), label: this.themeMode === "dark" ? darkModeLabel : lightModeLabel, className: this.themeMode === "dark" ? "deck-widget-moon" : "deck-widget-sun" }), rootElement);
1134
- }
1135
- onAdd() {
1136
- this._setThemeMode(this.themeMode);
1137
- }
1138
- _handleClick() {
1139
- const newThemeMode = this.themeMode === "dark" ? "light" : "dark";
1140
- this._setThemeMode(newThemeMode);
1141
- }
1142
- _setThemeMode(themeMode) {
1143
- var _a;
1144
- this.themeMode = themeMode;
1145
- const container = (_a = this.rootElement) == null ? void 0 : _a.closest(".deck-widget-container");
1146
- if (container) {
1147
- const themeStyle = themeMode === "dark" ? this.props.darkModeTheme : this.props.lightModeTheme;
1148
- (0, import_core12._applyStyles)(container, themeStyle);
1149
- const label = this.themeMode === "dark" ? this.props.darkModeLabel : this.props.lightModeLabel;
1150
- import_core12.log.log(1, `Switched theme to ${label}`, themeStyle);
1151
- this.updateHTML();
1152
- }
1153
- }
1154
- /** Read browser preference */
1155
- _getInitialThemeMode() {
1156
- const { initialThemeMode } = this.props;
1157
- return initialThemeMode === "auto" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : initialThemeMode;
1069
+ (0, import_preact9.render)((0, import_jsx_runtime14.jsx)(IconMenu, { className: "deck-widget-view-selector", menuItems: MENU_ITEMS.map((item) => ({
1070
+ ...item,
1071
+ icon: item.icon()
1072
+ })), initialItem: this.props.initialViewMode, onItemSelected: this.handleSelectMode }), rootElement);
1158
1073
  }
1159
1074
  };
1160
- ThemeWidget.defaultProps = {
1161
- ...import_core13.Widget.defaultProps,
1162
- id: "theme",
1075
+ ViewSelectorWidget.defaultProps = {
1076
+ ...import_core10.Widget.defaultProps,
1077
+ id: "view-selector",
1163
1078
  placement: "top-left",
1164
- lightModeLabel: "Light Mode",
1165
- lightModeTheme: LightGlassTheme,
1166
- darkModeLabel: "Dark Mode",
1167
- darkModeTheme: DarkGlassTheme,
1168
- initialThemeMode: "auto"
1079
+ viewId: null,
1080
+ label: "Split View",
1081
+ initialViewMode: "single",
1082
+ onViewModeChange: () => {
1083
+ }
1084
+ };
1085
+ var ICON_STYLE = { width: "24px", height: "24px" };
1086
+ var ICONS = {
1087
+ single: () => (0, import_jsx_runtime14.jsx)("svg", { width: "24", height: "24", style: ICON_STYLE, children: (0, import_jsx_runtime14.jsx)("rect", { x: "4", y: "4", width: "16", height: "16", stroke: "var(--button-icon-hover, rgb(24, 24, 26))", fill: "none", strokeWidth: "2" }) }),
1088
+ "split-horizontal": () => (0, import_jsx_runtime14.jsxs)("svg", { width: "24", height: "24", style: ICON_STYLE, children: [(0, import_jsx_runtime14.jsx)("rect", { x: "4", y: "4", width: "16", height: "7", stroke: "var(--button-icon-hover, rgb(24, 24, 26))", fill: "none", strokeWidth: "2" }), (0, import_jsx_runtime14.jsx)("rect", { x: "4", y: "13", width: "16", height: "7", stroke: "var(--button-icon-hover, rgb(24, 24, 26))", fill: "none", strokeWidth: "2" })] }),
1089
+ "split-vertical": () => (0, import_jsx_runtime14.jsxs)("svg", { width: "24", height: "24", style: ICON_STYLE, children: [(0, import_jsx_runtime14.jsx)("rect", { x: "4", y: "4", width: "7", height: "16", stroke: "var(--button-icon-hover, rgb(24, 24, 26))", fill: "none", strokeWidth: "2" }), (0, import_jsx_runtime14.jsx)("rect", { x: "13", y: "4", width: "7", height: "16", stroke: "var(--button-icon-hover, rgb(24, 24, 26))", fill: "none", strokeWidth: "2" })] })
1169
1090
  };
1091
+ var MENU_ITEMS = [
1092
+ { value: "single", icon: ICONS.single, label: "Single View" },
1093
+ { value: "split-horizontal", icon: ICONS["split-horizontal"], label: "Split Horizontal" },
1094
+ { value: "split-vertical", icon: ICONS["split-vertical"], label: "Split Vertical" }
1095
+ ];
1170
1096
 
1171
1097
  // dist/info-widget.js
1172
1098
  var import_jsx_runtime15 = require("preact/jsx-runtime");
1173
- var import_core14 = require("@deck.gl/core");
1174
- var import_preact11 = require("preact");
1175
- var InfoWidget = class extends import_core14.Widget {
1099
+ var import_core11 = require("@deck.gl/core");
1100
+ var import_preact10 = require("preact");
1101
+ var InfoWidget = class extends import_core11.Widget {
1176
1102
  constructor(props) {
1177
1103
  super(props, InfoWidget.defaultProps);
1178
1104
  this.className = "deck-widget-info";
1179
1105
  this.placement = "fill";
1180
- this.viewId = null;
1181
- props.position = props.position || [0, 0];
1182
- props.text = props.text || "";
1183
- props.visible = props.visible || false;
1184
- props.minOffset = props.minOffset ?? 0;
1106
+ this.setProps(this.props);
1185
1107
  }
1186
1108
  setProps(props) {
1109
+ this.viewId = props.viewId ?? this.viewId;
1187
1110
  super.setProps(props);
1188
1111
  }
1189
1112
  onCreateRootElement() {
@@ -1202,7 +1125,7 @@ var InfoWidget = class extends import_core14.Widget {
1202
1125
  this.setProps({
1203
1126
  visible: tooltip !== null,
1204
1127
  ...tooltip,
1205
- style: { zIndex: 1, ...tooltip == null ? void 0 : tooltip.style }
1128
+ style: { zIndex: "1", ...tooltip == null ? void 0 : tooltip.style }
1206
1129
  });
1207
1130
  }
1208
1131
  }
@@ -1245,7 +1168,7 @@ var InfoWidget = class extends import_core14.Widget {
1245
1168
  // Include any additional styles
1246
1169
  ...this.props.style
1247
1170
  }, children: this.props.text }), (0, import_jsx_runtime15.jsx)("div", { className: "popup-arrow", style: { position: "absolute", width: "0px", height: "0px" } })] }) : null;
1248
- (0, import_preact11.render)(ui, rootElement);
1171
+ (0, import_preact10.render)(ui, rootElement);
1249
1172
  requestAnimationFrame(() => {
1250
1173
  if (!this.props.visible || !rootElement.firstChild || !this.viewport)
1251
1174
  return;
@@ -1304,11 +1227,11 @@ var InfoWidget = class extends import_core14.Widget {
1304
1227
  }
1305
1228
  };
1306
1229
  InfoWidget.defaultProps = {
1307
- ...import_core14.Widget.defaultProps,
1230
+ ...import_core11.Widget.defaultProps,
1231
+ id: "info",
1308
1232
  position: [0, 0],
1309
1233
  text: "",
1310
1234
  visible: false,
1311
- // Set default minOffset if not provided
1312
1235
  minOffset: 0,
1313
1236
  viewId: null,
1314
1237
  mode: "hover",
@@ -1316,126 +1239,13 @@ InfoWidget.defaultProps = {
1316
1239
  onClick: void 0
1317
1240
  };
1318
1241
 
1319
- // dist/stats-widget.js
1320
- var import_jsx_runtime16 = require("preact/jsx-runtime");
1321
- var import_core15 = require("@deck.gl/core");
1322
- var import_core16 = require("@luma.gl/core");
1323
- var import_preact12 = require("preact");
1324
- var RIGHT_ARROW = "\u25B6";
1325
- var DOWN_ARROW = "\u2B07";
1326
- var DEFAULT_COUNT_FORMATTER = (stat) => `${stat.name}: ${stat.count}`;
1327
- function formatTime(time) {
1328
- return time < 1e3 ? `${time.toFixed(2)}ms` : `${(time / 1e3).toFixed(2)}s`;
1329
- }
1330
- function formatMemory(bytes) {
1331
- const mb = bytes / 1e6;
1332
- return `${mb.toFixed(1)} MB`;
1333
- }
1334
- var DEFAULT_FORMATTERS = {
1335
- count: DEFAULT_COUNT_FORMATTER,
1336
- averageTime: (stat) => `${stat.name}: ${formatTime(stat.getAverageTime())}`,
1337
- totalTime: (stat) => `${stat.name}: ${formatTime(stat.time)}`,
1338
- fps: (stat) => `${stat.name}: ${Math.round(stat.getHz())}fps`,
1339
- memory: (stat) => `${stat.name}: ${formatMemory(stat.count)}`
1340
- };
1341
- var StatsWidget = class extends import_core15.Widget {
1342
- constructor(props = {}) {
1343
- super(props, StatsWidget.defaultProps);
1344
- this.className = "deck-widget-stats";
1345
- this.placement = "top-left";
1346
- this._counter = 0;
1347
- this.collapsed = true;
1348
- this._toggleCollapsed = () => {
1349
- this.collapsed = !this.collapsed;
1350
- this.updateHTML();
1351
- };
1352
- this._formatters = { ...DEFAULT_FORMATTERS };
1353
- this.setProps(props);
1354
- this._resetOnUpdate = { ...this.props.resetOnUpdate };
1355
- this._stats = this.props.stats;
1356
- }
1357
- setProps(props) {
1358
- super.setProps(props);
1359
- this._stats = this._getStats();
1360
- if (props.formatters) {
1361
- for (const name in props.formatters) {
1362
- const f = props.formatters[name];
1363
- this._formatters[name] = typeof f === "string" ? DEFAULT_FORMATTERS[f] || DEFAULT_COUNT_FORMATTER : f;
1364
- }
1365
- }
1366
- if (props.resetOnUpdate) {
1367
- this._resetOnUpdate = { ...props.resetOnUpdate };
1368
- }
1369
- }
1370
- onAdd() {
1371
- this._stats = this._getStats();
1372
- this.updateHTML();
1373
- }
1374
- onRenderHTML(rootElement) {
1375
- const stats = this._stats;
1376
- const collapsed = this.collapsed;
1377
- const title = this.props.title || (stats == null ? void 0 : stats.id) || "Stats";
1378
- const items = [];
1379
- if (!collapsed && stats) {
1380
- stats.forEach((stat) => {
1381
- const lines = this._getLines(stat);
1382
- if (this._resetOnUpdate && this._resetOnUpdate[stat.name]) {
1383
- stat.reset();
1384
- }
1385
- lines.forEach((line, i) => {
1386
- items.push((0, import_jsx_runtime16.jsx)("div", { style: { whiteSpace: "pre" }, children: line }, `${stat.name}-${i}`));
1387
- });
1388
- });
1389
- }
1390
- (0, import_preact12.render)((0, import_jsx_runtime16.jsxs)("div", { className: "deck-widget-stats-container", style: { cursor: "default" }, children: [(0, import_jsx_runtime16.jsxs)("div", { className: "deck-widget-stats-header", style: { cursor: "pointer", pointerEvents: "auto" }, onClick: this._toggleCollapsed, children: [collapsed ? RIGHT_ARROW : DOWN_ARROW, " ", title] }), !collapsed && (0, import_jsx_runtime16.jsx)("div", { className: "deck-widget-stats-content deck-widget-common", children: items })] }), rootElement);
1391
- }
1392
- onRedraw() {
1393
- const framesPerUpdate = Math.max(1, this.props.framesPerUpdate || 1);
1394
- if (this._counter++ % framesPerUpdate === 0) {
1395
- console.log("Redrawing stats widget");
1396
- this.updateHTML();
1397
- }
1398
- }
1399
- _getStats() {
1400
- var _a, _b;
1401
- switch (this.props.type) {
1402
- case "deck":
1403
- return (_a = this.deck) == null ? void 0 : _a.stats;
1404
- case "luma":
1405
- return Array.from(import_core16.luma.stats.stats.values())[0];
1406
- case "device":
1407
- const device = (_b = this.deck) == null ? void 0 : _b.device;
1408
- const stats = device == null ? void 0 : device.statsManager.stats.values();
1409
- return stats ? Array.from(stats)[0] : void 0;
1410
- case "custom":
1411
- return this.props.stats;
1412
- default:
1413
- throw new Error(`Unknown stats type: ${this.props.type}`);
1414
- }
1415
- }
1416
- _getLines(stat) {
1417
- const formatter = this._formatters[stat.name] || this._formatters[stat.type || ""] || DEFAULT_COUNT_FORMATTER;
1418
- return formatter(stat).split("\n");
1419
- }
1420
- };
1421
- StatsWidget.defaultProps = {
1422
- ...import_core15.Widget.defaultProps,
1423
- type: "deck",
1424
- stats: void 0,
1425
- title: "Stats",
1426
- framesPerUpdate: 1,
1427
- formatters: {},
1428
- resetOnUpdate: {},
1429
- id: "stats"
1430
- };
1431
-
1432
1242
  // dist/context-menu-widget.js
1433
- var import_jsx_runtime18 = require("preact/jsx-runtime");
1434
- var import_core17 = require("@deck.gl/core");
1435
- var import_preact13 = require("preact");
1243
+ var import_jsx_runtime17 = require("preact/jsx-runtime");
1244
+ var import_core12 = require("@deck.gl/core");
1245
+ var import_preact11 = require("preact");
1436
1246
 
1437
1247
  // dist/lib/components/simple-menu.js
1438
- var import_jsx_runtime17 = require("preact/jsx-runtime");
1248
+ var import_jsx_runtime16 = require("preact/jsx-runtime");
1439
1249
  var MENU_STYLE = {
1440
1250
  position: "absolute",
1441
1251
  top: "100%",
@@ -1443,7 +1253,7 @@ var MENU_STYLE = {
1443
1253
  background: "white",
1444
1254
  border: "1px solid #ccc",
1445
1255
  borderRadius: "4px",
1446
- marginTop: "4px",
1256
+ marginTop: "var(--menu-gap, 4px)",
1447
1257
  zIndex: 100
1448
1258
  };
1449
1259
  var MENU_ITEM_STYLE = {
@@ -1461,20 +1271,20 @@ var SimpleMenu = (props) => {
1461
1271
  left: `${position.x}px`,
1462
1272
  top: `${position.y}px`
1463
1273
  };
1464
- return (0, import_jsx_runtime17.jsx)("div", { style: styleOverride, children: menuItems.map(({ key, label }) => (0, import_jsx_runtime17.jsx)("button", { style: { ...MENU_ITEM_STYLE, display: "block" }, onClick: (_) => onItemSelected(key), children: label }, key)) });
1274
+ return (0, import_jsx_runtime16.jsx)("div", { style: styleOverride, children: menuItems.map(({ key, label }) => (0, import_jsx_runtime16.jsx)("button", { style: { ...MENU_ITEM_STYLE, display: "block" }, onClick: (_) => onItemSelected(key), children: label }, key)) });
1465
1275
  };
1466
1276
 
1467
1277
  // dist/context-menu-widget.js
1468
1278
  var MOUSE_BUTTON_RIGHT = 2;
1469
1279
  var MOUSE_WHICH_RIGHT = 3;
1470
- var ContextMenuWidget = class extends import_core17.Widget {
1280
+ var ContextMenuWidget = class extends import_core12.Widget {
1471
1281
  constructor(props) {
1472
1282
  super(props, ContextMenuWidget.defaultProps);
1473
1283
  this.className = "deck-widget-context-menu";
1474
1284
  this.placement = "fill";
1475
1285
  this.pickInfo = null;
1476
1286
  this.pickInfo = null;
1477
- this.setProps(props);
1287
+ this.setProps(this.props);
1478
1288
  }
1479
1289
  onAdd({ deck }) {
1480
1290
  var _a, _b;
@@ -1494,8 +1304,8 @@ var ContextMenuWidget = class extends import_core17.Widget {
1494
1304
  }
1495
1305
  onRenderHTML(rootElement) {
1496
1306
  const { visible, position, menuItems } = this.props;
1497
- const ui = visible && menuItems.length ? (0, import_jsx_runtime18.jsx)(SimpleMenu, { menuItems, onItemSelected: (key) => this.props.onMenuItemSelected(key, this.pickInfo), position, style: { pointerEvents: "auto" } }) : null;
1498
- (0, import_preact13.render)(ui, rootElement);
1307
+ const ui = visible && menuItems.length ? (0, import_jsx_runtime17.jsx)(SimpleMenu, { menuItems, onItemSelected: (key) => this.props.onMenuItemSelected(key, this.pickInfo), position, style: { pointerEvents: "auto" } }) : null;
1308
+ (0, import_preact11.render)(ui, rootElement);
1499
1309
  }
1500
1310
  handleContextMenu(srcEvent) {
1501
1311
  var _a, _b, _c;
@@ -1522,7 +1332,7 @@ var ContextMenuWidget = class extends import_core17.Widget {
1522
1332
  }
1523
1333
  };
1524
1334
  ContextMenuWidget.defaultProps = {
1525
- ...import_core17.Widget.defaultProps,
1335
+ ...import_core12.Widget.defaultProps,
1526
1336
  id: "context",
1527
1337
  viewId: null,
1528
1338
  visible: false,
@@ -1533,115 +1343,11 @@ ContextMenuWidget.defaultProps = {
1533
1343
  onMenuItemSelected: (key, pickInfo) => console.log("Context menu item selected:", key, pickInfo)
1534
1344
  };
1535
1345
 
1536
- // dist/splitter-widget.js
1537
- var import_jsx_runtime19 = require("preact/jsx-runtime");
1538
- var import_preact14 = require("preact");
1539
- var import_hooks2 = require("preact/hooks");
1540
- var import_core18 = require("@deck.gl/core");
1541
- var SplitterWidget = class extends import_core18.Widget {
1542
- constructor(props) {
1543
- super(props, SplitterWidget.defaultProps);
1544
- this.className = "deck-widget-splitter";
1545
- this.placement = "fill";
1546
- }
1547
- setProps(props) {
1548
- super.setProps(props);
1549
- }
1550
- onRenderHTML(rootElement) {
1551
- rootElement.style.position = "absolute";
1552
- rootElement.style.top = "0";
1553
- rootElement.style.left = "0";
1554
- rootElement.style.width = "100%";
1555
- rootElement.style.height = "100%";
1556
- rootElement.style.margin = "0px";
1557
- (0, import_preact14.render)((0, import_jsx_runtime19.jsx)(Splitter, { orientation: this.props.orientation, initialSplit: this.props.initialSplit, onChange: this.props.onChange, onDragStart: this.props.onDragStart, onDragEnd: this.props.onDragEnd }), rootElement);
1558
- }
1559
- };
1560
- SplitterWidget.defaultProps = {
1561
- ...import_core18.Widget.defaultProps,
1562
- id: "splitter-widget",
1563
- viewId1: "",
1564
- viewId2: "",
1565
- orientation: "vertical",
1566
- initialSplit: 0.5,
1567
- onChange: () => {
1568
- },
1569
- onDragStart: () => {
1570
- },
1571
- onDragEnd: () => {
1572
- }
1573
- };
1574
- function Splitter({ orientation, initialSplit, onChange, onDragStart, onDragEnd }) {
1575
- const [split, setSplit] = (0, import_hooks2.useState)(initialSplit);
1576
- const dragging = (0, import_hooks2.useRef)(false);
1577
- const containerRef = (0, import_hooks2.useRef)(null);
1578
- const handleDragStart = (event) => {
1579
- dragging.current = true;
1580
- onDragStart == null ? void 0 : onDragStart();
1581
- document.addEventListener("mousemove", handleDragging);
1582
- document.addEventListener("mouseup", handleDragEnd);
1583
- event.preventDefault();
1584
- };
1585
- const handleDragging = (event) => {
1586
- if (!dragging.current || !containerRef.current)
1587
- return;
1588
- const rect = containerRef.current.getBoundingClientRect();
1589
- let newSplit;
1590
- if (orientation === "vertical") {
1591
- newSplit = (event.clientX - rect.left) / rect.width;
1592
- } else {
1593
- newSplit = (event.clientY - rect.top) / rect.height;
1594
- }
1595
- newSplit = Math.min(Math.max(newSplit, 0.05), 0.95);
1596
- setSplit(newSplit);
1597
- onChange == null ? void 0 : onChange(newSplit);
1598
- };
1599
- const handleDragEnd = (event) => {
1600
- if (!dragging.current)
1601
- return;
1602
- dragging.current = false;
1603
- onDragEnd == null ? void 0 : onDragEnd();
1604
- document.removeEventListener("mousemove", handleDragging);
1605
- document.removeEventListener("mouseup", handleDragEnd);
1606
- };
1607
- const splitterStyle = orientation === "vertical" ? {
1608
- position: "absolute",
1609
- top: 0,
1610
- bottom: 0,
1611
- left: `${split * 100}%`,
1612
- width: "4px",
1613
- cursor: "col-resize",
1614
- background: "#ccc",
1615
- zIndex: 10,
1616
- pointerEvents: "auto",
1617
- boxShadow: "inset -1px 0 0 white, inset 1px 0 0 white"
1618
- } : {
1619
- position: "absolute",
1620
- left: 0,
1621
- right: 0,
1622
- top: `${split * 100}%`,
1623
- height: "4px",
1624
- cursor: "row-resize",
1625
- background: "#ccc",
1626
- zIndex: 10,
1627
- pointerEvents: "auto",
1628
- boxShadow: "inset -1px 0 0 white, inset 1px 0 0 white"
1629
- };
1630
- const containerStyle = {
1631
- position: "absolute",
1632
- top: 0,
1633
- left: 0,
1634
- right: 0,
1635
- bottom: 0
1636
- };
1637
- return (0, import_jsx_runtime19.jsx)("div", { ref: containerRef, style: containerStyle, children: (0, import_jsx_runtime19.jsx)("div", { style: splitterStyle, onMouseDown: handleDragStart }) });
1638
- }
1639
-
1640
1346
  // dist/timeline-widget.js
1641
- var import_jsx_runtime20 = require("preact/jsx-runtime");
1642
- var import_core19 = require("@deck.gl/core");
1643
- var import_preact15 = require("preact");
1644
- var TimelineWidget = class extends import_core19.Widget {
1347
+ var import_jsx_runtime18 = require("preact/jsx-runtime");
1348
+ var import_core13 = require("@deck.gl/core");
1349
+ var import_preact12 = require("preact");
1350
+ var TimelineWidget = class extends import_core13.Widget {
1645
1351
  constructor(props = {}) {
1646
1352
  super(props, TimelineWidget.defaultProps);
1647
1353
  this.id = "timeline";
@@ -1677,9 +1383,11 @@ var TimelineWidget = class extends import_core19.Widget {
1677
1383
  }
1678
1384
  };
1679
1385
  this.currentTime = this.props.initialTime ?? this.props.timeRange[0];
1386
+ this.setProps(this.props);
1680
1387
  }
1681
1388
  setProps(props) {
1682
- this.placement = props.placement || this.placement;
1389
+ this.placement = props.placement ?? this.placement;
1390
+ this.viewId = props.viewId ?? this.viewId;
1683
1391
  super.setProps(props);
1684
1392
  }
1685
1393
  onAdd() {
@@ -1690,7 +1398,7 @@ var TimelineWidget = class extends import_core19.Widget {
1690
1398
  this.stop();
1691
1399
  }
1692
1400
  onRenderHTML(rootElement) {
1693
- (0, import_preact15.render)((0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", alignItems: "center", pointerEvents: "auto" }, children: [(0, import_jsx_runtime20.jsx)("button", { type: "button", className: "timeline-play-pause", title: this.playing ? "Pause" : "Play", onClick: this.handlePlayPause, children: this.playing ? "\u23F8" : "\u25B6" }), (0, import_jsx_runtime20.jsx)("input", { type: "range", className: "timeline-slider", min: this.props.timeRange[0], max: this.props.timeRange[1], step: this.props.step, value: this.currentTime, onInput: this.handleSliderChange })] }), rootElement);
1401
+ (0, import_preact12.render)((0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", alignItems: "center", pointerEvents: "auto" }, children: [(0, import_jsx_runtime18.jsx)(IconButton, { label: this.playing ? "Pause" : "Play", onClick: this.handlePlayPause, children: (0, import_jsx_runtime18.jsx)("div", { className: "text", children: this.playing ? "\u23F8" : "\u25B6" }) }), (0, import_jsx_runtime18.jsx)("input", { type: "range", className: "timeline-slider", min: this.props.timeRange[0], max: this.props.timeRange[1], step: this.props.step, value: this.currentTime, onInput: this.handleSliderChange })] }), rootElement);
1694
1402
  }
1695
1403
  start() {
1696
1404
  this.playing = true;
@@ -1707,9 +1415,10 @@ var TimelineWidget = class extends import_core19.Widget {
1707
1415
  }
1708
1416
  };
1709
1417
  TimelineWidget.defaultProps = {
1710
- ...import_core19.Widget.defaultProps,
1418
+ ...import_core13.Widget.defaultProps,
1711
1419
  id: "timeline",
1712
1420
  placement: "bottom-left",
1421
+ viewId: null,
1713
1422
  timeRange: [0, 100],
1714
1423
  step: 1,
1715
1424
  initialTime: void 0,
@@ -1718,98 +1427,406 @@ TimelineWidget.defaultProps = {
1718
1427
  playInterval: 1e3
1719
1428
  };
1720
1429
 
1721
- // dist/view-selector-widget.js
1722
- var import_jsx_runtime22 = require("preact/jsx-runtime");
1723
- var import_preact16 = require("preact");
1724
- var import_core20 = require("@deck.gl/core");
1725
-
1726
- // dist/lib/components/icon-menu.js
1727
- var import_jsx_runtime21 = require("preact/jsx-runtime");
1728
- var import_hooks3 = require("preact/hooks");
1729
- var MENU_STYLE2 = {
1730
- position: "absolute",
1731
- top: "100%",
1732
- left: 0,
1733
- background: "white",
1734
- border: "1px solid #ccc",
1735
- borderRadius: "4px",
1736
- marginTop: "4px",
1737
- zIndex: 100
1738
- };
1739
- var MENU_ITEM_STYLE2 = {
1740
- background: "white",
1741
- border: "none",
1742
- padding: "4px",
1743
- cursor: "pointer",
1744
- pointerEvents: "auto"
1745
- };
1746
- function IconMenu(props) {
1747
- const [menuOpen, setMenuOpen] = (0, import_hooks3.useState)(false);
1748
- const containerRef = (0, import_hooks3.useRef)(null);
1749
- const handleClickOutside = (event) => {
1750
- if (containerRef.current && !containerRef.current.contains(event.target)) {
1751
- setMenuOpen(false);
1752
- }
1753
- };
1754
- (0, import_hooks3.useEffect)(() => {
1755
- document.addEventListener("mousedown", handleClickOutside);
1756
- return () => {
1757
- document.removeEventListener("mousedown", handleClickOutside);
1758
- };
1759
- }, [containerRef]);
1760
- const [selectedItem, setSelectedItem] = (0, import_hooks3.useState)(props.initialItem);
1761
- const handleSelectItem = (item) => {
1762
- setSelectedItem(item);
1763
- setMenuOpen(false);
1764
- props.onItemSelected(item);
1765
- };
1766
- const handleButtonClick = () => setMenuOpen(!menuOpen);
1767
- const selectedMenuItem = props.menuItems.find((item) => item.value === selectedItem);
1768
- const label = props.label || (selectedMenuItem == null ? void 0 : selectedMenuItem.label) || "";
1769
- const Icon = props.icon || (selectedMenuItem == null ? void 0 : selectedMenuItem.icon);
1770
- return (0, import_jsx_runtime21.jsxs)("div", { style: { position: "relative", display: "inline-block" }, ref: containerRef, children: [(0, import_jsx_runtime21.jsx)(IconButton, { className: props.className, label, onClick: handleButtonClick, children: (0, import_jsx_runtime21.jsx)(Icon, {}) }), menuOpen && (0, import_jsx_runtime21.jsx)("div", { style: MENU_STYLE2, children: (0, import_jsx_runtime21.jsx)("div", { style: { display: "flex", flexDirection: "column" }, children: props.menuItems.map((item) => (0, import_jsx_runtime21.jsx)("button", { style: MENU_ITEM_STYLE2, title: item.label, onClick: () => handleSelectItem(item.value), children: item.icon }, item.value)) }) })] });
1771
- }
1430
+ // dist/screenshot-widget.js
1431
+ var import_jsx_runtime19 = require("preact/jsx-runtime");
1432
+ var import_preact13 = require("preact");
1433
+ var import_core14 = require("@deck.gl/core");
1434
+ var ScreenshotWidget = class extends import_core14.Widget {
1435
+ constructor(props = {}) {
1436
+ super(props, ScreenshotWidget.defaultProps);
1437
+ this.className = "deck-widget-screenshot";
1438
+ this.placement = "top-left";
1439
+ this.setProps(this.props);
1440
+ }
1441
+ setProps(props) {
1442
+ this.placement = props.placement ?? this.placement;
1443
+ this.viewId = props.viewId ?? this.viewId;
1444
+ super.setProps(props);
1445
+ }
1446
+ onRenderHTML(rootElement) {
1447
+ (0, import_preact13.render)((0, import_jsx_runtime19.jsx)(IconButton, { className: "deck-widget-camera", label: this.props.label, onClick: this.handleClick.bind(this) }), rootElement);
1448
+ }
1449
+ handleClick() {
1450
+ if (this.props.onCapture) {
1451
+ this.props.onCapture(this);
1452
+ return;
1453
+ }
1454
+ const dataURL = this.captureScreenToDataURL(this.props.imageFormat);
1455
+ if (dataURL) {
1456
+ this.downloadDataURL(dataURL, this.props.filename);
1457
+ }
1458
+ }
1459
+ /** @note only captures canvas contents, not HTML DOM or CSS styles */
1460
+ captureScreenToDataURL(imageFormat) {
1461
+ var _a;
1462
+ const canvas = (_a = this.deck) == null ? void 0 : _a.getCanvas();
1463
+ return canvas == null ? void 0 : canvas.toDataURL(imageFormat);
1464
+ }
1465
+ /** Download a data URL */
1466
+ downloadDataURL(dataURL, filename) {
1467
+ const link = document.createElement("a");
1468
+ link.href = dataURL;
1469
+ link.download = filename;
1470
+ link.click();
1471
+ }
1472
+ };
1473
+ ScreenshotWidget.defaultProps = {
1474
+ ...import_core14.Widget.defaultProps,
1475
+ id: "screenshot",
1476
+ placement: "top-left",
1477
+ viewId: null,
1478
+ label: "Screenshot",
1479
+ filename: "screenshot.png",
1480
+ imageFormat: "image/png",
1481
+ onCapture: void 0
1482
+ };
1772
1483
 
1773
- // dist/view-selector-widget.js
1774
- var ViewSelectorWidget = class extends import_core20.Widget {
1484
+ // dist/theme-widget.js
1485
+ var import_jsx_runtime20 = require("preact/jsx-runtime");
1486
+ var import_core15 = require("@deck.gl/core");
1487
+ var import_core16 = require("@deck.gl/core");
1488
+ var import_preact14 = require("preact");
1489
+
1490
+ // dist/themes.js
1491
+ var LightTheme = {
1492
+ "--widget-margin": "12px",
1493
+ "--button-size": "28px",
1494
+ "--button-corner-radius": "8px",
1495
+ "--button-background": "#fff",
1496
+ "--button-stroke": "rgba(255, 255, 255, 0.3)",
1497
+ "--button-inner-stroke": "unset",
1498
+ "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25)",
1499
+ "--button-backdrop-filter": "unset",
1500
+ "--button-icon-idle": "rgba(97, 97, 102, 1)",
1501
+ "--button-icon-hover": "rgba(24, 24, 26, 1)",
1502
+ "--button-text": "rgb(24, 24, 26, 1)",
1503
+ "--icon-compass-north-color": "rgb(240, 92, 68)",
1504
+ "--icon-compass-south-color": "rgb(204, 204, 204)",
1505
+ "--menu-gap": "4px"
1506
+ };
1507
+ var DarkTheme = {
1508
+ "--widget-margin": "12px",
1509
+ "--button-size": "28px",
1510
+ "--button-corner-radius": "8px",
1511
+ "--button-background": "rgba(18, 18, 20, 1)",
1512
+ "--button-stroke": "rgba(18, 18, 20, 0.30)",
1513
+ "--button-inner-stroke": "unset",
1514
+ "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25)",
1515
+ "--button-backdrop-filter": "unset",
1516
+ "--button-icon-idle": "rgba(158, 157, 168, 1)",
1517
+ "--button-icon-hover": "rgba(215, 214, 229, 1)",
1518
+ "--button-text": "rgb(215, 214, 229, 1)",
1519
+ "--icon-compass-north-color": "rgb(240, 92, 68)",
1520
+ "--icon-compass-south-color": "rgb(200, 199, 209)",
1521
+ "--menu-gap": "4px"
1522
+ };
1523
+ var LightGlassTheme = {
1524
+ "--widget-margin": "12px",
1525
+ "--button-size": "28px",
1526
+ "--button-corner-radius": "8px",
1527
+ "--button-background": "rgba(255, 255, 255, 0.6)",
1528
+ "--button-stroke": "rgba(255, 255, 255, 0.3)",
1529
+ "--button-inner-stroke": "1px solid rgba(255, 255, 255, 0.6)",
1530
+ "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset",
1531
+ "--button-backdrop-filter": "blur(4px)",
1532
+ "--button-icon-idle": "rgba(97, 97, 102, 1)",
1533
+ "--button-icon-hover": "rgba(24, 24, 26, 1)",
1534
+ "--button-text": "rgb(24, 24, 26, 1)",
1535
+ "--icon-compass-north-color": "rgb(240, 92, 68)",
1536
+ "--icon-compass-south-color": "rgb(204, 204, 204)",
1537
+ "--menu-gap": "4px"
1538
+ };
1539
+ var DarkGlassTheme = {
1540
+ "--widget-margin": "12px",
1541
+ "--button-size": "28px",
1542
+ "--button-corner-radius": "8px",
1543
+ "--button-background": "rgba(18, 18, 20, 0.75)",
1544
+ "--button-stroke": "rgba(18, 18, 20, 0.30)",
1545
+ "--button-inner-stroke": "1px solid rgba(18, 18, 20, 0.75)",
1546
+ "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset",
1547
+ "--button-backdrop-filter": "blur(4px)",
1548
+ "--button-icon-idle": "rgba(158, 157, 168, 1)",
1549
+ "--button-icon-hover": "rgba(215, 214, 229, 1)",
1550
+ "--button-text": "rgb(215, 214, 229, 1)",
1551
+ "--icon-compass-north-color": "rgb(240, 92, 68)",
1552
+ "--icon-compass-south-color": "rgb(200, 199, 209)",
1553
+ "--menu-gap": "4px"
1554
+ };
1555
+
1556
+ // dist/theme-widget.js
1557
+ var ThemeWidget = class extends import_core16.Widget {
1775
1558
  constructor(props = {}) {
1776
- super(props, ViewSelectorWidget.defaultProps);
1777
- this.className = "deck-widget-view-selector";
1559
+ super(props, ThemeWidget.defaultProps);
1560
+ this.className = "deck-widget-theme";
1778
1561
  this.placement = "top-left";
1779
- this.handleSelectMode = (viewMode) => {
1780
- this.viewMode = viewMode;
1562
+ this.themeMode = "dark";
1563
+ this.themeMode = this._getInitialThemeMode();
1564
+ this.setProps(this.props);
1565
+ }
1566
+ // eslint-disable-next-line complexity
1567
+ setProps(props) {
1568
+ const { lightModeTheme, darkModeTheme } = this.props;
1569
+ this.placement = props.placement ?? this.placement;
1570
+ this.viewId = props.viewId ?? this.viewId;
1571
+ super.setProps(props);
1572
+ switch (this.themeMode) {
1573
+ case "light":
1574
+ if (props.lightModeTheme && !(0, import_core15._deepEqual)(props.lightModeTheme, lightModeTheme, 1)) {
1575
+ this._setThemeMode("light");
1576
+ }
1577
+ break;
1578
+ case "dark":
1579
+ if (props.darkModeTheme && !(0, import_core15._deepEqual)(props.darkModeTheme, darkModeTheme, 1)) {
1580
+ this._setThemeMode("dark");
1581
+ }
1582
+ break;
1583
+ default:
1584
+ import_core15.log.warn(`Invalid theme mode ${this.themeMode}`)();
1585
+ }
1586
+ }
1587
+ onRenderHTML(rootElement) {
1588
+ const { lightModeLabel, darkModeLabel } = this.props;
1589
+ (0, import_preact14.render)((0, import_jsx_runtime20.jsx)(IconButton, { onClick: this._handleClick.bind(this), label: this.themeMode === "dark" ? darkModeLabel : lightModeLabel, className: this.themeMode === "dark" ? "deck-widget-moon" : "deck-widget-sun" }), rootElement);
1590
+ }
1591
+ onAdd() {
1592
+ this._setThemeMode(this.themeMode);
1593
+ }
1594
+ _handleClick() {
1595
+ const newThemeMode = this.themeMode === "dark" ? "light" : "dark";
1596
+ this._setThemeMode(newThemeMode);
1597
+ }
1598
+ _setThemeMode(themeMode) {
1599
+ var _a;
1600
+ this.themeMode = themeMode;
1601
+ const container = (_a = this.rootElement) == null ? void 0 : _a.closest(".deck-widget-container");
1602
+ if (container) {
1603
+ const themeStyle = themeMode === "dark" ? this.props.darkModeTheme : this.props.lightModeTheme;
1604
+ (0, import_core15._applyStyles)(container, themeStyle);
1605
+ const label = this.themeMode === "dark" ? this.props.darkModeLabel : this.props.lightModeLabel;
1606
+ import_core15.log.log(1, `Switched theme to ${label}`, themeStyle)();
1781
1607
  this.updateHTML();
1782
- };
1783
- this.placement = this.props.placement;
1784
- this.viewMode = this.props.initialViewMode;
1608
+ }
1609
+ }
1610
+ /** Read browser preference */
1611
+ _getInitialThemeMode() {
1612
+ const { initialThemeMode } = this.props;
1613
+ return initialThemeMode === "auto" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : initialThemeMode;
1614
+ }
1615
+ };
1616
+ ThemeWidget.defaultProps = {
1617
+ ...import_core16.Widget.defaultProps,
1618
+ id: "theme",
1619
+ placement: "top-left",
1620
+ viewId: null,
1621
+ lightModeLabel: "Light Mode",
1622
+ lightModeTheme: LightGlassTheme,
1623
+ darkModeLabel: "Dark Mode",
1624
+ darkModeTheme: DarkGlassTheme,
1625
+ initialThemeMode: "auto"
1626
+ };
1627
+
1628
+ // dist/loading-widget.js
1629
+ var import_jsx_runtime21 = require("preact/jsx-runtime");
1630
+ var import_preact15 = require("preact");
1631
+ var import_core17 = require("@deck.gl/core");
1632
+ var LoadingWidget = class extends import_core17.Widget {
1633
+ constructor(props = {}) {
1634
+ super(props, LoadingWidget.defaultProps);
1635
+ this.className = "deck-widget-loading";
1636
+ this.placement = "top-left";
1637
+ this.loading = true;
1638
+ this.setProps(this.props);
1785
1639
  }
1786
1640
  setProps(props) {
1641
+ this.placement = props.placement ?? this.placement;
1642
+ this.viewId = props.viewId ?? this.viewId;
1787
1643
  super.setProps(props);
1644
+ }
1645
+ onRenderHTML(rootElement) {
1646
+ (0, import_preact15.render)(
1647
+ // TODO(ibgreen) - this should not be a button, but styling is so nested that it is easier to reuse this component.
1648
+ this.loading && (0, import_jsx_runtime21.jsx)(IconButton, { className: "deck-widget-spinner", label: this.props.label, onClick: this.handleClick.bind(this) }),
1649
+ rootElement
1650
+ );
1651
+ }
1652
+ onRedraw({ layers }) {
1653
+ const loading = layers.some((layer) => !layer.isLoaded);
1654
+ if (loading !== this.loading) {
1655
+ this.loading = loading;
1656
+ this.updateHTML();
1657
+ }
1658
+ }
1659
+ // TODO(ibgreen) - this should not be a button, see above.
1660
+ handleClick() {
1661
+ }
1662
+ };
1663
+ LoadingWidget.defaultProps = {
1664
+ ...import_core17.Widget.defaultProps,
1665
+ id: "loading",
1666
+ placement: "top-left",
1667
+ viewId: null,
1668
+ label: "Loading layer data"
1669
+ };
1670
+
1671
+ // dist/fps-widget.js
1672
+ var import_jsx_runtime22 = require("preact/jsx-runtime");
1673
+ var import_core18 = require("@deck.gl/core");
1674
+ var import_preact16 = require("preact");
1675
+ var FpsWidget = class extends import_core18.Widget {
1676
+ constructor(props = {}) {
1677
+ super(props, FpsWidget.defaultProps);
1678
+ this.className = "deck-widget-fps";
1679
+ this.placement = "top-left";
1680
+ this._lastFps = -1;
1681
+ this.setProps(this.props);
1682
+ }
1683
+ setProps(props) {
1788
1684
  this.placement = props.placement ?? this.placement;
1685
+ this.viewId = props.viewId ?? this.viewId;
1686
+ super.setProps(props);
1687
+ }
1688
+ onAdd({}) {
1689
+ this._lastFps = this._getFps();
1690
+ requestAnimationFrame(() => this._animate());
1789
1691
  }
1790
1692
  onRenderHTML(rootElement) {
1791
- (0, import_preact16.render)((0, import_jsx_runtime22.jsx)(IconMenu, { className: "deck-widget-view-selector", menuItems: MENU_ITEMS, initialItem: this.props.initialViewMode, onItemSelected: this.handleSelectMode }), rootElement);
1693
+ const fps = this._getFps();
1694
+ (0, import_preact16.render)((0, import_jsx_runtime22.jsx)(IconButton, { children: (0, import_jsx_runtime22.jsxs)("div", { className: "text", children: ["FPS", (0, import_jsx_runtime22.jsx)("br", {}), fps] }) }), rootElement);
1695
+ }
1696
+ _animate() {
1697
+ const fps = this._getFps();
1698
+ if (this._lastFps !== fps) {
1699
+ this._lastFps = fps;
1700
+ this.updateHTML();
1701
+ }
1702
+ requestAnimationFrame(() => this._animate());
1703
+ }
1704
+ _getFps() {
1705
+ var _a;
1706
+ return Math.round(((_a = this.deck) == null ? void 0 : _a.metrics.fps) ?? 0);
1792
1707
  }
1793
1708
  };
1794
- ViewSelectorWidget.defaultProps = {
1795
- ...import_core20.Widget.defaultProps,
1796
- id: "view-selector",
1709
+ FpsWidget.defaultProps = {
1710
+ ...import_core18.Widget.defaultProps,
1711
+ id: "fps",
1797
1712
  placement: "top-left",
1798
- label: "Split View",
1799
- initialViewMode: "single",
1800
- onViewModeChange: (viewMode) => {
1801
- console.log(viewMode);
1713
+ viewId: null
1714
+ };
1715
+
1716
+ // dist/stats-widget.js
1717
+ var import_jsx_runtime23 = require("preact/jsx-runtime");
1718
+ var import_core19 = require("@deck.gl/core");
1719
+ var import_core20 = require("@luma.gl/core");
1720
+ var import_preact17 = require("preact");
1721
+ var RIGHT_ARROW = "\u25B6";
1722
+ var DOWN_ARROW = "\u2B07";
1723
+ var DEFAULT_COUNT_FORMATTER = (stat) => `${stat.name}: ${stat.count}`;
1724
+ function formatTime(time) {
1725
+ return time < 1e3 ? `${time.toFixed(2)}ms` : `${(time / 1e3).toFixed(2)}s`;
1726
+ }
1727
+ function formatMemory(bytes) {
1728
+ const mb = bytes / 1e6;
1729
+ return `${mb.toFixed(1)} MB`;
1730
+ }
1731
+ var DEFAULT_FORMATTERS = {
1732
+ count: DEFAULT_COUNT_FORMATTER,
1733
+ averageTime: (stat) => `${stat.name}: ${formatTime(stat.getAverageTime())}`,
1734
+ totalTime: (stat) => `${stat.name}: ${formatTime(stat.time)}`,
1735
+ fps: (stat) => `${stat.name}: ${Math.round(stat.getHz())}fps`,
1736
+ memory: (stat) => `${stat.name}: ${formatMemory(stat.count)}`
1737
+ };
1738
+ var StatsWidget = class extends import_core19.Widget {
1739
+ constructor(props = {}) {
1740
+ super(props, StatsWidget.defaultProps);
1741
+ this.className = "deck-widget-stats";
1742
+ this.placement = "top-left";
1743
+ this._counter = 0;
1744
+ this.collapsed = true;
1745
+ this._toggleCollapsed = () => {
1746
+ this.collapsed = !this.collapsed;
1747
+ this.updateHTML();
1748
+ };
1749
+ this._formatters = { ...DEFAULT_FORMATTERS };
1750
+ this._resetOnUpdate = { ...this.props.resetOnUpdate };
1751
+ this._stats = this.props.stats;
1752
+ this.setProps(props);
1753
+ }
1754
+ setProps(props) {
1755
+ this.placement = props.placement ?? this.placement;
1756
+ this.viewId = props.viewId ?? this.viewId;
1757
+ this._stats = this._getStats();
1758
+ if (props.formatters) {
1759
+ for (const name in props.formatters) {
1760
+ const f = props.formatters[name];
1761
+ this._formatters[name] = typeof f === "string" ? DEFAULT_FORMATTERS[f] || DEFAULT_COUNT_FORMATTER : f;
1762
+ }
1763
+ }
1764
+ if (props.resetOnUpdate) {
1765
+ this._resetOnUpdate = { ...props.resetOnUpdate };
1766
+ }
1767
+ super.setProps(props);
1768
+ }
1769
+ onAdd() {
1770
+ this._stats = this._getStats();
1771
+ this.updateHTML();
1772
+ }
1773
+ onRenderHTML(rootElement) {
1774
+ const stats = this._stats;
1775
+ const collapsed = this.collapsed;
1776
+ const title = this.props.title || (stats == null ? void 0 : stats.id) || "Stats";
1777
+ const items = [];
1778
+ if (!collapsed && stats) {
1779
+ stats.forEach((stat) => {
1780
+ const lines = this._getLines(stat);
1781
+ if (this._resetOnUpdate && this._resetOnUpdate[stat.name]) {
1782
+ stat.reset();
1783
+ }
1784
+ lines.forEach((line, i) => {
1785
+ items.push((0, import_jsx_runtime23.jsx)("div", { style: { whiteSpace: "pre" }, children: line }, `${stat.name}-${i}`));
1786
+ });
1787
+ });
1788
+ }
1789
+ (0, import_preact17.render)((0, import_jsx_runtime23.jsxs)("div", { className: "deck-widget-stats-container", style: { cursor: "default" }, children: [(0, import_jsx_runtime23.jsxs)("div", { className: "deck-widget-stats-header", style: { cursor: "pointer", pointerEvents: "auto" }, onClick: this._toggleCollapsed, children: [collapsed ? RIGHT_ARROW : DOWN_ARROW, " ", title] }), !collapsed && (0, import_jsx_runtime23.jsx)("div", { className: "deck-widget-stats-content", children: items })] }), rootElement);
1790
+ }
1791
+ onRedraw() {
1792
+ const framesPerUpdate = Math.max(1, this.props.framesPerUpdate || 1);
1793
+ if (this._counter++ % framesPerUpdate === 0) {
1794
+ this._stats = this._getStats();
1795
+ this.updateHTML();
1796
+ }
1797
+ }
1798
+ _getStats() {
1799
+ var _a, _b;
1800
+ switch (this.props.type) {
1801
+ case "deck":
1802
+ return (_a = this.deck) == null ? void 0 : _a.stats;
1803
+ case "luma":
1804
+ return Array.from(import_core20.luma.stats.stats.values())[0];
1805
+ case "device":
1806
+ const device = (_b = this.deck) == null ? void 0 : _b.device;
1807
+ const stats = device == null ? void 0 : device.statsManager.stats.values();
1808
+ return stats ? Array.from(stats)[0] : void 0;
1809
+ case "custom":
1810
+ return this.props.stats;
1811
+ default:
1812
+ throw new Error(`Unknown stats type: ${this.props.type}`);
1813
+ }
1814
+ }
1815
+ _getLines(stat) {
1816
+ const formatter = this._formatters[stat.name] || this._formatters[stat.type || ""] || DEFAULT_COUNT_FORMATTER;
1817
+ return formatter(stat).split("\n");
1802
1818
  }
1803
1819
  };
1804
- var ICON_STYLE = { width: "24px", height: "24px" };
1805
- var ICONS = {
1806
- single: () => (0, import_jsx_runtime22.jsx)("svg", { width: "24", height: "24", style: ICON_STYLE, children: (0, import_jsx_runtime22.jsx)("rect", { x: "4", y: "4", width: "16", height: "16", stroke: "black", fill: "none", strokeWidth: "2" }) }),
1807
- "split-horizontal": () => (0, import_jsx_runtime22.jsxs)("svg", { width: "24", height: "24", style: ICON_STYLE, children: [(0, import_jsx_runtime22.jsx)("rect", { x: "4", y: "4", width: "16", height: "7", stroke: "black", fill: "none", strokeWidth: "2" }), (0, import_jsx_runtime22.jsx)("rect", { x: "4", y: "13", width: "16", height: "7", stroke: "black", fill: "none", strokeWidth: "2" })] }),
1808
- "split-vertical": () => (0, import_jsx_runtime22.jsxs)("svg", { width: "24", height: "24", style: ICON_STYLE, children: [(0, import_jsx_runtime22.jsx)("rect", { x: "4", y: "4", width: "7", height: "16", stroke: "black", fill: "none", strokeWidth: "2" }), (0, import_jsx_runtime22.jsx)("rect", { x: "13", y: "4", width: "7", height: "16", stroke: "black", fill: "none", strokeWidth: "2" })] })
1820
+ StatsWidget.defaultProps = {
1821
+ ...import_core19.Widget.defaultProps,
1822
+ type: "deck",
1823
+ placement: "top-left",
1824
+ viewId: null,
1825
+ stats: void 0,
1826
+ title: "Stats",
1827
+ framesPerUpdate: 1,
1828
+ formatters: {},
1829
+ resetOnUpdate: {},
1830
+ id: "stats"
1809
1831
  };
1810
- var MENU_ITEMS = [
1811
- { value: "single", icon: ICONS.single, label: "Single View" },
1812
- { value: "split-horizontal", icon: ICONS["split-horizontal"], label: "Split Horizontal" },
1813
- { value: "split-vertical", icon: ICONS["split-vertical"], label: "Split Vertical" }
1814
- ];
1815
1832
  //# sourceMappingURL=index.cjs.map