fix: prevent asset conflicts between React and Grid.js versions

Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
dwindown
2026-04-18 17:02:14 +07:00
parent bd9cdac02e
commit e8fbfb14c1
74973 changed files with 6658406 additions and 71 deletions

21
node_modules/@emotion/css/LICENSE generated vendored Normal file
View 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.

345
node_modules/@emotion/css/README.md generated vendored Normal file
View File

@@ -0,0 +1,345 @@
# @emotion/css
The [@emotion/css](https://www.npmjs.com/package/@emotion/css) package is framework agnostic and the simplest way to use Emotion.
## Table of Contents
- [Quick Start](#quick-start)
- [API](#api)
- [Generate Class Names — `css`](#css)
- [Global Styles — `injectGlobal`](#global-styles)
- [Animation Keyframes — `keyframes`](#animation-keyframes)
- [Composing Class Names — `cx`](#cx)
- [Custom Instances](#custom-instances)
- [Server Side Rendering](https://emotion.sh/docs/ssr#api)
- [Babel Plugin](https://emotion.sh/docs/@emotion/babel-plugin)
## Quick Start
Get up and running with a single import.
```bash
npm install --save @emotion/css
```
```javascript
import { css } from '@emotion/css'
const app = document.getElementById('root')
const myStyle = css`
color: rebeccapurple;
`
app.classList.add(myStyle)
```
## API
### css
The `css` function accepts styles as a template literal, object, or array of objects and returns a class name. It is the foundation of emotion.
#### String Styles
```jsx
// @live
import { css } from '@emotion/css'
const color = 'darkgreen'
render(
<div
className={css`
background-color: hotpink;
&:hover {
color: ${color};
}
`}
>
This has a hotpink background.
</div>
)
```
#### Object Styles
```jsx
// @live
import { css } from '@emotion/css'
const color = 'darkgreen'
render(
<div
className={css({
backgroundColor: 'hotpink',
'&:hover': {
color
}
})}
>
This has a hotpink background.
</div>
)
```
#### Array of Object Styles
```jsx
// @live
import { css } from '@emotion/css'
const color = 'darkgreen'
const isDanger = true
render(
<div
className={css([
{
backgroundColor: 'hotpink',
'&:hover': {
color
}
},
isDanger && {
color: 'red'
}
])}
>
This has a hotpink background.
</div>
)
```
### Global Styles
`injectGlobal` injects styles into the global scope and is useful for applications such as css resets or font faces.
```jsx
import { injectGlobal } from '@emotion/css'
injectGlobal`
* {
box-sizing: border-box;
}
@font-face {
font-family: 'Patrick Hand SC';
font-style: normal;
font-weight: 400;
src: local('Patrick Hand SC'),
local('PatrickHandSC-Regular'),
url(https://fonts.gstatic.com/s/patrickhandsc/v4/OYFWCgfCR-7uHIovjUZXsZ71Uis0Qeb9Gqo8IZV7ckE.woff2)
format('woff2');
unicode-range: U+0100-024f, U+1-1eff,
U+20a0-20ab, U+20ad-20cf, U+2c60-2c7f,
U+A720-A7FF;
}
`
```
### Animation Keyframes
`keyframes` generates a unique animation name that can be used to animate elements with CSS animations.
**String Styles**
```jsx
// @live
import { css, keyframes } from '@emotion/css'
const bounce = keyframes`
from, 20%, 53%, 80%, to {
transform: translate3d(0,0,0);
}
40%, 43% {
transform: translate3d(0, -30px, 0);
}
70% {
transform: translate3d(0, -15px, 0);
}
90% {
transform: translate3d(0,-4px,0);
}
`
render(
<img
className={css`
width: 96px;
height: 96px;
border-radius: 50%;
animation: ${bounce} 1s ease infinite;
transform-origin: center bottom;
`}
src={logoUrl}
/>
)
```
**Object Styles**
```jsx
// @live
import { css, keyframes } from '@emotion/css'
const bounce = keyframes({
'from, 20%, 53%, 80%, to': {
transform: 'translate3d(0,0,0)'
},
'40%, 43%': {
transform: 'translate3d(0, -30px, 0)'
},
'70%': {
transform: 'translate3d(0, -15px, 0)'
},
'90%': {
transform: 'translate3d(0, -4px, 0)'
}
})
render(
<img
src={logoUrl}
className={css({
width: 96,
height: 96,
borderRadius: '50%',
animation: `${bounce} 1s ease infinite`,
transformOrigin: 'center bottom'
})}
/>
)
```
### cx
`cx` is emotion's version of the popular [`classnames` library](https://github.com/JedWatson/classnames). The key advantage of `cx` is that it detects emotion generated class names ensuring styles are overwritten in the correct order. Emotion generated styles are applied from left to right. Subsequent styles overwrite property values of previous styles.
**Combining class names**
```jsx
import { cx, css } from '@emotion/css'
const cls1 = css`
font-size: 20px;
background: green;
`
const cls2 = css`
font-size: 20px;
background: blue;
`
<div className={cx(cls1, cls2)} />
```
**Conditional class names**
```jsx
const cls1 = css`
font-size: 20px;
background: green;
`
const cls2 = css`
font-size: 20px;
background: blue;
`
const foo = true
const bar = false
<div
className={cx(
{ [cls1]: foo },
{ [cls2]: bar }
)}
/>
```
**Using class names from other sources**
```jsx
const cls1 = css`
font-size: 20px;
background: green;
`
<div
className={cx(cls1, 'profile')}
/>
```
## Custom Instances
With `@emotion/css/create-instance`, you can provide custom options to Emotion's cache.
The main `@emotion/css` entrypoint can be thought of as a call to `@emotion/css/create-instance` with sensible defaults for most applications.
```javascript
import createEmotion from '@emotion/css/create-instance'
export const {
flush,
hydrate,
cx,
merge,
getRegisteredStyles,
injectGlobal,
keyframes,
css,
sheet,
cache
} = createEmotion()
```
### Upside
- Calling it directly will allow for some low level customization.
- Create custom names for emotion APIs to help with migration from other, similar libraries.
- Could set custom `key` to something other than `css`
### Downside
- Introduces some amount of complexity to your application that can vary depending on developer experience.
- Required to keep up with changes in the repo and API at a lower level than if using `@emotion/css` directly
### Primary use cases
- Using emotion in embedded contexts such as an `<iframe/>`
- Setting a [nonce](/packages/cache#nonce-string) on any `<style/>` tag emotion creates for security purposes
- Use emotion with a container different than `document.head` for style elements
- Using emotion with custom stylis plugins
## Multiple instances in a single app example
```jsx
import createEmotion from '@emotion/css/create-instance'
export const {
flush,
hydrate,
cx,
merge,
getRegisteredStyles,
injectGlobal,
keyframes,
css,
sheet,
cache
} = createEmotion({
// The key option is required when there will be multiple instances in a single app
key: 'some-key'
})
```
## Options
`createEmotion` accepts the same options as [createCache](/packages/cache#options) from `@emotion/cache`.

View File

@@ -0,0 +1,3 @@
export * from "../../dist/declarations/src/create-instance.js";
export { _default as default } from "./emotion-css-create-instance.cjs.default.js";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi1jc3MtY3JlYXRlLWluc3RhbmNlLmNqcy5kLm10cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2Rpc3QvZGVjbGFyYXRpb25zL3NyYy9jcmVhdGUtaW5zdGFuY2UuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9

View File

@@ -0,0 +1,3 @@
export * from "../../dist/declarations/src/create-instance";
export { default } from "../../dist/declarations/src/create-instance";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi1jc3MtY3JlYXRlLWluc3RhbmNlLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vZGlzdC9kZWNsYXJhdGlvbnMvc3JjL2NyZWF0ZS1pbnN0YW5jZS5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=

View File

@@ -0,0 +1 @@
export { default as _default } from "../../dist/declarations/src/create-instance.js"

View File

@@ -0,0 +1 @@
exports._default = require("./emotion-css-create-instance.cjs.js").default;

View File

@@ -0,0 +1,148 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var createCache = require('@emotion/cache');
var serialize = require('@emotion/serialize');
var utils = require('@emotion/utils');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var createCache__default = /*#__PURE__*/_interopDefault(createCache);
function insertWithoutScoping(cache, serialized) {
if (cache.inserted[serialized.name] === undefined) {
return cache.insert('', serialized, cache.sheet, true);
}
}
function merge(registered, css, className) {
var registeredStyles = [];
var rawClassName = utils.getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css(registeredStyles);
}
var createEmotion = function createEmotion(options) {
var cache = createCache__default["default"](options);
cache.sheet.speedy = function (value) {
this.isSpeedy = value;
};
cache.compat = true;
var css = function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serialize.serializeStyles(args, cache.registered, undefined);
utils.insertStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var keyframes = function keyframes() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var serialized = serialize.serializeStyles(args, cache.registered);
var animation = "animation-" + serialized.name;
insertWithoutScoping(cache, {
name: serialized.name,
styles: "@keyframes " + animation + "{" + serialized.styles + "}"
});
return animation;
};
var injectGlobal = function injectGlobal() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
var serialized = serialize.serializeStyles(args, cache.registered);
insertWithoutScoping(cache, serialized);
};
var cx = function cx() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return merge(cache.registered, css, classnames(args));
};
return {
css: css,
cx: cx,
injectGlobal: injectGlobal,
keyframes: keyframes,
hydrate: function hydrate(ids) {
ids.forEach(function (key) {
cache.inserted[key] = true;
});
},
flush: function flush() {
cache.registered = {};
cache.inserted = {};
cache.sheet.flush();
},
sheet: cache.sheet,
cache: cache,
getRegisteredStyles: utils.getRegisteredStyles.bind(null, cache.registered),
merge: merge.bind(null, cache.registered, css)
};
};
var classnames = function classnames(args) {
var cls = '';
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case 'boolean':
break;
case 'object':
{
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
toAdd = '';
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ');
toAdd += k;
}
}
}
break;
}
default:
{
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += ' ');
cls += toAdd;
}
}
return cls;
};
exports["default"] = createEmotion;

View File

@@ -0,0 +1,2 @@
import "./emotion-css-create-instance.cjs.js";
export { _default as default } from "./emotion-css-create-instance.cjs.default.js";

View File

@@ -0,0 +1 @@
exports._default = require("./emotion-css-create-instance.development.cjs.js").default;

View File

@@ -0,0 +1,151 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var createCache = require('@emotion/cache');
var serialize = require('@emotion/serialize');
var utils = require('@emotion/utils');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var createCache__default = /*#__PURE__*/_interopDefault(createCache);
function insertWithoutScoping(cache, serialized) {
if (cache.inserted[serialized.name] === undefined) {
return cache.insert('', serialized, cache.sheet, true);
}
}
function merge(registered, css, className) {
var registeredStyles = [];
var rawClassName = utils.getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css(registeredStyles);
}
var createEmotion = function createEmotion(options) {
var cache = createCache__default["default"](options);
cache.sheet.speedy = function (value) {
if (this.ctr !== 0) {
throw new Error('speedy must be changed before any rules are inserted');
}
this.isSpeedy = value;
};
cache.compat = true;
var css = function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serialize.serializeStyles(args, cache.registered, undefined);
utils.insertStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var keyframes = function keyframes() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var serialized = serialize.serializeStyles(args, cache.registered);
var animation = "animation-" + serialized.name;
insertWithoutScoping(cache, {
name: serialized.name,
styles: "@keyframes " + animation + "{" + serialized.styles + "}"
});
return animation;
};
var injectGlobal = function injectGlobal() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
var serialized = serialize.serializeStyles(args, cache.registered);
insertWithoutScoping(cache, serialized);
};
var cx = function cx() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return merge(cache.registered, css, classnames(args));
};
return {
css: css,
cx: cx,
injectGlobal: injectGlobal,
keyframes: keyframes,
hydrate: function hydrate(ids) {
ids.forEach(function (key) {
cache.inserted[key] = true;
});
},
flush: function flush() {
cache.registered = {};
cache.inserted = {};
cache.sheet.flush();
},
sheet: cache.sheet,
cache: cache,
getRegisteredStyles: utils.getRegisteredStyles.bind(null, cache.registered),
merge: merge.bind(null, cache.registered, css)
};
};
var classnames = function classnames(args) {
var cls = '';
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case 'boolean':
break;
case 'object':
{
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
toAdd = '';
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ');
toAdd += k;
}
}
}
break;
}
default:
{
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += ' ');
cls += toAdd;
}
}
return cls;
};
exports["default"] = createEmotion;

