@micromag/core 0.3.126 → 0.3.138

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.
package/es/components.js CHANGED
@@ -1570,6 +1570,8 @@ ModalsContainer.propTypes = propTypes$v;
1570
1570
  ModalsContainer.defaultProps = defaultProps$v;
1571
1571
  var Modals = withModals(ModalsContainer);
1572
1572
 
1573
+ var styles$l = {"container":"micromag-core-modals-modal-container","center":"micromag-core-modals-modal-center","inner":"micromag-core-modals-modal-inner","top":"micromag-core-modals-modal-top"};
1574
+
1573
1575
  /* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
1574
1576
  var propTypes$u = {
1575
1577
  id: PropTypes$1.string,
@@ -1654,8 +1656,6 @@ var ModalPortal = function ModalPortal(_ref) {
1654
1656
  ModalPortal.propTypes = propTypes$t;
1655
1657
  ModalPortal.defaultProps = defaultProps$t;
1656
1658
 
1657
- var styles$l = {"container":"micromag-core-modals-modal-container","center":"micromag-core-modals-modal-center","inner":"micromag-core-modals-modal-inner","top":"micromag-core-modals-modal-top"};
1658
-
1659
1659
  var propTypes$s = {
1660
1660
  id: PropTypes$1.string,
1661
1661
  title: PropTypes$1.string,
@@ -1688,7 +1688,7 @@ var Modal = function Modal(_ref) {
1688
1688
  }, /*#__PURE__*/React.createElement("div", {
1689
1689
  className: classNames([styles$l.container, _defineProperty({}, styles$l[position], position !== null)])
1690
1690
  }, /*#__PURE__*/React.createElement("div", {
1691
- className: styles$l.inner
1691
+ className: classNames([styles$l.inner, 'bg-dark'])
1692
1692
  }, children)));
1693
1693
  };
1694
1694
 
