@domql/emotion 2.25.3 → 2.27.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/classList.js +7 -2
- package/index.js +18 -5
- package/package.json +3 -3
package/classList.js
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { exec, isObject, isString } from '@domql/utils'
|
|
4
4
|
|
|
5
|
-
export const assignKeyAsClassname =
|
|
5
|
+
export const assignKeyAsClassname = element => {
|
|
6
6
|
const { key } = element
|
|
7
7
|
if (element.class === true) element.class = key
|
|
8
|
-
else if (
|
|
8
|
+
else if (
|
|
9
|
+
!element.class &&
|
|
10
|
+
typeof key === 'string' &&
|
|
11
|
+
key.charAt(0) === '_' &&
|
|
12
|
+
key.charAt(1) !== '_'
|
|
13
|
+
) {
|
|
9
14
|
element.class = key.slice(1)
|
|
10
15
|
}
|
|
11
16
|
}
|
package/index.js
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
// import DOM from '../../src'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
isObjectLike,
|
|
6
|
+
isString,
|
|
7
|
+
isNumber,
|
|
8
|
+
isBoolean,
|
|
9
|
+
exec,
|
|
10
|
+
isObject,
|
|
11
|
+
isEqualDeep,
|
|
12
|
+
isProduction
|
|
13
|
+
} from '@domql/utils'
|
|
5
14
|
import createEmotion from '@emotion/css/create-instance'
|
|
6
15
|
import { applyClassListOnNode } from './classList'
|
|
7
16
|
|
|
8
|
-
export const transformEmotionStyle =
|
|
17
|
+
export const transformEmotionStyle = emotion => {
|
|
9
18
|
return (params, element, state) => {
|
|
10
19
|
const execParams = exec(params, element)
|
|
11
20
|
if (params) {
|
|
@@ -16,15 +25,19 @@ export const transformEmotionStyle = (emotion) => {
|
|
|
16
25
|
}
|
|
17
26
|
}
|
|
18
27
|
|
|
19
|
-
export const transformEmotionClass =
|
|
28
|
+
export const transformEmotionClass = emotion => {
|
|
20
29
|
return (params, element, state, flag) => {
|
|
21
30
|
if (element.style && !flag) return
|
|
22
31
|
const { __ref } = element
|
|
23
32
|
const { __class, __classNames } = __ref
|
|
24
33
|
|
|
25
34
|
if (!isObjectLike(params)) return
|
|
26
|
-
if (element.props.class) {
|
|
27
|
-
|
|
35
|
+
if (element.props.class) {
|
|
36
|
+
__classNames.classProps = element.props.class
|
|
37
|
+
}
|
|
38
|
+
if (element.attr.class) {
|
|
39
|
+
__classNames.class = element.attr.class
|
|
40
|
+
}
|
|
28
41
|
|
|
29
42
|
for (const key in params) {
|
|
30
43
|
const prop = exec(params[key], element)
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/emotion",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.8",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@domql/utils": "^2.
|
|
7
|
+
"@domql/utils": "^2.27.8"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@emotion/css": "*"
|
|
11
11
|
},
|
|
12
|
-
"gitHead": "
|
|
12
|
+
"gitHead": "e783fd54228d5c7aaab9d4b5624199a17a6c4713",
|
|
13
13
|
"source": "index.js"
|
|
14
14
|
}
|