react-dom
Advanced tools
Comparing version 0.0.0-experimental-71d16750c-20211202 to 0.0.0-experimental-720de7f81a-20241220
@@ -1,5 +0,6 @@ | ||
/** @license React vundefined | ||
/** | ||
* @license React | ||
* react-dom-test-utils.development.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -16,3 +17,2 @@ * This source code is licensed under the MIT license found in the | ||
var _assign = require('object-assign'); | ||
var React = require('react'); | ||
@@ -96,52 +96,8 @@ var ReactDOM = require('react-dom'); | ||
var HostText = 6; | ||
var HostHoistable = 26; | ||
var HostSingleton = 27; | ||
// ATTENTION | ||
// When adding new symbols to this file, | ||
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
// nor polyfill, then a plain number is used for performance. | ||
var REACT_ELEMENT_TYPE = 0xeac7; | ||
var REACT_PORTAL_TYPE = 0xeaca; | ||
var REACT_FRAGMENT_TYPE = 0xeacb; | ||
var REACT_STRICT_MODE_TYPE = 0xeacc; | ||
var REACT_PROFILER_TYPE = 0xead2; | ||
var REACT_PROVIDER_TYPE = 0xeacd; | ||
var REACT_CONTEXT_TYPE = 0xeace; | ||
var REACT_FORWARD_REF_TYPE = 0xead0; | ||
var REACT_SUSPENSE_TYPE = 0xead1; | ||
var REACT_SUSPENSE_LIST_TYPE = 0xead8; | ||
var REACT_MEMO_TYPE = 0xead3; | ||
var REACT_LAZY_TYPE = 0xead4; | ||
var REACT_SCOPE_TYPE = 0xead7; | ||
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; | ||
var REACT_OFFSCREEN_TYPE = 0xeae2; | ||
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; | ||
var REACT_CACHE_TYPE = 0xeae4; | ||
if (typeof Symbol === 'function' && Symbol.for) { | ||
var symbolFor = Symbol.for; | ||
REACT_ELEMENT_TYPE = symbolFor('react.element'); | ||
REACT_PORTAL_TYPE = symbolFor('react.portal'); | ||
REACT_FRAGMENT_TYPE = symbolFor('react.fragment'); | ||
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); | ||
REACT_PROFILER_TYPE = symbolFor('react.profiler'); | ||
REACT_PROVIDER_TYPE = symbolFor('react.provider'); | ||
REACT_CONTEXT_TYPE = symbolFor('react.context'); | ||
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); | ||
REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); | ||
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); | ||
REACT_MEMO_TYPE = symbolFor('react.memo'); | ||
REACT_LAZY_TYPE = symbolFor('react.lazy'); | ||
REACT_SCOPE_TYPE = symbolFor('react.scope'); | ||
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); | ||
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); | ||
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); | ||
REACT_CACHE_TYPE = symbolFor('react.cache'); | ||
} | ||
// Don't change these two values. They're used by React Dev Tools. | ||
var NoFlags = | ||
/* */ | ||
0; | ||
var Placement = | ||
@@ -152,5 +108,4 @@ /* */ | ||
/* */ | ||
4096; | ||
4096; // You can change the rest (and add more). | ||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; | ||
function getNearestMountedFiber(fiber) { | ||
@@ -173,4 +128,5 @@ var node = fiber; | ||
nearestMounted = node.return; | ||
} | ||
} // $FlowFixMe[incompatible-type] we bail out when we get a null | ||
nextNode = node.return; | ||
@@ -360,2 +316,4 @@ } while (nextNode); | ||
var assign = Object.assign; | ||
/** | ||
@@ -425,2 +383,3 @@ * `charCode` represents the actual "character code" and is safe to use with | ||
*/ | ||
// $FlowFixMe[missing-this-annot] | ||
function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) { | ||
@@ -434,13 +393,13 @@ this._reactName = reactName; | ||
for (var _propName in Interface) { | ||
if (!Interface.hasOwnProperty(_propName)) { | ||
for (var propName in Interface) { | ||
if (!Interface.hasOwnProperty(propName)) { | ||
continue; | ||
} | ||
var normalize = Interface[_propName]; | ||
var normalize = Interface[propName]; | ||
if (normalize) { | ||
this[_propName] = normalize(nativeEvent); | ||
this[propName] = normalize(nativeEvent); | ||
} else { | ||
this[_propName] = nativeEvent[_propName]; | ||
this[propName] = nativeEvent[propName]; | ||
} | ||
@@ -459,5 +418,7 @@ } | ||
return this; | ||
} | ||
} // $FlowFixMe[prop-missing] found when upgrading Flow | ||
_assign(SyntheticBaseEvent.prototype, { | ||
assign(SyntheticBaseEvent.prototype, { | ||
// $FlowFixMe[missing-this-annot] | ||
preventDefault: function () { | ||
@@ -472,3 +433,3 @@ this.defaultPrevented = true; | ||
if (event.preventDefault) { | ||
event.preventDefault(); // $FlowFixMe - flow is not aware of `unknown` in IE | ||
event.preventDefault(); // $FlowFixMe[illegal-typeof] - flow is not aware of `unknown` in IE | ||
} else if (typeof event.returnValue !== 'unknown') { | ||
@@ -480,2 +441,3 @@ event.returnValue = false; | ||
}, | ||
// $FlowFixMe[missing-this-annot] | ||
stopPropagation: function () { | ||
@@ -489,3 +451,3 @@ var event = this.nativeEvent; | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); // $FlowFixMe - flow is not aware of `unknown` in IE | ||
event.stopPropagation(); // $FlowFixMe[illegal-typeof] - flow is not aware of `unknown` in IE | ||
} else if (typeof event.cancelBubble !== 'unknown') { | ||
@@ -518,3 +480,2 @@ // The ChangeEventPlugin registers a "propertychange" event for | ||
}); | ||
return SyntheticBaseEvent; | ||
@@ -540,3 +501,3 @@ } | ||
var UIEventInterface = _assign({}, EventInterface, { | ||
var UIEventInterface = assign({}, EventInterface, { | ||
view: 0, | ||
@@ -546,3 +507,3 @@ detail: 0 | ||
var SyntheticUIEvent = createSyntheticEvent(UIEventInterface); | ||
createSyntheticEvent(UIEventInterface); | ||
var lastMovementX; | ||
@@ -555,3 +516,5 @@ var lastMovementY; | ||
if (lastMouseEvent && event.type === 'mousemove') { | ||
lastMovementX = event.screenX - lastMouseEvent.screenX; | ||
// $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
lastMovementX = event.screenX - lastMouseEvent.screenX; // $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
lastMovementY = event.screenY - lastMouseEvent.screenY; | ||
@@ -572,3 +535,3 @@ } else { | ||
var MouseEventInterface = _assign({}, UIEventInterface, { | ||
var MouseEventInterface = assign({}, UIEventInterface, { | ||
screenX: 0, | ||
@@ -611,3 +574,3 @@ screenY: 0, | ||
var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface); | ||
createSyntheticEvent(MouseEventInterface); | ||
/** | ||
@@ -618,7 +581,7 @@ * @interface DragEvent | ||
var DragEventInterface = _assign({}, MouseEventInterface, { | ||
var DragEventInterface = assign({}, MouseEventInterface, { | ||
dataTransfer: 0 | ||
}); | ||
var SyntheticDragEvent = createSyntheticEvent(DragEventInterface); | ||
createSyntheticEvent(DragEventInterface); | ||
/** | ||
@@ -629,7 +592,7 @@ * @interface FocusEvent | ||
var FocusEventInterface = _assign({}, UIEventInterface, { | ||
var FocusEventInterface = assign({}, UIEventInterface, { | ||
relatedTarget: 0 | ||
}); | ||
var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface); | ||
createSyntheticEvent(FocusEventInterface); | ||
/** | ||
@@ -641,3 +604,3 @@ * @interface Event | ||
var AnimationEventInterface = _assign({}, EventInterface, { | ||
var AnimationEventInterface = assign({}, EventInterface, { | ||
animationName: 0, | ||
@@ -648,3 +611,3 @@ elapsedTime: 0, | ||
var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface); | ||
createSyntheticEvent(AnimationEventInterface); | ||
/** | ||
@@ -655,3 +618,3 @@ * @interface Event | ||
var ClipboardEventInterface = _assign({}, EventInterface, { | ||
var ClipboardEventInterface = assign({}, EventInterface, { | ||
clipboardData: function (event) { | ||
@@ -662,3 +625,3 @@ return 'clipboardData' in event ? event.clipboardData : window.clipboardData; | ||
var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface); | ||
createSyntheticEvent(ClipboardEventInterface); | ||
/** | ||
@@ -669,7 +632,7 @@ * @interface Event | ||
var CompositionEventInterface = _assign({}, EventInterface, { | ||
var CompositionEventInterface = assign({}, EventInterface, { | ||
data: 0 | ||
}); | ||
var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface); | ||
createSyntheticEvent(CompositionEventInterface); | ||
/** | ||
@@ -749,3 +712,4 @@ * Normalization of deprecated HTML5 `key` values | ||
// printable characters (normalized to `Unidentified`), ignore it. | ||
var key = normalizeKey[nativeEvent.key] || nativeEvent.key; | ||
var key = // $FlowFixMe[invalid-computed-prop] unable to index with a `mixed` value | ||
normalizeKey[nativeEvent.key] || nativeEvent.key; | ||
@@ -759,3 +723,4 @@ if (key !== 'Unidentified') { | ||
if (nativeEvent.type === 'keypress') { | ||
var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can | ||
var charCode = getEventCharCode( // $FlowFixMe[incompatible-call] unable to narrow to `KeyboardEvent` | ||
nativeEvent); // The enter-key is technically both printable and non-printable and can | ||
// thus be captured by `keypress`, no other non-printable key should. | ||
@@ -769,2 +734,3 @@ | ||
// `keyCode` value, almost all function keys have a universal value. | ||
// $FlowFixMe[invalid-computed-prop] unable to index with a `mixed` value | ||
return translateToKey[nativeEvent.keyCode] || 'Unidentified'; | ||
@@ -789,2 +755,4 @@ } | ||
// modifier keys exposed by the event. In this case, Lock-keys are not supported. | ||
// $FlowFixMe[missing-local-annot] | ||
// $FlowFixMe[missing-this-annot] | ||
@@ -812,3 +780,3 @@ function modifierStateGetter(keyArg) { | ||
var KeyboardEventInterface = _assign({}, UIEventInterface, { | ||
var KeyboardEventInterface = assign({}, UIEventInterface, { | ||
key: getEventKey, | ||
@@ -831,3 +799,4 @@ code: 0, | ||
if (event.type === 'keypress') { | ||
return getEventCharCode(event); | ||
return getEventCharCode( // $FlowFixMe[incompatible-call] unable to narrow to `KeyboardEvent` | ||
event); | ||
} | ||
@@ -854,3 +823,4 @@ | ||
if (event.type === 'keypress') { | ||
return getEventCharCode(event); | ||
return getEventCharCode( // $FlowFixMe[incompatible-call] unable to narrow to `KeyboardEvent` | ||
event); | ||
} | ||
@@ -866,3 +836,3 @@ | ||
var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface); | ||
createSyntheticEvent(KeyboardEventInterface); | ||
/** | ||
@@ -873,3 +843,3 @@ * @interface PointerEvent | ||
var PointerEventInterface = _assign({}, MouseEventInterface, { | ||
var PointerEventInterface = assign({}, MouseEventInterface, { | ||
pointerId: 0, | ||
@@ -887,3 +857,3 @@ width: 0, | ||
var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface); | ||
createSyntheticEvent(PointerEventInterface); | ||
/** | ||
@@ -894,3 +864,3 @@ * @interface TouchEvent | ||
var TouchEventInterface = _assign({}, UIEventInterface, { | ||
var TouchEventInterface = assign({}, UIEventInterface, { | ||
touches: 0, | ||
@@ -906,3 +876,3 @@ targetTouches: 0, | ||
var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface); | ||
createSyntheticEvent(TouchEventInterface); | ||
/** | ||
@@ -914,3 +884,3 @@ * @interface Event | ||
var TransitionEventInterface = _assign({}, EventInterface, { | ||
var TransitionEventInterface = assign({}, EventInterface, { | ||
propertyName: 0, | ||
@@ -921,3 +891,3 @@ elapsedTime: 0, | ||
var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface); | ||
createSyntheticEvent(TransitionEventInterface); | ||
/** | ||
@@ -928,11 +898,14 @@ * @interface WheelEvent | ||
var WheelEventInterface = _assign({}, MouseEventInterface, { | ||
var WheelEventInterface = assign({}, MouseEventInterface, { | ||
deltaX: function (event) { | ||
return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). | ||
'wheelDeltaX' in event ? -event.wheelDeltaX : 0; | ||
'wheelDeltaX' in event ? // $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
-event.wheelDeltaX : 0; | ||
}, | ||
deltaY: function (event) { | ||
return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). | ||
'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). | ||
'wheelDelta' in event ? -event.wheelDelta : 0; | ||
'wheelDeltaY' in event ? // $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
-event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). | ||
'wheelDelta' in event ? // $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
-event.wheelDelta : 0; | ||
}, | ||
@@ -947,3 +920,3 @@ deltaZ: 0, | ||
var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface); | ||
createSyntheticEvent(WheelEventInterface); | ||
@@ -955,47 +928,32 @@ /** | ||
function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) { | ||
var funcArgs = Array.prototype.slice.call(arguments, 3); | ||
var fakeNode = null; | ||
try { | ||
func.apply(context, funcArgs); | ||
} catch (error) { | ||
this.onError(error); | ||
{ | ||
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && // $FlowFixMe[method-unbinding] | ||
typeof document.createEvent === 'function') { | ||
fakeNode = document.createElement('react'); | ||
} | ||
} | ||
var invokeGuardedCallbackImpl = invokeGuardedCallbackProd; | ||
{ | ||
// In DEV mode, we swap out invokeGuardedCallback for a special version | ||
// that plays more nicely with the browser's DevTools. The idea is to preserve | ||
// "Pause on exceptions" behavior. Because React wraps all user-provided | ||
// functions in invokeGuardedCallback, and the production version of | ||
// invokeGuardedCallback uses a try-catch, all user exceptions are treated | ||
// like caught exceptions, and the DevTools won't pause unless the developer | ||
// takes the extra step of enabling pause on caught exceptions. This is | ||
// unintuitive, though, because even though React has caught the error, from | ||
// the developer's perspective, the error is uncaught. | ||
// | ||
// To preserve the expected "Pause on exceptions" behavior, we don't use a | ||
// try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake | ||
// DOM node, and call the user-provided callback from inside an event handler | ||
// for that fake event. If the callback throws, the error is "captured" using | ||
// a global event handler. But because the error happens in a different | ||
// event loop context, it does not interrupt the normal program flow. | ||
// Effectively, this gives us try-catch behavior without actually using | ||
// try-catch. Neat! | ||
// Check that the browser supports the APIs we need to implement our special | ||
// DEV version of invokeGuardedCallback | ||
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { | ||
var fakeNode = document.createElement('react'); | ||
invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) { | ||
// If document doesn't exist we know for sure we will crash in this method | ||
// when we call document.createEvent(). However this can cause confusing | ||
// errors: https://github.com/facebook/create-react-app/issues/3482 | ||
// So we preemptively throw with a better message instead. | ||
if (typeof document === 'undefined' || document === null) { | ||
throw new Error('The `document` global was defined when React was initialized, but is not ' + 'defined anymore. This can happen in a test environment if a component ' + 'schedules an update from an asynchronous callback, but the test has already ' + 'finished running. To solve this, you can either unmount the component at ' + 'the end of your test (and ensure that any asynchronous operations get ' + 'canceled in `componentWillUnmount`), or you can change the test itself ' + 'to be asynchronous.'); | ||
} | ||
function invokeGuardedCallbackImpl(name, func, context) { | ||
{ | ||
// In DEV mode, we use a special version | ||
// that plays more nicely with the browser's DevTools. The idea is to preserve | ||
// "Pause on exceptions" behavior. Because React wraps all user-provided | ||
// functions in invokeGuardedCallback, and the production version of | ||
// invokeGuardedCallback uses a try-catch, all user exceptions are treated | ||
// like caught exceptions, and the DevTools won't pause unless the developer | ||
// takes the extra step of enabling pause on caught exceptions. This is | ||
// unintuitive, though, because even though React has caught the error, from | ||
// the developer's perspective, the error is uncaught. | ||
// | ||
// To preserve the expected "Pause on exceptions" behavior, we don't use a | ||
// try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake | ||
// DOM node, and call the user-provided callback from inside an event handler | ||
// for that fake event. If the callback throws, the error is "captured" using | ||
// event loop context, it does not interrupt the normal program flow. | ||
// Effectively, this gives us try-catch behavior without actually using | ||
// try-catch. Neat! | ||
// fakeNode signifies we are in an environment with a document and window object | ||
if (fakeNode) { | ||
var evt = document.createEvent('Event'); | ||
@@ -1018,3 +976,3 @@ var didCall = false; // Keeps track of whether the user-provided callback threw an error. We | ||
function restoreAfterDispatch() { | ||
var restoreAfterDispatch = function () { | ||
// We immediately remove the callback from event listeners so that | ||
@@ -1032,15 +990,17 @@ // nested `invokeGuardedCallback` calls do not clash. Otherwise, a | ||
} | ||
} // Create an event handler for our fake event. We will synchronously | ||
}; // Create an event handler for our fake event. We will synchronously | ||
// dispatch our fake event using `dispatchEvent`. Inside the handler, we | ||
// call the user-provided callback. | ||
// $FlowFixMe[method-unbinding] | ||
var funcArgs = Array.prototype.slice.call(arguments, 3); | ||
var _funcArgs = Array.prototype.slice.call(arguments, 3); | ||
function callCallback() { | ||
var callCallback = function () { | ||
didCall = true; | ||
restoreAfterDispatch(); | ||
func.apply(context, funcArgs); | ||
restoreAfterDispatch(); // $FlowFixMe[incompatible-call] Flow doesn't understand the arguments splicing. | ||
func.apply(context, _funcArgs); | ||
didError = false; | ||
} // Create a global error event handler. We use this to capture the value | ||
}; // Create a global error event handler. We use this to capture the value | ||
// that was thrown. It's possible that this error handler will fire more | ||
@@ -1063,3 +1023,3 @@ // than once; for example, if non-React code also calls `dispatchEvent` | ||
function handleWindowError(event) { | ||
var handleWindowError = function (event) { | ||
error = event.error; | ||
@@ -1083,3 +1043,3 @@ didSetError = true; | ||
} | ||
} // Create a fake event type. | ||
}; // Create a fake event type. | ||
@@ -1116,3 +1076,5 @@ | ||
if (!didCall) { | ||
if (didCall) { | ||
return; | ||
} else { | ||
// Something went really wrong, and our event was not dispatched. | ||
@@ -1122,11 +1084,20 @@ // https://github.com/facebook/react/issues/16734 | ||
// Fall back to the production implementation. | ||
restoreAfterDispatch(); | ||
return invokeGuardedCallbackProd.apply(this, arguments); | ||
restoreAfterDispatch(); // we fall through and call the prod version instead | ||
} | ||
}; | ||
} // We only get here if we are in an environment that either does not support the browser | ||
// variant or we had trouble getting the browser to emit the error. | ||
// $FlowFixMe[method-unbinding] | ||
var funcArgs = Array.prototype.slice.call(arguments, 3); | ||
try { | ||
// $FlowFixMe[incompatible-call] Flow doesn't understand the arguments splicing. | ||
func.apply(context, funcArgs); | ||
} catch (error) { | ||
this.onError(error); | ||
} | ||
} | ||
} | ||
var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; | ||
var hasError = false; | ||
@@ -1160,3 +1131,3 @@ var caughtError = null; // Used by event system to capture/rethrow the first error. | ||
caughtError = null; | ||
invokeGuardedCallbackImpl$1.apply(reporter, arguments); | ||
invokeGuardedCallbackImpl.apply(reporter, arguments); | ||
} | ||
@@ -1247,3 +1218,3 @@ /** | ||
while (true) { | ||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionComponent) { | ||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionComponent || (node.tag === HostHoistable ) || (node.tag === HostSingleton )) { | ||
var publicInst = node.stateNode; | ||
@@ -1576,3 +1547,5 @@ | ||
var executeDispatchesAndRelease = function (event) { | ||
function executeDispatchesAndRelease(event | ||
/* ReactSyntheticEvent */ | ||
) { | ||
if (event) { | ||
@@ -1585,3 +1558,3 @@ executeDispatchesInOrder(event); | ||
} | ||
}; | ||
} | ||
@@ -1599,3 +1572,3 @@ function isInteractive(tag) { | ||
// do the portal feature. | ||
} while (inst && inst.tag !== HostComponent); | ||
} while (inst && inst.tag !== HostComponent && (inst.tag !== HostSingleton)); | ||
@@ -1658,3 +1631,5 @@ if (inst) { | ||
function getListener(inst, registrationName) { | ||
function getListener(inst | ||
/* Fiber */ | ||
, registrationName) { | ||
// TODO: shouldPreventMouseEvent is DOM-specific and definitely should not | ||
@@ -1787,5 +1762,4 @@ // live here; needs to be moved to a better place soon | ||
event.persist(); | ||
assign(event, eventData); | ||
_assign(event, eventData); | ||
if (directDispatchEventTypes.has(eventType)) { | ||
@@ -1792,0 +1766,0 @@ accumulateDirectDispatchesSingle(event); |
@@ -1,5 +0,6 @@ | ||
/** @license React vundefined | ||
/** | ||
* @license React | ||
* react-dom-test-utils.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -9,32 +10,32 @@ * This source code is licensed under the MIT license found in the | ||
*/ | ||
'use strict';var h=require("object-assign"),l=require("react"),m=require("react-dom");function n(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&4098)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function p(a){if(n(a)!==a)throw Error("Unable to find node on an unmounted component.");} | ||
function q(a){var b=a.alternate;if(!b){b=n(a);if(null===b)throw Error("Unable to find node on an unmounted component.");return b!==a?null:a}for(var c=a,d=b;;){var f=c.return;if(null===f)break;var g=f.alternate;if(null===g){d=f.return;if(null!==d){c=d;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===c)return p(f),a;if(g===d)return p(f),b;g=g.sibling}throw Error("Unable to find node on an unmounted component.");}if(c.return!==d.return)c=f,d=g;else{for(var e=!1,k=f.child;k;){if(k===c){e= | ||
!0;c=f;d=g;break}if(k===d){e=!0;d=f;c=g;break}k=k.sibling}if(!e){for(k=g.child;k;){if(k===c){e=!0;c=g;d=f;break}if(k===d){e=!0;d=g;c=f;break}k=k.sibling}if(!e)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");}}if(c.alternate!==d)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");}if(3!==c.tag)throw Error("Unable to find node on an unmounted component."); | ||
return c.stateNode.current===c?a:b}function r(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function t(){return!0}function u(){return!1} | ||
function v(a){function b(c,b,f,g,e){this._reactName=c;this._targetInst=f;this.type=b;this.nativeEvent=g;this.target=e;this.currentTarget=null;for(var d in a)a.hasOwnProperty(d)&&(c=a[d],this[d]=c?c(g):g[d]);this.isDefaultPrevented=(null!=g.defaultPrevented?g.defaultPrevented:!1===g.returnValue)?t:u;this.isPropagationStopped=u;return this}h(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&& | ||
(a.returnValue=!1),this.isDefaultPrevented=t)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=t)},persist:function(){},isPersistent:t});return b}var w={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},x=v(w),y=h({},w,{view:0,detail:0});v(y); | ||
var z,A,B,D=h({},y,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:C,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if("movementX"in a)return a.movementX;a!==B&&(B&&"mousemove"===a.type?(z=a.screenX-B.screenX,A=a.screenY-B.screenY):A=z=0,B=a);return z},movementY:function(a){return"movementY"in a?a.movementY:A}}); | ||
v(D);var E=h({},D,{dataTransfer:0});v(E);var F=h({},y,{relatedTarget:0});v(F);var aa=h({},w,{animationName:0,elapsedTime:0,pseudoElement:0});v(aa);var ba=h({},w,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}});v(ba);var ca=h({},w,{data:0});v(ca); | ||
'use strict';var k=require("react"),l=require("react-dom");function m(a){var c=a,b=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,0!==(c.flags&4098)&&(b=c.return),a=c.return;while(a)}return 3===c.tag?b:null}function n(a){if(m(a)!==a)throw Error("Unable to find node on an unmounted component.");} | ||
function p(a){var c=a.alternate;if(!c){c=m(a);if(null===c)throw Error("Unable to find node on an unmounted component.");return c!==a?null:a}for(var b=a,d=c;;){var f=b.return;if(null===f)break;var g=f.alternate;if(null===g){d=f.return;if(null!==d){b=d;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===b)return n(f),a;if(g===d)return n(f),c;g=g.sibling}throw Error("Unable to find node on an unmounted component.");}if(b.return!==d.return)b=f,d=g;else{for(var e=!1,h=f.child;h;){if(h===b){e= | ||
!0;b=f;d=g;break}if(h===d){e=!0;d=f;b=g;break}h=h.sibling}if(!e){for(h=g.child;h;){if(h===b){e=!0;b=g;d=f;break}if(h===d){e=!0;d=g;b=f;break}h=h.sibling}if(!e)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");}}if(b.alternate!==d)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");}if(3!==b.tag)throw Error("Unable to find node on an unmounted component."); | ||
return b.stateNode.current===b?a:c}var r=Object.assign;function t(a){var c=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===c&&(a=13)):a=c;10===a&&(a=13);return 32<=a||13===a?a:0}function u(){return!0}function v(){return!1} | ||
function w(a){function c(b,d,f,g,e){this._reactName=b;this._targetInst=f;this.type=d;this.nativeEvent=g;this.target=e;this.currentTarget=null;for(var h in a)a.hasOwnProperty(h)&&(b=a[h],this[h]=b?b(g):g[h]);this.isDefaultPrevented=(null!=g.defaultPrevented?g.defaultPrevented:!1===g.returnValue)?u:v;this.isPropagationStopped=v;return this}r(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var b=this.nativeEvent;b&&(b.preventDefault?b.preventDefault():"unknown"!==typeof b.returnValue&& | ||
(b.returnValue=!1),this.isDefaultPrevented=u)},stopPropagation:function(){var b=this.nativeEvent;b&&(b.stopPropagation?b.stopPropagation():"unknown"!==typeof b.cancelBubble&&(b.cancelBubble=!0),this.isPropagationStopped=u)},persist:function(){},isPersistent:u});return c}var x={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},y=w(x),z=r({},x,{view:0,detail:0});w(z); | ||
var B,C,D,F=r({},z,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:E,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if("movementX"in a)return a.movementX;a!==D&&(D&&"mousemove"===a.type?(B=a.screenX-D.screenX,C=a.screenY-D.screenY):C=B=0,D=a);return B},movementY:function(a){return"movementY"in a?a.movementY:C}}); | ||
w(F);var G=r({},F,{dataTransfer:0});w(G);var H=r({},z,{relatedTarget:0});w(H);var aa=r({},x,{animationName:0,elapsedTime:0,pseudoElement:0});w(aa);var ba=r({},x,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}});w(ba);var ca=r({},x,{data:0});w(ca); | ||
var da={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ea={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4", | ||
116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fa={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ha(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=fa[a])?!!b[a]:!1}function C(){return ha} | ||
var ia=h({},y,{key:function(a){if(a.key){var b=da[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=r(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?ea[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:C,charCode:function(a){return"keypress"===a.type?r(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"=== | ||
a.type?r(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}});v(ia);var ja=h({},D,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0});v(ja);var ka=h({},y,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:C});v(ka);var la=h({},w,{propertyName:0,elapsedTime:0,pseudoElement:0});v(la); | ||
var ma=h({},D,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0});v(ma);function na(a,b,c,d,f,g,e,k,N){var G=Array.prototype.slice.call(arguments,3);try{b.apply(c,G)}catch(oa){this.onError(oa)}}var H=!1,I=null,J=!1,K=null,pa={onError:function(a){H=!0;I=a}};function qa(a,b,c,d,f,g,e,k,N){H=!1;I=null;na.apply(pa,arguments)} | ||
function ra(a,b,c,d,f,g,e,k,N){qa.apply(this,arguments);if(H){if(H){var G=I;H=!1;I=null}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");J||(J=!0,K=G)}}var L=Array.isArray,M=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,sa=M[0],ta=M[1],ua=M[2],va=M[3],wa=M[4],xa=l.unstable_act;function ya(){} | ||
function za(a,b){if(!a)return[];a=q(a);if(!a)return[];for(var c=a,d=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var f=c.stateNode;b(f)&&d.push(f)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return d;for(;!c.sibling;){if(!c.return||c.return===a)return d;c=c.return}c.sibling.return=c.return;c=c.sibling}}} | ||
function O(a,b){if(a&&!a._reactInternals){var c=String(a);a=L(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;throw Error(b+"(...): the first argument must be a React class instance. Instead received: "+(a+"."));}}function P(a){return!(!a||1!==a.nodeType||!a.tagName)}function Q(a){return P(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState} | ||
function R(a,b){return Q(a)?a._reactInternals.type===b:!1}function S(a,b){O(a,"findAllInRenderedTree");return a?za(a._reactInternals,b):[]} | ||
function T(a,b){O(a,"scryRenderedDOMComponentsWithClass");return S(a,function(a){if(P(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var f=c.split(/\s+/);if(!L(b)){if(void 0===b)throw Error("TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.");b=b.split(/\s+/)}return b.every(function(a){return-1!==f.indexOf(a)})}return!1})} | ||
function U(a,b){O(a,"scryRenderedDOMComponentsWithTag");return S(a,function(a){return P(a)&&a.tagName.toUpperCase()===b.toUpperCase()})}function V(a,b){O(a,"scryRenderedComponentsWithType");return S(a,function(a){return R(a,b)})}function W(a,b,c){var d=a.type||"unknown-event";a.currentTarget=ta(c);ra(d,b,void 0,a);a.currentTarget=null} | ||
function X(a,b,c){for(var d=[];a;){d.push(a);do a=a.return;while(a&&5!==a.tag);a=a?a:null}for(a=d.length;0<a--;)b(d[a],"captured",c);for(a=0;a<d.length;a++)b(d[a],"bubbled",c)} | ||
function Y(a,b){var c=a.stateNode;if(!c)return null;var d=ua(c);if(!d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw Error("Expected `"+ | ||
b+"` listener to be a function, instead got a value of `"+typeof c+"` type.");return c}function Aa(a,b,c){a&&c&&c._reactName&&(b=Y(a,c._reactName))&&(null==c._dispatchListeners&&(c._dispatchListeners=[]),null==c._dispatchInstances&&(c._dispatchInstances=[]),c._dispatchListeners.push(b),c._dispatchInstances.push(a))} | ||
function Ba(a,b,c){var d=c._reactName;"captured"===b&&(d+="Capture");if(b=Y(a,d))null==c._dispatchListeners&&(c._dispatchListeners=[]),null==c._dispatchInstances&&(c._dispatchInstances=[]),c._dispatchListeners.push(b),c._dispatchInstances.push(a)}var Z={},Ca=new Set(["mouseEnter","mouseLeave","pointerEnter","pointerLeave"]); | ||
function Da(a){return function(b,c){if(l.isValidElement(b))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.");if(Q(b))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.");var d="on"+a[0].toUpperCase()+ | ||
a.slice(1),f=new ya;f.target=b;f.type=a.toLowerCase();var g=sa(b),e=new x(d,f.type,g,f,b);e.persist();h(e,c);Ca.has(a)?e&&e._reactName&&Aa(e._targetInst,null,e):e&&e._reactName&&X(e._targetInst,Ba,e);m.unstable_batchedUpdates(function(){va(b);if(e){var a=e._dispatchListeners,c=e._dispatchInstances;if(L(a))for(var d=0;d<a.length&&!e.isPropagationStopped();d++)W(e,a[d],c[d]);else a&&W(e,a,c);e._dispatchListeners=null;e._dispatchInstances=null;e.isPersistent()||e.constructor.release(e)}if(J)throw a= | ||
K,J=!1,K=null,a;});wa()}} | ||
"blur cancel click close contextMenu copy cut auxClick doubleClick dragEnd dragStart drop focus input invalid keyDown keyPress keyUp mouseDown mouseUp paste pause play pointerCancel pointerDown pointerUp rateChange reset resize seeked submit touchCancel touchEnd touchStart volumeChange drag dragEnter dragExit dragLeave dragOver mouseMove mouseOut mouseOver pointerMove pointerOut pointerOver scroll toggle touchMove wheel abort animationEnd animationIteration animationStart canPlay canPlayThrough durationChange emptied encrypted ended error gotPointerCapture load loadedData loadedMetadata loadStart lostPointerCapture playing progress seeking stalled suspend timeUpdate transitionEnd waiting mouseEnter mouseLeave pointerEnter pointerLeave change select beforeInput compositionEnd compositionStart compositionUpdate".split(" ").forEach(function(a){Z[a]=Da(a)}); | ||
exports.Simulate=Z;exports.act=xa;exports.findAllInRenderedTree=S;exports.findRenderedComponentWithType=function(a,b){O(a,"findRenderedComponentWithType");a=V(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]};exports.findRenderedDOMComponentWithClass=function(a,b){O(a,"findRenderedDOMComponentWithClass");a=T(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]}; | ||
exports.findRenderedDOMComponentWithTag=function(a,b){O(a,"findRenderedDOMComponentWithTag");a=U(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]};exports.isCompositeComponent=Q;exports.isCompositeComponentWithType=R;exports.isDOMComponent=P;exports.isDOMComponentElement=function(a){return!!(a&&l.isValidElement(a)&&a.tagName)};exports.isElement=function(a){return l.isValidElement(a)}; | ||
exports.isElementOfType=function(a,b){return l.isValidElement(a)&&a.type===b};exports.mockComponent=function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return l.createElement(b,null,this.props.children)});return this};exports.nativeTouchData=function(a,b){return{touches:[{pageX:a,pageY:b}]}};exports.renderIntoDocument=function(a){var b=document.createElement("div");return m.render(a,b)};exports.scryRenderedComponentsWithType=V; | ||
116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fa={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ha(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=fa[a])?!!c[a]:!1}function E(){return ha} | ||
var ia=r({},z,{key:function(a){if(a.key){var c=da[a.key]||a.key;if("Unidentified"!==c)return c}return"keypress"===a.type?(a=t(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?ea[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:E,charCode:function(a){return"keypress"===a.type?t(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"=== | ||
a.type?t(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}});w(ia);var ja=r({},F,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0});w(ja);var ka=r({},z,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:E});w(ka);var la=r({},x,{propertyName:0,elapsedTime:0,pseudoElement:0});w(la); | ||
var ma=r({},F,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0});w(ma);function na(a,c,b){var d=Array.prototype.slice.call(arguments,3);try{c.apply(b,d)}catch(f){this.onError(f)}}var I=!1,J=null,K=!1,L=null,oa={onError:function(a){I=!0;J=a}};function pa(a,c,b,d,f,g,e,h,A){I=!1;J=null;na.apply(oa,arguments)} | ||
function qa(a,c,b,d,f,g,e,h,A){pa.apply(this,arguments);if(I){if(I){var q=J;I=!1;J=null}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");K||(K=!0,L=q)}}var M=Array.isArray,N=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,ra=N[0],sa=N[1],ta=N[2],ua=N[3],va=N[4],wa=k.unstable_act;function xa(){} | ||
function ya(a,c){if(!a)return[];a=p(a);if(!a)return[];for(var b=a,d=[];;){if(5===b.tag||6===b.tag||1===b.tag||0===b.tag||26===b.tag||27===b.tag){var f=b.stateNode;c(f)&&d.push(f)}if(b.child)b.child.return=b,b=b.child;else{if(b===a)return d;for(;!b.sibling;){if(!b.return||b.return===a)return d;b=b.return}b.sibling.return=b.return;b=b.sibling}}} | ||
function O(a,c){if(a&&!a._reactInternals){var b=String(a);a=M(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b;throw Error(c+"(...): the first argument must be a React class instance. Instead received: "+(a+"."));}}function P(a){return!(!a||1!==a.nodeType||!a.tagName)}function Q(a){return P(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState} | ||
function R(a,c){return Q(a)?a._reactInternals.type===c:!1}function S(a,c){O(a,"findAllInRenderedTree");return a?ya(a._reactInternals,c):[]} | ||
function T(a,c){O(a,"scryRenderedDOMComponentsWithClass");return S(a,function(b){if(P(b)){var d=b.className;"string"!==typeof d&&(d=b.getAttribute("class")||"");var f=d.split(/\s+/);if(!M(c)){if(void 0===c)throw Error("TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.");c=c.split(/\s+/)}return c.every(function(g){return-1!==f.indexOf(g)})}return!1})} | ||
function U(a,c){O(a,"scryRenderedDOMComponentsWithTag");return S(a,function(b){return P(b)&&b.tagName.toUpperCase()===c.toUpperCase()})}function V(a,c){O(a,"scryRenderedComponentsWithType");return S(a,function(b){return R(b,c)})}function W(a,c,b){var d=a.type||"unknown-event";a.currentTarget=sa(b);qa(d,c,void 0,a);a.currentTarget=null} | ||
function X(a,c,b){for(var d=[];a;){d.push(a);do a=a.return;while(a&&5!==a.tag&&27!==a.tag);a=a?a:null}for(a=d.length;0<a--;)c(d[a],"captured",b);for(a=0;a<d.length;a++)c(d[a],"bubbled",b)} | ||
function Y(a,c){var b=a.stateNode;if(!b)return null;var d=ta(b);if(!d)return null;b=d[c];a:switch(c){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(b&&"function"!==typeof b)throw Error("Expected `"+ | ||
c+"` listener to be a function, instead got a value of `"+typeof b+"` type.");return b}function za(a,c,b){a&&b&&b._reactName&&(c=Y(a,b._reactName))&&(null==b._dispatchListeners&&(b._dispatchListeners=[]),null==b._dispatchInstances&&(b._dispatchInstances=[]),b._dispatchListeners.push(c),b._dispatchInstances.push(a))} | ||
function Aa(a,c,b){var d=b._reactName;"captured"===c&&(d+="Capture");if(c=Y(a,d))null==b._dispatchListeners&&(b._dispatchListeners=[]),null==b._dispatchInstances&&(b._dispatchInstances=[]),b._dispatchListeners.push(c),b._dispatchInstances.push(a)}var Z={},Ba=new Set(["mouseEnter","mouseLeave","pointerEnter","pointerLeave"]); | ||
function Ca(a){return function(c,b){if(k.isValidElement(c))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.");if(Q(c))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.");var d="on"+a[0].toUpperCase()+ | ||
a.slice(1),f=new xa;f.target=c;f.type=a.toLowerCase();var g=ra(c),e=new y(d,f.type,g,f,c);e.persist();r(e,b);Ba.has(a)?e&&e._reactName&&za(e._targetInst,null,e):e&&e._reactName&&X(e._targetInst,Aa,e);l.unstable_batchedUpdates(function(){ua(c);if(e){var h=e._dispatchListeners,A=e._dispatchInstances;if(M(h))for(var q=0;q<h.length&&!e.isPropagationStopped();q++)W(e,h[q],A[q]);else h&&W(e,h,A);e._dispatchListeners=null;e._dispatchInstances=null;e.isPersistent()||e.constructor.release(e)}if(K)throw h= | ||
L,K=!1,L=null,h;});va()}} | ||
"blur cancel click close contextMenu copy cut auxClick doubleClick dragEnd dragStart drop focus input invalid keyDown keyPress keyUp mouseDown mouseUp paste pause play pointerCancel pointerDown pointerUp rateChange reset resize seeked submit touchCancel touchEnd touchStart volumeChange drag dragEnter dragExit dragLeave dragOver mouseMove mouseOut mouseOver pointerMove pointerOut pointerOver scroll toggle touchMove wheel abort animationEnd animationIteration animationStart canPlay canPlayThrough durationChange emptied encrypted ended error gotPointerCapture load loadedData loadedMetadata loadStart lostPointerCapture playing progress seeking stalled suspend timeUpdate transitionEnd waiting mouseEnter mouseLeave pointerEnter pointerLeave change select beforeInput compositionEnd compositionStart compositionUpdate".split(" ").forEach(function(a){Z[a]=Ca(a)}); | ||
exports.Simulate=Z;exports.act=wa;exports.findAllInRenderedTree=S;exports.findRenderedComponentWithType=function(a,c){O(a,"findRenderedComponentWithType");a=V(a,c);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+c);return a[0]};exports.findRenderedDOMComponentWithClass=function(a,c){O(a,"findRenderedDOMComponentWithClass");a=T(a,c);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+c);return a[0]}; | ||
exports.findRenderedDOMComponentWithTag=function(a,c){O(a,"findRenderedDOMComponentWithTag");a=U(a,c);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+c);return a[0]};exports.isCompositeComponent=Q;exports.isCompositeComponentWithType=R;exports.isDOMComponent=P;exports.isDOMComponentElement=function(a){return!!(a&&k.isValidElement(a)&&a.tagName)};exports.isElement=function(a){return k.isValidElement(a)}; | ||
exports.isElementOfType=function(a,c){return k.isValidElement(a)&&a.type===c};exports.mockComponent=function(a,c){c=c||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return k.createElement(c,null,this.props.children)});return this};exports.nativeTouchData=function(a,c){return{touches:[{pageX:a,pageY:c}]}};exports.renderIntoDocument=function(a){var c=document.createElement("div");return l.render(a,c)};exports.scryRenderedComponentsWithType=V; | ||
exports.scryRenderedDOMComponentsWithClass=T;exports.scryRenderedDOMComponentsWithTag=U;exports.traverseTwoPhase=X; |
{ | ||
"name": "react-dom", | ||
"version": "0.0.0-experimental-71d16750c-20211202", | ||
"version": "0.0.0-experimental-720de7f81a-20241220", | ||
"description": "React package for working with the DOM.", | ||
@@ -21,7 +21,6 @@ "main": "index.js", | ||
"loose-envify": "^1.1.0", | ||
"object-assign": "^4.1.1", | ||
"scheduler": "0.0.0-experimental-71d16750c-20211202" | ||
"scheduler": "0.0.0-experimental-720de7f81a-20241220" | ||
}, | ||
"peerDependencies": { | ||
"react": "0.0.0-experimental-71d16750c-20211202" | ||
"react": "0.0.0-experimental-720de7f81a-20241220" | ||
}, | ||
@@ -31,15 +30,63 @@ "files": [ | ||
"README.md", | ||
"build-info.json", | ||
"index.js", | ||
"client.js", | ||
"profiling.js", | ||
"server.js", | ||
"server.browser.js", | ||
"server.edge.js", | ||
"server.node.js", | ||
"server.bun.js", | ||
"static.js", | ||
"static.browser.js", | ||
"static.edge.js", | ||
"static.node.js", | ||
"server-rendering-stub.js", | ||
"test-utils.js", | ||
"unstable_testing.js", | ||
"unstable_server-external-runtime.js", | ||
"cjs/", | ||
"umd/" | ||
], | ||
"exports": { | ||
".": { | ||
"react-server": "./react-dom.shared-subset.js", | ||
"default": "./index.js" | ||
}, | ||
"./client": "./client.js", | ||
"./server": { | ||
"workerd": "./server.edge.js", | ||
"bun": "./server.bun.js", | ||
"deno": "./server.browser.js", | ||
"worker": "./server.browser.js", | ||
"browser": "./server.browser.js", | ||
"node": "./server.node.js", | ||
"edge-light": "./server.edge.js", | ||
"default": "./server.node.js" | ||
}, | ||
"./server.browser": "./server.browser.js", | ||
"./server.bun": "./server.bun.js", | ||
"./server.edge": "./server.edge.js", | ||
"./server.node": "./server.node.js", | ||
"./static": { | ||
"workerd": "./static.edge.js", | ||
"deno": "./static.browser.js", | ||
"worker": "./static.browser.js", | ||
"browser": "./static.browser.js", | ||
"node": "./static.node.js", | ||
"edge-light": "./static.edge.js", | ||
"default": "./static.node.js" | ||
}, | ||
"./static.browser": "./static.browser.js", | ||
"./static.edge": "./static.edge.js", | ||
"./static.node": "./static.node.js", | ||
"./server-rendering-stub": "./server-rendering-stub.js", | ||
"./profiling": "./profiling.js", | ||
"./test-utils": "./test-utils.js", | ||
"./unstable_testing": "./unstable_testing.js", | ||
"./unstable_server-external-runtime": "./unstable_server-external-runtime.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"browser": { | ||
"./server.js": "./server.browser.js" | ||
"./server.js": "./server.browser.js", | ||
"./static.js": "./static.browser.js" | ||
}, | ||
@@ -46,0 +93,0 @@ "browserify": { |
@@ -16,10 +16,10 @@ # `react-dom` | ||
```js | ||
var React = require('react'); | ||
var ReactDOM = require('react-dom'); | ||
import { createRoot } from 'react-dom/client'; | ||
function MyComponent() { | ||
function App() { | ||
return <div>Hello World</div>; | ||
} | ||
ReactDOM.render(<MyComponent />, node); | ||
const root = createRoot(document.getElementById('root')); | ||
root.render(<App />); | ||
``` | ||
@@ -30,10 +30,19 @@ | ||
```js | ||
var React = require('react'); | ||
var ReactDOMServer = require('react-dom/server'); | ||
import { renderToPipeableStream } from 'react-dom/server'; | ||
function MyComponent() { | ||
function App() { | ||
return <div>Hello World</div>; | ||
} | ||
ReactDOMServer.renderToString(<MyComponent />); | ||
function handleRequest(res) { | ||
// ... in your server handler ... | ||
const stream = renderToPipeableStream(<App />, { | ||
onShellReady() { | ||
res.statusCode = 200; | ||
res.setHeader('Content-type', 'text/html'); | ||
stream.pipe(res); | ||
}, | ||
// ... | ||
}); | ||
} | ||
``` | ||
@@ -45,9 +54,10 @@ | ||
- `findDOMNode` | ||
- `render` | ||
- `unmountComponentAtNode` | ||
See https://react.dev/reference/react-dom | ||
### `react-dom/client` | ||
See https://react.dev/reference/react-dom/client | ||
### `react-dom/server` | ||
- `renderToString` | ||
- `renderToStaticMarkup` | ||
See https://react.dev/reference/react-dom/server |
@@ -18,1 +18,4 @@ 'use strict'; | ||
exports.renderToReadableStream = s.renderToReadableStream; | ||
if (s.resume) { | ||
exports.resume = s.resume; | ||
} |
@@ -18,1 +18,4 @@ 'use strict'; | ||
exports.renderToPipeableStream = s.renderToPipeableStream; | ||
if (s.resumeToPipeableStream) { | ||
exports.resumeToPipeableStream = s.resumeToPipeableStream; | ||
} |
@@ -1,5 +0,6 @@ | ||
/** @license React vundefined | ||
/** | ||
* @license React | ||
* react-dom-test-utils.development.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -12,8 +13,5 @@ * This source code is licensed under the MIT license found in the | ||
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom'], factory) : | ||
(global = global || self, factory(global.ReactTestUtils = {}, global.React, global.ReactDOM)); | ||
}(this, (function (exports, React, ReactDOM) { 'use strict'; | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactTestUtils = {}, global.React, global.ReactDOM)); | ||
})(this, (function (exports, React, ReactDOM) { 'use strict'; | ||
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
var _assign = ReactInternals.assign; | ||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | ||
@@ -94,52 +92,8 @@ | ||
var HostText = 6; | ||
var HostHoistable = 26; | ||
var HostSingleton = 27; | ||
// ATTENTION | ||
// When adding new symbols to this file, | ||
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
// nor polyfill, then a plain number is used for performance. | ||
var REACT_ELEMENT_TYPE = 0xeac7; | ||
var REACT_PORTAL_TYPE = 0xeaca; | ||
var REACT_FRAGMENT_TYPE = 0xeacb; | ||
var REACT_STRICT_MODE_TYPE = 0xeacc; | ||
var REACT_PROFILER_TYPE = 0xead2; | ||
var REACT_PROVIDER_TYPE = 0xeacd; | ||
var REACT_CONTEXT_TYPE = 0xeace; | ||
var REACT_FORWARD_REF_TYPE = 0xead0; | ||
var REACT_SUSPENSE_TYPE = 0xead1; | ||
var REACT_SUSPENSE_LIST_TYPE = 0xead8; | ||
var REACT_MEMO_TYPE = 0xead3; | ||
var REACT_LAZY_TYPE = 0xead4; | ||
var REACT_SCOPE_TYPE = 0xead7; | ||
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; | ||
var REACT_OFFSCREEN_TYPE = 0xeae2; | ||
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; | ||
var REACT_CACHE_TYPE = 0xeae4; | ||
if (typeof Symbol === 'function' && Symbol.for) { | ||
var symbolFor = Symbol.for; | ||
REACT_ELEMENT_TYPE = symbolFor('react.element'); | ||
REACT_PORTAL_TYPE = symbolFor('react.portal'); | ||
REACT_FRAGMENT_TYPE = symbolFor('react.fragment'); | ||
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode'); | ||
REACT_PROFILER_TYPE = symbolFor('react.profiler'); | ||
REACT_PROVIDER_TYPE = symbolFor('react.provider'); | ||
REACT_CONTEXT_TYPE = symbolFor('react.context'); | ||
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref'); | ||
REACT_SUSPENSE_TYPE = symbolFor('react.suspense'); | ||
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list'); | ||
REACT_MEMO_TYPE = symbolFor('react.memo'); | ||
REACT_LAZY_TYPE = symbolFor('react.lazy'); | ||
REACT_SCOPE_TYPE = symbolFor('react.scope'); | ||
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode'); | ||
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen'); | ||
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden'); | ||
REACT_CACHE_TYPE = symbolFor('react.cache'); | ||
} | ||
// Don't change these two values. They're used by React Dev Tools. | ||
var NoFlags = | ||
/* */ | ||
0; | ||
var Placement = | ||
@@ -150,5 +104,4 @@ /* */ | ||
/* */ | ||
4096; | ||
4096; // You can change the rest (and add more). | ||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; | ||
function getNearestMountedFiber(fiber) { | ||
@@ -171,4 +124,5 @@ var node = fiber; | ||
nearestMounted = node.return; | ||
} | ||
} // $FlowFixMe[incompatible-type] we bail out when we get a null | ||
nextNode = node.return; | ||
@@ -358,2 +312,4 @@ } while (nextNode); | ||
var assign = Object.assign; | ||
/** | ||
@@ -423,2 +379,3 @@ * `charCode` represents the actual "character code" and is safe to use with | ||
*/ | ||
// $FlowFixMe[missing-this-annot] | ||
function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) { | ||
@@ -432,13 +389,13 @@ this._reactName = reactName; | ||
for (var _propName in Interface) { | ||
if (!Interface.hasOwnProperty(_propName)) { | ||
for (var propName in Interface) { | ||
if (!Interface.hasOwnProperty(propName)) { | ||
continue; | ||
} | ||
var normalize = Interface[_propName]; | ||
var normalize = Interface[propName]; | ||
if (normalize) { | ||
this[_propName] = normalize(nativeEvent); | ||
this[propName] = normalize(nativeEvent); | ||
} else { | ||
this[_propName] = nativeEvent[_propName]; | ||
this[propName] = nativeEvent[propName]; | ||
} | ||
@@ -457,5 +414,7 @@ } | ||
return this; | ||
} | ||
} // $FlowFixMe[prop-missing] found when upgrading Flow | ||
_assign(SyntheticBaseEvent.prototype, { | ||
assign(SyntheticBaseEvent.prototype, { | ||
// $FlowFixMe[missing-this-annot] | ||
preventDefault: function () { | ||
@@ -470,3 +429,3 @@ this.defaultPrevented = true; | ||
if (event.preventDefault) { | ||
event.preventDefault(); // $FlowFixMe - flow is not aware of `unknown` in IE | ||
event.preventDefault(); // $FlowFixMe[illegal-typeof] - flow is not aware of `unknown` in IE | ||
} else if (typeof event.returnValue !== 'unknown') { | ||
@@ -478,2 +437,3 @@ event.returnValue = false; | ||
}, | ||
// $FlowFixMe[missing-this-annot] | ||
stopPropagation: function () { | ||
@@ -487,3 +447,3 @@ var event = this.nativeEvent; | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); // $FlowFixMe - flow is not aware of `unknown` in IE | ||
event.stopPropagation(); // $FlowFixMe[illegal-typeof] - flow is not aware of `unknown` in IE | ||
} else if (typeof event.cancelBubble !== 'unknown') { | ||
@@ -516,3 +476,2 @@ // The ChangeEventPlugin registers a "propertychange" event for | ||
}); | ||
return SyntheticBaseEvent; | ||
@@ -538,3 +497,3 @@ } | ||
var UIEventInterface = _assign({}, EventInterface, { | ||
var UIEventInterface = assign({}, EventInterface, { | ||
view: 0, | ||
@@ -544,3 +503,3 @@ detail: 0 | ||
var SyntheticUIEvent = createSyntheticEvent(UIEventInterface); | ||
createSyntheticEvent(UIEventInterface); | ||
var lastMovementX; | ||
@@ -553,3 +512,5 @@ var lastMovementY; | ||
if (lastMouseEvent && event.type === 'mousemove') { | ||
lastMovementX = event.screenX - lastMouseEvent.screenX; | ||
// $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
lastMovementX = event.screenX - lastMouseEvent.screenX; // $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
lastMovementY = event.screenY - lastMouseEvent.screenY; | ||
@@ -570,3 +531,3 @@ } else { | ||
var MouseEventInterface = _assign({}, UIEventInterface, { | ||
var MouseEventInterface = assign({}, UIEventInterface, { | ||
screenX: 0, | ||
@@ -609,3 +570,3 @@ screenY: 0, | ||
var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface); | ||
createSyntheticEvent(MouseEventInterface); | ||
/** | ||
@@ -616,7 +577,7 @@ * @interface DragEvent | ||
var DragEventInterface = _assign({}, MouseEventInterface, { | ||
var DragEventInterface = assign({}, MouseEventInterface, { | ||
dataTransfer: 0 | ||
}); | ||
var SyntheticDragEvent = createSyntheticEvent(DragEventInterface); | ||
createSyntheticEvent(DragEventInterface); | ||
/** | ||
@@ -627,7 +588,7 @@ * @interface FocusEvent | ||
var FocusEventInterface = _assign({}, UIEventInterface, { | ||
var FocusEventInterface = assign({}, UIEventInterface, { | ||
relatedTarget: 0 | ||
}); | ||
var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface); | ||
createSyntheticEvent(FocusEventInterface); | ||
/** | ||
@@ -639,3 +600,3 @@ * @interface Event | ||
var AnimationEventInterface = _assign({}, EventInterface, { | ||
var AnimationEventInterface = assign({}, EventInterface, { | ||
animationName: 0, | ||
@@ -646,3 +607,3 @@ elapsedTime: 0, | ||
var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface); | ||
createSyntheticEvent(AnimationEventInterface); | ||
/** | ||
@@ -653,3 +614,3 @@ * @interface Event | ||
var ClipboardEventInterface = _assign({}, EventInterface, { | ||
var ClipboardEventInterface = assign({}, EventInterface, { | ||
clipboardData: function (event) { | ||
@@ -660,3 +621,3 @@ return 'clipboardData' in event ? event.clipboardData : window.clipboardData; | ||
var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface); | ||
createSyntheticEvent(ClipboardEventInterface); | ||
/** | ||
@@ -667,7 +628,7 @@ * @interface Event | ||
var CompositionEventInterface = _assign({}, EventInterface, { | ||
var CompositionEventInterface = assign({}, EventInterface, { | ||
data: 0 | ||
}); | ||
var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface); | ||
createSyntheticEvent(CompositionEventInterface); | ||
/** | ||
@@ -747,3 +708,4 @@ * Normalization of deprecated HTML5 `key` values | ||
// printable characters (normalized to `Unidentified`), ignore it. | ||
var key = normalizeKey[nativeEvent.key] || nativeEvent.key; | ||
var key = // $FlowFixMe[invalid-computed-prop] unable to index with a `mixed` value | ||
normalizeKey[nativeEvent.key] || nativeEvent.key; | ||
@@ -757,3 +719,4 @@ if (key !== 'Unidentified') { | ||
if (nativeEvent.type === 'keypress') { | ||
var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can | ||
var charCode = getEventCharCode( // $FlowFixMe[incompatible-call] unable to narrow to `KeyboardEvent` | ||
nativeEvent); // The enter-key is technically both printable and non-printable and can | ||
// thus be captured by `keypress`, no other non-printable key should. | ||
@@ -767,2 +730,3 @@ | ||
// `keyCode` value, almost all function keys have a universal value. | ||
// $FlowFixMe[invalid-computed-prop] unable to index with a `mixed` value | ||
return translateToKey[nativeEvent.keyCode] || 'Unidentified'; | ||
@@ -787,2 +751,4 @@ } | ||
// modifier keys exposed by the event. In this case, Lock-keys are not supported. | ||
// $FlowFixMe[missing-local-annot] | ||
// $FlowFixMe[missing-this-annot] | ||
@@ -810,3 +776,3 @@ function modifierStateGetter(keyArg) { | ||
var KeyboardEventInterface = _assign({}, UIEventInterface, { | ||
var KeyboardEventInterface = assign({}, UIEventInterface, { | ||
key: getEventKey, | ||
@@ -829,3 +795,4 @@ code: 0, | ||
if (event.type === 'keypress') { | ||
return getEventCharCode(event); | ||
return getEventCharCode( // $FlowFixMe[incompatible-call] unable to narrow to `KeyboardEvent` | ||
event); | ||
} | ||
@@ -852,3 +819,4 @@ | ||
if (event.type === 'keypress') { | ||
return getEventCharCode(event); | ||
return getEventCharCode( // $FlowFixMe[incompatible-call] unable to narrow to `KeyboardEvent` | ||
event); | ||
} | ||
@@ -864,3 +832,3 @@ | ||
var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface); | ||
createSyntheticEvent(KeyboardEventInterface); | ||
/** | ||
@@ -871,3 +839,3 @@ * @interface PointerEvent | ||
var PointerEventInterface = _assign({}, MouseEventInterface, { | ||
var PointerEventInterface = assign({}, MouseEventInterface, { | ||
pointerId: 0, | ||
@@ -885,3 +853,3 @@ width: 0, | ||
var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface); | ||
createSyntheticEvent(PointerEventInterface); | ||
/** | ||
@@ -892,3 +860,3 @@ * @interface TouchEvent | ||
var TouchEventInterface = _assign({}, UIEventInterface, { | ||
var TouchEventInterface = assign({}, UIEventInterface, { | ||
touches: 0, | ||
@@ -904,3 +872,3 @@ targetTouches: 0, | ||
var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface); | ||
createSyntheticEvent(TouchEventInterface); | ||
/** | ||
@@ -912,3 +880,3 @@ * @interface Event | ||
var TransitionEventInterface = _assign({}, EventInterface, { | ||
var TransitionEventInterface = assign({}, EventInterface, { | ||
propertyName: 0, | ||
@@ -919,3 +887,3 @@ elapsedTime: 0, | ||
var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface); | ||
createSyntheticEvent(TransitionEventInterface); | ||
/** | ||
@@ -926,11 +894,14 @@ * @interface WheelEvent | ||
var WheelEventInterface = _assign({}, MouseEventInterface, { | ||
var WheelEventInterface = assign({}, MouseEventInterface, { | ||
deltaX: function (event) { | ||
return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). | ||
'wheelDeltaX' in event ? -event.wheelDeltaX : 0; | ||
'wheelDeltaX' in event ? // $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
-event.wheelDeltaX : 0; | ||
}, | ||
deltaY: function (event) { | ||
return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). | ||
'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). | ||
'wheelDelta' in event ? -event.wheelDelta : 0; | ||
'wheelDeltaY' in event ? // $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
-event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). | ||
'wheelDelta' in event ? // $FlowFixMe[unsafe-arithmetic] assuming this is a number | ||
-event.wheelDelta : 0; | ||
}, | ||
@@ -945,3 +916,3 @@ deltaZ: 0, | ||
var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface); | ||
createSyntheticEvent(WheelEventInterface); | ||
@@ -953,47 +924,32 @@ /** | ||
function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) { | ||
var funcArgs = Array.prototype.slice.call(arguments, 3); | ||
var fakeNode = null; | ||
try { | ||
func.apply(context, funcArgs); | ||
} catch (error) { | ||
this.onError(error); | ||
{ | ||
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && // $FlowFixMe[method-unbinding] | ||
typeof document.createEvent === 'function') { | ||
fakeNode = document.createElement('react'); | ||
} | ||
} | ||
var invokeGuardedCallbackImpl = invokeGuardedCallbackProd; | ||
{ | ||
// In DEV mode, we swap out invokeGuardedCallback for a special version | ||
// that plays more nicely with the browser's DevTools. The idea is to preserve | ||
// "Pause on exceptions" behavior. Because React wraps all user-provided | ||
// functions in invokeGuardedCallback, and the production version of | ||
// invokeGuardedCallback uses a try-catch, all user exceptions are treated | ||
// like caught exceptions, and the DevTools won't pause unless the developer | ||
// takes the extra step of enabling pause on caught exceptions. This is | ||
// unintuitive, though, because even though React has caught the error, from | ||
// the developer's perspective, the error is uncaught. | ||
// | ||
// To preserve the expected "Pause on exceptions" behavior, we don't use a | ||
// try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake | ||
// DOM node, and call the user-provided callback from inside an event handler | ||
// for that fake event. If the callback throws, the error is "captured" using | ||
// a global event handler. But because the error happens in a different | ||
// event loop context, it does not interrupt the normal program flow. | ||
// Effectively, this gives us try-catch behavior without actually using | ||
// try-catch. Neat! | ||
// Check that the browser supports the APIs we need to implement our special | ||
// DEV version of invokeGuardedCallback | ||
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { | ||
var fakeNode = document.createElement('react'); | ||
invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) { | ||
// If document doesn't exist we know for sure we will crash in this method | ||
// when we call document.createEvent(). However this can cause confusing | ||
// errors: https://github.com/facebook/create-react-app/issues/3482 | ||
// So we preemptively throw with a better message instead. | ||
if (typeof document === 'undefined' || document === null) { | ||
throw new Error('The `document` global was defined when React was initialized, but is not ' + 'defined anymore. This can happen in a test environment if a component ' + 'schedules an update from an asynchronous callback, but the test has already ' + 'finished running. To solve this, you can either unmount the component at ' + 'the end of your test (and ensure that any asynchronous operations get ' + 'canceled in `componentWillUnmount`), or you can change the test itself ' + 'to be asynchronous.'); | ||
} | ||
function invokeGuardedCallbackImpl(name, func, context) { | ||
{ | ||
// In DEV mode, we use a special version | ||
// that plays more nicely with the browser's DevTools. The idea is to preserve | ||
// "Pause on exceptions" behavior. Because React wraps all user-provided | ||
// functions in invokeGuardedCallback, and the production version of | ||
// invokeGuardedCallback uses a try-catch, all user exceptions are treated | ||
// like caught exceptions, and the DevTools won't pause unless the developer | ||
// takes the extra step of enabling pause on caught exceptions. This is | ||
// unintuitive, though, because even though React has caught the error, from | ||
// the developer's perspective, the error is uncaught. | ||
// | ||
// To preserve the expected "Pause on exceptions" behavior, we don't use a | ||
// try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake | ||
// DOM node, and call the user-provided callback from inside an event handler | ||
// for that fake event. If the callback throws, the error is "captured" using | ||
// event loop context, it does not interrupt the normal program flow. | ||
// Effectively, this gives us try-catch behavior without actually using | ||
// try-catch. Neat! | ||
// fakeNode signifies we are in an environment with a document and window object | ||
if (fakeNode) { | ||
var evt = document.createEvent('Event'); | ||
@@ -1016,3 +972,3 @@ var didCall = false; // Keeps track of whether the user-provided callback threw an error. We | ||
function restoreAfterDispatch() { | ||
var restoreAfterDispatch = function () { | ||
// We immediately remove the callback from event listeners so that | ||
@@ -1030,15 +986,17 @@ // nested `invokeGuardedCallback` calls do not clash. Otherwise, a | ||
} | ||
} // Create an event handler for our fake event. We will synchronously | ||
}; // Create an event handler for our fake event. We will synchronously | ||
// dispatch our fake event using `dispatchEvent`. Inside the handler, we | ||
// call the user-provided callback. | ||
// $FlowFixMe[method-unbinding] | ||
var funcArgs = Array.prototype.slice.call(arguments, 3); | ||
var _funcArgs = Array.prototype.slice.call(arguments, 3); | ||
function callCallback() { | ||
var callCallback = function () { | ||
didCall = true; | ||
restoreAfterDispatch(); | ||
func.apply(context, funcArgs); | ||
restoreAfterDispatch(); // $FlowFixMe[incompatible-call] Flow doesn't understand the arguments splicing. | ||
func.apply(context, _funcArgs); | ||
didError = false; | ||
} // Create a global error event handler. We use this to capture the value | ||
}; // Create a global error event handler. We use this to capture the value | ||
// that was thrown. It's possible that this error handler will fire more | ||
@@ -1061,3 +1019,3 @@ // than once; for example, if non-React code also calls `dispatchEvent` | ||
function handleWindowError(event) { | ||
var handleWindowError = function (event) { | ||
error = event.error; | ||
@@ -1081,3 +1039,3 @@ didSetError = true; | ||
} | ||
} // Create a fake event type. | ||
}; // Create a fake event type. | ||
@@ -1114,3 +1072,5 @@ | ||
if (!didCall) { | ||
if (didCall) { | ||
return; | ||
} else { | ||
// Something went really wrong, and our event was not dispatched. | ||
@@ -1120,11 +1080,20 @@ // https://github.com/facebook/react/issues/16734 | ||
// Fall back to the production implementation. | ||
restoreAfterDispatch(); | ||
return invokeGuardedCallbackProd.apply(this, arguments); | ||
restoreAfterDispatch(); // we fall through and call the prod version instead | ||
} | ||
}; | ||
} // We only get here if we are in an environment that either does not support the browser | ||
// variant or we had trouble getting the browser to emit the error. | ||
// $FlowFixMe[method-unbinding] | ||
var funcArgs = Array.prototype.slice.call(arguments, 3); | ||
try { | ||
// $FlowFixMe[incompatible-call] Flow doesn't understand the arguments splicing. | ||
func.apply(context, funcArgs); | ||
} catch (error) { | ||
this.onError(error); | ||
} | ||
} | ||
} | ||
var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; | ||
var hasError = false; | ||
@@ -1158,3 +1127,3 @@ var caughtError = null; // Used by event system to capture/rethrow the first error. | ||
caughtError = null; | ||
invokeGuardedCallbackImpl$1.apply(reporter, arguments); | ||
invokeGuardedCallbackImpl.apply(reporter, arguments); | ||
} | ||
@@ -1245,3 +1214,3 @@ /** | ||
while (true) { | ||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionComponent) { | ||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionComponent || (node.tag === HostHoistable ) || (node.tag === HostSingleton )) { | ||
var publicInst = node.stateNode; | ||
@@ -1574,3 +1543,5 @@ | ||
var executeDispatchesAndRelease = function (event) { | ||
function executeDispatchesAndRelease(event | ||
/* ReactSyntheticEvent */ | ||
) { | ||
if (event) { | ||
@@ -1583,3 +1554,3 @@ executeDispatchesInOrder(event); | ||
} | ||
}; | ||
} | ||
@@ -1597,3 +1568,3 @@ function isInteractive(tag) { | ||
// do the portal feature. | ||
} while (inst && inst.tag !== HostComponent); | ||
} while (inst && inst.tag !== HostComponent && (inst.tag !== HostSingleton)); | ||
@@ -1656,3 +1627,5 @@ if (inst) { | ||
function getListener(inst, registrationName) { | ||
function getListener(inst | ||
/* Fiber */ | ||
, registrationName) { | ||
// TODO: shouldPreventMouseEvent is DOM-specific and definitely should not | ||
@@ -1785,5 +1758,4 @@ // live here; needs to be moved to a better place soon | ||
event.persist(); | ||
assign(event, eventData); | ||
_assign(event, eventData); | ||
if (directDispatchEventTypes.has(eventType)) { | ||
@@ -1837,2 +1809,2 @@ accumulateDirectDispatchesSingle(event); | ||
}))); | ||
})); |
@@ -1,5 +0,6 @@ | ||
/** @license React vundefined | ||
/** | ||
* @license React | ||
* react-dom-test-utils.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -9,25 +10,25 @@ * This source code is licensed under the MIT license found in the | ||
*/ | ||
(function(){'use strict';(function(f,q){"object"===typeof exports&&"undefined"!==typeof module?q(exports,require("react-dom")):"function"===typeof define&&define.amd?define(["exports","react","react-dom"],q):(f=f||self,q(f.ReactTestUtils={},f.React,f.ReactDOM))})(this,function(f,q,C){function K(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&4098)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function L(a){if(K(a)!==a)throw Error("Unable to find node on an unmounted component."); | ||
}function V(a){var b=a.alternate;if(!b){b=K(a);if(null===b)throw Error("Unable to find node on an unmounted component.");return b!==a?null:a}for(var c=a,d=b;;){var g=c.return;if(null===g)break;var h=g.alternate;if(null===h){d=g.return;if(null!==d){c=d;continue}break}if(g.child===h.child){for(h=g.child;h;){if(h===c)return L(g),a;if(h===d)return L(g),b;h=h.sibling}throw Error("Unable to find node on an unmounted component.");}if(c.return!==d.return)c=g,d=h;else{for(var e=!1,m=g.child;m;){if(m===c){e= | ||
!0;c=g;d=h;break}if(m===d){e=!0;d=g;c=h;break}m=m.sibling}if(!e){for(m=h.child;m;){if(m===c){e=!0;c=h;d=g;break}if(m===d){e=!0;d=h;c=g;break}m=m.sibling}if(!e)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");}}if(c.alternate!==d)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");}if(3!==c.tag)throw Error("Unable to find node on an unmounted component."); | ||
return c.stateNode.current===c?a:b}function D(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function x(){return!0}function M(){return!1}function n(a){function b(c,b,g,h,e){this._reactName=c;this._targetInst=g;this.type=b;this.nativeEvent=h;this.target=e;this.currentTarget=null;for(var d in a)a.hasOwnProperty(d)&&(c=a[d],this[d]=c?c(h):h[d]);this.isDefaultPrevented=(null!=h.defaultPrevented?h.defaultPrevented:!1===h.returnValue)? | ||
x:M;this.isPropagationStopped=M;return this}k(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=x)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=x)},persist:function(){},isPersistent:x});return b}function W(a){var b=this.nativeEvent; | ||
return b.getModifierState?b.getModifierState(a):(a=X[a])?!!b[a]:!1}function E(a){return W}function Y(a,b,c,d,g,h,e,f,k){v=!1;y=null;Z.apply(aa,arguments)}function ba(a,b,c,d,g,h,e,f,k){Y.apply(this,arguments);if(v){if(v){var m=y;v=!1;y=null}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");z||(z=!0,F=m)}}function ca(a){}function da(a,b){if(!a)return[];a=V(a);if(!a)return[];for(var c=a,d=[];;){if(5===c.tag|| | ||
6===c.tag||1===c.tag||0===c.tag){var g=c.stateNode;b(g)&&d.push(g)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return d;for(;!c.sibling;){if(!c.return||c.return===a)return d;c=c.return}c.sibling.return=c.return;c=c.sibling}}}function t(a,b){if(a&&!a._reactInternals){var c=String(a);a=G(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;throw Error(b+"(...): the first argument must be a React class instance. Instead received: "+ | ||
(a+"."));}}function A(a){return!(!a||1!==a.nodeType||!a.tagName)}function H(a){return A(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState}function N(a,b){return H(a)?a._reactInternals.type===b:!1}function B(a,b){t(a,"findAllInRenderedTree");return a?da(a._reactInternals,b):[]}function O(a,b){t(a,"scryRenderedDOMComponentsWithClass");return B(a,function(a){if(A(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var g=c.split(/\s+/);if(!G(b)){if(void 0=== | ||
b)throw Error("TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.");b=b.split(/\s+/)}return b.every(function(a){return-1!==g.indexOf(a)})}return!1})}function P(a,b){t(a,"scryRenderedDOMComponentsWithTag");return B(a,function(a){return A(a)&&a.tagName.toUpperCase()===b.toUpperCase()})}function Q(a,b){t(a,"scryRenderedComponentsWithType");return B(a,function(a){return N(a,b)})}function R(a,b,c){var d=a.type||"unknown-event";a.currentTarget=ea(c);ba(d,b,void 0,a); | ||
a.currentTarget=null}function S(a,b,c){for(var d=[];a;){d.push(a);do a=a.return;while(a&&5!==a.tag);a=a?a:null}for(a=d.length;0<a--;)b(d[a],"captured",c);for(a=0;a<d.length;a++)b(d[a],"bubbled",c)}function T(a,b){var c=a.stateNode;if(!c)return null;var d=fa(c);if(!d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d= | ||
!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw Error("Expected `"+b+"` listener to be a function, instead got a value of `"+typeof c+"` type.");return c}function ha(a,b,c){a&&c&&c._reactName&&(b=T(a,c._reactName))&&(null==c._dispatchListeners&&(c._dispatchListeners=[]),null==c._dispatchInstances&&(c._dispatchInstances=[]),c._dispatchListeners.push(b),c._dispatchInstances.push(a))}function ia(a, | ||
b,c){var d=c._reactName;"captured"===b&&(d+="Capture");if(b=T(a,d))null==c._dispatchListeners&&(c._dispatchListeners=[]),null==c._dispatchInstances&&(c._dispatchInstances=[]),c._dispatchListeners.push(b),c._dispatchInstances.push(a)}function ja(a){return function(b,c){if(q.isValidElement(b))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering."); | ||
if(H(b))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.");var d="on"+a[0].toUpperCase()+a.slice(1),g=new ca;g.target=b;g.type=a.toLowerCase();var f=ka(b),e=new la(d,g.type,f,g,b);e.persist();k(e,c);ma.has(a)?e&&e._reactName&&ha(e._targetInst,null,e):e&&e._reactName&&S(e._targetInst,ia,e);C.unstable_batchedUpdates(function(){na(b);if(e){var a=e._dispatchListeners,c=e._dispatchInstances; | ||
if(G(a))for(var d=0;d<a.length&&!e.isPropagationStopped();d++)R(e,a[d],c[d]);else a&&R(e,a,c);e._dispatchListeners=null;e._dispatchInstances=null;e.isPersistent()||e.constructor.release(e)}if(z)throw a=F,z=!1,F=null,a;});oa()}}var k=q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},la=n(r),u=k({},r,{view:0,detail:0});n(u);var I,J,w,l=k({},u,{screenX:0,screenY:0,clientX:0, | ||
clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:E,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if("movementX"in a)return a.movementX;a!==w&&(w&&"mousemove"===a.type?(I=a.screenX-w.screenX,J=a.screenY-w.screenY):J=I=0,w=a);return I},movementY:function(a){return"movementY"in a?a.movementY:J}});n(l);var p=k({},l,{dataTransfer:0});n(p);p=k({}, | ||
u,{relatedTarget:0});n(p);p=k({},r,{animationName:0,elapsedTime:0,pseudoElement:0});n(p);p=k({},r,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}});n(p);p=k({},r,{data:0});n(p);var pa={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qa={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control", | ||
18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},X={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};p=k({},u,{key:function(a){if(a.key){var b=pa[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"=== | ||
a.type?(a=D(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?qa[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:E,charCode:function(a){return"keypress"===a.type?D(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?D(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}});n(p);p=k({},l,{pointerId:0,width:0,height:0,pressure:0, | ||
tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0});n(p);u=k({},u,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:E});n(u);r=k({},r,{propertyName:0,elapsedTime:0,pseudoElement:0});n(r);l=k({},l,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0});n(l);var Z=function(a, | ||
b,c,d,f,h,e,k,l){var g=Array.prototype.slice.call(arguments,3);try{b.apply(c,g)}catch(ra){this.onError(ra)}},v=!1,y=null,z=!1,F=null,aa={onError:function(a){v=!0;y=a}},G=Array.isArray;l=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;var ka=l[0],ea=l[1],fa=l[2],na=l[3],oa=l[4];l=q.unstable_act;var U={},ma=new Set(["mouseEnter","mouseLeave","pointerEnter","pointerLeave"]),sa="blur cancel click close contextMenu copy cut auxClick doubleClick dragEnd dragStart drop focus input invalid keyDown keyPress keyUp mouseDown mouseUp paste pause play pointerCancel pointerDown pointerUp rateChange reset resize seeked submit touchCancel touchEnd touchStart volumeChange drag dragEnter dragExit dragLeave dragOver mouseMove mouseOut mouseOver pointerMove pointerOut pointerOver scroll toggle touchMove wheel abort animationEnd animationIteration animationStart canPlay canPlayThrough durationChange emptied encrypted ended error gotPointerCapture load loadedData loadedMetadata loadStart lostPointerCapture playing progress seeking stalled suspend timeUpdate transitionEnd waiting mouseEnter mouseLeave pointerEnter pointerLeave change select beforeInput compositionEnd compositionStart compositionUpdate".split(" "); | ||
(function(){sa.forEach(function(a){U[a]=ja(a)})})();f.Simulate=U;f.act=l;f.findAllInRenderedTree=B;f.findRenderedComponentWithType=function(a,b){t(a,"findRenderedComponentWithType");a=Q(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]};f.findRenderedDOMComponentWithClass=function(a,b){t(a,"findRenderedDOMComponentWithClass");a=O(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+ | ||
b);return a[0]};f.findRenderedDOMComponentWithTag=function(a,b){t(a,"findRenderedDOMComponentWithTag");a=P(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]};f.isCompositeComponent=H;f.isCompositeComponentWithType=N;f.isDOMComponent=A;f.isDOMComponentElement=function(a){return!!(a&&q.isValidElement(a)&&a.tagName)};f.isElement=function(a){return q.isValidElement(a)};f.isElementOfType=function(a,b){return q.isValidElement(a)&&a.type===b}; | ||
f.mockComponent=function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return q.createElement(b,null,this.props.children)});return this};f.nativeTouchData=function(a,b){return{touches:[{pageX:a,pageY:b}]}};f.renderIntoDocument=function(a){var b=document.createElement("div");return C.render(a,b)};f.scryRenderedComponentsWithType=Q;f.scryRenderedDOMComponentsWithClass=O;f.scryRenderedDOMComponentsWithTag=P;f.traverseTwoPhase=S}); | ||
(function(){'use strict';(function(k,q){"object"===typeof exports&&"undefined"!==typeof module?q(exports,require("react"),require("react-dom")):"function"===typeof define&&define.amd?define(["exports","react","react-dom"],q):(k="undefined"!==typeof globalThis?globalThis:k||self,q(k.ReactTestUtils={},k.React,k.ReactDOM))})(this,function(k,q,E){function M(a){var c=a,b=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,0!==(c.flags&4098)&&(b=c.return),a=c.return;while(a)}return 3===c.tag?b:null}function N(a){if(M(a)!== | ||
a)throw Error("Unable to find node on an unmounted component.");}function X(a){var c=a.alternate;if(!c){c=M(a);if(null===c)throw Error("Unable to find node on an unmounted component.");return c!==a?null:a}for(var b=a,d=c;;){var f=b.return;if(null===f)break;var g=f.alternate;if(null===g){d=f.return;if(null!==d){b=d;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===b)return N(f),a;if(g===d)return N(f),c;g=g.sibling}throw Error("Unable to find node on an unmounted component.");}if(b.return!== | ||
d.return)b=f,d=g;else{for(var e=!1,h=f.child;h;){if(h===b){e=!0;b=f;d=g;break}if(h===d){e=!0;d=f;b=g;break}h=h.sibling}if(!e){for(h=g.child;h;){if(h===b){e=!0;b=g;d=f;break}if(h===d){e=!0;d=g;b=f;break}h=h.sibling}if(!e)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");}}if(b.alternate!==d)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."); | ||
}if(3!==b.tag)throw Error("Unable to find node on an unmounted component.");return b.stateNode.current===b?a:c}function F(a){var c=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===c&&(a=13)):a=c;10===a&&(a=13);return 32<=a||13===a?a:0}function y(){return!0}function O(){return!1}function n(a){function c(b,d,f,g,e){this._reactName=b;this._targetInst=f;this.type=d;this.nativeEvent=g;this.target=e;this.currentTarget=null;for(var h in a)a.hasOwnProperty(h)&&(b=a[h],this[h]=b?b(g):g[h]);this.isDefaultPrevented= | ||
(null!=g.defaultPrevented?g.defaultPrevented:!1===g.returnValue)?y:O;this.isPropagationStopped=O;return this}l(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var b=this.nativeEvent;b&&(b.preventDefault?b.preventDefault():"unknown"!==typeof b.returnValue&&(b.returnValue=!1),this.isDefaultPrevented=y)},stopPropagation:function(){var b=this.nativeEvent;b&&(b.stopPropagation?b.stopPropagation():"unknown"!==typeof b.cancelBubble&&(b.cancelBubble=!0),this.isPropagationStopped=y)},persist:function(){}, | ||
isPersistent:y});return c}function Y(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=Z[a])?!!c[a]:!1}function G(a){return Y}function aa(a,c,b){var d=Array.prototype.slice.call(arguments,3);try{c.apply(b,d)}catch(f){this.onError(f)}}function ba(a,c,b,d,f,g,e,h,z){w=!1;A=null;aa.apply(ca,arguments)}function da(a,c,b,d,f,g,e,h,z){ba.apply(this,arguments);if(w){if(w){var v=A;w=!1;A=null}else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."); | ||
B||(B=!0,H=v)}}function ea(a){}function fa(a,c){if(!a)return[];a=X(a);if(!a)return[];for(var b=a,d=[];;){if(5===b.tag||6===b.tag||1===b.tag||0===b.tag||26===b.tag||27===b.tag){var f=b.stateNode;c(f)&&d.push(f)}if(b.child)b.child.return=b,b=b.child;else{if(b===a)return d;for(;!b.sibling;){if(!b.return||b.return===a)return d;b=b.return}b.sibling.return=b.return;b=b.sibling}}}function t(a,c){if(a&&!a._reactInternals){var b=String(a);a=I(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"=== | ||
b?"object with keys {"+Object.keys(a).join(", ")+"}":b;throw Error(c+"(...): the first argument must be a React class instance. Instead received: "+(a+"."));}}function C(a){return!(!a||1!==a.nodeType||!a.tagName)}function J(a){return C(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState}function P(a,c){return J(a)?a._reactInternals.type===c:!1}function D(a,c){t(a,"findAllInRenderedTree");return a?fa(a._reactInternals,c):[]}function Q(a,c){t(a,"scryRenderedDOMComponentsWithClass"); | ||
return D(a,function(b){if(C(b)){var d=b.className;"string"!==typeof d&&(d=b.getAttribute("class")||"");var f=d.split(/\s+/);if(!I(c)){if(void 0===c)throw Error("TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.");c=c.split(/\s+/)}return c.every(function(g){return-1!==f.indexOf(g)})}return!1})}function R(a,c){t(a,"scryRenderedDOMComponentsWithTag");return D(a,function(b){return C(b)&&b.tagName.toUpperCase()===c.toUpperCase()})}function S(a,c){t(a,"scryRenderedComponentsWithType"); | ||
return D(a,function(b){return P(b,c)})}function T(a,c,b){var d=a.type||"unknown-event";a.currentTarget=ha(b);da(d,c,void 0,a);a.currentTarget=null}function U(a,c,b){for(var d=[];a;){d.push(a);do a=a.return;while(a&&5!==a.tag&&27!==a.tag);a=a?a:null}for(a=d.length;0<a--;)c(d[a],"captured",b);for(a=0;a<d.length;a++)c(d[a],"bubbled",b)}function V(a,c){var b=a.stateNode;if(!b)return null;var d=ia(b);if(!d)return null;b=d[c];a:switch(c){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d= | ||
!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(b&&"function"!==typeof b)throw Error("Expected `"+c+"` listener to be a function, instead got a value of `"+typeof b+"` type.");return b}function ja(a,c,b){a&&b&&b._reactName&&(c=V(a,b._reactName))&&(null==b._dispatchListeners&&(b._dispatchListeners=[]),null==b._dispatchInstances&&(b._dispatchInstances=[]),b._dispatchListeners.push(c),b._dispatchInstances.push(a))}function ka(a, | ||
c,b){var d=b._reactName;"captured"===c&&(d+="Capture");if(c=V(a,d))null==b._dispatchListeners&&(b._dispatchListeners=[]),null==b._dispatchInstances&&(b._dispatchInstances=[]),b._dispatchListeners.push(c),b._dispatchInstances.push(a)}function la(a){return function(c,b){if(q.isValidElement(c))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering."); | ||
if(J(c))throw Error("TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.");var d="on"+a[0].toUpperCase()+a.slice(1),f=new ea;f.target=c;f.type=a.toLowerCase();var g=ma(c),e=new na(d,f.type,g,f,c);e.persist();l(e,b);oa.has(a)?e&&e._reactName&&ja(e._targetInst,null,e):e&&e._reactName&&U(e._targetInst,ka,e);E.unstable_batchedUpdates(function(){pa(c);if(e){var h=e._dispatchListeners,z=e._dispatchInstances; | ||
if(I(h))for(var v=0;v<h.length&&!e.isPropagationStopped();v++)T(e,h[v],z[v]);else h&&T(e,h,z);e._dispatchListeners=null;e._dispatchInstances=null;e.isPersistent()||e.constructor.release(e)}if(B)throw h=H,B=!1,H=null,h;});qa()}}var l=Object.assign,r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},na=n(r),u=l({},r,{view:0,detail:0});n(u);var K,L,x,m=l({},u,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0, | ||
altKey:0,metaKey:0,getModifierState:G,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if("movementX"in a)return a.movementX;a!==x&&(x&&"mousemove"===a.type?(K=a.screenX-x.screenX,L=a.screenY-x.screenY):L=K=0,x=a);return K},movementY:function(a){return"movementY"in a?a.movementY:L}});n(m);var p=l({},m,{dataTransfer:0});n(p);p=l({},u,{relatedTarget:0});n(p);p=l({},r,{animationName:0, | ||
elapsedTime:0,pseudoElement:0});n(p);p=l({},r,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}});n(p);p=l({},r,{data:0});n(p);var ra={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sa={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ", | ||
33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Z={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};p=l({},u,{key:function(a){if(a.key){var c=ra[a.key]||a.key;if("Unidentified"!==c)return c}return"keypress"===a.type?(a=F(a),13===a?"Enter":String.fromCharCode(a)): | ||
"keydown"===a.type||"keyup"===a.type?sa[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:G,charCode:function(a){return"keypress"===a.type?F(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?F(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}});n(p);p=l({},m,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0, | ||
isPrimary:0});n(p);u=l({},u,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:G});n(u);r=l({},r,{propertyName:0,elapsedTime:0,pseudoElement:0});n(r);m=l({},m,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0});n(m);var w=!1,A=null,B=!1,H=null,ca={onError:function(a){w=!0;A=a}},I=Array.isArray; | ||
m=E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;var ma=m[0],ha=m[1],ia=m[2],pa=m[3],qa=m[4];m=q.unstable_act;var W={},oa=new Set(["mouseEnter","mouseLeave","pointerEnter","pointerLeave"]),ta="blur cancel click close contextMenu copy cut auxClick doubleClick dragEnd dragStart drop focus input invalid keyDown keyPress keyUp mouseDown mouseUp paste pause play pointerCancel pointerDown pointerUp rateChange reset resize seeked submit touchCancel touchEnd touchStart volumeChange drag dragEnter dragExit dragLeave dragOver mouseMove mouseOut mouseOver pointerMove pointerOut pointerOver scroll toggle touchMove wheel abort animationEnd animationIteration animationStart canPlay canPlayThrough durationChange emptied encrypted ended error gotPointerCapture load loadedData loadedMetadata loadStart lostPointerCapture playing progress seeking stalled suspend timeUpdate transitionEnd waiting mouseEnter mouseLeave pointerEnter pointerLeave change select beforeInput compositionEnd compositionStart compositionUpdate".split(" "); | ||
(function(){ta.forEach(function(a){W[a]=la(a)})})();k.Simulate=W;k.act=m;k.findAllInRenderedTree=D;k.findRenderedComponentWithType=function(a,c){t(a,"findRenderedComponentWithType");a=S(a,c);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+c);return a[0]};k.findRenderedDOMComponentWithClass=function(a,c){t(a,"findRenderedDOMComponentWithClass");a=Q(a,c);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+ | ||
c);return a[0]};k.findRenderedDOMComponentWithTag=function(a,c){t(a,"findRenderedDOMComponentWithTag");a=R(a,c);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+c);return a[0]};k.isCompositeComponent=J;k.isCompositeComponentWithType=P;k.isDOMComponent=C;k.isDOMComponentElement=function(a){return!!(a&&q.isValidElement(a)&&a.tagName)};k.isElement=function(a){return q.isValidElement(a)};k.isElementOfType=function(a,c){return q.isValidElement(a)&&a.type===c}; | ||
k.mockComponent=function(a,c){c=c||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return q.createElement(c,null,this.props.children)});return this};k.nativeTouchData=function(a,c){return{touches:[{pageX:a,pageY:c}]}};k.renderIntoDocument=function(a){var c=document.createElement("div");return E.render(a,c)};k.scryRenderedComponentsWithType=S;k.scryRenderedDOMComponentsWithClass=Q;k.scryRenderedDOMComponentsWithTag=R;k.traverseTwoPhase=U}); | ||
})(); |
@@ -35,5 +35,5 @@ 'use strict'; | ||
checkDCE(); | ||
module.exports = require('./cjs/react-dom-testing.production.min.js'); | ||
module.exports = require('./cjs/react-dom-unstable_testing.production.min.js'); | ||
} else { | ||
module.exports = require('./cjs/react-dom-testing.development.js'); | ||
module.exports = require('./cjs/react-dom-unstable_testing.development.js'); | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
9130197
3
53
183997
61
18
34
+ Addedreact@0.0.0-experimental-720de7f81a-20241220(transitive)
+ Addedscheduler@0.0.0-experimental-720de7f81a-20241220(transitive)
- Removedobject-assign@^4.1.1
- Removedobject-assign@4.1.1(transitive)
- Removedreact@0.0.0-experimental-71d16750c-20211202(transitive)
- Removedscheduler@0.0.0-experimental-71d16750c-20211202(transitive)