@symbo.ls/preview 0.0.98 → 2.0.7

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.
Files changed (216) hide show
  1. package/README.md +19 -0
  2. package/app.webmanifest +4 -0
  3. package/index.html +14 -4
  4. package/netlify.toml +19 -0
  5. package/package.json +32 -32
  6. package/protect-pwd.js +65 -0
  7. package/src/animations.js +71 -0
  8. package/src/app.js +68 -30
  9. package/src/assets/dots.png +0 -0
  10. package/src/assets/dotsDark.png +0 -0
  11. package/src/config/index.js +31 -12
  12. package/src/config/theme.js +71 -1
  13. package/src/data/Symbols.sketch +0 -0
  14. package/src/data/_Symbols.sketch/document.json +1 -0
  15. package/src/data/_Symbols.sketch/fonts/6c9956fc8970ec3d8268c3f286afe19d954fc40b +0 -0
  16. package/src/data/_Symbols.sketch/fonts/750e9b005158d57108ebbcf288e2582f078d6735 +0 -0
  17. package/src/data/_Symbols.sketch/fonts/86c45cb69ad4ba2a8e6d0b81f20964b33f4eca6c +0 -0
  18. package/src/data/_Symbols.sketch/fonts/f97cec7aed309ec77b4fd3005d1a3e0d86c2a7b9 +0 -0
  19. package/src/data/_Symbols.sketch/images/0427bc225ee7dc33db78252defd5b2e4cd5b7467.png +0 -0
  20. package/src/data/_Symbols.sketch/images/0c4846cdd2f11ffb23c9ce063380fc934f7a11ea.png +0 -0
  21. package/src/data/_Symbols.sketch/images/55d3f5e93869fbd70e8dfbca1ce3dfa0cc9f2dbe.png +0 -0
  22. package/src/data/_Symbols.sketch/images/67ae1583a9d77eec7106f5016f48b5594a02b3f6.png +0 -0
  23. package/src/data/_Symbols.sketch/images/7152b3ea22388d53052d0212995a1805527ea862.png +0 -0
  24. package/src/data/_Symbols.sketch/images/72f1896a8462385fd596bc35f240382ba15814fc.png +0 -0
  25. package/src/data/_Symbols.sketch/images/73e4245b1f867343001657193ff2318c9cf2ef53.png +0 -0
  26. package/src/data/_Symbols.sketch/images/7b89dae77676fb4cfd072e0830cff9c27afd11c6.png +0 -0
  27. package/src/data/_Symbols.sketch/images/811e2b516575d3b4e7709dfef6369bce7dae0a26.png +0 -0
  28. package/src/data/_Symbols.sketch/images/82d006789579f2ee1fa45c9116f7cd7dd1bcbe37.png +0 -0
  29. package/src/data/_Symbols.sketch/images/8a896270aa4da8e2401d0ea76e46dc9b9125e59a.png +0 -0
  30. package/src/data/_Symbols.sketch/images/966688c4a579283836f15ab69c8b76e11b236ff5.png +0 -0
  31. package/src/data/_Symbols.sketch/images/b903a498e1d438e8bb12de5422f732c717b79eff.png +0 -0
  32. package/src/data/_Symbols.sketch/images/b9f3cae81a855e21ae75185dcb6ae6551c5447f1.png +0 -0
  33. package/src/data/_Symbols.sketch/images/cd0f908410abf4cad7a4501539eb0711c41a182f.png +0 -0
  34. package/src/data/_Symbols.sketch/images/d54f15f130ba4f1d4ad56f03c01ac06fe0ab4f56.png +0 -0
  35. package/src/data/_Symbols.sketch/images/df5a20029363f95abc58b2c8972e1417d84c8aa7.png +0 -0
  36. package/src/data/_Symbols.sketch/images/e889546970c931244400c2f70412c39123029cb3.png +0 -0
  37. package/src/data/_Symbols.sketch/images/f420a7a2beb15bee5d2ecbba8f296c6d4b22dfa3.png +0 -0
  38. package/src/data/_Symbols.sketch/meta.json +1 -0
  39. package/src/data/_Symbols.sketch/pages/31D11772-FB33-42EC-A3CC-79F63922E04D.json +1 -0
  40. package/src/data/_Symbols.sketch/pages/35BD91AD-F0ED-4002-891D-F1B3250E88C1.json +1 -0
  41. package/src/data/_Symbols.sketch/pages/4831AF31-ECB8-4DA6-B4D0-C1095D42146C.json +1 -0
  42. package/src/data/_Symbols.sketch/pages/6FCC0155-B3F4-4792-892E-523D45315AFD.json +1 -0
  43. package/src/data/_Symbols.sketch/pages/7996D5DD-C5B2-4EE7-9DE8-2C05E2ACA9F3.json +1 -0
  44. package/src/data/_Symbols.sketch/pages/B314C0F3-0038-473F-A127-536AF28E5272.json +1 -0
  45. package/src/data/_Symbols.sketch/pages/B6798E64-F7E9-40F5-9BD0-88A548478438.json +1 -0
  46. package/src/data/_Symbols.sketch/pages/B9B28DF3-EDC2-4D5B-A412-12B3B2E7DE58.json +1 -0
  47. package/src/data/_Symbols.sketch/pages/CA6E47E4-DAF7-4D1D-8DDC-D5A60508D9A0.json +1 -0
  48. package/src/data/_Symbols.sketch/pages/D6F5EB10-9D31-47AC-9077-1CE8CB2C2448.json +1 -0
  49. package/src/data/_Symbols.sketch/previews/preview.png +0 -0
  50. package/src/data/_Symbols.sketch/user.json +1 -0
  51. package/src/data/categories.js +44 -0
  52. package/src/data/components/button-archived/index.js +63 -0
  53. package/src/data/components/button-archived/style.js +5 -0
  54. package/src/data/components/button-circle/index.js +54 -0
  55. package/src/data/components/button-contacts/index.js +56 -0
  56. package/src/data/components/button-contacts/style.js +13 -0
  57. package/src/data/components/button-download/index.js +63 -0
  58. package/src/data/components/button-pro/index.js +98 -0
  59. package/src/data/components/button-pro/style.js +19 -0
  60. package/src/data/components/button-theme-switcher/index.js +104 -0
  61. package/src/data/components/button-theme-switcher/style.js +16 -0
  62. package/src/data/components/button-user/index.js +82 -0
  63. package/src/data/components/button-user/style.js +25 -0
  64. package/src/data/components/datepicker/index.js +40 -0
  65. package/src/data/components/datepicker/style.js +4 -0
  66. package/src/data/components/dropdown-list/index.js +56 -0
  67. package/src/data/components/field/index.js +40 -0
  68. package/src/data/components/index.js +34 -0
  69. package/src/data/components/label/index.js +40 -0
  70. package/src/data/components/notification/index.js +55 -0
  71. package/src/data/components/notification/style.js +20 -0
  72. package/src/data/components/pills/index.js +37 -0
  73. package/src/data/components/tooltip/index.js +38 -0
  74. package/src/data/index.js +3 -0
  75. package/src/data/library/button-circle/index.js +52 -0
  76. package/src/data/library/button-join/index.js +61 -0
  77. package/src/data/library/family-bundle/index.js +99 -0
  78. package/src/data/library/family-bundle/style.js +27 -0
  79. package/src/data/library/index.js +15 -0
  80. package/src/data/library/join-class/index.js +45 -0
  81. package/src/data/library/parent-mode/index.js +69 -0
  82. package/src/data/library/parent-mode/style.js +25 -0
  83. package/src/index.html +57 -0
  84. package/src/index.js +7 -0
  85. package/src/pages/Account/index.js +147 -17
  86. package/src/pages/Account/{__/setUpProject.js → setUpProject.js} +10 -10
  87. package/src/pages/Color/colors.js +58 -0
  88. package/src/pages/Color/documentThemes.js +101 -0
  89. package/src/pages/Color/index.js +10 -7
  90. package/src/pages/Color/style.js +7 -0
  91. package/src/pages/Color/themes.js +117 -23
  92. package/src/pages/ColorEditor/colorTone.js +163 -0
  93. package/src/pages/{Theme → ColorEditor}/friendTheme.js +3 -3
  94. package/src/pages/ColorEditor/index.js +178 -0
  95. package/src/pages/{Theme → ColorEditor}/interactivity.js +7 -6
  96. package/src/pages/{Theme → ColorEditor}/style.js +12 -1
  97. package/src/pages/{Theme → ColorEditor}/themingTools.js +12 -12
  98. package/src/pages/Editor/index.js +9 -7
  99. package/src/pages/Editor/layers.js +14 -14
  100. package/src/pages/Editor/scene.js +9 -7
  101. package/src/pages/Editor/tools.js +22 -22
  102. package/{.legacy → src/pages/Export}/_tools_old.js +6 -7
  103. package/src/pages/Export/const.js +4 -3
  104. package/src/pages/Export/description.js +87 -58
  105. package/src/pages/Export/header.js +37 -0
  106. package/src/pages/Export/index.js +39 -48
  107. package/src/pages/Export/scene.js +61 -98
  108. package/src/pages/Export/state.js +5 -11
  109. package/src/pages/Export/style.js +28 -0
  110. package/src/pages/Export/tools.js +86 -41
  111. package/src/pages/Icons/index.js +69 -73
  112. package/src/pages/Icons/style.js +18 -0
  113. package/src/pages/Library/index.js +47 -24
  114. package/src/pages/Library/style.js +43 -0
  115. package/src/pages/PageProto.js +26 -0
  116. package/src/pages/Shapes/index.js +204 -54
  117. package/src/pages/Shapes/style.js +28 -0
  118. package/src/pages/Spaces/boxModel.js +3 -0
  119. package/src/pages/Spaces/index.js +47 -23
  120. package/{.legacy → src/pages/Spaces}/preview.js +14 -14
  121. package/src/pages/Spaces/sequence.js +1 -30
  122. package/src/pages/Spaces/state.js +14 -12
  123. package/{.legacy → src/pages/Spaces}/style.js +3 -0
  124. package/src/pages/Typography/docFonts.js +128 -0
  125. package/src/pages/Typography/docStyles.js +97 -0
  126. package/src/pages/Typography/index.js +36 -28
  127. package/src/pages/Typography/shared.js +3 -2
  128. package/src/pages/Typography/state.js +8 -9
  129. package/src/pages/Typography/style.js +11 -0
  130. package/src/pages/Typography/typeScale.js +82 -63
  131. package/src/pages/index.js +23 -15
  132. package/src/protect.js +114 -0
  133. package/src/state.js +3 -0
  134. package/src/style.js +12 -15
  135. package/src/test.js +30 -0
  136. package/svgSprite.config.js +1 -2
  137. package/test/index.test.js +5 -0
  138. package/.legacy/index copy.js +0 -45
  139. package/.vscode/extensions.json +0 -5
  140. package/index.js +0 -44
  141. package/src/assets/dark.png +0 -0
  142. package/src/assets/mask1.png +0 -0
  143. package/src/assets/mask2.png +0 -0
  144. package/src/assets/shapes.png +0 -0
  145. package/src/assets/space.png +0 -0
  146. package/src/assets/type.png +0 -0
  147. package/src/components/Aside.js +0 -101
  148. package/src/components/Banner.js +0 -58
  149. package/src/components/ColorText.js +0 -29
  150. package/src/components/ColorsPalette.js +0 -69
  151. package/src/components/ColumnParagrphs.js +0 -23
  152. package/src/components/ContinueButton.js +0 -14
  153. package/src/components/DesignComponent.js +0 -80
  154. package/src/components/FontText.js +0 -193
  155. package/src/components/Header.js +0 -50
  156. package/src/components/HeaderHeading.js +0 -23
  157. package/src/components/IconsGroup.js +0 -60
  158. package/src/components/Page.js +0 -135
  159. package/src/components/ResponsivePreview.js +0 -44
  160. package/src/components/Route.js +0 -1
  161. package/src/components/ShapePreview.js +0 -63
  162. package/src/components/ShapeSet.js +0 -85
  163. package/src/components/SlidersWithResponsive.js +0 -23
  164. package/src/components/SpacingButton/actionButtons.js +0 -41
  165. package/src/components/SpacingButton/dropdown.js +0 -114
  166. package/src/components/SpacingButton/index.js +0 -248
  167. package/src/components/SpacingButton/props.js +0 -45
  168. package/src/components/SpacingPreview.js +0 -154
  169. package/src/components/SpacingTable.js +0 -210
  170. package/src/components/ThemeButtons.js +0 -42
  171. package/src/components/UploadImage.js +0 -61
  172. package/src/components/Widget.js +0 -1
  173. package/src/components/index.js +0 -25
  174. package/src/pages/Account/__/index.js +0 -241
  175. package/src/pages/Color/globalThemes.js +0 -30
  176. package/src/pages/Color/palette.js +0 -35
  177. package/src/pages/Components/grid.js +0 -99
  178. package/src/pages/Components/index.js +0 -37
  179. package/src/pages/Components/sidebar.js +0 -28
  180. package/src/pages/Components/style.js +0 -16
  181. package/src/pages/DesignSystem/Dashboard/banners.js +0 -38
  182. package/src/pages/DesignSystem/Dashboard/designElements.js +0 -124
  183. package/src/pages/DesignSystem/Dashboard/index.js +0 -22
  184. package/src/pages/DesignSystem/Dashboard/quickstart.js +0 -86
  185. package/src/pages/DesignSystem/Dashboard/state.js +0 -118
  186. package/src/pages/DesignSystem/Dashboard/summary.js +0 -40
  187. package/src/pages/DesignSystem/index.js +0 -187
  188. package/src/pages/Export/gist.js +0 -23
  189. package/src/pages/Fonts/fontFaces.js +0 -50
  190. package/src/pages/Fonts/fontFamilies.js +0 -47
  191. package/src/pages/Fonts/index.js +0 -15
  192. package/src/pages/Fonts/state.js +0 -5
  193. package/src/pages/Init/ChooseEnvironment.js +0 -104
  194. package/src/pages/Init/CreateDocumentTheme.js +0 -166
  195. package/src/pages/Init/CreatePalette.js +0 -72
  196. package/src/pages/Init/FontText.js +0 -23
  197. package/src/pages/Init/Personalize/fields.js +0 -109
  198. package/src/pages/Init/Personalize/icon.js +0 -42
  199. package/src/pages/Init/Personalize/index.js +0 -37
  200. package/src/pages/Init/index.js +0 -36
  201. package/src/pages/Library/disabled.js +0 -38
  202. package/src/pages/MediaQuery/index.js +0 -46
  203. package/src/pages/MediaQuery/lists.js +0 -285
  204. package/src/pages/MediaQuery/state.js +0 -150
  205. package/src/pages/MediaQuery/typeScale.js +0 -69
  206. package/src/pages/Shapes/shapeSet.js +0 -133
  207. package/src/pages/State/index.js +0 -86
  208. package/src/pages/Theme/index.js +0 -197
  209. package/src/pages/Theme/preview.js +0 -153
  210. package/src/pages/Typography/collection.js +0 -110
  211. package/src/pages/Typography/documentStyles.js +0 -125
  212. package/src/pages/Typography/rangeButtons.js +0 -58
  213. package/src/pages/Typography/stylesHelpers.js +0 -30
  214. /package/{.legacy/boxModel.js → src/data/favorites.js} +0 -0
  215. /package/{.legacy/sequence.js → src/data/filters.js} +0 -0
  216. /package/src/pages/{Theme → ColorEditor}/ntc.js +0 -0
