@symbo.ls/atoms 2.34.29 → 2.34.30
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/Box.js +728 -460
- package/Text.js +93 -41
- package/package.json +6 -6
package/Text.js
CHANGED
|
@@ -6,15 +6,22 @@ import { getFontSizeByKey, getFontFamily } from '@symbo.ls/scratch'
|
|
|
6
6
|
const props = {
|
|
7
7
|
fontSize: (el) => {
|
|
8
8
|
const { props, deps } = el
|
|
9
|
-
|
|
9
|
+
const val = deps.exec.call(el, props.fontSize)
|
|
10
|
+
return val ? deps.getFontSizeByKey(val) : null
|
|
10
11
|
},
|
|
11
|
-
fontFamily: (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
fontFamily: (element) => {
|
|
13
|
+
const { props, deps } = element
|
|
14
|
+
const val = deps.exec.call(element, props.fontFamily)
|
|
15
|
+
return { fontFamily: deps.getFontFamily(val) || val }
|
|
16
|
+
},
|
|
17
|
+
fontWeight: (element) => {
|
|
18
|
+
const { props, deps } = element
|
|
19
|
+
const val = deps.exec.call(element, props.fontWeight)
|
|
20
|
+
return {
|
|
21
|
+
fontWeight: val,
|
|
22
|
+
fontVariationSettings: '"wght" ' + val
|
|
23
|
+
}
|
|
24
|
+
}
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
export const Text = {
|
|
@@ -28,39 +35,84 @@ export const Text = {
|
|
|
28
35
|
},
|
|
29
36
|
|
|
30
37
|
class: {
|
|
31
|
-
font: (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
38
|
+
font: (element) => {
|
|
39
|
+
const { props, deps } = element
|
|
40
|
+
const val = deps.exec.call(element, props.font)
|
|
41
|
+
if (isUndefined(val)) return
|
|
42
|
+
return { font: val }
|
|
43
|
+
},
|
|
44
|
+
lineHeight: (element) => {
|
|
45
|
+
const { props, deps } = element
|
|
46
|
+
const val = deps.exec.call(element, props.lineHeight)
|
|
47
|
+
if (isUndefined(val)) return
|
|
48
|
+
return { lineHeight: val }
|
|
49
|
+
},
|
|
50
|
+
textDecoration: (element) => {
|
|
51
|
+
const { props, deps } = element
|
|
52
|
+
const val = deps.exec.call(element, props.textDecoration)
|
|
53
|
+
if (isUndefined(val)) return
|
|
54
|
+
return { textDecoration: val }
|
|
55
|
+
},
|
|
56
|
+
textTransform: (element) => {
|
|
57
|
+
const { props, deps } = element
|
|
58
|
+
const val = deps.exec.call(element, props.textTransform)
|
|
59
|
+
if (isUndefined(val)) return
|
|
60
|
+
return { textTransform: val }
|
|
61
|
+
},
|
|
62
|
+
wordBreak: (element) => {
|
|
63
|
+
const { props, deps } = element
|
|
64
|
+
const val = deps.exec.call(element, props.wordBreak)
|
|
65
|
+
if (isUndefined(val)) return
|
|
66
|
+
return { wordBreak: val }
|
|
67
|
+
},
|
|
68
|
+
whiteSpace: (element) => {
|
|
69
|
+
const { props, deps } = element
|
|
70
|
+
const val = deps.exec.call(element, props.whiteSpace)
|
|
71
|
+
if (isUndefined(val)) return
|
|
72
|
+
return { whiteSpace: val }
|
|
73
|
+
},
|
|
74
|
+
wordWrap: (element) => {
|
|
75
|
+
const { props, deps } = element
|
|
76
|
+
const val = deps.exec.call(element, props.wordWrap)
|
|
77
|
+
if (isUndefined(val)) return
|
|
78
|
+
return { wordWrap: val }
|
|
79
|
+
},
|
|
80
|
+
letterSpacing: (element) => {
|
|
81
|
+
const { props, deps } = element
|
|
82
|
+
const val = deps.exec.call(element, props.letterSpacing)
|
|
83
|
+
if (isUndefined(val)) return
|
|
84
|
+
return { letterSpacing: val }
|
|
85
|
+
},
|
|
86
|
+
textOverflow: (element) => {
|
|
87
|
+
const { props, deps } = element
|
|
88
|
+
const val = deps.exec.call(element, props.textOverflow)
|
|
89
|
+
if (isUndefined(val)) return
|
|
90
|
+
return { textOverflow: val }
|
|
91
|
+
},
|
|
92
|
+
textAlign: (element) => {
|
|
93
|
+
const { props, deps } = element
|
|
94
|
+
const val = deps.exec.call(element, props.textAlign)
|
|
95
|
+
if (isUndefined(val)) return
|
|
96
|
+
return { textAlign: val }
|
|
97
|
+
},
|
|
98
|
+
writingMode: (element) => {
|
|
99
|
+
const { props, deps } = element
|
|
100
|
+
const val = deps.exec.call(element, props.writingMode)
|
|
101
|
+
if (isUndefined(val)) return
|
|
102
|
+
return { writingMode: val }
|
|
103
|
+
},
|
|
104
|
+
textOrientation: (element) => {
|
|
105
|
+
const { props, deps } = element
|
|
106
|
+
const val = deps.exec.call(element, props.textOrientation)
|
|
107
|
+
if (isUndefined(val)) return
|
|
108
|
+
return { textOrientation: val }
|
|
109
|
+
},
|
|
110
|
+
textIndent: (element) => {
|
|
111
|
+
const { props, deps } = element
|
|
112
|
+
const val = deps.exec.call(element, props.textIndent)
|
|
113
|
+
if (isUndefined(val)) return
|
|
114
|
+
return { textIndent: val }
|
|
115
|
+
},
|
|
64
116
|
...props
|
|
65
117
|
}
|
|
66
118
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/atoms",
|
|
3
|
-
"version": "2.34.
|
|
3
|
+
"version": "2.34.30",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"gitHead": "
|
|
6
|
+
"gitHead": "e8c2af04ccfbe5521b5a2d5473b6e5236954edba",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@domql/state": "^2.34.
|
|
9
|
-
"@domql/utils": "^2.34.
|
|
10
|
-
"@symbo.ls/emotion": "^2.34.
|
|
11
|
-
"@symbo.ls/scratch": "^2.34.
|
|
8
|
+
"@domql/state": "^2.34.30",
|
|
9
|
+
"@domql/utils": "^2.34.30",
|
|
10
|
+
"@symbo.ls/emotion": "^2.34.30",
|
|
11
|
+
"@symbo.ls/scratch": "^2.34.30"
|
|
12
12
|
},
|
|
13
13
|
"source": "src/index.js",
|
|
14
14
|
"devDependencies": {
|