@symbo.ls/preview 0.0.9

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 (117) hide show
  1. package/.babelrc.js +5 -0
  2. package/.coveralls.yml +1 -0
  3. package/.eslintignore +1 -0
  4. package/.eslintrc.js +15 -0
  5. package/.prettierrc +4 -0
  6. package/.symbols/button-archived/index.js +63 -0
  7. package/.symbols/button-archived/style.js +5 -0
  8. package/.symbols/button-circle/index.js +62 -0
  9. package/.symbols/button-contacts/index.js +48 -0
  10. package/.symbols/button-contacts/style.js +13 -0
  11. package/.symbols/button-download/index.js +59 -0
  12. package/.symbols/button-pro/index.js +98 -0
  13. package/.symbols/button-pro/style.js +19 -0
  14. package/.symbols/button-theme-switcher/index.js +104 -0
  15. package/.symbols/button-theme-switcher/style.js +16 -0
  16. package/.symbols/button-user/index.js +82 -0
  17. package/.symbols/button-user/style.js +25 -0
  18. package/.symbols/categories.js +44 -0
  19. package/.symbols/datepicker/index.js +40 -0
  20. package/.symbols/datepicker/style.js +4 -0
  21. package/.symbols/dropdown-list/index.js +56 -0
  22. package/.symbols/field/index.js +40 -0
  23. package/.symbols/index.js +33 -0
  24. package/.symbols/label/index.js +40 -0
  25. package/.symbols/notification/index.js +49 -0
  26. package/.symbols/notification/style.js +5 -0
  27. package/.symbols/pills/index.js +37 -0
  28. package/.symbols/tooltip/index.js +38 -0
  29. package/.vscode/settings.json +3 -0
  30. package/README.md +19 -0
  31. package/app.webmanifest +4 -0
  32. package/index.html +22 -0
  33. package/package.json +48 -0
  34. package/protect-pwd.js +65 -0
  35. package/src/animations.js +71 -0
  36. package/src/app.js +79 -0
  37. package/src/assets/dots.png +0 -0
  38. package/src/assets/dotsDark.png +0 -0
  39. package/src/assets/fonts/FiraGO/FiraGO-Bold.woff2 +0 -0
  40. package/src/assets/fonts/FiraGO/FiraGO-Light.woff2 +0 -0
  41. package/src/assets/fonts/FiraGO/FiraGO-Medium.woff2 +0 -0
  42. package/src/assets/fonts/FiraGO/FiraGO-Regular.woff2 +0 -0
  43. package/src/assets/fonts/europa-bold-webfont.woff2 +0 -0
  44. package/src/assets/fonts/europa-bolditalic-webfont.woff2 +0 -0
  45. package/src/assets/fonts/europa-light-webfont.woff2 +0 -0
  46. package/src/assets/fonts/europa-lightitalic-webfont.woff2 +0 -0
  47. package/src/assets/fonts/europa-regular-webfont.woff2 +0 -0
  48. package/src/assets/fonts/europa-regularitalic-webfont.woff2 +0 -0
  49. package/src/assets/ovalCircle.svg +9 -0
  50. package/src/components/Header.js +21 -0
  51. package/src/components/index.js +3 -0
  52. package/src/config/color.js +8 -0
  53. package/src/config/font.js +0 -0
  54. package/src/config/index.js +19 -0
  55. package/src/config/theme.js +85 -0
  56. package/src/dev.html +19 -0
  57. package/src/index.js +33 -0
  58. package/src/pages/Account/index.js +241 -0
  59. package/src/pages/Account/setUpProject.js +142 -0
  60. package/src/pages/Color/colors.js +58 -0
  61. package/src/pages/Color/documentThemes.js +101 -0
  62. package/src/pages/Color/index.js +20 -0
  63. package/src/pages/Color/style.js +7 -0
  64. package/src/pages/Color/themes.js +131 -0
  65. package/src/pages/ColorEditor/colorTone.js +163 -0
  66. package/src/pages/ColorEditor/friendTheme.js +30 -0
  67. package/src/pages/ColorEditor/index.js +178 -0
  68. package/src/pages/ColorEditor/interactivity.js +116 -0
  69. package/src/pages/ColorEditor/ntc.js +1689 -0
  70. package/src/pages/ColorEditor/style.js +49 -0
  71. package/src/pages/ColorEditor/themingTools.js +107 -0
  72. package/src/pages/Components/grid.js +94 -0
  73. package/src/pages/Components/index.js +40 -0
  74. package/src/pages/Components/sidebar.js +23 -0
  75. package/src/pages/Components/style.js +16 -0
  76. package/src/pages/DesignSystem/index.js +106 -0
  77. package/src/pages/DesignSystem/style.js +1 -0
  78. package/src/pages/Editor/index.js +46 -0
  79. package/src/pages/Editor/layers.js +126 -0
  80. package/src/pages/Editor/scene.js +97 -0
  81. package/src/pages/Editor/style.js +13 -0
  82. package/src/pages/Editor/tools.js +360 -0
  83. package/src/pages/Export/_tools_old.js +49 -0
  84. package/src/pages/Export/const.js +18 -0
  85. package/src/pages/Export/description.js +56 -0
  86. package/src/pages/Export/index.js +74 -0
  87. package/src/pages/Export/scene.js +62 -0
  88. package/src/pages/Export/state.js +21 -0
  89. package/src/pages/Export/style.js +21 -0
  90. package/src/pages/Export/tools.js +14 -0
  91. package/src/pages/Icons/index.js +72 -0
  92. package/src/pages/Icons/style.js +1 -0
  93. package/src/pages/Library/index.js +32 -0
  94. package/src/pages/Library/style.js +36 -0
  95. package/src/pages/PageExtend.js +12 -0
  96. package/src/pages/Shapes/index.js +161 -0
  97. package/src/pages/Shapes/style.js +28 -0
  98. package/src/pages/Spaces/boxModel.js +3 -0
  99. package/src/pages/Spaces/index.js +58 -0
  100. package/src/pages/Spaces/preview.js +133 -0
  101. package/src/pages/Spaces/sequence.js +3 -0
  102. package/src/pages/Spaces/state.js +18 -0
  103. package/src/pages/Spaces/style.js +30 -0
  104. package/src/pages/Typography/docFonts.js +128 -0
  105. package/src/pages/Typography/docStyles.js +97 -0
  106. package/src/pages/Typography/index.js +52 -0
  107. package/src/pages/Typography/shared.js +10 -0
  108. package/src/pages/Typography/state.js +15 -0
  109. package/src/pages/Typography/style.js +11 -0
  110. package/src/pages/Typography/typeScale.js +104 -0
  111. package/src/pages/index.js +13 -0
  112. package/src/protect.js +114 -0
  113. package/src/state.js +7 -0
  114. package/src/style.js +7 -0
  115. package/src/test.js +30 -0
  116. package/svgSprite.config.js +7 -0
  117. package/test/index.test.js +5 -0
