1 line
28 KiB
Plaintext
1 line
28 KiB
Plaintext
{"version":3,"file":"get-css-data.esm.js","sources":["../src/get-urls.js","../src/get-css.js"],"sourcesContent":["/*global XDomainRequest*/\n\n// Functions\n// =============================================================================\n/**\n * Requests one-or-more URLs and returns array of data in order specified.\n * Provides callbacks error and success callbacks for each XMLHttpRequest.\n *\n * @param {array|string} url Single URL or array of URLs to request\n * @param {object} [options] Options object\n * @param {string} [options.mimeType] Overrides MIME type returned by\n * server\n * @param {function} [options.onBeforeSend] Callback before each request is\n * sent. Passes 1) the xhr object, 2) the URL, and 3) the\n * URL index as arguments.\n * @param {function} [options.onSuccess] Callback on xhr success. Passes 1)\n * xhr response text, 2) the URL, and 3) the URL index as\n * arguments.\n * @param {function} [options.onError] Callback on xhr error. Passes 1) the\n * xhr object, 2) the URL, 3) the URL index as arguments.\n * @param {function} [options.onComplete] Callback after all requests have\n * completed. Passes 1) an array of response text for each\n * URL in order provided as an argument.\n */\nfunction getUrls(urls, options = {}) {\n const settings = {\n mimeType : options.mimeType || null,\n onBeforeSend: options.onBeforeSend || Function.prototype,\n onSuccess : options.onSuccess || Function.prototype,\n onError : options.onError || Function.prototype,\n onComplete : options.onComplete || Function.prototype\n };\n const urlArray = Array.isArray(urls) ? urls : [urls];\n const urlQueue = Array.apply(null, Array(urlArray.length)).map(x => null);\n\n // Functions (Private)\n // -------------------------------------------------------------------------\n function isValidCss(text) {\n const isString = typeof text === 'string';\n const isHTML = isString && text.trim().charAt(0) === '<';\n\n return isString && !isHTML;\n }\n\n function onError(xhr, urlIndex) {\n settings.onError(xhr, urlArray[urlIndex], urlIndex);\n }\n\n function onSuccess(responseText, urlIndex) {\n const returnVal = settings.onSuccess(responseText, urlArray[urlIndex], urlIndex);\n\n responseText = returnVal === false ? '' : returnVal || responseText;\n urlQueue[urlIndex] = responseText;\n\n // Complete\n if (urlQueue.indexOf(null) === -1) {\n settings.onComplete(urlQueue);\n }\n }\n\n // Main\n // -------------------------------------------------------------------------\n const parser = document.createElement('a');\n\n urlArray.forEach((url, i) => {\n parser.setAttribute('href', url);\n parser.href = String(parser.href);\n\n const isIElte9 = Boolean(document.all && !window.atob);\n const isIElte9CORS = isIElte9 && parser.host.split(':')[0] !== location.host.split(':')[0];\n\n // IE 9 CORS\n if (isIElte9CORS) {\n const isSameProtocol = parser.protocol === location.protocol;\n\n if (isSameProtocol) {\n const xdr = new XDomainRequest();\n\n // Event handlers must be assigned AFTER xdr.open\n xdr.open('GET', url);\n\n xdr.timeout = 0; // Prevent aborts/timeouts\n xdr.onprogress = Function.prototype; // Prevent aborts/timeouts\n xdr.ontimeout = Function.prototype; // Prevent aborts/timeouts\n xdr.onload = function() {\n const text = xdr.responseText;\n\n if (isValidCss(text)) {\n onSuccess(text, i);\n }\n else {\n onError(xdr, i);\n }\n };\n xdr.onerror = function(err) {\n onError(xdr, i);\n };\n\n // Wrap in setTimeout to fix known issues with XDomainRequest\n // when sending multiple requests\n setTimeout(function() {\n xdr.send();\n }, 0);\n }\n else {\n // eslint-disable-next-line\n console.warn(`Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (${url})`);\n onError(null, i);\n }\n }\n // Other\n else {\n const xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n\n // overrideMimeType method not available in all browsers\n if (settings.mimeType && xhr.overrideMimeType) {\n xhr.overrideMimeType(settings.mimeType);\n }\n\n settings.onBeforeSend(xhr, url, i);\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n const text = xhr.responseText;\n\n // Success\n if (xhr.status < 400 && isValidCss(text)) {\n onSuccess(text, i);\n }\n // Success via file protocol (file://)\n else if (xhr.status === 0 && isValidCss(text)) {\n onSuccess(text, i);\n }\n // Error\n else {\n onError(xhr, i);\n }\n }\n };\n\n xhr.send();\n }\n });\n}\n\n\n// Export\n// =============================================================================\nexport default getUrls;\n","// Dependencies\n// =============================================================================\nimport getUrls from './get-urls';\n\n\n// Functions (Public)\n// =============================================================================\n/**\n * Gets CSS data from <style> and <link> nodes (including @imports), then\n * returns data in order processed by DOM. Allows specifying nodes to\n * include/exclude and filtering CSS data using RegEx.\n *\n * @preserve\n * @param {object} [options] The options object\n * @param {object} [options.rootElement=document] Root element to traverse for\n * <link> and <style> nodes.\n * @param {string} [options.include] CSS selector matching <link> and <style>\n * nodes to include\n * @param {string} [options.exclude] CSS selector matching <link> and <style>\n * nodes to exclude\n * @param {object} [options.filter] Regular expression used to filter node CSS\n * data. Each block of CSS data is tested against the filter,\n * and only matching data is included.\n * @param {boolean} [options.skipDisabled=true] Determines if disabled\n * stylesheets will be skipped while collecting CSS data.\n * @param {boolean} [options.useCSSOM=false] Determines if CSS data will be\n * collected from a stylesheet's runtime values instead of its\n * text content. This is required to get accurate CSS data\n * when a stylesheet has been modified using the deleteRule()\n * or insertRule() methods because these modifications will\n * not be reflected in the stylesheet's text content.\n * @param {function} [options.onBeforeSend] Callback before XHR is sent. Passes\n * 1) the XHR object, 2) source node reference, and 3) the\n * source URL as arguments.\n * @param {function} [options.onSuccess] Callback on each CSS node read. Passes\n * 1) CSS text, 2) source node reference, and 3) the source\n * URL as arguments.\n * @param {function} [options.onError] Callback on each error. Passes 1) the XHR\n * object for inspection, 2) soure node reference, and 3) the\n * source URL that failed (either a <link> href or an @import)\n * as arguments\n * @param {function} [options.onComplete] Callback after all nodes have been\n * processed. Passes 1) concatenated CSS text, 2) an array of\n * CSS text in DOM order, and 3) an array of nodes in DOM\n * order as arguments.\n *\n * @example\n *\n * getCssData({\n * rootElement : document,\n * include : 'style,link[rel=\"stylesheet\"]',\n * exclude : '[href=\"skip.css\"]',\n * filter : /red/,\n * skipDisabled: true,\n * useCSSOM : false,\n * onBeforeSend(xhr, node, url) {\n * // ...\n * }\n * onSuccess(cssText, node, url) {\n * // ...\n * }\n * onError(xhr, node, url) {\n * // ...\n * },\n * onComplete(cssText, cssArray, nodeArray) {\n * // ...\n * }\n * });\n */\nfunction getCssData(options) {\n const regex = {\n // CSS comments\n cssComments: /\\/\\*[\\s\\S]+?\\*\\//g,\n // CSS @import rules ($1: url)\n cssImports : /(?:@import\\s*)(?:url\\(\\s*)?(?:['\"])([^'\"]*)(?:['\"])(?:\\s*\\))?(?:[^;]*;)/g\n };\n const settings = {\n rootElement : options.rootElement || document,\n include : options.include || 'style,link[rel=\"stylesheet\"]',\n exclude : options.exclude || null,\n filter : options.filter || null,\n skipDisabled: options.skipDisabled !== false,\n useCSSOM : options.useCSSOM || false,\n onBeforeSend: options.onBeforeSend || Function.prototype,\n onSuccess : options.onSuccess || Function.prototype,\n onError : options.onError || Function.prototype,\n onComplete : options.onComplete || Function.prototype\n };\n const sourceNodes = Array.apply(null, settings.rootElement.querySelectorAll(settings.include)).filter(node => !matchesSelector(node, settings.exclude));\n const cssArray = Array.apply(null, Array(sourceNodes.length)).map(x => null);\n\n /**\n * Handles the onComplete() callback after verifying that all CSS has been\n * processed.\n */\n function handleComplete() {\n const isComplete = cssArray.indexOf(null) === -1;\n\n if (isComplete) {\n // Remove skipped nodes/css\n cssArray\n .reduce((skipIndices, value, i) => {\n if (value === '') {\n skipIndices.push(i);\n }\n\n return skipIndices;\n }, [])\n .reverse()\n .forEach(skipIndex => [sourceNodes, cssArray].forEach(arr => arr.splice(skipIndex, 1)));\n\n const cssText = cssArray.join('');\n\n settings.onComplete(cssText, cssArray, sourceNodes);\n }\n }\n\n /**\n * Processes CSS text, updates cssArray, and triggers handleComplete()\n * 1. Passes CSS to resolveImports\n * 2. Triggers onError() callback for each @import error\n * 3. Tests resolved CSS against (optional) RegEx filter\n * 4. Triggers onSuccess() callback and accepts modified cssText as return\n * 5. Inserts final CSS into cssArray\n * 6. Triggers handleComplete() after processing is complete\n *\n * @param {string} cssText CSS text to be processed\n * @param {number} cssIndex cssArray index to store final CSS\n * @param {object} node CSS source <link> or <style> node\n * @param {string} sourceUrl The URL containing the source node\n */\n function handleSuccess(cssText, cssIndex, node, sourceUrl) {\n const returnVal = settings.onSuccess(cssText, node, sourceUrl);\n\n cssText = returnVal !== undefined && Boolean(returnVal) === false ? '' : returnVal || cssText;\n\n resolveImports(cssText, node, sourceUrl, function(resolvedCssText, errorData) {\n if (cssArray[cssIndex] === null) {\n // Trigger onError for each error item\n errorData.forEach(data => settings.onError(data.xhr, node, data.url));\n\n // Filter: Pass\n if (!settings.filter || settings.filter.test(resolvedCssText)) {\n cssArray[cssIndex] = resolvedCssText;\n }\n // Filter: Fail\n else {\n cssArray[cssIndex] = '';\n }\n\n handleComplete();\n }\n });\n }\n\n /**\n * Parses CSS and returns an object containing @import related data.\n *\n * @param {any} cssText CSS text to be processed\n * @param {any} baseUrl Base URL used to resolve relative @import URLs\n * @param {any} [ignoreRules=[]]\n * @returns {object}\n */\n function parseImportData(cssText, baseUrl, ignoreRules = []) {\n const importData = {};\n\n // @import rules\n // Ex: @import \"file.css\";\n importData.rules = (cssText\n // Remove comments to avoid processing @import in comments\n .replace(regex.cssComments, '')\n // Find all @import rules\n .match(regex.cssImports)\n // Force empty array if no match\n || [])\n // Remove rules found in ignoreRules array\n .filter(rule => ignoreRules.indexOf(rule) === -1);\n\n // @import urls\n // Ex: file.css\n importData.urls = importData.rules.map(rule => rule.replace(regex.cssImports, '$1'));\n\n // Absolute @import urls\n // Ex: /path/to/file.css\n importData.absoluteUrls = importData.urls.map(url => getFullUrl(url, baseUrl));\n\n // Absolute @import rules\n // Ex: @import \"/path/to/file.css\";\n importData.absoluteRules = importData.rules.map((rule, i) => {\n const oldUrl = importData.urls[i];\n const newUrl = getFullUrl(importData.absoluteUrls[i], baseUrl);\n\n return rule.replace(oldUrl, newUrl);\n });\n\n return importData;\n }\n\n /**\n * Recursively parses CSS for @import rules, fetches data for each import\n * URL, replaces the @rule the fetched data, then returns the resolved CSS\n * via a callback function.\n *\n * @param {string} cssText CSS text to be processed\n * @param {object} node CSS source <link> or <style> node\n * @param {string} baseUrl Base URL used to resolve relative @import URLs\n * @param {function} callbackFn Callback function to trigger on complete.\n * Passes 1) the resolves CSS and 2) an array of error\n * objects as arguments.\n */\n function resolveImports(cssText, node, baseUrl, callbackFn, __errorData = [], __errorRules = []) {\n const importData = parseImportData(cssText, baseUrl, __errorRules);\n\n // Has @imports\n if (importData.rules.length) {\n getUrls(importData.absoluteUrls, {\n onBeforeSend(xhr, url, urlIndex) {\n settings.onBeforeSend(xhr, node, url);\n },\n onSuccess(cssText, url, urlIndex) {\n const returnVal = settings.onSuccess(cssText, node, url);\n\n cssText = returnVal === false ? '' : returnVal || cssText;\n\n const responseImportData = parseImportData(cssText, url, __errorRules);\n\n // Replace relative @import rules with absolute rules\n responseImportData.rules.forEach((rule, i) => {\n cssText = cssText.replace(rule, responseImportData.absoluteRules[i]);\n });\n\n return cssText;\n },\n onError(xhr, url, urlIndex) {\n __errorData.push({ xhr, url });\n __errorRules.push(importData.rules[urlIndex]);\n\n resolveImports(cssText, node, baseUrl, callbackFn, __errorData, __errorRules);\n },\n onComplete(responseArray) {\n responseArray.forEach((importText, i) => {\n cssText = cssText.replace(importData.rules[i], importText);\n });\n\n resolveImports(cssText, node, baseUrl, callbackFn, __errorData, __errorRules);\n }\n });\n }\n // No @imports\n else {\n callbackFn(cssText, __errorData);\n }\n }\n\n // Main\n // -------------------------------------------------------------------------\n if (sourceNodes.length) {\n sourceNodes.forEach((node, i) => {\n const linkHref = node.getAttribute('href');\n const linkRel = node.getAttribute('rel');\n const isLink = node.nodeName.toLowerCase() === 'link' && linkHref && linkRel && linkRel.toLowerCase().indexOf('stylesheet') !== -1;\n const isSkip = settings.skipDisabled === false ? false : node.disabled;\n const isStyle = node.nodeName.toLowerCase() === 'style';\n\n if (isLink && !isSkip) {\n const isURIScheme = linkHref.indexOf('data:text/css') !== -1;\n\n if (isURIScheme) {\n let cssText = decodeURIComponent(linkHref.substring(linkHref.indexOf(',') + 1));\n\n if (settings.useCSSOM) {\n cssText = Array.apply(null, node.sheet.cssRules)\n .map(rule => rule.cssText)\n .join('');\n }\n \n handleSuccess(cssText, i, node, location.href);\n } else {\n getUrls(linkHref, {\n mimeType: 'text/css',\n onBeforeSend(xhr, url, urlIndex) {\n settings.onBeforeSend(xhr, node, url);\n },\n onSuccess(cssText, url, urlIndex) {\n // Convert relative linkHref to absolute url\n const sourceUrl = getFullUrl(linkHref);\n \n handleSuccess(cssText, i, node, sourceUrl);\n },\n onError(xhr, url, urlIndex) {\n cssArray[i] = '';\n settings.onError(xhr, node, url);\n handleComplete();\n }\n });\n }\n }\n else if (isStyle && !isSkip) {\n let cssText = node.textContent;\n\n if (settings.useCSSOM) {\n cssText = Array.apply(null, node.sheet.cssRules)\n .map(rule => rule.cssText)\n .join('');\n }\n\n handleSuccess(cssText, i, node, location.href);\n }\n else {\n cssArray[i] = '';\n handleComplete();\n }\n });\n }\n else {\n settings.onComplete('', []);\n }\n}\n\n\n// Functions (Private)\n// =============================================================================\n/**\n * Returns fully qualified URL from relative URL and (optional) base URL\n *\n * @param {any} url\n * @param {any} base\n * @returns\n */\nfunction getFullUrl(url, base) {\n const d = document.implementation.createHTMLDocument('');\n const b = d.createElement('base');\n const a = d.createElement('a');\n\n d.head.appendChild(b);\n d.body.appendChild(a);\n b.href = base || document.baseURI || (document.querySelector('base') || {}).href || location.href;\n a.href = url;\n\n return a.href;\n}\n\n/**\n * Ponyfill for native Element.matches method\n *\n * @param {object} elm The element to test\n * @param {string} selector The CSS selector to test against\n * @returns {boolean}\n */\nfunction matchesSelector(elm, selector) {\n /* istanbul ignore next */\n const matches = elm.matches || elm.matchesSelector || elm.webkitMatchesSelector || elm.mozMatchesSelector || elm.msMatchesSelector || elm.oMatchesSelector;\n\n return matches.call(elm, selector);\n}\n\n\n// Export\n// =============================================================================\nexport default getCssData;\n"],"names":["getUrls","urls","options","settings","mimeType","onBeforeSend","Function","prototype","onSuccess","onError","onComplete","urlArray","Array","isArray","urlQueue","apply","length","map","x","isValidCss","text","isString","isHTML","trim","charAt","xhr","urlIndex","responseText","returnVal","indexOf","parser","document","createElement","forEach","url","i","setAttribute","href","String","isIElte9","Boolean","all","window","atob","isIElte9CORS","host","split","location","isSameProtocol","protocol","xdr","XDomainRequest","open","timeout","onprogress","ontimeout","onload","onerror","err","setTimeout","send","console","warn","concat","XMLHttpRequest","overrideMimeType","onreadystatechange","readyState","status","getCssData","regex","cssComments","cssImports","rootElement","include","exclude","filter","skipDisabled","useCSSOM","sourceNodes","querySelectorAll","node","matchesSelector","cssArray","handleComplete","isComplete","reduce","skipIndices","value","push","reverse","skipIndex","arr","splice","cssText","join","handleSuccess","cssIndex","sourceUrl","undefined","resolveImports","resolvedCssText","errorData","data","test","parseImportData","baseUrl","ignoreRules","importData","rules","replace","match","rule","absoluteUrls","getFullUrl","absoluteRules","oldUrl","newUrl","callbackFn","__errorData","__errorRules","responseImportData","responseArray","importText","linkHref","getAttribute","linkRel","isLink","nodeName","toLowerCase","isSkip","disabled","isStyle","isURIScheme","decodeURIComponent","substring","sheet","cssRules","textContent","base","d","implementation","createHTMLDocument","b","a","head","appendChild","body","baseURI","querySelector","elm","selector","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","call"],"mappings":";;;;;;;AAwBA,SAASA,QAAQC;IAAMC,IAAAA,8EAAU;IAC7B,IAAMC,WAAW;QACbC,UAAcF,QAAQE,YAAgB;QACtCC,cAAcH,QAAQG,gBAAgBC,SAASC;QAC/CC,WAAcN,QAAQM,aAAgBF,SAASC;QAC/CE,SAAcP,QAAQO,WAAgBH,SAASC;QAC/CG,YAAcR,QAAQQ,cAAgBJ,SAASC;;IAEnD,IAAMI,WAAWC,MAAMC,QAAQZ,QAAQA,OAAO,EAACA;IAC/C,IAAMa,WAAWF,MAAMG,MAAM,MAAMH,MAAMD,SAASK,SAASC,KAAI,SAAAC;QAAC,OAAI;;IAI3DC,SAAAA,WAAWC;QAChB,IAAMC,kBAAkBD,SAAS;QACjC,IAAME,SAASD,YAAYD,KAAKG,OAAOC,OAAO,OAAO;QAE9CH,OAAAA,aAAaC;;IAGxB,SAASb,QAAQgB,KAAKC;QAClBvB,SAASM,QAAQgB,KAAKd,SAASe,WAA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