react-native-drax 0.11.0-alpha.1 → 0.11.0-alpha.2
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/build/DraxView.js
CHANGED
|
@@ -68,17 +68,17 @@ exports.DraxReanimatedView = (0, react_1.memo)((props) => {
|
|
|
68
68
|
const hoverPosition = (0, react_native_reanimated_1.useSharedValue)({ x: 0, y: 0 });
|
|
69
69
|
const updateViewProtocol = (0, useDraxProtocol_1.useDraxProtocol)(props, hoverPosition);
|
|
70
70
|
const { registerView, unregisterView } = (0, hooks_1.useDraxContext)();
|
|
71
|
-
const { onLayout, viewRef } = (0, useMeasurements_1.useMeasurements)(props);
|
|
71
|
+
const { onLayout, viewRef, measureWithHandler } = (0, useMeasurements_1.useMeasurements)(props);
|
|
72
72
|
const { combinedStyle, renderedChildren } = (0, useContent_1.useContent)({
|
|
73
73
|
draxViewProps: { ...props, hoverPosition },
|
|
74
74
|
viewRef,
|
|
75
75
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
(0, react_1.useEffect)(() => {
|
|
77
|
+
/** @todo 🪲BUG:
|
|
78
|
+
* For some reason, the Staging zone from the ColorDragDrop example loses its measurements,
|
|
79
|
+
* and we need to force refresh on them */
|
|
80
|
+
measureWithHandler?.();
|
|
81
|
+
}, [combinedStyle]);
|
|
82
82
|
(0, react_1.useEffect)(() => {
|
|
83
83
|
/** @todo 🪲BUG:
|
|
84
84
|
* Ugly hack to update hover views.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Reanimated from 'react-native-reanimated';
|
|
2
|
-
import { DraxViewProps } from '../types';
|
|
2
|
+
import { DraxViewProps, DraxViewMeasurementHandler } from '../types';
|
|
3
3
|
export declare const useMeasurements: ({ onMeasure, registration, id, parent: parentProp, scrollPosition, ...props }: DraxViewProps & {
|
|
4
4
|
id: string;
|
|
5
5
|
}) => {
|
|
6
6
|
onLayout: () => void;
|
|
7
7
|
viewRef: import("react-native-reanimated").AnimatedRef<Reanimated.View>;
|
|
8
|
+
measureWithHandler: (measurementHandler?: DraxViewMeasurementHandler) => void;
|
|
8
9
|
};
|