@office-iss/react-native-win32 0.0.0-canary.255 → 0.0.0-canary.257

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 (57) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +79 -1
  3. package/CHANGELOG.md +28 -4
  4. package/Libraries/Components/TextInput/InputAccessoryView.js +10 -1
  5. package/Libraries/Components/View/ViewAccessibility.js +4 -4
  6. package/Libraries/Components/View/ViewAccessibility.win32.js +6 -6
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/Core/setUpTimers.js +19 -0
  9. package/Libraries/Image/ImageProps.js +16 -5
  10. package/Libraries/Image/ImageViewNativeComponent.js +2 -1
  11. package/Libraries/LogBox/Data/LogBoxData.js +39 -4
  12. package/Libraries/LogBox/Data/LogBoxLog.js +5 -2
  13. package/Libraries/LogBox/Data/parseLogBoxLog.js +23 -2
  14. package/Libraries/LogBox/LogBox.js +29 -12
  15. package/Libraries/LogBox/LogBoxNotificationContainer.js +4 -0
  16. package/Libraries/LogBox/UI/LogBoxInspector.js +8 -70
  17. package/Libraries/LogBox/UI/LogBoxInspectorBody.js +87 -0
  18. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +6 -42
  19. package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +58 -0
  20. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +5 -66
  21. package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +7 -72
  22. package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +76 -0
  23. package/Libraries/LogBox/UI/LogBoxNotification.js +13 -152
  24. package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +63 -0
  25. package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +67 -0
  26. package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +57 -0
  27. package/Libraries/Renderer/implementations/ReactFabric-dev.js +15690 -26405
  28. package/Libraries/Renderer/implementations/ReactFabric-prod.js +2675 -1630
  29. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2945 -1682
  30. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16141 -27018
  31. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +2723 -1666
  32. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +2984 -1737
  33. package/Libraries/Renderer/shims/ReactFabric.js +2 -2
  34. package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
  35. package/Libraries/Renderer/shims/ReactNative.js +2 -3
  36. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -2
  37. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -2
  38. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
  39. package/Libraries/Share/Share.d.ts +16 -10
  40. package/Libraries/Share/Share.js +14 -15
  41. package/Libraries/Text/Text.js +142 -121
  42. package/Libraries/Text/Text.win32.js +153 -130
  43. package/Libraries/Text/TextNativeComponent.js +6 -5
  44. package/Libraries/Text/TextNativeComponent.win32.js +6 -5
  45. package/Libraries/Text/TextOptimized.js +538 -0
  46. package/Libraries/Text/TextProps.js +6 -6
  47. package/Libraries/Text/TextProps.win32.js +6 -6
  48. package/Libraries/Types/CodegenTypes.js +3 -0
  49. package/Libraries/Utilities/ReactNativeTestTools.js +7 -24
  50. package/Libraries/__tests__/ButtonWin32-test.js +7 -6
  51. package/Libraries/promiseRejectionTrackingOptions.js +1 -0
  52. package/jest/renderer.js +25 -14
  53. package/jest/setup.js +5 -0
  54. package/overrides.json +7 -7
  55. package/package.json +19 -19
  56. package/src/private/specs/modules/NativeDevSettings.js +1 -0
  57. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +34 -0
@@ -8,18 +8,17 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {Message as MessageType} from '../Data/parseLogBoxLog';
12
-
13
11
  import View from '../../Components/View/View';
14
- import Image from '../../Image/Image';
15
12
  import StyleSheet from '../../StyleSheet/StyleSheet';
16
- import Text from '../../Text/Text';
17
13
  import * as LogBoxData from '../Data/LogBoxData';
18
14
  import LogBoxLog from '../Data/LogBoxLog';
19
15
  import LogBoxButton from './LogBoxButton';
20
- import LogBoxMessage from './LogBoxMessage';
16
+ import LogBoxNotificationCountBadge from './LogBoxNotificationCountBadge';
17
+ import LogBoxNotificationDismissButton from './LogBoxNotificationDismissButton';
18
+ import LogBoxNotificationMessage from './LogBoxNotificationMessage';
21
19
  import * as LogBoxStyle from './LogBoxStyle';
