@iternio/react-native-auto-play 0.5.7 → 0.5.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.
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlay.kt +0 -1
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +29 -116
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputManager.kt +17 -1
- package/ios/templates/MapTemplate.swift +14 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +1 -2
- package/lib/scenes/AutoPlayCluster.js +1 -6
- package/lib/templates/MapTemplate.js +1 -6
- package/lib/types/RootComponent.d.ts +0 -4
- package/nitro.json +0 -6
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +0 -2
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +0 -18
- package/package.json +1 -1
- package/src/index.ts +1 -2
- package/src/scenes/AutoPlayCluster.ts +1 -6
- package/src/templates/MapTemplate.ts +1 -6
- package/src/types/RootComponent.ts +0 -4
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidWindowInformation.kt +0 -49
- package/lib/HybridAutoPlay.d.ts +0 -2
- package/lib/HybridAutoPlay.js +0 -2
- package/lib/components/OnAppearedChildRenderer.d.ts +0 -10
- package/lib/components/OnAppearedChildRenderer.js +0 -26
- package/lib/components/WindowInformationWrapper.d.ts +0 -15
- package/lib/components/WindowInformationWrapper.js +0 -17
- package/lib/hooks/useIsAutoPlayFocused.d.ts +0 -7
- package/lib/hooks/useIsAutoPlayFocused.js +0 -20
- package/lib/hybrid/HybridAndroidWindowInformation.android.d.ts +0 -2
- package/lib/hybrid/HybridAndroidWindowInformation.android.js +0 -2
- package/lib/hybrid/HybridAndroidWindowInformation.d.ts +0 -2
- package/lib/hybrid/HybridAndroidWindowInformation.js +0 -1
- package/lib/hybrid.d.ts +0 -2
- package/lib/hybrid.js +0 -2
- package/lib/specs/AndroidWindowInformation.nitro.d.ts +0 -22
- package/lib/specs/AndroidWindowInformation.nitro.js +0 -1
- package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.js +0 -1
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +0 -1
- package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +0 -23
- package/lib/templates/AutomotivePermissionRequestTemplate.js +0 -18
- package/lib/types/Glyphmap.d.ts +0 -4105
- package/lib/types/Glyphmap.js +0 -4105
- package/lib/utils/NitroOptionsPanel.d.ts +0 -67
- package/lib/utils/NitroOptionsPanel.js +0 -48
- package/nitrogen/generated/android/c++/JFunc_void_WindowInformation.hpp +0 -77
- package/nitrogen/generated/android/c++/JHybridAndroidWindowInformationSpec.cpp +0 -68
- package/nitrogen/generated/android/c++/JHybridAndroidWindowInformationSpec.hpp +0 -63
- package/nitrogen/generated/android/c++/JWindowInformation.hpp +0 -65
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_WindowInformation.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidWindowInformationSpec.kt +0 -59
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/WindowInformation.kt +0 -61
- package/nitrogen/generated/shared/c++/HybridAndroidWindowInformationSpec.cpp +0 -21
- package/nitrogen/generated/shared/c++/HybridAndroidWindowInformationSpec.hpp +0 -65
- package/nitrogen/generated/shared/c++/WindowInformation.hpp +0 -91
- package/src/components/WindowInformationWrapper.tsx +0 -30
- package/src/hybrid/HybridAndroidWindowInformation.android.ts +0 -5
- package/src/hybrid/HybridAndroidWindowInformation.ts +0 -3
- package/src/specs/AndroidWindowInformation.nitro.ts +0 -24
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// WindowInformation.hpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#pragma once
|
|
9
|
-
|
|
10
|
-
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
-
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
-
#else
|
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
-
#endif
|
|
15
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
-
#else
|
|
18
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
-
#endif
|
|
20
|
-
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
-
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
-
#else
|
|
23
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
-
#endif
|
|
25
|
-
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
-
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
-
#else
|
|
28
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
-
#endif
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* A struct which can be represented as a JavaScript object (WindowInformation).
|
|
39
|
-
*/
|
|
40
|
-
struct WindowInformation final {
|
|
41
|
-
public:
|
|
42
|
-
double width SWIFT_PRIVATE;
|
|
43
|
-
double height SWIFT_PRIVATE;
|
|
44
|
-
double scale SWIFT_PRIVATE;
|
|
45
|
-
|
|
46
|
-
public:
|
|
47
|
-
WindowInformation() = default;
|
|
48
|
-
explicit WindowInformation(double width, double height, double scale): width(width), height(height), scale(scale) {}
|
|
49
|
-
|
|
50
|
-
public:
|
|
51
|
-
friend bool operator==(const WindowInformation& lhs, const WindowInformation& rhs) = default;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
55
|
-
|
|
56
|
-
namespace margelo::nitro {
|
|
57
|
-
|
|
58
|
-
// C++ WindowInformation <> JS WindowInformation (object)
|
|
59
|
-
template <>
|
|
60
|
-
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::WindowInformation> final {
|
|
61
|
-
static inline margelo::nitro::swe::iternio::reactnativeautoplay::WindowInformation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
62
|
-
jsi::Object obj = arg.asObject(runtime);
|
|
63
|
-
return margelo::nitro::swe::iternio::reactnativeautoplay::WindowInformation(
|
|
64
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "width"))),
|
|
65
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height"))),
|
|
66
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "scale")))
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::WindowInformation& arg) {
|
|
70
|
-
jsi::Object obj(runtime);
|
|
71
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "width"), JSIConverter<double>::toJSI(runtime, arg.width));
|
|
72
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "height"), JSIConverter<double>::toJSI(runtime, arg.height));
|
|
73
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "scale"), JSIConverter<double>::toJSI(runtime, arg.scale));
|
|
74
|
-
return obj;
|
|
75
|
-
}
|
|
76
|
-
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
77
|
-
if (!value.isObject()) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
jsi::Object obj = value.getObject(runtime);
|
|
81
|
-
if (!nitro::isPlainObject(runtime, obj)) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "width")))) return false;
|
|
85
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "height")))) return false;
|
|
86
|
-
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "scale")))) return false;
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
} // namespace margelo::nitro
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { createElement, useEffect, useState } from 'react';
|
|
3
|
-
import { HybridAndroidWindowInformation } from '../hybrid/HybridAndroidWindowInformation';
|
|
4
|
-
import type { RootComponentInitialProps } from '../types/RootComponent';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Renders a user-provided root component and keeps its `window` prop up to date when the host
|
|
8
|
-
* recreates the render surface with new dimensions (some head units run Android Auto windowed
|
|
9
|
-
* and resize it at runtime), so consumers can simply read `props.window` without registering a
|
|
10
|
-
* listener themselves.
|
|
11
|
-
* On iOS this only passes the initial props through — CarPlay windows keep their size for the
|
|
12
|
-
* lifetime of a scene, so there is nothing to subscribe to.
|
|
13
|
-
*/
|
|
14
|
-
export function WindowInformationWrapper({
|
|
15
|
-
moduleName,
|
|
16
|
-
component,
|
|
17
|
-
componentProps,
|
|
18
|
-
}: {
|
|
19
|
-
moduleName: string;
|
|
20
|
-
component: React.ComponentType<RootComponentInitialProps>;
|
|
21
|
-
componentProps: RootComponentInitialProps;
|
|
22
|
-
}) {
|
|
23
|
-
const [window, setWindow] = useState(componentProps.window);
|
|
24
|
-
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
return HybridAndroidWindowInformation?.addWindowInformationListener(moduleName, setWindow);
|
|
27
|
-
}, [moduleName]);
|
|
28
|
-
|
|
29
|
-
return createElement(component, { ...componentProps, window });
|
|
30
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
|
-
import type { AndroidWindowInformation } from '../specs/AndroidWindowInformation.nitro';
|
|
3
|
-
|
|
4
|
-
export const HybridAndroidWindowInformation: AndroidWindowInformation | null =
|
|
5
|
-
NitroModules.createHybridObject<AndroidWindowInformation>('AndroidWindowInformation');
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
/**
|
|
6
|
-
* Android-only access to render-surface window dimensions. On iOS this module does not exist —
|
|
7
|
-
* use the platform-split `HybridAndroidWindowInformation` wrapper which resolves to `null` there.
|
|
8
|
-
*/
|
|
9
|
-
export interface AndroidWindowInformation extends HybridObject<{ android: 'kotlin' }> {
|
|
10
|
-
/**
|
|
11
|
-
* callback for window dimension changes, fired when the host recreates the render surface
|
|
12
|
-
* with a different size (some head units run Android Auto windowed and resize it at runtime).
|
|
13
|
-
* Root components rendered via a template's `component` prop do NOT need this — their
|
|
14
|
-
* `window` prop is kept up to date automatically. Use this listener only for
|
|
15
|
-
* size-dependent logic living outside a root component.
|
|
16
|
-
* Fires with the last known window information immediately if the surface is already initialized.
|
|
17
|
-
* @param moduleName one of @AutoPlayModules or a cluster scene uuid
|
|
18
|
-
* @namespace Android
|
|
19
|
-
*/
|
|
20
|
-
addWindowInformationListener(
|
|
21
|
-
moduleName: string,
|
|
22
|
-
callback: (window: WindowInformation) => void
|
|
23
|
-
): CleanupCallback;
|
|
24
|
-
}
|