react-native-spalla-player 1.0.1 → 1.0.3

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.
@@ -1,24 +1,40 @@
1
1
  package com.spallaplayer
2
2
 
3
- import com.facebook.react.ReactPackage
3
+ import com.facebook.react.BaseReactPackage
4
+ import com.facebook.react.bridge.ModuleSpec
4
5
  import com.facebook.react.bridge.NativeModule
5
6
  import com.facebook.react.bridge.ReactApplicationContext
6
- import com.facebook.react.uimanager.ViewManager
7
+ import com.facebook.react.module.model.ReactModuleInfo
8
+ import com.facebook.react.module.model.ReactModuleInfoProvider
7
9
  import com.spallaplayer.components.RNGoogleCastButtonManager
8
- import java.util.ArrayList
9
10
 
10
- class SpallaPlayerViewPackage : ReactPackage {
11
- override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
12
- val viewManagers: MutableList<ViewManager<*, *>> = ArrayList()
13
- viewManagers.add(SpallaPlayerViewManager())
14
- viewManagers.add(RNGoogleCastButtonManager())
15
- return viewManagers
16
- }
11
+ class SpallaPlayerViewPackage : BaseReactPackage() {
17
12
 
18
- @Deprecated("Migrate to [BaseReactPackage] and implement [getModule] instead.")
19
- override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
20
- return listOf(SpallaPlayerModule(reactContext))
21
- }
13
+ override fun getViewManagers(
14
+ reactContext: ReactApplicationContext
15
+ ): List<ModuleSpec> =
16
+ listOf(
17
+ ModuleSpec.viewManagerSpec {
18
+ SpallaPlayerViewManager()
19
+ },
20
+ ModuleSpec.viewManagerSpec {
21
+ RNGoogleCastButtonManager()
22
+ }
23
+ )
24
+
25
+ override fun getReactModuleInfoProvider(): ReactModuleInfoProvider =
26
+ ReactModuleInfoProvider {
27
+ mapOf(
28
+ SpallaPlayerModule.REACT_NAME to ReactModuleInfo(
29
+ SpallaPlayerModule.REACT_NAME,
30
+ className = SpallaPlayerModule::class.java.name,
31
+ canOverrideExistingModule = false,
32
+ needsEagerInit = false,
33
+ isCxxModule = false,
34
+ isTurboModule = false
35
+ )
36
+ )
37
+ }
22
38
 
23
39
  override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
