REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 4.99 KB
Close
/home/byroehnu/.trash/node_modules11/@emotion/react/src/emotion-element.tsx
Text
Base64
import * as React from 'react' import { withEmotionCache } from './context' import { Theme, ThemeContext } from './theming' import { EmotionCache, getRegisteredStyles, insertStyles, registerStyles, SerializedStyles } from '@emotion/utils' import { hasOwn } from './utils' import { Interpolation, serializeStyles } from '@emotion/serialize' import isDevelopment from '#is-development' import isBrowser from '#is-browser' import { getLabelFromStackTrace } from './get-label-from-stack-trace' import { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks' const typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__' const labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__' interface EmotionProps { css: Interpolation<Theme> [typePropName]: React.ElementType [labelPropName]?: string [key: string]: unknown } export const createEmotionProps = ( type: React.ElementType, props: { css: Interpolation<Theme> } ): EmotionProps => { if ( isDevelopment && typeof props.css === 'string' && // check if there is a css declaration props.css.indexOf(':') !== -1 ) { throw new Error( `Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css\`${props.css}\`` ) } let newProps = {} as EmotionProps for (let key in props) { if (hasOwn.call(props, key)) { newProps[key] = props[key as keyof typeof props] } } newProps[typePropName] = type // Runtime labeling is an opt-in feature because: // - It causes hydration warnings when using Safari and SSR // - It can degrade performance if there are a huge number of elements // // Even if the flag is set, we still don't compute the label if it has already // been determined by the Babel plugin. if ( isDevelopment && typeof globalThis !== 'undefined' && !!(globalThis as any).EMOTION_RUNTIME_AUTO_LABEL && !!props.css && (typeof props.css !== 'object' || !('name' in props.css) || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1) ) { const label = getLabelFromStackTrace(new Error().stack) if (label) newProps[labelPropName] = label } return newProps } const Insertion = ({ cache, serialized, isStringTag }: { cache: EmotionCache serialized: SerializedStyles isStringTag: boolean }) => { registerStyles(cache, serialized, isStringTag) const rules = useInsertionEffectAlwaysWithSyncFallback(() => insertStyles(cache, serialized, isStringTag) ) if (!isBrowser && rules !== undefined) { let serializedNames = serialized.name let next = serialized.next while (next !== undefined) { serializedNames += ' ' + next.name next = next.next } return ( <style {...{ [`data-emotion`]: `${cache.key} ${serializedNames}`, dangerouslySetInnerHTML: { __html: rules }, nonce: cache.sheet.nonce }} /> ) } return null } let Emotion = /* #__PURE__ */ withEmotionCache<EmotionProps>( (props, cache, ref) => { let cssProp = props.css as EmotionProps['css'] // so that using `css` from `emotion` and passing the result to the css prop works // not passing the registered cache to serializeStyles because it would // make certain babel optimisations not possible if ( typeof cssProp === 'string' && cache.registered[cssProp] !== undefined ) { cssProp = cache.registered[cssProp] } let WrappedComponent = props[ typePropName ] as EmotionProps[typeof typePropName] let registeredStyles = [cssProp] let className = '' if (typeof props.className === 'string') { className = getRegisteredStyles( cache.registered, registeredStyles, props.className ) } else if (props.className != null) { className = `${props.className} ` } let serialized = serializeStyles( registeredStyles, undefined, React.useContext(ThemeContext) ) if (isDevelopment && serialized.name.indexOf('-') === -1) { let labelFromStack = props[labelPropName] if (labelFromStack) { serialized = serializeStyles([ serialized, 'label:' + labelFromStack + ';' ]) } } className += `${cache.key}-${serialized.name}` const newProps: Record<string, unknown> = {} for (let key in props) { if ( hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (!isDevelopment || key !== labelPropName) ) { newProps[key] = props[key] } } newProps.className = className if (ref) { newProps.ref = ref } return ( <> <Insertion cache={cache} serialized={serialized} isStringTag={typeof WrappedComponent === 'string'} /> <WrappedComponent {...newProps} /> </> ) } ) if (isDevelopment) { Emotion.displayName = 'EmotionCssPropInternal' } export default Emotion
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).