chore(editor): use colors from default theme instead (#9425)

This commit is contained in:
fundon
2024-12-30 09:41:00 +00:00
parent 47ba0a8a32
commit 580e3eb13c
5 changed files with 14 additions and 14 deletions

View File

@@ -28,7 +28,7 @@ import {
Vec,
} from '@blocksuite/global/utils';
import type { Color } from '../../themes/index.js';
import { type Color, DefaultTheme } from '../../themes/index';
export type BrushProps = BaseElementProps & {
/**
@@ -131,7 +131,7 @@ export class BrushElementModel extends GfxPrimitiveElementModel<BrushProps> {
}
@field()
accessor color: Color = '#000000';
accessor color: Color = DefaultTheme.black;
@watch((_, instance) => {
instance['_local'].delete('commands');

View File

@@ -37,8 +37,8 @@ import {
StrokeStyle,
TextAlign,
type TextStyleProps,
} from '../../consts/index.js';
import type { Color } from '../../themes/index.ts';
} from '../../consts/index';
import { type Color, DefaultTheme } from '../../themes/index';
export type SerializedConnection = {
id?: string;
@@ -433,7 +433,7 @@ export class ConnectorElementModel extends GfxPrimitiveElementModel<ConnectorEle
* Defines the style of the label.
*/
@field({
color: '#000000',
color: DefaultTheme.black,
fontFamily: FontFamily.Inter,
fontSize: 16,
fontStyle: FontStyle.Normal,
@@ -486,7 +486,7 @@ export class ConnectorElementModel extends GfxPrimitiveElementModel<ConnectorEle
};
@field()
accessor stroke: Color = '#000000';
accessor stroke: Color = DefaultTheme.connectorColor;
@field()
accessor strokeStyle: StrokeStyle = StrokeStyle.Solid;

View File

@@ -6,8 +6,8 @@ import {
DEFAULT_ROUGHNESS,
type PointStyle,
StrokeStyle,
} from '../../consts/index.js';
import type { Color } from '../../themes/index.ts';
} from '../../consts/index';
import { type Color, DefaultTheme } from '../../themes/index';
import type { Connection } from './connector.js';
export class LocalConnectorElementModel extends GfxLocalElementModel {
@@ -29,7 +29,7 @@ export class LocalConnectorElementModel extends GfxLocalElementModel {
position: [0, 0],
};
stroke: Color = '#000000';
stroke: Color = DefaultTheme.connectorColor;
strokeStyle: StrokeStyle = StrokeStyle.Solid;

View File

@@ -98,7 +98,7 @@ export class ShapeElementModel extends GfxPrimitiveElementModel<ShapeProps> {
});
}
@field('#000000' as Color)
@field(DefaultTheme.shapeTextColor)
accessor color!: Color;
@field()
@@ -200,7 +200,7 @@ export class LocalShapeElementModel extends GfxLocalElementModel {
}
@prop()
accessor color: Color = '#000000';
accessor color: Color = DefaultTheme.shapeTextColor;
@prop()
accessor fillColor: Color = DefaultTheme.shapeFillColor;

View File

@@ -16,8 +16,8 @@ import {
FontWeight,
TextAlign,
type TextStyleProps,
} from '../../consts/index.js';
import type { Color } from '../../themes/index.js';
} from '../../consts/index';
import { type Color, DefaultTheme } from '../../themes/index';
export type TextElementProps = BaseElementProps & {
text: Y.Text;
@@ -61,7 +61,7 @@ export class TextElementModel extends GfxPrimitiveElementModel<TextElementProps>
}
@field()
accessor color: Color = '#000000';
accessor color: Color = DefaultTheme.black;
@field()
accessor fontFamily: FontFamily = FontFamily.Inter;