@deck.gl/widgets 9.3.0-alpha.6 → 9.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/compass-widget.d.ts +12 -0
  2. package/dist/compass-widget.d.ts.map +1 -1
  3. package/dist/compass-widget.js +9 -3
  4. package/dist/compass-widget.js.map +1 -1
  5. package/dist/dist.dev.js +205 -69
  6. package/dist/fullscreen-widget.d.ts +5 -0
  7. package/dist/fullscreen-widget.d.ts.map +1 -1
  8. package/dist/fullscreen-widget.js +18 -8
  9. package/dist/fullscreen-widget.js.map +1 -1
  10. package/dist/geocoder-widget.d.ts +13 -0
  11. package/dist/geocoder-widget.d.ts.map +1 -1
  12. package/dist/geocoder-widget.js +13 -1
  13. package/dist/geocoder-widget.js.map +1 -1
  14. package/dist/gimbal-widget.d.ts +12 -0
  15. package/dist/gimbal-widget.d.ts.map +1 -1
  16. package/dist/gimbal-widget.js +4 -1
  17. package/dist/gimbal-widget.js.map +1 -1
  18. package/dist/index.cjs +218 -70
  19. package/dist/index.cjs.map +2 -2
  20. package/dist/loading-widget.d.ts +5 -0
  21. package/dist/loading-widget.d.ts.map +1 -1
  22. package/dist/loading-widget.js +4 -1
  23. package/dist/loading-widget.js.map +1 -1
  24. package/dist/reset-view-widget.d.ts +9 -0
  25. package/dist/reset-view-widget.d.ts.map +1 -1
  26. package/dist/reset-view-widget.js +4 -1
  27. package/dist/reset-view-widget.js.map +1 -1
  28. package/dist/stats-widget.d.ts +18 -3
  29. package/dist/stats-widget.d.ts.map +1 -1
  30. package/dist/stats-widget.js +29 -12
  31. package/dist/stats-widget.js.map +1 -1
  32. package/dist/theme-widget.d.ts +20 -2
  33. package/dist/theme-widget.d.ts.map +1 -1
  34. package/dist/theme-widget.js +38 -14
  35. package/dist/theme-widget.js.map +1 -1
  36. package/dist/timeline-widget.d.ts +34 -3
  37. package/dist/timeline-widget.d.ts.map +1 -1
  38. package/dist/timeline-widget.js +98 -24
  39. package/dist/timeline-widget.js.map +1 -1
  40. package/dist/zoom-widget.d.ts +13 -1
  41. package/dist/zoom-widget.d.ts.map +1 -1
  42. package/dist/zoom-widget.js +7 -4
  43. package/dist/zoom-widget.js.map +1 -1
  44. package/dist.min.js +2 -2
  45. package/package.json +2 -2
  46. package/src/compass-widget.tsx +23 -3
  47. package/src/fullscreen-widget.tsx +24 -9
  48. package/src/geocoder-widget.tsx +23 -1
  49. package/src/gimbal-widget.tsx +17 -1
  50. package/src/loading-widget.tsx +11 -1
  51. package/src/reset-view-widget.tsx +15 -1
  52. package/src/stats-widget.tsx +42 -13
  53. package/src/theme-widget.tsx +56 -17
  54. package/src/timeline-widget.tsx +123 -24
  55. package/src/zoom-widget.tsx +20 -4
@@ -9,6 +9,18 @@ export type CompassWidgetProps = WidgetProps & {
9
9
  label?: string;
10
10
  /** Bearing and pitch reset transition duration in ms. */
11
11
  transitionDuration?: number;
12
+ /**
13
+ * Callback when the compass reset button is clicked.
14
+ * Called for each viewport that will be reset.
15
+ */
16
+ onReset?: (params: {
17
+ /** The view being reset */
18
+ viewId: string;
19
+ /** The new bearing value (0) */
20
+ bearing: number;
21
+ /** The new pitch value (0 if bearing was already 0) */
22
+ pitch: number;
23
+ }) => void;
12
24
  };
