Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(base-ui): toolbar custom button, fix border,font style,font color bug (#251)

Dushusir01802b3e2977
diff --git a/packages/base-sheets/src/commands/commands/__tests__/set-style.command.spec.ts b/packages/base-sheets/src/commands/commands/__tests__/set-style.command.spec.ts
index fd54d2bd50..ea7f9709ac 100644
--- a/packages/base-sheets/src/commands/commands/__tests__/set-style.command.spec.ts
+++ b/packages/base-sheets/src/commands/commands/__tests__/set-style.command.spec.ts
@@ -5,6 +5,7 @@ import {
HorizontalAlign,
ICommandService,
ICurrentUniverService,
+ IStyleData,
ITextDecoration,
ITextRotation,
Nullable,
@@ -19,7 +20,7 @@ import { Injector } from '@wendellhu/redi';
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { NORMAL_SELECTION_PLUGIN_NAME, SelectionManagerService } from '../../../services/selection-manager.service';
-import { SetRangeStyleMutation } from '../../mutations/set-range-styles.mutation';
+import { SetRangeValuesMutation } from '../../mutations/set-range-values.mutation';
import {
SetBackgroundColorCommand,
SetBoldCommand,
@@ -27,6 +28,7 @@ import {
SetFontSizeCommand,
SetHorizontalTextAlignCommand,
SetItalicCommand,
+ SetOverlineCommand,
SetStrikeThroughCommand,
SetStyleCommand,
SetTextColorCommand,
@@ -41,6 +43,7 @@ describe("Test commands used for updating cells' styles", () => {
let univer: Univer;
let get: Injector['get'];
let commandService: ICommandService;
+ let getTextStyle: () => Nullable<IStyleData>;
beforeEach(() => {
const testBed = createCommandTestBed();
@@ -52,6 +55,7 @@ describe("Test commands used for updating cells' styles", () => {
commandService.registerCommand(SetItalicCommand);
commandService.registerCommand(SetUnderlineCommand);
commandService.registerCommand(SetStrikeThroughCommand);
+ commandService.registerCommand(SetOverlineCommand);
commandService.registerCommand(SetFontSizeCommand);
commandService.registerCommand(SetFontFamilyCommand);
commandService.registerCommand(SetTextColorCommand);
@@ -61,7 +65,14 @@ describe("Test commands used for updating cells' styles", () => {
commandService.registerCommand(SetTextWrapCommand);
commandService.registerCommand(SetTextRotationCommand);
commandService.registerCommand(SetStyleCommand);
- commandService.registerCommand(SetRangeStyleMutation);
+ commandService.registerCommand(SetRangeValuesMutation);
+
+ getTextStyle = (): Nullable<IStyleData> =>
+ get(ICurrentUniverService)
+ .getUniverSheetInstance('test')
+ ?.getSheetBySheetId('sheet1')
+ ?.getRange(0, 0, 0, 0)
+ .getTextStyle();
});
afterEach(() => {
@@ -69,17 +80,6 @@ describe("Test commands used for updating cells' styles", () => {
});
describe('bold', () => {
- beforeEach(() => {
- const testBed = createCommandTestBed();
- univer = testBed.univer;
- get = testBed.get;
-
- commandService = get(ICommandService);
- commandService.registerCommand(SetBoldCommand);
- commandService.registerCommand(SetStyleCommand);
- commandService.registerCommand(SetRangeStyleMutation);
- });
-
describe('correct situations', () => {
it('will toggle bold style when there is a selected range', async () => {
const selectionManagerService = get(SelectionManagerService);
@@ -135,17 +135,6 @@ describe("Test commands used for updating cells' styles", () => {
});
describe('italic', () => {
- beforeEach(() => {
- const testBed = createCommandTestBed();
- univer = testBed.univer;
- get = testBed.get;
-
- commandService = get(ICommandService);
- commandService.registerCommand(SetItalicCommand);
- commandService.registerCommand(SetStyleCommand);
- commandService.registerCommand(SetRangeStyleMutation);
- });
-
describe('correct situations', () => {
it('will toggle italic style when there is a selected range', async () => {
const selectionManager = get(SelectionManagerService);
@@ -379,7 +368,16 @@ describe("Test commands used for updating cells' styles", () => {
selectionManager.add([
{
range: { startRow: 0, startColumn: 0, endColumn: 0, endRow: 0, rangeType: RANGE_TYPE.NORMAL },
- primary: null,
+ primary: {
+ startRow: 0,
+ startColumn: 0,
+ endColumn: 0,
+ endRow: 0,
+ actualColumn: 0,
+ actualRow: 0,
+ isMerged: false,
+ isMergedMainCell: false,
+ },
style: null,
},
]);
@@ -391,9 +389,44 @@ describe("Test commands used for updating cells' styles", () => {
?.getRange(0, 0, 0, 0)
.getTextStyle()?.cl?.rgb;
}
+ function getFontThroughLine(): ITextDecoration | undefined {
+ return get(ICurrentUniverService)
+ .getUniverSheetInstance('test')
+ ?.getSheetBySheetId('sheet1')
+ ?.getRange(0, 0, 0, 0)
+ .getStrikeThrough();
+ }
+ function getFontUnderline(): ITextDecoration | undefined {
+ return get(ICurrentUniverService)
+ .getUniverSheetInstance('test')
+ ?.getSheetBySheetId('sheet1')
+ ?.getRange(0, 0, 0, 0)
+ .getUnderline();
+ }
+ function getFontOverline(): ITextDecoration | undefined {
+ return get(ICurrentUniverService)
+ .getUniverSheetInstance('test')
+ ?.getSheetBySheetId('sheet1')
+ ?.getRange(0, 0, 0, 0)
+ .getOverline();
+ }
+
+ expect(await commandService.executeCommand(SetStrikeThroughCommand.id)).toBeTruthy();
+ expect(getFontThroughLine()?.s).toBe(BooleanNumber.TRUE);
+
+ expect(await commandService.executeCommand(SetUnderlineCommand.id)).toBeTruthy();
+ expect(getFontUnderline()?.s).toBe(BooleanNumber.TRUE);
+
+ expect(await commandService.executeCommand(SetOverlineCommand.id)).toBeTruthy();
+ expect(getFontOverline()?.s).toBe(BooleanNumber.TRUE);
expect(await commandService.executeCommand(SetTextColorCommand.id, { value: '#abcdef' })).toBeTruthy();
expect(getFontColor()).toBe('#abcdef');
+
+ // You need to ensure that the color of the strike through/underline/overline will also be changed
+ expect(getFontThroughLine()?.cl?.rgb).toBe('#abcdef');
+ expect(getFontUnderline()?.cl?.rgb).toBe('#abcdef');
+ expect(getFontOverline()?.cl?.rgb).toBe('#abcdef');
});
});
diff --git a/packages/base-sheets/src/commands/commands/set-border-command.ts b/packages/base-sheets/src/commands/commands/set-border-command.ts
index e707be85d3..57a840f72e 100644
--- a/packages/base-sheets/src/commands/commands/set-border-command.ts
+++ b/packages/base-sheets/src/commands/commands/set-border-command.ts
@@ -111,7 +111,7 @@ export const SetBorderCommand: ICommand = {
const right = type === BorderType.RIGHT || type === BorderType.ALL || type === BorderType.OUTSIDE;
const vertical = type === BorderType.VERTICAL || type === BorderType.ALL || type === BorderType.INSIDE;
const horizontal = type === BorderType.HORIZONTAL || type === BorderType.ALL || type === BorderType.INSIDE;
- const range = selections[0];
+ const range = selections[0]; // TODO support multiple ranges
// Cells in the surrounding range may need to clear the border
const topRangeOut = {
@@ -302,37 +302,63 @@ export const SetBorderCommand: ICommand = {
forEach(range, (row, column) => {
const rectangle = hasMerge(row, column);
if (rectangle) {
+ // Clear the right border of all columns except the last column
if (rectangle.endColumn !== range.endColumn) {
const style = mr.getValue(rectangle.startRow, rectangle.startColumn);
mr.setValue(row, column, {
bd: style?.bd ? Object.assign(style.bd, { r: null }) : { r: null },
});
}
- } else {
- if (column !== range.endColumn) {
- const style = mr.getValue(row, column);
+ // Clear the left border of all columns except the first column
+ if (rectangle.startColumn !== range.startColumn) {
+ const style = mr.getValue(rectangle.startRow, rectangle.startColumn);
mr.setValue(row, column, {
- bd: style?.bd ? Object.assign(style.bd, { r: null }) : { r: null },
+ bd: style?.bd ? Object.assign(style.bd, { l: null }) : { l: null },
});
}
- }
- });
- forEach(range, (row, column) => {
- const rectangle = hasMerge(row, column);
- if (rectangle) {
+ // Clear all the bottom border except the last line
if (rectangle.endRow !== range.endRow) {
const style = mr.getValue(rectangle.startRow, rectangle.startColumn);
mr.setValue(row, column, {
bd: style?.bd ? Object.assign(style.bd, { b: null }) : { b: null },
});
}
+ // Clear the top border of all lines except the first line
+ if (rectangle.startRow !== range.startRow) {
+ const style = mr.getValue(rectangle.startRow, rectangle.startColumn);
+ mr.setValue(row, column, {
+ bd: style?.bd ? Object.assign(style.bd, { t: null }) : { t: null },
+ });
+ }
} else {
+ // Clear the right border of all columns except the last column
+ if (column !== range.endColumn) {
+ const style = mr.getValue(row, column);
+ mr.setValue(row, column, {
+ bd: style?.bd ? Object.assign(style.bd, { r: null }) : { r: null },
+ });
+ }
+ // Clear the left border of all columns except the first column
+ if (column !== range.startColumn) {
+ const style = mr.getValue(row, column);
+ mr.setValue(row, column, {
+ bd: style?.bd ? Object.assign(style.bd, { l: null }) : { l: null },
+ });
+ }
+ // Clear all the bottom border except the last line
if (row !== range.endRow) {
const style = mr.getValue(row, column);
mr.setValue(row, column, {
bd: style?.bd ? Object.assign(style.bd, { b: null }) : { b: null },
});
}
+ // Clear the top border of all lines except the first line
+ if (row !== range.startRow) {
+ const style = mr.getValue(row, column);
+ mr.setValue(row, column, {
+ bd: style?.bd ? Object.assign(style.bd, { t: null }) : { t: null },
+ });
+ }
}
});
}
diff --git a/packages/base-sheets/src/commands/commands/set-range-values.command.ts b/packages/base-sheets/src/commands/commands/set-range-values.command.ts
index 70c58e170b..2df619f435 100644
--- a/packages/base-sheets/src/commands/commands/set-range-values.command.ts
+++ b/packages/base-sheets/src/commands/commands/set-range-values.command.ts
@@ -64,20 +64,6 @@ export const SetRangeValuesCommand: ICommand = {
const cellValue = new ObjectMatrix<ICellData>();
let realCellValue: ObjectMatrixPrimitiveType<ICellData> | undefined;
- // for (let i = 0; i < currentSelections.length; i++) {
- // const { startRow, startColumn, endRow, endColumn } = currentSelections[i];
- // if (Tools.isArray(value)) {
- // for (let r = 0; r <= endRow - startRow; r++) {
- // for (let c = 0; c <= endColumn - startColumn; c++) {
- // cellValue.setValue(r + startRow, c + startColumn, value[r][c]);
- // }
- // }
- // } else if (isICellData(value)) {
- // cellValue.setValue(startRow, startColumn, value);
- // } else {
- // realCellValue = value as ObjectMatrixPrimitiveType<ICellData>;
- // }
- // }
if (Tools.isArray(value)) {
for (let i = 0; i < currentSelections.length; i++) {
const { startRow, startColumn, endRow, endColumn } = currentSelections[i];
diff --git a/packages/base-sheets/src/commands/commands/set-style.command.ts b/packages/base-sheets/src/commands/commands/set-style.command.ts
index 44bcce6941..ab8e1fed53 100644
--- a/packages/base-sheets/src/commands/commands/set-style.command.ts
+++ b/packages/base-sheets/src/commands/commands/set-style.command.ts
@@ -4,6 +4,7 @@ import {
FontItalic,
FontWeight,
HorizontalAlign,
+ ICellData,
IColorStyle,
ICommand,
ICommandService,
@@ -12,7 +13,6 @@ import {
ITextRotation,
IUndoRedoService,
ObjectMatrix,
- ObjectMatrixPrimitiveType,
Tools,
VerticalAlign,
WrapStrategy,
@@ -21,10 +21,10 @@ import { IAccessor } from '@wendellhu/redi';
import { SelectionManagerService } from '../../services/selection-manager.service';
import {
- ISetRangeStyleMutationParams,
- SetRangeStyleMutation,
- SetRangeStyleUndoMutationFactory,
-} from '../mutations/set-range-styles.mutation';
+ ISetRangeValuesMutationParams,
+ SetRangeValuesMutation,
+ SetRangeValuesUndoMutationFactory,
+} from '../mutations/set-range-values.mutation';
export interface IStyleTypeValue<T> {
type: keyof IStyleData;
@@ -67,48 +67,64 @@ export const SetStyleCommand: ICommand<ISetStyleParams<unknown>> = {
const worksheet = workbook.getSheetBySheetId(worksheetId);
if (!worksheet) return false;
- let value: ObjectMatrixPrimitiveType<IStyleData>;
- for (let i = 0; i < ranges.length; i++) {
- const { startRow, endRow, startColumn, endColumn } = ranges[i];
- if (Tools.isArray(style.value)) {
- const matrix = new ObjectMatrix<IStyleData>();
- for (let r = 0; r < endRow - startRow + 1; r++) {
- for (let c = 0; c < endColumn - startColumn + 1; c++) {
- matrix.setValue(r, c, {
- [style.type]: style.value[r][c],
+ const cellValue = new ObjectMatrix<ICellData>();
+ // let value: ObjectMatrixPrimitiveType<ICellData> | undefined;
+
+ if (Tools.isArray(style.value)) {
+ for (let i = 0; i < ranges.length; i++) {
+ const { startRow, endRow, startColumn, endColumn } = ranges[i];
+
+ for (let r = 0; r <= endRow - startRow; r++) {
+ for (let c = 0; c <= endColumn - startColumn; c++) {
+ cellValue.setValue(r + startRow, c + startColumn, {
+ s: {
+ [style.type]: style.value[r][c],
+ },
});
}
}
- value = matrix.getData();
- } else {
- const colorObj: IStyleData = {
- [style.type]: style.value,
+ }
+
+ // value = cellValue.getData();
+ } else {
+ for (let i = 0; i < ranges.length; i++) {
+ const { startRow, endRow, startColumn, endColumn } = ranges[i];
+
+ const colorObj: ICellData = {
+ s: {
+ [style.type]: style.value,
+ },
};
- value = Tools.fillObjectMatrix(endRow - startRow + 1, endColumn - startColumn + 1, colorObj);
+ // value = Tools.fillObjectMatrix(endRow - startRow + 1, endColumn - startColumn + 1, colorObj);
+ for (let r = startRow; r <= endRow; r++) {
+ for (let c = startColumn; c <= endColumn; c++) {
+ cellValue.setValue(r, c, colorObj);
+ }
+ }
}
}
- const setRangeStyleMutationParams: ISetRangeStyleMutationParams = {
+ const setRangeValuesMutationParams: ISetRangeValuesMutationParams = {
range: ranges,
worksheetId,
workbookId,
- value: value!,
+ cellValue: cellValue.getMatrix(),
};
- const undoSetRangeStyleMutationParams: ISetRangeStyleMutationParams = SetRangeStyleUndoMutationFactory(
+ const undoSetRangeValuesMutationParams: ISetRangeValuesMutationParams = SetRangeValuesUndoMutationFactory(
accessor,
- setRangeStyleMutationParams
+ setRangeValuesMutationParams
);
- const result = commandService.executeCommand(SetRangeStyleMutation.id, setRangeStyleMutationParams);
+ const result = commandService.executeCommand(SetRangeValuesMutation.id, setRangeValuesMutationParams);
if (result) {
undoRedoService.pushUndoRedo({
URI: workbookId,
undo() {
- return commandService.executeCommand(SetRangeStyleMutation.id, undoSetRangeStyleMutationParams);
+ return commandService.executeCommand(SetRangeValuesMutation.id, undoSetRangeValuesMutationParams);
},
redo() {
- return commandService.executeCommand(SetRangeStyleMutation.id, setRangeStyleMutationParams);
+ return commandService.executeCommand(SetRangeValuesMutation.id, setRangeValuesMutationParams);
},
});
@@ -258,6 +274,43 @@ export const SetStrikeThroughCommand: ICommand = {
},
};
+/**
+ * Set overline font style to currently selected ranges. If the cell is already overline then it will cancel the overline style.
+ */
+export const SetOverlineCommand: ICommand = {
+ type: CommandType.COMMAND,
+ id: 'sheet.command.set-overline',
+ handler: async (accessor) => {
+ const selection = accessor.get(SelectionManagerService).getLast();
+ if (!selection) {
+ return false;
+ }
+
+ const worksheet = accessor
+ .get(ICurrentUniverService)
+ .getCurrentUniverSheetInstance()
+
+ .getActiveSheet();
+ let currentlyOverline = true;
+ if (selection.primary) {
+ currentlyOverline = !!worksheet
+ .getRange(selection.primary.startRow, selection.primary.startColumn)
+ .getOverline().s;
+ }
+
+ const setStyleParams: ISetStyleParams<{ s: number }> = {
+ style: {
+ type: 'ol',
+ value: {
+ s: currentlyOverline ? BooleanNumber.FALSE : BooleanNumber.TRUE,
+ },
+ },
+ };
+
+ return accessor.get(ICommandService).executeCommand(SetStyleCommand.id, setStyleParams);
+ },
+};
+
export interface ISetFontFamilyCommandParams {
value: string;
}
@@ -314,7 +367,7 @@ export const SetTextColorCommand: ICommand<ISetColorCommandParams> = {
type: CommandType.COMMAND,
id: 'sheet.command.set-text-color',
handler: async (accessor, params) => {
- if (!params) {
+ if (!params || !params.value) {
return false;
}
@@ -341,7 +394,7 @@ export const ResetTextColorCommand: ICommand = {
style: {
type: 'cl',
value: {
- rgb: '#000',
+ rgb: null, // use null to reset text color
},
},
};
@@ -354,7 +407,7 @@ export const SetBackgroundColorCommand: ICommand<ISetColorCommandParams> = {
type: CommandType.COMMAND,
id: 'sheet.command.set-background-color',
handler: async (accessor, params) => {
- if (!params) {
+ if (!params || !params.value) {
return false;
}
@@ -381,7 +434,7 @@ export const ResetBackgroundColorCommand: ICommand = {
style: {
type: 'bg',
value: {
- rgb: undefined,
+ rgb: null, // use null to reset background color
},
},
};
diff --git a/packages/base-sheets/src/commands/mutations/set-border-styles.mutation.ts b/packages/base-sheets/src/commands/mutations/set-border-styles.mutation.ts
index 517928d661..86c3466262 100644
--- a/packages/base-sheets/src/commands/mutations/set-border-styles.mutation.ts
+++ b/packages/base-sheets/src/commands/mutations/set-border-styles.mutation.ts
@@ -193,11 +193,23 @@ export function mergeStyle(
}
// Overline/Strikethrough/Underline color follows text color
+ // if ('cl' in backupStyle) {
+ // for (const k in newStyle) {
+ // if (['ul', 'ol', 'st'].includes(k)) {
+ // backupStyle[k].cl = backupStyle.cl;
+ // }
+ // }
+ // }
+
if ('cl' in backupStyle) {
- for (const k in newStyle) {
- if (['ul', 'ol', 'st'].includes(k)) {
- backupStyle[k].cl = backupStyle.cl;
- }
+ if ('ul' in backupStyle) {
+ backupStyle.ul.cl = backupStyle.cl;
+ }
+ if ('ol' in backupStyle) {
+ backupStyle.ol.cl = backupStyle.cl;
+ }
+ if ('st' in backupStyle) {
+ backupStyle.st.cl = backupStyle.cl;
}
}
diff --git a/packages/base-ui/package.json b/packages/base-ui/package.json
index 80af40efbb..517c1f837b 100644
--- a/packages/base-ui/package.json
+++ b/packages/base-ui/package.json
@@ -46,7 +46,7 @@
"dependencies": {
"@univerjs/base-render": "workspace:^0.0.1",
"@univerjs/core": "workspace:^0.0.1",
- "@univerjs/icons": "^0.0.3",
+ "@univerjs/icons": "^0.0.5",
"@wendellhu/redi": "^0.12.8",
"react": "^18.2.0",
"react-colorful": "^5.6.1",
diff --git a/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx b/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
index 3c26fd3b37..f062d64fdc 100644
--- a/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
+++ b/packages/base-ui/src/Components/ColorPicker/ColorPicker.tsx
@@ -274,6 +274,7 @@ export function ColorPicker(props: BaseColorPickerProps) {
const onCancel = () => {
props.onCancel && props.onCancel();
+ props.onValueChange?.('');
};
// const hideSelect = (e?: MouseEvent) => {
diff --git a/packages/base-ui/src/Components/CustomLabel/CustomLabel.module.less b/packages/base-ui/src/Components/CustomLabel/CustomLabel.module.less
index 9b3283e96a..b670bdc6c8 100644
--- a/packages/base-ui/src/Components/CustomLabel/CustomLabel.module.less
+++ b/packages/base-ui/src/Components/CustomLabel/CustomLabel.module.less
@@ -1,5 +1,6 @@
.color-select {
position: relative;
+ display: flex;
.color-select-line {
position: absolute;
@@ -13,6 +14,7 @@
.font-select {
width: 120px;
+ font-size: 14px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
diff --git a/packages/base-ui/src/Components/CustomLabel/CustomLabel.tsx b/packages/base-ui/src/Components/CustomLabel/CustomLabel.tsx
index 1f6eee340a..b7780602aa 100644
--- a/packages/base-ui/src/Components/CustomLabel/CustomLabel.tsx
+++ b/packages/base-ui/src/Components/CustomLabel/CustomLabel.tsx
@@ -167,8 +167,8 @@ export interface IColorSelectProps {
export function ColorSelect({ value, icon, title }: IColorSelectProps) {
return (
<div className={styles.colorSelect}>
- <div>{icon ? <CustomLabel label={{ name: icon }} /> : title}</div>
- <div className={styles.colorSelectLine} style={{ background: value }}></div>
+ {icon ? <CustomLabel label={{ name: icon, props: { color: value } }} /> : title}
+ {/* <div className={styles.colorSelectLine} style={{ background: value }}></div> */}
</div>
);
}
diff --git a/packages/base-ui/src/Components/Dropdown/index.module.less b/packages/base-ui/src/Components/Dropdown/index.module.less
index ca4f61a8de..1676f29131 100644
--- a/packages/base-ui/src/Components/Dropdown/index.module.less
+++ b/packages/base-ui/src/Components/Dropdown/index.module.less
@@ -1,7 +1,7 @@
@import '../../Basics/CSS/Skin/default.module.less';
.dropdown {
- padding: 0px 5px;
+ // padding: 4px 8px;
position: relative;
display: flex;
align-items: center;
@@ -14,9 +14,11 @@
.drop-icon {
height: 100%;
- margin-left: 5px;
- border-left: 1px solid @gray-14;
+ // margin-left: 5px;
+ // border-left: 1px solid @gray-14;
display: flex;
align-items: center;
+ color: var(--grey-400);
+ font-size: 10px;
}
}
diff --git a/packages/base-ui/src/Components/Icon/AddIcon.tsx b/packages/base-ui/src/Components/Icon/AddIcon.tsx
index 621afdc6e1..88079c3eb7 100644
--- a/packages/base-ui/src/Components/Icon/AddIcon.tsx
+++ b/packages/base-ui/src/Components/Icon/AddIcon.tsx
@@ -11,6 +11,7 @@ export interface BaseIconProps extends BaseComponentProps {
name?: string;
width?: string;
height?: string;
+ color?: string;
}
export const Icon = (props: BaseIconProps) => {
const { spin, rotate, children, name, style, className } = props;
diff --git a/packages/base-ui/src/Components/Icon/Cell/index.tsx b/packages/base-ui/src/Components/Icon/Cell/index.tsx
index c6b039261e..097916220b 100644
--- a/packages/base-ui/src/Components/Icon/Cell/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Cell/index.tsx
@@ -1,338 +1,43 @@
-import { BaseIconProps, Icon } from '../AddIcon';
+import {
+ BinaryColorExample24,
+ DownBorde24,
+ InnerBorde24,
+ LeftBorde24,
+ MergeCell24,
+ NoBorders24,
+ OuterBorder24,
+ RightBorde24,
+ TableStyle24,
+ UpBorde24,
+} from '@univerjs/icons';
+
+import { BaseIconProps } from '../AddIcon';
export const FillColorIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5567"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M730.24 562.176l-253.44 253.44-217.173333-217.258667 253.44-253.44 217.173333 217.258667z m-72.405333-0.042667L512.981333 417.28l-180.992 180.992 144.810667 144.853333 181.034667-181.034666z"
- p-id="5568"
- ></path>
- <path
- d="M520.533333 298.666667v230.4H469.333333V349.824H392.533333v179.626667H341.333333V298.666667zM699.733333 554.666667c48.768 0 88.32 37.802667 88.32 84.48 0 46.634667-39.552 84.48-88.32 84.48"
- p-id="5569"
- ></path>
- </svg>
- </Icon>
+ <BinaryColorExample24 extend={{ colorChannel1: props.color || 'white' }} />
);
-export const FullBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5695"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M213.333333 810.666667V256h42.666667v554.666667zM725.333333 810.666667V256h42.666667v554.666667zM469.333333 810.666667V256h42.666667v554.666667z"
- p-id="5696"
- ></path>
- <path
- d="M213.333333 256h554.666667v42.666667H213.333333zM213.333333 512h554.666667v42.666667H213.333333zM213.333333 768h554.666667v42.666667H213.333333z"
- p-id="5697"
- ></path>
- </svg>
- </Icon>
-);
+export const FullBorderIcon = (props: BaseIconProps) => <TableStyle24 />;
-export const TopBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5823"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M213.333333 256h554.666667v42.666667H213.333333z" p-id="5824"></path>
- <path
- d="M213.333333 426.666667h42.666667v42.666666H213.333333zM213.333333 597.333333h42.666667v42.666667H213.333333zM213.333333 341.333333h42.666667v42.666667H213.333333zM213.333333 512h42.666667v42.666667H213.333333zM213.333333 682.666667h42.666667v42.666666H213.333333zM469.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 597.333333h42.666667v42.666667h-42.666667zM725.333333 341.333333h42.666667v42.666667h-42.666667zM725.333333 512h42.666667v42.666667h-42.666667zM725.333333 682.666667h42.666667v42.666666h-42.666667zM725.333333 768h42.666667v42.666667h-42.666667zM469.333333 597.333333h42.666667v42.666667h-42.666667zM469.333333 341.333333h42.666667v42.666667h-42.666667zM469.333333 512h42.666667v42.666667h-42.666667zM469.333333 682.666667h42.666667v42.666666h-42.666667zM213.333333 768h42.666667v42.666667H213.333333zM384 768h42.666667v42.666667H384zM554.666667 768h42.666666v42.666667h-42.666666zM298.666667 768h42.666666v42.666667H298.666667zM469.333333 768h42.666667v42.666667h-42.666667zM640 768h42.666667v42.666667h-42.666667zM384 512h42.666667v42.666667H384zM554.666667 512h42.666666v42.666667h-42.666666zM298.666667 512h42.666666v42.666667H298.666667z"
- p-id="5825"
- ></path>
- <path
- d="M469.333333 512h42.666667v42.666667h-42.666667zM640 512h42.666667v42.666667h-42.666667z"
- p-id="5826"
- ></path>
- </svg>
- </Icon>
-);
+export const TopBorderIcon = (props: BaseIconProps) => <UpBorde24 />;
-export const BottomBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5952"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M768 810.666667H213.333333v-42.666667h554.666667z" p-id="5953"></path>
- <path
- d="M768 640h-42.666667v-42.666667h42.666667zM768 469.333333h-42.666667v-42.666666h42.666667zM768 725.333333h-42.666667v-42.666666h42.666667zM768 554.666667h-42.666667v-42.666667h42.666667zM768 384h-42.666667V341.333333h42.666667z"
- p-id="5954"
- ></path>
- <path d="M512 640h-42.666667v-42.666667h42.666667z" p-id="5955"></path>
- <path
- d="M256 640H213.333333v-42.666667h42.666667zM256 469.333333H213.333333v-42.666666h42.666667zM256 725.333333H213.333333v-42.666666h42.666667zM256 554.666667H213.333333v-42.666667h42.666667zM256 384H213.333333V341.333333h42.666667zM256 298.666667H213.333333V256h42.666667z"
- p-id="5956"
- ></path>
- <path
- d="M512 469.333333h-42.666667v-42.666666h42.666667zM512 725.333333h-42.666667v-42.666666h42.666667zM512 554.666667h-42.666667v-42.666667h42.666667zM512 384h-42.666667V341.333333h42.666667z"
- p-id="5957"
- ></path>
- <path
- d="M768 298.666667h-42.666667V256h42.666667zM597.333333 298.666667h-42.666666V256h42.666666zM426.666667 298.666667H384V256h42.666667zM682.666667 298.666667h-42.666667V256h42.666667zM512 298.666667h-42.666667V256h42.666667zM341.333333 298.666667H298.666667V256h42.666666z"
- p-id="5958"
- ></path>
- <path
- d="M597.333333 554.666667h-42.666666v-42.666667h42.666666zM426.666667 554.666667H384v-42.666667h42.666667zM682.666667 554.666667h-42.666667v-42.666667h42.666667zM512 554.666667h-42.666667v-42.666667h42.666667zM341.333333 554.666667H298.666667v-42.666667h42.666666z"
- p-id="5959"
- ></path>
- </svg>
- </Icon>
-);
+export const BottomBorderIcon = (props: BaseIconProps) => <DownBorde24 />;
-export const LeftBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="6085"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M213.333333 810.666667V256h42.666667v554.666667z" p-id="6086"></path>
- <path
- d="M384 810.666667v-42.666667h42.666667v42.666667zM554.666667 810.666667v-42.666667h42.666666v42.666667zM298.666667 810.666667v-42.666667h42.666666v42.666667zM469.333333 810.666667v-42.666667h42.666667v42.666667zM640 810.666667v-42.666667h42.666667v42.666667z"
- p-id="6087"
- ></path>
- <path
- d="M384 554.666667v-42.666667h42.666667v42.666667zM554.666667 554.666667v-42.666667h42.666666v42.666667zM298.666667 554.666667v-42.666667h42.666666v42.666667zM469.333333 554.666667v-42.666667h42.666667v42.666667zM640 554.666667v-42.666667h42.666667v42.666667zM469.333333 640v-42.666667h42.666667v42.666667zM469.333333 469.333333v-42.666666h42.666667v42.666666zM469.333333 725.333333v-42.666666h42.666667v42.666666z"
- p-id="6088"
- ></path>
- <path
- d="M469.333333 554.666667v-42.666667h42.666667v42.666667zM469.333333 384V341.333333h42.666667v42.666667z"
- p-id="6089"
- ></path>
- <path
- d="M384 298.666667V256h42.666667v42.666667zM554.666667 298.666667V256h42.666666v42.666667zM298.666667 298.666667V256h42.666666v42.666667zM469.333333 298.666667V256h42.666667v42.666667zM640 298.666667V256h42.666667v42.666667zM725.333333 298.666667V256h42.666667v42.666667z"
- p-id="6090"
- ></path>
- <path
- d="M725.333333 810.666667v-42.666667h42.666667v42.666667zM725.333333 640v-42.666667h42.666667v42.666667zM725.333333 469.333333v-42.666666h42.666667v42.666666zM725.333333 725.333333v-42.666666h42.666667v42.666666zM725.333333 554.666667v-42.666667h42.666667v42.666667zM725.333333 384V341.333333h42.666667v42.666667z"
- p-id="6091"
- ></path>
- </svg>
- </Icon>
-);
+export const LeftBorderIcon = (props: BaseIconProps) => <LeftBorde24 />;
-export const RightBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="6217"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M768 256v554.666667h-42.666667V256z" p-id="6218"></path>
- <path
- d="M597.333333 256v42.666667h-42.666666V256zM426.666667 256v42.666667H384V256zM682.666667 256v42.666667h-42.666667V256zM512 256v42.666667h-42.666667V256zM341.333333 256v42.666667H298.666667V256z"
- p-id="6219"
- ></path>
- <path d="M597.333333 512v42.666667h-42.666666v-42.666667z" p-id="6220"></path>
- <path
- d="M597.333333 768v42.666667h-42.666666v-42.666667zM426.666667 768v42.666667H384v-42.666667zM682.666667 768v42.666667h-42.666667v-42.666667zM512 768v42.666667h-42.666667v-42.666667zM341.333333 768v42.666667H298.666667v-42.666667zM256 768v42.666667H213.333333v-42.666667z"
- p-id="6221"
- ></path>
- <path
- d="M426.666667 512v42.666667H384v-42.666667zM682.666667 512v42.666667h-42.666667v-42.666667zM512 512v42.666667h-42.666667v-42.666667zM341.333333 512v42.666667H298.666667v-42.666667z"
- p-id="6222"
- ></path>
- <path
- d="M256 256v42.666667H213.333333V256zM256 426.666667v42.666666H213.333333v-42.666666zM256 597.333333v42.666667H213.333333v-42.666667zM256 341.333333v42.666667H213.333333V341.333333zM256 512v42.666667H213.333333v-42.666667zM256 682.666667v42.666666H213.333333v-42.666666z"
- p-id="6223"
- ></path>
- <path
- d="M512 426.666667v42.666666h-42.666667v-42.666666zM512 597.333333v42.666667h-42.666667v-42.666667zM512 341.333333v42.666667h-42.666667V341.333333zM512 512v42.666667h-42.666667v-42.666667zM512 682.666667v42.666666h-42.666667v-42.666666z"
- p-id="6224"
- ></path>
- </svg>
- </Icon>
-);
+export const RightBorderIcon = (props: BaseIconProps) => <RightBorde24 />;
-export const NoneBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="6350"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M384 810.666667v-42.666667h42.666667v42.666667zM554.666667 810.666667v-42.666667h42.666666v42.666667zM298.666667 810.666667v-42.666667h42.666666v42.666667zM469.333333 810.666667v-42.666667h42.666667v42.666667zM640 810.666667v-42.666667h42.666667v42.666667zM384 554.666667v-42.666667h42.666667v42.666667zM384 298.666667V256h42.666667v42.666667zM554.666667 298.666667V256h42.666666v42.666667zM298.666667 298.666667V256h42.666666v42.666667zM469.333333 298.666667V256h42.666667v42.666667zM640 298.666667V256h42.666667v42.666667zM725.333333 298.666667V256h42.666667v42.666667zM213.333333 298.666667V256h42.666667v42.666667zM554.666667 554.666667v-42.666667h42.666666v42.666667zM298.666667 554.666667v-42.666667h42.666666v42.666667zM469.333333 554.666667v-42.666667h42.666667v42.666667zM640 554.666667v-42.666667h42.666667v42.666667z"
- p-id="6351"
- ></path>
- <path
- d="M725.333333 810.666667v-42.666667h42.666667v42.666667zM213.333333 810.666667v-42.666667h42.666667v42.666667zM725.333333 640v-42.666667h42.666667v42.666667zM213.333333 640v-42.666667h42.666667v42.666667zM725.333333 469.333333v-42.666666h42.666667v42.666666zM213.333333 469.333333v-42.666666h42.666667v42.666666zM725.333333 725.333333v-42.666666h42.666667v42.666666zM213.333333 725.333333v-42.666666h42.666667v42.666666zM725.333333 554.666667v-42.666667h42.666667v42.666667zM213.333333 554.666667v-42.666667h42.666667v42.666667zM725.333333 384V341.333333h42.666667v42.666667zM213.333333 384V341.333333h42.666667v42.666667z"
- p-id="6352"
- ></path>
- <path
- d="M469.333333 640v-42.666667h42.666667v42.666667zM469.333333 469.333333v-42.666666h42.666667v42.666666zM469.333333 725.333333v-42.666666h42.666667v42.666666zM469.333333 554.666667v-42.666667h42.666667v42.666667zM469.333333 384V341.333333h42.666667v42.666667z"
- p-id="6353"
- ></path>
- </svg>
- </Icon>
-);
+export const NoneBorderIcon = (props: BaseIconProps) => <NoBorders24 />;
-export const OuterBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="6479"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M213.333333 810.666667V256h42.666667v554.666667zM725.333333 810.666667V256h42.666667v554.666667z"
- p-id="6480"
- ></path>
- <path
- d="M213.333333 256h554.666667v42.666667H213.333333zM213.333333 768h554.666667v42.666667H213.333333z"
- p-id="6481"
- ></path>
- <path
- d="M384 554.666667v-42.666667h42.666667v42.666667zM554.666667 554.666667v-42.666667h42.666666v42.666667zM298.666667 554.666667v-42.666667h42.666666v42.666667zM469.333333 554.666667v-42.666667h42.666667v42.666667zM640 554.666667v-42.666667h42.666667v42.666667zM469.333333 640v-42.666667h42.666667v42.666667zM469.333333 469.333333v-42.666666h42.666667v42.666666zM469.333333 725.333333v-42.666666h42.666667v42.666666z"
- p-id="6482"
- ></path>
- <path
- d="M469.333333 554.666667v-42.666667h42.666667v42.666667zM469.333333 384V341.333333h42.666667v42.666667z"
- p-id="6483"
- ></path>
- </svg>
- </Icon>
-);
+export const OuterBorderIcon = (props: BaseIconProps) => <OuterBorder24 />;
-export const InnerBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="6609"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M213.333333 512h554.666667v42.666667H213.333333z" p-id="6610"></path>
- <path d="M512 256v554.666667h-42.666667V256z" p-id="6611"></path>
- <path
- d="M213.333333 426.666667h42.666667v42.666666H213.333333zM213.333333 597.333333h42.666667v42.666667H213.333333zM213.333333 341.333333h42.666667v42.666667H213.333333zM213.333333 682.666667h42.666667v42.666666H213.333333zM725.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 597.333333h42.666667v42.666667h-42.666667zM725.333333 341.333333h42.666667v42.666667h-42.666667zM725.333333 682.666667h42.666667v42.666666h-42.666667zM725.333333 768h42.666667v42.666667h-42.666667zM725.333333 256h42.666667v42.666667h-42.666667zM213.333333 768h42.666667v42.666667H213.333333zM213.333333 256h42.666667v42.666667H213.333333zM384 768h42.666667v42.666667H384zM384 256h42.666667v42.666667H384zM554.666667 768h42.666666v42.666667h-42.666666zM554.666667 256h42.666666v42.666667h-42.666666zM298.666667 768h42.666666v42.666667H298.666667zM298.666667 256h42.666666v42.666667H298.666667zM640 768h42.666667v42.666667h-42.666667zM640 256h42.666667v42.666667h-42.666667z"
- p-id="6612"
- ></path>
- </svg>
- </Icon>
-);
+export const InnerBorderIcon = (props: BaseIconProps) => <InnerBorde24 />;
-export const StripingBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="6866"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M213.333333 512h554.666667v42.666667H213.333333z" p-id="6867"></path>
- <path
- d="M213.333333 426.666667h42.666667v42.666666H213.333333zM213.333333 597.333333h42.666667v42.666667H213.333333zM213.333333 341.333333h42.666667v42.666667H213.333333zM213.333333 682.666667h42.666667v42.666666H213.333333zM725.333333 426.666667h42.666667v42.666666h-42.666667zM469.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 597.333333h42.666667v42.666667h-42.666667zM469.333333 597.333333h42.666667v42.666667h-42.666667zM725.333333 341.333333h42.666667v42.666667h-42.666667zM469.333333 341.333333h42.666667v42.666667h-42.666667zM725.333333 682.666667h42.666667v42.666666h-42.666667zM469.333333 682.666667h42.666667v42.666666h-42.666667zM725.333333 768h42.666667v42.666667h-42.666667zM725.333333 256h42.666667v42.666667h-42.666667zM213.333333 768h42.666667v42.666667H213.333333zM213.333333 256h42.666667v42.666667H213.333333zM384 768h42.666667v42.666667H384zM384 256h42.666667v42.666667H384zM554.666667 768h42.666666v42.666667h-42.666666zM554.666667 256h42.666666v42.666667h-42.666666zM298.666667 768h42.666666v42.666667H298.666667zM298.666667 256h42.666666v42.666667H298.666667zM469.333333 768h42.666667v42.666667h-42.666667zM469.333333 256h42.666667v42.666667h-42.666667zM640 768h42.666667v42.666667h-42.666667zM640 256h42.666667v42.666667h-42.666667z"
- p-id="6868"
- ></path>
- </svg>
- </Icon>
-);
+export const StripingBorderIcon = (props: BaseIconProps) => <InnerBorde24 />;
-export const VerticalBorderIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="6994"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M213.333333 426.666667h42.666667v42.666666H213.333333zM213.333333 597.333333h42.666667v42.666667H213.333333zM213.333333 341.333333h42.666667v42.666667H213.333333zM213.333333 682.666667h42.666667v42.666666H213.333333zM725.333333 426.666667h42.666667v42.666666h-42.666667zM725.333333 597.333333h42.666667v42.666667h-42.666667zM725.333333 341.333333h42.666667v42.666667h-42.666667zM725.333333 682.666667h42.666667v42.666666h-42.666667zM725.333333 768h42.666667v42.666667h-42.666667zM725.333333 256h42.666667v42.666667h-42.666667zM725.333333 512h42.666667v42.666667h-42.666667zM213.333333 768h42.666667v42.666667H213.333333zM213.333333 256h42.666667v42.666667H213.333333zM213.333333 512h42.666667v42.666667H213.333333zM384 768h42.666667v42.666667H384zM384 256h42.666667v42.666667H384zM384 512h42.666667v42.666667H384zM554.666667 768h42.666666v42.666667h-42.666666zM554.666667 256h42.666666v42.666667h-42.666666zM554.666667 512h42.666666v42.666667h-42.666666zM298.666667 768h42.666666v42.666667H298.666667zM298.666667 256h42.666666v42.666667H298.666667zM298.666667 512h42.666666v42.666667H298.666667zM469.333333 768h42.666667v42.666667h-42.666667zM469.333333 256h42.666667v42.666667h-42.666667zM469.333333 512h42.666667v42.666667h-42.666667zM640 768h42.666667v42.666667h-42.666667zM640 256h42.666667v42.666667h-42.666667zM640 512h42.666667v42.666667h-42.666667z"
- p-id="6995"
- ></path>
- <path d="M512 256v554.666667h-42.666667V256z" p-id="6996"></path>
- </svg>
- </Icon>
-);
+export const VerticalBorderIcon = (props: BaseIconProps) => <InnerBorde24 />;
-export const MergeIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="7122"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M810.666667 213.333333v597.333334H213.333333V213.333333h597.333334z m-42.666667 42.666667H256v512h512V256z"
- p-id="7123"
- ></path>
- <path
- d="M389.162667 426.666667l90.538666 90.496-90.538666 90.538666-30.165334-30.165333 37.802667-37.845333-119.466667 0.042666v-42.666666l121.856-0.042667-40.192-40.192 30.165334-30.165333zM645.162667 426.666667L554.666667 517.162667l90.496 90.538666 30.165333-30.165333-37.76-37.845333 119.466667 0.042666v-42.666666l-121.856-0.042667 40.149333-40.192-30.165333-30.165333z"
- p-id="7124"
- ></path>
- </svg>
- </Icon>
-);
+export const MergeIcon = (props: BaseIconProps) => <MergeCell24 />;
export default {
FillColorIcon,
diff --git a/packages/base-ui/src/Components/Icon/Font/index.tsx b/packages/base-ui/src/Components/Icon/Font/index.tsx
index 9d9bcff557..4f9a11cdca 100644
--- a/packages/base-ui/src/Components/Icon/Font/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Font/index.tsx
@@ -1,120 +1,14 @@
-import { BaseIconProps, Icon } from '../AddIcon';
+import { Strikethrough24, TextBold24, TextColor24, TextItalic24, Underline24 } from '@univerjs/icons';
-export const BoldIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5565"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M298.666667 213.333333h224a174.208 174.208 0 0 1 141.952 275.242667A174.208 174.208 0 0 1 572.458667 810.666667H298.666667V213.333333z m273.792 348.458667l-174.250667-0.042667v149.333334h174.250667a74.666667 74.666667 0 0 0 6.101333-149.077334l-6.101333-0.213333zM398.208 312.874667v149.333333h124.458667a74.666667 74.666667 0 0 0 6.144-149.077333l-6.144-0.256H398.208z"
- p-id="5566"
- ></path>
- </svg>
- </Icon>
-);
+import { BaseIconProps } from '../AddIcon';
-export const ItalicIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5692"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M469.333333 256h170.666667v42.666667h-170.666667z" p-id="5693"></path>
- <path d="M573.738667 284.586667l-81.493334 462.208-41.984-7.381334 81.493334-462.208z" p-id="5694"></path>
- <path d="M384 725.333333h170.666667v42.666667H384z" p-id="5695"></path>
- </svg>
- </Icon>
-);
+// TODO The toolbar should use the icon directly
+export const BoldIcon = (props: BaseIconProps) => <TextBold24 />;
+export const ItalicIcon = (props: BaseIconProps) => <TextItalic24 />;
+export const DeleteLineIcon = (props: BaseIconProps) => <Strikethrough24 style={props.style} />;
+export const UnderLineIcon = (props: BaseIconProps) => <Underline24 />;
-export const DeleteLineIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5311"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M298.666667 256h426.666666v42.666667H298.666667z" p-id="5312"></path>
- <path
- d="M533.290667 554.666667l0.042666 192h-42.666666l-0.042667-192h42.666667z m0.042666-277.333334l-0.042666 234.666667h-42.666667l0.042667-234.666667h42.666666zM320 256v85.333333h-42.666667V256zM746.666667 256v85.333333h-42.666667V256z"
- p-id="5313"
- ></path>
- <path
- d="M256 469.333333h512v42.666667H256zM426.666667 725.333333h170.666666v42.666667h-170.666666z"
- p-id="5314"
- ></path>
- </svg>
- </Icon>
-);
-
-export const UnderLineIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5318"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M362.666667 256v298.666667a149.333333 149.333333 0 0 0 298.453333 8.192L661.333333 554.666667V256h42.666667v298.666667a192 192 0 0 1-383.786667 9.045333L320 554.666667V256h42.666667z"
- p-id="5319"
- ></path>
- <path
- d="M256 768m21.333333 0l469.333334 0q21.333333 0 21.333333 21.333333l0 0q0 21.333333-21.333333 21.333334l-469.333334 0q-21.333333 0-21.333333-21.333334l0 0q0-21.333333 21.333333-21.333333Z"
- p-id="5320"
- ></path>
- <path
- d="M256 256m21.333333 0l128 0q21.333333 0 21.333334 21.333333l0 0q0 21.333333-21.333334 21.333334l-128 0q-21.333333 0-21.333333-21.333334l0 0q0-21.333333 21.333333-21.333333Z"
- p-id="5321"
- ></path>
- <path
- d="M597.333333 256m21.333334 0l128 0q21.333333 0 21.333333 21.333333l0 0q0 21.333333-21.333333 21.333334l-128 0q-21.333333 0-21.333334-21.333334l0 0q0-21.333333 21.333334-21.333333Z"
- p-id="5322"
- ></path>
- </svg>
- </Icon>
-);
-
-export const TextColorIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5440"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M549.546667 256l194.133333 533.333333h-45.354667l-77.653333-213.333333H421.632l-77.653333 213.333333H298.666667L492.757333 256h56.789334z m-28.416 46.634667L437.162667 533.333333h167.978666l-84.010666-230.698666z"
- p-id="5441"
- ></path>
- </svg>
- </Icon>
-);
+export const TextColorIcon = (props: BaseIconProps) => <TextColor24 style={{ color: props.color }} />;
export default {
BoldIcon,
diff --git a/packages/base-ui/src/Components/Icon/Format/index.tsx b/packages/base-ui/src/Components/Icon/Format/index.tsx
index 1a8f50e3e9..f14b050f6d 100644
--- a/packages/base-ui/src/Components/Icon/Format/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Format/index.tsx
@@ -1,44 +1,10 @@
+import { Redo24, Undo24 } from '@univerjs/icons';
+
import { BaseIconProps, Icon } from '../AddIcon';
-export const BackIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5692"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M737.664 419.328H426.666667v42.666667h311.296l-84.48 84.437333a21.333333 21.333333 0 0 0 30.208 30.165333l120.746666-120.704a21.290667 21.290667 0 0 0 0-30.165333l-120.746666-120.661333a21.333333 21.333333 0 0 0-30.165334 30.165333l84.138667 84.096zM213.333333 632.661333a213.333333 213.333333 0 0 1 213.333334-213.333333v42.666667a170.666667 170.666667 0 0 0-170.666667 170.666666H213.333333z m0 0h42.666667v64a21.333333 21.333333 0 0 1-42.666667 0v-64z"
- p-id="5693"
- ></path>
- </svg>
- </Icon>
-);
+export const BackIcon = (props: BaseIconProps) => <Redo24 />;
-export const ForwardIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} className={props.className} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5565"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M287.018667 419.328h310.997333v42.666667H286.72l84.48 84.437333a21.333333 21.333333 0 1 1-30.208 30.165333l-120.746667-120.704a21.248 21.248 0 0 1 0-30.165333l120.746667-120.661333a21.333333 21.333333 0 0 1 30.165333 30.165333L287.018667 419.328z m524.330666 213.333333a213.333333 213.333333 0 0 0-213.333333-213.333333v42.666667a170.666667 170.666667 0 0 1 170.666667 170.666666h42.666666z m0 0h-42.666666v64a21.333333 21.333333 0 1 0 42.666666 0v-64z"
- p-id="5566"
- ></path>
- </svg>
- </Icon>
-);
+export const ForwardIcon = (props: BaseIconProps) => <Undo24 />;
export const FormatIcon = (props: BaseIconProps) => (
<Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
diff --git a/packages/base-ui/src/Components/Icon/Text/index.tsx b/packages/base-ui/src/Components/Icon/Text/index.tsx
index d8c5e6881a..4e7e3838e6 100644
--- a/packages/base-ui/src/Components/Icon/Text/index.tsx
+++ b/packages/base-ui/src/Components/Icon/Text/index.tsx
@@ -1,314 +1,47 @@
-import { BaseIconProps, Icon } from '../AddIcon';
+import {
+ Autowrap24,
+ LeftRotation45Degrees24,
+ LeftRotation90Degrees24,
+ Overflow24,
+ RightRotation45Degrees24,
+ RightRotation90Degrees24,
+ TextDown24,
+ TextHorizontallyCenter24,
+ TextLeft24,
+ TextRight24,
+ TextRotation24,
+ TextUp24,
+ TextVertical24,
+ TextVerticallyCenter24,
+ Truncation24,
+} from '@univerjs/icons';
-export const LeftAlignIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="7250"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666z m0 128h341.333333a21.333333 21.333333 0 0 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z m0 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666z m0 128h341.333333a21.333333 21.333333 0 0 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
- p-id="7251"
- ></path>
- </svg>
- </Icon>
-);
+import { BaseIconProps } from '../AddIcon';
-export const CenterAlignIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="7377"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666zM341.333333 426.666667h341.333334a21.333333 21.333333 0 1 1 0 42.666666H341.333333a21.333333 21.333333 0 0 1 0-42.666666z m-106.666666 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666zM341.333333 682.666667h341.333334a21.333333 21.333333 0 1 1 0 42.666666H341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
- p-id="7378"
- ></path>
- </svg>
- </Icon>
-);
+export const LeftAlignIcon = (props: BaseIconProps) => <TextLeft24 />;
-export const RightAlignIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="7504"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M234.666667 298.666667h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 1 1 0-42.666666z m213.333333 128h341.333333a21.333333 21.333333 0 1 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z m-213.333333 128h554.666666a21.333333 21.333333 0 1 1 0 42.666666h-554.666666a21.333333 21.333333 0 0 1 0-42.666666z m213.333333 128h341.333333a21.333333 21.333333 0 1 1 0 42.666666h-341.333333a21.333333 21.333333 0 0 1 0-42.666666z"
- p-id="7505"
- ></path>
- </svg>
- </Icon>
-);
+export const CenterAlignIcon = (props: BaseIconProps) => <TextHorizontallyCenter24 />;
-export const TopVerticalIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="7631"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M298.666667 384h426.666666v42.666667H298.666667zM416 527.829333l90.496-90.496 90.538667 90.496-30.165334 30.165334-37.802666-37.717334v290.090667h-42.666667v-292.565333l-40.234667 40.192-30.165333-30.165334z"
- p-id="7632"
- ></path>
- </svg>
- </Icon>
-);
+export const RightAlignIcon = (props: BaseIconProps) => <TextRight24 />;
-export const CenterVerticalIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="7758"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M725.333333 533.333333H298.666667v-42.666666h426.666666zM426.666667 634.496l90.496-90.496 90.538666 90.496-30.165333 30.165333-39.936-39.850666v121.557333h-42.666667v-119.765333l-38.101333 38.058666-30.165333-30.165333zM426.666667 389.162667l90.496 90.538666 90.538666-90.538666-30.165333-30.165334-39.936 39.893334V277.333333h-42.666667v119.765334l-38.101333-38.101334-30.165333 30.165334z"
- p-id="7759"
- ></path>
- </svg>
- </Icon>
-);
+export const TopVerticalIcon = (props: BaseIconProps) => <TextUp24 />;
-export const BottomVerticalIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="7885"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M725.333333 725.333333H298.666667v-42.666666h426.666666zM608 581.504l-90.496 90.496-90.538667-90.496 30.165334-30.165333 37.802666 37.717333V298.965333h42.666667v292.565334l40.234667-40.192 30.165333 30.165333z"
- p-id="7886"
- ></path>
- </svg>
- </Icon>
-);
+export const CenterVerticalIcon = (props: BaseIconProps) => <TextVerticallyCenter24 />;
-export const TextRotateIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="8217"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M549.546667 213.333333l77.653333 213.333334h0.64l-0.042667 1.621333 53.76 147.712h-45.354666l-38.826667-106.666667h-152.405333l-38.826667 106.666667H360.789333l53.674667-147.498667 0.042667-1.834666h0.64l77.610666-213.333334h56.789334z m-28.416 46.634667L460.458667 426.666667h121.386666l-60.714666-166.698667zM709.162667 618.666667l90.538666 90.496-90.538666 90.538666-30.165334-30.165333 37.76-37.802667H256v-42.666666h463.232l-40.234667-40.234667 30.165334-30.165333z"
- p-id="8218"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateAngleUpIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="4524"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M290.944 289.365333l205.738667 95.914667 0.469333-0.426667 1.109333 1.152 142.506667 66.432-32.128 32.085334-102.826667-47.957334-107.818666 107.733334 48 102.912-32.085334 32.042666-66.346666-142.250666-1.28-1.28 0.469333-0.512-96-205.696 40.192-40.149334z m12.885333 53.034667l74.965334 160.810667 85.845333-85.845334L303.786667 342.4zM690.432 463.104h128v128h-42.666667v-53.418667l-325.845333 325.802667-30.165333-30.165333 327.552-327.552h-56.874667v-42.666667z"
- fill="#444D5A"
- p-id="4525"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateAngleDownIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="4659"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M755.968 312.277333l-95.914667 205.738667 0.426667 0.469333-1.152 1.109334-66.432 142.506666-32.085333-32.128 47.957333-102.826666-107.733333-107.818667-102.912 48-32.042667-32.085333 142.250667-66.346667 1.28-1.28 0.512 0.469333 205.696-96 40.149333 40.192z m-53.034667 12.885334l-160.810666 74.965333 85.845333 85.845333 74.965333-160.810666zM582.229333 711.765333v128h-128v-42.666666h53.418667l-325.802667-325.845334 30.165334-30.165333 327.552 327.552v-56.874667h42.666666z"
- fill="#444D5A"
- p-id="4660"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateVerticalIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="4794"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M636.757333 298.666667l77.653334 213.333333h0.64l-0.042667 1.621333 53.76 147.712h-45.354667l-38.826666-106.666666h-152.405334l-38.826666 106.666666H448l53.674667-147.498666 0.042666-1.834667h0.64l77.610667-213.333333h56.789333z m-28.416 46.634666L547.669333 512h121.386667l-60.714667-166.698667zM394.368 698.496L303.786667 789.034667 213.333333 698.453333l30.165334-30.165333 37.802666 37.76V245.333333h42.666667v463.232l40.234667-40.234666 30.165333 30.165333z"
- fill="#444D5A"
- p-id="4795"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateRotationUpIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="4929"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M192 495.786667l213.333333-77.653334v-0.64l1.621334 0.042667L554.666667 363.776v45.354667l-106.666667 38.826666v152.405334l106.666667 38.826666v45.354667l-147.498667-53.674667-1.834667-0.042666v-0.64l-213.333333-77.610667V495.786667z m46.634667 28.416L405.333333 584.874667v-121.386667l-166.698666 60.714667zM597.333333 336.170667l90.496-90.538667 90.538667 90.538667-30.165333 30.165333-37.802667-37.76V789.333333h-42.666667V326.101333l-40.234666 40.234667L597.333333 336.170667z"
- fill="#444D5A"
- p-id="4930"
- ></path>
- </svg>
- </Icon>
-);
-export const TextRotateRotationDownIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="5199"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M789.333333 528.213333l-213.333333 77.653334v0.64l-1.621333-0.042667L426.666667 660.224v-45.354667l106.666666-38.826666V423.637333l-106.666666-38.826666V339.456l147.498666 53.674667 1.834667 0.042666v0.64l213.333333 77.610667v56.789333z m-46.634666-28.416L576 439.125333v121.386667l166.698667-60.714667zM384 687.829333l-90.496 90.538667-90.538667-90.538667 30.165334-30.165333 37.802666 37.76V234.666667h42.666667v463.232l40.234667-40.234667 30.165333 30.165333z"
- fill="#444D5A"
- p-id="5200"
- ></path>
- </svg>
- </Icon>
-);
+export const BottomVerticalIcon = (props: BaseIconProps) => <TextDown24 />;
-export const BrIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="8736"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M213.333333 213.333333h85.12v597.333334H213.333333V213.333333z m225.450667 477.44l25.557333-21.333333-72.362666-63.786667 72.362666-63.872-25.557333-21.248-93.610667 80.853334h4.266667-4.266667l93.610667 89.386666z"
- p-id="8737"
- ></path>
- <path d="M768 213.333333h42.581333v597.333334H768z" p-id="8738"></path>
- <path
- d="M540.928 367.274667H391.978667v42.581333h148.949333c59.605333 0 106.410667 38.314667 106.410667 85.12s-46.805333 85.12-106.410667 85.12H391.978667v42.581333h148.949333c85.12 0 157.482667-55.338667 157.482667-127.701333s-72.362667-127.701333-157.44-127.701333z"
- p-id="8739"
- ></path>
- </svg>
- </Icon>
-);
+export const TextRotateIcon = (props: BaseIconProps) => <TextRotation24 />;
+export const TextRotateAngleUpIcon = (props: BaseIconProps) => <LeftRotation45Degrees24 />;
+export const TextRotateAngleDownIcon = (props: BaseIconProps) => <RightRotation45Degrees24 />;
+export const TextRotateVerticalIcon = (props: BaseIconProps) => <TextVertical24 />;
+export const TextRotateRotationUpIcon = (props: BaseIconProps) => <LeftRotation90Degrees24 />;
+export const TextRotateRotationDownIcon = (props: BaseIconProps) => <RightRotation90Degrees24 />;
-export const OverflowIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="8608"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path
- d="M300.288 810.666667H213.333333V213.333333h86.954667v279.978667h441.898667l-91.306667-85.845333 26.624-26.112L810.666667 512l-133.162667 130.688-26.624-26.154667 91.306667-85.845333-441.898667-0.042667z"
- p-id="8609"
- ></path>
- <path
- d="M530.688 213.333333h42.666667v242.688h-42.666667V213.333333z m0 354.688h42.666667V810.666667h-42.666667v-242.688z"
- p-id="8610"
- ></path>
- </svg>
- </Icon>
-);
+export const BrIcon = (props: BaseIconProps) => <Autowrap24 />;
-export const CutIcon = (props: BaseIconProps) => (
- <Icon spin={props.spin} rotate={props.rotate} name="foward" style={props.style}>
- <svg
- className="icon"
- viewBox="0 0 1024 1024"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- p-id="8865"
- width="1em"
- height="1em"
- fill="currentColor"
- >
- <path d="M767.829333 213.333333h42.496v597.333334h-42.496z" p-id="8866"></path>
- <path
- d="M767.146667 553.216h-384v-42.496h384v42.496zM213.333333 213.333333h84.992v597.333334H213.333333V213.333333z"
- p-id="8867"
- ></path>
- </svg>
- </Icon>
-);
+export const OverflowIcon = (props: BaseIconProps) => <Overflow24 />;
+
+export const CutIcon = (props: BaseIconProps) => <Truncation24 />;
export default {
LeftAlignIcon,
diff --git a/packages/base-ui/src/Components/Menu/Menu.tsx b/packages/base-ui/src/Components/Menu/Menu.tsx
index 8080d8f015..56d82e22e4 100644
--- a/packages/base-ui/src/Components/Menu/Menu.tsx
+++ b/packages/base-ui/src/Components/Menu/Menu.tsx
@@ -602,12 +602,12 @@ export const Menu = (props: BaseMenuProps) => {
)}
onClick={() => {
// Execute the callback function
- if (option.value) {
- onOptionSelect?.({
- ...option,
- show: option.showAfterClick,
- });
- }
+ // if (option.value) { // color picker cancel use ''
+ onOptionSelect?.({
+ ...option,
+ show: option.showAfterClick,
+ });
+ // }
}}
>
<NeoCustomLabel
diff --git a/packages/base-ui/src/Components/Menu/index.module.less b/packages/base-ui/src/Components/Menu/index.module.less
index bb5d12e3b9..3392751084 100644
--- a/packages/base-ui/src/Components/Menu/index.module.less
+++ b/packages/base-ui/src/Components/Menu/index.module.less
@@ -28,8 +28,8 @@
user-select: none;
// FIXME use token instead
- padding: 4px;
- margin: 4px 8px;
+ padding: var(--padding-xs);
+ margin: var(--margin-xs) var(--margin-sm);
font-size: 14px;
border-radius: var(--border-radius-base);
diff --git a/packages/base-ui/src/Components/Select/Select.tsx b/packages/base-ui/src/Components/Select/Select.tsx
index 567b9647f3..2e89da7ab0 100644
--- a/packages/base-ui/src/Components/Select/Select.tsx
+++ b/packages/base-ui/src/Components/Select/Select.tsx
@@ -316,6 +316,7 @@
// return <div className={styles.selectComponent}>{this.getType(type)}</div>;
// }
// }
+import { Dropdown12 } from '@univerjs/icons';
import React, { useEffect, useRef, useState } from 'react';
import { ICustomComponent } from '../../Common';
@@ -698,7 +699,7 @@ export function Select(props: BaseSelectProps) {
display: displayInSubMenu,
onClose,
}}
- icon={<NextIcon />}
+ icon={<Dropdown12 />}
>
<div className={styles.selectLabel}>
<NeoCustomLabel
diff --git a/packages/base-ui/src/Components/Select/index.module.less b/packages/base-ui/src/Components/Select/index.module.less
index ce250a5d70..5a7faa2aa9 100644
--- a/packages/base-ui/src/Components/Select/index.module.less
+++ b/packages/base-ui/src/Components/Select/index.module.less
@@ -2,11 +2,14 @@
.select-component {
position: relative;
- margin: 0 3px;
- height: 26px;
+ display: flex;
+ align-items: center;
+ border-radius: var(--border-radius-base);
+ // margin: 0 3px;
+ // height: 26px;
&:hover {
- background-color: var(--gray-14);
+ background-color: var(--grey-100);
}
.select-button {
@@ -61,12 +64,12 @@
}
.select-double {
- &:hover {
- background: @bg-color-hover;
- }
+ // &:hover {
+ // background: @bg-color-hover;
+ // }
.dropdown {
- padding-right: 0;
+ // padding-right: 0;
}
.drop-content {
@@ -84,21 +87,31 @@
}
.drop-icon {
- border-left: 1px solid transparent;
- }
+ // border-left: 1px solid transparent;
+ height: 26px;
+ padding: 0 2px;
- &:hover {
- .drop-icon {
- // TODO: Use different background color to distinguish the hover state
- // border-left: 1px solid var(--gray-6);// new design, no border
+ &:hover{
+ background-color: var(--grey-300);
+ border-radius: 0 var(--border-radius-base) var(--border-radius-base) 0;
}
}
}
.select-label {
+ display: flex;
+ align-items: center;
+ height: 26px;
+ font-size: 18px;//icon size
+ padding: 0 4px;
span[role='img'] {
font-size: 24px;
}
+
+ &:hover{
+ background-color: var(--grey-300);
+ border-radius: var(--border-radius-base) 0 0 var(--border-radius-base);
+ }
}
button {
diff --git a/packages/base-ui/src/Components/Tooltip/index.module.less b/packages/base-ui/src/Components/Tooltip/index.module.less
index 7071c8b0e5..464a1989de 100644
--- a/packages/base-ui/src/Components/Tooltip/index.module.less
+++ b/packages/base-ui/src/Components/Tooltip/index.module.less
@@ -42,7 +42,7 @@
.tooltip-body {
width: 100%;
height: 100%;
- display: inline-flex;
+ display: flex;
&:hover~.tooltip-title {
position: absolute;
diff --git a/packages/base-ui/src/views/components/toolbar/button/index.module.less b/packages/base-ui/src/views/components/toolbar/button/index.module.less
new file mode 100644
index 0000000000..245ac03b98
--- /dev/null
+++ b/packages/base-ui/src/views/components/toolbar/button/index.module.less
@@ -0,0 +1,55 @@
+@import '../../../../Components/Button/Style/mixin.less';
+
+.btn {
+ line-height: @line-height-base;
+ .btn();
+ .btn-default();
+
+ >span {
+ display: inline-block;
+ }
+
+ &-text {
+ .button-color(var(--text-color), transparent, transparent);
+ box-shadow: none;
+
+ &:hover {
+ color: var(--text-color);
+ background-color: var(--grey-100);
+ border-color: transparent;
+ }
+
+ // &:active {
+ // color: var(--text-color);
+ // background: #eee;
+ // border-color: transparent;
+ // }
+ .button-disabled(var(--disabled-color); transparent; transparent);
+ &-active {
+ color: var(--text-color);
+ background-color: var(--grey-100);
+ border-color: transparent;
+ }
+ height: 26px;
+ }
+
+ &::before {
+ position: absolute;
+ top: -@border-width-base;
+ right: -@border-width-base;
+ bottom: -@border-width-base;
+ left: -@border-width-base;
+ z-index: 1;
+ display: none;
+ background: @bg-color-secondary;
+ border-radius: inherit;
+ opacity: 0.35;
+ transition: opacity 0.2s;
+ content: '';
+ pointer-events: none;
+ }
+
+ &:active>span {
+ position: relative;
+ }
+}
diff --git a/packages/base-ui/src/views/components/toolbar/button/toolbar-button.tsx b/packages/base-ui/src/views/components/toolbar/button/toolbar-button.tsx
new file mode 100644
index 0000000000..f32d4da3d8
--- /dev/null
+++ b/packages/base-ui/src/views/components/toolbar/button/toolbar-button.tsx
@@ -0,0 +1,58 @@
+import { joinClassNames } from '../../../../Utils/util';
+import styles from './index.module.less';
+
+export interface IBaseToolbarButtonProps {
+ children?: React.ReactNode;
+
+ /** Semantic DOM class */
+ className?: string;
+
+ /** Semantic DOM style */
+ style?: React.CSSProperties;
+
+ /**
+ * Disabled state of button
+ * @default false
+ */
+ disabled?: boolean;
+
+ /** Set the handler to handle `click` event */
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
+
+ /**
+ * Set the button is activated
+ * @default false
+ */
+ active?: boolean;
+}
+
+/**
+ * Button Component
+ */
+export function ToolbarButton(props: IBaseToolbarButtonProps) {
+ const { children, className, style, disabled = false, active = false, onClick } = props;
+
+ const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
+ if (disabled) {
+ e.preventDefault();
+ return;
+ }
+
+ onClick && onClick(e);
+ };
+
+ const _className = joinClassNames(
+ styles.btn,
+ `${styles.btn}-text`,
+ {
+ [`${styles.btn}-text-active`]: active,
+ },
+ className
+ );
+
+ return (
+ <button className={_className} style={style} disabled={disabled} onClick={handleClick}>
+ {children}
+ </button>
+ );
+}
diff --git a/packages/base-ui/src/views/components/toolbar/index.module.less b/packages/base-ui/src/views/components/toolbar/index.module.less
index 04afad766a..7ce4ca47db 100644
--- a/packages/base-ui/src/views/components/toolbar/index.module.less
+++ b/packages/base-ui/src/views/components/toolbar/index.module.less
@@ -36,7 +36,7 @@
height: 26px;
display: inline-block;
vertical-align: middle;
- margin: 0 3px;
+ margin: 0 1px;
cursor: pointer;
&.select-button:hover {
@@ -96,23 +96,27 @@
}
.select-single {
- height: 26px;
- line-height: 26px;
+ // height: 26px;
+ // line-height: 26px;
}
.select-input {
- height: 26px;
- line-height: 26px;
+ // height: 26px;
+ // line-height: 26px;
}
.select-double {
- height: 26px;
- line-height: 26px;
+ // height: 26px;
+ // line-height: 26px;
}
button {
- padding: 0;
- height: 26px;
+ padding: 0 4px; // FIXME Set the BIUS buttons, the target is 26 * 26, padding 4px, but only 27.6 * 26 can be obtained
+ display: flex;
+ align-items: center;
+ // height: 26px;
+ font-size: 18px;
+ border-radius: var(--border-radius-base);
}
span[role='img'].univericon-nextIcon {
diff --git a/packages/base-ui/src/views/components/toolbar/toolbar-item.tsx b/packages/base-ui/src/views/components/toolbar/toolbar-item.tsx
index ccc3f535b7..55184077b5 100644
--- a/packages/base-ui/src/views/components/toolbar/toolbar-item.tsx
+++ b/packages/base-ui/src/views/components/toolbar/toolbar-item.tsx
@@ -3,7 +3,6 @@ import { Component } from 'react';
import { Subscription } from 'rxjs';
import { AppContext } from '../../../Common/AppContext';
-import { Button } from '../../../Components/Button/Button';
import { CustomLabel } from '../../../Components/CustomLabel/CustomLabel';
import { Select } from '../../../Components/Select/Select';
import { Tooltip } from '../../../Components/Tooltip/Tooltip';
@@ -15,6 +14,7 @@ import {
IValueOption,
MenuItemType,
} from '../../../services/menu/menu';
+import { ToolbarButton } from './button/toolbar-button';
import styles from './index.module.less';
export interface IToolbarItemStatus {
@@ -131,14 +131,14 @@ export class ToolbarItem extends Component<IDisplayMenuItem<IMenuItem>, IToolbar
return (
<Tooltip title={this.getTooltip()} placement="bottom">
- <Button
+ <ToolbarButton
active={activated}
className={styles.textButton}
disabled={disabled}
onClick={() => commandService.executeCommand(props.id)}
>
<CustomLabel label={icon ? { name: icon } : title} />
- </Button>
+ </ToolbarButton>
</Tooltip>
);
}
diff --git a/packages/ui-plugin-sheets/src/Locale/en.ts b/packages/ui-plugin-sheets/src/Locale/en.ts
index 29ccc4bd0d..b63b33d0e6 100644
--- a/packages/ui-plugin-sheets/src/Locale/en.ts
+++ b/packages/ui-plugin-sheets/src/Locale/en.ts
@@ -375,6 +375,7 @@ export default {
borderVertical: 'borderVertical',
borderColor: 'borderColor',
borderSize: 'borderSize',
+ borderType: 'borderType',
},
merge: {
all: 'Merge all',
diff --git a/packages/ui-plugin-sheets/src/Locale/zh.ts b/packages/ui-plugin-sheets/src/Locale/zh.ts
index edc4bfbafa..ccb1153a30 100644
--- a/packages/ui-plugin-sheets/src/Locale/zh.ts
+++ b/packages/ui-plugin-sheets/src/Locale/zh.ts
@@ -238,6 +238,7 @@ export default {
borderVertical: '内侧竖线',
borderColor: '边框颜色',
borderSize: '边框粗细',
+ borderType: '边框线类型',
},
merge: {
all: '全部合并',
diff --git a/packages/ui-plugin-sheets/src/controller/menu/__tests__/menu.spec.ts b/packages/ui-plugin-sheets/src/controller/menu/__tests__/menu.spec.ts
index 22161d4084..07c58f2b8f 100644
--- a/packages/ui-plugin-sheets/src/controller/menu/__tests__/menu.spec.ts
+++ b/packages/ui-plugin-sheets/src/controller/menu/__tests__/menu.spec.ts
@@ -2,7 +2,7 @@ import {
NORMAL_SELECTION_PLUGIN_NAME,
SelectionManagerService,
SetBoldCommand,
- SetRangeStyleMutation,
+ SetRangeValuesMutation,
SetStyleCommand,
} from '@univerjs/base-sheets';
import {
@@ -34,7 +34,7 @@ describe('Test menu items', () => {
commandService = get(ICommandService);
commandService.registerCommand(SetBoldCommand);
commandService.registerCommand(SetStyleCommand);
- commandService.registerCommand(SetRangeStyleMutation);
+ commandService.registerCommand(SetRangeValuesMutation);
disposableCollection = new DisposableCollection();
});
@@ -50,8 +50,8 @@ describe('Test menu items', () => {
let disabled = false;
const menuItem = get(Injector).invoke(BoldMenuItemFactory);
- disposableCollection.add(toDisposable(menuItem.activated$!.subscribe((v) => (activated = v))));
- disposableCollection.add(toDisposable(menuItem.disabled$!.subscribe((v) => (disabled = v))));
+ disposableCollection.add(toDisposable(menuItem.activated$!.subscribe((v: boolean) => (activated = v))));
+ disposableCollection.add(toDisposable(menuItem.disabled$!.subscribe((v: boolean) => (disabled = v))));
expect(activated).toBe(false);
expect(disabled).toBe(false);
diff --git a/packages/ui-plugin-sheets/src/controller/menu/border.menu.ts b/packages/ui-plugin-sheets/src/controller/menu/border.menu.ts
index 0fe2f46ee6..7c3306f9ce 100644
--- a/packages/ui-plugin-sheets/src/controller/menu/border.menu.ts
+++ b/packages/ui-plugin-sheets/src/controller/menu/border.menu.ts
@@ -158,7 +158,7 @@ export function SetBorderColorMenuItemFactory(accessor: IAccessor): IMenuSelecto
const borderStyleManagerService = accessor.get(BorderStyleManagerService);
return {
id: SetBorderColorCommand.id,
- title: 'border',
+ title: 'borderLine.borderColor',
positions: SetBorderPositionCommand.id,
display: DisplayTypes.COLOR,
selectType: SelectTypes.NEO,
@@ -176,7 +176,7 @@ export function SetBorderStyleMenuItemFactory(accessor: IAccessor): IMenuSelecto
const borderStyleManagerService = accessor.get(BorderStyleManagerService);
return {
id: SetBorderStyleCommand.id,
- title: 'borderLine.borderSize',
+ title: 'borderLine.borderType',
label: SHEET_UI_PLUGIN_NAME + LINE_BOLD_LABEL,
positions: SetBorderPositionCommand.id,
display: DisplayTypes.CUSTOM,
diff --git a/packages/ui-plugin-sheets/src/controller/menu/menu.ts b/packages/ui-plugin-sheets/src/controller/menu/menu.ts
index 4f45ad520c..34667547a4 100644
--- a/packages/ui-plugin-sheets/src/controller/menu/menu.ts
+++ b/packages/ui-plugin-sheets/src/controller/menu/menu.ts
@@ -20,6 +20,7 @@ import {
SetHorizontalTextAlignCommand,
SetItalicCommand,
SetRangeStyleMutation,
+ SetRangeValuesMutation,
SetSelectionsOperation,
SetStrikeThroughCommand,
SetTabColorCommand,
@@ -135,7 +136,11 @@ export function BoldMenuItemFactory(accessor: IAccessor): IMenuButtonItem {
activated$: new Observable<boolean>((subscriber) => {
const disposable = commandService.onCommandExecuted((c) => {
const id = c.id;
- if (id !== SetRangeStyleMutation.id && id !== SetSelectionsOperation.id) {
+ if (
+ id !== SetRangeStyleMutation.id &&
+ id !== SetRangeValuesMutation.id &&
+ id !== SetSelectionsOperation.id
+ ) {
return;
}
@@ -188,7 +193,11 @@ export function ItalicMenuItemFactory(accessor: IAccessor): IMenuButtonItem {
activated$: new Observable<boolean>((subscriber) => {
const disposable = commandService.onCommandExecuted((c) => {
const id = c.id;
- if (id !== SetRangeStyleMutation.id && id !== SetSelectionsOperation.id) {
+ if (
+ id !== SetRangeStyleMutation.id &&
+ id !== SetRangeValuesMutation.id &&
+ id !== SetSelectionsOperation.id
+ ) {
return;
}
@@ -241,7 +250,11 @@ export function UnderlineMenuItemFactory(accessor: IAccessor): IMenuButtonItem {
activated$: new Observable<boolean>((subscriber) => {
const disposable = commandService.onCommandExecuted((c) => {
const id = c.id;
- if (id !== SetRangeStyleMutation.id && id !== SetSelectionsOperation.id) {
+ if (
+ id !== SetRangeStyleMutation.id &&
+ id !== SetRangeValuesMutation.id &&
+ id !== SetSelectionsOperation.id
+ ) {
return;
}
@@ -294,7 +307,11 @@ export function StrikeThroughMenuItemFactory(accessor: IAccessor): IMenuButtonIt
activated$: new Observable<boolean>((subscriber) => {
const disposable = commandService.onCommandExecuted((c) => {
const id = c.id;
- if (id !== SetRangeStyleMutation.id && id !== SetSelectionsOperation.id) {
+ if (
+ id !== SetRangeStyleMutation.id &&
+ id !== SetRangeValuesMutation.id &&
+ id !== SetSelectionsOperation.id
+ ) {
return;
}
@@ -445,21 +462,22 @@ export const FONT_FAMILY_CHILDREN = [
style: { 'font-family': '华文隶书' },
value: '华文隶书',
},
- {
- label: 'fontFamily.HanaleiFill',
- style: { 'font-family': 'HanaleiFill' },
- value: 'HanaleiFill',
- },
- {
- label: 'fontFamily.Anton',
- style: { 'font-family': 'Anton' },
- value: 'Anton',
- },
- {
- label: 'fontFamily.Pacifico',
- style: { 'font-family': 'Pacifico' },
- value: 'Pacifico',
- },
+ // The following 3 fonts do not work, temporarily delete
+ // {
+ // label: 'fontFamily.HanaleiFill',
+ // style: { 'font-family': 'HanaleiFill' },
+ // value: 'HanaleiFill',
+ // },
+ // {
+ // label: 'fontFamily.Anton',
+ // style: { 'font-family': 'Anton' },
+ // value: 'Anton',
+ // },
+ // {
+ // label: 'fontFamily.Pacifico',
+ // style: { 'font-family': 'Pacifico' },
+ // value: 'Pacifico',
+ // },
];
export function FontFamilySelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string> {
@@ -499,7 +517,11 @@ export function FontFamilySelectorMenuItemFactory(accessor: IAccessor): IMenuSel
const disposable = commandService.onCommandExecuted((c) => {
const id = c.id;
- if (id !== SetRangeStyleMutation.id && id !== SetSelectionsOperation.id) {
+ if (
+ id !== SetRangeStyleMutation.id &&
+ id !== SetRangeValuesMutation.id &&
+ id !== SetSelectionsOperation.id
+ ) {
return;
}
@@ -558,7 +580,11 @@ export function FontSizeSelectorMenuItemFactory(accessor: IAccessor): IMenuSelec
const DEFAULT_SIZE = 14;
const disposable = commandService.onCommandExecuted((c) => {
const id = c.id;
- if (id !== SetRangeStyleMutation.id && id !== SetSelectionsOperation.id) {
+ if (
+ id !== SetRangeStyleMutation.id &&
+ id !== SetRangeValuesMutation.id &&
+ id !== SetSelectionsOperation.id
+ ) {
return;
}
@@ -1087,7 +1113,11 @@ export function SetRowHeightMenuItemFactory(accessor: IAccessor): IMenuButtonIte
const disposable = commandService.onCommandExecuted((c) => {
const id = c.id;
- if (id === SetRangeStyleMutation.id || id === SetSelectionsOperation.id) {
+ if (
+ id === SetRangeStyleMutation.id ||
+ id === SetRangeValuesMutation.id ||
+ id === SetSelectionsOperation.id
+ ) {
return update();
}
});
@@ -1131,7 +1161,11 @@ export function SetColWidthMenuItemFactory(accessor: IAccessor): IMenuButtonItem
const disposable = commandService.onCommandExecuted((c) => {
const id = c.id;
- if (id === SetRangeStyleMutation.id || id === SetSelectionsOperation.id) {
+ if (
+ id === SetRangeStyleMutation.id ||
+ id === SetRangeValuesMutation.id ||
+ id === SetSelectionsOperation.id
+ ) {
return update();
}
});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 8d2fd90152..a6e27c41c3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -573,8 +573,8 @@ importers:
specifier: workspace:^0.0.1
version: link:../core
'@univerjs/icons':
- specifier: ^0.0.3
+ specifier: ^0.0.5
'@wendellhu/redi':
specifier: ^0.12.8
version: 0.12.8
@@ -5695,8 +5695,8 @@ packages:
eslint-visitor-keys: 3.4.3
dev: true
- resolution: {integrity: sha512-jHjA4L3/hhi9r04Cb2lpXMDnF99HZK/9MiK4QIEKjH6hQPtNljpQcufaDowfeG0UCqJ8A3WlE4cey6XBmjijWQ==}
+ resolution: {integrity: sha512-/wJ8p8/ZNwXrlvDRz6rp0RvMlgMLSvL4MWTeuE/7dpE/zLtqsjY96huAwoIDMZkZcGOQn0VqBtUMyZskRlb5GQ==}
peerDependencies:
react: '*'
react-dom: '*'