@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.
Files changed (48) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-ac3a63b0.js +851 -0
  3. package/dist/cjs/loader.cjs.js +6 -12
  4. package/dist/cjs/user-actions.cjs.entry.js +60 -46
  5. package/dist/cjs/user-actions.cjs.js +16 -10
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/user-actions/index.js +1 -0
  8. package/dist/collection/components/user-actions/user-actions.js +100 -86
  9. package/dist/collection/utils/utils.js +20 -12
  10. package/dist/esm/app-globals-0f993ce5.js +3 -0
  11. package/dist/esm/index-ab1e2c3f.js +826 -0
  12. package/dist/esm/loader.js +6 -12
  13. package/dist/esm/user-actions.entry.js +60 -46
  14. package/dist/esm/user-actions.js +13 -10
  15. package/dist/stencil.config.dev.js +17 -0
  16. package/dist/stencil.config.js +14 -19
  17. 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
  18. 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
  19. package/dist/types/components/user-actions/index.d.ts +1 -0
  20. package/dist/types/components/user-actions/user-actions.d.ts +9 -9
  21. package/dist/types/stencil-public-runtime.d.ts +142 -33
  22. package/dist/types/utils/utils.d.ts +20 -12
  23. package/dist/user-actions/p-307d13e2.js +2 -0
  24. package/dist/user-actions/p-e1255160.js +1 -0
  25. package/dist/user-actions/p-f2e74cc7.entry.js +1 -0
  26. package/dist/user-actions/user-actions.esm.js +1 -1
  27. package/loader/cdn.js +1 -3
  28. package/loader/index.cjs.js +1 -3
  29. package/loader/index.d.ts +13 -1
  30. package/loader/index.es2017.js +1 -3
  31. package/loader/index.js +1 -3
  32. package/loader/package.json +1 -0
  33. package/package.json +8 -1
  34. package/dist/cjs/index-46c0a1de.js +0 -791
  35. package/dist/components/index.d.ts +0 -26
  36. package/dist/components/index.js +0 -1
  37. package/dist/components/user-actions.d.ts +0 -11
  38. package/dist/components/user-actions.js +0 -79
  39. package/dist/esm/index-6c13c021.js +0 -767
  40. package/dist/esm/polyfills/core-js.js +0 -11
  41. package/dist/esm/polyfills/css-shim.js +0 -1
  42. package/dist/esm/polyfills/dom.js +0 -79
  43. package/dist/esm/polyfills/es5-html-element.js +0 -1
  44. package/dist/esm/polyfills/index.js +0 -34
  45. package/dist/esm/polyfills/system.js +0 -6
  46. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-actions/.stencil/packages/user-actions/stencil.config.d.ts +0 -2
  47. package/dist/user-actions/p-02573b9e.entry.js +0 -1
  48. package/dist/user-actions/p-d8d5dc61.js +0 -1
@@ -2,20 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-46c0a1de.js');
5
+ const index = require('./index-ac3a63b0.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
6
7
 
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(() => {
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,60 +2,74 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-46c0a1de.js');
5
+ const index = require('./index-ac3a63b0.js');
6
6
 
7
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
- },
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
+ }
20
28
  };
21
29
 
22
30
  const userActionsCss = ":host{display:block}";
31
+ const UserActionsStyle0 = userActionsCss;
23
32
 
24
33
  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();
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;
40
71
  }
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
72
  };
59
- UserActions.style = userActionsCss;
73
+ UserActions.style = UserActionsStyle0;
60
74
 
61
75
  exports.user_actions = UserActions;
@@ -1,19 +1,25 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-46c0a1de.js');
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 v2.15.2 | MIT Licensed | https://stenciljs.com
9
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
7
10
  */
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);
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
- "./components/user-actions/user-actions.js"
3
+ "components/user-actions/user-actions.js"
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "2.15.2",
8
- "typescriptVersion": "4.5.4"
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,90 +1,104 @@
1
- import { Component, Prop, State, Listen } from '@stencil/core';
2
- import { actionsMapping } from '../../utils/utils';
1
+ import { actionsMapping } from "../../utils/utils";
3
2
  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();
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 = [];
18
13
  }
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
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
+ }];
78
103
  }
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
104
  }
@@ -1,14 +1,22 @@
1
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
- },
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
+ }
14
22
  };
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };