Skip to content

Commit a1d9dd1

Browse files
committed
feat(editor): update edgeless color palette
1 parent b96a03b commit a1d9dd1

File tree

249 files changed

+948
-963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+948
-963
lines changed

blocksuite/affine/block-attachment/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@floating-ui/dom": "^1.6.10",
2727
"@lit/context": "^1.1.2",
2828
"@preact/signals-core": "^1.8.0",
29-
"@toeverything/theme": "^1.1.1",
29+
"@toeverything/theme": "^1.1.3",
3030
"file-type": "^19.5.0",
3131
"lit": "^3.2.0",
3232
"minimatch": "^10.0.1",

blocksuite/affine/block-bookmark/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@floating-ui/dom": "^1.6.10",
2626
"@lit/context": "^1.1.2",
2727
"@preact/signals-core": "^1.8.0",
28-
"@toeverything/theme": "^1.1.1",
28+
"@toeverything/theme": "^1.1.3",
2929
"lit": "^3.2.0",
3030
"minimatch": "^10.0.1",
3131
"zod": "^3.23.8"

blocksuite/affine/block-code/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@floating-ui/dom": "^1.6.10",
2424
"@lit/context": "^1.1.2",
2525
"@preact/signals-core": "^1.8.0",
26-
"@toeverything/theme": "^1.1.1",
26+
"@toeverything/theme": "^1.1.3",
2727
"@types/mdast": "^4.0.4",
2828
"lit": "^3.2.0",
2929
"minimatch": "^10.0.1",

blocksuite/affine/block-divider/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@floating-ui/dom": "^1.6.10",
2424
"@lit/context": "^1.1.2",
2525
"@preact/signals-core": "^1.8.0",
26-
"@toeverything/theme": "^1.1.1",
26+
"@toeverything/theme": "^1.1.3",
2727
"@types/mdast": "^4.0.4",
2828
"lit": "^3.2.0",
2929
"minimatch": "^10.0.1",

blocksuite/affine/block-edgeless-text/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@floating-ui/dom": "^1.6.10",
2626
"@lit/context": "^1.1.2",
2727
"@preact/signals-core": "^1.8.0",
28-
"@toeverything/theme": "^1.1.1",
28+
"@toeverything/theme": "^1.1.3",
2929
"lit": "^3.2.0",
3030
"minimatch": "^10.0.1",
3131
"zod": "^3.23.8"

blocksuite/affine/block-embed/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@floating-ui/dom": "^1.6.10",
2626
"@lit/context": "^1.1.2",
2727
"@preact/signals-core": "^1.8.0",
28-
"@toeverything/theme": "^1.1.1",
28+
"@toeverything/theme": "^1.1.3",
2929
"lit": "^3.2.0",
3030
"minimatch": "^10.0.1",
3131
"zod": "^3.23.8"

blocksuite/affine/block-frame/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@floating-ui/dom": "^1.6.10",
2424
"@lit/context": "^1.1.2",
2525
"@preact/signals-core": "^1.8.0",
26-
"@toeverything/theme": "^1.1.1",
26+
"@toeverything/theme": "^1.1.3",
2727
"@types/mdast": "^4.0.4",
2828
"lit": "^3.2.0",
2929
"minimatch": "^10.0.1",

blocksuite/affine/block-image/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@floating-ui/dom": "^1.6.10",
2525
"@lit/context": "^1.1.2",
2626
"@preact/signals-core": "^1.8.0",
27-
"@toeverything/theme": "^1.1.1",
27+
"@toeverything/theme": "^1.1.3",
2828
"file-type": "^19.5.0",
2929
"lit": "^3.2.0",
3030
"minimatch": "^10.0.1",

blocksuite/affine/block-latex/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@floating-ui/dom": "^1.6.10",
2525
"@lit/context": "^1.1.2",
2626
"@preact/signals-core": "^1.8.0",
27-
"@toeverything/theme": "^1.1.1",
27+
"@toeverything/theme": "^1.1.3",
2828
"@types/katex": "^0.16.7",
2929
"@types/mdast": "^4.0.4",
3030
"katex": "^0.16.11",

blocksuite/affine/block-list/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@floating-ui/dom": "^1.6.10",
2424
"@lit/context": "^1.1.2",
2525
"@preact/signals-core": "^1.8.0",
26-
"@toeverything/theme": "^1.1.1",
26+
"@toeverything/theme": "^1.1.3",
2727
"@types/mdast": "^4.0.4",
2828
"lit": "^3.2.0",
2929
"minimatch": "^10.0.1",

