smbls 0.8.29 → 0.8.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/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.29",
6
+ "version": "0.8.30",
7
7
  "repository": "https://github.com/symbo-ls/smbls",
8
8
  "main": "src/index.js",
9
9
  "files": [
File without changes
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { Shape, Position, Block, Text, Overflow, Transition, Transform, Responsive } from '..'
3
+ import { Shape, Position, Block, Text, Overflow, Transition, Transform, Responsive } from '.'
4
4
 
5
5
  const PropsCSS = {
6
6
  class: {
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { IconText } from '../'
3
+ import { IconText } from '.'
4
4
 
5
5
  const css = {
6
6
  appearance: 'none',
@@ -0,0 +1,10 @@
1
+ 'use strict'
2
+
3
+ import { SquareButton } from './Button'
4
+ import { Flex } from './Flex'
5
+
6
+ export const ButtonSet = {
7
+ tag: 'nav',
8
+ proto: Flex,
9
+ childProto: SquareButton
10
+ }
@@ -3,13 +3,10 @@
3
3
  import style from './style'
4
4
 
5
5
  import Icon from '../Icon'
6
- import Shape from '../Shape'
7
- import { Block } from '../Block'
8
6
 
9
7
  export const DatePicker = {
10
8
  style,
11
9
 
12
- proto: [Shape, Block],
13
10
  props: {
14
11
  theme: 'lightDark',
15
12
  padding: 'A',
File without changes
@@ -1,12 +1,10 @@
1
1
  'use strict'
2
2
 
3
- import style from './style'
4
- import { mapBasedOnRatio } from '../Block'
3
+ import { mapBasedOnRatio } from './Block'
5
4
 
6
5
  export const Flex = {
7
- style,
8
-
9
6
  props: {
7
+ display: 'flex',
10
8
  flow: 'row'
11
9
  },
12
10
 
@@ -1,12 +1,9 @@
1
1
  'use strict'
2
2
 
3
- import style from './style'
4
- import { mapBasedOnRatio } from '../Block'
3
+ import { mapBasedOnRatio } from './Block'
5
4
 
6
5
  export const Grid = {
7
- style,
8
-
9
- props: {},
6
+ props: { display: 'grid' },
10
7
 
11
8
  class: {
12
9
  columns: ({ props }) => props.columns ? ({ gridTemplateColumns: props.columns }) : null,
File without changes
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
- import { Block } from '../Block'
3
- import { Shape } from '../Shape'
4
- import { Text } from '../Text'
2
+ import { Block } from './Block'
3
+ import { Shape } from './Shape'
4
+ import { Text } from './Text'
5
5
 
6
6
  export const Label = {
7
7
  proto: [Shape, Block, Text],
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import { exec } from '@domql/utils'
4
- import { Shape, Text } from '..'
4
+ import { Shape, Text } from '.'
5
5
 
6
6
  export const Link = {
7
7
  proto: [Shape, Text],
package/src/Media.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { merge } from '@domql/utils'
3
+ import { merge, isArray } from '@domql/utils'
4
4
  import { CASES as CONFIG_CASES, MEDIA as CONFIG_MEDIA, getTheme } from '@symbo.ls/scratch'
5
5
 
6
6
  const convertToClass = (subProps, element) => {
@@ -10,7 +10,11 @@ const convertToClass = (subProps, element) => {
10
10
  const classnameExec = className[prop]
11
11
  if (typeof classnameExec !== 'function') continue
12
12
 
13
- const contertedToClass = classnameExec({ props: subProps })
13
+ let contertedToClass = classnameExec({ props: subProps })
14
+ if (isArray(contertedToClass)) {
15
+ contertedToClass = contertedToClass.reduce((a, c) => merge(a, c), {})
16
+ }
17
+
14
18
  for (const finalProp in contertedToClass) subPropsClassname[finalProp] = contertedToClass[finalProp]
15
19
  }
16
20
  return subPropsClassname
@@ -38,13 +42,10 @@ const init = (el, s) => {
38
42
  } else if (screen.slice(0, 1) === '$') {
39
43
  const caseKey = screen.slice(1)
40
44
  if (!CONFIG_CASES[caseKey]) continue
41
-
42
45
  const caseProps = props[screen]
43
- const execCaseProps = convertToClass(caseProps, el)
44
-
45
46
  const { CASE } = className
46
47
  if (!CASE) className.CASE = {}
47
- merge(className.CASE, execCaseProps)
48
+ merge(className.CASE, convertToClass(caseProps, el))
48
49
  }
49
50
  }
50
51
  }
@@ -53,22 +54,25 @@ export const Responsive = {
53
54
  on: {
54
55
  init,
55
56
  initUpdate: el => {
57
+ // FORCE STATE UPDATE:
56
58
  const { props, class: className } = el
57
59
  const rootState = el.__root ? el.__root.state : el.state
58
60
  // console.log(props)
61
+ if (el.key !== 'app') return
59
62
 
60
63
  if (props.theme) {
61
- // console.group(props.theme)
62
64
  const { theme } = props
65
+ // console.group(props.theme)
66
+
67
+ const convertTheme = getTheme(theme)
63
68
 
64
- for (const key in theme) {
69
+ for (const key in convertTheme) {
65
70
  if (key.includes('dark') || key.includes('light')) {
66
71
  const parse = key.split(': ')[1].split(')')[0]
67
72
  if (rootState.globalTheme === parse) {
68
73
  props.theme = getTheme(theme[key])
69
74
  } else props.theme = theme
70
75
  className.MEDIA_FORCED_BY_STATE = props.theme
71
- props.generatedTheme = true
72
76
  }
73
77
  }
74
78
  // console.groupEnd(props.theme)
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { Shape, Block, IconText, Direction, Flex, Text } from '../'
3
+ import { Shape, Block, IconText, Direction, Flex, Text } from '.'
4
4
 
5
5
  export const Notification = {
6
6
  style: { cursor: 'pointer' },
@@ -2,6 +2,6 @@
2
2
 
3
3
  export const Overflow = {
4
4
  class: {
5
- overflow: ({ props }) => props.overflow && ({ overflow: props.overflow }),
5
+ overflow: ({ props }) => props.overflow && ({ overflow: props.overflow })
6
6
  }
7
7
  }
@@ -1,5 +1,4 @@
1
1
  'use strict'
2
- import Shape from '../Shape'
3
2
 
4
3
  export const Pills = {
5
4
  style: {
@@ -18,13 +17,10 @@ export const Pills = {
18
17
  },
19
18
  childProto: {
20
19
  tag: 'div',
21
- proto: Shape,
22
20
  props: {
23
21
  round: 42,
24
22
  theme: 'White'
25
23
  }
26
24
  },
27
- ...[
28
- {}, {}, {}
29
- ]
25
+ ...[{}, {}, {}]
30
26
  }
File without changes
File without changes
@@ -1,5 +1,6 @@
1
1
  'use strict'
2
- import { Icon, Link } from '../'
2
+
3
+ import { Icon, Link } from '.'
3
4
 
4
5
  const MenuItem = {
5
6
  proto: Link,
File without changes
@@ -4,6 +4,6 @@ export const Transform = {
4
4
  class: {
5
5
  transform: ({ props }) => props.transform && ({
6
6
  transform: props.transform
7
- }),
7
+ })
8
8
  }
9
9
  }
File without changes
@@ -1 +0,0 @@
1
- 'use strict'
@@ -1,4 +0,0 @@
1
- 'use strict'
2
-
3
- export default {
4
- }
@@ -1,14 +0,0 @@
1
- 'use strict'
2
-
3
- import { SquareButton } from '../Button'
4
- import { Shape } from '../Shape'
5
- import { Flex } from '../Flex'
6
- import { Block } from '../Block'
7
-
8
- export const ButtonSet = {
9
- tag: 'nav',
10
- proto: [Shape, Flex, Block],
11
- childProto: {
12
- proto: [SquareButton]
13
- }
14
- }
package/src/Flex/style.js DELETED
@@ -1,5 +0,0 @@
1
- 'use strict'
2
-
3
- export default {
4
- display: 'flex'
5
- }
package/src/Grid/style.js DELETED
@@ -1,5 +0,0 @@
1
- 'use strict'
2
-
3
- export default {
4
- display: 'grid'
5
- }
package/src/Text/style.js DELETED
@@ -1,2 +0,0 @@
1
- 'use strict'
2
-
@@ -1,2 +0,0 @@
1
- 'use strict'
2
-