react-native-windows 0.74.0-preview.1 → 0.74.0-preview.3
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/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/registerCallableModule.d.ts +16 -0
- package/Libraries/Image/AssetSourceResolver.windows.js +186 -0
- package/Libraries/Image/assetPaths.js +36 -0
- package/Libraries/Lists/FlatList.js +0 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +21 -2
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +4 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +3 -0
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/codegen/react/components/rnwcore/ComponentDescriptors.h +0 -1
- package/codegen/react/components/rnwcore/EventEmitters.cpp +0 -9
- package/codegen/react/components/rnwcore/EventEmitters.h +0 -9
- package/codegen/react/components/rnwcore/Props.cpp +0 -7
- package/codegen/react/components/rnwcore/Props.h +0 -10
- package/codegen/react/components/rnwcore/ShadowNodes.cpp +0 -1
- package/codegen/react/components/rnwcore/ShadowNodes.h +0 -11
- package/codegen/react/components/rnwcore/States.h +0 -15
- package/index.js +0 -5
- package/package.json +16 -15
- package/types/index.d.ts +1 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.android.js +0 -69
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.d.ts +0 -24
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.js +0 -33
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroidNativeComponent.js +0 -13
- package/src/private/specs/components/PopupMenuAndroidNativeComponent.js +0 -47
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
*/
|
|
9
|
+
|
|
10
|
+
type Module = Object;
|
|
11
|
+
type RegisterCallableModule = (
|
|
12
|
+
name: string,
|
|
13
|
+
moduleOrFactory: Module | (() => Module),
|
|
14
|
+
) => void;
|
|
15
|
+
|
|
16
|
+
export const registerCallableModule: RegisterCallableModule;
|
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
export type ResolvedAssetSource = {|
|
|
14
|
+
+__packager_asset: boolean,
|
|
15
|
+
+width: ?number,
|
|
16
|
+
+height: ?number,
|
|
17
|
+
+uri: string,
|
|
18
|
+
+scale: number,
|
|
19
|
+
|};
|
|
20
|
+
|
|
21
|
+
import type {PackagerAsset} from '@react-native/assets-registry/registry';
|
|
22
|
+
|
|
23
|
+
const PixelRatio = require('../Utilities/PixelRatio').default;
|
|
24
|
+
const Platform = require('../Utilities/Platform');
|
|
25
|
+
const {pickScale} = require('./AssetUtils');
|
|
26
|
+
const {
|
|
27
|
+
getAndroidResourceFolderName,
|
|
28
|
+
getAndroidResourceIdentifier,
|
|
29
|
+
} = require('@react-native/assets-registry/path-support');
|
|
30
|
+
const invariant = require('invariant');
|
|
31
|
+
// $FlowFixMe[untyped-import]
|
|
32
|
+
const ensureShortPath = require('./assetPaths.js'); // [Windows]
|
|
33
|
+
|
|
34
|
+
// [Windows - instead of using basePath from @react-native/assets-registry/path-support]
|
|
35
|
+
function getBasePath(asset: PackagerAsset, local: boolean) {
|
|
36
|
+
let basePath = asset.httpServerLocation;
|
|
37
|
+
if (basePath[0] === '/') {
|
|
38
|
+
basePath = basePath.substr(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (local) {
|
|
42
|
+
const safePath = basePath.replace(/\.\.\//g, '_');
|
|
43
|
+
// If this asset was created with saveAssetPlugin, then we should shorten the path
|
|
44
|
+
// This conditional allow compat of bundles which might have been created without the saveAssetPlugin
|
|
45
|
+
// $FlowFixMe: __useShortPath not part of public type
|
|
46
|
+
if (asset.__useShortPath) {
|
|
47
|
+
return ensureShortPath(safePath);
|
|
48
|
+
}
|
|
49
|
+
return safePath;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return basePath;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Returns a path like 'assets/AwesomeModule/icon@2x.png'
|
|
57
|
+
*/
|
|
58
|
+
function getScaledAssetPath(asset: PackagerAsset, local: boolean): string {
|
|
59
|
+
const scale = pickScale(asset.scales, PixelRatio.get());
|
|
60
|
+
const scaleSuffix = scale === 1 ? '' : '@' + scale + 'x';
|
|
61
|
+
const assetDir = getBasePath(asset, local);
|
|
62
|
+
return assetDir + '/' + asset.name + scaleSuffix + '.' + asset.type;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Returns a path like 'drawable-mdpi/icon.png'
|
|
67
|
+
*/
|
|
68
|
+
function getAssetPathInDrawableFolder(asset: PackagerAsset): string {
|
|
69
|
+
const scale = pickScale(asset.scales, PixelRatio.get());
|
|
70
|
+
const drawableFolder = getAndroidResourceFolderName(asset, scale);
|
|
71
|
+
const fileName = getAndroidResourceIdentifier(asset);
|
|
72
|
+
return drawableFolder + '/' + fileName + '.' + asset.type;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
class AssetSourceResolver {
|
|
76
|
+
serverUrl: ?string;
|
|
77
|
+
// where the jsbundle is being run from
|
|
78
|
+
jsbundleUrl: ?string;
|
|
79
|
+
// the asset to resolve
|
|
80
|
+
asset: PackagerAsset;
|
|
81
|
+
|
|
82
|
+
constructor(serverUrl: ?string, jsbundleUrl: ?string, asset: PackagerAsset) {
|
|
83
|
+
this.serverUrl = serverUrl;
|
|
84
|
+
this.jsbundleUrl = jsbundleUrl;
|
|
85
|
+
this.asset = asset;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
isLoadedFromServer(): boolean {
|
|
89
|
+
return !!this.serverUrl;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
isLoadedFromFileSystem(): boolean {
|
|
93
|
+
return this.jsbundleUrl != null && this.jsbundleUrl?.startsWith('file://');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
defaultAsset(): ResolvedAssetSource {
|
|
97
|
+
if (this.isLoadedFromServer()) {
|
|
98
|
+
return this.assetServerURL();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (Platform.OS === 'android') {
|
|
102
|
+
return this.isLoadedFromFileSystem()
|
|
103
|
+
? this.drawableFolderInBundle()
|
|
104
|
+
: this.resourceIdentifierWithoutScale();
|
|
105
|
+
} else {
|
|
106
|
+
return this.scaledAssetURLNearBundle();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Returns an absolute URL which can be used to fetch the asset
|
|
112
|
+
* from the devserver
|
|
113
|
+
*/
|
|
114
|
+
assetServerURL(): ResolvedAssetSource {
|
|
115
|
+
invariant(this.serverUrl != null, 'need server to load from');
|
|
116
|
+
return this.fromSource(
|
|
117
|
+
this.serverUrl +
|
|
118
|
+
getScaledAssetPath(this.asset, false) +
|
|
119
|
+
'?platform=' +
|
|
120
|
+
Platform.OS +
|
|
121
|
+
'&hash=' +
|
|
122
|
+
this.asset.hash,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Resolves to just the scaled asset filename
|
|
128
|
+
* E.g. 'assets/AwesomeModule/icon@2x.png'
|
|
129
|
+
*/
|
|
130
|
+
scaledAssetPath(local: boolean): ResolvedAssetSource {
|
|
131
|
+
return this.fromSource(getScaledAssetPath(this.asset, local));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Resolves to where the bundle is running from, with a scaled asset filename
|
|
136
|
+
* E.g. 'file:///sdcard/bundle/assets/AwesomeModule/icon@2x.png'
|
|
137
|
+
*/
|
|
138
|
+
scaledAssetURLNearBundle(): ResolvedAssetSource {
|
|
139
|
+
const path = this.jsbundleUrl ?? 'file://';
|
|
140
|
+
return this.fromSource(
|
|
141
|
+
// Assets can have relative paths outside of the project root.
|
|
142
|
+
// When bundling them we replace `../` with `_` to make sure they
|
|
143
|
+
// don't end up outside of the expected assets directory.
|
|
144
|
+
path + getScaledAssetPath(this.asset, true).replace(/\.\.\//g, '_'),
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The default location of assets bundled with the app, located by
|
|
150
|
+
* resource identifier
|
|
151
|
+
* The Android resource system picks the correct scale.
|
|
152
|
+
* E.g. 'assets_awesomemodule_icon'
|
|
153
|
+
*/
|
|
154
|
+
resourceIdentifierWithoutScale(): ResolvedAssetSource {
|
|
155
|
+
invariant(
|
|
156
|
+
Platform.OS === 'android',
|
|
157
|
+
'resource identifiers work on Android',
|
|
158
|
+
);
|
|
159
|
+
return this.fromSource(getAndroidResourceIdentifier(this.asset));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* If the jsbundle is running from a sideload location, this resolves assets
|
|
164
|
+
* relative to its location
|
|
165
|
+
* E.g. 'file:///sdcard/AwesomeModule/drawable-mdpi/icon.png'
|
|
166
|
+
*/
|
|
167
|
+
drawableFolderInBundle(): ResolvedAssetSource {
|
|
168
|
+
const path = this.jsbundleUrl ?? 'file://';
|
|
169
|
+
return this.fromSource(path + getAssetPathInDrawableFolder(this.asset));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
fromSource(source: string): ResolvedAssetSource {
|
|
173
|
+
return {
|
|
174
|
+
__packager_asset: true,
|
|
175
|
+
width: this.asset.width,
|
|
176
|
+
height: this.asset.height,
|
|
177
|
+
uri: source,
|
|
178
|
+
scale: pickScale(this.asset.scales, PixelRatio.get()),
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
static pickScale: (scales: Array<number>, deviceScale?: number) => number =
|
|
183
|
+
pickScale;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
module.exports = AssetSourceResolver;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Dont use flow here, since this file is used by saveAssetPlugin.js which will run without flow transform
|
|
6
|
+
* @format
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
// Some windows machines may not have long paths enabled
|
|
12
|
+
// https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
|
|
13
|
+
// Assets in nested node_modules (common when using pnpm) - end up creating very long paths
|
|
14
|
+
// Using this function we shorten longer paths to prevent paths from hitting the path limit
|
|
15
|
+
function ensureShortPath(str) {
|
|
16
|
+
if (str.length < 40) return str;
|
|
17
|
+
|
|
18
|
+
const assetsPrefix = 'assets/';
|
|
19
|
+
|
|
20
|
+
if (!str.startsWith(assetsPrefix)) {
|
|
21
|
+
console.warn(`Unexpected asset uri - ${str} may not load correctly.`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const postStr = str.slice(assetsPrefix.length);
|
|
25
|
+
var hash = 0,
|
|
26
|
+
i,
|
|
27
|
+
chr;
|
|
28
|
+
for (i = 0; i < postStr.length; i++) {
|
|
29
|
+
chr = postStr.charCodeAt(i);
|
|
30
|
+
hash = (hash << 5) - hash + chr;
|
|
31
|
+
hash |= 0; // Convert to 32bit integer
|
|
32
|
+
}
|
|
33
|
+
return assetsPrefix + hash.toString();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = ensureShortPath;
|
|
@@ -308,7 +308,6 @@ export type Props<ItemT> = {
|
|
|
308
308
|
* Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation.
|
|
309
309
|
*/
|
|
310
310
|
class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
311
|
-
props: Props<ItemT>;
|
|
312
311
|
/**
|
|
313
312
|
* Scrolls to the end of the content. May be janky without `getItemLayout` prop.
|
|
314
313
|
*/
|
|
@@ -192,7 +192,7 @@ export function parseComponentStack(message: string): ComponentStack {
|
|
|
192
192
|
if (!s) {
|
|
193
193
|
return null;
|
|
194
194
|
}
|
|
195
|
-
const match = s.match(/(.*) \(at (.*\.js):([\d]+)\)/);
|
|
195
|
+
const match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/);
|
|
196
196
|
if (!match) {
|
|
197
197
|
return null;
|
|
198
198
|
}
|
|
@@ -20,7 +20,6 @@ import View from '../Components/View/View';
|
|
|
20
20
|
import DebuggingOverlay from '../Debugging/DebuggingOverlay';
|
|
21
21
|
import useSubscribeToDebuggingOverlayRegistry from '../Debugging/useSubscribeToDebuggingOverlayRegistry';
|
|
22
22
|
import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter';
|
|
23
|
-
import ReactDevToolsOverlay from '../Inspector/ReactDevToolsOverlay';
|
|
24
23
|
import LogBoxNotificationContainer from '../LogBox/LogBoxNotificationContainer';
|
|
25
24
|
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
26
25
|
import {RootTagContext, createRootTag} from './RootTag';
|
|
@@ -64,6 +63,26 @@ const InspectorDeferred = ({
|
|
|
64
63
|
);
|
|
65
64
|
};
|
|
66
65
|
|
|
66
|
+
type ReactDevToolsOverlayDeferredProps = {
|
|
67
|
+
inspectedViewRef: InspectedViewRef,
|
|
68
|
+
reactDevToolsAgent: ReactDevToolsAgent,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const ReactDevToolsOverlayDeferred = ({
|
|
72
|
+
inspectedViewRef,
|
|
73
|
+
reactDevToolsAgent,
|
|
74
|
+
}: ReactDevToolsOverlayDeferredProps) => {
|
|
75
|
+
const ReactDevToolsOverlay =
|
|
76
|
+
require('../Inspector/ReactDevToolsOverlay').default;
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<ReactDevToolsOverlay
|
|
80
|
+
inspectedViewRef={inspectedViewRef}
|
|
81
|
+
reactDevToolsAgent={reactDevToolsAgent}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
67
86
|
const AppContainer = ({
|
|
68
87
|
children,
|
|
69
88
|
fabric,
|
|
@@ -155,7 +174,7 @@ const AppContainer = ({
|
|
|
155
174
|
<DebuggingOverlay ref={debuggingOverlayRef} />
|
|
156
175
|
|
|
157
176
|
{reactDevToolsAgent != null && (
|
|
158
|
-
<
|
|
177
|
+
<ReactDevToolsOverlayDeferred
|
|
159
178
|
inspectedViewRef={innerViewRef}
|
|
160
179
|
reactDevToolsAgent={reactDevToolsAgent}
|
|
161
180
|
/>
|
|
@@ -27,6 +27,8 @@ export type DimensionValue =
|
|
|
27
27
|
type AnimatableNumericValue = number | Animated.AnimatedNode;
|
|
28
28
|
type AnimatableStringValue = string | Animated.AnimatedNode;
|
|
29
29
|
|
|
30
|
+
export type CursorValue = 'auto' | 'pointer';
|
|
31
|
+
|
|
30
32
|
/**
|
|
31
33
|
* Flex Prop Types
|
|
32
34
|
* @see https://reactnative.dev/docs/flexbox
|
|
@@ -274,6 +276,7 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
|
|
274
276
|
* Controls whether the View can be the target of touch events.
|
|
275
277
|
*/
|
|
276
278
|
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined;
|
|
279
|
+
cursor?: CursorValue | undefined;
|
|
277
280
|
}
|
|
278
281
|
|
|
279
282
|
export type FontVariant =
|
|
@@ -403,4 +406,5 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
|
|
403
406
|
tintColor?: ColorValue | undefined;
|
|
404
407
|
opacity?: AnimatableNumericValue | undefined;
|
|
405
408
|
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | undefined;
|
|
409
|
+
cursor?: CursorValue | undefined;
|
|
406
410
|
}
|
|
@@ -37,6 +37,8 @@ export type EdgeInsetsValue = {
|
|
|
37
37
|
export type DimensionValue = number | string | 'auto' | AnimatedNode | null;
|
|
38
38
|
export type AnimatableNumericValue = number | AnimatedNode;
|
|
39
39
|
|
|
40
|
+
export type CursorValue = 'auto' | 'pointer';
|
|
41
|
+
|
|
40
42
|
/**
|
|
41
43
|
* React Native's layout system is based on Flexbox and is powered both
|
|
42
44
|
* on iOS and Android by an open source project called `Yoga`:
|
|
@@ -729,6 +731,7 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
|
|
|
729
731
|
opacity?: AnimatableNumericValue,
|
|
730
732
|
elevation?: number,
|
|
731
733
|
pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only',
|
|
734
|
+
cursor?: CursorValue,
|
|
732
735
|
}>;
|
|
733
736
|
|
|
734
737
|
export type ____ViewStyle_Internal = $ReadOnly<{
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.74.0-preview.
|
|
13
|
+
<ReactNativeWindowsVersion>0.74.0-preview.3</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>74</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>a7fbde79bab1d8ce811614bfaa5d2770d6c69041</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -21,7 +21,6 @@ using AndroidDrawerLayoutComponentDescriptor = ConcreteComponentDescriptor<Andro
|
|
|
21
21
|
using AndroidHorizontalScrollContentViewComponentDescriptor = ConcreteComponentDescriptor<AndroidHorizontalScrollContentViewShadowNode>;
|
|
22
22
|
using AndroidSwipeRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidSwipeRefreshLayoutShadowNode>;
|
|
23
23
|
using DebuggingOverlayComponentDescriptor = ConcreteComponentDescriptor<DebuggingOverlayShadowNode>;
|
|
24
|
-
using AndroidPopupMenuComponentDescriptor = ConcreteComponentDescriptor<AndroidPopupMenuShadowNode>;
|
|
25
24
|
using PullToRefreshViewComponentDescriptor = ConcreteComponentDescriptor<PullToRefreshViewShadowNode>;
|
|
26
25
|
using SwitchComponentDescriptor = ConcreteComponentDescriptor<SwitchShadowNode>;
|
|
27
26
|
using UnimplementedNativeViewComponentDescriptor = ConcreteComponentDescriptor<UnimplementedNativeViewShadowNode>;
|
|
@@ -71,15 +71,6 @@ $payload.setProperty(runtime, "target", $event.target);
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
void AndroidPopupMenuEventEmitter::onSelectionChange(OnSelectionChange $event) const {
|
|
75
|
-
dispatchEvent("selectionChange", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
76
|
-
auto $payload = jsi::Object(runtime);
|
|
77
|
-
$payload.setProperty(runtime, "item", $event.item);
|
|
78
|
-
return $payload;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
74
|
|
|
84
75
|
void PullToRefreshViewEventEmitter::onRefresh(OnRefresh $event) const {
|
|
85
76
|
dispatchEvent("refresh", [](jsi::Runtime &runtime) {
|
|
@@ -79,15 +79,6 @@ class DebuggingOverlayEventEmitter : public ViewEventEmitter {
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
};
|
|
83
|
-
class AndroidPopupMenuEventEmitter : public ViewEventEmitter {
|
|
84
|
-
public:
|
|
85
|
-
using ViewEventEmitter::ViewEventEmitter;
|
|
86
|
-
|
|
87
|
-
struct OnSelectionChange {
|
|
88
|
-
int item;
|
|
89
|
-
};
|
|
90
|
-
void onSelectionChange(OnSelectionChange value) const;
|
|
91
82
|
};
|
|
92
83
|
class AndroidProgressBarEventEmitter : public ViewEventEmitter {
|
|
93
84
|
public:
|
|
@@ -76,13 +76,6 @@ DebuggingOverlayProps::DebuggingOverlayProps(
|
|
|
76
76
|
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps)
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
{}
|
|
80
|
-
AndroidPopupMenuProps::AndroidPopupMenuProps(
|
|
81
|
-
const PropsParserContext &context,
|
|
82
|
-
const AndroidPopupMenuProps &sourceProps,
|
|
83
|
-
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
84
|
-
|
|
85
|
-
menuItems(convertRawProp(context, rawProps, "menuItems", sourceProps.menuItems, {}))
|
|
86
79
|
{}
|
|
87
80
|
AndroidProgressBarProps::AndroidProgressBarProps(
|
|
88
81
|
const PropsParserContext &context,
|
|
@@ -178,16 +178,6 @@ class DebuggingOverlayProps final : public ViewProps {
|
|
|
178
178
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
class AndroidPopupMenuProps final : public ViewProps {
|
|
182
|
-
public:
|
|
183
|
-
AndroidPopupMenuProps() = default;
|
|
184
|
-
AndroidPopupMenuProps(const PropsParserContext& context, const AndroidPopupMenuProps &sourceProps, const RawProps &rawProps);
|
|
185
|
-
|
|
186
|
-
#pragma mark - Props
|
|
187
|
-
|
|
188
|
-
std::vector<std::string> menuItems{};
|
|
189
|
-
};
|
|
190
|
-
|
|
191
181
|
class AndroidProgressBarProps final : public ViewProps {
|
|
192
182
|
public:
|
|
193
183
|
AndroidProgressBarProps() = default;
|
|
@@ -17,7 +17,6 @@ extern const char AndroidDrawerLayoutComponentName[] = "AndroidDrawerLayout";
|
|
|
17
17
|
extern const char AndroidHorizontalScrollContentViewComponentName[] = "AndroidHorizontalScrollContentView";
|
|
18
18
|
extern const char AndroidSwipeRefreshLayoutComponentName[] = "AndroidSwipeRefreshLayout";
|
|
19
19
|
extern const char DebuggingOverlayComponentName[] = "DebuggingOverlay";
|
|
20
|
-
extern const char AndroidPopupMenuComponentName[] = "AndroidPopupMenu";
|
|
21
20
|
extern const char PullToRefreshViewComponentName[] = "PullToRefreshView";
|
|
22
21
|
extern const char SwitchComponentName[] = "Switch";
|
|
23
22
|
extern const char UnimplementedNativeViewComponentName[] = "UnimplementedNativeView";
|
|
@@ -73,17 +73,6 @@ using DebuggingOverlayShadowNode = ConcreteViewShadowNode<
|
|
|
73
73
|
DebuggingOverlayEventEmitter,
|
|
74
74
|
DebuggingOverlayState>;
|
|
75
75
|
|
|
76
|
-
JSI_EXPORT extern const char AndroidPopupMenuComponentName[];
|
|
77
|
-
|
|
78
|
-
/*
|
|
79
|
-
* `ShadowNode` for <AndroidPopupMenu> component.
|
|
80
|
-
*/
|
|
81
|
-
using AndroidPopupMenuShadowNode = ConcreteViewShadowNode<
|
|
82
|
-
AndroidPopupMenuComponentName,
|
|
83
|
-
AndroidPopupMenuProps,
|
|
84
|
-
AndroidPopupMenuEventEmitter,
|
|
85
|
-
AndroidPopupMenuState>;
|
|
86
|
-
|
|
87
76
|
JSI_EXPORT extern const char PullToRefreshViewComponentName[];
|
|
88
77
|
|
|
89
78
|
/*
|
|
@@ -91,21 +91,6 @@ public:
|
|
|
91
91
|
#endif
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
class AndroidPopupMenuState {
|
|
95
|
-
public:
|
|
96
|
-
AndroidPopupMenuState() = default;
|
|
97
|
-
|
|
98
|
-
#ifdef ANDROID
|
|
99
|
-
AndroidPopupMenuState(AndroidPopupMenuState const &previousState, folly::dynamic data){};
|
|
100
|
-
folly::dynamic getDynamic() const {
|
|
101
|
-
return {};
|
|
102
|
-
};
|
|
103
|
-
MapBuffer getMapBuffer() const {
|
|
104
|
-
return MapBufferBuilder::EMPTY();
|
|
105
|
-
};
|
|
106
|
-
#endif
|
|
107
|
-
};
|
|
108
|
-
|
|
109
94
|
class PullToRefreshViewState {
|
|
110
95
|
public:
|
|
111
96
|
PullToRefreshViewState() = default;
|
package/index.js
CHANGED
|
@@ -27,7 +27,6 @@ import typeof Clipboard from './Libraries/Components/Clipboard/Clipboard';
|
|
|
27
27
|
import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
|
|
28
28
|
import typeof Keyboard from './Libraries/Components/Keyboard/Keyboard';
|
|
29
29
|
import typeof KeyboardAvoidingView from './Libraries/Components/Keyboard/KeyboardAvoidingView';
|
|
30
|
-
import typeof PopupMenuAndroid from './Libraries/Components/PopupMenuAndroid/PopupMenuAndroid';
|
|
31
30
|
import typeof Pressable from './Libraries/Components/Pressable/Pressable';
|
|
32
31
|
import typeof ProgressBarAndroid from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
|
|
33
32
|
import typeof RefreshControl from './Libraries/Components/RefreshControl/RefreshControl';
|
|
@@ -135,10 +134,6 @@ module.exports = {
|
|
|
135
134
|
return require('./Libraries/Components/Keyboard/KeyboardAvoidingView')
|
|
136
135
|
.default;
|
|
137
136
|
},
|
|
138
|
-
get PopupMenuAndroid(): PopupMenuAndroid {
|
|
139
|
-
return require('./Libraries/Components/PopupMenuAndroid/PopupMenuAndroid')
|
|
140
|
-
.default;
|
|
141
|
-
},
|
|
142
137
|
get Modal(): Modal {
|
|
143
138
|
return require('./Libraries/Modal/Modal');
|
|
144
139
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.74.0-preview.
|
|
3
|
+
"version": "0.74.0-preview.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/runtime": "^7.0.0",
|
|
25
25
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
26
|
-
"@react-native-community/cli": "13.6.
|
|
27
|
-
"@react-native-community/cli-platform-android": "13.6.
|
|
28
|
-
"@react-native-community/cli-platform-ios": "13.6.
|
|
29
|
-
"@react-native-windows/cli": "0.74.0-preview.
|
|
26
|
+
"@react-native-community/cli": "13.6.4",
|
|
27
|
+
"@react-native-community/cli-platform-android": "13.6.4",
|
|
28
|
+
"@react-native-community/cli-platform-ios": "13.6.4",
|
|
29
|
+
"@react-native-windows/cli": "0.74.0-preview.2",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
|
-
"@react-native/assets-registry": "0.74.
|
|
32
|
-
"@react-native/codegen": "0.74.
|
|
33
|
-
"@react-native/community-cli-plugin": "0.74.
|
|
34
|
-
"@react-native/gradle-plugin": "0.74.
|
|
35
|
-
"@react-native/js-polyfills": "0.74.
|
|
36
|
-
"@react-native/normalize-colors": "0.74.
|
|
37
|
-
"@react-native/virtualized-lists": "0.74.
|
|
31
|
+
"@react-native/assets-registry": "0.74.80",
|
|
32
|
+
"@react-native/codegen": "0.74.80",
|
|
33
|
+
"@react-native/community-cli-plugin": "0.74.80",
|
|
34
|
+
"@react-native/gradle-plugin": "0.74.80",
|
|
35
|
+
"@react-native/js-polyfills": "0.74.80",
|
|
36
|
+
"@react-native/normalize-colors": "0.74.80",
|
|
37
|
+
"@react-native/virtualized-lists": "0.74.80",
|
|
38
38
|
"abort-controller": "^3.0.0",
|
|
39
39
|
"anser": "^1.4.9",
|
|
40
40
|
"ansi-regex": "^5.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@react-native-windows/codegen": "0.74.0-preview.1",
|
|
68
|
-
"@react-native/metro-config": "0.74.
|
|
68
|
+
"@react-native/metro-config": "0.74.80",
|
|
69
69
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
70
70
|
"@rnw-scripts/eslint-config": "1.2.9",
|
|
71
71
|
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.13",
|
|
@@ -81,14 +81,15 @@
|
|
|
81
81
|
"just-scripts": "^1.3.3",
|
|
82
82
|
"prettier": "2.8.8",
|
|
83
83
|
"react": "18.2.0",
|
|
84
|
-
"react-native": "0.74.0-rc.
|
|
84
|
+
"react-native": "0.74.0-rc.9",
|
|
85
85
|
"react-native-platform-override": "^1.9.25",
|
|
86
86
|
"react-refresh": "^0.14.0",
|
|
87
87
|
"typescript": "5.0.4"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
+
"@types/react": "^18.2.6",
|
|
90
91
|
"react": "18.2.0",
|
|
91
|
-
"react-native": "0.74.0-rc.
|
|
92
|
+
"react-native": "0.74.0-rc.9"
|
|
92
93
|
},
|
|
93
94
|
"beachball": {
|
|
94
95
|
"defaultNpmTag": "preview",
|
package/types/index.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ export * from '../Libraries/Components/View/View';
|
|
|
103
103
|
export * from '../Libraries/Components/View/ViewAccessibility';
|
|
104
104
|
export * from '../Libraries/Components/View/ViewPropTypes';
|
|
105
105
|
export * from '../Libraries/Components/Button';
|
|
106
|
+
export * from '../Libraries/Core/registerCallableModule';
|
|
106
107
|
export * from '../Libraries/DevToolsSettings/DevToolsSettingsManager';
|
|
107
108
|
export * from '../Libraries/EventEmitter/NativeEventEmitter';
|
|
108
109
|
export * from '../Libraries/EventEmitter/RCTDeviceEventEmitter';
|
|
@@ -1,69 +0,0 @@
|
|
|
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-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
12
|
-
import type {SyntheticEvent} from '../../Types/CoreEventTypes';
|
|
13
|
-
import type {RefObject} from 'react';
|
|
14
|
-
|
|
15
|
-
import PopupMenuAndroidNativeComponent, {
|
|
16
|
-
Commands,
|
|
17
|
-
} from './PopupMenuAndroidNativeComponent';
|
|
18
|
-
import nullthrows from 'nullthrows';
|
|
19
|
-
import * as React from 'react';
|
|
20
|
-
import {useCallback, useImperativeHandle, useRef} from 'react';
|
|
21
|
-
|
|
22
|
-
type PopupMenuSelectionEvent = SyntheticEvent<
|
|
23
|
-
$ReadOnly<{
|
|
24
|
-
item: number,
|
|
25
|
-
}>,
|
|
26
|
-
>;
|
|
27
|
-
|
|
28
|
-
export type PopupMenuAndroidInstance = {
|
|
29
|
-
+show: () => void,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
type Props = {
|
|
33
|
-
menuItems: $ReadOnlyArray<string>,
|
|
34
|
-
onSelectionChange: number => void,
|
|
35
|
-
children: React.Node,
|
|
36
|
-
instanceRef: RefObject<?PopupMenuAndroidInstance>,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default function PopupMenuAndroid({
|
|
40
|
-
menuItems,
|
|
41
|
-
onSelectionChange,
|
|
42
|
-
children,
|
|
43
|
-
instanceRef,
|
|
44
|
-
}: Props): React.Node {
|
|
45
|
-
const nativeRef = useRef<React.ElementRef<HostComponent<mixed>> | null>(null);
|
|
46
|
-
const _onSelectionChange = useCallback(
|
|
47
|
-
(event: PopupMenuSelectionEvent) => {
|
|
48
|
-
onSelectionChange(event.nativeEvent.item);
|
|
49
|
-
},
|
|
50
|
-
[onSelectionChange],
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
useImperativeHandle(instanceRef, ItemViewabilityInstance => {
|
|
54
|
-
return {
|
|
55
|
-
show() {
|
|
56
|
-
Commands.show(nullthrows(nativeRef.current));
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<PopupMenuAndroidNativeComponent
|
|
63
|
-
ref={nativeRef}
|
|
64
|
-
onSelectionChange={_onSelectionChange}
|
|
65
|
-
menuItems={menuItems}>
|
|
66
|
-
{children}
|
|
67
|
-
</PopupMenuAndroidNativeComponent>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type * as React from 'react';
|
|
11
|
-
import {HostComponent} from '../../../types/public/ReactNativeTypes';
|
|
12
|
-
|
|
13
|
-
type PopupMenuAndroidInstance = {
|
|
14
|
-
show: () => void;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
type Props = {
|
|
18
|
-
menuItems: Array<string>;
|
|
19
|
-
onSelectionChange: (number) => void;
|
|
20
|
-
children: React.ReactNode | undefined;
|
|
21
|
-
instanceRef: React.ElementRef<HostComponent<PopupMenuAndroidInstance>>;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
declare class PopupMenuAndroid extends React.Component<Props> {}
|
|
@@ -1,33 +0,0 @@
|
|
|
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-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {RefObject} from 'react';
|
|
12
|
-
import type {Node} from 'react';
|
|
13
|
-
|
|
14
|
-
import * as React from 'react';
|
|
15
|
-
|
|
16
|
-
const UnimplementedView = require('../UnimplementedViews/UnimplementedView');
|
|
17
|
-
|
|
18
|
-
export type PopupMenuAndroidInstance = {
|
|
19
|
-
+show: () => void,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
type Props = {
|
|
23
|
-
menuItems: $ReadOnlyArray<string>,
|
|
24
|
-
onSelectionChange: number => void,
|
|
25
|
-
children: Node,
|
|
26
|
-
instanceRef: RefObject<?PopupMenuAndroidInstance>,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
function PopupMenuAndroid(props: Props): Node {
|
|
30
|
-
return <UnimplementedView />;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default PopupMenuAndroid;
|
|
@@ -1,13 +0,0 @@
|
|
|
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-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from '../../../src/private/specs/components/PopupMenuAndroidNativeComponent';
|
|
12
|
-
import PopupMenuAndroidNativeComponent from '../../../src/private/specs/components/PopupMenuAndroidNativeComponent';
|
|
13
|
-
export default PopupMenuAndroidNativeComponent;
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
* @flow strict-local
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
|
|
12
|
-
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
13
|
-
import type {
|
|
14
|
-
DirectEventHandler,
|
|
15
|
-
Int32,
|
|
16
|
-
} from '../../../../Libraries/Types/CodegenTypes';
|
|
17
|
-
|
|
18
|
-
import codegenNativeCommands from '../../../../Libraries/Utilities/codegenNativeCommands';
|
|
19
|
-
import codegenNativeComponent from '../../../../Libraries/Utilities/codegenNativeComponent';
|
|
20
|
-
import * as React from 'react';
|
|
21
|
-
|
|
22
|
-
type PopupMenuSelectionEvent = $ReadOnly<{
|
|
23
|
-
item: Int32,
|
|
24
|
-
}>;
|
|
25
|
-
|
|
26
|
-
type NativeProps = $ReadOnly<{
|
|
27
|
-
...ViewProps,
|
|
28
|
-
|
|
29
|
-
//Props
|
|
30
|
-
menuItems?: ?$ReadOnlyArray<string>,
|
|
31
|
-
|
|
32
|
-
onSelectionChange?: DirectEventHandler<PopupMenuSelectionEvent>,
|
|
33
|
-
}>;
|
|
34
|
-
|
|
35
|
-
type ComponentType = HostComponent<NativeProps>;
|
|
36
|
-
|
|
37
|
-
interface NativeCommands {
|
|
38
|
-
+show: (viewRef: React.ElementRef<ComponentType>) => void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
42
|
-
supportedCommands: ['show'],
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export default (codegenNativeComponent<NativeProps>(
|
|
46
|
-
'AndroidPopupMenu',
|
|
47
|
-
): HostComponent<NativeProps>);
|