New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

single-spa-angular

Package Overview
Dependencies
Maintainers
14
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

single-spa-angular - npm Package Compare versions

Comparing version 4.6.0 to 4.7.0

bundles/single-spa-angular-parcel.umd.js

2

bundles/single-spa-angular-elements.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('single-spa-angular/internals')) :
typeof define === 'function' && define.amd ? define('single-spa-angular/elements', ['exports', 'single-spa-angular/internals'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['single-spa-angular'] = global['single-spa-angular'] || {}, global['single-spa-angular'].elements = {}), global['single-spa-angular'].internals));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['single-spa-angular'] = global['single-spa-angular'] || {}, global['single-spa-angular'].elements = {}), global['single-spa-angular-internals']));
}(this, (function (exports, internals) { 'use strict';

@@ -6,0 +6,0 @@

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("single-spa-angular/internals")):"function"==typeof define&&define.amd?define("single-spa-angular/elements",["exports","single-spa-angular/internals"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self)["single-spa-angular"]=e["single-spa-angular"]||{},e["single-spa-angular"].elements={}),e["single-spa-angular"].internals)}(this,(function(e,n){"use strict";
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("single-spa-angular/internals")):"function"==typeof define&&define.amd?define("single-spa-angular/elements",["exports","single-spa-angular/internals"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self)["single-spa-angular"]=e["single-spa-angular"]||{},e["single-spa-angular"].elements={}),e["single-spa-angular-internals"])}(this,(function(e,n){"use strict";
/*! *****************************************************************************

@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation.

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define('single-spa-angular/internals', ['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['single-spa-angular'] = global['single-spa-angular'] || {}, global['single-spa-angular'].internals = {})));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['single-spa-angular-internals'] = {}));
}(this, (function (exports) { 'use strict';

@@ -6,0 +6,0 @@

@@ -1,2 +0,2 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define("single-spa-angular/internals",["exports"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self)["single-spa-angular"]=e["single-spa-angular"]||{},e["single-spa-angular"].internals={}))}(this,(function(e){"use strict";function n(e){var n=e();if(!n)throw Error("domElementGetter did not return a valid dom element");return n}function t(e,n){var t,r;return(n=null!==(t=null==n?void 0:n.customProps)&&void 0!==t?t:n).domElement?function(){return n.domElement}:n.domElementGetter?n.domElementGetter:e.domElementGetter?e.domElementGetter:(r=n.name,function(){var e="single-spa-application:"+r,n=document.getElementById(e);return n||((n=document.createElement("div")).id=e,document.body.appendChild(n)),n})}e.getContainerElementAndSetTemplate=function(e,r){var o=t(e,r);if(!o)throw Error("Cannot mount angular application '"+(r.name||r.appName)+"' without a domElementGetter provided either as an opt or a prop");var i=n(o);return i.innerHTML=e.template,i},e.removeApplicationFromDOMIfIvyEnabled=function(e,r){if(function(){try{return!!require("@angular/core").ɵivyEnabled}catch(e){return!1}}())for(var o=n(t(e,r));o.firstChild;)o.removeChild(o.firstChild)},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("single-spa-angular/internals",["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["single-spa-angular-internals"]={})}(this,(function(e){"use strict";function t(e){var t=e();if(!t)throw Error("domElementGetter did not return a valid dom element");return t}function n(e,t){var n,r;return(t=null!==(n=null==t?void 0:t.customProps)&&void 0!==n?n:t).domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:(r=t.name,function(){var e="single-spa-application:"+r,t=document.getElementById(e);return t||((t=document.createElement("div")).id=e,document.body.appendChild(t)),t})}e.getContainerElementAndSetTemplate=function(e,r){var o=n(e,r);if(!o)throw Error("Cannot mount angular application '"+(r.name||r.appName)+"' without a domElementGetter provided either as an opt or a prop");var i=t(o);return i.innerHTML=e.template,i},e.removeApplicationFromDOMIfIvyEnabled=function(e,r){if(function(){try{return!!require("@angular/core").ɵivyEnabled}catch(e){return!1}}())for(var o=t(n(e,r));o.firstChild;)o.removeChild(o.firstChild)},Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=single-spa-angular-internals.umd.min.js.map
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('single-spa-angular/internals'), require('@angular/core'), require('@angular/common')) :
typeof define === 'function' && define.amd ? define('single-spa-angular', ['exports', 'single-spa-angular/internals', '@angular/core', '@angular/common'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['single-spa-angular'] = {}, global['single-spa-angular'].internals, global.ng.core, global.ng.common));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['single-spa-angular'] = {}, global['single-spa-angular-internals'], global.ng.core, global.ng.common));
}(this, (function (exports, internals, core, common) { 'use strict';

@@ -604,134 +604,2 @@

var ParcelComponent = /** @class */ (function () {
// eslint-disable-next-line @typescript-eslint/no-parameter-properties
function ParcelComponent(host) {
this.host = host;
this.onParcelMount = null;
this.wrapWith = 'div';
this.customProps = {};
this.appendTo = null;
this.handleError = function (error) { return console.error(error); };
this.createdDomElement = null;
this.hasError = false;
this.unmounted = true;
}
ParcelComponent.prototype.ngOnInit = function () {
var _this = this;
if (!this.config) {
throw new Error("single-spa-angular's Parcel component requires the [config] binding to either be a parcel config or a loading function that returns a promise. See https://github.com/CanopyTax/single-spa-angular");
}
this.addThingToDo('mount', function () {
var mountParcel = _this.mountParcel;
if (!mountParcel) {
throw new Error("\n\t\t\t\t <parcel> was not passed a [mountParcel] binding.\n\t\t\t\t If you are using <parcel> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <parcel> as a [mountParcel] binding\n\t\t\t\t");
}
var domElement;
if (_this.appendTo) {
_this.createdDomElement = domElement = document.createElement(_this.wrapWith);
_this.appendTo.appendChild(domElement);
}
else {
_this.createdDomElement = domElement = document.createElement(_this.wrapWith);
// Except of having `@ViewChild` we can simply get the first child element.
var parcelDiv = _this.host.nativeElement.children[0];
parcelDiv.appendChild(domElement);
}
_this.parcel = mountParcel(_this.config, Object.assign({ domElement: domElement }, _this.customProps));
if (_this.onParcelMount) {
_this.parcel.mountPromise.then(_this.onParcelMount);
}
_this.unmounted = false;
return _this.parcel.mountPromise;
});
};
ParcelComponent.prototype.ngOnChanges = function () {
var _this = this;
this.addThingToDo('update', function () {
if (_this.parcel && _this.parcel.update) {
return _this.parcel.update(_this.customProps);
}
});
};
ParcelComponent.prototype.ngOnDestroy = function () {
var _this = this;
this.addThingToDo('unmount', function () {
if (_this.parcel && _this.parcel.getStatus() === 'MOUNTED') {
return _this.parcel.unmount();
}
});
if (this.createdDomElement) {
this.createdDomElement.parentNode.removeChild(this.createdDomElement);
}
this.unmounted = true;
};
ParcelComponent.prototype.addThingToDo = function (action, thing) {
var _this = this;
if (this.hasError && action !== 'unmount') {
// In an error state, we don't do anything anymore except for unmounting
return;
}
this.nextThingToDo = (this.nextThingToDo || Promise.resolve())
.then(function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (_this.unmounted && action !== 'unmount') {
// Never do anything once the angular component unmounts
return;
}
return thing.apply(void 0, __spread(args));
})
.catch(function (error) {
_this.nextThingToDo = Promise.resolve(); // reset so we don't .then() the bad promise again
_this.hasError = true;
if (error && error.message) {
error.message = "During '" + action + "', parcel threw an error: " + error.message;
}
if (typeof _this.handleError === 'function') {
_this.handleError(error);
}
else {
setTimeout(function () {
throw error;
});
}
// No more things to do should be done -- the parcel is in an error state
throw error;
});
};
return ParcelComponent;
}());
ParcelComponent.decorators = [
{ type: core.Component, args: [{
selector: 'parcel',
template: '<div></div>'
},] }
];
ParcelComponent.ctorParameters = function () { return [
{ type: core.ElementRef }
]; };
ParcelComponent.propDecorators = {
config: [{ type: core.Input }],
mountParcel: [{ type: core.Input }],
onParcelMount: [{ type: core.Input }],
wrapWith: [{ type: core.Input }],
customProps: [{ type: core.Input }],
appendTo: [{ type: core.Input }],
handleError: [{ type: core.Input }]
};
var ParcelModule = /** @class */ (function () {
function ParcelModule() {
}
return ParcelModule;
}());
ParcelModule.decorators = [
{ type: core.NgModule, args: [{
declarations: [ParcelComponent],
exports: [ParcelComponent],
entryComponents: [ParcelComponent],
},] }
];
/**

@@ -745,4 +613,2 @@ * The public api for consumers of single-spa-angular

exports.ParcelComponent = ParcelComponent;
exports.ParcelModule = ParcelModule;
exports.getSingleSpaExtraProviders = getSingleSpaExtraProviders;

@@ -749,0 +615,0 @@ exports.singleSpaAngular = singleSpaAngular;

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("single-spa-angular/internals"),require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("single-spa-angular",["exports","single-spa-angular/internals","@angular/core","@angular/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["single-spa-angular"]={},t["single-spa-angular"].internals,t.ng.core,t.ng.common)}(this,(function(t,e,n,o){"use strict";
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("single-spa-angular/internals"),require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("single-spa-angular",["exports","single-spa-angular/internals","@angular/core","@angular/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["single-spa-angular"]={},t["single-spa-angular-internals"],t.ng.core,t.ng.common)}(this,(function(t,e,n,o){"use strict";
/*! *****************************************************************************

@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function s(t){try{u(o.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((o=o.apply(t,e||[])).next())}))}function a(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}Object.create;var l=function(t){function e(){var e=t.apply(this,p(arguments))||this;return e.skipNextPopState=!1,e.zoneToOnPopStateListenersMap=new Map,e.source=0,e}return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.destroyApplication=function(t){var e,n,o=p(this.zoneToOnPopStateListenersMap.keys()).find((function(e){return null!==e.getZoneWith(t)})),r=this.zoneToOnPopStateListenersMap.get(o);if(Array.isArray(r))try{for(var i=s(r),a=i.next();!a.done;a=i.next()){var u=a.value;window.removeEventListener("popstate",u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}this.zoneToOnPopStateListenersMap.delete(o)},e.prototype.pushState=function(e,n,o){this.skipNextPopState=!0,t.prototype.pushState.call(this,e,n,o)},e.prototype.replaceState=function(e,n,o){this.skipNextPopState=!0,t.prototype.replaceState.call(this,e,n,o)},e.prototype.onPopState=function(e){var n=this,o=Zone.current;e=o.wrap(e,""+this.source++);var r=function(t){var o=!!t.singleSpa;n.skipNextPopState&&o?n.skipNextPopState=!1:e(t)};this.storeOnPopStateListener(o,r),t.prototype.onPopState.call(this,r)},e.prototype.storeOnPopStateListener=function(t,e){var n=this.zoneToOnPopStateListenersMap.get(t)||[];n.push(e),this.zoneToOnPopStateListenersMap.has(t)||this.zoneToOnPopStateListenersMap.set(t,n)},e}(o.ɵBrowserPlatformLocation);l.decorators=[{type:n.Injectable}];var c={NgZone:null,bootstrapFunction:null,template:null,Router:void 0,domElementGetter:void 0,AnimationEngine:void 0,updateFunction:function(){return Promise.resolve()}};function f(t,e){return i(this,void 0,void 0,(function(){return a(this,(function(n){return"noop"===t.NgZone||(t.zoneIdentifier="single-spa-angular:"+(e.name||e.appName),t.NgZone.isInAngularZone=function(){return!0===window.Zone.current._properties[t.zoneIdentifier]},t.routingEventListener=function(){t.bootstrappedNgZone.run((function(){}))}),[2]}))}))}function d(t,n){return i(this,void 0,void 0,(function(){var o,r,i,s,u,p,c;return a(this,(function(a){switch(a.label){case 0:if(e.getContainerElementAndSetTemplate(t,n),!((o=t.bootstrapFunction(n))instanceof Promise))throw Error("single-spa-angular: the options.bootstrapFunction must return a promise, but instead returned a '"+typeof o+"' that is not a Promise");return[4,o];case 1:if(!(r=a.sent())||"function"!=typeof r.destroy)throw Error("single-spa-angular: the options.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?");if(i=r.injector.get(l,null),(s="noop"!==t.NgZone)&&t.Router&&null===i)throw new Error("\n single-spa-angular: could not retrieve extra providers from the platform injector. Did you call platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule()?\n ");return u=t,s&&(p=r.injector.get(t.NgZone),c=u.zoneIdentifier,null!==i&&(!function(t,e){if(!e.NavigationStart)return;var n=t.injector.get(e.Router),o=n.events.subscribe((function(t){if(t instanceof e.NavigationStart){var o=n.getCurrentNavigation();"imperative"!==o.trigger&&(o.extras.skipLocationChange=!0,o.extras.replaceUrl=!1)}}));t.onDestroy((function(){o.unsubscribe()}))}(r,t),r.onDestroy((function(){i.destroyApplication(c)}))),u.bootstrappedNgZone=p,u.bootstrappedNgZone._inner._properties[c]=!0,window.addEventListener("single-spa:routing-event",u.routingEventListener)),u.bootstrappedModule=r,[2,r]}}))}))}function h(t,n){return i(this,void 0,void 0,(function(){return a(this,(function(o){return t.Router&&t.bootstrappedModule.injector.get(t.Router).dispose(),t.routingEventListener&&window.removeEventListener("single-spa:routing-event",t.routingEventListener),t.AnimationEngine&&t.bootstrappedModule.injector.get(t.AnimationEngine)._transitionEngine.flush(),t.bootstrappedModule.destroy(),delete t.bootstrappedModule,e.removeApplicationFromDOMIfIvyEnabled(t,n),[2]}))}))}var g=function(){function t(t){this.host=t,this.onParcelMount=null,this.wrapWith="div",this.customProps={},this.appendTo=null,this.handleError=function(t){return console.error(t)},this.createdDomElement=null,this.hasError=!1,this.unmounted=!0}return t.prototype.ngOnInit=function(){var t=this;if(!this.config)throw new Error("single-spa-angular's Parcel component requires the [config] binding to either be a parcel config or a loading function that returns a promise. See https://github.com/CanopyTax/single-spa-angular");this.addThingToDo("mount",(function(){var e,n=t.mountParcel;if(!n)throw new Error("\n\t\t\t\t <parcel> was not passed a [mountParcel] binding.\n\t\t\t\t If you are using <parcel> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <parcel> as a [mountParcel] binding\n\t\t\t\t");t.appendTo?(t.createdDomElement=e=document.createElement(t.wrapWith),t.appendTo.appendChild(e)):(t.createdDomElement=e=document.createElement(t.wrapWith),t.host.nativeElement.children[0].appendChild(e));return t.parcel=n(t.config,Object.assign({domElement:e},t.customProps)),t.onParcelMount&&t.parcel.mountPromise.then(t.onParcelMount),t.unmounted=!1,t.parcel.mountPromise}))},t.prototype.ngOnChanges=function(){var t=this;this.addThingToDo("update",(function(){if(t.parcel&&t.parcel.update)return t.parcel.update(t.customProps)}))},t.prototype.ngOnDestroy=function(){var t=this;this.addThingToDo("unmount",(function(){if(t.parcel&&"MOUNTED"===t.parcel.getStatus())return t.parcel.unmount()})),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0},t.prototype.addThingToDo=function(t,e){var n=this;this.hasError&&"unmount"!==t||(this.nextThingToDo=(this.nextThingToDo||Promise.resolve()).then((function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];if(!n.unmounted||"unmount"===t)return e.apply(void 0,p(o))})).catch((function(e){throw n.nextThingToDo=Promise.resolve(),n.hasError=!0,e&&e.message&&(e.message="During '"+t+"', parcel threw an error: "+e.message),"function"==typeof n.handleError?n.handleError(e):setTimeout((function(){throw e})),e})))},t}();g.decorators=[{type:n.Component,args:[{selector:"parcel",template:"<div></div>"}]}],g.ctorParameters=function(){return[{type:n.ElementRef}]},g.propDecorators={config:[{type:n.Input}],mountParcel:[{type:n.Input}],onParcelMount:[{type:n.Input}],wrapWith:[{type:n.Input}],customProps:[{type:n.Input}],appendTo:[{type:n.Input}],handleError:[{type:n.Input}]};var m=function(){};m.decorators=[{type:n.NgModule,args:[{declarations:[g],exports:[g],entryComponents:[g]}]}],t.ParcelComponent=g,t.ParcelModule=m,t.getSingleSpaExtraProviders=function(){return[{provide:l,useClass:l,deps:[[new n.Inject(o.DOCUMENT)]]},{provide:o.PlatformLocation,useExisting:l}]},t.singleSpaAngular=function(t){if("object"!=typeof t)throw Error("single-spa-angular requires a configuration object");var e=Object.assign(Object.assign({},c),t);if("function"!=typeof e.bootstrapFunction)throw Error("single-spa-angular must be passed an options.bootstrapFunction");if("string"!=typeof e.template)throw Error("single-spa-angular must be passed options.template string");if(!e.NgZone)throw Error("single-spa-angular must be passed the NgZone option");return e.Router&&!e.NavigationStart&&console.warn("single-spa-angular must be passed the NavigationStart option"),{bootstrap:f.bind(null,e),mount:d.bind(null,e),unmount:h.bind(null,e),update:e.updateFunction}},t.ɵa=l,Object.defineProperty(t,"__esModule",{value:!0})}));
***************************************************************************** */var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{u(o.next(t))}catch(t){i(t)}}function s(t){try{u(o.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((o=o.apply(t,e||[])).next())}))}function a(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}Object.create;var l=function(t){function e(){var e=t.apply(this,p(arguments))||this;return e.skipNextPopState=!1,e.zoneToOnPopStateListenersMap=new Map,e.source=0,e}return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.destroyApplication=function(t){var e,n,o=p(this.zoneToOnPopStateListenersMap.keys()).find((function(e){return null!==e.getZoneWith(t)})),r=this.zoneToOnPopStateListenersMap.get(o);if(Array.isArray(r))try{for(var i=s(r),a=i.next();!a.done;a=i.next()){var u=a.value;window.removeEventListener("popstate",u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}this.zoneToOnPopStateListenersMap.delete(o)},e.prototype.pushState=function(e,n,o){this.skipNextPopState=!0,t.prototype.pushState.call(this,e,n,o)},e.prototype.replaceState=function(e,n,o){this.skipNextPopState=!0,t.prototype.replaceState.call(this,e,n,o)},e.prototype.onPopState=function(e){var n=this,o=Zone.current;e=o.wrap(e,""+this.source++);var r=function(t){var o=!!t.singleSpa;n.skipNextPopState&&o?n.skipNextPopState=!1:e(t)};this.storeOnPopStateListener(o,r),t.prototype.onPopState.call(this,r)},e.prototype.storeOnPopStateListener=function(t,e){var n=this.zoneToOnPopStateListenersMap.get(t)||[];n.push(e),this.zoneToOnPopStateListenersMap.has(t)||this.zoneToOnPopStateListenersMap.set(t,n)},e}(o.ɵBrowserPlatformLocation);l.decorators=[{type:n.Injectable}];var c={NgZone:null,bootstrapFunction:null,template:null,Router:void 0,domElementGetter:void 0,AnimationEngine:void 0,updateFunction:function(){return Promise.resolve()}};function f(t,e){return i(this,void 0,void 0,(function(){return a(this,(function(n){return"noop"===t.NgZone||(t.zoneIdentifier="single-spa-angular:"+(e.name||e.appName),t.NgZone.isInAngularZone=function(){return!0===window.Zone.current._properties[t.zoneIdentifier]},t.routingEventListener=function(){t.bootstrappedNgZone.run((function(){}))}),[2]}))}))}function d(t,n){return i(this,void 0,void 0,(function(){var o,r,i,s,u,p,c;return a(this,(function(a){switch(a.label){case 0:if(e.getContainerElementAndSetTemplate(t,n),!((o=t.bootstrapFunction(n))instanceof Promise))throw Error("single-spa-angular: the options.bootstrapFunction must return a promise, but instead returned a '"+typeof o+"' that is not a Promise");return[4,o];case 1:if(!(r=a.sent())||"function"!=typeof r.destroy)throw Error("single-spa-angular: the options.bootstrapFunction returned a promise that did not resolve with a valid Angular module. Did you call platformBrowserDynamic().bootstrapModule() correctly?");if(i=r.injector.get(l,null),(s="noop"!==t.NgZone)&&t.Router&&null===i)throw new Error("\n single-spa-angular: could not retrieve extra providers from the platform injector. Did you call platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule()?\n ");return u=t,s&&(p=r.injector.get(t.NgZone),c=u.zoneIdentifier,null!==i&&(!function(t,e){if(!e.NavigationStart)return;var n=t.injector.get(e.Router),o=n.events.subscribe((function(t){if(t instanceof e.NavigationStart){var o=n.getCurrentNavigation();"imperative"!==o.trigger&&(o.extras.skipLocationChange=!0,o.extras.replaceUrl=!1)}}));t.onDestroy((function(){o.unsubscribe()}))}(r,t),r.onDestroy((function(){i.destroyApplication(c)}))),u.bootstrappedNgZone=p,u.bootstrappedNgZone._inner._properties[c]=!0,window.addEventListener("single-spa:routing-event",u.routingEventListener)),u.bootstrappedModule=r,[2,r]}}))}))}function g(t,n){return i(this,void 0,void 0,(function(){return a(this,(function(o){return t.Router&&t.bootstrappedModule.injector.get(t.Router).dispose(),t.routingEventListener&&window.removeEventListener("single-spa:routing-event",t.routingEventListener),t.AnimationEngine&&t.bootstrappedModule.injector.get(t.AnimationEngine)._transitionEngine.flush(),t.bootstrappedModule.destroy(),delete t.bootstrappedModule,e.removeApplicationFromDOMIfIvyEnabled(t,n),[2]}))}))}t.getSingleSpaExtraProviders=function(){return[{provide:l,useClass:l,deps:[[new n.Inject(o.DOCUMENT)]]},{provide:o.PlatformLocation,useExisting:l}]},t.singleSpaAngular=function(t){if("object"!=typeof t)throw Error("single-spa-angular requires a configuration object");var e=Object.assign(Object.assign({},c),t);if("function"!=typeof e.bootstrapFunction)throw Error("single-spa-angular must be passed an options.bootstrapFunction");if("string"!=typeof e.template)throw Error("single-spa-angular must be passed options.template string");if(!e.NgZone)throw Error("single-spa-angular must be passed the NgZone option");return e.Router&&!e.NavigationStart&&console.warn("single-spa-angular must be passed the NavigationStart option"),{bootstrap:f.bind(null,e),mount:d.bind(null,e),unmount:g.bind(null,e),update:e.updateFunction}},t.ɵa=l,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=single-spa-angular.umd.min.js.map
export { singleSpaAngular } from './single-spa-angular';
export { getSingleSpaExtraProviders } from './extra-providers';
export { ParcelModule } from './parcel-lib/index';
export { ParcelComponent } from './parcel-lib/parcel.component';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIvVXNlcnMvam9lbGRlbm5pbmcvY29kZS9zaW5nbGUtc3BhLWFuZ3VsYXIvbGlicy9zaW5nbGUtc3BhLWFuZ3VsYXIvIiwic291cmNlcyI6WyJzcmMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN4RCxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUMvRCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDbEQsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLCtCQUErQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgc2luZ2xlU3BhQW5ndWxhciB9IGZyb20gJy4vc2luZ2xlLXNwYS1hbmd1bGFyJztcbmV4cG9ydCB7IGdldFNpbmdsZVNwYUV4dHJhUHJvdmlkZXJzIH0gZnJvbSAnLi9leHRyYS1wcm92aWRlcnMnO1xuZXhwb3J0IHsgUGFyY2VsTW9kdWxlIH0gZnJvbSAnLi9wYXJjZWwtbGliL2luZGV4JztcbmV4cG9ydCB7IFBhcmNlbENvbXBvbmVudCB9IGZyb20gJy4vcGFyY2VsLWxpYi9wYXJjZWwuY29tcG9uZW50JztcbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIvVXNlcnMvam9lbGRlbm5pbmcvY29kZS9zaW5nbGUtc3BhLWFuZ3VsYXIvbGlicy9zaW5nbGUtc3BhLWFuZ3VsYXIvIiwic291cmNlcyI6WyJzcmMvcHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUN4RCxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IHNpbmdsZVNwYUFuZ3VsYXIgfSBmcm9tICcuL3NpbmdsZS1zcGEtYW5ndWxhcic7XG5leHBvcnQgeyBnZXRTaW5nbGVTcGFFeHRyYVByb3ZpZGVycyB9IGZyb20gJy4vZXh0cmEtcHJvdmlkZXJzJztcbiJdfQ==
import { __awaiter } from 'tslib';
import { getContainerElementAndSetTemplate, removeApplicationFromDOMIfIvyEnabled } from 'single-spa-angular/internals';
import { Injectable, Inject, Component, ElementRef, Input, NgModule } from '@angular/core';
import { Injectable, Inject } from '@angular/core';
import { ɵBrowserPlatformLocation, DOCUMENT, PlatformLocation } from '@angular/common';

@@ -299,125 +299,2 @@

class ParcelComponent {
// eslint-disable-next-line @typescript-eslint/no-parameter-properties
constructor(host) {
this.host = host;
this.onParcelMount = null;
this.wrapWith = 'div';
this.customProps = {};
this.appendTo = null;
this.handleError = (error) => console.error(error);
this.createdDomElement = null;
this.hasError = false;
this.unmounted = true;
}
ngOnInit() {
if (!this.config) {
throw new Error(`single-spa-angular's Parcel component requires the [config] binding to either be a parcel config or a loading function that returns a promise. See https://github.com/CanopyTax/single-spa-angular`);
}
this.addThingToDo('mount', () => {
const mountParcel = this.mountParcel;
if (!mountParcel) {
throw new Error(`
<parcel> was not passed a [mountParcel] binding.
If you are using <parcel> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <parcel> as a [mountParcel] binding
`);
}
let domElement;
if (this.appendTo) {
this.createdDomElement = domElement = document.createElement(this.wrapWith);
this.appendTo.appendChild(domElement);
}
else {
this.createdDomElement = domElement = document.createElement(this.wrapWith);
// Except of having `@ViewChild` we can simply get the first child element.
const parcelDiv = this.host.nativeElement.children[0];
parcelDiv.appendChild(domElement);
}
this.parcel = mountParcel(this.config, Object.assign({ domElement }, this.customProps));
if (this.onParcelMount) {
this.parcel.mountPromise.then(this.onParcelMount);
}
this.unmounted = false;
return this.parcel.mountPromise;
});
}
ngOnChanges() {
this.addThingToDo('update', () => {
if (this.parcel && this.parcel.update) {
return this.parcel.update(this.customProps);
}
});
}
ngOnDestroy() {
this.addThingToDo('unmount', () => {
if (this.parcel && this.parcel.getStatus() === 'MOUNTED') {
return this.parcel.unmount();
}
});
if (this.createdDomElement) {
this.createdDomElement.parentNode.removeChild(this.createdDomElement);
}
this.unmounted = true;
}
addThingToDo(action, thing) {
if (this.hasError && action !== 'unmount') {
// In an error state, we don't do anything anymore except for unmounting
return;
}
this.nextThingToDo = (this.nextThingToDo || Promise.resolve())
.then((...args) => {
if (this.unmounted && action !== 'unmount') {
// Never do anything once the angular component unmounts
return;
}
return thing(...args);
})
.catch(error => {
this.nextThingToDo = Promise.resolve(); // reset so we don't .then() the bad promise again
this.hasError = true;
if (error && error.message) {
error.message = `During '${action}', parcel threw an error: ${error.message}`;
}
if (typeof this.handleError === 'function') {
this.handleError(error);
}
else {
setTimeout(() => {
throw error;
});
}
// No more things to do should be done -- the parcel is in an error state
throw error;
});
}
}
ParcelComponent.decorators = [
{ type: Component, args: [{
selector: 'parcel',
template: '<div></div>'
},] }
];
ParcelComponent.ctorParameters = () => [
{ type: ElementRef }
];
ParcelComponent.propDecorators = {
config: [{ type: Input }],
mountParcel: [{ type: Input }],
onParcelMount: [{ type: Input }],
wrapWith: [{ type: Input }],
customProps: [{ type: Input }],
appendTo: [{ type: Input }],
handleError: [{ type: Input }]
};
class ParcelModule {
}
ParcelModule.decorators = [
{ type: NgModule, args: [{
declarations: [ParcelComponent],
exports: [ParcelComponent],
entryComponents: [ParcelComponent],
},] }
];
/**

@@ -431,3 +308,3 @@ * The public api for consumers of single-spa-angular

export { ParcelComponent, ParcelModule, getSingleSpaExtraProviders, singleSpaAngular, SingleSpaPlatformLocation as ɵa };
export { getSingleSpaExtraProviders, singleSpaAngular, SingleSpaPlatformLocation as ɵa };
//# sourceMappingURL=single-spa-angular.js.map
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"name": "single-spa-angular",
"version": "4.6.0",
"version": "4.7.0",
"description": "Helpers for building single-spa applications which use Angular 2",

@@ -6,0 +6,0 @@ "schematics": "./schematics/schematics.json",

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"ɵa":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/common","name":"ɵBrowserPlatformLocation","line":13,"character":47},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"character":1}}],"members":{"destroyApplication":[{"__symbolic":"method"}],"pushState":[{"__symbolic":"method"}],"replaceState":[{"__symbolic":"method"}],"onPopState":[{"__symbolic":"method"}],"storeOnPopStateListener":[{"__symbolic":"method"}]}},"singleSpaAngular":{"__symbolic":"function"},"getSingleSpaExtraProviders":{"__symbolic":"function","parameters":[],"value":[{"provide":{"__symbolic":"reference","name":"ɵa"},"useClass":{"__symbolic":"reference","name":"ɵa"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":128,"character":18},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":128,"character":25}]}]]},{"provide":{"__symbolic":"reference","module":"@angular/common","name":"PlatformLocation","line":131,"character":15},"useExisting":{"__symbolic":"reference","name":"ɵa"}}]},"ParcelModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ParcelComponent"}],"exports":[{"__symbolic":"reference","name":"ParcelComponent"}],"entryComponents":[{"__symbolic":"reference","name":"ParcelComponent"}]}]}],"members":{}},"ParcelComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"parcel","template":"<div></div>"}]}],"members":{"config":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"mountParcel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"onParcelMount":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"wrapWith":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"customProps":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"appendTo":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"handleError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ElementRef","module":"@angular/core","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":39,"context":{"typeName":"HTMLElement"},"module":"./src/parcel-lib/parcel.component"}]}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"addThingToDo":[{"__symbolic":"method"}]}}},"origins":{"ɵa":"./src/extra-providers","singleSpaAngular":"./src/single-spa-angular","getSingleSpaExtraProviders":"./src/extra-providers","ParcelModule":"./src/parcel-lib/index","ParcelComponent":"./src/parcel-lib/parcel.component"},"importAs":"single-spa-angular"}
{"__symbolic":"module","version":4,"metadata":{"ɵa":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/common","name":"ɵBrowserPlatformLocation","line":13,"character":47},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"character":1}}],"members":{"destroyApplication":[{"__symbolic":"method"}],"pushState":[{"__symbolic":"method"}],"replaceState":[{"__symbolic":"method"}],"onPopState":[{"__symbolic":"method"}],"storeOnPopStateListener":[{"__symbolic":"method"}]}},"singleSpaAngular":{"__symbolic":"function"},"getSingleSpaExtraProviders":{"__symbolic":"function","parameters":[],"value":[{"provide":{"__symbolic":"reference","name":"ɵa"},"useClass":{"__symbolic":"reference","name":"ɵa"},"deps":[[{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":128,"character":18},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":128,"character":25}]}]]},{"provide":{"__symbolic":"reference","module":"@angular/common","name":"PlatformLocation","line":131,"character":15},"useExisting":{"__symbolic":"reference","name":"ɵa"}}]}},"origins":{"ɵa":"./src/extra-providers","singleSpaAngular":"./src/single-spa-angular","getSingleSpaExtraProviders":"./src/extra-providers"},"importAs":"single-spa-angular"}
export { singleSpaAngular } from './single-spa-angular';
export { getSingleSpaExtraProviders } from './extra-providers';
export { ParcelModule } from './parcel-lib/index';
export { ParcelComponent } from './parcel-lib/parcel.component';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc