@symbo.ls/preview 0.0.89 → 0.0.91

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.91",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
@@ -25,15 +25,14 @@
25
25
  "dependencies": {
26
26
  "@domql/router": "latest",
27
27
  "@domql/tags": "latest",
28
- "@symbo.ls/cli": "^0.6.23",
28
+ "@symbo.ls/cli": "latest",
29
29
  "@symbo.ls/components": "latest",
30
30
  "@symbo.ls/config": "latest",
31
- "@symbo.ls/config-default": "^1.0.1",
31
+ "@symbo.ls/config-default": "latest",
32
32
  "@symbo.ls/icons": "latest",
33
- "@symbo.ls/init": "^1.1.3",
34
- "@symbo.ls/preview": "^0.0.73",
33
+ "@symbo.ls/init": "latest",
35
34
  "@symbo.ls/scratch": "latest",
36
- "@symbo.ls/temp-db": "^0.0.2",
35
+ "@symbo.ls/temp-db": "latest",
37
36
  "@symbo.ls/utils": "latest",
38
37
  "domql": "^1.5.35",
39
38
  "showdown": "^2.1.0"
@@ -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
  }
@@ -5,7 +5,7 @@ import { splitRoute } from 'domql/packages/router'
5
5
  import sidebar from './sidebar'
6
6
  import grid from './grid'
7
7
 
8
- import { CATEGORIES } from '../../../.symbols/categories'
8
+ import { CATEGORIES } from '@symbo.ls/temp-db/symbols/categories'
9
9
  // import FAVORITES from '../../data/favorites'
10
10
  // import COMPONENTS from '../../data/components'
11
11
 
@@ -1,11 +1,11 @@
1
1
  'use strict'
2
2
 
