@symbo.ls/atoms 2.11.239 → 2.11.242

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/Collection.js CHANGED
@@ -5,6 +5,49 @@ import { isString, isNot, isArray, isObject, isObjectLike, deepDiff, deepClone }
5
5
 
6
6
  export const Collection = {
7
7
  define: {
8
+ $collection: (param, el, state) => {
9
+ if (!param) return
10
+
11
+ if (isString(param)) {
12
+ if (param === 'state') param = state.parse()
13
+ else param = getChildStateInKey(param, state)
14
+ }
15
+ if (isState(param)) param = param.parse()
16
+ if (isNot(param)('array', 'object')) return
17
+
18
+ const { __ref: ref } = el
19
+
20
+ if (ref.__stateCollectionCache) {
21
+ const d = deepDiff(param, ref.__stateCollectionCache) // eslint-disable-line
22
+ if (Object.keys(d).length) {
23
+ ref.__stateCollectionCache = deepClone(param)
24
+ delete ref.__noCollectionDifference
25
+ } else {
26
+ ref.__noCollectionDifference = true
27
+ return
28
+ }
29
+ } else {
30
+ ref.__stateCollectionCache = deepClone(param)
31
+ }
32
+
33
+ const obj = {
34
+ tag: 'fragment',
35
+ props: {
36
+ childProps: el.props && el.props.childProps
37
+ }
38
+ }
39
+
40
+ for (const key in param) {
41
+ const value = param[key]
42
+ obj[key] = isObjectLike(value) ? value : { value }
43
+ }
44
+
45
+ el.removeContent()
46
+ el.content = obj
47
+
48
+ return obj
49
+ },
50
+
8
51
  $setCollection: (param, el, state) => {
9
52
  if (!param) return
10
53
 
package/Text.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict'
2
2
 
3
+ import { isUndefined } from '@domql/utils'
3
4
  import { getFontSizeByKey, getFontFamily } from '@symbo.ls/scratch'
4
5
 
5
6
  export const Text = {
@@ -15,18 +16,19 @@ export const Text = {
15
16
  const { props, deps } = el
16
17
  return props.fontSize ? deps.getFontSizeByKey(props.fontSize) : null
17
18
  },
18
- fontFamily: ({ props, deps }) => props.fontFamily && ({
19
+ font: ({ props }) => !isUndefined(props.font) && ({ font: props.font }),
20
+ fontFamily: ({ props, deps }) => !isUndefined(props.fontFamily) && ({
19
21
  fontFamily: deps.getFontFamily(props.fontFamily) || props.fontFamily
20
22
  }),
21
- lineHeight: ({ props }) => props.lineHeight && ({ lineHeight: props.lineHeight }),
22
- // lineHeight: ({ props }) => props.lineHeight && getSpacingBasedOnRatio(props, 'lineHeight', null, ''),
23
- textDecoration: ({ props }) => props.textDecoration && ({ textDecoration: props.textDecoration }),
24
- textTransform: ({ props }) => props.textTransform && ({ textTransform: props.textTransform }),
25
- whiteSpace: ({ props }) => props.whiteSpace && ({ whiteSpace: props.whiteSpace }),
26
- wordWrap: ({ props }) => props.wordWrap && ({ wordWrap: props.wordWrap }),
27
- letterSpacing: ({ props }) => props.letterSpacing && ({ letterSpacing: props.letterSpacing }),
28
- textAlign: ({ props }) => props.textAlign && ({ textAlign: props.textAlign }),
29
- fontWeight: ({ props }) => props.fontWeight && ({
23
+ lineHeight: ({ props }) => !isUndefined(props.lineHeight) && ({ lineHeight: props.lineHeight }),
24
+ // lineHeight: ({ props }) => !isUndefined(props.lineHeight) && getSpacingBasedOnRatio(props, 'lineHeight', null, ''),
25
+ textDecoration: ({ props }) => !isUndefined(props.textDecoration) && ({ textDecoration: props.textDecoration }),
26
+ textTransform: ({ props }) => !isUndefined(props.textTransform) && ({ textTransform: props.textTransform }),
27
+ whiteSpace: ({ props }) => !isUndefined(props.whiteSpace) && ({ whiteSpace: props.whiteSpace }),
28
+ wordWrap: ({ props }) => !isUndefined(props.wordWrap) && ({ wordWrap: props.wordWrap }),
29
+ letterSpacing: ({ props }) => !isUndefined(props.letterSpacing) && ({ letterSpacing: props.letterSpacing }),
30
+ textAlign: ({ props }) => !isUndefined(props.textAlign) && ({ textAlign: props.textAlign }),
31
+ fontWeight: ({ props }) => !isUndefined(props.fontWeight) && ({
30
32
  fontWeight: props.fontWeight,
31
33
  fontVariationSettings: '"wght" ' + props.fontWeight
32
34
  })
@@ -65,4 +67,8 @@ export const Footnote = {
65
67
  props: { fontSize: 'Z' }
66
68
  }
67
69
 
70
+ export const B = { tag: 'b' }
71
+
72
+ export const I = { tag: 'i' }
73
+
68
74
  // export const Paragraph = { tag: 'p' }
package/Theme.js CHANGED
@@ -159,6 +159,14 @@ export const Theme = {
159
159
  columnRule: deps.transformBorder(props.columnRule)
160
160
  }),
161
161
 
162
+ filter: ({ props, deps }) => !isUndefined(props.filter) && ({
163
+ filter: props.filter
164
+ }),
165
+
166
+ mixBlendMode: ({ props, deps }) => !isUndefined(props.mixBlendMode) && ({
167
+ mixBlendMode: props.mixBlendMode
168
+ }),
169
+
162
170
  appearance: ({ props }) => !isUndefined(props.appearance) && ({
163
171
  appearance: props.appearance
164
172
  })
package/Transform.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  export const Transform = {
4
4
  class: {
5
+ zoom: ({ props }) => props.zoom && ({ zoom: props.zoom }),
5
6
  transform: ({ props }) => props.transform && ({ transform: props.transform }),
6
7
  transformOrigin: ({ props }) => props.transformOrigin && ({ transformOrigin: props.transformOrigin })
7
8
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.11.239",
3
+ "version": "2.11.242",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "41a7706e6ed0e20fce89aa1a0ed4975f7aa92aac",
6
+ "gitHead": "56daeda0385e51332c376ac254d54bb6fd8e35e5",
7
7
  "dependencies": {
8
8
  "@domql/state": "latest",
9
9
  "@domql/utils": "latest",