piral-blazor
Advanced tools
Comparing version 1.6.0-beta.7144 to 1.6.0-beta.7147
@@ -67,7 +67,12 @@ import { createElement } from 'react'; | ||
} | ||
function getFallback(fallbackComponent, params) { | ||
if (typeof fallbackComponent === 'string') { | ||
const empty = undefined; | ||
return () => createElement('piral-extension', { name: fallbackComponent, params, empty }); | ||
} | ||
return undefined; | ||
} | ||
export function emitRenderEvent(source, name, params, sourceRef, fallbackComponent) { | ||
const target = findTarget(source); | ||
const empty = typeof fallbackComponent === 'string' | ||
? () => createElement('piral-extension', { name: fallbackComponent, params }) | ||
: undefined; | ||
const empty = getFallback(fallbackComponent, params); | ||
const order = typeof sourceRef !== 'undefined' | ||
@@ -130,2 +135,4 @@ ? (elements) => { | ||
globalEventNames.forEach((eventName) => host.addEventListener(eventName, dispatchToRoot)); | ||
// register host as event parent | ||
eventParents.push(host); | ||
return () => { | ||
@@ -136,4 +143,6 @@ host.removeEventListener(eventNames.render, render, false); | ||
globalEventNames.forEach((eventName) => host.removeEventListener(eventName, dispatchToRoot)); | ||
// unregister host as event parent | ||
eventParents.splice(eventParents.indexOf(host), 1); | ||
}; | ||
} | ||
//# sourceMappingURL=events.js.map |
@@ -70,7 +70,12 @@ "use strict"; | ||
} | ||
function getFallback(fallbackComponent, params) { | ||
if (typeof fallbackComponent === 'string') { | ||
const empty = undefined; | ||
return () => (0, react_1.createElement)('piral-extension', { name: fallbackComponent, params, empty }); | ||
} | ||
return undefined; | ||
} | ||
function emitRenderEvent(source, name, params, sourceRef, fallbackComponent) { | ||
const target = findTarget(source); | ||
const empty = typeof fallbackComponent === 'string' | ||
? () => (0, react_1.createElement)('piral-extension', { name: fallbackComponent, params }) | ||
: undefined; | ||
const empty = getFallback(fallbackComponent, params); | ||
const order = typeof sourceRef !== 'undefined' | ||
@@ -136,2 +141,4 @@ ? (elements) => { | ||
globalEventNames.forEach((eventName) => host.addEventListener(eventName, dispatchToRoot)); | ||
// register host as event parent | ||
eventParents.push(host); | ||
return () => { | ||
@@ -142,2 +149,4 @@ host.removeEventListener(eventNames.render, render, false); | ||
globalEventNames.forEach((eventName) => host.removeEventListener(eventName, dispatchToRoot)); | ||
// unregister host as event parent | ||
eventParents.splice(eventParents.indexOf(host), 1); | ||
}; | ||
@@ -144,0 +153,0 @@ } |
{ | ||
"name": "piral-blazor", | ||
"version": "1.6.0-beta.7144", | ||
"version": "1.6.0-beta.7147", | ||
"description": "Plugin for integrating Blazor components in Piral.", | ||
@@ -70,5 +70,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"piral-core": "1.6.0-beta.7144" | ||
"piral-core": "1.6.0-beta.7147" | ||
}, | ||
"gitHead": "c9046054bf0fda74a52e433d8ec72a3bbc5cbde8" | ||
"gitHead": "d626400cfcbc7585f89f3678f45a2211a35af2b0" | ||
} |
@@ -77,2 +77,11 @@ import type { ExtensionRegistration } from 'piral-core'; | ||
function getFallback(fallbackComponent: string, params: any) { | ||
if ( typeof fallbackComponent === 'string') { | ||
const empty = undefined; | ||
return () => createElement('piral-extension', { name: fallbackComponent, params, empty }); | ||
} | ||
return undefined; | ||
} | ||
export function emitRenderEvent( | ||
@@ -86,6 +95,3 @@ source: HTMLElement, | ||
const target = findTarget(source); | ||
const empty = | ||
typeof fallbackComponent === 'string' | ||
? () => createElement('piral-extension', { name: fallbackComponent, params }) | ||
: undefined; | ||
const empty = getFallback(fallbackComponent, params); | ||
const order = | ||
@@ -160,2 +166,4 @@ typeof sourceRef !== 'undefined' | ||
globalEventNames.forEach((eventName) => host.addEventListener(eventName, dispatchToRoot)); | ||
// register host as event parent | ||
eventParents.push(host); | ||
@@ -167,3 +175,5 @@ return () => { | ||
globalEventNames.forEach((eventName) => host.removeEventListener(eventName, dispatchToRoot)); | ||
// unregister host as event parent | ||
eventParents.splice(eventParents.indexOf(host), 1); | ||
}; | ||
} |
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
197428
3150