react-native-drax 0.10.1 → 0.10.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/CHANGELOG.md CHANGED
@@ -9,6 +9,11 @@ Changes marked as (BREAKING) may break your app logic. Changes marked as (BREAKI
9
9
  ## [Unreleased]
10
10
  - Nothing yet
11
11
 
12
+ ## [0.10.2] - 2022-06-10
13
+
14
+ ### Added
15
+ - Allow overriding style of DraxProvider (#136)
16
+
12
17
  ## [0.10.1] - 2022-06-10
13
18
 
14
19
  ### Changed
@@ -230,7 +235,8 @@ Changes marked as (BREAKING) may break your app logic. Changes marked as (BREAKI
230
235
 
231
236
  *(More history to be added later?)*
232
237
 
233
- [Unreleased]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.1...HEAD
238
+ [Unreleased]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.2...HEAD
239
+ [0.10.2]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.1...v0.10.2
234
240
  [0.10.1]: https://github.com/nuclearpasta/react-native-drax/compare/v0.10.0...v0.10.1
235
241
  [0.10.0]: https://github.com/nuclearpasta/react-native-drax/compare/v0.9.3...v0.10.0
236
242
  [0.9.3]: https://github.com/nuclearpasta/react-native-drax/compare/v0.9.2...v0.9.3
@@ -1,3 +1,4 @@
1
- import { FunctionComponent } from 'react';
1
+ /// <reference types="react" />
2
+ /// <reference types="react" />
2
3
  import { DraxProviderProps } from './types';
3
- export declare const DraxProvider: FunctionComponent<DraxProviderProps>;
4
+ export declare const DraxProvider: ({ debug, style, children, }: DraxProviderProps) => JSX.Element;
@@ -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: styles.provider, ref: setRootNodeHandleRef },
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/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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-drax",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "A drag-and-drop system for React Native",
5
5
  "repository": {
6
6
  "type": "git",