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
feat: update design token (#765)
白熱68717bd37795
diff --git a/examples/public/index.html b/examples/public/index.htmlindex b77e565821..ced7f58fda 100644--- a/examples/public/index.html+++ b/examples/public/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8" /><meta content="width=device-width, initial-scale=1" name="viewport" />- <title>Univer Sheet</title>+ <title>Univer</title><link rel="icon" type="image/x-icon" href="../favicon.svg"><link rel="stylesheet" href="./main.css" />diff --git a/examples/src/docs/main.ts b/examples/src/docs/main.tsindex 6e96be7998..bd5b27d65d 100644--- a/examples/src/docs/main.ts+++ b/examples/src/docs/main.ts@@ -25,14 +25,6 @@ import { DEFAULT_DOCUMENT_DATA_CN } from '../data';import { DebuggerPlugin } from '../plugins/debugger';import { locales } from './locales';-// package info-console.table({- NODE_ENV: process.env.NODE_ENV,- GIT_COMMIT_HASH: process.env.GIT_COMMIT_HASH,- GIT_REF_NAME: process.env.GIT_REF_NAME,- BUILD_TIME: process.env.BUILD_TIME,-});-// univerconst univer = new Univer({theme: defaultTheme,diff --git a/examples/src/main.tsx b/examples/src/main.tsxindex 6752f61f02..a07b80d084 100644--- a/examples/src/main.tsx+++ b/examples/src/main.tsx@@ -19,6 +19,14 @@ import { createRoot } from 'react-dom/client';import styles from './styles.module.less';+// package info+console.table({+ NODE_ENV: process.env.NODE_ENV,+ GIT_COMMIT_HASH: process.env.GIT_COMMIT_HASH,+ GIT_REF_NAME: process.env.GIT_REF_NAME,+ BUILD_TIME: process.env.BUILD_TIME,+});+function Examples() {return (<section className={styles.examples}>diff --git a/examples/src/sheets/main.ts b/examples/src/sheets/main.tsindex 9f20aa6188..f0aebcbc55 100644--- a/examples/src/sheets/main.ts+++ b/examples/src/sheets/main.ts@@ -15,7 +15,7 @@*/import { LocaleType, LogLevel, Univer } from '@univerjs/core';-import { greenTheme } from '@univerjs/design';+import { defaultTheme } from '@univerjs/design';import { RichTextEditingMutation, UniverDocsPlugin } from '@univerjs/docs';import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';import { UniverRenderEnginePlugin } from '@univerjs/engine-render';@@ -33,17 +33,9 @@ import { DEFAULT_WORKBOOK_DATA_DEMO } from '../data';import { DebuggerPlugin } from '../plugins/debugger';import { locales } from './locales';-// package info-console.table({- NODE_ENV: process.env.NODE_ENV,- GIT_COMMIT_HASH: process.env.GIT_COMMIT_HASH,- GIT_REF_NAME: process.env.GIT_REF_NAME,- BUILD_TIME: process.env.BUILD_TIME,-});-// univerconst univer = new Univer({- theme: greenTheme,+ theme: defaultTheme,locale: LocaleType.ZH_CN,locales,logLevel: LogLevel.VERBOSE,diff --git a/examples/src/slides/main.ts b/examples/src/slides/main.tsindex 7b150b9a7d..1ee00a7dda 100644--- a/examples/src/slides/main.ts+++ b/examples/src/slides/main.ts@@ -23,14 +23,6 @@ import { UniverUIPlugin } from '@univerjs/ui';import { DEFAULT_SLIDE_DATA } from '../data';-// package info-console.table({- NODE_ENV: process.env.NODE_ENV,- GIT_COMMIT_HASH: process.env.GIT_COMMIT_HASH,- GIT_REF_NAME: process.env.GIT_REF_NAME,- BUILD_TIME: process.env.BUILD_TIME,-});-// univerconst univer = new Univer({locale: LocaleType.ZH_CN,diff --git a/packages/design/src/components/design-token/Palette.tsx b/packages/design/src/components/design-token/Palette.tsxindex 70b52b2e67..7f8adb0343 100644--- a/packages/design/src/components/design-token/Palette.tsx+++ b/packages/design/src/components/design-token/Palette.tsx@@ -22,7 +22,7 @@ interface IProps {theme: Record<string, string>;}-const levelMap = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950', '1000'];+const levelMap = ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900'];function convertToCSSVar(input: string): string {const dashCase = input.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`).replace(/(\d+)/g, '-$1');@@ -53,7 +53,7 @@ export function Palette(props: IProps) {},{title: 'Text Color',- colors: ['textColor', 'textColorSecondary', 'textColorTertiary'],+ colors: ['textColor', 'textColorSecondary', 'textColorSecondaryDarker', 'textColorTertiary'],},{title: 'Link',@@ -158,7 +158,7 @@ export function Palette(props: IProps) {},{title: '灰 / Grey',- colors: generateColors('grey', 12),+ colors: generateColors('grey', 9),},{title: '黑 / 白 / Black / White',diff --git a/packages/design/src/components/slider/index.module.less b/packages/design/src/components/slider/index.module.lessindex 93189173f0..9a033a371f 100644--- a/packages/design/src/components/slider/index.module.less+++ b/packages/design/src/components/slider/index.module.less@@ -84,7 +84,7 @@font-size: var(--font-size-xs);line-height: 2;- color: rgb(var(--text-color-secondary));+ color: rgb(var(--text-color-secondary-darker));text-align: center;border-radius: var(--border-radius-base);diff --git a/packages/design/src/themes/base.less b/packages/design/src/themes/base.lessindex c23ed1e19c..1cd85dbbf9 100644--- a/packages/design/src/themes/base.less+++ b/packages/design/src/themes/base.less@@ -177,16 +177,16 @@* 霁 / Jiqing* =====================================*/-@jiqing-50: #e8fcfc;-@jiqing-100: #d1fafa;-@jiqing-200: #a3f5f5;-@jiqing-300: #76efef;-@jiqing-400: #2aeaea;-@jiqing-500: #1cd8d8;-@jiqing-600: #00bbbb;-@jiqing-700: #009e9e;-@jiqing-800: #008a8a;-@jiqing-900: #007676;+@jiqing-50: #e5fffb;+@jiqing-100: #ccfff7;+@jiqing-200: #a9fff2;+@jiqing-300: #78fce8;+@jiqing-400: #2afede;+@jiqing-500: #10e8c7;+@jiqing-600: #00d2b2;+@jiqing-700: #00b298;+@jiqing-800: #009e87;+@jiqing-900: #008b76;:export {--jiqing-50: @jiqing-50;@@ -206,16 +206,16 @@* Cornflower / 矢车菊 / Blue* =====================================*/-@blue-50: #e5f3ff;-@blue-100: #cce6ff;-@blue-200: #99ceff;-@blue-300: #66b5ff;-@blue-400: #339cff;-@blue-500: #188fff;-@blue-600: #0081fa;-@blue-700: #0072de;-@blue-800: #0063c0;-@blue-900: #0053a0;+@blue-50: #e4f4fe;+@blue-100: #d0edff;+@blue-200: #9fdaff;+@blue-300: #62c2ff;+@blue-400: #2daeff;+@blue-500: #0b9efb;+@blue-600: #0493ee;+@blue-700: #0080d2;+@blue-800: #006cae;+@blue-900: #005f9a;:export {--blue-50: @blue-50;@@ -239,9 +239,9 @@@hyacinth-100: #d0d9fb;@hyacinth-200: #a2b3f6;@hyacinth-300: #738df2;-@hyacinth-400: #4567ed;-@hyacinth-500: #2f55eb;-@hyacinth-600: #133de3;+@hyacinth-400: #3a60f7;+@hyacinth-500: #274fee;+@hyacinth-600: #143ee3;@hyacinth-700: #012bd2;@hyacinth-800: #0025b7;@hyacinth-900: #001f9c;@@ -322,18 +322,16 @@* 灰 / Grey* =====================================*/-@grey-50: #f9f9f9;-@grey-100: #f5f5f5;+@grey-50: #f5f5f5;+@grey-100: #ececec;@grey-200: #e5e5e5;-@grey-300: #e8e8e8;-@grey-400: #cccccc;-@grey-500: #b2b2b2;-@grey-600: #999999;-@grey-700: #8b8b8b;-@grey-800: #7d7d7d;-@grey-900: #6f6f6f;-@grey-950: #606060;-@grey-1000: #505050;+@grey-300: #d8d8d8;+@grey-400: #bcbcbc;+@grey-500: #999999;+@grey-600: #7a7a7a;+@grey-700: #656565;+@grey-800: #565656;+@grey-900: #4b4b4b;:export {--grey-50: @grey-50;@@ -346,12 +344,10 @@--grey-700: @grey-700;--grey-800: @grey-800;--grey-900: @grey-900;- --grey-950: @grey-950;- --grey-1000: @grey-1000;}// 黑 / 白 / Black / White-@color-black: #35322b;+@color-black: #1e222b;@color-white: #ffffff;:export {@@ -372,7 +368,8 @@// Text Color@text-color: @color-black;@text-color-secondary: @grey-600;-@text-color-tertiary: @grey-200;+@text-color-secondary-darker: @grey-900;+@text-color-tertiary: @grey-400;// Border Color@border-color: @grey-200;@@ -425,6 +422,7 @@// Text Color--text-color: @text-color;--text-color-secondary: @text-color-secondary;+ --text-color-secondary-darker: @text-color-secondary-darker;--text-color-tertiary: @text-color-tertiary;// Border Colordiff --git a/packages/design/src/themes/default.module.less b/packages/design/src/themes/default.module.lessindex e9cda5e8bd..ac0648637e 100644--- a/packages/design/src/themes/default.module.less+++ b/packages/design/src/themes/default.module.less@@ -10,8 +10,8 @@@error-color: @red-400;// Brand / 品牌-@primary-color: @blue-700;-@primary-color-hover: @blue-600;+@primary-color: @hyacinth-500;+@primary-color-hover: @hyacinth-400;// Link@link-color: @blue-500;diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-button/index.module.less b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-button/index.module.lessindex 8816eb8215..a2a362c743 100644--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-button/index.module.less+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-button/index.module.less@@ -12,7 +12,7 @@padding: 0;font-size: var(--font-size-lg);- color: rgb(var(--text-color-secondary));+ color: rgb(var(--text-color-secondary-darker));background-color: transparent;border: none;diff --git a/packages/ui/src/views/App.tsx b/packages/ui/src/views/App.tsxindex aea6a40329..ab73bf8360 100644--- a/packages/ui/src/views/App.tsx+++ b/packages/ui/src/views/App.tsx@@ -96,7 +96,7 @@ export function App(props: IUniverAppProps) {return (<ConfigProvider locale={locale} mountContainer={portalContainer}>- <section className={styles.appLayout}>+ <div className={styles.appLayout}>{/* header */}{props.toolbar && <MenuBar headerMenuComponents={headerMenuComponents} />}@@ -104,33 +104,35 @@ export function App(props: IUniverAppProps) {<section className={styles.appContainer}><header className={styles.appContainerHeader}>{props.toolbar && <Toolbar />}</header>- <section className={styles.appContainerWrapper}>- <section className={styles.appContainerContent}>- <header>- <ComponentContainer components={headerComponents} />- </header>-- <section- className={styles.appContainerCanvas}- ref={contentRef}- data-range-selector- onContextMenu={(e) => e.preventDefault()}- >- <ComponentContainer components={contentComponents} />+ <div className={styles.appContainerMain}>+ <div className={styles.appContainerWrapper}>+ <section className={styles.appContainerContent}>+ <header>+ <ComponentContainer components={headerComponents} />+ </header>++ <section+ className={styles.appContainerCanvas}+ ref={contentRef}+ data-range-selector+ onContextMenu={(e) => e.preventDefault()}+ >+ <ComponentContainer components={contentComponents} />+ </section></section>- </section>- <aside className={styles.appContainerSidebar}>- <Sidebar />- </aside>- </section>- </section>+ <aside className={styles.appContainerSidebar}>+ <Sidebar />+ </aside>+ </div>- {/* footer */}- <footer className={styles.appFooter}>- <ComponentContainer components={footerComponents} />- </footer>- </section>+ {/* footer */}+ <footer className={styles.appFooter}>+ <ComponentContainer components={footerComponents} />+ </footer>+ </div>+ </section>+ </div><ComponentContainer components={globalComponents} /></ConfigProvider>diff --git a/packages/ui/src/views/app.module.less b/packages/ui/src/views/app.module.lessindex 58dba43ff5..6cbe85b47f 100644--- a/packages/ui/src/views/app.module.less+++ b/packages/ui/src/views/app.module.less@@ -21,6 +21,12 @@width: 100%;}+ &-main {+ display: flex;+ flex: 1;+ flex-direction: column;+ }+&-wrapper {display: grid;grid-template-columns: 1fr auto;diff --git a/packages/ui/src/views/components/doc-bars/Toolbar.tsx b/packages/ui/src/views/components/doc-bars/Toolbar.tsxindex b9bda46612..2f27ce5b8a 100644--- a/packages/ui/src/views/components/doc-bars/Toolbar.tsx+++ b/packages/ui/src/views/components/doc-bars/Toolbar.tsx@@ -69,7 +69,7 @@ export function Toolbar() {return () => {listener.unsubscribe();};- }, []);+ }, [position]);useEffect(() => {function resize() {