@symbo.ls/atoms 2.11.424 → 2.11.427

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 CHANGED
@@ -30,12 +30,16 @@ export const Block = {
30
30
  display: props.display
31
31
  }),
32
32
 
33
- hide: ({ props, deps }) => props.hide && ({
33
+ show: (el, s, ctx) => (ctx.utils.exec(el.props.show, el, s) === false) && ({
34
+ display: 'none !important'
35
+ }),
36
+
37
+ hide: (el, s, ctx) => ctx.utils.exec(el.props.hide, el, s) && ({
34
38
  display: 'none !important'
35
39
  }),
36
40
 
37
- width: ({ props, deps }) => deps.transformSizeRatio('width', props),
38
41
  height: ({ props, deps }) => deps.transformSizeRatio('height', props),
42
+ width: ({ props, deps }) => deps.transformSizeRatio('width', props),
39
43
 
40
44
  boxSize: ({ props, deps }) => {
41
45
  if (!deps.isString(props.boxSize)) return
@@ -46,6 +50,9 @@ export const Block = {
46
50
  }
47
51
  },
48
52
 
53
+ inlineSize: ({ props, deps }) => deps.transformSizeRatio('inlineSize', props),
54
+ blockSize: ({ props, deps }) => deps.transformSizeRatio('blockSize', props),
55
+
49
56
  minWidth: ({ props, deps }) => deps.transformSizeRatio('minWidth', props),
50
57
  maxWidth: ({ props, deps }) => deps.transformSizeRatio('maxWidth', props),
51
58
  widthRange: ({ props, deps }) => {
@@ -68,21 +75,30 @@ export const Block = {
68
75
  }
69
76
  },
70
77
 
78
+ size: ({ props, deps }) => {
79
+ if (!deps.isString(props.size)) return
80
+ const [inlineSize, blockSize] = props.size.split(' ')
81
+ return {
82
+ ...deps.transformSizeRatio('inlineSize', inlineSize),
83
+ ...deps.transformSizeRatio('blockSize', blockSize || inlineSize)
84
+ }
85
+ },
86
+
71
87
  minSize: ({ props, deps }) => {
72
88
  if (!deps.isString(props.minSize)) return
73
- const [minHeight, minWidth] = props.minSize.split(' ')
89
+ const [minInlineSize, minBlockSize] = props.minSize.split(' ')
74
90
  return {
75
- ...deps.transformSize('minHeight', minHeight),
76
- ...deps.transformSize('minWidth', minWidth || minHeight)
91
+ ...deps.transformSize('minInlineSize', minInlineSize),
92
+ ...deps.transformSize('minBlockSize', minBlockSize || minInlineSize)
77
93
  }
78
94
  },
79
95
 
80
96
  maxSize: ({ props, deps }) => {
81
97
  if (!deps.isString(props.maxSize)) return
82
- const [maxHeight, maxWidth] = props.maxSize.split(' ')
98
+ const [maxInlineSize, maxBlockSize] = props.maxSize.split(' ')
83
99
  return {
84
- ...deps.transformSize('maxHeight', maxHeight),
85
- ...deps.transformSize('maxWidth', maxWidth || maxHeight)
100
+ ...deps.transformSize('maxInlineSize', maxInlineSize),
101
+ ...deps.transformSize('maxBlockSize', maxBlockSize || maxInlineSize)
86
102
  }
87
103
  },
88
104
 
@@ -148,6 +164,10 @@ export const Block = {
148
164
  gap: ({ props, deps }) => !deps.isUndefined(props.gap) && ({
149
165
  gap: transfromGap(props.gap)
150
166
  }),
167
+
168
+ columnGap: ({ props, deps }) => props.columnGap ? deps.getSpacingBasedOnRatio(props, 'columnGap') : null,
169
+ rowGap: ({ props, deps }) => props.rowGap ? deps.getSpacingBasedOnRatio(props, 'rowGap') : null,
170
+
151
171
  gridArea: ({ props, deps }) => props.gridArea && ({ gridArea: props.gridArea }),
152
172
 
153
173
  float: ({ props, deps }) => !deps.isUndefined(props.float) && ({
@@ -217,15 +237,6 @@ export const Block = {
217
237
  gridRowStart: props.gridRowStart
218
238
  }),
219
239
 
220
- size: ({ props, deps }) => {
221
- if (!deps.isString(props.heightRange)) return
222
- const [minHeight, maxHeight] = props.heightRange.split(' ')
223
- return {
224
- ...deps.transformSizeRatio('minHeight', minHeight),
225
- ...deps.transformSizeRatio('maxHeight', maxHeight || minHeight)
226
- }
227
- },
228
-
229
240
  resize: ({ props, deps }) => !deps.isUndefined(props.resize) && ({
230
241
  resize: props.resize
231
242
  }),
@@ -241,7 +252,6 @@ export const Block = {
241
252
  columnWidth: ({ props, deps }) => !deps.isUndefined(props.columnWidth) && ({
242
253
  columnWidth: props.columnWidth
243
254
  }),
244
- columnGap: ({ props, deps }) => deps.transformSizeRatio('columnGap', props),
245
255
  columnSpan: ({ props, deps }) => !deps.isUndefined(props.columnSpan) && ({
246
256
  columnSpan: props.columnSpan
247
257
  }),
package/Collection.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import { isState, getChildStateInKey } from '@domql/state'
4
+ import { addAdditionalExtend } from '@domql/element/utils/component'
4
5
  import { isString, isNot, isArray, isObject, isObjectLike, exec, deepCloneWithExtend } from '@domql/utils'
5
6
 
6
7
  export const Collection = {
@@ -9,12 +10,19 @@ export const Collection = {
9
10
  const { __ref: ref } = el
10
11
  const { children, childrenAs, childrenExtend } = (el.props || {})
11
12
  const childrenExec = children && exec(children, el, state)
12
- const hasChildren = isArray(childrenExec)
13
13
 
14
- if (hasChildren) {
14
+ if (isArray(childrenExec)) {
15
15
  param = deepCloneWithExtend(childrenExec)
16
16
  if (childrenAs) param = param.map(v => ({ extend: childrenExtend, [childrenAs]: v }))
17
- } else if (!param) return
17
+ } else if (isObject(childrenExec)) {
18
+ param = deepCloneWithExtend(childrenExec)
19
+ param = Object.keys(param).map(v => {
20
+ const val = param[v]
21
+ return addAdditionalExtend(v, val)
22
+ })
23
+ }
24
+
25
+ if (!param) return
18
26
 
19
27
  if (isString(param)) {
20
28
  if (param === 'state') param = state.parse()
@@ -109,6 +117,7 @@ export const Collection = {
109
117
  const obj = {
110
118
  tag: 'fragment',
111
119
  props: {
120
+ children: el.props && el.props.children,
112
121
  childProps: el.props && el.props.childProps
113
122
  }
114
123
  }
package/Grid.js CHANGED
@@ -24,9 +24,6 @@ export const Grid = {
24
24
  autoRows: ({ props }) => props.autoRows ? ({ gridAutoRows: props.autoRows }) : null,
25
25
  rowStart: ({ props }) => props.rowStart ? ({ gridRowStart: props.rowStart }) : null,
26
26
 
27
- autoFlow: ({ props }) => props.autoFlow ? ({ gridAutoFlow: props.autoFlow }) : null,
28
-
29
- columnGap: ({ props, deps }) => props.columnGap ? deps.getSpacingBasedOnRatio(props, 'columnGap') : null,
30
- rowGap: ({ props, deps }) => props.rowGap ? deps.getSpacingBasedOnRatio(props, 'rowGap') : null
27
+ autoFlow: ({ props }) => props.autoFlow ? ({ gridAutoFlow: props.autoFlow }) : null
31
28
  }
32
29
  }
package/Media.js CHANGED
@@ -53,7 +53,7 @@ const execClass = (key, props, result, element) => {
53
53
  context: element.context,
54
54
  state: element.state,
55
55
  deps: element.deps
56
- })
56
+ }, element.state, element.context)
57
57
 
58
58
  if (isArray(classExec)) classExec = classExec.reduce((a, c) => merge(a, c), {})
59
59
 
package/Svg.js CHANGED
@@ -3,9 +3,7 @@
3
3
  // create SVG symbol
4
4
  export const Svg = {
5
5
  tag: 'svg',
6
- props: {
7
- style: { '*': { fill: 'currentColor' } }
8
- },
6
+ props: {},
9
7
  attr: {
10
8
  xmlns: 'http://www.w3.org/2000/svg',
11
9
  'xmlns:xlink': 'http://www.w3.org/1999/xlink'
package/Text.js CHANGED
@@ -32,6 +32,7 @@ export const Text = {
32
32
  textAlign: ({ props }) => !isUndefined(props.textAlign) && ({ textAlign: props.textAlign }),
33
33
  writingMode: ({ props }) => !isUndefined(props.writingMode) && ({ writingMode: props.writingMode }),
34
34
  textOrientation: ({ props }) => !isUndefined(props.textOrientation) && ({ textOrientation: props.textOrientation }),
35
+ textIndent: ({ props }) => !isUndefined(props.textIndent) && ({ textIndent: props.textIndent }),
35
36
  fontWeight: ({ props }) => !isUndefined(props.fontWeight) && ({
36
37
  fontWeight: props.fontWeight,
37
38
  fontVariationSettings: '"wght" ' + props.fontWeight
package/Theme.js CHANGED
@@ -160,6 +160,10 @@ export const Theme = {
160
160
  backdropFilter: props.backdropFilter
161
161
  }),
162
162
 
163
+ caretColor: ({ props }) => !isUndefined(props.caretColor) && ({
164
+ caretColor: props.caretColor
165
+ }),
166
+
163
167
  opacity: ({ props }) => !isUndefined(props.opacity) && ({
164
168
  opacity: props.opacity
165
169
  }),
package/XYZ.js CHANGED
@@ -4,6 +4,8 @@ import { isUndefined } from '@domql/utils'
4
4
 
5
5
  export const XYZ = {
6
6
  class: {
7
- zIndex: ({ props }) => !isUndefined(props.zIndex) && ({ zIndex: props.zIndex })
7
+ zIndex: ({ props }) => !isUndefined(props.zIndex) && ({ zIndex: props.zIndex }),
8
+ perspective: ({ props }) => !isUndefined(props.perspective) && ({ perspective: props.perspective }),
9
+ perspectiveOrigin: ({ props }) => !isUndefined(props.perspectiveOrigin) && ({ perspectiveOrigin: props.perspectiveOrigin })
8
10
  }
9
11
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.11.424",
3
+ "version": "2.11.427",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "3708811dd9976df392626400dd5560e1b11237b1",
6
+ "gitHead": "60efc845b7989c7e8e631bacfdaa0dba0827b8cf",
7
7
  "dependencies": {
8
8
  "@domql/state": "latest",
9
9
  "@domql/utils": "latest",