3
- import {
3
+ import {
4
4
  FilterCategories,
5
5
  FilterInteractivity,
6
6
  FilterDataTypes
7
7
  } from '@symbo.ls/components'
8
- import { CATEGORIES } from '../../../.symbols/categories'
8
+ import { CATEGORIES } from '@symbo.ls/temp-db/symbols/categories'
9
9
 
10
10
  export default {
11
11
  sticky: {
@@ -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,47 +0,0 @@
1
- 'use strict'
2
-
3
- import { CATEGORIES } from '../categories'
4
-
5
- import { Button } from 'smbls'
6
-
7
- const key = 'button'
8
- const title = 'Call to Action Button'
9
- const description = ''
10
- const category = CATEGORIES[1]
11
- const extend = 'Button'
12
- const state = {}
13
- const props = {
14
- icon: 'arrow angle up',
15
- gap: 'X2',
16
- theme: 'primary',
17
- text: 'Call to Action',
18
- padding: 'Z2 B2',
19
- round: 'C'
20
- }
21
-
22
- const component = {
23
- extend: Button,
24
- props
25
- }
26
-
27
- const code = ``
28
-
29
- const settings = {
30
- gridOptions: { colspan: 4, rowspan: 2 }
31
- }
32
-
33
- export default {
34
- key,
35
- title,
36
- description,
37
- extend,
38
- category,
39
- component,
40
- code,
41
- state,
42
-
43
- props,
44
- settings,
45
- interactivity: ['click'],
46
- dataTypes: ['object']
47
- }
@@ -1,50 +0,0 @@
1
- 'use strict'
2
-
3
- import { CATEGORIES } from '../categories'
4
-
5
- import { Button } from 'smbls'
6
-
7
- const key = 'all-star'
8
- const title = 'All Star'
9
- const description = ''
10
- const category = CATEGORIES[1]
11
- const extend = 'Button'
12
-
13
- const state = {}
14
- const props = {
15
- icon: 'star',
16
- text: 'All Star',
17
- theme: 'label',
18
- padding: 'X1 Z2',
19
- gap: 'X',
20
- round: 'A',
21
- fontWeight: 'bold'
22
- }
23
-
24
- const component = {
25
- extend: Button,
26
- props
27
- }
28
-
29
- const code = ``
30
-
31
- const settings = {
32
- gridOptions: { colspan: 3, rowspan: 2 }
33
- }
34
-
35
- export default {
36
- key,
37
- title,
38
- description,
39
- category,
40
- extend,
41
-
42
- component,
43
- code,
44
- state,
45
- props,
46
-
47
- settings,
48
- interactivity: [],
49
- dataTypes: []
50
- }
@@ -1,47 +0,0 @@
1
- 'use strict'
2
-
3
- import { CATEGORIES } from '../categories'
4
-
5
- import { CircleButton } from 'smbls'
6
-
7
- const key = 'button-circle'
8
- const title = 'Circle Button'
9
- const extend = 'CircleButton'
10
- const description = ''
11
- const category = CATEGORIES[1]
12
-
13
- const state = {}
14
- const props = {
15
- theme: 'secondary',
16
- background: 'blue .2',
17
- fontSize: 'A2',
18
- color: 'white',
19
- padding: 'Y2',
20
- text: '3'
21
- }
22
-
23
- const component = {
24
- extend: CircleButton,
25
- props
26
- }
27
-
28
- const code = ``
29
-
30
- const settings = {
31
- gridOptions: { colspan: 2, rowspan: 2 }
32
- }
33
-
34
- export default {
35
- key,
36
- title,
37
- description,
38
- category,
39
- component,
40
- extend,
41
- code,
42
- state,
43
- props,
44
- settings,
45
- interactivity: ['click'],
46
- dataTypes: ['object']
47
- }
@@ -1,75 +0,0 @@
1
- 'use strict'
2
-
3
- import { CATEGORIES } from '../categories'
4
-
5
- import { KangorooButton } from 'smbls'
6
-
7
- const key = 'ButtonPro'
8
- const title = 'Pro Button'
9
- const description = ''
10
- const category = CATEGORIES[1]
11
- const extend = 'KangorooButton'
12
-
13
- const state = {}
14
- const props = {
15
- theme: 'quinary',
16
- round: 'Z2',
17
- padding: 'X1 X1 X1 A2',
18
- size: 'A',
19
- gap: 'A',
20
- transition: 'A defaultBezier',
21
- transitionProperty: 'background, color, opacity',
22
- color: 'white',
23
-
24
- label: {
25
- gap: 'X1',
26
- text: 'Become PRO',
27
- alignItems: 'center',
28
- color: 'white',
29
- fontWeight: '500',
30
- icon: {
31
- name: 'star',
32
- color: 'yellow'
33
- }
34
- },
35
- child: {
36
- background: 'black .65',
37
- round: 'Z',
38
- size: 'Z',
39
- padding: 'Z A2',
40
- text: '1 month free',
41
- opacity: '.85'
42
- }
43
- }
44
-
45
- const component = {
46
- extend: KangorooButton,
47
-
48
- props,
49
-
50
- label: {},
51
- child: {}
52
- }
53
-
54
- const code = ``
55
-
56
- const settings = {
57
- gridOptions: { colspan: 5, rowspan: 2 }
58
- }
59
-
60
- export default {
61
- key,
62
- title,
63
- description,
64
- category,
65
- extend,
66
-
67
- component,
68
- code,
69
- state,
70
- props,
71
-
72
- settings,
73
- interactivity: ['click'],
74
- dataTypes: ['object']
75
- }
@@ -1,74 +0,0 @@
1
- 'use strict'
2
-
3
- import { CATEGORIES } from '../categories'
4
-
5
- import { KangorooButton } from 'smbls'
6
-
7
- const key = 'button-theme-switcher'
8
- const title = 'Theme Switcher'
9
- const description = ''
10
- const category = CATEGORIES[1]
11
- const extend = 'KangorooButton'
12
-
13
- const state = {}
14
- const props = {
15
- round: 'C',
16
- padding: 'V2 V2 V2 A1',
17
- gap: 'Z1',
18
- depth: 16,
19
- fontWeight: '500',
20
-
21
- label: {
22
- gap: 'X1',
23
- text: 'Light Mode',
24
- padding: 'Z2 X',
25
- icon: {
26
- color: 'yellow',
27
- name: 'sun'
28
- }
29
- },
30
-
31
- child: {
32
- gap: 'X1',
33
- round: 'C',
34
- text: 'Dark Mode',
35
- background: 'black .95',
36
- color: 'white',
37
- padding: 'Z2 A2',
38
- icon: {
39
- color: 'yellow',
40
- name: 'moon'
41
- }
42
- }
43
- }
44
-
45
- const component = {
46
- extend: KangorooButton,
47
-
48
- props,
49
-
50
- label: {},
51
- child: {}
52
- }
53
-
54
- const code = ``
55
-
56
- const settings = {
57
- gridOptions: { colspan: 5, rowspan: 2 }
58
- }
59
-
60
- export default {
61
- key,
62
- title,
63
- description,
64
- category,
65
- component,
66
- extend,
67
-
68
- code,
69
- state,
70
- props,
71
- settings,
72
- interactivity: [],
73
- dataTypes: []
74
- }