@iternio/react-native-auto-play 0.5.5 → 0.5.7
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/README.md +2 -1
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidWindowInformation.kt +49 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlay.kt +1 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +116 -29
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputManager.kt +2 -1
- package/ios/utils/VoiceInputManager.swift +41 -47
- package/lib/HybridAutoPlay.d.ts +2 -0
- package/lib/HybridAutoPlay.js +2 -0
- package/lib/components/OnAppearedChildRenderer.d.ts +10 -0
- package/lib/components/OnAppearedChildRenderer.js +26 -0
- package/lib/components/WindowInformationWrapper.d.ts +15 -0
- package/lib/components/WindowInformationWrapper.js +17 -0
- package/lib/hooks/useIsAutoPlayFocused.d.ts +7 -0
- package/lib/hooks/useIsAutoPlayFocused.js +20 -0
- package/lib/hybrid/HybridAndroidWindowInformation.android.d.ts +2 -0
- package/lib/hybrid/HybridAndroidWindowInformation.android.js +2 -0
- package/lib/hybrid/HybridAndroidWindowInformation.d.ts +2 -0
- package/lib/hybrid/HybridAndroidWindowInformation.js +1 -0
- package/lib/hybrid.d.ts +2 -0
- package/lib/hybrid.js +2 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/scenes/AutoPlayCluster.js +6 -1
- package/lib/specs/AndroidWindowInformation.nitro.d.ts +22 -0
- package/lib/specs/AndroidWindowInformation.nitro.js +1 -0
- package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +11 -0
- package/lib/specs/AutomotivePermissionRequestTemplate.js +1 -0
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +11 -0
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +1 -0
- package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +23 -0
- package/lib/templates/AutomotivePermissionRequestTemplate.js +18 -0
- package/lib/templates/MapTemplate.js +6 -1
- package/lib/types/Glyphmap.d.ts +4105 -0
- package/lib/types/Glyphmap.js +4105 -0
- package/lib/types/RootComponent.d.ts +4 -0
- package/lib/utils/NitroOptionsPanel.d.ts +67 -0
- package/lib/utils/NitroOptionsPanel.js +48 -0
- package/nitro.json +6 -0
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +2 -0
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +18 -0
- package/nitrogen/generated/android/c++/JFunc_void_WindowInformation.hpp +77 -0
- package/nitrogen/generated/android/c++/JHybridAndroidWindowInformationSpec.cpp +68 -0
- package/nitrogen/generated/android/c++/JHybridAndroidWindowInformationSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JWindowInformation.hpp +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_WindowInformation.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidWindowInformationSpec.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/WindowInformation.kt +61 -0
- package/nitrogen/generated/shared/c++/HybridAndroidWindowInformationSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridAndroidWindowInformationSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/WindowInformation.hpp +91 -0
- package/package.json +1 -1
- package/src/components/WindowInformationWrapper.tsx +30 -0
- package/src/hybrid/HybridAndroidWindowInformation.android.ts +5 -0
- package/src/hybrid/HybridAndroidWindowInformation.ts +3 -0
- package/src/index.ts +2 -1
- package/src/scenes/AutoPlayCluster.ts +6 -1
- package/src/specs/AndroidWindowInformation.nitro.ts +24 -0
- package/src/templates/MapTemplate.ts +6 -1
- package/src/types/RootComponent.ts +4 -0
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { HybridAndroidAutoTelemetry } from './hybrid/HybridAndroidAutoTelemetry';
|
|
2
|
+
import { HybridAndroidWindowInformation } from './hybrid/HybridAndroidWindowInformation';
|
|
2
3
|
import { HybridAutoPlay } from './hybrid/HybridAutoPlay';
|
|
3
4
|
import { HybridVoice } from './hybrid/HybridVoice';
|
|
4
5
|
import type { AndroidAutomotive } from './specs/AndroidAutomotive.nitro';
|
|
5
|
-
export { HybridAndroidAutoTelemetry, HybridAutoPlay, HybridVoice };
|
|
6
|
+
export { HybridAndroidAutoTelemetry, HybridAndroidWindowInformation, HybridAutoPlay, HybridVoice };
|
|
6
7
|
export declare const HybridAndroidAutomotive: AndroidAutomotive | null;
|
|
7
8
|
/**
|
|
8
9
|
* These are the static module names for the app running on the mobile device, head unit screen and the CarPlay dashboard.
|
package/lib/index.js
CHANGED
|
@@ -2,10 +2,11 @@ import { Platform } from 'react-native';
|
|
|
2
2
|
import { NitroModules } from 'react-native-nitro-modules';
|
|
3
3
|
import AutoPlayHeadlessJsTask from './AutoPlayHeadlessJsTask';
|
|
4
4
|
import { HybridAndroidAutoTelemetry } from './hybrid/HybridAndroidAutoTelemetry';
|
|
5
|
+
import { HybridAndroidWindowInformation } from './hybrid/HybridAndroidWindowInformation';
|
|
5
6
|
import { HybridAutoPlay } from './hybrid/HybridAutoPlay';
|
|
6
7
|
import { HybridVoice } from './hybrid/HybridVoice';
|
|
7
8
|
AutoPlayHeadlessJsTask.registerHeadlessTask(HybridAutoPlay);
|
|
8
|
-
export { HybridAndroidAutoTelemetry, HybridAutoPlay, HybridVoice };
|
|
9
|
+
export { HybridAndroidAutoTelemetry, HybridAndroidWindowInformation, HybridAutoPlay, HybridVoice };
|
|
9
10
|
export const HybridAndroidAutomotive = Platform.OS === 'android'
|
|
10
11
|
? NitroModules.createHybridObject('AndroidAutomotive')
|
|
11
12
|
: null;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { AppRegistry, Platform } from 'react-native';
|
|
3
3
|
import { NitroModules } from 'react-native-nitro-modules';
|
|
4
4
|
import { SafeAreaInsetsProvider } from '../components/SafeAreaInsetsContext';
|
|
5
|
+
import { WindowInformationWrapper } from '../components/WindowInformationWrapper';
|
|
5
6
|
import { NitroImageUtil } from '../utils/NitroImage';
|
|
6
7
|
const HybridCluster = NitroModules.createHybridObject('Cluster');
|
|
7
8
|
class Cluster {
|
|
@@ -49,7 +50,11 @@ class Cluster {
|
|
|
49
50
|
AppRegistry.registerComponent(clusterId, () => (props) => React.createElement(SafeAreaInsetsProvider, {
|
|
50
51
|
moduleName: clusterId,
|
|
51
52
|
// biome-ignore lint/correctness/noChildrenProp: there is no other way in a ts file
|
|
52
|
-
children: React.createElement(
|
|
53
|
+
children: React.createElement(WindowInformationWrapper, {
|
|
54
|
+
moduleName: clusterId,
|
|
55
|
+
component,
|
|
56
|
+
componentProps: props,
|
|
57
|
+
}),
|
|
53
58
|
}));
|
|
54
59
|
this.clusters[clusterId] = true;
|
|
55
60
|
await HybridCluster.initRootView(clusterId);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
import type { CleanupCallback } from '../types/Event';
|
|
3
|
+
import type { WindowInformation } from '../types/RootComponent';
|
|
4
|
+
/**
|
|
5
|
+
* Android-only access to render-surface window dimensions. On iOS this module does not exist —
|
|
6
|
+
* use the platform-split `HybridAndroidWindowInformation` wrapper which resolves to `null` there.
|
|
7
|
+
*/
|
|
8
|
+
export interface AndroidWindowInformation extends HybridObject<{
|
|
9
|
+
android: 'kotlin';
|
|
10
|
+
}> {
|
|
11
|
+
/**
|
|
12
|
+
* callback for window dimension changes, fired when the host recreates the render surface
|
|
13
|
+
* with a different size (some head units run Android Auto windowed and resize it at runtime).
|
|
14
|
+
* Root components rendered via a template's `component` prop do NOT need this — their
|
|
15
|
+
* `window` prop is kept up to date automatically. Use this listener only for
|
|
16
|
+
* size-dependent logic living outside a root component.
|
|
17
|
+
* Fires with the last known window information immediately if the surface is already initialized.
|
|
18
|
+
* @param moduleName one of @AutoPlayModules or a cluster scene uuid
|
|
19
|
+
* @namespace Android
|
|
20
|
+
*/
|
|
21
|
+
addWindowInformationListener(moduleName: string, callback: (window: WindowInformation) => void): CleanupCallback;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
import type { NitroAutomotivePermissionRequestTemplateConfig } from '../templates/AutomotivePermissionRequestTemplate';
|
|
3
|
+
import type { NitroTemplateConfig } from './AutoPlay.nitro';
|
|
4
|
+
interface AutomotivePermissionRequestTemplateConfig extends NitroTemplateConfig, NitroAutomotivePermissionRequestTemplateConfig {
|
|
5
|
+
}
|
|
6
|
+
export interface AutomotivePermissionRequestTemplate extends HybridObject<{
|
|
7
|
+
android: 'kotlin';
|
|
8
|
+
}> {
|
|
9
|
+
createAutomotivePermissionRequestTemplate(config: AutomotivePermissionRequestTemplateConfig): void;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
import type { NitroAutomotivePermissionRequestTemplateConfig } from '../templates/AutomotivePermissionRequestTemplate';
|
|
3
|
+
import type { NitroTemplateConfig } from './AutoPlay.nitro';
|
|
4
|
+
interface AutomotivePermissionRequestTemplateConfig extends NitroTemplateConfig, NitroAutomotivePermissionRequestTemplateConfig {
|
|
5
|
+
}
|
|
6
|
+
export interface AutomotivePermissionRequestTemplate extends HybridObject<{
|
|
7
|
+
android: 'kotlin';
|
|
8
|
+
}> {
|
|
9
|
+
createAutomotivePermissionRequestTemplate(config: AutomotivePermissionRequestTemplateConfig): void;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CustomActionButtonAndroid } from '../types/Button';
|
|
2
|
+
import type { AutoText } from '../types/Text';
|
|
3
|
+
import { type NitroAction } from '../utils/NitroAction';
|
|
4
|
+
import { type HeaderActions, Template, type TemplateConfig } from './Template';
|
|
5
|
+
export interface NitroAutomotivePermissionRequestTemplateConfig extends TemplateConfig {
|
|
6
|
+
headerActions?: Array<NitroAction>;
|
|
7
|
+
title: AutoText;
|
|
8
|
+
actions: Array<NitroAction>;
|
|
9
|
+
}
|
|
10
|
+
export type AutomotivePermissionRequestTemplateConfig = Omit<NitroAutomotivePermissionRequestTemplateConfig, 'headerActions' | 'buttons'> & {
|
|
11
|
+
/**
|
|
12
|
+
* action buttons, usually at the the top right on Android and a top bar on iOS
|
|
13
|
+
*/
|
|
14
|
+
headerActions?: HeaderActions<AutomotivePermissionRequestTemplate>;
|
|
15
|
+
actions: [CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>] | [
|
|
16
|
+
CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>,
|
|
17
|
+
CustomActionButtonAndroid<AutomotivePermissionRequestTemplate>
|
|
18
|
+
];
|
|
19
|
+
};
|
|
20
|
+
export declare class AutomotivePermissionRequestTemplate extends Template<AutomotivePermissionRequestTemplateConfig, HeaderActions<AutomotivePermissionRequestTemplate>> {
|
|
21
|
+
private template;
|
|
22
|
+
constructor(config: AutomotivePermissionRequestTemplateConfig);
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
|
+
import { NitroActionUtil } from '../utils/NitroAction';
|
|
3
|
+
import { Template, } from './Template';
|
|
4
|
+
const HybridAutomotivePermissionRequestTemplate = NitroModules.createHybridObject('AutomotivePermissionRequestTemplate');
|
|
5
|
+
export class AutomotivePermissionRequestTemplate extends Template {
|
|
6
|
+
template = this;
|
|
7
|
+
constructor(config) {
|
|
8
|
+
super(config);
|
|
9
|
+
const { headerActions, actions, ...rest } = config;
|
|
10
|
+
const nitroConfig = {
|
|
11
|
+
...rest,
|
|
12
|
+
id: this.id,
|
|
13
|
+
headerActions: NitroActionUtil.convert(this.template, headerActions),
|
|
14
|
+
actions: NitroActionUtil.convert(this.template, actions),
|
|
15
|
+
};
|
|
16
|
+
HybridAutomotivePermissionRequestTemplate.createAutomotivePermissionRequestTemplate(nitroConfig);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -3,6 +3,7 @@ import { AppRegistry, Platform } from 'react-native';
|
|
|
3
3
|
import { NitroModules } from 'react-native-nitro-modules';
|
|
4
4
|
import { MapTemplateProvider } from '../components/MapTemplateContext';
|
|
5
5
|
import { SafeAreaInsetsProvider } from '../components/SafeAreaInsetsContext';
|
|
6
|
+
import { WindowInformationWrapper } from '../components/WindowInformationWrapper';
|
|
6
7
|
import { HybridAutoPlay } from '../hybrid/HybridAutoPlay';
|
|
7
8
|
import { NitroActionUtil } from '../utils/NitroAction';
|
|
8
9
|
import { NitroAlertUtil } from '../utils/NitroAlert';
|
|
@@ -23,7 +24,11 @@ export class MapTemplate extends Template {
|
|
|
23
24
|
children: React.createElement(SafeAreaInsetsProvider, {
|
|
24
25
|
moduleName: this.id,
|
|
25
26
|
// biome-ignore lint/correctness/noChildrenProp: there is no other way in a ts file
|
|
26
|
-
children: React.createElement(
|
|
27
|
+
children: React.createElement(WindowInformationWrapper, {
|
|
28
|
+
moduleName: this.id,
|
|
29
|
+
component,
|
|
30
|
+
componentProps: props,
|
|
31
|
+
}),
|
|
27
32
|
}),
|
|
28
33
|
}));
|
|
29
34
|
const nitroConfig = {
|