13
25
  export declare class CompassWidget extends Widget<CompassWidgetProps> {
14
26
  static defaultProps: Required<CompassWidgetProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"compass-widget.d.ts","sourceRoot":"","sources":["../src/compass-widget.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAyD,MAAM,eAAe,CAAC;AAC7F,OAAO,KAAK,EAAC,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAG1E,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAC7C,8DAA8D;IAC9D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAA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;QACf,gCAAgC;QAChC,OAAO,EAAE,MAAM,CAAC;QAChB,uDAAuD;QACvD,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;CACZ,CAAC;AAEF,qBAAa,aAAc,SAAQ,MAAM,CAAC,kBAAkB,CAAC;IAC3D,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAQ/C;IAEF,SAAS,SAAyB;IAClC,SAAS,EAAE,eAAe,CAAc;IACxC,SAAS,EAAE;QAAC,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAC,CAAM;gBAE7B,KAAK,GAAE,kBAAuB;IAK1C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC;IAM3C,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAoC5C,gBAAgB,CAAC,QAAQ,EAAE,QAAQ;IAQnC,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ;IAS/B,kBAAkB,CAAC,QAAQ,EAAE,QAAQ;CAqBtC"}
@@ -48,10 +48,15 @@ export class CompassWidget extends Widget {
48
48
  const viewId = this.viewId || viewport.id;
49
49
  if (viewport instanceof WebMercatorViewport) {
50
50
  const viewState = this.getViewState(viewId);
51
+ const resetPitch = this.getRotation(viewport)[0] === 0;
52
+ const nextBearing = 0;
53
+ const nextPitch = resetPitch ? 0 : viewport.pitch;
54
+ // Call callback
55
+ this.props.onReset?.({ viewId, bearing: nextBearing, pitch: nextPitch });
51
56
  const nextViewState = {
52
57
  ...viewState,
53
- bearing: 0,
54
- ...(this.getRotation(viewport)[0] === 0 ? { pitch: 0 } : {}),
58
+ bearing: nextBearing,
59
+ ...(resetPitch ? { pitch: nextPitch } : {}),
55
60
  transitionDuration: this.props.transitionDuration,
56
61
  transitionInterpolator: new FlyToInterpolator()
57
62
  };
@@ -65,6 +70,7 @@ CompassWidget.defaultProps = {
65
70
  placement: 'top-left',
66
71
  viewId: null,
67
72
  label: 'Reset Compass',
68
- transitionDuration: 200
73
+ transitionDuration: 200,
74
+ onReset: () => { }
69
75
  };
70
76
  //# sourceMappingURL=compass-widget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compass-widget.js","sourceRoot":"","sources":["../src/compass-widget.tsx"],"names":[],"mappings":";AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,MAAM,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAa9B,MAAM,OAAO,aAAc,SAAQ,MAA0B;IAc3D,YAAY,QAA4B,EAAE;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC;QALf,cAAS,GAAG,qBAAqB,CAAC;QAClC,cAAS,GAAoB,UAAU,CAAC;QACxC,cAAS,GAA6B,EAAE,CAAC;QAIvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,QAAQ,CAAC,KAAkC;QACzC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC;QACnD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;QAC1C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,WAAwB;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACnE,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAElD,MAAM,EAAE,GAAG,CACT,cAAK,SAAS,EAAC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 +659,7 @@ var __exports__ = (() => {
659
659
  ] });
660
660
  B(ui, rootElement);
661
661
  }
