@everymatrix/user-actions 1.44.0 → 1.45.2
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/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-ac3a63b0.js +851 -0
- package/dist/cjs/loader.cjs.js +6 -12
- package/dist/cjs/user-actions.cjs.entry.js +60 -57
- package/dist/cjs/user-actions.cjs.js +16 -10
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/user-actions/index.js +1 -0
- package/dist/collection/components/user-actions/user-actions.js +100 -89
- package/dist/collection/utils/utils.js +20 -20
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-ab1e2c3f.js +826 -0
- package/dist/esm/loader.js +6 -12
- package/dist/esm/user-actions.entry.js +60 -57
- package/dist/esm/user-actions.js +13 -10
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-actions/.stencil/packages/stencil/user-actions/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-actions/.stencil/packages/stencil/user-actions/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/user-actions/index.d.ts +1 -0
- package/dist/types/components/user-actions/user-actions.d.ts +9 -9
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/utils.d.ts +20 -20
- package/dist/user-actions/p-307d13e2.js +2 -0
- package/dist/user-actions/p-e1255160.js +1 -0
- package/dist/user-actions/p-f2e74cc7.entry.js +1 -0
- package/dist/user-actions/user-actions.esm.js +1 -1
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -1
- package/dist/cjs/index-46c0a1de.js +0 -791
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/user-actions.d.ts +0 -11
- package/dist/components/user-actions.js +0 -90
- package/dist/esm/index-6c13c021.js +0 -767
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-actions/.stencil/packages/user-actions/stencil.config.d.ts +0 -2
- package/dist/user-actions/p-aebdbdbd.entry.js +0 -1
- package/dist/user-actions/p-d8d5dc61.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,20 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-ac3a63b0.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const patchEsm = () => {
|
|
11
|
-
return index.promiseResolve();
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const defineCustomElements = (win, options) => {
|
|
15
|
-
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
-
return patchEsm().then(() => {
|
|
8
|
+
const defineCustomElements = async (win, options) => {
|
|
9
|
+
if (typeof window === 'undefined') return undefined;
|
|
10
|
+
await appGlobals.globalScripts();
|
|
17
11
|
return index.bootstrapLazy([["user-actions.cjs",[[1,"user-actions",{"endpoint":[1],"userid":[1],"actionStack":[32]},[[8,"message","handleEvent"]]]]]], options);
|
|
18
|
-
});
|
|
19
12
|
};
|
|
20
13
|
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
21
15
|
exports.defineCustomElements = defineCustomElements;
|
|
@@ -2,71 +2,74 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-ac3a63b0.js');
|
|
6
6
|
|
|
7
7
|
const actionsMapping = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
"verification-popup": {
|
|
9
|
+
"emit": "openKycVerificationModal",
|
|
10
|
+
"listen": "closeKycVerificationModal"
|
|
11
|
+
},
|
|
12
|
+
"get-temporary-account-consents": {
|
|
13
|
+
"emit": "openTemporaryConsentsModal",
|
|
14
|
+
"listen": "closeTemporaryConsentsModal"
|
|
15
|
+
},
|
|
16
|
+
"limits-popup": {
|
|
17
|
+
"emit": "openLugasPopup",
|
|
18
|
+
"listen": "closeLugasPopup"
|
|
19
|
+
},
|
|
20
|
+
"video-verification-popup": {
|
|
21
|
+
"emit": "openKycVerificationModal",
|
|
22
|
+
"listen": "closeKycVerificationModal"
|
|
23
|
+
},
|
|
24
|
+
"unverified-phone-number": {
|
|
25
|
+
"emit": "openSmsVerificationModal",
|
|
26
|
+
"listen": "closeSmsVerificationModal"
|
|
27
|
+
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const userActionsCss = ":host{display:block}";
|
|
31
|
+
const UserActionsStyle0 = userActionsCss;
|
|
31
32
|
|
|
32
33
|
const UserActions = class {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
constructor(hostRef) {
|
|
35
|
+
index.registerInstance(this, hostRef);
|
|
36
|
+
this.emitCurrentActionEvent = () => {
|
|
37
|
+
window.postMessage({ type: actionsMapping[this.actionStack[0].action].emit });
|
|
38
|
+
};
|
|
39
|
+
this.shiftActionStack = () => {
|
|
40
|
+
this.actionStack = this.actionStack.slice(1);
|
|
41
|
+
};
|
|
42
|
+
this.endpoint = undefined;
|
|
43
|
+
this.userid = undefined;
|
|
44
|
+
this.actionStack = [];
|
|
45
|
+
}
|
|
46
|
+
handleEvent(e) {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
if (((_b = actionsMapping[(_a = this.actionStack[0]) === null || _a === void 0 ? void 0 : _a.action]) === null || _b === void 0 ? void 0 : _b.listen) === e.data.type) {
|
|
49
|
+
this.shiftActionStack();
|
|
50
|
+
if (this.actionStack.length > 0)
|
|
51
|
+
this.emitCurrentActionEvent();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
fetchUserActions() {
|
|
55
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
|
|
56
|
+
return fetch(url.href)
|
|
57
|
+
.then((response) => response.json())
|
|
58
|
+
.then(data => {
|
|
59
|
+
// filtering necessary to prevent widget from throwing "cannot read properties of 'undefined'"
|
|
60
|
+
// when the actions received are not part of actionsMapping
|
|
61
|
+
this.actionStack = data.actions.filter(action => actionsMapping[action.action]);
|
|
62
|
+
if (this.actionStack.length > 0)
|
|
63
|
+
this.emitCurrentActionEvent();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
componentWillLoad() {
|
|
67
|
+
return this.fetchUserActions();
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
return;
|
|
49
71
|
}
|
|
50
|
-
}
|
|
51
|
-
fetchUserActions() {
|
|
52
|
-
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
|
|
53
|
-
return fetch(url.href)
|
|
54
|
-
.then((response) => response.json())
|
|
55
|
-
.then(data => {
|
|
56
|
-
// filtering necessary to prevent widget from throwing "cannot read properties of 'undefined'"
|
|
57
|
-
// when the actions received are not part of actionsMapping
|
|
58
|
-
this.actionStack = data.actions.filter(action => actionsMapping[action.action]);
|
|
59
|
-
if (this.actionStack.length > 0)
|
|
60
|
-
this.emitCurrentActionEvent();
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
componentWillLoad() {
|
|
64
|
-
return this.fetchUserActions();
|
|
65
|
-
}
|
|
66
|
-
render() {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
72
|
};
|
|
70
|
-
UserActions.style =
|
|
73
|
+
UserActions.style = UserActionsStyle0;
|
|
71
74
|
|
|
72
75
|
exports.user_actions = UserActions;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-ac3a63b0.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
4
7
|
|
|
5
8
|
/*
|
|
6
|
-
Stencil Client Patch Browser
|
|
9
|
+
Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var patchBrowser = () => {
|
|
12
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('user-actions.cjs.js', document.baseURI).href));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
15
18
|
};
|
|
16
19
|
|
|
17
|
-
patchBrowser().then(options => {
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
21
|
+
await appGlobals.globalScripts();
|
|
18
22
|
return index.bootstrapLazy([["user-actions.cjs",[[1,"user-actions",{"endpoint":[1],"userid":[1],"actionStack":[32]},[[8,"message","handleEvent"]]]]]], options);
|
|
19
23
|
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"
|
|
3
|
+
"components/user-actions/user-actions.js"
|
|
4
4
|
],
|
|
5
5
|
"compiler": {
|
|
6
6
|
"name": "@stencil/core",
|
|
7
|
-
"version": "
|
|
8
|
-
"typescriptVersion": "
|
|
7
|
+
"version": "4.20.0",
|
|
8
|
+
"typescriptVersion": "5.5.3"
|
|
9
9
|
},
|
|
10
10
|
"collections": [],
|
|
11
11
|
"bundles": []
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UserActions } from './user-actions';
|
|
@@ -1,93 +1,104 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { actionsMapping } from '../../utils/utils';
|
|
1
|
+
import { actionsMapping } from "../../utils/utils";
|
|
3
2
|
export class UserActions {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _a, _b;
|
|
15
|
-
if (((_b = actionsMapping[(_a = this.actionStack[0]) === null || _a === void 0 ? void 0 : _a.action]) === null || _b === void 0 ? void 0 : _b.listen) === e.data.type) {
|
|
16
|
-
this.shiftActionStack();
|
|
17
|
-
if (this.actionStack.length > 0)
|
|
18
|
-
this.emitCurrentActionEvent();
|
|
3
|
+
constructor() {
|
|
4
|
+
this.emitCurrentActionEvent = () => {
|
|
5
|
+
window.postMessage({ type: actionsMapping[this.actionStack[0].action].emit });
|
|
6
|
+
};
|
|
7
|
+
this.shiftActionStack = () => {
|
|
8
|
+
this.actionStack = this.actionStack.slice(1);
|
|
9
|
+
};
|
|
10
|
+
this.endpoint = undefined;
|
|
11
|
+
this.userid = undefined;
|
|
12
|
+
this.actionStack = [];
|
|
19
13
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
14
|
+
handleEvent(e) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
if (((_b = actionsMapping[(_a = this.actionStack[0]) === null || _a === void 0 ? void 0 : _a.action]) === null || _b === void 0 ? void 0 : _b.listen) === e.data.type) {
|
|
17
|
+
this.shiftActionStack();
|
|
18
|
+
if (this.actionStack.length > 0)
|
|
19
|
+
this.emitCurrentActionEvent();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
fetchUserActions() {
|
|
23
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
|
|
24
|
+
return fetch(url.href)
|
|
25
|
+
.then((response) => response.json())
|
|
26
|
+
.then(data => {
|
|
27
|
+
// filtering necessary to prevent widget from throwing "cannot read properties of 'undefined'"
|
|
28
|
+
// when the actions received are not part of actionsMapping
|
|
29
|
+
this.actionStack = data.actions.filter(action => actionsMapping[action.action]);
|
|
30
|
+
if (this.actionStack.length > 0)
|
|
31
|
+
this.emitCurrentActionEvent();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
return this.fetchUserActions();
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
static get is() { return "user-actions"; }
|
|
41
|
+
static get encapsulation() { return "shadow"; }
|
|
42
|
+
static get originalStyleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["user-actions.scss"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get styleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["user-actions.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get properties() {
|
|
53
|
+
return {
|
|
54
|
+
"endpoint": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "string",
|
|
59
|
+
"resolved": "string",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": true,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": ""
|
|
67
|
+
},
|
|
68
|
+
"attribute": "endpoint",
|
|
69
|
+
"reflect": false
|
|
70
|
+
},
|
|
71
|
+
"userid": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string",
|
|
76
|
+
"resolved": "string",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": true,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": ""
|
|
84
|
+
},
|
|
85
|
+
"attribute": "userid",
|
|
86
|
+
"reflect": false
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
static get states() {
|
|
91
|
+
return {
|
|
92
|
+
"actionStack": {}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
static get listeners() {
|
|
96
|
+
return [{
|
|
97
|
+
"name": "message",
|
|
98
|
+
"method": "handleEvent",
|
|
99
|
+
"target": "window",
|
|
100
|
+
"capture": false,
|
|
101
|
+
"passive": false
|
|
102
|
+
}];
|
|
81
103
|
}
|
|
82
|
-
}; }
|
|
83
|
-
static get states() { return {
|
|
84
|
-
"actionStack": {}
|
|
85
|
-
}; }
|
|
86
|
-
static get listeners() { return [{
|
|
87
|
-
"name": "message",
|
|
88
|
-
"method": "handleEvent",
|
|
89
|
-
"target": "window",
|
|
90
|
-
"capture": false,
|
|
91
|
-
"passive": false
|
|
92
|
-
}]; }
|
|
93
104
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export const actionsMapping = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
"verification-popup": {
|
|
3
|
+
"emit": "openKycVerificationModal",
|
|
4
|
+
"listen": "closeKycVerificationModal"
|
|
5
|
+
},
|
|
6
|
+
"get-temporary-account-consents": {
|
|
7
|
+
"emit": "openTemporaryConsentsModal",
|
|
8
|
+
"listen": "closeTemporaryConsentsModal"
|
|
9
|
+
},
|
|
10
|
+
"limits-popup": {
|
|
11
|
+
"emit": "openLugasPopup",
|
|
12
|
+
"listen": "closeLugasPopup"
|
|
13
|
+
},
|
|
14
|
+
"video-verification-popup": {
|
|
15
|
+
"emit": "openKycVerificationModal",
|
|
16
|
+
"listen": "closeKycVerificationModal"
|
|
17
|
+
},
|
|
18
|
+
"unverified-phone-number": {
|
|
19
|
+
"emit": "openSmsVerificationModal",
|
|
20
|
+
"listen": "closeSmsVerificationModal"
|
|
21
|
+
}
|
|
22
22
|
};
|