smbls 0.15.16 → 0.15.18

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.15.16",
6
+ "version": "0.15.18",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
@@ -52,7 +52,48 @@ export const Block = {
52
52
  borderWidth: ({ props }) => props.borderWidth ? getSpacingBasedOnRatio(props, 'borderWidth') : null,
53
53
 
54
54
  padding: ({ props }) => props.padding ? getSpacingBasedOnRatio(props, 'padding') : null,
55
+ paddingInline: ({ props }) => {
56
+ if (typeof props.paddingInline !== 'string') return
57
+ const [paddingInlineStart, paddingInlineEnd] = props.paddingInline.split(' ')
58
+ return {
59
+ ...getSpacingByKey(paddingInlineStart, 'paddingInlineStart'),
60
+ ...getSpacingByKey(paddingInlineEnd || paddingInlineStart, 'paddingInlineEnd')
61
+ }
62
+ },
63
+ paddingBlock: ({ props }) => {
64
+ if (typeof props.paddingBlock !== 'string') return
65
+ const [paddingBlockStart, paddingBlockEnd] = props.paddingBlock.split(' ')
66
+ return {
67
+ ...getSpacingByKey(paddingBlockStart, 'paddingBlockStart'),
68
+ ...getSpacingByKey(paddingBlockEnd || paddingBlockStart, 'paddingBlockEnd')
69
+ }
70
+ },
71
+ paddingInlineStart: ({ props }) => props.paddingInlineStart ? getSpacingBasedOnRatio(props, 'paddingInlineStart') : null,
72
+ paddingInlineEnd: ({ props }) => props.paddingInlineEnd ? getSpacingBasedOnRatio(props, 'paddingInlineEnd') : null,
73
+ paddingBlockStart: ({ props }) => props.paddingBlockStart ? getSpacingBasedOnRatio(props, 'paddingBlockStart') : null,
74
+ paddingBlockEnd: ({ props }) => props.paddingBlockEnd ? getSpacingBasedOnRatio(props, 'paddingBlockEnd') : null,
75
+
55
76
  margin: ({ props }) => props.margin ? getSpacingBasedOnRatio(props, 'margin') : null,
77
+ marginInline: ({ props }) => {
78
+ if (typeof props.marginInline !== 'string') return
79
+ const [marginInlineStart, marginInlineEnd] = props.marginInline.split(' ')
80
+ return {
81
+ ...getSpacingByKey(marginInlineStart, 'marginInlineStart'),
82
+ ...getSpacingByKey(marginInlineEnd || marginInlineStart, 'marginInlineEnd')
83
+ }
84
+ },
85
+ marginBlock: ({ props }) => {
86
+ if (typeof props.marginBlock !== 'string') return
87
+ const [marginBlockStart, marginBlockEnd] = props.marginBlock.split(' ')
88
+ return {
89
+ ...getSpacingByKey(marginBlockStart, 'marginBlockStart'),
90
+ ...getSpacingByKey(marginBlockEnd || marginBlockStart, 'marginBlockEnd')
91
+ }
92
+ },
93
+ marginInlineStart: ({ props }) => props.marginInlineStart ? getSpacingBasedOnRatio(props, 'marginInlineStart') : null,
94
+ marginInlineEnd: ({ props }) => props.marginInlineEnd ? getSpacingBasedOnRatio(props, 'marginInlineEnd') : null,
95
+ marginBlockStart: ({ props }) => props.marginBlockStart ? getSpacingBasedOnRatio(props, 'marginBlockStart') : null,
96
+ marginBlockEnd: ({ props }) => props.marginBlockEnd ? getSpacingBasedOnRatio(props, 'marginBlockEnd') : null,
56
97
 
57
98
  gap: ({ props }) => props.gap ? getSpacingBasedOnRatio(props, 'gap') : null,
58
99
  gridArea: ({ props }) => props.gridArea && ({ gridArea: props.gridArea }),
@@ -17,22 +17,22 @@ const getComputedBackgroundColor = el => {
17
17
  // const propsTheme = getTheme(props.theme)
18
18
 
19
19
  if (!propsColor) {
20
- const computedStyle = window.getComputedStyle(node)
21
- // if (props.shapeDirection) {
22
- // console.group(el.parent.parent.parent.key + ' - ' + el.parent.key)
23
- // console.log(propsTheme)
24
- // console.log(getColor(props.borderColor))
25
- // console.log(getColor(props.backgroundColor))
26
- // console.log(getColor(props.background))
27
- // console.log(computedStyle.getPropertyValue('border-color'))
28
- // console.log(computedStyle.getPropertyValue('background'))
29
- // console.log(computedStyle.getPropertyValue('background-color'))
30
- // console.log(el)
31
- // console.groupEnd(el.parent.parent.parent.key + ' - ' + el.parent.key)
32
- // }
33
- return computedStyle.getPropertyValue('border-color') ||
34
- computedStyle.getPropertyValue('background') ||
35
- computedStyle.getPropertyValue('background-color')
20
+ // const computedStyle = window.getComputedStyle(node)
21
+ // // if (props.shapeDirection) {
22
+ // // console.group(el.parent.parent.parent.key + ' - ' + el.parent.key)
23
+ // // console.log(propsTheme)
24
+ // // console.log(getColor(props.borderColor))
25
+ // // console.log(getColor(props.backgroundColor))
26
+ // // console.log(getColor(props.background))
27
+ // // console.log(computedStyle.getPropertyValue('border-color'))
28
+ // // console.log(computedStyle.getPropertyValue('background'))
29
+ // // console.log(computedStyle.getPropertyValue('background-color'))
30
+ // // console.log(el)
31
+ // // console.groupEnd(el.parent.parent.parent.key + ' - ' + el.parent.key)
32
+ // // }
33
+ // return computedStyle.getPropertyValue('border-color') ||
34
+ // computedStyle.getPropertyValue('background') ||
35
+ // computedStyle.getPropertyValue('background-color')
36
36
  }
37
37
 
38
38
  return propsColor