@symbo.ls/preview 2.6.25 → 2.6.34

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 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
- import { platformOptions } from '@symbo.ls/platform-options'
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
- HeaderOnRouter: {},
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.parent, s)
36
+ smbls.openModal(el, s)
33
37
  }
34
38
  }
35
- }, undefined, 'app', platformOptions)
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.25",
4
+ "author": "symbo.ls",
5
+ "version": "2.6.34",
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,6 +28,8 @@
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
34
  "@symbo.ls/utils": "latest"
33
35
  },
@@ -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: { extend: IconButton, props: { icon: 'info' } },
87
- logout: { extend: IconButton, props: { icon: '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
  }
@@ -93,7 +93,7 @@ const modes = {
93
93
  },
94
94
  stateUpdated: (el, s, changes) => {
95
95
  const { color, background } = s
96
- s.systemUpdate({
96
+ s.projectSystemUpdate({
97
97
  THEME: {
98
98
  document: {
99
99
  ['@' + s.key]: { color, background }
@@ -20,7 +20,7 @@ export const Init = {
20
20
 
21
21
  define: { routes: param => param },
22
22
  routes: {
23
- '/': ChooseProject,
23
+ '/*': ChooseProject,
24
24
  '/create': CreateProject,
25
25
  '/personalize': Personalize,
26
26
  '/theme': CreateDocumentTheme,
@@ -22,7 +22,7 @@ export const Spaces = {
22
22
  on: {
23
23
  init: (el, s) => {},
24
24
  stateUpdated: (el, s, changes) => {
25
- s.systemUpdate({
25
+ s.projectSystemUpdate({
26
26
  SPACING: changes
27
27
  }, {
28
28
  preventUpdate: true
@@ -81,7 +81,7 @@ export const State = {
81
81
 
82
82
  on: {
83
83
  stateUpdated: (el, s) => {
84
- s.systemUpdate({ PROJECT_STATE: s.parse })
84
+ s.projectSystemUpdate({ PROJECT_STATE: s.parse })
85
85
  }
86
86
  }
87
87
  }
@@ -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
- if (!s.__projectSystem) return
117
- const { __projectSystem } = s
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 })
@@ -33,7 +33,7 @@ export const Typography = {
33
33
  mapSequence(s, sortSequence)
34
34
  },
35
35
  stateUpdated: (el, s, changes) => {
36
- s.systemUpdate({
36
+ s.projectSystemUpdate({
37
37
  TYPOGRAPHY: changes
38
38
  }, {
39
39
  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
+ }