react-native-macos 0.71.6 → 0.71.8

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.
@@ -15,6 +15,7 @@ type AccessibilityChangeEventName =
15
15
  | 'change' // deprecated, maps to screenReaderChanged
16
16
  | 'boldTextChanged' // iOS-only Event
17
17
  | 'grayscaleChanged' // iOS-only Event
18
+ | 'highContrastChanged' // [macOS]
18
19
  | 'invertColorsChanged' // iOS-only Event
19
20
  | 'reduceMotionChanged'
20
21
  | 'screenReaderChanged'
@@ -57,6 +58,14 @@ export interface AccessibilityInfoStatic {
57
58
  */
58
59
  isGrayscaleEnabled: () => Promise<boolean>;
59
60
 
61
+ /**
62
+ *
63
+ * @returns Query whether high contract is currently enabled.
64
+ *
65
+ * @platform macos
66
+ */
67
+ isHighContrastEnabled: () => Promise<boolean>;
68
+
60
69
  /**
61
70
  * Query whether invert colors is currently enabled.
62
71
  *
@@ -274,6 +274,113 @@ export interface TextInputIOSProps {
274
274
  scrollEnabled?: boolean | undefined;
275
275
  }
276
276
 
277
+ // [macOS
278
+ export type SettingChangeEvent = NativeSyntheticEvent<{
279
+ enabled: boolean;
280
+ }>;
281
+
282
+ export type PasteEvent = NativeSyntheticEvent<{
283
+ dataTransfer: {
284
+ files: {
285
+ height: number;
286
+ size: number;
287
+ type: string;
288
+ uri: string;
289
+ width: number;
290
+ }[];
291
+ items: {
292
+ kind: string;
293
+ type: string;
294
+ }[];
295
+ types: string[];
296
+ };
297
+ }>;
298
+
299
+ export type SubmitKeyEvent = {
300
+ key: string;
301
+ altKey?: boolean | undefined;
302
+ ctrlKey?: boolean | undefined;
303
+ metaKey?: boolean | undefined;
304
+ shiftKey?: boolean | undefined;
305
+ functionKey?: boolean | undefined;
306
+ };
307
+
308
+ export type PasteType = 'fileUrl' | 'image' | 'string';
309
+ export type PastedTypesType = PasteType | PasteType[];
310
+
311
+ /**
312
+ * macOS Specific properties for TextInput
313
+ */
314
+ export interface TextInputMacOSProps {
315
+ /**
316
+ * If `true`, clears the text field synchronously before `onSubmitEditing` is emitted.
317
+ */
318
+ clearTextOnSubmit?: boolean | undefined;
319
+
320
+ /**
321
+ * If `false`, disables grammar-check.
322
+ */
323
+ grammarCheck?: boolean | undefined;
324
+
325
+ /**
326
+ * If `true`, hide vertical scrollbar on the underlying multiline scrollview
327
+ * The default value is `false`.
328
+ */
329
+ hideVerticalScrollIndicator?: boolean | undefined;
330
+
331
+ /**
332
+ * Fired when a supported element is pasted
333
+ */
334
+ onPaste?: (event: PasteEvent) => void | undefined;
335
+
336
+ /**
337
+ * Callback that is called when the text input's autoCorrect setting changes.
338
+ * This will be called with
339
+ * `{ nativeEvent: { enabled } }`.
340
+ * Does only work with 'multiline={true}'.
341
+ */
342
+ onAutoCorrectChange?: (e: SettingChangeEvent) => void | undefined;
343
+
344
+ /**
345
+ * Callback that is called when the text input's spellCheck setting changes.
346
+ * This will be called with
347
+ * `{ nativeEvent: { enabled } }`.
348
+ * Does only work with 'multiline={true}'.
349
+ */
350
+ onSpellCheckChange?: (e: SettingChangeEvent) => void | undefined;
351
+
352
+ /**
353
+ * Callback that is called when the text input's grammarCheck setting changes.
354
+ * This will be called with
355
+ * `{ nativeEvent: { enabled } }`.
356
+ * Does only work with 'multiline={true}'.
357
+ */
358
+ onGrammarCheckChange?: (e: SettingChangeEvent) => void | undefined;
359
+
360
+ /**
361
+ * Enables Paste support for certain types of pasted types
362
+ *
363
+ * Possible values for `pastedTypes` are:
364
+ *
365
+ * - `'fileUrl'`
366
+ * - `'image'`
367
+ * - `'string'`
368
+ */
369
+ pastedTypes?: PastedTypesType | undefined;
370
+
371
+ /**
372
+ * Configures keys that can be used to submit editing for the TextInput. Defaults to 'Enter' key.
373
+ */
374
+ submitKeyEvents?: SubmitKeyEvent[] | undefined;
375
+
376
+ /**
377
+ * Specifies the tooltip.
378
+ */
379
+ tooltip?: string | undefined;
380
+ }
381
+
382
+ // macOS]
383
+
277
384
  /**
278
385
  * Android Specific properties for TextInput
279
386
  * @see https://reactnative.dev/docs/textinput#props
@@ -12,7 +12,12 @@ import {Insets} from '../../../types/public/Insets';
12
12
  import {GestureResponderHandlers} from '../../../types/public/ReactNativeRenderer';
13
13
  import {StyleProp} from '../../StyleSheet/StyleSheet';
14
14
  import {ViewStyle} from '../../StyleSheet/StyleSheetTypes';
15
- import {LayoutChangeEvent, PointerEvents} from '../../Types/CoreEventTypes';
15
+ import {
16
+ KeyEvent,
17
+ LayoutChangeEvent,
18
+ MouseEvent,
19
+ PointerEvents,
20
+ } from '../../Types/CoreEventTypes';
16
21
  import {Touchable} from '../Touchable/Touchable';
17
22
  import {AccessibilityProps} from './ViewAccessibility';
18
23
 
@@ -163,12 +168,31 @@ export interface ViewPropsAndroid {
163
168
  focusable?: boolean | undefined;
164
169
  }
165
170
 
171
+ export type DraggedType = 'fileUrl';
172
+ export type DraggedTypesType = DraggedType | DraggedType[];
173
+
174
+ export interface ViewPropsMacOS {
175
+ acceptsFirstMouse?: boolean | undefined;
176
+ enableFocusRing?: boolean | undefined;
177
+ onMouseEnter?: ((event: MouseEvent) => void) | undefined;
178
+ onMouseLeave?: ((event: MouseEvent) => void) | undefined;
179
+ onDragEnter?: ((event: MouseEvent) => void) | undefined;
180
+ onDragLeave?: ((event: MouseEvent) => void) | undefined;
181
+ onDrop?: ((event: MouseEvent) => void) | undefined;
182
+ onKeyDown?: ((event: KeyEvent) => void) | undefined;
183
+ onKeyUp?: ((event: KeyEvent) => void) | undefined;
184
+ validKeysDown?: string[] | undefined;
185
+ validKeysUp?: string[] | undefined;
186
+ draggedTypes?: DraggedTypesType | undefined;
187
+ }
188
+
166
189
  /**
167
190
  * @see https://reactnative.dev/docs/view#props
168
191
  */
169
192
  export interface ViewProps
170
193
  extends ViewPropsAndroid,
171
194
  ViewPropsIOS,
195
+ ViewPropsMacOS,
172
196
  GestureResponderHandlers,
173
197
  Touchable,
174
198
  PointerEvents,
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 71,
15
- patch: 6,
15
+ patch: 8,
16
16
  prerelease: null,
17
17
  };
