@granite-js/react-native 0.1.23-next.5 → 0.1.23
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 +9 -54
- package/dist/app/Granite.d.ts +2 -2
- package/dist/async-bridges.d.mts +1 -1
- package/dist/async-bridges.js +2 -5
- package/dist/async-bridges.mjs +2 -2
- package/dist/constant-bridges.js +2 -5
- package/dist/constant-bridges.mjs +2 -2
- package/dist/intersection-observer/IOFlatList.d.ts +2 -2
- package/dist/native-event-emitter/nativeEventEmitter.d.ts +1 -5
- package/dist/native-modules/core/GraniteCoreModule.d.ts +1 -1
- package/dist/native-modules/natives/GraniteModule.d.ts +1 -1
- package/dist/native-modules/natives/closeView.d.ts +1 -1
- package/dist/router/Router.d.ts +0 -1
- package/dist/router/components/StackNavigator.d.ts +42 -36
- package/dist/router/components/useRouterBackHandler.d.ts +2 -2
- package/dist/video/Video.d.ts +2 -2
- package/dist/video/instance.d.ts +2 -2
- package/package.json +16 -14
- package/src/app/Granite.tsx +2 -2
- package/src/intersection-observer/IOFlatList.ts +2 -2
- package/src/native-event-emitter/nativeEventEmitter.ts +1 -12
- package/src/native-modules/core/GraniteCoreModule.ts +1 -1
- package/src/native-modules/natives/GraniteModule.ts +1 -4
- package/src/native-modules/natives/closeView.ts +1 -1
- package/src/native-modules/natives/getSchemeUri.ts +1 -1
- package/src/router/Router.tsx +5 -5
- package/src/router/components/useRouterBackHandler.tsx +2 -2
- package/src/video/Video.tsx +1 -1
- package/src/video/instance.tsx +2 -2
- package/src/visibility/utils/usePrevious.tsx +1 -1
- package/dist/chunk-2PYPIQMA.mjs +0 -10
- package/dist/react/index.d.ts +0 -1
- package/dist/react/useWaitForReturnNavigator.d.ts +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,63 +1,18 @@
|
|
|
1
1
|
# @granite-js/react-native
|
|
2
2
|
|
|
3
|
-
## 0.1.23
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- temp
|
|
8
|
-
- Updated dependencies
|
|
9
|
-
- @granite-js/plugin-core@0.1.23-next.5
|
|
10
|
-
- @granite-js/style-utils@0.1.23-next.5
|
|
11
|
-
- @granite-js/lottie@0.1.23-next.5
|
|
12
|
-
- @granite-js/native@0.1.23-next.5
|
|
13
|
-
- @granite-js/image@0.1.23-next.5
|
|
14
|
-
- @granite-js/mpack@0.1.23-next.5
|
|
15
|
-
- @granite-js/jest@0.1.23-next.5
|
|
16
|
-
- @granite-js/cli@0.1.23-next.5
|
|
17
|
-
|
|
18
|
-
## 0.1.23-next.4
|
|
19
|
-
|
|
20
|
-
### Patch Changes
|
|
21
|
-
|
|
22
|
-
- test
|
|
23
|
-
- Updated dependencies
|
|
24
|
-
- @granite-js/plugin-core@0.1.23-next.4
|
|
25
|
-
- @granite-js/style-utils@0.1.23-next.4
|
|
26
|
-
- @granite-js/lottie@0.1.23-next.4
|
|
27
|
-
- @granite-js/native@0.1.23-next.4
|
|
28
|
-
- @granite-js/image@0.1.23-next.4
|
|
29
|
-
- @granite-js/mpack@0.1.23-next.4
|
|
30
|
-
- @granite-js/jest@0.1.23-next.4
|
|
31
|
-
- @granite-js/cli@0.1.23-next.4
|
|
32
|
-
|
|
33
|
-
## 0.1.23-next.3
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- test
|
|
38
|
-
- Updated dependencies
|
|
39
|
-
- @granite-js/plugin-core@0.1.23-next.3
|
|
40
|
-
- @granite-js/style-utils@0.1.23-next.3
|
|
41
|
-
- @granite-js/lottie@0.1.23-next.3
|
|
42
|
-
- @granite-js/native@0.1.23-next.3
|
|
43
|
-
- @granite-js/image@0.1.23-next.3
|
|
44
|
-
- @granite-js/mpack@0.1.23-next.3
|
|
45
|
-
- @granite-js/jest@0.1.23-next.3
|
|
46
|
-
- @granite-js/cli@0.1.23-next.3
|
|
47
|
-
|
|
48
|
-
## 0.1.23-next.0
|
|
3
|
+
## 0.1.23
|
|
49
4
|
|
|
50
5
|
### Patch Changes
|
|
51
6
|
|
|
52
7
|
- d9b7d7c: avoid multiple app registrations without throwing errors
|
|
53
|
-
- @granite-js/cli@0.1.23
|
|
54
|
-
- @granite-js/image@0.1.23
|
|
55
|
-
- @granite-js/jest@0.1.23
|
|
56
|
-
- @granite-js/lottie@0.1.23
|
|
57
|
-
- @granite-js/mpack@0.1.23
|
|
58
|
-
- @granite-js/native@0.1.23
|
|
59
|
-
- @granite-js/plugin-core@0.1.23
|
|
60
|
-
- @granite-js/style-utils@0.1.23
|
|
8
|
+
- @granite-js/cli@0.1.23
|
|
9
|
+
- @granite-js/image@0.1.23
|
|
10
|
+
- @granite-js/jest@0.1.23
|
|
11
|
+
- @granite-js/lottie@0.1.23
|
|
12
|
+
- @granite-js/mpack@0.1.23
|
|
13
|
+
- @granite-js/native@0.1.23
|
|
14
|
+
- @granite-js/plugin-core@0.1.23
|
|
15
|
+
- @granite-js/style-utils@0.1.23
|
|
61
16
|
|
|
62
17
|
## 0.1.22
|
|
63
18
|
|
package/dist/app/Granite.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType,
|
|
1
|
+
import { ComponentType, PropsWithChildren } from 'react';
|
|
2
2
|
import type { InitialProps } from '../initial-props';
|
|
3
3
|
import type { RouterProps, RequireContext } from '../router';
|
|
4
4
|
export interface GraniteProps {
|
|
@@ -68,6 +68,6 @@ export interface GraniteProps {
|
|
|
68
68
|
*/
|
|
69
69
|
export declare const Granite: {
|
|
70
70
|
registerApp(AppContainer: ComponentType<PropsWithChildren<InitialProps>>, { appName, context, router, initialScheme, setIosSwipeGestureEnabled }: GraniteProps): (initialProps: InitialProps) => JSX.Element;
|
|
71
|
-
registerHostApp(AppContainer: ComponentType<PropsWithChildren<InitialProps>>, { appName }: Pick<GraniteProps, "appName">): (initialProps: InitialProps) =>
|
|
71
|
+
registerHostApp(AppContainer: ComponentType<PropsWithChildren<InitialProps>>, { appName }: Pick<GraniteProps, "appName">): (initialProps: InitialProps) => JSX.Element;
|
|
72
72
|
readonly appName: string;
|
|
73
73
|
};
|
package/dist/async-bridges.d.mts
CHANGED
package/dist/async-bridges.js
CHANGED
|
@@ -27,14 +27,11 @@ module.exports = __toCommonJS(async_bridges_exports);
|
|
|
27
27
|
|
|
28
28
|
// src/native-modules/natives/GraniteModule.ts
|
|
29
29
|
var import_react_native = require("react-native");
|
|
30
|
-
var GraniteModule = import_react_native.TurboModuleRegistry.
|
|
31
|
-
if (!GraniteModule) {
|
|
32
|
-
console.warn("[GraniteModule] is not registered");
|
|
33
|
-
}
|
|
30
|
+
var GraniteModule = import_react_native.TurboModuleRegistry.getEnforcing("GraniteModule");
|
|
34
31
|
|
|
35
32
|
// src/native-modules/natives/closeView.ts
|
|
36
33
|
async function closeView() {
|
|
37
|
-
return GraniteModule
|
|
34
|
+
return GraniteModule.closeView();
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
// src/native-modules/natives/openURL.ts
|
package/dist/async-bridges.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GraniteModule
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A3JGM5OI.mjs";
|
|
4
4
|
|
|
5
5
|
// src/native-modules/natives/closeView.ts
|
|
6
6
|
async function closeView() {
|
|
7
|
-
return GraniteModule
|
|
7
|
+
return GraniteModule.closeView();
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
// src/native-modules/natives/openURL.ts
|
package/dist/constant-bridges.js
CHANGED
|
@@ -26,14 +26,11 @@ module.exports = __toCommonJS(constant_bridges_exports);
|
|
|
26
26
|
|
|
27
27
|
// src/native-modules/natives/GraniteModule.ts
|
|
28
28
|
var import_react_native = require("react-native");
|
|
29
|
-
var GraniteModule = import_react_native.TurboModuleRegistry.
|
|
30
|
-
if (!GraniteModule) {
|
|
31
|
-
console.warn("[GraniteModule] is not registered");
|
|
32
|
-
}
|
|
29
|
+
var GraniteModule = import_react_native.TurboModuleRegistry.getEnforcing("GraniteModule");
|
|
33
30
|
|
|
34
31
|
// src/native-modules/natives/getSchemeUri.ts
|
|
35
32
|
function getSchemeUri() {
|
|
36
|
-
return GraniteModule
|
|
33
|
+
return GraniteModule.schemeUri;
|
|
37
34
|
}
|
|
38
35
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
36
|
0 && (module.exports = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GraniteModule
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A3JGM5OI.mjs";
|
|
4
4
|
|
|
5
5
|
// src/native-modules/natives/getSchemeUri.ts
|
|
6
6
|
function getSchemeUri() {
|
|
7
|
-
return GraniteModule
|
|
7
|
+
return GraniteModule.schemeUri;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
10
10
|
getSchemeUri
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
2
2
|
import { FlatList, FlatListProps } from 'react-native';
|
|
3
3
|
import { IOComponentProps } from './withIO';
|
|
4
4
|
export type IOFlatListController = FlatList;
|
|
@@ -51,5 +51,5 @@ export type IOFlatListProps<ItemT = any> = IOComponentProps & FlatListProps<Item
|
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
53
|
declare const IOFlatList: typeof IOFlatListFunction;
|
|
54
|
-
declare function IOFlatListFunction<ItemT = any>(props: IOFlatListProps<ItemT> & RefAttributes<IOFlatListController>):
|
|
54
|
+
declare function IOFlatListFunction<ItemT = any>(props: IOFlatListProps<ItemT> & RefAttributes<IOFlatListController>): JSX.Element;
|
|
55
55
|
export default IOFlatList;
|
|
@@ -11,9 +11,5 @@ type ParamOf<K extends EventKeys> = EventEmittersMap[K]['params'];
|
|
|
11
11
|
interface EventEmitter {
|
|
12
12
|
addListener<Event extends EventKeys>(event: Event, callback: (...params: ParamOf<Event>) => void): EmitterSubscription;
|
|
13
13
|
}
|
|
14
|
-
export declare const nativeEventEmitter: EventEmitter
|
|
15
|
-
addListener: () => {
|
|
16
|
-
remove: () => void;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
14
|
+
export declare const nativeEventEmitter: EventEmitter;
|
|
19
15
|
export {};
|
|
@@ -4,5 +4,5 @@ interface GraniteCoreModule extends TurboModule {
|
|
|
4
4
|
removeListeners: (count: number) => void;
|
|
5
5
|
importLazy: () => Promise<void>;
|
|
6
6
|
}
|
|
7
|
-
export declare const GraniteCoreModule: GraniteCoreModule
|
|
7
|
+
export declare const GraniteCoreModule: GraniteCoreModule;
|
|
8
8
|
export {};
|
package/dist/router/Router.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ interface StackNavigatorProps {
|
|
|
26
26
|
screenContainer?: ComponentType<PropsWithChildren<any>>;
|
|
27
27
|
}
|
|
28
28
|
type NavigationContainerProps = Pick<ComponentProps<typeof NavigationContainer>, 'ref' | 'documentTitle' | 'fallback' | 'onReady' | 'onUnhandledAction' | 'onStateChange'>;
|
|
29
|
-
export declare const navigationRef: NavigationContainerRefWithCurrent<never>;
|
|
30
29
|
/**
|
|
31
30
|
* @category Components
|
|
32
31
|
* @kind function
|
|
@@ -1,48 +1,54 @@
|
|
|
1
1
|
export declare const StackNavigator: {
|
|
2
|
-
Navigator: import("react").ComponentType<Omit<import("@react-navigation/
|
|
2
|
+
Navigator: import("react").ComponentType<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
3
|
+
id?: string;
|
|
3
4
|
children: React.ReactNode;
|
|
4
|
-
layout?: ((props: {
|
|
5
|
-
state: import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>;
|
|
6
|
-
navigation: import("@react-navigation/core").NavigationHelpers<import("@react-navigation/routers").ParamListBase, {}>;
|
|
7
|
-
descriptors: Record<string, import("@react-navigation/core").Descriptor<import("@react-navigation/native-stack").NativeStackNavigationOptions, import("@react-navigation/core").NavigationProp<import("@react-navigation/routers").ParamListBase, string, string | undefined, import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>, import("@react-navigation/native-stack").NativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationEventMap>, import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>>>;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}) => React.ReactElement) | undefined;
|
|
10
5
|
screenListeners?: Partial<{
|
|
11
|
-
transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionStart"
|
|
12
|
-
transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionEnd"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "state", unknown>;
|
|
18
|
-
beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "beforeRemove", true>;
|
|
6
|
+
transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionStart">;
|
|
7
|
+
transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionEnd">;
|
|
8
|
+
focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "focus">;
|
|
9
|
+
blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "blur">;
|
|
10
|
+
state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "state">;
|
|
11
|
+
beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "beforeRemove">;
|
|
19
12
|
}> | ((props: {
|
|
20
13
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
21
|
-
navigation:
|
|
14
|
+
navigation: any;
|
|
22
15
|
}) => Partial<{
|
|
23
|
-
transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionStart"
|
|
24
|
-
transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionEnd"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "state", unknown>;
|
|
30
|
-
beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "beforeRemove", true>;
|
|
16
|
+
transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionStart">;
|
|
17
|
+
transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionEnd">;
|
|
18
|
+
focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "focus">;
|
|
19
|
+
blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "blur">;
|
|
20
|
+
state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "state">;
|
|
21
|
+
beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "beforeRemove">;
|
|
31
22
|
}>) | undefined;
|
|
32
23
|
screenOptions?: import("@react-navigation/native-stack").NativeStackNavigationOptions | ((props: {
|
|
33
24
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
34
|
-
navigation:
|
|
35
|
-
|
|
25
|
+
navigation: any;
|
|
26
|
+
}) => import("@react-navigation/native-stack").NativeStackNavigationOptions) | undefined;
|
|
27
|
+
} & import("@react-navigation/routers").StackRouterOptions, "children" | "id" | "initialRouteName" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
28
|
+
id?: string;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
screenListeners?: Partial<{
|
|
31
|
+
transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionStart">;
|
|
32
|
+
transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionEnd">;
|
|
33
|
+
focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "focus">;
|
|
34
|
+
blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "blur">;
|
|
35
|
+
state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "state">;
|
|
36
|
+
beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "beforeRemove">;
|
|
37
|
+
}> | ((props: {
|
|
38
|
+
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
39
|
+
navigation: any;
|
|
40
|
+
}) => Partial<{
|
|
41
|
+
transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionStart">;
|
|
42
|
+
transitionEnd: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "transitionEnd">;
|
|
43
|
+
focus: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "focus">;
|
|
44
|
+
blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "blur">;
|
|
45
|
+
state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "state">;
|
|
46
|
+
beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap & import("@react-navigation/core").EventMapCore<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>>, "beforeRemove">;
|
|
47
|
+
}>) | undefined;
|
|
48
|
+
screenOptions?: import("@react-navigation/native-stack").NativeStackNavigationOptions | ((props: {
|
|
49
|
+
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
50
|
+
navigation: any;
|
|
36
51
|
}) => import("@react-navigation/native-stack").NativeStackNavigationOptions) | undefined;
|
|
37
|
-
screenLayout?: ((props: import("@react-navigation/core").ScreenLayoutArgs<import("@react-navigation/routers").ParamListBase, string, import("@react-navigation/native-stack").NativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/routers").ParamListBase, string, undefined>>) => React.ReactElement) | undefined;
|
|
38
|
-
UNSTABLE_router?: (<Action extends Readonly<{
|
|
39
|
-
type: string;
|
|
40
|
-
payload?: object;
|
|
41
|
-
source?: string;
|
|
42
|
-
target?: string;
|
|
43
|
-
}>>(original: import("@react-navigation/routers").Router<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>, Action>) => Partial<import("@react-navigation/routers").Router<import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>, Action>>) | undefined;
|
|
44
|
-
} & {
|
|
45
|
-
id?: undefined;
|
|
46
52
|
}>;
|
|
47
|
-
Screen: <RouteName extends string>(_: import("@react-navigation/core").RouteConfig<import("@react-navigation/routers").ParamListBase, RouteName, import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>, import("@react-navigation/native-stack").NativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationEventMap
|
|
53
|
+
Screen: <RouteName extends string>(_: import("@react-navigation/core").RouteConfig<import("@react-navigation/routers").ParamListBase, RouteName, import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>, import("@react-navigation/native-stack").NativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationEventMap>) => null;
|
|
48
54
|
};
|
|
@@ -42,13 +42,13 @@ import { NavigationContainerRefWithCurrent } from '@granite-js/native/@react-nav
|
|
|
42
42
|
* }
|
|
43
43
|
*/
|
|
44
44
|
export declare function useRouterBackHandler({ navigationContainerRef, onClose, }: {
|
|
45
|
-
navigationContainerRef: NavigationContainerRefWithCurrent<
|
|
45
|
+
navigationContainerRef: NavigationContainerRefWithCurrent<any>;
|
|
46
46
|
onClose?: () => void;
|
|
47
47
|
}): {
|
|
48
48
|
handler: () => void;
|
|
49
49
|
};
|
|
50
50
|
export declare function useInternalRouterBackHandler({ navigationContainerRef, onClose, }: {
|
|
51
|
-
navigationContainerRef: NavigationContainerRefWithCurrent<
|
|
51
|
+
navigationContainerRef: NavigationContainerRefWithCurrent<any>;
|
|
52
52
|
onClose?: () => void;
|
|
53
53
|
}): {
|
|
54
54
|
handler: () => void;
|
package/dist/video/Video.d.ts
CHANGED
|
@@ -58,11 +58,11 @@ type VideoProps = ComponentProps<typeof AnimatedRNVideo>;
|
|
|
58
58
|
* }
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
|
-
declare const VideoImpl: import("react").ForwardRefExoticComponent<Omit<import("react-native-video").
|
|
61
|
+
declare const VideoImpl: import("react").ForwardRefExoticComponent<Omit<import("react-native-video").VideoProperties, "onAudioFocusChanged"> & {
|
|
62
62
|
onAudioFocusChanged?: (event: {
|
|
63
63
|
hasAudioFocus: boolean;
|
|
64
64
|
}) => void;
|
|
65
|
-
} & import("react").RefAttributes<
|
|
65
|
+
} & import("react").RefAttributes<VideoRef>>;
|
|
66
66
|
export declare const Video: typeof VideoImpl & {
|
|
67
67
|
isAvailable: boolean;
|
|
68
68
|
};
|
package/dist/video/instance.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VideoProperties } from '@granite-js/native/react-native-video';
|
|
2
2
|
import { type ComponentType } from 'react';
|
|
3
|
-
export type VideoNativeProps = Omit<
|
|
3
|
+
export type VideoNativeProps = Omit<VideoProperties, 'onAudioFocusChanged'> & {
|
|
4
4
|
onAudioFocusChanged?: (event: {
|
|
5
5
|
hasAudioFocus: boolean;
|
|
6
6
|
}) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granite-js/react-native",
|
|
3
|
-
"version": "0.1.23
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "The Granite Framework",
|
|
5
5
|
"bin": {
|
|
6
6
|
"granite": "./bin/cli.js"
|
|
@@ -86,37 +86,39 @@
|
|
|
86
86
|
"@babel/core": "^7.24.9",
|
|
87
87
|
"@babel/preset-env": "^7.24.8",
|
|
88
88
|
"@babel/preset-typescript": "^7.24.7",
|
|
89
|
-
"@granite-js/native": "0.1.23
|
|
89
|
+
"@granite-js/native": "0.1.23",
|
|
90
90
|
"@testing-library/dom": "^10.4.0",
|
|
91
91
|
"@testing-library/react": "^16.1.0",
|
|
92
92
|
"@types/babel__core": "^7",
|
|
93
93
|
"@types/babel__preset-env": "^7",
|
|
94
94
|
"@types/node": "^22.10.2",
|
|
95
|
-
"@types/react": "
|
|
95
|
+
"@types/react": "18.3.3",
|
|
96
|
+
"@types/react-dom": "^18",
|
|
96
97
|
"@vitest/coverage-v8": "^2.1.8",
|
|
97
|
-
"esbuild": "0.25.
|
|
98
|
+
"esbuild": "0.25.8",
|
|
98
99
|
"eslint": "^9.7.0",
|
|
99
100
|
"jsdom": "^25.0.1",
|
|
100
|
-
"react": "
|
|
101
|
-
"react-
|
|
101
|
+
"react": "18.2.0",
|
|
102
|
+
"react-dom": "18.2.0",
|
|
103
|
+
"react-native": "0.72.6",
|
|
102
104
|
"tsup": "^8.5.0",
|
|
103
105
|
"typescript": "5.8.3",
|
|
104
106
|
"vitest": "^2.1.8"
|
|
105
107
|
},
|
|
106
108
|
"peerDependencies": {
|
|
107
|
-
"@granite-js/native": "
|
|
109
|
+
"@granite-js/native": "*",
|
|
108
110
|
"@types/react": "*",
|
|
109
111
|
"react": "*",
|
|
110
112
|
"react-native": "*"
|
|
111
113
|
},
|
|
112
114
|
"dependencies": {
|
|
113
|
-
"@granite-js/cli": "0.1.23
|
|
114
|
-
"@granite-js/image": "0.1.23
|
|
115
|
-
"@granite-js/jest": "0.1.23
|
|
116
|
-
"@granite-js/lottie": "0.1.23
|
|
117
|
-
"@granite-js/mpack": "0.1.23
|
|
118
|
-
"@granite-js/plugin-core": "0.1.23
|
|
119
|
-
"@granite-js/style-utils": "0.1.23
|
|
115
|
+
"@granite-js/cli": "0.1.23",
|
|
116
|
+
"@granite-js/image": "0.1.23",
|
|
117
|
+
"@granite-js/jest": "0.1.23",
|
|
118
|
+
"@granite-js/lottie": "0.1.23",
|
|
119
|
+
"@granite-js/mpack": "0.1.23",
|
|
120
|
+
"@granite-js/plugin-core": "0.1.23",
|
|
121
|
+
"@granite-js/style-utils": "0.1.23",
|
|
120
122
|
"es-toolkit": "^1.39.8",
|
|
121
123
|
"react-native-url-polyfill": "1.3.0"
|
|
122
124
|
}
|
package/src/app/Granite.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType,
|
|
1
|
+
import { ComponentType, PropsWithChildren } from 'react';
|
|
2
2
|
import { AppRegistry } from 'react-native';
|
|
3
3
|
import { ENTRY_BUNDLE_NAME } from '../constants';
|
|
4
4
|
import type { InitialProps } from '../initial-props';
|
|
@@ -83,7 +83,7 @@ const createApp = () => {
|
|
|
83
83
|
registerHostApp(
|
|
84
84
|
AppContainer: ComponentType<PropsWithChildren<InitialProps>>,
|
|
85
85
|
{ appName }: Pick<GraniteProps, 'appName'>
|
|
86
|
-
): (initialProps: InitialProps) =>
|
|
86
|
+
): (initialProps: InitialProps) => JSX.Element {
|
|
87
87
|
if (appName !== ENTRY_BUNDLE_NAME) {
|
|
88
88
|
throw new Error(`Host appName must be 'shared'`);
|
|
89
89
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
2
2
|
import { FlatList, FlatListProps } from 'react-native';
|
|
3
3
|
import withIO, { IOComponentProps } from './withIO';
|
|
4
4
|
|
|
@@ -67,6 +67,6 @@ const IOFlatList = withIO(FlatList, [
|
|
|
67
67
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
68
68
|
declare function IOFlatListFunction<ItemT = any>(
|
|
69
69
|
props: IOFlatListProps<ItemT> & RefAttributes<IOFlatListController>
|
|
70
|
-
):
|
|
70
|
+
): JSX.Element;
|
|
71
71
|
|
|
72
72
|
export default IOFlatList;
|
|
@@ -15,15 +15,4 @@ interface EventEmitter {
|
|
|
15
15
|
): EmitterSubscription;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export const nativeEventEmitter = GraniteCoreModule
|
|
19
|
-
? (new NativeEventEmitter(GraniteCoreModule) as unknown as EventEmitter)
|
|
20
|
-
: {
|
|
21
|
-
addListener: () => {
|
|
22
|
-
console.warn('[GraniteCoreModule] is not registered');
|
|
23
|
-
return {
|
|
24
|
-
remove: () => {
|
|
25
|
-
console.warn('[GraniteCoreModule] is not registered');
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
};
|
|
18
|
+
export const nativeEventEmitter = new NativeEventEmitter(GraniteCoreModule) as unknown as EventEmitter;
|
|
@@ -6,4 +6,4 @@ interface GraniteCoreModule extends TurboModule {
|
|
|
6
6
|
importLazy: () => Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const GraniteCoreModule = TurboModuleRegistry.
|
|
9
|
+
export const GraniteCoreModule = TurboModuleRegistry.getEnforcing<GraniteCoreModule>('GraniteCoreModule');
|
|
@@ -5,7 +5,4 @@ interface GraniteModuleSpec extends TurboModule {
|
|
|
5
5
|
schemeUri: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export const GraniteModule = TurboModuleRegistry.
|
|
9
|
-
if (!GraniteModule) {
|
|
10
|
-
console.warn('[GraniteModule] is not registered');
|
|
11
|
-
}
|
|
8
|
+
export const GraniteModule = TurboModuleRegistry.getEnforcing<GraniteModuleSpec>('GraniteModule');
|
package/src/router/Router.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
RouteProp,
|
|
8
8
|
} from '@granite-js/native/@react-navigation/native';
|
|
9
9
|
import { NativeStackNavigationOptions } from '@granite-js/native/@react-navigation/native-stack';
|
|
10
|
-
import { ComponentProps, ComponentType, Fragment, PropsWithChildren, ReactElement, useCallback } from 'react';
|
|
10
|
+
import { ComponentProps, ComponentType, Fragment, PropsWithChildren, ReactElement, useCallback, useMemo } from 'react';
|
|
11
11
|
import { InitialProps } from '..';
|
|
12
12
|
import { closeView } from '../native-modules';
|
|
13
13
|
import { BackButton } from './components/BackButton';
|
|
@@ -89,8 +89,6 @@ type NavigationContainerProps = Pick<
|
|
|
89
89
|
'ref' | 'documentTitle' | 'fallback' | 'onReady' | 'onUnhandledAction' | 'onStateChange'
|
|
90
90
|
>;
|
|
91
91
|
|
|
92
|
-
export const navigationRef = createNavigationContainerRef<never>();
|
|
93
|
-
|
|
94
92
|
/**
|
|
95
93
|
* @category Components
|
|
96
94
|
* @kind function
|
|
@@ -143,8 +141,10 @@ export function Router({
|
|
|
143
141
|
initialScheme,
|
|
144
142
|
});
|
|
145
143
|
|
|
144
|
+
const ref = useMemo(() => navigationContainerRef ?? createNavigationContainerRef<any>(), [navigationContainerRef]);
|
|
145
|
+
|
|
146
146
|
const { handler, canGoBack, onBack } = useInternalRouterBackHandler({
|
|
147
|
-
navigationContainerRef:
|
|
147
|
+
navigationContainerRef: ref,
|
|
148
148
|
onClose: closeView,
|
|
149
149
|
});
|
|
150
150
|
|
|
@@ -164,7 +164,7 @@ export function Router({
|
|
|
164
164
|
);
|
|
165
165
|
|
|
166
166
|
return (
|
|
167
|
-
<NavigationContainer ref={
|
|
167
|
+
<NavigationContainer ref={ref} {...navigationContainerProps} linking={linkingOptions}>
|
|
168
168
|
<CanGoBackGuard canGoBack={canGoBack} onBack={onBack} setIosSwipeGestureEnabled={setIosSwipeGestureEnabled}>
|
|
169
169
|
<Container {...initialProps}>
|
|
170
170
|
<StackNavigator.Navigator initialRouteName={initialRouteName} screenOptions={screenOptions}>
|
|
@@ -48,7 +48,7 @@ export function useRouterBackHandler({
|
|
|
48
48
|
navigationContainerRef,
|
|
49
49
|
onClose,
|
|
50
50
|
}: {
|
|
51
|
-
navigationContainerRef: NavigationContainerRefWithCurrent<
|
|
51
|
+
navigationContainerRef: NavigationContainerRefWithCurrent<any>;
|
|
52
52
|
onClose?: () => void;
|
|
53
53
|
}) {
|
|
54
54
|
const { handler } = useInternalRouterBackHandler({ navigationContainerRef, onClose });
|
|
@@ -60,7 +60,7 @@ export function useInternalRouterBackHandler({
|
|
|
60
60
|
navigationContainerRef,
|
|
61
61
|
onClose,
|
|
62
62
|
}: {
|
|
63
|
-
navigationContainerRef: NavigationContainerRefWithCurrent<
|
|
63
|
+
navigationContainerRef: NavigationContainerRefWithCurrent<any>;
|
|
64
64
|
onClose?: () => void;
|
|
65
65
|
}) {
|
|
66
66
|
const { hasBackEvent, onBack } = useBackEventContext();
|
package/src/video/Video.tsx
CHANGED
|
@@ -62,7 +62,7 @@ type VideoProps = ComponentProps<typeof AnimatedRNVideo>;
|
|
|
62
62
|
* }
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
const VideoImpl = forwardRef<
|
|
65
|
+
const VideoImpl = forwardRef<VideoRef, instance.VideoNativeProps>((props, ref) => {
|
|
66
66
|
const [isFocused, setIsFocused] = useState(props.muted || props.paused);
|
|
67
67
|
const visible = useVisibility();
|
|
68
68
|
|
package/src/video/instance.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VideoProperties } from '@granite-js/native/react-native-video';
|
|
2
2
|
import { Component as ReactComponent, forwardRef, type ComponentType, type ForwardedRef } from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
|
|
5
|
-
export type VideoNativeProps = Omit<
|
|
5
|
+
export type VideoNativeProps = Omit<VideoProperties, 'onAudioFocusChanged'> & {
|
|
6
6
|
onAudioFocusChanged?: (event: { hasAudioFocus: boolean }) => void;
|
|
7
7
|
};
|
|
8
8
|
|
package/dist/chunk-2PYPIQMA.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// src/native-modules/natives/GraniteModule.ts
|
|
2
|
-
import { TurboModuleRegistry } from "react-native";
|
|
3
|
-
var GraniteModule = TurboModuleRegistry.get("GraniteModule");
|
|
4
|
-
if (!GraniteModule) {
|
|
5
|
-
console.warn("[GraniteModule] is not registered");
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
GraniteModule
|
|
10
|
-
};
|
package/dist/react/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useWaitForReturnNavigator } from './useWaitForReturnNavigator';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
* @category Screen Control
|
|
4
|
-
* @name useWaitForReturnNavigator
|
|
5
|
-
* @description
|
|
6
|
-
* A Hook that helps execute the next code synchronously when returning from a screen transition.
|
|
7
|
-
* Screen navigation uses [@react-navigation/native `useNavigation`'s `navigate`](https://reactnavigation.org/docs/6.x/navigation-prop#navigate).
|
|
8
|
-
*
|
|
9
|
-
* For example, it can be used when you want to log that a user has navigated to another screen and returned.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ### Example of code execution when returning from screen navigation
|
|
13
|
-
*
|
|
14
|
-
* When the **"Navigate"** button is pressed, it navigates to another screen, and logs are created when returning.
|
|
15
|
-
*
|
|
16
|
-
* ```tsx
|
|
17
|
-
* import { Button } from 'react-native';
|
|
18
|
-
* import { useWaitForReturnNavigator } from '@granite-js/react-native';
|
|
19
|
-
*
|
|
20
|
-
* export function UseWaitForReturnNavigator() {
|
|
21
|
-
* const navigate = useWaitForReturnNavigator();
|
|
22
|
-
*
|
|
23
|
-
* return (
|
|
24
|
-
* <>
|
|
25
|
-
* <Button
|
|
26
|
-
* title="Navigate"
|
|
27
|
-
* onPress={async () => {
|
|
28
|
-
* console.log(1);
|
|
29
|
-
* await navigate('/examples/use-visibility');
|
|
30
|
-
* // This code executes when returning to the screen
|
|
31
|
-
* console.log(2);
|
|
32
|
-
* }}
|
|
33
|
-
* />
|
|
34
|
-
* </>
|
|
35
|
-
* );
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare function useWaitForReturnNavigator<T extends Record<string, object | undefined>>(): <RouteName extends keyof T>(route: RouteName, params?: T[RouteName]) => Promise<void>;
|