Fixes styling on page select, bumps data version

This commit is contained in:
Steve Ruiz 2021-06-03 13:20:34 +01:00
parent 5ba56216d0
commit 3b74580b4f
6 changed files with 19 additions and 16 deletions

View file

@ -80,6 +80,8 @@ const StyledRadioItem = styled(DropdownMenu.RadioItem, {
padding: '0 6px 0 12px',
cursor: 'pointer',
borderRadius: '4px',
fontSize: '$1',
fontFamily: '$ui',
backgroundColor: 'transparent',
outline: 'none',
'&:hover': {

View file

@ -74,6 +74,8 @@ export const RowButton = styled('button', {
cursor: 'pointer',
outline: 'none',
alignItems: 'center',
fontFamily: '$ui',
fontSize: '$1',
justifyContent: 'space-between',
padding: '4px 6px 4px 12px',
@ -94,8 +96,6 @@ export const RowButton = styled('button', {
},
'& label': {
fontFamily: '$ui',
fontSize: '$2',
fontWeight: '$1',
margin: 0,
padding: 0,

View file

@ -266,7 +266,7 @@ const Row = styled('div', {
'& label': {
fontFamily: '$ui',
fontSize: '$2',
fontSize: '$1',
fontWeight: '$1',
margin: 0,
padding: 0,

View file

@ -3,10 +3,10 @@ import shapeUtils from 'lib/shape-utils'
export const defaultDocument: Data['document'] = {
pages: {
page0: {
id: 'page0',
page1: {
id: 'page1',
type: 'page',
name: 'Page 0',
name: 'Page 1',
childIndex: 0,
shapes: {
// arrowShape0: shapeUtils[ShapeType.Arrow].create({
@ -128,10 +128,10 @@ export const defaultDocument: Data['document'] = {
// }),
},
},
page1: {
id: 'page1',
page2: {
id: 'page2',
type: 'page',
name: 'Page 1',
name: 'Page 2',
childIndex: 1,
shapes: {},
},

View file

@ -1,6 +1,7 @@
import { Data } from 'types'
import { BaseCommand } from './commands/command'
import state from './state'
const CURRENT_VERSION = 'code_slate_0.0.2'
// A singleton to manage history changes.
@ -44,7 +45,7 @@ class BaseHistory<T> {
this.save(data)
}
load(data: T, id = 'code_slate_0.0.1') {
load(data: T, id = CURRENT_VERSION) {
if (typeof window === 'undefined') return
if (typeof localStorage === 'undefined') return
@ -55,7 +56,7 @@ class BaseHistory<T> {
}
}
save = (data: T, id = 'code_slate_0.0.1') => {
save = (data: T, id = CURRENT_VERSION) => {
if (typeof window === 'undefined') return
if (typeof localStorage === 'undefined') return

View file

@ -61,18 +61,18 @@ const initialData: Data = {
pointedId: null,
hoveredId: null,
selectedIds: new Set([]),
currentPageId: 'page0',
currentPageId: 'page1',
currentCodeFileId: 'file0',
codeControls: {},
document: defaultDocument,
pageStates: {
page0: {
page1: {
camera: {
point: [0, 0],
zoom: 1,
},
},
page1: {
page2: {
camera: {
point: [0, 0],
zoom: 1,
@ -1325,7 +1325,7 @@ const state = createState({
},
restoreSavedData(data) {
// history.load(data)
history.load(data)
},
clearBoundsRotation(data) {