662
- handleZoom(viewId, nextZoom) {
662
+ handleZoom(viewId, nextZoom, delta) {
663
663
  const viewState = this.getViewState(viewId);
664
664
  if (viewState) {
665
665
  const { minZoom, maxZoom } = viewState;
@@ -670,6 +670,7 @@ var __exports__ = (() => {
670
670
  nextZoom = Math.min(maxZoom, nextZoom);
671
671
  }
672
672
  }
673
+ this.props.onZoom?.({ viewId, delta, zoom: nextZoom });
673
674
  const nextViewState = {
674
675
  ...viewState,
675
676
  zoom: nextZoom
@@ -686,14 +687,14 @@ var __exports__ = (() => {
686
687
  const viewIds = this.viewId ? [this.viewId] : this.deck?.getViews().map((v3) => v3.id) ?? [];
687
688
  for (const viewId of viewIds) {
688
689
  const viewState = this.getViewState(viewId);
689
- this.handleZoom(viewId, viewState.zoom + 1);
690
+ this.handleZoom(viewId, viewState.zoom + 1, 1);
690
691
  }
691
692
  }
692
693
  handleZoomOut() {
693
694
  const viewIds = this.viewId ? [this.viewId] : this.deck?.getViews().map((v3) => v3.id) ?? [];
694
695
  for (const viewId of viewIds) {
695
696
  const viewState = this.getViewState(viewId);
696
- this.handleZoom(viewId, viewState.zoom - 1);
697
+ this.handleZoom(viewId, viewState.zoom - 1, -1);
697
698
  }
698
699
  }
699
700
  };
@@ -705,7 +706,9 @@ var __exports__ = (() => {
705
706
  transitionDuration: 200,
706
707
  zoomInLabel: "Zoom In",
707
708
  zoomOutLabel: "Zoom Out",
708
- viewId: null
709
+ viewId: null,
710
+ onZoom: () => {
711
+ }
709
712
  };
710
713
 
711
714
  // src/reset-view-widget.tsx
@@ -748,6 +751,7 @@ var __exports__ = (() => {
748
751
  // transitionDuration: this.props.transitionDuration,
749
752
  // transitionInterpolator: new FlyToInterpolator()
750
753
  };
754
+ this.props.onReset?.({ viewId, viewState: nextViewState });
751
755
  this.setViewState(viewId, nextViewState);
752
756
  }
753
757
  }
@@ -758,7 +762,9 @@ var __exports__ = (() => {
758
762
  placement: "top-left",
759
763
  label: "Reset View",
760
764
  initialViewState: void 0,
761
- viewId: null
765
+ viewId: null,
766
+ onReset: () => {
767
+ }
762
768
  };
763
769
 
764
770
  // src/gimbal-widget.tsx
@@ -857,6 +863,7 @@ var __exports__ = (() => {
857
863
  const viewId = this.viewId || viewport?.id || "OrbitView";
858
864
  const viewState = this.getViewState(viewId);
859
865
  if ("rotationOrbit" in viewState || "rotationX" in viewState) {
866
+ this.props.onReset?.({ viewId, rotationOrbit: 0, rotationX: 0 });
860
867
  const nextViewState = {
861
868
  ...viewState,
862
869
  rotationOrbit: 0,
@@ -891,7 +898,9 @@ var __exports__ = (() => {
891
898
  viewId: null,
892
899
  label: "Gimbal",
893
900
  strokeWidth: 1.5,
894
- transitionDuration: 200
901
+ transitionDuration: 200,
902
+ onReset: () => {
903
+ }
895
904
  };
896
905
  function normalizeAndClampAngle(angle) {
897
906
  let normalized = ((angle + 180) % 360 + 360) % 360 - 180;
@@ -975,10 +984,14 @@ var __exports__ = (() => {
975
984
  const viewId = this.viewId || viewport.id;
976
985
  if (viewport instanceof import_core5.WebMercatorViewport) {
977
986
  const viewState = this.getViewState(viewId);
987
+ const resetPitch = this.getRotation(viewport)[0] === 0;
988
+ const nextBearing = 0;
989
+ const nextPitch = resetPitch ? 0 : viewport.pitch;
990
+ this.props.onReset?.({ viewId, bearing: nextBearing, pitch: nextPitch });
978
991
  const nextViewState = {
979
992
  ...viewState,
980
- bearing: 0,
981
- ...this.getRotation(viewport)[0] === 0 ? { pitch: 0 } : {},
993
+ bearing: nextBearing,
994
+ ...resetPitch ? { pitch: nextPitch } : {},
982
995
  transitionDuration: this.props.transitionDuration,
983
996
  transitionInterpolator: new import_core5.FlyToInterpolator()
984
997
  };
@@ -992,7 +1005,9 @@ var __exports__ = (() => {
992
1005
  placement: "top-left",
993
1006
  viewId: null,
994
1007
  label: "Reset Compass",
995
- transitionDuration: 200
1008
+ transitionDuration: 200,
1009
+ onReset: () => {
1010
+ }
996
1011
  };
997
1012
 
998
1013
  // src/scale-widget.tsx
@@ -1506,6 +1521,16 @@ var __exports__ = (() => {
1506
1521
  flyTo(viewState) {
1507
1522
  const viewIds = this.viewId ? [this.viewId] : this.deck?.getViews().map((v3) => v3.id) ?? [];
1508
1523
  for (const viewId of viewIds) {
1524
+ if ("longitude" in viewState && "latitude" in viewState) {
1525
+ this.props.onGeocode?.({
1526
+ viewId,
1527
+ coordinates: {
1528
+ longitude: viewState.longitude,
1529
+ latitude: viewState.latitude,
1530
+ zoom: viewState.zoom
1531
+ }
1532
+ });
1533
+ }
1509
1534
  const currentViewState = this.getViewState(viewId);
1510
1535
  const nextViewState = {
1511
1536
  ...currentViewState,
@@ -1529,7 +1554,9 @@ var __exports__ = (() => {
1529
1554
  geocoder: "coordinates",
1530
1555
  customGeocoder: CoordinatesGeocoder,
1531
1556
  apiKey: "",
1532
- _geolocation: false
1557
+ _geolocation: false,
1558
+ onGeocode: () => {
1559
+ }
1533
1560
  };
1534
1561
  function getGeocoder(props) {
1535
1562
  switch (props.geocoder) {
@@ -1568,6 +1595,7 @@ var __exports__ = (() => {
1568
1595
  document.removeEventListener("fullscreenchange", this.onFullscreenChange.bind(this));
1569
1596
  }
1570
1597
  onRenderHTML(rootElement) {
1598
+ const isFullscreen = this.getFullscreen();
1571
1599
  B(
1572
1600
  /* @__PURE__ */ u2(
1573
1601
  IconButton,
@@ -1575,8 +1603,8 @@ var __exports__ = (() => {
1575
1603
  onClick: () => {
1576
1604
  this.handleClick().catch((err) => import_core9.log.error(err)());
1577
1605
  },
1578
- label: this.fullscreen ? this.props.exitLabel : this.props.enterLabel,
1579
- className: this.fullscreen ? "deck-widget-fullscreen-exit" : "deck-widget-fullscreen-enter"
1606
+ label: isFullscreen ? this.props.exitLabel : this.props.enterLabel,
1607
+ className: isFullscreen ? "deck-widget-fullscreen-exit" : "deck-widget-fullscreen-enter"
1580
1608
  }
1581
1609
  ),
1582
1610
  rootElement
@@ -1590,21 +1618,24 @@ var __exports__ = (() => {
1590
1618
  getContainer() {
1591
1619
  return this.props.container || this.deck?.props.parent || this.deck?.getCanvas()?.parentElement;
1592
1620
  }
1621
+ getFullscreen() {
1622
+ return this.fullscreen;
1623
+ }
1593
1624
  onFullscreenChange() {
1594
- const prevFullscreen = this.fullscreen;
1595
1625
  const fullscreen = document.fullscreenElement === this.getContainer();
1596
- if (prevFullscreen !== fullscreen) {
1597
- this.fullscreen = !this.fullscreen;
1626
+ if (fullscreen !== this.fullscreen) {
1627
+ this.fullscreen = fullscreen;
1628
+ this.props.onFullscreenChange?.(fullscreen);
1629
+ this.updateHTML();
1598
1630
  }
1599
- this.updateHTML();
1600
1631
  }
1601
1632
  async handleClick() {
1602
- if (this.fullscreen) {
1633
+ const isFullscreen = this.getFullscreen();
1634
+ if (isFullscreen) {
1603
1635
  await this.exitFullscreen();
1604
1636
  } else {
1605
1637
  await this.requestFullscreen();
1606
1638
  }
1607
- this.updateHTML();
1608
1639
  }
1609
1640
  async requestFullscreen() {
1610
1641
  const container = this.getContainer();
@@ -1623,6 +1654,9 @@ var __exports__ = (() => {
1623
1654
  }
1624
1655
  togglePseudoFullscreen() {
1625
1656
  this.getContainer()?.classList.toggle("deck-pseudo-fullscreen");
1657
+ this.fullscreen = !this.fullscreen;
1658
+ this.props.onFullscreenChange?.(this.fullscreen);
1659
+ this.updateHTML();
1626
1660
  }
1627
1661
  };
1628
1662
  FullscreenWidget.defaultProps = {
@@ -1632,7 +1666,9 @@ var __exports__ = (() => {
1632
1666
  viewId: null,
1633
1667
  enterLabel: "Enter Fullscreen",
1634
1668
  exitLabel: "Exit Fullscreen",
1635
- container: void 0
1669
+ container: void 0,
1670
+ onFullscreenChange: () => {
1671
+ }
1636
1672
  };
1637
1673
 
1638
1674
  // src/splitter-widget.tsx
@@ -4429,20 +4465,27 @@ var __exports__ = (() => {
4429
4465
  this.id = "timeline";
4430
4466
  this.className = "deck-widget-timeline";
4431
4467
  this.placement = "fill";
4432
- this.playing = false;
4468
+ this._playing = false;
4433
4469
  this.timerId = null;
4434
4470
  this.handlePlayPause = () => {
4435
- if (this.playing) {
4436
- this.stop();
4437
- } else {
4438
- this.play();
4471
+ const isPlaying = this.getPlaying();
4472
+ const nextPlaying = !isPlaying;
4473
+ this.props.onPlayingChange?.(nextPlaying);
4474
+ if (this.props.playing === void 0) {
4475
+ if (nextPlaying) {
4476
+ this.play();
4477
+ } else {
4478
+ this.stop();
4479
+ }
4439
4480
  }
4440
4481
  };
4441
4482
  this.handleTimeChange = ([value]) => {
4442
- this.currentTime = value;
4443
- this.props.timeline?.setTime(value);
4444
4483
  this.props.onTimeChange(value);
4445
- this.updateHTML();
4484
+ if (this.props.time === void 0) {
4485
+ this.currentTime = value;
4486
+ this.props.timeline?.setTime(value);
4487
+ this.updateHTML();
4488
+ }
4446
4489
  };
4447
4490
  this.tick = () => {
4448
4491
  const {
@@ -4451,51 +4494,90 @@ var __exports__ = (() => {
4451
4494
  loop
4452
4495
  } = this.props;
4453
4496
  if (step > 0) {
4454
- let next = Math.round(this.currentTime / step) * step + step;
4497
+ const currentTime = this.getTime();
4498
+ let next = Math.round(currentTime / step) * step + step;
4455
4499
  if (next > max2) {
4456
- if (this.currentTime < max2) {
4500
+ if (currentTime < max2) {
4457
4501
  next = max2;
4458
4502
  } else if (loop) {
4459
4503
  next = min2;
4460
4504
  } else {
4461
4505
  next = max2;
4462
- this.playing = false;
4506
+ this._playing = false;
4507
+ this.props.onPlayingChange?.(false);
4463
4508
  }
4464
4509
  }
4465
- this.currentTime = next;
4466
4510
  this.props.onTimeChange(next);
4511
+ if (this.props.time === void 0) {
4512
+ this.currentTime = next;
4513
+ this.props.timeline?.setTime(next);
4514
+ }
4467
4515
  this.updateHTML();
4468
4516
  }
4469
- if (this.playing) {
4517
+ if (this._playing) {
4470
4518
  this.timerId = window.setTimeout(this.tick, this.props.playInterval);
4471
4519
  } else {
4472
4520
  this.timerId = null;
4473
4521
  }
4474
4522
  };
4475
4523
  this.currentTime = this.props.initialTime ?? this.props.timeRange[0];
4476
- this.props.timeline?.setTime(this.currentTime);
4524
+ const syncTime = this.props.time ?? this.currentTime;
4525
+ this.props.timeline?.setTime(syncTime);
4477
4526
  this.setProps(this.props);
4478
4527
  }
4528
+ /**
4529
+ * Returns the current time value.
4530
+ * In controlled mode, returns the time prop.
4531
+ * In uncontrolled mode, returns the internal state.
4532
+ */
4533
+ getTime() {
4534
+ return this.props.time ?? this.currentTime;
4535
+ }
4536
+ /**
4537
+ * Returns the current playing state.
4538
+ * In controlled mode, returns the playing prop.
4539
+ * In uncontrolled mode, returns the internal state.
4540
+ */
4541
+ getPlaying() {
4542
+ return this.props.playing ?? this._playing;
4543
+ }
4479
4544
  setProps(props) {
4545
+ const { playing: prevPlaying, time: prevTime } = this.props;
4480
4546
  this.viewId = props.viewId ?? this.viewId;
4481
4547
  super.setProps(props);
4548
+ if (props.time !== void 0 && props.time !== prevTime) {
4549
+ this.props.timeline?.setTime(props.time);
4550
+ }
4551
+ if (props.playing !== void 0 && props.playing !== prevPlaying) {
4552
+ if (props.playing && !this._playing) {
4553
+ this._startTimer();
4554
+ } else if (!props.playing && this._playing) {
4555
+ this._stopTimer();
4556
+ }
4557
+ }
4482
4558
  }
4483
4559
  onAdd() {
4484
- this.playing = false;
4560
+ this._playing = false;
4485
4561
  this.timerId = null;
4486
- if (this.props.autoPlay)
4487
- this.play();
4562
+ if (this.props.autoPlay) {
4563
+ if (this.props.playing !== void 0) {
4564
+ this.props.onPlayingChange?.(true);
4565
+ } else {
4566
+ this.play();
4567
+ }
4568
+ }
4488
4569
  }
4489
4570
  onRemove() {
4490
4571
  this.stop();
4491
4572
  }
4492
4573
  onRenderHTML(rootElement) {
4493
4574
  const { timeRange, step, formatLabel } = this.props;
4494
- const currentTime = this.currentTime;
4575
+ const isPlaying = this.getPlaying();
4576
+ const currentTime = this.getTime();
4495
4577
  rootElement.dataset.placement = this.props.placement;
4496
4578
  B(
4497
4579
  /* @__PURE__ */ u2("div", { className: "deck-widget-button-group", children: [
4498
- this.playing ? /* @__PURE__ */ u2(
4580
+ isPlaying ? /* @__PURE__ */ u2(
4499
4581
  IconButton,
4500
4582
  {
4501
4583
  label: "Pause",
@@ -4532,24 +4614,34 @@ var __exports__ = (() => {
4532
4614
  );
4533
4615
  }
4534
4616
  play() {
4535
- this.playing = true;
4617
+ this._playing = true;
4536
4618
  const {
4537
4619
  timeRange: [min2, max2]
4538
4620
  } = this.props;
4539
- if (this.currentTime >= max2) {
4621
+ if (this.props.time === void 0 && this.getTime() >= max2) {
4540
4622
  this.currentTime = min2;
4541
4623
  this.props.onTimeChange(min2);
4624
+ this.props.timeline?.setTime(min2);
4542
4625
  }
4543
4626
  this.updateHTML();
4544
4627
  this.tick();
4545
4628
  }
4546
4629
  stop() {
4547
- this.playing = false;
4630
+ this._stopTimer();
4631
+ this.updateHTML();
4632
+ }
4633
+ /** Start the playback timer (used internally) */
4634
+ _startTimer() {
4635
+ this._playing = true;
4636
+ this.tick();
4637
+ }
4638
+ /** Stop the playback timer (used internally) */
4639
+ _stopTimer() {
4640
+ this._playing = false;
4548
4641
  if (this.timerId !== null) {
4549
4642
  window.clearTimeout(this.timerId);
4550
4643
  this.timerId = null;
4551
4644
  }
4552
- this.updateHTML();
4553
4645
  }
4554
4646
  };
4555
4647
  TimelineWidget.defaultProps = {
@@ -4561,11 +4653,15 @@ var __exports__ = (() => {
4561
4653
  timeRange: [0, 100],
4562
4654
  step: 1,
4563
4655
  initialTime: void 0,
4656
+ time: void 0,
4564
4657
  onTimeChange: () => {
4565
4658
  },
4566
4659
  autoPlay: false,
4567
4660
  loop: false,
4568
4661
  playInterval: 1e3,
4662
+ playing: void 0,
4663
+ onPlayingChange: () => {
4664
+ },
4569
4665
  formatLabel: String
4570
4666
  };
4571
4667
 
@@ -4760,53 +4856,72 @@ var __exports__ = (() => {
4760
4856
  }
4761
4857
  // eslint-disable-next-line complexity
4762
4858
  setProps(props) {
4763
- const { lightModeTheme, darkModeTheme } = this.props;
4859
+ const { lightModeTheme, darkModeTheme, themeMode: prevThemeMode } = this.props;
4764
4860
  this.placement = props.placement ?? this.placement;
4765
4861
  this.viewId = props.viewId ?? this.viewId;
4766
4862
  super.setProps(props);
4767
- switch (this.themeMode) {
4863
+ const currentMode = this.getThemeMode();
4864
+ if (props.themeMode !== void 0 && props.themeMode !== prevThemeMode) {
4865
+ this._applyTheme(props.themeMode);
4866
+ return;
4867
+ }
4868
+ switch (currentMode) {
4768
4869
  case "light":
4769
4870
  if (props.lightModeTheme && !(0, import_core21._deepEqual)(props.lightModeTheme, lightModeTheme, 1)) {
4770
- this._setThemeMode("light");
4871
+ this._applyTheme("light");
4771
4872
  }
4772
4873
  break;
4773
4874
  case "dark":
4774
4875
  if (props.darkModeTheme && !(0, import_core21._deepEqual)(props.darkModeTheme, darkModeTheme, 1)) {
4775
- this._setThemeMode("dark");
4876
+ this._applyTheme("dark");
4776
4877
  }
4777
4878
  break;
4778
4879
  default:
4779
- import_core21.log.warn(`Invalid theme mode ${this.themeMode}`)();
4880
+ import_core21.log.warn(`Invalid theme mode ${currentMode}`)();
4780
4881
  }
4781
4882
  }
4782
4883
  onRenderHTML(rootElement) {
4783
4884
  const { lightModeLabel, darkModeLabel } = this.props;
4885
+ const currentMode = this.getThemeMode();
4784
4886
  B(
4785
4887
  /* @__PURE__ */ u2(
4786
4888
  IconButton,
4787
4889
  {
4788
4890
  onClick: this._handleClick.bind(this),
4789
- label: this.themeMode === "dark" ? darkModeLabel : lightModeLabel,
4790
- className: this.themeMode === "dark" ? "deck-widget-moon" : "deck-widget-sun"
4891
+ label: currentMode === "dark" ? darkModeLabel : lightModeLabel,
4892
+ className: currentMode === "dark" ? "deck-widget-moon" : "deck-widget-sun"
4791
4893
  }
4792
4894
  ),
4793
4895
  rootElement
4794
4896
  );
4795
4897
  }
4796
4898
  onAdd() {
4797
- this._setThemeMode(this.themeMode);
4899
+ this._applyTheme(this.getThemeMode());
4900
+ }
4901
+ /**
4902
+ * Returns the current theme mode.
4903
+ * In controlled mode, returns the themeMode prop.
4904
+ * In uncontrolled mode, returns the internal state.
4905
+ */
4906
+ getThemeMode() {
4907
+ return this.props.themeMode ?? this.themeMode;
4798
4908
  }
4799
4909
  _handleClick() {
4800
- const newThemeMode = this.themeMode === "dark" ? "light" : "dark";
4801
- this._setThemeMode(newThemeMode);
4910
+ const currentMode = this.getThemeMode();
4911
+ const nextMode = currentMode === "dark" ? "light" : "dark";
4912
+ this.props.onThemeModeChange?.(nextMode);
4913
+ if (this.props.themeMode === void 0) {
4914
+ this.themeMode = nextMode;
4915
+ this._applyTheme(nextMode);
4916
+ }
4802
4917
  }
4803
- _setThemeMode(themeMode) {
4804
- this.themeMode = themeMode;
4918
+ /** Apply theme styling without changing internal state */
4919
+ _applyTheme(themeMode) {
4805
4920
  const container = this.rootElement?.closest(".deck-widget-container");
4806
4921
  if (container) {
4807
4922
  const themeStyle = themeMode === "dark" ? this.props.darkModeTheme : this.props.lightModeTheme;
4808
4923
  (0, import_core21._applyStyles)(container, themeStyle);
4809
- const label = this.themeMode === "dark" ? this.props.darkModeLabel : this.props.lightModeLabel;
4924
+ const label = themeMode === "dark" ? this.props.darkModeLabel : this.props.lightModeLabel;
4810
4925
  import_core21.log.log(1, `Switched theme to ${label}`, themeStyle)();
4811
4926
  this.updateHTML();
4812
4927
  }
@@ -4832,7 +4947,10 @@ var __exports__ = (() => {
4832
4947
  lightModeTheme: LightGlassTheme,
4833
4948
  darkModeLabel: "Dark Mode",
4834
4949
  darkModeTheme: DarkGlassTheme,
4835
- initialThemeMode: "auto"
4950
+ initialThemeMode: "auto",
4951
+ themeMode: void 0,
4952
+ onThemeModeChange: () => {
4953
+ }
4836
4954
  };
4837
4955
 
4838
4956
  // src/loading-widget.tsx
@@ -4868,6 +4986,7 @@ var __exports__ = (() => {
4868
4986
  const loading = layers.some((layer) => !layer.isLoaded);
4869
4987
  if (loading !== this.loading) {
4870
4988
  this.loading = loading;
4989
+ this.props.onLoadingChange?.(loading);
4871
4990
  this.updateHTML();
4872
4991
  }
4873
4992
  }
@@ -4880,7 +4999,9 @@ var __exports__ = (() => {
4880
4999
  id: "loading",
4881
5000
  placement: "top-left",
4882
5001
  viewId: null,
4883
- label: "Loading layer data"
5002
+ label: "Loading layer data",
5003
+ onLoadingChange: () => {
5004
+ }
4884
5005
  };
4885
5006
 
4886
5007
  // src/stats-widget.tsx
@@ -4907,19 +5028,31 @@ var __exports__ = (() => {
4907
5028
  this.className = "deck-widget-stats";
4908
5029
  this.placement = "top-left";
4909
5030
  this._counter = 0;
4910
- this.collapsed = true;
4911
- this._toggleCollapsed = () => {
4912
- this.collapsed = !this.collapsed;
4913
- this.updateHTML();
5031
+ this._expanded = false;
5032
+ this._toggleExpanded = () => {
5033
+ const nextExpanded = !this.getExpanded();
5034
+ this.props.onExpandedChange?.(nextExpanded);
5035
+ if (this.props.expanded === void 0) {
5036
+ this._expanded = nextExpanded;
5037
+ this.updateHTML();
5038
+ }
4914
5039
  };
4915
5040
  this._getFps = () => {
4916
5041
  return Math.round(this.deck?.metrics.fps ?? 0);
4917
5042
  };
4918
5043
  this._formatters = { ...DEFAULT_FORMATTERS };
4919
5044
  this._resetOnUpdate = { ...this.props.resetOnUpdate };
4920
- this.collapsed = !props.defaultIsExpanded;
5045
+ this._expanded = Boolean(props.initialExpanded);
4921
5046
  this.setProps(props);
4922
5047
  }
5048
+ /**
5049
+ * Returns the current expanded state.
5050
+ * In controlled mode, returns the expanded prop.
5051
+ * In uncontrolled mode, returns the internal state.
5052
+ */
5053
+ getExpanded() {
5054
+ return this.props.expanded ?? this._expanded;
5055
+ }
4923
5056
  setProps(props) {
4924
5057
  this.placement = props.placement ?? this.placement;
4925
5058
  this.viewId = props.viewId ?? this.viewId;
@@ -4940,9 +5073,9 @@ var __exports__ = (() => {
4940
5073
  }
4941
5074
  }
4942
5075
  onRenderHTML(rootElement) {
4943
- const collapsed = this.collapsed;
4944
- if (collapsed) {
4945
- B(/* @__PURE__ */ u2(FpsIcon, { getFps: this._getFps, onClick: this._toggleCollapsed }), rootElement);
5076
+ const isExpanded = this.getExpanded();
5077
+ if (!isExpanded) {
5078
+ B(/* @__PURE__ */ u2(FpsIcon, { getFps: this._getFps, onClick: this._toggleExpanded }), rootElement);
4946
5079
  return;
4947
5080
  }
4948
5081
  const stats = this._getStats();
@@ -4969,7 +5102,7 @@ var __exports__ = (() => {
4969
5102
  {
4970
5103
  className: "deck-widget-stats-header",
4971
5104
  style: { cursor: "pointer", pointerEvents: "auto" },
4972
- onClick: this._toggleCollapsed,
5105
+ onClick: this._toggleExpanded,
4973
5106
  children: [
4974
5107
  /* @__PURE__ */ u2("b", { children: title }),
4975
5108
  deviceLabel && /* @__PURE__ */ u2("span", { className: "deck-widget-stats-device", children: deviceLabel }),
@@ -4983,7 +5116,7 @@ var __exports__ = (() => {
4983
5116
  );
4984
5117
  }
4985
5118
  onRedraw() {
4986
- if (!this.collapsed) {
5119
+ if (this.getExpanded()) {
4987
5120
  const framesPerUpdate = Math.max(1, this.props.framesPerUpdate || 1);
4988
5121
  if (this._counter++ % framesPerUpdate === 0) {
4989
5122
  this.updateHTML();
@@ -5036,13 +5169,16 @@ var __exports__ = (() => {
5036
5169
  type: "deck",
5037
5170
  placement: "top-left",
5038
5171
  viewId: null,
5039
- defaultIsExpanded: false,
5172
+ initialExpanded: false,
5040
5173
  stats: void 0,
5041
5174
  title: "Stats",
5042
5175
  framesPerUpdate: 1,
5043
5176
  formatters: {},
5044
5177
  resetOnUpdate: {},
5045
- id: "stats"
5178
+ id: "stats",
5179
+ expanded: void 0,
5180
+ onExpandedChange: () => {
5181
+ }
5046
5182
  };
5047
5183
  function FpsIcon({ getFps, onClick }) {
5048
5184
  const [fps, setFps] = h2(getFps());