@symbo.ls/preview 2.6.17 → 2.6.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
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/preview",
3
3
  "description": "",
4
4
  "author": "",
5
- "version": "2.6.17",
5
+ "version": "2.6.18",
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",
package/src/app.js CHANGED
@@ -38,7 +38,6 @@ const App = {
38
38
  '/design-system': DesignSystem,
39
39
  '/components': Components,
40
40
  '/component': Export,
41
- // '/state': State,
42
41
  ...SUB_ROUTES
43
42
  },
44
43
 
@@ -25,7 +25,6 @@ export const ThemeButtons = {
25
25
  on: {
26
26
  stateUpdated: (el, s) => {
27
27
  s.parent.update({ [s.key]: s.value })
28
- return false
29
28
  }
30
29
  }
31
30
  },
@@ -68,7 +68,7 @@ export default {
68
68
 
69
69
  title: {},
70
70
  list: {
71
- $setStateCollection: ({ state }) => state.props
71
+ // $setStateCollection: ({ state }) => state.props
72
72
  }
73
73
  },
74
74
 
@@ -52,6 +52,7 @@ export const Export = {
52
52
  ...content
53
53
  }, { preventUpdate: true })
54
54
  }
55
+
55
56
  if (componentKey.length === 32) { // this might be Gist
56
57
  fetchGist(componentKey, state)
57
58
  }
@@ -73,8 +74,8 @@ export const Export = {
73
74
  flex: '1'
74
75
  },
75
76
 
76
- tools
77
- // description
77
+ tools,
78
+ description
78
79
  }
79
80
 
80
81
  // footer: { extend: Footer }
@@ -1,17 +1,7 @@
1
1
  'use strict'
2
2
 
3
- import DOM from 'domql'
4
- import { transformEmotionClass, transformEmotionStyle } from 'domql/packages/emotion'
5
- import { createEmotion } from '@symbo.ls/create-emotion'
6
- import { updateReset } from '@symbo.ls/init'
7
- import { isString } from '@domql/utils'
8
-
9
- import { getActiveConfig, activateConfig } from '@symbo.ls/scratch'
10
- import { init, Box, Scene } from '@symbo.ls/components'
11
-
12
- import * as components from '../../components'
13
-
14
- const emCache = {}
3
+ import { getActiveConfig } from '@symbo.ls/scratch'
4
+ import { Scene } from '@symbo.ls/components'
15
5
 
16
6
  export default {
17
7
  extend: Scene,
@@ -31,6 +21,7 @@ export default {
31
21
  props: {
32
22
  padding: 'B 0',
33
23
  maxHeight: '40em',
24
+ position: 'relative',
34
25
  minHeight: '65vh'
35
26
  },
36
27
 
@@ -42,86 +33,26 @@ export default {
42
33
  })
43
34
  },
44
35
 
45
- content: {
46
- props: {
47
- transition: 'all, B, defaultBezier',
48
- style: {
49
- '*': { transition: 'all 255ms cubic-bezier(.29,.67,.51,.97)' }
50
- }
51
- },
52
-
53
- comp: (el, s) => {
54
- if (s.live) {
55
- const PROJECT_SYSTEM = s.__projectSystem
56
- const styleNode = document.createElement('head')
57
- const emotion = createEmotion('client', styleNode)
58
- emCache['client'] = emotion
59
-
60
- const emotionStyle = transformEmotionStyle(emotion, true)
61
- const emotionClass = transformEmotionClass(emotion, true)
62
-
63
- const newDom = DOM.create({
64
- tag: 'shadow',
65
- state: s.state
66
- }, el.parent.node, 'comp', {
67
- extend: [Box],
68
- define: { style: emotionStyle, class: emotionClass },
69
- components,
70
- context: { system: PROJECT_SYSTEM }
71
- })
72
-
73
- newDom.node.appendChild(styleNode)
74
-
75
- init(PROJECT_SYSTEM, null, { emotion, initDOMQLDefine: false, newConfig: 'client' })
76
- activateConfig('client')
77
-
78
- newDom.set({
79
- tag: 'fragment',
80
- [s.key]: {
81
- extend: isString(s.component) ? document.eval(s.component) : s.component,
82
- props: { inheritSpacingRatio: true }
83
- },
84
- on: {
85
- render: (el) => {
86
- // const appKey = el.__root.state.appKey && el.__root.state.appKey.split('.')[0]
87
- }
88
- }
89
- })
90
-
91
- activateConfig(0)
92
- return newDom
93
- }
94
-
95
- return {
96
- extend: {
97
- extend: isString(s.component) ? document.eval(s.component) : s.component
98
- },
99
- props: { inheritSpacingRatio: true }
100
- }
101
- },
102
-
36
+ Iframe: {
37
+ props: (el, s) => ({
38
+ id: 'component',
39
+ src: `/scene/${s.key}`,
40
+ border: '0',
41
+ background: 'transparent',
42
+ position: 'absolute',
43
+ boxSize: '100% 100%',
44
+ inset: '0 0 0 0'
45
+ }),
103
46
  on: {
104
47
  initUpdate: (el, s) => {
105
- if (s.live) {
106
- activateConfig('client')
107
- updateReset({ emotion: emCache['client'] })
108
- } else {
109
- el.comp.setProps({
110
- base: s.base,
111
- fontSize: s.base + 'px',
112
- spacingRatio: s.ratio,
113
- direction: s.direction
114
- }, { preventUpdate: true })
115
- updateReset()
116
- }
117
- activateConfig(0)
48
+ return false
118
49
  }
119
50
  }
120
51
  }
121
52
  },
