@office-iss/react-native-win32 0.0.0-canary.280 → 0.0.0-canary.281
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +1 -1
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +16 -8
- package/Libraries/Animated/nodes/AnimatedAddition.js +1 -0
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +1 -0
- package/Libraries/Animated/nodes/AnimatedDivision.js +1 -0
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -0
- package/Libraries/Animated/nodes/AnimatedModulo.js +1 -0
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +1 -0
- package/Libraries/Animated/nodes/AnimatedNode.js +0 -46
- package/Libraries/Animated/nodes/AnimatedObject.js +1 -0
- package/Libraries/Animated/nodes/AnimatedProps.js +1 -0
- package/Libraries/Animated/nodes/AnimatedStyle.js +1 -0
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +1 -0
- package/Libraries/Animated/nodes/AnimatedTracking.js +1 -0
- package/Libraries/Animated/nodes/AnimatedTransform.js +1 -0
- package/Libraries/Animated/nodes/AnimatedValue.js +45 -3
- package/Libraries/Animated/useAnimatedProps.js +0 -43
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +4 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +5 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
- package/Libraries/Components/TextInput/TextInput.js +6 -0
- package/Libraries/Components/TextInput/TextInput.win32.js +6 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/AssetSourceResolver.js +11 -0
- package/Libraries/Inspector/BorderBox.js +26 -14
- package/Libraries/Inspector/BoxInspector.js +60 -42
- package/Libraries/Inspector/ElementBox.js +55 -48
- package/Libraries/Inspector/StyleInspector.js +36 -30
- package/Libraries/ReactNative/UIManagerProperties.js +3 -1
- package/overrides.json +6 -6
- package/package.json +10 -10
- package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -16
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -4
- package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -55
- package/src/private/specs/modules/NativeCPUTime.js +24 -0
- package/src/private/specs/modules/NativeFantom.js +37 -0
- package/src/private/utilities/ensureInstance.js +21 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +1 -0
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +14 -8
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
* @flow strict
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export default function ensureInstance<T>(value: mixed, Class: Class<T>): T {
|
|
12
|
+
if (!(value instanceof Class)) {
|
|
13
|
+
// $FlowIssue[incompatible-use]
|
|
14
|
+
const className = Class.name;
|
|
15
|
+
throw new Error(
|
|
16
|
+
`Expected instance of ${className} but got ${String(value)}`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
@@ -303,11 +303,18 @@ export function setInstanceHandle(
|
|
|
303
303
|
node[INSTANCE_HANDLE_KEY] = instanceHandle;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
+
let RendererProxy;
|
|
307
|
+
function getRendererProxy() {
|
|
308
|
+
if (RendererProxy == null) {
|
|
309
|
+
// Lazy import Fabric here to avoid DOM Node APIs classes from having side-effects.
|
|
310
|
+
// With a static import we can't use these classes for Paper-only variants.
|
|
311
|
+
RendererProxy = require('../../../../../Libraries/ReactNative/RendererProxy');
|
|
312
|
+
}
|
|
313
|
+
return RendererProxy;
|
|
314
|
+
}
|
|
315
|
+
|
|
306
316
|
export function getShadowNode(node: ReadOnlyNode): ?ShadowNode {
|
|
307
|
-
|
|
308
|
-
// With a static import we can't use these classes for Paper-only variants.
|
|
309
|
-
const RendererProxy = require('../../../../../Libraries/ReactNative/RendererProxy');
|
|
310
|
-
return RendererProxy.getNodeFromInternalInstanceHandle(
|
|
317
|
+
return getRendererProxy().getNodeFromInternalInstanceHandle(
|
|
311
318
|
getInstanceHandle(node),
|
|
312
319
|
);
|
|
313
320
|
}
|
|
@@ -351,11 +358,10 @@ function getNodeSiblingsAndPosition(
|
|
|
351
358
|
export function getPublicInstanceFromInternalInstanceHandle(
|
|
352
359
|
instanceHandle: InternalInstanceHandle,
|
|
353
360
|
): ?ReadOnlyNode {
|
|
354
|
-
// Lazy import Fabric here to avoid DOM Node APIs classes from having side-effects.
|
|
355
|
-
// With a static import we can't use these classes for Paper-only variants.
|
|
356
|
-
const RendererProxy = require('../../../../../Libraries/ReactNative/RendererProxy');
|
|
357
361
|
const mixedPublicInstance =
|
|
358
|
-
|
|
362
|
+
getRendererProxy().getPublicInstanceFromInternalInstanceHandle(
|
|
363
|
+
instanceHandle,
|
|
364
|
+
);
|
|
359
365
|
// $FlowExpectedError[incompatible-return] React defines public instances as "mixed" because it can't access the definition from React Native.
|
|
360
366
|
return mixedPublicInstance;
|
|
361
367
|
}
|