@symbo.ls/preview 2.6.23 → 2.6.33
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/index.js +13 -5
- package/package.json +5 -4
- package/src/pages/Account/index.js +10 -9
- package/src/pages/Color/palette.js +1 -1
- package/src/pages/Color/themes.js +1 -1
- package/src/pages/Init/CreateDocumentTheme.js +1 -1
- package/src/pages/Init/index.js +1 -1
- package/src/pages/Spaces/index.js +1 -1
- package/src/pages/State/index.js +1 -1
- package/src/pages/Typography/collection.js +4 -0
- package/src/pages/Typography/documentStyles.js +2 -3
- package/src/pages/Typography/index.js +1 -1
- package/src/state.js +20 -0
package/index.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import '@symbo.ls/platform-init'
|
|
3
|
+
import { init, system } from '@symbo.ls/platform-init'
|
|
4
|
+
import { state } from '@symbo.ls/platform-state'
|
|
4
5
|
|
|
5
6
|
import DOM from 'domql'
|
|
6
7
|
import * as smbls from '@symbo.ls/components'
|
|
8
|
+
import * as components from './src/components'
|
|
7
9
|
|
|
8
10
|
import App from './src/app'
|
|
9
11
|
import { router, lastLevel } from '@domql/router'
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
const designSystem = init(system)
|
|
11
14
|
|
|
12
15
|
DOM.define({
|
|
13
16
|
routes: param => param,
|
|
@@ -19,7 +22,8 @@ DOM.define({
|
|
|
19
22
|
const app = DOM.create({
|
|
20
23
|
extend: App,
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
HeaderOfMember: { maxWidth: '100%' },
|
|
26
|
+
state,
|
|
23
27
|
|
|
24
28
|
on: {
|
|
25
29
|
render: (el, s) => {
|
|
@@ -29,10 +33,14 @@ const app = DOM.create({
|
|
|
29
33
|
},
|
|
30
34
|
|
|
31
35
|
update: (el, s, changes) => {
|
|
32
|
-
smbls.openModal(el
|
|
36
|
+
smbls.openModal(el, s)
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
|
-
}, undefined, 'app',
|
|
39
|
+
}, undefined, 'app', {
|
|
40
|
+
extend: [smbls.Box],
|
|
41
|
+
components: { ...smbls, ...components },
|
|
42
|
+
context: { system: designSystem }
|
|
43
|
+
})
|
|
36
44
|
|
|
37
45
|
window.onpopstate = e => {
|
|
38
46
|
const { pathname, hash } = window.location
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/preview",
|
|
3
3
|
"description": "",
|
|
4
|
-
"author": "",
|
|
5
|
-
"version": "2.6.
|
|
4
|
+
"author": "symbo.ls",
|
|
5
|
+
"version": "2.6.33",
|
|
6
6
|
"main": "src/app.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"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",
|
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
"@symbo.ls/icons": "latest",
|
|
29
29
|
"@symbo.ls/init": "latest",
|
|
30
30
|
"@symbo.ls/scratch": "latest",
|
|
31
|
+
"@symbo.ls/platform-init": "latest",
|
|
32
|
+
"@symbo.ls/platform-state": "latest",
|
|
31
33
|
"@symbo.ls/temp-db": "latest",
|
|
32
|
-
"@symbo.ls/utils": "latest"
|
|
33
|
-
"colorthief": "^2.3.2"
|
|
34
|
+
"@symbo.ls/utils": "latest"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@babel/core": "^7.11.5",
|
|
@@ -9,7 +9,7 @@ import { projectAccount } from './projectAccount'
|
|
|
9
9
|
|
|
10
10
|
const ProjectButton = {
|
|
11
11
|
extend: [SquareButton],
|
|
12
|
-
props: { theme: 'transparent' },
|
|
12
|
+
props: { theme: 'transparent' },
|
|
13
13
|
User: {
|
|
14
14
|
props: ({ state }) => ({
|
|
15
15
|
round: '100%',
|
|
@@ -23,7 +23,7 @@ const ProjectButton = {
|
|
|
23
23
|
const { projectId, username } = s.parse
|
|
24
24
|
fetchProject(el, s, {
|
|
25
25
|
username: s.name,
|
|
26
|
-
projectId: s.id
|
|
26
|
+
projectId: s.id
|
|
27
27
|
})
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -40,7 +40,7 @@ const sidebar = {
|
|
|
40
40
|
borderRight: 'gray2, solid',
|
|
41
41
|
borderWidth: '1px',
|
|
42
42
|
minWidth: 'D1',
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
childProps: {
|
|
45
45
|
flow: 'column',
|
|
46
46
|
gap: 'A2'
|
|
@@ -52,7 +52,7 @@ const sidebar = {
|
|
|
52
52
|
extend: Flex
|
|
53
53
|
},
|
|
54
54
|
|
|
55
|
-
Flex:
|
|
55
|
+
Flex: {
|
|
56
56
|
extend: Flex,
|
|
57
57
|
profile: {
|
|
58
58
|
extend: [IconButton],
|
|
@@ -74,17 +74,18 @@ const sidebar = {
|
|
|
74
74
|
$setStateCollection: ({ state }) => state.projects
|
|
75
75
|
},
|
|
76
76
|
|
|
77
|
-
add: {
|
|
77
|
+
add: {
|
|
78
78
|
extend: [IconButton, Link],
|
|
79
79
|
props: { icon: 'plus', href: '/init/create' }
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
|
|
81
|
+
},
|
|
82
|
+
|
|
83
83
|
meta: {
|
|
84
84
|
extend: Flex,
|
|
85
|
+
childExtend: [Link, IconButton],
|
|
85
86
|
props: { gap: 'A' },
|
|
86
|
-
info: {
|
|
87
|
-
logout: {
|
|
87
|
+
info: { props: { icon: 'info' } },
|
|
88
|
+
logout: { props: { icon: 'logout', href: '/logout' } }
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { SectionHeader, ColorTemplate, Flex } from '@symbo.ls/components'
|
|
4
4
|
|
|
5
5
|
const mapColors = (el, s) => {
|
|
6
|
-
if (!s.__projectSystem) return
|
|
7
6
|
const { COLOR } = s.__projectSystem
|
|
7
|
+
if (!COLOR) return
|
|
8
8
|
const colorKeys = Object.keys(COLOR)
|
|
9
9
|
return colorKeys.map(v => ({ key: v, value: COLOR[v] }))
|
|
10
10
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { ThemeTemplate, SectionHeader, Grid } from '@symbo.ls/components'
|
|
4
4
|
|
|
5
5
|
const mapThemes = (el, s) => {
|
|
6
|
-
if (!s.__projectSystem) return
|
|
7
6
|
const { THEME } = s.__projectSystem
|
|
7
|
+
if (!THEME) return
|
|
8
8
|
const themeKeys = Object.keys(THEME)
|
|
9
9
|
return themeKeys.map(v => ({ ...THEME[v], key: v }))
|
|
10
10
|
}
|
package/src/pages/Init/index.js
CHANGED
package/src/pages/State/index.js
CHANGED
|
@@ -26,6 +26,7 @@ const iconMap = {
|
|
|
26
26
|
|
|
27
27
|
const getTypeProp = (key, prop, library, defaultValue) => {
|
|
28
28
|
const { TYPOGRAPHY } = library
|
|
29
|
+
if (!TYPOGRAPHY) return
|
|
29
30
|
const { styles } = TYPOGRAPHY
|
|
30
31
|
if (!styles[key]) styles[key] = {}
|
|
31
32
|
return styles[key][prop] ||
|
|
@@ -52,6 +53,7 @@ const isHelper = v => v.slice(0, 1) === '.'
|
|
|
52
53
|
const getCollectionFromArray = (arr, s) => {
|
|
53
54
|
const { __projectSystem } = s
|
|
54
55
|
const { TYPOGRAPHY } = __projectSystem
|
|
56
|
+
if (!TYPOGRAPHY) return
|
|
55
57
|
const { styles } = TYPOGRAPHY
|
|
56
58
|
return arr.map((v, k) => {
|
|
57
59
|
const result = getTypeStyle(v, __projectSystem)
|
|
@@ -84,6 +86,7 @@ export const headingsCollection = (el, s) => {
|
|
|
84
86
|
export const tagsCollection = (el, s) => {
|
|
85
87
|
const { __projectSystem } = s
|
|
86
88
|
const { TYPOGRAPHY } = __projectSystem
|
|
89
|
+
if (!TYPOGRAPHY) return
|
|
87
90
|
const { styles } = TYPOGRAPHY
|
|
88
91
|
if (!styles.body) styles.body = {}
|
|
89
92
|
el.removeContent()
|
|
@@ -99,6 +102,7 @@ export const tagsCollection = (el, s) => {
|
|
|
99
102
|
export const helpersCollection = (el, s) => {
|
|
100
103
|
const { __projectSystem } = s
|
|
101
104
|
const { TYPOGRAPHY } = __projectSystem
|
|
105
|
+
if (!TYPOGRAPHY) return
|
|
102
106
|
const { styles } = TYPOGRAPHY
|
|
103
107
|
|
|
104
108
|
const HELPERS = Object.keys(styles)
|
|
@@ -113,9 +113,8 @@ export default {
|
|
|
113
113
|
|
|
114
114
|
on: {
|
|
115
115
|
init: (el, s) => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const { TYPOGRAPHY } = __projectSystem
|
|
116
|
+
const { TYPOGRAPHY } = s.__projectSystem
|
|
117
|
+
if (!TYPOGRAPHY) return
|
|
119
118
|
const { styles } = TYPOGRAPHY
|
|
120
119
|
if (styles) {
|
|
121
120
|
s.update({ styles }, { preventUpdate: true })
|
package/src/state.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import SYSTEM from '@symbo.ls/platform-init'
|
|
4
|
+
import USR_DATA from '@symbo.ls/temp-db'
|
|
5
|
+
import { LIBRARY, COMPONENTS } from '@symbo.ls/temp-db/symbols'
|
|
6
|
+
|
|
7
|
+
export const state = {
|
|
8
|
+
globalTheme: 'dark',
|
|
9
|
+
appKey: '4it.symbo.ls'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
state.SYSTEM = USR_DATA[state.appKey]
|
|
13
|
+
// state.SYSTEM = {}
|
|
14
|
+
state.SYSTEM.COMPONENTS = {}
|
|
15
|
+
|
|
16
|
+
export const context = {
|
|
17
|
+
LIBRARY,
|
|
18
|
+
SYSTEM,
|
|
19
|
+
COMPONENTS
|
|
20
|
+
}
|