From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Mon, 16 Nov 2020 00:10:28 +0100 Subject: api, login, auth --- node_modules/style-loader/lib/addStyleUrl.js | 44 +++ node_modules/style-loader/lib/addStyles.js | 398 +++++++++++++++++++++++++++ node_modules/style-loader/lib/urls.js | 89 ++++++ 3 files changed, 531 insertions(+) create mode 100644 node_modules/style-loader/lib/addStyleUrl.js create mode 100644 node_modules/style-loader/lib/addStyles.js create mode 100644 node_modules/style-loader/lib/urls.js (limited to 'node_modules/style-loader/lib') diff --git a/node_modules/style-loader/lib/addStyleUrl.js b/node_modules/style-loader/lib/addStyleUrl.js new file mode 100644 index 0000000..581fecb --- /dev/null +++ b/node_modules/style-loader/lib/addStyleUrl.js @@ -0,0 +1,44 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +function addAttrs (element, attrs) { + Object.keys(attrs).forEach(function (key) { + element.setAttribute(key, attrs[key]); + }); +} + +module.exports = function addStyleUrl (url, options) { + if (typeof DEBUG !== "undefined" && DEBUG) { + if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); + } + + options = options || {}; + + options.attrs = typeof options.attrs === "object" ? options.attrs : {}; + + options.hmr = typeof options.hmr === 'undefined' ? true : options.hmr; + + var link = document.createElement("link"); + + link.rel = "stylesheet"; + link.type = "text/css"; + link.href = url; + + addAttrs(link, options.attrs); + + var head = document.getElementsByTagName("head")[0]; + + head.appendChild(link); + + if (options.hmr && module.hot) { + return function(url) { + if(typeof url === "string") { + link.href = url; + } else { + head.removeChild(link); + } + }; + } +} diff --git a/node_modules/style-loader/lib/addStyles.js b/node_modules/style-loader/lib/addStyles.js new file mode 100644 index 0000000..077a368 --- /dev/null +++ b/node_modules/style-loader/lib/addStyles.js @@ -0,0 +1,398 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + +var stylesInDom = {}; + +var memoize = function (fn) { + var memo; + + return function () { + if (typeof memo === "undefined") memo = fn.apply(this, arguments); + return memo; + }; +}; + +var isOldIE = memoize(function () { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + return window && document && document.all && !window.atob; +}); + +var getTarget = function (target, parent) { + if (parent){ + return parent.querySelector(target); + } + return document.querySelector(target); +}; + +var getElement = (function (fn) { + var memo = {}; + + return function(target, parent) { + // If passing function in options, then use it for resolve "head" element. + // Useful for Shadow Root style i.e + // { + // insertInto: function () { return document.querySelector("#foo").shadowRoot } + // } + if (typeof target === 'function') { + return target(); + } + if (typeof memo[target] === "undefined") { + var styleTarget = getTarget.call(this, target, parent); + // Special case to return head of iframe instead of iframe itself + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch(e) { + styleTarget = null; + } + } + memo[target] = styleTarget; + } + return memo[target] + }; +})(); + +var singleton = null; +var singletonCounter = 0; +var stylesInsertedAtTop = []; + +var fixUrls = require("./urls"); + +module.exports = function(list, options) { + if (typeof DEBUG !== "undefined" && DEBUG) { + if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); + } + + options = options || {}; + + options.attrs = typeof options.attrs === "object" ? options.attrs : {}; + + // Force single-tag solution on IE6-9, which has a hard limit on the # of