@@ -1732,7 +1732,7 @@ var ModalDialog = function ModalDialog(_ref) {
1732
1732
  }, /*#__PURE__*/React.createElement("div", {
1733
1733
  className: "modal-content"
1734
1734
  }, header || /*#__PURE__*/React.createElement("div", {
1735
- className: classNames(['modal-header', styles$k.header, {// 'bg-dark': theme === 'dark',
1735
+ className: classNames(['modal-header', 'p-2', styles$k.header, {// 'bg-dark': theme === 'dark',
1736
1736
  // 'border-dark': theme === 'dark',
1737
1737
  // 'text-light': theme === 'dark',
1738
1738
  }])
@@ -1744,8 +1744,9 @@ var ModalDialog = function ModalDialog(_ref) {
1744
1744
  "aria-label": "Close",
1745
1745
  onClick: onClickClose
1746
1746
  })), /*#__PURE__*/React.createElement("div", {
1747
- className: classNames(['modal-body', styles$k.body, {// [`bg-${theme}`]: theme !== null,
1747
+ className: classNames(['modal-body', 'p-2', styles$k.body, {// [`bg-${theme}`]: theme !== null,
1748
1748
  // 'text-light': theme === 'dark',
1749
+ // 'bg-dark': theme === 'dark',
1749
1750
  }])
1750
1751
  }, children), footer !== null || buttons !== null ? /*#__PURE__*/React.createElement("div", {
1751
1752
  className: classNames(['modal-footer', styles$k.footer])
package/es/hooks.js CHANGED
@@ -736,6 +736,8 @@ var useMediaApi = function useMediaApi() {
736
736
  onEnded = _ref$onEnded === void 0 ? null : _ref$onEnded,
737
737
  _ref$onSeeked = _ref.onSeeked,
738
738
  onSeeked = _ref$onSeeked === void 0 ? null : _ref$onSeeked,
739
+ _ref$onSuspended = _ref.onSuspended,
740
+ onSuspended = _ref$onSuspended === void 0 ? null : _ref$onSuspended,
739
741
  _ref$onLoadStart = _ref.onLoadStart,
740
742
  onLoadStart = _ref$onLoadStart === void 0 ? null : _ref$onLoadStart,
741
743
  _ref$onCanPlayThough = _ref.onCanPlayThough,
@@ -784,6 +786,11 @@ var useMediaApi = function useMediaApi() {
784
786
  initialPlay = _useState14[0],
785
787
  setInitialPlay = _useState14[1];
786
788
 
789
+ var _useState15 = useState(false),
790
+ _useState16 = _slicedToArray(_useState15, 2),
791
+ suspended = _useState16[0],
792
+ setSuspended = _useState16[1];
793
+
787
794
  var progressStepsReached = useRef({});
788
795
  var paused = !playing; // Exposed methods
789
796
 
@@ -959,6 +966,13 @@ var useMediaApi = function useMediaApi() {
959
966
  onLoadedData();
960
967
  }
961
968
  }, [setDataReady, onLoadedData]);
969
+ var onCustomSuspended = useCallback(function () {
970
+ setSuspended(true);
971
+
972
+ if (onSuspended !== null) {
973
+ onSuspended();
974
+ }
975
+ }, [setDataReady, onLoadedData]);
962
976
  useEffect(function () {
963
977
  var _ref$current = ref.current,
964
978
  media = _ref$current === void 0 ? null : _ref$current; // console.log('actions', url);
@@ -987,7 +1001,7 @@ var useMediaApi = function useMediaApi() {
987
1001
  // media.removeEventListener('loadedmetadata', onCustomLoadedMetadata);
988
1002
  }
989
1003
  };
990
- }, [url, onCustomVolumeChange, onCustomPlay, onCustomPause, onCustomEnded, onCustomSeeked // onCustomLoadStart,
1004
+ }, [url, onCustomVolumeChange, onCustomPlay, onCustomPause, onCustomEnded, onCustomSeeked, onCustomSuspended // onCustomLoadStart,
991
1005
  // onCustomCanPlayThrough,
992
1006
  // onCustomCanPlay,
993
1007
  // onCustomLoadedMetadata,
@@ -1002,6 +1016,7 @@ var useMediaApi = function useMediaApi() {
1002
1016
  media.addEventListener('canplay', onCustomCanPlay);
1003
1017
  media.addEventListener('loadedmetadata', onCustomLoadedMetadata);
1004
1018
  media.addEventListener('loadeddata', onCustomLoadedData);
1019
+ media.addEventListener('suspend', onCustomSuspended);
1005
1020
  }
1006
1021
 
1007
1022
  return function () {
@@ -1010,9 +1025,10 @@ var useMediaApi = function useMediaApi() {
1010
1025
  media.removeEventListener('canplaythrough', onCustomCanPlayThrough);
1011
1026
  media.removeEventListener('canplay', onCustomCanPlay);
1012
1027
  media.removeEventListener('loadedmetadata', onCustomLoadedMetadata);
1028
+ media.removeEventListener('suspend', onCustomSuspended);
1013
1029
  }
1014
1030
  };
1015
- }, [url, onCustomLoadStart, onCustomCanPlayThrough, onCustomCanPlay, onCustomLoadedMetadata]); // Duration
1031
+ }, [url, onCustomLoadStart, onCustomCanPlayThrough, onCustomCanPlay, onCustomLoadedMetadata, onCustomSuspended]); // Duration
1016
1032
 
1017
1033
  useEffect(function () {
1018
1034
  var _ref$current3 = ref.current,
@@ -1075,7 +1091,8 @@ var useMediaApi = function useMediaApi() {
1075
1091
  playing: playing,
1076
1092
  paused: paused,
1077
1093
  ready: ready,
1078
- dataReady: dataReady
1094
+ dataReady: dataReady,
1095
+ suspended: suspended
1079
1096
  };
1080
1097
  };
1081
1098
 
package/lib/components.js CHANGED
@@ -1611,6 +1611,8 @@ ModalsContainer.propTypes = propTypes$v;
1611
1611
  ModalsContainer.defaultProps = defaultProps$v;
1612
1612
  var Modals = contexts.withModals(ModalsContainer);
1613
1613
 
1614
+ var styles$l = {"container":"micromag-core-modals-modal-container","center":"micromag-core-modals-modal-center","inner":"micromag-core-modals-modal-inner","top":"micromag-core-modals-modal-top"};
1615
+
1614
1616
  /* eslint-disable react/no-array-index-key, react/jsx-props-no-spreading */
1615
1617
  var propTypes$u = {
1616
1618
  id: PropTypes__default["default"].string,
@@ -1695,8 +1697,6 @@ var ModalPortal = function ModalPortal(_ref) {
1695
1697
  ModalPortal.propTypes = propTypes$t;
1696
1698
  ModalPortal.defaultProps = defaultProps$t;
1697
1699
 
1698
- var styles$l = {"container":"micromag-core-modals-modal-container","center":"micromag-core-modals-modal-center","inner":"micromag-core-modals-modal-inner","top":"micromag-core-modals-modal-top"};
1699
-
1700
1700
  var propTypes$s = {
1701
1701
  id: PropTypes__default["default"].string,
1702
1702
  title: PropTypes__default["default"].string,
@@ -1729,7 +1729,7 @@ var Modal = function Modal(_ref) {
1729
1729
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1730
1730
  className: classNames__default["default"]([styles$l.container, _defineProperty__default["default"]({}, styles$l[position], position !== null)])
1731
1731
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1732
- className: styles$l.inner
1732
+ className: classNames__default["default"]([styles$l.inner, 'bg-dark'])
1733
1733
  }, children)));
1734
1734
  };
1735
1735
 
@@ -1773,7 +1773,7 @@ var ModalDialog = function ModalDialog(_ref) {
1773
1773
  }, /*#__PURE__*/React__default["default"].createElement("div", {
1774
1774
  className: "modal-content"
1775
1775
  }, header || /*#__PURE__*/React__default["default"].createElement("div", {
1776
- className: classNames__default["default"](['modal-header', styles$k.header, {// 'bg-dark': theme === 'dark',
1776
+ className: classNames__default["default"](['modal-header', 'p-2', styles$k.header, {// 'bg-dark': theme === 'dark',
1777
1777
  // 'border-dark': theme === 'dark',
1778
1778
  // 'text-light': theme === 'dark',
1779
1779
  }])
@@ -1785,8 +1785,9 @@ var ModalDialog = function ModalDialog(_ref) {
1785
1785
  "aria-label": "Close",
1786
1786
  onClick: onClickClose
1787
1787
  })), /*#__PURE__*/React__default["default"].createElement("div", {
1788
- className: classNames__default["default"](['modal-body', styles$k.body, {// [`bg-${theme}`]: theme !== null,
1788
+ className: classNames__default["default"](['modal-body', 'p-2', styles$k.body, {// [`bg-${theme}`]: theme !== null,
1789
1789
  // 'text-light': theme === 'dark',
1790
+ // 'bg-dark': theme === 'dark',
1790
1791
  }])
1791
1792
  }, children), footer !== null || buttons !== null ? /*#__PURE__*/React__default["default"].createElement("div", {
1792
1793
  className: classNames__default["default"](['modal-footer', styles$k.footer])
package/lib/hooks.js CHANGED
@@ -772,6 +772,8 @@ var useMediaApi = function useMediaApi() {
772
772
  onEnded = _ref$onEnded === void 0 ? null : _ref$onEnded,
773
773
  _ref$onSeeked = _ref.onSeeked,
774
774
  onSeeked = _ref$onSeeked === void 0 ? null : _ref$onSeeked,
775
+ _ref$onSuspended = _ref.onSuspended,
776
+ onSuspended = _ref$onSuspended === void 0 ? null : _ref$onSuspended,
775
777
  _ref$onLoadStart = _ref.onLoadStart,
776
778
  onLoadStart = _ref$onLoadStart === void 0 ? null : _ref$onLoadStart,
777
779
  _ref$onCanPlayThough = _ref.onCanPlayThough,
@@ -820,6 +822,11 @@ var useMediaApi = function useMediaApi() {
820
822
  initialPlay = _useState14[0],
821
823
  setInitialPlay = _useState14[1];
822
824
 
825
+ var _useState15 = react.useState(false),
826
+ _useState16 = _slicedToArray__default["default"](_useState15, 2),
827
+ suspended = _useState16[0],
828
+ setSuspended = _useState16[1];
829
+
823
830
  var progressStepsReached = react.useRef({});
824
831
  var paused = !playing; // Exposed methods
825
832
 
@@ -995,6 +1002,13 @@ var useMediaApi = function useMediaApi() {
995
1002
  onLoadedData();
996
1003
  }
997
1004
  }, [setDataReady, onLoadedData]);
1005
+ var onCustomSuspended = react.useCallback(function () {
1006
+ setSuspended(true);
1007
+
1008
+ if (onSuspended !== null) {
1009
+ onSuspended();
1010
+ }
1011
+ }, [setDataReady, onLoadedData]);
998
1012
  react.useEffect(function () {
999
1013
  var _ref$current = ref.current,
1000
1014
  media = _ref$current === void 0 ? null : _ref$current; // console.log('actions', url);
@@ -1023,7 +1037,7 @@ var useMediaApi = function useMediaApi() {
1023
1037
  // media.removeEventListener('loadedmetadata', onCustomLoadedMetadata);
1024
1038
  }
1025
1039
  };
1026
- }, [url, onCustomVolumeChange, onCustomPlay, onCustomPause, onCustomEnded, onCustomSeeked // onCustomLoadStart,
1040
+ }, [url, onCustomVolumeChange, onCustomPlay, onCustomPause, onCustomEnded, onCustomSeeked, onCustomSuspended // onCustomLoadStart,
1027
1041
  // onCustomCanPlayThrough,
1028
1042
  // onCustomCanPlay,
1029
1043
  // onCustomLoadedMetadata,
@@ -1038,6 +1052,7 @@ var useMediaApi = function useMediaApi() {
1038
1052
  media.addEventListener('canplay', onCustomCanPlay);
1039
1053
  media.addEventListener('loadedmetadata', onCustomLoadedMetadata);
1040
1054
  media.addEventListener('loadeddata', onCustomLoadedData);
1055
+ media.addEventListener('suspend', onCustomSuspended);
1041
1056
  }
1042
1057
 
1043
1058
  return function () {
@@ -1046,9 +1061,10 @@ var useMediaApi = function useMediaApi() {
1046
1061
  media.removeEventListener('canplaythrough', onCustomCanPlayThrough);
1047
1062
  media.removeEventListener('canplay', onCustomCanPlay);
1048
1063
  media.removeEventListener('loadedmetadata', onCustomLoadedMetadata);
1064
+ media.removeEventListener('suspend', onCustomSuspended);
1049
1065
  }
1050
1066
  };
1051
- }, [url, onCustomLoadStart, onCustomCanPlayThrough, onCustomCanPlay, onCustomLoadedMetadata]); // Duration
1067
+ }, [url, onCustomLoadStart, onCustomCanPlayThrough, onCustomCanPlay, onCustomLoadedMetadata, onCustomSuspended]); // Duration
1052
1068
 
1053
1069
  react.useEffect(function () {
1054
1070
  var _ref$current3 = ref.current,
@@ -1111,7 +1127,8 @@ var useMediaApi = function useMediaApi() {
1111
1127
  playing: playing,
1112
1128
  paused: paused,
1113
1129
  ready: ready,
1114
- dataReady: dataReady
1130
+ dataReady: dataReady,
1131
+ suspended: suspended
1115
1132
  };
1116
1133
  };
1117
1134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/core",
3
- "version": "0.3.126",
3
+ "version": "0.3.138",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -106,7 +106,7 @@
106
106
  "@uppy/webcam": "^2.0.5",
107
107
  "@uppy/xhr-upload": "^2.0.7",
108
108
  "@use-gesture/react": "^10.2.4",
109
- "bootstrap": "^5.1.0",
109
+ "bootstrap": "5.2.0-beta1",
110
110
  "change-case": "^4.1.2",
111
111
  "classnames": "^2.2.6",
112
112
  "css-mediaquery": "^0.1.2",
@@ -132,5 +132,5 @@
132
132
  "publishConfig": {
133
133
  "access": "public"
134
134
  },
135
- "gitHead": "079203c5850c4aa771bc4fa1c567d2db1bc3ee3d"
135
+ "gitHead": "6460d58f8b915076249a11089a5f662ac11830fa"
136
136
  }