@iternio/react-native-auto-play 0.4.6 → 0.4.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.
Files changed (77) hide show
  1. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlay.kt +0 -89
  2. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoice.kt +97 -0
  3. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputManager.kt +286 -20
  4. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/utils/ThreadUtil.kt +6 -13
  5. package/ios/hybrid/HybridAutoPlay.swift +2 -47
  6. package/ios/hybrid/HybridVoice.swift +65 -0
  7. package/ios/utils/VoiceInputManager.swift +144 -40
  8. package/lib/HybridAutoPlay.d.ts +2 -0
  9. package/lib/HybridAutoPlay.js +2 -0
  10. package/lib/hooks/useIsAutoPlayFocused.d.ts +7 -0
  11. package/lib/hooks/useIsAutoPlayFocused.js +20 -0
  12. package/lib/hybrid/HybridVoice.d.ts +52 -0
  13. package/lib/hybrid/HybridVoice.js +52 -0
  14. package/lib/hybrid.d.ts +2 -0
  15. package/lib/hybrid.js +2 -0
  16. package/lib/index.d.ts +3 -1
  17. package/lib/index.js +2 -1
  18. package/lib/specs/AutoPlay.nitro.d.ts +0 -29
  19. package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +11 -0
  20. package/lib/specs/AutomotivePermissionRequestTemplate.js +1 -0
  21. package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +11 -0
  22. package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +1 -0
  23. package/lib/specs/Voice.nitro.d.ts +11 -0
  24. package/lib/specs/Voice.nitro.js +1 -0
  25. package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +23 -0
  26. package/lib/templates/AutomotivePermissionRequestTemplate.js +18 -0
  27. package/lib/templates/MapTemplate.js +1 -6
  28. package/lib/types/Glyphmap.d.ts +4105 -0
  29. package/lib/types/Glyphmap.js +4105 -0
  30. package/lib/types/Voice.d.ts +16 -0
  31. package/lib/types/Voice.js +1 -0
  32. package/nitro.json +10 -0
  33. package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +2 -0
  34. package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +18 -0
  35. package/nitrogen/generated/android/c++/JFunc_void_VoiceInputChunk.hpp +81 -0
  36. package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp +0 -43
  37. package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.hpp +0 -4
  38. package/nitrogen/generated/android/c++/JHybridVoiceSpec.cpp +104 -0
  39. package/nitrogen/generated/android/c++/JHybridVoiceSpec.hpp +66 -0
  40. package/nitrogen/generated/android/c++/JVoiceInputChunk.hpp +64 -0
  41. package/nitrogen/generated/android/c++/JVoiceInputResult.hpp +64 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_VoiceInputChunk.kt +80 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlaySpec.kt +0 -17
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoiceSpec.kt +72 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputChunk.kt +41 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputResult.kt +41 -0
  47. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +41 -16
  48. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +201 -126
  49. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +11 -0
  50. package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.mm +8 -0
  51. package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.swift +12 -0
  52. package/nitrogen/generated/ios/c++/HybridAutoPlaySpecSwift.hpp +0 -34
  53. package/nitrogen/generated/ios/c++/HybridVoiceSpecSwift.cpp +11 -0
  54. package/nitrogen/generated/ios/c++/HybridVoiceSpecSwift.hpp +116 -0
  55. package/nitrogen/generated/ios/swift/Func_void_VoiceInputChunk.swift +46 -0
  56. package/nitrogen/generated/ios/swift/{Func_void_std__shared_ptr_ArrayBuffer_.swift → Func_void_VoiceInputResult.swift} +10 -10
  57. package/nitrogen/generated/ios/swift/Func_void_bool.swift +5 -5
  58. package/nitrogen/generated/ios/swift/HybridAutoPlaySpec.swift +0 -4
  59. package/nitrogen/generated/ios/swift/HybridAutoPlaySpec_cxx.swift +0 -82
  60. package/nitrogen/generated/ios/swift/HybridVoiceSpec.swift +58 -0
  61. package/nitrogen/generated/ios/swift/HybridVoiceSpec_cxx.swift +234 -0
  62. package/nitrogen/generated/ios/swift/VoiceInputChunk.swift +60 -0
  63. package/nitrogen/generated/ios/swift/VoiceInputResult.swift +60 -0
  64. package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.cpp +0 -4
  65. package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.hpp +0 -5
  66. package/nitrogen/generated/shared/c++/HybridVoiceSpec.cpp +24 -0
  67. package/nitrogen/generated/shared/c++/HybridVoiceSpec.hpp +73 -0
  68. package/nitrogen/generated/shared/c++/VoiceInputChunk.hpp +89 -0
  69. package/nitrogen/generated/shared/c++/VoiceInputResult.hpp +89 -0
  70. package/package.json +1 -1
  71. package/src/hybrid/HybridVoice.ts +79 -0
  72. package/src/index.ts +3 -1
  73. package/src/specs/AutoPlay.nitro.ts +0 -37
  74. package/src/specs/Voice.nitro.ts +16 -0
  75. package/src/templates/MapTemplate.ts +1 -6
  76. package/src/types/Voice.ts +18 -0
  77. package/src/components/OnAppearedChildRenderer.tsx +0 -37
@@ -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,11 @@
1
+ import type { HybridObject } from 'react-native-nitro-modules';
2
+ import type { VoiceInputChunk, VoiceInputResult } from '../types/Voice';
3
+ export interface Voice extends HybridObject<{
4
+ android: 'kotlin';
5
+ ios: 'swift';
6
+ }> {
7
+ hasVoiceInputPermission(): boolean;
8
+ requestVoiceInputPermission(): Promise<boolean>;
9
+ startVoiceInput(silenceThresholdMs?: number, maxDurationMs?: number, listeningText?: string, preferSpeechToText?: boolean, onChunk?: (chunk: VoiceInputChunk) => void, language?: string): Promise<VoiceInputResult>;
10
+ stopVoiceInput(): void;
11
+ }
@@ -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
+ }
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { AppRegistry, Platform } from 'react-native';
3
3
  import { NitroModules } from 'react-native-nitro-modules';
4
4
  import { MapTemplateProvider } from '../components/MapTemplateContext';
5
- import OnAppearedChildRenderer from '../components/OnAppearedChildRenderer';
6
5
  import { SafeAreaInsetsProvider } from '../components/SafeAreaInsetsContext';
7
6
  import { HybridAutoPlay } from '../hybrid/HybridAutoPlay';
8
7
  import { NitroActionUtil } from '../utils/NitroAction';
@@ -24,11 +23,7 @@ export class MapTemplate extends Template {
24
23
  children: React.createElement(SafeAreaInsetsProvider, {
25
24
  moduleName: this.id,
26
25
  // biome-ignore lint/correctness/noChildrenProp: there is no other way in a ts file
27
- children: React.createElement(OnAppearedChildRenderer, {
28
- // biome-ignore lint/correctness/noChildrenProp: there is no other way in a ts file
29
- children: React.createElement(component, props),
30
- moduleName: this.id,
31
- }),
26
+ children: React.createElement(component, props),
32
27
  }),
33
28
  }));
34
29
  const nitroConfig = {