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.

feat(sheets): toggle gridlines (#3805)

Wenzhao Huc3a7ddfeaa01
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
index 9d83d63124..7f53222133 100644
--- a/.github/workflows/playwright.yml
+++ b/.github/workflows/playwright.yml
@@ -30,6 +30,7 @@ jobs:
- name: 🚀 Deploy to Vercel
uses: amondnet/vercel-action@v25
+ if: failure()
id: vercel-e2e-report
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
diff --git a/e2e/e2e.d.ts b/e2e/e2e.d.ts
index 82b46c2a15..8203915652 100644
--- a/e2e/e2e.d.ts
+++ b/e2e/e2e.d.ts
@@ -15,5 +15,7 @@ declare global {
// eslint-disable-next-line ts/naming-convention
interface Window {
E2EControllerAPI: IE2EControllerAPI;
+ // eslint-disable-next-line ts/no-explicit-any
+ univerAPI: any;
}
}
diff --git a/e2e/visual-comparison/sheets/sheets-gridlines.spec.ts b/e2e/visual-comparison/sheets/sheets-gridlines.spec.ts
new file mode 100644
index 0000000000..19ce7edcaa
--- /dev/null
+++ b/e2e/visual-comparison/sheets/sheets-gridlines.spec.ts
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2023-present DreamNum Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { chromium, expect, test } from '@playwright/test';
+import { generateSnapshotName } from '../const';
+
+const isCI = !!process.env.CI;
+
+test('sheets no gridlines', async () => {
+ const browser = await chromium.launch({
+ headless: !!isCI, // Set to false to see the browser window
+ });
+ const context = await browser.newContext({
+ viewport: { width: 1280, height: 720 },
+ deviceScaleFactor: 2, // Set your desired DPR
+ });
+ const page = await context.newPage();
+ await page.goto('http://localhost:3000/sheets/');
+ await page.waitForTimeout(2000);
+ await page.evaluate(() => window.E2EControllerAPI.loadDefaultSheet());
+ await page.waitForTimeout(5000);
+ await page.evaluate(() => window.univerAPI.getActiveWorkbook().getActiveSheet().setHiddenGridlines(true));
+ await page.waitForTimeout(1000);
+
+ const filename = generateSnapshotName('sheets-no-gridlines');
+ const screenshot = await page.screenshot({
+ mask: [
+ page.locator('.univer-headerbar'),
+ ],
+ fullPage: true,
+ });
+ expect(screenshot).toMatchSnapshot(filename, { maxDiffPixels: 5 });
+});
+
diff --git a/e2e/visual-comparison/sheets/sheets-gridlines.spec.ts-snapshots/sheets-no-gridlines-ci-chromium-linux.png b/e2e/visual-comparison/sheets/sheets-gridlines.spec.ts-snapshots/sheets-no-gridlines-ci-chromium-linux.png
new file mode 100644
index 0000000000..9c1489493f
Binary files /dev/null and b/e2e/visual-comparison/sheets/sheets-gridlines.spec.ts-snapshots/sheets-no-gridlines-ci-chromium-linux.png differ
diff --git a/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts b/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts
index 5e68451667..7455ddaf85 100644
--- a/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts
+++ b/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts
@@ -41,7 +41,7 @@ test('diff default sheet toolbar', async () => {
],
fullPage: true,
});
- await expect(screenshot).toMatchSnapshot(filename, { maxDiffPixels: 5 });
+ await expect(screenshot).toMatchSnapshot(filename, { maxDiffPixels: 100 });
});
test('diff default sheet content', async ({ page }) => {
diff --git a/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/default-sheet-fullpage-ci-chromium-linux.png b/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/default-sheet-fullpage-ci-chromium-linux.png
index d575956f13..7c578ec922 100644
Binary files a/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/default-sheet-fullpage-ci-chromium-linux.png and b/e2e/visual-comparison/sheets/sheets-visual-comparison.spec.ts-snapshots/default-sheet-fullpage-ci-chromium-linux.png differ
diff --git a/examples/package.json b/examples/package.json
index e11373fece..9a51650070 100644
--- a/examples/package.json
+++ b/examples/package.json
@@ -30,7 +30,7 @@
"@univerjs/engine-render": "workspace:*",
"@univerjs/facade": "workspace:*",
"@univerjs/find-replace": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/mockdata": "workspace:*",
"@univerjs/rpc": "workspace:*",
"@univerjs/sheets": "workspace:*",
diff --git a/packages-experimental/action-recorder/package.json b/packages-experimental/action-recorder/package.json
index ec38ac96dd..693f4afe1f 100644
--- a/packages-experimental/action-recorder/package.json
+++ b/packages-experimental/action-recorder/package.json
@@ -65,7 +65,7 @@
"dependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-filter-ui": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages-experimental/uni-docs-ui/package.json b/packages-experimental/uni-docs-ui/package.json
index ce41929e50..70b68cdb90 100644
--- a/packages-experimental/uni-docs-ui/package.json
+++ b/packages-experimental/uni-docs-ui/package.json
@@ -66,7 +66,7 @@
"@univerjs/docs-drawing-ui": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/ui": "workspace:*",
"@univerjs/uniui": "workspace:*",
"clsx": "^2.1.1"
diff --git a/packages-experimental/uni-formula-ui/package.json b/packages-experimental/uni-formula-ui/package.json
index 1918c8199a..aa5efe56e8 100644
--- a/packages-experimental/uni-formula-ui/package.json
+++ b/packages-experimental/uni-formula-ui/package.json
@@ -68,7 +68,7 @@
"@univerjs/docs": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/rpc": "workspace:*",
"@univerjs/sheets-formula": "workspace:*",
"@univerjs/sheets-formula-ui": "workspace:*",
diff --git a/packages-experimental/uni-formula/package.json b/packages-experimental/uni-formula/package.json
index 4ee27558e5..62bda43a00 100644
--- a/packages-experimental/uni-formula/package.json
+++ b/packages-experimental/uni-formula/package.json
@@ -62,7 +62,7 @@
"dependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/docs": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"clsx": "^2.1.1"
},
"devDependencies": {
diff --git a/packages-experimental/uni-sheets-ui/package.json b/packages-experimental/uni-sheets-ui/package.json
index 6a500fadb4..f1b2a8b346 100644
--- a/packages-experimental/uni-sheets-ui/package.json
+++ b/packages-experimental/uni-sheets-ui/package.json
@@ -65,7 +65,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/docs": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-drawing-ui": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages-experimental/uni-slides-ui/package.json b/packages-experimental/uni-slides-ui/package.json
index 77cf7a49bb..7a9505c667 100644
--- a/packages-experimental/uni-slides-ui/package.json
+++ b/packages-experimental/uni-slides-ui/package.json
@@ -63,7 +63,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/slides": "workspace:*",
"@univerjs/slides-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
diff --git a/packages-experimental/uniui/package.json b/packages-experimental/uniui/package.json
index 861f9f69b2..422df0ab6e 100644
--- a/packages-experimental/uniui/package.json
+++ b/packages-experimental/uniui/package.json
@@ -69,7 +69,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
diff --git a/packages/core/src/services/config/config.service.ts b/packages/core/src/services/config/config.service.ts
index 2da5f76a26..e980c315df 100644
--- a/packages/core/src/services/config/config.service.ts
+++ b/packages/core/src/services/config/config.service.ts
@@ -14,10 +14,12 @@
* limitations under the License.
*/
+import type { IDisposable } from '../../common/di';
+import type { Nullable } from '../../shared/types';
+import { filter, Observable, Subject } from 'rxjs';
import { createIdentifier } from '../../common/di';
-import { Tools } from '../../shared';
-import type { Nullable } from '../../shared/types';
+import { Tools } from '../../shared';
// WARNING!!! Do not set per unit config here! You can definitely find a better place to do that.
@@ -45,11 +47,20 @@ export interface IConfigService {
getConfig<T>(id: string): Nullable<T>;
setConfig(id: string | symbol, value: unknown, options?: IConfigOptions): void;
deleteConfig(id: string): boolean;
+ subscribeConfigValue$<T = unknown>(key: string): Observable<T>;
+
}
-export class ConfigService implements IConfigService {
+export class ConfigService implements IConfigService, IDisposable {
+ private _configChanged$ = new Subject<{ [key: string]: unknown }>();
+ readonly configChanged$ = this._configChanged$.asObservable();
+
private readonly _config: Map<string | symbol, any> = new Map();
+ dispose(): void {
+ this._configChanged$.complete();
+ }
+
getConfig<T>(id: string | symbol): Nullable<T> {
return this._config.get(id) as T;
}
@@ -57,18 +68,33 @@ export class ConfigService implements IConfigService {
setConfig(id: string, value: unknown, options?: IConfigOptions): void {
const { merge = false } = options || {};
- const existingValue = this._config.get(id) ?? {};
+ let nextValue = this._config.get(id) ?? {};
if (merge) {
- this._config.set(id, Tools.deepMerge(existingValue, value));
-
- return;
+ nextValue = Tools.deepMerge(nextValue, value);
+ } else {
+ nextValue = value;
}
- this._config.set(id, value);
+ this._config.set(id, nextValue);
+ this._configChanged$.next({ [id]: nextValue });
}
deleteConfig(id: string | symbol): boolean {
return this._config.delete(id);
}
+
+ subscribeConfigValue$<T = unknown>(key: string): Observable<T> {
+ return new Observable<T>((observer) => {
+ if (Object.prototype.hasOwnProperty.call(this._config, key)) {
+ observer.next(this._config.get(key) as T);
+ }
+
+ const sub = this.configChanged$
+ .pipe(filter((c) => Object.prototype.hasOwnProperty.call(c, key)))
+ .subscribe((c) => observer.next(c[key] as T));
+
+ return () => sub.unsubscribe();
+ });
+ }
}
diff --git a/packages/core/src/shared/lifecycle.ts b/packages/core/src/shared/lifecycle.ts
index ac337d1f74..a53d76a2f0 100644
--- a/packages/core/src/shared/lifecycle.ts
+++ b/packages/core/src/shared/lifecycle.ts
@@ -15,9 +15,9 @@
*/
import type { Subscription, SubscriptionLike } from 'rxjs';
+import type { IDisposable } from '../common/di';
import { Subject } from 'rxjs';
import { isSubscription } from 'rxjs/internal/Subscription';
-import type { IDisposable } from '../common/di';
type DisposableLike = IDisposable | SubscriptionLike | (() => void);
@@ -93,7 +93,7 @@ export class Disposable implements IDisposable {
protected _disposed = false;
private readonly _collection = new DisposableCollection();
- protected disposeWithMe(disposable: DisposableLike): IDisposable {
+ public disposeWithMe(disposable: DisposableLike): IDisposable {
return this._collection.add(disposable);
}
diff --git a/packages/core/src/sheets/typedef.ts b/packages/core/src/sheets/typedef.ts
index 12d55c211d..b1fed277b0 100644
--- a/packages/core/src/sheets/typedef.ts
+++ b/packages/core/src/sheets/typedef.ts
@@ -546,7 +546,7 @@ export interface IOptionData {
/**
* Option of copyTo function
*/
-export interface ICopyToOptionsData extends IOptionData {}
+export interface ICopyToOptionsData extends IOptionData { }
export interface IRectLTRB {
left: number;
@@ -574,9 +574,9 @@ export interface ISingleCell {
isMergedMainCell: boolean;
}
-export interface IRangeWithCoord extends IPosition, IRange {}
+export interface IRangeWithCoord extends IPosition, IRange { }
-export interface ISelectionCell extends IRange, ISingleCell {}
+export interface ISelectionCell extends IRange, ISingleCell { }
export interface ISelectionCellWithMergeInfo extends IPosition, ISingleCell {
mergeInfo: IRangeWithCoord; // merge cell, start and end is upper left cell
diff --git a/packages/design/package.json b/packages/design/package.json
index 469be55c13..95331ef5ef 100644
--- a/packages/design/package.json
+++ b/packages/design/package.json
@@ -68,7 +68,7 @@
"@rc-component/color-picker": "^2.0.1",
"@rc-component/trigger": "^2.2.3",
"@types/react-mentions": "^4.4.0",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"clsx": "^2.1.1",
"dayjs": "^1.11.13",
"rc-dialog": "^9.6.0",
diff --git a/packages/docs-drawing-ui/package.json b/packages/docs-drawing-ui/package.json
index 9a70a0531a..e4a997b24e 100644
--- a/packages/docs-drawing-ui/package.json
+++ b/packages/docs-drawing-ui/package.json
@@ -71,7 +71,7 @@
"@univerjs/drawing": "workspace:*",
"@univerjs/drawing-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/ui": "workspace:*",
"clsx": "^2.1.1"
},
diff --git a/packages/docs-hyper-link-ui/package.json b/packages/docs-hyper-link-ui/package.json
index fdb464c4d8..76d83b5f97 100644
--- a/packages/docs-hyper-link-ui/package.json
+++ b/packages/docs-hyper-link-ui/package.json
@@ -69,7 +69,7 @@
"@univerjs/docs-hyper-link": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/ui": "workspace:*",
"clsx": "^2.1.1"
},
diff --git a/packages/docs-hyper-link/package.json b/packages/docs-hyper-link/package.json
index c8cd22255c..ce8201d993 100644
--- a/packages/docs-hyper-link/package.json
+++ b/packages/docs-hyper-link/package.json
@@ -61,7 +61,7 @@
},
"dependencies": {
"@univerjs/core": "workspace:*",
- "@univerjs/icons": "^0.1.79"
+ "@univerjs/icons": "^0.1.84"
},
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
diff --git a/packages/docs-thread-comment-ui/package.json b/packages/docs-thread-comment-ui/package.json
index e5d4d01bf8..b3a65901a5 100644
--- a/packages/docs-thread-comment-ui/package.json
+++ b/packages/docs-thread-comment-ui/package.json
@@ -67,7 +67,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/thread-comment": "workspace:*",
"@univerjs/thread-comment-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
diff --git a/packages/docs-ui/package.json b/packages/docs-ui/package.json
index ec13e78597..aa0e1bc743 100644
--- a/packages/docs-ui/package.json
+++ b/packages/docs-ui/package.json
@@ -70,7 +70,7 @@
"@univerjs/docs": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/ui": "workspace:*",
"clsx": "^2.1.1"
},
diff --git a/packages/drawing-ui/package.json b/packages/drawing-ui/package.json
index 3864dee338..3485d58dc5 100644
--- a/packages/drawing-ui/package.json
+++ b/packages/drawing-ui/package.json
@@ -67,7 +67,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/drawing": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/ui": "workspace:*",
"clsx": "^2.1.1"
},
diff --git a/packages/drawing/package.json b/packages/drawing/package.json
index 6f72eeb90a..d8124a460a 100644
--- a/packages/drawing/package.json
+++ b/packages/drawing/package.json
@@ -61,7 +61,7 @@
},
"dependencies": {
"@univerjs/core": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"ot-json1": "^1.0.2"
},
"devDependencies": {
diff --git a/packages/engine-render/src/components/sheets/sheet-component.ts b/packages/engine-render/src/components/sheets/sheet-component.ts
index 6dab0de118..43845b08fe 100644
--- a/packages/engine-render/src/components/sheets/sheet-component.ts
+++ b/packages/engine-render/src/components/sheets/sheet-component.ts
@@ -16,12 +16,12 @@
import type { IRange, Nullable } from '@univerjs/core';
-import { RENDER_CLASS_TYPE } from '../../basics/const';
import type { IViewportInfo, Vector2 } from '../../basics/vector2';
import type { UniverRenderingContext } from '../../context';
-import { RenderComponent } from '../component';
import type { SHEET_EXTENSION_TYPE } from './extensions/sheet-extension';
import type { SpreadsheetSkeleton } from './sheet-skeleton';
+import { RENDER_CLASS_TYPE } from '../../basics/const';
+import { RenderComponent } from '../component';
export abstract class SheetComponent extends RenderComponent<SpreadsheetSkeleton, SHEET_EXTENSION_TYPE, IRange[]> {
constructor(
diff --git a/packages/engine-render/src/components/sheets/sheet-skeleton.ts b/packages/engine-render/src/components/sheets/sheet-skeleton.ts
index 2f10c38083..71c2c190c6 100644
--- a/packages/engine-render/src/components/sheets/sheet-skeleton.ts
+++ b/packages/engine-render/src/components/sheets/sheet-skeleton.ts
@@ -216,7 +216,7 @@ const DEFAULT_CELL_DOCUMENT_MODEL_OPTION: ICellDocumentModelOption = {
ignoreTextRotation: false,
};
-interface IRowColumnRange extends IRowRange, IColumnRange {}
+interface IRowColumnRange extends IRowRange, IColumnRange { }
export interface IDocumentLayoutObject {
documentModel: Nullable<DocumentDataModel>;
fontString: string;
@@ -1888,7 +1888,7 @@ export class SpreadsheetSkeleton extends Skeleton {
// If the cell is merged and is not the main cell, the cell is not rendered.
if (isMerged && !isMergedMainCell) {
return;
- // If the cell no merged, the cell is not rendered.
+ // If the cell no merged, the cell is not rendered.
} else if (!isMergedMainCell) {
return;
}
diff --git a/packages/engine-render/src/components/sheets/spreadsheet.ts b/packages/engine-render/src/components/sheets/spreadsheet.ts
index dcbc6dc34c..b696fbf6c8 100644
--- a/packages/engine-render/src/components/sheets/spreadsheet.ts
+++ b/packages/engine-render/src/components/sheets/spreadsheet.ts
@@ -16,9 +16,7 @@
import type { IRange, ISelectionCellWithMergeInfo, Nullable, ObjectMatrix } from '@univerjs/core';
import type { IBoundRectNoAngle, IViewportInfo, Vector2 } from '../../basics/vector2';
-
import type { Canvas } from '../../canvas';
-
import type { UniverRenderingContext2D } from '../../context';
import type { Engine } from '../../engine';
import type { Scene } from '../../scene';
@@ -32,7 +30,6 @@ import { BooleanNumber, sortRules, Tools } from '@univerjs/core';
import { FIX_ONE_PIXEL_BLUR_OFFSET, RENDER_CLASS_TYPE } from '../../basics/const';
import { getCellPositionByIndex, getColor } from '../../basics/tools';
import { Documents } from '../docs/document';
-
import { SpreadsheetExtensionRegistry } from '../extension';
import { SHEET_EXTENSION_PREFIX } from './extensions/sheet-extension';
import { type IPaintForRefresh, type IPaintForScrolling, SHEET_VIEWPORT_KEY } from './interfaces';
@@ -94,12 +91,11 @@ export class Spreadsheet extends SheetComponent {
return this._forceDisableGridlines;
}
- /**
- * TODO: DR-Univer, fix as unknown as
- */
override dispose() {
super.dispose();
this._documents?.dispose();
+
+ // TODO: fix memory leak without reassigning these properties
this._documents = null as unknown as Documents;
this._backgroundExtension = null as unknown as Background;
this._borderExtension = null as unknown as Border;
@@ -389,7 +385,7 @@ export class Spreadsheet extends SheetComponent {
if (
(segment.startRow === -1 && segment.endRow === -1) ||
- (segment.startColumn === -1 && segment.endColumn === -1)
+ (segment.startColumn === -1 && segment.endColumn === -1)
) {
return;
}
@@ -567,8 +563,7 @@ export class Spreadsheet extends SheetComponent {
ctx.setLineWidthByPrecision(1);
- // TODO@jikkai: these should be configurable
- ctx.strokeStyle = getColor([214, 216, 219]);
+ ctx.strokeStyle = ctx.renderConfig.gridlineColor ?? getColor([214, 216, 219]);
const columnWidthAccumulationLength = columnWidthAccumulation.length;
const rowHeightAccumulationLength = rowHeightAccumulation.length;
diff --git a/packages/engine-render/src/context.ts b/packages/engine-render/src/context.ts
index 3764728911..19519ada6f 100644
--- a/packages/engine-render/src/context.ts
+++ b/packages/engine-render/src/context.ts
@@ -15,13 +15,13 @@
*/
import type { Nullable } from '@univerjs/core';
+import type { IRenderConfig } from './services/render-config';
import { Tools } from '@univerjs/core';
import { fixLineWidthByScale, getColor } from './basics/tools';
export class UniverRenderingContext2D implements CanvasRenderingContext2D {
__mode = 'rendering';
- private _system: string;
- private _browser: string;
+
private _transformCache: Nullable<DOMMatrix>;
readonly canvas: HTMLCanvasElement;
@@ -29,6 +29,8 @@ export class UniverRenderingContext2D implements CanvasRenderingContext2D {
private _systemType: string;
private _browserType: string;
+ renderConfig: Readonly<IRenderConfig> = {};
+
constructor(context: CanvasRenderingContext2D) {
this.canvas = context.canvas;
this._context = context;
@@ -900,7 +902,6 @@ export class UniverRenderingContext2D implements CanvasRenderingContext2D {
this._context.setLineDash(segments);
} else if ('mozDash' in this._context) {
// verified that this works in firefox
-
(<any> this._context.mozDash) = segments;
} else if ('webkitLineDash' in this._context) {
// does not currently work for Safari
@@ -1008,18 +1009,7 @@ export class UniverRenderingContext2D implements CanvasRenderingContext2D {
}
}
-/**
- * TODO
- */
-export class UniverRenderingContextWebGL { }
-
-/**
- * TODO
- */
-export class UniverRenderingContextWebGPU { }
-
-export class UniverRenderingContext extends UniverRenderingContext2D {
-}
+export class UniverRenderingContext extends UniverRenderingContext2D { }
export class UniverPrintingContext extends UniverRenderingContext2D {
override __mode = 'printing';
diff --git a/packages/engine-render/src/index.ts b/packages/engine-render/src/index.ts
index e3496cc645..7c89acef16 100644
--- a/packages/engine-render/src/index.ts
+++ b/packages/engine-render/src/index.ts
@@ -19,6 +19,7 @@ export * from './basics';
export { getOffsetRectForDom } from './basics/position';
export * from './canvas';
export * from './components';
+export { UniverRenderConfigService } from './services/render-config.service';
export { DocBackground } from './components/docs/doc-background';
export { Documents } from './components/docs/document';
export type { IPageRenderConfig } from './components/docs/document';
@@ -31,7 +32,6 @@ export { Liquid } from './components/docs/liquid';
export { DataStreamTreeNode } from './components/docs/view-model/data-stream-tree-node';
export { DocumentViewModel } from './components/docs/view-model/document-view-model';
export { DocumentEditArea } from './components/docs/view-model/document-view-model';
-
export { parseDataStreamToTree } from './components/docs/view-model/document-view-model';
export { DEFAULT_PADDING_DATA } from './components/sheets/sheet-skeleton';
export * from './context';
@@ -39,7 +39,7 @@ export * from './custom';
export * from './engine';
export * from './group';
export * from './layer';
-export { IRenderingEngine, UniverRenderEnginePlugin } from './render-engine';
+export { IRenderingEngine, UniverRenderEnginePlugin } from './plugin';
export { IRenderManagerService, type RenderComponentType, RenderManagerService } from './render-manager/render-manager.service';
export { type IRender, type IRenderContext, type IRenderModule, RenderUnit } from './render-manager/render-unit';
export * from './scene';
diff --git a/packages/engine-render/src/render-engine.ts b/packages/engine-render/src/plugin.ts
similarity index 86%
rename from packages/engine-render/src/render-engine.ts
rename to packages/engine-render/src/plugin.ts
index 89ba580e69..c1643dc75d 100644
--- a/packages/engine-render/src/render-engine.ts
+++ b/packages/engine-render/src/plugin.ts
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-import { createIdentifier, IConfigService, Inject, Injector, Plugin } from '@univerjs/core';
+import type { IUniverEngineRenderConfig } from './controllers/config.schema';
+import { createIdentifier, IConfigService, Inject, Injector, Plugin, registerDependencies } from '@univerjs/core';
+import { defaultPluginConfig, PLUGIN_CONFIG_KEY } from './controllers/config.schema';
import { Engine } from './engine';
import { IRenderManagerService, RenderManagerService } from './render-manager/render-manager.service';
-import type { IUniverEngineRenderConfig } from './controllers/config.schema';
-import { defaultPluginConfig, PLUGIN_CONFIG_KEY } from './controllers/config.schema';
/**
* The global rendering engine.
@@ -42,13 +42,9 @@ export class UniverRenderEnginePlugin extends Plugin {
const { ...rest } = this._config;
this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
- this._injector.add([IRenderingEngine, { useFactory: () => new Engine() }]);
-
- this._injector.add([
- IRenderManagerService,
- {
- useClass: RenderManagerService,
- },
+ registerDependencies(this._injector, [
+ [IRenderingEngine, { useFactory: () => new Engine() }],
+ [IRenderManagerService, { useClass: RenderManagerService }],
]);
}
}
diff --git a/packages/engine-render/src/render-manager/render-unit.ts b/packages/engine-render/src/render-manager/render-unit.ts
index cda51ee8b7..0c33344312 100644
--- a/packages/engine-render/src/render-manager/render-unit.ts
+++ b/packages/engine-render/src/render-manager/render-unit.ts
@@ -15,10 +15,10 @@
*/
import type { Dependency, DependencyIdentifier, IDisposable, Nullable, UnitModel, UnitType, UniverInstanceType } from '@univerjs/core';
-import { Disposable, Inject, Injector, isClassDependencyItem } from '@univerjs/core';
import type { Engine } from '../engine';
import type { Scene } from '../scene';
import type { RenderComponentType } from './render-manager.service';
+import { Disposable, Inject, Injector, isClassDependencyItem } from '@univerjs/core';
/**
* Public interface of a {@link RenderUnit}.
@@ -41,7 +41,7 @@ export interface IRender {
/**
* Every render module should implement this interface.
*/
-export interface IRenderModule extends IDisposable {}
+export interface IRenderModule extends IDisposable { }
/**
* Necessary context for a render module.This interface would be the first argument of render modules' constructor
@@ -77,12 +77,13 @@ export class RenderUnit extends Disposable implements IRender {
get components(): Map<string, RenderComponentType> { return this._renderContext.components; }
constructor(
- init: Pick<IRenderContext, 'engine' | 'scene' | 'isMainScene' | 'unit' >,
+ init: Pick<IRenderContext, 'engine' | 'scene' | 'isMainScene' | 'unit'>,
@Inject(Injector) parentInjector: Injector
) {
super();
this._injector = parentInjector.createChild();
+
this._renderContext = {
unit: init.unit,
unitId: init.unit.getUnitId(),
@@ -140,3 +141,4 @@ export class RenderUnit extends Disposable implements IRender {
});
}
}
+
diff --git a/packages/engine-render/src/services/render-config.service.ts b/packages/engine-render/src/services/render-config.service.ts
new file mode 100644
index 0000000000..228a509d20
--- /dev/null
+++ b/packages/engine-render/src/services/render-config.service.ts
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2023-present DreamNum Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable ts/no-explicit-any */
+
+import type { IRenderConfig } from './render-config';
+import { debounceTime, Subject } from 'rxjs';
+
+/**
+ * This service carries managers render config that would be passed
+ * to every widget, so some rendering could be optimized.
+ */
+export class UniverRenderConfigService {
+ private readonly _renderConfig: IRenderConfig = {
+ ok: '111',
+ };
+
+ private readonly _updateSignal$ = new Subject<void>();
+ readonly updateSignal$ = this._updateSignal$.pipe(debounceTime(4));
+
+ setRenderConfig(key: string, value: any): void {
+ if (value == null) {
+ delete this._renderConfig[key];
+ return;
+ }
+
+ this._renderConfig[key] = value;
+ };
+
+ getRenderConfig(): Readonly<Record<string, any>> {
+ return this._renderConfig;
+ }
+}
+
diff --git a/packages/engine-render/src/services/render-config.ts b/packages/engine-render/src/services/render-config.ts
new file mode 100644
index 0000000000..f18f5836a4
--- /dev/null
+++ b/packages/engine-render/src/services/render-config.ts
@@ -0,0 +1,19 @@
+/**
+ * Copyright 2023-present DreamNum Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export interface IRenderConfig {
+ [key: string]: any;
+}
diff --git a/packages/engine-render/src/viewport.ts b/packages/engine-render/src/viewport.ts
index 77d47cc2a9..1971db19b1 100644
--- a/packages/engine-render/src/viewport.ts
+++ b/packages/engine-render/src/viewport.ts
@@ -464,6 +464,8 @@ export class Viewport {
return this.viewportScrollY - this._preViewportScrollY;
}
+ get canvas() { return this._cacheCanvas; }
+
enable() {
this._active = true;
}
diff --git a/packages/facade/src/apis/facade.ts b/packages/facade/src/apis/facade.ts
index de5360d420..9a301fa709 100644
--- a/packages/facade/src/apis/facade.ts
+++ b/packages/facade/src/apis/facade.ts
@@ -38,7 +38,6 @@ import type { ISocket } from '@univerjs/network';
import type { ISetCrosshairHighlightColorOperationParams } from '@univerjs/sheets-crosshair-highlight';
import type { IRegisterFunctionParams } from '@univerjs/sheets-formula';
import type { IImageWatermarkConfig, ITextWatermarkConfig } from '@univerjs/watermark';
-
import {
BorderStyleTypes,
debounce,
diff --git a/packages/facade/src/apis/sheets/f-worksheet.ts b/packages/facade/src/apis/sheets/f-worksheet.ts
index c27831a471..da161bb4ef 100644
--- a/packages/facade/src/apis/sheets/f-worksheet.ts
+++ b/packages/facade/src/apis/sheets/f-worksheet.ts
@@ -15,15 +15,14 @@
*/
import type { ICellData, IDisposable, IFreeze, IRange, IStyleData, Nullable, Workbook, Worksheet } from '@univerjs/core';
-import type { ISetRangeValuesMutationParams } from '@univerjs/sheets';
+import type { ISetRangeValuesMutationParams, IToggleGridlinesCommandParams } from '@univerjs/sheets';
import type { IDataValidationResCache } from '@univerjs/sheets-data-validation';
import type { FilterModel } from '@univerjs/sheets-filter';
-
import type { FWorkbook, IFICanvasFloatDom } from './f-workbook';
-import { Direction, ICommandService, Inject, Injector, ObjectMatrix, RANGE_TYPE } from '@univerjs/core';
+import { BooleanNumber, Direction, ICommandService, Inject, Injector, ObjectMatrix, RANGE_TYPE } from '@univerjs/core';
import { DataValidationModel } from '@univerjs/data-validation';
import { deserializeRangeWithSheet } from '@univerjs/engine-formula';
-import { copyRangeStyles, InsertColCommand, InsertRowCommand, MoveColsCommand, MoveRowsCommand, RemoveColCommand, RemoveRowCommand, SetColHiddenCommand, SetColWidthCommand, SetFrozenCommand, SetRangeValuesMutation, SetRowHeightCommand, SetRowHiddenCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetWorksheetDefaultStyleMutation, SetWorksheetRowColumnStyleMutation, SetWorksheetRowIsAutoHeightCommand, SheetsSelectionsService } from '@univerjs/sheets';
+import { copyRangeStyles, InsertColCommand, InsertRowCommand, MoveColsCommand, MoveRowsCommand, RemoveColCommand, RemoveRowCommand, SetColHiddenCommand, SetColWidthCommand, SetFrozenCommand, SetRangeValuesMutation, SetRowHeightCommand, SetRowHiddenCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetWorksheetDefaultStyleMutation, SetWorksheetRowColumnStyleMutation, SetWorksheetRowIsAutoHeightCommand, SheetsSelectionsService, ToggleGridlinesCommand } from '@univerjs/sheets';
import { SheetsDataValidationValidatorService } from '@univerjs/sheets-data-validation';
import { SheetCanvasFloatDomManagerService } from '@univerjs/sheets-drawing-ui';
import { SheetsFilterService } from '@univerjs/sheets-filter';
@@ -106,7 +105,7 @@ export class FWorksheet {
* @param {boolean} [keepRaw] If true, return the raw style data maybe the style name or style data, otherwise return the data from row manager
* @returns {Nullable<IStyleData> | string} The default style of the worksheet row name or style data
*/
- getRowDefaultStyle(index: number, keepRaw = false): Nullable<IStyleData> | string {
+ getRowDefaultStyle(index: number, keepRaw: boolean = false): Nullable<IStyleData> | string {
return this._worksheet.getRowStyle(index, keepRaw);
}
@@ -116,7 +115,7 @@ export class FWorksheet {
* @param {boolean} [keepRaw] If true, return the raw style data maybe the style name or style data, otherwise return the data from col manager
* @returns {Nullable<IStyleData> | string} The default style of the worksheet column name or style data
*/
- getColumnDefaultStyle(index: number, keepRaw = false): Nullable<IStyleData> | string {
+ getColumnDefaultStyle(index: number, keepRaw: boolean = false): Nullable<IStyleData> | string {
return this._worksheet.getColumnStyle(index, keepRaw);
}
@@ -1121,6 +1120,25 @@ export class FWorksheet {
return freeze.startRow;
}
+ /**
+ * Returns true if the sheet's gridlines are hidden; otherwise returns false. Gridlines are visible by default.
+ */
+ hasHiddenGridLines(): boolean {
+ return this._worksheet.getConfig().showGridlines === BooleanNumber.FALSE;
+ }
+
+ /**
+ * Hides or reveals the sheet gridlines.
+ * @param {boolean} hidden If `true`, hide gridlines in this sheet; otherwise show the gridlines.
+ */
+ setHiddenGridlines(hidden: boolean): Promise<boolean> {
+ return this._commandService.executeCommand(ToggleGridlinesCommand.id, {
+ unitId: this._workbook.getUnitId(),
+ subUnitId: this._worksheet.getSheetId(),
+ showGridlines: hidden ? BooleanNumber.FALSE : BooleanNumber.TRUE,
+ } as IToggleGridlinesCommandParams);
+ }
+
/**
* Subscribe to the cell data change event.
* @param callback - The callback function to be executed when the cell data changes.
@@ -1134,7 +1152,7 @@ export class FWorksheet {
if (
params.unitId === this._workbook.getUnitId() &&
params.subUnitId === this._worksheet.getSheetId() &&
- params.cellValue
+ params.cellValue
) {
callback(new ObjectMatrix(params.cellValue));
}
diff --git a/packages/find-replace/package.json b/packages/find-replace/package.json
index e9c81e82ee..1d2398b047 100644
--- a/packages/find-replace/package.json
+++ b/packages/find-replace/package.json
@@ -69,7 +69,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/ui": "workspace:*"
},
"devDependencies": {
diff --git a/packages/sheets-conditional-formatting-ui/package.json b/packages/sheets-conditional-formatting-ui/package.json
index 08d1106e2d..1acf29748b 100644
--- a/packages/sheets-conditional-formatting-ui/package.json
+++ b/packages/sheets-conditional-formatting-ui/package.json
@@ -71,7 +71,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/protocol": "0.1.39-alpha.30",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-conditional-formatting": "workspace:*",
diff --git a/packages/sheets-crosshair-highlight/package.json b/packages/sheets-crosshair-highlight/package.json
index 573ea0ad9b..a0a68f3123 100644
--- a/packages/sheets-crosshair-highlight/package.json
+++ b/packages/sheets-crosshair-highlight/package.json
@@ -65,7 +65,7 @@
"dependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
diff --git a/packages/sheets-data-validation-ui/package.json b/packages/sheets-data-validation-ui/package.json
index 64c99a2320..4a2c3d4504 100644
--- a/packages/sheets-data-validation-ui/package.json
+++ b/packages/sheets-data-validation-ui/package.json
@@ -74,7 +74,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/protocol": "0.1.39-alpha.30",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-data-validation": "workspace:*",
diff --git a/packages/sheets-data-validation/package.json b/packages/sheets-data-validation/package.json
index 36279c3a31..8703003bd7 100644
--- a/packages/sheets-data-validation/package.json
+++ b/packages/sheets-data-validation/package.json
@@ -67,7 +67,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/data-validation": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/protocol": "0.1.39-alpha.30",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-formula": "workspace:*",
diff --git a/packages/sheets-drawing-ui/package.json b/packages/sheets-drawing-ui/package.json
index 138a55792a..f3cf482ec0 100644
--- a/packages/sheets-drawing-ui/package.json
+++ b/packages/sheets-drawing-ui/package.json
@@ -68,7 +68,7 @@
"@univerjs/drawing": "workspace:*",
"@univerjs/drawing-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-drawing": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages/sheets-filter-ui/package.json b/packages/sheets-filter-ui/package.json
index 7dff49e7b0..e318337f2b 100644
--- a/packages/sheets-filter-ui/package.json
+++ b/packages/sheets-filter-ui/package.json
@@ -67,7 +67,7 @@
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/rpc": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-filter": "workspace:*",
diff --git a/packages/sheets-formula-ui/package.json b/packages/sheets-formula-ui/package.json
index 951fcd0801..8edb6ebffe 100644
--- a/packages/sheets-formula-ui/package.json
+++ b/packages/sheets-formula-ui/package.json
@@ -74,7 +74,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-formula": "workspace:*",
"@univerjs/sheets-numfmt": "workspace:*",
diff --git a/packages/sheets-hyper-link-ui/package.json b/packages/sheets-hyper-link-ui/package.json
index 643ca9662b..ec42de2b9f 100644
--- a/packages/sheets-hyper-link-ui/package.json
+++ b/packages/sheets-hyper-link-ui/package.json
@@ -71,7 +71,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-formula-ui": "workspace:*",
"@univerjs/sheets-hyper-link": "workspace:*",
diff --git a/packages/sheets-numfmt/package.json b/packages/sheets-numfmt/package.json
index 2f5d741523..4aac76def5 100644
--- a/packages/sheets-numfmt/package.json
+++ b/packages/sheets-numfmt/package.json
@@ -70,7 +70,7 @@
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-numfmt": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/ui": "workspace:*"
diff --git a/packages/sheets-sort-ui/package.json b/packages/sheets-sort-ui/package.json
index b141fcb1d7..9722890389 100644
--- a/packages/sheets-sort-ui/package.json
+++ b/packages/sheets-sort-ui/package.json
@@ -67,7 +67,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-sort": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages/sheets-thread-comment/package.json b/packages/sheets-thread-comment/package.json
index 4c2aecf742..7651cabbc2 100644
--- a/packages/sheets-thread-comment/package.json
+++ b/packages/sheets-thread-comment/package.json
@@ -67,7 +67,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-thread-comment-base": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
diff --git a/packages/sheets-ui/package.json b/packages/sheets-ui/package.json
index 81798888f1..c523f61550 100644
--- a/packages/sheets-ui/package.json
+++ b/packages/sheets-ui/package.json
@@ -71,7 +71,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/protocol": "0.1.39-alpha.30",
"@univerjs/sheets": "workspace:*",
"@univerjs/telemetry": "workspace:*",
diff --git a/packages/sheets-ui/src/controllers/config.schema.ts b/packages/sheets-ui/src/controllers/config.schema.ts
index 2ab5a50b3e..81fe980112 100644
--- a/packages/sheets-ui/src/controllers/config.schema.ts
+++ b/packages/sheets-ui/src/controllers/config.schema.ts
@@ -35,3 +35,4 @@ export interface IUniverSheetsUIConfig {
export const defaultPluginConfig: IUniverSheetsUIConfig = {
formulaBar: true,
};
+
diff --git a/packages/sheets-ui/src/controllers/menu.schema.ts b/packages/sheets-ui/src/controllers/menu.schema.ts
index 3d218ac81b..eb044bb90d 100644
--- a/packages/sheets-ui/src/controllers/menu.schema.ts
+++ b/packages/sheets-ui/src/controllers/menu.schema.ts
@@ -41,6 +41,7 @@ import {
SetTextWrapCommand,
SetVerticalTextAlignCommand, SetWorksheetHideCommand,
SetWorksheetRowIsAutoHeightCommand,
+ ToggleGridlinesCommand,
} from '@univerjs/sheets';
import { ContextMenuGroup, ContextMenuPosition, RibbonStartGroup } from '@univerjs/ui';
import {
@@ -88,6 +89,7 @@ import { RenameSheetOperation } from '../commands/operations/rename-sheet.operat
import { CellBorderSelectorMenuItemFactory } from './menu/border.menu';
import { CLEAR_SELECTION_MENU_ID, ClearSelectionAllMenuItemFactory, ClearSelectionContentMenuItemFactory, ClearSelectionFormatMenuItemFactory, ClearSelectionMenuItemFactory } from './menu/clear.menu';
import { DELETE_RANGE_MENU_ID, DeleteRangeMenuItemFactory, DeleteRangeMoveLeftMenuItemFactory, DeleteRangeMoveUpMenuItemFactory, RemoveColMenuItemFactory, RemoveRowMenuItemFactory } from './menu/delete.menu';
+import { ToggleGridlinesMenuFactory } from './menu/gridlines.menu';
import {
CELL_INSERT_MENU_ID,
CellInsertMenuItemFactory,
@@ -698,4 +700,12 @@ export const menuSchema: MenuSchemaType = {
},
},
},
+ [ContextMenuPosition.FOOTER_MENU]: {
+ [ContextMenuGroup.OTHERS]: {
+ [ToggleGridlinesCommand.id]: {
+ order: 1,
+ menuItemFactory: ToggleGridlinesMenuFactory,
+ },
+ },
+ },
};
diff --git a/packages/sheets-ui/src/controllers/menu/border.menu.ts b/packages/sheets-ui/src/controllers/menu/border.menu.ts
index 63720a5d06..41aa077595 100644
--- a/packages/sheets-ui/src/controllers/menu/border.menu.ts
+++ b/packages/sheets-ui/src/controllers/menu/border.menu.ts
@@ -14,20 +14,18 @@
* limitations under the License.
*/
-import { ICommandService, UniverInstanceType } from '@univerjs/core';
+import type { IAccessor } from '@univerjs/core';
import type { IBorderInfo } from '@univerjs/sheets';
-import { BorderStyleManagerService, RangeProtectionPermissionEditPoint, SetBorderBasicCommand, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission } from '@univerjs/sheets';
import type { IMenuSelectorItem } from '@univerjs/ui';
+import { ICommandService, UniverInstanceType } from '@univerjs/core';
+import { BorderStyleManagerService, RangeProtectionPermissionEditPoint, SetBorderBasicCommand, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission } from '@univerjs/sheets';
import { getMenuHiddenObservable, MenuItemType } from '@univerjs/ui';
-import type { IAccessor } from '@univerjs/core';
import { Observable } from 'rxjs';
import { BORDER_LINE_CHILDREN, BORDER_PANEL_COMPONENT } from '../../components/border-panel/interface';
import { getCurrentRangeDisable$ } from './menu-util';
export function CellBorderSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<IBorderInfo, IBorderInfo> {
- // const permissionService = accessor.get(IPermissionService);
-
const borderStyleManagerService = accessor.get(BorderStyleManagerService);
const disabled$ = getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission], rangeTypes: [RangeProtectionPermissionEditPoint] });
diff --git a/packages/sheets-ui/src/controllers/menu/gridlines.menu.ts b/packages/sheets-ui/src/controllers/menu/gridlines.menu.ts
new file mode 100644
index 0000000000..22d3e71cd5
--- /dev/null
+++ b/packages/sheets-ui/src/controllers/menu/gridlines.menu.ts
@@ -0,0 +1,54 @@
+/**
+ * Copyright 2023-present DreamNum Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type { IAccessor, Workbook } from '@univerjs/core';
+import { BooleanNumber, DisposableCollection, ICommandService, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
+import { SetWorksheetActiveOperation, ToggleGridlinesCommand, ToggleGridlinesMutation } from '@univerjs/sheets';
+import { type IMenuButtonItem, MenuItemType } from '@univerjs/ui';
+import { Observable } from 'rxjs';
+
+export function ToggleGridlinesMenuFactory(accessor: IAccessor): IMenuButtonItem {
+ const commandService = accessor.get(ICommandService);
+ const instanceService = accessor.get(IUniverInstanceService);
+
+ return {
+ id: ToggleGridlinesCommand.id,
+ type: MenuItemType.BUTTON,
+ tooltip: 'toolbar.toggleGridlines',
+ icon: 'HideGridlines',
+ activated$: new Observable<boolean>((observer) => {
+ const getValue = () => {
+ const workbook = instanceService.getCurrentUnitForType<Workbook>(UniverInstanceType.UNIVER_SHEET);
+ if (workbook) return workbook.getActiveSheet().getConfig().showGridlines === BooleanNumber.TRUE;
+ return false;
+ };
+
+ const disposable = new DisposableCollection();
+ disposable.add(commandService.onCommandExecuted((c) => {
+ if (c.id === ToggleGridlinesMutation.id || c.id === SetWorksheetActiveOperation.id) {
+ observer.next(getValue());
+ }
+ }));
+ disposable.add(instanceService.getCurrentTypeOfUnit$<Workbook>(UniverInstanceType.UNIVER_SHEET).subscribe(() => {
+ observer.next(getValue());
+ }));
+
+ observer.next(getValue());
+ return () => disposable.dispose();
+ }),
+ };
+}
+
diff --git a/packages/sheets-ui/src/controllers/render-controllers/sheet.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/sheet.render-controller.ts
index 8fca0ef8be..483217a84f 100644
--- a/packages/sheets-ui/src/controllers/render-controllers/sheet.render-controller.ts
+++ b/packages/sheets-ui/src/controllers/render-controllers/sheet.render-controller.ts
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-import type { ICommandInfo, IExecutionOptions, IRange, Nullable, Workbook, Worksheet } from '@univerjs/core';
+import type { ICommandInfo, IRange, Nullable, Workbook, Worksheet } from '@univerjs/core';
import type { ISetFormulaCalculationNotificationMutation } from '@univerjs/engine-formula';
import type { IAfterRender$Info, IBasicFrameInfo, IExtendFrameInfo, IRenderContext, IRenderModule, ISummaryFrameInfo, ITimeMetric, IViewportInfos, Scene } from '@univerjs/engine-render';
-import { CommandType, ICommandService, IContextService, Inject, Optional, Rectangle, RxDisposable } from '@univerjs/core';
+import { CommandType, ICommandService, Inject, Optional, Rectangle, RxDisposable } from '@univerjs/core';
import { SetFormulaCalculationNotificationMutation } from '@univerjs/engine-formula';
import {
Rect,
@@ -30,8 +30,8 @@ import {
Viewport,
} from '@univerjs/engine-render';
import { COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, MoveRangeMutation, SetRangeValuesMutation, SetWorksheetActiveOperation } from '@univerjs/sheets';
-import { ITelemetryService } from '@univerjs/telemetry';
+import { ITelemetryService } from '@univerjs/telemetry';
import { Subject, withLatestFrom } from 'rxjs';
import {
SHEET_COMPONENT_HEADER_LAYER_INDEX,
@@ -51,13 +51,13 @@ const FRAME_STACK_THRESHOLD = 60;
export class SheetRenderController extends RxDisposable implements IRenderModule {
constructor(
private readonly _context: IRenderContext<Workbook>,
- @IContextService private readonly _contextService: IContextService,
@Inject(SheetSkeletonManagerService) private readonly _sheetSkeletonManagerService: SheetSkeletonManagerService,
@Inject(SheetsRenderService) private readonly _sheetRenderService: SheetsRenderService,
@ICommandService private readonly _commandService: ICommandService,
@Optional(ITelemetryService) private readonly _telemetryService?: ITelemetryService
) {
super();
+
this._addNewRender();
this._initRenderMetricSubscriber();
}
@@ -76,6 +76,8 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
const sheetId = worksheet.getSheetId();
this._sheetSkeletonManagerService.setCurrent({ sheetId });
+
+ // TODO: we should attach the context object to the RenderContext object on scene.canvas.
engine.runRenderLoop(() => scene.render());
}
@@ -95,7 +97,7 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
engine.endFrame$.subscribe(() => {
const validRenderInfo = this._renderFrameTimeMetric &&
- Object.keys(this._renderFrameTimeMetric).filter((key) => key.startsWith(SHEET_EXTENSION_PREFIX)).length > 0;
+ Object.keys(this._renderFrameTimeMetric).filter((key) => key.startsWith(SHEET_EXTENSION_PREFIX)).length > 0;
if (validRenderInfo) {
this._afterRenderMetric$.next({
@@ -110,8 +112,7 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
if (!this._renderFrameTimeMetric[key]) {
this._renderFrameTimeMetric[key] = [];
}
- value = Math.round(value * 100) / 100;
- this._renderFrameTimeMetric[key].push(value);
+ this._renderFrameTimeMetric[key].push(Math.round(value * 100) / 100);
});
engine.renderFrameTags$.subscribe(([key, value]: [string, any]) => {
@@ -119,7 +120,7 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
});
const frameInfoList: IExtendFrameInfo[] = [];
- this._afterRenderMetric$.pipe(withLatestFrom(engine.endFrame$)).subscribe(([sceneRenderDetail, basicFrameTimeInfo]: [IAfterRender$Info, IBasicFrameInfo ]) => {
+ this._afterRenderMetric$.pipe(withLatestFrom(engine.endFrame$)).subscribe(([sceneRenderDetail, basicFrameTimeInfo]: [IAfterRender$Info, IBasicFrameInfo]) => {
frameInfoList.push({
...{
FPS: basicFrameTimeInfo.FPS,
@@ -205,12 +206,7 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
const { scene, components } = this._context;
const worksheet = workbook.getActiveSheet();
- if (!worksheet) {
- throw new Error('No active sheet found');
- }
-
const spreadsheet = new Spreadsheet(SHEET_VIEW_KEY.MAIN);
-
this._addViewport(worksheet);
const spreadsheetRowHeader = new SpreadsheetRowHeader(SHEET_VIEW_KEY.ROW);
@@ -239,7 +235,6 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
scene.enableLayerCache(SHEET_COMPONENT_MAIN_LAYER_INDEX, SHEET_COMPONENT_HEADER_LAYER_INDEX);
}
- // eslint-disable-next-line max-lines-per-function
private _initViewports(scene: Scene, rowHeader: { width: number }, columnHeader: { height: number }) {
const bufferEdgeX = 100;
const bufferEdgeY = 100;
@@ -261,7 +256,6 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
bufferEdgeX: 0,
bufferEdgeY: 0,
});
-
const viewMainLeft = new Viewport(SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT, scene, {
isWheelPreventDefaultX: true,
active: false,
@@ -269,7 +263,6 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
bufferEdgeX: 0,
bufferEdgeY,
});
-
const viewMainTop = new Viewport(SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP, scene, {
isWheelPreventDefaultX: true,
active: false,
@@ -277,12 +270,10 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
bufferEdgeX,
bufferEdgeY: 0,
});
-
const viewRowTop = new Viewport(SHEET_VIEWPORT_KEY.VIEW_ROW_TOP, scene, {
active: false,
isWheelPreventDefaultX: true,
});
-
const viewRowBottom = new Viewport(SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM, scene, {
left: 0,
top: columnHeader.height,
@@ -290,12 +281,10 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
width: rowHeader.width,
isWheelPreventDefaultX: true,
});
-
const viewColumnLeft = new Viewport(SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT, scene, {
active: false,
isWheelPreventDefaultX: true,
});
-
const viewColumnRight = new Viewport(SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT, scene, {
left: rowHeader.width,
top: 0,
@@ -303,7 +292,6 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
right: 0,
isWheelPreventDefaultX: true,
});
-
const viewLeftTop = new Viewport(SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP, scene, {
left: 0,
top: 0,
@@ -339,17 +327,12 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
private _addViewport(worksheet: Worksheet) {
const scene = this._context.scene;
- if (scene == null) {
- return;
- }
const { rowHeader, columnHeader } = worksheet.getConfig();
const { viewMain } = this._initViewports(scene, rowHeader, columnHeader);
- // this._initMouseWheel(scene, viewMain);
const _scrollBar = new ScrollBar(viewMain);
scene.attachControl();
-
return viewMain;
}
@@ -380,8 +363,8 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
}
private _initCommandListener(): void {
- this.disposeWithMe(this._commandService.onCommandExecuted((command: ICommandInfo, options?: IExecutionOptions) => {
- const { unit: workbook, unitId: workbookId } = this._context;
+ this.disposeWithMe(this._commandService.onCommandExecuted((command: ICommandInfo) => {
+ const { unit: workbook } = this._context;
const { id: commandId } = command;
if (COMMAND_LISTENER_SKELETON_CHANGE.includes(commandId) || this._sheetRenderService.checkMutationShouldTriggerRerender(commandId)) {
@@ -418,12 +401,12 @@ export class SheetRenderController extends RxDisposable implements IRenderModule
// All mutations must be executed. Using reCalculate alone will not trigger a refresh.
if (command.type === CommandType.MUTATION) {
- this._markUnitDirty(workbookId, command);
+ this._markUnitDirty(command);
}
}));
}
- private _markUnitDirty(unitId: string, command: ICommandInfo) {
+ private _markUnitDirty(command: ICommandInfo) {
const { mainComponent: spreadsheet, scene } = this._context;
if (command.id === SetFormulaCalculationNotificationMutation.id) {
diff --git a/packages/sheets-ui/src/controllers/sheet-ui.controller.ts b/packages/sheets-ui/src/controllers/sheet-ui.controller.ts
index 1fbe8d84ff..a05da2f8f3 100644
--- a/packages/sheets-ui/src/controllers/sheet-ui.controller.ts
+++ b/packages/sheets-ui/src/controllers/sheet-ui.controller.ts
@@ -17,8 +17,9 @@
import type { IUniverSheetsUIConfig } from './config.schema';
import { connectInjector, Disposable, ICommandService, IConfigService, Inject, Injector, UniverInstanceType } from '@univerjs/core';
import { DocSelectionRenderService } from '@univerjs/docs-ui';
-
import { IRenderManagerService } from '@univerjs/engine-render';
+
+import { HideGridlines } from '@univerjs/icons';
import {
SetBoldCommand,
SetFontFamilyCommand,
@@ -93,8 +94,8 @@ import { SheetPermissionOpenPanelOperation } from '../commands/operations/sheet-
import { SidebarDefinedNameOperation } from '../commands/operations/sidebar-defined-name.operation';
import { BorderPanel } from '../components/border-panel/BorderPanel';
import { BORDER_PANEL_COMPONENT } from '../components/border-panel/interface';
-import { COLOR_PICKER_COMPONENT, ColorPicker } from '../components/color-picker';
+import { COLOR_PICKER_COMPONENT, ColorPicker } from '../components/color-picker';
import {
FONT_FAMILY_COMPONENT,
FONT_FAMILY_ITEM_COMPONENT,
@@ -176,7 +177,7 @@ export class SheetUIController extends Disposable {
}
private _init(): void {
- this._initCustomComponents();
+ this._initComponents();
this._initCommands();
this._initMenus();
this._initShortcuts();
@@ -184,8 +185,10 @@ export class SheetUIController extends Disposable {
this._initFocusHandler();
}
- private _initCustomComponents(): void {
+ private _initComponents(): void {
const componentManager = this._componentManager;
+
+ // init custom components
this.disposeWithMe(componentManager.register(MENU_ITEM_INPUT_COMPONENT, MenuItemInput));
this.disposeWithMe(componentManager.register(BORDER_PANEL_COMPONENT, BorderPanel));
this.disposeWithMe(componentManager.register(COLOR_PICKER_COMPONENT, ColorPicker));
@@ -193,6 +196,9 @@ export class SheetUIController extends Disposable {
this.disposeWithMe(componentManager.register(FONT_FAMILY_ITEM_COMPONENT, FontFamilyItem));
this.disposeWithMe(componentManager.register(FONT_SIZE_COMPONENT, FontSize));
this.disposeWithMe(componentManager.register(DEFINED_NAME_CONTAINER, DefinedNameContainer));
+
+ // init icons
+ this.disposeWithMe(componentManager.register('HideGridlines', HideGridlines));
}
// eslint-disable-next-line max-lines-per-function
diff --git a/packages/sheets-ui/src/index.ts b/packages/sheets-ui/src/index.ts
index 4417fddd7b..29f2e411c8 100644
--- a/packages/sheets-ui/src/index.ts
+++ b/packages/sheets-ui/src/index.ts
@@ -66,7 +66,7 @@ export { BaseSelectionRenderService, ISheetSelectionRenderService } from './serv
export { SelectionControl as SelectionShape } from './services/selection/selection-control';
export type { ISheetSkeletonManagerParam } from './services/sheet-skeleton-manager.service';
export { attachRangeWithCoord, SheetSkeletonManagerService } from './services/sheet-skeleton-manager.service';
-export { UniverSheetsUIPlugin } from './sheets-ui-plugin';
+export { UniverSheetsUIPlugin } from './plugin';
export { SheetRenderController } from './controllers/render-controllers/sheet.render-controller';
export { HoverManagerService } from './services/hover-manager.service';
export { DragManagerService } from './services/drag-manager.service';
@@ -94,7 +94,7 @@ export type { IRangeProtectionRenderCellData } from './views/permission/extensio
export { RenderSheetContent, RenderSheetFooter, RenderSheetHeader } from './views/sheet-container/SheetContainer';
export { SheetBar } from './views/sheet-bar/SheetBar';
export { SheetPrintInterceptorService } from './services/print-interceptor.service';
-export { UniverSheetsMobileUIPlugin } from './mobile-sheets-ui-plugin';
+export { UniverSheetsMobileUIPlugin } from './mobile-plugin';
export { MobileSheetBar } from './views/mobile/sheet-bar/MobileSheetBar';
export { SheetPermissionInitController } from './controllers/permission/sheet-permission-init.controller';
diff --git a/packages/sheets-ui/src/locale/en-US.ts b/packages/sheets-ui/src/locale/en-US.ts
index 9b2d69e0c6..287ecd7518 100644
--- a/packages/sheets-ui/src/locale/en-US.ts
+++ b/packages/sheets-ui/src/locale/en-US.ts
@@ -110,6 +110,9 @@ const locale: typeof zhCN = {
right: 'Right frame line',
},
more: 'More',
+ hideGridlines: 'Hide Gridlines',
+ showGridlines: 'Show Gridlines',
+ toggleGridlines: 'Toggle Gridlines',
},
defaultFmt: {
Automatic: {
diff --git a/packages/sheets-ui/src/locale/fa-IR.ts b/packages/sheets-ui/src/locale/fa-IR.ts
index 35dfd1db09..f7f9f46197 100644
--- a/packages/sheets-ui/src/locale/fa-IR.ts
+++ b/packages/sheets-ui/src/locale/fa-IR.ts
@@ -110,6 +110,9 @@ const locale: typeof zhCN = {
right: 'خط راست قاب',
},
more: 'بیشتر',
+ hideGridlines: 'پنهان کردن خطوط شبکه',
+ showGridlines: 'نمایش خطوط شبکه',
+ toggleGridlines: 'تغییر وضعیت خطوط شبکه',
},
defaultFmt: {
Automatic: {
diff --git a/packages/sheets-ui/src/locale/ru-RU.ts b/packages/sheets-ui/src/locale/ru-RU.ts
index d3b3013174..ab04d7f540 100644
--- a/packages/sheets-ui/src/locale/ru-RU.ts
+++ b/packages/sheets-ui/src/locale/ru-RU.ts
@@ -110,6 +110,9 @@ const locale: typeof zhCN = {
right: 'Правая рамка',
},
more: 'Больше',
+ hideGridlines: 'Скрыть сетку',
+ showGridlines: 'Показать сетку',
+ toggleGridlines: 'Переключить сетку',
},
defaultFmt: {
Automatic: {
diff --git a/packages/sheets-ui/src/locale/vi-VN.ts b/packages/sheets-ui/src/locale/vi-VN.ts
index 2675d68410..e9f901cf13 100644
--- a/packages/sheets-ui/src/locale/vi-VN.ts
+++ b/packages/sheets-ui/src/locale/vi-VN.ts
@@ -110,6 +110,9 @@ const locale: typeof zhCN = {
right: 'Viền phải',
},
more: 'Thêm',
+ hideGridlines: 'Ẩn đường lưới',
+ showGridlines: 'Hiện đường lưới',
+ toggleGridlines: 'Chuyển đổi đường lưới',
},
defaultFmt: {
Automatic: {
diff --git a/packages/sheets-ui/src/locale/zh-CN.ts b/packages/sheets-ui/src/locale/zh-CN.ts
index 6d71f6a26e..7a7eb4164b 100644
--- a/packages/sheets-ui/src/locale/zh-CN.ts
+++ b/packages/sheets-ui/src/locale/zh-CN.ts
@@ -109,6 +109,9 @@ const locale = {
right: '右框线',
},
more: '更多',
+ hideGridlines: '隐藏网格线',
+ showGridlines: '展示网格线',
+ toggleGridlines: '切换网格线',
},
defaultFmt: {
Automatic: {
diff --git a/packages/sheets-ui/src/locale/zh-TW.ts b/packages/sheets-ui/src/locale/zh-TW.ts
index 7a674a6a9b..bc8cad25d5 100644
--- a/packages/sheets-ui/src/locale/zh-TW.ts
+++ b/packages/sheets-ui/src/locale/zh-TW.ts
@@ -111,6 +111,9 @@ const locale: typeof zhCN = {
right: '右框線',
},
more: '更多',
+ hideGridlines: '隱藏網格線',
+ showGridlines: '顯示網格線',
+ toggleGridlines: '切換網格線',
},
defaultFmt: {
Automatic: {
diff --git a/packages/sheets-ui/src/mobile-sheets-ui-plugin.ts b/packages/sheets-ui/src/mobile-plugin.ts
similarity index 100%
rename from packages/sheets-ui/src/mobile-sheets-ui-plugin.ts
rename to packages/sheets-ui/src/mobile-plugin.ts
diff --git a/packages/sheets-ui/src/sheets-ui-plugin.ts b/packages/sheets-ui/src/plugin.ts
similarity index 100%
rename from packages/sheets-ui/src/sheets-ui-plugin.ts
rename to packages/sheets-ui/src/plugin.ts
diff --git a/packages/sheets-ui/src/services/sheets-render.service.ts b/packages/sheets-ui/src/services/sheets-render.service.ts
index 85c6eb35d0..bb363a5dee 100644
--- a/packages/sheets-ui/src/services/sheets-render.service.ts
+++ b/packages/sheets-ui/src/services/sheets-render.service.ts
@@ -26,8 +26,9 @@ import { IRenderManagerService, RENDER_RAW_FORMULA_KEY, Spreadsheet } from '@uni
import { distinctUntilChanged, takeUntil } from 'rxjs';
const SHEET_MAIN_CANVAS_ID = 'univer-sheet-main-canvas';
+
/**
- * This controller is responsible for managing units of a specific kind to be rendered on the canvas.
+ * This controller is responsible for managing units of a specific kind (UnierSheet) to be rendered on the canvas.
*/
export class SheetsRenderService extends RxDisposable {
private _skeletonChangeMutations = new Set<string>();
@@ -58,6 +59,9 @@ export class SheetsRenderService extends RxDisposable {
return toDisposable(() => this._skeletonChangeMutations.delete(mutationId));
}
+ /**
+ * Examine if a mutation would make the skeleton to change.
+ */
checkMutationShouldTriggerRerender(id: string): boolean {
return this._skeletonChangeMutations.has(id);
}
@@ -70,10 +74,7 @@ export class SheetsRenderService extends RxDisposable {
private _initWorkbookListener(): void {
this._instanceSrv.getTypeOfUnitAdded$<Workbook>(UniverInstanceType.UNIVER_SHEET)
.pipe(takeUntil(this.dispose$))
- .subscribe((workbook) => {
- // TODO when does this function get called?
- this._createRenderer(workbook);
- });
+ .subscribe((workbook) => this._createRenderer(workbook));
this._instanceSrv.getAllUnitsForType<Workbook>(UniverInstanceType.UNIVER_SHEET)
.forEach((workbook) => this._createRenderer(workbook));
@@ -103,14 +104,14 @@ export class SheetsRenderService extends RxDisposable {
private _initContextListener(): void {
// If we toggle the raw formula, we need to refresh all spreadsheets.
- this._contextService.subscribeContextValue$(RENDER_RAW_FORMULA_KEY)
- .pipe(distinctUntilChanged(), takeUntil(this.dispose$))
+ this.disposeWithMe(this._contextService.subscribeContextValue$(RENDER_RAW_FORMULA_KEY)
+ .pipe(distinctUntilChanged())
.subscribe(() => {
this._renderManagerService.getRenderAll().forEach((renderer) => {
if (renderer.mainComponent instanceof Spreadsheet) {
(renderer.mainComponent as Spreadsheet).makeForceDirty(true);
}
});
- });
+ }));
}
}
diff --git a/packages/sheets-ui/src/views/sheet-container/index.module.less b/packages/sheets-ui/src/views/sheet-container/index.module.less
index e3516d5442..e3d48fd3b6 100644
--- a/packages/sheets-ui/src/views/sheet-container/index.module.less
+++ b/packages/sheets-ui/src/views/sheet-container/index.module.less
@@ -14,4 +14,8 @@
padding: 0 var(--padding-xl);
background-color: rgb(var(--bg-color-secondary));
+
+ > span:not(:last-of-type) {
+ margin-right: 4px;
+ }
}
diff --git a/packages/sheets-zen-editor/package.json b/packages/sheets-zen-editor/package.json
index 656328de5a..e09260386e 100644
--- a/packages/sheets-zen-editor/package.json
+++ b/packages/sheets-zen-editor/package.json
@@ -70,7 +70,7 @@
"@univerjs/docs": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
diff --git a/packages/sheets/src/basics/const/command-listener-const.ts b/packages/sheets/src/basics/const/command-listener-const.ts
index 1a4a030a23..8aee8ba307 100644
--- a/packages/sheets/src/basics/const/command-listener-const.ts
+++ b/packages/sheets/src/basics/const/command-listener-const.ts
@@ -32,6 +32,7 @@ import {
SetWorksheetRowHeightMutation,
SetWorksheetRowIsAutoHeightMutation,
} from '../../commands/mutations/set-worksheet-row-height.mutation';
+import { ToggleGridlinesMutation } from '../../commands/mutations/toggle-gridlines.mutation';
import { SetWorksheetActiveOperation } from '../../commands/operations/set-worksheet-active.operation';
/**
@@ -53,6 +54,7 @@ export const COMMAND_LISTENER_SKELETON_CHANGE = [
InsertRowMutation.id,
RemoveColMutation.id,
RemoveRowMutation.id,
+ ToggleGridlinesMutation.id,
];
export const COMMAND_LISTENER_VALUE_CHANGE = [
diff --git a/packages/sheets/src/commands/commands/set-hide-gridlines.command.ts b/packages/sheets/src/commands/commands/toggle-gridlines.command.ts
similarity index 51%
rename from packages/sheets/src/commands/commands/set-hide-gridlines.command.ts
rename to packages/sheets/src/commands/commands/toggle-gridlines.command.ts
index 3fb6c2f9d4..479264d7bb 100644
--- a/packages/sheets/src/commands/commands/set-hide-gridlines.command.ts
+++ b/packages/sheets/src/commands/commands/toggle-gridlines.command.ts
@@ -15,26 +15,21 @@
*/
import type { IAccessor, ICommand } from '@univerjs/core';
+import type { IToggleGridlinesMutationParams } from '../mutations/toggle-gridlines.mutation';
import { BooleanNumber, CommandType, ICommandService, IUndoRedoService, IUniverInstanceService } from '@univerjs/core';
-
-import type { ISetHideGridlinesMutationParams } from '../mutations/set-hide-gridlines.mutatiom';
-import {
- SetHideGridlinesMutation,
- SetHideGridlinesUndoMutationFactory,
-} from '../mutations/set-hide-gridlines.mutatiom';
+import { ToggleGridlinesMutation } from '../mutations/toggle-gridlines.mutation';
import { getSheetCommandTarget } from './utils/target-util';
-export interface ISetHideGridlinesCommandParams {
- hideGridlines?: BooleanNumber;
+export interface IToggleGridlinesCommandParams {
+ showGridlines?: BooleanNumber;
unitId?: string;
subUnitId?: string;
}
-export const SetHideGridlinesCommand: ICommand = {
+export const ToggleGridlinesCommand: ICommand = {
type: CommandType.COMMAND,
- id: 'sheet.command.set-hide-gridlines',
-
- handler: async (accessor: IAccessor, params?: ISetHideGridlinesCommandParams) => {
+ id: 'sheet.command.toggle-gridlines',
+ handler: async (accessor: IAccessor, params?: IToggleGridlinesCommandParams) => {
const commandService = accessor.get(ICommandService);
const undoRedoService = accessor.get(IUndoRedoService);
const univerInstanceService = accessor.get(IUniverInstanceService);
@@ -42,33 +37,31 @@ export const SetHideGridlinesCommand: ICommand = {
const target = getSheetCommandTarget(univerInstanceService);
if (!target) return false;
- const { unitId, subUnitId } = target;
- let hideGridlines = BooleanNumber.FALSE;
-
- if (params) {
- hideGridlines = params.hideGridlines ?? BooleanNumber.FALSE;
- }
-
- const workbook = univerInstanceService.getUniverSheetInstance(unitId);
- if (!workbook) return false;
- const worksheet = workbook.getSheetBySheetId(subUnitId);
- if (!worksheet) return false;
+ const { worksheet } = target;
+ const currentlyShow = worksheet.getConfig().showGridlines;
+ if (currentlyShow === params?.showGridlines) return false;
- const setHideGridlinesMutationParams: ISetHideGridlinesMutationParams = {
- hideGridlines,
+ const { unitId, subUnitId } = target;
+ const doParams: IToggleGridlinesMutationParams = {
+ showGridlines: currentlyShow === BooleanNumber.TRUE ? BooleanNumber.FALSE : BooleanNumber.TRUE,
unitId,
subUnitId,
};
- const undoMutationParams = SetHideGridlinesUndoMutationFactory(accessor, setHideGridlinesMutationParams);
- const result = commandService.syncExecuteCommand(SetHideGridlinesMutation.id, setHideGridlinesMutationParams);
+ const undoMutationParams: IToggleGridlinesMutationParams = {
+ showGridlines: currentlyShow,
+ unitId,
+ subUnitId,
+ };
+ const result = commandService.syncExecuteCommand(ToggleGridlinesMutation.id, doParams);
if (result) {
undoRedoService.pushUndoRedo({
unitID: unitId,
- undoMutations: [{ id: SetHideGridlinesMutation.id, params: undoMutationParams }],
- redoMutations: [{ id: SetHideGridlinesMutation.id, params: setHideGridlinesMutationParams }],
+ undoMutations: [{ id: ToggleGridlinesMutation.id, params: undoMutationParams }],
+ redoMutations: [{ id: ToggleGridlinesMutation.id, params: doParams }],
});
+
return true;
}
diff --git a/packages/sheets/src/commands/mutations/set-hide-gridlines.mutatiom.ts b/packages/sheets/src/commands/mutations/set-hide-gridlines.mutatiom.ts
deleted file mode 100644
index 5f2d2e66cc..0000000000
--- a/packages/sheets/src/commands/mutations/set-hide-gridlines.mutatiom.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright 2023-present DreamNum Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import type { BooleanNumber, IAccessor, IMutation } from '@univerjs/core';
-import { CommandType, IUniverInstanceService, Tools } from '@univerjs/core';
-
-export interface ISetHideGridlinesMutationParams {
- hideGridlines: BooleanNumber;
- unitId: string;
- subUnitId: string;
-}
-
-export const SetHideGridlinesUndoMutationFactory = (
- accessor: IAccessor,
- params: ISetHideGridlinesMutationParams
-): ISetHideGridlinesMutationParams => {
- const workbook = accessor.get(IUniverInstanceService).getUniverSheetInstance(params.unitId);
- const worksheet = workbook!.getSheetBySheetId(params.subUnitId);
- const config = worksheet!.getConfig();
-
- const oldStatus = config.showGridlines;
-
- return {
- ...Tools.deepClone(params),
- hideGridlines: oldStatus,
- };
-};
-
-export const SetHideGridlinesMutation: IMutation<ISetHideGridlinesMutationParams> = {
- id: 'sheet.mutation.set-hide-gridlines',
- type: CommandType.MUTATION,
- handler: (accessor, params) => {
- const workbook = accessor.get(IUniverInstanceService).getUniverSheetInstance(params.unitId);
- if (!workbook) return false;
- const worksheet = workbook.getSheetBySheetId(params.subUnitId);
- if (!worksheet) return false;
- const config = worksheet.getConfig();
-
- config.showGridlines = params.hideGridlines;
-
- return true;
- },
-};
diff --git a/packages/sheets/src/commands/mutations/toggle-gridlines.mutation.ts b/packages/sheets/src/commands/mutations/toggle-gridlines.mutation.ts
new file mode 100644
index 0000000000..c108e10553
--- /dev/null
+++ b/packages/sheets/src/commands/mutations/toggle-gridlines.mutation.ts
@@ -0,0 +1,39 @@
+/**
+ * Copyright 2023-present DreamNum Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type { BooleanNumber, IMutation } from '@univerjs/core';
+import { CommandType, IUniverInstanceService } from '@univerjs/core';
+import { getSheetCommandTarget } from '../commands/utils/target-util';
+
+export interface IToggleGridlinesMutationParams {
+ showGridlines: BooleanNumber;
+ unitId: string;
+ subUnitId: string;
+}
+
+export const ToggleGridlinesMutation: IMutation<IToggleGridlinesMutationParams> = {
+ id: 'sheet.mutation.set-hide-gridlines',
+ type: CommandType.MUTATION,
+ handler: (accessor, params) => {
+ const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
+ if (!target) return false;
+
+ const { worksheet } = target;
+ const config = worksheet.getConfig();
+ config.showGridlines = params.showGridlines;
+ return true;
+ },
+};
diff --git a/packages/sheets/src/controllers/basic-worksheet.controller.ts b/packages/sheets/src/controllers/basic-worksheet.controller.ts
index 62e2a8f9d3..f154247cb6 100644
--- a/packages/sheets/src/controllers/basic-worksheet.controller.ts
+++ b/packages/sheets/src/controllers/basic-worksheet.controller.ts
@@ -93,6 +93,7 @@ import {
} from '../commands/commands/set-worksheet-row-height.command';
import { SetWorksheetShowCommand } from '../commands/commands/set-worksheet-show.command';
import { ToggleCellCheckboxCommand } from '../commands/commands/toggle-checkbox.command';
+import { ToggleGridlinesCommand } from '../commands/commands/toggle-gridlines.command';
import { AddRangeProtectionMutation } from '../commands/mutations/add-range-protection.mutation';
import { AddWorksheetMergeMutation } from '../commands/mutations/add-worksheet-merge.mutation';
import { AddWorksheetProtectionMutation } from '../commands/mutations/add-worksheet-protection.mutation';
@@ -128,6 +129,7 @@ import {
SetWorksheetRowHeightMutation,
SetWorksheetRowIsAutoHeightMutation,
} from '../commands/mutations/set-worksheet-row-height.mutation';
+import { ToggleGridlinesMutation } from '../commands/mutations/toggle-gridlines.mutation';
import { ScrollToCellOperation } from '../commands/operations/scroll-to-cell.operation';
import { SetSelectionsOperation } from '../commands/operations/selection.operation';
import { SetWorksheetActiveOperation } from '../commands/operations/set-worksheet-active.operation';
@@ -259,6 +261,9 @@ export class BasicWorksheetController extends Disposable implements IDisposable
SetDefinedNameCommand,
SetWorksheetShowCommand,
+ ToggleGridlinesCommand,
+ ToggleGridlinesMutation,
+
// permissions range protection
SetWorksheetPermissionPointsCommand,
AddWorksheetProtectionMutation,
diff --git a/packages/sheets/src/index.ts b/packages/sheets/src/index.ts
index c8703c500b..b5090bbb2d 100644
--- a/packages/sheets/src/index.ts
+++ b/packages/sheets/src/index.ts
@@ -241,7 +241,7 @@ export {
export { SetDefinedNameCommand } from './commands/commands/set-defined-name.command';
export { SetFrozenCancelCommand } from './commands/commands/set-frozen-cancel.command';
export { SetFrozenCommand } from './commands/commands/set-frozen.command';
-export { SetHideGridlinesCommand } from './commands/commands/set-hide-gridlines.command';
+export { type IToggleGridlinesCommandParams, ToggleGridlinesCommand } from './commands/commands/toggle-gridlines.command';
export { type ISetRangeProtectionCommandParams, SetRangeProtectionCommand } from './commands/commands/set-range-protection.command';
export { type ISetRangeValuesCommandParams, SetRangeValuesCommand } from './commands/commands/set-range-values.command';
export {
@@ -352,7 +352,7 @@ export {
SetFrozenMutation,
SetFrozenMutationFactory,
} from './commands/mutations/set-frozen.mutation';
-export { SetHideGridlinesMutation } from './commands/mutations/set-hide-gridlines.mutatiom';
+export { type IToggleGridlinesMutationParams, ToggleGridlinesMutation } from './commands/mutations/toggle-gridlines.mutation';
export { FactorySetRangeProtectionMutation, type ISetRangeProtectionMutationParams, SetRangeProtectionMutation } from './commands/mutations/set-range-protection.mutation';
export {
type ISetRangeValuesMutationParams,
diff --git a/packages/sheets/src/services/border-style-manager.service.ts b/packages/sheets/src/services/border-style-manager.service.ts
index 585550d819..2c388d6e74 100644
--- a/packages/sheets/src/services/border-style-manager.service.ts
+++ b/packages/sheets/src/services/border-style-manager.service.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
+import type { IDisposable } from '@univerjs/core';
import { BorderStyleTypes, BorderType } from '@univerjs/core';
import { BehaviorSubject } from 'rxjs';
-import type { IDisposable } from '@univerjs/core';
export interface IBorderInfo {
type: BorderType;
@@ -37,7 +37,6 @@ export class BorderStyleManagerService implements IDisposable {
};
private readonly _borderInfo$ = new BehaviorSubject<IBorderInfo>(this._borderInfo);
-
readonly borderInfo$ = this._borderInfo$.asObservable();
dispose(): void {
@@ -47,17 +46,17 @@ export class BorderStyleManagerService implements IDisposable {
setType(type: BorderType): void {
this._borderInfo.type = type;
this.setActiveBorderType(true);
- this.refresh();
+ this._refresh();
}
setColor(color: string): void {
this._borderInfo.color = color;
- this.refresh();
+ this._refresh();
}
setStyle(style: BorderStyleTypes): void {
this._borderInfo.style = style;
- this.refresh();
+ this._refresh();
}
setActiveBorderType(status: boolean) {
@@ -68,7 +67,7 @@ export class BorderStyleManagerService implements IDisposable {
return this._borderInfo;
}
- private refresh(): void {
+ private _refresh(): void {
this._borderInfo$.next(this._borderInfo);
}
}
diff --git a/packages/slides-ui/package.json b/packages/slides-ui/package.json
index 9ada3a8d81..efaa935d12 100644
--- a/packages/slides-ui/package.json
+++ b/packages/slides-ui/package.json
@@ -71,7 +71,7 @@
"@univerjs/docs-ui": "workspace:*",
"@univerjs/drawing": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/slides": "workspace:*",
"@univerjs/ui": "workspace:*",
"clsx": "^2.1.1"
diff --git a/packages/thread-comment-ui/package.json b/packages/thread-comment-ui/package.json
index 9f8308dcaf..e7a540691d 100644
--- a/packages/thread-comment-ui/package.json
+++ b/packages/thread-comment-ui/package.json
@@ -68,7 +68,7 @@
"@univerjs/docs": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"@univerjs/protocol": "0.1.39-alpha.30",
"@univerjs/thread-comment": "workspace:*",
"@univerjs/ui": "workspace:*",
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 2f4158259d..6e317e13ea 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -70,7 +70,7 @@
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
- "@univerjs/icons": "^0.1.79",
+ "@univerjs/icons": "^0.1.84",
"clsx": "^2.1.1",
"localforage": "^1.10.0",
"rc-notification": "^5.6.2",
diff --git a/packages/ui/src/services/menu/menu.ts b/packages/ui/src/services/menu/menu.ts
index 0044ac28cc..3e774d3b38 100644
--- a/packages/ui/src/services/menu/menu.ts
+++ b/packages/ui/src/services/menu/menu.ts
@@ -97,12 +97,12 @@ interface IMenuItemBase<V> {
* Custom label component id.
*/
label?:
- | string
- | {
- name: string;
- hoverable?: boolean;
- props?: Record<string, any>;
- }; // custom component, send to CustomLabel label property
+ | string
+ | {
+ name: string;
+ hoverable?: boolean;
+ props?: Record<string, any>;
+ }; // custom component, send to CustomLabel label property
hidden$?: Observable<boolean>;
disabled$?: Observable<boolean>;
@@ -121,12 +121,12 @@ export interface IValueOption<T = undefined> {
value?: string | number;
value$?: Observable<T>;
label?:
- | string
- | {
- name: string;
- hoverable?: boolean;
- props?: Record<string, string | number | Array<{ [x: string | number]: string }>>;
- }; // custom component, send to CustomLabel label property
+ | string
+ | {
+ name: string;
+ hoverable?: boolean;
+ props?: Record<string, string | number | Array<{ [x: string | number]: string }>>;
+ }; // custom component, send to CustomLabel label property
icon?: string;
tooltip?: string;
style?: object;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 00e7661360..1e141acca5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -250,8 +250,8 @@ importers:
specifier: workspace:*
version: link:../packages/find-replace
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/mockdata':
specifier: workspace:*
version: link:../mockdata
@@ -495,8 +495,8 @@ importers:
specifier: workspace:*
version: link:../../packages/design
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../../packages/sheets
@@ -634,8 +634,8 @@ importers:
specifier: workspace:*
version: link:../../packages/engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/ui':
specifier: workspace:*
version: link:../../packages/ui
@@ -671,8 +671,8 @@ importers:
specifier: workspace:*
version: link:../../packages/docs
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
clsx:
specifier: ^2.1.1
version: 2.1.1
@@ -711,8 +711,8 @@ importers:
specifier: workspace:*
version: link:../../packages/engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/rpc':
specifier: workspace:*
version: link:../../packages/rpc
@@ -772,8 +772,8 @@ importers:
specifier: workspace:*
version: link:../../packages/docs-ui
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../../packages/sheets
@@ -824,8 +824,8 @@ importers:
specifier: workspace:*
version: link:../../packages/engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/slides':
specifier: workspace:*
version: link:../../packages/slides
@@ -891,8 +891,8 @@ importers:
specifier: workspace:*
version: link:../../packages/engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../../packages/sheets
@@ -1035,8 +1035,8 @@ importers:
specifier: ^4.4.0
version: 4.4.0
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
clsx:
specifier: ^2.1.1
version: 2.1.1
@@ -1200,8 +1200,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1237,8 +1237,8 @@ importers:
specifier: workspace:*
version: link:../core
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
devDependencies:
'@univerjs-infra/shared':
specifier: workspace:*
@@ -1277,8 +1277,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1375,8 +1375,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/thread-comment':
specifier: workspace:*
version: link:../thread-comment
@@ -1427,8 +1427,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1467,8 +1467,8 @@ importers:
specifier: workspace:*
version: link:../core
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
ot-json1:
specifier: ^1.0.2
version: 1.0.2
@@ -1507,8 +1507,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1742,8 +1742,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/ui':
specifier: workspace:*
version: link:../ui
@@ -1906,8 +1906,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/protocol':
specifier: 0.1.39-alpha.30
version: 0.1.39-alpha.30(@grpc/[email protected])([email protected])
@@ -1973,8 +1973,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2025,8 +2025,8 @@ importers:
specifier: workspace:*
version: link:../engine-formula
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/protocol':
specifier: 0.1.39-alpha.30
version: 0.1.39-alpha.30(@grpc/[email protected])([email protected])
@@ -2086,8 +2086,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/protocol':
specifier: 0.1.39-alpha.30
version: 0.1.39-alpha.30(@grpc/[email protected])([email protected])
@@ -2178,8 +2178,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2255,8 +2255,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/rpc':
specifier: workspace:*
version: link:../rpc
@@ -2405,8 +2405,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2506,8 +2506,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2564,8 +2564,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2644,8 +2644,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2702,8 +2702,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2806,8 +2806,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/protocol':
specifier: 0.1.39-alpha.30
version: 0.1.39-alpha.30(@grpc/[email protected])([email protected])
@@ -2867,8 +2867,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2950,8 +2950,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/slides':
specifier: workspace:*
version: link:../slides
@@ -3064,8 +3064,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
'@univerjs/protocol':
specifier: 0.1.39-alpha.30
version: 0.1.39-alpha.30(@grpc/[email protected])([email protected])
@@ -3119,8 +3119,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.79
+ specifier: ^0.1.84
clsx:
specifier: ^2.1.1
version: 2.1.1
@@ -5227,8 +5227,8 @@ packages:
'@univerjs/[email protected]':
resolution: {integrity: sha512-9T9V6wtDkLJIJVCCKiOTgCyU8d9oQVjlK8saDxzyKEK8bWFVgSWIr7swIww0gHjVp0tJXiBRQNhcXMqJvCt2ZQ==}
- '@univerjs/[email protected]':
- resolution: {integrity: sha512-4dyyC75EWw7pBnIO9PwXUeshSEKjAdNUF5dXkyHZ2fmkW5+jNxuSLos4lVhsZ2PHMYhf0PWwffT2Ff6qD8M1kw==}
+ '@univerjs/[email protected]':
+ resolution: {integrity: sha512-fB13Qbn54xHHsX6p2QjI7QjvnLVP143h/4eTlI8BFUtoRA0Wp8Vo1R5mcZyU5sOtlD/nUNlyP27s7q2g8T89cw==}
peerDependencies:
react: '*'
react-dom: '*'
@@ -12459,7 +12459,7 @@ snapshots:
'@univerjs/[email protected]': {}
dependencies:
react: 18.3.1
react-dom: 18.3.1([email protected])