@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
|
@@ -1,26 +0,0 @@
|
|
|
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';
|
package/dist/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,79 +0,0 @@
|
|
|
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 };
|