diff --git a/example/test/react_test_components.dart b/example/test/react_test_components.dart index 84c179bd..e78ae6ef 100644 --- a/example/test/react_test_components.dart +++ b/example/test/react_test_components.dart @@ -129,7 +129,8 @@ class _ClockComponent extends react.Component { @override render() { - return react.span({'onClick': (event) => print('Hello World!')}, + return react.span( + {'onClick': (event) => print('Hello World!')}, // { 'onClick': (event, [domid = null]) => print("Hello World!") }, ['Seconds elapsed: ', "${state['secondsElapsed']}"]); } diff --git a/lib/react.dart b/lib/react.dart index a9f55452..91648c04 100644 --- a/lib/react.dart +++ b/lib/react.dart @@ -24,7 +24,6 @@ export 'package:react/src/react_client/event_helpers.dart'; export 'package:react/react_client/react_interop.dart' show forwardRef2, createRef, memo2; export 'package:react/src/react_client/synthetic_event_wrappers.dart' hide NonNativeDataTransfer; export 'package:react/src/react_client/synthetic_data_transfer.dart' show SyntheticDataTransfer; -export 'package:react/src/react_client/event_helpers.dart'; /// A React component declared using a function that takes in [props] and returns rendered output. /// diff --git a/test/mockito.mocks.dart b/test/mockito.mocks.dart index 709c03ae..c0eb19d3 100644 --- a/test/mockito.mocks.dart +++ b/test/mockito.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.0 from annotations +// Mocks generated by Mockito 5.4.2 from annotations // in react/test/mockito.dart. // Do not manually edit this file. @@ -61,42 +61,49 @@ class MockKeyboardEvent extends _i1.Mock implements _i2.KeyboardEvent { returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override int get charCode => (super.noSuchMethod( Invocation.getter(#charCode), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override bool get altKey => (super.noSuchMethod( Invocation.getter(#altKey), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get ctrlKey => (super.noSuchMethod( Invocation.getter(#ctrlKey), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override int get location => (super.noSuchMethod( Invocation.getter(#location), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override bool get metaKey => (super.noSuchMethod( Invocation.getter(#metaKey), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get shiftKey => (super.noSuchMethod( Invocation.getter(#shiftKey), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i2.Element get matchingTarget => (super.noSuchMethod( Invocation.getter(#matchingTarget), @@ -109,30 +116,35 @@ class MockKeyboardEvent extends _i1.Mock implements _i2.KeyboardEvent { Invocation.getter(#matchingTarget), ), ) as _i2.Element); + @override List<_i2.EventTarget> get path => (super.noSuchMethod( Invocation.getter(#path), returnValue: <_i2.EventTarget>[], returnValueForMissingStub: <_i2.EventTarget>[], ) as List<_i2.EventTarget>); + @override bool get defaultPrevented => (super.noSuchMethod( Invocation.getter(#defaultPrevented), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override int get eventPhase => (super.noSuchMethod( Invocation.getter(#eventPhase), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override String get type => (super.noSuchMethod( Invocation.getter(#type), returnValue: '', returnValueForMissingStub: '', ) as String); + @override bool getModifierState(String? keyArg) => (super.noSuchMethod( Invocation.method( @@ -142,6 +154,7 @@ class MockKeyboardEvent extends _i1.Mock implements _i2.KeyboardEvent { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override List<_i2.EventTarget> composedPath() => (super.noSuchMethod( Invocation.method( @@ -151,6 +164,7 @@ class MockKeyboardEvent extends _i1.Mock implements _i2.KeyboardEvent { returnValue: <_i2.EventTarget>[], returnValueForMissingStub: <_i2.EventTarget>[], ) as List<_i2.EventTarget>); + @override void preventDefault() => super.noSuchMethod( Invocation.method( @@ -159,6 +173,7 @@ class MockKeyboardEvent extends _i1.Mock implements _i2.KeyboardEvent { ), returnValueForMissingStub: null, ); + @override void stopImmediatePropagation() => super.noSuchMethod( Invocation.method( @@ -167,6 +182,7 @@ class MockKeyboardEvent extends _i1.Mock implements _i2.KeyboardEvent { ), returnValueForMissingStub: null, ); + @override void stopPropagation() => super.noSuchMethod( Invocation.method( @@ -189,6 +205,7 @@ class MockDataTransfer extends _i1.Mock implements _i2.DataTransfer { ), returnValueForMissingStub: null, ); + @override set effectAllowed(String? value) => super.noSuchMethod( Invocation.setter( @@ -197,6 +214,7 @@ class MockDataTransfer extends _i1.Mock implements _i2.DataTransfer { ), returnValueForMissingStub: null, ); + @override void clearData([String? format]) => super.noSuchMethod( Invocation.method( @@ -205,6 +223,7 @@ class MockDataTransfer extends _i1.Mock implements _i2.DataTransfer { ), returnValueForMissingStub: null, ); + @override String getData(String? format) => (super.noSuchMethod( Invocation.method( @@ -214,6 +233,7 @@ class MockDataTransfer extends _i1.Mock implements _i2.DataTransfer { returnValue: '', returnValueForMissingStub: '', ) as String); + @override void setData( String? format, @@ -229,6 +249,7 @@ class MockDataTransfer extends _i1.Mock implements _i2.DataTransfer { ), returnValueForMissingStub: null, ); + @override void setDragImage( _i2.Element? image, @@ -258,30 +279,35 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override int get button => (super.noSuchMethod( Invocation.getter(#button), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override bool get ctrlKey => (super.noSuchMethod( Invocation.getter(#ctrlKey), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get metaKey => (super.noSuchMethod( Invocation.getter(#metaKey), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get shiftKey => (super.noSuchMethod( Invocation.getter(#shiftKey), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override _i3.Point get client => (super.noSuchMethod( Invocation.getter(#client), @@ -294,6 +320,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { Invocation.getter(#client), ), ) as _i3.Point); + @override _i3.Point get movement => (super.noSuchMethod( Invocation.getter(#movement), @@ -306,6 +333,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { Invocation.getter(#movement), ), ) as _i3.Point); + @override _i3.Point get offset => (super.noSuchMethod( Invocation.getter(#offset), @@ -318,6 +346,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { Invocation.getter(#offset), ), ) as _i3.Point); + @override _i3.Point get screen => (super.noSuchMethod( Invocation.getter(#screen), @@ -330,6 +359,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { Invocation.getter(#screen), ), ) as _i3.Point); + @override _i3.Point get layer => (super.noSuchMethod( Invocation.getter(#layer), @@ -342,6 +372,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { Invocation.getter(#layer), ), ) as _i3.Point); + @override _i3.Point get page => (super.noSuchMethod( Invocation.getter(#page), @@ -354,6 +385,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { Invocation.getter(#page), ), ) as _i3.Point); + @override _i2.DataTransfer get dataTransfer => (super.noSuchMethod( Invocation.getter(#dataTransfer), @@ -366,6 +398,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { Invocation.getter(#dataTransfer), ), ) as _i2.DataTransfer); + @override _i2.Element get matchingTarget => (super.noSuchMethod( Invocation.getter(#matchingTarget), @@ -378,30 +411,35 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { Invocation.getter(#matchingTarget), ), ) as _i2.Element); + @override List<_i2.EventTarget> get path => (super.noSuchMethod( Invocation.getter(#path), returnValue: <_i2.EventTarget>[], returnValueForMissingStub: <_i2.EventTarget>[], ) as List<_i2.EventTarget>); + @override bool get defaultPrevented => (super.noSuchMethod( Invocation.getter(#defaultPrevented), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override int get eventPhase => (super.noSuchMethod( Invocation.getter(#eventPhase), returnValue: 0, returnValueForMissingStub: 0, ) as int); + @override String get type => (super.noSuchMethod( Invocation.getter(#type), returnValue: '', returnValueForMissingStub: '', ) as String); + @override bool getModifierState(String? keyArg) => (super.noSuchMethod( Invocation.method( @@ -411,6 +449,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override List<_i2.EventTarget> composedPath() => (super.noSuchMethod( Invocation.method( @@ -420,6 +459,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { returnValue: <_i2.EventTarget>[], returnValueForMissingStub: <_i2.EventTarget>[], ) as List<_i2.EventTarget>); + @override void preventDefault() => super.noSuchMethod( Invocation.method( @@ -428,6 +468,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { ), returnValueForMissingStub: null, ); + @override void stopImmediatePropagation() => super.noSuchMethod( Invocation.method( @@ -436,6 +477,7 @@ class MockMouseEvent extends _i1.Mock implements _i2.MouseEvent { ), returnValueForMissingStub: null, ); + @override void stopPropagation() => super.noSuchMethod( Invocation.method( @@ -456,42 +498,49 @@ class MockSyntheticEvent extends _i1.Mock implements _i4.SyntheticEvent { returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get cancelable => (super.noSuchMethod( Invocation.getter(#cancelable), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override bool get defaultPrevented => (super.noSuchMethod( Invocation.getter(#defaultPrevented), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override num get eventPhase => (super.noSuchMethod( Invocation.getter(#eventPhase), returnValue: 0, returnValueForMissingStub: 0, ) as num); + @override bool get isTrusted => (super.noSuchMethod( Invocation.getter(#isTrusted), returnValue: false, returnValueForMissingStub: false, ) as bool); + @override num get timeStamp => (super.noSuchMethod( Invocation.getter(#timeStamp), returnValue: 0, returnValueForMissingStub: 0, ) as num); + @override String get type => (super.noSuchMethod( Invocation.getter(#type), returnValue: '', returnValueForMissingStub: '', ) as String); + @override void preventDefault() => super.noSuchMethod( Invocation.method(