@symbo.ls/atoms 2.28.44 → 2.28.45

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.
Files changed (2) hide show
  1. package/Text.js +37 -17
  2. package/package.json +6 -6
package/Text.js CHANGED
@@ -4,7 +4,7 @@ import { exec, isUndefined } from '@domql/utils'
4
4
  import { getFontSizeByKey, getFontFamily } from '@symbo.ls/scratch'
5
5
 
6
6
  const props = {
7
- fontSize: (el) => {
7
+ fontSize: el => {
8
8
  const { props, deps } = el
9
9
  return props.fontSize ? deps.getFontSizeByKey(props.fontSize) : null
10
10
  },
@@ -20,28 +20,48 @@ const props = {
20
20
  export const Text = {
21
21
  deps: { exec, getFontSizeByKey, getFontFamily },
22
22
 
23
- text: (el) => {
23
+ text: el => {
24
24
  const { key, props, state, deps } = el
25
- if (props.text === true) return (state && state[key]) || (props && props[key])
26
- // return console.log(el) || deps.exec(props.text, el)
25
+ if (props.text === true)
26
+ return (state && state[key]) || (props && props[key])
27
27
  return deps.exec(props.text, el)
28
28
  },
29
29
 
30
30
  class: {
31
- font: ({ props }) => !isUndefined(props.font) && ({ font: props.font }),
32
- lineHeight: ({ props }) => !isUndefined(props.lineHeight) && ({ lineHeight: props.lineHeight }),
31
+ font: ({ props }) => !isUndefined(props.font) && { font: props.font },
32
+ lineHeight: ({ props }) =>
33
+ !isUndefined(props.lineHeight) && { lineHeight: props.lineHeight },
33
34
  // lineHeight: ({ props }) => !isUndefined(props.lineHeight) && getSpacingBasedOnRatio(props, 'lineHeight', null, ''),
34
- textDecoration: ({ props }) => !isUndefined(props.textDecoration) && ({ textDecoration: props.textDecoration }),
35
- textTransform: ({ props }) => !isUndefined(props.textTransform) && ({ textTransform: props.textTransform }),
36
- wordBreak: ({ props }) => !isUndefined(props.wordBreak) && ({ wordBreak: props.wordBreak }),
37
- whiteSpace: ({ props }) => !isUndefined(props.whiteSpace) && ({ whiteSpace: props.whiteSpace }),
38
- wordWrap: ({ props }) => !isUndefined(props.wordWrap) && ({ wordWrap: props.wordWrap }),
39
- letterSpacing: ({ props }) => !isUndefined(props.letterSpacing) && ({ letterSpacing: props.letterSpacing }),
40
- textOverflow: ({ props }) => !isUndefined(props.textOverflow) && ({ textOverflow: props.textOverflow }),
41
- textAlign: ({ props }) => !isUndefined(props.textAlign) && ({ textAlign: props.textAlign }),
42
- writingMode: ({ props }) => !isUndefined(props.writingMode) && ({ writingMode: props.writingMode }),
43
- textOrientation: ({ props }) => !isUndefined(props.textOrientation) && ({ textOrientation: props.textOrientation }),
44
- textIndent: ({ props }) => !isUndefined(props.textIndent) && ({ textIndent: props.textIndent }),
35
+ textDecoration: ({ props }) =>
36
+ !isUndefined(props.textDecoration) && {
37
+ textDecoration: props.textDecoration
38
+ },
39
+ textTransform: ({ props }) =>
40
+ !isUndefined(props.textTransform) && {
41
+ textTransform: props.textTransform
42
+ },
43
+ wordBreak: ({ props }) =>
44
+ !isUndefined(props.wordBreak) && { wordBreak: props.wordBreak },
45
+ whiteSpace: ({ props }) =>
46
+ !isUndefined(props.whiteSpace) && { whiteSpace: props.whiteSpace },
47
+ wordWrap: ({ props }) =>
48
+ !isUndefined(props.wordWrap) && { wordWrap: props.wordWrap },
49
+ letterSpacing: ({ props }) =>
50
+ !isUndefined(props.letterSpacing) && {
51
+ letterSpacing: props.letterSpacing
52
+ },
53
+ textOverflow: ({ props }) =>
54
+ !isUndefined(props.textOverflow) && { textOverflow: props.textOverflow },
55
+ textAlign: ({ props }) =>
56
+ !isUndefined(props.textAlign) && { textAlign: props.textAlign },
57
+ writingMode: ({ props }) =>
58
+ !isUndefined(props.writingMode) && { writingMode: props.writingMode },
59
+ textOrientation: ({ props }) =>
60
+ !isUndefined(props.textOrientation) && {
61
+ textOrientation: props.textOrientation
62
+ },
63
+ textIndent: ({ props }) =>
64
+ !isUndefined(props.textIndent) && { textIndent: props.textIndent },
45
65
  ...props
46
66
  }
47
67
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.28.44",
3
+ "version": "2.28.45",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "70519611a6e66b84b628e807c95227a516a40b03",
6
+ "gitHead": "2f1d629e1cd0076c3eb90de5348269b8284e2a40",
7
7
  "dependencies": {
8
- "@domql/state": "^2.28.44",
9
- "@domql/utils": "^2.28.44",
10
- "@symbo.ls/emotion": "^2.28.44",
11
- "@symbo.ls/scratch": "^2.28.44"
8
+ "@domql/state": "^2.28.45",
9
+ "@domql/utils": "^2.28.45",
10
+ "@symbo.ls/emotion": "^2.28.45",
11
+ "@symbo.ls/scratch": "^2.28.45"
12
12
  },
13
13
  "source": "src/index.js",
14
14
  "devDependencies": {