kolibri-components
Advanced tools
Comparing version 0.13.0-dev.8 to 0.13.0-dev.9
{ | ||
"name": "kolibri-components", | ||
"version": "0.13.0-dev.8", | ||
"version": "0.13.0-dev.9", | ||
"description": "Front-end components and utilities supporting the Kolibri Design System", | ||
@@ -14,2 +14,2 @@ "author": "Learning Equality", | ||
} | ||
} | ||
} |
import setupPluginMediator from '../utils/pluginMediator'; | ||
import KContentRenderer from './KContentRenderer'; | ||
import ContentRendererLoading from './ContentRendererLoading'; | ||
import { RENDERER_SUFFIX } from './constants'; | ||
@@ -10,18 +11,25 @@ | ||
languageDirection, | ||
ContentRendererLoadingComponent = { | ||
render(h) { | ||
return h('p', '-----'); | ||
}, | ||
}, | ||
ContentRendererLoadingComponent = ContentRendererLoading, | ||
ContentRendererErrorComponent = { | ||
// Define a simple error component in case none is supplied. | ||
render(h) { | ||
return h('p', 'xxxxx'); | ||
return h('p', 'Error'); | ||
}, | ||
}, | ||
facade, | ||
coreApp, | ||
registerContentActivity = () => {}, | ||
} = {} | ||
) { | ||
if (!facade) { | ||
facade = window.kolibriCoreAppGlobal = window.kolibriCoreAppGlobal || {}; | ||
if (!coreApp) { | ||
coreApp = window.kolibriCoreAppGlobal = window.kolibriCoreAppGlobal || {}; | ||
} else { | ||
// Do a check that if a coreApp argument is supplied, that it is referenceable | ||
// as window.kolibriCoreAppGlobal. | ||
setTimeout(() => { | ||
// Do after the main thread executes, so that if this is inside the kolibri core | ||
// app then it has had a chance to be assigned to the core global object. | ||
if (coreApp !== window.kolibriCoreAppGlobal) { | ||
console.error('KContent coreApp is not window.kolibriCoreAppGlobal'); // eslint-disable-line no-console | ||
} | ||
}, 0); | ||
} | ||
@@ -35,3 +43,3 @@ | ||
languageDirection, | ||
facade, | ||
facade: coreApp, | ||
}); | ||
@@ -38,0 +46,0 @@ |
@@ -31,3 +31,7 @@ import { RENDERER_SUFFIX } from './constants'; | ||
if (listeners[event]) { | ||
listeners[event] = [listeners[event], this.registerContentActivity]; | ||
if (Array.isArray(listeners[event])) { | ||
listeners[event] = [...listeners[event], this.registerContentActivity]; | ||
} else { | ||
listeners[event] = [listeners[event], this.registerContentActivity]; | ||
} | ||
} else { | ||
@@ -39,2 +43,3 @@ listeners[event] = this.registerContentActivity; | ||
props: this.$props, | ||
attrs: this.$attrs, | ||
on: listeners, | ||
@@ -41,0 +46,0 @@ ref: 'contentView', |
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
237386
60
3044