1
+ import { themeToVar } from '@toeverything/theme/v2' ;
1
2
import { z } from 'zod' ;
2
3
3
4
import { createEnumMap } from '../utils/enum.js' ;
@@ -8,40 +9,6 @@ export const NOTE_MIN_HEIGHT = 92;
8
9
export const DEFAULT_NOTE_WIDTH = NOTE_MIN_WIDTH ;
9
10
export const DEFAULT_NOTE_HEIGHT = NOTE_MIN_HEIGHT ;
10
11
11
- export enum NoteBackgroundColor {
12
- Black = '--affine-note-background-black' ,
13
- Blue = '--affine-note-background-blue' ,
14
- Green = '--affine-note-background-green' ,
15
- Grey = '--affine-note-background-grey' ,
16
- Magenta = '--affine-note-background-magenta' ,
17
- Orange = '--affine-note-background-orange' ,
18
- Purple = '--affine-note-background-purple' ,
19
- Red = '--affine-note-background-red' ,
20
- Teal = '--affine-note-background-teal' ,
21
- White = '--affine-note-background-white' ,
22
- Yellow = '--affine-note-background-yellow' ,
23
- }
24
-
25
- export const NoteBackgroundColorMap = createEnumMap ( NoteBackgroundColor ) ;
26
-
27
- export const NOTE_BACKGROUND_COLORS = [
28
- NoteBackgroundColor . Yellow ,
29
- NoteBackgroundColor . Orange ,
30
- NoteBackgroundColor . Red ,
31
- NoteBackgroundColor . Magenta ,
32
- NoteBackgroundColor . Purple ,
33
- NoteBackgroundColor . Blue ,
34
- NoteBackgroundColor . Teal ,
35
- NoteBackgroundColor . Green ,
36
- NoteBackgroundColor . Black ,
37
- NoteBackgroundColor . Grey ,
38
- NoteBackgroundColor . White ,
39
- ] as const ;
40
-
41
- export const DEFAULT_NOTE_BACKGROUND_COLOR = NoteBackgroundColor . White ;
42
-
43
- export const NoteBackgroundColorsSchema = z . nativeEnum ( NoteBackgroundColor ) ;
44
-
45
12
export enum NoteShadow {
46
13
Box = '--affine-note-shadow-box' ,
47
14
Film = '--affine-note-shadow-film' ,
@@ -105,3 +72,38 @@ export const DEFAULT_NOTE_CORNER = NoteCorners.Small;
105
72
export const NoteCornersSchema = z . nativeEnum ( NoteCorners ) ;
106
73
107
74
export const DEFAULT_NOTE_BORDER_SIZE = 4 ;
75
+
76
+ export const NoteBackgroundColor = {
77
+ Yellow : themeToVar ( 'edgeless/note/yellow' ) ,
78
+ Orange : themeToVar ( 'edgeless/note/orange' ) ,
79
+ Red : themeToVar ( 'edgeless/note/red' ) ,
80
+ Magenta : themeToVar ( 'edgeless/note/magenta' ) ,
81
+ Purple : themeToVar ( 'edgeless/note/purple' ) ,
82
+ Blue : themeToVar ( 'edgeless/note/blue' ) ,
83
+ Teal : themeToVar ( 'edgeless/note/teal' ) ,
84
+ Green : themeToVar ( 'edgeless/note/green' ) ,
85
+ Black : themeToVar ( 'edgeless/note/black' ) ,
86
+ Grey : themeToVar ( 'edgeless/note/grey' ) ,
87
+ White : themeToVar ( 'edgeless/note/white' ) ,
88
+ } as const ;
89
+
90
+ export const NOTE_BACKGROUND_PALETTES = [
91
+ NoteBackgroundColor . Yellow ,
92
+ NoteBackgroundColor . Orange ,
93
+ NoteBackgroundColor . Red ,
94
+ NoteBackgroundColor . Magenta ,
95
+ NoteBackgroundColor . Purple ,
96
+ NoteBackgroundColor . Blue ,
97
+ NoteBackgroundColor . Teal ,
98
+ NoteBackgroundColor . Green ,
99
+ NoteBackgroundColor . Black ,
100
+ NoteBackgroundColor . Grey ,
101
+ NoteBackgroundColor . White ,
102
+ ] as const ;
103
+
104
+ export const NoteBackgroundPaletteEnum = z . enum ( NOTE_BACKGROUND_PALETTES ) ;
105
+ export type NoteBackgroundPaletteEnum = z . infer <
106
+ typeof NoteBackgroundPaletteEnum
107
+ > ;
108
+
109
+ export const DEFAULT_NOTE_BACKGROUND_COLOR = NoteBackgroundColor . White ;
0 commit comments