blocksuite/affine/block-note/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@floating-ui/dom": "^1.6.10",
2727
"@lit/context": "^1.1.2",
2828
"@preact/signals-core": "^1.8.0",
29-
"@toeverything/theme": "^1.1.1",
29+
"@toeverything/theme": "^1.1.3",
3030
"lit": "^3.2.0",
3131
"minimatch": "^10.0.1",
3232
"zod": "^3.23.8"

blocksuite/affine/block-paragraph/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@floating-ui/dom": "^1.6.10",
2424
"@lit/context": "^1.1.2",
2525
"@preact/signals-core": "^1.8.0",
26-
"@toeverything/theme": "^1.1.1",
26+
"@toeverything/theme": "^1.1.3",
2727
"@types/mdast": "^4.0.4",
2828
"lit": "^3.2.0",
2929
"minimatch": "^10.0.1",

blocksuite/affine/block-surface/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@blocksuite/store": "workspace:*",
2323
"@lit/context": "^1.1.2",
2424
"@preact/signals-core": "^1.8.0",
25-
"@toeverything/theme": "^1.1.1",
25+
"@toeverything/theme": "^1.1.3",
2626
"fractional-indexing": "^3.2.0",
2727
"lit": "^3.2.0",
2828
"lodash.chunk": "^4.2.0",

blocksuite/affine/components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@lit/context": "^1.1.2",
2525
"@lottiefiles/dotlottie-wc": "^0.4.0",
2626
"@preact/signals-core": "^1.8.0",
27-
"@toeverything/theme": "^1.1.1",
27+
"@toeverything/theme": "^1.1.3",
2828
"date-fns": "^4.0.0",
2929
"katex": "^0.16.11",
3030
"lit": "^3.2.0",

blocksuite/affine/components/src/icons/edgeless.ts

-15
Original file line numberDiff line numberDiff line change
@@ -427,21 +427,6 @@ export const ViewBarIcon = icons.ViewBarIcon({
427427
height: '24',
428428
});
429429

