REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 4.49 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@emotion/react/src/global.tsx
Text
Base64
import * as React from 'react' import isDevelopment from '#is-development' import { withEmotionCache } from './context' import { Theme, ThemeContext } from './theming' import { insertStyles } from '@emotion/utils' import { Options as SheetOptions, StyleSheet } from '@emotion/sheet' import isBrowser from '#is-browser' import { useInsertionEffectWithLayoutFallback } from '@emotion/use-insertion-effect-with-fallbacks' import { Interpolation, serializeStyles } from '@emotion/serialize' export interface GlobalProps { styles: Interpolation<Theme> } let warnedAboutCssPropForGlobal = false // maintain place over rerenders. // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild // initial client-side render from SSR, use place of hydrating tag export let Global = /* #__PURE__ */ withEmotionCache<GlobalProps>( (props, cache) => { if ( isDevelopment && !warnedAboutCssPropForGlobal && // check for className as well since the user is // probably using the custom createElement which // means it will be turned into a className prop // I don't really want to add it to the type since it shouldn't be used (('className' in props && props.className) || ('css' in props && props.css)) ) { console.error( "It looks like you're using the css prop on Global, did you mean to use the styles prop instead?" ) warnedAboutCssPropForGlobal = true } let styles = props.styles let serialized = serializeStyles( [styles], undefined, React.useContext(ThemeContext) ) if (!isBrowser) { let serializedNames = serialized.name let serializedStyles = serialized.styles let next = serialized.next while (next !== undefined) { serializedNames += ' ' + next.name serializedStyles += next.styles next = next.next } let shouldCache = cache.compat === true let rules = cache.insert( ``, { name: serializedNames, styles: serializedStyles }, cache.sheet, shouldCache ) if (shouldCache) { return null } return ( <style {...{ [`data-emotion`]: `${cache.key}-global ${serializedNames}`, dangerouslySetInnerHTML: { __html: rules! }, nonce: cache.sheet.nonce }} /> ) } // yes, i know these hooks are used conditionally // but it is based on a constant that will never change at runtime // it's effectively like having two implementations and switching them out // so it's not actually breaking anything let sheetRef = React.useRef< [sheet: StyleSheet, isRehydrating: boolean] | undefined >() useInsertionEffectWithLayoutFallback(() => { const key = `${cache.key}-global` // use case of https://github.com/emotion-js/emotion/issues/2675 let sheet = new (cache.sheet.constructor as { new (options: SheetOptions): StyleSheet })({ key, nonce: cache.sheet.nonce, container: cache.sheet.container, speedy: cache.sheet.isSpeedy }) let rehydrating = false let node: HTMLStyleElement | null = document.querySelector( `style[data-emotion="${key} ${serialized.name}"]` ) if (cache.sheet.tags.length) { sheet.before = cache.sheet.tags[0] } if (node !== null) { rehydrating = true // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s node.setAttribute('data-emotion', key) sheet.hydrate([node]) } sheetRef.current = [sheet, rehydrating] return () => { sheet.flush() } }, [cache]) useInsertionEffectWithLayoutFallback(() => { let sheetRefCurrent = sheetRef.current! let [sheet, rehydrating] = sheetRefCurrent if (rehydrating) { sheetRefCurrent[1] = false return } if (serialized.next !== undefined) { // insert keyframes insertStyles(cache, serialized.next, true) } if (sheet.tags.length) { // if this doesn't exist then it will be null so the style element will be appended let element = sheet.tags[sheet.tags.length - 1].nextElementSibling sheet.before = element sheet.flush() } cache.insert(``, serialized, sheet, false) }, [cache, serialized.name]) return null } ) if (isDevelopment) { Global.displayName = 'EmotionGlobal' }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 16
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
conditions
DIR
-
drwxr-xr-x
2026-02-28 00:30:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
class-names.tsx
4.50 KB
lrw-r--r--
2026-02-28 00:30:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
context.tsx
2.49 KB
lrw-r--r--
2026-02-28 00:30:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
css.ts
423 B
lrw-r--r--
2026-02-28 00:30:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
emotion-element.tsx
4.99 KB
lrw-r--r--
2026-02-28 00:30:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
get-label-from-stack-trace.ts
1.61 KB
lrw-r--r--
2026-02-28 00:30:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
global.tsx
4.49 KB
lrw-r--r--
2026-02-28 00:30:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
2.08 KB
lrw-r--r--
2026-02-28 00:30:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jsx-dev-runtime.ts
826 B
lrw-r--r--
2026-02-28 00:30:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jsx-namespace.ts
4.23 KB
lrw-r--r--
2026-02-28 00:30:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jsx-runtime.ts
924 B
lrw-r--r--
2026-02-28 00:30:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jsx.ts
1.55 KB
lrw-r--r--
2026-02-28 00:30:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
keyframes.ts
654 B
lrw-r--r--
2026-02-28 00:30:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
theming.tsx
2.85 KB
lrw-r--r--
2026-02-28 00:30:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
types.ts
544 B
lrw-r--r--
2026-02-28 00:30:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.ts
40 B
lrw-r--r--
2026-02-28 00:30:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_isolated-hnrs.ts
650 B
lrw-r--r--
2026-02-28 00:30:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).