Socket
Socket
Sign inDemoInstall

@govflanders/vl-widget-core

Package Overview
Dependencies
Maintainers
13
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@govflanders/vl-widget-core - npm Package Compare versions

Comparing version 1.3.4 to 1.3.5

2

dist/index.esm.js

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

import t from"vue";import{Browser as e,Error as n,Utility as o,Environment as r}from"@govflanders/vl-widget-utility";import{ModulePluginContextProcessorDiscovery as i,PluginContextProcessorBase as u,installPluginContext as s,PluginContextPipelineBase as c,ModulePluginDiscovery as a,GenericPluginEvent as p,PluginManagerBase as f,PluginExtensionManagerBase as h,PluginBase as l,ExtensiblePluginBase as g,PluginError as d,PluginExtensionConstraint as v}from"@govflanders/vl-widget-plugin";import{injectable as m,DefaultServiceContainer as y}from"@govflanders/vl-widget-dependency-injection";import{DefaultEventEmitter as w}from"@govflanders/vl-widget-event";import{DefaultModuleManager as b}from"@govflanders/vl-widget-module";import{PluginStore as E}from"@govflanders/vl-widget-render-engine";var M,P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function R(t,e){function n(){this.constructor=t}P(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function C(t,e,n,o){var r,i=arguments.length,u=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(u=(i<3?r(u):i>3?r(e,n,u):r(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}function k(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function S(t,e,n,o){return new(n||(n=Promise))(function(r,i){function u(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(u,s)}c((o=o.apply(t,e||[])).next())})}function x(t,e){var n,o,r,i,u={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(;u;)try{if(n=1,o&&(r=o[2&i[0]?"return":i[0]?"throw":"next"])&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[0,r.value]),i[0]){case 0:case 1:r=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,o=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(r=(r=u.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){u.label=i[1];break}if(6===i[0]&&u.label<r[1]){u.label=r[1],r=i;break}if(r&&u.label<r[2]){u.label=r[2],u.ops.push(i);break}r[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}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])}}}!function(t){t.StyleSheet="stylesheet",t.Script="script"}(M||(M={}));var W=function(){function t(t,e){this.options=t,this.document=e}return t.prototype.getDocument=function(){return this.document},t.prototype.getMountElement=function(){return this.getDocument().head},t.prototype.getOptions=function(){return this.options},t.prototype.isMounted=function(){return!!this.element&&!!this.element.parentNode},t.prototype.mount=function(){return S(this,void 0,void 0,function(){var t=this;return x(this,function(o){return this.isMounted()?[2]:[2,this.createElement().then(function(o){return new Promise(function(r,i){t.element=o;var u=function t(){o.removeEventListener("load",t),o.removeEventListener("error",s),r()},s=function e(){o.removeEventListener("load",u),o.removeEventListener("error",e);var r=new n.RuntimeError("Asset "+t.getType()+" failed to resolve");t.unmount().then(function(){return i(r)}).catch(function(){return i(r)})};o.addEventListener("load",u),o.removeEventListener("error",s),e.DOM.mount(o,t.getMountElement()),t.getOptions().reference||u()})})]})})},t.prototype.unmount=function(){return S(this,void 0,void 0,function(){var t;return x(this,function(n){return this.isMounted()&&((t=this.element)&&e.DOM.unmount(t),this.element=void 0),[2]})})},t.prototype.remount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return[4,this.unmount()];case 1:return t.sent(),[4,this.mount()];case 2:return t.sent(),[2]}})})},t}(),H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return R(n,t),n.prototype.getMountElement=function(){return this.getDocument().body},n.prototype.createElement=function(){return S(this,void 0,void 0,function(){var t,n,o;return x(this,function(r){return t=this.getOptions(),n=this.getDocument(),o=n.createElement("script"),(t.attributes||[]).forEach(function(t){o.setAttribute(t.name,""+t.value)}),o.setAttribute("type",t.type||"text/javascript"),t.reference?o.setAttribute("src",t.value):e.DOM.mount(n.createTextNode(t.value),o),[2,o]})})},n.prototype.getType=function(){return M.Script},n}(W),A=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return R(n,t),n.prototype.createElement=function(){return S(this,void 0,void 0,function(){var t,n,o;return x(this,function(r){return t=this.getOptions(),n=this.getDocument(),o=n.createElement(t.reference?"link":"style"),(t.attributes||[]).forEach(function(t){o.setAttribute(t.name,""+t.value)}),o.setAttribute("type",t.type||"text/css"),t.reference?(o.setAttribute("rel","stylesheet"),o.setAttribute("href",t.value)):e.DOM.mount(n.createTextNode(t.value),o),[2,o]})})},n.prototype.getType=function(){return M.StyleSheet},n}(W),B=function(){function t(){this.mounted=!1,this.assets=[]}return t.prototype.has=function(t){return this.assets.findIndex(function(e){return e===t})>-1},t.prototype.add=function(t){for(var e=0,n=Array.isArray(t)?t:[t];e<n.length;e++){var o=n[e];this.has(o)||(this.assets.push(o),this.isMounted()&&o.mount())}return this},t.prototype.remove=function(t){for(var e=Array.isArray(t)?t:[t],n=function(t){var e=o.assets.findIndex(function(e){return e===t});e>-1&&(o.assets=o.assets.slice(e,1),t.unmount())},o=this,r=0,i=e;r<i.length;r++){n(i[r])}return this},t.prototype.list=function(t){return t?this.assets.filter(t):this.assets.concat()},t.prototype.isMounted=function(){return this.mounted},t.prototype.mount=function(t){return S(this,void 0,void 0,function(){var e;return x(this,function(n){switch(n.label){case 0:return this.mounted=!0,e=[],this.list(t).forEach(function(t){e.push(t.mount())}),[4,Promise.all(e)];case 1:return n.sent(),[2]}})})},t.prototype.unmount=function(t){return S(this,void 0,void 0,function(){var e;return x(this,function(n){switch(n.label){case 0:return e=[],this.list(t).forEach(function(t){e.push(t.mount())}),[4,Promise.all(e)];case 1:return n.sent(),this.mounted=!1,[2]}})})},t.prototype.remount=function(t){return S(this,void 0,void 0,function(){var e;return x(this,function(n){switch(n.label){case 0:return this.mounted=!0,e=[],this.list(t).forEach(function(t){e.push(t.remount())}),[4,Promise.all(e)];case 1:return n.sent(),[2]}})})},t}(),I=function(t){function e(e){var n=t.call(this)||this;return n.document=e,n}return R(e,t),e.prototype.getDocument=function(){return this.document},e.prototype.create=function(t,e){var o=this.getDocument();switch(t){case M.Script:return new H(e,o);case M.StyleSheet:return new A(e,o);default:throw new n.InvalidArgumentError('Asset type "'+t+'" is invalid')}},e}(B);function T(t){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var O,L=function(){function t(){}return t.prototype.getBoolean=function(t,e){var n=this.get(t,e);switch(T(n)){case"boolean":return n;case"string":return"true"===n;default:return!!n}},t.prototype.getString=function(t,e){var n=this.get(t,e);switch(T(n)){case"string":return n;default:return""+n}},t.prototype.getInteger=function(t,e){var n=this.get(t,e);switch(T(n)){case"number":return n;default:return parseInt(n,10)}},t.prototype.getFloat=function(t,e){var n=this.get(t,e);switch(T(n)){case"number":return n;default:return parseFloat(n)}},t}();!function(t){t.PluginContextProcessor="plugin.context.processor",t.PluginExtension="plugin.extension",t.Widget="widget"}(O||(O={}));var U,D="plugin.context.processor",F=function(t){function e(e,n){return t.call(this,e,n,D)||this}return R(e,t),e}(i),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getPluginExtensionContexts=function(t,e){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,t.extensions||[]]})})},e.prototype.onPostProcess=function(e,n){return S(this,void 0,void 0,function(){var o,r,i,u,s,c,a,p;return x(this,function(f){switch(f.label){case 0:return[4,t.prototype.onPostProcess.call(this,e,n)];case 1:return o=f.sent(),[4,this.getPluginExtensionContexts(o,n)];case 2:if(!((r=f.sent()).length>0))return[3,9];i=[],u=0,s=r,f.label=3;case 3:if(!(u<s.length))return[3,8];c=s[u],f.label=4;case 4:return f.trys.push([4,6,,7]),[4,n.process(c)];case 5:return a=f.sent(),i.push(a),[3,7];case 6:return p=f.sent(),console.error('Failed to perform plugin context post processing on "'+e.id+'": '+p.message),[3,7];case 7:return u++,[3,3];case 8:return o.extensions=i,[3,10];case 9:o.extensions=[],f.label=10;case 10:return[2,o]}})})},e}(u),$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e}(j),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e}(u),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e}(_),V=function(){function t(){}return t.prototype.createPluginContextProcessor=function(t){return S(this,void 0,void 0,function(){return x(this,function(t){return[2,new $]})})},t=C([m()],t)}(),Q=function(){function t(){}return t.prototype.createPluginContextProcessor=function(t){return S(this,void 0,void 0,function(){return x(this,function(t){return[2,new N]})})},t=C([m()],t)}(),z=function(t){function e(e,n){var o=t.call(this,n)||this;return o.moduleManager=e,o}return R(e,t),e.prototype.getModuleManager=function(){return this.moduleManager},e.prototype.process=function(e){return S(this,void 0,void 0,function(){var n,o;return x(this,function(r){switch(r.label){case 0:return n=this.getModuleManager(),[4,s(n,e)];case 1:return o=r.sent(),[2,t.prototype.process.call(this,o)]}})})},e=C([m(),k("design:paramtypes",[Object,Object])],e)}(c),q="widget.factory",G=function(t){function e(e){return t.call(this,e.getModuleManager(),e.getServiceContainer(),q)||this}return R(e,t),e}(a),J="plugin.extension.factory",K=function(t){function e(e){var n=e.getRuntime();return t.call(this,n.getModuleManager(),n.getServiceContainer(),J)||this}return R(e,t),e}(a),X=function(t){function e(e){return t.call(this,e,new G(e))||this}return R(e,t),e.prototype.createPluginInstance=function(e){return S(this,void 0,void 0,function(){var n;return x(this,function(o){switch(o.label){case 0:return[4,t.prototype.createPluginInstance.call(this,e)];case 1:return(n=o.sent()).getRuntime().emit(new p("vl.widget.created",n)),[2,n]}})})},e.prototype.mount=function(t){var e=this;return this.each(function(n){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return t&&!t(n)?[3,2]:[4,n.mount()];case 1:e.sent(),e.label=2;case 2:return[2,n]}})})})},e.prototype.unmount=function(t){var e=this;return this.each(function(n){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return t&&!t(n)?[3,2]:[4,n.unmount()];case 1:e.sent(),e.label=2;case 2:return[2,n]}})})})},e.prototype.remount=function(t){var e=this;return this.each(function(n){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return t&&!t(n)?[3,2]:[4,n.remount()];case 1:e.sent(),e.label=2;case 2:return[2,n]}})})})},e}(f),Y=function(t){function e(e){return t.call(this,e,new K(e))||this}return R(e,t),e}(h),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.onReady=function(){return S(this,void 0,void 0,function(){var e=this;return x(this,function(n){switch(n.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return n.sent(),this.addEventBroadcast(function(t){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,this.getPluginHost().emit(t.prefix(this.getPluginId()))];case 1:return e.sent(),[2]}})})}),this.getRuntime().getWidget().on("beforeMount",function(){return e.invokeHook("beforeMount")}).on("beforeUnmount",function(){return e.invokeHook("beforeUnmount")}).on("mounted",function(){return e.invokeHook("mounted")}).on("unmounted",function(){return e.invokeHook("unmounted")}),this.isMounted()?[4,this.invokeHook("beforeMount").then(function(){return e.invokeHook("mounted")})]:[3,3];case 2:return n.sent(),[3,5];case 3:return[4,this.invokeHook("beforeUnmount").then(function(){return e.invokeHook("unmounted")})];case 4:n.sent(),n.label=5;case 5:return[2]}})})},e.prototype.onBeforeMount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onMounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onBeforeUnmount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onUnmounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.isMounted=function(){return this.getRuntime().getWidget().isMounted()},e.prototype.createRuntime=function(){return new at(this)},e.prototype.getRuntime=function(){return void 0===this.pluginRuntime&&(this.pluginRuntime=this.createRuntime()),this.pluginRuntime},e}(l),tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getComponentRoot=function(){return void 0===this.componentRoot&&(this.componentRoot=this.createComponentRoot()),this.componentRoot},e.prototype.getComponentStore=function(){return void 0===this.componentStore&&(this.componentStore=this.createComponentStore()),this.componentStore},e.prototype.onReady=function(){return S(this,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return e.sent(),[4,this.attachComponentRoot()];case 2:return e.sent(),[2]}})})},e}(Z),et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.createExtensionManager=function(){return new Y(this)},e.prototype.onReady=function(){return S(this,void 0,void 0,function(){var e=this;return x(this,function(n){switch(n.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return n.sent(),this.addEventBroadcast(function(t){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,this.getPluginHost().emit(t.prefix(this.getPluginId()))];case 1:return e.sent(),[2]}})})}),this.getRuntime().getWidget().on("beforeMount",function(){return e.invokeHook("beforeMount")}).on("beforeUnmount",function(){return e.invokeHook("beforeUnmount")}).on("mounted",function(){return e.invokeHook("mounted")}).on("unmounted",function(){return e.invokeHook("unmounted")}),this.isMounted()?[4,this.invokeHook("beforeMount").then(function(){return e.invokeHook("mounted")})]:[3,3];case 2:return n.sent(),[3,5];case 3:return[4,this.invokeHook("beforeUnmount").then(function(){return e.invokeHook("unmounted")})];case 4:n.sent(),n.label=5;case 5:return[2]}})})},e.prototype.onBeforeMount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onMounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onBeforeUnmount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onUnmounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.isMounted=function(){return this.getRuntime().getWidget().isMounted()},e.prototype.createRuntime=function(){return new at(this)},e.prototype.getRuntime=function(){return void 0===this.pluginRuntime&&(this.pluginRuntime=this.createRuntime()),this.pluginRuntime},e}(g),nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getComponentRoot=function(){return void 0===this.componentRoot&&(this.componentRoot=this.createComponentRoot()),this.componentRoot},e.prototype.getComponentStore=function(){return void 0===this.componentStore&&(this.componentStore=this.createComponentStore()),this.componentStore},e.prototype.onReady=function(){return S(this,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return e.sent(),[4,this.attachComponentRoot()];case 2:return e.sent(),[2]}})})},e}(et),ot=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return R(o,t),o.prototype.onReady=function(){return S(this,void 0,void 0,function(){var e=this;return x(this,function(n){switch(n.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return n.sent(),this.addEventBroadcast(function(t){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,this.getPluginHost().emit(t.prefix("vl.widget."+this.getPluginTypeId()))];case 1:return e.sent(),[2]}})})}),[2]}})})},o.prototype.onBeforeMount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return[4,this.getAssetManager().mount()];case 1:return t.sent(),[2]}})})},o.prototype.onMounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},o.prototype.onBeforeUnmount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},o.prototype.onUnmounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return[4,this.getAssetManager().unmount()];case 1:return t.sent(),[2]}})})},o.prototype.validatePluginContext=function(e){if(t.prototype.validatePluginContext.call(this,e),"string"!=typeof e.id)throw new d(this,'Context property "id" should be a string');if(e.extensions&&!Array.isArray(e.extensions))throw new d(this,'Context property "extensions" should be an array')},o.prototype.resolveExtensionContexts=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){switch(t){case v.Optional:return[2,this.getPluginContext().extensions||[]];default:return[2,[]]}return[2]})})},o.prototype.createExtensionManager=function(){return new Y(this)},o.prototype.getComponentRoot=function(){return void 0===this.componentRoot&&(this.componentRoot=this.createComponentRoot()),this.componentRoot},o.prototype.getComponentStore=function(){return void 0===this.componentStore&&(this.componentStore=this.createComponentStore()),this.componentStore},o.prototype.createAssetManager=function(){if(this.getRuntime().getEnvironment()!==U.Browser)throw new n.RuntimeError("Asset manager requires a browser runtime");return new I(window.document)},o.prototype.getAssetManager=function(){return void 0===this.assetManager&&(this.assetManager=this.createAssetManager()),this.assetManager},o.prototype.getPluginId=function(){return this.getPluginContext().id},o.prototype.createRuntime=function(){return new ct(this)},o.prototype.getRuntime=function(){return void 0===this.widgetRuntime&&(this.widgetRuntime=this.createRuntime()),this.widgetRuntime},o.prototype.getElement=function(){var t=this.getComponentRoot(),e=t.$el||null;if(null===e&&(t.$mount(),e=t.$el||null),null===e)throw new d(this,"Cannot resolve widget element");return e},o.prototype.getCurrentMountElement=function(){return this.currentMountElement||null},o.prototype.getMountElement=function(){return this.mountElement||null},o.prototype.setMountElement=function(t){return t!==this.getMountElement()&&(this.mountElement=t||void 0),this},o.prototype.isMounted=function(){return null!==this.getCurrentMountElement()},o.prototype.mount=function(){return S(this,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:return t=this.getMountElement(),this.isMounted()||null===t?[3,3]:[4,this.invokeHook("beforeMount")];case 1:return n.sent(),this.currentMountElement=e.DOM.replaceWith(t,this.getElement()),this.getComponentRoot().$forceUpdate(),[4,this.invokeHook("mounted")];case 2:n.sent(),n.label=3;case 3:return[2]}})})},o.prototype.unmount=function(){return S(this,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:return t=this.getCurrentMountElement(),this.isMounted()&&null!==t?[4,this.invokeHook("beforeUnmount")]:[3,3];case 1:return n.sent(),e.DOM.replaceWith(this.getElement(),t),this.currentMountElement=void 0,[4,this.invokeHook("unmounted")];case 2:n.sent(),n.label=3;case 3:return[2]}})})},o.prototype.remount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return[4,this.unmount()];case 1:return t.sent(),[4,this.mount()];case 2:return t.sent(),[2]}})})},o}(g);function rt(t,e){if("string"!=typeof t.pluginTypeId||"function"!=typeof t.pluginContextProcessorFactory)throw new n.InvalidArgumentError("Plugin context processor registration should contain the following properties: pluginTypeId and pluginContextProcessorFactory");e.getServiceContainer().bind(D).to(t.pluginContextProcessorFactory).inSingletonScope().whenTargetNamed(t.pluginTypeId)}function it(t,e){if("string"!=typeof t.pluginTypeId||"function"!=typeof t.pluginFactory)throw new n.InvalidArgumentError("Plugin extension registration should contain the following properties: pluginTypeId and pluginFactory");e.getServiceContainer().bind(J).to(t.pluginFactory).inSingletonScope().whenTargetNamed(t.pluginTypeId)}function ut(t,e){if("string"!=typeof t.pluginTypeId||"function"!=typeof t.pluginFactory)throw new n.InvalidArgumentError("Widget registration should contain the following properties: pluginTypeId and pluginFactory");e.getServiceContainer().bind(q).to(t.pluginFactory).inSingletonScope().whenTargetNamed(t.pluginTypeId)}!function(t){t.Unknown="unknown",t.Browser="browser",t.WebWorker="webworker",t.Server="server"}(U||(U={}));var st=function(){function t(){}return t.prototype.createServiceContainer=function(){var t=new y;return t.bind("platform.runtime").toConstantValue(this),t.bind("plugin").toConstantValue(this.getPlugin()),t.bind("widget").toConstantValue(this.getWidget()),t},t.prototype.getServiceContainer=function(){return void 0===this.serviceContainer&&(this.serviceContainer=this.createServiceContainer(),this.linkServiceContainer(this.serviceContainer)),this.serviceContainer},t.prototype.getVersion=function(){return this.getWidget().getPluginHost().getVersion()},t.prototype.emit=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getWidget().getPluginHost().emit(t)]})})},t.prototype.on=function(t,e){return this.getWidget().getPluginHost().on(t,e),this},t.prototype.off=function(t,e){return this.getWidget().getPluginHost().off(t,e),this},t.prototype.once=function(t,e){return this.getWidget().getPluginHost().once(t,e),this},t.prototype.addEventListener=function(t,e){return this.getWidget().getPluginHost().addEventListener(t,e),this},t.prototype.removeEventListener=function(t,e){return this.getWidget().getPluginHost().removeEventListener(t,e),this},t.prototype.addEventBroadcast=function(t){return this.getWidget().getPluginHost().addEventBroadcast(t),this},t.prototype.removeEventBroadcast=function(t){return this.getWidget().getPluginHost().removeEventBroadcast(t),this},t.prototype.getEventBroadcast=function(){return this.getWidget().getPluginHost().getEventBroadcast()},t.prototype.getModuleManager=function(){return this.getWidget().getPluginHost().getModuleManager()},t.prototype.getWidgetManager=function(){return this.getWidget().getPluginHost().getWidgetManager()},t.prototype.capture=function(t,e){return this.getWidget().getPluginHost().capture(t,e)},t.prototype.getEnvironment=function(){return this.getWidget().getPluginHost().getEnvironment()},t.prototype.getConfiguration=function(){return this.getWidget().getPluginHost().getConfiguration()},t.prototype.bootstrap=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getWidget().getPluginHost().bootstrap(t)]})})},t.prototype.register=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getWidget().getPluginHost().register(t)]})})},t}(),ct=function(t){function e(e){var n=t.call(this)||this;return n.widget=e,n}return R(e,t),e.prototype.getPlugin=function(){return this.getWidget()},e.prototype.linkServiceContainer=function(t){t.parent=this.getWidget().getPluginHost().getServiceContainer()},e.prototype.getWidget=function(){return this.widget},e}(st),at=function(t){function e(e){var n=t.call(this)||this;return n.pluginExtension=e,n}return R(e,t),e.prototype.linkServiceContainer=function(t){t.parent=this.getWidget().getRuntime().getServiceContainer()},e.prototype.getPlugin=function(){return this.pluginExtension},e.prototype.getWidget=function(){return this.getPlugin().getPluginHost().getRuntime().getWidget()},e}(st),pt=function(){function t(t){this.moduleLoader=t,this.widgetCaptureQueue=[],this.initialize()}return t.prototype.initialize=function(){var t=this;this.on("vl.widget.created",function(e){return S(t,void 0,void 0,function(){var t=this;return x(this,function(n){return o.nextTick(function(){for(var n=e.getSender(),r=function(t){o.nextTick(function(){var e="function"==typeof t.filter?t.filter:null;(null===e||e(n))&&t.callback(n)})},i=0,u=t.widgetCaptureQueue;i<u.length;i++){r(u[i])}}),[2]})})})},t.prototype.createEventEmitter=function(){return new w},t.prototype.getEventEmitter=function(){return void 0===this.eventEmitter&&(this.eventEmitter=this.createEventEmitter()),this.eventEmitter},t.prototype.emit=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getEventEmitter().emit(t)]})})},t.prototype.on=function(t,e){return this.getEventEmitter().on(t,e),this},t.prototype.off=function(t,e){return this.getEventEmitter().off(t,e),this},t.prototype.once=function(t,e){return this.getEventEmitter().once(t,e),this},t.prototype.addEventListener=function(t,e){return this.getEventEmitter().addEventListener(t,e),this},t.prototype.removeEventListener=function(t,e){return this.getEventEmitter().removeEventListener(t,e),this},t.prototype.addEventBroadcast=function(t){return this.getEventEmitter().addEventBroadcast(t),this},t.prototype.removeEventBroadcast=function(t){return this.getEventEmitter().removeEventBroadcast(t),this},t.prototype.getEventBroadcast=function(){return this.getEventEmitter().getEventBroadcast()},t.prototype.createModuleManager=function(t){return new b(t,this)},t.prototype.getModuleManager=function(){return void 0===this.moduleManager&&(this.moduleManager=this.createModuleManager(this.moduleLoader)),this.moduleManager},t.prototype.createServiceContainer=function(){return new y},t.prototype.getServiceContainer=function(){return void 0===this.serviceContainer&&(this.serviceContainer=this.createServiceContainer()),this.serviceContainer},t.prototype.createWidgetManager=function(){return new X(this)},t.prototype.getWidgetManager=function(){return void 0===this.widgetManager&&(this.widgetManager=this.createWidgetManager()),this.widgetManager},t.prototype.bootstrap=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getWidgetManager().createPluginInstance(t)]})})},t.prototype.capture=function(t,e){var n=this;o.nextTick(function(){n.widgetCaptureQueue.push({callback:t,filter:e});for(var o=0,r=n.getWidgetManager().list(e);o<r.length;o++){var i=r[o];t(i)}})},t.prototype.getEnvironment=function(){return r.isBrowser()?U.Browser:r.isWebWorker()?U.WebWorker:r.isServer()?U.Server:U.Unknown},t.prototype.register=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){switch(t.type){case O.PluginContextProcessor:rt(t,this);break;case O.PluginExtension:it(t,this);break;case O.Widget:ut(t,this);break;default:throw new n.InvalidArgumentError('Registration type "'+t.type+'" is invalid')}return[2]})})},t}(),ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.$widget=function(){var t=this.$plugin().getRuntime();if("function"!=typeof t.getWidget)throw new n.RuntimeError("Plugin does not have a valid widget runtime");return t.getWidget()},e}(E);t.use({install:function(t){t.mixin({beforeCreate:function(){var t=this;void 0===this.$widget&&(this.$widget=function(){var e=t.$plugin().getRuntime();if("function"!=typeof e.getWidget)throw new n.RuntimeError("Plugin does not have a valid widget runtime");return e.getWidget()})}})}});export{W as AssetBase,B as AssetManagerBase,M as AssetType,I as DefaultAssetManager,z as DefaultPluginContextPipeline,F as DefaultPluginContextProcessorDiscovery,N as DefaultPluginExtensionContextProcessor,Q as DefaultPluginExtensionContextProcessorFactory,K as DefaultPluginExtensionDiscovery,Y as DefaultPluginExtensionManager,H as DefaultScriptAsset,A as DefaultStyleSheetAsset,$ as DefaultWidgetContextProcessor,V as DefaultWidgetContextProcessorFactory,G as DefaultWidgetDiscovery,X as DefaultWidgetManager,ct as DefaultWidgetRuntime,et as ExtensiblePluginExtensionBase,nt as ExtensibleUIPluginExtensionBase,D as PLUGIN_CONTEXT_PROCESSOR_SERVICE,J as PLUGIN_EXTENSION_FACTORY_SERVICE,O as PlatformRegistrationType,pt as PlatformRuntimeBase,L as PlatformRuntimeConfigBase,U as PlatformRuntimeEnvironment,Z as PluginExtensionBase,_ as PluginExtensionContextProcessorBase,at as PluginExtensionWidgetRuntime,ft as PluginStore,tt as UIPluginExtensionBase,q as WIDGET_FACTORY_SERVICE,ot as WidgetBase,j as WidgetContextProcessorBase,st as WidgetRuntimeBase,rt as registerPluginContextProcessor,it as registerPluginExtension,ut as registerWidget};
import t from"vue";import{Browser as e,Error as n,Utility as o,Environment as r}from"@govflanders/vl-widget-utility";import{ModulePluginContextProcessorDiscovery as i,PluginContextProcessorBase as u,PluginContextPipelineBase as s,installPluginContext as c,ModulePluginDiscovery as a,PluginManagerBase as p,PluginExtensionManagerBase as f,GenericPluginEvent as h,PluginBase as l,ExtensiblePluginBase as g,PluginError as d,PluginExtensionConstraint as v}from"@govflanders/vl-widget-plugin";import{injectable as m,DefaultServiceContainer as y}from"@govflanders/vl-widget-dependency-injection";import{DefaultEventEmitter as w}from"@govflanders/vl-widget-event";import{DefaultModuleManager as b}from"@govflanders/vl-widget-module";import{PluginStore as E}from"@govflanders/vl-widget-render-engine";var M,P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function R(t,e){function n(){this.constructor=t}P(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function C(t,e,n,o){var r,i=arguments.length,u=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(u=(i<3?r(u):i>3?r(e,n,u):r(e,n))||u);return i>3&&u&&Object.defineProperty(e,n,u),u}function k(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function S(t,e,n,o){return new(n||(n=Promise))(function(r,i){function u(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(u,s)}c((o=o.apply(t,e||[])).next())})}function x(t,e){var n,o,r,i,u={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(;u;)try{if(n=1,o&&(r=o[2&i[0]?"return":i[0]?"throw":"next"])&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[0,r.value]),i[0]){case 0:case 1:r=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,o=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(r=(r=u.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){u.label=i[1];break}if(6===i[0]&&u.label<r[1]){u.label=r[1],r=i;break}if(r&&u.label<r[2]){u.label=r[2],u.ops.push(i);break}r[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}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])}}}!function(t){t.StyleSheet="stylesheet",t.Script="script"}(M||(M={}));var W=function(){function t(t,e){this.options=t,this.document=e}return t.prototype.getDocument=function(){return this.document},t.prototype.getMountElement=function(){return this.getDocument().head},t.prototype.getOptions=function(){return this.options},t.prototype.isMounted=function(){return!!this.element&&!!this.element.parentNode},t.prototype.mount=function(){return S(this,void 0,void 0,function(){var t=this;return x(this,function(o){return this.isMounted()?[2]:[2,this.createElement().then(function(o){return new Promise(function(r,i){t.element=o;var u=function t(){o.removeEventListener("load",t),o.removeEventListener("error",s),r()},s=function e(){o.removeEventListener("load",u),o.removeEventListener("error",e);var r=new n.RuntimeError("Asset "+t.getType()+" failed to resolve");t.unmount().then(function(){return i(r)}).catch(function(){return i(r)})};o.addEventListener("load",u),o.removeEventListener("error",s),e.DOM.mount(o,t.getMountElement()),t.getOptions().reference||u()})})]})})},t.prototype.unmount=function(){return S(this,void 0,void 0,function(){var t;return x(this,function(n){return this.isMounted()&&((t=this.element)&&e.DOM.unmount(t),this.element=void 0),[2]})})},t.prototype.remount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return[4,this.unmount()];case 1:return t.sent(),[4,this.mount()];case 2:return t.sent(),[2]}})})},t}(),H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return R(n,t),n.prototype.getMountElement=function(){return this.getDocument().body},n.prototype.createElement=function(){return S(this,void 0,void 0,function(){var t,n,o;return x(this,function(r){return t=this.getOptions(),n=this.getDocument(),o=n.createElement("script"),(t.attributes||[]).forEach(function(t){o.setAttribute(t.name,""+t.value)}),o.setAttribute("type",t.type||"text/javascript"),t.reference?o.setAttribute("src",t.value):e.DOM.mount(n.createTextNode(t.value),o),[2,o]})})},n.prototype.getType=function(){return M.Script},n}(W),A=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return R(n,t),n.prototype.createElement=function(){return S(this,void 0,void 0,function(){var t,n,o;return x(this,function(r){return t=this.getOptions(),n=this.getDocument(),o=n.createElement(t.reference?"link":"style"),(t.attributes||[]).forEach(function(t){o.setAttribute(t.name,""+t.value)}),o.setAttribute("type",t.type||"text/css"),t.reference?(o.setAttribute("rel","stylesheet"),o.setAttribute("href",t.value)):e.DOM.mount(n.createTextNode(t.value),o),[2,o]})})},n.prototype.getType=function(){return M.StyleSheet},n}(W),B=function(){function t(){this.mounted=!1,this.assets=[]}return t.prototype.has=function(t){return this.assets.findIndex(function(e){return e===t})>-1},t.prototype.add=function(t){for(var e=0,n=Array.isArray(t)?t:[t];e<n.length;e++){var o=n[e];this.has(o)||(this.assets.push(o),this.isMounted()&&o.mount())}return this},t.prototype.remove=function(t){for(var e=Array.isArray(t)?t:[t],n=function(t){var e=o.assets.findIndex(function(e){return e===t});e>-1&&(o.assets=o.assets.slice(e,1),t.unmount())},o=this,r=0,i=e;r<i.length;r++){n(i[r])}return this},t.prototype.list=function(t){return t?this.assets.filter(t):this.assets.concat()},t.prototype.isMounted=function(){return this.mounted},t.prototype.mount=function(t){return S(this,void 0,void 0,function(){var e;return x(this,function(n){switch(n.label){case 0:return this.mounted=!0,e=[],this.list(t).forEach(function(t){e.push(t.mount())}),[4,Promise.all(e)];case 1:return n.sent(),[2]}})})},t.prototype.unmount=function(t){return S(this,void 0,void 0,function(){var e;return x(this,function(n){switch(n.label){case 0:return e=[],this.list(t).forEach(function(t){e.push(t.mount())}),[4,Promise.all(e)];case 1:return n.sent(),this.mounted=!1,[2]}})})},t.prototype.remount=function(t){return S(this,void 0,void 0,function(){var e;return x(this,function(n){switch(n.label){case 0:return this.mounted=!0,e=[],this.list(t).forEach(function(t){e.push(t.remount())}),[4,Promise.all(e)];case 1:return n.sent(),[2]}})})},t}(),I=function(t){function e(e){var n=t.call(this)||this;return n.document=e,n}return R(e,t),e.prototype.getDocument=function(){return this.document},e.prototype.create=function(t,e){var o=this.getDocument();switch(t){case M.Script:return new H(e,o);case M.StyleSheet:return new A(e,o);default:throw new n.InvalidArgumentError('Asset type "'+t+'" is invalid')}},e}(B);function T(t){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var O,L=function(){function t(){}return t.prototype.getBoolean=function(t,e){var n=this.get(t,e);switch(T(n)){case"boolean":return n;case"string":return"true"===n;default:return!!n}},t.prototype.getString=function(t,e){var n=this.get(t,e);switch(T(n)){case"string":return n;default:return""+n}},t.prototype.getInteger=function(t,e){var n=this.get(t,e);switch(T(n)){case"number":return n;default:return parseInt(n,10)}},t.prototype.getFloat=function(t,e){var n=this.get(t,e);switch(T(n)){case"number":return n;default:return parseFloat(n)}},t}();!function(t){t.PluginContextProcessor="plugin.context.processor",t.PluginExtension="plugin.extension",t.Widget="widget"}(O||(O={}));var U,D="plugin.context.processor",F=function(t){function e(e,n){return t.call(this,e,n,D)||this}return R(e,t),e}(i),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getPluginExtensionContexts=function(t,e){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,t.extensions||[]]})})},e.prototype.onPostProcess=function(e,n){return S(this,void 0,void 0,function(){var o,r,i,u,s,c,a,p;return x(this,function(f){switch(f.label){case 0:return[4,t.prototype.onPostProcess.call(this,e,n)];case 1:return o=f.sent(),[4,this.getPluginExtensionContexts(o,n)];case 2:if(!((r=f.sent()).length>0))return[3,9];i=[],u=0,s=r,f.label=3;case 3:if(!(u<s.length))return[3,8];c=s[u],f.label=4;case 4:return f.trys.push([4,6,,7]),[4,n.process(c)];case 5:return a=f.sent(),i.push(a),[3,7];case 6:return p=f.sent(),console.error('Failed to perform plugin context post processing on "'+e.id+'": '+p.message),[3,7];case 7:return u++,[3,3];case 8:return o.extensions=i,[3,10];case 9:o.extensions=[],f.label=10;case 10:return[2,o]}})})},e}(u),$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e}(j),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e}(u),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e}(_),V=function(){function t(){}return t.prototype.createPluginContextProcessor=function(t){return S(this,void 0,void 0,function(){return x(this,function(t){return[2,new $]})})},t=C([m()],t)}(),Q=function(){function t(){}return t.prototype.createPluginContextProcessor=function(t){return S(this,void 0,void 0,function(){return x(this,function(t){return[2,new N]})})},t=C([m()],t)}(),z=function(t){function e(e,n){var o=t.call(this,n)||this;return o.moduleManager=e,o}return R(e,t),e.prototype.getModuleManager=function(){return this.moduleManager},e.prototype.process=function(e){return S(this,void 0,void 0,function(){var n,o;return x(this,function(r){switch(r.label){case 0:return n=this.getModuleManager(),[4,c(n,e)];case 1:return o=r.sent(),[2,t.prototype.process.call(this,o)]}})})},e=C([m(),k("design:paramtypes",[Object,Object])],e)}(s),q="widget.factory",G=function(t){function e(e){return t.call(this,e.getModuleManager(),e.getServiceContainer(),q)||this}return R(e,t),e}(a),J="plugin.extension.factory",K=function(t){function e(e){var n=e.getRuntime();return t.call(this,n.getModuleManager(),n.getServiceContainer(),J)||this}return R(e,t),e}(a),X=function(t){function e(e){return t.call(this,e,new G(e))||this}return R(e,t),e.prototype.createPluginInstance=function(e){return S(this,void 0,void 0,function(){var n;return x(this,function(o){switch(o.label){case 0:return[4,t.prototype.createPluginInstance.call(this,e)];case 1:return(n=o.sent()).getRuntime().emit(new h("vl.widget.created",n)),[2,n]}})})},e.prototype.mount=function(t){var e=this;return this.each(function(n){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return t&&!t(n)?[3,2]:[4,n.mount()];case 1:e.sent(),e.label=2;case 2:return[2,n]}})})})},e.prototype.unmount=function(t){var e=this;return this.each(function(n){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return t&&!t(n)?[3,2]:[4,n.unmount()];case 1:e.sent(),e.label=2;case 2:return[2,n]}})})})},e.prototype.remount=function(t){var e=this;return this.each(function(n){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return t&&!t(n)?[3,2]:[4,n.remount()];case 1:e.sent(),e.label=2;case 2:return[2,n]}})})})},e}(p),Y=function(t){function e(e){return t.call(this,e,new K(e))||this}return R(e,t),e}(f),Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.onReady=function(){return S(this,void 0,void 0,function(){var e=this;return x(this,function(n){switch(n.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return n.sent(),this.addEventBroadcast(function(t){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,this.getPluginHost().emit(t.prefix(this.getPluginId()))];case 1:return e.sent(),[2]}})})}),this.getRuntime().getWidget().on("beforeMount",function(){return e.invokeHook("beforeMount")}).on("beforeUnmount",function(){return e.invokeHook("beforeUnmount")}).on("mounted",function(){return e.invokeHook("mounted")}).on("unmounted",function(){return e.invokeHook("unmounted")}),this.isMounted()?[4,this.invokeHook("beforeMount").then(function(){return e.invokeHook("mounted")})]:[3,3];case 2:return n.sent(),[3,5];case 3:return[4,this.invokeHook("beforeUnmount").then(function(){return e.invokeHook("unmounted")})];case 4:n.sent(),n.label=5;case 5:return[2]}})})},e.prototype.onBeforeMount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onMounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onBeforeUnmount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onUnmounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.isMounted=function(){return this.getRuntime().getWidget().isMounted()},e.prototype.createRuntime=function(){return new at(this)},e.prototype.getRuntime=function(){return void 0===this.pluginRuntime&&(this.pluginRuntime=this.createRuntime()),this.pluginRuntime},e}(l),tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getComponentRoot=function(){return void 0===this.componentRoot&&(this.componentRoot=this.createComponentRoot()),this.componentRoot},e.prototype.getComponentStore=function(){return void 0===this.componentStore&&(this.componentStore=this.createComponentStore()),this.componentStore},e.prototype.onReady=function(){return S(this,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return e.sent(),[4,this.attachComponentRoot()];case 2:return e.sent(),[2]}})})},e}(Z),et=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.createExtensionManager=function(){return new Y(this)},e.prototype.onReady=function(){return S(this,void 0,void 0,function(){var e=this;return x(this,function(n){switch(n.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return n.sent(),this.addEventBroadcast(function(t){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,this.getPluginHost().emit(t.prefix(this.getPluginId()))];case 1:return e.sent(),[2]}})})}),this.getRuntime().getWidget().on("beforeMount",function(){return e.invokeHook("beforeMount")}).on("beforeUnmount",function(){return e.invokeHook("beforeUnmount")}).on("mounted",function(){return e.invokeHook("mounted")}).on("unmounted",function(){return e.invokeHook("unmounted")}),this.isMounted()?[4,this.invokeHook("beforeMount").then(function(){return e.invokeHook("mounted")})]:[3,3];case 2:return n.sent(),[3,5];case 3:return[4,this.invokeHook("beforeUnmount").then(function(){return e.invokeHook("unmounted")})];case 4:n.sent(),n.label=5;case 5:return[2]}})})},e.prototype.onBeforeMount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onMounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onBeforeUnmount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.onUnmounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},e.prototype.isMounted=function(){return this.getRuntime().getWidget().isMounted()},e.prototype.createRuntime=function(){return new at(this)},e.prototype.getRuntime=function(){return void 0===this.pluginRuntime&&(this.pluginRuntime=this.createRuntime()),this.pluginRuntime},e}(g),nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getComponentRoot=function(){return void 0===this.componentRoot&&(this.componentRoot=this.createComponentRoot()),this.componentRoot},e.prototype.getComponentStore=function(){return void 0===this.componentStore&&(this.componentStore=this.createComponentStore()),this.componentStore},e.prototype.onReady=function(){return S(this,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return e.sent(),[4,this.attachComponentRoot()];case 2:return e.sent(),[2]}})})},e}(et),ot=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return R(o,t),o.prototype.onReady=function(){return S(this,void 0,void 0,function(){var e=this;return x(this,function(n){switch(n.label){case 0:return[4,t.prototype.onReady.call(this)];case 1:return n.sent(),this.addEventBroadcast(function(t){return S(e,void 0,void 0,function(){return x(this,function(e){switch(e.label){case 0:return[4,this.getPluginHost().emit(t.prefix("vl.widget."+this.getPluginTypeId()))];case 1:return e.sent(),[2]}})})}),[2]}})})},o.prototype.onBeforeMount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return[4,this.getAssetManager().mount()];case 1:return t.sent(),[2]}})})},o.prototype.onMounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},o.prototype.onBeforeUnmount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){return[2]})})},o.prototype.onUnmounted=function(){return S(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return[4,this.getAssetManager().unmount()];case 1:return t.sent(),[2]}})})},o.prototype.validatePluginContext=function(e){if(t.prototype.validatePluginContext.call(this,e),"string"!=typeof e.id)throw new d(this,'Context property "id" should be a string');if(e.extensions&&!Array.isArray(e.extensions))throw new d(this,'Context property "extensions" should be an array')},o.prototype.resolveExtensionContexts=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){switch(t){case v.Optional:return[2,this.getPluginContext().extensions||[]];default:return[2,[]]}return[2]})})},o.prototype.createExtensionManager=function(){return new Y(this)},o.prototype.getComponentRoot=function(){return void 0===this.componentRoot&&(this.componentRoot=this.createComponentRoot()),this.componentRoot},o.prototype.getComponentStore=function(){return void 0===this.componentStore&&(this.componentStore=this.createComponentStore()),this.componentStore},o.prototype.createAssetManager=function(){if(this.getRuntime().getEnvironment()!==U.Browser)throw new n.RuntimeError("Asset manager requires a browser runtime");return new I(window.document)},o.prototype.getAssetManager=function(){return void 0===this.assetManager&&(this.assetManager=this.createAssetManager()),this.assetManager},o.prototype.getPluginId=function(){return this.getPluginContext().id},o.prototype.createRuntime=function(){return new ct(this)},o.prototype.getRuntime=function(){return void 0===this.widgetRuntime&&(this.widgetRuntime=this.createRuntime()),this.widgetRuntime},o.prototype.getElement=function(){var t=this.getComponentRoot(),e=t.$el||null;if(null===e&&(t.$mount(),e=t.$el||null),null===e)throw new d(this,"Cannot resolve widget element");return e},o.prototype.getCurrentMountElement=function(){return this.currentMountElement||null},o.prototype.getMountElement=function(){return this.mountElement||null},o.prototype.setMountElement=function(t){return t!==this.getMountElement()&&(this.mountElement=t||void 0),this},o.prototype.isMounted=function(){return null!==this.getCurrentMountElement()},o.prototype.mount=function(){return S(this,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:return t=this.getMountElement(),this.isMounted()||null===t?[3,3]:[4,this.invokeHook("beforeMount")];case 1:return n.sent(),this.currentMountElement=e.DOM.replaceWith(t,this.getElement()),this.getComponentRoot().$forceUpdate(),[4,this.invokeHook("mounted")];case 2:n.sent(),n.label=3;case 3:return[2]}})})},o.prototype.unmount=function(){return S(this,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:return t=this.getCurrentMountElement(),this.isMounted()&&null!==t?[4,this.invokeHook("beforeUnmount")]:[3,3];case 1:return n.sent(),e.DOM.replaceWith(this.getElement(),t),this.currentMountElement=void 0,[4,this.invokeHook("unmounted")];case 2:n.sent(),n.label=3;case 3:return[2]}})})},o.prototype.remount=function(){return S(this,void 0,void 0,function(){return x(this,function(t){switch(t.label){case 0:return[4,this.unmount()];case 1:return t.sent(),[4,this.mount()];case 2:return t.sent(),[2]}})})},o}(g);function rt(t,e){if("string"!=typeof t.pluginTypeId||"function"!=typeof t.pluginContextProcessorFactory)throw new n.InvalidArgumentError("Plugin context processor registration should contain the following properties: pluginTypeId and pluginContextProcessorFactory");e.getServiceContainer().bind(D).to(t.pluginContextProcessorFactory).inSingletonScope().whenTargetNamed(t.pluginTypeId)}function it(t,e){if("string"!=typeof t.pluginTypeId||"function"!=typeof t.pluginFactory)throw new n.InvalidArgumentError("Plugin extension registration should contain the following properties: pluginTypeId and pluginFactory");e.getServiceContainer().bind(J).to(t.pluginFactory).inSingletonScope().whenTargetNamed(t.pluginTypeId)}function ut(t,e){if("string"!=typeof t.pluginTypeId||"function"!=typeof t.pluginFactory)throw new n.InvalidArgumentError("Widget registration should contain the following properties: pluginTypeId and pluginFactory");e.getServiceContainer().bind(q).to(t.pluginFactory).inSingletonScope().whenTargetNamed(t.pluginTypeId)}!function(t){t.Unknown="unknown",t.Browser="browser",t.WebWorker="webworker",t.Server="server"}(U||(U={}));var st=function(){function t(){}return t.prototype.createServiceContainer=function(){var t=new y;return t.bind("platform.runtime").toConstantValue(this),t.bind("plugin").toConstantValue(this.getPlugin()),t.bind("widget").toConstantValue(this.getWidget()),t},t.prototype.getServiceContainer=function(){return void 0===this.serviceContainer&&(this.serviceContainer=this.createServiceContainer(),this.linkServiceContainer(this.serviceContainer)),this.serviceContainer},t.prototype.getVersion=function(){return this.getWidget().getPluginHost().getVersion()},t.prototype.emit=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getWidget().getPluginHost().emit(t)]})})},t.prototype.on=function(t,e){return this.getWidget().getPluginHost().on(t,e),this},t.prototype.off=function(t,e){return this.getWidget().getPluginHost().off(t,e),this},t.prototype.once=function(t,e){return this.getWidget().getPluginHost().once(t,e),this},t.prototype.addEventListener=function(t,e){return this.getWidget().getPluginHost().addEventListener(t,e),this},t.prototype.removeEventListener=function(t,e){return this.getWidget().getPluginHost().removeEventListener(t,e),this},t.prototype.addEventBroadcast=function(t){return this.getWidget().getPluginHost().addEventBroadcast(t),this},t.prototype.removeEventBroadcast=function(t){return this.getWidget().getPluginHost().removeEventBroadcast(t),this},t.prototype.getEventBroadcast=function(){return this.getWidget().getPluginHost().getEventBroadcast()},t.prototype.getModuleManager=function(){return this.getWidget().getPluginHost().getModuleManager()},t.prototype.getWidgetManager=function(){return this.getWidget().getPluginHost().getWidgetManager()},t.prototype.capture=function(t,e){return this.getWidget().getPluginHost().capture(t,e)},t.prototype.getEnvironment=function(){return this.getWidget().getPluginHost().getEnvironment()},t.prototype.getConfiguration=function(){return this.getWidget().getPluginHost().getConfiguration()},t.prototype.bootstrap=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getWidget().getPluginHost().bootstrap(t)]})})},t.prototype.register=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getWidget().getPluginHost().register(t)]})})},t}(),ct=function(t){function e(e){var n=t.call(this)||this;return n.widget=e,n}return R(e,t),e.prototype.getPlugin=function(){return this.getWidget()},e.prototype.linkServiceContainer=function(t){t.parent=this.getWidget().getPluginHost().getServiceContainer()},e.prototype.getWidget=function(){return this.widget},e}(st),at=function(t){function e(e){var n=t.call(this)||this;return n.pluginExtension=e,n}return R(e,t),e.prototype.linkServiceContainer=function(t){t.parent=this.getWidget().getRuntime().getServiceContainer()},e.prototype.getPlugin=function(){return this.pluginExtension},e.prototype.getWidget=function(){return this.getPlugin().getPluginHost().getRuntime().getWidget()},e}(st),pt=function(){function t(t){this.moduleLoader=t,this.widgetCaptureQueue=[],this.initialize()}return t.prototype.initialize=function(){var t=this;this.on("vl.widget.created",function(e){return S(t,void 0,void 0,function(){var t=this;return x(this,function(n){return o.nextTick(function(){for(var n=e.getSender(),r=function(t){o.nextTick(function(){var e="function"==typeof t.filter?t.filter:null;(null===e||e(n))&&t.callback(n)})},i=0,u=t.widgetCaptureQueue;i<u.length;i++){r(u[i])}}),[2]})})})},t.prototype.createEventEmitter=function(){return new w},t.prototype.getEventEmitter=function(){return void 0===this.eventEmitter&&(this.eventEmitter=this.createEventEmitter()),this.eventEmitter},t.prototype.emit=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getEventEmitter().emit(t)]})})},t.prototype.on=function(t,e){return this.getEventEmitter().on(t,e),this},t.prototype.off=function(t,e){return this.getEventEmitter().off(t,e),this},t.prototype.once=function(t,e){return this.getEventEmitter().once(t,e),this},t.prototype.addEventListener=function(t,e){return this.getEventEmitter().addEventListener(t,e),this},t.prototype.removeEventListener=function(t,e){return this.getEventEmitter().removeEventListener(t,e),this},t.prototype.addEventBroadcast=function(t){return this.getEventEmitter().addEventBroadcast(t),this},t.prototype.removeEventBroadcast=function(t){return this.getEventEmitter().removeEventBroadcast(t),this},t.prototype.getEventBroadcast=function(){return this.getEventEmitter().getEventBroadcast()},t.prototype.createModuleManager=function(t){return new b(t,this)},t.prototype.getModuleManager=function(){return void 0===this.moduleManager&&(this.moduleManager=this.createModuleManager(this.moduleLoader)),this.moduleManager},t.prototype.createServiceContainer=function(){return new y},t.prototype.getServiceContainer=function(){return void 0===this.serviceContainer&&(this.serviceContainer=this.createServiceContainer()),this.serviceContainer},t.prototype.createWidgetManager=function(){return new X(this)},t.prototype.getWidgetManager=function(){return void 0===this.widgetManager&&(this.widgetManager=this.createWidgetManager()),this.widgetManager},t.prototype.bootstrap=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){return[2,this.getWidgetManager().createPluginInstance(t)]})})},t.prototype.capture=function(t,e){var n=this;o.nextTick(function(){n.widgetCaptureQueue.push({callback:t,filter:e});for(var o=0,r=n.getWidgetManager().list(e);o<r.length;o++){var i=r[o];t(i)}})},t.prototype.getEnvironment=function(){return r.isBrowser()?U.Browser:r.isWebWorker()?U.WebWorker:r.isServer()?U.Server:U.Unknown},t.prototype.register=function(t){return S(this,void 0,void 0,function(){return x(this,function(e){switch(t.type){case O.PluginContextProcessor:rt(t,this);break;case O.PluginExtension:it(t,this);break;case O.Widget:ut(t,this);break;default:throw new n.InvalidArgumentError('Registration type "'+t.type+'" is invalid')}return[2]})})},t}(),ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.$widget=function(){var t=this.$plugin().getRuntime();if("function"!=typeof t.getWidget)throw new n.RuntimeError("Plugin does not have a valid widget runtime");return t.getWidget()},e}(E);t.use({install:function(t){t.mixin({beforeCreate:function(){var t=this;void 0===this.$widget&&(this.$widget=function(){var e=t.$plugin().getRuntime();if("function"!=typeof e.getWidget)throw new n.RuntimeError("Plugin does not have a valid widget runtime");return e.getWidget()})}})}});export{W as AssetBase,B as AssetManagerBase,M as AssetType,I as DefaultAssetManager,z as DefaultPluginContextPipeline,F as DefaultPluginContextProcessorDiscovery,N as DefaultPluginExtensionContextProcessor,Q as DefaultPluginExtensionContextProcessorFactory,K as DefaultPluginExtensionDiscovery,Y as DefaultPluginExtensionManager,H as DefaultScriptAsset,A as DefaultStyleSheetAsset,$ as DefaultWidgetContextProcessor,V as DefaultWidgetContextProcessorFactory,G as DefaultWidgetDiscovery,X as DefaultWidgetManager,ct as DefaultWidgetRuntime,et as ExtensiblePluginExtensionBase,nt as ExtensibleUIPluginExtensionBase,D as PLUGIN_CONTEXT_PROCESSOR_SERVICE,J as PLUGIN_EXTENSION_FACTORY_SERVICE,O as PlatformRegistrationType,pt as PlatformRuntimeBase,L as PlatformRuntimeConfigBase,U as PlatformRuntimeEnvironment,Z as PluginExtensionBase,_ as PluginExtensionContextProcessorBase,at as PluginExtensionWidgetRuntime,ft as PluginStore,tt as UIPluginExtensionBase,q as WIDGET_FACTORY_SERVICE,ot as WidgetBase,j as WidgetContextProcessorBase,st as WidgetRuntimeBase,rt as registerPluginContextProcessor,it as registerPluginExtension,ut as registerWidget};
{
"name": "@govflanders/vl-widget-core",
"version": "1.3.4",
"version": "1.3.5",
"license": "MIT",

@@ -27,8 +27,8 @@ "contributors": [

"dependencies": {
"@govflanders/vl-widget-dependency-injection": "^1.3.4",
"@govflanders/vl-widget-event": "^1.3.4",
"@govflanders/vl-widget-module": "^1.3.4",
"@govflanders/vl-widget-plugin": "^1.3.4",
"@govflanders/vl-widget-render-engine": "^1.3.4",
"@govflanders/vl-widget-utility": "^1.3.4"
"@govflanders/vl-widget-dependency-injection": "^1.3.5",
"@govflanders/vl-widget-event": "^1.3.5",
"@govflanders/vl-widget-module": "^1.3.5",
"@govflanders/vl-widget-plugin": "^1.3.5",
"@govflanders/vl-widget-render-engine": "^1.3.5",
"@govflanders/vl-widget-utility": "^1.3.5"
},

@@ -35,0 +35,0 @@ "devDependencies": {

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