@symbo.ls/atoms 2.11.332 → 2.11.334
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/Block.js +13 -13
- package/Flex.js +3 -1
- package/Media.js +5 -4
- package/package.json +2 -2
package/Block.js
CHANGED
|
@@ -36,7 +36,7 @@ export const Block = {
|
|
|
36
36
|
height: ({ props, deps }) => deps.transformSizeRatio('height', props),
|
|
37
37
|
|
|
38
38
|
boxSize: ({ props, deps }) => {
|
|
39
|
-
if (
|
|
39
|
+
if (!isString(props.boxSize)) return
|
|
40
40
|
const [height, width] = props.boxSize.split(' ')
|
|
41
41
|
return {
|
|
42
42
|
...deps.transformSize('height', height),
|
|
@@ -47,7 +47,7 @@ export const Block = {
|
|
|
47
47
|
minWidth: ({ props, deps }) => deps.transformSizeRatio('minWidth', props),
|
|
48
48
|
maxWidth: ({ props, deps }) => deps.transformSizeRatio('maxWidth', props),
|
|
49
49
|
widthRange: ({ props, deps }) => {
|
|
50
|
-
if (
|
|
50
|
+
if (!isString(props.widthRange)) return
|
|
51
51
|
const [minWidth, maxWidth] = props.widthRange.split(' ')
|
|
52
52
|
return {
|
|
53
53
|
...deps.transformSize('minWidth', minWidth),
|
|
@@ -58,7 +58,7 @@ export const Block = {
|
|
|
58
58
|
minHeight: ({ props, deps }) => deps.transformSizeRatio('minHeight', props),
|
|
59
59
|
maxHeight: ({ props, deps }) => deps.transformSizeRatio('maxHeight', props),
|
|
60
60
|
heightRange: ({ props, deps }) => {
|
|
61
|
-
if (
|
|
61
|
+
if (!isString(props.heightRange)) return
|
|
62
62
|
const [minHeight, maxHeight] = props.heightRange.split(' ')
|
|
63
63
|
return {
|
|
64
64
|
...deps.transformSize('minHeight', minHeight),
|
|
@@ -67,8 +67,8 @@ export const Block = {
|
|
|
67
67
|
},
|
|
68
68
|
|
|
69
69
|
minSize: ({ props, deps }) => {
|
|
70
|
-
if (
|
|
71
|
-
const [minHeight, minWidth] = props.
|
|
70
|
+
if (!isString(props.minSize)) return
|
|
71
|
+
const [minHeight, minWidth] = props.minSize.split(' ')
|
|
72
72
|
return {
|
|
73
73
|
...deps.transformSize('minHeight', minHeight),
|
|
74
74
|
...deps.transformSize('minWidth', minWidth || minHeight)
|
|
@@ -76,8 +76,8 @@ export const Block = {
|
|
|
76
76
|
},
|
|
77
77
|
|
|
78
78
|
maxSize: ({ props, deps }) => {
|
|
79
|
-
if (
|
|
80
|
-
const [maxHeight, maxWidth] = props.
|
|
79
|
+
if (!isString(props.maxSize)) return
|
|
80
|
+
const [maxHeight, maxWidth] = props.maxSize.split(' ')
|
|
81
81
|
return {
|
|
82
82
|
...deps.transformSize('maxHeight', maxHeight),
|
|
83
83
|
...deps.transformSize('maxWidth', maxWidth || maxHeight)
|
|
@@ -97,7 +97,7 @@ export const Block = {
|
|
|
97
97
|
padding: ({ props, deps }) => deps.transformSizeRatio('padding', props),
|
|
98
98
|
scrollPadding: ({ props, deps }) => deps.transformSizeRatio('scrollPadding', props),
|
|
99
99
|
paddingInline: ({ props, deps }) => {
|
|
100
|
-
if (
|
|
100
|
+
if (!isString(props.paddingInline)) return
|
|
101
101
|
const [paddingInlineStart, paddingInlineEnd] = props.paddingInline.split(' ')
|
|
102
102
|
return {
|
|
103
103
|
...deps.transformSize('paddingInlineStart', paddingInlineStart),
|
|
@@ -119,7 +119,7 @@ export const Block = {
|
|
|
119
119
|
|
|
120
120
|
margin: ({ props, deps }) => deps.transformSizeRatio('margin', props),
|
|
121
121
|
marginInline: ({ props, deps }) => {
|
|
122
|
-
if (
|
|
122
|
+
if (!isString(props.marginInline)) return
|
|
123
123
|
const [marginInlineStart, marginInlineEnd] = props.marginInline.split(' ')
|
|
124
124
|
return {
|
|
125
125
|
...deps.transformSize('marginInlineStart', marginInlineStart),
|
|
@@ -127,7 +127,7 @@ export const Block = {
|
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
marginBlock: ({ props, deps }) => {
|
|
130
|
-
if (
|
|
130
|
+
if (!isString(props.marginBlock)) return
|
|
131
131
|
const [marginBlockStart, marginBlockEnd] = props.marginBlock.split(' ')
|
|
132
132
|
return {
|
|
133
133
|
...deps.transformSize('marginBlockStart', marginBlockStart),
|
|
@@ -178,7 +178,7 @@ export const Block = {
|
|
|
178
178
|
flexFlow: props.flexFlow + (props.reverse ? '-reverse' : '')
|
|
179
179
|
}),
|
|
180
180
|
flexAlign: ({ props }) => {
|
|
181
|
-
if (
|
|
181
|
+
if (!isString(props.flexAlign)) return
|
|
182
182
|
const [alignItems, justifyContent] = props.flexAlign.split(' ')
|
|
183
183
|
return {
|
|
184
184
|
display: 'flex',
|
|
@@ -201,7 +201,7 @@ export const Block = {
|
|
|
201
201
|
}),
|
|
202
202
|
|
|
203
203
|
size: ({ props, deps }) => {
|
|
204
|
-
if (
|
|
204
|
+
if (!isString(props.heightRange)) return
|
|
205
205
|
const [minHeight, maxHeight] = props.heightRange.split(' ')
|
|
206
206
|
return {
|
|
207
207
|
...deps.transformSizeRatio('minHeight', minHeight),
|
|
@@ -251,7 +251,7 @@ export const Gutter = {
|
|
|
251
251
|
},
|
|
252
252
|
class: {
|
|
253
253
|
size: ({ props, deps }) => {
|
|
254
|
-
if (
|
|
254
|
+
if (!isString(props.size)) return
|
|
255
255
|
const [height, width] = props.size.split(' ')
|
|
256
256
|
return {
|
|
257
257
|
...deps.getSpacingByKey('height', height),
|
package/Flex.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { isString } from '@domql/utils'
|
|
3
|
+
import { isString, isUndefined } from '@domql/utils'
|
|
4
4
|
|
|
5
5
|
export const Flex = {
|
|
6
6
|
props: {
|
|
@@ -19,6 +19,8 @@ export const Flex = {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
|
|
22
|
+
verticalAlign: ({ props }) => !isUndefined(props.verticalAlign) && ({ flexWrap: props.verticalAlign }),
|
|
23
|
+
|
|
22
24
|
wrap: ({ props }) => props.wrap && ({ flexWrap: props.wrap }),
|
|
23
25
|
align: ({ props }) => {
|
|
24
26
|
if (!isString(props.align)) return
|
package/Media.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { merge, isArray, overwriteShallow } from '@domql/utils'
|
|
3
|
+
import { merge, isArray, overwriteDeep, overwriteShallow } from '@domql/utils'
|
|
4
4
|
import { getSystemTheme } from './Theme'
|
|
5
5
|
|
|
6
6
|
export const keySetters = {
|
|
@@ -130,13 +130,13 @@ const applyConditionalCaseProps = (key, props, result, element) => {
|
|
|
130
130
|
const caseKey = key.slice(1)
|
|
131
131
|
const isPropTrue = element.props[caseKey] || element.state[caseKey]
|
|
132
132
|
if (!isPropTrue) return // remove classname if not here
|
|
133
|
-
return
|
|
133
|
+
return overwriteDeep(result, convertPropsToClass(props, result, element))
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
const applyConditionalFalsyProps = (key, props, result, element) => {
|
|
137
137
|
const caseKey = key.slice(1)
|
|
138
138
|
const isPropTrue = element.props[caseKey] || element.state[caseKey] === true
|
|
139
|
-
if (!isPropTrue) return
|
|
139
|
+
if (!isPropTrue) return overwriteDeep(result, convertPropsToClass(props, result, element))
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
const applyTrueProps = (props, result, element) => merge(result, convertPropsToClass(props, result, element))
|
|
@@ -166,9 +166,10 @@ const beforeClassAssign = (element, s) => {
|
|
|
166
166
|
isForced: true,
|
|
167
167
|
preventDefineUpdate: true
|
|
168
168
|
})
|
|
169
|
-
}
|
|
169
|
+
}
|
|
170
170
|
}
|
|
171
171
|
if (setter) setter(key, props[key], CLASS_NAMES, element)
|
|
172
|
+
else if (key === 'true') applyTrueProps(props[key], CLASS_NAMES, element)
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
// override props
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/atoms",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.334",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "dfa7309d692f0060cfa63b38758809a768a6abec",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@domql/state": "latest",
|
|
9
9
|
"@domql/utils": "latest",
|