@micromag/core 0.2.371 → 0.2.384

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
@@ -3332,7 +3332,8 @@ var propTypes$9 = {
3332
3332
  onPrevious: PropTypes$1.func,
3333
3333
  onNext: PropTypes$1.func,
3334
3334
  onEnableInteraction: PropTypes$1.func,
3335
- onDisableInteraction: PropTypes$1.func
3335
+ onDisableInteraction: PropTypes$1.func,
3336
+ getMediaRef: PropTypes$1.func
3336
3337
  };
3337
3338
  var defaultProps$9 = {
3338
3339
  active: false,
@@ -3344,7 +3345,8 @@ var defaultProps$9 = {
3344
3345
  onPrevious: null,
3345
3346
  onNext: null,
3346
3347
  onEnableInteraction: null,
3347
- onDisableInteraction: null
3348
+ onDisableInteraction: null,
3349
+ getMediaRef: null
3348
3350
  };
3349
3351
 
3350
3352
  var Screen = function Screen(_ref) {
@@ -3358,7 +3360,8 @@ var Screen = function Screen(_ref) {
3358
3360
  onPrevious = _ref.onPrevious,
3359
3361
  onNext = _ref.onNext,
3360
3362
  onEnableInteraction = _ref.onEnableInteraction,
3361
- onDisableInteraction = _ref.onDisableInteraction;
3363
+ onDisableInteraction = _ref.onDisableInteraction,
3364
+ getMediaRef = _ref.getMediaRef;
3362
3365
  var type = screen.type;
3363
3366
  var CustomScreenComponent = components !== null ? getComponentFromName(type, components) || null : null;
3364
3367
  var ContextScreenComponent = useScreenComponent(type);
@@ -3374,7 +3377,8 @@ var Screen = function Screen(_ref) {
3374
3377
  onPrevious: onPrevious,
3375
3378
  onNext: onNext,
3376
3379
  onEnableInteraction: onEnableInteraction,
3377
- onDisableInteraction: onDisableInteraction
3380
+ onDisableInteraction: onDisableInteraction,
3381
+ getMediaRef: getMediaRef
3378
3382
  }))) : /*#__PURE__*/React.createElement("div", {
3379
3383
  className: className
3380
3384
  }, component));
package/es/hooks.js CHANGED
@@ -599,6 +599,16 @@ var preventDefault = function preventDefault(event) {
599
599
  return false;
600
600
  };
601
601
 
