@micromag/viewer 0.4.22 → 0.4.24

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 (2) hide show
  1. package/es/index.js +7 -1
  2. package/package.json +10 -10
package/es/index.js CHANGED
@@ -21,7 +21,7 @@ import { Label, CloseIcon, ScreenPreview, Screen, ArrowIcon, Button as Button$1,
21
21
  import { getStyleFromColor, easings, getStyleFromText, getColorAsString, getDeviceScreens } from '@micromag/core/utils';
22
22
  import { ShareIncentive } from '@micromag/elements/all';
23
23
  import FocusLock from 'react-focus-lock';
24
- import { useSpring } from '@react-spring/core';
24
+ import { useSpringRef, useSpring } from '@react-spring/core';
25
25
  import Scroll from '@micromag/element-scroll';
26
26
  import ShareOptions from '@micromag/element-share-options';
27
27
  import { useGesture } from '@use-gesture/react';
@@ -600,8 +600,14 @@ function ViewerMenuDot(_ref) {
600
600
  primary = _ref2$primary === void 0 ? 'rgba(255, 255, 255, 1)' : _ref2$primary,
601
601
  _ref2$secondary = _ref2.secondary,
602
602
  secondary = _ref2$secondary === void 0 ? 'rgba(255, 255, 255, 0.25)' : _ref2$secondary;
603
+
604
+ // In react-spring v10, useSpring(fn) without deps resets the spring to its initial
605
+ // value on every render via a layout effect. Passing a dummy SpringRef as `ref`
606
+ // prevents this, so our imperative setDotSpringProps.start() calls are not overridden.
607
+ var springRef = useSpringRef();
603
608
  var _useSpring = useSpring(function () {
604
609
  return {
610
+ ref: springRef,
605
611
  scaleX: 0,
606
612
  config: {
607
613
  tension: 200,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/viewer",
3
- "version": "0.4.22",
3
+ "version": "0.4.24",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -62,14 +62,14 @@
62
62
  "dependencies": {
63
63
  "@babel/runtime": "^7.28.6",
64
64
  "@folklore/routes": "^0.2.36",
65
- "@micromag/core": "^0.4.21",
66
- "@micromag/element-badge": "^0.4.21",
67
- "@micromag/element-scroll": "^0.4.21",
68
- "@micromag/element-share-options": "^0.4.21",
69
- "@micromag/element-webview": "^0.4.21",
70
- "@micromag/elements": "^0.4.21",
71
- "@micromag/intl": "^0.4.21",
72
- "@micromag/screens": "^0.4.21",
65
+ "@micromag/core": "^0.4.23",
66
+ "@micromag/element-badge": "^0.4.23",
67
+ "@micromag/element-scroll": "^0.4.23",
68
+ "@micromag/element-share-options": "^0.4.23",
69
+ "@micromag/element-webview": "^0.4.23",
70
+ "@micromag/elements": "^0.4.23",
71
+ "@micromag/intl": "^0.4.23",
72
+ "@micromag/screens": "^0.4.24",
73
73
  "@react-spring/core": "^10.0.3",
74
74
  "@react-spring/web": "^10.0.3",
75
75
  "@use-gesture/react": "^10.3.0",
@@ -88,6 +88,6 @@
88
88
  "access": "public",
89
89
  "registry": "https://registry.npmjs.org/"
90
90
  },
91
- "gitHead": "d8ffcc5d8e966d44d658f6c281f6a14c84ee9d34",
91
+ "gitHead": "2c2fb09c153ede18f3fac877b7a5ce56e59fade2",
92
92
  "types": "es/index.d.ts"
93
93
  }