GoScrobble/web/node_modules/@emotion/react/dist/emotion-react.umd.min.js.map

1 line
106 KiB
Plaintext
Raw Normal View History

2022-04-25 02:47:15 +00:00
{"version":3,"file":"emotion-react.umd.min.js","sources":["../../sheet/src/index.js","../../../node_modules/stylis/dist/stylis.mjs","../../weak-memoize/src/index.js","../../memoize/src/index.js","../../cache/src/stylis-plugins.js","../../cache/src/index.js","../src/utils.js","../src/context.js","../../../node_modules/@babel/runtime/helpers/extends.js","../../../node_modules/react-is/cjs/react-is.production.min.js","../../../node_modules/react-is/cjs/react-is.development.js","../../../node_modules/react-is/index.js","../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../src/theming.js","../../utils/src/index.js","../../unitless/src/index.js","../../serialize/src/index.js","../../hash/src/index.js","../src/emotion-element.js","../src/jsx.js","../src/global.js","../src/css.js","../src/class-names.js","../src/keyframes.js","../src/isolated-hoist-non-react-statics-do-not-use-this-in-your-code.js"],"sourcesContent":["// @flow\n/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n\n// $FlowFixMe\nfunction sheetForTag(tag: HTMLStyleElement): CSSStyleSheet {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet\n }\n\n // this weirdness brought to you by firefox\n /* istanbul ignore next */\n for (let i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i]\n }\n }\n}\n\nexport type Options = {\n nonce?: string,\n key: string,\n container: HTMLElement,\n speedy?: boolean,\n prepend?: boolean\n}\n\nfunction createStyleElement(options: {\n key: string,\n nonce: string | void\n}): HTMLStyleElement {\n let tag = document.createElement('style')\n tag.setAttribute('data-emotion', options.key)\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce)\n }\n tag.appendChild(document.createTextNode(''))\n tag.setAttribute('data-s', '')\n return tag\n}\n\nexport class StyleSheet {\n isSpeedy: boolean\n ctr: number\n tags: HTMLStyleElement[]\n container: HTMLElement\n key: string\n nonce: string | void\n prepend: boolean | void\n before: Element | null\n constructor(options: Options) {\n this.isSpeedy =\n options.speedy === undefined\n ? process.env.NODE_ENV === 'production'\n : options.speedy\n this.tags = []\n this.ctr = 0\n this.nonce = options.nonce\n // key is the value of the data-emotion attribute, it's used to identify different sheets\n this.key = options.key\n this.container = options.container\n this.prepend = options.prepend\n this.before = null\n }\n\n _insertTag = (tag: HTMLStyleElement) => {\n let before\n if (this.tags.length === 0) {\n before = this.prepend ? this.container.firstChild : this.before\n } else {\n before = this.tags[this.tags.length - 1].nextSibling\n }\n this.container.insertBefore(tag, before)\n this.tags.push(tag)\n }\n\n hydrate(nodes: HTMLStyleElement[]) {\n nodes.forEach(this._insertTag)\n }\n\n insert(rule: string) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this))\n }\n const tag = this.tags[this.tags.length - 1]\n\n if (process.env.NODE_ENV !== 'production') {\n const isImportRule =\n rule.charCodeAt(0) === 64 &&