@micromag/core 0.4.23 → 0.4.26
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 +10 -7
- package/es/contexts.js +2 -1
- package/es/hooks.d.ts +3 -3
- package/es/hooks.js +8 -4
- package/lib/contexts.js +2 -1
- package/lib/hooks.js +8 -4
- package/package.json +2 -2
package/es/contexts.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
interface ConsentProviderProps {
|
|
59
|
+
children: React__default.ReactNode;
|
|
60
|
+
consent?: Record<string, unknown>[];
|
|
61
|
+
consented?: boolean;
|
|
60
62
|
expiration?: number;
|
|
61
|
-
children
|
|
62
|
-
}
|
|
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:
|
|
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 ?
|
|
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/es/hooks.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ declare const useForm: ({ fields: providedFields, injectInFields, ...opts }?: {
|
|
|
54
54
|
injectInFields?: boolean;
|
|
55
55
|
}) => any;
|
|
56
56
|
|
|
57
|
-
declare const useFormTransition: (
|
|
57
|
+
declare const useFormTransition: (initialPaths?: any, initialStyles?: {}) => {
|
|
58
58
|
direction: string;
|
|
59
59
|
name: {
|
|
60
60
|
enter: string;
|
|
@@ -297,9 +297,9 @@ declare function useSpringValue(wantedProgress: any, immediate: any, params: any
|
|
|
297
297
|
|
|
298
298
|
declare function useSupportsWebp(defaultValue?: boolean): boolean;
|
|
299
299
|
|
|
300
|
-
declare const useSwipe: ({ width, items, withSpring, swipeWidthThreshold, animateScale, disabled, lockAxis, onSwipeStart, onSwipeEnd, onSwipeCancel, onTap, }?: {
|
|
300
|
+
declare const useSwipe: ({ width, items: initialItems, withSpring, swipeWidthThreshold, animateScale, disabled, lockAxis, onSwipeStart, onSwipeEnd, onSwipeCancel, onTap, }?: {
|
|
301
301
|
width?: any;
|
|
302
|
-
items?: any
|
|
302
|
+
items?: any;
|
|
303
303
|
withSpring?: boolean;
|
|
304
304
|
swipeWidthThreshold?: number;
|
|
305
305
|
animateScale?: boolean;
|
package/es/hooks.js
CHANGED
|
@@ -340,8 +340,10 @@ var useForm = function useForm() {
|
|
|
340
340
|
};
|
|
341
341
|
|
|
342
342
|
var useFormTransition = function useFormTransition() {
|
|
343
|
-
var
|
|
344
|
-
var
|
|
343
|
+
var initialPaths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
344
|
+
var initialStyles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
345
|
+
var paths = initialPaths || [];
|
|
346
|
+
var styles = initialStyles || {};
|
|
345
347
|
var lastPageRef = useRef(paths || []);
|
|
346
348
|
var direction = useMemo(function () {
|
|
347
349
|
var currentPartsCount = paths.length;
|
|
@@ -1995,7 +1997,7 @@ var useScreenSize = function useScreenSize(_ref) {
|
|
|
1995
1997
|
_ref$menuOverScreen = _ref.menuOverScreen,
|
|
1996
1998
|
menuOverScreen = _ref$menuOverScreen === void 0 ? false : _ref$menuOverScreen,
|
|
1997
1999
|
_ref$screens = _ref.screens,
|
|
1998
|
-
|
|
2000
|
+
initialScreens = _ref$screens === void 0 ? null : _ref$screens,
|
|
1999
2001
|
_ref$mediaType = _ref.mediaType,
|
|
2000
2002
|
mediaType = _ref$mediaType === void 0 ? 'screen' : _ref$mediaType,
|
|
2001
2003
|
_ref$media = _ref.media,
|
|
@@ -2003,6 +2005,7 @@ var useScreenSize = function useScreenSize(_ref) {
|
|
|
2003
2005
|
_ref$scale = _ref.scale,
|
|
2004
2006
|
scale = _ref$scale === void 0 ? null : _ref$scale;
|
|
2005
2007
|
var devicePixelRatio = useDevicePixelRatio();
|
|
2008
|
+
var screens = initialScreens || [];
|
|
2006
2009
|
var screenSize = useMemo(function () {
|
|
2007
2010
|
var media = providedMedia !== null ? providedMedia : {
|
|
2008
2011
|
type: mediaType,
|
|
@@ -2165,7 +2168,7 @@ var useSwipe = function useSwipe() {
|
|
|
2165
2168
|
_ref$width = _ref.width,
|
|
2166
2169
|
width = _ref$width === void 0 ? null : _ref$width,
|
|
2167
2170
|
_ref$items = _ref.items,
|
|
2168
|
-
|
|
2171
|
+
initialItems = _ref$items === void 0 ? null : _ref$items,
|
|
2169
2172
|
_ref$withSpring = _ref.withSpring,
|
|
2170
2173
|
withSpring = _ref$withSpring === void 0 ? true : _ref$withSpring,
|
|
2171
2174
|
_ref$swipeWidthThresh = _ref.swipeWidthThreshold,
|
|
@@ -2184,6 +2187,7 @@ var useSwipe = function useSwipe() {
|
|
|
2184
2187
|
onSwipeCancel = _ref$onSwipeCancel === void 0 ? null : _ref$onSwipeCancel,
|
|
2185
2188
|
_ref$onTap = _ref.onTap,
|
|
2186
2189
|
onTap = _ref$onTap === void 0 ? null : _ref$onTap;
|
|
2190
|
+
var items = initialItems || [];
|
|
2187
2191
|
var swipingIndex = useRef(null);
|
|
2188
2192
|
var index = useRef(0);
|
|
2189
2193
|
var lockedAxis = useRef(null);
|
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 ?
|
|
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/hooks.js
CHANGED
|
@@ -342,8 +342,10 @@ var useForm = function useForm() {
|
|
|
342
342
|
};
|
|
343
343
|
|
|
344
344
|
var useFormTransition = function useFormTransition() {
|
|
345
|
-
var
|
|
346
|
-
var
|
|
345
|
+
var initialPaths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
346
|
+
var initialStyles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
347
|
+
var paths = initialPaths || [];
|
|
348
|
+
var styles = initialStyles || {};
|
|
347
349
|
var lastPageRef = react.useRef(paths || []);
|
|
348
350
|
var direction = react.useMemo(function () {
|
|
349
351
|
var currentPartsCount = paths.length;
|
|
@@ -1997,7 +1999,7 @@ var useScreenSize = function useScreenSize(_ref) {
|
|
|
1997
1999
|
_ref$menuOverScreen = _ref.menuOverScreen,
|
|
1998
2000
|
menuOverScreen = _ref$menuOverScreen === void 0 ? false : _ref$menuOverScreen,
|
|
1999
2001
|
_ref$screens = _ref.screens,
|
|
2000
|
-
|
|
2002
|
+
initialScreens = _ref$screens === void 0 ? null : _ref$screens,
|
|
2001
2003
|
_ref$mediaType = _ref.mediaType,
|
|
2002
2004
|
mediaType = _ref$mediaType === void 0 ? 'screen' : _ref$mediaType,
|
|
2003
2005
|
_ref$media = _ref.media,
|
|
@@ -2005,6 +2007,7 @@ var useScreenSize = function useScreenSize(_ref) {
|
|
|
2005
2007
|
_ref$scale = _ref.scale,
|
|
2006
2008
|
scale = _ref$scale === void 0 ? null : _ref$scale;
|
|
2007
2009
|
var devicePixelRatio = useDevicePixelRatio();
|
|
2010
|
+
var screens = initialScreens || [];
|
|
2008
2011
|
var screenSize = react.useMemo(function () {
|
|
2009
2012
|
var media = providedMedia !== null ? providedMedia : {
|
|
2010
2013
|
type: mediaType,
|
|
@@ -2167,7 +2170,7 @@ var useSwipe = function useSwipe() {
|
|
|
2167
2170
|
_ref$width = _ref.width,
|
|
2168
2171
|
width = _ref$width === void 0 ? null : _ref$width,
|
|
2169
2172
|
_ref$items = _ref.items,
|
|
2170
|
-
|
|
2173
|
+
initialItems = _ref$items === void 0 ? null : _ref$items,
|
|
2171
2174
|
_ref$withSpring = _ref.withSpring,
|
|
2172
2175
|
withSpring = _ref$withSpring === void 0 ? true : _ref$withSpring,
|
|
2173
2176
|
_ref$swipeWidthThresh = _ref.swipeWidthThreshold,
|
|
@@ -2186,6 +2189,7 @@ var useSwipe = function useSwipe() {
|
|
|
2186
2189
|
onSwipeCancel = _ref$onSwipeCancel === void 0 ? null : _ref$onSwipeCancel,
|
|
2187
2190
|
_ref$onTap = _ref.onTap,
|
|
2188
2191
|
onTap = _ref$onTap === void 0 ? null : _ref$onTap;
|
|
2192
|
+
var items = initialItems || [];
|
|
2189
2193
|
var swipingIndex = react.useRef(null);
|
|
2190
2194
|
var index = react.useRef(0);
|
|
2191
2195
|
var lockedAxis = react.useRef(null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.26",
|
|
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": "
|
|
164
|
+
"gitHead": "dd4833b92d00633e4c6b85d3118bf5207811157e",
|
|
165
165
|
"types": "es/index.d.ts"
|
|
166
166
|
}
|