@micromag/core 0.3.824 → 0.4.4
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 +31 -31
- package/assets/css/vendor.css +4 -3
- package/es/components.d.ts +628 -0
- package/es/components.js +947 -2301
- package/es/contexts.d.ts +297 -0
- package/es/contexts.js +154 -341
- package/es/hooks.d.ts +333 -0
- package/es/hooks.js +22 -17
- package/es/index.d.ts +665 -0
- package/es/index.js +2 -772
- package/es/styles.css +35 -0
- package/es/utils.d.ts +214 -0
- package/lib/components.js +955 -2309
- package/lib/contexts.js +153 -340
- package/lib/hooks.js +21 -16
- package/lib/index.js +0 -771
- package/lib/styles.css +35 -0
- package/package.json +39 -46
- package/styles/bootstrap-overrides.css +111 -0
- package/styles/bootstrap-patches.css +486 -0
- package/styles/breadcrumb.module.css +5 -0
- package/styles/button.module.css +82 -0
- package/styles/buttons.module.css +3 -0
- package/styles/clear.module.css +23 -0
- package/styles/collapsable-panel.module.css +31 -0
- package/styles/conversation.module.css +37 -0
- package/styles/dialog.module.css +13 -0
- package/styles/empty.module.css +22 -0
- package/styles/form-panel.module.css +3 -0
- package/styles/form.module.css +22 -0
- package/styles/link.module.css +9 -0
- package/styles/map.module.css +43 -0
- package/styles/media.module.css +3 -0
- package/styles/modal.module.css +22 -0
- package/styles/modals.module.css +12 -0
- package/styles/navbar.module.css +9 -0
- package/styles/pagination.module.css +3 -0
- package/styles/panel.module.css +3 -0
- package/styles/panels.module.css +3 -0
- package/styles/placeholder-block.module.css +29 -0
- package/styles/placeholder-text.module.css +17 -0
- package/styles/placeholders.module.css +3 -0
- package/styles/preview.module.css +34 -0
- package/styles/quiz-answer.module.css +29 -0
- package/styles/screen-placeholder.module.css +5 -0
- package/styles/screen-sizer.module.css +14 -0
- package/styles/screen.module.css +52 -0
- package/styles/screens.module.css +16 -0
- package/styles/share-options.module.css +27 -0
- package/{scss/_placeholders.scss → styles/shared.module.css} +103 -97
- package/styles/slideshow.module.css +28 -0
- package/styles/spinner.module.css +43 -0
- package/styles/styles.css +1 -0
- package/styles/survey-answer.module.css +18 -0
- package/styles/tabs.module.css +4 -0
- package/styles/theme.css +84 -0
- package/styles/transition.module.css +9 -0
- package/{scss/vendor.scss → styles/vendor.css} +16 -30
- package/styles/video-360.module.css +15 -0
- package/scss/_mixins.scss +0 -34
- package/scss/_theme.scss +0 -114
- package/scss/_variables.scss +0 -12
- package/scss/styles.scss +0 -1
- package/scss/upload.scss +0 -1
package/lib/hooks.js
CHANGED
|
@@ -228,16 +228,21 @@ function useDragProgress() {
|
|
|
228
228
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
229
229
|
direction = _useState4[0],
|
|
230
230
|
setDirection = _useState4[1];
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
231
|
+
|
|
232
|
+
// In react-spring v10, useSpring(fn) without deps stores the initial update and
|
|
233
|
+
// re-applies it via ctrl.start() in a layout effect on EVERY render, resetting the
|
|
234
|
+
// spring to its initial value. To prevent this, we pass a dummy SpringRef as `ref`
|
|
235
|
+
// in the props — when ctrl.ref is set, the layout effect queues updates instead of
|
|
236
|
+
// starting them, so our imperative api.start() calls are not overridden.
|
|
237
|
+
var imperativeRef = core$1.useSpringRef();
|
|
238
|
+
var _useSpring = core$1.useSpring(function () {
|
|
239
|
+
return _objectSpread({
|
|
240
|
+
ref: imperativeRef,
|
|
241
|
+
from: {
|
|
242
|
+
progress: wantedProgress
|
|
243
|
+
}
|
|
244
|
+
}, springParams);
|
|
245
|
+
}),
|
|
241
246
|
_useSpring2 = _slicedToArray(_useSpring, 2),
|
|
242
247
|
progress = _useSpring2[0].progress,
|
|
243
248
|
api = _useSpring2[1];
|
|
@@ -264,13 +269,13 @@ function useDragProgress() {
|
|
|
264
269
|
if (active !== dragging) {
|
|
265
270
|
setDragging(active);
|
|
266
271
|
}
|
|
267
|
-
api.start({
|
|
272
|
+
api.start(_objectSpread({
|
|
268
273
|
progress: newProgress,
|
|
269
274
|
immediate: active,
|
|
270
275
|
onResolve: !active ? function () {
|
|
271
276
|
setDirection(0);
|
|
272
277
|
} : function () {}
|
|
273
|
-
});
|
|
278
|
+
}, springParams));
|
|
274
279
|
if (onProgress !== null) {
|
|
275
280
|
onProgress(newProgress, gestureState);
|
|
276
281
|
}
|
|
@@ -286,15 +291,15 @@ function useDragProgress() {
|
|
|
286
291
|
if (!refDragging.current && wantedProgress !== refProgress.current) {
|
|
287
292
|
setDirection(wantedProgress < refProgress.current ? -1 : 1);
|
|
288
293
|
refProgress.current = wantedProgress;
|
|
289
|
-
api.start({
|
|
294
|
+
api.start(_objectSpread({
|
|
290
295
|
progress: wantedProgress,
|
|
291
|
-
immediate:
|
|
296
|
+
immediate: disabled,
|
|
292
297
|
onResolve: function onResolve() {
|
|
293
298
|
setDirection(0);
|
|
294
299
|
}
|
|
295
|
-
});
|
|
300
|
+
}, springParams));
|
|
296
301
|
}
|
|
297
|
-
}, [wantedProgress]);
|
|
302
|
+
}, [wantedProgress, disabled]);
|
|
298
303
|
var transitioning = react.useMemo(function () {
|
|
299
304
|
return wantedProgress !== progress.get() || progress.isAnimating || dragging;
|
|
300
305
|
}, [wantedProgress, progress.isAnimating, dragging]);
|