@react-navigation/native 8.0.0-alpha.50 → 8.0.0-alpha.51
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/android/build.gradle +93 -21
- package/android/src/main/java/org/reactnavigation/MaterialSymbolModule.kt +20 -6
- package/android/src/main/java/org/reactnavigation/MaterialSymbolTypeface.kt +84 -29
- package/android/src/main/java/org/reactnavigation/MaterialSymbolView.kt +18 -18
- package/android/src/main/java/org/reactnavigation/MaterialSymbolViewManager.kt +11 -0
- package/ios/ReactNavigationSFSymbolView.mm +7 -0
- package/ios/ReactNavigationSFSymbolView.swift +6 -0
- package/lib/module/NavigationContainer.js.map +1 -1
- package/lib/module/native/MaterialSymbol.android.js +12 -4
- package/lib/module/native/MaterialSymbol.android.js.map +1 -1
- package/lib/module/native/MaterialSymbol.js +3 -0
- package/lib/module/native/MaterialSymbol.js.map +1 -1
- package/lib/module/native/MaterialSymbolViewNativeComponent.ts +1 -0
- package/lib/module/native/NativeMaterialSymbolModule.js.map +1 -1
- package/lib/module/useLinkProps.js +1 -1
- package/lib/typescript/src/NavigationContainer.d.ts +2 -1
- package/lib/typescript/src/NavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts +4 -3
- package/lib/typescript/src/native/MaterialSymbol.android.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbol.d.ts +3 -2
- package/lib/typescript/src/native/MaterialSymbol.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts +1 -1
- package/lib/typescript/src/native/MaterialSymbolData.d.ts.map +1 -1
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts +1 -0
- package/lib/typescript/src/native/MaterialSymbolViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts +2 -1
- package/lib/typescript/src/native/NativeMaterialSymbolModule.d.ts.map +1 -1
- package/lib/typescript/src/native/types.d.ts +48 -7
- package/lib/typescript/src/native/types.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +14 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/NavigationContainer.tsx +2 -1
- package/src/native/MaterialSymbol.android.tsx +20 -4
- package/src/native/MaterialSymbol.tsx +9 -2
- package/src/native/MaterialSymbolData.tsx +34 -373
- package/src/native/MaterialSymbolViewNativeComponent.ts +1 -0
- package/src/native/NativeMaterialSymbolModule.ts +4 -1
- package/src/native/types.tsx +51 -7
- package/src/types.tsx +15 -0
- package/src/useLinkProps.tsx +1 -1
- package/assets/fonts/MaterialSymbolsOutlined.codepoints +0 -4268
- package/assets/fonts/MaterialSymbolsOutlined_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsOutlined_700.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded.codepoints +0 -4268
- package/assets/fonts/MaterialSymbolsRounded_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsRounded_700.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp.codepoints +0 -4268
- package/assets/fonts/MaterialSymbolsSharp_100.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_200.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_300.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_400.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_500.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_600.ttf +0 -0
- package/assets/fonts/MaterialSymbolsSharp_700.ttf +0 -0
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
import { type TurboModule, TurboModuleRegistry } from 'react-native';
|
|
4
4
|
|
|
5
5
|
export interface Spec extends TurboModule {
|
|
6
|
+
isAvailable(): boolean;
|
|
6
7
|
getImageSource(
|
|
7
8
|
name: string,
|
|
8
9
|
variant: string | undefined,
|
|
9
10
|
weight: 100 | 200 | 300 | 400 | 500 | 600 | 700 | undefined,
|
|
11
|
+
fill: boolean | undefined,
|
|
10
12
|
size: number,
|
|
11
13
|
// Codegen requires using `Object` instead of `object
|
|
12
14
|
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
|
|
13
|
-
color: Object
|
|
15
|
+
color: Object,
|
|
16
|
+
direction: 'ltr' | 'rtl'
|
|
14
17
|
): string;
|
|
15
18
|
}
|
|
16
19
|
|
package/src/native/types.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ColorValue } from 'react-native';
|
|
2
2
|
|
|
3
|
+
import type { LocaleDirection, SFSymbolNames } from '../types';
|
|
3
4
|
import type { FONT_WEIGHTS } from './constants';
|
|
4
5
|
import type { MaterialSymbolName } from './MaterialSymbolData';
|
|
5
6
|
|
|
@@ -15,12 +16,13 @@ export type MaterialSymbolOptions = {
|
|
|
15
16
|
*
|
|
16
17
|
* ```json
|
|
17
18
|
* "react-navigation": {
|
|
18
|
-
* "material-
|
|
19
|
+
* "material-symbols": {
|
|
19
20
|
* "fonts": [
|
|
20
21
|
* {
|
|
21
22
|
* "variant": "rounded",
|
|
22
|
-
* "
|
|
23
|
-
*
|
|
23
|
+
* "weights": [300],
|
|
24
|
+
* "fills": [0, 1]
|
|
25
|
+
* }
|
|
24
26
|
* ]
|
|
25
27
|
* }
|
|
26
28
|
* }
|
|
@@ -38,12 +40,13 @@ export type MaterialSymbolOptions = {
|
|
|
38
40
|
*
|
|
39
41
|
* ```json
|
|
40
42
|
* "react-navigation": {
|
|
41
|
-
* "material-
|
|
43
|
+
* "material-symbols": {
|
|
42
44
|
* "fonts": [
|
|
43
45
|
* {
|
|
44
46
|
* "variant": "rounded",
|
|
45
|
-
* "
|
|
46
|
-
*
|
|
47
|
+
* "weights": [300],
|
|
48
|
+
* "fills": [0, 1]
|
|
49
|
+
* }
|
|
47
50
|
* ]
|
|
48
51
|
* }
|
|
49
52
|
* }
|
|
@@ -71,6 +74,34 @@ export type MaterialSymbolOptions = {
|
|
|
71
74
|
| 600
|
|
72
75
|
| 700
|
|
73
76
|
| undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Whether to use the filled version of the symbol.
|
|
79
|
+
*
|
|
80
|
+
* Can be customized using `react-navigation` key in `package.json`:
|
|
81
|
+
*
|
|
82
|
+
* ```json
|
|
83
|
+
* "react-navigation": {
|
|
84
|
+
* "material-symbols": {
|
|
85
|
+
* "fonts": [
|
|
86
|
+
* {
|
|
87
|
+
* "variant": "rounded",
|
|
88
|
+
* "weights": [300],
|
|
89
|
+
* "fills": [0, 1]
|
|
90
|
+
* }
|
|
91
|
+
* ]
|
|
92
|
+
* }
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* Here:
|
|
97
|
+
* - `0`: Unfilled version
|
|
98
|
+
* - `1`: Filled version
|
|
99
|
+
*
|
|
100
|
+
* Automatically set if a single fill is available.
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
fill?: boolean | undefined;
|
|
74
105
|
/**
|
|
75
106
|
* The size of the symbol.
|
|
76
107
|
*
|
|
@@ -85,6 +116,17 @@ export type MaterialSymbolOptions = {
|
|
|
85
116
|
color?: ColorValue | undefined;
|
|
86
117
|
};
|
|
87
118
|
|
|
119
|
+
export type MaterialSymbolImageSourceOptions = MaterialSymbolOptions & {
|
|
120
|
+
/**
|
|
121
|
+
* The layout direction to render the symbol for.
|
|
122
|
+
*
|
|
123
|
+
* Symbols that support auto-mirroring are flipped horizontally in RTL.
|
|
124
|
+
*
|
|
125
|
+
* @default I18nManager.getConstants().isRTL ? 'rtl' : 'ltr'
|
|
126
|
+
*/
|
|
127
|
+
direction?: LocaleDirection | undefined;
|
|
128
|
+
};
|
|
129
|
+
|
|
88
130
|
type SFSymbolScale = 'small' | 'medium' | 'large';
|
|
89
131
|
|
|
90
132
|
type SFSymbolRenderingMode =
|
|
@@ -364,7 +406,9 @@ export type SFSymbolOptions = {
|
|
|
364
406
|
/**
|
|
365
407
|
* The name of the SF Symbol to display.
|
|
366
408
|
*/
|
|
367
|
-
name:
|
|
409
|
+
name:
|
|
410
|
+
| import('sf-symbols-typescript').SFSymbol
|
|
411
|
+
| Extract<keyof SFSymbolNames, string>;
|
|
368
412
|
/**
|
|
369
413
|
* The size of the symbol.
|
|
370
414
|
*
|
package/src/types.tsx
CHANGED
|
@@ -58,6 +58,21 @@ declare module '@react-navigation/core' {
|
|
|
58
58
|
interface Theme extends NativeTheme {}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Names of custom SF Symbols available in the app, such as symbols from the asset catalog.
|
|
63
|
+
* Custom names can be added using declaration merging:
|
|
64
|
+
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* declare module '@react-navigation/native' {
|
|
67
|
+
* interface SFSymbolNames {
|
|
68
|
+
* 'my.custom.symbol': true;
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
74
|
+
export interface SFSymbolNames {}
|
|
75
|
+
|
|
61
76
|
export type LocaleDirection = 'ltr' | 'rtl';
|
|
62
77
|
|
|
63
78
|
export type LinkingPrefix = '*' | (string & {});
|
package/src/useLinkProps.tsx
CHANGED
|
@@ -119,7 +119,7 @@ const NAVIGATE_ACTION_TYPES = [
|
|
|
119
119
|
* Nested params are tracked as consumed after handling
|
|
120
120
|
* So navigating with same params again won't work
|
|
121
121
|
* This can happen if the action or params are memoized
|
|
122
|
-
* Or component hasn't re-
|
|
122
|
+
* Or component hasn't re-rendered to re-create inline objects
|
|
123
123
|
* So we clone the action and params when necessary before dispatch
|
|
124
124
|
*/
|
|
125
125
|
function clone<T>(value: T): T;
|