@warp-ds/elements-core
Advanced tools
Comparing version 0.0.1-alpha.12 to 0.0.1
{ | ||
"name": "@warp-ds/elements-core", | ||
"type": "module", | ||
"version": "0.0.1-alpha.12", | ||
"version": "0.0.1", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "./src/element.js", |
import { CSSResult, unsafeCSS } from "lit"; | ||
import {getBrand, getGlobalStyles, getGlobalStylesSync, isServer} from "./utils.js"; | ||
import { | ||
getBrand, | ||
getGlobalStyles, | ||
getGlobalStylesSync, | ||
isServer, | ||
} from "./utils.js"; | ||
import "construct-style-sheets-polyfill"; | ||
@@ -36,3 +41,8 @@ | ||
// @ts-ignore | ||
const isWebkit = /WebKit/.test(UA) && !/Chrome/.test(UA) && !/Edg/.test(UA) && !window.MSStream; | ||
const isWebkit = | ||
/WebKit/.test(UA) && | ||
!/Chrome/.test(UA) && | ||
!/Edg/.test(UA) && | ||
// @ts-expect-error | ||
!window.MSStream; | ||
if (isWebkit) { | ||
@@ -42,5 +52,6 @@ // We do this because Safari does not always throw when this happens. | ||
// Safari in certain cases stopping JS execution. | ||
throw new Error("DoesNotSupportTopLevelAwait") | ||
throw new Error("DoesNotSupportTopLevelAwait"); | ||
} | ||
// block on fetching styles. This will throw in older browsers that don't support top level await | ||
// Block on fetching styles. This will throw in older browsers that don't support top level await. | ||
// They will fall back to a sync XMLHttpRequest. | ||
const sheets = await getGlobalStyles(brand); | ||
@@ -47,0 +58,0 @@ styles.replaceSync(sheets.css); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7869
206
2