smbls 0.8.18 → 0.8.21

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI Library built on Scratch and DOMQL",
4
4
  "private": false,
5
5
  "author": "symbo.ls",
6
- "version": "0.8.18",
6
+ "version": "0.8.21",
7
7
  "repository": "https://github.com/rackai/symbols",
8
8
  "main": "src/index.js",
9
9
  "files": [
@@ -69,9 +69,13 @@ export const Block = {
69
69
 
70
70
  aspectRatio: ({ props }) => props.aspectRatio && ({ aspectRatio: props.aspectRatio }),
71
71
 
72
- padding: ({ props }) => mapBasedOnRatio(props, 'padding'),
73
- margin: ({ props }) => mapBasedOnRatio(props, 'margin'),
74
- gap: ({ props }) => mapBasedOnRatio(props, 'gap'),
72
+ borderWidth: ({ props }) => props.borderWidth ? mapBasedOnRatio(props, 'borderWidth') : null,
73
+
74
+ padding: ({ props }) => props.padding ? mapBasedOnRatio(props, 'padding') : null,
75
+ margin: ({ props }) => props.margin ? mapBasedOnRatio(props, 'margin') : null,
76
+
77
+ gap: ({ props }) => props.gap ? mapBasedOnRatio(props, 'gap') : null,
78
+ gridArea: ({ props }) => props.gridArea && ({ gridArea: props.gridArea }),
75
79
 
76
80
  flexFlow: ({ props }) => props.flexFlow && ({
77
81
  display: 'flex',
@@ -86,14 +90,22 @@ export const Block = {
86
90
  justifyContent: justifyContent
87
91
  }
88
92
  },
93
+
89
94
  flex: ({ props }) => props.flex && ({ flex: props.flex }),
95
+ alignItems: ({ props }) => props.alignItems && ({ alignItems: props.alignItems }),
96
+ alignContent: ({ props }) => props.alignContent && ({ alignContent: props.alignContent }),
97
+ justifyContent: ({ props }) => props.justifyContent && ({ justifyContent: props.justifyContent }),
90
98
 
91
99
  gridColumn: ({ props }) => props.gridColumn && ({ gridColumn: props.gridColumn }),
92
100
  gridRow: ({ props }) => props.gridRow && ({ gridRow: props.gridRow }),
93
101
 
94
102
  size: ({ props }) => {
95
- // if (typeof props.size !== 'string') return
96
- // const [fontSize, padding, margin] = props.size.split(' ')
103
+ if (typeof props.heightRange !== 'string') return
104
+ const [minHeight, maxHeight] = props.heightRange.split(' ')
105
+ return {
106
+ ...mapSpacing(minHeight, 'minHeight'),
107
+ ...mapSpacing(maxHeight, 'maxHeight')
108
+ }
97
109
  }
98
110
  }
99
111
  }
package/src/Grid/index.js CHANGED
@@ -9,10 +9,13 @@ export const Grid = {
9
9
  props: {},
10
10
 
11
11
  class: {
12
- columns: ({ props }) => ({ gridTemplateColumns: props.columns }),
13
- rows: ({ props }) => ({ gridTemplateRows: props.rows }),
14
- gap: ({ props }) => mapBasedOnRatio(props, 'gap'),
15
- columnGap: ({ props }) => mapBasedOnRatio(props, 'columnGap'),
16
- rowGap: ({ props }) => mapBasedOnRatio(props, 'rowGap')
12
+ columns: ({ props }) => props.columns ? ({ gridTemplateColumns: props.columns }) : null,
13
+ rows: ({ props }) => props.rows ? ({ gridTemplateRows: props.rows }) : null,
14
+ area: ({ props }) => props.area ? ({ gridArea: props.area }) : null,
15
+ template: ({ props }) => props.template ? ({ gridTemplate: props.template }) : null,
16
+ templateAreas: ({ props }) => props.templateAreas ? ({ gridTemplateAreas: props.templateAreas }) : null,
17
+ gap: ({ props }) => props.gap ? mapBasedOnRatio(props, 'gap') : null,
18
+ columnGap: ({ props }) => props.template ? mapBasedOnRatio(props, 'columnGap') : null,
19
+ rowGap: ({ props }) => props.template ? mapBasedOnRatio(props, 'rowGap') : null
17
20
  }
18
21
  }
@@ -19,6 +19,14 @@ const diffBorder = (border, key = 'border') => {
19
19
  return obj
20
20
  }
21
21
 
22
+ const diffStroke = stroke => {
23
+ const WebkitTextStroke = stroke.split(', ').map(v => {
24
+ if (v.includes('px')) return v
25
+ else if (getColor(v)) return getColor(v)
26
+ }).join(' ')
27
+ return { WebkitTextStroke }
28
+ }
29
+
22
30
  export const Shape = {
23
31
  class: {
24
32
  default: style,
@@ -42,7 +50,12 @@ export const Shape = {
42
50
  background: ({ props }) => props.background ? ({ backgroundColor: getColor(props.background) }) : null,
43
51
  // border: ({ props }) => props.border ? ({ borderColor: getColor(props.border) }) : null,
44
52
 
53
+ textStroke: ({ props }) => props.textStroke ? diffStroke(props.textStroke) : null,
54
+
45
55
  border: ({ props }) => props.border ? diffBorder(props.border) : null,
56
+ borderColor: ({ props }) => props.borderColor ? ({ borderColor: getColor(props.borderColor) }) : null,
57
+ borderStyle: ({ props }) => props.borderStyle && ({ borderStyle: props.borderStyle }),
58
+
46
59
  borderLeft: ({ props }) => props.borderLeft ? diffBorder(props.borderLeft, 'borderLeft') : null,
47
60
  borderTop: ({ props }) => props.borderTop ? diffBorder(props.borderTop, 'borderTop') : null,
48
61
  borderRight: ({ props }) => props.borderRight ? diffBorder(props.borderRight, 'borderRight') : null,