|
7 | 7 | * @noflow
|
8 | 8 | * @nolint
|
9 | 9 | * @preventMunge
|
10 |
| - * @generated SignedSource<<aeb13744feb3c4d52877eeb7f7905a51>> |
| 10 | + * @generated SignedSource<<685bf7c576463dfbb4cf704d94b8c71b>> |
11 | 11 | */
|
12 | 12 |
|
13 | 13 | "use strict";
|
@@ -5862,6 +5862,20 @@ to return true:wantsResponderID| |
|
5862 | 5862 |
|
5863 | 5863 | return null;
|
5864 | 5864 | }
|
| 5865 | + function doesFiberContain(parentFiber, childFiber) { |
| 5866 | + var node = childFiber; |
| 5867 | + var parentFiberAlternate = parentFiber.alternate; |
| 5868 | + |
| 5869 | + while (node !== null) { |
| 5870 | + if (node === parentFiber || node === parentFiberAlternate) { |
| 5871 | + return true; |
| 5872 | + } |
| 5873 | + |
| 5874 | + node = node.return; |
| 5875 | + } |
| 5876 | + |
| 5877 | + return false; |
| 5878 | + } |
5865 | 5879 |
|
5866 | 5880 | function describeBuiltInComponentFrame(name, source, ownerFn) {
|
5867 | 5881 | {
|
@@ -27815,7 +27829,7 @@ to return true:wantsResponderID| |
|
27815 | 27829 | return root;
|
27816 | 27830 | }
|
27817 | 27831 |
|
27818 |
| - var ReactVersion = "18.3.0-canary-c34d6f72"; |
| 27832 | + var ReactVersion = "18.3.0-canary-ad95fe0f"; |
27819 | 27833 |
|
27820 | 27834 | function createPortal$1(
|
27821 | 27835 | children,
|
@@ -28357,6 +28371,158 @@ to return true:wantsResponderID| |
|
28357 | 28371 | return instanceCache.get(tag) || null;
|
28358 | 28372 | }
|
28359 | 28373 |
|
| 28374 | + /** |
| 28375 | + * In the future, we should cleanup callbacks by cancelling them instead of |
| 28376 | + * using this. |
| 28377 | + */ |
| 28378 | + function mountSafeCallback_NOT_REALLY_SAFE(context, callback) { |
| 28379 | + return function () { |
| 28380 | + if (!callback) { |
| 28381 | + return undefined; |
| 28382 | + } // This protects against createClass() components. |
| 28383 | + // We don't know if there is code depending on it. |
| 28384 | + // We intentionally don't use isMounted() because even accessing |
| 28385 | + // isMounted property on a React ES6 class will trigger a warning. |
| 28386 | + |
| 28387 | + if (typeof context.__isMounted === "boolean") { |
| 28388 | + if (!context.__isMounted) { |
| 28389 | + return undefined; |
| 28390 | + } |
| 28391 | + } // FIXME: there used to be other branches that protected |
| 28392 | + // against unmounted host components. But RN host components don't |
| 28393 | + // define isMounted() anymore, so those checks didn't do anything. |
| 28394 | + // They caused false positive warning noise so we removed them: |
| 28395 | + // https://github.com/facebook/react-native/issues/18868#issuecomment-413579095 |
| 28396 | + // However, this means that the callback is NOT guaranteed to be safe |
| 28397 | + // for host components. The solution we should implement is to make |
| 28398 | + // UIManager.measure() and similar calls truly cancelable. Then we |
| 28399 | + // can change our own code calling them to cancel when something unmounts. |
| 28400 | + |
| 28401 | + return callback.apply(context, arguments); |
| 28402 | + }; |
| 28403 | + } |
| 28404 | + function warnForStyleProps(props, validAttributes) { |
| 28405 | + { |
| 28406 | + for (var key in validAttributes.style) { |
| 28407 | + if (!(validAttributes[key] || props[key] === undefined)) { |
| 28408 | + error( |
| 28409 | + "You are setting the style `{ %s" + |
| 28410 | + ": ... }` as a prop. You " + |
| 28411 | + "should nest it in a style object. " + |
| 28412 | + "E.g. `{ style: { %s" + |
| 28413 | + ": ... } }`", |
| 28414 | + key, |
| 28415 | + key |
| 28416 | + ); |
| 28417 | + } |
| 28418 | + } |
| 28419 | + } |
| 28420 | + } |
| 28421 | + |
| 28422 | + var ReactNativeFiberHostComponent = /*#__PURE__*/ (function () { |
| 28423 | + function ReactNativeFiberHostComponent( |
| 28424 | + tag, |
| 28425 | + viewConfig, |
| 28426 | + internalInstanceHandleDEV |
| 28427 | + ) { |
| 28428 | + this._children = void 0; |
| 28429 | + this._nativeTag = void 0; |
| 28430 | + this._internalFiberInstanceHandleDEV = void 0; |
| 28431 | + this.viewConfig = void 0; |
| 28432 | + this._nativeTag = tag; |
| 28433 | + this._children = []; |
| 28434 | + this.viewConfig = viewConfig; |
| 28435 | + |
| 28436 | + { |
| 28437 | + this._internalFiberInstanceHandleDEV = internalInstanceHandleDEV; |
| 28438 | + } |
| 28439 | + } |
| 28440 | + |
| 28441 | + var _proto = ReactNativeFiberHostComponent.prototype; |
| 28442 | + |
| 28443 | + _proto.blur = function blur() { |
| 28444 | + ReactNativePrivateInterface.TextInputState.blurTextInput(this); |
| 28445 | + }; |
| 28446 | + |
| 28447 | + _proto.focus = function focus() { |
| 28448 | + ReactNativePrivateInterface.TextInputState.focusTextInput(this); |
| 28449 | + }; |
| 28450 | + |
| 28451 | + _proto.measure = function measure(callback) { |
| 28452 | + ReactNativePrivateInterface.UIManager.measure( |
| 28453 | + this._nativeTag, |
| 28454 | + mountSafeCallback_NOT_REALLY_SAFE(this, callback) |
| 28455 | + ); |
| 28456 | + }; |
| 28457 | + |
| 28458 | + _proto.measureInWindow = function measureInWindow(callback) { |
| 28459 | + ReactNativePrivateInterface.UIManager.measureInWindow( |
| 28460 | + this._nativeTag, |
| 28461 | + mountSafeCallback_NOT_REALLY_SAFE(this, callback) |
| 28462 | + ); |
| 28463 | + }; |
| 28464 | + |
| 28465 | + _proto.measureLayout = function measureLayout( |
| 28466 | + relativeToNativeNode, |
| 28467 | + onSuccess, |
| 28468 | + onFail |
| 28469 | + /* currently unused */ |
| 28470 | + ) { |
| 28471 | + var relativeNode; |
| 28472 | + |
| 28473 | + if (typeof relativeToNativeNode === "number") { |
| 28474 | + // Already a node handle |
| 28475 | + relativeNode = relativeToNativeNode; |
| 28476 | + } else { |
| 28477 | + var nativeNode = relativeToNativeNode; |
| 28478 | + |
| 28479 | + if (nativeNode._nativeTag) { |
| 28480 | + relativeNode = nativeNode._nativeTag; |
| 28481 | + } |
| 28482 | + } |
| 28483 | + |
| 28484 | + if (relativeNode == null) { |
| 28485 | + { |
| 28486 | + error( |
| 28487 | + "Warning: ref.measureLayout must be called with a node handle or a ref to a native component." |
| 28488 | + ); |
| 28489 | + } |
| 28490 | + |
| 28491 | + return; |
| 28492 | + } |
| 28493 | + |
| 28494 | + ReactNativePrivateInterface.UIManager.measureLayout( |
| 28495 | + this._nativeTag, |
| 28496 | + relativeNode, |
| 28497 | + mountSafeCallback_NOT_REALLY_SAFE(this, onFail), |
| 28498 | + mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess) |
| 28499 | + ); |
| 28500 | + }; |
| 28501 | + |
| 28502 | + _proto.setNativeProps = function setNativeProps(nativeProps) { |
| 28503 | + { |
| 28504 | + warnForStyleProps(nativeProps, this.viewConfig.validAttributes); |
| 28505 | + } |
| 28506 | + |
| 28507 | + var updatePayload = create( |
| 28508 | + nativeProps, |
| 28509 | + this.viewConfig.validAttributes |
| 28510 | + ); // Avoid the overhead of bridge calls if there's no update. |
| 28511 | + // This is an expensive no-op for Android, and causes an unnecessary |
| 28512 | + // view invalidation for certain components (eg RCTTextInput) on iOS. |
| 28513 | + |
| 28514 | + if (updatePayload != null) { |
| 28515 | + ReactNativePrivateInterface.UIManager.updateView( |
| 28516 | + this._nativeTag, |
| 28517 | + this.viewConfig.uiViewClassName, |
| 28518 | + updatePayload |
| 28519 | + ); |
| 28520 | + } |
| 28521 | + }; |
| 28522 | + |
| 28523 | + return ReactNativeFiberHostComponent; |
| 28524 | + })(); |
| 28525 | + |
28360 | 28526 | var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
28361 | 28527 | function findHostInstance_DEPRECATED(componentOrHandle) {
|
28362 | 28528 | {
|
@@ -28545,6 +28711,49 @@ to return true:wantsResponderID| |
|
28545 | 28711 | internalInstanceHandle.stateNode && // $FlowExpectedError[incompatible-use]
|
28546 | 28712 | internalInstanceHandle.stateNode.node
|
28547 | 28713 | );
|
| 28714 | + } // Remove this once Paper is no longer supported and DOM Node API are enabled by default in RN. |
| 28715 | + |
| 28716 | + function isChildPublicInstance(parentInstance, childInstance) { |
| 28717 | + { |
| 28718 | + // Paper |
| 28719 | + if ( |
| 28720 | + parentInstance instanceof ReactNativeFiberHostComponent || |
| 28721 | + childInstance instanceof ReactNativeFiberHostComponent |
| 28722 | + ) { |
| 28723 | + if ( |
| 28724 | + parentInstance instanceof ReactNativeFiberHostComponent && |
| 28725 | + childInstance instanceof ReactNativeFiberHostComponent |
| 28726 | + ) { |
| 28727 | + return doesFiberContain( |
| 28728 | + parentInstance._internalFiberInstanceHandleDEV, |
| 28729 | + childInstance._internalFiberInstanceHandleDEV |
| 28730 | + ); |
| 28731 | + } // Means that one instance is from Fabric and other is from Paper. |
| 28732 | + |
| 28733 | + return false; |
| 28734 | + } |
| 28735 | + |
| 28736 | + var parentInternalInstanceHandle = |
| 28737 | + ReactNativePrivateInterface.getInternalInstanceHandleFromPublicInstance( |
| 28738 | + parentInstance |
| 28739 | + ); |
| 28740 | + var childInternalInstanceHandle = |
| 28741 | + ReactNativePrivateInterface.getInternalInstanceHandleFromPublicInstance( |
| 28742 | + childInstance |
| 28743 | + ); // Fabric |
| 28744 | + |
| 28745 | + if ( |
| 28746 | + parentInternalInstanceHandle != null && |
| 28747 | + childInternalInstanceHandle != null |
| 28748 | + ) { |
| 28749 | + return doesFiberContain( |
| 28750 | + parentInternalInstanceHandle, |
| 28751 | + childInternalInstanceHandle |
| 28752 | + ); |
| 28753 | + } |
| 28754 | + |
| 28755 | + return false; |
| 28756 | + } |
28548 | 28757 | }
|
28549 | 28758 |
|
28550 | 28759 | var emptyObject = {};
|
@@ -28859,6 +29068,7 @@ to return true:wantsResponderID| |
|
28859 | 29068 | getNodeFromInternalInstanceHandle;
|
28860 | 29069 | exports.getPublicInstanceFromInternalInstanceHandle =
|
28861 | 29070 | getPublicInstanceFromInternalInstanceHandle;
|
| 29071 | + exports.isChildPublicInstance = isChildPublicInstance; |
28862 | 29072 | exports.render = render;
|
28863 | 29073 | exports.sendAccessibilityEvent = sendAccessibilityEvent;
|
28864 | 29074 | exports.stopSurface = stopSurface;
|
|
0 commit comments