122
53
 
123
54
  on: {
124
- update: (el, s) => {
55
+ stateUpdated: (el, s) => {
125
56
  el.__root.node.scrollTo({ top: 0, behavior: 'smooth' })
126
57
  }
127
58
  }
@@ -9,7 +9,9 @@ export default {
9
9
  theme: '',
10
10
  zoomLevel: 1,
11
11
  currentFontSizeIndex: 3,
12
+ }
12
13
 
14
+ export const toolsState = {
13
15
  base: TYPOGRAPHY.base,
14
16
  ratio: SPACING.ratio,
15
17
  range: [-1, +4],
@@ -5,8 +5,10 @@ import {
5
5
  SequenceSliders,
6
6
  ClickableItem,
7
7
  SquareButton,
8
- ThemeSwitcher
8
+ ThemeSwitcher // eslint-disable-line no-unused-vars
9
9
  } from '@symbo.ls/components'
10
+ import { Link } from '@symbo.ls/components/src/Link'
11
+ import { toolsState } from './state'
10
12
 
11
13
  export default {
12
14
  props: {
@@ -18,6 +20,54 @@ export default {
18
20
  extend: Flex,
19
21
  props: { gap: 'B1' },
20
22
  // theme: { extend: ThemeSwitcher },
23
+ state: toolsState,
24
+
25
+ on: {
26
+ stateUpdated: (el, s, changes) => {
27
+ // window.componentRoot.context.system = s.__projectSystem
28
+ window.componentState.update(changes)
29
+ }
30
+ },
31
+
32
+ editors: {
33
+ extend: Flex,
34
+ props: { gap: 'Z2' },
35
+
36
+ childExtend: {
37
+ extend: [ClickableItem, SquareButton],
38
+ props: {}
39
+ },
40
+
41
+ add: {
42
+ props: {
43
+ icon: 'plus'
44
+ }
45
+ },
46
+ remix: {
47
+ props: {
48
+ icon: 'magicstar outline'
49
+ },
50
+ on: {
51
+ click: (ev, el, s) => {
52
+ window.componentState.update({
53
+ system: s.__projectSystem
54
+ })
55
+ }
56
+ }
57
+ },
58
+ editor: {
59
+ extend: Link,
60
+ props: {
61
+ icon: 'edit',
62
+ href: '/editor/' + window.location.pathname.split('component/')[1]
63
+ }
64
+ }
65
+ },
66
+
67
+ VerticalLine: {
68
+ margin: 'auto 0',
69
+ height: 'A2'
70
+ },
21
71
 
22
72
  sliders: {
23
73
  extend: SequenceSliders,
@@ -31,13 +81,11 @@ export default {
31
81
 
32
82
  direction: {
33
83
  extend: [ClickableItem, SquareButton],
34
- props: {
35
- icon: 'languageDirection'
36
- },
84
+ props: { icon: 'languageDirection' },
37
85
  on: {
38
86
  click: (ev, el, s) => {
39
- s.update({
40
- direction: s.direction === 'rtl' ? 'ltr' : 'rtl'
87
+ window.componentState.update({
88
+ direction: window.componentState.direction === 'rtl' ? 'ltr' : 'rtl'
41
89
  })
42
90
  }
43
91
  }
@@ -8,7 +8,7 @@ import * as LOGOS from '@symbo.ls/icons/src/logos'
8
8
  import * as SIGNS from '@symbo.ls/icons/src/signs'
9
9
  import * as STYLE from '@symbo.ls/icons/src/style'
10
10
  import * as KEYBOARD from '@symbo.ls/icons/src/keyboard'
11
- import * as SVG from '@symbo.ls/icons/src/svg'
11
+ import * as SVG from '@symbo.ls/icons/src/miscellaneous'
12
12
  import * as TECH from '@symbo.ls/icons/src/tech'
13
13
  import * as TEXT from '@symbo.ls/icons/src/text'
14
14