@micromag/core 0.4.69 → 0.4.74
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/assets/css/styles.css +0 -1
- package/assets/css/vendor.css +2 -3
- package/es/components.d.ts +99 -56
- package/es/components.js +5098 -2330
- package/es/contexts.d.ts +139 -67
- package/es/contexts.js +2183 -1240
- package/es/hooks.d.ts +29 -73
- package/es/hooks.js +2522 -2155
- package/es/index.d.ts +51 -8
- package/es/index.js +1284 -1525
- package/es/styles.css +0 -1
- package/es/utils.d.ts +157 -15
- package/es/utils.js +748 -882
- package/package.json +36 -40
- package/lib/components.js +0 -3404
- package/lib/contexts.js +0 -1763
- package/lib/hooks.js +0 -2535
- package/lib/index.js +0 -1713
- package/lib/styles.css +0 -35
- package/lib/utils.js +0 -1284
package/es/hooks.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as _react_spring_core from '@react-spring/core';
|
|
3
3
|
import * as _use_gesture_react_dist_declarations_src_types from '@use-gesture/react/dist/declarations/src/types';
|
|
4
|
+
export { useIntersectionObserver, useResizeObserver } from '@folklore/hooks';
|
|
4
5
|
|
|
5
|
-
declare function useActivityDetector({
|
|
6
|
-
element?: any;
|
|
6
|
+
declare function useActivityDetector({ disabled, timeout: timeoutDelay }?: {
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
timeout?: number;
|
|
9
9
|
}): {
|
|
@@ -43,10 +43,10 @@ declare function useDragProgress({ progress: wantedProgress, onTap, disabled, dr
|
|
|
43
43
|
direction: number;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
declare
|
|
46
|
+
declare function useForm({ fields: providedFields, injectInFields, ...opts }?: {
|
|
47
47
|
fields?: any[];
|
|
48
48
|
injectInFields?: boolean;
|
|
49
|
-
})
|
|
49
|
+
}): {
|
|
50
50
|
fields: any[];
|
|
51
51
|
status: any;
|
|
52
52
|
response: unknown;
|
|
@@ -77,7 +77,8 @@ declare const useFormTransition: (initialPaths?: any, initialStyles?: {}) => {
|
|
|
77
77
|
timeout: number;
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
declare const useFullscreen: (
|
|
80
|
+
declare const useFullscreen: () => {
|
|
81
|
+
ref: react.RefObject<any>;
|
|
81
82
|
toggle: () => void;
|
|
82
83
|
fullscreen: () => void;
|
|
83
84
|
unFullscreen: () => void;
|
|
@@ -85,12 +86,14 @@ declare const useFullscreen: (element: any) => {
|
|
|
85
86
|
enabled: any;
|
|
86
87
|
};
|
|
87
88
|
|
|
88
|
-
|
|
89
|
+
interface UseIsVisibleOptions {
|
|
90
|
+
rootMargin?: string;
|
|
89
91
|
persist?: boolean;
|
|
90
92
|
disabled?: boolean;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
}
|
|
94
|
+
declare const useIsVisible: ({ rootMargin, persist, disabled, }?: UseIsVisibleOptions) => {
|
|
95
|
+
ref: react.RefObject<HTMLElement>;
|
|
96
|
+
visible: boolean;
|
|
94
97
|
};
|
|
95
98
|
|
|
96
99
|
declare const useLoadedFonts: (fonts: any) => {
|
|
@@ -118,60 +121,31 @@ declare const useLongPress: ({ onLongPress, onLongPressStart, onLongPressEnd, on
|
|
|
118
121
|
triggered: boolean;
|
|
119
122
|
};
|
|
120
123
|
|
|
121
|
-
|
|
122
|
-
url?: any;
|
|
123
|
-
onTimeUpdate?: any;
|
|
124
|
-
onProgressStep?: any;
|
|
125
|
-
onDurationChange?: any;
|
|
126
|
-
onVolumeChange?: any;
|
|
127
|
-
onPlay?: any;
|
|
128
|
-
onPause?: any;
|
|
129
|
-
onEnded?: any;
|
|
130
|
-
onSeeked?: any;
|
|
131
|
-
onSuspend?: any;
|
|
132
|
-
onLoadStart?: any;
|
|
133
|
-
onCanPlayThough?: any;
|
|
134
|
-
onCanPlay?: any;
|
|
135
|
-
onLoadedData?: any;
|
|
136
|
-
onLoadedMetadata?: any;
|
|
137
|
-
}) => {
|
|
138
|
-
ref: react.RefObject<any>;
|
|
139
|
-
play: () => void;
|
|
140
|
-
pause: () => void;
|
|
141
|
-
stop: () => void;
|
|
142
|
-
seek: (time: any) => void;
|
|
143
|
-
currentTime: any;
|
|
144
|
-
duration: any;
|
|
145
|
-
playing: boolean;
|
|
146
|
-
paused: boolean;
|
|
147
|
-
ready: boolean;
|
|
148
|
-
dataReady: boolean;
|
|
149
|
-
suspended: boolean;
|
|
150
|
-
};
|
|
124
|
+
type MediaElement = HTMLVideoElement | HTMLAudioElement | HTMLMediaElement;
|
|
151
125
|
|
|
152
|
-
declare const useMediaBuffering: (
|
|
126
|
+
declare const useMediaBuffering: (media?: MediaElement | null) => {
|
|
153
127
|
buffering: boolean;
|
|
154
128
|
};
|
|
155
129
|
|
|
156
|
-
declare
|
|
130
|
+
declare function useMediaState(media?: MediaElement | null, { playing: wantedPlaying, muted: wantedMuted }?: {
|
|
157
131
|
playing?: boolean;
|
|
158
132
|
muted?: boolean;
|
|
159
|
-
})
|
|
133
|
+
}): {
|
|
160
134
|
playing: boolean;
|
|
161
135
|
muted: boolean;
|
|
162
136
|
buffering: boolean;
|
|
163
137
|
};
|
|
164
138
|
|
|
165
|
-
declare function useMediaCurrentTime(
|
|
139
|
+
declare function useMediaCurrentTime(media: MediaElement | null, { id, disabled, updateInterval, onUpdate: customOnUpdate }?: {
|
|
166
140
|
id?: any;
|
|
167
141
|
disabled?: boolean;
|
|
168
142
|
updateInterval?: number;
|
|
169
143
|
onUpdate?: any;
|
|
170
144
|
}): number;
|
|
171
145
|
|
|
172
|
-
declare function useMediaDuration(
|
|
146
|
+
declare function useMediaDuration(media: MediaElement | null, { id }?: {
|
|
173
147
|
id?: any;
|
|
174
|
-
}):
|
|
148
|
+
}): number;
|
|
175
149
|
|
|
176
150
|
declare function useMediaLoad(element: any, { preload, shouldLoad }?: {
|
|
177
151
|
preload?: string;
|
|
@@ -180,7 +154,7 @@ declare function useMediaLoad(element: any, { preload, shouldLoad }?: {
|
|
|
180
154
|
|
|
181
155
|
declare function useMediaProgress(media?: any, options?: any): number;
|
|
182
156
|
|
|
183
|
-
declare function useMediaReady(
|
|
157
|
+
declare function useMediaReady(media: MediaElement | null, { id }?: {
|
|
184
158
|
id?: string | null;
|
|
185
159
|
}): boolean;
|
|
186
160
|
|
|
@@ -221,36 +195,16 @@ declare const useMediasParser: () => {
|
|
|
221
195
|
parser: MediasParser;
|
|
222
196
|
};
|
|
223
197
|
|
|
224
|
-
declare function useMediaThumbnail(media: any, file?: any): any;
|
|
225
|
-
|
|
226
198
|
declare function useMediaWaveform(media: any, { fake, reduceBufferFactor }?: {
|
|
227
199
|
fake?: boolean;
|
|
228
200
|
reduceBufferFactor?: number;
|
|
229
201
|
}): any;
|
|
230
202
|
|
|
231
|
-
declare
|
|
232
|
-
|
|
233
|
-
ref: react.RefObject<any>;
|
|
234
|
-
entry: any;
|
|
235
|
-
};
|
|
236
|
-
declare const useIntersectionObserver: ({ root, rootMargin, threshold, disabled, }?: {
|
|
237
|
-
root?: any;
|
|
238
|
-
rootMargin?: string;
|
|
239
|
-
threshold?: number[];
|
|
240
|
-
disabled?: boolean;
|
|
241
|
-
}) => {
|
|
242
|
-
ref: react.RefObject<any>;
|
|
243
|
-
entry: any;
|
|
244
|
-
};
|
|
245
|
-
declare const useResizeObserver: (options?: any) => {
|
|
246
|
-
ref: react.RefObject<any>;
|
|
247
|
-
entry: any;
|
|
248
|
-
};
|
|
249
|
-
declare const useDimensionObserver: (...args: any[]) => {
|
|
250
|
-
entry: any;
|
|
203
|
+
declare function useDimensionObserver(opts?: {}): {
|
|
204
|
+
entry: ResizeObserverEntry;
|
|
251
205
|
width: any;
|
|
252
206
|
height: any;
|
|
253
|
-
ref: react.RefObject<
|
|
207
|
+
ref: react.RefObject<HTMLElement>;
|
|
254
208
|
};
|
|
255
209
|
|
|
256
210
|
declare const useParsedStory: (story: any, { disabled, withTheme, withMedias, withFonts, withMigrations, }?: {
|
|
@@ -270,15 +224,17 @@ declare function usePlaceholderStyle(selector: string, placeholderStyle: {
|
|
|
270
224
|
textAlign?: string | null;
|
|
271
225
|
}): string | null;
|
|
272
226
|
|
|
273
|
-
declare function useProgressSteps({ disabled, currentTime, duration, onStep, steps, }
|
|
227
|
+
declare function useProgressSteps({ disabled, currentTime, duration, onStep, steps, }: {
|
|
274
228
|
disabled?: boolean;
|
|
229
|
+
currentTime: any;
|
|
230
|
+
duration: any;
|
|
275
231
|
onStep?: any;
|
|
276
232
|
steps?: number[];
|
|
277
233
|
}): void;
|
|
278
234
|
|
|
279
235
|
declare const useDevicePixelRatio: () => number;
|
|
280
236
|
declare const useScreenSizeFromElement: (options?: any) => {
|
|
281
|
-
ref: react.RefObject<
|
|
237
|
+
ref: react.RefObject<HTMLElement>;
|
|
282
238
|
fullWidth: any;
|
|
283
239
|
fullHeight: any;
|
|
284
240
|
screenSize: {
|
|
@@ -336,10 +292,10 @@ declare const useThemeParser: () => (story: any) => any;
|
|
|
336
292
|
|
|
337
293
|
declare const useTrackScreenView: () => (screen?: any, index?: any) => void;
|
|
338
294
|
declare const useTrackScreenEvent: (type?: any) => (action?: any, label?: any, opts?: any) => void;
|
|
339
|
-
declare const useTrackScreenMedia: (type?:
|
|
295
|
+
declare const useTrackScreenMedia: (type?: string | null) => (media?: any, action?: any, opts?: any) => void;
|
|
340
296
|
declare const useTrackEvent: () => (category?: any, action?: any, label?: any, opts?: any) => void;
|
|
341
297
|
declare const useTrackMedia: (type?: any) => (media?: any, action?: any, opts?: any) => void;
|
|
342
298
|
|
|
343
299
|
declare const useWindowEvent: (event: any, callback: any, enabled?: boolean) => void;
|
|
344
300
|
|
|
345
|
-
export {
|
|
301
|
+
export { useActivityDetector, useAnimationFrame, useDebounced as useDebounce, useDevicePixelRatio, useDimensionObserver, useDocumentEvent, useDragProgress, useForm, useFormTransition, useFormattedDate, useFormattedTime, useFullscreen, useIsVisible, useLoadedFonts, useLongPress, useMediaBuffering, useMediaCurrentTime, useMediaDuration, useMediaLoad, useMediaProgress, useMediaReady, useMediaState, useMediaTimestampOffset, useMediaWaveform, useMediasParser, useParsedStory, usePlaceholderStyle, useProgressSteps, useScreenSizeFromElement, useScreenSizeFromWindow, useSpringValue, useSupportsWebp, useSwipe, useThemeParser, useTrackEvent, useTrackMedia, useTrackScreenEvent, useTrackScreenMedia, useTrackScreenView, useWindowEvent };
|