@granite-js/react-native 0.1.26 → 0.1.28
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/CHANGELOG.md +33 -0
- package/dist/index.d.ts +1 -0
- package/dist/router/hooks/useIsInitialScreen.d.ts +5 -0
- package/package.json +15 -10
- package/src/app/Granite.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/polyfills/index.ts +5 -0
- package/src/router/createRoute.ts +3 -2
- package/src/router/hooks/useIsInitialScreen.ts +5 -0
- package/dist/rn-polyfills/symbol-asynciterator/index.d.ts +0 -9
- package/dist/rn-polyfills/url/index.d.ts +0 -1
- package/src/rn-polyfills/index.ts +0 -7
- package/src/rn-polyfills/symbol-asynciterator/index.ts +0 -15
- package/src/rn-polyfills/url/index.ts +0 -1
- /package/dist/{rn-polyfills → polyfills}/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @granite-js/react-native
|
|
2
2
|
|
|
3
|
+
## 0.1.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1d958cc: ci: provenance
|
|
8
|
+
- Updated dependencies [1d958cc]
|
|
9
|
+
- @granite-js/cli@0.1.28
|
|
10
|
+
- @granite-js/image@0.1.28
|
|
11
|
+
- @granite-js/jest@0.1.28
|
|
12
|
+
- @granite-js/lottie@0.1.28
|
|
13
|
+
- @granite-js/mpack@0.1.28
|
|
14
|
+
- @granite-js/native@0.1.28
|
|
15
|
+
- @granite-js/plugin-core@0.1.28
|
|
16
|
+
- @granite-js/style-utils@0.1.28
|
|
17
|
+
|
|
18
|
+
## 0.1.27
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 664f2a1: add useIsInitialScreen export in index(for user's import)
|
|
23
|
+
- d13ddeb: fix(router): useParams used from is strict: true
|
|
24
|
+
- e32b020: ci: oidc
|
|
25
|
+
- Updated dependencies [e32b020]
|
|
26
|
+
- Updated dependencies [1dd9179]
|
|
27
|
+
- @granite-js/cli@0.1.27
|
|
28
|
+
- @granite-js/image@0.1.27
|
|
29
|
+
- @granite-js/jest@0.1.27
|
|
30
|
+
- @granite-js/lottie@0.1.27
|
|
31
|
+
- @granite-js/mpack@0.1.27
|
|
32
|
+
- @granite-js/native@0.1.27
|
|
33
|
+
- @granite-js/plugin-core@0.1.27
|
|
34
|
+
- @granite-js/style-utils@0.1.27
|
|
35
|
+
|
|
3
36
|
## 0.1.26
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './intersection-observer';
|
|
|
12
12
|
export * from './impression-area';
|
|
13
13
|
export * from './scroll-view-inertial-background';
|
|
14
14
|
export * from './router/createRoute';
|
|
15
|
+
export * from './router/hooks/useIsInitialScreen';
|
|
15
16
|
export * from './event';
|
|
16
17
|
export * from './video';
|
|
17
18
|
export * from './status-bar';
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook that determines if the current screen is the initial screen in the navigation stack.
|
|
3
|
+
*
|
|
4
|
+
* @returns {boolean} True if the current screen is the initial (first) screen in the stack, false otherwise.
|
|
5
|
+
*/
|
|
1
6
|
export declare function useIsInitialScreen(): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granite-js/react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28",
|
|
4
4
|
"description": "The Granite Framework",
|
|
5
5
|
"bin": {
|
|
6
6
|
"granite": "./bin/cli.js"
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
},
|
|
15
15
|
"main": "./dist/index.js",
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/toss/granite.git",
|
|
20
|
+
"directory": "packages/react-native"
|
|
21
|
+
},
|
|
17
22
|
"exports": {
|
|
18
23
|
".": {
|
|
19
24
|
"types": "./dist/index.d.ts",
|
|
@@ -86,7 +91,7 @@
|
|
|
86
91
|
"@babel/core": "^7.24.9",
|
|
87
92
|
"@babel/preset-env": "^7.24.8",
|
|
88
93
|
"@babel/preset-typescript": "^7.24.7",
|
|
89
|
-
"@granite-js/native": "0.1.
|
|
94
|
+
"@granite-js/native": "0.1.28",
|
|
90
95
|
"@testing-library/dom": "^10.4.0",
|
|
91
96
|
"@testing-library/react": "^16.1.0",
|
|
92
97
|
"@types/babel__core": "^7",
|
|
@@ -112,15 +117,15 @@
|
|
|
112
117
|
"react-native": "*"
|
|
113
118
|
},
|
|
114
119
|
"dependencies": {
|
|
115
|
-
"@granite-js/cli": "0.1.
|
|
116
|
-
"@granite-js/image": "0.1.
|
|
117
|
-
"@granite-js/jest": "0.1.
|
|
118
|
-
"@granite-js/lottie": "0.1.
|
|
119
|
-
"@granite-js/mpack": "0.1.
|
|
120
|
-
"@granite-js/plugin-core": "0.1.
|
|
121
|
-
"@granite-js/style-utils": "0.1.
|
|
120
|
+
"@granite-js/cli": "0.1.28",
|
|
121
|
+
"@granite-js/image": "0.1.28",
|
|
122
|
+
"@granite-js/jest": "0.1.28",
|
|
123
|
+
"@granite-js/lottie": "0.1.28",
|
|
124
|
+
"@granite-js/mpack": "0.1.28",
|
|
125
|
+
"@granite-js/plugin-core": "0.1.28",
|
|
126
|
+
"@granite-js/style-utils": "0.1.28",
|
|
122
127
|
"es-toolkit": "^1.39.8",
|
|
123
|
-
"react-native-url-polyfill": "
|
|
128
|
+
"react-native-url-polyfill": "3.0.0"
|
|
124
129
|
},
|
|
125
130
|
"sideEffects": [
|
|
126
131
|
"dist/async-bridges.*",
|
package/src/app/Granite.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import type { RouterProps, RequireContext } from '../router';
|
|
|
6
6
|
import { AppRoot } from './AppRoot';
|
|
7
7
|
import { HostAppRoot } from './HostAppRoot';
|
|
8
8
|
import { getSchemeUri } from '../constant-bridges';
|
|
9
|
-
import { setupPolyfills } from '../
|
|
9
|
+
import { setupPolyfills } from '../polyfills';
|
|
10
10
|
|
|
11
11
|
export interface GraniteProps {
|
|
12
12
|
/**
|
package/src/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './intersection-observer';
|
|
|
14
14
|
export * from './impression-area';
|
|
15
15
|
export * from './scroll-view-inertial-background';
|
|
16
16
|
export * from './router/createRoute';
|
|
17
|
+
export * from './router/hooks/useIsInitialScreen';
|
|
17
18
|
export * from './event';
|
|
18
19
|
export * from './video';
|
|
19
20
|
export * from './status-bar';
|
|
@@ -133,14 +133,15 @@ export function useParams<TScreen extends keyof RegisterScreen>(
|
|
|
133
133
|
const routeOptions = useMatchOptions(options);
|
|
134
134
|
const route = useRoute();
|
|
135
135
|
|
|
136
|
+
const isStrict = typeof options.from === 'string' ? true : options.strict;
|
|
136
137
|
const params = useMemo(() => {
|
|
137
138
|
if (!routeOptions) {
|
|
138
139
|
return (route.params ?? {}) as Readonly<object | undefined>;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
const parsedParams = routeOptions.parserParams(route.params as Record<string, string>);
|
|
142
|
-
return
|
|
143
|
-
}, [routeOptions, route.params,
|
|
143
|
+
return isStrict && routeOptions.validateParams ? routeOptions.validateParams(parsedParams) : parsedParams;
|
|
144
|
+
}, [routeOptions, route.params, isStrict]);
|
|
144
145
|
|
|
145
146
|
return params;
|
|
146
147
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { useNavigationState } from '@granite-js/native/@react-navigation/native';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Hook that determines if the current screen is the initial screen in the navigation stack.
|
|
5
|
+
*
|
|
6
|
+
* @returns {boolean} True if the current screen is the initial (first) screen in the stack, false otherwise.
|
|
7
|
+
*/
|
|
3
8
|
export function useIsInitialScreen() {
|
|
4
9
|
const index = useNavigationState((state) => state?.index ?? 0);
|
|
5
10
|
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Polyfill for @swc/helpers build compatibility
|
|
3
|
-
*
|
|
4
|
-
* @see https://github.com/swc-project/swc/blob/v1.4.15/packages/helpers/esm/_async_iterator.js#L3
|
|
5
|
-
*
|
|
6
|
-
* - babel: No runtime issues after build as there is a fallback for `Symbol.asyncIterator`
|
|
7
|
-
* - swc: No fallback for `Symbol.asyncIterator`, so it needs to be defined in advance
|
|
8
|
-
*/
|
|
9
|
-
export declare function setup(): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { setupURLPolyfill as setup } from 'react-native-url-polyfill';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Polyfill for @swc/helpers build compatibility
|
|
3
|
-
*
|
|
4
|
-
* @see https://github.com/swc-project/swc/blob/v1.4.15/packages/helpers/esm/_async_iterator.js#L3
|
|
5
|
-
*
|
|
6
|
-
* - babel: No runtime issues after build as there is a fallback for `Symbol.asyncIterator`
|
|
7
|
-
* - swc: No fallback for `Symbol.asyncIterator`, so it needs to be defined in advance
|
|
8
|
-
*/
|
|
9
|
-
export function setup() {
|
|
10
|
-
if (typeof Symbol !== 'undefined' && !Symbol.asyncIterator) {
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
Symbol.asyncIterator = Symbol.for('@@asyncIterator');
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { setupURLPolyfill as setup } from 'react-native-url-polyfill';
|
|
File without changes
|