@symbo.ls/preview 0.0.58 → 0.0.60

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.58",
5
+ "version": "0.0.60",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
@@ -25,8 +25,10 @@
25
25
  "dependencies": {
26
26
  "@domql/router": "latest",
27
27
  "@domql/tags": "latest",
28
+ "@symbo.ls/cli": "^0.6.23",
28
29
  "@symbo.ls/components": "latest",
29
30
  "@symbo.ls/config": "latest",
31
+ "@symbo.ls/config-default": "^1.0.1",
30
32
  "@symbo.ls/icons": "latest",
31
33
  "@symbo.ls/init": "^1.1.3",
32
34
  "@symbo.ls/scratch": "latest",
package/src/app.js CHANGED
@@ -4,11 +4,8 @@ import './config'
4
4
 
5
5
  import 'domql/packages/emotion'
6
6
  import { router } from '@domql/router'
7
- import { init } from '@symbo.ls/init'
8
7
  import { openModal } from '@symbo.ls/components'
9
8
 
10
- // import { send } from '@symbo.ls/socket/client'
11
-
12
9
  import { state } from './state'
13
10
  import {
14
11
  Components,
@@ -17,6 +14,8 @@ import {
17
14
  Library
18
15
  } from './pages'
19
16
 
17
+ import { Sync } from './sync'
18
+
20
19
  const SUB_ROUTES = {}
21
20
  Object.keys(DesignSystem.routes).map(route => {
22
21
  SUB_ROUTES[route] = {
@@ -32,6 +31,7 @@ Object.keys(DesignSystem.routes).map(route => {
32
31
 
33
32
  const App = {
34
33
  key: 'app',
34
+ extend: [Sync],
35
35
 
36
36
  state,
37
37
 
@@ -67,12 +67,6 @@ const App = {
67
67
  router(element, url, {})
68
68
  },
69
69
  update: (el, s) => { openModal(el, s) },
70
- stateUpdated: (el, s, changes) => {
71
- if (changes.SYSTEM) {
72
- init(changes.SYSTEM)
73
- // send(changes.SYSTEM, s.SYSTEM)
74
- }
75
- },
76
70
  scroll: (ev, el) => {
77
71
  const { scrollTop } = el.node
78
72
  const isFloating = scrollTop > 0
@@ -49,7 +49,7 @@ export const TutorialBanner = {
49
49
  },
50
50
 
51
51
  ':hover': {
52
- padding: 'B B1',
52
+ padding: '- C1 - -',
53
53
  ':before': { opacity: '1' },
54
54
  ':after': { opacity: '1' }
55
55
  }
@@ -4,18 +4,20 @@ import { Flex } from '@symbo.ls/components'
4
4
 
5
5
  export const SlidersWithResponsive = {
6
6
  extend: Flex,
7
+
7
8
  props: {
8
9
  align: 'flex-end space-between',
9
10
  position: 'sticky',
10
11
  top: 'C2',
11
12
  background: 'black .5',
12
- zIndex: '9999',
13
+ zIndex: '9',
13
14
  margin: '-B2 -B -B',
14
15
  padding: 'B2 B B',
15
16
  style: {
16
17
  backdropFilter: 'blur(15px)'
17
18
  }
18
19
  },
20
+
19
21
  SequenceSliders: {},
20
22
  DeviceButtonSet: {}
21
23
  }
@@ -0,0 +1,37 @@
1
+ 'use strict'
2
+
3
+ import { Flex } from '@symbo.ls/components'
4
+ import { TutorialBanner } from '../../../components'
5
+
6
+ import DARK_PNG from '../../../assets/dark.png'
7
+ import TYPE_PNG from '../../../assets/type.png'
8
+ import SPACE_PNG from '../../../assets/space.png'
9
+
10
+ export default {
11
+ extend: Flex,
12
+
13
+ props: {
14
+ align: 'stretch space-between',
15
+ margin: 'C1 -Z1',
16
+ gap: 'B1'
17
+ },
18
+
19
+ childExtend: TutorialBanner,
20
+
21
+ $setStateCollection: ({ state }) => [{
22
+ title: 'Setting up a dark theme',
23
+ p: '1 min tutorial',
24
+ background: DARK_PNG,
25
+ href: ''
26
+ }, {
27
+ title: 'Learn typography scaling',
28
+ p: '2 mins tutorial',
29
+ background: TYPE_PNG,
30
+ href: ''
31
+ }, {
32
+ title: 'How scaling of space works',
33
+ p: '5 mins tutorial',
34
+ background: SPACE_PNG,
35
+ href: ''
36
+ }]
37
+ }
@@ -1,42 +1,8 @@
1
1
  'use strict'
2
2
 
3
- import { Flex } from '@symbo.ls/components'
4
- import { TutorialBanner } from '../../../components'
5
-
6
3
  import summary from './summary'
7
4
  import quickstart from './quickstart'
8
-
9
- import DARK_PNG from '../../../assets/dark.png'
10
- import TYPE_PNG from '../../../assets/type.png'
11
- import SPACE_PNG from '../../../assets/space.png'
12
-
13
- const banners = {
14
- extend: Flex,
15
- props: {
16
- align: 'stretch space-between',
17
- margin: 'C1 -Z1',
18
- gap: 'B1'
19
- },
20
-
21
- childExtend: TutorialBanner,
22
-
23
- $setStateCollection: ({ state }) => [{
24
- title: 'Setting up a dark theme',
25
- p: '1 min tutorial',
26
- background: DARK_PNG,
27
- href: ''
28
- }, {
29
- title: 'Learn typography scaling',
30
- p: '2 mins tutorial',
31
- background: TYPE_PNG,
32
- href: ''
33
- }, {
34
- title: 'How scaling of space works',
35
- p: '5 mins tutorial',
36
- background: SPACE_PNG,
37
- href: ''
38
- }]
39
- }
5
+ import banners from './banners'
40
6
 
41
7
  export const DesignSystemDashboard = {
42
8
  ArticleBig: {
@@ -17,7 +17,8 @@ export default {
17
17
  align: 'flex-start space-between',
18
18
  childProps: {
19
19
  flex: '1',
20
- maxWidth: 'H2'
20
+ maxWidth: 'H'
21
+ // width: '100%'
21
22
  }
22
23
  },
23
24
 
@@ -25,7 +26,7 @@ export default {
25
26
  extend: 'QuickStartTerminal',
26
27
  QuickStartNumber: { width: '.87ch', text: '1' },
27
28
  Terminal: {
28
- command: { text: 'yarn add smbls@^1.1.1' }
29
+ command: { text: 'yarn add smbls' }
29
30
  }
30
31
  },
31
32
 
@@ -16,5 +16,16 @@ export const Spaces = {
16
16
 
17
17
  Line: {},
18
18
 
19
- sequence
19
+ sequence,
20
+
21
+ init: (el, s) => {
22
+ if (!s.__system.SPACING) {
23
+ s.systemUpdate({
24
+ SPACING: { base: s.base, ratio: s.ratio }
25
+ }, { preventUpdate: true })
26
+ }
27
+ },
28
+ stateUpdated: (el, s, changes) => {
29
+ s.systemUpdate({ SPACING: changes }, { preventUpdate: true })
30
+ }
20
31
  }
@@ -30,10 +30,14 @@ export const Typography = {
30
30
 
31
31
  on: {
32
32
  init: (el, s) => {
33
+ if (!s.__system.TYPOGRAPHY) {
34
+ s.systemUpdate({
35
+ TYPOGRAPHY: { base: s.base, ratio: s.ratio }
36
+ })
37
+ }
33
38
  mapSequence(s, sortSequence)
34
39
  },
35
40
  stateUpdated: (el, s, changes) => {
36
- console.log(changes)
37
41
  s.systemUpdate({ TYPOGRAPHY: changes })
38
42
  }
39
43
  }
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
3
  export default ({ parent }) => ({
4
- base: parent.state.__system.TYPOGRAPHY.base,
5
- ratio: parent.state.__system.TYPOGRAPHY.ratio,
4
+ base: 16,
5
+ ratio: 1.125,
6
6
  range: [-3, +8],
7
7
  h1Matches: +6,
8
8
  scales: {},
package/src/state.js CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  import SYSTEM from './config'
4
4
  import { LIBRARY, COMPONENTS } from '../.symbols'
5
- import BYLD from '../user_data/byld'
5
+ import BYLD from '../user_data/byld' // eslint-disable-line no-unused-vars
6
6
 
7
7
  export const state = {
8
8
  globalTheme: 'dark',
9
- SYSTEM: BYLD
9
+ SYSTEM: {}
10
10
  }
11
11
 
12
12
  export const context = {
13
- CONFIG: BYLD,
13
+ CONFIG: SYSTEM,
14
14
  LIBRARY,
15
15
  SYSTEM,
16
16
  COMPONENTS
package/src/sync.js ADDED
@@ -0,0 +1,31 @@
1
+ 'use strict'
2
+
3
+ // import { init } from '@symbo.ls/init'
4
+ import { connect, send } from '@symbo.ls/socket/client'
5
+
6
+ import CONFIG_DEFAULT from '@symbo.ls/config-default'
7
+
8
+ const receive = (element, state) => {
9
+ return (event, data) => {
10
+ state.update({ SYSTEM: data })
11
+ if (!state.SYSTEM.TYPOGRAPHY) {
12
+ state.update({
13
+ SYSTEM: CONFIG_DEFAULT
14
+ }, { preventUpdate: true })
15
+ }
16
+ }
17
+ }
18
+
19
+ export const Sync = {
20
+ on: {
21
+ init: (el, s) => {
22
+ connect('ws://localhost:1001', receive(el, s))
23
+ },
24
+ stateUpdated: (el, s, changes) => {
25
+ if (changes.SYSTEM) {
26
+ // init(changes.SYSTEM)
27
+ send(changes.SYSTEM, s.SYSTEM)
28
+ }
29
+ }
30
+ }
31
+ }
package/README.md DELETED
@@ -1,19 +0,0 @@
1
- # Fucking editor!
2
- Example dev setup (boilerplate) to use [DOMQL](https://github.com/rackai/domql). You can also check live editor [Playground](https://github.com/rackai/playground).
3
-
4
- ### Setup
5
-
6
- 1. Clone the repo
7
- ```
8
- git clone git@github.com:symbo-ls/preview.git
9
- ```
10
-
11
- 2. Install scripts
12
- ```
13
- yarn
14
- ```
15
-
16
- 3. Run the project
17
- ```
18
- yarn start
19
- ```