View File

@@ -0,0 +1,2 @@
import "./emotion-css-create-instance.development.cjs.js";
export { _default as default } from "./emotion-css-create-instance.development.cjs.default.js";

View File

@@ -0,0 +1,143 @@
import createCache from '@emotion/cache';
import { serializeStyles } from '@emotion/serialize';
import { getRegisteredStyles, insertStyles } from '@emotion/utils';
function insertWithoutScoping(cache, serialized) {
if (cache.inserted[serialized.name] === undefined) {
return cache.insert('', serialized, cache.sheet, true);
}
}
function merge(registered, css, className) {
var registeredStyles = [];
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css(registeredStyles);
}
var createEmotion = function createEmotion(options) {
var cache = createCache(options);
cache.sheet.speedy = function (value) {
if (this.ctr !== 0) {
throw new Error('speedy must be changed before any rules are inserted');
}
this.isSpeedy = value;
};
cache.compat = true;
var css = function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serializeStyles(args, cache.registered, undefined);
insertStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var keyframes = function keyframes() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var serialized = serializeStyles(args, cache.registered);
var animation = "animation-" + serialized.name;
insertWithoutScoping(cache, {
name: serialized.name,
styles: "@keyframes " + animation + "{" + serialized.styles + "}"
});
return animation;
};
var injectGlobal = function injectGlobal() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
var serialized = serializeStyles(args, cache.registered);
insertWithoutScoping(cache, serialized);
};
var cx = function cx() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return merge(cache.registered, css, classnames(args));
};
return {
css: css,
cx: cx,
injectGlobal: injectGlobal,
keyframes: keyframes,
hydrate: function hydrate(ids) {
ids.forEach(function (key) {
cache.inserted[key] = true;
});
},
flush: function flush() {
cache.registered = {};
cache.inserted = {};
cache.sheet.flush();
},
sheet: cache.sheet,
cache: cache,
getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
merge: merge.bind(null, cache.registered, css)
};
};
var classnames = function classnames(args) {
var cls = '';
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case 'boolean':
break;
case 'object':
{
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
toAdd = '';
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ');
toAdd += k;
}
}
}
break;
}
default:
{
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += ' ');
cls += toAdd;
}
}
return cls;
};
export { createEmotion as default };

