@ray-js/ipc-player-integration 0.0.1-beta-2 → 0.0.1-beta-4

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,14 +1,12 @@
1
1
  import { createUseCtx } from './ctx';
2
2
  import { Battery, Screenshot, TempHumidity, RecordVideo, FullScreen, VideoBitKbps, Muted } from '../plugins';
3
+ import { authorizeStatus } from '../utils/authorize';
3
4
  const createPlayContext = ty.createIpcPlayerContext;
4
5
  // const createPlayContext = () => null;
5
6
 
6
7
  const topContent = [{
7
8
  id: 'Battery',
8
- content: Battery,
9
- initProps: {
10
- className: 1
11
- }
9
+ content: Battery
12
10
  }, {
13
11
  id: 'TempHumidity',
14
12
  content: TempHumidity
@@ -34,5 +32,6 @@ export const useCtx = createUseCtx({
34
32
  createPlayContext,
35
33
  defaultTopContent: topContent,
36
34
  defaultAbsoluteContent: absoluteContent,
37
- defaultBottomContent: bottomContent
35
+ defaultBottomContent: bottomContent,
36
+ authorizeStatus: authorizeStatus
38
37
  });
@@ -4,11 +4,6 @@ type WithInitialValue<Value> = {
4
4
  init: Value;
5
5
  };
6
6
  export type RetAtom<T> = PrimitiveAtom<T> & WithInitialValue<T>;
7
- export type ComponentConfig<T = Record<string, unknown>> = {
8
- id: string;
9
- content: (props: T) => React.ReactElement;
10
- initProps?: T;
11
- };
12
7
  export type ScreenType = 'full' | 'vertical';
13
8
  export declare const enum PlayerStreamStatus {
14
9
  UnknownException = -1000,
@@ -55,6 +50,11 @@ export type UseCtx = (options: {
55
50
  addContent: <T>(type: 'top' | 'bottom' | 'absolute', config: ComponentConfig<T> | ComponentConfig<T>[]) => void;
56
51
  deleteContent: (type: 'top' | 'bottom' | 'absolute', id: string) => void;
57
52
  };
53
+ export type ComponentConfig<T = ReturnType<UseCtx> & Record<string, any>> = {
54
+ id: string;
55
+ content: (props: T) => React.ReactElement;
56
+ initProps?: T;
57
+ };
58
58
  export type ComponentConfigProps = {
59
59
  IPCPlayerContext: IpcContext;
60
60
  } & ReturnType<UseCtx>;
@@ -10,9 +10,9 @@ export declare const Battery: import("react").FunctionComponent<{
10
10
  intercom: import("../..").RetAtom<boolean>;
11
11
  playState: import("../..").RetAtom<import("../..").PlayState>;
12
12
  IPCPlayerInstance: IpcContext;
13
- topContent: import("../..").RetAtom<import("../..").ComponentConfig<Record<string, unknown>>[]>;
14
- bottomContent: import("../..").RetAtom<import("../..").ComponentConfig<Record<string, unknown>>[]>;
15
- absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<Record<string, unknown>>[]>;
13
+ topContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
14
+ bottomContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
15
+ absoluteContent: import("../..").RetAtom<import("../..").ComponentConfig<any & Record<string, any>>[]>;
16
16
  setScreenType: (type: import("../..").ScreenType) => void;
17
17
  setRecording: (value: boolean) => Promise<boolean>;
18
18
  setIntercom: (value: boolean) => Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ipc-player-integration",
3
- "version": "0.0.1-beta-2",
3
+ "version": "0.0.1-beta-4",
4
4
  "description": "IPC 播放器功能集成",
5
5
  "main": "lib/index",
6
6
  "files": [
@@ -36,7 +36,8 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@ray-js/ray-ipc-player": "2.0.17-beta-beta-1",
39
- "clsx": "^1.2.1"
39
+ "clsx": "^1.2.1",
40
+ "jotai": "^2.10.1"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@commitlint/cli": "^7.2.1",
@@ -49,7 +50,6 @@
49
50
  "core-js": "^3.19.1",
50
51
  "eslint-config-tuya-panel": "^0.4.2",
51
52
  "husky": "^1.2.0",
52
- "jotai": "^2.10.1",
53
53
  "lint-staged": "^10.2.11",
54
54
  "standard-version": "9.3.2"
55
55
  },