@mui/x-internals
Advanced tools
@@ -6,3 +6,4 @@ /** | ||
| * @param root Document or ShadowRoot to load stylesheets from | ||
| * @param nonce Optional nonce to set on style elements for CSP compliance | ||
| */ | ||
| export declare function loadStyleSheets(document: Document, root: Document | ShadowRoot): Promise<void>[]; | ||
| export declare function loadStyleSheets(document: Document, root: Document | ShadowRoot, nonce?: string): Promise<void>[]; |
@@ -6,4 +6,5 @@ /** | ||
| * @param root Document or ShadowRoot to load stylesheets from | ||
| * @param nonce Optional nonce to set on style elements for CSP compliance | ||
| */ | ||
| export function loadStyleSheets(document, root) { | ||
| export function loadStyleSheets(document, root, nonce) { | ||
| const stylesheetLoadPromises = []; | ||
@@ -13,4 +14,4 @@ const headStyleElements = root.querySelectorAll("style, link[rel='stylesheet']"); | ||
| const node = headStyleElements[i]; | ||
| const newHeadStyleElements = document.createElement(node.tagName); | ||
| if (node.tagName === 'STYLE') { | ||
| const newHeadStyleElements = document.createElement(node.tagName); | ||
| const sheet = node.sheet; | ||
@@ -25,8 +26,4 @@ if (sheet) { | ||
| newHeadStyleElements.appendChild(document.createTextNode(styleCSS)); | ||
| document.head.appendChild(newHeadStyleElements); | ||
| } | ||
| } else if (node.getAttribute('href')) { | ||
| // If `href` tag is empty, avoid loading these links | ||
| const newHeadStyleElements = document.createElement(node.tagName); | ||
| for (let j = 0; j < node.attributes.length; j += 1) { | ||
@@ -41,6 +38,9 @@ const attr = node.attributes[j]; | ||
| })); | ||
| document.head.appendChild(newHeadStyleElements); | ||
| } | ||
| if (nonce) { | ||
| newHeadStyleElements.nonce = nonce; | ||
| } | ||
| document.head.appendChild(newHeadStyleElements); | ||
| } | ||
| return stylesheetLoadPromises; | ||
| } |
@@ -6,3 +6,4 @@ /** | ||
| * @param root Document or ShadowRoot to load stylesheets from | ||
| * @param nonce Optional nonce to set on style elements for CSP compliance | ||
| */ | ||
| export declare function loadStyleSheets(document: Document, root: Document | ShadowRoot): Promise<void>[]; | ||
| export declare function loadStyleSheets(document: Document, root: Document | ShadowRoot, nonce?: string): Promise<void>[]; |
@@ -12,4 +12,5 @@ "use strict"; | ||
| * @param root Document or ShadowRoot to load stylesheets from | ||
| * @param nonce Optional nonce to set on style elements for CSP compliance | ||
| */ | ||
| function loadStyleSheets(document, root) { | ||
| function loadStyleSheets(document, root, nonce) { | ||
| const stylesheetLoadPromises = []; | ||
@@ -19,4 +20,4 @@ const headStyleElements = root.querySelectorAll("style, link[rel='stylesheet']"); | ||
| const node = headStyleElements[i]; | ||
| const newHeadStyleElements = document.createElement(node.tagName); | ||
| if (node.tagName === 'STYLE') { | ||
| const newHeadStyleElements = document.createElement(node.tagName); | ||
| const sheet = node.sheet; | ||
@@ -31,8 +32,4 @@ if (sheet) { | ||
| newHeadStyleElements.appendChild(document.createTextNode(styleCSS)); | ||
| document.head.appendChild(newHeadStyleElements); | ||
| } | ||
| } else if (node.getAttribute('href')) { | ||
| // If `href` tag is empty, avoid loading these links | ||
| const newHeadStyleElements = document.createElement(node.tagName); | ||
| for (let j = 0; j < node.attributes.length; j += 1) { | ||
@@ -47,6 +44,9 @@ const attr = node.attributes[j]; | ||
| })); | ||
| document.head.appendChild(newHeadStyleElements); | ||
| } | ||
| if (nonce) { | ||
| newHeadStyleElements.nonce = nonce; | ||
| } | ||
| document.head.appendChild(newHeadStyleElements); | ||
| } | ||
| return stylesheetLoadPromises; | ||
| } |
+2
-2
| { | ||
| "name": "@mui/x-internals", | ||
| "version": "8.17.0", | ||
| "version": "8.18.0", | ||
| "author": "MUI Team", | ||
@@ -34,3 +34,3 @@ "description": "Utility functions for the MUI X packages (internal use only).", | ||
| "@babel/runtime": "^7.28.4", | ||
| "@mui/utils": "^7.3.3", | ||
| "@mui/utils": "^7.3.5", | ||
| "reselect": "^5.1.1", | ||
@@ -37,0 +37,0 @@ "use-sync-external-store": "^1.6.0" |
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
659251
0.62%3526
0.11%Updated