@symbo.ls/preview 0.0.38 → 0.0.40

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.
@@ -1,178 +0,0 @@
1
- 'use strict'
2
-
3
- import { Block, Text, Button, Flex, SectionHeader, AccessibilityCheck, SceneThemingBar } from '@symbo.ls/components'
4
-
5
- import { PageExtend } from '..'
6
- import { colorTones } from './colorTone'
7
- import { themingTools } from './themingTools'
8
- import { interactivity } from './interactivity'
9
- import { friendTheme } from './friendTheme'
10
-
11
- import style, { styleLabel } from './style'
12
-
13
- // import ntc from './ntc'
14
-
15
- // const returnColor = element => element.lookup('ColorEditor').state.color
16
- // const setBackground = (element, opacity = 1) => `background: ${opacify(returnColor(element), opacity)}`
17
-
18
- const nameTheTheme = {
19
- tag: 'label',
20
- style: styleLabel,
21
- attr: { for: 'name-it' },
22
- caption: {
23
- extend: [Block, Text],
24
- props: {
25
- text: 'Name the theme',
26
- padding: '0 0 Y1 0',
27
- size: 'Z'
28
- }
29
- },
30
- span: {
31
- tag: 'span',
32
- extend: Text,
33
- props: {
34
- text: (el, s) => s.value,
35
- size: 'E'
36
- },
37
- attr: { contentEditable: true, placeholder: 'you name it', id: 'name-it' }
38
- }
39
- }
40
-
41
- const footer = { //eslint-disable-line
42
- extend: [Flex, Block],
43
- props: {
44
- height: 'C2',
45
- padding: '0 A'
46
- },
47
- style: {
48
- margin: 'auto -80px 0',
49
- justifyContent: 'space-between',
50
- alignItems: 'center'
51
- },
52
- nav: {
53
- extend: [Flex, Block],
54
- props: { gap: 'A' },
55
- childExtend: {
56
- extend: [Button, Text],
57
- props: {
58
- size: 'Z',
59
- width: 'B2',
60
- height: 'B2',
61
- theme: 'transparent'
62
- }
63
- },
64
- ...[
65
- { props: { icon: 'starOutline' } },
66
- { props: { icon: 'copyOutline' } },
67
- { props: { icon: 'share' } }
68
- ]
69
- },
70
- span: {
71
- extend: Text,
72
- props: {
73
- text: 'Autosaved 1 second ago',
74
- size: 'Y'
75
- },
76
- style: { opacity: '.35' }
77
- },
78
-
79
- export: {
80
- extend: Flex,
81
- style: {
82
- alignItems: 'center'
83
- },
84
- span: {
85
- extend: [Text, Block],
86
- props: {
87
- text: 'Export:',
88
- size: 'Y',
89
- padding: '0 B1 0 0'
90
- },
91
- style: { opacity: '.35' }
92
- },
93
- nav: {
94
- extend: [Flex, Block],
95
- props: { gap: 'Y2' },
96
- childExtend: {
97
- extend: [Button, Text],
98
- props: {
99
- size: 'Z',
100
- width: 'B2',
101
- height: 'B2',
102
- theme: 'transparent'
103
- },
104
- style: {
105
- color: 'white'
106
- }
107
- },
108
- ...[
109
- { props: { icon: 'themeOutline' } },
110
- { props: { icon: 'sketch' } },
111
- { props: { icon: 'arrowAngleMirroringHorizontal' } }
112
- ]
113
- }
114
- }
115
- }
116
-
117
- export const ColorEditor = {
118
- key: 'ColorEditor',
119
-
120
- extend: PageExtend,
121
-
122
- style,
123
-
124
- state: {
125
- sceneTheme: 'dark'
126
- },
127
-
128
- on: {
129
- init: (el, s) => {
130
- if (!el.context.SYSTEM) return
131
-
132
- var route = window.location.pathname
133
- var routes = route.slice(1).split('/')
134
- var param = routes[1]
135
-
136
- const { THEME } = el.context.SYSTEM
137
- var content = THEME[`${param}`].value
138
- content.title = param
139
- el.state.value = content
140
- }
141
- },
142
-
143
- header: {
144
- extend: SectionHeader,
145
- props: {
146
- padding: 'C 0 B2 0',
147
- margin: '0'
148
- },
149
- heading: '',
150
- label: nameTheTheme,
151
- nav: { extend: SceneThemingBar }
152
- },
153
-
154
- cnt: {
155
- extend: [Flex],
156
- props: {
157
- gap: 'D'
158
- },
159
-
160
- aside: colorTones,
161
- colorEdit: {
162
- extend: Block,
163
- props: { gap: 'C2', flexFlow: 'column' },
164
- themingTools,
165
- interactivity,
166
- friendTheme
167
- }
168
- },
169
-
170
- check: {
171
- extend: AccessibilityCheck,
172
- props: {
173
- padding: 'E 0 F'
174
- }
175
- }
176
-
177
- // footer
178
- }
@@ -1,116 +0,0 @@
1
- 'use strict'
2
-
3
- import { Block, Grid, Text, SelectField, CommonField } from '@symbo.ls/components'
4
-
5
- export const interactivity = {
6
- h6: {
7
- extend: [Text, Block],
8
- props: { text: 'Interactivity', padding: '0 0 Z2 0', size: 'B' },
9
- style: { fontWeight: 'normal', margin: 0 }
10
- },
11
- interactivitySet: {
12
- extend: Grid,
13
- props: {
14
- columns: 'repeat(4, 1fr)',
15
- rows: 'repear(2, 1fr)',
16
- columnGap: 'C',
17
- rowGap: 'A2'
18
- },
19
- style: { width: 'fit-content' },
20
- childExtend: {
21
- extend: CommonField,
22
- props: { padding: 0 },
23
- element: {
24
- extend: SelectField,
25
- buttons: { ...[{ props: { icon: 'plus' } }] }
26
- }
27
- },
28
- ...[
29
- {
30
- caption: { props: { text: ':hover' } },
31
- element: {
32
- title: {
33
- props: { icon: 'hoverOutline', text: 'none' }
34
- }
35
- }
36
- },
37
- {
38
- caption: { props: { text: ':focus' } },
39
- element: {
40
- title: {
41
- props: { icon: 'focusOutline', text: 'none' }
42
- }
43
- }
44
- },
45
- {
46
- caption: { props: { text: ':active' } },
47
- element: {
48
- title: {
49
- props: { icon: 'clickOutline', text: 'none' }
50
- }
51
- }
52
- },
53
- {
54
- caption: { props: { text: ':selection' } },
55
- element: {
56
- title: {
57
- props: { icon: 'selection', text: 'none' }
58
- }
59
- }
60
- },
61
- {
62
- caption: { props: { text: ':link' } },
63
- element: {
64
- title: {
65
- props: { icon: 'clickOutline', text: 'none' }
66
- }
67
- }
68
- },
69
- {
70
- caption: { props: { text: ':visited' } },
71
- element: {
72
- title: {
73
- props: { icon: 'focusOutline', text: 'none' }
74
- }
75
- }
76
- },
77
- {
78
- caption: { props: { text: ':disabled' } },
79
- element: {
80
- title: {
81
- props: { icon: 'disabled', text: 'none' }
82
- }
83
- }
84
- },
85
-
86
- {
87
- caption: null,
88
- style: {
89
- display: 'flex',
90
- alignItems: 'flex-end'
91
- },
92
- element: {
93
- title: {
94
- props: { text: 'Add :pseudo' }
95
- },
96
- buttons: {
97
- style: {
98
- button: {
99
- background: 'transparent',
100
- borderRadius: 0,
101
- '&:first-child': { borderRight: '.1px solid rgba(255, 255, 255, .1)' },
102
- '&:hover': { background: 'transparent' }
103
- }
104
- },
105
- ...[
106
- { props: { icon: 'arrowAngleDown' } },
107
- { props: { icon: 'plus' } }
108
-
109
- ]
110
- }
111
- }
112
- }
113
- ]
114
- }
115
-
116
- }