@@ -1,40 +1,55 @@
1
1
  'use strict'
2
2
 
3
- import DOM from 'domql'
4
- import { transformEmotionClass, transformEmotionStyle } from 'domql/packages/emotion'
5
- import { createEmotion } from '@symbo.ls/create-emotion'
6
- import { updateReset } from '@symbo.ls/init'
7
- import { isString } from '@domql/utils'
3
+ import { Text, TYPOGRAPHY, returnSubThemeOrDefault, Scene } from '@symbo.ls/all'
8
4
 
9
- import { getActiveConfig, activateConfig } from '@symbo.ls/scratch'
10
- import { init, Box, Scene } from '@symbo.ls/components'
5
+ import { COMPONENT_ROUTES } from './const'
11
6
 
12
- import * as components from '../../components'
13
-
14
- const emCache = {}
7
+ const BREAKPOINTS = {
8
+ mobile: '375px',
9
+ tabletPortrait: '728px',
10
+ tabletLandscape: '1024px',
11
+ small: '1440px',
12
+ big: '1920px',
13
+ unset: '100%'
14
+ }
15
15
 
16
16
  export default {
17
- extend: Scene,
17
+ proto: Scene,
18
+
19
+ style: {
20
+ background: 'rgba(255, 255, 255, .06)',
21
+ maxWidth: '100%',
22
+ marginLeft: 'auto',
23
+ marginRight: 'auto',
24
+ transitionDuration: '225ms',
25
+ transitionEasing: 'cubic-bezier(.29,.67,.51,.97)',
26
+ transitionProperty: 'max-width, background'
27
+ },
18
28
 
19
- props: (el, s) => {
20
- const CONFIG = getActiveConfig()
21
- const { BREAKPOINTS } = CONFIG
22
- const previewSize = BREAKPOINTS[s.previewSize]
23
- return {
24
- width: '100%',
25
- maxWidth: previewSize ? previewSize + 'px' : '100%',
26
- margin: '- auto'
27
- }
29
+ class: {
30
+ s: (el, s) => ({
31
+ maxWidth: BREAKPOINTS[s.previewSize]
32
+ })
28
33
  },
29
34
 
30
35
  scene: {
31
- props: {
32
- padding: 'B 0',
36
+ style: {
37
+ padding: '3em 0',
33
38
  maxHeight: '40em',
34
39
  minHeight: '65vh'
35
40
  },
36
41
 
42
+ define: { routes: param => param },
43
+ routes: COMPONENT_ROUTES,
44
+
37
45
  class: {
46
+ a: {
47
+ '> *': {
48
+ transitionDuration: '225ms',
49
+ transitionTimingFunction: 'cubic-bezier(.29,.67,.51,.97)',
50
+ transitionProperty: 'transform'
51
+ }
52
+ },
38
53
  z: (el, s) => ({
39
54
  '> *': {
40
55
  transform: `scale(${parseFloat(s.zoomLevel, 2)})`
@@ -42,87 +57,35 @@ export default {
42
57
  })
43
58
  },
44
59
 
45
- content: {
46
- props: {
47
- transition: 'all, B, defaultBezier',
48
- style: {
49
- '*': { transition: 'all 255ms cubic-bezier(.29,.67,.51,.97)' }
50
- }
51
- },
52
-
53
- comp: (el, s) => {
54
- if (s.live) {
55
- const SYSTEM = s.__system
56
- const styleNode = document.createElement('head')
57
- const emotion = createEmotion('client', styleNode)
58
- emCache['client'] = emotion
59
-
60
- const emotionStyle = transformEmotionStyle(emotion, true)
61
- const emotionClass = transformEmotionClass(emotion, true)
62
-
63
- const newDom = DOM.create({
64
- tag: 'shadow',
65
- state: s.state
66
- }, el.parent.node, 'comp', {
67
- extend: [Box],
68
- define: { style: emotionStyle, class: emotionClass },
69
- components,
70
- context: { SYSTEM }
71
- })
72
-
73
- newDom.node.appendChild(styleNode)
74
-
75
- init(SYSTEM, null, { emotion, initDOMQLDefine: false, newConfig: 'client' })
76
- activateConfig('client')
77
-
78
- newDom.set({
79
- tag: 'fragment',
80
- [s.key]: {
81
- extend: isString(s.component) ? document.eval(s.component) : s.component,
82
- props: { inheritSpacingRatio: true }
83
- },
84
- on: {
85
- render: (el) => {
86
- // const appKey = el.__root.state.appKey && el.__root.state.appKey.split('.')[0]
87
- }
60
+ content: (el, s) => {
61
+ const props = el.lookup('content').props
62
+ return {
63
+ proto: [props.component, Text],
64
+ props: (el, s) => {
65
+ const { sequence } = TYPOGRAPHY
66
+ const activeSet = Object.keys(sequence).reverse()[s.currentFontSizeIndex]
67
+ const theme = returnSubThemeOrDefault(s.theme, s.sceneTheme)
68
+
69
+ return {
70
+ size: sequence[activeSet].key,
71
+ spacingRatio: s.spacingRatio,
72
+ theme
73
+ }
74
+ },
75
+ class: {
76
+ sceneTransition: {
77
+ '&, & *': {
78
+ transition: 'all 225ms cubic-bezier(.29,.67,.51,.97)'
88
79
  }
89
- })
90
-
91
- activateConfig(0)
92
- return newDom
93
- }
94
-
95
- return {
96
- extend: {
97
- extend: isString(s.component) ? document.eval(s.component) : s.component
98
- },
99
- props: { inheritSpacingRatio: true }
100
- }
101
- },
102
-
103
- on: {
104
- initUpdate: (el, s) => {
105
- if (s.live) {
106
- activateConfig('client')
107
- updateReset({ emotion: emCache['client'] })
108
- } else {
109
- el.comp.setProps({
110
- base: s.base,
111
- fontSize: s.base + 'px',
112
- spacingRatio: s.ratio,
113
- direction: s.direction
114
- }, { preventUpdate: true })
115
- updateReset()
116
80
  }
117
- activateConfig(0)
118
81
  }
119
82
  }
120
- }
121
- },
83
+ },
122
84
 
123
- on: {
124
- update: (el, s) => {
125
- el.__root.node.scrollTo({ top: 0, behavior: 'smooth' })
85
+ on: {
86
+ render: (el, s) => {
87
+ // el.__root.state.update({ activePage: el.props.title })
88
+ }
126
89
  }
127
90
  }
128
91
  }
@@ -1,6 +1,7 @@
1
1
  'use strict'
2
2
 
3
- import { SPACING, TYPOGRAPHY } from '@symbo.ls/scratch'
3
+ import { SPACING } from '@symbo.ls/all'
4
+ import { TYPOGRAPHY_SEQUENCE } from './const'
4
5
 
5
6
  export default {
6
7
  descriptionTheme: 'dark',
@@ -8,14 +9,7 @@ export default {
8
9
  sceneTheme: 'dark',
9
10
  theme: '',
10
11
  zoomLevel: 1,
11
- currentFontSizeIndex: 3,
12
-
13
- base: TYPOGRAPHY.base,
14
- ratio: SPACING.ratio,
15
- range: [-1, +4],
16
- scales: {},
17
- sequence: {},
18
- vars: {},
19
- type: 'type-scale',
20
- sampleText: 'Today is a big day for our tribe. The year ends.'
12
+ sequence: TYPOGRAPHY_SEQUENCE,
13
+ spacingRatio: SPACING.ratio,
14
+ currentFontSizeIndex: 3
21
15
  }
@@ -0,0 +1,28 @@
1
+ 'use strict'
2
+
3
+ export const styleArticle = {
4
+ caption: {
5
+ // textTransform: 'capitalize',
6
+ opacity: '.35'
7
+ },
8
+
9
+ p: {
10
+ maxWidth: `${470 / 14}em`,
11
+ opacity: '.75',
12
+ lineHeight: '20px'
13
+ },
14
+
15
+ code: {
16
+ overflow: 'hidden'
17
+ }
18
+ }
19
+
20
+ export const styleHeader = {
21
+ justifyContent: 'space-between',
22
+ alignItems: 'center'
23
+ }
24
+
25
+ export default {
26
+ display: 'flex',
27
+ flexDirection: 'column'
28
+ }
@@ -1,52 +1,97 @@
1
1
  'use strict'
2
2
 
3
- import {
4
- Flex,
5
- SequenceSliders,
6
- ClickableItem,
7
- SquareButton
8
- } from '@symbo.ls/components'
3
+ import { isArray } from 'domql-preview/src/utils'
4
+ import { Flex, Block, SEQUENCE, ThemeSwitcher, SliderToolItem } from '@symbo.ls/all'
9
5
 
10
- export default {
11
- props: {
12
- padding: 'Z2 0 0',
13
- flexAlign: 'center space-between'
14
- },
6
+ export const closestNumber = (number, arr) => {
7
+ return (isArray(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
8
+ return (Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev)
9
+ })
10
+ }
15
11
 
16
- tools: {
17
- extend: Flex,
18
- props: { gap: 'B1' },
19
- // theme: { extend: ThemeSwitcher },
12
+ export const FontSizeTool = {
13
+ proto: SliderToolItem,
14
+ props: (el, s) => ({
15
+ type: 'fontSize',
16
+ icon: 'fontSize',
20
17
 
21
- sliders: {
22
- extend: SequenceSliders,
23
- childExtend: { title: null }
24
- }
25
- },
18
+ value: s.sequence[s.currentFontSizeIndex],
19
+ min: s.sequence[0],
20
+ max: s.sequence[Object.keys(s.sequence).length - 1],
26
21
 
27
- responsive: {
28
- extend: Flex,
29
- props: { gap: 'A2' },
30
-
31
- direction: {
32
- extend: [ClickableItem, SquareButton],
33
- props: {
34
- icon: 'languageDirection'
35
- },
36
- on: {
37
- click: (ev, el, s) => {
38
- s.update({
39
- direction: s.direction === 'rtl' ? 'ltr' : 'rtl'
40
- })
41
- }
42
- }
22
+ minusClick: (ev, el, s) => {
23
+ const { currentFontSizeIndex } = s
24
+ const val = currentFontSizeIndex - 1
25
+ if (val < 0) return
26
+ // el.parent.range.node.value = val
27
+ s.update({ currentFontSizeIndex: val })
28
+ },
29
+ input: (ev, el, s) => {
30
+ const { sequence } = s
31
+ const value = el.node.value
32
+ const findMatch = closestNumber(value, s.sequence)
33
+ const seq = isArray(sequence) ? sequence : Object.values(sequence)
34
+ s.update({ currentFontSizeIndex: seq.indexOf(findMatch) })
43
35
  },
36
+ plusClick: (ev, el, s) => {
37
+ const { currentFontSizeIndex } = s
38
+ const val = currentFontSizeIndex + 1
39
+ if (val + 1 > Object.keys(s.sequence).length) return
40
+ // el.parent.range.node.value = val
41
+ s.update({ currentFontSizeIndex: currentFontSizeIndex + 1 })
42
+ }
43
+ })
44
+ }
44
45
 
45
- VerticalLine: {
46
- margin: 'auto 0',
47
- height: 'A2'
46
+ export const SpacingTool = {
47
+ proto: SliderToolItem,
48
+ if: (el) => el.lookup('content').props.defaultProps && el.lookup('content').props.defaultProps.spacingRatio,
49
+ props: (el, s) => ({
50
+ type: 'spacing',
51
+ icon: 'spaces',
52
+ step: '0.001',
53
+
54
+ value: s.spacingRatio,
55
+ min: SEQUENCE['minor-second'],
56
+ max: SEQUENCE['double-octave'],
57
+
58
+ minusClick: (ev, el, s) => {
59
+ const { spacingRatio } = s
60
+ const values = Object.values(SEQUENCE)
61
+ const activeKey = values.indexOf(spacingRatio) // keys.find(key => SEQUENCE[key] === spacingRatio)
62
+ s.update({ spacingRatio: values[activeKey - 1] })
63
+ },
64
+ input: (ev, el, s) => {
65
+ const value = el.node.value
66
+ const sequenceValues = Object.values(SEQUENCE)
67
+ const findMatch = closestNumber(value, sequenceValues)
68
+ s.update({ spacingRatio: findMatch })
48
69
  },
70
+ plusClick: (ev, el, s) => {
71
+ const { spacingRatio } = s
72
+ const values = Object.values(SEQUENCE)
73
+ const activeKey = values.indexOf(spacingRatio) // keys.find(key => SEQUENCE[key] === spacingRatio)
74
+ s.update({ spacingRatio: values[activeKey + 1] })
75
+ }
76
+ })
77
+ }
49
78
 
50
- ResponsiveToolBar: {}
51
- }
79
+ export default {
80
+ proto: [Flex, Block],
81
+ props: { gap: 'B1' },
82
+ childProto: {
83
+ if: ({ props }) => props.value,
84
+ style: {
85
+ position: 'relative',
86
+ zIndex: 999,
87
+ '&:hover > section': {
88
+ transform: 'translate3d(-50%,0,0)',
89
+ opacity: 1,
90
+ visibility: 'visible'
91
+ }
92
+ }
93
+ },
94
+ theme: { proto: ThemeSwitcher },
95
+ fontSize: { proto: FontSizeTool },
96
+ spacing: { proto: SpacingTool }
52
97
  }
@@ -1,92 +1,88 @@
1
1
  'use strict'
2
2
 
3
- import * as ACCESSIBILITY from '@symbo.ls/icons/src/accessibility'
4
- import * as BOXMODEL from '@symbo.ls/icons/src/boxModel'
5
- import * as DISPLAY from '@symbo.ls/icons/src/display'
6
- import * as INTERACTIVE from '@symbo.ls/icons/src/interactive'
7
- import * as LOGOS from '@symbo.ls/icons/src/logos'
8
- import * as SIGNS from '@symbo.ls/icons/src/signs'
9
- import * as STYLE from '@symbo.ls/icons/src/style'
10
- import * as KEYBOARD from '@symbo.ls/icons/src/keyboard'
11
- import * as SVG from '@symbo.ls/icons/src/svg'
12
- import * as TECH from '@symbo.ls/icons/src/tech'
13
- import * as TEXT from '@symbo.ls/icons/src/text'
3
+ import style, { styleIconsOption } from './style'
14
4
 
15
- import { IconsGroup } from '../../components'
5
+ import { IconText, Direction, ClickableItem, SectionHeader, sprite, Grid, Block } from '@symbo.ls/all'
6
+ import { PageProto } from '..'
16
7
 
17
- const ArraizeIconsCategory = (library, state) => {
18
- const list = Object.keys(library)
19
- if (state.searched) return list.filter(value => value.includes(state.searched))
20
- return list
8
+ const IconsOption = {
9
+ style: styleIconsOption,
10
+ header: { proto: SectionHeader },
11
+
12
+ iconSet: {
13
+ proto: Grid,
14
+ props: {
15
+ columns: 'repeat(12, 1fr)',
16
+ gap: 'Z'
17
+ }
18
+ }
21
19
  }
22
20
 
23
- const ICON_GROUPS = state => [{
24
- title: 'Document Icons',
25
- p: 'All ungrouped document icons',
26
- list: ArraizeIconsCategory(SVG, state)
27
- }, {
28
- title: 'Accessibility',
29
- list: ArraizeIconsCategory(ACCESSIBILITY, state)
30
- }, {
31
- title: 'Box Model',
32
- list: ArraizeIconsCategory(BOXMODEL, state)
33
- }, {
34
- title: 'Display',
35
- list: ArraizeIconsCategory(DISPLAY, state)
36
- }, {
37
- title: 'Interactive',
38
- list: ArraizeIconsCategory(INTERACTIVE, state)
39
- }, {
40
- title: 'Logos',
41
- list: ArraizeIconsCategory(LOGOS, state)
42
- }, {
43
- title: 'Signs',
44
- list: ArraizeIconsCategory(SIGNS, state)
45
- }, {
46
- title: 'Style',
47
- list: ArraizeIconsCategory(STYLE, state)
48
- }, {
49
- title: 'Keys',
50
- list: ArraizeIconsCategory(KEYBOARD, state)
51
- }, {
52
- title: 'Tech',
53
- list: ArraizeIconsCategory(TECH, state)
54
- }, {
55
- title: 'Text',
56
- list: ArraizeIconsCategory(TEXT, state)
57
- }]
21
+ const ICONS = Object.keys(sprite).map(key => ({ key: '_' + key }))
58
22
 
59
- export const Icons = {
60
- state: {},
23
+ const copyStringToClipboard = str => {
24
+ var el = document.createElement('textarea')
25
+ el.value = str
26
+ el.setAttribute('readonly', '')
27
+ el.style = { position: 'absolute', left: '-9999px' }
28
+ document.body.appendChild(el)
29
+ el.select()
30
+ document.execCommand('copy')
31
+ document.body.removeChild(el)
32
+ }
61
33
 
62
- SectionHeader: {
63
- extend: true,
34
+ const documentIcons = {
35
+ proto: IconsOption,
64
36
 
37
+ header: {
38
+ props: { padding: 'C 0 B1 0' },
65
39
  heading: {
66
- title: 'Icons',
67
- p: 'Unlike typography, component may has the properties of padding, gap, width and rest.'
40
+ caption: { props: { text: 'Document Icons' } },
41
+ p: { props: { text: 'All ungrouped document icons' } }
68
42
  },
43
+ nav: {
44
+ ...[
45
+ {
46
+ props: {
47
+ icon: 'upload',
48
+ href: '/icons/upload-icon'
49
+ }
50
+ },
51
+ { props: { icon: 'arrowAngleUp' } }
52
+ ]
53
+ }
54
+ },
69
55
 
70
- Search: {
71
- margin: '- -Z2 - -',
72
- placeholder: 'Search Icons'
56
+ iconSet: {
57
+ childProto: {
58
+ proto: [ClickableItem, IconText, Direction, Block],
59
+ props: el => ({
60
+ round: 'Z',
61
+ size: 'D',
62
+ aspectRatio: '1 / 1',
63
+ flexAlign: 'center center',
64
+ icon: el.key.slice(1)
65
+ }),
66
+ on: {
67
+ click: (event, element, state) => {
68
+ copyStringToClipboard(element.key.slice(1))
69
+ }
70
+ }
73
71
  },
74
72
 
75
- nav: null
76
- },
73
+ ...ICONS
74
+ }
75
+ }
77
76
 
78
- Line: {},
77
+ export default {
78
+ style,
79
79
 
80
- Flex: {
81
- props: {
82
- flow: 'column',
83
- gap: 'D1'
84
- },
80
+ proto: PageProto,
85
81
 
86
- childExtend: IconsGroup,
87
- $setStateCollection: (el, state) => {
88
- el.removeContent()
89
- return ICON_GROUPS(state)
90
- }
82
+ content: {
83
+ tag: 'section',
84
+
85
+ documentIcons
86
+ // navigationIcons
91
87
  }
92
88
  }
@@ -1 +1,19 @@
1
1
  'use strict'
2
+
3
+ export const styleIconsOption = {
4
+ '> div': {
5
+ '> div': {
6
+ '&:hover': {
7
+ background: 'rgba(255, 255, 255, .06)'
8
+ },
9
+ '&:hover > svg': {
10
+ color: 'white'
11
+ }
12
+ }
13
+ }
14
+ }
15
+
16
+ export default {
17
+ section: {
18
+ }
19
+ }
@@ -1,33 +1,56 @@
1
1
  'use strict'
2
2
 
3
- import { ComponentTemplate } from '@symbo.ls/components'
4
- import { DisabledPage, Page } from '../../components'
3
+ import style, { grid } from './style'
5
4
 
6
- export const Library = {
7
- extend: [DisabledPage, Page],
5
+ import { Block, SectionHeader, ComponentTemplate } from '@symbo.ls/all'
8
6
 
9
- SectionHeader: {
10
- title: 'My Symbols',
11
- p: 'This is the first collection of your components'
7
+ import { PageProto } from '..'
8
+
9
+ export default {
10
+ style,
11
+
12
+ proto: PageProto,
13
+
14
+ header: {
15
+ proto: [SectionHeader, Block],
16
+ props: { padding: 'C 0 0 0' },
17
+ heading: {},
18
+ nav: {
19
+ ...[
20
+ // { props: { icon: 'arrowAngleDown' } }
21
+ ]
22
+ }
12
23
  },
13
24
 
14
- Grid: {
15
- props: {
16
- flex: 1,
17
- templateColumns: 'repeat(12, 1fr)',
18
- autoFlow: 'dense',
19
- autoColumns: 'auto',
20
- autoRows: 'auto',
21
- justifyItems: 'stretch',
22
-
23
- margin: '- -Z2 B1',
24
- gap: 'A'
25
- },
26
-
27
- childExtend: ComponentTemplate,
28
- $setStateCollection: ({ state }) => {
29
- const { COMPONENTS } = state.__system
30
- return Object.values(COMPONENTS)
25
+ grid: {
26
+ class: { grid },
27
+ style: { flex: 1 },
28
+
29
+ content: (el, s) => {
30
+ if (!el.__root.state.LIBRARY) return
31
+ const { LIBRARY } = el.__root.state
32
+ const keys = Object.keys(LIBRARY)
33
+ const Symbols = keys.map(val => {
34
+ const v = LIBRARY[val]
35
+ return {
36
+ key: v.key,
37
+ title: v.title,
38
+ description: v.description,
39
+ category: v.category,
40
+ component: v.component,
41
+ interactivity: v.interactivity,
42
+ dataTypes: v.dataTypes,
43
+ code: v.code,
44
+ params: v.params,
45
+ settings: v.settings
46
+ }
47
+ })
48
+ return {
49
+ tag: 'fragment',
50
+ childProto: ComponentTemplate,
51
+
52
+ ...Symbols
53
+ }
31
54
  }
32
55
  }
33
56
  }