@symbo.ls/preview 2.0.7 → 2.5.5
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,63 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Scene, Flex, Code } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
const scene = {
|
|
6
|
+
extend: Scene,
|
|
7
|
+
|
|
8
|
+
scene: {
|
|
9
|
+
props: {
|
|
10
|
+
content: {
|
|
11
|
+
background: 'shape 1',
|
|
12
|
+
color: 'gray11',
|
|
13
|
+
padding: 'Z A1',
|
|
14
|
+
text: 'Shape Preview'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
on: {
|
|
19
|
+
update: (el, s) => {
|
|
20
|
+
el.set({
|
|
21
|
+
props: s.props
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const ShapePreview = {
|
|
29
|
+
extend: Flex,
|
|
30
|
+
props: {
|
|
31
|
+
height: 'E3',
|
|
32
|
+
zIndex: '9999',
|
|
33
|
+
gap: 'A',
|
|
34
|
+
alignItems: 'stretch ',
|
|
35
|
+
|
|
36
|
+
scene: { flex: 1 },
|
|
37
|
+
|
|
38
|
+
style: {
|
|
39
|
+
backdropFilter: 'blur(15px)'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
scene,
|
|
44
|
+
code: {
|
|
45
|
+
extend: Code,
|
|
46
|
+
props: ({ state }) => ({
|
|
47
|
+
hide: Object.keys(state.props).length === 0,
|
|
48
|
+
flex: '0 0 360px',
|
|
49
|
+
margin: '0',
|
|
50
|
+
code: {
|
|
51
|
+
height: '100%',
|
|
52
|
+
margin: '0'
|
|
53
|
+
},
|
|
54
|
+
buttons: { marginInline: 'X2' }
|
|
55
|
+
}),
|
|
56
|
+
title: null,
|
|
57
|
+
code: {
|
|
58
|
+
props: {
|
|
59
|
+
text: ({ state }) => 'const props = ' + JSON.stringify(state.props, null, 2)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { ClickableItem, Flex } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
const isActive = (el, s) => s.parent.active === `${el.parent.parent.parent.key}-${el.key}`
|
|
6
|
+
|
|
7
|
+
const ShapeItem = {
|
|
8
|
+
extend: [ClickableItem, Flex],
|
|
9
|
+
|
|
10
|
+
props: (el, s) => ({
|
|
11
|
+
padding: 'B',
|
|
12
|
+
round: 'Z',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
outline: '0, shape, solid',
|
|
16
|
+
background: 'gray1',
|
|
17
|
+
theme: null,
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
|
|
20
|
+
active: isActive(el, s),
|
|
21
|
+
|
|
22
|
+
'.active': {
|
|
23
|
+
outline: 'X, shape, solid',
|
|
24
|
+
opacity: '1',
|
|
25
|
+
background: 'gray2'
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
_shape: {
|
|
29
|
+
transition: 'A defaultBezier',
|
|
30
|
+
transitionProperty: 'background',
|
|
31
|
+
width: 'C1',
|
|
32
|
+
height: 'C1',
|
|
33
|
+
background: 'gray3'
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
|
|
37
|
+
_shape: {},
|
|
38
|
+
|
|
39
|
+
on: {
|
|
40
|
+
click: (ev, el, s) => {
|
|
41
|
+
const active = `${el.parent.parent.parent.key}-${el.key}`
|
|
42
|
+
s.parent.props = s.parse()
|
|
43
|
+
s.parent.update({ active })
|
|
44
|
+
},
|
|
45
|
+
mouseover: (ev, el, s) => {
|
|
46
|
+
el._shape.setProps({ background: 'gray5' })
|
|
47
|
+
},
|
|
48
|
+
mouseleave: (ev, el, s) => {
|
|
49
|
+
const active = isActive(el, s)
|
|
50
|
+
if (!active) el._shape.setProps({ background: 'gray3' })
|
|
51
|
+
},
|
|
52
|
+
update: (el, s) => {
|
|
53
|
+
const active = isActive(el, s)
|
|
54
|
+
el._shape.setProps({ background: active ? 'gray5' : 'gray3' })
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const ShapeSet = {
|
|
60
|
+
props: {
|
|
61
|
+
label: {
|
|
62
|
+
display: 'block',
|
|
63
|
+
opacity: '.65',
|
|
64
|
+
padding: '0 0 Z 0',
|
|
65
|
+
span: {
|
|
66
|
+
opacity: '.65'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
label: {},
|
|
72
|
+
list: {
|
|
73
|
+
extend: Flex,
|
|
74
|
+
props: {
|
|
75
|
+
gap: 'A2',
|
|
76
|
+
wrap: 'wrap'
|
|
77
|
+
},
|
|
78
|
+
childExtend: {
|
|
79
|
+
extend: ShapeItem,
|
|
80
|
+
_shape: {
|
|
81
|
+
props: ({ state }) => state
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
export const SlidersWithResponsive = {
|
|
6
|
+
extend: Flex,
|
|
7
|
+
|
|
8
|
+
props: {
|
|
9
|
+
align: 'flex-end space-between',
|
|
10
|
+
position: 'sticky',
|
|
11
|
+
top: 'C2',
|
|
12
|
+
theme: 'header',
|
|
13
|
+
zIndex: '1000',
|
|
14
|
+
margin: '-B2 -B -B',
|
|
15
|
+
padding: 'B2 B B',
|
|
16
|
+
style: {
|
|
17
|
+
backdropFilter: 'blur(15px)'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
SequenceSliders: {},
|
|
22
|
+
ResponsiveToolBar: {}
|
|
23
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex } from '@symbo.ls/components'
|
|
4
|
+
import { SpacingButton } from '..'
|
|
5
|
+
import { SPACING_BUTTONS } from './props'
|
|
6
|
+
|
|
7
|
+
export const setTableButtons = ({ state }) =>
|
|
8
|
+
Object.keys(SPACING_BUTTONS).filter(v => {
|
|
9
|
+
const rowState = state.sequence[state.selectedKey]
|
|
10
|
+
const { maxValue } = SPACING_BUTTONS[v]
|
|
11
|
+
return maxValue ? maxValue > (rowState && rowState.val) : true
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export const setRowButtons = ({ state }) =>
|
|
15
|
+
Object.keys(SPACING_BUTTONS).filter(v => {
|
|
16
|
+
const { maxValue } = SPACING_BUTTONS[v]
|
|
17
|
+
return maxValue ? maxValue > state.val : true
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
extend: Flex,
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
left: 'G3',
|
|
26
|
+
gap: 'X',
|
|
27
|
+
top: 'Y',
|
|
28
|
+
height: 'B2',
|
|
29
|
+
zIndex: 99,
|
|
30
|
+
boxSizing: 'content-box',
|
|
31
|
+
padding: '- - E',
|
|
32
|
+
transition: 'C ease-out',
|
|
33
|
+
transitionProperty: 'transform, opacity',
|
|
34
|
+
opacity: '0',
|
|
35
|
+
|
|
36
|
+
':hover': { opacity: '1' }
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
childExtend: SpacingButton,
|
|
40
|
+
$setStateCollection: setTableButtons
|
|
41
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Dropdown,
|
|
5
|
+
GridInDropdown
|
|
6
|
+
} from '@symbo.ls/components'
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
ChoosableButton,
|
|
10
|
+
diffIconTypes,
|
|
11
|
+
diffPropPosition,
|
|
12
|
+
diffPropValue,
|
|
13
|
+
getStateTree,
|
|
14
|
+
keysOf
|
|
15
|
+
} from '.'
|
|
16
|
+
import { SPACING_BUTTONS } from './props'
|
|
17
|
+
|
|
18
|
+
const ButtonInDropdown = {
|
|
19
|
+
extend: [ChoosableButton],
|
|
20
|
+
props: (element) => {
|
|
21
|
+
const { table, row, property: direction } = getStateTree(element)
|
|
22
|
+
const property = direction.parent
|
|
23
|
+
|
|
24
|
+
const propValue = property.value
|
|
25
|
+
const directionValue = direction.value
|
|
26
|
+
|
|
27
|
+
const activeProperty = SPACING_BUTTONS[property.value]
|
|
28
|
+
const keyLength = Object.keys(activeProperty).length
|
|
29
|
+
const iconKey = diffIconTypes(propValue, directionValue)
|
|
30
|
+
|
|
31
|
+
const active = table.props[propValue] === (row && row.key)
|
|
32
|
+
|
|
33
|
+
const gridArea = keyLength > 3 && diffPropPosition(propValue, directionValue)
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
active,
|
|
37
|
+
gridArea,
|
|
38
|
+
lazyLoad: true,
|
|
39
|
+
icon: { name: iconKey },
|
|
40
|
+
theme: null,
|
|
41
|
+
'@dark': {
|
|
42
|
+
background: 'transparent 0',
|
|
43
|
+
color: 'gray7',
|
|
44
|
+
':hover': {
|
|
45
|
+
theme: 'quinary',
|
|
46
|
+
color: 'gray8'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
':hover': null,
|
|
50
|
+
'.active': {
|
|
51
|
+
theme: null,
|
|
52
|
+
color: 'blue'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
attr: { title: ({ state }) => state.value },
|
|
57
|
+
on: {
|
|
58
|
+
click: (ev, element) => {
|
|
59
|
+
const { table, row, property: direction } = getStateTree(element)
|
|
60
|
+
const property = direction.parent
|
|
61
|
+
|
|
62
|
+
const propKey = diffPropValue(property.value, direction.value)
|
|
63
|
+
const active = table.props[propKey] === row.key
|
|
64
|
+
|
|
65
|
+
if (active) {
|
|
66
|
+
delete table.props[propKey] && table.update()
|
|
67
|
+
} else {
|
|
68
|
+
table.update({ props: { [propKey]: row.key } })
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
extend: Dropdown,
|
|
76
|
+
|
|
77
|
+
props: {
|
|
78
|
+
lazyLoad: true,
|
|
79
|
+
minWidth: 'none',
|
|
80
|
+
left: 'auto',
|
|
81
|
+
grid: { gap: '0' }
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
header: { text: ({ state }) => state.value },
|
|
85
|
+
|
|
86
|
+
grid: {
|
|
87
|
+
extend: GridInDropdown,
|
|
88
|
+
|
|
89
|
+
props: ({ state }) => {
|
|
90
|
+
const keys = keysOf(state)
|
|
91
|
+
if (keys.length < 4) {
|
|
92
|
+
return {
|
|
93
|
+
lazyLoad: true,
|
|
94
|
+
columns: 'repeat(4, 1fr)'
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
lazyLoad: true,
|
|
99
|
+
columns: 'auto 32px auto',
|
|
100
|
+
rows: 'auto 32px auto',
|
|
101
|
+
templateAreas: `"endStart blockStart startEnd"
|
|
102
|
+
"inlineStart content inlineEnd"
|
|
103
|
+
"startStart blockEnd endEnd"`
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
childExtend: ButtonInDropdown,
|
|
108
|
+
|
|
109
|
+
$setStateCollection: (element) => {
|
|
110
|
+
const { property } = getStateTree(element)
|
|
111
|
+
return keysOf(property)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { WiderButton, DropdownParent, Icon } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
import { SPACING_BUTTONS } from './props'
|
|
6
|
+
import dropdown from './dropdown'
|
|
7
|
+
|
|
8
|
+
export const ChoosableButton = {
|
|
9
|
+
props: ({ key }) => ({
|
|
10
|
+
padding: 'Z',
|
|
11
|
+
icon: key,
|
|
12
|
+
theme: null,
|
|
13
|
+
transition: 'B defaultBezier',
|
|
14
|
+
transitionProperty: 'opacity, background, color',
|
|
15
|
+
'@dark': {
|
|
16
|
+
background: 'gray1',
|
|
17
|
+
color: 'gray5'
|
|
18
|
+
},
|
|
19
|
+
'@light': {
|
|
20
|
+
background: 'white .5',
|
|
21
|
+
color: 'gray7'
|
|
22
|
+
},
|
|
23
|
+
':hover': {
|
|
24
|
+
theme: 'quaternary',
|
|
25
|
+
'.active': { color: 'blue' }
|
|
26
|
+
},
|
|
27
|
+
'.active': {
|
|
28
|
+
theme: null
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const DotForPropButton = {
|
|
34
|
+
props: (el) => {
|
|
35
|
+
const { table, row, property: direction } = getStateTree(el)
|
|
36
|
+
const property = direction.parent
|
|
37
|
+
|
|
38
|
+
const propKey = diffPropValue(property.value, direction.value)
|
|
39
|
+
const active = table.props[propKey] === (row && row.key)
|
|
40
|
+
|
|
41
|
+
const isRadius = property.value === 'borderRadius'
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
round: '100%',
|
|
46
|
+
background: 'blue',
|
|
47
|
+
boxSize: 'W2',
|
|
48
|
+
lazyLoad: true,
|
|
49
|
+
|
|
50
|
+
hide: !active,
|
|
51
|
+
isRadius,
|
|
52
|
+
|
|
53
|
+
'!isRadius': {
|
|
54
|
+
':nth-child(1)': { left: '45%', top: 'W' },
|
|
55
|
+
':nth-child(2)': { right: 'W', top: '45%' },
|
|
56
|
+
':nth-child(3)': { left: '45%', bottom: 'W' },
|
|
57
|
+
':nth-child(4)': { left: 'W', top: '45%' }
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
'.isRadius': {
|
|
61
|
+
':nth-child(1)': { left: 'X2', top: 'X2' },
|
|
62
|
+
':nth-child(2)': { right: 'X2', top: 'X2' },
|
|
63
|
+
':nth-child(3)': { right: 'X2', bottom: 'X2' },
|
|
64
|
+
':nth-child(4)': { left: 'X2', bottom: 'X2' }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const DotForRowButton = {
|
|
71
|
+
extend: DotForPropButton,
|
|
72
|
+
props: ({ state }) => {
|
|
73
|
+
const direction = state
|
|
74
|
+
const property = direction.parent
|
|
75
|
+
const row = property.parent
|
|
76
|
+
const table = row.parent
|
|
77
|
+
|
|
78
|
+
const propKey = diffPropValue(property.value, direction.value)
|
|
79
|
+
const active = table.props[propKey] === row.key
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
hide: !active,
|
|
83
|
+
background: 'blue .65'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const SpacingButton = {
|
|
89
|
+
extend: [ChoosableButton, DropdownParent, WiderButton],
|
|
90
|
+
|
|
91
|
+
props: (element) => {
|
|
92
|
+
const { table, row, property } = getStateTree(element)
|
|
93
|
+
const propValue = property.value
|
|
94
|
+
const active = table.props[propValue] === (row && row.key)
|
|
95
|
+
return {
|
|
96
|
+
active,
|
|
97
|
+
icon: { name: property.value },
|
|
98
|
+
|
|
99
|
+
'.active': {
|
|
100
|
+
color: 'blue',
|
|
101
|
+
':hover': { color: 'blue' }
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
style: {
|
|
105
|
+
'&:hover, &:focus-visible': {
|
|
106
|
+
'& [tooltip]': {
|
|
107
|
+
transform: 'translate3d(-50%,0,0)'
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
dots: {
|
|
115
|
+
props: {
|
|
116
|
+
lazyLoad: true,
|
|
117
|
+
position: 'absolute',
|
|
118
|
+
inset: '0 0 0 0'
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
on: {
|
|
122
|
+
click: (ev, el) => {
|
|
123
|
+
const { table, row, property } = getStateTree(el)
|
|
124
|
+
const active = table.props[property.value] === row.key
|
|
125
|
+
if (active) {
|
|
126
|
+
delete table.props[property.value] && table.update()
|
|
127
|
+
} else {
|
|
128
|
+
const allKeys = Object.keys(table.props)
|
|
129
|
+
allKeys.filter(v => {
|
|
130
|
+
const splitInWords = property.value.split(/(?=[A-Z])/)
|
|
131
|
+
return v.includes(splitInWords[0]) && v.includes(splitInWords[1])
|
|
132
|
+
})
|
|
133
|
+
.forEach(v => delete table.props[v])
|
|
134
|
+
table.update({ props: { [property.value]: row.key } })
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
attr: { title: ({ state }) => state.value },
|
|
140
|
+
|
|
141
|
+
childExtend: DotForPropButton,
|
|
142
|
+
|
|
143
|
+
$setStateCollection: ({ state }) => {
|
|
144
|
+
const buttonsByProperty = keysOf(state)
|
|
145
|
+
return buttonsByProperty
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
dropdown
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const DotsInButton = SpacingButton.dots
|
|
153
|
+
|
|
154
|
+
export const SpacingRowButton = {
|
|
155
|
+
props: ({ state }) => {
|
|
156
|
+
const property = state
|
|
157
|
+
const row = property.parent
|
|
158
|
+
const table = row.parent
|
|
159
|
+
|
|
160
|
+
const propKey = property.value
|
|
161
|
+
|
|
162
|
+
const active = Object.keys(table.props).filter(prop => {
|
|
163
|
+
const hasProp = prop.toLowerCase().includes(propKey.toLowerCase())
|
|
164
|
+
const keyMathes = table.props[prop] === row.key
|
|
165
|
+
return hasProp && keyMathes
|
|
166
|
+
}).length
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
active: !!active,
|
|
170
|
+
position: 'relative',
|
|
171
|
+
round: 'Z',
|
|
172
|
+
display: 'flex',
|
|
173
|
+
|
|
174
|
+
icon: {
|
|
175
|
+
name: propKey,
|
|
176
|
+
opacity: '0',
|
|
177
|
+
color: 'gray5',
|
|
178
|
+
margin: 'auto'
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
'.active': {
|
|
182
|
+
boxShadow: '0, 0, 0, 3px, gray1, inset'
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
icon: {
|
|
188
|
+
extend: Icon,
|
|
189
|
+
props: ({ state }) => {
|
|
190
|
+
const property = state
|
|
191
|
+
const row = property.parent
|
|
192
|
+
const table = row.parent
|
|
193
|
+
|
|
194
|
+
const propKey = property.value
|
|
195
|
+
const middleActive = table.props[propKey] === row.key
|
|
196
|
+
|
|
197
|
+
const active = Object.keys(table.props).filter(prop => {
|
|
198
|
+
const hasProp = prop.toLowerCase().includes(propKey.toLowerCase())
|
|
199
|
+
const keyMathes = table.props[prop] === row.key
|
|
200
|
+
return hasProp && keyMathes
|
|
201
|
+
}).length
|
|
202
|
+
|
|
203
|
+
return {
|
|
204
|
+
active,
|
|
205
|
+
middleActive,
|
|
206
|
+
'.active': { opacity: '1' },
|
|
207
|
+
'.middleActive': { color: 'blue' }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
dots: {
|
|
213
|
+
childExtend: DotForRowButton,
|
|
214
|
+
$setStateCollection: DotsInButton.$setStateCollection
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export const getStateTree = element => {
|
|
219
|
+
const table = element.lookup('Page').state
|
|
220
|
+
const row = table.sequence[table.selectedKey]
|
|
221
|
+
const property = element.state
|
|
222
|
+
|
|
223
|
+
return { table, row, property }
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export const jointPropDirection = (parentKey, key) => {
|
|
227
|
+
return parentKey + key.slice(0, 1).toUpperCase() + key.slice(1)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export const diffPropValue = (parentKey, key) => {
|
|
231
|
+
if (parentKey.includes('borderWidth')) parentKey = 'border'
|
|
232
|
+
return jointPropDirection(parentKey, key)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export const diffPropPosition = (parentKey, key) => {
|
|
236
|
+
if (parentKey.includes('borderWidth')) return key.split('Width')[0]
|
|
237
|
+
return key
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export const diffIconTypes = (parentKey, key) => {
|
|
241
|
+
if (parentKey.includes('borderWidth')) key = key.split('Width')[0]
|
|
242
|
+
if (parentKey.includes('margin') || parentKey === 'borderWidth') parentKey = 'padding'
|
|
243
|
+
return jointPropDirection(parentKey, key)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export const keysOf = state => {
|
|
247
|
+
return Object.keys(SPACING_BUTTONS[state.value]).filter(v => v !== 'maxValue')
|
|
248
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export const SPACING_BUTTONS = {
|
|
4
|
+
margin: {
|
|
5
|
+
maxValue: 3000,
|
|
6
|
+
blockStart: {},
|
|
7
|
+
inlineEnd: {},
|
|
8
|
+
blockEnd: {},
|
|
9
|
+
inlineStart: {}
|
|
10
|
+
},
|
|
11
|
+
height: {
|
|
12
|
+
minWidth: {},
|
|
13
|
+
maxWidth: {}
|
|
14
|
+
},
|
|
15
|
+
width: {
|
|
16
|
+
minWidth: {},
|
|
17
|
+
maxWidth: {}
|
|
18
|
+
},
|
|
19
|
+
borderWidth: {
|
|
20
|
+
maxValue: 1280,
|
|
21
|
+
blockStartWidth: {},
|
|
22
|
+
inlineEndWidth: {},
|
|
23
|
+
blockEndWidth: {},
|
|
24
|
+
inlineStartWidth: {}
|
|
25
|
+
},
|
|
26
|
+
padding: {
|
|
27
|
+
maxValue: 3000,
|
|
28
|
+
blockStart: {},
|
|
29
|
+
inlineEnd: {},
|
|
30
|
+
blockEnd: {},
|
|
31
|
+
inlineStart: {}
|
|
32
|
+
},
|
|
33
|
+
gap: {
|
|
34
|
+
maxValue: 3000,
|
|
35
|
+
Horizontal: {},
|
|
36
|
+
Vertical: {}
|
|
37
|
+
},
|
|
38
|
+
borderRadius: {
|
|
39
|
+
maxValue: 1280,
|
|
40
|
+
endStart: {},
|
|
41
|
+
startEnd: {},
|
|
42
|
+
endEnd: {},
|
|
43
|
+
startStart: {}
|
|
44
|
+
}
|
|
45
|
+
}
|