@everymatrix/user-actions 0.0.1 → 1.0.69
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 -46
- 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 -86
- package/dist/collection/utils/utils.js +20 -12
- 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 -46
- 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/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/user-actions/.stencil/packages/stencil/user-actions/stencil.config.d.ts +2 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/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 -12
- 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 -79
- 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-02573b9e.entry.js +0 -1
- package/dist/user-actions/p-d8d5dc61.js +0 -1
package/dist/esm/loader.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as bootstrapLazy } from './index-ab1e2c3f.js';
|
|
2
|
+
export { s as setNonce } from './index-ab1e2c3f.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const patchEsm = () => {
|
|
7
|
-
return promiseResolve();
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const defineCustomElements = (win, options) => {
|
|
11
|
-
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
|
-
return patchEsm().then(() => {
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await globalScripts();
|
|
13
8
|
return bootstrapLazy([["user-actions",[[1,"user-actions",{"endpoint":[1],"userid":[1],"actionStack":[32]},[[8,"message","handleEvent"]]]]]], options);
|
|
14
|
-
});
|
|
15
9
|
};
|
|
16
10
|
|
|
17
11
|
export { defineCustomElements };
|
|
@@ -1,57 +1,71 @@
|
|
|
1
|
-
import { r as registerInstance } from './index-
|
|
1
|
+
import { r as registerInstance } from './index-ab1e2c3f.js';
|
|
2
2
|
|
|
3
3
|
const actionsMapping = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
"verification-popup": {
|
|
5
|
+
"emit": "openKycVerificationModal",
|
|
6
|
+
"listen": "closeKycVerificationModal"
|
|
7
|
+
},
|
|
8
|
+
"get-temporary-account-consents": {
|
|
9
|
+
"emit": "openTemporaryConsentsModal",
|
|
10
|
+
"listen": "closeTemporaryConsentsModal"
|
|
11
|
+
},
|
|
12
|
+
"limits-popup": {
|
|
13
|
+
"emit": "openLugasPopup",
|
|
14
|
+
"listen": "closeLugasPopup"
|
|
15
|
+
},
|
|
16
|
+
"video-verification-popup": {
|
|
17
|
+
"emit": "openKycVerificationModal",
|
|
18
|
+
"listen": "closeKycVerificationModal"
|
|
19
|
+
},
|
|
20
|
+
"unverified-phone-number": {
|
|
21
|
+
"emit": "openSmsVerificationModal",
|
|
22
|
+
"listen": "closeSmsVerificationModal"
|
|
23
|
+
}
|
|
16
24
|
};
|
|
17
25
|
|
|
18
26
|
const userActionsCss = ":host{display:block}";
|
|
27
|
+
const UserActionsStyle0 = userActionsCss;
|
|
19
28
|
|
|
20
29
|
const UserActions = class {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.
|
|
30
|
+
constructor(hostRef) {
|
|
31
|
+
registerInstance(this, hostRef);
|
|
32
|
+
this.emitCurrentActionEvent = () => {
|
|
33
|
+
window.postMessage({ type: actionsMapping[this.actionStack[0].action].emit });
|
|
34
|
+
};
|
|
35
|
+
this.shiftActionStack = () => {
|
|
36
|
+
this.actionStack = this.actionStack.slice(1);
|
|
37
|
+
};
|
|
38
|
+
this.endpoint = undefined;
|
|
39
|
+
this.userid = undefined;
|
|
40
|
+
this.actionStack = [];
|
|
41
|
+
}
|
|
42
|
+
handleEvent(e) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
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) {
|
|
45
|
+
this.shiftActionStack();
|
|
46
|
+
if (this.actionStack.length > 0)
|
|
47
|
+
this.emitCurrentActionEvent();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
fetchUserActions() {
|
|
51
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
|
|
52
|
+
return fetch(url.href)
|
|
53
|
+
.then((response) => response.json())
|
|
54
|
+
.then(data => {
|
|
55
|
+
// filtering necessary to prevent widget from throwing "cannot read properties of 'undefined'"
|
|
56
|
+
// when the actions received are not part of actionsMapping
|
|
57
|
+
this.actionStack = data.actions.filter(action => actionsMapping[action.action]);
|
|
58
|
+
if (this.actionStack.length > 0)
|
|
59
|
+
this.emitCurrentActionEvent();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
componentWillLoad() {
|
|
63
|
+
return this.fetchUserActions();
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return;
|
|
36
67
|
}
|
|
37
|
-
}
|
|
38
|
-
fetchUserActions() {
|
|
39
|
-
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
|
|
40
|
-
return fetch(url.href)
|
|
41
|
-
.then((response) => response.json())
|
|
42
|
-
.then(data => {
|
|
43
|
-
this.actionStack = data.actions;
|
|
44
|
-
if (this.actionStack.length > 0)
|
|
45
|
-
this.emitCurrentActionEvent();
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
componentWillLoad() {
|
|
49
|
-
return this.fetchUserActions();
|
|
50
|
-
}
|
|
51
|
-
render() {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
68
|
};
|
|
55
|
-
UserActions.style =
|
|
69
|
+
UserActions.style = UserActionsStyle0;
|
|
56
70
|
|
|
57
71
|
export { UserActions as user_actions };
|
package/dist/esm/user-actions.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-ab1e2c3f.js';
|
|
2
|
+
export { s as setNonce } from './index-ab1e2c3f.js';
|
|
3
|
+
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
2
4
|
|
|
3
5
|
/*
|
|
4
|
-
Stencil Client Patch Browser
|
|
6
|
+
Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
|
|
5
7
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
var patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== "") {
|
|
12
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
13
15
|
};
|
|
14
16
|
|
|
15
|
-
patchBrowser().then(options => {
|
|
17
|
+
patchBrowser().then(async (options) => {
|
|
18
|
+
await globalScripts();
|
|
16
19
|
return bootstrapLazy([["user-actions",[[1,"user-actions",{"endpoint":[1],"userid":[1],"actionStack":[32]},[[8,"message","handleEvent"]]]]]], options);
|
|
17
20
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'user-actions',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: true,
|
|
6
|
+
minifyJs: false,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'www',
|
|
14
|
+
serviceWorker: null // disable service workers
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
package/dist/stencil.config.js
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import { sass } from
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
2
|
export const config = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
esmLoaderPath: '../loader',
|
|
3
|
+
namespace: 'user-actions',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
10
9
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
type: 'www',
|
|
19
|
-
serviceWorker: null, // disable service workers
|
|
20
|
-
},
|
|
21
|
-
],
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'dist',
|
|
14
|
+
esmLoaderPath: '../loader'
|
|
15
|
+
}
|
|
16
|
+
]
|
|
22
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UserActions } from './user-actions';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare class UserActions {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
endpoint: string;
|
|
3
|
+
userid: string;
|
|
4
|
+
private actionStack;
|
|
5
|
+
handleEvent(e: any): void;
|
|
6
|
+
fetchUserActions(): Promise<void>;
|
|
7
|
+
private emitCurrentActionEvent;
|
|
8
|
+
shiftActionStack: () => void;
|
|
9
|
+
componentWillLoad(): Promise<void>;
|
|
10
|
+
render(): void;
|
|
11
11
|
}
|