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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
xiugai
tonytonychopper123be5b23e2bb60
diff --git a/packages/base-docs/src/Controller/ToolBarController1.ts b/packages/base-docs/src/Controller/ToolbarController.tssimilarity index 100%rename from packages/base-docs/src/Controller/ToolBarController1.tsrename to packages/base-docs/src/Controller/ToolbarController.tsdiff --git a/packages/base-docs/src/Model/ToolBar1Model.ts b/packages/base-docs/src/Model/ToolbarModel.tssimilarity index 100%rename from packages/base-docs/src/Model/ToolBar1Model.tsrename to packages/base-docs/src/Model/ToolbarModel.tsdiff --git a/packages/base-docs/src/View/UI/ToolBar/ToolBar1-zh.md b/packages/base-docs/src/View/UI/ToolBar/Toolbar-zh.mdsimilarity index 100%rename from packages/base-docs/src/View/UI/ToolBar/ToolBar1-zh.mdrename to packages/base-docs/src/View/UI/ToolBar/Toolbar-zh.mddiff --git a/packages/base-docs/src/View/UI/ToolBar/ToolBar1.tsx b/packages/base-docs/src/View/UI/ToolBar/Toolbar.tsxsimilarity index 100%rename from packages/base-docs/src/View/UI/ToolBar/ToolBar1.tsxrename to packages/base-docs/src/View/UI/ToolBar/Toolbar.tsxdiff --git a/packages/base-sheets/src/Controller/ToolBarController1.ts b/packages/base-sheets/src/Controller/ToolbarController.tssimilarity index 100%rename from packages/base-sheets/src/Controller/ToolBarController1.tsrename to packages/base-sheets/src/Controller/ToolbarController.tsdiff --git a/packages/base-sheets/src/Model/ToolBarModel1.ts b/packages/base-sheets/src/Model/ToolbarModel.tssimilarity index 100%rename from packages/base-sheets/src/Model/ToolBarModel1.tsrename to packages/base-sheets/src/Model/ToolbarModel.tsdiff --git a/packages/base-slides/src/Controller/ToolBarController1.ts b/packages/base-slides/src/Controller/ToolbarController.tssimilarity index 100%rename from packages/base-slides/src/Controller/ToolBarController1.tsrename to packages/base-slides/src/Controller/ToolbarController.tsdiff --git a/packages/base-slides/src/Model/ToolBarModel1.ts b/packages/base-slides/src/Model/ToolbarModel.tssimilarity index 100%rename from packages/base-slides/src/Model/ToolBarModel1.tsrename to packages/base-slides/src/Model/ToolbarModel.tsdiff --git a/packages/base-slides/src/View/UI/ToolBar/ToolBar1-zh.md b/packages/base-slides/src/View/UI/ToolBar/Toolbar-zh.mdsimilarity index 100%rename from packages/base-slides/src/View/UI/ToolBar/ToolBar1-zh.mdrename to packages/base-slides/src/View/UI/ToolBar/Toolbar-zh.mddiff --git a/packages/base-slides/src/View/UI/ToolBar/ToolBar1.tsx b/packages/base-slides/src/View/UI/ToolBar/Toolbar.tsxsimilarity index 100%rename from packages/base-slides/src/View/UI/ToolBar/ToolBar1.tsxrename to packages/base-slides/src/View/UI/ToolBar/Toolbar.tsxdiff --git a/packages/base-ui/src/UI/ToolBar/Const.ts b/packages/base-ui/src/UI/ToolBar/Const.tsdeleted file mode 100644index 76d834f9a7..0000000000--- a/packages/base-ui/src/UI/ToolBar/Const.ts+++ /dev/null@@ -1,432 +0,0 @@-export const FONT_SIZE_CHILDREN = [- {- label: '9',- value: 9,- },- {- label: '10',- value: 10,- },- {- label: '11',- value: 11,- },- {- label: '12',- value: 12,- },- {- label: '14',- value: 14,- },- {- label: '16',- value: 16,- },- {- label: '18',- value: 18,- },- {- label: '20',- value: 20,- },-- {- label: '22',- value: 22,- },- {- label: '24',- value: 24,- },- {- label: '26',- value: 26,- },- {- label: '28',- value: 28,- },- {- label: '36',- value: 36,- },- {- label: '48',- value: 48,- },- {- label: '72',- value: 72,- },-];--export const FONT_FAMILY_CHILDREN = [- {- locale: 'fontFamily.TimesNewRoman',- style: { 'font-family': 'Times New Roman' },- value: 'Times New Roman',- selected: true,- },- {- locale: 'fontFamily.Arial',- style: { 'font-family': 'Arial' },- value: 'Arial',- },- {- locale: 'fontFamily.Tahoma',- style: { 'font-family': 'Tahoma' },- value: 'Tahoma',- },- {- locale: 'fontFamily.Verdana',- style: { 'font-family': 'Verdana' },- value: 'Verdana',- },- {- locale: 'fontFamily.MicrosoftAccorblack',- style: { 'font-family': '微软雅黑' },- value: '微软雅黑',- },- {- locale: 'fontFamily.SimSun',- style: { 'font-family': '宋体' },- value: '宋体',- },- {- locale: 'fontFamily.SimHei',- style: { 'font-family': '黑体' },- value: '黑体',- },- {- locale: 'fontFamily.Kaiti',- style: { 'font-family': '楷体' },- value: '楷体',- },- {- locale: 'fontFamily.FangSong',- style: { 'font-family': '仿宋' },- value: '仿宋',- },- {- locale: 'fontFamily.NSimSun',- style: { 'font-family': '新宋体' },- value: '新宋体',- },- {- locale: 'fontFamily.STXinwei',- style: { 'font-family': '华文新魏' },- value: '华文新魏',- },- {- locale: 'fontFamily.STXingkai',- style: { 'font-family': '华文行楷' },- value: '华文行楷',- },- {- locale: 'fontFamily.STLiti',- style: { 'font-family': '华文隶书' },- value: '华文隶书',- },- {- locale: 'fontFamily.HanaleiFill',- style: { 'font-family': 'HanaleiFill' },- value: 'HanaleiFill',- },- {- locale: 'fontFamily.Anton',- style: { 'font-family': 'Anton' },- value: 'Anton',- },- {- locale: 'fontFamily.Pacifico',- style: { 'font-family': 'Pacifico' },- value: 'Pacifico',- },-];--export const BORDER_LINE_CHILDREN = [- {- locale: 'borderLine.borderTop',- customSuffix: {- name: 'TopBorderIcon',- },- value: 'top',- },- {- locale: 'borderLine.borderBottom',- customSuffix: {- name: 'BottomBorderIcon',- },- value: 'bottom',- },- {- locale: 'borderLine.borderLeft',- customSuffix: {- name: 'LeftBorderIcon',- },- value: 'left',- },- {- locale: 'borderLine.borderRight',- customSuffix: {- name: 'RightBorderIcon',- },- value: 'right',- border: true,- },- {- locale: 'borderLine.borderNone',- customSuffix: {- name: 'NoneBorderIcon',- },- value: 'none',- },- {- locale: 'borderLine.borderAll',- customSuffix: {- name: 'FullBorderIcon',- },- value: 'all',- selected: true,- },- {- locale: 'borderLine.borderOutside',- customSuffix: {- name: 'OuterBorderIcon',- },- value: 'outside',- },- {- locale: 'borderLine.borderInside',- customSuffix: {- name: 'InnerBorderIcon',- },- value: 'inside',- },- {- locale: 'borderLine.borderHorizontal',- customSuffix: {- name: 'StripingBorderIcon',- },- value: 'horizontal',- },- {- locale: 'borderLine.borderVertical',- customSuffix: {- name: 'VerticalBorderIcon',- },- value: 'vertical',- },-];--export const BORDER_SIZE_CHILDREN = [- {- locale: 'borderLine.borderNone',- value: '',- },- {- customLabel: {- name: 'BorderThin',- },- value: 'BorderThin',- },- {- customLabel: {- name: 'BorderHair',- },- value: 'BorderHair',- },- {- customLabel: {- name: 'BorderDotted',- },- value: 'BorderDotted',- },- {- customLabel: {- name: 'BorderDashed',- },- value: 'BorderDashed',- },- {- customLabel: {- name: 'BorderDashDot',- },- value: 'BorderDashDot',- },- {- customLabel: {- name: 'BorderDashDotDot',- },- value: 'BorderDashDotDot',- },- {- customLabel: {- name: 'BorderMedium',- },- value: 'BorderMedium',- },- {- customLabel: {- name: 'BorderMediumDashed',- },- value: 'BorderMediumDashed',- },- {- customLabel: {- name: 'BorderMediumDashDot',- },- value: 'BorderMediumDashDot',- },- {- customLabel: {- name: 'BorderMediumDashDotDot',- },- value: 'BorderMediumDashDotDot',- },- {- customLabel: {- name: 'BorderThick',- },- value: 'BorderThick',- },-];--export const MERGE_CHILDREN = [- {- locale: 'merge.all',- value: 'all',- },- {- locale: 'merge.vertical',- value: 'vertical',- },- {- locale: 'merge.horizontal',- value: 'horizontal',- },- {- locale: 'merge.cancel',- value: 'cancel',- },-];--export const HORIZONTAL_ALIGN_CHILDREN = [- {- locale: 'align.left',- customSuffix: {- name: 'LeftAlignIcon',- },- value: 1,- },- {- locale: 'align.center',- selected: true,- customSuffix: {- name: 'CenterAlignIcon',- },- value: 2,- },- {- locale: 'align.right',- customSuffix: {- name: 'RightAlignIcon',- },- value: 3,- },-];--export const VERTICAL_ALIGN_CHILDREN = [- {- locale: 'align.top',- customSuffix: {- name: 'TopVerticalIcon',- },- value: 1,- },- {- locale: 'align.middle',- customSuffix: {- name: 'CenterVerticalIcon',- },- value: 2,- },- {- locale: 'align.bottom',- customSuffix: {- name: 'BottomVerticalIcon',- },- value: 3,- },-];--export const TEXT_WRAP_CHILDREN = [- {- locale: 'textWrap.overflow',- customSuffix: {- name: 'OverflowIcon',- },- value: 1,- },- {- locale: 'textWrap.wrap',- customSuffix: {- name: 'BrIcon',- },- value: 3,- },- {- locale: 'textWrap.clip',- customSuffix: {- name: 'CutIcon',- },- value: 2,- },-];--export const TEXT_ROTATE_CHILDREN = [- {- locale: 'textRotate.none',- customSuffix: {- name: 'TextRotateIcon',- },- value: 0,- },- {- locale: 'textRotate.angleUp',- customSuffix: {- name: 'TextRotateAngleUpIcon',- },- value: -45,- },- {- locale: 'textRotate.angleDown',- customSuffix: {- name: 'TextRotateAngleDownIcon',- },- value: 45,- },- {- locale: 'textRotate.vertical',- customSuffix: {- name: 'TextRotateVerticalIcon',- },- value: 'v',- },- {- locale: 'textRotate.rotationUp',- customSuffix: {- name: 'TextRotateRotationUpIcon',- },- value: -90,- },- {- locale: 'textRotate.rotationDown',- customSuffix: {- name: 'TextRotateRotationDownIcon',- },- value: 90,- },-];diff --git a/packages/base-ui/src/UI/ToolBar/DataBar.tsx b/packages/base-ui/src/UI/ToolBar/DataBar.tsxdeleted file mode 100644index f0f4350aa8..0000000000--- a/packages/base-ui/src/UI/ToolBar/DataBar.tsx+++ /dev/null@@ -1,22 +0,0 @@-type BarProps = {- list: Array<Record<string, string>>;- img: string;- onClick?: (item: {}, index: number) => void;-};--export const DataBar = (props: BarProps) => {- const { list, img, onClick } = props;- const background = `url(${img}) no-repeat`;-- let handleClick = (item: {}, index: number) => {- onClick?.call(this, item, index);- };-- return (- <div style="display: flex;">- {list.map((item, index) => (- <div onClick={() => handleClick(item, index)} style={{ width: '28px', height: '26px', background, backgroundPosition: `${item.x} ${item.y}` }}></div>- ))}- </div>- );-};diff --git a/packages/base-ui/src/UI/ToolBar/SingleButton.tsx b/packages/base-ui/src/UI/ToolBar/SingleButton.tsxdeleted file mode 100644index 74ae81578e..0000000000--- a/packages/base-ui/src/UI/ToolBar/SingleButton.tsx+++ /dev/null@@ -1,68 +0,0 @@-import { BaseSingleButtonProps, Component, JSXComponent, SingleButtonComponent } from '@univerjs/base-ui';-import { Button, Tooltip } from '@univerjs/style-univer';--import styles from './index.module.less';--export interface SingleButtonProps {- label?: string | JSX.Element;- icon?: JSX.Element | string | null | undefined;- tooltip?: string;- name?: string;- key?: string;- onClick?: (...arg: any[]) => void;- active?: boolean;- triggerUpdate?: (func: Function) => void;-}-export interface IState {- active: boolean;-}--class SingleButton extends Component<SingleButtonProps, IState> {- initialize(props: SingleButtonProps): void {- // Mount update function, when updating the selection range, the cell formats corresponding to different ranges are different, and the toolbar status and values need to be updated in real time- const { triggerUpdate, active } = props;- triggerUpdate && triggerUpdate(this.update.bind(this));-- this.state = {- active: active || false,- };- }-- update(active: boolean) {- this.setState({ active });- }-- onClick() {- this.setState(- (prevState: IState) => ({- active: !prevState.active,- }),- () => {- this.props.onClick && this.props.onClick(this.state.active);- }- );- }-- render() {- const { name, tooltip, label, icon, onClick, key } = this.props;- const { active } = this.state;- return (- <div className={styles.singleButton} key={key}>- <Tooltip title={tooltip!} placement={'bottom'}>- <Button type="text" onClick={() => this.onClick()} active={active}>- {label}- {icon}- </Button>- </Tooltip>- </div>- );- }-}--export class UniverSingleButton implements SingleButtonComponent {- render(): JSXComponent<BaseSingleButtonProps> {- return SingleButton;- }-}--export { SingleButton };diff --git a/packages/base-ui/src/UI/ToolBar/ToolBar.md b/packages/base-ui/src/UI/ToolBar/ToolBar.mddeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/base-ui/src/UI/ToolBar/ToolBar1.tsx b/packages/base-ui/src/UI/ToolBar/ToolBar1.tsxdeleted file mode 100644index 7879f271e6..0000000000--- a/packages/base-ui/src/UI/ToolBar/ToolBar1.tsx+++ /dev/null@@ -1,298 +0,0 @@-import { PLUGIN_NAMES } from '@univerjs/core';-import { BaseComponentProps, BaseComponentRender, BaseComponentSheet } from '../../BaseComponent';-import { BaseComponentPlugin } from '../../BaseComponentPlugin';-import { Select, TextButton } from '../../Components';-import { IToolbarItemProps } from '../../Controller/ToolbarController';-import { Component, createRef } from '../../Framework';-import { debounce } from '../../Utils';-import styles from './index.module.less';--interface IProps extends BaseComponentProps {- style?: JSX.CSSProperties;- toolList: IToolbarItemProps[];-}--interface IState {- toolList: IToolbarItemProps[];- moreToolList: IToolbarItemProps[];- defaultToolList: IToolbarItemProps[];- showMore: boolean;- toolbarListWidths: number[];- moreText: Record<string, string>;-}--export class Toolbar extends Component<IProps, IState> {- toolbarRef = createRef();-- moreBtnRef = createRef();-- moreToolRef = createRef();-- SelectRef = createRef();-- private _render: BaseComponentRender;-- clientWidth = 0;-- initialize() {- const component = this._context.getPluginManager().getPluginByName<BaseComponentSheet>('ComponentSheet')!;- this._render = component.getComponentRender();- this.state = {- // Button contains main button and drop down arrow, translation file contains main and right- showMore: false,- toolList: [],- defaultToolList: [],- moreToolList: [],- toolbarListWidths: [],- moreText: {},- };- }-- /**- * show more tool buttons- *- * TODO : 点击其他地方需要隐藏more buttons- */- showMore = () => {- let showMore = this.state.showMore;- this.setState({ showMore: !showMore });-- if (!showMore) {- document.addEventListener('click', this.hide, true);- }- };-- hide = (e: Event) => {- if (this.moreToolRef.current.contains(e.target)) return;- e.stopImmediatePropagation();- this.setState({ showMore: false });- document.removeEventListener('click', this.hide, true);- };-- /**- * Gets the distance of each button from the parent element- */- debounceSetToolbarListWidth = debounce(() => {- this.setToolbarListWidth();- }, 50);-- setToolbarListWidth = () => {- if (!this.clientWidth) {- this.clientWidth = document.documentElement.clientWidth;- }- const list = this.toolbarRef.current.querySelectorAll(`.${styles.toolbarWarp} > div`);- const moreButtonWidth = this.moreBtnRef.current.clientWidth;- let width = 60 + moreButtonWidth;- let index = null;-- const clientWidth = document.documentElement.clientWidth;- if (clientWidth <= this.clientWidth) {- // 向左resize- this.clientWidth = clientWidth;- for (let i = 0; i < list.length; i++) {- width += list[i].clientWidth + 6;-- if (width > clientWidth) {- index = i;- break;- }- }- if (index !== null) {- this.setState(- {- defaultToolList: this.state.toolList.slice(0, index),- moreToolList: index ? this.state.toolList.slice(index) : [],- },- () => {- this.resetUl();- this.forceUpdate();- }- );- }- } else {- // 向右resize- this.clientWidth = clientWidth;- if (this.state.moreToolList.length) {- let toolWidth = 30 + moreButtonWidth;- for (let i = 0; i < list.length; i++) {- toolWidth += list[i].clientWidth + 6;- }-- const moreList = this.moreToolRef.current.querySelectorAll(`.${styles.moreTool} > div`);- let moreIndex = null;- let last = false; //最后一个元素-- for (let i = 0; i < moreList.length; i++) {- toolWidth += moreList[i].clientWidth + 6;-- if (toolWidth > clientWidth) {- moreIndex = i;- break;- } else if (i === moreList.length - 1) {- moreIndex = i;- last = true;- }- }-- if (moreIndex !== null) {- this.setState(- {- defaultToolList: this.state.defaultToolList.concat(this.state.moreToolList.slice(0, last ? moreIndex + 1 : moreIndex)),- moreToolList: last ? [] : this.state.moreToolList.slice(moreIndex),- },- () => {- this.resetUl();- this.forceUpdate();- }- );- }- }- }- };-- resetLabel = (toolList: any[]) => {- const componentManager = this._context.getPluginManager().getPluginByName<BaseComponentPlugin>(PLUGIN_NAMES.BASE_COMPONENT)?.getComponentManager();-- for (let i = 0; i < toolList.length; i++) {- const item = toolList[i];-- // 优先寻找自定义组件- if (item.customLabel) {- const Label = componentManager?.get(item.customLabel.name);- if (Label) {- const props = item.customLabel.props ?? {};- item.label = <Label {...props} />;- }- }-- if (item.customSuffix) {- const Suffix = componentManager?.get(item.customSuffix.name);- if (Suffix) {- const props = item.customSuffix.props ?? {};- item.suffix = <Suffix {...props} />;- }- }-- if (item.children) {- item.children = this.resetLabel(item.children);- }- }- return toolList;- };-- // setToolbar = (toolList: any[], moreText: Record<string, string>) => {- // toolList = this.resetLabel(toolList);-- // this.setState(- // {- // toolList,- // defaultToolList: toolList,- // moreText,- // },- // () => {- // this.setToolbarListWidth();- // }- // );- // };-- setToolbar = (toolList: any[]) => {- toolList = this.resetLabel(toolList);-- this.setState(- {- toolList,- defaultToolList: toolList,- },- () => {- this.setToolbarListWidth();- }- );- };-- resetUl = () => {- const wrapper = this._context.getPluginManager().getPluginByName<BaseComponentPlugin>(PLUGIN_NAMES.BASE_COMPONENT)?.getUniverContainerController().getContentRef().current!;- const height = `${(wrapper as HTMLDivElement).offsetHeight}px`;- const ul = this.toolbarRef.current.querySelectorAll('ul');- for (let i = 0; i < ul.length; i++) {- ul[i].style.maxHeight = height;- }- };-- componentDidMount() {- this.props.getComponent?.(this);- window.addEventListener('resize', this.debounceSetToolbarListWidth);- }-- componentWillUnmount() {- window.removeEventListener('resize', this.debounceSetToolbarListWidth);- }-- // 渲染dom- getToolbarList(list: IToolbarItemProps[]) {- const Tooltip = this._render.renderFunction('Tooltip');-- return list.map((item) => {- if (item.toolbarType) {- if (item.show) {- return (- <Tooltip title={item.tooltip} placement={'bottom'}>- <TextButton active={item.active} label={item.label} onClick={item.onClick}></TextButton>- </Tooltip>- );- }- } else {- if (item.show) {- return (- <Select- tooltip={item.tooltip}- type={item.type}- display={item.display}- children={item.children}- customLabel={item.customLabel}- customSuffix={item.customSuffix}- label={item.label}- onClick={item.onClick}- onKeyUp={item.onKeyUp}- defaultColor={item.defaultColor}- hideSelectedIcon={item.hideSelectedIcon}- className={item.className}- ></Select>- );- }- }- return null;- });- }-- render() {- const { defaultToolList, moreToolList, moreText, showMore } = this.state;-- const Button = this._render.renderFunction('Button');- const Container = this._render.renderFunction('Container');- const Tooltip = this._render.renderFunction('Tooltip');-- return (- <Container style={{ position: 'relative' }}>- <div className={`${styles.toolbarWarp} ${styles.toolbar}`} ref={this.toolbarRef}>- {this.getToolbarList(defaultToolList)}-- <div ref={this.moreBtnRef} className={styles.moreButton} style={{ visibility: moreToolList.length ? 'visible' : 'hidden' }}>- <Tooltip title={moreText.tip} placement={'bottom'}>- <Button type="text" onClick={this.showMore}>- <div style={{ fontSize: '14px' }}>{moreText.more}</div>- </Button>- </Tooltip>- </div>- </div>-- {moreToolList.length ? (- <div style={{ visibility: showMore ? 'visible' : 'hidden' }} className={`${styles.moreTool} ${styles.toolbar}`} ref={this.moreToolRef}>- {this.getToolbarList(moreToolList)}- </div>- ) : (- ''- )}- </Container>- );- }-}diff --git a/packages/base-ui/src/UI/ToolBar/index.less b/packages/base-ui/src/UI/ToolBar/index.lessdeleted file mode 100644index ce9e6d429b..0000000000--- a/packages/base-ui/src/UI/ToolBar/index.less+++ /dev/null@@ -1,310 +0,0 @@-.universheet-wa-editor.toolbar {- height: 32px;- background: var(--bg);- position: relative;- padding: 5px 0 3px 15px;- border-bottom: 1px solid var(--bg);- white-space: nowrap;- transition: all 0.2s;- box-sizing: initial;-- span[role='img'] {- font-size: 24px;- display: inline-block;- }-- span[role='img'].univericon-nextIcon {- font-size: 13px;- }-- span[role='img'].univericon-rightIcon {- font-size: 13px;- }-- .universheet-toolbar-left-skin {- width: 15px;- position: absolute;- left: 0;- top: 1px;- bottom: 1px;- }-- .universheet-inline-block {- display: inline-block;- }-- .universheet-flex {- display: flex;- }-- .universheet-toolbar-button,- .universheet-toolbar-menu-button {- vertical-align: middle;-- &:hover {- background: rgba(0, 0, 0, 0.06);- }-- button {- min-width: 26px;- height: 26px;- padding: 0;- border: none;- .toolbar-button();-- span {- height: 100%;- vertical-align: text-bottom;- }- }- }-- .universheet-toolbar-button-outer-box,- .universheet-toolbar-menu-button-outer-box {- .outer-inner-box();- }-- .universheet-toolbar-select {- position: relative;- }-- .universheet-toolbar-button-inner-box,- .universheet-toolbar-menu-button-inner-box {- padding: 0 2px;- padding: 0;- text-align: center;- height: 26px;- min-width: 26px;- font-size: 12px;- }-- .universheet-toolbar-menu-button-caption {- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- margin-left: 1px;- text-align: center;- height: 100%;- }-- .universheet-toolbar-menu-button-text {- width: 55px !important;- }-- .universheet-toolbar-separator {- line-height: normal;- list-style: none;- outline: 0;- overflow: hidden;- padding: 0;- text-decoration: none;- width: 0;- height: 20px;- vertical-align: top;- border-left: 1px solid #e0e0e0;- margin: 5px 1px;- }-- .universheet-toolbar-combo-button {- font-weight: 700;- vertical-align: inherit;- margin: 0 1px;- .toolbar-button();- }-- .universheet-toolbar-combo-button-inner-box,- .universheet-toolbar-combo-button-outer-box {- .outer-inner-box();- }-- .universheet-toolbar-zoom-combobox .universheet-toolbar-combo-button-caption {- width: 36px !important;- }-- .universheet-toolbar-combo-button-caption {- padding: 0;- margin: 0 0 0 -3px;- }-- .universheet-toolbar-textinput {- -webkit-border-radius: 1px;- -moz-border-radius: 1px;- border-radius: 1px;- border: 1px solid #d9d9d9;- border-top: 1px solid silver;- font-size: 13px;- height: 25px;- padding: 1px 0 1px 8px;- }-- .universheet-toolbar-combo-button-input {- background: 0 0;- border: 1px solid transparent !important;- color: var(--text-color);- font-family: Arial, sans-serif !important;- font-size: 11px !important;- font-weight: 700 !important;- height: 20px !important;- overflow: hidden !important;- color: rgba(0, 0, 0, 0.7);- height: 22px !important;- width: 22px;- }-- .universheet-cols-menu {- .menu-button();- width: 252px;- left: 0;- top: 26px;- display: none;- }-- .universheet-cols-menu .universheet-cols-menuitem-hover,- .universheet-cols-menu .universheet-cols-menuitem:hover {- background-color: #efefef;- }-- .universheet-cols-menu .universheet-cols-menuitem {- position: relative;- color: var(--text-color);- cursor: pointer;- list-style: none;- margin: 0;- padding: 1px 6em 1px 20px;- white-space: nowrap;- padding-left: 8px;- vertical-align: middle;- padding-right: 24px;- user-select: none;- line-height: 16px;- }-- .universheet-submenu-arrow {- -webkit-transition: all 218ms;- -moz-transition: all 218ms;- -o-transition: all 218ms;- transition: all 218ms;- font-size: 12px;- left: auto;- right: 15px;- top: 50%;- transform: translateY(-50%);- padding-right: 0;- position: absolute;- text-align: right;- opacity: 0.5;- color: #000;- user-select: none;- font-family: Arial;- }-- .universheet-toolbar-dblbutton {- .universheet-toolbar-next-button {- border-left: 1px solid transparent;- position: relative;-- .universheet-next-menu {- position: absolute;- z-index: 100;- background-color: #fff;- box-shadow: var(--box-shadow-base);- font-size: 12px;- width: fit-content;-- .univer-menu-item > div {- width: 100%;- display: flex;- justify-content: space-between;- box-sizing: border-box;- padding: 0 5px 0 0;-- .universheet-next-menu-icon {- width: 25px;-- & ~ div {- flex: 1;- display: flex;- justify-content: space-between;- align-items: center;- }- }- }-- svg {- font-size: 24px;- vertical-align: top;- }- }-- svg {- font-size: 12px;- vertical-align: middle;- }- }-- .universheet-color-bottom {- width: 10px;- margin: 0 auto;- outline: 2px solid;- position: relative;- bottom: 7px;- }-- button.univer-btn {- min-width: 15px;-- &:active {- background: transparent !important;- }- }-- :hover .universheet-toolbar-next-button {- border-left: 1px solid #e0e0e0;- }- }-}--// 重复样式-.outer-inner-box() {- border: 0;- vertical-align: top;- margin: 0;- padding: 0;-}--.toolbar-button() {- -webkit-border-radius: 2px;- -moz-border-radius: 2px;- border-radius: 2px;- -webkit-user-select: none;- -moz-user-select: none;- -ms-user-select: none;- background: 0;- border: 1px solid transparent;- outline: 0;- padding: 0;- list-style: none;- font-size: 11px;- text-decoration: none;- cursor: default;- height: 26px;- line-height: 26px;- color: var(--text-color);-}--.menu-button() {- border-radius: 0;- box-shadow: 0 2px 4px rgb(0 0 0 / 20%);- transition: opacity 218ms;- background: #fff;- border: 1px solid rgba(0, 0, 0, 0.2);- cursor: default;- font-size: 13px;- margin: 0;- outline: 0;- padding: 6px 0;- position: absolute;- z-index: 100;- box-sizing: border-box;- user-select: none;-}diff --git a/packages/base-ui/src/UI/ToolBar/index.module.less b/packages/base-ui/src/UI/ToolBar/index.module.lessdeleted file mode 100644index 9a11e2623e..0000000000--- a/packages/base-ui/src/UI/ToolBar/index.module.less+++ /dev/null@@ -1,139 +0,0 @@-.toolbar-warp {- max-height: fit-content;- width: 100%;- overflow: unset;- box-sizing: border-box;- font-size: var(--font-size);- background-color: var(--bg);- position: relative;- display: flex;- align-items: center;- border-bottom: 1px solid var(--border-color-base);-- .single-button {- &.more-hide {- display: none;- }-- &.more-show {- display: block;- }- }-}--.toolbar {- max-width: 100%;- color: var(--text-color);- padding: 0 15px;- height: 40px;- position: relative;- display: flex;- align-items: center;-- >div {- height: 26px;- display: inline-block;- vertical-align: middle;- margin: 0 3px;- cursor: pointer;-- &.select-button:hover {- background-color: #efefef;- }- }-- .cols-menu {- overflow-y: auto;- }-- .select-label-string {- .drop-content {- >div {- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- width: 90px;- }- }- }-- .select-double-string {- .drop-content {- >div {- width: 24px;- }- }- }-- .select-color-picker-parent {- .select-item-content {- width: 100%;- }-- ul {- padding: 0;- }-- .select-color-picker {- padding: 0;-- .select-item {- padding: 0;- }- }- }-- .select-line-bold-parent {- .select-item-content {- width: 100%;- }- }-- button {- padding: 0;- height: 26px;- }-- span[role='img'].univericon-nextIcon {- font-size: 12px;- }-}--.more-button {- position: absolute;- right: 15px;- top: 50%;- transform: translateY(-50%);- .button();-- &.more-show {- display: block;- }-}--.more-tool {- // height: 40px;- // display: none;- // align-items: center;- padding: 0 10px;- background-color: var(--bg);- box-shadow: var(--box-shadow-base);- position: absolute;- right: 2em;- top: 40px;- z-index: 100;-- &.more-show {- display: flex;- }-- button {- .button();- // font-size: 24px;- }-}--.button() {- padding: 0px;- line-height: 1;-}\ No newline at end of filediff --git a/packages/base-ui/src/UI/ToolBar/index.ts b/packages/base-ui/src/UI/ToolBar/index.tsdeleted file mode 100644index 7c6430332b..0000000000--- a/packages/base-ui/src/UI/ToolBar/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './Toolbar';diff --git a/packages/ui-plugin-sheets/src/View/Toolbar/ToolBar1-zh.md b/packages/ui-plugin-sheets/src/View/Toolbar/ToolBar1-zh.mddeleted file mode 100644index 3d310b457f..0000000000--- a/packages/ui-plugin-sheets/src/View/Toolbar/ToolBar1-zh.md+++ /dev/null@@ -1,92 +0,0 @@-----category: Components-type: 定制-title: Toolbar-subtitle: 工具栏-cover: ''------## 介绍--工具栏--## API--工具栏的属性说明如下:--| 属性 | 说明 | 类型 | 默认值 |-| ---------- | --------------------- | --------------------------- | -------------------------- |-| style | 自定义 css 央样式对象 | `JSX.CSSProperties` | - |-| config | 配置项 | `IShowToolbarConfig` | `IShowToolbarConfig` |-| forwardRef | preact refs 引用 | `RefObject<HTMLDivElement>` | - |-| func | 回调挂载 | `object` | `{ addButton: Function; }` |--`IShowToolbarConfig`包含以下配置,默认都为 `true`,可以指定想隐藏的工具栏按钮为`false`--```json-{- "undoRedo": false, //撤销重做,注意撤消重做是两个按钮,由这一个配置决定显示还是隐藏- "paintFormat": false, //格式刷- "currencyFormat": false, //货币格式- "percentageFormat": false, //百分比格式- "numberDecrease": false, // '减少小数位数'- "numberIncrease": false, // '增加小数位数- "moreFormats": false, // '更多格式'- "font": false, // '字体'- "fontSize": false, // '字号大小'- "bold": false, // '粗体 (Ctrl+B)'- "italic": false, // '斜体 (Ctrl+I)'- "strikethrough": false, // '删除线 (Alt+Shift+5)'- "underline": false, // '下划线 (Alt+Shift+6)'- "textColor": false, // '文本颜色'- "fillColor": false, // '单元格颜色'- "border": false, // '边框'- "mergeCell": false, // '合并单元格'- "horizontalAlignMode": false, // '水平对齐方式'- "verticalAlignMode": false, // '垂直对齐方式'- "textWrapMode": false, // '换行方式'- "textRotateMode": false // '文本旋转方式'-}-```--以下这些配置已经分配到各个插件中了--```json-{- "link": false, // '插入链接'- "image": false, // '插入图片'- "chart": false, // '图表'- "comment": false, //'批注'- "pivotTable": false, //'数据透视表'- "function": false, // '公式'- "frozenMode": false, // '冻结方式'- "sort": false, // '排序'- "filter": false, // '筛选'- "conditionalalFormat": false, // '条件格式'- "dataValidation": false, // '数据验证'- "splitColumn": false, // '分列'- "screenshot": false, // '截图'- "findAndReplace": false, // '查找替换'- "protection": false, // '工作表保护'- "print": false // '打印'-}-```--## 案例--```jsx-import { Toolbar } from '@univerjs/style-univer';--const SheetContainer = () => {- return (- <Toolbar- style={{- display: layout.toolbar ? 'block' : 'none',- }}- config={layout.toolbarConfig!}- func={{ addButton }}- ref={this.toolbarRef}- ></Toolbar>- );-};-```diff --git a/packages/base-ui/src/UI/ToolBar/ToolBar1-zh.md b/packages/ui-plugin-sheets/src/View/Toolbar/Toolbar-zh.mdsimilarity index 100%rename from packages/base-ui/src/UI/ToolBar/ToolBar1-zh.mdrename to packages/ui-plugin-sheets/src/View/Toolbar/Toolbar-zh.md