chore(editor): use colors from default theme instead (#9425)
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
|||||||
Vec,
|
Vec,
|
||||||
} from '@blocksuite/global/utils';
|
} from '@blocksuite/global/utils';
|
||||||
|
|
||||||
import type { Color } from '../../themes/index.js';
|
import { type Color, DefaultTheme } from '../../themes/index';
|
||||||
|
|
||||||
export type BrushProps = BaseElementProps & {
|
export type BrushProps = BaseElementProps & {
|
||||||
/**
|
/**
|
||||||
@@ -131,7 +131,7 @@ export class BrushElementModel extends GfxPrimitiveElementModel<BrushProps> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@field()
|
@field()
|
||||||
accessor color: Color = '#000000';
|
accessor color: Color = DefaultTheme.black;
|
||||||
|
|
||||||
@watch((_, instance) => {
|
@watch((_, instance) => {
|
||||||
instance['_local'].delete('commands');
|
instance['_local'].delete('commands');
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ import {
|
|||||||
StrokeStyle,
|
StrokeStyle,
|
||||||
TextAlign,
|
TextAlign,
|
||||||
type TextStyleProps,
|
type TextStyleProps,
|
||||||
} from '../../consts/index.js';
|
} from '../../consts/index';
|
||||||
import type { Color } from '../../themes/index.ts';
|
import { type Color, DefaultTheme } from '../../themes/index';
|
||||||
|
|
||||||
export type SerializedConnection = {
|
export type SerializedConnection = {
|
||||||
id?: string;
|
id?: string;
|
||||||
@@ -433,7 +433,7 @@ export class ConnectorElementModel extends GfxPrimitiveElementModel<ConnectorEle
|
|||||||
* Defines the style of the label.
|
* Defines the style of the label.
|
||||||
*/
|
*/
|
||||||
@field({
|
@field({
|
||||||
color: '#000000',
|
color: DefaultTheme.black,
|
||||||
fontFamily: FontFamily.Inter,
|
fontFamily: FontFamily.Inter,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontStyle: FontStyle.Normal,
|
fontStyle: FontStyle.Normal,
|
||||||
@@ -486,7 +486,7 @@ export class ConnectorElementModel extends GfxPrimitiveElementModel<ConnectorEle
|
|||||||
};
|
};
|
||||||
|
|
||||||
@field()
|
@field()
|
||||||
accessor stroke: Color = '#000000';
|
accessor stroke: Color = DefaultTheme.connectorColor;
|
||||||
|
|
||||||
@field()
|
@field()
|
||||||
accessor strokeStyle: StrokeStyle = StrokeStyle.Solid;
|
accessor strokeStyle: StrokeStyle = StrokeStyle.Solid;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import {
|
|||||||
DEFAULT_ROUGHNESS,
|
DEFAULT_ROUGHNESS,
|
||||||
type PointStyle,
|
type PointStyle,
|
||||||
StrokeStyle,
|
StrokeStyle,
|
||||||
} from '../../consts/index.js';
|
} from '../../consts/index';
|
||||||
import type { Color } from '../../themes/index.ts';
|
import { type Color, DefaultTheme } from '../../themes/index';
|
||||||
import type { Connection } from './connector.js';
|
import type { Connection } from './connector.js';
|
||||||
|
|
||||||
export class LocalConnectorElementModel extends GfxLocalElementModel {
|
export class LocalConnectorElementModel extends GfxLocalElementModel {
|
||||||
@@ -29,7 +29,7 @@ export class LocalConnectorElementModel extends GfxLocalElementModel {
|
|||||||
position: [0, 0],
|
position: [0, 0],
|
||||||
};
|
};
|
||||||
|
|
||||||
stroke: Color = '#000000';
|
stroke: Color = DefaultTheme.connectorColor;
|
||||||
|
|
||||||
strokeStyle: StrokeStyle = StrokeStyle.Solid;
|
strokeStyle: StrokeStyle = StrokeStyle.Solid;
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ export class ShapeElementModel extends GfxPrimitiveElementModel<ShapeProps> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@field('#000000' as Color)
|
@field(DefaultTheme.shapeTextColor)
|
||||||
accessor color!: Color;
|
accessor color!: Color;
|
||||||
|
|
||||||
@field()
|
@field()
|
||||||
@@ -200,7 +200,7 @@ export class LocalShapeElementModel extends GfxLocalElementModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@prop()
|
@prop()
|
||||||
accessor color: Color = '#000000';
|
accessor color: Color = DefaultTheme.shapeTextColor;
|
||||||
|
|
||||||
@prop()
|
@prop()
|
||||||
accessor fillColor: Color = DefaultTheme.shapeFillColor;
|
accessor fillColor: Color = DefaultTheme.shapeFillColor;
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import {
|
|||||||
FontWeight,
|
FontWeight,
|
||||||
TextAlign,
|
TextAlign,
|
||||||
type TextStyleProps,
|
type TextStyleProps,
|
||||||
} from '../../consts/index.js';
|
} from '../../consts/index';
|
||||||
import type { Color } from '../../themes/index.js';
|
import { type Color, DefaultTheme } from '../../themes/index';
|
||||||
|
|
||||||
export type TextElementProps = BaseElementProps & {
|
export type TextElementProps = BaseElementProps & {
|
||||||
text: Y.Text;
|
text: Y.Text;
|
||||||
@@ -61,7 +61,7 @@ export class TextElementModel extends GfxPrimitiveElementModel<TextElementProps>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@field()
|
@field()
|
||||||
accessor color: Color = '#000000';
|
accessor color: Color = DefaultTheme.black;
|
||||||
|
|
||||||
@field()
|
@field()
|
||||||
accessor fontFamily: FontFamily = FontFamily.Inter;
|
accessor fontFamily: FontFamily = FontFamily.Inter;
|
||||||
|
|||||||
Reference in New Issue
Block a user