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', padding: '0 6px 0 12px',
cursor: 'pointer', cursor: 'pointer',
borderRadius: '4px', borderRadius: '4px',
fontSize: '$1',
fontFamily: '$ui',
backgroundColor: 'transparent', backgroundColor: 'transparent',
outline: 'none', outline: 'none',
'&:hover': { '&:hover': {

View file

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

View file

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

View file

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

View file

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

View file

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