430-
export const TransparentIcon = html`<svg
431-
width="16"
432-
height="16"
433-
viewBox="0 0 16 16"
434-
fill="none"
435-
xmlns="http://www.w3.org/2000/svg"
436-
>
437-
<path
438-
fill-rule="evenodd"
439-
clip-rule="evenodd"
440-
d="M-0.939238 4.14286C-0.979281 4.4228 -1 4.70898 -1 5V6.71429H1.57143V9.28571H-1V11C-1 11.291 -0.979281 11.5772 -0.939238 11.8571H1.57143V14.4286H0.0754482C0.481795 15.0111 0.988871 15.5182 1.57143 15.9246V14.4286L4.14286 14.4286V16.9392C4.4228 16.9793 4.70898 17 5 17H6.71429V14.4286H9.28571V17H11C11.291 17 11.5772 16.9793 11.8571 16.9392V14.4286H14.4286L14.4286 15.9246C15.0111 15.5182 15.5182 15.0111 15.9246 14.4286L14.4286 14.4286V11.8571H16.9392C16.9793 11.5772 17 11.291 17 11V9.28571H14.4286V6.71429H17V5C17 4.70898 16.9793 4.4228 16.9392 4.14286H14.4286V1.57143H15.9246C15.5182 0.988871 15.0111 0.481795 14.4286 0.075448L14.4286 1.57143H11.8571V-0.939238C11.5772 -0.979281 11.291 -1 11 -1H9.28571V1.57143H6.71429V-1H5C4.70898 -1 4.4228 -0.979281 4.14286 -0.939238V1.57143H1.57143V0.0754479C0.988871 0.481795 0.481795 0.988871 0.0754479 1.57143H1.57143V4.14286H-0.939238ZM4.14286 4.14286V1.57143H6.71429V4.14286H4.14286ZM4.14286 6.71429H1.57143V4.14286H4.14286V6.71429ZM6.71429 6.71429V4.14286H9.28571V6.71429H6.71429ZM6.71429 9.28571V6.71429H4.14286V9.28571H1.57143V11.8571H4.14286V14.4286H6.71429V11.8571H9.28571V14.4286H11.8571V11.8571H14.4286V9.28571H11.8571V6.71429H14.4286V4.14286H11.8571V1.57143H9.28571V4.14286H11.8571V6.71429H9.28571V9.28571H6.71429ZM6.71429 9.28571V11.8571H4.14286V9.28571H6.71429ZM9.28571 9.28571H11.8571V11.8571H9.28571V9.28571Z"
441-
fill="#D9D9D9"
442-
/>
443-
</svg>`;
444-
445430
export const MoreHorizontalIcon = icons.MoreHorizontalIcon({
446431
width: '24',
447432
height: '24',

blocksuite/affine/data-view/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@floating-ui/dom": "^1.6.10",
2424
"@lit/context": "^1.1.2",
2525
"@preact/signals-core": "^1.8.0",
26-
"@toeverything/theme": "^1.1.1",
26+
"@toeverything/theme": "^1.1.3",
2727
"date-fns": "^4.0.0",
2828
"lit": "^3.2.0",
2929
"zod": "^3.23.8"

blocksuite/affine/model/src/blocks/frame/frame-model.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const FrameBlockSchema = defineBlockSchema({
3030
flavour: 'affine:frame',
3131
props: (internal): FrameBlockProps => ({
3232
title: internal.Text(),
33-
background: '--affine-palette-transparent',
33+
background: 'transparent',
3434
xywh: `[0,0,100,100]`,
3535
index: 'a0',
3636
childElementIds: Object.create(null),
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { LineColor } from './line.js';
1+
import { StrokeColor } from './color.js';
22

3-
export const DEFAULT_BRUSH_COLOR = LineColor.Blue;
3+
export const DEFAULT_BRUSH_COLOR = StrokeColor.Blue;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import { themeToVar } from '@toeverything/theme/v2';
2+
import { z } from 'zod';
3+
4+
import { createEnumMap } from '../utils/enum.js';
5+
6+
export const Transparent = 'transparent';
7+
export const White = themeToVar('edgeless/palette/white');
8+
export const Black = themeToVar('edgeless/palette/black');
9+
10+
export const Light = {
11+
Red: themeToVar('edgeless/palette/light/redLight'),
12+
Orange: themeToVar('edgeless/palette/light/orangeLight'),
13+
Yellow: themeToVar('edgeless/palette/light/yellowLight'),
14+
Green: themeToVar('edgeless/palette/light/greenLight'),
15+
Blue: themeToVar('edgeless/palette/light/blueLight'),
16+
Purple: themeToVar('edgeless/palette/light/purpleLight'),
17+
Magenta: themeToVar('edgeless/palette/light/magentaLight'),
18+
Grey: themeToVar('edgeless/palette/light/greyLight'),
19+
} as const;
20+
21+
export const LIGHT_PALETTES = [
22+
Light.Red,
23+
Light.Orange,
24+
Light.Yellow,
25+
Light.Green,
26+
Light.Blue,
27+
Light.Purple,
28+
Light.Magenta,
29+
Light.Grey,
30+
] as const;
31+
32+
export const Medium = {
33+
Red: themeToVar('edgeless/palette/medium/redMedium'),
34+
Orange: themeToVar('edgeless/palette/medium/orangeMedium'),
35+
Yellow: themeToVar('edgeless/palette/medium/yellowMedium'),
36+
Green: themeToVar('edgeless/palette/medium/greenMedium'),
37+
Blue: themeToVar('edgeless/palette/medium/blueMedium'),
38+
Purple: themeToVar('edgeless/palette/medium/purpleMedium'),
39+
Magenta: themeToVar('edgeless/palette/medium/magentaMedium'),
40+
Grey: themeToVar('edgeless/palette/medium/greyMedium'),
41+
} as const;
42+
43+
export const MEDIUM_PALETTES = [
44+
Medium.Red,
45+
Medium.Orange,
46+
Medium.Yellow,
47+
Medium.Green,
48+
Medium.Blue,
49+
Medium.Purple,
50+
Medium.Magenta,
51+
Medium.Grey,
52+
] as const;
53+
54+
export const Heavy = {
55+
Red: themeToVar('edgeless/palette/heavy/red'),
56+
Orange: themeToVar('edgeless/palette/heavy/orange'),
57+
Yellow: themeToVar('edgeless/palette/heavy/yellow'),
58+
Green: themeToVar('edgeless/palette/heavy/green'),
59+
Blue: themeToVar('edgeless/palette/heavy/blue'),
60+
Purple: themeToVar('edgeless/palette/heavy/purple'),
61+
Magenta: themeToVar('edgeless/palette/heavy/magenta'),
62+
} as const;
63+
64+
export const HEAVY_PALETTES = [
65+
Heavy.Red,
66+
Heavy.Orange,
67+
Heavy.Yellow,
68+
Heavy.Green,
69+
Heavy.Blue,
70+
Heavy.Purple,
71+
Heavy.Magenta,
72+
] as const;
73+
74+
export const PALETTES = [
75+
// Light
76+
...LIGHT_PALETTES,
77+
78+
Transparent,
79+
80+
// Medium
81+
...MEDIUM_PALETTES,
82+
83+
White,
84+
85+
// Heavy
86+
...HEAVY_PALETTES,
87+
88+
Black,
89+
] as const;
90+
91+
export const PaletteEnum = z.enum(PALETTES);
92+
93+
export const StrokeColor = { Black, White, ...Medium } as const;
94+
95+
export const StrokeColorMap = createEnumMap(StrokeColor);
96+
97+
export const STROKE_COLORS = [...MEDIUM_PALETTES, Black, White] as const;

blocksuite/affine/model/src/consts/connector.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createEnumMap } from '../utils/enum.js';
2-
import { LineColor } from './line.js';
2+
import { StrokeColor } from './color.js';
33

44
export enum ConnectorEndpoint {
55
Front = 'Front',
@@ -16,9 +16,9 @@ export enum PointStyle {
1616

1717
export const PointStyleMap = createEnumMap(PointStyle);
1818

19-
export const DEFAULT_CONNECTOR_COLOR = LineColor.Grey;
19+
export const DEFAULT_CONNECTOR_COLOR = StrokeColor.Grey;
2020

21-
export const DEFAULT_CONNECTOR_TEXT_COLOR = LineColor.Black;
21+
export const DEFAULT_CONNECTOR_TEXT_COLOR = StrokeColor.Black;
2222

2323
export const DEFAULT_FRONT_END_POINT_STYLE = PointStyle.None;
2424

+2-26
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
import { z } from 'zod';
1+
import { Light } from './color.js';
22

3-
export enum FrameBackgroundColor {
4-
Blue = '--affine-tag-blue',
5-
Gray = '--affine-tag-gray',
6-
Green = '--affine-tag-green',
7-
Orange = '--affine-tag-orange',
8-
Pink = '--affine-tag-pink',
9-
Purple = '--affine-tag-purple',
10-
Red = '--affine-tag-red',
11-
Teal = '--affine-tag-teal',
12-
Yellow = '--affine-tag-yellow',
13-
}
14-
15-
export const FRAME_BACKGROUND_COLORS = [
16-
FrameBackgroundColor.Gray,
17-
FrameBackgroundColor.Red,
18-
FrameBackgroundColor.Orange,
19-
FrameBackgroundColor.Yellow,
20-
FrameBackgroundColor.Green,
21-
FrameBackgroundColor.Teal,
22-
FrameBackgroundColor.Blue,
23-
FrameBackgroundColor.Purple,
24-
FrameBackgroundColor.Pink,
25-
];
26-
27-
export const FrameBackgroundColorsSchema = z.nativeEnum(FrameBackgroundColor);
3+
export const FrameBackgroundColor = Light;

blocksuite/affine/model/src/consts/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './brush.js';
2+
export * from './color.js';
23
export * from './connector.js';
34
export * from './doc.js';
45
export * from './frame.js';

blocksuite/affine/model/src/consts/line.ts

+14
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ export enum LineWidth {
1313
Two = 2,
1414
}
1515

16+
export const LINE_WIDTHS = [
17+
LineWidth.Two,
18+
LineWidth.Four,
19+
LineWidth.Six,
20+
LineWidth.Eight,
21+
LineWidth.Ten,
22+
LineWidth.Twelve,
23+
];
24+
25+
/**
26+
* Use `StrokeColor` instead.
27+
*
28+
* @deprecated
29+
*/
1630
export enum LineColor {
1731
Black = '--affine-palette-line-black',
1832
Blue = '--affine-palette-line-blue',

0 commit comments

Comments
 (0)