@symbo.ls/preview 2.7.21 → 2.7.24
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/.eslintrc.js +2 -8
- package/.vscode/settings.json +4 -1
- package/README.md +1 -0
- package/config.js +6 -0
- package/define.js +10 -0
- package/index.html +5 -5
- package/index.js +6 -9
- package/package.json +9 -28
- package/src/app.js +33 -38
- package/state.js +14 -0
- package/svgSprite.config.js +2 -2
- package/.babelrc.js +0 -5
- package/.coveralls.yml +0 -1
- package/.eslintignore +0 -1
- package/.legacy/_tools_old.js +0 -49
- package/.legacy/boxModel.js +0 -3
- package/.legacy/index copy.js +0 -45
- package/.legacy/preview.js +0 -133
- package/.legacy/sequence.js +0 -3
- package/.legacy/style.js +0 -30
- package/.prettierrc +0 -4
- package/.vscode/extensions.json +0 -5
- package/src/assets/dark.png +0 -0
- package/src/assets/fonts/FiraGO/FiraGO-Bold.woff2 +0 -0
- package/src/assets/fonts/FiraGO/FiraGO-Light.woff2 +0 -0
- package/src/assets/fonts/FiraGO/FiraGO-Medium.woff2 +0 -0
- package/src/assets/fonts/FiraGO/FiraGO-Regular.woff2 +0 -0
- package/src/assets/fonts/europa-bold-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-bolditalic-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-light-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-lightitalic-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-regular-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-regularitalic-webfont.woff2 +0 -0
- package/src/assets/mask1.png +0 -0
- package/src/assets/mask2.png +0 -0
- package/src/assets/ovalCircle.svg +0 -9
- 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 +0 -101
- package/src/components/Banner.js +0 -58
- package/src/components/ColorText.js +0 -29
- package/src/components/ColorsPalette.js +0 -69
- package/src/components/ColumnParagrphs.js +0 -22
- package/src/components/ContinueButton.js +0 -14
- package/src/components/DesignComponent.js +0 -81
- package/src/components/FontText.js +0 -193
- package/src/components/Header.js +0 -53
- package/src/components/HeaderHeading.js +0 -23
- package/src/components/IconsGroup.js +0 -64
- package/src/components/Page.js +0 -135
- package/src/components/ResponsivePreview.js +0 -44
- package/src/components/Route.js +0 -1
- package/src/components/ShapePreview.js +0 -63
- package/src/components/ShapeSet.js +0 -85
- package/src/components/SlidersWithResponsive.js +0 -23
- package/src/components/SpacingButton/actionButtons.js +0 -41
- package/src/components/SpacingButton/dropdown.js +0 -114
- package/src/components/SpacingButton/index.js +0 -250
- package/src/components/SpacingButton/props.js +0 -45
- package/src/components/SpacingPreview.js +0 -156
- package/src/components/SpacingTable.js +0 -213
- package/src/components/ThemeButtons.js +0 -41
- package/src/components/UploadImage.js +0 -31
- package/src/components/Widget.js +0 -1
- package/src/components/index.js +0 -25
- package/src/pages/Account/Personal.js +0 -59
- package/src/pages/Account/Project.js +0 -40
- package/src/pages/Account/fields.js +0 -74
- package/src/pages/Account/fieldsGridProps.js +0 -15
- package/src/pages/Account/index.js +0 -117
- package/src/pages/Color/globalThemes.js +0 -32
- package/src/pages/Color/index.js +0 -18
- package/src/pages/Color/palette.js +0 -36
- package/src/pages/Color/themes.js +0 -37
- package/src/pages/Components/grid.js +0 -99
- package/src/pages/Components/index.js +0 -37
- package/src/pages/Components/sidebar.js +0 -28
- package/src/pages/Components/style.js +0 -16
- package/src/pages/DesignSystem/Dashboard/banners.js +0 -38
- package/src/pages/DesignSystem/Dashboard/designElements.js +0 -124
- package/src/pages/DesignSystem/Dashboard/index.js +0 -22
- package/src/pages/DesignSystem/Dashboard/quickstart.js +0 -84
- package/src/pages/DesignSystem/Dashboard/state.js +0 -142
- package/src/pages/DesignSystem/Dashboard/summary.js +0 -52
- package/src/pages/DesignSystem/index.js +0 -187
- package/src/pages/Editor/index.js +0 -46
- package/src/pages/Editor/layers.js +0 -126
- package/src/pages/Editor/scene.js +0 -95
- package/src/pages/Editor/style.js +0 -13
- package/src/pages/Editor/tools.js +0 -360
- package/src/pages/Export/const.js +0 -19
- package/src/pages/Export/description.js +0 -88
- package/src/pages/Export/gist.js +0 -23
- package/src/pages/Export/index.js +0 -82
- package/src/pages/Export/scene.js +0 -59
- package/src/pages/Export/state.js +0 -23
- package/src/pages/Export/tools.js +0 -101
- package/src/pages/Fonts/fontFaces.js +0 -50
- package/src/pages/Fonts/fontFamilies.js +0 -48
- package/src/pages/Fonts/index.js +0 -16
- package/src/pages/Fonts/state.js +0 -5
- package/src/pages/Icons/index.js +0 -92
- package/src/pages/Icons/style.js +0 -1
- package/src/pages/Init/ChooseEnvironment.js +0 -149
- package/src/pages/Init/ChooseProject.js +0 -61
- package/src/pages/Init/CreateDocumentTheme.js +0 -176
- package/src/pages/Init/CreatePalette.js +0 -94
- package/src/pages/Init/FontText.js +0 -33
- package/src/pages/Init/Personalize/fields.js +0 -120
- package/src/pages/Init/Personalize/icon.js +0 -76
- package/src/pages/Init/Personalize/index.js +0 -120
- package/src/pages/Init/index.js +0 -39
- package/src/pages/Library/disabled.js +0 -38
- package/src/pages/Library/index.js +0 -33
- package/src/pages/MediaQuery/index.js +0 -46
- package/src/pages/MediaQuery/lists.js +0 -299
- package/src/pages/MediaQuery/state.js +0 -149
- package/src/pages/MediaQuery/typeScale.js +0 -69
- package/src/pages/Shapes/index.js +0 -75
- package/src/pages/Shapes/shapeSet.js +0 -133
- package/src/pages/Shapes/style.js +0 -11
- package/src/pages/Spaces/index.js +0 -65
- package/src/pages/Spaces/sequence.js +0 -34
- package/src/pages/Spaces/templates.js +0 -37
- package/src/pages/State/index.js +0 -87
- package/src/pages/Theme/buttonTitlesGrid.js +0 -47
- package/src/pages/Theme/buttonsHeader.js +0 -33
- package/src/pages/Theme/friendTheme.js +0 -30
- package/src/pages/Theme/index.js +0 -226
- package/src/pages/Theme/interactivity.js +0 -115
- package/src/pages/Theme/ntc.js +0 -1689
- package/src/pages/Theme/preview.js +0 -152
- package/src/pages/Theme/selectsGrid.js +0 -74
- package/src/pages/Theme/style.js +0 -38
- package/src/pages/Theme/themingTools.js +0 -106
- package/src/pages/Typography/collection.js +0 -115
- package/src/pages/Typography/documentStyles.js +0 -113
- package/src/pages/Typography/index.js +0 -71
- package/src/pages/Typography/rangeButtons.js +0 -58
- package/src/pages/Typography/shared.js +0 -9
- package/src/pages/Typography/stylesHelpers.js +0 -30
- package/src/pages/Typography/typeScale.js +0 -83
- package/src/pages/__Account/__/index.js +0 -241
- package/src/pages/__Account/__/setUpProject.js +0 -142
- package/src/pages/__Account/index.js +0 -111
- package/src/pages/index.js +0 -17
- package/src/state.js +0 -20
- package/src/style.js +0 -20
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { opacify } from '@symbo.ls/scratch'
|
|
4
|
-
import { Flex, Grid } from '@symbo.ls/components'
|
|
5
|
-
|
|
6
|
-
const classOpacify = (value, opacity) => {
|
|
7
|
-
const { background, backgroundColor, color } = value
|
|
8
|
-
const bg = background || backgroundColor || color
|
|
9
|
-
if (!bg) return
|
|
10
|
-
return { background: opacify(bg, opacity) }
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const TONES_AMOUNT = 13
|
|
14
|
-
const TONES_ARR = new Array(TONES_AMOUNT).fill(0).map((_, i) => i)
|
|
15
|
-
|
|
16
|
-
const getThemeProperty = (property, value, mod) => {
|
|
17
|
-
const modifier = `@${mod}`
|
|
18
|
-
return value[modifier] && value[modifier][property] ? value[modifier][property] : value[property]
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const Tones = {
|
|
22
|
-
extend: Grid,
|
|
23
|
-
props: {
|
|
24
|
-
columns: `repeat(${TONES_AMOUNT}, 1fr)`,
|
|
25
|
-
height: 'B',
|
|
26
|
-
round: 'Z',
|
|
27
|
-
overflow: 'hidden'
|
|
28
|
-
},
|
|
29
|
-
childExtend: {
|
|
30
|
-
tag: 'span',
|
|
31
|
-
text: null,
|
|
32
|
-
props: ({ key, state }) => ({
|
|
33
|
-
round: '0',
|
|
34
|
-
transition: 'B defaultBezier',
|
|
35
|
-
transitionProperty: 'color, background',
|
|
36
|
-
background: getThemeProperty('background', state.value, state.sceneTheme),
|
|
37
|
-
opacity: '' + (100 / TONES_AMOUNT * parseInt(key)) / 100
|
|
38
|
-
})
|
|
39
|
-
},
|
|
40
|
-
$setCollection: () => TONES_ARR
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
tag: 'aside',
|
|
45
|
-
extend: Flex,
|
|
46
|
-
props: { flow: 'column' },
|
|
47
|
-
|
|
48
|
-
preview: {
|
|
49
|
-
props: (el, s) => ({
|
|
50
|
-
padding: 'X1',
|
|
51
|
-
round: 'Z2',
|
|
52
|
-
theme: `scene @${s.sceneTheme}`,
|
|
53
|
-
style: {
|
|
54
|
-
'&, & *': {
|
|
55
|
-
transition: '165ms cubic-bezier(.29,.67,.51,.97)',
|
|
56
|
-
transitionProperty: 'color, background'
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}),
|
|
60
|
-
scene: {
|
|
61
|
-
props: {
|
|
62
|
-
padding: 'A',
|
|
63
|
-
backgroundPosition: `center`,
|
|
64
|
-
backgroundRepeat: `repeat`,
|
|
65
|
-
backgroundSize: '100px 100px'
|
|
66
|
-
},
|
|
67
|
-
circle: {
|
|
68
|
-
props: (el, s) => ({
|
|
69
|
-
theme: window.location.pathname.split('theme/')[1],
|
|
70
|
-
themeModifier: s.sceneTheme,
|
|
71
|
-
flexFlow: 'column',
|
|
72
|
-
flexAlign: 'center center',
|
|
73
|
-
width: 'G',
|
|
74
|
-
aspectRatio: '1 / 1',
|
|
75
|
-
round: '100%',
|
|
76
|
-
position: 'relative',
|
|
77
|
-
borderWidth: '1px',
|
|
78
|
-
borderStyle: 'solid',
|
|
79
|
-
borderColor: 'transparent',
|
|
80
|
-
|
|
81
|
-
h6: {
|
|
82
|
-
fontSize: 'D',
|
|
83
|
-
fontWeight: 'bold',
|
|
84
|
-
gap: 'X'
|
|
85
|
-
}
|
|
86
|
-
}),
|
|
87
|
-
h6: {
|
|
88
|
-
extend: Flex,
|
|
89
|
-
Span: {
|
|
90
|
-
text: 'The',
|
|
91
|
-
fontWeight: 'normal',
|
|
92
|
-
marginRight: '6px'
|
|
93
|
-
},
|
|
94
|
-
text: 'Text Color'
|
|
95
|
-
},
|
|
96
|
-
Span: (el, s) => ({
|
|
97
|
-
text: s.themeName,
|
|
98
|
-
position: 'absolute',
|
|
99
|
-
top: '86%',
|
|
100
|
-
left: '50%',
|
|
101
|
-
transform: 'translate(-50%, -50%)',
|
|
102
|
-
fontWeight: '600'
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
opacity: {
|
|
109
|
-
props: {
|
|
110
|
-
padding: 'B1 0 0 0'
|
|
111
|
-
},
|
|
112
|
-
caption: {
|
|
113
|
-
props: {
|
|
114
|
-
text: 'Opacity',
|
|
115
|
-
size: 'Z',
|
|
116
|
-
padding: '0 0 Z1 0',
|
|
117
|
-
opacity: '.65'
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
// tones: { extend: Tones }
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
shades: {
|
|
124
|
-
if: () => false,
|
|
125
|
-
props: { padding: 'B 0 0 0' },
|
|
126
|
-
caption: {
|
|
127
|
-
props: {
|
|
128
|
-
text: 'Shades',
|
|
129
|
-
size: 'Z',
|
|
130
|
-
padding: '0 0 Z1 0'
|
|
131
|
-
},
|
|
132
|
-
style: { opacity: '.65' }
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
generate: {
|
|
136
|
-
props: { flexFlow: 'column', round: 'Z', gap: '2px' },
|
|
137
|
-
|
|
138
|
-
childExtend: {
|
|
139
|
-
extend: [Tones],
|
|
140
|
-
props: { round: 'X' },
|
|
141
|
-
...TONES_ARR.map(v => ({
|
|
142
|
-
class: { background: el => classOpacify(el, (100 / TONES_AMOUNT * v) / 100) }
|
|
143
|
-
}))
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
dark: {},
|
|
147
|
-
light: {
|
|
148
|
-
props: { theme: 'lightScene' }
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { CommonField, ColorSelect, Grid } from '@symbo.ls/components'
|
|
4
|
-
|
|
5
|
-
const ColorDropwdown = {
|
|
6
|
-
extend: CommonField,
|
|
7
|
-
tag: 'div',
|
|
8
|
-
state: true,
|
|
9
|
-
|
|
10
|
-
props: (el, s) => ({
|
|
11
|
-
width: '100%',
|
|
12
|
-
title: {
|
|
13
|
-
text: s.title
|
|
14
|
-
},
|
|
15
|
-
element: {
|
|
16
|
-
width: '100%',
|
|
17
|
-
height: 'B2+W',
|
|
18
|
-
padding: '0 W1 0 Z1',
|
|
19
|
-
title: {
|
|
20
|
-
box: { background: s.value },
|
|
21
|
-
value: { text: s.value }
|
|
22
|
-
},
|
|
23
|
-
buttons: {
|
|
24
|
-
gap: 'W',
|
|
25
|
-
childProps: {
|
|
26
|
-
boxSize: 'fit-content',
|
|
27
|
-
padding: 'W1+W1'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
title: {},
|
|
34
|
-
element: { extend: ColorSelect }
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const selectsGrid = {
|
|
38
|
-
extend: Grid,
|
|
39
|
-
props: {
|
|
40
|
-
columns: 'repeat(4, auto)',
|
|
41
|
-
width: '100%',
|
|
42
|
-
gap: 'C1',
|
|
43
|
-
justifyItems: 'start',
|
|
44
|
-
'@tabletL': { columns: 'repeat(3, auto)' },
|
|
45
|
-
'@tabletM': { columns: 'repeat(2, auto)' }
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
childExtend: ColorDropwdown,
|
|
49
|
-
|
|
50
|
-
color: {},
|
|
51
|
-
backgroundColor: {},
|
|
52
|
-
borderColor: {},
|
|
53
|
-
opacity: {},
|
|
54
|
-
|
|
55
|
-
$setCollection: ({ state }) => {
|
|
56
|
-
// return [{
|
|
57
|
-
// title: 'Background color',
|
|
58
|
-
// color: 'red',
|
|
59
|
-
// name: 'red'
|
|
60
|
-
// }, {
|
|
61
|
-
// title: 'Border color',
|
|
62
|
-
// name: 'none',
|
|
63
|
-
// colorDisplay: 'none'
|
|
64
|
-
// }, {
|
|
65
|
-
// title: 'Border color',
|
|
66
|
-
// name: 'none',
|
|
67
|
-
// colorDisplay: 'none'
|
|
68
|
-
// }, {
|
|
69
|
-
// title: 'Text color',
|
|
70
|
-
// color: 'white',
|
|
71
|
-
// name: 'white'
|
|
72
|
-
// }]
|
|
73
|
-
}
|
|
74
|
-
}
|
package/src/pages/Theme/style.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export const styleTool = {
|
|
4
|
-
caption: { opacity: '.65' },
|
|
5
|
-
'> div span': { opacity: '.5' },
|
|
6
|
-
'> div > div': { gap: '1px' }
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const styleColorTones = {
|
|
10
|
-
width: '22em',
|
|
11
|
-
display: 'flex',
|
|
12
|
-
flexDirection: 'column',
|
|
13
|
-
'> div > button': {
|
|
14
|
-
padding: `${123 / 16}em`,
|
|
15
|
-
position: 'absolute'
|
|
16
|
-
},
|
|
17
|
-
caption: {
|
|
18
|
-
textTransform: 'capitalize',
|
|
19
|
-
opacity: '.65',
|
|
20
|
-
marginBottom: `${10 / 13}em`
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default {
|
|
25
|
-
display: 'flex',
|
|
26
|
-
flexFlow: 'column',
|
|
27
|
-
|
|
28
|
-
'header > nav a:hover': {
|
|
29
|
-
background: 'rgba(255, 255, 255, .08)',
|
|
30
|
-
opacity: 1,
|
|
31
|
-
color: '#EDCB38'
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
'> section': {
|
|
35
|
-
display: 'flex',
|
|
36
|
-
gap: '6.6em'
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { Grid, ColorSwitcher, CommonField, SelectField, ButtonSet, ClickableItem } from '@symbo.ls/components'
|
|
4
|
-
|
|
5
|
-
ColorSwitcher.props = (el, s) => {
|
|
6
|
-
if (!s.value) return
|
|
7
|
-
const value = s.value[el.props.type] || s.value[el.props.type + 'Color']
|
|
8
|
-
const key = filterByValue(value).key || value
|
|
9
|
-
return {
|
|
10
|
-
key: key,
|
|
11
|
-
value: value
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const themingTools = {
|
|
16
|
-
extend: Grid,
|
|
17
|
-
style: {
|
|
18
|
-
width: 'fit-content'
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
columns: 'repeat(4, 1fr)',
|
|
22
|
-
columnGap: 'C',
|
|
23
|
-
rowGap: 'C'
|
|
24
|
-
},
|
|
25
|
-
childExtend: {
|
|
26
|
-
extend: CommonField,
|
|
27
|
-
props: { padding: 0 },
|
|
28
|
-
caption: { text: el => el.parent.props.caption },
|
|
29
|
-
element: {}
|
|
30
|
-
},
|
|
31
|
-
...[{
|
|
32
|
-
props: { caption: 'Background color' },
|
|
33
|
-
caption: {},
|
|
34
|
-
element: {
|
|
35
|
-
extend: ColorSwitcher,
|
|
36
|
-
props: { type: 'background' },
|
|
37
|
-
|
|
38
|
-
title: {},
|
|
39
|
-
buttons: { ...[
|
|
40
|
-
{ props: { icon: 'plus' } },
|
|
41
|
-
{ props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
|
|
42
|
-
] }
|
|
43
|
-
}
|
|
44
|
-
}, {
|
|
45
|
-
props: { caption: 'Text color' },
|
|
46
|
-
caption: {},
|
|
47
|
-
element: {
|
|
48
|
-
extend: ColorSwitcher,
|
|
49
|
-
props: { type: 'color' },
|
|
50
|
-
|
|
51
|
-
title: {},
|
|
52
|
-
buttons: { ...[
|
|
53
|
-
{ props: { icon: 'colorInvert' } },
|
|
54
|
-
{ props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
|
|
55
|
-
] }
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
props: { caption: 'Border color' },
|
|
59
|
-
caption: {},
|
|
60
|
-
element: {
|
|
61
|
-
extend: ColorSwitcher,
|
|
62
|
-
props: { type: 'border' },
|
|
63
|
-
|
|
64
|
-
title: {},
|
|
65
|
-
buttons: { ...[
|
|
66
|
-
{ props: { icon: 'colorInvert' } },
|
|
67
|
-
{ props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
|
|
68
|
-
] }
|
|
69
|
-
}
|
|
70
|
-
}, {
|
|
71
|
-
props: { caption: 'Use as' },
|
|
72
|
-
caption: {},
|
|
73
|
-
element: {
|
|
74
|
-
extend: SelectField,
|
|
75
|
-
title: { props: { text: 'Background color' } },
|
|
76
|
-
buttons: { ...[{ props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }] }
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
props: { caption: 'Border' },
|
|
82
|
-
caption: {},
|
|
83
|
-
element: {
|
|
84
|
-
extend: ButtonSet,
|
|
85
|
-
childExtend: { extend: [ClickableItem] },
|
|
86
|
-
props: { gap: 'Z' },
|
|
87
|
-
...[
|
|
88
|
-
{ props: { icon: 'colorsColored' } },
|
|
89
|
-
{ props: { icon: 'borderOpacity' } },
|
|
90
|
-
{ props: { icon: 'borderWeight' } },
|
|
91
|
-
{ props: { icon: 'borderProps' } }
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
{
|
|
97
|
-
props: { caption: 'Shadow' },
|
|
98
|
-
caption: {},
|
|
99
|
-
element: {
|
|
100
|
-
extend: ButtonSet,
|
|
101
|
-
childExtend: { extend: [ClickableItem] },
|
|
102
|
-
...[{ props: { icon: 'plus' } }]
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
findHeadingLetter,
|
|
5
|
-
getFontFamily
|
|
6
|
-
} from '@symbo.ls/scratch'
|
|
7
|
-
import { HTML_TAGS } from '@domql/tags'
|
|
8
|
-
|
|
9
|
-
const propertyDefaults = {
|
|
10
|
-
fontSize: 'A',
|
|
11
|
-
fontWeight: '400',
|
|
12
|
-
lineHeight: '1.4',
|
|
13
|
-
letterSpacing: '0',
|
|
14
|
-
italic: '0',
|
|
15
|
-
letterWidth: '0'
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const iconMap = {
|
|
19
|
-
font: 'fontFace',
|
|
20
|
-
fontWeight: 'fontVariable',
|
|
21
|
-
lineHeight: 'textLineHeight',
|
|
22
|
-
letterSpacing: 'textLetterSpacing',
|
|
23
|
-
italic: 'fontStyleItalic',
|
|
24
|
-
letterWidth: 'textLetterWidth'
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const getTypeProp = (key, prop, library, defaultValue) => {
|
|
28
|
-
const { TYPOGRAPHY } = library
|
|
29
|
-
if (!TYPOGRAPHY) return
|
|
30
|
-
let styles = TYPOGRAPHY.styles
|
|
31
|
-
if (!styles) styles = TYPOGRAPHY.styles = {}
|
|
32
|
-
if (!styles[key]) styles[key] = {}
|
|
33
|
-
return styles[key][prop] ||
|
|
34
|
-
styles[prop] ||
|
|
35
|
-
TYPOGRAPHY[prop] ||
|
|
36
|
-
defaultValue ||
|
|
37
|
-
propertyDefaults[prop]
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const getTypeStyle = (key, library) => ({
|
|
41
|
-
font: getFontFamily(key, library.FONT_FAMILY)[0],
|
|
42
|
-
fontSize: getTypeProp(key, 'fontSize', library),
|
|
43
|
-
fontWeight: getTypeProp(key, 'fontWeight', library),
|
|
44
|
-
lineHeight: getTypeProp(key, 'lineHeight', library),
|
|
45
|
-
letterSpacing: getTypeProp(key, 'letterSpacing', library),
|
|
46
|
-
italic: getTypeProp(key, 'italic', library),
|
|
47
|
-
letterWidth: getTypeProp(key, 'letterWidth', library)
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
const isHeading = v => v.length === 2 && v[0] === 'h'
|
|
51
|
-
const isTag = v => HTML_TAGS.root.indexOf(v) > -1 || HTML_TAGS.body.indexOf(v) > -1
|
|
52
|
-
const isHelper = v => v.slice(0, 1) === '.'
|
|
53
|
-
|
|
54
|
-
const getCollectionFromArray = (arr, s) => {
|
|
55
|
-
const TYPOGRAPHY = s.parse()
|
|
56
|
-
const styles = TYPOGRAPHY.styles || {}
|
|
57
|
-
|
|
58
|
-
if (!s.sequence) return {}
|
|
59
|
-
|
|
60
|
-
return arr.map((v, k) => {
|
|
61
|
-
const result = getTypeStyle(v, s.parent.parse())
|
|
62
|
-
return {
|
|
63
|
-
key: v,
|
|
64
|
-
value: {
|
|
65
|
-
...result,
|
|
66
|
-
...styles[v]
|
|
67
|
-
},
|
|
68
|
-
labels: Object.keys(result)
|
|
69
|
-
.filter(key => key !== 'fontSize' && result[key] && result[key] !== '0')
|
|
70
|
-
.map(key => ({
|
|
71
|
-
icon: iconMap[key],
|
|
72
|
-
text: result[key]
|
|
73
|
-
})
|
|
74
|
-
),
|
|
75
|
-
sequenceValue: s.sequence[
|
|
76
|
-
isHeading(v) ? findHeadingLetter(s.h1Matches, k) : result.fontSize
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export const headingsCollection = (el, s) => {
|
|
83
|
-
el.removeContent()
|
|
84
|
-
const HEADINGS = new Array(6).fill(null).map((_, i) => 'h' + (i + 1))
|
|
85
|
-
return getCollectionFromArray(HEADINGS, s)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export const tagsCollection = (el, s) => {
|
|
89
|
-
const { __projectSystem } = s
|
|
90
|
-
const { TYPOGRAPHY } = __projectSystem
|
|
91
|
-
if (!TYPOGRAPHY) return
|
|
92
|
-
let styles = TYPOGRAPHY.styles
|
|
93
|
-
if (!styles) styles = TYPOGRAPHY.styles = {}
|
|
94
|
-
if (!styles.body) styles.body = {}
|
|
95
|
-
el.removeContent()
|
|
96
|
-
|
|
97
|
-
const TAGS = Object.keys(styles)
|
|
98
|
-
.filter(v => {
|
|
99
|
-
return isTag(v) && !isHeading(v) && !isHelper(v)
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
return getCollectionFromArray(TAGS, s)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export const helpersCollection = (el, s) => {
|
|
106
|
-
const TYPOGRAPHY = s.parse()
|
|
107
|
-
const styles = TYPOGRAPHY.styles || {}
|
|
108
|
-
|
|
109
|
-
const HELPERS = Object.keys(styles)
|
|
110
|
-
.filter(v => v.slice(0, 1) === '.')
|
|
111
|
-
|
|
112
|
-
el.removeContent()
|
|
113
|
-
|
|
114
|
-
return getCollectionFromArray(HELPERS, s)
|
|
115
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
DocumentStylesSequence,
|
|
5
|
-
Flex,
|
|
6
|
-
SelectField,
|
|
7
|
-
HTMLTagTypeObject
|
|
8
|
-
} from '@symbo.ls/components'
|
|
9
|
-
|
|
10
|
-
import { headingsCollection, tagsCollection } from './collection'
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
SectionHeader: {
|
|
14
|
-
title: 'Document Styles',
|
|
15
|
-
p: 'Document styling and theming provides global themes of the entire app, imagine it as a :root styling'
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
styles: {
|
|
19
|
-
extend: Flex,
|
|
20
|
-
|
|
21
|
-
props: {
|
|
22
|
-
flow: 'column',
|
|
23
|
-
gap: 'C',
|
|
24
|
-
align: 'flex-start flex-start',
|
|
25
|
-
header: {
|
|
26
|
-
width: '100%',
|
|
27
|
-
align: 'center space-between'
|
|
28
|
-
},
|
|
29
|
-
headings: {
|
|
30
|
-
width: '100%'
|
|
31
|
-
},
|
|
32
|
-
doc: {
|
|
33
|
-
width: '100%'
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
headings: {
|
|
38
|
-
extend: DocumentStylesSequence,
|
|
39
|
-
$setStateCollection: headingsCollection
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
doc: {
|
|
43
|
-
extend: DocumentStylesSequence,
|
|
44
|
-
$setStateCollection: tagsCollection
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
footer: {}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
fields: {
|
|
51
|
-
extend: Flex,
|
|
52
|
-
props: {
|
|
53
|
-
gap: 'A',
|
|
54
|
-
margin: '0 0 0 E2+B',
|
|
55
|
-
align: 'center flex-start'
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
tags: {
|
|
59
|
-
extend: Flex,
|
|
60
|
-
props: { gap: 'A' },
|
|
61
|
-
childExtend: HTMLTagTypeObject,
|
|
62
|
-
|
|
63
|
-
p: {
|
|
64
|
-
props: {
|
|
65
|
-
title: {
|
|
66
|
-
text: '<p>'
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
code: {
|
|
71
|
-
props: {
|
|
72
|
-
title: {
|
|
73
|
-
text: '<code>'
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
pre: {
|
|
78
|
-
props: {
|
|
79
|
-
title: {
|
|
80
|
-
text: '<pre>'
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
VerticalLine: {
|
|
87
|
-
height: 'B',
|
|
88
|
-
margin: '0 Z1'
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
IconButton: {
|
|
92
|
-
theme: 'quinary',
|
|
93
|
-
position: 'relative',
|
|
94
|
-
icon: 'plus'
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
addsomething: {
|
|
98
|
-
extend: SelectField,
|
|
99
|
-
props: {
|
|
100
|
-
position: 'relative',
|
|
101
|
-
title: {
|
|
102
|
-
text: 'Choose element'
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
title: {},
|
|
106
|
-
buttons: [{
|
|
107
|
-
props: { icon: 'plus' }
|
|
108
|
-
}, {
|
|
109
|
-
props: { icon: 'arrowAngleMirroringVertical' }
|
|
110
|
-
}]
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import documentStyles from './documentStyles'
|
|
4
|
-
import stylesHelpers from './stylesHelpers'
|
|
5
|
-
import typeScale from './typeScale'
|
|
6
|
-
import { mapSequence, sortSequence } from '@symbo.ls/components'
|
|
7
|
-
|
|
8
|
-
export const Typography = {
|
|
9
|
-
state: 'PROJECT_SYSTEM',
|
|
10
|
-
|
|
11
|
-
SectionHeader: {
|
|
12
|
-
margin: '0 0 C',
|
|
13
|
-
title: 'Typography',
|
|
14
|
-
p: 'A general configuration of type properties on the document.'
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
cnt: {
|
|
18
|
-
state: 'TYPOGRAPHY',
|
|
19
|
-
|
|
20
|
-
SlidersWithResponsive: {},
|
|
21
|
-
|
|
22
|
-
Line: {},
|
|
23
|
-
|
|
24
|
-
documentStyles,
|
|
25
|
-
Line_1: {},
|
|
26
|
-
|
|
27
|
-
stylesHelpers,
|
|
28
|
-
Line_2: {},
|
|
29
|
-
|
|
30
|
-
typeScale,
|
|
31
|
-
|
|
32
|
-
on: {
|
|
33
|
-
stateCreated: (el, s) => {
|
|
34
|
-
s.update({
|
|
35
|
-
base: s.base || 16,
|
|
36
|
-
ratio: s.ratio || 1.125,
|
|
37
|
-
range: s.range || [-3, +8],
|
|
38
|
-
subSequence: s.subSequence || true,
|
|
39
|
-
styles: s.styles || {},
|
|
40
|
-
h1Matches: s.h1Matches || +6,
|
|
41
|
-
scales: {},
|
|
42
|
-
sequence: {},
|
|
43
|
-
vars: {},
|
|
44
|
-
type: 'demo-font-size',
|
|
45
|
-
sampleText: 'Today is a big day for our tribe. The year ends.'
|
|
46
|
-
}, {
|
|
47
|
-
preventUpdate: true,
|
|
48
|
-
preventUpdateListener: true
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
console.log(s.parse())
|
|
52
|
-
if (s.base && s.range && s.type) mapSequence(s, sortSequence)
|
|
53
|
-
},
|
|
54
|
-
stateUpdated: (el, s, changes) => {
|
|
55
|
-
const { base, ratio, range, subSequence, h1Matches, type } = changes
|
|
56
|
-
|
|
57
|
-
s.update({
|
|
58
|
-
base,
|
|
59
|
-
ratio,
|
|
60
|
-
range,
|
|
61
|
-
subSequence,
|
|
62
|
-
type,
|
|
63
|
-
h1Matches
|
|
64
|
-
}, {
|
|
65
|
-
preventUpdate: true,
|
|
66
|
-
preventUpdateListener: true
|
|
67
|
-
})
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|