@@ -0,0 +1,40 @@
1
+ 'use strict'
2
+
3
+ import { CATEGORIES } from '../categories'
4
+
5
+ import { DatePicker } from '@symbo.ls/components'
6
+
7
+ import style from './style'
8
+
9
+ const key = 'datepicker'
10
+ const title = 'DatePicker'
11
+ const description = ''
12
+ const category = CATEGORIES[7]
13
+
14
+ const component = {
15
+ style,
16
+ extend: DatePicker
17
+ }
18
+
19
+ const code = `{}`
20
+
21
+ const defaultState = {}
22
+ const props = {}
23
+
24
+ const settings = {
25
+ gridOptions: { colspan: 7, rowspan: 5 }
26
+ }
27
+
28
+ export default {
29
+ key,
30
+ title,
31
+ description,
32
+ category,
33
+ component,
34
+ code,
35
+ defaultState,
36
+ props,
37
+ settings,
38
+ interactivity: ['click', 'choose'],
39
+ dataTypes: ['date']
40
+ }
@@ -0,0 +1,4 @@
1
+ 'use strict'
2
+
3
+ export default {
4
+ }
@@ -0,0 +1,56 @@
1
+ 'use strict'
2
+
3
+ import { CATEGORIES } from '../categories'
4
+
5
+ import { DropdownList } from '@symbo.ls/components'
6
+
7
+ const key = 'dropdown-list'
8
+ const title = 'Dropdown List'
9
+ const description = ''
10
+ const category = CATEGORIES[5]
11
+
12
+ const component = {
13
+ extend: DropdownList,
14
+ props: {
15
+ theme: 'quaternary', round: 'A'
16
+ },
17
+ // props: (el, s) => {
18
+ // return {
19
+ // round: 'Z',
20
+ // depth: '16',
21
+ // theme: s.sceneTheme === 'light' ? 'lightDark' : 'dark',
22
+ // rowTheme: s.sceneTheme === 'light' ? 'lightDark' : 'quaternary'
23
+ // }
24
+ // },
25
+
26
+ ...[
27
+ { span: { props: { text: 'Today' } } },
28
+ { span: { props: { text: 'Yesterday' } } },
29
+ { span: { props: { text: 'A week age' } } },
30
+ { span: { props: { text: 'A month ago' } } }
31
+ ]
32
+ }
33
+
34
+ const code = `{}`
35
+
36
+ const defaultState = {}
37
+ const props = {
38
+ theme: 'quaternary'
39
+ }
40
+ const settings = {
41
+ gridOptions: { colspan: 5, rowspan: 5 }
42
+ }
43
+
44
+ export default {
45
+ key,
46
+ title,
47
+ description,
48
+ category,
49
+ component,
50
+ code,
51
+ defaultState,
52
+ props,
53
+ settings,
54
+ interactivity: [],
55
+ dataTypes: []
56
+ }
@@ -0,0 +1,40 @@
1
+ 'use strict'
2
+
3
+ import { CATEGORIES } from '../categories'
4
+
5
+ import { Field } from '@symbo.ls/components'
6
+
7
+ const key = 'field'
8
+ const title = 'Field'
9
+ const description = ''
10
+ const category = CATEGORIES[2]
11
+
12
+ const component = {
13
+ extend: Field,
14
+ props: (el, s) => ({
15
+ theme: s.sceneTheme === 'light' ? 'lightDark' : 'quaternary'
16
+ })
17
+ }
18
+
19
+ const code = `{}`
20
+
21
+ const defaultState = {}
22
+ const props = {}
23
+
24
+ const settings = {
25
+ gridOptions: { colspan: 4, rowspan: 2 }
26
+ }
27
+
28
+ export default {
29
+ key,
30
+ title,
31
+ description,
32
+ category,
33
+ component,
34
+ code,
35
+ defaultState,
36
+ props,
37
+ settings,
38
+ interactivity: ['input'],
39
+ dataTypes: ['string']
40
+ }
@@ -0,0 +1,33 @@
1
+ 'use strict'
2
+
3
+ import circleButton from './button-circle'
4
+ import buttonContacts from './button-contacts'
5
+ import buttonDownload from './button-download'
6
+ import buttonPro from './button-pro'
7
+ import buttonArchived from './button-archived'
8
+ import buttonUser from './button-user'
9
+ import buttonThemeSwitcher from './button-theme-switcher'
10
+ import notification from './notification'
11
+ import dropdownList from './dropdown-list'
12
+ import label from './label'
13
+ import datepicker from './datepicker'
14
+ import field from './field'
15
+ import tooltip from './tooltip'
16
+ import pills from './pills'
17
+
18
+ export const LIBRARY = [
19
+ circleButton,
20
+ buttonDownload,
21
+ buttonPro,
22
+ buttonArchived,
23
+ buttonContacts,
24
+ buttonUser,
25
+ label,
26
+ buttonThemeSwitcher,
27
+ notification,
28
+ dropdownList,
29
+ datepicker,
30
+ field,
31
+ tooltip,
32
+ pills
33
+ ]
@@ -0,0 +1,40 @@
1
+ 'use strict'
2
+
3
+ import { CATEGORIES } from '../categories'
4
+
5
+ import { Label } from '@symbo.ls/components'
6
+
7
+ const key = 'label'
8
+ const title = 'Label'
9
+ const description = ''
10
+ const category = CATEGORIES[0]
11
+
12
+ const component = {
13
+ extend: Label,
14
+ props: {
15
+ theme: 'lightDark'
16
+ }
17
+ }
18
+
19
+ const code = `{}`
20
+
21
+ const defaultState = {}
22
+ const props = {}
23
+
24
+ const settings = {
25
+ gridOptions: { colspan: 3, rowspan: 2 }
26
+ }
27
+
28
+ export default {
29
+ key,
30
+ title,
31
+ description,
32
+ category,
33
+ component,
34
+ code,
35
+ defaultState,
36
+ props,
37
+ settings,
38
+ interactivity: [],
39
+ dataTypes: []
40
+ }
@@ -0,0 +1,49 @@
1
+ 'use strict'
2
+
3
+ import { CATEGORIES } from '../categories'
4
+
5
+ import style from './style'
6
+ import { Notification } from '@symbo.ls/components'
7
+
8
+ const key = 'notification'
9
+ const title = 'Notification'
10
+ const description = ''
11
+ const category = CATEGORIES[4]
12
+
13
+ const component = {
14
+ style,
15
+ extend: Notification,
16
+ props: {
17
+ theme: 'alert'
18
+ }
19
+ }
20
+
21
+ const code = `{
22
+ extend: Notification,
23
+ props: {
24
+ theme: 'alert'
25
+ }
26
+ }`
27
+
28
+ const defaultState = {}
29
+ const props = {
30
+ theme: 'alert'
31
+ }
32
+
33
+ const settings = {
34
+ gridOptions: { colspan: 4, rowspan: 2 }
35
+ }
36
+
37
+ export default {
38
+ key,
39
+ title,
40
+ description,
41
+ category,
42
+ component,
43
+ code,
44
+ defaultState,
45
+ props,
46
+ settings,
47
+ interactivity: [],
48
+ dataTypes: []
49
+ }
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ export default {
4
+ borderBottomLeftRadius: '.4em',
5
+ }
@@ -0,0 +1,37 @@
1
+ 'use strict'
2
+
3
+ import { CATEGORIES } from '../categories'
4
+
5
+ import { Pills } from '@symbo.ls/components'
6
+
7
+ const key = 'pills'
8
+ const title = 'Pills'
9
+ const description = ''
10
+ const category = CATEGORIES[CATEGORIES.length - 1]
11
+
12
+ const component = {
13
+ extend: Pills
14
+ }
15
+
16
+ const code = `{}`
17
+
18
+ const defaultState = {}
19
+ const props = {}
20
+
21
+ const settings = {
22
+ gridOptions: { colspan: 3, rowspan: 2 }
23
+ }
24
+
25
+ export default {
26
+ key,
27
+ title,
28
+ description,
29
+ category,
30
+ component,
31
+ code,
32
+ defaultState,
33
+ props,
34
+ settings,
35
+ interactivity: [],
36
+ dataTypes: []
37
+ }
@@ -0,0 +1,38 @@
1
+ 'use strict'
2
+
3
+ import { CATEGORIES } from '../categories'
4
+
5
+ import { Tooltip } from '@symbo.ls/components'
6
+
7
+ const key = 'tooltip'
8
+ const title = 'Tooltip'
9
+ const description = ''
10
+ const category = CATEGORIES[8]
11
+
12
+ const component = {
13
+ extend: Tooltip
14
+ }
15
+
16
+ const code = `{}`
17
+
18
+ const defaultState = {}
19
+ const props = {}
20
+
21
+ const settings = {
22
+ gridOptions: { colspan: 4, rowspan: 2 }
23
+ }
24
+
25
+ export default {
26
+ key,
27
+ title,
28
+ description,
29
+ category,
30
+ component,
31
+ code,
32
+ defaultState,
33
+
34
+ props,
35
+ settings,
36
+ interactivity: [],
37
+ dataTypes: []
38
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "standard.enable": true
3
+ }
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # Fucking editor!
2
+ Example dev setup (boilerplate) to use [DOMQL](https://github.com/rackai/domql). You can also check live editor [Playground](https://github.com/rackai/playground).
3
+
4
+ ### Setup
5
+
6
+ 1. Clone the repo
7
+ ```
8
+ git clone git@github.com:rackai/editor.git
9
+ ```
10
+
11
+ 2. Install scripts
12
+ ```
13
+ yarn
14
+ ```
15
+
16
+ 3. Run the project
17
+ ```
18
+ yarn start
19
+ ```
@@ -0,0 +1,4 @@
1
+ {
2
+ "display": "standalone",
3
+ "scope": "https://editor.symbols.app/"
4
+ }
package/index.html ADDED
@@ -0,0 +1,22 @@
1
+ <html background="#000">
2
+ <head>
3
+ <title>Symbols Editor</title>
4
+ <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
5
+ <meta name="apple-mobile-web-app-capable" content="yes">
6
+
7
+ <meta charset="UTF-8">
8
+
9
+ <meta name="author" content="SymbolsApp">
10
+ <meta name="keywords" content="UIkit, Design System, Platform, Javascript, CSS, Less, Sass, Component, React, Angular, Vue, Svelte, HTML, Haml, Jade, Bootstrap, Semantic UI, Material, ">
11
+ <meta name="description" content="Introducing a highly customizable UI kit to decorate your app from scratch. Our space shares all the tools and supplies to design desired components. ">
12
+
13
+ <meta name="apple-mobile-web-app-title" content="Symbols">
14
+ <meta name="apple-mobile-web-app-capable" content="yes">
15
+ <meta name="apple-mobile-web-app-status-bar-style" content="default">
16
+
17
+ <link rel="manifest" href="./app.webmanifest" crossorigin="use-credentials">
18
+ </head>
19
+ <body>
20
+ <script src="./protect-pwd.js"></script>
21
+ </body>
22
+ </html>
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@symbo.ls/preview",
3
+ "description": "",
4
+ "author": "",
5
+ "version": "0.0.9",
6
+ "repository": "https://github.com/rackai/editor",
7
+ "main": "src/index.js",
8
+ "scripts": {
9
+ "map:copy": "mkdir dist && find dist/ \\( -name \"*.map\" \\) -exec cp {} ./map.json \\;",
10
+ "link:all": "yarn link smbls domql css-in-props @symbo.ls/icons @symbo.ls/config @symbo.ls/components @symbo.ls/scratch @symbo.ls/playground @symbo.ls/utils @symbo.ls/init @symbo.ls/config-default @domql/router @domql/utils @domql/router",
11
+ "prestart": "rm -rf .cache dist",
12
+ "start": "parcel src/dev.html --port 1200 --no-cache",
13
+ "start:protected": "npm run prestart && parcel index.html",
14
+ "prebuild": "rm -rf dist",
15
+ "build": "parcel build index.html",
16
+ "build:protected": "parcel build index.html --no-source-maps --no-content-hash",
17
+ "reinstall": "rm -rf node_modules/@symbo.ls node_modules/@domql node_modules/domql node_modules/smbls dist yarn.lock .cache && yarn"
18
+ },
19
+ "targets": {
20
+ "main": {
21
+ "context": "browser",
22
+ "outputFormat": "commonjs",
23
+ "includeNodeModules": true
24
+ }
25
+ },
26
+ "dependencies": {
27
+ "@domql/router": "^2.3.1",
28
+ "@symbo.ls/components": "^0.2.5",
29
+ "@symbo.ls/config": "^1.0.33",
30
+ "@symbo.ls/icons": "^0.2.32",
31
+ "@symbo.ls/init": "^1.1.2",
32
+ "@symbo.ls/scratch": "^0.6.3",
33
+ "@symbo.ls/utils": "^0.0.3",
34
+ "domql": "^1.5.0"
35
+ },
36
+ "devDependencies": {
37
+ "@babel/core": "^7.11.5",
38
+ "@emotion/css": "^11.5.0",
39
+ "babel-eslint": "^10.0.3",
40
+ "eslint": "^6.1.0",
41
+ "parcel-bundler": "^1.12.4",
42
+ "parcel-plugin-svg-sprite": "^1.4.1",
43
+ "standard": "^13.1.0"
44
+ },
45
+ "standard": {
46
+ "parser": "babel-eslint"
47
+ }
48
+ }
package/protect-pwd.js ADDED
@@ -0,0 +1,65 @@
1
+ 'use strict'
2
+
3
+ import './src/config'
4
+
5
+ import DOM from 'domql'
6
+ import App from './src/app'
7
+ import { getCookie, setCookie } from 'domql/packages/cookie'
8
+
9
+ const KEY = '9EC6CB2A5122F61B0A5E4211B6C1F8E5F3708E0276DA2F23159AE7987EE74298'
10
+ const KEY2 = 'F6CC5B085B61387AC2C125BD1289137D02BC58A07AF9A766FA0DE45E0E5066F8'
11
+
12
+ async function sha256 (message) {
13
+ const msgBuffer = new TextEncoder('utf-8').encode(message)
14
+ const hashBuffer = await window.crypto.subtle.digest('SHA-256', msgBuffer)
15
+ const hashArray = Array.from(new Uint8Array(hashBuffer))
16
+ const hashHex = hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join('')
17
+ return hashHex
18
+ }
19
+
20
+ const protect = {
21
+ style: {
22
+ position: 'absolute',
23
+ left: '50%',
24
+ top: '50%',
25
+ width: '45%',
26
+ minWidth: 300,
27
+ transform: 'translate3d(-50%, -50%, 1px)',
28
+ fontSize: 18,
29
+ color: 'black',
30
+ background: 'white',
31
+ padding: 26
32
+ },
33
+
34
+ label: {
35
+ tag: 'label',
36
+ div: 'Password Protected',
37
+ input: {
38
+ tag: 'input',
39
+ attr: { type: 'password', autofocus: true },
40
+ style: {
41
+ padding: 10,
42
+ marginTop: 10,
43
+ width: '100%'
44
+ },
45
+ on: {
46
+ keyup: (event, element) => {
47
+ var { node } = element
48
+ var { value } = node
49
+ sha256(value).then(hash => {
50
+ var passph = hash.toUpperCase()
51
+ if (passph === KEY || passph === KEY2) {
52
+ setCookie('hash', passph, 3)
53
+ protect.remove()
54
+ DOM.create(App)
55
+ }
56
+ })
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+
63
+ const hash = getCookie('hash')
64
+ if (hash === KEY || hash === KEY2) DOM.create(App)
65
+ else DOM.create(protect)
@@ -0,0 +1,71 @@
1
+ 'use strict'
2
+
3
+ import { keyframes } from '@emotion/css'
4
+
5
+ export const isVisible = q => (q ? {
6
+ visibility: 'visible',
7
+ opacity: 1
8
+ } : {
9
+ visibility: 'hidden',
10
+ opacity: 0
11
+ })
12
+
13
+ export const transition = (t = 350) => ({
14
+ transition: `${t}ms`,
15
+ transitionProperties: 'opacity, visibility'
16
+ })
17
+
18
+ export const fadeIn = keyframes`
19
+ from {
20
+ opacity: 0;
21
+ }
22
+ to {
23
+ opacity: 1;
24
+ }
25
+ `
26
+
27
+ export const fadeInUp = keyframes`
28
+ from {
29
+ transform: translate3d(0,20px,0);
30
+ opacity: 0;
31
+ }
32
+ to {
33
+ transform: translate3d(0,0,0);
34
+ opacity: 1;
35
+ }
36
+ `
37
+
38
+ export const fadeInUpLong = keyframes`
39
+ from {
40
+ transform: translate3d(0,40px,0);
41
+ opacity: 0;
42
+ }
43
+ to {
44
+ transform: translate3d(0,0,0);
45
+ opacity: 1;
46
+ }
47
+ `
48
+
49
+ export const circleDown = keyframes`
50
+ from {
51
+ transform: translate3d(-50%, -60%, 0);
52
+ opacity: 0;
53
+ }
54
+ to {
55
+ transform: translate3d(-50%, -50%, 0);
56
+ opacity: 1;
57
+ }
58
+ `
59
+
60
+ export const animationSettings = {
61
+ name: fadeInUp,
62
+ duration: '950ms'
63
+ }
64
+
65
+ export const animateOnLoad = (condition, { name, duration, delay } = animationSettings) => (condition ? {
66
+ animationName: name || animationSettings.name,
67
+ animationDuration: duration || animationSettings.duration,
68
+ animationDelay: delay || animationSettings.delay,
69
+ animationTimingFunction: 'ease',
70
+ animationFillMode: 'both'
71
+ } : null)
package/src/app.js ADDED
@@ -0,0 +1,79 @@
1
+ 'use strict'
2
+
3
+ import './config'
4
+
5
+ import 'domql/packages/emotion'
6
+ import { router, lastLevel } from '@domql/router'
7
+
8
+ import { state } from './state'
9
+ import {
10
+ PageExtend,
11
+ Components,
12
+ DesignSystem,
13
+ Export,
14
+ Library
15
+ } from './pages'
16
+
17
+ const SUB_ROUTES = {}
18
+ Object.keys(DesignSystem.routes).map(route => {
19
+ SUB_ROUTES[route] = {
20
+ extend: DesignSystem,
21
+ sidebar: {},
22
+ main: {
23
+ extend: [DesignSystem.routes[route], PageExtend]
24
+ },
25
+ __filepath: 'pages/index.js'
26
+ }
27
+ })
28
+
29
+ const App = {
30
+ key: 'app',
31
+
32
+ state,
33
+ props: {
34
+ theme: 'document',
35
+ boxSize: '100% 100%',
36
+ position: 'absolute',
37
+ top: '0',
38
+ left: '0',
39
+ flexFlow: 'column',
40
+ flexAlign: 'center flex-start'
41
+ },
42
+
43
+ define: { routes: param => param },
44
+ routes: {
45
+ '/library': Library,
46
+ '/design-system': DesignSystem,
47
+ '/components': Components,
48
+ '/component': Export,
49
+ ...SUB_ROUTES
50
+ },
51
+
52
+ content: {
53
+ style: { position: 'relative' }
54
+ },
55
+
56
+ on: {
57
+ render: element => {
58
+ const { pathname, hash } = window.location
59
+ const url = pathname + hash
60
+ router(element, url, {})
61
+ },
62
+ scroll: (ev, el) => {
63
+ const { scrollTop } = el.node
64
+ const isFloating = scrollTop > 0
65
+ if (isFloating !== el.props.isFloating) {
66
+ el.props.isFloating = isFloating
67
+ // el._header.update()
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ window.onpopstate = e => {
74
+ const { pathname, hash } = window.location
75
+ const url = pathname + hash
76
+ router(App, url, {}, lastLevel, true)
77
+ }
78
+
79
+ export default App
Binary file
Binary file