@@ -81,6 +81,10 @@ interface ImagePropsAndroid {
81
81
  fadeDuration?: number | undefined;
82
82
  }
83
83
 
84
+ interface ImagePropsMacOS {
85
+ tooltip?: string | undefined;
86
+ }
87
+
84
88
  /**
85
89
  * @see https://reactnative.dev/docs/image#source
86
90
  */
@@ -117,6 +121,7 @@ export interface ImageResolvedAssetSource {
117
121
  export interface ImagePropsBase
118
122
  extends ImagePropsIOS,
119
123
  ImagePropsAndroid,
124
+ ImagePropsMacOS,
120
125
  AccessibilityProps {
121
126
  /**
122
127
  * Used to reference react managed images from native code.
@@ -28,6 +28,9 @@ export interface Spec extends TurboModule {
28
28
 
29
29
  // iOS only.
30
30
  +setIsShakeToShowDevMenuEnabled: (enabled: boolean) => void;
31
+
32
+ // macOS only.
33
+ +setIsSecondaryClickToShowDevMenuEnabled: (enabled: boolean) => void; // [macOS]
31
34
  }
32
35
 
33
36
  export default (TurboModuleRegistry.getEnforcing<Spec>('DevSettings'): Spec);
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import {ColorValue, OpaqueColorValue} from './StyleSheet';
6
+
7
+ type DynamicColorMacOSTuple = {
8
+ light: ColorValue;
9
+ dark: ColorValue;
10
+ highContrastLight?: ColorValue;
11
+ highContrastDark?: ColorValue;
12
+ };
13
+
14
+ export function DynamicColorMacOS(
15
+ tuple: DynamicColorMacOSTuple,
16
+ ): OpaqueColorValue;
17
+
18
+ type SystemEffectMacOS =
19
+ | 'none'
20
+ | 'pressed'
21
+ | 'deepPressed'
22
+ | 'disabled'
23
+ | 'rollover';
24
+
25
+ export function ColorWithSystemEffectMacOS(
26
+ color: ColorValue,
27
+ effect: SystemEffectMacOS,
28
+ ): OpaqueColorValue;
@@ -261,3 +261,25 @@ export interface PointerEvents {
261
261
  onPointerUp?: ((event: PointerEvent) => void) | undefined;
262
262
  onPointerUpCapture?: ((event: PointerEvent) => void) | undefined;
263
263
  }
264
+
265
+ // [macOS
266
+ export interface NativeKeyEvent {
267
+ // Modifier keys
268
+ capsLockKey: boolean;
269
+ shiftKey: boolean;
270
+ ctrlKey: boolean;
271
+ altKey: boolean;
272
+ metaKey: boolean;
273
+ numericPadKey: boolean;
274
+ helpKey: boolean;
275
+ functionKey: boolean;
276
+ // Key options
277
+ ArrowLeft: boolean;
278
+ ArrowRight: boolean;
279
+ ArrowUp: boolean;
280
+ ArrowDown: boolean;
281
+ key: string;
282
+ }
283
+
284
+ export interface KeyEvent extends NativeSyntheticEvent<NativeKeyEvent> {}
285
+ // macOS]
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(71),
26
- RCTVersionPatch: @(6),
26
+ RCTVersionPatch: @(8),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -31,6 +31,7 @@ static NSString *const kRCTDevSettingIsDebuggingRemotely = @"isDebuggingRemotely
31
31
  static NSString *const kRCTDevSettingExecutorOverrideClass = @"executor-override";
32
32
  static NSString *const kRCTDevSettingShakeToShowDevMenu = @"shakeToShow";
33
33
  static NSString *const kRCTDevSettingIsPerfMonitorShown = @"RCTPerfMonitorKey";
34
+ static NSString *const kRCTDevSettingSecondClickToShowDevMenu = @"secondClickToShow"; // [macOS]
34
35
 
35
36
  static NSString *const kRCTDevSettingsUserDefaultsKey = @"RCTDevMenu";
36
37
 
@@ -157,6 +158,7 @@ RCT_EXPORT_MODULE()
157
158
  NSDictionary *defaultValues = @{
158
159
  kRCTDevSettingShakeToShowDevMenu : @YES,
159
160
  kRCTDevSettingHotLoadingEnabled : @YES,
161
+ kRCTDevSettingSecondClickToShowDevMenu: @YES, // [macOS]
160
162
  };
161
163
  RCTDevSettingsUserDefaultsDataSource *dataSource =
162
164
  [[RCTDevSettingsUserDefaultsDataSource alloc] initWithDefaultValues:defaultValues];
@@ -332,6 +334,18 @@ RCT_EXPORT_METHOD(setIsShakeToShowDevMenuEnabled : (BOOL)enabled)
332
334
  return [[self settingForKey:kRCTDevSettingShakeToShowDevMenu] boolValue];
333
335
  }
334
336
 
337
+ // [macOS
338
+ RCT_EXPORT_METHOD(setIsSecondaryClickToShowDevMenuEnabled:(BOOL)enabled)
339
+ {
340
+ [self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingSecondClickToShowDevMenu];
341
+ }
342
+
343
+ - (BOOL)isSecondaryClickToShowDevMenuEnabled
344
+ {
345
+ return [[self settingForKey:kRCTDevSettingSecondClickToShowDevMenu] boolValue];
346
+ }
347
+ // macOS]
348
+
335
349
  RCT_EXPORT_METHOD(setIsDebuggingRemotely:(BOOL)enabled)
336
350
  {
337
351
  [self _updateSettingWithValue:@(enabled) forKey:kRCTDevSettingIsDebuggingRemotely];
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.71.6
1
+ VERSION_NAME=0.71.8
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -109,6 +109,13 @@ public class DevSettingsModule extends NativeDevSettingsSpec {
109
109
  // iOS only
110
110
  }
111
111
 
112
+ // [macOS
113
+ @Override
114
+ public void setIsShakeToShowDevMenuEnabled(boolean enabled) {
115
+ // macOS only
116
+ }
117
+ // macOS]
118
+
112
119
  @Override
113
120
  public void addListener(String eventName) {
114
121
  // iOS only
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 71,
20
- "patch", 6,
20
+ "patch", 8,
21
21
  "prerelease", null);
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 71;
20
- int32_t Patch = 6;
20
+ int32_t Patch = 8;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.71.6",
3
+ "version": "0.71.8",
4
4
  "bin": "./cli.js",
5
5
  "description": "React Native for macOS",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "react": "18.2.0",
15
- "react-native-macos": "0.71.6"
15
+ "react-native-macos": "0.71.8"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@babel/core": "^7.20.0",
package/types/index.d.ts CHANGED
@@ -133,6 +133,7 @@ export * from '../Libraries/ReactNative/requireNativeComponent';
133
133
  export * from '../Libraries/Settings/Settings';
134
134
  export * from '../Libraries/Share/Share';
135
135
  export * from '../Libraries/StyleSheet/PlatformColorValueTypesIOS';
136
+ export * from '../Libraries/StyleSheet/PlatformColorValueTypesMacOS'; // [macOS]
136
137
  export * from '../Libraries/StyleSheet/PlatformColorValueTypes';
137
138
  export * from '../Libraries/StyleSheet/StyleSheet';
138
139
  export * from '../Libraries/StyleSheet/StyleSheetTypes';