@everymatrix/user-actions 0.0.1
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/index-46c0a1de.js +791 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/user-actions.cjs.entry.js +61 -0
- package/dist/cjs/user-actions.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/user-actions/user-actions.css +3 -0
- package/dist/collection/components/user-actions/user-actions.js +90 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +14 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/user-actions.d.ts +11 -0
- package/dist/components/user-actions.js +79 -0
- package/dist/esm/index-6c13c021.js +767 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/user-actions.entry.js +57 -0
- package/dist/esm/user-actions.js +17 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-actions/.stencil/packages/user-actions/stencil.config.d.ts +2 -0
- package/dist/types/components/user-actions/user-actions.d.ts +11 -0
- package/dist/types/components.d.ts +41 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/utils.d.ts +14 -0
- package/dist/user-actions/index.esm.js +0 -0
- package/dist/user-actions/p-02573b9e.entry.js +1 -0
- package/dist/user-actions/p-d8d5dc61.js +1 -0
- package/dist/user-actions/user-actions.esm.js +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-46c0a1de.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
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(() => {
|
|
17
|
+
return index.bootstrapLazy([["user-actions.cjs",[[1,"user-actions",{"endpoint":[1],"userid":[1],"actionStack":[32]},[[8,"message","handleEvent"]]]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-46c0a1de.js');
|
|
6
|
+
|
|
7
|
+
const actionsMapping = {
|
|
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
|
+
};
|
|
21
|
+
|
|
22
|
+
const userActionsCss = ":host{display:block}";
|
|
23
|
+
|
|
24
|
+
const UserActions = class {
|
|
25
|
+
constructor(hostRef) {
|
|
26
|
+
index.registerInstance(this, hostRef);
|
|
27
|
+
this.actionStack = [];
|
|
28
|
+
this.emitCurrentActionEvent = () => {
|
|
29
|
+
window.postMessage({ type: actionsMapping[this.actionStack[0].action].emit });
|
|
30
|
+
};
|
|
31
|
+
this.shiftActionStack = () => {
|
|
32
|
+
this.actionStack = this.actionStack.slice(1);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
handleEvent(e) {
|
|
36
|
+
if (actionsMapping[this.actionStack[0].action].listen === e.data) {
|
|
37
|
+
this.shiftActionStack();
|
|
38
|
+
if (this.actionStack.length > 0)
|
|
39
|
+
this.emitCurrentActionEvent();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
fetchUserActions() {
|
|
43
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
|
|
44
|
+
return fetch(url.href)
|
|
45
|
+
.then((response) => response.json())
|
|
46
|
+
.then(data => {
|
|
47
|
+
this.actionStack = data.actions;
|
|
48
|
+
if (this.actionStack.length > 0)
|
|
49
|
+
this.emitCurrentActionEvent();
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
componentWillLoad() {
|
|
53
|
+
return this.fetchUserActions();
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
UserActions.style = userActionsCss;
|
|
60
|
+
|
|
61
|
+
exports.user_actions = UserActions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-46c0a1de.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
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));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["user-actions.cjs",[[1,"user-actions",{"endpoint":[1],"userid":[1],"actionStack":[32]},[[8,"message","handleEvent"]]]]]], options);
|
|
19
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Component, Prop, State, Listen } from '@stencil/core';
|
|
2
|
+
import { actionsMapping } from '../../utils/utils';
|
|
3
|
+
export class UserActions {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.actionStack = [];
|
|
6
|
+
this.emitCurrentActionEvent = () => {
|
|
7
|
+
window.postMessage({ type: actionsMapping[this.actionStack[0].action].emit });
|
|
8
|
+
};
|
|
9
|
+
this.shiftActionStack = () => {
|
|
10
|
+
this.actionStack = this.actionStack.slice(1);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
handleEvent(e) {
|
|
14
|
+
if (actionsMapping[this.actionStack[0].action].listen === e.data) {
|
|
15
|
+
this.shiftActionStack();
|
|
16
|
+
if (this.actionStack.length > 0)
|
|
17
|
+
this.emitCurrentActionEvent();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
fetchUserActions() {
|
|
21
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
|
|
22
|
+
return fetch(url.href)
|
|
23
|
+
.then((response) => response.json())
|
|
24
|
+
.then(data => {
|
|
25
|
+
this.actionStack = data.actions;
|
|
26
|
+
if (this.actionStack.length > 0)
|
|
27
|
+
this.emitCurrentActionEvent();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
componentWillLoad() {
|
|
31
|
+
return this.fetchUserActions();
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
static get is() { return "user-actions"; }
|
|
37
|
+
static get encapsulation() { return "shadow"; }
|
|
38
|
+
static get originalStyleUrls() { return {
|
|
39
|
+
"$": ["user-actions.scss"]
|
|
40
|
+
}; }
|
|
41
|
+
static get styleUrls() { return {
|
|
42
|
+
"$": ["user-actions.css"]
|
|
43
|
+
}; }
|
|
44
|
+
static get properties() { return {
|
|
45
|
+
"endpoint": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"mutable": false,
|
|
48
|
+
"complexType": {
|
|
49
|
+
"original": "string",
|
|
50
|
+
"resolved": "string",
|
|
51
|
+
"references": {}
|
|
52
|
+
},
|
|
53
|
+
"required": true,
|
|
54
|
+
"optional": false,
|
|
55
|
+
"docs": {
|
|
56
|
+
"tags": [],
|
|
57
|
+
"text": ""
|
|
58
|
+
},
|
|
59
|
+
"attribute": "endpoint",
|
|
60
|
+
"reflect": false
|
|
61
|
+
},
|
|
62
|
+
"userid": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"mutable": false,
|
|
65
|
+
"complexType": {
|
|
66
|
+
"original": "string",
|
|
67
|
+
"resolved": "string",
|
|
68
|
+
"references": {}
|
|
69
|
+
},
|
|
70
|
+
"required": true,
|
|
71
|
+
"optional": false,
|
|
72
|
+
"docs": {
|
|
73
|
+
"tags": [],
|
|
74
|
+
"text": ""
|
|
75
|
+
},
|
|
76
|
+
"attribute": "userid",
|
|
77
|
+
"reflect": false
|
|
78
|
+
}
|
|
79
|
+
}; }
|
|
80
|
+
static get states() { return {
|
|
81
|
+
"actionStack": {}
|
|
82
|
+
}; }
|
|
83
|
+
static get listeners() { return [{
|
|
84
|
+
"name": "message",
|
|
85
|
+
"method": "handleEvent",
|
|
86
|
+
"target": "window",
|
|
87
|
+
"capture": false,
|
|
88
|
+
"passive": false
|
|
89
|
+
}]; }
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const actionsMapping = {
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* UserActions custom elements */
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Used to manually set the base path where assets can be found.
|
|
7
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setAssetPath: (path: string) => void;
|
|
16
|
+
|
|
17
|
+
export interface SetPlatformOptions {
|
|
18
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
26
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface UserActions extends Components.UserActions, HTMLElement {}
|
|
4
|
+
export const UserActions: {
|
|
5
|
+
prototype: UserActions;
|
|
6
|
+
new (): UserActions;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const actionsMapping = {
|
|
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
|
+
};
|
|
17
|
+
|
|
18
|
+
const userActionsCss = ":host{display:block}";
|
|
19
|
+
|
|
20
|
+
const UserActions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.__registerHost();
|
|
24
|
+
this.__attachShadow();
|
|
25
|
+
this.actionStack = [];
|
|
26
|
+
this.emitCurrentActionEvent = () => {
|
|
27
|
+
window.postMessage({ type: actionsMapping[this.actionStack[0].action].emit });
|
|
28
|
+
};
|
|
29
|
+
this.shiftActionStack = () => {
|
|
30
|
+
this.actionStack = this.actionStack.slice(1);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
handleEvent(e) {
|
|
34
|
+
if (actionsMapping[this.actionStack[0].action].listen === e.data) {
|
|
35
|
+
this.shiftActionStack();
|
|
36
|
+
if (this.actionStack.length > 0)
|
|
37
|
+
this.emitCurrentActionEvent();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
fetchUserActions() {
|
|
41
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
|
|
42
|
+
return fetch(url.href)
|
|
43
|
+
.then((response) => response.json())
|
|
44
|
+
.then(data => {
|
|
45
|
+
this.actionStack = data.actions;
|
|
46
|
+
if (this.actionStack.length > 0)
|
|
47
|
+
this.emitCurrentActionEvent();
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
componentWillLoad() {
|
|
51
|
+
return this.fetchUserActions();
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
static get style() { return userActionsCss; }
|
|
57
|
+
}, [1, "user-actions", {
|
|
58
|
+
"endpoint": [1],
|
|
59
|
+
"userid": [1],
|
|
60
|
+
"actionStack": [32]
|
|
61
|
+
}, [[8, "message", "handleEvent"]]]);
|
|
62
|
+
function defineCustomElement$1() {
|
|
63
|
+
if (typeof customElements === "undefined") {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const components = ["user-actions"];
|
|
67
|
+
components.forEach(tagName => { switch (tagName) {
|
|
68
|
+
case "user-actions":
|
|
69
|
+
if (!customElements.get(tagName)) {
|
|
70
|
+
customElements.define(tagName, UserActions$1);
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
} });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const UserActions = UserActions$1;
|
|
77
|
+
const defineCustomElement = defineCustomElement$1;
|
|
78
|
+
|
|
79
|
+
export { UserActions, defineCustomElement };
|