@symbo.ls/preview 0.0.77 → 0.0.79

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.77",
5
+ "version": "0.0.79",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
package/src/app.js CHANGED
@@ -3,8 +3,7 @@
3
3
  import './config'
4
4
  import style from './style'
5
5
 
6
- import { router } from '@domql/router'
7
- import { Flex, openModal } from '@symbo.ls/components'
6
+ import { Flex } from '@symbo.ls/components'
8
7
 
9
8
  import { state } from './state'
10
9
  import {
@@ -17,6 +17,7 @@ export const TutorialBanner = {
17
17
  position: 'relative',
18
18
  color: 'white',
19
19
  flex: 1,
20
+ transitionProperty: 'transform, opacity, padding',
20
21
 
21
22
  title: { margin: 'auto 0 0', text: state.title },
22
23
  p: { text: state.p },
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import {
3
+ import {
4
4
  findHeadingLetter,
5
5
  getFontFamily
6
6
  } from '@symbo.ls/scratch'
@@ -28,7 +28,7 @@ const getTypeProp = (key, prop, library, defaultValue) => {
28
28
  const { TYPOGRAPHY } = library
29
29
  const { styles } = TYPOGRAPHY
30
30
  if (!styles[key]) styles[key] = {}
31
- return styles[key][prop] ||
31
+ return styles[key][prop] ||
32
32
  styles[prop] ||
33
33
  TYPOGRAPHY[prop] ||
34
34
  defaultValue ||
@@ -45,10 +45,8 @@ const getTypeStyle = (key, library) => ({
45
45
  letterWidth: getTypeProp(key, 'letterWidth', library)
46
46
  })
47
47
 
48
-
49
48
  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
49
+ const isTag = v => HTML_TAGS.root.indexOf(v) > -1 || HTML_TAGS.body.indexOf(v) > -1
52
50
  const isHelper = v => v.slice(0, 1) === '.'
53
51
 
54
52
  const getCollectionFromArray = (arr, s) => {
@@ -65,11 +63,11 @@ const getCollectionFromArray = (arr, s) => {
65
63
  },
66
64
  labels: Object.keys(result)
67
65
  .filter(key => key !== 'fontSize' && result[key] && result[key] !== '0')
68
- .map(key => ({
66
+ .map(key => ({
69
67
  icon: iconMap[key],
70
68
  text: result[key]
71
69
  })
72
- ),
70
+ ),
73
71
  sequenceValue: s.sequence[
74
72
  isHeading(v) ? findHeadingLetter(s.h1Matches, k) : result.fontSize
75
73
  ]
@@ -85,7 +83,7 @@ export const headingsCollection = (el, s) => {
85
83
 
86
84
  export const tagsCollection = (el, s) => {
87
85
  const { __system } = s
88
- const { FONT_FAMILY, TYPOGRAPHY } = __system
86
+ const { TYPOGRAPHY } = __system
89
87
  const { styles } = TYPOGRAPHY
90
88
  if (!styles.body) styles.body = {}
91
89
  el.removeContent()
@@ -100,17 +98,13 @@ export const tagsCollection = (el, s) => {
100
98
 
101
99
  export const helpersCollection = (el, s) => {
102
100
  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]
101
+ const { TYPOGRAPHY } = __system
102
+ const { styles } = TYPOGRAPHY
111
103
 
112
104
  const HELPERS = Object.keys(styles)
113
105
  .filter(v => v.slice(0, 1) === '.')
114
106
 
107
+ el.removeContent()
108
+
115
109
  return getCollectionFromArray(HELPERS, s)
116
110
  }
package/src/sync.js CHANGED
@@ -5,7 +5,10 @@ import { connect, send } from '@symbo.ls/socket/client'
5
5
 
6
6
  const onChange = (element, state) => {
7
7
  return (event, data) => {
8
- state.update({ SYSTEM: data })
8
+ if (event !== 'live-change') {
9
+ const obj = JSON.parse(data)
10
+ state.update({ SYSTEM: data })
11
+ }
9
12
  }
10
13
  }
11
14