@ray-js/adapter 1.3.0-beta.2-beta-2 → 1.3.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.
- package/CHANGELOG.md +4 -0
- package/cjs/hostComponents/Camera/node.js +1 -1
- package/cjs/hostComponents/Iframe/node.d.ts +3 -3
- package/cjs/hostComponents/Iframe/node.js +1 -1
- package/cjs/hostComponents/Map/node.js +1 -1
- package/cjs/hostComponents/Navigator/index.d.ts +38 -0
- package/cjs/hostComponents/Navigator/index.js +17 -0
- package/cjs/hostComponents/Navigator/node.d.ts +23 -0
- package/cjs/hostComponents/Navigator/node.js +26 -0
- package/cjs/hostComponents/Video/node.js +1 -1
- package/cjs/hostComponents/View/node.d.ts +1 -0
- package/cjs/hostComponents/View/node.js +1 -1
- package/cjs/hostComponents/WebView/node.d.ts +3 -3
- package/cjs/hostComponents/WebView/node.js +1 -1
- package/cjs/hostComponents/index.d.ts +1 -0
- package/cjs/hostComponents/index.js +1 -0
- package/cjs/hostComponents/node.js +2 -0
- package/esm/hostComponents/Camera/node.js +1 -1
- package/esm/hostComponents/Iframe/node.d.ts +3 -3
- package/esm/hostComponents/Iframe/node.js +1 -1
- package/esm/hostComponents/Map/node.js +1 -1
- package/esm/hostComponents/Navigator/index.d.ts +38 -0
- package/esm/hostComponents/Navigator/index.js +14 -0
- package/esm/hostComponents/Navigator/node.d.ts +23 -0
- package/esm/hostComponents/Navigator/node.js +23 -0
- package/esm/hostComponents/Video/node.js +1 -1
- package/esm/hostComponents/View/node.d.ts +1 -0
- package/esm/hostComponents/View/node.js +1 -1
- package/esm/hostComponents/WebView/node.d.ts +3 -3
- package/esm/hostComponents/WebView/node.js +1 -1
- package/esm/hostComponents/index.d.ts +1 -0
- package/esm/hostComponents/index.js +1 -0
- package/esm/hostComponents/node.js +2 -0
- package/package.json +6 -6
- package/templates/component.ejs +65 -37
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.2.16-beta-1](./compare/v1.2.16-alpha.2...v1.2.16-beta-1) (2023-05-22)
|
|
6
|
+
|
|
7
|
+
**Note:** Version bump only for package @ray-js/adapter
|
|
8
|
+
|
|
5
9
|
## [1.3.0-beta.2-beta-2](./compare/v1.3.0-beta.2-beta-1...v1.3.0-beta.2-beta-2) (2023-05-11)
|
|
6
10
|
|
|
7
11
|
**Note:** Version bump only for package @ray-js/adapter
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.props = exports.alias = void 0;
|
|
4
4
|
const universal_1 = require("../universal");
|
|
5
|
-
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { id: 'id', className: 'class
|
|
5
|
+
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { id: 'id', className: 'class', style: 'style', updateLayout: 'update-layout', mode: 'mode', resolution: 'resolution', devicePosition: 'device-position', flash: 'flash', borderWidth: 'border-width', borderStyle: 'border-style', borderColor: 'border-color', borderRadius: 'border-radius', borderRadiusTopLeft: 'border-radius-top-left', borderRadiusTopRight: 'border-radius-top-right', borderRadiusBottomLeft: 'border-radius-bottom-left', borderRadiusBottomRight: 'border-radius-bottom-right', backgroundColor: 'background-color', onBindstop: 'bind:bindstop', onError: 'bind:error', onInitdone: 'bind:initdone' });
|
|
6
6
|
exports.props = Object.values(exports.alias);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export declare const alias: {
|
|
2
|
-
id: string;
|
|
3
|
-
className: string;
|
|
4
|
-
style: string;
|
|
5
2
|
src: string;
|
|
6
3
|
onError: string;
|
|
7
4
|
onLoad: string;
|
|
8
5
|
onMessage: string;
|
|
6
|
+
id: string;
|
|
9
7
|
disableScroll: string;
|
|
10
8
|
hoverClass: string;
|
|
11
9
|
hoverClassName: string;
|
|
12
10
|
hoverStartTime: string;
|
|
13
11
|
hoverStayTime: string;
|
|
14
12
|
hidden: string;
|
|
13
|
+
className: string;
|
|
15
14
|
animation: string;
|
|
15
|
+
style: string;
|
|
16
16
|
hoverStopPropagation: string;
|
|
17
17
|
onTap: string;
|
|
18
18
|
onClick: string;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.props = exports.alias = void 0;
|
|
4
4
|
const universal_1 = require("../universal");
|
|
5
|
-
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), {
|
|
5
|
+
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { src: 'src', onError: 'binderror', onLoad: 'bindload', onMessage: 'bindmessage' });
|
|
6
6
|
exports.props = Object.values(exports.alias);
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.props = exports.alias = void 0;
|
|
4
4
|
const universal_1 = require("../universal");
|
|
5
|
-
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { id: 'id', className: 'class
|
|
5
|
+
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { id: 'id', className: 'class', style: 'style', updateLayout: 'update-layout', longitude: 'longitude', latitude: 'latitude', scale: 'scale', minScale: 'min-scale', maxScale: 'max-scale', markers: 'markers', polyline: 'polyline', circles: 'circles', polygons: 'polygons', borderWidth: 'border-width', borderStyle: 'border-style', borderColor: 'border-color', borderRadius: 'border-radius', borderRadiusTopLeft: 'border-radius-top-left', borderRadiusTopRight: 'border-radius-top-right', borderRadiusBottomLeft: 'border-radius-bottom-left', borderRadiusBottomRight: 'border-radius-bottom-right', backgroundColor: 'background-color', onMarkertap: 'bind:markertap', onCallouttap: 'bind:callouttap', onRegionchange: 'bind:regionchange', onInitdone: 'bind:initdone' });
|
|
6
6
|
exports.props = Object.values(exports.alias);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BaseProps, GenericEvent } from '../../types/component';
|
|
3
|
+
export interface NavigatorProps extends BaseProps {
|
|
4
|
+
/** (default: self) 在哪个目标上发生跳转,默认当前小程序 2.0.7 */
|
|
5
|
+
target?: 'self' | 'miniProgram';
|
|
6
|
+
/** 当前小程序内的跳转链接 1.0.0 */
|
|
7
|
+
url?: string;
|
|
8
|
+
/** (default: navigate) 跳转方式 1.0.0 */
|
|
9
|
+
openType?: 'navigate' | 'redirect' | 'switchTab' | 'reLaunch' | 'navigateBack' | 'exit';
|
|
10
|
+
/** (default: 1) 当 open-type 为 'navigateBack' 时有效,表示回退的层数 1.0.0 */
|
|
11
|
+
delta?: number;
|
|
12
|
+
/** 当target="miniProgram"时有效,要打开的小程序 appId 2.0.7 */
|
|
13
|
+
appId?: string;
|
|
14
|
+
/** 当target="miniProgram"时有效,打开的页面路径,如果为空则打开首页 2.0.7 */
|
|
15
|
+
path?: string;
|
|
16
|
+
/** 当target="miniProgram"时有效,需要传递给目标小程序的数据,目标小程序可在 App.onLaunch(),App.onShow() 中获取到这份数据。详情 2.0.7 */
|
|
17
|
+
extraData?: any;
|
|
18
|
+
/** (default: release) 当target="miniProgram"时有效,要打开的小程序版本 2.0.7 */
|
|
19
|
+
version?: 'develop' | 'trial' | 'release';
|
|
20
|
+
/** (default: navigator-hover) 指定点击时的样式类,当hover-class="none"时,没有点击态效果 1.0.0 */
|
|
21
|
+
hoverClassName?: string;
|
|
22
|
+
/** (default: false) 指定是否阻止本节点的祖先节点出现点击态 1.5.0 */
|
|
23
|
+
hoverStopPropagation?: boolean;
|
|
24
|
+
/** (default: 50) 按住后多久出现点击态,单位毫秒 1.0.0 */
|
|
25
|
+
hoverStartTime?: number;
|
|
26
|
+
/** (default: 600) 手指松开后点击态保留时间,单位毫秒 1.0.0 */
|
|
27
|
+
hoverStayTime?: number;
|
|
28
|
+
/** 当target="miniProgram"时有效,跳转小程序成功 2.0.7 */
|
|
29
|
+
onSuccess?: (event: GenericEvent) => any;
|
|
30
|
+
/** 当target="miniProgram"时有效,跳转小程序失败 2.0.7 */
|
|
31
|
+
onFail?: (event: GenericEvent) => any;
|
|
32
|
+
/** 当target="miniProgram"时有效,跳转小程序完成 2.0.7 */
|
|
33
|
+
onComplete?: (event: GenericEvent) => any;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html
|
|
37
|
+
*/
|
|
38
|
+
export declare const Navigator: React.ComponentType<NavigatorProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Navigator = void 0;
|
|
4
|
+
const runtime_1 = require("@ray-core/runtime");
|
|
5
|
+
/**
|
|
6
|
+
* https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html
|
|
7
|
+
*/
|
|
8
|
+
exports.Navigator = (0, runtime_1.createHostComponent)('navigator');
|
|
9
|
+
exports.Navigator.defaultProps = {
|
|
10
|
+
target: 'self',
|
|
11
|
+
openType: 'navigate',
|
|
12
|
+
delta: 1,
|
|
13
|
+
hoverClassName: 'navigator-hover',
|
|
14
|
+
hoverStopPropagation: false,
|
|
15
|
+
hoverStartTime: 50,
|
|
16
|
+
hoverStayTime: 600,
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const alias: {
|
|
2
|
+
id: string;
|
|
3
|
+
className: string;
|
|
4
|
+
style: string;
|
|
5
|
+
animation: string;
|
|
6
|
+
openType: string;
|
|
7
|
+
hoverClass: string;
|
|
8
|
+
hoverClassName: string;
|
|
9
|
+
hoverStartTime: string;
|
|
10
|
+
hoverStayTime: string;
|
|
11
|
+
url: string;
|
|
12
|
+
target: string;
|
|
13
|
+
delta: string;
|
|
14
|
+
appId: string;
|
|
15
|
+
path: string;
|
|
16
|
+
extraData: string;
|
|
17
|
+
version: string;
|
|
18
|
+
hoverStopPropagation: string;
|
|
19
|
+
onSuccess: string;
|
|
20
|
+
onFail: string;
|
|
21
|
+
onComplete: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const props: string[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.props = exports.alias = void 0;
|
|
4
|
+
exports.alias = {
|
|
5
|
+
id: 'id',
|
|
6
|
+
className: 'class',
|
|
7
|
+
style: 'style',
|
|
8
|
+
animation: 'animation',
|
|
9
|
+
openType: 'open-type',
|
|
10
|
+
hoverClass: 'hover-class',
|
|
11
|
+
hoverClassName: 'hover-class',
|
|
12
|
+
hoverStartTime: 'hover-start-time',
|
|
13
|
+
hoverStayTime: 'hover-stay-time',
|
|
14
|
+
url: 'url',
|
|
15
|
+
target: 'target',
|
|
16
|
+
delta: 'delta',
|
|
17
|
+
appId: 'app-id',
|
|
18
|
+
path: 'path',
|
|
19
|
+
extraData: 'extra-data',
|
|
20
|
+
version: 'version',
|
|
21
|
+
hoverStopPropagation: 'hover-stop-propagation',
|
|
22
|
+
onSuccess: 'bindsuccess',
|
|
23
|
+
onFail: 'bindfail',
|
|
24
|
+
onComplete: 'bindcomplete',
|
|
25
|
+
};
|
|
26
|
+
exports.props = Object.values(exports.alias);
|
|
@@ -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
|
|
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' });
|
|
7
7
|
exports.props = (0, shared_1.unique)(Object.values(exports.alias));
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.props = exports.alias = void 0;
|
|
4
4
|
const universal_1 = require("../universal");
|
|
5
|
-
exports.alias = universal_1.universalAlias;
|
|
5
|
+
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { catchTouchMove: 'catchtouchmove' });
|
|
6
6
|
exports.props = Object.values(exports.alias);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const alias: {
|
|
2
|
-
id: string;
|
|
3
|
-
className: string;
|
|
4
|
-
style: string;
|
|
5
2
|
src: string;
|
|
6
3
|
onError: string;
|
|
7
4
|
onLoad: string;
|
|
8
5
|
onMessage: string;
|
|
9
6
|
updateLayout: string;
|
|
7
|
+
id: string;
|
|
10
8
|
disableScroll: string;
|
|
11
9
|
hoverClass: string;
|
|
12
10
|
hoverClassName: string;
|
|
13
11
|
hoverStartTime: string;
|
|
14
12
|
hoverStayTime: string;
|
|
15
13
|
hidden: string;
|
|
14
|
+
className: string;
|
|
16
15
|
animation: string;
|
|
16
|
+
style: string;
|
|
17
17
|
hoverStopPropagation: string;
|
|
18
18
|
onTap: string;
|
|
19
19
|
onClick: string;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.props = exports.alias = void 0;
|
|
4
4
|
const universal_1 = require("../universal");
|
|
5
|
-
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), {
|
|
5
|
+
exports.alias = Object.assign(Object.assign({}, universal_1.universalAlias), { src: 'src', onError: 'binderror', onLoad: 'bindload', onMessage: 'bindmessage', updateLayout: 'update-layout' });
|
|
6
6
|
exports.props = Object.values(exports.alias);
|
|
@@ -57,6 +57,7 @@ const MapView = __importStar(require("./Map/node"));
|
|
|
57
57
|
const Camera = __importStar(require("./Camera/node"));
|
|
58
58
|
const RichText = __importStar(require("./RichText/node"));
|
|
59
59
|
const Iframe = __importStar(require("./Iframe/node"));
|
|
60
|
+
const Navigator = __importStar(require("./Navigator/node"));
|
|
60
61
|
const hostComponents = new Map();
|
|
61
62
|
hostComponents.set('button', Button);
|
|
62
63
|
hostComponents.set('canvas', Canvas);
|
|
@@ -92,4 +93,5 @@ hostComponents.set('camera', Camera);
|
|
|
92
93
|
hostComponents.set('progress', Progress);
|
|
93
94
|
hostComponents.set('rich-text', RichText);
|
|
94
95
|
hostComponents.set('iframe', Iframe);
|
|
96
|
+
hostComponents.set('navigator', Navigator);
|
|
95
97
|
exports.default = hostComponents;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { universalAlias } from '../universal';
|
|
2
|
-
export const alias = Object.assign(Object.assign({}, universalAlias), { id: 'id', className: 'class
|
|
2
|
+
export const alias = Object.assign(Object.assign({}, universalAlias), { id: 'id', className: 'class', style: 'style', updateLayout: 'update-layout', mode: 'mode', resolution: 'resolution', devicePosition: 'device-position', flash: 'flash', borderWidth: 'border-width', borderStyle: 'border-style', borderColor: 'border-color', borderRadius: 'border-radius', borderRadiusTopLeft: 'border-radius-top-left', borderRadiusTopRight: 'border-radius-top-right', borderRadiusBottomLeft: 'border-radius-bottom-left', borderRadiusBottomRight: 'border-radius-bottom-right', backgroundColor: 'background-color', onBindstop: 'bind:bindstop', onError: 'bind:error', onInitdone: 'bind:initdone' });
|
|
3
3
|
export const props = Object.values(alias);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export declare const alias: {
|
|
2
|
-
id: string;
|
|
3
|
-
className: string;
|
|
4
|
-
style: string;
|
|
5
2
|
src: string;
|
|
6
3
|
onError: string;
|
|
7
4
|
onLoad: string;
|
|
8
5
|
onMessage: string;
|
|
6
|
+
id: string;
|
|
9
7
|
disableScroll: string;
|
|
10
8
|
hoverClass: string;
|
|
11
9
|
hoverClassName: string;
|
|
12
10
|
hoverStartTime: string;
|
|
13
11
|
hoverStayTime: string;
|
|
14
12
|
hidden: string;
|
|
13
|
+
className: string;
|
|
15
14
|
animation: string;
|
|
15
|
+
style: string;
|
|
16
16
|
hoverStopPropagation: string;
|
|
17
17
|
onTap: string;
|
|
18
18
|
onClick: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { universalAlias } from '../universal';
|
|
2
|
-
export const alias = Object.assign(Object.assign({}, universalAlias), {
|
|
2
|
+
export const alias = Object.assign(Object.assign({}, universalAlias), { src: 'src', onError: 'binderror', onLoad: 'bindload', onMessage: 'bindmessage' });
|
|
3
3
|
export const props = Object.values(alias);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { universalAlias } from '../universal';
|
|
2
|
-
export const alias = Object.assign(Object.assign({}, universalAlias), { id: 'id', className: 'class
|
|
2
|
+
export const alias = Object.assign(Object.assign({}, universalAlias), { id: 'id', className: 'class', style: 'style', updateLayout: 'update-layout', longitude: 'longitude', latitude: 'latitude', scale: 'scale', minScale: 'min-scale', maxScale: 'max-scale', markers: 'markers', polyline: 'polyline', circles: 'circles', polygons: 'polygons', borderWidth: 'border-width', borderStyle: 'border-style', borderColor: 'border-color', borderRadius: 'border-radius', borderRadiusTopLeft: 'border-radius-top-left', borderRadiusTopRight: 'border-radius-top-right', borderRadiusBottomLeft: 'border-radius-bottom-left', borderRadiusBottomRight: 'border-radius-bottom-right', backgroundColor: 'background-color', onMarkertap: 'bind:markertap', onCallouttap: 'bind:callouttap', onRegionchange: 'bind:regionchange', onInitdone: 'bind:initdone' });
|
|
3
3
|
export const props = Object.values(alias);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BaseProps, GenericEvent } from '../../types/component';
|
|
3
|
+
export interface NavigatorProps extends BaseProps {
|
|
4
|
+
/** (default: self) 在哪个目标上发生跳转,默认当前小程序 2.0.7 */
|
|
5
|
+
target?: 'self' | 'miniProgram';
|
|
6
|
+
/** 当前小程序内的跳转链接 1.0.0 */
|
|
7
|
+
url?: string;
|
|
8
|
+
/** (default: navigate) 跳转方式 1.0.0 */
|
|
9
|
+
openType?: 'navigate' | 'redirect' | 'switchTab' | 'reLaunch' | 'navigateBack' | 'exit';
|
|
10
|
+
/** (default: 1) 当 open-type 为 'navigateBack' 时有效,表示回退的层数 1.0.0 */
|
|
11
|
+
delta?: number;
|
|
12
|
+
/** 当target="miniProgram"时有效,要打开的小程序 appId 2.0.7 */
|
|
13
|
+
appId?: string;
|
|
14
|
+
/** 当target="miniProgram"时有效,打开的页面路径,如果为空则打开首页 2.0.7 */
|
|
15
|
+
path?: string;
|
|
16
|
+
/** 当target="miniProgram"时有效,需要传递给目标小程序的数据,目标小程序可在 App.onLaunch(),App.onShow() 中获取到这份数据。详情 2.0.7 */
|
|
17
|
+
extraData?: any;
|
|
18
|
+
/** (default: release) 当target="miniProgram"时有效,要打开的小程序版本 2.0.7 */
|
|
19
|
+
version?: 'develop' | 'trial' | 'release';
|
|
20
|
+
/** (default: navigator-hover) 指定点击时的样式类,当hover-class="none"时,没有点击态效果 1.0.0 */
|
|
21
|
+
hoverClassName?: string;
|
|
22
|
+
/** (default: false) 指定是否阻止本节点的祖先节点出现点击态 1.5.0 */
|
|
23
|
+
hoverStopPropagation?: boolean;
|
|
24
|
+
/** (default: 50) 按住后多久出现点击态,单位毫秒 1.0.0 */
|
|
25
|
+
hoverStartTime?: number;
|
|
26
|
+
/** (default: 600) 手指松开后点击态保留时间,单位毫秒 1.0.0 */
|
|
27
|
+
hoverStayTime?: number;
|
|
28
|
+
/** 当target="miniProgram"时有效,跳转小程序成功 2.0.7 */
|
|
29
|
+
onSuccess?: (event: GenericEvent) => any;
|
|
30
|
+
/** 当target="miniProgram"时有效,跳转小程序失败 2.0.7 */
|
|
31
|
+
onFail?: (event: GenericEvent) => any;
|
|
32
|
+
/** 当target="miniProgram"时有效,跳转小程序完成 2.0.7 */
|
|
33
|
+
onComplete?: (event: GenericEvent) => any;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html
|
|
37
|
+
*/
|
|
38
|
+
export declare const Navigator: React.ComponentType<NavigatorProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createHostComponent } from '@ray-core/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html
|
|
4
|
+
*/
|
|
5
|
+
export const Navigator = createHostComponent('navigator');
|
|
6
|
+
Navigator.defaultProps = {
|
|
7
|
+
target: 'self',
|
|
8
|
+
openType: 'navigate',
|
|
9
|
+
delta: 1,
|
|
10
|
+
hoverClassName: 'navigator-hover',
|
|
11
|
+
hoverStopPropagation: false,
|
|
12
|
+
hoverStartTime: 50,
|
|
13
|
+
hoverStayTime: 600,
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const alias: {
|
|
2
|
+
id: string;
|
|
3
|
+
className: string;
|
|
4
|
+
style: string;
|
|
5
|
+
animation: string;
|
|
6
|
+
openType: string;
|
|
7
|
+
hoverClass: string;
|
|
8
|
+
hoverClassName: string;
|
|
9
|
+
hoverStartTime: string;
|
|
10
|
+
hoverStayTime: string;
|
|
11
|
+
url: string;
|
|
12
|
+
target: string;
|
|
13
|
+
delta: string;
|
|
14
|
+
appId: string;
|
|
15
|
+
path: string;
|
|
16
|
+
extraData: string;
|
|
17
|
+
version: string;
|
|
18
|
+
hoverStopPropagation: string;
|
|
19
|
+
onSuccess: string;
|
|
20
|
+
onFail: string;
|
|
21
|
+
onComplete: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const props: string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const alias = {
|
|
2
|
+
id: 'id',
|
|
3
|
+
className: 'class',
|
|
4
|
+
style: 'style',
|
|
5
|
+
animation: 'animation',
|
|
6
|
+
openType: 'open-type',
|
|
7
|
+
hoverClass: 'hover-class',
|
|
8
|
+
hoverClassName: 'hover-class',
|
|
9
|
+
hoverStartTime: 'hover-start-time',
|
|
10
|
+
hoverStayTime: 'hover-stay-time',
|
|
11
|
+
url: 'url',
|
|
12
|
+
target: 'target',
|
|
13
|
+
delta: 'delta',
|
|
14
|
+
appId: 'app-id',
|
|
15
|
+
path: 'path',
|
|
16
|
+
extraData: 'extra-data',
|
|
17
|
+
version: 'version',
|
|
18
|
+
hoverStopPropagation: 'hover-stop-propagation',
|
|
19
|
+
onSuccess: 'bindsuccess',
|
|
20
|
+
onFail: 'bindfail',
|
|
21
|
+
onComplete: 'bindcomplete',
|
|
22
|
+
};
|
|
23
|
+
export const props = Object.values(alias);
|
|
@@ -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
|
|
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' });
|
|
4
4
|
export const props = unique(Object.values(alias));
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const alias: {
|
|
2
|
-
id: string;
|
|
3
|
-
className: string;
|
|
4
|
-
style: string;
|
|
5
2
|
src: string;
|
|
6
3
|
onError: string;
|
|
7
4
|
onLoad: string;
|
|
8
5
|
onMessage: string;
|
|
9
6
|
updateLayout: string;
|
|
7
|
+
id: string;
|
|
10
8
|
disableScroll: string;
|
|
11
9
|
hoverClass: string;
|
|
12
10
|
hoverClassName: string;
|
|
13
11
|
hoverStartTime: string;
|
|
14
12
|
hoverStayTime: string;
|
|
15
13
|
hidden: string;
|
|
14
|
+
className: string;
|
|
16
15
|
animation: string;
|
|
16
|
+
style: string;
|
|
17
17
|
hoverStopPropagation: string;
|
|
18
18
|
onTap: string;
|
|
19
19
|
onClick: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { universalAlias } from '../universal';
|
|
2
|
-
export const alias = Object.assign(Object.assign({}, universalAlias), {
|
|
2
|
+
export const alias = Object.assign(Object.assign({}, universalAlias), { src: 'src', onError: 'binderror', onLoad: 'bindload', onMessage: 'bindmessage', updateLayout: 'update-layout' });
|
|
3
3
|
export const props = Object.values(alias);
|
|
@@ -32,6 +32,7 @@ import * as MapView from './Map/node';
|
|
|
32
32
|
import * as Camera from './Camera/node';
|
|
33
33
|
import * as RichText from './RichText/node';
|
|
34
34
|
import * as Iframe from './Iframe/node';
|
|
35
|
+
import * as Navigator from './Navigator/node';
|
|
35
36
|
const hostComponents = new Map();
|
|
36
37
|
hostComponents.set('button', Button);
|
|
37
38
|
hostComponents.set('canvas', Canvas);
|
|
@@ -67,4 +68,5 @@ hostComponents.set('camera', Camera);
|
|
|
67
68
|
hostComponents.set('progress', Progress);
|
|
68
69
|
hostComponents.set('rich-text', RichText);
|
|
69
70
|
hostComponents.set('iframe', Iframe);
|
|
71
|
+
hostComponents.set('navigator', Navigator);
|
|
70
72
|
export default hostComponents;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/adapter",
|
|
3
|
-
"version": "1.3.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Ray adapter for tuya",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ray"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"watch": "concurrently 'yarn build:cjs --watch' 'yarn build:esm --watch'"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@ray-js/types": "^1.3.0
|
|
24
|
+
"@ray-js/types": "^1.3.0",
|
|
25
25
|
"concurrently": "^6.2.1"
|
|
26
26
|
},
|
|
27
27
|
"maintainers": [
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ray-core/runtime": "^0.
|
|
35
|
-
"@ray-core/shared": "^0.
|
|
36
|
-
"@ray-core/types": "^0.
|
|
34
|
+
"@ray-core/runtime": "^0.3.0",
|
|
35
|
+
"@ray-core/shared": "^0.3.0",
|
|
36
|
+
"@ray-core/types": "^0.3.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "f7f96c375a429a2fa94452b0a9af3f841572921a",
|
|
39
39
|
"repository": {}
|
|
40
40
|
}
|
package/templates/component.ejs
CHANGED
|
@@ -1,47 +1,75 @@
|
|
|
1
1
|
<template name="REMAX_TPL_<%=id%>">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</
|
|
2
|
+
<%_ if (id === 'view') { -%>
|
|
3
|
+
<block ty:if="{{i.props['catchtouchmove']}}">
|
|
4
|
+
<<%=id%>
|
|
5
|
+
<%# view 标签需要区分是否含 catchtouchmove 事件,区分渲染模板 避免冲突 -%>
|
|
6
|
+
<%pp1 = props.filter(k => k !== 'bindtouchmove')-%>
|
|
7
|
+
<%_ for(let i=0;i < pp1.length; i++) { -%>
|
|
8
|
+
<%=pp1[i]%>="{{i.props['<%=pp1[i]%>']}}"
|
|
9
|
+
<%_ } -%>
|
|
10
|
+
>
|
|
11
|
+
<block ty:for="{{i.children}}" ty:key="*this">
|
|
12
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
|
|
13
|
+
</block>
|
|
14
|
+
</<%=id%>>
|
|
14
15
|
</block>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
<block ty:else>
|
|
17
|
+
<<%=id%>
|
|
18
|
+
<%pp2 = props.filter(k => k !== 'catchtouchmove')-%>
|
|
19
|
+
<%_ for(let i=0;i < pp2.length; i++) { -%>
|
|
20
|
+
<%=pp2[i]%>="{{i.props['<%=pp2[i]%>']}}"
|
|
21
|
+
<%_ } -%>
|
|
22
|
+
>
|
|
23
|
+
<block ty:for="{{i.children}}" ty:key="*this">
|
|
24
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
|
|
25
|
+
</block>
|
|
26
|
+
</<%=id%>>
|
|
22
27
|
</block>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
>
|
|
28
|
+
<%_ } else { -%>
|
|
29
|
+
<<%=id%>
|
|
30
|
+
<%_ for(let i=0;i < props.length; i++) { -%>
|
|
31
|
+
<%=props[i]%>="{{i.props['<%=props[i]%>']}}"
|
|
32
|
+
<%_ } -%>
|
|
33
|
+
>
|
|
34
|
+
<%_ if (id === 'swiper') { -%>
|
|
35
|
+
<block ty:for="{{i.children}}" ty:key="*this">
|
|
36
|
+
<swiper-item key="{{i.nodes[item].props.key}}">
|
|
32
37
|
<block ty:for="{{i.nodes[item].children}}" ty:key="*this" ty:for-item="sItem">
|
|
33
38
|
<template is="{{'REMAX_TPL_' + i.nodes[item].nodes[sItem].type}}" data="{{i: i.nodes[item].nodes[sItem]}}" />
|
|
34
39
|
</block>
|
|
35
|
-
</
|
|
40
|
+
</swiper-item>
|
|
41
|
+
</block>
|
|
42
|
+
<%_ } else if (id === 'picker-view') { -%>
|
|
43
|
+
<block ty:for="{{i.children}}" ty:key="*this">
|
|
44
|
+
<picker-view-column>
|
|
45
|
+
<block ty:for="{{i.nodes[item].children}}" ty:for-item="sItem">
|
|
46
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].nodes[sItem].type}}" data="{{i: i.nodes[item].nodes[sItem]}}" />
|
|
47
|
+
</block>
|
|
48
|
+
</picker-view-column>
|
|
49
|
+
</block>
|
|
50
|
+
<%_ } else if (type === 'native') { -%>
|
|
51
|
+
<block ty:for="{{i.children}}" ty:key="*this">
|
|
52
|
+
<block ty:if="{{i.nodes[item].props['slot']}}">
|
|
53
|
+
<view
|
|
54
|
+
slot="{{i.nodes[item].props['slot']}}"
|
|
55
|
+
<%_ for(let i=0;i < slotView.props.length; i++) { -%>
|
|
56
|
+
<%=slotView.props[i]%>="{{i.nodes[item].props['<%=slotView.props[i]%>']}}"
|
|
57
|
+
<%_ } -%>
|
|
58
|
+
>
|
|
59
|
+
<block ty:for="{{i.nodes[item].children}}" ty:key="*this" ty:for-item="sItem">
|
|
60
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].nodes[sItem].type}}" data="{{i: i.nodes[item].nodes[sItem]}}" />
|
|
61
|
+
</block>
|
|
62
|
+
</view>
|
|
63
|
+
</block>
|
|
64
|
+
<block ty:else>
|
|
65
|
+
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
|
|
66
|
+
</block>
|
|
36
67
|
</block>
|
|
37
|
-
|
|
68
|
+
<%_ } else { -%>
|
|
69
|
+
<block ty:for="{{i.children}}" ty:key="*this">
|
|
38
70
|
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
|
|
39
71
|
</block>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<template is="{{'REMAX_TPL_' + i.nodes[item].type}}" data="{{i: i.nodes[item]}}" />
|
|
44
|
-
</block>
|
|
45
|
-
<%_ } -%>
|
|
46
|
-
</<%=id%>>
|
|
72
|
+
<%_ } -%>
|
|
73
|
+
</<%=id%>>
|
|
74
|
+
<% } %>
|
|
47
75
|
</template>
|