602
+ var preventClickDefault = function preventClickDefault(e) {
603
+ if (e.preventDefault) {
604
+ e.preventDefault();
605
+ }
606
+
607
+ if (e.stopPropagation) {
608
+ e.stopPropagation();
609
+ }
610
+ };
611
+
602
612
  var useLongPress = function useLongPress() {
603
613
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
604
614
  _ref$onLongPress = _ref.onLongPress,
@@ -608,7 +618,7 @@ var useLongPress = function useLongPress() {
608
618
  _ref$shouldPreventDef = _ref.shouldPreventDefault,
609
619
  shouldPreventDefault = _ref$shouldPreventDef === void 0 ? true : _ref$shouldPreventDef,
610
620
  _ref$delay = _ref.delay,
611
- delay = _ref$delay === void 0 ? 300 : _ref$delay;
621
+ delay = _ref$delay === void 0 ? 350 : _ref$delay;
612
622
 
613
623
  var _useState = useState(false),
614
624
  _useState2 = _slicedToArray(_useState, 2),
@@ -627,6 +637,9 @@ var useLongPress = function useLongPress() {
627
637
  target.current.addEventListener('touchend', preventDefault, {
628
638
  passive: false
629
639
  });
640
+ target.current.addEventListener('click', preventClickDefault, {
641
+ passive: false
642
+ });
630
643
  }
631
644
 
632
645
  if (onLongPress !== null) {
@@ -645,6 +658,9 @@ var useLongPress = function useLongPress() {
645
658
  } else if (shouldPreventDefault && target.current !== null) {
646
659
  preventDefault(event);
647
660
  target.current.removeEventListener('touchend', preventDefault);
661
+ setTimeout(function () {
662
+ target.current.removeEventListener('click', preventClickDefault);
663
+ }, 10);
648
664
  }
649
665
 
650
666
  if (shouldTriggerClick && !longPressTriggered && onClick !== null) {
package/lib/components.js CHANGED
@@ -3355,7 +3355,8 @@ var propTypes$9 = {
3355
3355
  onPrevious: PropTypes__default["default"].func,
3356
3356
  onNext: PropTypes__default["default"].func,
3357
3357
  onEnableInteraction: PropTypes__default["default"].func,
3358
- onDisableInteraction: PropTypes__default["default"].func
3358
+ onDisableInteraction: PropTypes__default["default"].func,
3359
+ getMediaRef: PropTypes__default["default"].func
3359
3360
  };
3360
3361
  var defaultProps$9 = {
3361
3362
  active: false,
@@ -3367,7 +3368,8 @@ var defaultProps$9 = {
3367
3368
  onPrevious: null,
3368
3369
  onNext: null,
3369
3370
  onEnableInteraction: null,
3370
- onDisableInteraction: null
3371
+ onDisableInteraction: null,
3372
+ getMediaRef: null
3371
3373
  };
3372
3374
 
3373
3375
  var Screen = function Screen(_ref) {
@@ -3381,7 +3383,8 @@ var Screen = function Screen(_ref) {
3381
3383
  onPrevious = _ref.onPrevious,
3382
3384
  onNext = _ref.onNext,
3383
3385
  onEnableInteraction = _ref.onEnableInteraction,
3384
- onDisableInteraction = _ref.onDisableInteraction;
3386
+ onDisableInteraction = _ref.onDisableInteraction,
3387
+ getMediaRef = _ref.getMediaRef;
3385
3388
  var type = screen.type;
3386
3389
  var CustomScreenComponent = components !== null ? utils.getComponentFromName(type, components) || null : null;
3387
3390
  var ContextScreenComponent = contexts.useScreenComponent(type);
@@ -3397,7 +3400,8 @@ var Screen = function Screen(_ref) {
3397
3400
  onPrevious: onPrevious,
3398
3401
  onNext: onNext,
3399
3402
  onEnableInteraction: onEnableInteraction,
3400
- onDisableInteraction: onDisableInteraction
3403
+ onDisableInteraction: onDisableInteraction,
3404
+ getMediaRef: getMediaRef
3401
3405
  }))) : /*#__PURE__*/React__default["default"].createElement("div", {
3402
3406
  className: className
3403
3407
  }, component));
package/lib/hooks.js CHANGED
@@ -635,6 +635,16 @@ var preventDefault = function preventDefault(event) {
635
635
  return false;
636
636
  };
637
637
 
638
+ var preventClickDefault = function preventClickDefault(e) {
639
+ if (e.preventDefault) {
640
+ e.preventDefault();
641
+ }
642
+
643
+ if (e.stopPropagation) {
644
+ e.stopPropagation();
645
+ }
646
+ };
647
+
638
648
  var useLongPress = function useLongPress() {
639
649
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
640
650
  _ref$onLongPress = _ref.onLongPress,
@@ -644,7 +654,7 @@ var useLongPress = function useLongPress() {
644
654
  _ref$shouldPreventDef = _ref.shouldPreventDefault,
645
655
  shouldPreventDefault = _ref$shouldPreventDef === void 0 ? true : _ref$shouldPreventDef,
646
656
  _ref$delay = _ref.delay,
647
- delay = _ref$delay === void 0 ? 300 : _ref$delay;
657
+ delay = _ref$delay === void 0 ? 350 : _ref$delay;
648
658
 
649
659
  var _useState = react.useState(false),
650
660
  _useState2 = _slicedToArray__default["default"](_useState, 2),
@@ -663,6 +673,9 @@ var useLongPress = function useLongPress() {
663
673
  target.current.addEventListener('touchend', preventDefault, {
664
674
  passive: false
665
675
  });
676
+ target.current.addEventListener('click', preventClickDefault, {
677
+ passive: false
678
+ });
666
679
  }
667
680
 
668
681
  if (onLongPress !== null) {
@@ -681,6 +694,9 @@ var useLongPress = function useLongPress() {
681
694
  } else if (shouldPreventDefault && target.current !== null) {
682
695
  preventDefault(event);
683
696
  target.current.removeEventListener('touchend', preventDefault);
697
+ setTimeout(function () {
698
+ target.current.removeEventListener('click', preventClickDefault);
699
+ }, 10);
684
700
  }
685
701
 
686
702
  if (shouldTriggerClick && !longPressTriggered && onClick !== null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/core",
3
- "version": "0.2.371",
3
+ "version": "0.2.384",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -36,7 +36,15 @@
36
36
  "./components": "./lib/components.js",
37
37
  "./contexts": "./lib/contexts.js",
38
38
  "./hooks": "./lib/hooks.js",
39
- "./utils": "./lib/utils.js"
39
+ "./utils": "./lib/utils.js",
40
+ "./scss/mixins": "./scss/_mixins.scss",
41
+ "./scss/placeholders": "./scss/_placeholders.scss",
42
+ "./scss/theme": "./scss/_theme.scss",
43
+ "./scss/variables": "./scss/_variables.scss",
44
+ "./scss/styles": "./scss/styles.scss",
45
+ "./scss/upload": "./scss/upload.scss",
46
+ "./scss/vendor": "./scss/vendor.scss",
47
+ "./assets/css/styles.css": "./assets/css/styles.css"
40
48
  },
41
49
  "browser": {
42
50
  ".": "./es/index.js",
@@ -117,5 +125,5 @@
117
125
  "publishConfig": {
118
126
  "access": "public"
119
127
  },
120
- "gitHead": "c0b4ada82950489dde098c81af7eb04cce86b56d"
128
+ "gitHead": "cfe309fba4ad374b6cd483e588d90ab3b76d2f5b"
121
129
  }