View File

@@ -0,0 +1,140 @@
import createCache from '@emotion/cache';
import { serializeStyles } from '@emotion/serialize';
import { getRegisteredStyles, insertStyles } from '@emotion/utils';
function insertWithoutScoping(cache, serialized) {
if (cache.inserted[serialized.name] === undefined) {
return cache.insert('', serialized, cache.sheet, true);
}
}
function merge(registered, css, className) {
var registeredStyles = [];
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css(registeredStyles);
}
var createEmotion = function createEmotion(options) {
var cache = createCache(options);
cache.sheet.speedy = function (value) {
this.isSpeedy = value;
};
cache.compat = true;
var css = function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serializeStyles(args, cache.registered, undefined);
insertStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var keyframes = function keyframes() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
var serialized = serializeStyles(args, cache.registered);
var animation = "animation-" + serialized.name;
insertWithoutScoping(cache, {
name: serialized.name,
styles: "@keyframes " + animation + "{" + serialized.styles + "}"
});
return animation;
};
var injectGlobal = function injectGlobal() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
var serialized = serializeStyles(args, cache.registered);
insertWithoutScoping(cache, serialized);
};
var cx = function cx() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return merge(cache.registered, css, classnames(args));
};
return {
css: css,
cx: cx,
injectGlobal: injectGlobal,
keyframes: keyframes,
hydrate: function hydrate(ids) {
ids.forEach(function (key) {
cache.inserted[key] = true;
});
},
flush: function flush() {
cache.registered = {};
cache.inserted = {};
cache.sheet.flush();
},
sheet: cache.sheet,
cache: cache,
getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
merge: merge.bind(null, cache.registered, css)
};
};
var classnames = function classnames(args) {
var cls = '';
for (var i = 0; i < args.length; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case 'boolean':
break;
case 'object':
{
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
toAdd = '';
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ');
toAdd += k;
}
}
}
break;
}
default:
{
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += ' ');
cls += toAdd;
}
}
return cls;
};
export { createEmotion as default };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
{
"main": "dist/emotion-css-create-instance.cjs.js",
"module": "dist/emotion-css-create-instance.esm.js",
"umd:main": "dist/emotion-css-create-instance.umd.min.js",
"types": "dist/emotion-css-create-instance.cjs.d.ts",
"preconstruct": {
"umdName": "createEmotion"
}
}

