@everymatrix/user-actions 1.43.2 → 1.43.4

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.
@@ -41,7 +41,8 @@ const UserActions = class {
41
41
  };
42
42
  }
43
43
  handleEvent(e) {
44
- if (actionsMapping[this.actionStack[0].action].listen === e.data.type) {
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) {
45
46
  this.shiftActionStack();
46
47
  if (this.actionStack.length > 0)
47
48
  this.emitCurrentActionEvent();
@@ -11,7 +11,8 @@ export class UserActions {
11
11
  };
12
12
  }
13
13
  handleEvent(e) {
14
- if (actionsMapping[this.actionStack[0].action].listen === e.data.type) {
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) {
15
16
  this.shiftActionStack();
16
17
  if (this.actionStack.length > 0)
17
18
  this.emitCurrentActionEvent();
@@ -39,7 +39,8 @@ const UserActions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
39
39
  };
40
40
  }
41
41
  handleEvent(e) {
42
- if (actionsMapping[this.actionStack[0].action].listen === e.data.type) {
42
+ var _a, _b;
43
+ 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) {
43
44
  this.shiftActionStack();
44
45
  if (this.actionStack.length > 0)
45
46
  this.emitCurrentActionEvent();
@@ -37,7 +37,8 @@ const UserActions = class {
37
37
  };
38
38
  }
39
39
  handleEvent(e) {
40
- if (actionsMapping[this.actionStack[0].action].listen === e.data.type) {
40
+ var _a, _b;
41
+ 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) {
41
42
  this.shiftActionStack();
42
43
  if (this.actionStack.length > 0)
43
44
  this.emitCurrentActionEvent();
@@ -0,0 +1 @@
1
+ import{r as i}from"./p-d8d5dc61.js";const o={"verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"get-temporary-account-consents":{emit:"openTemporaryConsentsModal",listen:"closeTemporaryConsentsModal"},"limits-popup":{emit:"openLugasPopup",listen:"closeLugasPopup"},"video-verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"unverified-phone-number":{emit:"openSmsVerificationModal",listen:"closeSmsVerificationModal"}},t=class{constructor(t){i(this,t),this.actionStack=[],this.emitCurrentActionEvent=()=>{window.postMessage({type:o[this.actionStack[0].action].emit})},this.shiftActionStack=()=>{this.actionStack=this.actionStack.slice(1)}}handleEvent(i){var t,e;(null===(e=o[null===(t=this.actionStack[0])||void 0===t?void 0:t.action])||void 0===e?void 0:e.listen)===i.data.type&&(this.shiftActionStack(),this.actionStack.length>0&&this.emitCurrentActionEvent())}fetchUserActions(){const i=new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);return fetch(i.href).then((i=>i.json())).then((i=>{this.actionStack=i.actions.filter((i=>o[i.action])),this.actionStack.length>0&&this.emitCurrentActionEvent()}))}componentWillLoad(){return this.fetchUserActions()}render(){}};t.style=":host{display:block}";export{t as user_actions}
@@ -1 +1 @@
1
- import{p as e,b as a}from"./p-d8d5dc61.js";(()=>{const a=import.meta.url,n={};return""!==a&&(n.resourcesUrl=new URL(".",a).href),e(n)})().then((e=>a([["p-121ae7fa",[[1,"user-actions",{endpoint:[1],userid:[1],actionStack:[32]},[[8,"message","handleEvent"]]]]]],e)));
1
+ import{p as e,b as d}from"./p-d8d5dc61.js";(()=>{const d=import.meta.url,n={};return""!==d&&(n.resourcesUrl=new URL(".",d).href),e(n)})().then((e=>d([["p-aebdbdbd",[[1,"user-actions",{endpoint:[1],userid:[1],actionStack:[32]},[[8,"message","handleEvent"]]]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-actions",
3
- "version": "1.43.2",
3
+ "version": "1.43.4",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as i}from"./p-d8d5dc61.js";const t={"verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"get-temporary-account-consents":{emit:"openTemporaryConsentsModal",listen:"closeTemporaryConsentsModal"},"limits-popup":{emit:"openLugasPopup",listen:"closeLugasPopup"},"video-verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"unverified-phone-number":{emit:"openSmsVerificationModal",listen:"closeSmsVerificationModal"}},o=class{constructor(o){i(this,o),this.actionStack=[],this.emitCurrentActionEvent=()=>{window.postMessage({type:t[this.actionStack[0].action].emit})},this.shiftActionStack=()=>{this.actionStack=this.actionStack.slice(1)}}handleEvent(i){t[this.actionStack[0].action].listen===i.data.type&&(this.shiftActionStack(),this.actionStack.length>0&&this.emitCurrentActionEvent())}fetchUserActions(){const i=new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);return fetch(i.href).then((i=>i.json())).then((i=>{this.actionStack=i.actions.filter((i=>t[i.action])),this.actionStack.length>0&&this.emitCurrentActionEvent()}))}componentWillLoad(){return this.fetchUserActions()}render(){}};o.style=":host{display:block}";export{o as user_actions}