piral-base
Advanced tools
Comparing version 1.5.0-beta.6658 to 1.5.0-beta.6684
@@ -149,3 +149,3 @@ /** | ||
/** | ||
* Metadata for pilets using the v2 schema. | ||
* Metadata for pilets using the v3 schema. | ||
*/ | ||
@@ -152,0 +152,0 @@ export interface PiletV3Entry { |
@@ -0,6 +1,5 @@ | ||
import type { SinglePiletApp } from "../types"; | ||
/** | ||
* Represents an empty pilet app. | ||
*/ | ||
export declare const emptyApp: { | ||
setup(): void; | ||
}; | ||
export declare const emptyApp: SinglePiletApp; |
@@ -7,5 +7,3 @@ /// <reference types="systemjs" /> | ||
*/ | ||
export declare function loadSystemPilet(link: string): Promise<{ | ||
setup(): void; | ||
} | System.Module>; | ||
export declare function loadSystemPilet(link: string): Promise<import("../types").SinglePiletApp | System.Module>; | ||
export interface ModuleResolver { | ||
@@ -12,0 +10,0 @@ (): any; |
{ | ||
"name": "piral-base", | ||
"version": "1.5.0-beta.6658", | ||
"version": "1.5.0-beta.6684", | ||
"description": "The base library for creating a Piral instance.", | ||
@@ -86,3 +86,3 @@ "keywords": [ | ||
], | ||
"gitHead": "3b5ce14949e37335fc7a0814d9b477fad61d0e26" | ||
"gitHead": "2619f43474cb2825c357cf425e31da0816878c2c" | ||
} |
@@ -21,3 +21,18 @@ import { registerDependencyUrls, loadSystemPilet, createEvaluatedPilet } from '../../utils'; | ||
return loadSystemPilet(link).then((app) => createEvaluatedPilet(meta, app)); | ||
return loadSystemPilet(link).then((app) => { | ||
const pilet = createEvaluatedPilet(meta, app); | ||
if (Array.isArray(app.styles) && typeof document !== 'undefined') { | ||
for (const style of app.styles) { | ||
const link = document.createElement('link'); | ||
link.setAttribute('data-origin', pilet.name); | ||
link.type = 'text/css'; | ||
link.rel = 'stylesheet'; | ||
link.href = `${pilet.basePath}/${style}`; | ||
document.head.appendChild(link); | ||
} | ||
} | ||
return pilet; | ||
}); | ||
} |
@@ -155,3 +155,3 @@ /** | ||
/** | ||
* Metadata for pilets using the v2 schema. | ||
* Metadata for pilets using the v3 schema. | ||
*/ | ||
@@ -158,0 +158,0 @@ export interface PiletV3Entry { |
@@ -0,6 +1,8 @@ | ||
import type { SinglePiletApp } from "../types"; | ||
/** | ||
* Represents an empty pilet app. | ||
*/ | ||
export const emptyApp = { | ||
export const emptyApp: SinglePiletApp = { | ||
setup() {}, | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
788487
15360