View File

@@ -0,0 +1,30 @@
import { CSSInterpolation } from '@emotion/serialize';
import { EmotionCache, Options } from '@emotion/cache';
import { StyleSheet } from '@emotion/sheet';
export type { CSSInterpolation, ArrayCSSInterpolation, ComponentSelector, CSSObject } from '@emotion/serialize';
export type { EmotionCache, Options };
export interface ArrayClassNamesArg extends Array<ClassNamesArg> {
}
export type ClassNamesArg = undefined | null | string | boolean | {
[className: string]: boolean | null | undefined;
} | ArrayClassNamesArg;
export interface CSSStyleSheet extends StyleSheet {
speedy(value: boolean): void;
}
export interface Emotion {
css(template: TemplateStringsArray, ...args: Array<CSSInterpolation>): string;
css(...args: Array<CSSInterpolation>): string;
cx(...classNames: Array<ClassNamesArg>): string;
flush(): void;
hydrate(ids: Array<string>): void;
injectGlobal(template: TemplateStringsArray, ...args: Array<CSSInterpolation>): void;
injectGlobal(...args: Array<CSSInterpolation>): void;
keyframes(template: TemplateStringsArray, ...args: Array<CSSInterpolation>): string;
keyframes(...args: Array<CSSInterpolation>): string;
sheet: CSSStyleSheet;
cache: EmotionCache;
merge(className: string): string;
getRegisteredStyles(registeredStyles: Array<string>, className: string): string;
}
declare let createEmotion: (options: Options) => Emotion;
export default createEmotion;

View File

