@entur-partner/micro-frontend 2.1.0 → 2.1.3

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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.1.3](https://bitbucket.org/enturas/entur-partner-packages/compare/@entur-partner/micro-frontend@2.1.2...@entur-partner/micro-frontend@2.1.3) (2022-03-21)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **deps:** update all non-major dependencies ([5eb6d42](https://bitbucket.org/enturas/entur-partner-packages/commits/5eb6d425aa36092c207473a669aa7cec0e9ef0fd))
11
+
12
+ ## [2.1.2](https://bitbucket.org/enturas/entur-partner-packages/compare/@entur-partner/micro-frontend@2.1.1...@entur-partner/micro-frontend@2.1.2) (2022-03-09)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **deps:** update all non-major dependencies ([4533e34](https://bitbucket.org/enturas/entur-partner-packages/commits/4533e34e81006c6fd056f5ebca40a58c75d9caf9))
17
+ - **deps:** update entur packages ([22224c2](https://bitbucket.org/enturas/entur-partner-packages/commits/22224c223cd111224f5654ced91879a7c06d2fa1))
18
+
19
+ ## [2.1.1](https://bitbucket.org/enturas/entur-partner-packages/compare/@entur-partner/micro-frontend@2.1.0...@entur-partner/micro-frontend@2.1.1) (2022-02-10)
20
+
21
+ ### Bug Fixes
22
+
23
+ - update to Node 16. Also update various packages to make dts-cli and its dependencies work ([93468c8](https://bitbucket.org/enturas/entur-partner-packages/commits/93468c8190e8590143f274c468df23e786af4553))
24
+
6
25
  # [2.1.0](https://bitbucket.org/enturas/entur-partner-packages/compare/@entur-partner/micro-frontend@2.0.0...@entur-partner/micro-frontend@2.1.0) (2022-02-07)
7
26
 
8
27
  ### Bug Fixes
@@ -5,7 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  function _inheritsLoose(subClass, superClass) {
6
6
  subClass.prototype = Object.create(superClass.prototype);
7
7
  subClass.prototype.constructor = subClass;
8
- subClass.__proto__ = superClass;
8
+
9
+ _setPrototypeOf(subClass, superClass);
9
10
  }
10
11
 
11
12
  function _getPrototypeOf(o) {
@@ -30,7 +31,7 @@ function _isNativeReflectConstruct() {
30
31
  if (typeof Proxy === "function") return true;
31
32
 
32
33
  try {
33
- Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
34
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
34
35
  return true;
35
36
  } catch (e) {
36
37
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"micro-frontend.cjs.development.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","import { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n"],"names":["MOUNT_EVENT_TYPE","UNMOUNT_EVENT_TYPE","createMountEvent","detail","CustomEvent","createUnmountEvent","ROUTE_CHANGE_EVENT_TYPE","RouteChangeEvent","registerMicroFrontend","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAaaA,gBAAgB,GAAG;IACnBC,kBAAkB,GAAG;SAKlBC,iBAAiBC;AAC/B,SAAO,IAAIC,WAAJ,CAAkCJ,gBAAlC,EAAoD;AAAEG,IAAAA,MAAM,EAANA;AAAF,GAApD,CAAP;AACD;SAEeE,mBAAmBF;AACjC,SAAO,IAAIC,WAAJ,CAAoCH,kBAApC,EAAwD;AAAEE,IAAAA,MAAM,EAANA;AAAF,GAAxD,CAAP;AACD;IAEYG,uBAAuB,GAAG;IAS1BC,gBAAb;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA,iCAAsCH,WAAtC;;SClBgBI,sBAAsBC;MAC5BC,UAAoCD,OAApCC;MAASC,kBAA2BF,OAA3BE;MAAiBC,QAAUH,OAAVG;AAElCC,EAAAA,MAAM,CAACC,gBAAP,CAAwBd,gBAAxB,EAA2C,UAACe,KAAD;AACzC,QAAI,CAACA,KAAK,CAACZ,MAAN,CAAaa,EAAb,CAAgBC,UAAhB,CAA2BN,eAA3B,CAAL,EAAkD;AAChD;AACD;;AACDC,IAAAA,KAAK,CACHG,KAAK,CAACZ,MAAN,CAAae,UADV,EAEHH,KAAK,CAACZ,MAAN,CAAagB,OAFV,EAGHJ,KAAK,CAACZ,MAAN,CAAae,UAHV,CAAL;AAKD,GATD;AAWAL,EAAAA,MAAM,CAACC,gBAAP,CAAwBb,kBAAxB,EAA6C,UAACc,KAAD;AAC3C,QAAI,CAACA,KAAK,CAACZ,MAAN,CAAaa,EAAb,CAAgBC,UAAhB,CAA2BN,eAA3B,CAAL,EAAkD;AAChD;AACD;;AACDD,IAAAA,OAAO,CAACK,KAAK,CAACZ,MAAN,CAAae,UAAd,CAAP;AACD,GALD;AAMD;;;;;;;;;;"}
1
+ {"version":3,"file":"micro-frontend.cjs.development.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","/*global EventListener*/\nimport { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n"],"names":["MOUNT_EVENT_TYPE","UNMOUNT_EVENT_TYPE","createMountEvent","detail","CustomEvent","createUnmountEvent","ROUTE_CHANGE_EVENT_TYPE","RouteChangeEvent","registerMicroFrontend","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAMA,gBAAgB,GAAG,uBAAzB;AACA,IAAMC,kBAAkB,GAAG,yBAA3B;AAKD,SAAUC,gBAAV,CAA2BC,MAA3B,EAAmD;AACvD,EAAA,OAAO,IAAIC,WAAJ,CAAkCJ,gBAAlC,EAAoD;AAAEG,IAAAA,MAAM,EAANA,MAAAA;AAAF,GAApD,CAAP,CAAA;AACD,CAAA;AAEK,SAAUE,kBAAV,CAA6BF,MAA7B,EAAuD;AAC3D,EAAA,OAAO,IAAIC,WAAJ,CAAoCH,kBAApC,EAAwD;AAAEE,IAAAA,MAAM,EAANA,MAAAA;AAAF,GAAxD,CAAP,CAAA;AACD,CAAA;AAEM,IAAMG,uBAAuB,GAAG,oCAAhC;AASP,IAAaC,gBAAb,gBAAA,UAAA,YAAA,EAAA;AAAA,EAAA,cAAA,CAAA,gBAAA,EAAA,YAAA,CAAA,CAAA;;AAAA,EAAA,SAAA,gBAAA,GAAA;AAAA,IAAA,OAAA,YAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,IAAA,IAAA,CAAA;AAAA,GAAA;;AAAA,EAAA,OAAA,gBAAA,CAAA;AAAA,CAAA,eAAA,gBAAA,CAAsCH,WAAtC,CAAA;;ACjBM,SAAUI,qBAAV,CAAgCC,MAAhC,EAA8C;AAClD,EAAA,IAAQC,OAAR,GAA4CD,MAA5C,CAAQC,OAAR;AAAA,MAAiBC,eAAjB,GAA4CF,MAA5C,CAAiBE,eAAjB;AAAA,MAAkCC,KAAlC,GAA4CH,MAA5C,CAAkCG,KAAlC,CAAA;AAEAC,EAAAA,MAAM,CAACC,gBAAP,CAAwBd,gBAAxB,EAA2C,UAACe,KAAD,EAAsB;AAC/D,IAAI,IAAA,CAACA,KAAK,CAACZ,MAAN,CAAaa,EAAb,CAAgBC,UAAhB,CAA2BN,eAA3B,CAAL,EAAkD;AAChD,MAAA,OAAA;AACD,KAAA;;AACDC,IAAAA,KAAK,CACHG,KAAK,CAACZ,MAAN,CAAae,UADV,EAEHH,KAAK,CAACZ,MAAN,CAAagB,OAFV,EAGHJ,KAAK,CAACZ,MAAN,CAAae,UAHV,CAAL,CAAA;AAKD,GATD,CAAA,CAAA;AAWAL,EAAAA,MAAM,CAACC,gBAAP,CAAwBb,kBAAxB,EAA6C,UAACc,KAAD,EAAwB;AACnE,IAAI,IAAA,CAACA,KAAK,CAACZ,MAAN,CAAaa,EAAb,CAAgBC,UAAhB,CAA2BN,eAA3B,CAAL,EAAkD;AAChD,MAAA,OAAA;AACD,KAAA;;AACDD,IAAAA,OAAO,CAACK,KAAK,CAACZ,MAAN,CAAae,UAAd,CAAP,CAAA;AACD,GALD,CAAA,CAAA;AAMD;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";function t(e){return(t=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}function e(t,n){return(e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function r(t,o,u){return(r=n()?Reflect.construct:function(t,n,r){var o=[null];o.push.apply(o,n);var u=new(Function.bind.apply(t,o));return r&&e(u,r.prototype),u}).apply(null,arguments)}function o(n){var u="function"==typeof Map?new Map:void 0;return(o=function(n){if(null===n||-1===Function.toString.call(n).indexOf("[native code]"))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==u){if(u.has(n))return u.get(n);u.set(n,o)}function o(){return r(n,arguments,t(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),e(o,n)})(n)}Object.defineProperty(exports,"__esModule",{value:!0});var u=function(t){var e,n;function r(){return t.apply(this,arguments)||this}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r}(o(CustomEvent));exports.MOUNT_EVENT_TYPE="@entur-partner:mount",exports.ROUTE_CHANGE_EVENT_TYPE="@entur-partner:after-route-change",exports.RouteChangeEvent=u,exports.UNMOUNT_EVENT_TYPE="@entur-partner:unmount",exports.createMountEvent=function(t){return new CustomEvent("@entur-partner:mount",{detail:t})},exports.createUnmountEvent=function(t){return new CustomEvent("@entur-partner:unmount",{detail:t})},exports.registerMicroFrontend=function(t){var e=t.unmount,n=t.microFrontendId,r=t.mount;window.addEventListener("@entur-partner:mount",(function(t){t.detail.id.startsWith(n)&&r(t.detail.mountPoint,t.detail.payload,t.detail.mountPoint)})),window.addEventListener("@entur-partner:unmount",(function(t){t.detail.id.startsWith(n)&&e(t.detail.mountPoint)}))};
1
+ "use strict";function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t(e)}function e(t,n){return e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(t,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function r(t,o,u){return r=n()?Reflect.construct:function(t,n,r){var o=[null];o.push.apply(o,n);var u=new(Function.bind.apply(t,o));return r&&e(u,r.prototype),u},r.apply(null,arguments)}function o(n){var u="function"==typeof Map?new Map:void 0;return o=function(n){if(null===n||-1===Function.toString.call(n).indexOf("[native code]"))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==u){if(u.has(n))return u.get(n);u.set(n,o)}function o(){return r(n,arguments,t(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),e(o,n)},o(n)}Object.defineProperty(exports,"__esModule",{value:!0});var u=function(t){var n,r;function o(){return t.apply(this,arguments)||this}return r=t,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,e(n,r),o}(o(CustomEvent));exports.MOUNT_EVENT_TYPE="@entur-partner:mount",exports.ROUTE_CHANGE_EVENT_TYPE="@entur-partner:after-route-change",exports.RouteChangeEvent=u,exports.UNMOUNT_EVENT_TYPE="@entur-partner:unmount",exports.createMountEvent=function(t){return new CustomEvent("@entur-partner:mount",{detail:t})},exports.createUnmountEvent=function(t){return new CustomEvent("@entur-partner:unmount",{detail:t})},exports.registerMicroFrontend=function(t){var e=t.unmount,n=t.microFrontendId,r=t.mount;window.addEventListener("@entur-partner:mount",(function(t){t.detail.id.startsWith(n)&&r(t.detail.mountPoint,t.detail.payload,t.detail.mountPoint)})),window.addEventListener("@entur-partner:unmount",(function(t){t.detail.id.startsWith(n)&&e(t.detail.mountPoint)}))};
2
2
  //# sourceMappingURL=micro-frontend.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"micro-frontend.cjs.production.min.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","import { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n"],"names":["RouteChangeEvent","CustomEvent","detail","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload"],"mappings":"gsCAoCaA,2KAAyBC,uCAvBN,uDAcO,0FAbL,2DAKDC,UACxB,IAAID,YAPmB,uBAO6B,CAAEC,OAAAA,yCAG5BA,UAC1B,IAAID,YAVqB,yBAU+B,CAAEC,OAAAA,4CCN7BC,OAC5BC,EAAoCD,EAApCC,QAASC,EAA2BF,EAA3BE,gBAAiBC,EAAUH,EAAVG,MAElCC,OAAOC,iBDRuB,wBCQa,SAACC,GACrCA,EAAMP,OAAOQ,GAAGC,WAAWN,IAGhCC,EACEG,EAAMP,OAAOU,WACbH,EAAMP,OAAOW,QACbJ,EAAMP,OAAOU,eAIjBL,OAAOC,iBDlByB,0BCkBa,SAACC,GACvCA,EAAMP,OAAOQ,GAAGC,WAAWN,IAGhCD,EAAQK,EAAMP,OAAOU"}
1
+ {"version":3,"file":"micro-frontend.cjs.production.min.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","/*global EventListener*/\nimport { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n"],"names":["RouteChangeEvent","_CustomEvent","apply","this","arguments","_wrapNativeSuper","CustomEvent","detail","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload"],"mappings":"qsCA2BO,IASMA,EAAb,SAAAC,WAAA,SAAAD,IAAA,OAAAC,EAAAC,MAAAC,KAAAC,YAAAD,KAAA,SAAAF,KAAAD,yEAAAA,EAAA,CAAAK,EAAsCC,uCAvBN,uDAcO,0FAbL,kDAK5B,SAA2BC,GAC/B,OAAO,IAAID,YAPmB,uBAO6B,CAAEC,OAAAA,gCAGzD,SAA6BA,GACjC,OAAO,IAAID,YAVqB,yBAU+B,CAAEC,OAAAA,mCCL7D,SAAgCC,GACpC,IAAQC,EAAoCD,EAApCC,QAASC,EAA2BF,EAA3BE,gBAAiBC,EAAUH,EAAVG,MAElCC,OAAOC,iBDTuB,wBCSa,SAACC,GACrCA,EAAMP,OAAOQ,GAAGC,WAAWN,IAGhCC,EACEG,EAAMP,OAAOU,WACbH,EAAMP,OAAOW,QACbJ,EAAMP,OAAOU,eAIjBL,OAAOC,iBDnByB,0BCmBa,SAACC,GACvCA,EAAMP,OAAOQ,GAAGC,WAAWN,IAGhCD,EAAQK,EAAMP,OAAOU"}
@@ -1,7 +1,8 @@
1
1
  function _inheritsLoose(subClass, superClass) {
2
2
  subClass.prototype = Object.create(superClass.prototype);
3
3
  subClass.prototype.constructor = subClass;
4
- subClass.__proto__ = superClass;
4
+
5
+ _setPrototypeOf(subClass, superClass);
5
6
  }
6
7
 
7
8
  function _getPrototypeOf(o) {
@@ -26,7 +27,7 @@ function _isNativeReflectConstruct() {
26
27
  if (typeof Proxy === "function") return true;
27
28
 
28
29
  try {
29
- Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
30
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
30
31
  return true;
31
32
  } catch (e) {
32
33
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"micro-frontend.esm.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","import { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n"],"names":["MOUNT_EVENT_TYPE","UNMOUNT_EVENT_TYPE","createMountEvent","detail","CustomEvent","createUnmountEvent","ROUTE_CHANGE_EVENT_TYPE","RouteChangeEvent","registerMicroFrontend","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAaaA,gBAAgB,GAAG;IACnBC,kBAAkB,GAAG;SAKlBC,iBAAiBC;AAC/B,SAAO,IAAIC,WAAJ,CAAkCJ,gBAAlC,EAAoD;AAAEG,IAAAA,MAAM,EAANA;AAAF,GAApD,CAAP;AACD;SAEeE,mBAAmBF;AACjC,SAAO,IAAIC,WAAJ,CAAoCH,kBAApC,EAAwD;AAAEE,IAAAA,MAAM,EAANA;AAAF,GAAxD,CAAP;AACD;IAEYG,uBAAuB,GAAG;IAS1BC,gBAAb;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA,iCAAsCH,WAAtC;;SClBgBI,sBAAsBC;MAC5BC,UAAoCD,OAApCC;MAASC,kBAA2BF,OAA3BE;MAAiBC,QAAUH,OAAVG;AAElCC,EAAAA,MAAM,CAACC,gBAAP,CAAwBd,gBAAxB,EAA2C,UAACe,KAAD;AACzC,QAAI,CAACA,KAAK,CAACZ,MAAN,CAAaa,EAAb,CAAgBC,UAAhB,CAA2BN,eAA3B,CAAL,EAAkD;AAChD;AACD;;AACDC,IAAAA,KAAK,CACHG,KAAK,CAACZ,MAAN,CAAae,UADV,EAEHH,KAAK,CAACZ,MAAN,CAAagB,OAFV,EAGHJ,KAAK,CAACZ,MAAN,CAAae,UAHV,CAAL;AAKD,GATD;AAWAL,EAAAA,MAAM,CAACC,gBAAP,CAAwBb,kBAAxB,EAA6C,UAACc,KAAD;AAC3C,QAAI,CAACA,KAAK,CAACZ,MAAN,CAAaa,EAAb,CAAgBC,UAAhB,CAA2BN,eAA3B,CAAL,EAAkD;AAChD;AACD;;AACDD,IAAAA,OAAO,CAACK,KAAK,CAACZ,MAAN,CAAae,UAAd,CAAP;AACD,GALD;AAMD;;;;"}
1
+ {"version":3,"file":"micro-frontend.esm.js","sources":["../src/events.ts","../src/registerMicroFrontend.tsx"],"sourcesContent":["import { MicroFrontendPayload } from './Payload';\n\ntype MountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n payload: MicroFrontendPayload;\n};\n\ntype UnmountEventDetail = {\n id: string;\n mountPoint: HTMLDivElement;\n};\n\nexport const MOUNT_EVENT_TYPE = '@entur-partner:mount';\nexport const UNMOUNT_EVENT_TYPE = '@entur-partner:unmount';\n\nexport interface MountEvent extends CustomEvent<MountEventDetail> {}\nexport interface UnmountEvent extends CustomEvent<UnmountEventDetail> {}\n\nexport function createMountEvent(detail: MountEventDetail) {\n return new CustomEvent<MountEventDetail>(MOUNT_EVENT_TYPE, { detail });\n}\n\nexport function createUnmountEvent(detail: UnmountEventDetail) {\n return new CustomEvent<UnmountEventDetail>(UNMOUNT_EVENT_TYPE, { detail });\n}\n\nexport const ROUTE_CHANGE_EVENT_TYPE = '@entur-partner:after-route-change';\n\nexport type RouteAction = 'PUSH' | 'POP' | 'REPLACE';\n\ntype RouteChangeEventDetail = {\n location: Location;\n action: RouteAction;\n};\n\nexport class RouteChangeEvent extends CustomEvent<RouteChangeEventDetail> {}\n","/*global EventListener*/\nimport { MicroFrontendPayload } from './Payload';\nimport {\n MountEvent,\n UnmountEvent,\n MOUNT_EVENT_TYPE,\n UNMOUNT_EVENT_TYPE,\n} from './events';\n\ninterface Config {\n microFrontendId: string;\n mount: (\n mountPoint: HTMLDivElement,\n payload: MicroFrontendPayload,\n deprecatedMountPoint: HTMLDivElement\n ) => void;\n unmount: (mountPoint: HTMLDivElement) => void;\n}\n\nexport function registerMicroFrontend(config: Config): void {\n const { unmount, microFrontendId, mount } = config;\n\n window.addEventListener(MOUNT_EVENT_TYPE, ((event: MountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n mount(\n event.detail.mountPoint,\n event.detail.payload,\n event.detail.mountPoint\n );\n }) as EventListener);\n\n window.addEventListener(UNMOUNT_EVENT_TYPE, ((event: UnmountEvent) => {\n if (!event.detail.id.startsWith(microFrontendId)) {\n return;\n }\n unmount(event.detail.mountPoint);\n }) as EventListener);\n}\n"],"names":["MOUNT_EVENT_TYPE","UNMOUNT_EVENT_TYPE","createMountEvent","detail","CustomEvent","createUnmountEvent","ROUTE_CHANGE_EVENT_TYPE","RouteChangeEvent","registerMicroFrontend","config","unmount","microFrontendId","mount","window","addEventListener","event","id","startsWith","mountPoint","payload"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,IAAMA,gBAAgB,GAAG,uBAAzB;AACA,IAAMC,kBAAkB,GAAG,yBAA3B;AAKD,SAAUC,gBAAV,CAA2BC,MAA3B,EAAmD;AACvD,EAAA,OAAO,IAAIC,WAAJ,CAAkCJ,gBAAlC,EAAoD;AAAEG,IAAAA,MAAM,EAANA,MAAAA;AAAF,GAApD,CAAP,CAAA;AACD,CAAA;AAEK,SAAUE,kBAAV,CAA6BF,MAA7B,EAAuD;AAC3D,EAAA,OAAO,IAAIC,WAAJ,CAAoCH,kBAApC,EAAwD;AAAEE,IAAAA,MAAM,EAANA,MAAAA;AAAF,GAAxD,CAAP,CAAA;AACD,CAAA;AAEM,IAAMG,uBAAuB,GAAG,oCAAhC;AASP,IAAaC,gBAAb,gBAAA,UAAA,YAAA,EAAA;AAAA,EAAA,cAAA,CAAA,gBAAA,EAAA,YAAA,CAAA,CAAA;;AAAA,EAAA,SAAA,gBAAA,GAAA;AAAA,IAAA,OAAA,YAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,IAAA,IAAA,CAAA;AAAA,GAAA;;AAAA,EAAA,OAAA,gBAAA,CAAA;AAAA,CAAA,eAAA,gBAAA,CAAsCH,WAAtC,CAAA;;ACjBM,SAAUI,qBAAV,CAAgCC,MAAhC,EAA8C;AAClD,EAAA,IAAQC,OAAR,GAA4CD,MAA5C,CAAQC,OAAR;AAAA,MAAiBC,eAAjB,GAA4CF,MAA5C,CAAiBE,eAAjB;AAAA,MAAkCC,KAAlC,GAA4CH,MAA5C,CAAkCG,KAAlC,CAAA;AAEAC,EAAAA,MAAM,CAACC,gBAAP,CAAwBd,gBAAxB,EAA2C,UAACe,KAAD,EAAsB;AAC/D,IAAI,IAAA,CAACA,KAAK,CAACZ,MAAN,CAAaa,EAAb,CAAgBC,UAAhB,CAA2BN,eAA3B,CAAL,EAAkD;AAChD,MAAA,OAAA;AACD,KAAA;;AACDC,IAAAA,KAAK,CACHG,KAAK,CAACZ,MAAN,CAAae,UADV,EAEHH,KAAK,CAACZ,MAAN,CAAagB,OAFV,EAGHJ,KAAK,CAACZ,MAAN,CAAae,UAHV,CAAL,CAAA;AAKD,GATD,CAAA,CAAA;AAWAL,EAAAA,MAAM,CAACC,gBAAP,CAAwBb,kBAAxB,EAA6C,UAACc,KAAD,EAAwB;AACnE,IAAI,IAAA,CAACA,KAAK,CAACZ,MAAN,CAAaa,EAAb,CAAgBC,UAAhB,CAA2BN,eAA3B,CAAL,EAAkD;AAChD,MAAA,OAAA;AACD,KAAA;;AACDD,IAAAA,OAAO,CAACK,KAAK,CAACZ,MAAN,CAAae,UAAd,CAAP,CAAA;AACD,GALD,CAAA,CAAA;AAMD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur-partner/micro-frontend",
3
- "version": "2.1.0",
3
+ "version": "2.1.3",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/micro-frontend.esm.js",
@@ -17,18 +17,18 @@
17
17
  "access": "public"
18
18
  },
19
19
  "scripts": {
20
- "watch": "tsdx watch --noClean --verbose",
21
- "build": "tsdx build",
22
- "test": "tsdx test --env=jsdom --passWithNoTests",
23
- "lint": "tsdx lint"
20
+ "watch": "dts watch --noClean --verbose",
21
+ "build": "dts build",
22
+ "test": "dts test --env=jsdom --passWithNoTests",
23
+ "lint": "dts lint"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": ">=16.8.0",
27
27
  "react-dom": ">=16.8.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@auth0/auth0-spa-js": "1.13.6",
31
- "@entur-partner/permission-client-node": "1.1.3"
30
+ "@auth0/auth0-spa-js": "1.20.1",
31
+ "@entur-partner/permission-client-node": "1.3.4"
32
32
  },
33
33
  "jest": {
34
34
  "collectCoverageFrom": [
@@ -40,5 +40,5 @@
40
40
  "reportFile": "jest-sonar-report.xml",
41
41
  "indent": 4
42
42
  },
43
- "gitHead": "a762828a4ff18043452ca99795216925bf6a8936"
43
+ "gitHead": "04139cb859ace2671609060a8bba6980216f3f27"
44
44
  }