@symbo.ls/preview 0.0.89 → 0.0.90

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.89",
5
+ "version": "0.0.90",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "@domql/tags": "latest",
28
28
  "@symbo.ls/cli": "^0.6.23",
29
29
  "@symbo.ls/components": "latest",
30
- "@symbo.ls/config": "latest",
30
+ "@symbo.ls/config": "^1.0.60",
31
31
  "@symbo.ls/config-default": "^1.0.1",
32
32
  "@symbo.ls/icons": "latest",
33
33
  "@symbo.ls/init": "^1.1.3",
@@ -22,6 +22,34 @@ export const UploadImage = {
22
22
  element: {
23
23
  extend: [Upload, Flex, ClickableItem],
24
24
  icon: { style: { fontSize: '52px' } },
25
- p: { span: null }
25
+ p: { span: null },
26
+ input: {
27
+ on: {
28
+ change: async (ev, el, s) => {
29
+ const { context } = el
30
+ const { client } = context
31
+ s.update({ icon: { pending: true } })
32
+
33
+ try {
34
+ let id
35
+ await client.file(ev.target.files[0]).then(async d => { id = d.id })
36
+
37
+ await client.observe({
38
+ $id: id,
39
+ src: true
40
+ }, async (data) => {
41
+ s.update({ icon: { pending: false, data } })
42
+
43
+ await client.set({
44
+ $id: s.projectId,
45
+ file: data.id
46
+ })
47
+ })
48
+ } catch (e) {
49
+ console.log(e)
50
+ }
51
+ }
52
+ }
53
+ }
26
54
  }
27
55
  }
