@webprovisions/platform
Advanced tools
Comparing version 1.0.0-alpha.8 to 1.0.0-alpha.9
@@ -12,3 +12,11 @@ import { ConfigurationStage, ConfigurationScope, createConfigCommand, } from './configurator'; | ||
}), | ||
usePlugin: createConfigCommand(ConfigurationScope.Widget, ConfigurationStage.Pre, function (context, key, settings) { | ||
context.container.get('$plugins')[key] = null; | ||
context.container.get('$pluginSettings')[key] = settings; | ||
}), | ||
addPlugin: createConfigCommand(ConfigurationScope.Widget, ConfigurationStage.Pre, function (context, key, settings) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
// tslint:disable-next-line max-line-length | ||
console.warn('Webprovisions: Configuration command \'addPlugin()\' is obsolete. Use \'usePlugin()\' instead.'); | ||
} | ||
context.container.get('$plugins')[key] = null; | ||
@@ -15,0 +23,0 @@ context.container.get('$pluginSettings')[key] = settings; |
@@ -35,3 +35,3 @@ import ns from '../namespace'; | ||
unsubscribe(); | ||
listener(event, data); | ||
return listener(event, data); | ||
}); | ||
@@ -83,7 +83,3 @@ }; | ||
} | ||
return Promise.resolve(listener(event, data)).then(function () { | ||
if (event.defaultPrevented) { | ||
return true; | ||
} | ||
}); | ||
return Promise.resolve(listener(event, data)).then(function () { return event.defaultPrevented; }); | ||
}); | ||
@@ -90,0 +86,0 @@ })(listeners[i]); |
@@ -17,2 +17,8 @@ import { Container } from './dependency-injection'; | ||
name: string; | ||
/** | ||
* The id of the tenant this implementation is associated with. | ||
* Is used to filter implementations when more then one tenant is | ||
* present on the same `Environment`. | ||
*/ | ||
tenant?: string; | ||
widgets?: WidgetDataConfigurationMap; | ||
@@ -30,5 +36,7 @@ bindings?: string[]; | ||
/** | ||
* Idenfitifer for the implementation (usually a URI). | ||
* Id of the tenant this implementation is associated with. | ||
* Is used to filter implementations when more then one tenant is | ||
* present on the same `Environment`. | ||
*/ | ||
application: string; | ||
tenant?: string; | ||
/** | ||
@@ -35,0 +43,0 @@ * The environment instance. |
@@ -22,2 +22,3 @@ import ns from './namespace'; | ||
this.name = configuration.name; | ||
this.tenant = configuration.tenant; | ||
this.environment = environment; | ||
@@ -24,0 +25,0 @@ this.bindings = configuration.bindings || []; |
@@ -14,3 +14,11 @@ "use strict"; | ||
}), | ||
usePlugin: configurator_1.createConfigCommand(configurator_1.ConfigurationScope.Widget, configurator_1.ConfigurationStage.Pre, function (context, key, settings) { | ||
context.container.get('$plugins')[key] = null; | ||
context.container.get('$pluginSettings')[key] = settings; | ||
}), | ||
addPlugin: configurator_1.createConfigCommand(configurator_1.ConfigurationScope.Widget, configurator_1.ConfigurationStage.Pre, function (context, key, settings) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
// tslint:disable-next-line max-line-length | ||
console.warn('Webprovisions: Configuration command \'addPlugin()\' is obsolete. Use \'usePlugin()\' instead.'); | ||
} | ||
context.container.get('$plugins')[key] = null; | ||
@@ -17,0 +25,0 @@ context.container.get('$pluginSettings')[key] = settings; |
@@ -37,3 +37,3 @@ "use strict"; | ||
unsubscribe(); | ||
listener(event, data); | ||
return listener(event, data); | ||
}); | ||
@@ -85,7 +85,3 @@ }; | ||
} | ||
return Promise.resolve(listener(event, data)).then(function () { | ||
if (event.defaultPrevented) { | ||
return true; | ||
} | ||
}); | ||
return Promise.resolve(listener(event, data)).then(function () { return event.defaultPrevented; }); | ||
}); | ||
@@ -92,0 +88,0 @@ })(listeners[i]); |
@@ -17,2 +17,8 @@ import { Container } from './dependency-injection'; | ||
name: string; | ||
/** | ||
* The id of the tenant this implementation is associated with. | ||
* Is used to filter implementations when more then one tenant is | ||
* present on the same `Environment`. | ||
*/ | ||
tenant?: string; | ||
widgets?: WidgetDataConfigurationMap; | ||
@@ -30,5 +36,7 @@ bindings?: string[]; | ||
/** | ||
* Idenfitifer for the implementation (usually a URI). | ||
* Id of the tenant this implementation is associated with. | ||
* Is used to filter implementations when more then one tenant is | ||
* present on the same `Environment`. | ||
*/ | ||
application: string; | ||
tenant?: string; | ||
/** | ||
@@ -35,0 +43,0 @@ * The environment instance. |
@@ -24,2 +24,3 @@ "use strict"; | ||
this.name = configuration.name; | ||
this.tenant = configuration.tenant; | ||
this.environment = environment; | ||
@@ -26,0 +27,0 @@ this.bindings = configuration.bindings || []; |
{ | ||
"name": "@webprovisions/platform", | ||
"version": "1.0.0-alpha.8", | ||
"version": "1.0.0-alpha.9", | ||
"description": "Webprovisions core platform modules.", | ||
@@ -5,0 +5,0 @@ "author": "Humany AB", |
@@ -1,2 +0,5 @@ | ||
# webprovisions | ||
Javascript library for web distribution platform Webprovisions. | ||
# @webprovisions/platform | ||
Webprovisions is a web distribution platform provided by Humany. The client framework orchestrates widgets and plugins and provides an easy-to-use API for controlling and extending their behaviour. | ||
### Webprovisions is in alpha | ||
This means breaking changes can occur from any version to the next. |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
167307
2657
5
7