浏览代码

Fixes styling on page select, bumps data version

main
Steve Ruiz 4 年前
父节点
当前提交
3b74580b4f
共有 6 个文件被更改,包括 19 次插入16 次删除
  1. 2
    0
      components/page-panel/page-panel.tsx
  2. 2
    2
      components/shared.tsx
  3. 1
    1
      components/style-panel/style-panel.tsx
  4. 6
    6
      state/data.ts
  5. 4
    3
      state/history.ts
  6. 4
    4
      state/state.ts

+ 2
- 0
components/page-panel/page-panel.tsx 查看文件

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

+ 2
- 2
components/shared.tsx 查看文件

@@ -74,6 +74,8 @@ export const RowButton = styled('button', {
74 74
   cursor: 'pointer',
75 75
   outline: 'none',
76 76
   alignItems: 'center',
77
+  fontFamily: '$ui',
78
+  fontSize: '$1',
77 79
   justifyContent: 'space-between',
78 80
   padding: '4px 6px 4px 12px',
79 81
 
@@ -94,8 +96,6 @@ export const RowButton = styled('button', {
94 96
   },
95 97
 
96 98
   '& label': {
97
-    fontFamily: '$ui',
98
-    fontSize: '$2',
99 99
     fontWeight: '$1',
100 100
     margin: 0,
101 101
     padding: 0,

+ 1
- 1
components/style-panel/style-panel.tsx 查看文件

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

+ 6
- 6
state/data.ts 查看文件

@@ -3,10 +3,10 @@ import shapeUtils from 'lib/shape-utils'
3 3
 
4 4
 export const defaultDocument: Data['document'] = {
5 5
   pages: {
6
-    page0: {
7
-      id: 'page0',
6
+    page1: {
7
+      id: 'page1',
8 8
       type: 'page',
9
-      name: 'Page 0',
9
+      name: 'Page 1',
10 10
       childIndex: 0,
11 11
       shapes: {
12 12
         // arrowShape0: shapeUtils[ShapeType.Arrow].create({
@@ -128,10 +128,10 @@ export const defaultDocument: Data['document'] = {
128 128
         // }),
129 129
       },
130 130
     },
131
-    page1: {
132
-      id: 'page1',
131
+    page2: {
132
+      id: 'page2',
133 133
       type: 'page',
134
-      name: 'Page 1',
134
+      name: 'Page 2',
135 135
       childIndex: 1,
136 136
       shapes: {},
137 137
     },

+ 4
- 3
state/history.ts 查看文件

@@ -1,6 +1,7 @@
1 1
 import { Data } from 'types'
2 2
 import { BaseCommand } from './commands/command'
3
-import state from './state'
3
+
4
+const CURRENT_VERSION = 'code_slate_0.0.2'
4 5
 
5 6
 // A singleton to manage history changes.
6 7
 
@@ -44,7 +45,7 @@ class BaseHistory<T> {
44 45
     this.save(data)
45 46
   }
46 47
 
47
-  load(data: T, id = 'code_slate_0.0.1') {
48
+  load(data: T, id = CURRENT_VERSION) {
48 49
     if (typeof window === 'undefined') return
49 50
     if (typeof localStorage === 'undefined') return
50 51
 
@@ -55,7 +56,7 @@ class BaseHistory<T> {
55 56
     }
56 57
   }
57 58
 
58
-  save = (data: T, id = 'code_slate_0.0.1') => {
59
+  save = (data: T, id = CURRENT_VERSION) => {
59 60
     if (typeof window === 'undefined') return
60 61
     if (typeof localStorage === 'undefined') return
61 62
 

+ 4
- 4
state/state.ts 查看文件

@@ -61,18 +61,18 @@ const initialData: Data = {
61 61
   pointedId: null,
62 62
   hoveredId: null,
63 63
   selectedIds: new Set([]),
64
-  currentPageId: 'page0',
64
+  currentPageId: 'page1',
65 65
   currentCodeFileId: 'file0',
66 66
   codeControls: {},
67 67
   document: defaultDocument,
68 68
   pageStates: {
69
-    page0: {
69
+    page1: {
70 70
       camera: {
71 71
         point: [0, 0],
72 72
         zoom: 1,
73 73
       },
74 74
     },
75
-    page1: {
75
+    page2: {
76 76
       camera: {
77 77
         point: [0, 0],
78 78
         zoom: 1,
@@ -1325,7 +1325,7 @@ const state = createState({
1325 1325
     },
1326 1326
 
1327 1327
     restoreSavedData(data) {
1328
-      // history.load(data)
1328
+      history.load(data)
1329 1329
     },
1330 1330
 
1331 1331
     clearBoundsRotation(data) {

正在加载...
取消
保存