@@ -46,6 +46,7 @@ const yourEnvironment = {
46
46
 
47
47
  title: {},
48
48
  element: { ...[
49
+ { props: { icon: 'html' } },
49
50
  { props: { icon: 'js outline' } },
50
51
  { props: { icon: 'ts outline' } },
51
52
  { props: { icon: 'pdf' } },
@@ -71,7 +72,6 @@ const yourFramework = {
71
72
  },
72
73
  title: {},
73
74
  element: { ...[
74
- { props: { icon: 'html' } },
75
75
  { props: { icon: 'domql' } },
76
76
  { props: { icon: 'react' } },
77
77
  { props: { icon: 'vue' } },
@@ -0,0 +1,109 @@
1
+ 'use strict'
2
+
3
+ import { CommonField, Input, Grid, SelectField } from '@symbo.ls/components'
4
+
5
+ export default {
6
+ extend: Grid,
7
+ props: {
8
+ columns: 'repeat(2, 270px)',
9
+ columnGap: 'C',
10
+ rowGap: 'C2'
11
+ },
12
+
13
+ childExtend: {
14
+ extend: CommonField,
15
+ props: {
16
+ position: 'relative',
17
+ align: 'stretch flex-start',
18
+ element: {
19
+ margin: '- -Z',
20
+ width: 'auto',
21
+ padding: 'Z1 A2'
22
+ }
23
+ }
24
+ },
25
+
26
+ name: {
27
+ props: {
28
+ title: { text: 'Name the project' },
29
+ element: { placeholder: 'You name it' }
30
+ },
31
+
32
+ title: {},
33
+ element: {
34
+ extend: Input,
35
+ attr: { value: ({ state }) => state.projectName }
36
+ }
37
+ },
38
+
39
+ k: {
40
+ props: {
41
+ title: { text: 'Key' }
42
+ },
43
+ title: {},
44
+ element: {
45
+ extend: Input,
46
+ attr: { value: ({ state }) => state.appKey && state.appKey.split('.')[0] },
47
+ props: { placeholder: 'a-zA-Z0-9' }
48
+ },
49
+ Span: {
50
+ position: 'absolute',
51
+ opacity: '.65',
52
+ text: '.symbo.ls',
53
+ right: 'Z2',
54
+ bottom: 'Z',
55
+ pointerEvents: 'none'
56
+ }
57
+ },
58
+
59
+ visibility: {
60
+ props: { title: { text: 'URL Access' } },
61
+ title: {},
62
+ element: {
63
+ extend: [SelectField],
64
+ props: {
65
+ style: { padding: '0' },
66
+ round: 'C1'
67
+ },
68
+ title: null,
69
+ buttons: {
70
+ props: {
71
+ position: 'absolute',
72
+ right: 'Z',
73
+ pointerEvents: 'none'
74
+ }
75
+ },
76
+
77
+ Select: {
78
+ props: {
79
+ outline: 'none',
80
+ border: 'none',
81
+ background: 'transparent',
82
+ color: 'currentColor',
83
+ padding: 'Z1 A2',
84
+ round: 'C1',
85
+ width: '100%',
86
+
87
+ style: {
88
+ cursor: 'default',
89
+ appearance: 'none'
90
+ },
91
+
92
+ name: 'user',
93
+ id: 'user'
94
+ },
95
+
96
+ childExtend: { tag: 'option', text: ({ state }) => state.text },
97
+ $setCollection: () => [
98
+ { text: 'Private' },
99
+ { text: 'Public' }
100
+ ],
101
+ on: {
102
+ change: (ev, { parent }) => {
103
+ parent.user.update({ key: ev.target.value })
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,42 @@
1
+ 'use strict'
2
+
3
+ import { User } from '@symbo.ls/components'
4
+ import { UploadImage } from '../../../components'
5
+
6
+ export default {
7
+ extend: UploadImage,
8
+ props: {
9
+ title: { text: 'Project icon' },
10
+ element: {
11
+ flow: 'column',
12
+ position: 'relative',
13
+ width: 'fit-content',
14
+ padding: 'A',
15
+ gap: '0',
16
+
17
+ p: {
18
+ text: 'Drag and drop or click',
19
+ maxWidth: 'E',
20
+ textAlign: 'center'
21
+ }
22
+ }
23
+ },
24
+ title: {},
25
+ element: {
26
+ User: {
27
+ extend: User,
28
+ props: ({ state }) => ({
29
+ position: 'absolute',
30
+ fontSize: 'H',
31
+ top: '50%',
32
+ left: '50%',
33
+ transform: 'translate3d(-50%, -50%, 1px)',
34
+ src: state.icon && state.icon.src,
35
+ key: state.projectName,
36
+ transition: 'C defaultBezier opacity',
37
+ opacity: (state.icon && state.icon.src) ? '1' : '0',
38
+ pointerEvents: 'none'
39
+ })
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,37 @@
1
+ 'use strict'
2
+
3
+ import { InitPage } from '../../../components'
4
+
5
+ import icon from './icon'
6
+ import fields from './fields'
7
+
8
+ export const Personalize = {
9
+ extend: InitPage,
10
+
11
+ back: null,
12
+
13
+ HeaderHeading: {
14
+ props: { margin: '- - D2 -' },
15
+ Caption: { text: `Let's personalize your Symbols` },
16
+ H1: { text: ({ state }) => `Hi ${state.userName}` }
17
+ },
18
+
19
+ ColumnParagraphs: {
20
+ extend: true,
21
+ ...[
22
+ { props: { text: `In this example we'll initialize a Symbols Design System for you.` } },
23
+ { props: { text: `You can connect Symbols to your app and style it online.` } }
24
+ ]
25
+ },
26
+
27
+ Flex: {
28
+ props: { gap: 'D1' },
29
+
30
+ icon,
31
+ fields
32
+ },
33
+
34
+ ContinueButton: {
35
+ href: '/init/theme'
36
+ }
37
+ }
@@ -1,9 +1,9 @@
1
1
  'use strict'
2
2
 
3
- import { Input, Img, Flex, ClickableItem, CommonField } from '@symbo.ls/components'
3
+ import { Input, Flex, CommonField } from '@symbo.ls/components'
4
4
 
5
5
  const sideBar = {
6
- tag: 'aside',
6
+ tag: 'aside'
7
7
  }
8
8
 
9
9
  export const State = {
@@ -26,7 +26,7 @@ export const State = {
26
26
  on: {
27
27
  input: (ev, el, s) => {
28
28
  const rootState = el.__root.state
29
- const obj = {
29
+ const obj = {
30
30
  STATE: { [el.parent.key]: el.node.value }
31
31
  }
32
32
  rootState.update({ SYSTEM: obj })
@@ -34,48 +34,48 @@ export const State = {
34
34
  }
35
35
  }
36
36
  },
37
-
37
+
38
38
  websiteTitle: {
39
39
  title: 'Title',
40
40
  element: {
41
41
  extend: Input
42
42
  }
43
43
  },
44
-
44
+
45
45
  websiteDesc: {
46
46
  title: 'Description',
47
47
  element: {
48
48
  extend: Input
49
49
  }
50
50
  },
51
-
51
+
52
52
  websiteTags: {
53
53
  title: 'Tags',
54
54
  element: {
55
55
  extend: Input
56
56
  }
57
57
  },
58
-
58
+
59
59
  headline: {
60
60
  title: 'Headline',
61
61
  element: {
62
62
  extend: Input
63
63
  }
64
64
  },
65
-
65
+
66
66
  paragraph: {
67
67
  title: 'Paragraph',
68
68
  element: {
69
69
  extend: Input
70
70
  }
71
71
  },
72
-
72
+
73
73
  bookNowUrl: {
74
74
  title: 'Book now URL:',
75
75
  element: {
76
76
  extend: Input
77
77
  }
78
- },
78
+ }
79
79
  },
80
80
 
81
81
  on: {
package/src/state.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import SYSTEM from './config'
4
4
  import { LIBRARY, COMPONENTS } from '@symbo.ls/preview/.symbols'
5
- import USR_DATA from '@symbo.ls/temp-db'
5
+ import USR_DATA from '@symbo.ls/temp-db' // eslint-disable-line
6
6
 
7
7
  export const state = {
8
8
  globalTheme: 'dark',
@@ -10,6 +10,7 @@ export const state = {
10
10
  }
11
11
 
12
12
  state.SYSTEM = USR_DATA[state.appKey]
13
+ // state.SYSTEM = {}
13
14
  state.SYSTEM.COMPONENTS = {}
14
15
 
15
16
  export const context = {
@@ -1,145 +0,0 @@
1
- 'use strict'
2
-
3
- import { CommonField, Input, Grid, Flex, ClickableItem } from '@symbo.ls/components'
4
-
5
- import { InitPage, UploadImage } from '../../components'
6
-
7
- const fields = {
8
- extend: Grid,
9
- props: {
10
- columns: 'repeat(2, 270px)',
11
- columnGap: 'C',
12
- rowGap: 'C2',
13
- childProps: {
14
- element: {
15
- round: 'Y2'
16
- // padding: '- A'
17
- // height: 'C',
18
-
19
- // style: { background: 'rgba(255, 255, 255, .1) !important' },
20
- // align: 'center space-between',
21
- }
22
- }
23
- },
24
-
25
- childExtend: {
26
- extend: CommonField,
27
- title: {},
28
- element: { extend: Flex }
29
- },
30
-
31
- ...[{
32
- props: {
33
- title: { text: 'Name the project' },
34
- element: { placeholder: 'You name it' }
35
- },
36
-
37
- title: {},
38
- element: { extend: Input, props: { } }
39
- }, {
40
- props: {
41
- title: { text: 'Key' },
42
- element: {
43
- extend: Input,
44
- props: {
45
- placeholder: 'a-zA-Z0-9'
46
- },
47
- Span: {
48
- position: 'absolute',
49
- text: '.symbo.ls',
50
- right: 'A',
51
- pointerEvents: 'none'
52
- }
53
- }
54
- },
55
- title: {},
56
- element: {
57
- input: { extend: Input },
58
- span: {}
59
- }
60
- }, {
61
- props: { title: { text: 'URL Access' } },
62
- title: {},
63
- element: {
64
- extend: [ClickableItem],
65
- Select: {
66
- props: {
67
- outline: 'none',
68
- pointerEvents: 'all',
69
- appearance: 'none',
70
- border: 'none',
71
- width: '100%',
72
- height: '100%',
73
- background: 'none',
74
- color: 'currentColor',
75
- fontSize: 'A',
76
- lineHeight: 1,
77
- padding: 'Z A',
78
-
79
- name: 'user',
80
- id: 'user'
81
- },
82
- childExtend: { tag: 'option', text: ({ state }) => state.text },
83
- $setCollection: () => [
84
- { text: 'Private' },
85
- { text: 'Public' }
86
- ],
87
- on: {
88
- change: (ev, { parent }) => {
89
- parent.user.update({ key: ev.target.value })
90
- }
91
- }
92
- }
93
- }
94
- }]
95
- }
96
-
97
- const uploadImage = {
98
- extend: UploadImage,
99
- props: {
100
- title: { text: 'Project icon' },
101
- element: {
102
- flow: 'column',
103
- width: 'fit-content',
104
- padding: 'A',
105
- gap: '0',
106
- p: {
107
- text: 'Drag and drop or click',
108
- maxWidth: 'E',
109
- textAlign: 'center'
110
- }
111
- }
112
- }
113
-
114
- }
115
-
116
- export const Personalize = {
117
- extend: InitPage,
118
-
119
- back: null,
120
-
121
- HeaderHeading: {
122
- props: { margin: '- - D2 -' },
123
- Caption: { text: `Let's personalize your Symbols` },
124
- H1: { text: 'Hi George' }
125
- },
126
-
127
- ColumnParagraphs: {
128
- extend: true,
129
- ...[
130
- { props: { text: `In this example we'll initialize a Symbols Design System for you.` } },
131
- { props: { text: `You can connect Symbols to your app and style it online.` } }
132
- ]
133
- },
134
-
135
- content: {
136
- extend: Flex,
137
- props: { gap: 'D1' },
138
- uploadImage,
139
- fields
140
- },
141
-
142
- ContinueButton: {
143
- href: '/init/theme'
144
- }
145
- }