@symbo.ls/preview 2.6.0 → 2.6.6

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
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/preview",
3
3
  "description": "",
4
4
  "author": "",
5
- "version": "2.6.0",
5
+ "version": "2.6.6",
6
6
  "main": "src/app.js",
7
7
  "scripts": {
8
8
  "link:all": "yarn link smbls domql css-in-props @symbo.ls/icons @symbo.ls/config @symbo.ls/components @symbo.ls/scratch @symbo.ls/playground @symbo.ls/utils @symbo.ls/init @symbo.ls/config-default @domql/router @domql/utils @domql/router",
@@ -4,9 +4,8 @@ import { Flex } from '@symbo.ls/components'
4
4
 
5
5
  const props = {
6
6
  gap: 'E',
7
- margin: '- - D1 -',
7
+ margin: '- - D2 -',
8
8
  childProps: {
9
- fontSize: 'Z1',
10
9
  color: 'gray6',
11
10
  maxWidth: `${272 / 14}em`
12
11
  }
@@ -42,7 +42,7 @@ export const InitPage = {
42
42
  }
43
43
 
44
44
  const ifWeHaveComponents = (state) => {
45
- const keys = Object.keys(state.__system.COMPONENTS)
45
+ const keys = Object.keys(state.__client_system.COMPONENTS)
46
46
  return !!keys.length
47
47
  }
48
48
 
@@ -3,8 +3,8 @@
3
3
  import { SectionHeader, ColorTemplate, Flex } from '@symbo.ls/components'
4
4
 
5
5
  const mapColors = (el, s) => {
6
- if (!s.__system) return
7
- const { COLOR } = s.__system
6
+ if (!s.__client_system) return
7
+ const { COLOR } = s.__client_system
8
8
  const colorKeys = Object.keys(COLOR)
9
9
  return colorKeys.map(v => ({ key: v, value: COLOR[v] }))
10
10
  }
@@ -3,8 +3,8 @@
3
3
  import { ThemeTemplate, SectionHeader, Grid } from '@symbo.ls/components'
4
4
 
5
5
  const mapThemes = (el, s) => {
6
- if (!s.__system) return
7
- const { THEME } = s.__system
6
+ if (!s.__client_system) return
7
+ const { THEME } = s.__client_system
8
8
  const themeKeys = Object.keys(THEME)
9
9
  return themeKeys.map(v => ({ ...THEME[v], key: v }))
10
10
  }
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- export default ({ parent: { state: { __system } } }) => ({
3
+ export default ({ parent: { state: { __client_system } } }) => __client_system && ({
4
4
  data: [{
5
5
  icon: 'colorOutline',
6
6
  iconTheme: 'theme',
@@ -9,10 +9,10 @@ export default ({ parent: { state: { __system } } }) => ({
9
9
  iconBackground: 'red',
10
10
  properties: [{
11
11
  property: 'Colors',
12
- value: Object.keys(__system.COLOR).length
12
+ value: __client_system.COLOR && Object.keys(__client_system.COLOR).length
13
13
  }, {
14
14
  property: 'Themes',
15
- value: Object.keys(__system.THEME).length
15
+ value: __client_system.THEME && Object.keys(__client_system.THEME).length
16
16
  }]
17
17
  }, {
18
18
  icon: 'typographyOutline',
@@ -21,19 +21,19 @@ export default ({ parent: { state: { __system } } }) => ({
21
21
  paragraph: 'style a typed material',
22
22
  properties: [{
23
23
  property: 'Base size',
24
- value: __system.TYPOGRAPHY.base + 'px'
24
+ value: __client_system.TYPOGRAPHY && __client_system.TYPOGRAPHY.base + 'px'
25
25
  }, {
26
26
  property: 'Ratio',
27
- value: __system.TYPOGRAPHY.ratio
27
+ value: __client_system.TYPOGRAPHY && __client_system.TYPOGRAPHY.ratio
28
28
  }, {
29
29
  property: 'Styles',
30
- value: __system.TYPOGRAPHY.styles && Object.keys(__system.TYPOGRAPHY.styles).length
30
+ value: __client_system.TYPOGRAPHY && __client_system.TYPOGRAPHY.styles && Object.keys(__client_system.TYPOGRAPHY.styles).length
31
31
  }, {
32
32
  property: 'Fonts',
33
- value: Object.keys(__system.FONT).length
33
+ value: __client_system.FONT && Object.keys(__client_system.FONT).length
34
34
  }, {
35
35
  property: 'Families',
36
- value: Object.keys(__system.FONT_FAMILY).length - 1
36
+ value: __client_system.FONT_FAMILY && Object.keys(__client_system.FONT_FAMILY).length - 1
37
37
  }]
38
38
  }, {
39
39
  icon: 'spaceOutline',
@@ -42,7 +42,7 @@ export default ({ parent: { state: { __system } } }) => ({
42
42
  paragraph: 'Manage properties of a size',
43
43
  properties: [{
44
44
  property: 'Ratio',
45
- value: __system.SPACING.ratio
45
+ value: __client_system.SPACING && __client_system.SPACING.ratio
46
46
  }, {
47
47
  property: 'Templates',
48
48
  value: 'TBA'
@@ -66,13 +66,13 @@ export default ({ parent: { state: { __system } } }) => ({
66
66
  paragraph: 'Label a role of subject with glyphs',
67
67
  properties: [{
68
68
  property: 'All',
69
- value: Object.keys(__system.ICONS).length
69
+ value: __client_system.ICONS && Object.keys(__client_system.ICONS).length
70
70
  }, {
71
71
  property: 'Linear',
72
- value: Object.keys(__system.ICONS).filter(v => v.includes('Outline')).length
72
+ value: __client_system.ICONS && Object.keys(__client_system.ICONS).filter(v => v.includes('Outline')).length
73
73
  }, {
74
74
  property: 'Colored',
75
- value: Object.keys(__system.ICONS).filter(v => v.includes('Colored')).length
75
+ value: __client_system.ICONS && Object.keys(__client_system.ICONS).filter(v => v.includes('Colored')).length
76
76
  }]
77
77
  }, {
78
78
  icon: 'clock',
@@ -81,10 +81,10 @@ export default ({ parent: { state: { __system } } }) => ({
81
81
  paragraph: 'Tokens for transitions and animations',
82
82
  properties: [{
83
83
  property: 'Timing base',
84
- value: __system.TIMING.base + 'ms'
84
+ value: __client_system.TIMING && __client_system.TIMING.base + 'ms'
85
85
  }, {
86
86
  property: 'Ratio',
87
- value: __system.TIMING.ratio
87
+ value: __client_system.TIMING && __client_system.TIMING.ratio
88
88
  }, {
89
89
  property: 'Transitions',
90
90
  value: 'TBA'
@@ -98,10 +98,10 @@ export default ({ parent: { state: { __system } } }) => ({
98
98
  paragraph: 'Label a role of subject with glyphs',
99
99
  properties: [{
100
100
  property: 'Breakpoints',
101
- value: Object.keys(__system.MEDIA).length
101
+ value: __client_system.MEDIA && Object.keys(__client_system.MEDIA).length
102
102
  }, {
103
103
  property: 'Screens',
104
- value: Object.keys(__system.DEVICES).length
104
+ value: __client_system.DEVICES && Object.keys(__client_system.DEVICES).length
105
105
  }]
106
106
  }, {
107
107
  icon: 'threeDots',
@@ -39,7 +39,7 @@ export const Export = {
39
39
  const route = window.location.pathname
40
40
  const routes = route.slice(1).split('/')
41
41
  const componentKey = routes[1]
42
- const { COMPONENTS } = state.__system
42
+ const COMPONENTS = state.__components
43
43
 
44
44
  const libComponent = COMPONENT_ROUTES[`/${componentKey}`]
45
45
  const liveComponent = COMPONENTS[componentKey]
@@ -52,7 +52,7 @@ export default {
52
52
 
53
53
  comp: (el, s) => {
54
54
  if (s.live) {
55
- const SYSTEM = s.__system
55
+ const CLIENT_SYSTEM = s.__client_system
56
56
  const styleNode = document.createElement('head')
57
57
  const emotion = createEmotion('client', styleNode)
58
58
  emCache['client'] = emotion
@@ -67,12 +67,12 @@ export default {
67
67
  extend: [Box],
68
68
  define: { style: emotionStyle, class: emotionClass },
69
69
  components,
70
- context: { SYSTEM }
70
+ context: { SYSTEM: CLIENT_SYSTEM }
71
71
  })
72
72
 
73
73
  newDom.node.appendChild(styleNode)
74
74
 
75
- init(SYSTEM, null, { emotion, initDOMQLDefine: false, newConfig: 'client' })
75
+ init(CLIENT_SYSTEM, null, { emotion, initDOMQLDefine: false, newConfig: 'client' })
76
76
  activateConfig('client')
77
77
 
78
78
  newDom.set({
@@ -4,8 +4,8 @@ import { Grid, Hoverable, FontObject } from '@symbo.ls/components'
4
4
  import { TypeSection } from '../Typography/shared'
5
5
 
6
6
  const mapFonts = (el, s) => {
7
- if (!s.__system) return
8
- const { FONT } = s.__system
7
+ if (!s.__client_system) return
8
+ const { FONT } = s.__client_system
9
9
  const fontKeys = Object.keys(FONT)
10
10
 
11
11
  return fontKeys.map(v => {
@@ -4,8 +4,8 @@ import { Grid, Hoverable, FontFamilyObject } from '@symbo.ls/components'
4
4
  import { TypeSection } from '../Typography/shared'
5
5
 
6
6
  const mapFontFamilies = (el, s) => {
7
- if (!s.__system) return
8
- const { FONT_FAMILY } = s.__system
7
+ if (!s.__client_system) return
8
+ const { FONT_FAMILY } = s.__client_system
9
9
  const fontFamilyKeys = Object.keys(FONT_FAMILY)
10
10
 
11
11
  return fontFamilyKeys.map(v => {
@@ -136,7 +136,7 @@ export const CreateDocumentTheme = {
136
136
 
137
137
  on: {
138
138
  init: ({ state }) => {
139
- const { THEME, COLOR } = state.__system
139
+ const { THEME, COLOR } = state.__client_system
140
140
  const { document } = THEME
141
141
  const dark = document['@dark']
142
142
  const light = document['@light']
@@ -11,7 +11,7 @@ export const Personalize = {
11
11
  back: null,
12
12
 
13
13
  HeaderHeading: {
14
- props: { margin: '- - D2 -' },
14
+ props: { margin: '- - D1 -' },
15
15
  Caption: { text: `Let's personalize your Symbols` },
16
16
  H1: { text: ({ state }) => `Hi ${state.userName}` }
17
17
  },
@@ -25,7 +25,9 @@ export const Personalize = {
25
25
  },
26
26
 
27
27
  Flex: {
28
- props: { gap: 'D1' },
28
+ props: ({ state }) => ({
29
+ gap: 'D1'
30
+ }),
29
31
 
30
32
  icon,
31
33
  fields
@@ -26,7 +26,7 @@ export const Library = {
26
26
 
27
27
  childExtend: ComponentTemplate,
28
28
  $setStateCollection: ({ state }) => {
29
- const { COMPONENTS } = state.__system
29
+ const COMPONENTS = state.__components
30
30
  return Object.values(COMPONENTS)
31
31
  }
32
32
  }
@@ -20,7 +20,7 @@ export const Spaces = {
20
20
 
21
21
  on: {
22
22
  init: (el, s) => {
23
- if (!s.__system.SPACING) {
23
+ if (!s.__client_system.SPACING) {
24
24
  s.systemUpdate({
25
25
  SPACING: { base: s.base, ratio: s.ratio }
26
26
  }, { preventUpdate: true })
@@ -27,9 +27,9 @@ export const State = {
27
27
  input: (ev, el, s) => {
28
28
  const rootState = el.__root.state
29
29
  const obj = {
30
- STATE: { [el.parent.key]: el.node.value }
30
+ CLIENT_STATE: { [el.parent.key]: el.node.value }
31
31
  }
32
- rootState.update({ SYSTEM: obj })
32
+ rootState.update(obj)
33
33
  }
34
34
  }
35
35
  }
@@ -80,7 +80,7 @@ export const State = {
80
80
 
81
81
  on: {
82
82
  stateUpdated: (el, s) => {
83
- s.systemUpdate({ STATE: s.parse })
83
+ s.systemUpdate({ CLIENT_STATE: s.parse })
84
84
  }
85
85
  }
86
86
  }
@@ -145,11 +145,11 @@ export const Theme = {
145
145
 
146
146
  on: {
147
147
  init: (el, s) => {
148
- if (!s.__system) return
148
+ if (!s.__client_system) return
149
149
  const path = window.location.pathname
150
150
  const pathArray = path.split('theme/')
151
- if (!s.__system) return
152
- const { THEME } = s.__system
151
+ if (!s.__client_system) return
152
+ const { THEME } = s.__client_system
153
153
  const themeName = pathArray[1]
154
154
  var value = THEME[themeName]
155
155
 
@@ -50,11 +50,11 @@ const isTag = v => HTML_TAGS.root.indexOf(v) > -1 || HTML_TAGS.body.indexOf(v) >
50
50
  const isHelper = v => v.slice(0, 1) === '.'
51
51
 
52
52
  const getCollectionFromArray = (arr, s) => {
53
- const { __system } = s
54
- const { TYPOGRAPHY } = __system
53
+ const { __client_system } = s
54
+ const { TYPOGRAPHY } = __client_system
55
55
  const { styles } = TYPOGRAPHY
56
56
  return arr.map((v, k) => {
57
- const result = getTypeStyle(v, __system)
57
+ const result = getTypeStyle(v, __client_system)
58
58
  return {
59
59
  key: v,
60
60
  value: {
@@ -82,8 +82,8 @@ export const headingsCollection = (el, s) => {
82
82
  }
83
83
 
84
84
  export const tagsCollection = (el, s) => {
85
- const { __system } = s
86
- const { TYPOGRAPHY } = __system
85
+ const { __client_system } = s
86
+ const { TYPOGRAPHY } = __client_system
87
87
  const { styles } = TYPOGRAPHY
88
88
  if (!styles.body) styles.body = {}
89
89
  el.removeContent()
@@ -97,8 +97,8 @@ export const tagsCollection = (el, s) => {
97
97
  }
98
98
 
99
99
  export const helpersCollection = (el, s) => {
100
- const { __system } = s
101
- const { TYPOGRAPHY } = __system
100
+ const { __client_system } = s
101
+ const { TYPOGRAPHY } = __client_system
102
102
  const { styles } = TYPOGRAPHY
103
103
 
104
104
  const HELPERS = Object.keys(styles)
@@ -113,9 +113,9 @@ export default {
113
113
 
114
114
  on: {
115
115
  init: (el, s) => {
116
- if (!s.__system) return
117
- const { __system } = s
118
- const { TYPOGRAPHY } = __system
116
+ if (!s.__client_system) return
117
+ const { __client_system } = s
118
+ const { TYPOGRAPHY } = __client_system
119
119
  const { styles } = TYPOGRAPHY
120
120
  if (styles) {
121
121
  s.update({ styles }, { preventUpdate: true })
@@ -30,7 +30,7 @@ export const Typography = {
30
30
 
31
31
  on: {
32
32
  init: (el, s) => {
33
- if (!s.__system.TYPOGRAPHY) {
33
+ if (!s.__client_system.TYPOGRAPHY) {
34
34
  s.systemUpdate({
35
35
  TYPOGRAPHY: { base: s.base, ratio: s.ratio }
36
36
  })