single-file-core 1.0.63 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -314,10 +314,12 @@
|
|
|
314
314
|
|
|
315
315
|
addEventListener(GET_ADOPTED_STYLESHEETS_REQUEST_EVENT, event => {
|
|
316
316
|
const shadowRoot = event.target.shadowRoot;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
317
|
+
if (shadowRoot) {
|
|
318
|
+
const adoptedStyleSheets = Array.from(shadowRoot.adoptedStyleSheets).map(stylesheet => Array.from(stylesheet.cssRules).map(cssRule => cssRule.cssText).join("\n"));
|
|
319
|
+
if (adoptedStyleSheets.length) {
|
|
320
|
+
event.target.dispatchEvent(new CustomEvent(GET_ADOPTED_STYLESHEETS_RESPONSE_EVENT, { detail: { adoptedStyleSheets } }));
|
|
321
|
+
}
|
|
322
|
+
}
|
|
321
323
|
}, { capture: true });
|
|
322
324
|
|
|
323
325
|
if (globalThis.FontFace) {
|