react-native-drax 0.10.0 → 0.10.3
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/CHANGELOG.md +25 -1
- package/build/DraxProvider.d.ts +3 -2
- package/build/DraxProvider.js +2 -2
- package/build/math.js +4 -4
- package/build/types.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,27 @@ Changes marked as (BREAKING) may break your app logic. Changes marked as (BREAKI
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
- Nothing yet
|
|
11
11
|
|
|
12
|
+
|
|
13
|
+
## [0.10.3] - 2022-09-06
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Fix clipping sizes to properly take position into account (#151) - Thank you @FrancoisDupayrat!
|
|
17
|
+
|
|
18
|
+
## [0.10.2] - 2022-06-10
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- Allow overriding style of DraxProvider (#136)
|
|
22
|
+
|
|
23
|
+
## [0.10.1] - 2022-06-10
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Bump ansi-regex from 4.1.0 to 4.1.1 (dependabot)
|
|
27
|
+
- Bump async from 2.6.3 to 2.6.4 (dependabot)
|
|
28
|
+
- Bump cross-fetch from 3.1.4 to 3.1.5 (dependabot)
|
|
29
|
+
- Bump minimist from 1.2.5 to 1.2.6 (dependabot)
|
|
30
|
+
- Bump plist from 3.0.2 to 3.0.5 (dependabot)
|
|
31
|
+
- Bump simple-plist from 1.1.1 to 1.3.1 (dependabot)
|
|
32
|
+
|
|
12
33
|
## [0.10.0] - 2022-06-10
|
|
13
34
|
|
|
14
35
|
### Changed
|
|
@@ -220,7 +241,10 @@ Changes marked as (BREAKING) may break your app logic. Changes marked as (BREAKI
|
|
|
220
241
|
|
|
221
242
|
*(More history to be added later?)*
|
|
222
243
|
|
|
223
|
-
[Unreleased]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.
|
|
244
|
+
[Unreleased]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.3...HEAD
|
|
245
|
+
[0.10.3]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.2...v0.10.3
|
|
246
|
+
[0.10.2]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.1...v0.10.2
|
|
247
|
+
[0.10.1]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.0...v0.10.1
|
|
224
248
|
[0.10.0]: https://github.com/nuclearpasta/react-native-drax/compare/v0.9.3...v0.10.0
|
|
225
249
|
[0.9.3]: https://github.com/nuclearpasta/react-native-drax/compare/v0.9.2...v0.9.3
|
|
226
250
|
[0.9.2]: https://github.com/nuclearpasta/react-native-drax/compare/v0.9.1...v0.9.2
|
package/build/DraxProvider.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
2
3
|
import { DraxProviderProps } from './types';
|
|
3
|
-
export declare const DraxProvider:
|
|
4
|
+
export declare const DraxProvider: ({ debug, style, children, }: DraxProviderProps) => JSX.Element;
|
package/build/DraxProvider.js
CHANGED
|
@@ -31,7 +31,7 @@ const hooks_1 = require("./hooks");
|
|
|
31
31
|
const DraxContext_1 = require("./DraxContext");
|
|
32
32
|
const types_1 = require("./types");
|
|
33
33
|
const math_1 = require("./math");
|
|
34
|
-
const DraxProvider = ({ debug = false, children }) => {
|
|
34
|
+
const DraxProvider = ({ debug = false, style = styles.provider, children, }) => {
|
|
35
35
|
const { getViewState, getTrackingStatus, dispatch, } = (0, hooks_1.useDraxState)();
|
|
36
36
|
const { getAbsoluteViewData, getTrackingDragged, getTrackingReceiver, getTrackingMonitorIds, getTrackingMonitors, getDragPositionData, findMonitorsAndReceiver, getHoverItems, registerView, updateViewProtocol, updateViewMeasurements, resetReceiver, resetDrag, startDrag, updateDragPosition, updateReceiver, setMonitorIds, unregisterView, } = (0, hooks_1.useDraxRegistry)(dispatch);
|
|
37
37
|
const rootNodeHandleRef = (0, react_1.useRef)(null);
|
|
@@ -629,7 +629,7 @@ const DraxProvider = ({ debug = false, children }) => {
|
|
|
629
629
|
rootNodeHandleRef.current = ref && (0, react_native_1.findNodeHandle)(ref);
|
|
630
630
|
}, []);
|
|
631
631
|
return (react_1.default.createElement(DraxContext_1.DraxContext.Provider, { value: contextValue },
|
|
632
|
-
react_1.default.createElement(react_native_1.View, { style:
|
|
632
|
+
react_1.default.createElement(react_native_1.View, { style: style, ref: setRootNodeHandleRef },
|
|
633
633
|
children,
|
|
634
634
|
react_1.default.createElement(react_native_1.View, { style: react_native_1.StyleSheet.absoluteFill, pointerEvents: "none" }, hoverViews))));
|
|
635
635
|
};
|
package/build/math.js
CHANGED
|
@@ -17,20 +17,20 @@ const clipMeasurements = (vm, cvm) => {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
if (x0 < cx0) {
|
|
20
|
-
x0 = cx0;
|
|
21
20
|
width -= cx0 - x0;
|
|
21
|
+
x0 = cx0;
|
|
22
22
|
}
|
|
23
23
|
if (x1 > cx1) {
|
|
24
|
-
x1 = cx1;
|
|
25
24
|
width -= x1 - cx1;
|
|
25
|
+
x1 = cx1;
|
|
26
26
|
}
|
|
27
27
|
if (y0 < cy0) {
|
|
28
|
-
y0 = cy0;
|
|
29
28
|
height -= cy0 - y0;
|
|
29
|
+
y0 = cy0;
|
|
30
30
|
}
|
|
31
31
|
if (y1 > cy1) {
|
|
32
|
-
y1 = cy1;
|
|
33
32
|
height -= y1 - cy1;
|
|
33
|
+
y1 = cy1;
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
36
|
width,
|
package/build/types.d.ts
CHANGED
|
@@ -463,7 +463,9 @@ export interface DraxContextValue {
|
|
|
463
463
|
}
|
|
464
464
|
/** Optional props that can be passed to a DraxProvider to modify its behavior */
|
|
465
465
|
export interface DraxProviderProps {
|
|
466
|
+
style?: StyleProp<ViewStyle>;
|
|
466
467
|
debug?: boolean;
|
|
468
|
+
children?: ReactNode;
|
|
467
469
|
}
|
|
468
470
|
/** Props that are passed to a DraxSubprovider, used internally for nesting views */
|
|
469
471
|
export interface DraxSubproviderProps {
|