24
40
  return when (name) {
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import { codegenNativeComponent, codegenNativeCommands } from 'react-native';
3
+ // NOTE: codegenNativeComponent MUST be imported from RN internals for Fabric.
4
+ // Do not change this import to `from 'react-native'`.
5
+ /* eslint-disable @react-native/no-deep-imports */
6
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
+
8
+ /* eslint-disable @react-native/no-deep-imports */
9
+ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
4
10
 
5
11
  // Define a single comprehensive event payload interface
6
12
 
@@ -1 +1 @@
1
- {"version":3,"names":["codegenNativeComponent","codegenNativeCommands","Commands","supportedCommands"],"sourceRoot":"../../src","sources":["SpallaPlayerViewNativeComponent.ts"],"mappings":";;AAAA,SACEA,sBAAsB,EAItBC,qBAAqB,QAChB,cAAc;;AAErB;;AAyCA,OAAO,MAAMC,QAAwB,GAAGD,qBAAqB,CAAiB;EAC5EE,iBAAiB,EAAE,CACjB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,SAAS;AAEb,CAAC,CAAC;AAEF,eAAeH,sBAAsB,CAAc,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["codegenNativeComponent","codegenNativeCommands","Commands","supportedCommands"],"sourceRoot":"../../src","sources":["SpallaPlayerViewNativeComponent.ts"],"mappings":";;AAEA;AACA;AACA;AACA,OAAOA,sBAAsB,MAAM,yDAAyD;;AAE5F;AACA,OAAOC,qBAAqB,MAAM,wDAAwD;;AAE1F;;AAyCA,OAAO,MAAMC,QAAwB,GAAGD,qBAAqB,CAAiB;EAC5EE,iBAAiB,EAAE,CACjB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,SAAS;AAEb,CAAC,CAAC;AAEF,eAAeH,sBAAsB,CAAc,kBAAkB,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { type ViewProps, type CodegenTypes, type HostComponent } from 'react-native';
1
+ import type { ViewProps, CodegenTypes, HostComponent } from 'react-native';
2
2
  interface PlayerEventPayload {
3
3
  event: string;
4
4
  time?: CodegenTypes.Double;
@@ -20,14 +20,16 @@ export interface NativeProps extends ViewProps {
20
20
  onPlayerEvent?: CodegenTypes.BubblingEventHandler<PlayerEventPayload>;
21
21
  }
22
22
  export interface NativeCommands {
23
- play: (viewRef: React.ElementRef<HostComponent<any>>) => void;
24
- pause: (viewRef: React.ElementRef<HostComponent<any>>) => void;
25
- seekTo: (viewRef: React.ElementRef<HostComponent<any>>, time: CodegenTypes.Double) => void;
26
- selectSubtitle: (viewRef: React.ElementRef<HostComponent<any>>, subtitle: string | null) => void;
27
- selectPlaybackRate: (viewRef: React.ElementRef<HostComponent<any>>, rate: CodegenTypes.Float) => void;
28
- unmount: (viewRef: React.ElementRef<HostComponent<any>>) => void;
23
+ play: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
24
+ pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
25
+ seekTo: (viewRef: React.ElementRef<HostComponent<NativeProps>>, time: CodegenTypes.Double) => void;
26
+ selectSubtitle: (viewRef: React.ElementRef<HostComponent<NativeProps>>, subtitle: string | null) => void;
27
+ selectPlaybackRate: (viewRef: React.ElementRef<HostComponent<NativeProps>>, rate: CodegenTypes.Float) => void;
28
+ unmount: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
29
29
  }
30
30
  export declare const Commands: NativeCommands;
31
- declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
31
+ declare const _default: (props: Omit<NativeProps, "ref"> & {
32
+ ref?: React.Ref<import("react-native").HostInstance>;
33
+ }) => React.ReactNode;
32
34
  export default _default;
33
35
  //# sourceMappingURL=SpallaPlayerViewNativeComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpallaPlayerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/SpallaPlayerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,aAAa,EAEnB,MAAM,cAAc,CAAC;AAGtB,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;CACvE;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;IAC9D,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,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
  {
2
2
  "name": "react-native-spalla-player",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Spalla Player for React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
9
  "source": "./src/index.tsx",
10
+ "import": "./lib/module/index.js",
10
11
  "types": "./lib/typescript/src/index.d.ts",
11
12
  "default": "./lib/module/index.js"
12
13
  },
@@ -1,10 +1,12 @@
1
- import {
2
- codegenNativeComponent,
3
- type ViewProps,
4
- type CodegenTypes,
5
- type HostComponent,
6
- codegenNativeCommands,
7
- } from 'react-native';
1
+ import type { ViewProps, CodegenTypes, HostComponent } from 'react-native';
2
+
3
+ // NOTE: codegenNativeComponent MUST be imported from RN internals for Fabric.
4
+ // Do not change this import to `from 'react-native'`.
5
+ /* eslint-disable @react-native/no-deep-imports */
6
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
7
+
8
+ /* eslint-disable @react-native/no-deep-imports */
9
+ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
8
10
 
9
11
  // Define a single comprehensive event payload interface
10
12
  interface PlayerEventPayload {
@@ -30,21 +32,21 @@ export interface NativeProps extends ViewProps {
30
32
  }
31
33
 
32
34
  export interface NativeCommands {
33
- play: (viewRef: React.ElementRef<HostComponent<any>>) => void;
34
- pause: (viewRef: React.ElementRef<HostComponent<any>>) => void;
35
+ play: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
36
+ pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
35
37
  seekTo: (
36
- viewRef: React.ElementRef<HostComponent<any>>,
38
+ viewRef: React.ElementRef<HostComponent<NativeProps>>,
37
39
  time: CodegenTypes.Double
38
40
  ) => void;
39
41
  selectSubtitle: (
40
- viewRef: React.ElementRef<HostComponent<any>>,
42
+ viewRef: React.ElementRef<HostComponent<NativeProps>>,
41
43
  subtitle: string | null
42
44
  ) => void;
43
45
  selectPlaybackRate: (
44
- viewRef: React.ElementRef<HostComponent<any>>,
46
+ viewRef: React.ElementRef<HostComponent<NativeProps>>,
45
47
  rate: CodegenTypes.Float
46
48
  ) => void;
47
- unmount: (viewRef: React.ElementRef<HostComponent<any>>) => void;
49
+ unmount: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
48
50
  }
49
51
 
50
52
  export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({