@symbo.ls/preview 0.0.45 → 0.0.46

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/preview",
3
3
  "description": "",
4
4
  "author": "",
5
- "version": "0.0.45",
5
+ "version": "0.0.46",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
@@ -68,12 +68,16 @@ export const SpacingScale = {
68
68
  hide: Object.keys(state.props).length === 0,
69
69
  flex: '0 0 360px',
70
70
  margin: '0',
71
- code: { margin: '0' },
71
+ code: {
72
+ margin: '0'
73
+ },
72
74
  buttons: { marginInline: 'X2' }
73
75
  }),
74
76
  title: null,
75
77
  code: {
76
- text: ({ state }) => JSON.stringify(state.props, null, 2)
78
+ props: {
79
+ text: ({ state }) => 'const props = ' + JSON.stringify(state.props, null, 2)
80
+ }
77
81
  }
78
82
  }
79
83
  }
@@ -21,7 +21,7 @@ const Row = {
21
21
  key: state => state.key,
22
22
 
23
23
  props: ({ state }) => ({
24
- columns: '10ch 14ch 13ch 10ch 21em 1fr',
24
+ columns: '7ch 20em 14ch 12ch 12ch 1fr',
25
25
  alignItems: 'center',
26
26
  isBase: state.index === 0,
27
27
  active: (state.key && state.key.length) === 1,
@@ -92,10 +92,10 @@ const Row = {
92
92
  childExtend: Cell,
93
93
 
94
94
  i: {},
95
+ buttons,
95
96
  em: {},
96
97
  decimal: {},
97
98
  px: {},
98
- buttons,
99
99
 
100
100
  graph: { line: {} }
101
101
  }
@@ -111,10 +111,10 @@ const HeaderRow = {
111
111
  },
112
112
 
113
113
  i: '#',
114
+ buttons: ' ',
114
115
  em: 'em',
115
116
  decimal: 'decimal',
116
117
  px: 'px',
117
- buttons: null,
118
118
  graph: null
119
119
  }
120
120
 
@@ -158,6 +158,7 @@ export const Table = {
158
158
 
159
159
  cnt: {
160
160
  childExtend: Row,
161
+ props: { lazyLoad: true },
161
162
  $setStateCollection: (el) => mapSequence(el.state, sortSequence)
162
163
  }
163
164
  }
@@ -127,6 +127,7 @@ export default {
127
127
  }
128
128
  }
129
129
  return {
130
+ lazyLoad: true,
130
131
  columns: 'auto 32px auto',
131
132
  rows: 'auto 32px auto',
132
133
  templateAreas: `"endStart blockStart startEnd"
@@ -184,6 +185,7 @@ export default {
184
185
 
185
186
  click: {
186
187
  props: {
188
+ lazyLoad: true,
187
189
  position: 'absolute',
188
190
  inset: '0 0 0 0'
189
191
  },
@@ -194,17 +196,20 @@ export default {
194
196
  const tableState = rowState.parent
195
197
  const propKey = state.value
196
198
  const active = tableState.props[propKey] === rowState.key
197
- if (active) {
198
- delete tableState.props[propKey] && tableState.update()
199
- } else {
200
- const allKeys = Object.keys(tableState.props)
201
- allKeys.filter(v => {
202
- const splitInWords = propKey.split(/(?=[A-Z])/)
203
- return v.includes(splitInWords[0]) && v.includes(splitInWords[1])
204
- })
205
- .forEach(v => delete tableState.props[v])
206
- tableState.update({ props: { [propKey]: rowState.key } })
207
- }
199
+ const t = setTimeout(() => {
200
+ if (active) {
201
+ delete tableState.props[propKey] && tableState.update()
202
+ } else {
203
+ const allKeys = Object.keys(tableState.props)
204
+ allKeys.filter(v => {
205
+ const splitInWords = propKey.split(/(?=[A-Z])/)
206
+ return v.includes(splitInWords[0]) && v.includes(splitInWords[1])
207
+ })
208
+ .forEach(v => delete tableState.props[v])
209
+ tableState.update({ props: { [propKey]: rowState.key } })
210
+ }
211
+ clearTimeout(t)
212
+ })
208
213
  }
209
214
  },
210
215