@ray-js/adapter 1.5.0-beta.12 → 1.5.0

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.
@@ -60,7 +60,7 @@ export type Polygon = {
60
60
  longitude: number;
61
61
  }>;
62
62
  strokeWidth?: number;
63
- strokeColor?: number;
64
- fillColor?: number;
63
+ strokeColor?: string;
64
+ fillColor?: string;
65
65
  };
66
66
  export declare const Map: React.ComponentType<MapProps>;
@@ -21,7 +21,9 @@ export interface PickerProps extends BaseProps {
21
21
  * 取消选择时触发
22
22
  */
23
23
  onCancel?: (event: GenericEvent) => any;
24
- onChange?: (event: GenericEvent) => void;
24
+ onChange?: (event: GenericEvent<{
25
+ value: any;
26
+ }>) => void;
25
27
  /**
26
28
  * 列改变时触发
27
29
  */
@@ -8,7 +8,9 @@ export interface PickerViewProps extends BaseProps {
8
8
  /** 设置蒙层的样式 */
9
9
  maskStyle?: React.CSSProperties;
10
10
  /** 滚动选择时触发 change 事件,event.detail = {value};value 为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项(下标从 0 开始) */
11
- onChange?: (event: GenericEvent) => any;
11
+ onChange?: (event: GenericEvent<{
12
+ value: number[];
13
+ }>) => any;
12
14
  /** 当滚动选择开始时候触发事件 */
13
15
  onPickstart?: (event: GenericEvent) => any;
14
16
  /** 当滚动选择结束时候触发事件 */
@@ -8,7 +8,7 @@ type RichTextNode = {
8
8
  export interface RichTextProps extends BaseProps {
9
9
  /** 节点列表/HTML String,现支持两种节点,通过 type 来区分,分别是元素节点和文本节点,默认是元素节点,在富文本区域里显示的 HTML 节点。 */
10
10
  nodes?: string | RichTextNode[];
11
- onSelect: (e: any) => void;
11
+ onSelect?: (e: any) => void;
12
12
  }
13
13
  export declare const RichText: React.ComponentType<RichTextProps>;
14
14
  export {};
@@ -1,12 +1,17 @@
1
1
  import * as React from 'react';
2
+ type Danmu = {
3
+ text: string;
4
+ color: string;
5
+ time: number;
6
+ };
2
7
  export interface VideoProps {
3
8
  id?: string;
4
9
  className?: string;
5
10
  style?: React.CSSProperties;
6
- src?: string;
11
+ src: string;
7
12
  duration?: number;
8
13
  controls?: boolean;
9
- danmuList?: string;
14
+ danmuList?: Array<Danmu>;
10
15
  danmuBtn?: boolean;
11
16
  enableDanmu?: boolean;
12
17
  autoplay?: boolean;
@@ -33,5 +38,10 @@ export interface VideoProps {
33
38
  onRateChange?: (event: any) => void;
34
39
  onVolumeChange?: (event: any) => void;
35
40
  onSeekComplete?: (event: any) => void;
41
+ /** 非可视区域是否自动暂停 */
42
+ autoPause?: boolean;
43
+ /** 指定视频 border-radius */
44
+ borderRadius?: number;
36
45
  }
37
46
  export declare const Video: React.ComponentType<VideoProps>;
47
+ export {};
@@ -32,6 +32,8 @@ export declare const alias: {
32
32
  onRateChange: string;
33
33
  onVolumeChange: string;
34
34
  onSeekComplete: string;
35
+ autoPause: string;
36
+ borderRadius: string;
35
37
  disableScroll: string;
36
38
  hoverClass: string;
37
39
  hoverClassName: string;
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.props = exports.alias = void 0;
4
4
  const shared_1 = require("@ray-core/shared");
5
5
  const universal_1 = require("../universal");
6
- exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { id: 'id', className: 'class', style: 'style', src: 'src', duration: 'duration', controls: 'controls', danmuList: 'danmu-list', danmuBtn: 'danmu-btn', enableDanmu: 'enable-danmu', autoplay: 'autoplay', loop: 'loop', muted: 'muted', initialTime: 'initial-time', showFullscreenBtn: 'show-fullscreen-btn', showPlayBtn: 'show-play-btn', showCenterPlayBtn: 'show-center-play-btn', objectFit: 'object-fit', poster: 'poster', showMuteBtn: 'show-mute-btn', onPlay: 'bindplay', onPause: 'bindpause', onEnded: 'bindended', onTimeUpdate: 'bindtimeupdate', onWaiting: 'bindwaiting', onError: 'binderror', onProgress: 'bindprogress', onLoadedMetadata: 'bindloadedmetadata', onCanplay: 'bindcanplay', onCanplayThrough: 'bindcanplaythrough', onPlaying: 'bindplaying', onRateChange: 'bindratechange', onVolumeChange: 'bindvolumechange', onSeekComplete: 'bindseekcomplete' });
6
+ exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { id: 'id', className: 'class', style: 'style', src: 'src', duration: 'duration', controls: 'controls', danmuList: 'danmu-list', danmuBtn: 'danmu-btn', enableDanmu: 'enable-danmu', autoplay: 'autoplay', loop: 'loop', muted: 'muted', initialTime: 'initial-time', showFullscreenBtn: 'show-fullscreen-btn', showPlayBtn: 'show-play-btn', showCenterPlayBtn: 'show-center-play-btn', objectFit: 'object-fit', poster: 'poster', showMuteBtn: 'show-mute-btn', onPlay: 'bindplay', onPause: 'bindpause', onEnded: 'bindended', onTimeUpdate: 'bindtimeupdate', onWaiting: 'bindwaiting', onError: 'binderror', onProgress: 'bindprogress', onLoadedMetadata: 'bindloadedmetadata', onCanplay: 'bindcanplay', onCanplayThrough: 'bindcanplaythrough', onPlaying: 'bindplaying', onRateChange: 'bindratechange', onVolumeChange: 'bindvolumechange', onSeekComplete: 'bindseekcomplete', autoPause: 'auto-pause', borderRadius: 'border-radius' });
7
7
  exports.props = (0, shared_1.unique)(Object.values(exports.alias));
@@ -69,7 +69,9 @@ export interface BaseEvent {
69
69
  /** 自定义事件对象属性列表 */
70
70
  export interface GenericEvent<Detail = any> extends BaseEvent {
71
71
  /** 额外的信息 */
72
- detail: Detail;
72
+ detail: {
73
+ value: any;
74
+ } & Detail;
73
75
  }
74
76
  /** 触摸事件对象属性列表 */
75
77
  export interface TouchEvent<T = Touch> extends BaseEvent {
@@ -60,7 +60,7 @@ export type Polygon = {
60
60
  longitude: number;
61
61
  }>;
62
62
  strokeWidth?: number;
63
- strokeColor?: number;
64
- fillColor?: number;
63
+ strokeColor?: string;
64
+ fillColor?: string;
65
65
  };
66
66
  export declare const Map: React.ComponentType<MapProps>;
@@ -21,7 +21,9 @@ export interface PickerProps extends BaseProps {
21
21
  * 取消选择时触发
22
22
  */
23
23
  onCancel?: (event: GenericEvent) => any;
24
- onChange?: (event: GenericEvent) => void;
24
+ onChange?: (event: GenericEvent<{
25
+ value: any;
26
+ }>) => void;
25
27
  /**
26
28
  * 列改变时触发
27
29
  */
@@ -8,7 +8,9 @@ export interface PickerViewProps extends BaseProps {
8
8
  /** 设置蒙层的样式 */
9
9
  maskStyle?: React.CSSProperties;
10
10
  /** 滚动选择时触发 change 事件,event.detail = {value};value 为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项(下标从 0 开始) */
11
- onChange?: (event: GenericEvent) => any;
11
+ onChange?: (event: GenericEvent<{
12
+ value: number[];
13
+ }>) => any;
12
14
  /** 当滚动选择开始时候触发事件 */
13
15
  onPickstart?: (event: GenericEvent) => any;
14
16
  /** 当滚动选择结束时候触发事件 */
@@ -8,7 +8,7 @@ type RichTextNode = {
8
8
  export interface RichTextProps extends BaseProps {
9
9
  /** 节点列表/HTML String,现支持两种节点,通过 type 来区分,分别是元素节点和文本节点,默认是元素节点,在富文本区域里显示的 HTML 节点。 */
10
10
  nodes?: string | RichTextNode[];
11
- onSelect: (e: any) => void;
11
+ onSelect?: (e: any) => void;
12
12
  }
13
13
  export declare const RichText: React.ComponentType<RichTextProps>;
14
14
  export {};
@@ -1,12 +1,17 @@
1
1
  import * as React from 'react';
2
+ type Danmu = {
3
+ text: string;
4
+ color: string;
5
+ time: number;
6
+ };
2
7
  export interface VideoProps {
3
8
  id?: string;
4
9
  className?: string;
5
10
  style?: React.CSSProperties;
6
- src?: string;
11
+ src: string;
7
12
  duration?: number;
8
13
  controls?: boolean;
9
- danmuList?: string;
14
+ danmuList?: Array<Danmu>;
10
15
  danmuBtn?: boolean;
11
16
  enableDanmu?: boolean;
12
17
  autoplay?: boolean;
@@ -33,5 +38,10 @@ export interface VideoProps {
33
38
  onRateChange?: (event: any) => void;
34
39
  onVolumeChange?: (event: any) => void;
35
40
  onSeekComplete?: (event: any) => void;
41
+ /** 非可视区域是否自动暂停 */
42
+ autoPause?: boolean;
43
+ /** 指定视频 border-radius */
44
+ borderRadius?: number;
36
45
  }
37
46
  export declare const Video: React.ComponentType<VideoProps>;
47
+ export {};
@@ -32,6 +32,8 @@ export declare const alias: {
32
32
  onRateChange: string;
33
33
  onVolumeChange: string;
34
34
  onSeekComplete: string;
35
+ autoPause: string;
36
+ borderRadius: string;
35
37
  disableScroll: string;
36
38
  hoverClass: string;
37
39
  hoverClassName: string;
@@ -1,4 +1,4 @@
1
1
  import { unique } from '@ray-core/shared';
2
2
  import { universalAlias } from '../universal';
3
- export const alias = Object.assign(Object.assign({}, universalAlias), { id: 'id', className: 'class', style: 'style', src: 'src', duration: 'duration', controls: 'controls', danmuList: 'danmu-list', danmuBtn: 'danmu-btn', enableDanmu: 'enable-danmu', autoplay: 'autoplay', loop: 'loop', muted: 'muted', initialTime: 'initial-time', showFullscreenBtn: 'show-fullscreen-btn', showPlayBtn: 'show-play-btn', showCenterPlayBtn: 'show-center-play-btn', objectFit: 'object-fit', poster: 'poster', showMuteBtn: 'show-mute-btn', onPlay: 'bindplay', onPause: 'bindpause', onEnded: 'bindended', onTimeUpdate: 'bindtimeupdate', onWaiting: 'bindwaiting', onError: 'binderror', onProgress: 'bindprogress', onLoadedMetadata: 'bindloadedmetadata', onCanplay: 'bindcanplay', onCanplayThrough: 'bindcanplaythrough', onPlaying: 'bindplaying', onRateChange: 'bindratechange', onVolumeChange: 'bindvolumechange', onSeekComplete: 'bindseekcomplete' });
3
+ export const alias = Object.assign(Object.assign({}, universalAlias), { id: 'id', className: 'class', style: 'style', src: 'src', duration: 'duration', controls: 'controls', danmuList: 'danmu-list', danmuBtn: 'danmu-btn', enableDanmu: 'enable-danmu', autoplay: 'autoplay', loop: 'loop', muted: 'muted', initialTime: 'initial-time', showFullscreenBtn: 'show-fullscreen-btn', showPlayBtn: 'show-play-btn', showCenterPlayBtn: 'show-center-play-btn', objectFit: 'object-fit', poster: 'poster', showMuteBtn: 'show-mute-btn', onPlay: 'bindplay', onPause: 'bindpause', onEnded: 'bindended', onTimeUpdate: 'bindtimeupdate', onWaiting: 'bindwaiting', onError: 'binderror', onProgress: 'bindprogress', onLoadedMetadata: 'bindloadedmetadata', onCanplay: 'bindcanplay', onCanplayThrough: 'bindcanplaythrough', onPlaying: 'bindplaying', onRateChange: 'bindratechange', onVolumeChange: 'bindvolumechange', onSeekComplete: 'bindseekcomplete', autoPause: 'auto-pause', borderRadius: 'border-radius' });
4
4
  export const props = unique(Object.values(alias));
@@ -69,7 +69,9 @@ export interface BaseEvent {
69
69
  /** 自定义事件对象属性列表 */
70
70
  export interface GenericEvent<Detail = any> extends BaseEvent {
71
71
  /** 额外的信息 */
72
- detail: Detail;
72
+ detail: {
73
+ value: any;
74
+ } & Detail;
73
75
  }
74
76
  /** 触摸事件对象属性列表 */
75
77
  export interface TouchEvent<T = Touch> extends BaseEvent {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/adapter",
3
- "version": "1.5.0-beta.12",
3
+ "version": "1.5.0",
4
4
  "description": "Ray adapter for tuya",
5
5
  "keywords": [
6
6
  "ray"
@@ -15,6 +15,8 @@
15
15
  ],
16
16
  "module": "./esm/index.js",
17
17
  "typings": "./esm/index.d.ts",
18
+ "main": "./cjs/index.js",
19
+ "types": "./cjs/index.d.ts",
18
20
  "files": [
19
21
  "cjs",
20
22
  "esm",
@@ -29,12 +31,12 @@
29
31
  "watch": "concurrently 'yarn build:cjs --watch' 'yarn build:esm --watch'"
30
32
  },
31
33
  "dependencies": {
32
- "@ray-core/runtime": "^0.3.9",
33
- "@ray-core/shared": "^0.3.9",
34
- "@ray-core/types": "^0.3.9"
34
+ "@ray-core/runtime": "^0.4.0",
35
+ "@ray-core/shared": "^0.4.0",
36
+ "@ray-core/types": "^0.4.0"
35
37
  },
36
38
  "devDependencies": {
37
- "@ray-js/types": "^1.5.0-beta.12",
39
+ "@ray-js/types": "1.5.0",
38
40
  "concurrently": "^6.5.1"
39
41
  },
40
42
  "publishConfig": {
@@ -42,5 +44,5 @@
42
44
  "registry": "https://registry.npmjs.org"
43
45
  },
44
46
  "esnext": "./esm/index.js",
45
- "gitHead": "7fb9ae94b8896c81a6b6556099107cb2daab9c9b"
47
+ "gitHead": "acb0b960e4f0cda492b34c950bf9cd8d5b27ec8a"
46
48
  }