@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.
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 -57
  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 -89
  9. package/dist/collection/utils/utils.js +20 -20
  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 -57
  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/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-actions/.stencil/packages/stencil/user-actions/stencil.config.d.ts +2 -0
  18. 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
  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 -20
  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 -90
  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-aebdbdbd.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,71 +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
- },
20
- "video-verification-popup": {
21
- "emit": "openKycVerificationModal",
22
- "listen": "closeKycVerificationModal"
23
- },
24
- "unverified-phone-number": {
25
- "emit": "openSmsVerificationModal",
26
- "listen": "closeSmsVerificationModal"
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
- constructor(hostRef) {
34
- index.registerInstance(this, hostRef);
35
- this.actionStack = [];
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
- }
43
- handleEvent(e) {
44
- var _a, _b;
45
- 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) {
46
- this.shiftActionStack();
47
- if (this.actionStack.length > 0)
48
- 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;
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 = userActionsCss;
73
+ UserActions.style = UserActionsStyle0;
71
74
 
72
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,93 +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
- 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
- fetchUserActions() {
22
- const url = new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);
23
- return fetch(url.href)
24
- .then((response) => response.json())
25
- .then(data => {
26
- // filtering necessary to prevent widget from throwing "cannot read properties of 'undefined'"
27
- // when the actions received are not part of actionsMapping
28
- this.actionStack = data.actions.filter(action => actionsMapping[action.action]);
29
- if (this.actionStack.length > 0)
30
- this.emitCurrentActionEvent();
31
- });
32
- }
33
- componentWillLoad() {
34
- return this.fetchUserActions();
35
- }
36
- render() {
37
- return;
38
- }
39
- static get is() { return "user-actions"; }
40
- static get encapsulation() { return "shadow"; }
41
- static get originalStyleUrls() { return {
42
- "$": ["user-actions.scss"]
43
- }; }
44
- static get styleUrls() { return {
45
- "$": ["user-actions.css"]
46
- }; }
47
- static get properties() { return {
48
- "endpoint": {
49
- "type": "string",
50
- "mutable": false,
51
- "complexType": {
52
- "original": "string",
53
- "resolved": "string",
54
- "references": {}
55
- },
56
- "required": true,
57
- "optional": false,
58
- "docs": {
59
- "tags": [],
60
- "text": ""
61
- },
62
- "attribute": "endpoint",
63
- "reflect": false
64
- },
65
- "userid": {
66
- "type": "string",
67
- "mutable": false,
68
- "complexType": {
69
- "original": "string",
70
- "resolved": "string",
71
- "references": {}
72
- },
73
- "required": true,
74
- "optional": false,
75
- "docs": {
76
- "tags": [],
77
- "text": ""
78
- },
79
- "attribute": "userid",
80
- "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
+ }];
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
- "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
- }
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
  };
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };