@micromag/core 0.4.55 → 0.4.60

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/contexts.d.ts CHANGED
@@ -285,13 +285,8 @@ interface FieldContextProviderProps {
285
285
  declare function FieldContextProvider({ context, children }: FieldContextProviderProps): react_jsx_runtime.JSX.Element;
286
286
 
287
287
  declare const FontsContext: any;
288
- declare const useGoogleFonts: ({ disabled, setFonts }?: {
289
- disabled?: boolean;
290
- setFonts?: any;
291
- }) => any;
292
- declare const useFonts: ({ withoutGoogleFonts }?: {
293
- withoutGoogleFonts?: boolean;
294
- }) => {
288
+ declare const useGoogleFonts: (options?: any) => any;
289
+ declare const useFonts: (options?: any) => {
295
290
  systemFonts: any;
296
291
  googleFonts: any;
297
292
  customFonts: any;
@@ -446,13 +441,7 @@ interface StoryProviderProps {
446
441
  declare function StoryProvider({ story, children }: StoryProviderProps): react_jsx_runtime.JSX.Element;
447
442
 
448
443
  declare const useTracking: () => unknown;
449
- interface TrackingProviderProps {
450
- children: React__default.ReactNode;
451
- variables?: TrackingVariables;
452
- disabled?: boolean;
453
- paused?: boolean;
454
- }
455
- declare function TrackingProvider({ variables, disabled, paused, children }: TrackingProviderProps): react_jsx_runtime.JSX.Element;
444
+ declare function TrackingProvider(options?: any): react_jsx_runtime.JSX.Element;
456
445
 
457
446
  declare const ViewerContext: any;
458
447
  declare const useViewerContext: () => unknown;
package/es/contexts.js CHANGED
@@ -640,7 +640,8 @@ var FontsContext = /*#__PURE__*/React.createContext({
640
640
  customFonts: null
641
641
  });
642
642
  var useGoogleFonts = function useGoogleFonts() {
643
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
643
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
644
+ var _ref = options || {},
644
645
  _ref$disabled = _ref.disabled,
645
646
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
646
647
  _ref$setFonts = _ref.setFonts,
@@ -680,7 +681,8 @@ var useGoogleFonts = function useGoogleFonts() {
680
681
  return googleFonts;
681
682
  };
682
683
  var useFonts = function useFonts() {
683
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
684
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
685
+ var _ref3 = options || {},
684
686
  _ref3$withoutGoogleFo = _ref3.withoutGoogleFonts,
685
687
  withoutGoogleFonts = _ref3$withoutGoogleFo === void 0 ? false : _ref3$withoutGoogleFo;
686
688
  var _useContext = useContext(FontsContext),
@@ -1389,14 +1391,17 @@ function ScreenSizeProvider(_ref) {
1389
1391
  var useTracking = function useTracking() {
1390
1392
  return useContext(TrackingContext);
1391
1393
  };
1392
- function TrackingProvider(_ref) {
1393
- var _ref$variables = _ref.variables,
1394
+ function TrackingProvider() {
1395
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1396
+ var _ref = options || {},
1397
+ _ref$variables = _ref.variables,
1394
1398
  variables = _ref$variables === void 0 ? null : _ref$variables,
1395
1399
  _ref$disabled = _ref.disabled,
1396
1400
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1397
1401
  _ref$paused = _ref.paused,
1398
1402
  paused = _ref$paused === void 0 ? false : _ref$paused,
1399
- children = _ref.children;
1403
+ _ref$children = _ref.children,
1404
+ children = _ref$children === void 0 ? null : _ref$children;
1400
1405
  var contextTracking = useTracking() || null;
1401
1406
  var refTracking = useRef(null);
1402
1407
  var tracking = useMemo(function () {
package/es/hooks.d.ts CHANGED
@@ -15,15 +15,8 @@ declare const useAnimationFrame: (onFrame: any, { disabled }?: {
15
15
  disabled?: boolean;
16
16
  }) => void;
17
17
 
18
- declare const useFormattedDate: ({ format, showToday }?: {
19
- format?: any;
20
- showToday?: boolean;
21
- }) => (date: any) => string;
22
- declare const useFormattedTime: ({ format, showNow, timeGap }?: {
23
- format?: any;
24
- showNow?: boolean;
25
- timeGap?: number;
26
- }) => (date: any) => string;
18
+ declare const useFormattedDate: (options?: any) => (date: any) => string;
19
+ declare const useFormattedTime: (options?: any) => (date: any) => string;
27
20
 
28
21
  declare const useDebounced: (handler: any, watchedValue: any, delay?: number) => void;
29
22
 
@@ -167,9 +160,7 @@ declare function useMediaLoad(element: any, { preload, shouldLoad }?: {
167
160
  shouldLoad?: boolean;
168
161
  }): void;
169
162
 
170
- declare function useMediaProgress(media: any, { disabled, ...props }?: {
171
- disabled?: boolean;
172
- }): number;
163
+ declare function useMediaProgress(media?: any, options?: any): number;
173
164
 
174
165
  declare function useMediaReady(element: any, { id }?: {
175
166
  id?: any;
@@ -220,9 +211,9 @@ declare function useMediaWaveform(media: any, { fake, reduceBufferFactor }?: {
220
211
  }): any;
221
212
 
222
213
  declare const getObserver: (Observer: any, options?: {}) => any;
223
- declare const useObserver: (Observer: any, opts?: {}, initialEntry?: {}) => {
214
+ declare const useObserver: (Observer: any, opts?: any, initialEntry?: any) => {
224
215
  ref: react.RefObject<any>;
225
- entry: {};
216
+ entry: any;
226
217
  };
227
218
  declare const useIntersectionObserver: ({ root, rootMargin, threshold, disabled, }?: {
228
219
  root?: any;
@@ -231,16 +222,14 @@ declare const useIntersectionObserver: ({ root, rootMargin, threshold, disabled,
231
222
  disabled?: boolean;
232
223
  }) => {
233
224
  ref: react.RefObject<any>;
234
- entry: {};
225
+ entry: any;
235
226
  };
236
- declare const useResizeObserver: ({ disabled }?: {
237
- disabled?: boolean;
238
- }) => {
227
+ declare const useResizeObserver: (options?: any) => {
239
228
  ref: react.RefObject<any>;
240
- entry: {};
229
+ entry: any;
241
230
  };
242
231
  declare const useDimensionObserver: (...args: any[]) => {
243
- entry: {};
232
+ entry: any;
244
233
  width: any;
245
234
  height: any;
246
235
  ref: react.RefObject<any>;
@@ -270,10 +259,7 @@ declare function useProgressSteps({ disabled, currentTime, duration, onStep, ste
270
259
  }): void;
271
260
 
272
261
  declare const useDevicePixelRatio: () => number;
273
- declare const useScreenSizeFromElement: ({ width, height, ...opts }?: {
274
- width?: any;
275
- height?: any;
276
- }) => {
262
+ declare const useScreenSizeFromElement: (options?: any) => {
277
263
  ref: react.RefObject<any>;
278
264
  fullWidth: any;
279
265
  fullHeight: any;
package/es/hooks.js CHANGED
@@ -20,8 +20,8 @@ import { useScreensManager, useFieldsManager, useTracking, useScreen } from '@mi
20
20
  import isEmpty from 'lodash/isEmpty';
21
21
  import { useWindowSize } from '@folklore/hooks';
22
22
  import { match } from 'css-mediaquery';
23
- import { useIntl } from 'react-intl';
24
23
  import dayjs from 'dayjs';
24
+ import { useIntl } from 'react-intl';
25
25
  import clamp from 'lodash/clamp';
26
26
 
27
27
  function useActivityDetector() {
@@ -120,7 +120,8 @@ var useAnimationFrame = function useAnimationFrame(onFrame) {
120
120
  };
121
121
 
122
122
  var useFormattedDate = function useFormattedDate() {
123
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
123
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
124
+ var _ref = options || {},
124
125
  _ref$format = _ref.format,
125
126
  format = _ref$format === void 0 ? null : _ref$format,
126
127
  _ref$showToday = _ref.showToday,
@@ -146,7 +147,8 @@ var useFormattedDate = function useFormattedDate() {
146
147
  }, [today, showToday, format]);
147
148
  };
148
149
  var useFormattedTime = function useFormattedTime() {
149
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
150
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
151
+ var _ref2 = options || {},
150
152
  _ref2$format = _ref2.format,
151
153
  format = _ref2$format === void 0 ? null : _ref2$format,
152
154
  _ref2$showNow = _ref2.showNow,
@@ -529,16 +531,17 @@ var getObserver = function getObserver(Observer) {
529
531
  return observers[observerKey];
530
532
  };
531
533
  var useObserver = function useObserver(Observer) {
532
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
533
- var initialEntry = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
534
- var _opts$root = opts.root,
535
- root = _opts$root === void 0 ? null : _opts$root,
536
- _opts$rootMargin = opts.rootMargin,
537
- rootMargin = _opts$rootMargin === void 0 ? null : _opts$rootMargin,
538
- _opts$threshold = opts.threshold,
539
- threshold = _opts$threshold === void 0 ? null : _opts$threshold,
540
- _opts$disabled = opts.disabled,
541
- disabled = _opts$disabled === void 0 ? false : _opts$disabled;
534
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
535
+ var initialEntry = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
536
+ var _ref3 = opts || {},
537
+ _ref3$root = _ref3.root,
538
+ root = _ref3$root === void 0 ? null : _ref3$root,
539
+ _ref3$rootMargin = _ref3.rootMargin,
540
+ rootMargin = _ref3$rootMargin === void 0 ? null : _ref3$rootMargin,
541
+ _ref3$threshold = _ref3.threshold,
542
+ threshold = _ref3$threshold === void 0 ? null : _ref3$threshold,
543
+ _ref3$disabled = _ref3.disabled,
544
+ disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
542
545
  var _useState = useState(initialEntry),
543
546
  _useState2 = _slicedToArray(_useState, 2),
544
547
  entry = _useState2[0],
@@ -607,15 +610,15 @@ var intersectionObserverInitialEntry = {
607
610
  rootBounds: null
608
611
  };
609
612
  var useIntersectionObserver = function useIntersectionObserver() {
610
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
611
- _ref3$root = _ref3.root,
612
- root = _ref3$root === void 0 ? null : _ref3$root,
613
- _ref3$rootMargin = _ref3.rootMargin,
614
- rootMargin = _ref3$rootMargin === void 0 ? '0px' : _ref3$rootMargin,
615
- _ref3$threshold = _ref3.threshold,
616
- threshold = _ref3$threshold === void 0 ? thresholdArray : _ref3$threshold,
617
- _ref3$disabled = _ref3.disabled,
618
- disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
613
+ var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
614
+ _ref4$root = _ref4.root,
615
+ root = _ref4$root === void 0 ? null : _ref4$root,
616
+ _ref4$rootMargin = _ref4.rootMargin,
617
+ rootMargin = _ref4$rootMargin === void 0 ? '0px' : _ref4$rootMargin,
618
+ _ref4$threshold = _ref4.threshold,
619
+ threshold = _ref4$threshold === void 0 ? thresholdArray : _ref4$threshold,
620
+ _ref4$disabled = _ref4.disabled,
621
+ disabled = _ref4$disabled === void 0 ? false : _ref4$disabled;
619
622
  return useObserver(typeof window !== 'undefined' ? IntersectionObserver : null, {
620
623
  root: root,
621
624
  rootMargin: rootMargin,
@@ -634,9 +637,10 @@ var resizeObserverInitialEntry = {
634
637
  borderBoxSize: null
635
638
  };
636
639
  var useResizeObserver = function useResizeObserver() {
637
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
638
- _ref4$disabled = _ref4.disabled,
639
- disabled = _ref4$disabled === void 0 ? false : _ref4$disabled;
640
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
641
+ var _ref5 = options || {},
642
+ _ref5$disabled = _ref5.disabled,
643
+ disabled = _ref5$disabled === void 0 ? false : _ref5$disabled;
640
644
  return useObserver(typeof window !== 'undefined' ? ResizeObserver : null, {
641
645
  disabled: disabled
642
646
  }, resizeObserverInitialEntry);
@@ -645,21 +649,21 @@ var useDimensionObserver = function useDimensionObserver() {
645
649
  var _useResizeObserver = useResizeObserver.apply(void 0, arguments),
646
650
  entry = _useResizeObserver.entry,
647
651
  rest = _objectWithoutProperties(_useResizeObserver, _excluded$2);
648
- var _ref5 = entry || {},
649
- _ref5$contentRect = _ref5.contentRect,
650
- contentRect = _ref5$contentRect === void 0 ? null : _ref5$contentRect,
651
- _ref5$borderBoxSize = _ref5.borderBoxSize,
652
- borderBoxSize = _ref5$borderBoxSize === void 0 ? null : _ref5$borderBoxSize;
653
- var _ref6 = contentRect || {},
654
- _ref6$width = _ref6.width,
655
- width = _ref6$width === void 0 ? 0 : _ref6$width,
656
- _ref6$height = _ref6.height,
657
- height = _ref6$height === void 0 ? 0 : _ref6$height;
658
- var _ref7 = isArray(borderBoxSize) ? borderBoxSize[0] || {} : borderBoxSize || {},
659
- _ref7$blockSize = _ref7.blockSize,
660
- blockSize = _ref7$blockSize === void 0 ? null : _ref7$blockSize,
661
- _ref7$inlineSize = _ref7.inlineSize,
662
- inlineSize = _ref7$inlineSize === void 0 ? null : _ref7$inlineSize;
652
+ var _ref6 = entry || {},
653
+ _ref6$contentRect = _ref6.contentRect,
654
+ contentRect = _ref6$contentRect === void 0 ? null : _ref6$contentRect,
655
+ _ref6$borderBoxSize = _ref6.borderBoxSize,
656
+ borderBoxSize = _ref6$borderBoxSize === void 0 ? null : _ref6$borderBoxSize;
657
+ var _ref7 = contentRect || {},
658
+ _ref7$width = _ref7.width,
659
+ width = _ref7$width === void 0 ? 0 : _ref7$width,
660
+ _ref7$height = _ref7.height,
661
+ height = _ref7$height === void 0 ? 0 : _ref7$height;
662
+ var _ref8 = isArray(borderBoxSize) ? borderBoxSize[0] || {} : borderBoxSize || {},
663
+ _ref8$blockSize = _ref8.blockSize,
664
+ blockSize = _ref8$blockSize === void 0 ? null : _ref8$blockSize,
665
+ _ref8$inlineSize = _ref8.inlineSize,
666
+ inlineSize = _ref8$inlineSize === void 0 ? null : _ref8$inlineSize;
663
667
  return _objectSpread(_objectSpread({}, rest), {}, {
664
668
  entry: entry,
665
669
  width: inlineSize || width,
@@ -1640,8 +1644,10 @@ function useMediaLoad(element) {
1640
1644
  }
1641
1645
 
1642
1646
  var _excluded$1 = ["disabled"];
1643
- function useMediaProgress(media) {
1644
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1647
+ function useMediaProgress() {
1648
+ var media = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1649
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1650
+ var _ref = options || {},
1645
1651
  _ref$disabled = _ref.disabled,
1646
1652
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1647
1653
  props = _objectWithoutProperties(_ref, _excluded$1);
@@ -2056,7 +2062,8 @@ var useScreenSize = function useScreenSize(_ref) {
2056
2062
  return screenSize;
2057
2063
  };
2058
2064
  var useScreenSizeFromElement = function useScreenSizeFromElement() {
2059
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
2065
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
2066
+ var _ref4 = options || {},
2060
2067
  _ref4$width = _ref4.width,
2061
2068
  width = _ref4$width === void 0 ? null : _ref4$width,
2062
2069
  _ref4$height = _ref4.height,
package/lib/contexts.js CHANGED
@@ -640,7 +640,8 @@ var FontsContext = /*#__PURE__*/React.createContext({
640
640
  customFonts: null
641
641
  });
642
642
  var useGoogleFonts = function useGoogleFonts() {
643
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
643
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
644
+ var _ref = options || {},
644
645
  _ref$disabled = _ref.disabled,
645
646
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
646
647
  _ref$setFonts = _ref.setFonts,
@@ -680,7 +681,8 @@ var useGoogleFonts = function useGoogleFonts() {
680
681
  return googleFonts;
681
682
  };
682
683
  var useFonts = function useFonts() {
683
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
684
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
685
+ var _ref3 = options || {},
684
686
  _ref3$withoutGoogleFo = _ref3.withoutGoogleFonts,
685
687
  withoutGoogleFonts = _ref3$withoutGoogleFo === void 0 ? false : _ref3$withoutGoogleFo;
686
688
  var _useContext = React.useContext(FontsContext),
@@ -1389,14 +1391,17 @@ function ScreenSizeProvider(_ref) {
1389
1391
  var useTracking = function useTracking() {
1390
1392
  return React.useContext(tracking.TrackingContext);
1391
1393
  };
1392
- function TrackingProvider(_ref) {
1393
- var _ref$variables = _ref.variables,
1394
+ function TrackingProvider() {
1395
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1396
+ var _ref = options || {},
1397
+ _ref$variables = _ref.variables,
1394
1398
  variables = _ref$variables === void 0 ? null : _ref$variables,
1395
1399
  _ref$disabled = _ref.disabled,
1396
1400
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1397
1401
  _ref$paused = _ref.paused,
1398
1402
  paused = _ref$paused === void 0 ? false : _ref$paused,
1399
- children = _ref.children;
1403
+ _ref$children = _ref.children,
1404
+ children = _ref$children === void 0 ? null : _ref$children;
1400
1405
  var contextTracking = useTracking() || null;
1401
1406
  var refTracking = React.useRef(null);
1402
1407
  var tracking$1 = React.useMemo(function () {
package/lib/hooks.js CHANGED
@@ -22,8 +22,8 @@ var contexts = require('@micromag/core/contexts');
22
22
  var isEmpty = require('lodash/isEmpty');
23
23
  var hooks = require('@folklore/hooks');
24
24
  var cssMediaquery = require('css-mediaquery');
25
- var reactIntl = require('react-intl');
26
25
  var dayjs = require('dayjs');
26
+ var reactIntl = require('react-intl');
27
27
  var clamp = require('lodash/clamp');
28
28
 
29
29
  function useActivityDetector() {
@@ -122,7 +122,8 @@ var useAnimationFrame = function useAnimationFrame(onFrame) {
122
122
  };
123
123
 
124
124
  var useFormattedDate = function useFormattedDate() {
125
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
125
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
126
+ var _ref = options || {},
126
127
  _ref$format = _ref.format,
127
128
  format = _ref$format === void 0 ? null : _ref$format,
128
129
  _ref$showToday = _ref.showToday,
@@ -148,7 +149,8 @@ var useFormattedDate = function useFormattedDate() {
148
149
  }, [today, showToday, format]);
149
150
  };
150
151
  var useFormattedTime = function useFormattedTime() {
151
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
152
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
153
+ var _ref2 = options || {},
152
154
  _ref2$format = _ref2.format,
153
155
  format = _ref2$format === void 0 ? null : _ref2$format,
154
156
  _ref2$showNow = _ref2.showNow,
@@ -531,16 +533,17 @@ var getObserver = function getObserver(Observer) {
531
533
  return observers[observerKey];
532
534
  };
533
535
  var useObserver = function useObserver(Observer) {
534
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
535
- var initialEntry = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
536
- var _opts$root = opts.root,
537
- root = _opts$root === void 0 ? null : _opts$root,
538
- _opts$rootMargin = opts.rootMargin,
539
- rootMargin = _opts$rootMargin === void 0 ? null : _opts$rootMargin,
540
- _opts$threshold = opts.threshold,
541
- threshold = _opts$threshold === void 0 ? null : _opts$threshold,
542
- _opts$disabled = opts.disabled,
543
- disabled = _opts$disabled === void 0 ? false : _opts$disabled;
536
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
537
+ var initialEntry = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
538
+ var _ref3 = opts || {},
539
+ _ref3$root = _ref3.root,
540
+ root = _ref3$root === void 0 ? null : _ref3$root,
541
+ _ref3$rootMargin = _ref3.rootMargin,
542
+ rootMargin = _ref3$rootMargin === void 0 ? null : _ref3$rootMargin,
543
+ _ref3$threshold = _ref3.threshold,
544
+ threshold = _ref3$threshold === void 0 ? null : _ref3$threshold,
545
+ _ref3$disabled = _ref3.disabled,
546
+ disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
544
547
  var _useState = react.useState(initialEntry),
545
548
  _useState2 = _slicedToArray(_useState, 2),
546
549
  entry = _useState2[0],
@@ -609,15 +612,15 @@ var intersectionObserverInitialEntry = {
609
612
  rootBounds: null
610
613
  };
611
614
  var useIntersectionObserver = function useIntersectionObserver() {
612
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
613
- _ref3$root = _ref3.root,
614
- root = _ref3$root === void 0 ? null : _ref3$root,
615
- _ref3$rootMargin = _ref3.rootMargin,
616
- rootMargin = _ref3$rootMargin === void 0 ? '0px' : _ref3$rootMargin,
617
- _ref3$threshold = _ref3.threshold,
618
- threshold = _ref3$threshold === void 0 ? thresholdArray : _ref3$threshold,
619
- _ref3$disabled = _ref3.disabled,
620
- disabled = _ref3$disabled === void 0 ? false : _ref3$disabled;
615
+ var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
616
+ _ref4$root = _ref4.root,
617
+ root = _ref4$root === void 0 ? null : _ref4$root,
618
+ _ref4$rootMargin = _ref4.rootMargin,
619
+ rootMargin = _ref4$rootMargin === void 0 ? '0px' : _ref4$rootMargin,
620
+ _ref4$threshold = _ref4.threshold,
621
+ threshold = _ref4$threshold === void 0 ? thresholdArray : _ref4$threshold,
622
+ _ref4$disabled = _ref4.disabled,
623
+ disabled = _ref4$disabled === void 0 ? false : _ref4$disabled;
621
624
  return useObserver(typeof window !== 'undefined' ? IntersectionObserver : null, {
622
625
  root: root,
623
626
  rootMargin: rootMargin,
@@ -636,9 +639,10 @@ var resizeObserverInitialEntry = {
636
639
  borderBoxSize: null
637
640
  };
638
641
  var useResizeObserver = function useResizeObserver() {
639
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
640
- _ref4$disabled = _ref4.disabled,
641
- disabled = _ref4$disabled === void 0 ? false : _ref4$disabled;
642
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
643
+ var _ref5 = options || {},
644
+ _ref5$disabled = _ref5.disabled,
645
+ disabled = _ref5$disabled === void 0 ? false : _ref5$disabled;
642
646
  return useObserver(typeof window !== 'undefined' ? ResizeObserver : null, {
643
647
  disabled: disabled
644
648
  }, resizeObserverInitialEntry);
@@ -647,21 +651,21 @@ var useDimensionObserver = function useDimensionObserver() {
647
651
  var _useResizeObserver = useResizeObserver.apply(void 0, arguments),
648
652
  entry = _useResizeObserver.entry,
649
653
  rest = _objectWithoutProperties(_useResizeObserver, _excluded$2);
650
- var _ref5 = entry || {},
651
- _ref5$contentRect = _ref5.contentRect,
652
- contentRect = _ref5$contentRect === void 0 ? null : _ref5$contentRect,
653
- _ref5$borderBoxSize = _ref5.borderBoxSize,
654
- borderBoxSize = _ref5$borderBoxSize === void 0 ? null : _ref5$borderBoxSize;
655
- var _ref6 = contentRect || {},
656
- _ref6$width = _ref6.width,
657
- width = _ref6$width === void 0 ? 0 : _ref6$width,
658
- _ref6$height = _ref6.height,
659
- height = _ref6$height === void 0 ? 0 : _ref6$height;
660
- var _ref7 = isArray(borderBoxSize) ? borderBoxSize[0] || {} : borderBoxSize || {},
661
- _ref7$blockSize = _ref7.blockSize,
662
- blockSize = _ref7$blockSize === void 0 ? null : _ref7$blockSize,
663
- _ref7$inlineSize = _ref7.inlineSize,
664
- inlineSize = _ref7$inlineSize === void 0 ? null : _ref7$inlineSize;
654
+ var _ref6 = entry || {},
655
+ _ref6$contentRect = _ref6.contentRect,
656
+ contentRect = _ref6$contentRect === void 0 ? null : _ref6$contentRect,
657
+ _ref6$borderBoxSize = _ref6.borderBoxSize,
658
+ borderBoxSize = _ref6$borderBoxSize === void 0 ? null : _ref6$borderBoxSize;
659
+ var _ref7 = contentRect || {},
660
+ _ref7$width = _ref7.width,
661
+ width = _ref7$width === void 0 ? 0 : _ref7$width,
662
+ _ref7$height = _ref7.height,
663
+ height = _ref7$height === void 0 ? 0 : _ref7$height;
664
+ var _ref8 = isArray(borderBoxSize) ? borderBoxSize[0] || {} : borderBoxSize || {},
665
+ _ref8$blockSize = _ref8.blockSize,
666
+ blockSize = _ref8$blockSize === void 0 ? null : _ref8$blockSize,
667
+ _ref8$inlineSize = _ref8.inlineSize,
668
+ inlineSize = _ref8$inlineSize === void 0 ? null : _ref8$inlineSize;
665
669
  return _objectSpread(_objectSpread({}, rest), {}, {
666
670
  entry: entry,
667
671
  width: inlineSize || width,
@@ -1642,8 +1646,10 @@ function useMediaLoad(element) {
1642
1646
  }
1643
1647
 
1644
1648
  var _excluded$1 = ["disabled"];
1645
- function useMediaProgress(media) {
1646
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1649
+ function useMediaProgress() {
1650
+ var media = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1651
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1652
+ var _ref = options || {},
1647
1653
  _ref$disabled = _ref.disabled,
1648
1654
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1649
1655
  props = _objectWithoutProperties(_ref, _excluded$1);
@@ -2058,7 +2064,8 @@ var useScreenSize = function useScreenSize(_ref) {
2058
2064
  return screenSize;
2059
2065
  };
2060
2066
  var useScreenSizeFromElement = function useScreenSizeFromElement() {
2061
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
2067
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
2068
+ var _ref4 = options || {},
2062
2069
  _ref4$width = _ref4.width,
2063
2070
  width = _ref4$width === void 0 ? null : _ref4$width,
2064
2071
  _ref4$height = _ref4.height,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/core",
3
- "version": "0.4.55",
3
+ "version": "0.4.60",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -161,6 +161,6 @@
161
161
  "access": "public",
162
162
  "registry": "https://registry.npmjs.org/"
163
163
  },
164
- "gitHead": "9708f0016de0cf18dcd6a6aa5bc70d7f00b86d9f",
164
+ "gitHead": "515ac855ce6094c26f37b1dbf413ee80064713e6",
165
165
  "types": "es/index.d.ts"
166
166
  }