@@ -0,0 +1,10 @@
export declare const flush: () => void, hydrate: (ids: string[]) => void, cx: (...classNames: import("./create-instance.js").ClassNamesArg[]) => string, merge: (className: string) => string, getRegisteredStyles: (registeredStyles: string[], className: string) => string, injectGlobal: {
(template: TemplateStringsArray, ...args: import("./create-instance.js").CSSInterpolation[]): void;
(...args: import("./create-instance.js").CSSInterpolation[]): void;
}, keyframes: {
(template: TemplateStringsArray, ...args: import("./create-instance.js").CSSInterpolation[]): string;
(...args: import("./create-instance.js").CSSInterpolation[]): string;
}, css: {
(template: TemplateStringsArray, ...args: import("./create-instance.js").CSSInterpolation[]): string;
(...args: import("./create-instance.js").CSSInterpolation[]): string;
}, sheet: import("./create-instance.js").CSSStyleSheet, cache: import("./create-instance.js").EmotionCache;

2
node_modules/@emotion/css/dist/emotion-css.cjs.d.mts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from "./declarations/src/index.js";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi1jc3MuY2pzLmQubXRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==

2
node_modules/@emotion/css/dist/emotion-css.cjs.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from "./declarations/src/index";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi1jc3MuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9

33
node_modules/@emotion/css/dist/emotion-css.cjs.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var createInstance_dist_emotionCssCreateInstance = require('../create-instance/dist/emotion-css-create-instance.cjs.js');
require('@emotion/cache');
require('@emotion/serialize');
require('@emotion/utils');
var _createEmotion = createInstance_dist_emotionCssCreateInstance["default"]({
key: 'css'
}),
flush = _createEmotion.flush,
hydrate = _createEmotion.hydrate,
cx = _createEmotion.cx,
merge = _createEmotion.merge,
getRegisteredStyles = _createEmotion.getRegisteredStyles,
injectGlobal = _createEmotion.injectGlobal,
keyframes = _createEmotion.keyframes,
css = _createEmotion.css,
sheet = _createEmotion.sheet,
cache = _createEmotion.cache;
exports.cache = cache;
exports.css = css;
exports.cx = cx;
exports.flush = flush;
exports.getRegisteredStyles = getRegisteredStyles;
exports.hydrate = hydrate;
exports.injectGlobal = injectGlobal;
exports.keyframes = keyframes;
exports.merge = merge;
exports.sheet = sheet;

12
node_modules/@emotion/css/dist/emotion-css.cjs.mjs generated vendored Normal file
View File

@@ -0,0 +1,12 @@
export {
cache,
css,
cx,
flush,
getRegisteredStyles,
hydrate,
injectGlobal,
keyframes,
merge,
sheet
} from "./emotion-css.cjs.js";

View File

@@ -0,0 +1,33 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var createInstance_dist_emotionCssCreateInstance = require('../create-instance/dist/emotion-css-create-instance.development.cjs.js');
require('@emotion/cache');
require('@emotion/serialize');
require('@emotion/utils');
var _createEmotion = createInstance_dist_emotionCssCreateInstance["default"]({
key: 'css'
}),
flush = _createEmotion.flush,
hydrate = _createEmotion.hydrate,
cx = _createEmotion.cx,
merge = _createEmotion.merge,
getRegisteredStyles = _createEmotion.getRegisteredStyles,
injectGlobal = _createEmotion.injectGlobal,
keyframes = _createEmotion.keyframes,
css = _createEmotion.css,
sheet = _createEmotion.sheet,
cache = _createEmotion.cache;
exports.cache = cache;
exports.css = css;
exports.cx = cx;
exports.flush = flush;
exports.getRegisteredStyles = getRegisteredStyles;
exports.hydrate = hydrate;
exports.injectGlobal = injectGlobal;
exports.keyframes = keyframes;
exports.merge = merge;
exports.sheet = sheet;

View File

@@ -0,0 +1,12 @@
export {
cache,
css,
cx,
flush,
getRegisteredStyles,
hydrate,
injectGlobal,
keyframes,
merge,
sheet
} from "./emotion-css.development.cjs.js";

View File

@@ -0,0 +1,20 @@
import createEmotion from '../create-instance/dist/emotion-css-create-instance.development.esm.js';
import '@emotion/cache';
import '@emotion/serialize';
import '@emotion/utils';
var _createEmotion = createEmotion({
key: 'css'
}),
flush = _createEmotion.flush,
hydrate = _createEmotion.hydrate,
cx = _createEmotion.cx,
merge = _createEmotion.merge,
getRegisteredStyles = _createEmotion.getRegisteredStyles,
injectGlobal = _createEmotion.injectGlobal,
keyframes = _createEmotion.keyframes,
css = _createEmotion.css,
sheet = _createEmotion.sheet,
cache = _createEmotion.cache;
export { cache, css, cx, flush, getRegisteredStyles, hydrate, injectGlobal, keyframes, merge, sheet };

