@symbo.ls/preview 0.0.74 → 0.0.76

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": "0.0.74",
5
+ "version": "0.0.76",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
package/src/app.js CHANGED
@@ -12,7 +12,8 @@ import {
12
12
  Components,
13
13
  DesignSystem,
14
14
  Export,
15
- Library
15
+ Library,
16
+ Account
16
17
  } from './pages'
17
18
 
18
19
  import { Sync } from './sync' // eslint-disable-line no-unused-vars
@@ -40,6 +41,7 @@ const App = {
40
41
  define: { routes: param => param },
41
42
  routes: {
42
43
  '/init': Init,
44
+ '/account': Account,
43
45
  '/library': Library,
44
46
  '/design-system': DesignSystem,
45
47
  '/components': Components,
@@ -49,28 +51,7 @@ const App = {
49
51
 
50
52
  content: {},
51
53
 
52
- Modal: {},
53
-
54
- on: {
55
- render: (el, s) => {
56
- const { pathname, hash } = window.location
57
- const url = pathname + hash
58
- router(el, url, {})
59
- },
60
- update: (el, s) => {
61
- const { pathname } = window.location
62
- if (pathname === '/' && !state.initialized) return router(el, '/init/', {})
63
- openModal(el, s)
64
- },
65
- scroll: (ev, el) => {
66
- const { scrollTop } = el.node
67
- const isFloating = scrollTop > 0
68
- if (isFloating !== el.props.isFloating) {
69
- el.props.isFloating = isFloating
70
- // state.update()
71
- }
72
- }
73
- }
54
+ Modal: {}
74
55
  }
75
56
 
76
57
  export default App
@@ -17,6 +17,7 @@ export const Header = {
17
17
  }
18
18
  }
19
19
 
20
+ let cacheToken
20
21
  export const HeaderOnRouter = {
21
22
  extend: Header,
22
23
  props: { width: '100%' },
@@ -28,10 +29,26 @@ export const HeaderOnRouter = {
28
29
  },
29
30
 
30
31
  on: {
31
- render: element => {
32
+ render: (element, s) => {
32
33
  const { pathname, hash } = window.location
33
34
  const url = pathname + hash
34
- router(element, url, {}, { updateState: false })
35
+ if (s.userToken) {
36
+ router(element, '/*', {}, { updateState: false, pushState: false })
37
+ } else {
38
+ router(element, '/', {}, { updateState: false, pushState: false })
39
+ }
40
+ },
41
+ update: (element, s, changes) => {
42
+ const { pathname, hash } = window.location
43
+ const url = pathname + hash
44
+ if (cacheToken !== s.userToken) {
45
+ cacheToken = s.userToken
46
+ if (s.userToken) {
47
+ router(element, '/*', {}, { updateState: false, pushState: false })
48
+ } else {
49
+ router(element, '/', {}, { updateState: false, pushState: false })
50
+ }
51
+ }
35
52
  }
36
53
  }
37
54
  }
@@ -44,15 +44,15 @@ export const DisabledPage = {
44
44
  animationDuration: 'G'
45
45
  },
46
46
 
47
- Overlay: {
48
- background: 'gradient-colorful',
49
- inset: '0 0 0 0',
50
- opacity: '.9',
51
- style: {
52
- WebkitMaskImage: 'url(' + MASK1 + ')',
53
- WebkitMaskSize: '100% 100%'
54
- }
55
- },
47
+ // Overlay: {
48
+ // background: 'gradient-colorful',
49
+ // inset: '0 0 0 0',
50
+ // opacity: '.9',
51
+ // style: {
52
+ // WebkitMaskImage: 'url(' + MASK1 + ')',
53
+ // WebkitMaskSize: '100% 100%'
54
+ // }
55
+ // },
56
56
 
57
57
  message: {
58
58
  props: {
@@ -61,18 +61,21 @@ export const DisabledPage = {
61
61
  animationDelay: 'G',
62
62
  margin: 'auto auto 0',
63
63
  padding: 'C1 E C',
64
- color: 'black',
65
64
  width: '100%',
66
65
  maxWidth: 'K-default'
67
66
  },
68
67
 
69
- H3: 'Custom library will come up soon',
70
- P: {
71
- text: 'Meanwhile, please check the components page',
72
- margin: 'X 0 0',
73
- animation: 'fadeInUpShort',
74
- animationDuration: 'G',
75
- animationDelay: 'G2'
68
+ ArticleBig: {
69
+ title: {
70
+ text: 'Custom library will come up soon'
71
+ },
72
+ p: {
73
+ text: 'Meanwhile, please check the components page',
74
+ margin: 'X 0 0',
75
+ animation: 'fadeInUpShort',
76
+ animationDuration: 'G',
77
+ animationDelay: 'G1'
78
+ }
76
79
  }
77
80
  }
78
81
  }
@@ -10,7 +10,6 @@ export * from './Banner'
10
10
  export * from './ShapeSet'
11
11
  export * from './ColorText'
12
12
  export * from './ThemeButtons'
13
- export * from './ContinueButton'
14
13
  export * from './SlidersWithResponsive'
15
14
  export * from './HeaderHeading'
16
15
  export * from './ColorsPalette'
package/src/index.js CHANGED
@@ -27,7 +27,19 @@ DOM.define({
27
27
  const app = DOM.create({
28
28
  // extend: [Sync, App],
29
29
  extend: [App],
30
- HeaderOnRouter: {}
30
+ HeaderOnRouter: {},
31
+
32
+ on: {
33
+ render: (el, s) => {
34
+ const { pathname, hash } = window.location
35
+ const url = pathname + hash
36
+ router(el, url, {})
37
+ },
38
+ update: (el, s) => {
39
+ const { pathname } = window.location
40
+ openModal(el, s)
41
+ },
42
+ }
31
43
  }, undefined, 'app', {
32
44
  extend: [smbls.Box],
33
45
  components: { ...smbls, ...components },
@@ -0,0 +1,241 @@
1
+ 'use strict'
2
+
3
+ import { Text, Block, Link, SquareButton, Img, ClickableItem, SelectFieldWithCaption, Grid, CheckButton } from '@symbo.ls/components'
4
+ // import { account } from '../SignUp'
5
+
6
+ import setUpProject from './setUpProject'
7
+
8
+ import Page from '../Page'
9
+ import { logout } from '@symbo.ls/auth'
10
+
11
+ const sideBar = {
12
+ tag: 'aside',
13
+ extend: Block,
14
+ style: {
15
+ height: '100%',
16
+ borderRight: '1px solid rgba(255, 255, 255, .06)'
17
+ },
18
+ props: {
19
+ flexFlow: 'column',
20
+ flexAlign: 'flex-start space-between',
21
+ padding: '0 C 0 0'
22
+ },
23
+ nav: {
24
+ extend: Block,
25
+ props: {
26
+ flexFlow: 'column',
27
+ gap: 'A1'
28
+ },
29
+ childExtend: {
30
+ tag: 'a',
31
+
32
+ extend: [SquareButton, Link, ClickableItem],
33
+ props: {
34
+ theme: 'quaternary',
35
+ padding: 0,
36
+ boxSize: 'B1 B1'
37
+ },
38
+ style: { padding: 0 }
39
+ },
40
+
41
+ personal: {
42
+ props: { icon: 'githubOutline' },
43
+ style: { svg: { color: 'white' } },
44
+
45
+ on: {
46
+ click: (ev, el, s) => {
47
+ s.update({ activeTab: el.key })
48
+ Link.on.click(ev, el, s)
49
+ }
50
+ }
51
+ },
52
+ project: {
53
+ style: {
54
+ borderRadius: '100%',
55
+ display: 'block'
56
+ },
57
+ image: {
58
+ extend: Img,
59
+ attr: {
60
+ // src: 'https://p194.p3.n0.cdn.getcloudapp.com/items/yAubz2KN/IMG_2375.jpg?v=c59a92ea47a959e386e952c3d84c08e5'
61
+ src: 'https://ui-avatars.com/api/?font-size=0.5&size=150&name=Rockstar'
62
+ },
63
+ style: {
64
+ width: '100%',
65
+ height: '100%',
66
+ borderRadius: '100%'
67
+ }
68
+ },
69
+
70
+ on: {
71
+ click: (ev, el, s) => {
72
+ s.update({ activeTab: el.key })
73
+ Link.on.click(ev, el, s)
74
+ }
75
+ }
76
+ },
77
+
78
+ add: {
79
+ props: { icon: 'plus' },
80
+ style: { svg: { color: 'rgba(255, 255, 255, .25)' } },
81
+
82
+ on: {
83
+ click: (ev, el, s) => {
84
+ s.update({ activeTab: el.key })
85
+ Link.on.click(ev, el, s)
86
+ }
87
+ }
88
+ }
89
+ },
90
+
91
+ nav2: {
92
+ tag: 'nav',
93
+ extend: Block,
94
+ props: {
95
+ flexFlow: 'column',
96
+ gap: 'A1'
97
+ },
98
+
99
+ style: { svg: { color: 'rgba(255, 255, 255, .25)' } },
100
+ childExtend: {
101
+ extend: [SquareButton, Link],
102
+ props: {
103
+ theme: 'quaternary',
104
+ padding: 0,
105
+ boxSize: 'B1 B1'
106
+ },
107
+ style: { padding: 0 }
108
+ },
109
+
110
+ info: { props: { icon: 'info' } },
111
+ logout: {
112
+ props: { icon: 'upload' },
113
+
114
+ on: {
115
+ click: (ev, el, s) => {
116
+ logout()
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ const fillFields = {
124
+ extend: [Block, Grid],
125
+ props: {
126
+ columns: 'repeat(2, 1fr)',
127
+ columnGap: 'C',
128
+ rowGap: 'C2'
129
+ },
130
+ childExtend: {
131
+ extend: SelectFieldWithCaption,
132
+ style: {
133
+ '> input': { width: '270x', minWidth: '270px', height: '42px' }
134
+ },
135
+ caption: {},
136
+ element: {
137
+ style: {
138
+ minWidth: `${270 / 16}em`,
139
+ height: `${42 / 16}em`
140
+ },
141
+ buttons: { ...[{ props: { theme: 'transparent' } }] }
142
+ }
143
+ },
144
+ ...[
145
+ {
146
+ caption: { props: { text: 'Your Username' } },
147
+ element: {
148
+ tag: 'input',
149
+ attr: {
150
+ value: 'nikoloza'
151
+ }
152
+ }
153
+ },
154
+ {
155
+ caption: { props: { text: 'Your role' } },
156
+ element: {
157
+ title: { props: { text: 'Design' } }
158
+ }
159
+ },
160
+ {
161
+ caption: { props: { text: 'Country and region' } },
162
+ element: {
163
+ props: { gap: 'W' },
164
+ title: {
165
+ props: { text: 'Georgia' },
166
+
167
+ style: {
168
+ '&::before': {
169
+ content: '"🇬🇪"'
170
+ }
171
+ }
172
+ }
173
+ }
174
+ },
175
+
176
+ {
177
+ caption: { props: { text: 'Time-zone' } },
178
+ element: {
179
+ props: { gap: 'W' },
180
+ title: {
181
+ props: { text: 'Tbilisi(GMT+4)' }
182
+ }
183
+ }
184
+ }
185
+ ]
186
+ }
187
+
188
+ const personalAccount = {
189
+ extend: Block,
190
+ props: {
191
+ // padding: '0 0 0 E',
192
+ flexFlow: 'column',
193
+ flexAlign: 'flex-start flex-start',
194
+ gap: 'C2'
195
+ },
196
+ caption: {
197
+ extend: [Text, Block],
198
+ props: {
199
+ text: 'Your personal account'
200
+ }
201
+ },
202
+
203
+ fields: {
204
+ extend: { fillFields }
205
+ },
206
+ button: {
207
+ extend: CheckButton,
208
+ props: {
209
+ text: 'Save Updates'
210
+ },
211
+ style: {
212
+ background: '#0079FD',
213
+ '> svg': { color: 'white' },
214
+ '&:hover': { background: '#0079FD' }
215
+ }
216
+ }
217
+ }
218
+
219
+ export const Account = {
220
+ extend: Page,
221
+ props: {
222
+ flexAlign: 'flex-start flex-start',
223
+ padding: 'C1 0 D1 0',
224
+ gap: 'E'
225
+ },
226
+ define: { routes: param => param },
227
+ state: {
228
+ activeTab: 'personal'
229
+ },
230
+
231
+ sideBar,
232
+
233
+ routes: {
234
+ personal: personalAccount,
235
+ project: setUpProject
236
+ },
237
+
238
+ page: {
239
+ content: (el, s) => ({ extend: el.parent.routes[s.activeTab] })
240
+ }
241
+ }
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import { Text, Block, Img, SquareButton, SelectField } from '@symbo.ls/components'
4
- import { SetUp } from '..'
4
+ import { SetUp } from '../..'
5
5
 
6
6
  export default {
7
7
  caption: {
@@ -1,27 +1,19 @@
1
1
  'use strict'
2
2
 
3
- import { Text, Block, Link, SquareButton, Img, ClickableItem, SelectFieldWithCaption, Grid, CheckButton } from '@symbo.ls/components'
4
- // import { account } from '../SignUp'
5
-
6
- import setUpProject from './setUpProject'
7
-
8
- import Page from '../Page'
9
- import { logout } from '@symbo.ls/auth'
3
+ import { Link, Img, SquareButton, ClickableItem } from '@symbo.ls/components'
10
4
 
11
5
  const sideBar = {
12
6
  tag: 'aside',
13
- extend: Block,
14
7
  style: {
15
- height: '100%',
16
- borderRight: '1px solid rgba(255, 255, 255, .06)'
17
8
  },
18
9
  props: {
19
10
  flexFlow: 'column',
20
11
  flexAlign: 'flex-start space-between',
21
- padding: '0 C 0 0'
12
+ padding: '0 C 0 0',
13
+ height: '100%',
14
+ style: { borderRight: '1px solid rgba(255, 255, 255, .06)' }
22
15
  },
23
16
  nav: {
24
- extend: Block,
25
17
  props: {
26
18
  flexFlow: 'column',
27
19
  gap: 'A1'
@@ -34,8 +26,7 @@ const sideBar = {
34
26
  theme: 'quaternary',
35
27
  padding: 0,
36
28
  boxSize: 'B1 B1'
37
- },
38
- style: { padding: 0 }
29
+ }
39
30
  },
40
31
 
41
32
  personal: {
@@ -56,11 +47,8 @@ const sideBar = {
56
47
  },
57
48
  image: {
58
49
  extend: Img,
59
- attr: {
60
- // src: 'https://p194.p3.n0.cdn.getcloudapp.com/items/yAubz2KN/IMG_2375.jpg?v=c59a92ea47a959e386e952c3d84c08e5'
61
- src: 'https://ui-avatars.com/api/?font-size=0.5&size=150&name=Rockstar'
62
- },
63
- style: {
50
+ props: {
51
+ src: 'https://ui-avatars.com/api/?font-size=0.5&size=150&name=Rockstar',
64
52
  width: '100%',
65
53
  height: '100%',
66
54
  borderRadius: '100%'
@@ -90,7 +78,6 @@ const sideBar = {
90
78
 
91
79
  nav2: {
92
80
  tag: 'nav',
93
- extend: Block,
94
81
  props: {
95
82
  flexFlow: 'column',
96
83
  gap: 'A1'
@@ -109,133 +96,16 @@ const sideBar = {
109
96
 
110
97
  info: { props: { icon: 'info' } },
111
98
  logout: {
112
- props: { icon: 'upload' },
113
-
114
- on: {
115
- click: (ev, el, s) => {
116
- logout()
117
- }
118
- }
119
- }
120
- }
121
- }
122
-
123
- const fillFields = {
124
- extend: [Block, Grid],
125
- props: {
126
- columns: 'repeat(2, 1fr)',
127
- columnGap: 'C',
128
- rowGap: 'C2'
129
- },
130
- childExtend: {
131
- extend: SelectFieldWithCaption,
132
- style: {
133
- '> input': { width: '270x', minWidth: '270px', height: '42px' }
134
- },
135
- caption: {},
136
- element: {
137
- style: {
138
- minWidth: `${270 / 16}em`,
139
- height: `${42 / 16}em`
140
- },
141
- buttons: { ...[{ props: { theme: 'transparent' } }] }
142
- }
143
- },
144
- ...[
145
- {
146
- caption: { props: { text: 'Your Username' } },
147
- element: {
148
- tag: 'input',
149
- attr: {
150
- value: 'nikoloza'
151
- }
152
- }
153
- },
154
- {
155
- caption: { props: { text: 'Your role' } },
156
- element: {
157
- title: { props: { text: 'Design' } }
158
- }
159
- },
160
- {
161
- caption: { props: { text: 'Country and region' } },
162
- element: {
163
- props: { gap: 'W' },
164
- title: {
165
- props: { text: 'Georgia' },
166
-
167
- style: {
168
- '&::before': {
169
- content: '"🇬🇪"'
170
- }
171
- }
172
- }
173
- }
174
- },
175
-
176
- {
177
- caption: { props: { text: 'Time-zone' } },
178
- element: {
179
- props: { gap: 'W' },
180
- title: {
181
- props: { text: 'Tbilisi(GMT+4)' }
182
- }
183
- }
184
- }
185
- ]
186
- }
187
-
188
- const personalAccount = {
189
- extend: Block,
190
- props: {
191
- // padding: '0 0 0 E',
192
- flexFlow: 'column',
193
- flexAlign: 'flex-start flex-start',
194
- gap: 'C2'
195
- },
196
- caption: {
197
- extend: [Text, Block],
198
- props: {
199
- text: 'Your personal account'
200
- }
201
- },
202
-
203
- fields: {
204
- extend: { fillFields }
205
- },
206
- button: {
207
- extend: CheckButton,
208
- props: {
209
- text: 'Save Updates'
210
- },
211
- style: {
212
- background: '#0079FD',
213
- '> svg': { color: 'white' },
214
- '&:hover': { background: '#0079FD' }
99
+ props: { icon: 'logout', href: '/logout' },
215
100
  }
216
101
  }
217
102
  }
218
103
 
219
- export default {
220
- extend: Page,
221
- props: {
222
- flexAlign: 'flex-start flex-start',
223
- padding: 'C1 0 D1 0',
224
- gap: 'E'
225
- },
226
- define: { routes: param => param },
227
- state: {
228
- activeTab: 'personal'
229
- },
230
-
104
+ export const Account = {
231
105
  sideBar,
232
-
233
- routes: {
234
- personal: personalAccount,
235
- project: setUpProject
236
- },
237
-
238
- page: {
239
- content: (el, s) => ({ extend: el.parent.routes[s.activeTab] })
106
+ on: {
107
+ render: element => {
108
+
109
+ }
240
110
  }
241
111
  }
@@ -20,7 +20,12 @@ export default {
20
20
  props: {
21
21
  margin: '0 0 X2',
22
22
  title: null,
23
- p: 'All Categories'
23
+ heading: {
24
+ p: {
25
+ opacity: '0',
26
+ text: 'All Categories'
27
+ },
28
+ }
24
29
  },
25
30
 
26
31
  heading: {},
@@ -1,13 +1,18 @@
1
1
  'use strict'
2
2
 
3
- import { FilterCategories, FilterInteractivity, FilterDataTypes } from '@symbo.ls/components'
3
+ import {
4
+ FilterCategories,
5
+ FilterInteractivity,
6
+ FilterDataTypes
7
+ } from '@symbo.ls/components'
4
8
  import { CATEGORIES } from '../../../.symbols/categories'
5
9
 
6
10
  export default {
7
11
  sticky: {
8
12
  props: {
9
13
  position: 'sticky',
10
- top: 'C2'
14
+ top: 'D2',
15
+ padding: '- - - X2'
11
16
  },
12
17
 
13
18
  categories: {
@@ -1,10 +1,12 @@
1
1
 
2
- import { DesignElement } from '@symbo.ls/components'
2
+ import { Flex, DesignElement } from '@symbo.ls/components'
3
3
 
4
4
  export default {
5
+ extend: Flex,
6
+
5
7
  props: {
6
- flexFlow: 'row wrap',
7
- flexAlign: 'flex-start flex-start',
8
+ flow: 'row wrap',
9
+ align: 'flex-start flex-start',
8
10
  gap: 'C B2',
9
11
  padding: 'B1 0 B2',
10
12
  margin: '0 -Z2'
@@ -152,7 +152,7 @@ export const DesignSystem = {
152
152
 
153
153
  define: { routes: param => param },
154
154
  routes: {
155
- '/': DesignSystemDashboard,
155
+ // '/': DesignSystemDashboard,
156
156
  '/design-system': DesignSystemDashboard,
157
157
  '/colors': Color,
158
158
  '/theme': Theme,
@@ -0,0 +1,116 @@
1
+ 'use strict'
2
+
3
+ import {
4
+ findHeadingLetter,
5
+ getFontFamily
6
+ } from '@symbo.ls/scratch'
7
+ import { HTML_TAGS } from '@domql/tags'
8
+
9
+ const propertyDefaults = {
10
+ fontSize: 'A',
11
+ fontWeight: '400',
12
+ lineHeight: '1.4',
13
+ letterSpacing: '0',
14
+ italic: '0',
15
+ letterWidth: '0'
16
+ }
17
+
18
+ const iconMap = {
19
+ font: 'fontFace',
20
+ fontWeight: 'fontVariable',
21
+ lineHeight: 'textLineHeight',
22
+ letterSpacing: 'textLetterSpacing',
23
+ italic: 'fontStyleItalic',
24
+ letterWidth: 'textLetterWidth'
25
+ }
26
+
27
+ const getTypeProp = (key, prop, library, defaultValue) => {
28
+ const { TYPOGRAPHY } = library
29
+ const { styles } = TYPOGRAPHY
30
+ if (!styles[key]) styles[key] = {}
31
+ return styles[key][prop] ||
32
+ styles[prop] ||
33
+ TYPOGRAPHY[prop] ||
34
+ defaultValue ||
35
+ propertyDefaults[prop]
36
+ }
37
+
38
+ const getTypeStyle = (key, library) => ({
39
+ font: getFontFamily(key, library.FONT_FAMILY)[0],
40
+ fontSize: getTypeProp(key, 'fontSize', library),
41
+ fontWeight: getTypeProp(key, 'fontWeight', library),
42
+ lineHeight: getTypeProp(key, 'lineHeight', library),
43
+ letterSpacing: getTypeProp(key, 'letterSpacing', library),
44
+ italic: getTypeProp(key, 'italic', library),
45
+ letterWidth: getTypeProp(key, 'letterWidth', library)
46
+ })
47
+
48
+
49
+ const isHeading = v => v.length === 2 && v[0] === 'h'
50
+ const isTag = v => HTML_TAGS.root.indexOf(v) > -1 ||
51
+ HTML_TAGS.body.indexOf(v) > -1
52
+ const isHelper = v => v.slice(0, 1) === '.'
53
+
54
+ const getCollectionFromArray = (arr, s) => {
55
+ const { __system } = s
56
+ const { TYPOGRAPHY } = __system
57
+ const { styles } = TYPOGRAPHY
58
+ return arr.map((v, k) => {
59
+ const result = getTypeStyle(v, __system)
60
+ return {
61
+ key: v,
62
+ value: {
63
+ ...result,
64
+ ...styles[v]
65
+ },
66
+ labels: Object.keys(result)
67
+ .filter(key => key !== 'fontSize' && result[key] && result[key] !== '0')
68
+ .map(key => ({
69
+ icon: iconMap[key],
70
+ text: result[key]
71
+ })
72
+ ),
73
+ sequenceValue: s.sequence[
74
+ isHeading(v) ? findHeadingLetter(s.h1Matches, k) : result.fontSize
75
+ ]
76
+ }
77
+ })
78
+ }
79
+
80
+ export const headingsCollection = (el, s) => {
81
+ el.removeContent()
82
+ const HEADINGS = new Array(6).fill(null).map((_, i) => 'h' + (i + 1))
83
+ return getCollectionFromArray(HEADINGS, s)
84
+ }
85
+
86
+ export const tagsCollection = (el, s) => {
87
+ const { __system } = s
88
+ const { FONT_FAMILY, TYPOGRAPHY } = __system
89
+ const { styles } = TYPOGRAPHY
90
+ if (!styles.body) styles.body = {}
91
+ el.removeContent()
92
+
93
+ const TAGS = Object.keys(styles)
94
+ .filter(v => {
95
+ return isTag(v) && !isHeading(v) && !isHelper(v)
96
+ })
97
+
98
+ return getCollectionFromArray(TAGS, s)
99
+ }
100
+
101
+ export const helpersCollection = (el, s) => {
102
+ const { __system } = s
103
+ const { TYPOGRAPHY, FONT_FAMILY } = __system
104
+ let { styles } = TYPOGRAPHY
105
+ if (!styles) styles = TYPOGRAPHY.styles = {}
106
+ el.removeContent()
107
+
108
+ const { lineHeight, fontWeight } = TYPOGRAPHY
109
+ const familyValue = getFontFamily('def', FONT_FAMILY)
110
+ const font = familyValue[0]
111
+
112
+ const HELPERS = Object.keys(styles)
113
+ .filter(v => v.slice(0, 1) === '.')
114
+
115
+ return getCollectionFromArray(HELPERS, s)
116
+ }
@@ -1,13 +1,13 @@
1
1
  'use strict'
2
2
 
3
- import { findHeadingLetter, getFontFamily } from '@symbo.ls/scratch'
4
3
  import {
5
4
  DocumentStylesSequence,
6
5
  Flex,
7
- SelectField
6
+ SelectField,
7
+ HTMLTagTypeObject
8
8
  } from '@symbo.ls/components'
9
9
 
10
- import { HTML_TAGS } from '@domql/tags' // eslint-disable-line no-unused-vars
10
+ import { headingsCollection, tagsCollection } from './collection'
11
11
 
12
12
  export default {
13
13
  SectionHeader: {
@@ -36,106 +36,12 @@ export default {
36
36
 
37
37
  headings: {
38
38
  extend: DocumentStylesSequence,
39
-
40
- $setStateCollection: (el, s) => {
41
- const { __system } = s
42
- const { TYPOGRAPHY, FONT_FAMILY } = __system
43
- let { styles } = TYPOGRAPHY
44
- if (!styles) styles = TYPOGRAPHY.styles = {}
45
-
46
- const familyValue = getFontFamily('def', FONT_FAMILY)
47
- const { lineHeight, fontWeight } = TYPOGRAPHY
48
- const font = familyValue[0]
49
- const HEADINGS = new Array(6).fill(null).map((_, i) => 'h' + (i + 1))
50
-
51
- el.removeContent()
52
- const calcProp = (key, prop, defaultValue) => {
53
- if (!styles[key]) styles[key] = {}
54
- return styles[key][prop] || styles[prop] || defaultValue
55
- }
56
-
57
- return HEADINGS.map((v, k) => ({
58
- key: v,
59
- value: {
60
- font,
61
- fontFamily: calcProp(v, 'fontFamily', familyValue),
62
- fontWeight: calcProp(v, 'fontWeight', fontWeight),
63
- lineHeight: calcProp(v, 'lineHeight', lineHeight),
64
- ...(styles ? styles[v] : {})
65
- },
66
- labels: [
67
- { icon: 'fontFace', text: font },
68
- { icon: 'fontVariable', text: 900 - (k * 100) },
69
- { icon: 'textLineHeight', text: lineHeight }
70
- ],
71
- sequenceValue: s.sequence[
72
- findHeadingLetter(s.h1Matches, k)
73
- ]
74
- }))
75
- }
39
+ $setStateCollection: headingsCollection
76
40
  },
77
41
 
78
42
  doc: {
79
43
  extend: DocumentStylesSequence,
80
- $setStateCollection: (el, s) => {
81
- const { __system } = s
82
- const { FONT_FAMILY, TYPOGRAPHY } = __system
83
- const { styles, lineHeight, fontWeight } = TYPOGRAPHY
84
- if (!styles.body) styles.body = {}
85
-
86
- const familyValue = getFontFamily('def', FONT_FAMILY)
87
- const font = familyValue[0]
88
-
89
- el.removeContent()
90
- return [{
91
- key: 'body',
92
- value: {
93
- fontFamily: styles ? styles['body'].fontFamily || styles.fontFamily : familyValue,
94
- fontWeight: styles ? styles['body'].fontWeight || styles.fontWeight : fontWeight,
95
- lineHeight: styles ? styles['body'].lineHeight || styles.lineHeight : lineHeight,
96
- ...(styles ? styles['body'] : {})
97
- },
98
- labels: [
99
- { icon: 'fontFace', text: font },
100
- { icon: 'fontVariable', text: fontWeight || 400 },
101
- { icon: 'textLineHeight', text: lineHeight }
102
- ],
103
- sequenceValue: s.sequence['A']
104
- }]
105
- }
106
- },
107
-
108
- helpers: {
109
- $setStateCollection: (el, s) => {
110
- const { state, context } = el // eslint-disable-line no-unused-vars
111
- const { __system } = s
112
- const { TYPOGRAPHY, FONT_FAMILY } = __system
113
- const { styles, lineHeight, fontWeight } = TYPOGRAPHY
114
-
115
- const familyValue = getFontFamily('def', FONT_FAMILY)
116
- const font = familyValue[0]
117
-
118
- el.removeContent()
119
- if (!styles) return
120
- return Object.keys(styles).filter(v => v.slice(0, 1) === '.').map((v, k) => ({
121
- key: v,
122
- value: {
123
- font,
124
- fontFamily: familyValue,
125
- fontWeight: styles[v].fontWeight || fontWeight,
126
- lineHeight,
127
- ...styles[v]
128
- },
129
- labels: [
130
- { icon: 'fontFace', text: font },
131
- { icon: 'fontVariable', text: 900 - (k * 100) },
132
- { icon: 'textLineHeight', text: lineHeight }
133
- ],
134
- sequenceValue: state.sequence[
135
- findHeadingLetter(state.h1Matches, k)
136
- ]
137
- }))
138
- }
44
+ $setStateCollection: tagsCollection
139
45
  },
140
46
 
141
47
  footer: {}
@@ -149,42 +55,32 @@ export default {
149
55
  align: 'center flex-start'
150
56
  },
151
57
 
152
- interactivities: {
58
+ tags: {
153
59
  extend: Flex,
154
60
  props: { gap: 'A' },
155
- childExtend: {
156
- extend: SelectField,
157
- props: {
158
- justifyContent: 'space-between',
159
- svg: { color: 'rgba(255, 255, 255, .35)' },
160
- icon: { name: 'plus' }
161
- },
61
+ childExtend: HTMLTagTypeObject,
162
62
 
163
- title: {},
164
- buttons: {
165
- ...[{ props: { icon: 'plus' } }]
166
- }
167
- },
168
-
169
- ...[{
63
+ p: {
170
64
  props: {
171
65
  title: {
172
66
  text: '<p>'
173
67
  }
174
68
  }
175
- }, {
69
+ },
70
+ code: {
176
71
  props: {
177
72
  title: {
178
73
  text: '<code>'
179
74
  }
180
75
  }
181
- }, {
76
+ },
77
+ pre: {
182
78
  props: {
183
79
  title: {
184
80
  text: '<pre>'
185
81
  }
186
82
  }
187
- }]
83
+ }
188
84
  },
189
85
 
190
86
  VerticalLine: {
@@ -5,7 +5,7 @@ import {
5
5
  SectionHeader,
6
6
  TypeHelperObject
7
7
  } from '@symbo.ls/components'
8
- import { findHeadingLetter, getFontFamily } from '@symbo.ls/scratch'
8
+ import { helpersCollection } from './collection'
9
9
 
10
10
  export default {
11
11
  header: {
@@ -25,37 +25,6 @@ export default {
25
25
  props: { columns: 'repeat(3, 1fr)' },
26
26
 
27
27
  childExtend: TypeHelperObject,
28
-
29
- $setStateCollection: (el) => {
30
- const { state, context } = el // eslint-disable-line no-unused-vars
31
- const { TYPOGRAPHY, FONT_FAMILY } = context.SYSTEM
32
- const { styles } = TYPOGRAPHY
33
- el.removeContent()
34
-
35
- const family = FONT_FAMILY[FONT_FAMILY.default]
36
- const familyValue = getFontFamily()
37
- const lineHeight = TYPOGRAPHY.lineHeight
38
- const font = family.arr[0]
39
-
40
- const HELPERS = Object.keys(styles).filter(v => v.slice(0, 1) === '.')
41
- return HELPERS.map((v, k) => ({
42
- key: v,
43
- value: {
44
- font,
45
- fontFamily: familyValue,
46
- fontWeight: 900 - (k * 100),
47
- lineHeight,
48
- ...styles[v]
49
- },
50
- labels: [
51
- { icon: 'fontFace', text: font },
52
- { icon: 'fontVariable', text: 900 - (k * 100) },
53
- { icon: 'textLineHeight', text: lineHeight }
54
- ],
55
- sequenceValue: state.sequence[
56
- findHeadingLetter(state.h1Matches, k)
57
- ]
58
- }))
59
- }
28
+ $setStateCollection: helpersCollection
60
29
  }
61
30
  }
@@ -13,3 +13,4 @@ export * from './Spaces'
13
13
  export * from './Typography'
14
14
  export * from './MediaQuery'
15
15
  export * from './DesignSystem'
16
+ export * from './Account'
@@ -1,15 +0,0 @@
1
- 'use strict'
2
-
3
- import { Button, ClickableItem, Link } from '@symbo.ls/components'
4
-
5
- export const ContinueButton = {
6
- extend: [ClickableItem, Button, Link],
7
- props: {
8
- text: 'Continue',
9
- fontSize: 'A2',
10
- padding: 'Z1 C2',
11
- theme: 'secondary',
12
- margin: 'auto - - -Z',
13
- fontWeight: '500'
14
- }
15
- }