init
This commit is contained in:
21
mc_test/node_modules/@emotion/utils/LICENSE
generated
vendored
Executable file
21
mc_test/node_modules/@emotion/utils/LICENSE
generated
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Emotion team and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
5
mc_test/node_modules/@emotion/utils/dist/declarations/src/index.d.ts
generated
vendored
Executable file
5
mc_test/node_modules/@emotion/utils/dist/declarations/src/index.d.ts
generated
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
import { RegisteredCache, EmotionCache, SerializedStyles } from "./types.js";
|
||||
export declare function getRegisteredStyles(registered: RegisteredCache, registeredStyles: string[], classNames: string): string;
|
||||
export declare const registerStyles: (cache: EmotionCache, serialized: SerializedStyles, isStringTag: boolean) => void;
|
||||
export declare const insertStyles: (cache: EmotionCache, serialized: SerializedStyles, isStringTag: boolean) => string | undefined;
|
||||
export * from "./types.js";
|
||||
17
mc_test/node_modules/@emotion/utils/dist/declarations/src/types.d.ts
generated
vendored
Executable file
17
mc_test/node_modules/@emotion/utils/dist/declarations/src/types.d.ts
generated
vendored
Executable file
@ -0,0 +1,17 @@
|
||||
import type { StyleSheet } from '@emotion/sheet';
|
||||
export type { StyleSheet };
|
||||
export type RegisteredCache = Record<string, string | undefined>;
|
||||
export type SerializedStyles = {
|
||||
name: string;
|
||||
styles: string;
|
||||
next?: SerializedStyles;
|
||||
};
|
||||
export type EmotionCache = {
|
||||
inserted: Record<string, string | true | undefined>;
|
||||
registered: RegisteredCache;
|
||||
sheet: StyleSheet;
|
||||
key: string;
|
||||
compat?: true;
|
||||
nonce?: string;
|
||||
insert: (selector: string, serialized: SerializedStyles, sheet: StyleSheet, shouldCache: boolean) => string | void;
|
||||
};
|
||||
51
mc_test/node_modules/@emotion/utils/dist/emotion-utils.browser.cjs.js
generated
vendored
Executable file
51
mc_test/node_modules/@emotion/utils/dist/emotion-utils.browser.cjs.js
generated
vendored
Executable file
@ -0,0 +1,51 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var isBrowser = true;
|
||||
|
||||
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
||||
var rawClassName = '';
|
||||
classNames.split(' ').forEach(function (className) {
|
||||
if (registered[className] !== undefined) {
|
||||
registeredStyles.push(registered[className] + ";");
|
||||
} else if (className) {
|
||||
rawClassName += className + " ";
|
||||
}
|
||||
});
|
||||
return rawClassName;
|
||||
}
|
||||
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if ( // we only need to add the styles to the registered cache if the
|
||||
// class name could be used further down
|
||||
// the tree but if it's a string tag, we know it won't
|
||||
// so we don't have to add it to registered cache.
|
||||
// this improves memory usage since we can avoid storing the whole style string
|
||||
(isStringTag === false || // we need to always store it if we're in compat mode and
|
||||
// in node since emotion-server relies on whether a style is in
|
||||
// the registered cache to know whether a style is global or not
|
||||
// also, note that this check will be dead code eliminated in the browser
|
||||
isBrowser === false ) && cache.registered[className] === undefined) {
|
||||
cache.registered[className] = serialized.styles;
|
||||
}
|
||||
};
|
||||
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
||||
registerStyles(cache, serialized, isStringTag);
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if (cache.inserted[serialized.name] === undefined) {
|
||||
var current = serialized;
|
||||
|
||||
do {
|
||||
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
||||
|
||||
current = current.next;
|
||||
} while (current !== undefined);
|
||||
}
|
||||
};
|
||||
|
||||
exports.getRegisteredStyles = getRegisteredStyles;
|
||||
exports.insertStyles = insertStyles;
|
||||
exports.registerStyles = registerStyles;
|
||||
5
mc_test/node_modules/@emotion/utils/dist/emotion-utils.browser.cjs.mjs
generated
vendored
Executable file
5
mc_test/node_modules/@emotion/utils/dist/emotion-utils.browser.cjs.mjs
generated
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
export {
|
||||
getRegisteredStyles,
|
||||
insertStyles,
|
||||
registerStyles
|
||||
} from "./emotion-utils.browser.cjs.js";
|
||||
45
mc_test/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
generated
vendored
Executable file
45
mc_test/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
generated
vendored
Executable file
@ -0,0 +1,45 @@
|
||||
var isBrowser = true;
|
||||
|
||||
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
||||
var rawClassName = '';
|
||||
classNames.split(' ').forEach(function (className) {
|
||||
if (registered[className] !== undefined) {
|
||||
registeredStyles.push(registered[className] + ";");
|
||||
} else if (className) {
|
||||
rawClassName += className + " ";
|
||||
}
|
||||
});
|
||||
return rawClassName;
|
||||
}
|
||||
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if ( // we only need to add the styles to the registered cache if the
|
||||
// class name could be used further down
|
||||
// the tree but if it's a string tag, we know it won't
|
||||
// so we don't have to add it to registered cache.
|
||||
// this improves memory usage since we can avoid storing the whole style string
|
||||
(isStringTag === false || // we need to always store it if we're in compat mode and
|
||||
// in node since emotion-server relies on whether a style is in
|
||||
// the registered cache to know whether a style is global or not
|
||||
// also, note that this check will be dead code eliminated in the browser
|
||||
isBrowser === false ) && cache.registered[className] === undefined) {
|
||||
cache.registered[className] = serialized.styles;
|
||||
}
|
||||
};
|
||||
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
||||
registerStyles(cache, serialized, isStringTag);
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if (cache.inserted[serialized.name] === undefined) {
|
||||
var current = serialized;
|
||||
|
||||
do {
|
||||
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
||||
|
||||
current = current.next;
|
||||
} while (current !== undefined);
|
||||
}
|
||||
};
|
||||
|
||||
export { getRegisteredStyles, insertStyles, registerStyles };
|
||||
2
mc_test/node_modules/@emotion/utils/dist/emotion-utils.cjs.d.mts
generated
vendored
Executable file
2
mc_test/node_modules/@emotion/utils/dist/emotion-utils.cjs.d.mts
generated
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
export * from "./declarations/src/index.js";
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi11dGlscy5janMuZC5tdHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
|
||||
2
mc_test/node_modules/@emotion/utils/dist/emotion-utils.cjs.d.ts
generated
vendored
Executable file
2
mc_test/node_modules/@emotion/utils/dist/emotion-utils.cjs.d.ts
generated
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
export * from "./declarations/src/index";
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi11dGlscy5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
|
||||
60
mc_test/node_modules/@emotion/utils/dist/emotion-utils.cjs.js
generated
vendored
Executable file
60
mc_test/node_modules/@emotion/utils/dist/emotion-utils.cjs.js
generated
vendored
Executable file
@ -0,0 +1,60 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var isBrowser = typeof document !== 'undefined';
|
||||
|
||||
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
||||
var rawClassName = '';
|
||||
classNames.split(' ').forEach(function (className) {
|
||||
if (registered[className] !== undefined) {
|
||||
registeredStyles.push(registered[className] + ";");
|
||||
} else if (className) {
|
||||
rawClassName += className + " ";
|
||||
}
|
||||
});
|
||||
return rawClassName;
|
||||
}
|
||||
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if ( // we only need to add the styles to the registered cache if the
|
||||
// class name could be used further down
|
||||
// the tree but if it's a string tag, we know it won't
|
||||
// so we don't have to add it to registered cache.
|
||||
// this improves memory usage since we can avoid storing the whole style string
|
||||
(isStringTag === false || // we need to always store it if we're in compat mode and
|
||||
// in node since emotion-server relies on whether a style is in
|
||||
// the registered cache to know whether a style is global or not
|
||||
// also, note that this check will be dead code eliminated in the browser
|
||||
isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
||||
cache.registered[className] = serialized.styles;
|
||||
}
|
||||
};
|
||||
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
||||
registerStyles(cache, serialized, isStringTag);
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if (cache.inserted[serialized.name] === undefined) {
|
||||
var stylesForSSR = '';
|
||||
var current = serialized;
|
||||
|
||||
do {
|
||||
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
||||
|
||||
if (!isBrowser && maybeStyles !== undefined) {
|
||||
stylesForSSR += maybeStyles;
|
||||
}
|
||||
|
||||
current = current.next;
|
||||
} while (current !== undefined);
|
||||
|
||||
if (!isBrowser && stylesForSSR.length !== 0) {
|
||||
return stylesForSSR;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.getRegisteredStyles = getRegisteredStyles;
|
||||
exports.insertStyles = insertStyles;
|
||||
exports.registerStyles = registerStyles;
|
||||
5
mc_test/node_modules/@emotion/utils/dist/emotion-utils.cjs.mjs
generated
vendored
Executable file
5
mc_test/node_modules/@emotion/utils/dist/emotion-utils.cjs.mjs
generated
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
export {
|
||||
getRegisteredStyles,
|
||||
insertStyles,
|
||||
registerStyles
|
||||
} from "./emotion-utils.cjs.js";
|
||||
58
mc_test/node_modules/@emotion/utils/dist/emotion-utils.edge-light.cjs.js
generated
vendored
Executable file
58
mc_test/node_modules/@emotion/utils/dist/emotion-utils.edge-light.cjs.js
generated
vendored
Executable file
@ -0,0 +1,58 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
||||
var rawClassName = '';
|
||||
classNames.split(' ').forEach(function (className) {
|
||||
if (registered[className] !== undefined) {
|
||||
registeredStyles.push(registered[className] + ";");
|
||||
} else if (className) {
|
||||
rawClassName += className + " ";
|
||||
}
|
||||
});
|
||||
return rawClassName;
|
||||
}
|
||||
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if ( // we only need to add the styles to the registered cache if the
|
||||
// class name could be used further down
|
||||
// the tree but if it's a string tag, we know it won't
|
||||
// so we don't have to add it to registered cache.
|
||||
// this improves memory usage since we can avoid storing the whole style string
|
||||
(isStringTag === false || // we need to always store it if we're in compat mode and
|
||||
// in node since emotion-server relies on whether a style is in
|
||||
// the registered cache to know whether a style is global or not
|
||||
// also, note that this check will be dead code eliminated in the browser
|
||||
cache.compat !== undefined) && cache.registered[className] === undefined) {
|
||||
cache.registered[className] = serialized.styles;
|
||||
}
|
||||
};
|
||||
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
||||
registerStyles(cache, serialized, isStringTag);
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if (cache.inserted[serialized.name] === undefined) {
|
||||
var stylesForSSR = '';
|
||||
var current = serialized;
|
||||
|
||||
do {
|
||||
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
||||
|
||||
if (maybeStyles !== undefined) {
|
||||
stylesForSSR += maybeStyles;
|
||||
}
|
||||
|
||||
current = current.next;
|
||||
} while (current !== undefined);
|
||||
|
||||
if (stylesForSSR.length !== 0) {
|
||||
return stylesForSSR;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.getRegisteredStyles = getRegisteredStyles;
|
||||
exports.insertStyles = insertStyles;
|
||||
exports.registerStyles = registerStyles;
|
||||
5
mc_test/node_modules/@emotion/utils/dist/emotion-utils.edge-light.cjs.mjs
generated
vendored
Executable file
5
mc_test/node_modules/@emotion/utils/dist/emotion-utils.edge-light.cjs.mjs
generated
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
export {
|
||||
getRegisteredStyles,
|
||||
insertStyles,
|
||||
registerStyles
|
||||
} from "./emotion-utils.edge-light.cjs.js";
|
||||
52
mc_test/node_modules/@emotion/utils/dist/emotion-utils.edge-light.esm.js
generated
vendored
Executable file
52
mc_test/node_modules/@emotion/utils/dist/emotion-utils.edge-light.esm.js
generated
vendored
Executable file
@ -0,0 +1,52 @@
|
||||
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
||||
var rawClassName = '';
|
||||
classNames.split(' ').forEach(function (className) {
|
||||
if (registered[className] !== undefined) {
|
||||
registeredStyles.push(registered[className] + ";");
|
||||
} else if (className) {
|
||||
rawClassName += className + " ";
|
||||
}
|
||||
});
|
||||
return rawClassName;
|
||||
}
|
||||
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if ( // we only need to add the styles to the registered cache if the
|
||||
// class name could be used further down
|
||||
// the tree but if it's a string tag, we know it won't
|
||||
// so we don't have to add it to registered cache.
|
||||
// this improves memory usage since we can avoid storing the whole style string
|
||||
(isStringTag === false || // we need to always store it if we're in compat mode and
|
||||
// in node since emotion-server relies on whether a style is in
|
||||
// the registered cache to know whether a style is global or not
|
||||
// also, note that this check will be dead code eliminated in the browser
|
||||
cache.compat !== undefined) && cache.registered[className] === undefined) {
|
||||
cache.registered[className] = serialized.styles;
|
||||
}
|
||||
};
|
||||
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
||||
registerStyles(cache, serialized, isStringTag);
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if (cache.inserted[serialized.name] === undefined) {
|
||||
var stylesForSSR = '';
|
||||
var current = serialized;
|
||||
|
||||
do {
|
||||
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
||||
|
||||
if (maybeStyles !== undefined) {
|
||||
stylesForSSR += maybeStyles;
|
||||
}
|
||||
|
||||
current = current.next;
|
||||
} while (current !== undefined);
|
||||
|
||||
if (stylesForSSR.length !== 0) {
|
||||
return stylesForSSR;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export { getRegisteredStyles, insertStyles, registerStyles };
|
||||
54
mc_test/node_modules/@emotion/utils/dist/emotion-utils.esm.js
generated
vendored
Executable file
54
mc_test/node_modules/@emotion/utils/dist/emotion-utils.esm.js
generated
vendored
Executable file
@ -0,0 +1,54 @@
|
||||
var isBrowser = typeof document !== 'undefined';
|
||||
|
||||
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
||||
var rawClassName = '';
|
||||
classNames.split(' ').forEach(function (className) {
|
||||
if (registered[className] !== undefined) {
|
||||
registeredStyles.push(registered[className] + ";");
|
||||
} else if (className) {
|
||||
rawClassName += className + " ";
|
||||
}
|
||||
});
|
||||
return rawClassName;
|
||||
}
|
||||
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if ( // we only need to add the styles to the registered cache if the
|
||||
// class name could be used further down
|
||||
// the tree but if it's a string tag, we know it won't
|
||||
// so we don't have to add it to registered cache.
|
||||
// this improves memory usage since we can avoid storing the whole style string
|
||||
(isStringTag === false || // we need to always store it if we're in compat mode and
|
||||
// in node since emotion-server relies on whether a style is in
|
||||
// the registered cache to know whether a style is global or not
|
||||
// also, note that this check will be dead code eliminated in the browser
|
||||
isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
||||
cache.registered[className] = serialized.styles;
|
||||
}
|
||||
};
|
||||
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
||||
registerStyles(cache, serialized, isStringTag);
|
||||
var className = cache.key + "-" + serialized.name;
|
||||
|
||||
if (cache.inserted[serialized.name] === undefined) {
|
||||
var stylesForSSR = '';
|
||||
var current = serialized;
|
||||
|
||||
do {
|
||||
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
||||
|
||||
if (!isBrowser && maybeStyles !== undefined) {
|
||||
stylesForSSR += maybeStyles;
|
||||
}
|
||||
|
||||
current = current.next;
|
||||
} while (current !== undefined);
|
||||
|
||||
if (!isBrowser && stylesForSSR.length !== 0) {
|
||||
return stylesForSSR;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export { getRegisteredStyles, insertStyles, registerStyles };
|
||||
65
mc_test/node_modules/@emotion/utils/package.json
generated
vendored
Executable file
65
mc_test/node_modules/@emotion/utils/package.json
generated
vendored
Executable file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "@emotion/utils",
|
||||
"version": "1.4.2",
|
||||
"description": "internal utils for emotion",
|
||||
"main": "dist/emotion-utils.cjs.js",
|
||||
"module": "dist/emotion-utils.esm.js",
|
||||
"types": "dist/emotion-utils.cjs.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": {
|
||||
"import": "./dist/emotion-utils.cjs.mjs",
|
||||
"default": "./dist/emotion-utils.cjs.js"
|
||||
},
|
||||
"edge-light": {
|
||||
"module": "./dist/emotion-utils.edge-light.esm.js",
|
||||
"import": "./dist/emotion-utils.edge-light.cjs.mjs",
|
||||
"default": "./dist/emotion-utils.edge-light.cjs.js"
|
||||
},
|
||||
"worker": {
|
||||
"module": "./dist/emotion-utils.edge-light.esm.js",
|
||||
"import": "./dist/emotion-utils.edge-light.cjs.mjs",
|
||||
"default": "./dist/emotion-utils.edge-light.cjs.js"
|
||||
},
|
||||
"workerd": {
|
||||
"module": "./dist/emotion-utils.edge-light.esm.js",
|
||||
"import": "./dist/emotion-utils.edge-light.cjs.mjs",
|
||||
"default": "./dist/emotion-utils.edge-light.cjs.js"
|
||||
},
|
||||
"browser": {
|
||||
"module": "./dist/emotion-utils.browser.esm.js",
|
||||
"import": "./dist/emotion-utils.browser.cjs.mjs",
|
||||
"default": "./dist/emotion-utils.browser.cjs.js"
|
||||
},
|
||||
"module": "./dist/emotion-utils.esm.js",
|
||||
"import": "./dist/emotion-utils.cjs.mjs",
|
||||
"default": "./dist/emotion-utils.cjs.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"imports": {
|
||||
"#is-browser": {
|
||||
"edge-light": "./src/conditions/false.ts",
|
||||
"workerd": "./src/conditions/false.ts",
|
||||
"worker": "./src/conditions/false.ts",
|
||||
"browser": "./src/conditions/true.ts",
|
||||
"default": "./src/conditions/is-browser.ts"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test:typescript": "dtslint types"
|
||||
},
|
||||
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/utils",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"src",
|
||||
"dist"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@definitelytyped/dtslint": "0.0.112",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
1
mc_test/node_modules/@emotion/utils/src/conditions/false.ts
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/utils/src/conditions/false.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export default false as boolean
|
||||
1
mc_test/node_modules/@emotion/utils/src/conditions/is-browser.ts
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/utils/src/conditions/is-browser.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export default typeof document !== 'undefined'
|
||||
1
mc_test/node_modules/@emotion/utils/src/conditions/true.ts
generated
vendored
Executable file
1
mc_test/node_modules/@emotion/utils/src/conditions/true.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export default true as boolean
|
||||
75
mc_test/node_modules/@emotion/utils/src/index.ts
generated
vendored
Executable file
75
mc_test/node_modules/@emotion/utils/src/index.ts
generated
vendored
Executable file
@ -0,0 +1,75 @@
|
||||
import isBrowser from '#is-browser'
|
||||
import { RegisteredCache, EmotionCache, SerializedStyles } from './types'
|
||||
|
||||
export function getRegisteredStyles(
|
||||
registered: RegisteredCache,
|
||||
registeredStyles: string[],
|
||||
classNames: string
|
||||
): string {
|
||||
let rawClassName = ''
|
||||
|
||||
classNames.split(' ').forEach(className => {
|
||||
if (registered[className] !== undefined) {
|
||||
registeredStyles.push(`${registered[className]};`)
|
||||
} else if (className) {
|
||||
rawClassName += `${className} `
|
||||
}
|
||||
})
|
||||
return rawClassName
|
||||
}
|
||||
|
||||
export const registerStyles = (
|
||||
cache: EmotionCache,
|
||||
serialized: SerializedStyles,
|
||||
isStringTag: boolean
|
||||
): void => {
|
||||
let className = `${cache.key}-${serialized.name}`
|
||||
if (
|
||||
// we only need to add the styles to the registered cache if the
|
||||
// class name could be used further down
|
||||
// the tree but if it's a string tag, we know it won't
|
||||
// so we don't have to add it to registered cache.
|
||||
// this improves memory usage since we can avoid storing the whole style string
|
||||
(isStringTag === false ||
|
||||
// we need to always store it if we're in compat mode and
|
||||
// in node since emotion-server relies on whether a style is in
|
||||
// the registered cache to know whether a style is global or not
|
||||
// also, note that this check will be dead code eliminated in the browser
|
||||
(isBrowser === false && cache.compat !== undefined)) &&
|
||||
cache.registered[className] === undefined
|
||||
) {
|
||||
cache.registered[className] = serialized.styles
|
||||
}
|
||||
}
|
||||
|
||||
export const insertStyles = (
|
||||
cache: EmotionCache,
|
||||
serialized: SerializedStyles,
|
||||
isStringTag: boolean
|
||||
) => {
|
||||
registerStyles(cache, serialized, isStringTag)
|
||||
|
||||
let className = `${cache.key}-${serialized.name}`
|
||||
|
||||
if (cache.inserted[serialized.name] === undefined) {
|
||||
let stylesForSSR = ''
|
||||
let current: SerializedStyles | undefined = serialized
|
||||
do {
|
||||
let maybeStyles = cache.insert(
|
||||
serialized === current ? `.${className}` : '',
|
||||
current,
|
||||
cache.sheet,
|
||||
true
|
||||
)
|
||||
if (!isBrowser && maybeStyles !== undefined) {
|
||||
stylesForSSR += maybeStyles
|
||||
}
|
||||
current = current.next
|
||||
} while (current !== undefined)
|
||||
if (!isBrowser && stylesForSSR.length !== 0) {
|
||||
return stylesForSSR
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export * from './types'
|
||||
26
mc_test/node_modules/@emotion/utils/src/types.ts
generated
vendored
Executable file
26
mc_test/node_modules/@emotion/utils/src/types.ts
generated
vendored
Executable file
@ -0,0 +1,26 @@
|
||||
import type { StyleSheet } from '@emotion/sheet'
|
||||
|
||||
export type { StyleSheet }
|
||||
|
||||
export type RegisteredCache = Record<string, string | undefined>
|
||||
|
||||
export type SerializedStyles = {
|
||||
name: string
|
||||
styles: string
|
||||
next?: SerializedStyles
|
||||
}
|
||||
|
||||
export type EmotionCache = {
|
||||
inserted: Record<string, string | true | undefined>
|
||||
registered: RegisteredCache
|
||||
sheet: StyleSheet
|
||||
key: string
|
||||
compat?: true
|
||||
nonce?: string
|
||||
insert: (
|
||||
selector: string,
|
||||
serialized: SerializedStyles,
|
||||
sheet: StyleSheet,
|
||||
shouldCache: boolean
|
||||
) => string | void
|
||||
}
|
||||
Reference in New Issue
Block a user