|
|
|
@ -7,26 +7,35 @@ if (typeof window !== 'undefined') {
|
|
|
|
|
history = createHistory()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mapper = new Morph()
|
|
|
|
|
const mapper = new Morph({
|
|
|
|
|
types: {
|
|
|
|
|
bool: v => {
|
|
|
|
|
if (v === 'false') return false
|
|
|
|
|
return Boolean(v)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const mappings = [
|
|
|
|
|
'bg:backgroundColor',
|
|
|
|
|
't:theme',
|
|
|
|
|
'l:language',
|
|
|
|
|
'ds:dropShadow',
|
|
|
|
|
'wc:windowControls',
|
|
|
|
|
'wa:widthAdjustment',
|
|
|
|
|
'pv:paddingVertical',
|
|
|
|
|
'ph:paddingHorizontal',
|
|
|
|
|
'ln:lineNumbers',
|
|
|
|
|
'code:code'
|
|
|
|
|
{ field: 'bg:backgroundColor' },
|
|
|
|
|
{ field: 't:theme' },
|
|
|
|
|
{ field: 'l:language' },
|
|
|
|
|
{ field: 'ds:dropShadow', type: 'bool' },
|
|
|
|
|
{ field: 'wc:windowControls', type: 'bool' },
|
|
|
|
|
{ field: 'wa:widthAdjustment', type: 'bool' },
|
|
|
|
|
{ field: 'pv:paddingVertical' },
|
|
|
|
|
{ field: 'ph:paddingHorizontal' },
|
|
|
|
|
{ field: 'ln:lineNumbers', type: 'bool' },
|
|
|
|
|
{ field: 'code:code' }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const reverseMappings = mappings.map(field =>
|
|
|
|
|
field
|
|
|
|
|
.split(':')
|
|
|
|
|
.reverse()
|
|
|
|
|
.join(':')
|
|
|
|
|
const reverseMappings = mappings.map(mapping =>
|
|
|
|
|
Object.assign({}, mapping, {
|
|
|
|
|
field: mapping.field
|
|
|
|
|
.split(':')
|
|
|
|
|
.reverse()
|
|
|
|
|
.join(':')
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const keysToQuery = keys =>
|
|
|
|
|