20
node_modules/@emotion/css/dist/emotion-css.esm.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import createEmotion from '../create-instance/dist/emotion-css-create-instance.esm.js';
import '@emotion/cache';
import '@emotion/serialize';
import '@emotion/utils';
var _createEmotion = createEmotion({
key: 'css'
}),
flush = _createEmotion.flush,
hydrate = _createEmotion.hydrate,
cx = _createEmotion.cx,
merge = _createEmotion.merge,
getRegisteredStyles = _createEmotion.getRegisteredStyles,
injectGlobal = _createEmotion.injectGlobal,
keyframes = _createEmotion.keyframes,
css = _createEmotion.css,
sheet = _createEmotion.sheet,
cache = _createEmotion.cache;
export { cache, css, cx, flush, getRegisteredStyles, hydrate, injectGlobal, keyframes, merge, sheet };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
node_modules/@emotion/css/macro.d.mts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from './macro.js'

1
node_modules/@emotion/css/macro.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from '@emotion/css'

1
node_modules/@emotion/css/macro.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require('@emotion/babel-plugin').macros.vanillaEmotion

106
node_modules/@emotion/css/package.json generated vendored Normal file
View File

@@ -0,0 +1,106 @@
{
"name": "@emotion/css",
"version": "11.13.5",
"description": "The Next Generation of CSS-in-JS.",
"main": "dist/emotion-css.cjs.js",
"module": "dist/emotion-css.esm.js",
"types": "dist/emotion-css.cjs.d.ts",
"files": [
"src",
"dist",
"types",
"macro.*",
"create-instance"
],
"scripts": {
"test:typescript": "dtslint types"
},
"dependencies": {
"@emotion/babel-plugin": "^11.13.5",
"@emotion/cache": "^11.13.5",
"@emotion/serialize": "^1.3.3",
"@emotion/sheet": "^1.4.0",
"@emotion/utils": "^1.4.2"
},
"devDependencies": {
"@definitelytyped/dtslint": "0.0.112",
"typescript": "^5.4.5"
},
"author": "Kye Hohenberger",
"homepage": "https://emotion.sh",
"license": "MIT",
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/css",
"keywords": [
"styles",
"emotion",
"react",
"css",
"css-in-js"
],
"bugs": {
"url": "https://github.com/emotion-js/emotion/issues"
},
"umd:main": "dist/emotion-css.umd.min.js",
"exports": {
".": {
"types": {
"import": "./dist/emotion-css.cjs.mjs",
"default": "./dist/emotion-css.cjs.js"
},
"development": {
"module": "./dist/emotion-css.development.esm.js",
"import": "./dist/emotion-css.development.cjs.mjs",
"default": "./dist/emotion-css.development.cjs.js"
},
"module": "./dist/emotion-css.esm.js",
"import": "./dist/emotion-css.cjs.mjs",
"default": "./dist/emotion-css.cjs.js"
},
"./create-instance": {
"types": {
"import": "./create-instance/dist/emotion-css-create-instance.cjs.mjs",
"default": "./create-instance/dist/emotion-css-create-instance.cjs.js"
},
"development": {
"module": "./create-instance/dist/emotion-css-create-instance.development.esm.js",
"import": "./create-instance/dist/emotion-css-create-instance.development.cjs.mjs",
"default": "./create-instance/dist/emotion-css-create-instance.development.cjs.js"
},
"module": "./create-instance/dist/emotion-css-create-instance.esm.js",
"import": "./create-instance/dist/emotion-css-create-instance.cjs.mjs",
"default": "./create-instance/dist/emotion-css-create-instance.cjs.js"
},
"./package.json": "./package.json",
"./macro": {
"types": {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
},
"imports": {
"#is-development": {
"development": "./src/conditions/true.ts",
"default": "./src/conditions/false.ts"
}
},
"preconstruct": {
"umdName": "emotion",
"entrypoints": [
"./index.ts",
"./create-instance.ts"
],
"exports": {
"extra": {
"./macro": {
"types": {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
}
}
}
}

1
node_modules/@emotion/css/src/conditions/false.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default false as boolean

1
node_modules/@emotion/css/src/conditions/true.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default true as boolean

191
node_modules/@emotion/css/src/create-instance.ts generated vendored Normal file
View File

@@ -0,0 +1,191 @@
import createCache from '@emotion/cache'
import {
serializeStyles,
CSSInterpolation,
Interpolation
} from '@emotion/serialize'
import {
insertStyles,
getRegisteredStyles,
SerializedStyles,
RegisteredCache
} from '@emotion/utils'
import { EmotionCache, Options } from '@emotion/cache'
import { StyleSheet } from '@emotion/sheet'
import isDevelopment from '#is-development'
export type {
CSSInterpolation,
ArrayCSSInterpolation,
ComponentSelector,
CSSObject
} from '@emotion/serialize'
function insertWithoutScoping(
cache: EmotionCache,
serialized: SerializedStyles
) {
if (cache.inserted[serialized.name] === undefined) {
return cache.insert('', serialized, cache.sheet, true)
}
}
export type { EmotionCache, Options }
export interface ArrayClassNamesArg extends Array<ClassNamesArg> {}
export type ClassNamesArg =
| undefined
| null
| string
| boolean
| { [className: string]: boolean | null | undefined }
| ArrayClassNamesArg
export interface CSSStyleSheet extends StyleSheet {
speedy(value: boolean): void
}
export interface Emotion {
css(template: TemplateStringsArray, ...args: Array<CSSInterpolation>): string
css(...args: Array<CSSInterpolation>): string
cx(...classNames: Array<ClassNamesArg>): string
flush(): void
hydrate(ids: Array<string>): void
injectGlobal(
template: TemplateStringsArray,
...args: Array<CSSInterpolation>
): void
injectGlobal(...args: Array<CSSInterpolation>): void
keyframes(
template: TemplateStringsArray,
...args: Array<CSSInterpolation>
): string
keyframes(...args: Array<CSSInterpolation>): string
sheet: CSSStyleSheet
cache: EmotionCache
merge(className: string): string
getRegisteredStyles(
registeredStyles: Array<string>,
className: string
): string
}
function merge(
registered: RegisteredCache,
css: Emotion['css'],
className: string
) {
const registeredStyles: string[] = []
const rawClassName = getRegisteredStyles(
registered,
registeredStyles,
className
)
if (registeredStyles.length < 2) {
return className
}
return rawClassName + css(registeredStyles)
}
let createEmotion = (options: Options): Emotion => {
let cache = createCache(options)
;(cache.sheet as CSSStyleSheet).speedy = function (value: boolean) {
if (isDevelopment && this.ctr !== 0) {
throw new Error('speedy must be changed before any rules are inserted')
}
this.isSpeedy = value
}
cache.compat = true
let css: Emotion['css'] = (
...args: (TemplateStringsArray | Interpolation<unknown>)[]
) => {
let serialized = serializeStyles(args, cache.registered, undefined)
insertStyles(cache, serialized, false)
return `${cache.key}-${serialized.name}`
}
let keyframes: Emotion['keyframes'] = (
...args: (TemplateStringsArray | Interpolation<unknown>)[]
) => {
let serialized = serializeStyles(args, cache.registered)
let animation = `animation-${serialized.name}`
insertWithoutScoping(cache, {
name: serialized.name,
styles: `@keyframes ${animation}{${serialized.styles}}`
})
return animation
}
let injectGlobal: Emotion['injectGlobal'] = (
...args: (TemplateStringsArray | Interpolation<unknown>)[]
) => {
let serialized = serializeStyles(args, cache.registered)
insertWithoutScoping(cache, serialized)
}
let cx: Emotion['cx'] = (...args) => {
return merge(cache.registered, css, classnames(args))
}
return {
css,
cx,
injectGlobal,
keyframes,
hydrate(ids) {
ids.forEach(key => {
cache.inserted[key] = true
})
},
flush() {
cache.registered = {}
cache.inserted = {}
cache.sheet.flush()
},
sheet: cache.sheet as CSSStyleSheet,
cache,
getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
merge: merge.bind(null, cache.registered, css)
}
}
let classnames = (args: ClassNamesArg[]) => {
let cls = ''
for (let i = 0; i < args.length; i++) {
let arg = args[i]
if (arg == null) continue
let toAdd
switch (typeof arg) {
case 'boolean':
break
case 'object': {
if (Array.isArray(arg)) {
toAdd = classnames(arg)
} else {
toAdd = ''
for (const k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ')
toAdd += k
}
}
}
break
}
default: {
toAdd = arg
}
}
if (toAdd) {
cls && (cls += ' ')
cls += toAdd
}
}
return cls
}
export default createEmotion

14
node_modules/@emotion/css/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import createEmotion from './create-instance'
export const {
flush,
hydrate,
cx,
merge,
getRegisteredStyles,
injectGlobal,
keyframes,
css,
sheet,
cache
} = createEmotion({ key: 'css' })

4
node_modules/@emotion/css/types/create-instance.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
// TypeScript Version: 2.8
export * from '../create-instance'
export { default } from '../create-instance'

1
node_modules/@emotion/css/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from '..'

View File

@@ -0,0 +1,171 @@
import createEmotion from '@emotion/css/create-instance'
// $ExpectType Emotion
const emotion0 = createEmotion({ key: 'bar' })
// $ExpectType Emotion
const emotion1 = createEmotion({
key: 'foo',
container: document.head,
nonce: 'fasefw'
})
// $ExpectError
createEmotion('abc')
// $ExpectError
createEmotion({}, undefined as any)
const {
flush,
hydrate,
cx,
merge,
getRegisteredStyles,
css,
injectGlobal,
keyframes,
sheet,
cache
} = emotion0
flush()
// $ExpectError
flush(undefined as any)
hydrate([])
hydrate(['123'])
// $ExpectError
hydrate()
// $ExpectError
hydrate([0])
// $ExpectError
hydrate([], undefined as any)
cx()
cx(true)
cx('123')
cx('123', 'pf')
cx({
abc: false,
fp: true,
opt1: null,
opt2: undefined
})
cx([])
cx([
'cl',
{
fp: true
}
])
cx([['abc']])
// $ExpectError
cx(5)
merge('abc def fpfp')
getRegisteredStyles([], 'abc')
getRegisteredStyles(['abc'], 'bcd')
getRegisteredStyles([], 'abc def fpfw')
css`
height: 20px;
`
css`
color: ${'green'};
font-size: ${10 + 4}px;
`
css()
css(1)
css('abc')
css(true)
css([])
css([1])
css([['abc', 'asdf'], 'efw'])
css({
':active': {
borderRadius: '2px',
overflowAnchor: 'none',
clear: ['both', 'left']
},
'::before': {
borderRadius: '2px'
}
})
css(true, true)
css('fa', 1123)
css(['123'], 'asdf')
// $ExpectError
css({
width: {}
})
// $ExpectError
css({
color: 5
})
injectGlobal`
background: black;
`
injectGlobal()
injectGlobal(30)
injectGlobal('this-is-class')
injectGlobal({})
injectGlobal([
{
animationDelay: '200ms'
}
])
// $ExpectError
injectGlobal({
backgroundColor: 4
})
keyframes`
from {
width: 100%;
}
to {
width: 50%;
}
`
keyframes()
keyframes({
from: {
marginLeft: '100%'
},
to: {
marginLeft: '50%'
}
})
keyframes([
{
from: {
marginLeft: '100%'
},
to: {
marginLeft: '50%'
}
},
{
'0%': {
width: '100px'
},
'50%': {
width: '50px'
},
'100%': {
width: '120px'
}
}
])
// $ExpectError
keyframes({
'0%': {
backgroundOrigin: 0
}
})

91
node_modules/@emotion/css/types/tests.ts generated vendored Normal file
View File

@@ -0,0 +1,91 @@
import {
flush,
hydrate,
cx,
merge,
getRegisteredStyles,
css,
injectGlobal,
keyframes,
sheet,
cache
} from '@emotion/css'
flush()
hydrate(['css-123', 'css-456'])
const cssObject = {
height: 100,
width: '100%',
display: 'block',
position: undefined,
':hover': {
display: 'block'
}
}
const className: string = css`
${(true as boolean) && ''}
${'bar'}
${css``}
${1}
${cssObject}
`
const className2: string = css(cssObject)
css([{ display: 'none' }, [{ position: 'relative' }, { width: 100 }]])
css({ display: 'none' }, [{ position: 'relative' }, { width: 100 }])
css(null)
injectGlobal`
#foo {
font-face: 'Foo';
}
`
injectGlobal({
html: {
width: '100vw',
height: '100vh'
},
'#root': {
fontWeight: 'bold'
}
})
keyframes({
'0%': {
transform: 'scaleY(0.5)'
},
to: {
transform: 'scaleY(1)'
}
})
keyframes`
0% {
transform: translateX(100%);
}
40% {
transform: translateX(50%);
}
60% {
transform: translateX(30%);
}
100% {
transform: translateX(100%);
}
`
const cxResult: string = cx([
[className, false && className2, 'modal'],
[[className, { [className2]: true }, 'profile']]
])
merge(`class1 class2 ${className}`)
getRegisteredStyles([], className)

19
node_modules/@emotion/css/types/tsconfig.json generated vendored Normal file
View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"baseUrl": "../",
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["es6", "dom"],
"module": "commonjs",
"noEmit": true,
"strict": true,
"target": "es5",
"typeRoots": ["../"],
"types": [],
"paths": {
"#is-browser": ["./src/conditions/true.ts"],
"#is-development": ["./src/conditions/true.ts"]
}
},
"include": ["./*.ts", "./*.tsx"]
}

24
node_modules/@emotion/css/types/tslint.json generated vendored Normal file
View File

@@ -0,0 +1,24 @@
{
"extends": "@definitelytyped/dtslint/dtslint.json",
"rules": {
"array-type": [true, "generic"],
"import-spacing": false,
"file-name-casing": false,
"no-default-import": false,
"no-null-undefined-union": false,
"semicolon": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-rest-spread",
"check-type",
"check-typecast",
"check-type-operator",
"check-preblock"
],
"unnecessary-bind": false
}
}