@yagolive/event-kit 1.0.7 → 1.0.9
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 +72 -0
- package/README.md +81 -2
- package/dist/js/action_bridge.umd.js +341 -3
- package/dist/js/action_creator.umd.js +285 -3
- package/package.json +1 -1
- package/src/bridge/ActionBridge.js +62 -0
- package/src/bridge/index.d.ts +16 -1
- package/src/core/ActionCreator.js +48 -0
- package/src/core/index.d.ts +100 -1
- package/src/core/index.js +3 -0
- package/src/core/types/Ask.js +28 -0
- package/src/core/types/GrantBenefits.js +86 -0
- package/src/core/types/Track.js +35 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +3 -0
package/src/core/index.js
CHANGED
|
@@ -6,8 +6,11 @@ export { default as Goback } from './types/Goback.js';
|
|
|
6
6
|
export { default as EnterRoom } from './types/EnterRoom.js';
|
|
7
7
|
export { default as LiveDetect } from './types/LiveDetect.js';
|
|
8
8
|
export { default as Onelink } from './types/Onelink.js';
|
|
9
|
+
export { default as Ask } from './types/Ask.js';
|
|
9
10
|
export { default as AgencyInvite } from './types/AgencyInvite.js';
|
|
10
11
|
export { default as Recharge } from './types/Recharge.js';
|
|
11
12
|
export { default as Close } from './types/Close.js';
|
|
12
13
|
export { default as Config } from './types/Config.js';
|
|
14
|
+
export { default as Track } from './types/Track.js';
|
|
15
|
+
export { default as GrantBenefits } from './types/GrantBenefits.js';
|
|
13
16
|
export { default as Action } from './types/Action.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
class Ask {
|
|
2
|
+
constructor(id) {
|
|
3
|
+
if (id == null) throw new Error('id cannot be null');
|
|
4
|
+
this.text = null;
|
|
5
|
+
this.id = id;
|
|
6
|
+
this.title = null;
|
|
7
|
+
this.message = null;
|
|
8
|
+
this.accepted = null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getText() { return this.text; } setText(text) { this.text = text; return this; }
|
|
12
|
+
getId() { return this.id; } setId(id) { this.id = id; return this; }
|
|
13
|
+
getTitle() { return this.title; } setTitle(title) { this.title = title; return this; }
|
|
14
|
+
getMessage() { return this.message; } setMessage(message) { this.message = message; return this; }
|
|
15
|
+
getAccepted() { return this.accepted; } setAccepted(accepted) { this.accepted = accepted; return this; }
|
|
16
|
+
|
|
17
|
+
toMap() {
|
|
18
|
+
const map = {};
|
|
19
|
+
if (this.text != null) map.text = this.text;
|
|
20
|
+
if (this.id != null) map.id = this.id;
|
|
21
|
+
if (this.title != null) map.title = this.title;
|
|
22
|
+
if (this.message != null) map.message = this.message;
|
|
23
|
+
if (this.accepted != null) map.accepted = this.accepted;
|
|
24
|
+
return map;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default Ask;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
class Theme {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.image = null;
|
|
4
|
+
this.tintColor = null;
|
|
5
|
+
this.buttonImage = null;
|
|
6
|
+
this.topInset = null;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
getImage() { return this.image; }
|
|
10
|
+
setImage(image) { this.image = image; return this; }
|
|
11
|
+
getTintColor() { return this.tintColor; }
|
|
12
|
+
setTintColor(tintColor) { this.tintColor = tintColor; return this; }
|
|
13
|
+
getButtonImage() { return this.buttonImage; }
|
|
14
|
+
setButtonImage(buttonImage) { this.buttonImage = buttonImage; return this; }
|
|
15
|
+
getTopInset() { return this.topInset; }
|
|
16
|
+
setTopInset(topInset) { this.topInset = topInset; return this; }
|
|
17
|
+
|
|
18
|
+
toMap() {
|
|
19
|
+
const map = {};
|
|
20
|
+
if (this.image != null) map.image = this.image;
|
|
21
|
+
if (this.tintColor != null) map.tintColor = this.tintColor;
|
|
22
|
+
if (this.buttonImage != null) map.buttonImage = this.buttonImage;
|
|
23
|
+
if (this.topInset != null) map.topInset = this.topInset;
|
|
24
|
+
return map;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class GrantBenefits {
|
|
29
|
+
constructor(benefits) {
|
|
30
|
+
this.text = null;
|
|
31
|
+
if (benefits == null) {
|
|
32
|
+
throw new Error('benefits cannot be null');
|
|
33
|
+
}
|
|
34
|
+
this.benefits = benefits;
|
|
35
|
+
this.title = null;
|
|
36
|
+
this.message = null;
|
|
37
|
+
this.okAction = null;
|
|
38
|
+
this.closeable = null;
|
|
39
|
+
this.duration = null;
|
|
40
|
+
this.theme = null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getText() { return this.text; }
|
|
44
|
+
setText(text) { this.text = text; return this; }
|
|
45
|
+
getBenefits() { return this.benefits; }
|
|
46
|
+
setBenefits(benefits) {
|
|
47
|
+
if (benefits == null) throw new Error('benefits cannot be null');
|
|
48
|
+
this.benefits = benefits;
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
getTitle() { return this.title; }
|
|
52
|
+
setTitle(title) { this.title = title; return this; }
|
|
53
|
+
getMessage() { return this.message; }
|
|
54
|
+
setMessage(message) { this.message = message; return this; }
|
|
55
|
+
getOkAction() { return this.okAction; }
|
|
56
|
+
setOkAction(okAction) { this.okAction = okAction; return this; }
|
|
57
|
+
getCloseable() { return this.closeable; }
|
|
58
|
+
setCloseable(closeable) { this.closeable = closeable; return this; }
|
|
59
|
+
getDuration() { return this.duration; }
|
|
60
|
+
setDuration(duration) { this.duration = duration; return this; }
|
|
61
|
+
getTheme() { return this.theme; }
|
|
62
|
+
setTheme(theme) { this.theme = theme; return this; }
|
|
63
|
+
|
|
64
|
+
toMap() {
|
|
65
|
+
const map = {};
|
|
66
|
+
if (this.text != null) map.text = this.text;
|
|
67
|
+
if (this.title != null) map.title = this.title;
|
|
68
|
+
if (this.message != null) map.message = this.message;
|
|
69
|
+
if (this.benefits != null) map.benefits = this.benefits;
|
|
70
|
+
if (this.okAction != null) {
|
|
71
|
+
if (typeof this.okAction.toMap === 'function') {
|
|
72
|
+
map.okAction = this.okAction.toMap();
|
|
73
|
+
} else {
|
|
74
|
+
map.okAction = this.okAction;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (this.closeable != null) map.closeable = this.closeable;
|
|
78
|
+
if (this.duration != null) map.duration = this.duration;
|
|
79
|
+
if (this.theme != null) map.theme = this.theme.toMap();
|
|
80
|
+
return map;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
GrantBenefits.Theme = Theme;
|
|
85
|
+
|
|
86
|
+
export default GrantBenefits;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
class Track {
|
|
2
|
+
constructor(name) {
|
|
3
|
+
this.text = null;
|
|
4
|
+
if (name == null) {
|
|
5
|
+
throw new Error('name cannot be null');
|
|
6
|
+
}
|
|
7
|
+
this.name = name;
|
|
8
|
+
this.params = null;
|
|
9
|
+
this.options = null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
getText() { return this.text; }
|
|
13
|
+
setText(text) { this.text = text; return this; }
|
|
14
|
+
getName() { return this.name; }
|
|
15
|
+
setName(name) {
|
|
16
|
+
if (name == null) throw new Error('name cannot be null');
|
|
17
|
+
this.name = name;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
getParams() { return this.params; }
|
|
21
|
+
setParams(params) { this.params = params != null ? params : null; return this; }
|
|
22
|
+
getOptions() { return this.options; }
|
|
23
|
+
setOptions(options) { this.options = options != null ? options : null; return this; }
|
|
24
|
+
|
|
25
|
+
toMap() {
|
|
26
|
+
const map = {};
|
|
27
|
+
if (this.text != null) map.text = this.text;
|
|
28
|
+
if (this.name != null) map.name = this.name;
|
|
29
|
+
if (this.params != null) map.params = this.params;
|
|
30
|
+
if (this.options != null) map.options = this.options;
|
|
31
|
+
return map;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default Track;
|
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ActionBridge } from './bridge/index.js';
|
|
2
|
-
export { ActionCreator, ActionData, ActionType, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge, Close, Config, Action } from './core/index.js';
|
|
2
|
+
export { ActionCreator, ActionData, ActionType, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, Ask, AgencyInvite, Recharge, Close, Config, Track, GrantBenefits, Action } from './core/index.js';
|
|
3
3
|
export { RNWebViewAdapter, MockAdapter, IActionAdapter, MockCall } from './adapters/index.js';
|
|
4
4
|
export { ActionBridgeProvider, useActionBridge } from './integrations/react/index.js';
|
package/src/index.js
CHANGED
|
@@ -8,8 +8,11 @@ export { Goback } from './core/index.js';
|
|
|
8
8
|
export { EnterRoom } from './core/index.js';
|
|
9
9
|
export { LiveDetect } from './core/index.js';
|
|
10
10
|
export { Onelink } from './core/index.js';
|
|
11
|
+
export { Ask } from './core/index.js';
|
|
11
12
|
export { AgencyInvite } from './core/index.js';
|
|
12
13
|
export { Recharge } from './core/index.js';
|
|
13
14
|
export { Close } from './core/index.js';
|
|
14
15
|
export { Config } from './core/index.js';
|
|
16
|
+
export { Track } from './core/index.js';
|
|
17
|
+
export { GrantBenefits } from './core/index.js';
|
|
15
18
|
export { Action } from './core/index.js';
|