@micromag/core 0.4.21 → 0.4.25

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
@@ -39,7 +39,7 @@ import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
39
39
  import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';
40
40
  import { faPercent } from '@fortawesome/free-solid-svg-icons/faPercent';
41
41
  import { getSizeWithinBounds } from '@folklore/size';
42
- import { useSpring } from '@react-spring/core';
42
+ import { useSpringRef, useSpring } from '@react-spring/core';
43
43
  import { config, animated } from '@react-spring/web';
44
44
 
45
45
  /* eslint-disable react/jsx-props-no-spreading */
@@ -2907,8 +2907,13 @@ function Transition(_ref) {
2907
2907
  onStart = _ref$onStart === void 0 ? null : _ref$onStart,
2908
2908
  _ref$onComplete = _ref.onComplete,
2909
2909
  onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete;
2910
+ // In react-spring v10, useSpring(fn) without deps resets the spring on every render
2911
+ // via a layout effect. Passing a SpringRef prevents this reset behavior.
2912
+ var springRef = useSpringRef();
2910
2913
  var _useSpring = useSpring(function () {
2911
- return {};
2914
+ return {
2915
+ ref: springRef
2916
+ };
2912
2917
  }),
2913
2918
  _useSpring2 = _slicedToArray(_useSpring, 2),
2914
2919
  springProps = _useSpring2[0],
package/es/contexts.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
2
+ import * as React from 'react';
3
+ import React__default from 'react';
3
4
  export { RoutesContext, RoutesProvider, useRoutes, useUrlGenerator } from '@folklore/routes';
4
5
  export { TrackingContext } from '@folklore/tracking';
5
6
 
@@ -54,12 +55,14 @@ declare function ComponentsProvider({ components, manager, namespace, children,
54
55
 
55
56
  declare const ConsentContext: any;
56
57
  declare const useConsent: () => unknown;
57
- declare function ConsentProvider({ consent: providedConsent, consented: initialConsented, expiration, children, }: {
58
- consent?: string[];
59
- consented?: any;
58
+ interface ConsentProviderProps {
59
+ children: React__default.ReactNode;
60
+ consent?: Record<string, unknown>[];
61
+ consented?: boolean;
60
62
  expiration?: number;
61
- children: any;
62
- }): react_jsx_runtime.JSX.Element;
63
+ children?: React__default.ReactNode | null;
64
+ }
65
+ declare function ConsentProvider({ consent: providedConsent, consented: initialConsented, expiration, children, }: ConsentProviderProps): react_jsx_runtime.JSX.Element;
63
66
 
64
67
  declare const EditorContext: any;
65
68
  declare const useEditor: () => unknown;
@@ -163,7 +166,7 @@ declare function PanelsProvider({ children, container: initialContainer }: {
163
166
  declare const PlaybackContext: any;
164
167
  declare const usePlaybackContext: () => unknown;
165
168
  declare const usePlaybackMediaRef: (active?: boolean, background?: boolean) => {
166
- ref: react.RefObject<any>;
169
+ ref: React.RefObject<any>;
167
170
  isCurrent: boolean;
168
171
  };
169
172
  declare function PlaybackProvider({ muted: initialMuted, playing: initialPlaying, paused, controls: initialControls, controlsSuggestPlay: initialControlsSuggestPlay, controlsVisible: initialControlsVisible, controlsTheme: initialControlsTheme, currentQualityLevel: initialCurrentQualityLevel, children, }: {
package/es/contexts.js CHANGED
@@ -296,9 +296,10 @@ var ConsentContext = /*#__PURE__*/React.createContext({
296
296
  var useConsent = function useConsent() {
297
297
  return useContext(ConsentContext);
298
298
  };
299
+ var defaultValues = ['functionality_storage', 'analytics_storage', 'ad_storage', 'ad_personalization', 'ad_user_data'];
299
300
  function ConsentProvider(_ref) {
300
301
  var _ref$consent = _ref.consent,
301
- providedConsent = _ref$consent === void 0 ? ['functionality_storage', 'analytics_storage', 'ad_storage', 'ad_personalization', 'ad_user_data'] : _ref$consent,
302
+ providedConsent = _ref$consent === void 0 ? defaultValues : _ref$consent,
302
303
  _ref$consented = _ref.consented,
303
304
  initialConsented = _ref$consented === void 0 ? null : _ref$consented,
304
305
  _ref$expiration = _ref.expiration,
package/lib/components.js CHANGED
@@ -2909,8 +2909,13 @@ function Transition(_ref) {
2909
2909
  onStart = _ref$onStart === void 0 ? null : _ref$onStart,
2910
2910
  _ref$onComplete = _ref.onComplete,
2911
2911
  onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete;
2912
+ // In react-spring v10, useSpring(fn) without deps resets the spring on every render
2913
+ // via a layout effect. Passing a SpringRef prevents this reset behavior.
2914
+ var springRef = core.useSpringRef();
2912
2915
  var _useSpring = core.useSpring(function () {
2913
- return {};
2916
+ return {
2917
+ ref: springRef
2918
+ };
2914
2919
  }),
2915
2920
  _useSpring2 = _slicedToArray(_useSpring, 2),
2916
2921
  springProps = _useSpring2[0],
package/lib/contexts.js CHANGED
@@ -296,9 +296,10 @@ var ConsentContext = /*#__PURE__*/React.createContext({
296
296
  var useConsent = function useConsent() {
297
297
  return React.useContext(ConsentContext);
298
298
  };
299
+ var defaultValues = ['functionality_storage', 'analytics_storage', 'ad_storage', 'ad_personalization', 'ad_user_data'];
299
300
  function ConsentProvider(_ref) {
300
301
  var _ref$consent = _ref.consent,
301
- providedConsent = _ref$consent === void 0 ? ['functionality_storage', 'analytics_storage', 'ad_storage', 'ad_personalization', 'ad_user_data'] : _ref$consent,
302
+ providedConsent = _ref$consent === void 0 ? defaultValues : _ref$consent,
302
303
  _ref$consented = _ref.consented,
303
304
  initialConsented = _ref$consented === void 0 ? null : _ref$consented,
304
305
  _ref$expiration = _ref.expiration,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/core",
3
- "version": "0.4.21",
3
+ "version": "0.4.25",
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": "34dedbdd988f27c395b838b50dfcd0e48bfa16ee",
164
+ "gitHead": "01f62fcaf9ea405d162fdc26e36479d9f307f640",
165
165
  "types": "es/index.d.ts"
166
166
  }