@symbo.ls/preview 2.0.7 → 2.6.0
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/{src/pages/Export → .legacy}/_tools_old.js +7 -6
- package/.legacy/index copy.js +45 -0
- package/{src/pages/Spaces → .legacy}/preview.js +14 -14
- package/{src/pages/Spaces → .legacy}/style.js +0 -3
- package/.vscode/extensions.json +5 -0
- package/index.html +4 -14
- package/index.js +44 -0
- package/package.json +32 -32
- package/src/app.js +30 -68
- package/src/assets/dark.png +0 -0
- package/src/assets/mask1.png +0 -0
- package/src/assets/mask2.png +0 -0
- package/src/assets/shapes.png +0 -0
- package/src/assets/space.png +0 -0
- package/src/assets/type.png +0 -0
- package/src/components/Aside.js +101 -0
- package/src/components/Banner.js +58 -0
- package/src/components/ColorText.js +29 -0
- package/src/components/ColorsPalette.js +69 -0
- package/src/components/ColumnParagrphs.js +23 -0
- package/src/components/ContinueButton.js +14 -0
- package/src/components/DesignComponent.js +80 -0
- package/src/components/FontText.js +193 -0
- package/src/components/Header.js +50 -0
- package/src/components/HeaderHeading.js +23 -0
- package/src/components/IconsGroup.js +60 -0
- package/src/components/Page.js +135 -0
- package/src/components/ResponsivePreview.js +44 -0
- package/src/components/Route.js +1 -0
- package/src/components/ShapePreview.js +63 -0
- package/src/components/ShapeSet.js +85 -0
- package/src/components/SlidersWithResponsive.js +23 -0
- package/src/components/SpacingButton/actionButtons.js +41 -0
- package/src/components/SpacingButton/dropdown.js +114 -0
- package/src/components/SpacingButton/index.js +248 -0
- package/src/components/SpacingButton/props.js +45 -0
- package/src/components/SpacingPreview.js +154 -0
- package/src/components/SpacingTable.js +210 -0
- package/src/components/ThemeButtons.js +42 -0
- package/src/components/UploadImage.js +61 -0
- package/src/components/Widget.js +1 -0
- package/src/components/index.js +25 -0
- package/src/config/index.js +12 -31
- package/src/config/theme.js +1 -71
- package/src/pages/Account/__/index.js +241 -0
- package/src/pages/Account/{setUpProject.js → __/setUpProject.js} +10 -10
- package/src/pages/Account/index.js +17 -147
- package/src/pages/Color/globalThemes.js +30 -0
- package/src/pages/Color/index.js +7 -10
- package/src/pages/Color/palette.js +35 -0
- package/src/pages/Color/themes.js +23 -117
- package/src/pages/Components/grid.js +99 -0
- package/src/pages/Components/index.js +37 -0
- package/src/pages/Components/sidebar.js +28 -0
- package/src/pages/Components/style.js +16 -0
- package/src/pages/DesignSystem/Dashboard/banners.js +38 -0
- package/src/pages/DesignSystem/Dashboard/designElements.js +124 -0
- package/src/pages/DesignSystem/Dashboard/index.js +22 -0
- package/src/pages/DesignSystem/Dashboard/quickstart.js +86 -0
- package/src/pages/DesignSystem/Dashboard/state.js +118 -0
- package/src/pages/DesignSystem/Dashboard/summary.js +40 -0
- package/src/pages/DesignSystem/index.js +187 -0
- package/src/pages/Editor/index.js +7 -9
- package/src/pages/Editor/layers.js +14 -14
- package/src/pages/Editor/scene.js +7 -9
- package/src/pages/Editor/tools.js +22 -22
- package/src/pages/Export/const.js +3 -4
- package/src/pages/Export/description.js +58 -87
- package/src/pages/Export/gist.js +23 -0
- package/src/pages/Export/index.js +48 -39
- package/src/pages/Export/scene.js +98 -61
- package/src/pages/Export/state.js +11 -5
- package/src/pages/Export/tools.js +41 -86
- package/src/pages/Fonts/fontFaces.js +50 -0
- package/src/pages/Fonts/fontFamilies.js +47 -0
- package/src/pages/Fonts/index.js +15 -0
- package/src/pages/Fonts/state.js +5 -0
- package/src/pages/Icons/index.js +73 -69
- package/src/pages/Icons/style.js +0 -18
- package/src/pages/Init/ChooseEnvironment.js +104 -0
- package/src/pages/Init/CreateDocumentTheme.js +166 -0
- package/src/pages/Init/CreatePalette.js +72 -0
- package/src/pages/Init/FontText.js +23 -0
- package/src/pages/Init/Personalize/fields.js +109 -0
- package/src/pages/Init/Personalize/icon.js +42 -0
- package/src/pages/Init/Personalize/index.js +37 -0
- package/src/pages/Init/index.js +36 -0
- package/src/pages/Library/disabled.js +38 -0
- package/src/pages/Library/index.js +24 -47
- package/src/pages/MediaQuery/index.js +46 -0
- package/src/pages/MediaQuery/lists.js +285 -0
- package/src/pages/MediaQuery/state.js +150 -0
- package/src/pages/MediaQuery/typeScale.js +69 -0
- package/src/pages/Shapes/index.js +54 -204
- package/src/pages/Shapes/shapeSet.js +133 -0
- package/src/pages/Shapes/style.js +0 -28
- package/src/pages/Spaces/index.js +23 -47
- package/src/pages/Spaces/sequence.js +30 -1
- package/src/pages/Spaces/state.js +12 -14
- package/src/pages/State/index.js +86 -0
- package/src/pages/{ColorEditor → Theme}/friendTheme.js +3 -3
- package/src/pages/Theme/index.js +197 -0
- package/src/pages/{ColorEditor → Theme}/interactivity.js +6 -7
- package/src/pages/Theme/preview.js +153 -0
- package/src/pages/{ColorEditor → Theme}/style.js +1 -12
- package/src/pages/{ColorEditor → Theme}/themingTools.js +12 -12
- package/src/pages/Typography/collection.js +110 -0
- package/src/pages/Typography/documentStyles.js +125 -0
- package/src/pages/Typography/index.js +28 -36
- package/src/pages/Typography/rangeButtons.js +58 -0
- package/src/pages/Typography/shared.js +2 -3
- package/src/pages/Typography/state.js +9 -8
- package/src/pages/Typography/stylesHelpers.js +30 -0
- package/src/pages/Typography/typeScale.js +63 -82
- package/src/pages/index.js +15 -23
- package/src/style.js +15 -12
- package/svgSprite.config.js +2 -1
- package/README.md +0 -19
- package/app.webmanifest +0 -4
- package/netlify.toml +0 -19
- package/protect-pwd.js +0 -65
- package/src/animations.js +0 -71
- package/src/assets/dots.png +0 -0
- package/src/assets/dotsDark.png +0 -0
- package/src/data/Symbols.sketch +0 -0
- package/src/data/_Symbols.sketch/document.json +0 -1
- package/src/data/_Symbols.sketch/fonts/6c9956fc8970ec3d8268c3f286afe19d954fc40b +0 -0
- package/src/data/_Symbols.sketch/fonts/750e9b005158d57108ebbcf288e2582f078d6735 +0 -0
- package/src/data/_Symbols.sketch/fonts/86c45cb69ad4ba2a8e6d0b81f20964b33f4eca6c +0 -0
- package/src/data/_Symbols.sketch/fonts/f97cec7aed309ec77b4fd3005d1a3e0d86c2a7b9 +0 -0
- package/src/data/_Symbols.sketch/images/0427bc225ee7dc33db78252defd5b2e4cd5b7467.png +0 -0
- package/src/data/_Symbols.sketch/images/0c4846cdd2f11ffb23c9ce063380fc934f7a11ea.png +0 -0
- package/src/data/_Symbols.sketch/images/55d3f5e93869fbd70e8dfbca1ce3dfa0cc9f2dbe.png +0 -0
- package/src/data/_Symbols.sketch/images/67ae1583a9d77eec7106f5016f48b5594a02b3f6.png +0 -0
- package/src/data/_Symbols.sketch/images/7152b3ea22388d53052d0212995a1805527ea862.png +0 -0
- package/src/data/_Symbols.sketch/images/72f1896a8462385fd596bc35f240382ba15814fc.png +0 -0
- package/src/data/_Symbols.sketch/images/73e4245b1f867343001657193ff2318c9cf2ef53.png +0 -0
- package/src/data/_Symbols.sketch/images/7b89dae77676fb4cfd072e0830cff9c27afd11c6.png +0 -0
- package/src/data/_Symbols.sketch/images/811e2b516575d3b4e7709dfef6369bce7dae0a26.png +0 -0
- package/src/data/_Symbols.sketch/images/82d006789579f2ee1fa45c9116f7cd7dd1bcbe37.png +0 -0
- package/src/data/_Symbols.sketch/images/8a896270aa4da8e2401d0ea76e46dc9b9125e59a.png +0 -0
- package/src/data/_Symbols.sketch/images/966688c4a579283836f15ab69c8b76e11b236ff5.png +0 -0
- package/src/data/_Symbols.sketch/images/b903a498e1d438e8bb12de5422f732c717b79eff.png +0 -0
- package/src/data/_Symbols.sketch/images/b9f3cae81a855e21ae75185dcb6ae6551c5447f1.png +0 -0
- package/src/data/_Symbols.sketch/images/cd0f908410abf4cad7a4501539eb0711c41a182f.png +0 -0
- package/src/data/_Symbols.sketch/images/d54f15f130ba4f1d4ad56f03c01ac06fe0ab4f56.png +0 -0
- package/src/data/_Symbols.sketch/images/df5a20029363f95abc58b2c8972e1417d84c8aa7.png +0 -0
- package/src/data/_Symbols.sketch/images/e889546970c931244400c2f70412c39123029cb3.png +0 -0
- package/src/data/_Symbols.sketch/images/f420a7a2beb15bee5d2ecbba8f296c6d4b22dfa3.png +0 -0
- package/src/data/_Symbols.sketch/meta.json +0 -1
- package/src/data/_Symbols.sketch/pages/31D11772-FB33-42EC-A3CC-79F63922E04D.json +0 -1
- package/src/data/_Symbols.sketch/pages/35BD91AD-F0ED-4002-891D-F1B3250E88C1.json +0 -1
- package/src/data/_Symbols.sketch/pages/4831AF31-ECB8-4DA6-B4D0-C1095D42146C.json +0 -1
- package/src/data/_Symbols.sketch/pages/6FCC0155-B3F4-4792-892E-523D45315AFD.json +0 -1
- package/src/data/_Symbols.sketch/pages/7996D5DD-C5B2-4EE7-9DE8-2C05E2ACA9F3.json +0 -1
- package/src/data/_Symbols.sketch/pages/B314C0F3-0038-473F-A127-536AF28E5272.json +0 -1
- package/src/data/_Symbols.sketch/pages/B6798E64-F7E9-40F5-9BD0-88A548478438.json +0 -1
- package/src/data/_Symbols.sketch/pages/B9B28DF3-EDC2-4D5B-A412-12B3B2E7DE58.json +0 -1
- package/src/data/_Symbols.sketch/pages/CA6E47E4-DAF7-4D1D-8DDC-D5A60508D9A0.json +0 -1
- package/src/data/_Symbols.sketch/pages/D6F5EB10-9D31-47AC-9077-1CE8CB2C2448.json +0 -1
- package/src/data/_Symbols.sketch/previews/preview.png +0 -0
- package/src/data/_Symbols.sketch/user.json +0 -1
- package/src/data/categories.js +0 -44
- package/src/data/components/button-archived/index.js +0 -63
- package/src/data/components/button-archived/style.js +0 -5
- package/src/data/components/button-circle/index.js +0 -54
- package/src/data/components/button-contacts/index.js +0 -56
- package/src/data/components/button-contacts/style.js +0 -13
- package/src/data/components/button-download/index.js +0 -63
- package/src/data/components/button-pro/index.js +0 -98
- package/src/data/components/button-pro/style.js +0 -19
- package/src/data/components/button-theme-switcher/index.js +0 -104
- package/src/data/components/button-theme-switcher/style.js +0 -16
- package/src/data/components/button-user/index.js +0 -82
- package/src/data/components/button-user/style.js +0 -25
- package/src/data/components/datepicker/index.js +0 -40
- package/src/data/components/datepicker/style.js +0 -4
- package/src/data/components/dropdown-list/index.js +0 -56
- package/src/data/components/field/index.js +0 -40
- package/src/data/components/index.js +0 -34
- package/src/data/components/label/index.js +0 -40
- package/src/data/components/notification/index.js +0 -55
- package/src/data/components/notification/style.js +0 -20
- package/src/data/components/pills/index.js +0 -37
- package/src/data/components/tooltip/index.js +0 -38
- package/src/data/filters.js +0 -3
- package/src/data/index.js +0 -3
- package/src/data/library/button-circle/index.js +0 -52
- package/src/data/library/button-join/index.js +0 -61
- package/src/data/library/family-bundle/index.js +0 -99
- package/src/data/library/family-bundle/style.js +0 -27
- package/src/data/library/index.js +0 -15
- package/src/data/library/join-class/index.js +0 -45
- package/src/data/library/parent-mode/index.js +0 -69
- package/src/data/library/parent-mode/style.js +0 -25
- package/src/index.html +0 -57
- package/src/index.js +0 -7
- package/src/pages/Color/colors.js +0 -58
- package/src/pages/Color/documentThemes.js +0 -101
- package/src/pages/Color/style.js +0 -7
- package/src/pages/ColorEditor/colorTone.js +0 -163
- package/src/pages/ColorEditor/index.js +0 -178
- package/src/pages/Export/header.js +0 -37
- package/src/pages/Export/style.js +0 -28
- package/src/pages/Library/style.js +0 -43
- package/src/pages/PageProto.js +0 -26
- package/src/pages/Typography/docFonts.js +0 -128
- package/src/pages/Typography/docStyles.js +0 -97
- package/src/pages/Typography/style.js +0 -11
- package/src/protect.js +0 -114
- package/src/state.js +0 -3
- package/src/test.js +0 -30
- package/test/index.test.js +0 -5
- /package/{src/pages/Spaces → .legacy}/boxModel.js +0 -0
- /package/{src/data/favorites.js → .legacy/sequence.js} +0 -0
- /package/src/pages/{ColorEditor → Theme}/ntc.js +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Grid, Scene, Flex, Code } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
const returnScale = (state, key, fallback) => {
|
|
6
|
+
const { scales } = state
|
|
7
|
+
return (scales[state.props[key] || state.props[fallback]] || 0) + 'em'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const scene = {
|
|
11
|
+
extend: Scene,
|
|
12
|
+
|
|
13
|
+
scene: {
|
|
14
|
+
boxModel: {
|
|
15
|
+
extend: Grid,
|
|
16
|
+
props: ({ state }) => ({
|
|
17
|
+
color: 'gray5',
|
|
18
|
+
fontSize: 'Z',
|
|
19
|
+
columns: '30px auto 30px',
|
|
20
|
+
rows: '30px auto 30px',
|
|
21
|
+
templateAreas: `"x1 t x2"
|
|
22
|
+
"l content r"
|
|
23
|
+
"x3 b x4"`,
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
textAlign: 'center'
|
|
26
|
+
}),
|
|
27
|
+
|
|
28
|
+
...[
|
|
29
|
+
...['', { text: (el, s) => s.props.paddingTop || '', style: { gridArea: 't' } }, ''],
|
|
30
|
+
...[
|
|
31
|
+
{ text: (el, s) => s.props.paddingLeft || '', style: { gridArea: 'l' } },
|
|
32
|
+
{
|
|
33
|
+
props: ({ state }) => ({
|
|
34
|
+
gridArea: 'content',
|
|
35
|
+
borderStyle: 'solid',
|
|
36
|
+
borderColor: 'margin 0.15',
|
|
37
|
+
|
|
38
|
+
borderWidth: [
|
|
39
|
+
returnScale(state, 'marginBlockStart', 'margin'),
|
|
40
|
+
returnScale(state, 'marginInlineEnd', 'margin'),
|
|
41
|
+
returnScale(state, 'marginBlockEnd', 'margin'),
|
|
42
|
+
returnScale(state, 'marginInlineStart', 'margin')
|
|
43
|
+
]
|
|
44
|
+
}),
|
|
45
|
+
border: {
|
|
46
|
+
props: ({ state }) => ({
|
|
47
|
+
gridArea: 'content',
|
|
48
|
+
borderStyle: 'solid',
|
|
49
|
+
borderColor: 'border 0.65',
|
|
50
|
+
overflow: 'hidden',
|
|
51
|
+
|
|
52
|
+
round: [
|
|
53
|
+
returnScale(state, 'borderRadiusEndStart', 'borderRadius'),
|
|
54
|
+
returnScale(state, 'borderRadiusStartEnd', 'borderRadius'),
|
|
55
|
+
returnScale(state, 'borderRadiusEndEnd', 'borderRadius'),
|
|
56
|
+
returnScale(state, 'borderRadiusStartStart', 'borderRadius')
|
|
57
|
+
].join(' '),
|
|
58
|
+
|
|
59
|
+
borderWidth: [
|
|
60
|
+
returnScale(state, 'borderBlockStartWidth', 'borderWidth'),
|
|
61
|
+
returnScale(state, 'borderInlineEndWidth', 'borderWidth'),
|
|
62
|
+
returnScale(state, 'borderBlockEndWidth', 'borderWidth'),
|
|
63
|
+
returnScale(state, 'borderInlineStartWidth', 'borderWidth')
|
|
64
|
+
]
|
|
65
|
+
}),
|
|
66
|
+
padding: {
|
|
67
|
+
extend: Flex,
|
|
68
|
+
props: ({ state }) => ({
|
|
69
|
+
fontSize: `${state.base}px`,
|
|
70
|
+
lineHeight: 1,
|
|
71
|
+
borderStyle: 'solid',
|
|
72
|
+
theme: 'quaternary',
|
|
73
|
+
padding: 'X2',
|
|
74
|
+
borderColor: 'grassgreen 0.25',
|
|
75
|
+
overflow: 'hidden',
|
|
76
|
+
textOverflow: 'ellipsis',
|
|
77
|
+
|
|
78
|
+
width: state.props['width'],
|
|
79
|
+
height: state.props['height'],
|
|
80
|
+
|
|
81
|
+
minWidth: state.props['minWidth'],
|
|
82
|
+
maxWidth: state.props['maxWidth'],
|
|
83
|
+
|
|
84
|
+
minHeight: state.props['minHeight'],
|
|
85
|
+
maxHeight: state.props['maxHeight'],
|
|
86
|
+
|
|
87
|
+
borderWidth: [
|
|
88
|
+
returnScale(state, 'paddingBlockStart', 'padding'),
|
|
89
|
+
returnScale(state, 'paddingInlineEnd', 'padding'),
|
|
90
|
+
returnScale(state, 'paddingBlockEnd', 'padding'),
|
|
91
|
+
returnScale(state, 'paddingInlineStart', 'padding')
|
|
92
|
+
],
|
|
93
|
+
style: { whiteSpace: 'nowrap' }
|
|
94
|
+
}),
|
|
95
|
+
span: (el, s) => `Base `,
|
|
96
|
+
gap: {
|
|
97
|
+
props: ({ state }) => ({
|
|
98
|
+
background: 'gap .15',
|
|
99
|
+
margin: '0 .1em',
|
|
100
|
+
height: '1em',
|
|
101
|
+
minWidth: state.props['gap']
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
base: { text: (el, s) => s.base }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
text: (el, s) => s.paddingRight || '', style: { gridArea: 'r' }
|
|
109
|
+
}],
|
|
110
|
+
...['', { text: (el, s) => s.paddingBottom || '', style: { gridArea: 'b' } }, '']
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const SpacingPreview = {
|
|
117
|
+
extend: Flex,
|
|
118
|
+
|
|
119
|
+
props: {
|
|
120
|
+
maxHeight: '25vh',
|
|
121
|
+
zIndex: '9999',
|
|
122
|
+
gap: 'A',
|
|
123
|
+
lazyLoad: true,
|
|
124
|
+
|
|
125
|
+
scene: { flex: 1 },
|
|
126
|
+
|
|
127
|
+
style: {
|
|
128
|
+
backdropFilter: 'blur(15px)'
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
scene,
|
|
133
|
+
code: {
|
|
134
|
+
extend: Code,
|
|
135
|
+
props: ({ state }) => ({
|
|
136
|
+
hide: Object.keys(state.props).length === 0,
|
|
137
|
+
flex: '0 0 360px',
|
|
138
|
+
margin: '0',
|
|
139
|
+
code: {
|
|
140
|
+
margin: '0'
|
|
141
|
+
},
|
|
142
|
+
buttons: { marginInline: 'X2' }
|
|
143
|
+
}),
|
|
144
|
+
title: null,
|
|
145
|
+
code: {
|
|
146
|
+
props: {
|
|
147
|
+
text: ({ state }) => {
|
|
148
|
+
const code = 'const props = ' + JSON.stringify(state.props, null, 2)
|
|
149
|
+
return code
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Grid,
|
|
5
|
+
Pseudo,
|
|
6
|
+
mapSequence,
|
|
7
|
+
sortSequence
|
|
8
|
+
} from '@symbo.ls/components'
|
|
9
|
+
|
|
10
|
+
import { SpacingRowButton } from '.'
|
|
11
|
+
import actionButtons, { setRowButtons } from './SpacingButton/actionButtons'
|
|
12
|
+
|
|
13
|
+
const Cell = {
|
|
14
|
+
tag: 'div',
|
|
15
|
+
props: {
|
|
16
|
+
padding: 'X2 C2 X2 0'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const Row = {
|
|
21
|
+
extend: Grid,
|
|
22
|
+
key: state => state.key,
|
|
23
|
+
|
|
24
|
+
props: ({ state }) => ({
|
|
25
|
+
columns: '7ch 14ch 12ch 12ch 20em 1fr',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
isBase: state.index === 0,
|
|
28
|
+
active: (state.key && state.key.length) === 1,
|
|
29
|
+
|
|
30
|
+
margin: '0 -A',
|
|
31
|
+
padding: '0 B',
|
|
32
|
+
position: 'relative',
|
|
33
|
+
height: 'C+Z',
|
|
34
|
+
transition: 'A defaultBezier background',
|
|
35
|
+
|
|
36
|
+
'.isBase': {
|
|
37
|
+
opacity: 1,
|
|
38
|
+
background: 'gray1 .5'
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
':hover': {
|
|
42
|
+
background: 'gray1 .65'
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
i: {
|
|
46
|
+
text: state.key,
|
|
47
|
+
active: (state.key && state.key.length) === 1,
|
|
48
|
+
|
|
49
|
+
'.active': {
|
|
50
|
+
fontWeight: '600',
|
|
51
|
+
'@dark': { color: 'gray9' },
|
|
52
|
+
'@light': { color: 'gray3' }
|
|
53
|
+
},
|
|
54
|
+
'!active': {
|
|
55
|
+
fontWeight: '400',
|
|
56
|
+
'@dark': { color: 'gray6' },
|
|
57
|
+
'@light': { color: 'gray7' }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
decimal: {
|
|
61
|
+
text: state.decimal,
|
|
62
|
+
color: 'gray6',
|
|
63
|
+
fontWeight: '300'
|
|
64
|
+
},
|
|
65
|
+
px: {
|
|
66
|
+
text: state.val,
|
|
67
|
+
'@dark': { color: 'gray9' },
|
|
68
|
+
'@light': { color: 'gray3' }
|
|
69
|
+
},
|
|
70
|
+
em: {
|
|
71
|
+
color: 'gray6',
|
|
72
|
+
text: state.scaling + 'em'
|
|
73
|
+
},
|
|
74
|
+
graph: {
|
|
75
|
+
margin: '0 0 0 -B2',
|
|
76
|
+
maxWidth: '1px',
|
|
77
|
+
line: {
|
|
78
|
+
isBase: state.index === 0,
|
|
79
|
+
widthRange: `${state.val}px` || 0,
|
|
80
|
+
height: '2px',
|
|
81
|
+
background: 'blue',
|
|
82
|
+
borderRadius: 'A',
|
|
83
|
+
'.isBase': {
|
|
84
|
+
height: '5px'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
buttons: {
|
|
89
|
+
columns: 'repeat(7, var(--spacing-B2))',
|
|
90
|
+
rows: 'var(--spacing-B2)',
|
|
91
|
+
position: 'relative',
|
|
92
|
+
gap: '.2em',
|
|
93
|
+
opacity: '1',
|
|
94
|
+
boxSizing: 'content-box',
|
|
95
|
+
margin: '0 0 0 -1.9em'
|
|
96
|
+
}
|
|
97
|
+
}),
|
|
98
|
+
|
|
99
|
+
childExtend: Cell,
|
|
100
|
+
|
|
101
|
+
i: {},
|
|
102
|
+
em: {},
|
|
103
|
+
decimal: {},
|
|
104
|
+
px: {},
|
|
105
|
+
buttons: {
|
|
106
|
+
extend: Grid,
|
|
107
|
+
childExtend: SpacingRowButton,
|
|
108
|
+
$setStateCollection: setRowButtons
|
|
109
|
+
},
|
|
110
|
+
graph: { line: {} },
|
|
111
|
+
|
|
112
|
+
overlay: {
|
|
113
|
+
props: {
|
|
114
|
+
position: 'absolute',
|
|
115
|
+
right: '0',
|
|
116
|
+
top: '0',
|
|
117
|
+
bottom: '0',
|
|
118
|
+
width: 'calc(100% - var(--spacing-G3))',
|
|
119
|
+
height: '100%'
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
on: {
|
|
123
|
+
mouseover: (ev, el, s) => {
|
|
124
|
+
if (!s.parent.hovered !== s.key) {
|
|
125
|
+
const key = parseInt(el.parent.key)
|
|
126
|
+
const rowHeight = '(var(--spacing-C) + var(--spacing-Z))'
|
|
127
|
+
const translateY = `calc(${rowHeight} * ${key + 1})`
|
|
128
|
+
const transform = `translate3d(0px, ${translateY}, 1px)`
|
|
129
|
+
s.parent.hovered = s.key
|
|
130
|
+
s.parent.selectedKey = s.key
|
|
131
|
+
el.lookup('actionButtons').setProps({ opacity: '1', transform })
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
mouseleave: (ev, el, s) => {
|
|
136
|
+
if (s.parent.hovered && s.parent.hovered === s.key) {
|
|
137
|
+
s.parent.hovered = false
|
|
138
|
+
el.lookup('actionButtons').setProps({ opacity: '0' })
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const HeaderRow = {
|
|
146
|
+
extend: Row,
|
|
147
|
+
|
|
148
|
+
childExtend: {
|
|
149
|
+
props: {
|
|
150
|
+
color: 'gray7',
|
|
151
|
+
style: { paddingBlock: '0 .618em' }
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
i: '#',
|
|
156
|
+
em: 'em',
|
|
157
|
+
decimal: 'decimal',
|
|
158
|
+
px: 'px',
|
|
159
|
+
buttons: '',
|
|
160
|
+
graph: null,
|
|
161
|
+
overlay: null
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export const SpacingTable = {
|
|
165
|
+
extend: Pseudo,
|
|
166
|
+
tag: 'section',
|
|
167
|
+
|
|
168
|
+
props: {
|
|
169
|
+
lazyLoad: true,
|
|
170
|
+
overflow: 'hidden',
|
|
171
|
+
position: 'relative',
|
|
172
|
+
header: {
|
|
173
|
+
'@dark': { color: 'gray6' },
|
|
174
|
+
'@light': { color: 'gray7' }
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
'::after': {
|
|
178
|
+
content: '""',
|
|
179
|
+
position: 'absolute',
|
|
180
|
+
width: '100%',
|
|
181
|
+
height: '100%',
|
|
182
|
+
top: '0',
|
|
183
|
+
left: '100%'
|
|
184
|
+
},
|
|
185
|
+
'@dark': {
|
|
186
|
+
color: 'gray8',
|
|
187
|
+
'::after': {
|
|
188
|
+
background: 'gray0',
|
|
189
|
+
boxShadow: 'gray0, 0 0px 50px 50px'
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
'@light': {
|
|
193
|
+
color: 'gray3',
|
|
194
|
+
'::after': {
|
|
195
|
+
background: 'gray12',
|
|
196
|
+
boxShadow: 'gray12, 0 0px 50px 50px'
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
header: HeaderRow,
|
|
202
|
+
|
|
203
|
+
cnt: {
|
|
204
|
+
childExtend: Row,
|
|
205
|
+
props: { lazyLoad: true },
|
|
206
|
+
$setStateCollection: ({ state }) => mapSequence(state, sortSequence)
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
actionButtons
|
|
210
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { ColorPicker } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
export const ThemeButtons = {
|
|
6
|
+
props: {
|
|
7
|
+
position: 'relative',
|
|
8
|
+
zIndex: '2',
|
|
9
|
+
round: 'X2',
|
|
10
|
+
style: {
|
|
11
|
+
columnCount: 2,
|
|
12
|
+
columnGap: '0'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
attr: { buttons: true },
|
|
17
|
+
|
|
18
|
+
childExtend: {
|
|
19
|
+
extend: ColorPicker,
|
|
20
|
+
props: {
|
|
21
|
+
width: '100%',
|
|
22
|
+
theme: null,
|
|
23
|
+
background: 'black 0'
|
|
24
|
+
},
|
|
25
|
+
on: {
|
|
26
|
+
stateUpdated: (el, s) => {
|
|
27
|
+
s.parent.update({ [s.key]: s.value })
|
|
28
|
+
return false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
$setStateCollection: (el, s) => {
|
|
34
|
+
return [{
|
|
35
|
+
key: 'color',
|
|
36
|
+
value: s.color
|
|
37
|
+
}, {
|
|
38
|
+
key: 'background',
|
|
39
|
+
value: s.background
|
|
40
|
+
}]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex, CommonField, Upload, ClickableItem } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
export const UploadImage = {
|
|
6
|
+
extend: [CommonField],
|
|
7
|
+
props: {
|
|
8
|
+
title: { text: 'Pick from the picture' },
|
|
9
|
+
element: {
|
|
10
|
+
border: 'none',
|
|
11
|
+
background: 'gray1',
|
|
12
|
+
padding: 'Z A Z Z',
|
|
13
|
+
gap: 'Z',
|
|
14
|
+
flow: 'row',
|
|
15
|
+
icon: { style: { fontSize: '52px' } },
|
|
16
|
+
p: {
|
|
17
|
+
text: 'Upload or drop the image'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
title: {},
|
|
22
|
+
element: {
|
|
23
|
+
extend: [Upload, Flex, ClickableItem],
|
|
24
|
+
icon: { style: { fontSize: '52px' } },
|
|
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
|
+
$all: true
|
|
40
|
+
}, async (data) => {
|
|
41
|
+
console.log(data)
|
|
42
|
+
s.update({ icon: { pending: false, ...data } })
|
|
43
|
+
|
|
44
|
+
// await client.set({
|
|
45
|
+
// $id: s.projectId,
|
|
46
|
+
// icon: data
|
|
47
|
+
// }, d => console.log('d', d))
|
|
48
|
+
|
|
49
|
+
await client.set({
|
|
50
|
+
$id: s.projectId,
|
|
51
|
+
icon: data.id
|
|
52
|
+
}, d => console.log('d2', d))
|
|
53
|
+
})
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.log(e)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export * from './Widget'
|
|
4
|
+
export * from './Route'
|
|
5
|
+
export * from './Page'
|
|
6
|
+
export * from './Header'
|
|
7
|
+
export * from './Aside'
|
|
8
|
+
|
|
9
|
+
export * from './Banner'
|
|
10
|
+
export * from './ShapeSet'
|
|
11
|
+
export * from './ColorText'
|
|
12
|
+
export * from './ThemeButtons'
|
|
13
|
+
export * from './SlidersWithResponsive'
|
|
14
|
+
export * from './HeaderHeading'
|
|
15
|
+
export * from './ColorsPalette'
|
|
16
|
+
export * from './ShapePreview'
|
|
17
|
+
export * from './SpacingPreview'
|
|
18
|
+
export * from './ResponsivePreview'
|
|
19
|
+
export * from './IconsGroup'
|
|
20
|
+
export * from './FontText'
|
|
21
|
+
export * from './DesignComponent'
|
|
22
|
+
export * from './ColumnParagrphs'
|
|
23
|
+
export * from './SpacingButton'
|
|
24
|
+
export * from './UploadImage'
|
|
25
|
+
export * from './SpacingTable'
|
package/src/config/index.js
CHANGED
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { set, setEach, RESET, FONT_FAMILY, FONT, getFontFace, getFontFamily } from '@symbo.ls/scratch'
|
|
5
|
-
import { injectGlobal } from '@emotion/css'
|
|
3
|
+
import { init } from '@symbo.ls/components'
|
|
6
4
|
|
|
7
|
-
import { merge } from 'domql-preview/src/utils/object'
|
|
8
|
-
import { EDITOR_THEMES, COMPONENT_THEMES } from './theme'
|
|
9
5
|
import { EDITOR_COLORS } from './color'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
setEach('theme', EDITOR_THEMES)
|
|
21
|
-
|
|
22
|
-
const FontFace = getFontFace(FONT)
|
|
23
|
-
const family = getFontFamily(FONT_FAMILY)
|
|
24
|
-
|
|
25
|
-
injectGlobal(RESET)
|
|
26
|
-
injectGlobal(FontFace)
|
|
27
|
-
injectGlobal(`
|
|
28
|
-
body,
|
|
29
|
-
input,
|
|
30
|
-
select {
|
|
31
|
-
font-family: ${family};
|
|
6
|
+
import { COMPONENT_THEMES, EDITOR_THEMES } from './theme'
|
|
7
|
+
|
|
8
|
+
const PREVIEW_CONF = {
|
|
9
|
+
color: {
|
|
10
|
+
blue2: '#4676EC',
|
|
11
|
+
...EDITOR_COLORS
|
|
12
|
+
},
|
|
13
|
+
theme: {
|
|
14
|
+
...EDITOR_THEMES,
|
|
15
|
+
...COMPONENT_THEMES
|
|
32
16
|
}
|
|
33
|
-
`)
|
|
34
17
|
}
|
|
35
18
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export default CONFIG
|
|
19
|
+
export default init(PREVIEW_CONF)
|
package/src/config/theme.js
CHANGED
|
@@ -1,83 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import dots from '../assets/dots.png'
|
|
4
|
-
import dotsDark from '../assets/dotsDark.png'
|
|
5
|
-
|
|
6
|
-
const MODAL = {
|
|
7
|
-
modalFade: {
|
|
8
|
-
color: 'white',
|
|
9
|
-
backdropFilter: 'blur(3px)',
|
|
10
|
-
backgroundColor: 'modalFade 0.75'
|
|
11
|
-
},
|
|
12
|
-
modalBackground: {
|
|
13
|
-
color: 'white',
|
|
14
|
-
backgroundColor: 'modalBackground'
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const SCENE = {
|
|
19
|
-
darkScene: {
|
|
20
|
-
backgroundColor: 'white 0.02',
|
|
21
|
-
'> div': { backgroundImage: `url(${dots})` }
|
|
22
|
-
},
|
|
23
|
-
lightScene: {
|
|
24
|
-
backgroundColor: 'white',
|
|
25
|
-
'> div': { backgroundImage: `url(${dotsDark})` }
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const DROPDOWN = {
|
|
30
|
-
dropdownItem: {
|
|
31
|
-
color: 'white 0.65',
|
|
32
|
-
state: {
|
|
33
|
-
hover: {
|
|
34
|
-
color: 'white',
|
|
35
|
-
background: 'gradient-light-active'
|
|
36
|
-
},
|
|
37
|
-
active: {
|
|
38
|
-
color: 'white',
|
|
39
|
-
background: 'gradient-light-active'
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
dropdownItemActive: {
|
|
44
|
-
color: 'white',
|
|
45
|
-
background: 'gradient-light-active'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
3
|
export const EDITOR_THEMES = {
|
|
50
|
-
header: {
|
|
51
|
-
color: 'white',
|
|
52
|
-
backgroundColor: 'black 0.85',
|
|
53
|
-
borderColor: 'white 0.09',
|
|
54
|
-
backdropFilter: 'blur(3px)'
|
|
55
|
-
},
|
|
56
|
-
|
|
57
4
|
shape: {
|
|
58
5
|
background: 'shapeColor',
|
|
59
6
|
border: 'none'
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
...MODAL,
|
|
63
|
-
...SCENE,
|
|
64
|
-
...DROPDOWN
|
|
7
|
+
}
|
|
65
8
|
}
|
|
66
9
|
|
|
67
10
|
export const COMPONENT_THEMES = {
|
|
68
|
-
lightDark: {
|
|
69
|
-
background: 'white',
|
|
70
|
-
color: 'darkPurple',
|
|
71
|
-
variants: {
|
|
72
|
-
inverse: true
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
alert: {
|
|
77
|
-
background: 'yellow',
|
|
78
|
-
color: 'black'
|
|
79
|
-
},
|
|
80
|
-
|
|
81
11
|
label: {
|
|
82
12
|
background: 'brown',
|
|
83
13
|
color: 'white'
|