@office-iss/react-native-win32 0.0.0-canary.280 → 0.0.0-canary.282

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.
Files changed (41) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +24 -8
  4. package/Libraries/Animated/nodes/AnimatedAddition.js +1 -0
  5. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +1 -0
  6. package/Libraries/Animated/nodes/AnimatedDivision.js +1 -0
  7. package/Libraries/Animated/nodes/AnimatedInterpolation.js +1 -0
  8. package/Libraries/Animated/nodes/AnimatedModulo.js +1 -0
  9. package/Libraries/Animated/nodes/AnimatedMultiplication.js +1 -0
  10. package/Libraries/Animated/nodes/AnimatedNode.js +0 -46
  11. package/Libraries/Animated/nodes/AnimatedObject.js +1 -0
  12. package/Libraries/Animated/nodes/AnimatedProps.js +1 -0
  13. package/Libraries/Animated/nodes/AnimatedStyle.js +1 -0
  14. package/Libraries/Animated/nodes/AnimatedSubtraction.js +1 -0
  15. package/Libraries/Animated/nodes/AnimatedTracking.js +1 -0
  16. package/Libraries/Animated/nodes/AnimatedTransform.js +1 -0
  17. package/Libraries/Animated/nodes/AnimatedValue.js +45 -3
  18. package/Libraries/Animated/useAnimatedProps.js +0 -43
  19. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +4 -1
  20. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  21. package/Libraries/Components/TextInput/TextInput.d.ts +5 -0
  22. package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
  23. package/Libraries/Components/TextInput/TextInput.js +6 -0
  24. package/Libraries/Components/TextInput/TextInput.win32.js +6 -0
  25. package/Libraries/Core/ReactNativeVersion.js +1 -1
  26. package/Libraries/Image/AssetSourceResolver.js +11 -0
  27. package/Libraries/Inspector/BorderBox.js +26 -14
  28. package/Libraries/Inspector/BoxInspector.js +60 -42
  29. package/Libraries/Inspector/ElementBox.js +55 -48
  30. package/Libraries/Inspector/StyleInspector.js +36 -30
  31. package/Libraries/ReactNative/UIManagerProperties.js +3 -1
  32. package/overrides.json +6 -6
  33. package/package.json +11 -11
  34. package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -16
  35. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -4
  36. package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -55
  37. package/src/private/specs/modules/NativeCPUTime.js +24 -0
  38. package/src/private/specs/modules/NativeFantom.js +37 -0
  39. package/src/private/utilities/ensureInstance.js +21 -0
  40. package/src/private/webapis/dom/nodes/ReactNativeElement.js +1 -0
  41. 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
+ }
@@ -227,4 +227,5 @@ ReactNativeElement.prototype = Object.create(
227
227
  );
228
228
 
229
229
  // $FlowExpectedError[prop-missing]
230
+ // $FlowFixMe[incompatible-cast]
230
231
  export default ReactNativeElement as typeof ReactNativeElementMethods;
@@ -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
- // Lazy import Fabric here to avoid DOM Node APIs classes from having side-effects.
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
- RendererProxy.getPublicInstanceFromInternalInstanceHandle(instanceHandle);
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
  }