@amazon-devices/react-native-gesture-handler 2.0.1758683737 → 2.0.1759135970

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.
@@ -37864,24 +37864,34 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
37864
37864
  var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
37865
37865
  var _Component$render;
37866
37866
  var ComponentWrapper = /*#__PURE__*/React.forwardRef(function (props, ref) {
37867
- // filter out props that should be passed to gesture handler wrapper
37868
- var gestureHandlerProps = Object.keys(props).reduce(function (res, key) {
37869
- // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
37870
- var allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
37871
- if (allowedKeys.includes(key)) {
37872
- // @ts-ignore FIXME(TS)
37873
- res[key] = props[key];
37874
- }
37875
- return res;
37876
- }, Object.assign({}, config) // watch out not to modify config
37877
- );
37867
+ // Filter out props that should be passed to gesture handler wrapper
37868
+ var _Object$keys$reduce = Object.keys(props).reduce(function (res, key) {
37869
+ // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
37870
+ var allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
37871
+ if (allowedKeys.includes(key)) {
37872
+ // @ts-ignore FIXME(TS)
37873
+ res.gestureHandlerProps[key] = props[key];
37874
+ } else {
37875
+ // @ts-ignore FIXME(TS)
37876
+ res.childProps[key] = props[key];
37877
+ }
37878
+ return res;
37879
+ }, {
37880
+ gestureHandlerProps: Object.assign({}, config),
37881
+ // Watch out not to modify config
37882
+ childProps: {
37883
+ enabled: props.enabled
37884
+ }
37885
+ }),
37886
+ gestureHandlerProps = _Object$keys$reduce.gestureHandlerProps,
37887
+ childProps = _Object$keys$reduce.childProps;
37878
37888
  var _ref = (0, _react.useRef)();
37879
37889
  var _gestureHandlerRef = (0, _react.useRef)();
37880
37890
  (0, _react.useImperativeHandle)(ref,
37881
37891
  // @ts-ignore TODO(TS) decide how nulls work in this context
37882
37892
  function () {
37883
37893
  var node = _gestureHandlerRef.current;
37884
- // add handlerTag for relations config
37894
+ // Add handlerTag for relations config
37885
37895
  if (_ref.current && node) {
37886
37896
  // @ts-ignore FIXME(TS) think about createHandler return type
37887
37897
  _ref.current.handlerTag = node.handlerTag;
@@ -37891,7 +37901,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
37891
37901
  }, [_ref, _gestureHandlerRef]);
37892
37902
  return /*#__PURE__*/React.createElement(_$$_REQUIRE(_dependencyMap[2]).NativeViewGestureHandler, _extends({}, gestureHandlerProps, {
37893
37903
  ref: _gestureHandlerRef
37894
- }), /*#__PURE__*/React.createElement(Component, _extends({}, props, {
37904
+ }), /*#__PURE__*/React.createElement(Component, _extends({}, childProps, {
37895
37905
  ref: _ref
37896
37906
  })));
37897
37907
  });
@@ -51255,24 +51265,34 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
51255
51265
  var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
51256
51266
  var _Component$render;
51257
51267
  var ComponentWrapper = /*#__PURE__*/React.forwardRef(function (props, ref) {
51258
- // filter out props that should be passed to gesture handler wrapper
51259
- var gestureHandlerProps = Object.keys(props).reduce(function (res, key) {
51260
- // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
51261
- var allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
51262
- if (allowedKeys.includes(key)) {
51263
- // @ts-ignore FIXME(TS)
51264
- res[key] = props[key];
51265
- }
51266
- return res;
51267
- }, Object.assign({}, config) // watch out not to modify config
51268
- );
51268
+ // Filter out props that should be passed to gesture handler wrapper
51269
+ var _Object$keys$reduce = Object.keys(props).reduce(function (res, key) {
51270
+ // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
51271
+ var allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
51272
+ if (allowedKeys.includes(key)) {
51273
+ // @ts-ignore FIXME(TS)
51274
+ res.gestureHandlerProps[key] = props[key];
51275
+ } else {
51276
+ // @ts-ignore FIXME(TS)
51277
+ res.childProps[key] = props[key];
51278
+ }
51279
+ return res;
51280
+ }, {
51281
+ gestureHandlerProps: Object.assign({}, config),
51282
+ // Watch out not to modify config
51283
+ childProps: {
51284
+ enabled: props.enabled
51285
+ }
51286
+ }),
51287
+ gestureHandlerProps = _Object$keys$reduce.gestureHandlerProps,
51288
+ childProps = _Object$keys$reduce.childProps;
51269
51289
  var _ref = (0, _react.useRef)();
51270
51290
  var _gestureHandlerRef = (0, _react.useRef)();
51271
51291
  (0, _react.useImperativeHandle)(ref,
51272
51292
  // @ts-ignore TODO(TS) decide how nulls work in this context
51273
51293
  function () {
51274
51294
  var node = _gestureHandlerRef.current;
51275
- // add handlerTag for relations config
51295
+ // Add handlerTag for relations config
51276
51296
  if (_ref.current && node) {
51277
51297
  // @ts-ignore FIXME(TS) think about createHandler return type
51278
51298
  _ref.current.handlerTag = node.handlerTag;
@@ -51282,7 +51302,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
51282
51302
  }, [_ref, _gestureHandlerRef]);
51283
51303
  return /*#__PURE__*/React.createElement(_$$_REQUIRE(_dependencyMap[3]).NativeViewGestureHandler, _extends({}, gestureHandlerProps, {
51284
51304
  ref: _gestureHandlerRef
51285
- }), /*#__PURE__*/React.createElement(Component, _extends({}, props, {
51305
+ }), /*#__PURE__*/React.createElement(Component, _extends({}, childProps, {
51286
51306
  ref: _ref
51287
51307
  })));
51288
51308
  });
@@ -63407,24 +63427,34 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
63407
63427
  var _Component$render;
63408
63428
  var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
63409
63429
  var ComponentWrapper = React.forwardRef(function (props, ref) {
63410
- // filter out props that should be passed to gesture handler wrapper
63411
- var gestureHandlerProps = Object.keys(props).reduce(function (res, key) {
63412
- // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
63413
- var allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
63414
- if (allowedKeys.includes(key)) {
63415
- // @ts-ignore FIXME(TS)
63416
- res[key] = props[key];
63417
- }
63418
- return res;
63419
- }, Object.assign({}, config) // watch out not to modify config
63420
- );
63430
+ // Filter out props that should be passed to gesture handler wrapper
63431
+ var _Object$keys$reduce = Object.keys(props).reduce(function (res, key) {
63432
+ // TS being overly protective with it's types, see https://github.com/microsoft/TypeScript/issues/26255#issuecomment-458013731 for more info
63433
+ var allowedKeys = NATIVE_WRAPPER_PROPS_FILTER;
63434
+ if (allowedKeys.includes(key)) {
63435
+ // @ts-ignore FIXME(TS)
63436
+ res.gestureHandlerProps[key] = props[key];
63437
+ } else {
63438
+ // @ts-ignore FIXME(TS)
63439
+ res.childProps[key] = props[key];
63440
+ }
63441
+ return res;
63442
+ }, {
63443
+ gestureHandlerProps: Object.assign({}, config),
63444
+ // Watch out not to modify config
63445
+ childProps: {
63446
+ enabled: props.enabled
63447
+ }
63448
+ }),
63449
+ gestureHandlerProps = _Object$keys$reduce.gestureHandlerProps,
63450
+ childProps = _Object$keys$reduce.childProps;
63421
63451
  var _ref = (0, _react.useRef)();
63422
63452
  var _gestureHandlerRef = (0, _react.useRef)();
63423
63453
  (0, _react.useImperativeHandle)(ref,
63424
63454
  // @ts-ignore TODO(TS) decide how nulls work in this context
63425
63455
  function () {
63426
63456
  var node = _gestureHandlerRef.current;
63427
- // add handlerTag for relations config
63457
+ // Add handlerTag for relations config
63428
63458
  if (_ref.current && node) {
63429
63459
  // @ts-ignore FIXME(TS) think about createHandler return type
63430
63460
  _ref.current.handlerTag = node.handlerTag;
@@ -63434,7 +63464,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
63434
63464
  }, [_ref, _gestureHandlerRef]);
63435
63465
  return /*#__PURE__*/(0, _$$_REQUIRE(_dependencyMap[4]).jsx)(_$$_REQUIRE(_dependencyMap[3]).NativeViewGestureHandler, Object.assign({}, gestureHandlerProps, {
63436
63466
  ref: _gestureHandlerRef,
63437
- children: /*#__PURE__*/(0, _$$_REQUIRE(_dependencyMap[4]).jsx)(Component, Object.assign({}, props, {
63467
+ children: /*#__PURE__*/(0, _$$_REQUIRE(_dependencyMap[4]).jsx)(Component, Object.assign({}, childProps, {
63438
63468
  ref: _ref
63439
63469
  }))
63440
63470
  }));