22
20
  import * as React from 'react';
21
+ import {useEffect} from 'react';
23
22
 
24
23
  type Props = $ReadOnly<{
25
24
  log: LogBoxLog,
@@ -29,170 +28,34 @@ type Props = $ReadOnly<{
29
28
  onPressDismiss: () => void,
30
29
  }>;
31
30
 
32
- function LogBoxLogNotification(props: Props): React.Node {
31
+ export default function LogBoxNotification(props: Props): React.Node {
33
32
  const {totalLogCount, level, log} = props;
34
33
 
35
34
  // Eagerly symbolicate so the stack is available when pressing to inspect.
36
- React.useEffect(() => {
35
+ useEffect(() => {
37
36
  LogBoxData.symbolicateLogLazy(log);
38
37
  }, [log]);
39
38
 
40
39
  return (
41
- <View style={toastStyles.container}>
40
+ <View style={styles.container}>
42
41
  <LogBoxButton
43
42
  onPress={props.onPressOpen}
44
- style={toastStyles.press}
43
+ style={styles.press}
45
44
  backgroundColor={{
46
45
  default: LogBoxStyle.getBackgroundColor(1),
47
46
  pressed: LogBoxStyle.getBackgroundColor(0.9),
48
47
  }}>
49
- <View style={toastStyles.content}>
50
- <CountBadge count={totalLogCount} level={level} />
51
- <Message message={log.message} />
52
- <DismissButton onPress={props.onPressDismiss} />
48
+ <View style={styles.content}>
49
+ <LogBoxNotificationCountBadge count={totalLogCount} level={level} />
50
+ <LogBoxNotificationMessage message={log.message} />
51
+ <LogBoxNotificationDismissButton onPress={props.onPressDismiss} />
53
52
  </View>
54
53
  </LogBoxButton>
55
54
  </View>
56
55
  );
57
56
  }
58
57
 
59
- function CountBadge(props: {count: number, level: 'error' | 'warn'}) {
60
- return (
61
- <View style={countStyles.outside}>
62
- {/* $FlowFixMe[incompatible-type] (>=0.114.0) This suppression was added
63
- * when fixing the type of `StyleSheet.create`. Remove this comment to
64
- * see the error. */}
65
- <View style={[countStyles.inside, countStyles[props.level]]}>
66
- <Text style={countStyles.text}>
67
- {props.count <= 1 ? '!' : props.count}
68
- </Text>
69
- </View>
70
- </View>
71
- );
72
- }
73
-
74
- function Message(props: {message: MessageType}) {
75
- return (
76
- <View style={messageStyles.container}>
77
- <Text numberOfLines={1} style={messageStyles.text}>
78
- {props.message && (
79
- <LogBoxMessage
80
- plaintext
81
- message={props.message}
82
- style={messageStyles.substitutionText}
83
- />
84
- )}
85
- </Text>
86
- </View>
87
- );
88
- }
89
-
90
- function DismissButton(props: {onPress: () => void}) {
91
- return (
92
- <View style={dismissStyles.container}>
93
- <LogBoxButton
94
- backgroundColor={{
95
- default: LogBoxStyle.getTextColor(0.3),
96
- pressed: LogBoxStyle.getTextColor(0.5),
97
- }}
98
- hitSlop={{
99
- top: 12,
100
- right: 10,
101
- bottom: 12,
102
- left: 10,
103
- }}
104
- onPress={props.onPress}
105
- style={dismissStyles.press}>
106
- <Image
107
- source={require('./LogBoxImages/close.png')}
108
- style={dismissStyles.image}
109
- />
110
- </LogBoxButton>
111
- </View>
112
- );
113
- }
114
-
115
- const countStyles = StyleSheet.create({
116
- warn: {
117
- backgroundColor: LogBoxStyle.getWarningColor(1),
118
- },
119
- error: {
120
- backgroundColor: LogBoxStyle.getErrorColor(1),
121
- },
122
- log: {
123
- backgroundColor: LogBoxStyle.getLogColor(1),
124
- },
125
- outside: {
126
- padding: 2,
127
- borderRadius: 25,
128
- backgroundColor: '#fff',
129
- marginRight: 8,
130
- },
131
- inside: {
132
- minWidth: 18,
133
- paddingLeft: 4,
134
- paddingRight: 4,
135
- borderRadius: 25,
136
- fontWeight: '600',
137
- },
138
- text: {
139
- color: LogBoxStyle.getTextColor(1),
140
- fontSize: 14,
141
- lineHeight: 18,
142
- textAlign: 'center',
143
- fontWeight: '600',
144
- textShadowColor: LogBoxStyle.getBackgroundColor(0.4),
145
- textShadowOffset: {width: 0, height: 0},
146
- textShadowRadius: 3,
147
- },
148
- });
149
-
150
- const messageStyles = StyleSheet.create({
151
- container: {
152
- alignSelf: 'stretch',
153
- flexGrow: 1,
154
- flexShrink: 1,
155
- flexBasis: 'auto',
156
- borderLeftColor: LogBoxStyle.getTextColor(0.2),
157
- borderLeftWidth: 1,
158
- paddingLeft: 8,
159
- },
160
- text: {
161
- color: LogBoxStyle.getTextColor(1),
162
- flex: 1,
163
- fontSize: 14,
164
- lineHeight: 22,
165
- },
166
- substitutionText: {
167
- color: LogBoxStyle.getTextColor(0.6),
168
- },
169
- });
170
-
171
- const dismissStyles = StyleSheet.create({
172
- container: {
173
- alignSelf: 'center',
174
- flexDirection: 'row',
175
- flexGrow: 0,
176
- flexShrink: 0,
177
- flexBasis: 'auto',
178
- marginLeft: 5,
179
- },
180
- press: {
181
- height: 20,
182
- width: 20,
183
- borderRadius: 25,
184
- alignSelf: 'flex-end',
185
- alignItems: 'center',
186
- justifyContent: 'center',
187
- },
188
- image: {
189
- height: 8,
190
- width: 8,
191
- tintColor: LogBoxStyle.getBackgroundColor(1),
192
- },
193
- });
194
-
195
- const toastStyles = StyleSheet.create({
58
+ const styles = StyleSheet.create({
196
59
  container: {
197
60
  height: 48,
198
61
  position: 'relative',
@@ -218,5 +81,3 @@ const toastStyles = StyleSheet.create({
218
81
  flexBasis: 'auto',
219
82
  },
220
83
  });
221
-
222
- export default LogBoxLogNotification;
@@ -0,0 +1,63 @@
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 View from '../../Components/View/View';
12
+ import StyleSheet from '../../StyleSheet/StyleSheet';
13
+ import Text from '../../Text/Text';
14
+ import * as LogBoxStyle from './LogBoxStyle';
15
+ import * as React from 'react';
16
+
17
+ export default function LogBoxNotificationCountBadge(props: {
18
+ count: number,
19
+ level: 'error' | 'warn',
20
+ }): React.Node {
21
+ return (
22
+ <View style={styles.outside}>
23
+ {/* $FlowFixMe[incompatible-type] (>=0.114.0) This suppression was added
24
+ * when fixing the type of `StyleSheet.create`. Remove this comment to
25
+ * see the error. */}
26
+ <View style={[styles.inside, styles[props.level]]}>
27
+ <Text style={styles.text}>{props.count <= 1 ? '!' : props.count}</Text>
28
+ </View>
29
+ </View>
30
+ );
31
+ }
32
+
33
+ const styles = StyleSheet.create({
34
+ warn: {
35
+ backgroundColor: LogBoxStyle.getWarningColor(1),
36
+ },
37
+ error: {
38
+ backgroundColor: LogBoxStyle.getErrorColor(1),
39
+ },
40
+ outside: {
41
+ padding: 2,
42
+ borderRadius: 25,
43
+ backgroundColor: '#fff',
44
+ marginRight: 8,
45
+ },
46
+ inside: {
47
+ minWidth: 18,
48
+ paddingLeft: 4,
49
+ paddingRight: 4,
50
+ borderRadius: 25,
51
+ fontWeight: '600',
52
+ },
53
+ text: {
54
+ color: LogBoxStyle.getTextColor(1),
55
+ fontSize: 14,
56
+ lineHeight: 18,
57
+ textAlign: 'center',
58
+ fontWeight: '600',
59
+ textShadowColor: LogBoxStyle.getBackgroundColor(0.4),
60
+ textShadowOffset: {width: 0, height: 0},
61
+ textShadowRadius: 3,
62
+ },
63
+ });
@@ -0,0 +1,67 @@
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 View from '../../Components/View/View';
12
+ import Image from '../../Image/Image';
13
+ import StyleSheet from '../../StyleSheet/StyleSheet';
14
+ import LogBoxButton from './LogBoxButton';
15
+ import * as LogBoxStyle from './LogBoxStyle';
16
+ import * as React from 'react';
17
+
18
+ export default function LogBoxNotificationDismissButton(props: {
19
+ onPress: () => void,
20
+ }): React.Node {
21
+ return (
22
+ <View style={styles.container}>
23
+ <LogBoxButton
24
+ backgroundColor={{
25
+ default: LogBoxStyle.getTextColor(0.3),
26
+ pressed: LogBoxStyle.getTextColor(0.5),
27
+ }}
28
+ hitSlop={{
29
+ top: 12,
30
+ right: 10,
31
+ bottom: 12,
32
+ left: 10,
33
+ }}
34
+ onPress={props.onPress}
35
+ style={styles.press}>
36
+ <Image
37
+ source={require('./LogBoxImages/close.png')}
38
+ style={styles.image}
39
+ />
40
+ </LogBoxButton>
41
+ </View>
42
+ );
43
+ }
44
+
45
+ const styles = StyleSheet.create({
46
+ container: {
47
+ alignSelf: 'center',
48
+ flexDirection: 'row',
49
+ flexGrow: 0,
50
+ flexShrink: 0,
51
+ flexBasis: 'auto',
52
+ marginLeft: 5,
53
+ },
54
+ press: {
55
+ height: 20,
56
+ width: 20,
57
+ borderRadius: 25,
58
+ alignSelf: 'flex-end',
59
+ alignItems: 'center',
60
+ justifyContent: 'center',
61
+ },
62
+ image: {
63
+ height: 8,
64
+ width: 8,
65
+ tintColor: LogBoxStyle.getBackgroundColor(1),
66
+ },
67
+ });
@@ -0,0 +1,57 @@
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 {Message as MessageType} from '../Data/parseLogBoxLog';
12
+
13
+ import View from '../../Components/View/View';
14
+ import StyleSheet from '../../StyleSheet/StyleSheet';
15
+ import Text from '../../Text/Text';
16
+ import LogBoxMessage from './LogBoxMessage';
17
+ import * as LogBoxStyle from './LogBoxStyle';
18
+ import * as React from 'react';
19
+
20
+ export default function LogBoxNotificationMessage(props: {
21
+ message: MessageType,
22
+ }): React.Node {
23
+ return (
24
+ <View style={styles.container}>
25
+ <Text numberOfLines={1} style={styles.text}>
26
+ {props.message && (
27
+ <LogBoxMessage
28
+ plaintext
29
+ message={props.message}
30
+ style={styles.substitutionText}
31
+ />
32
+ )}
33
+ </Text>
34
+ </View>
35
+ );
36
+ }
37
+
38
+ const styles = StyleSheet.create({
39
+ container: {
40
+ alignSelf: 'stretch',
41
+ flexGrow: 1,
42
+ flexShrink: 1,
43
+ flexBasis: 'auto',
44
+ borderLeftColor: LogBoxStyle.getTextColor(0.2),
45
+ borderLeftWidth: 1,
46
+ paddingLeft: 8,
47
+ },
48
+ text: {
49
+ color: LogBoxStyle.getTextColor(1),
50
+ flex: 1,
51
+ fontSize: 14,
52
+ lineHeight: 22,
53
+ },
54
+ substitutionText: {
55
+ color: LogBoxStyle.getTextColor(0.6),
56
+ },
57
+ });