Skip to content

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

fix: export menu schemas from package entries (#7225)

白熱e4c75ba7bf89
diff --git a/packages/action-recorder/src/index.ts b/packages/action-recorder/src/index.ts
index fd2292be5e..85715e6a68 100644
--- a/packages/action-recorder/src/index.ts
+++ b/packages/action-recorder/src/index.ts
@@ -17,6 +17,7 @@
import './global.css';
export type { IUniverActionRecorderConfig } from './config/config';
+export { menuSchema as ActionRecorderMenuSchema } from './menu/action-recorder.menu';
export { UniverActionRecorderPlugin } from './plugin';
export { ActionRecorderService } from './services/action-recorder.service';
export { ActionReplayService } from './services/replay.service';
diff --git a/packages/design/src/components/dialog/Dialog.tsx b/packages/design/src/components/dialog/Dialog.tsx
index 5fc58ddfab..ad796745f9 100644
--- a/packages/design/src/components/dialog/Dialog.tsx
+++ b/packages/design/src/components/dialog/Dialog.tsx
@@ -14,12 +14,19 @@
* limitations under the License.
*/
-import type { CSSProperties, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
+import type { CSSProperties, MouseEvent, ReactNode } from 'react';
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
import { clsx } from '../../helper/clsx';
import { Button } from '../button/Button';
import { ConfigContext } from '../config-provider/ConfigProvider';
-import { DialogContent, DialogDescription, DialogFooter, DialogHeader, Dialog as DialogProvider, DialogTitle } from './DialogPrimitive';
+import {
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ Dialog as DialogProvider,
+ DialogTitle,
+} from './DialogPrimitive';
export interface IDialogProps {
children: ReactNode;
@@ -178,7 +185,7 @@ function useDraggable(
return { x: newX, y: newY };
}, []);
- const startDrag = useCallback((e: ReactMouseEvent<HTMLElement> | MouseEvent) => {
+ const startDrag = useCallback((e: MouseEvent<HTMLElement> | MouseEvent) => {
if (!enabled) return;
e.preventDefault();
@@ -191,7 +198,7 @@ function useDraggable(
document.body.style.userSelect = 'none';
}, [enabled, position]);
- const onDrag = useCallback((e: MouseEvent) => {
+ const onDrag = useCallback((e: globalThis.MouseEvent) => {
if (!isDragging) return;
e.preventDefault();
diff --git a/packages/design/src/components/message/Message.tsx b/packages/design/src/components/message/Message.tsx
index 34dd79b8a9..558656d60b 100644
--- a/packages/design/src/components/message/Message.tsx
+++ b/packages/design/src/components/message/Message.tsx
@@ -16,7 +16,7 @@
import type { ComponentProps, ReactNode } from 'react';
import { ErrorIcon, InfoIcon, LoadingMultiIcon, SuccessIcon, WarningIcon } from '@univerjs/icons';
-import { Toaster as Sonner, toast } from 'sonner';
+import { toast, Toaster } from 'sonner';
import { clsx } from '../../helper/clsx';
export enum MessageType {
@@ -35,7 +35,7 @@ export interface IMessageProps {
onClose?: () => void;
}
-export type IMessagerProps = Omit<ComponentProps<typeof Sonner>, 'id' | 'position' | 'visibleToasts' | 'toastOptions'>;
+export type IMessagerProps = Omit<ComponentProps<typeof Toaster>, 'id' | 'position' | 'visibleToasts' | 'toastOptions'>;
const MESSAGE_TOASTER_ID = 'univer-message-toaster';
const DEFAULT_MESSAGE_DURATION = 3000;
@@ -90,7 +90,7 @@ const createMessageId = () => {
};
export const Messager = ({ className, ...props }: IMessagerProps) => (
- <Sonner
+ <Toaster
id={MESSAGE_TOASTER_ID}
position="top-center"
visibleToasts={4}
diff --git a/packages/docs-drawing-ui/src/index.ts b/packages/docs-drawing-ui/src/index.ts
index bfbee8716b..7a58540e74 100644
--- a/packages/docs-drawing-ui/src/index.ts
+++ b/packages/docs-drawing-ui/src/index.ts
@@ -25,12 +25,14 @@ export { MoveDocDrawingsCommand } from './commands/commands/move-drawings.comman
export { RemoveDocDrawingCommand } from './commands/commands/remove-doc-drawing.command';
export { SetDocDrawingArrangeCommand } from './commands/commands/set-drawing-arrange.command';
export { UngroupDocDrawingCommand } from './commands/commands/ungroup-doc-drawing.command';
+export { UpdateDrawingDocTransformCommand } from './commands/commands/update-doc-drawing.command';
export { ClearDocDrawingTransformerOperation } from './commands/operations/clear-drawing-transformer.operation';
export { EditDocDrawingOperation } from './commands/operations/edit-doc-drawing.operation';
export { SidebarDocDrawingOperation } from './commands/operations/open-drawing-panel.operation';
-export { type IUniverDocsDrawingUIConfig } from './config/config';
+export type { IUniverDocsDrawingUIConfig } from './config/config';
export { DocFloatDomController } from './controllers/doc-float-dom.controller';
export { DOCS_IMAGE_MENU_ID } from './menu/image.menu';
+export { menuSchema as DocsDrawingUIMenuSchema } from './menu/schema';
export { DOCS_SHAPE_BELOW_MENU_ID, DOCS_SHAPE_MENU_ID } from './menu/shape.menu';
export { UniverDocsDrawingUIPlugin } from './plugin';
export { DocDrawingFloatingToolbarAdapterService } from './services/doc-drawing-floating-toolbar-adapter.service';
diff --git a/packages/docs-hyper-link-ui/src/index.ts b/packages/docs-hyper-link-ui/src/index.ts
index 9e35a59447..a27b22bf67 100644
--- a/packages/docs-hyper-link-ui/src/index.ts
+++ b/packages/docs-hyper-link-ui/src/index.ts
@@ -17,4 +17,5 @@
import './global.css';
export type { IUniverDocsHyperLinkUIConfig } from './config/config';
+export { menuSchema as DocsHyperLinkUIMenuSchema } from './menu/schema';
export { UniverDocsHyperLinkUIPlugin } from './plugin';
diff --git a/packages/docs-thread-comment-ui/src/index.ts b/packages/docs-thread-comment-ui/src/index.ts
index 15d96f39e3..ca796a33f4 100644
--- a/packages/docs-thread-comment-ui/src/index.ts
+++ b/packages/docs-thread-comment-ui/src/index.ts
@@ -23,4 +23,5 @@ export type { IDeleteDocCommentComment } from './commands/commands/delete-doc-co
export { ShowCommentPanelOperation, StartAddCommentOperation } from './commands/operations/show-comment-panel.operation';
export type { IShowCommentPanelOperationParams } from './commands/operations/show-comment-panel.operation';
export type { IUniverDocsThreadCommentUIConfig } from './config/config';
+export { menuSchema as DocsThreadCommentUIMenuSchema } from './menu/schema';
export { UniverDocsThreadCommentUIPlugin } from './plugin';
diff --git a/packages/docs-thread-comment-ui/src/views/__tests__/DocThreadCommentPanel.spec.tsx b/packages/docs-thread-comment-ui/src/views/__tests__/DocThreadCommentPanel.spec.tsx
index 523adc5820..d53a983004 100644
--- a/packages/docs-thread-comment-ui/src/views/__tests__/DocThreadCommentPanel.spec.tsx
+++ b/packages/docs-thread-comment-ui/src/views/__tests__/DocThreadCommentPanel.spec.tsx
@@ -15,7 +15,7 @@
*/
import type { DocumentDataModel, IDisposable, IDocumentBody, IDocumentData, Injector } from '@univerjs/core';
-import type { IRender, IRenderManagerService } from '@univerjs/engine-render';
+import type { IRender } from '@univerjs/engine-render';
import type { IThreadComment } from '@univerjs/thread-comment';
import type { ISidebarMethodOptions } from '@univerjs/ui';
import type { Root } from 'react-dom/client';
@@ -31,7 +31,7 @@ import {
UserManagerService,
} from '@univerjs/core';
import { DocSelectionManagerService } from '@univerjs/docs';
-import { IRenderManagerService as IRenderManagerServiceToken } from '@univerjs/engine-render';
+import { IRenderManagerService } from '@univerjs/engine-render';
import { IThreadCommentDataSourceService, ThreadCommentDataSourceService, ThreadCommentModel } from '@univerjs/thread-comment';
import { SetActiveCommentOperation, ThreadCommentPanelService } from '@univerjs/thread-comment-ui';
import threadCommentEnUS from '@univerjs/thread-comment-ui/locale/en-US';
@@ -178,7 +178,7 @@ function createPanelTestBed(decorationIds: string[]) {
const get = injector.get.bind(injector) as Injector['get'];
injector.add([DocSelectionManagerService]);
- injector.add([IRenderManagerServiceToken, { useClass: TestRenderManagerService as never }]);
+ injector.add([IRenderManagerService, { useClass: TestRenderManagerService as never }]);
injector.add([IThreadCommentDataSourceService, { useClass: ThreadCommentDataSourceService }]);
injector.add([ThreadCommentModel]);
injector.add([ISidebarService, { useClass: TestSidebarService as never }]);
diff --git a/packages/docs-ui/src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts b/packages/docs-ui/src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
index cab135d213..26bb31f7e8 100644
--- a/packages/docs-ui/src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
+++ b/packages/docs-ui/src/services/clipboard/html-to-udm/paste-plugins/plugin-lark.ts
@@ -16,7 +16,7 @@
import type { IPastePlugin } from './type';
import { BooleanNumber, createParagraphId } from '@univerjs/core';
-import { extractNodeStyle as getInlineStyle } from '../parse-node-style';
+import { extractNodeStyle } from '../parse-node-style';
const LarkPastePlugin: IPastePlugin = {
name: 'univer-doc-paste-plugin-lark',
@@ -28,7 +28,7 @@ const LarkPastePlugin: IPastePlugin = {
{
filter: ['s'],
getStyle(node) {
- const inlineStyle = getInlineStyle(node);
+ const inlineStyle = extractNodeStyle(node);
return {
st: {
diff --git a/packages/docs-ui/src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts b/packages/docs-ui/src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
index a63dbc88db..ee49156648 100644
--- a/packages/docs-ui/src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
+++ b/packages/docs-ui/src/services/clipboard/html-to-udm/paste-plugins/plugin-word.ts
@@ -17,7 +17,7 @@
import type { IParagraph } from '@univerjs/core';
import type { IPastePlugin } from './type';
import { BooleanNumber, createParagraphId } from '@univerjs/core';
-import { extractNodeStyle as getInlineStyle } from '../parse-node-style';
+import { extractNodeStyle } from '../parse-node-style';
import { getParagraphStyle } from '../utils';
const WORD_SPACE_PLACEHOLDER_ENTITY = '&#57344;';
@@ -50,7 +50,7 @@ const WordPastePlugin: IPastePlugin = {
{
filter: ['b'],
getStyle(node) {
- const inlineStyle = getInlineStyle(node);
+ const inlineStyle = extractNodeStyle(node);
return { bl: BooleanNumber.TRUE, ...inlineStyle };
},
diff --git a/packages/docs/src/facade/__tests__/create-test-bed.ts b/packages/docs/src/facade/__tests__/create-test-bed.ts
index 0267da4158..ae81015ec5 100644
--- a/packages/docs/src/facade/__tests__/create-test-bed.ts
+++ b/packages/docs/src/facade/__tests__/create-test-bed.ts
@@ -15,7 +15,6 @@
*/
import type { DocumentDataModel, IDocumentData, Injector } from '@univerjs/core';
-import type { FUniver } from '@univerjs/core/facade';
import {
DisposableCollection,
DocumentBlockRangeType,
@@ -26,7 +25,7 @@ import {
Univer,
UniverInstanceType,
} from '@univerjs/core';
-import { FUniver as FUniverCtor } from '@univerjs/core/facade';
+import { FUniver } from '@univerjs/core/facade';
import { IRenderManagerService, RenderManagerService } from '@univerjs/engine-render';
import { BehaviorSubject } from 'rxjs';
import { UniverDocsPlugin } from '../../plugin';
@@ -208,6 +207,6 @@ export function createTestBed(documentConfig?: IDocumentData): ITestBed {
univer,
get: injector.get.bind(injector),
doc,
- univerAPI: FUniverCtor.newAPI(injector),
+ univerAPI: FUniver.newAPI(injector),
};
}
diff --git a/packages/drawing-ui/src/index.ts b/packages/drawing-ui/src/index.ts
index 995cc4dc6c..8bcf6af999 100644
--- a/packages/drawing-ui/src/index.ts
+++ b/packages/drawing-ui/src/index.ts
@@ -37,7 +37,13 @@ export {
} from './commands/operations/image-crop.operation';
export { ImageResetSizeOperation } from './commands/operations/image-reset-size.operation';
export type { IUniverDrawingUIConfig } from './config/config';
-export { disposeDrawingRenderObject, getCurrentUnitInfo, getDrawingRenderObject, insertGroupObject } from './controllers/utils';
+export {
+ disposeDrawingRenderObject,
+ getCurrentUnitInfo,
+ getDrawingRenderObject,
+ insertGroupObject,
+} from './controllers/utils';
+export { menuSchema as DrawingUIMenuSchema } from './menu/schema';
export { UniverDrawingUIPlugin } from './plugin';
export { DrawingImageClipService, IMAGE_CLIP_SHAPE_PICKER_COMPONENT } from './services/drawing-image-clip.service';
export type { ImageShapeClipDelegate } from './services/drawing-image-clip.service';
diff --git a/packages/engine-render/src/basics/draw.ts b/packages/engine-render/src/basics/draw.ts
index 6b936a3da7..0127d362f0 100644
--- a/packages/engine-render/src/basics/draw.ts
+++ b/packages/engine-render/src/basics/draw.ts
@@ -18,7 +18,7 @@ import type { IPosition } from '@univerjs/core';
import type { UniverRenderingContext } from '../context';
import type { IDocumentSkeletonLine } from './i-document-skeleton-cached';
import { BorderStyleTypes } from '@univerjs/core';
-import { BORDER_TYPE as BORDER_LTRB, ORIENTATION_TYPE } from './const';
+import { BORDER_TYPE, ORIENTATION_TYPE } from './const';
import { createCanvasElement } from './tools';
import { Vector2 } from './vector2';
@@ -60,28 +60,28 @@ export function getDevicePixelRatio(): number {
* @param lineWidthBuffer Solving the problem of mitered corners in the drawing of borders thicker than 2 pixels, caused by the line segments being centered.
* @param position border draw position
*/
-export function drawLineByBorderType(ctx: UniverRenderingContext, type: BORDER_LTRB, lineWidthBuffer: number, position: IPosition) {
+export function drawLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, lineWidthBuffer: number, position: IPosition) {
let drawStartX = 0;
let drawStartY = 0;
let drawEndX = 0;
let drawEndY = 0;
const { startX, startY, endX, endY } = position;
- if (type === BORDER_LTRB.TOP) {
+ if (type === BORDER_TYPE.TOP) {
drawStartX = startX - lineWidthBuffer;
drawStartY = startY;
drawEndX = endX + lineWidthBuffer;
drawEndY = startY;
- } else if (type === BORDER_LTRB.BOTTOM) {
+ } else if (type === BORDER_TYPE.BOTTOM) {
drawStartX = startX - lineWidthBuffer;
drawStartY = endY;
drawEndX = endX - lineWidthBuffer;
drawEndY = endY;
- } else if (type === BORDER_LTRB.LEFT) {
+ } else if (type === BORDER_TYPE.LEFT) {
drawStartX = startX;
drawStartY = startY - lineWidthBuffer;
drawEndX = startX;
drawEndY = endY + lineWidthBuffer;
- } else if (type === BORDER_LTRB.RIGHT) {
+ } else if (type === BORDER_TYPE.RIGHT) {
drawStartX = endX;
drawStartY = startY - lineWidthBuffer;
drawEndX = endX;
@@ -96,44 +96,44 @@ export function drawLineByBorderType(ctx: UniverRenderingContext, type: BORDER_L
ctx.closePathByEnv();
}
-function drawDiagonalSingleLineByBorderType(ctx: UniverRenderingContext, type: BORDER_LTRB, position: IPosition) {
+function drawDiagonalSingleLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, position: IPosition) {
let drawStartX = 0;
let drawStartY = 0;
let drawEndX = 0;
let drawEndY = 0;
const { startX, startY, endX, endY } = position;
switch (type) {
- case BORDER_LTRB.TL_BR:
+ case BORDER_TYPE.TL_BR:
drawStartX = startX;
drawStartY = startY;
drawEndX = endX;
drawEndY = endY;
break;
- case BORDER_LTRB.TL_BC:
+ case BORDER_TYPE.TL_BC:
drawStartX = startX;
drawStartY = startY;
drawEndX = (startX + endX) / 2;
drawEndY = endY;
break;
- case BORDER_LTRB.TL_MR:
+ case BORDER_TYPE.TL_MR:
drawStartX = startX;
drawStartY = startY;
drawEndX = endX;
drawEndY = (startY + endY) / 2;
break;
- case BORDER_LTRB.BL_TR:
+ case BORDER_TYPE.BL_TR:
drawStartX = startX;
drawStartY = endY;
drawEndX = endX;
drawEndY = startY;
break;
- case BORDER_LTRB.ML_TR:
+ case BORDER_TYPE.ML_TR:
drawStartX = startX;
drawStartY = (startY + endY) / 2;
drawEndX = endX;
drawEndY = startY;
break;
- case BORDER_LTRB.BC_TR:
+ case BORDER_TYPE.BC_TR:
drawStartX = (startX + endX) / 2;
drawStartY = endY;
drawEndX = endX;
@@ -149,7 +149,7 @@ function drawDiagonalSingleLineByBorderType(ctx: UniverRenderingContext, type: B
ctx.stroke();
}
-function drawDiagonalDoubleLineByBorderType(ctx: UniverRenderingContext, type: BORDER_LTRB, position: IPosition) {
+function drawDiagonalDoubleLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, position: IPosition) {
let drawFirstStartX = 0;
let drawFirstStartY = 0;
let drawFirstEndX = 0;
@@ -160,7 +160,7 @@ function drawDiagonalDoubleLineByBorderType(ctx: UniverRenderingContext, type: B
let drawSecondEndY = 0;
const { startX, startY, endX, endY } = position;
switch (type) {
- case BORDER_LTRB.TL_BR:
+ case BORDER_TYPE.TL_BR:
drawFirstStartX = startX;
drawFirstStartY = startY + 1.5;
drawFirstEndX = endX - 1.5;
@@ -170,7 +170,7 @@ function drawDiagonalDoubleLineByBorderType(ctx: UniverRenderingContext, type: B
drawSecondEndX = endX;
drawSecondEndY = endY - 1.5;
break;
- case BORDER_LTRB.BL_TR:
+ case BORDER_TYPE.BL_TR:
drawFirstStartX = startX;
drawFirstStartY = endY - 1.5;
drawFirstEndX = endX - 1.5;
@@ -196,40 +196,40 @@ function drawDiagonalDoubleLineByBorderType(ctx: UniverRenderingContext, type: B
ctx.stroke();
}
-export function drawDiagonalLineByBorderType(ctx: UniverRenderingContext, style: BorderStyleTypes, type: BORDER_LTRB, position: IPosition) {
- if (style === BorderStyleTypes.DOUBLE && (type === BORDER_LTRB.TL_BR || type === BORDER_LTRB.BL_TR)) {
+export function drawDiagonalLineByBorderType(ctx: UniverRenderingContext, style: BorderStyleTypes, type: BORDER_TYPE, position: IPosition) {
+ if (style === BorderStyleTypes.DOUBLE && (type === BORDER_TYPE.TL_BR || type === BORDER_TYPE.BL_TR)) {
drawDiagonalDoubleLineByBorderType(ctx, type, position);
} else {
drawDiagonalSingleLineByBorderType(ctx, type, position);
}
}
-export function clearLineByBorderType(ctx: UniverRenderingContext, type: BORDER_LTRB, position: IPosition) {
+export function clearLineByBorderType(ctx: UniverRenderingContext, type: BORDER_TYPE, position: IPosition) {
let drawStartX = 0;
let drawStartY = 0;
let drawEndX = 0;
let drawEndY = 0;
const { startX, startY, endX, endY } = position;
switch (type) {
- case BORDER_LTRB.TOP:
+ case BORDER_TYPE.TOP:
drawStartX = startX;
drawStartY = startY;
drawEndX = endX;
drawEndY = startY;
break;
- case BORDER_LTRB.BOTTOM:
+ case BORDER_TYPE.BOTTOM:
drawStartX = startX;
drawStartY = endY;
drawEndX = endX;
drawEndY = endY;
break;
- case BORDER_LTRB.LEFT:
+ case BORDER_TYPE.LEFT:
drawStartX = startX;
drawStartY = startY;
drawEndX = startX;
drawEndY = endY;
break;
- case BORDER_LTRB.RIGHT:
+ case BORDER_TYPE.RIGHT:
drawStartX = endX;
drawStartY = startY;
drawEndX = endX;
diff --git a/packages/engine-render/src/components/docs/extensions/border.ts b/packages/engine-render/src/components/docs/extensions/border.ts
index b2fd757623..83e8ca336c 100644
--- a/packages/engine-render/src/components/docs/extensions/border.ts
+++ b/packages/engine-render/src/components/docs/extensions/border.ts
@@ -18,7 +18,7 @@ import type { BorderStyleTypes, IBorderData, IBorderStyleData, IScale, Nullable
import type { IDocumentSkeletonGlyph } from '../../../basics/i-document-skeleton-cached';
import type { UniverRenderingContext } from '../../../context';
import { getColorStyle } from '@univerjs/core';
-import { BORDER_TYPE as BORDER_LTRB, COLOR_BLACK_RGB, FIX_ONE_PIXEL_BLUR_OFFSET } from '../../../basics/const';
+import { BORDER_TYPE, COLOR_BLACK_RGB, FIX_ONE_PIXEL_BLUR_OFFSET } from '../../../basics/const';
import { drawLineByBorderType, getLineWidth, setLineType } from '../../../basics/draw';
import { Vector2 } from '../../../basics/vector2';
import { DocumentsSpanAndLineExtensionRegistry } from '../../extension';
@@ -84,7 +84,7 @@ export class Border extends docExtension {
this._preBorderColor = color;
}
- drawLineByBorderType(ctx, type as BORDER_LTRB, (lineWidth - 1) / 2 / precisionScale, {
+ drawLineByBorderType(ctx, type as BORDER_TYPE, (lineWidth - 1) / 2 / precisionScale, {
startX: spanStartPoint.x,
startY: spanStartPoint.y,
endX: spanStartPoint.x + spanWidth,
@@ -102,11 +102,11 @@ export class Border extends docExtension {
private _createBorderCache(borderData: IBorderData) {
const { t, b, l, r } = borderData;
- const borderCache = new Map<BORDER_LTRB, Nullable<IBorderStyleData>>();
- t && borderCache.set(BORDER_LTRB.TOP, t);
- b && borderCache.set(BORDER_LTRB.BOTTOM, b);
- l && borderCache.set(BORDER_LTRB.LEFT, l);
- r && borderCache.set(BORDER_LTRB.RIGHT, r);
+ const borderCache = new Map<BORDER_TYPE, Nullable<IBorderStyleData>>();
+ t && borderCache.set(BORDER_TYPE.TOP, t);
+ b && borderCache.set(BORDER_TYPE.BOTTOM, b);
+ l && borderCache.set(BORDER_TYPE.LEFT, l);
+ r && borderCache.set(BORDER_TYPE.RIGHT, r);
return borderCache;
}
}
diff --git a/packages/engine-render/src/components/docs/layout/model/glyph.ts b/packages/engine-render/src/components/docs/layout/model/glyph.ts
index b9c42ae416..5e6bccbba4 100644
--- a/packages/engine-render/src/components/docs/layout/model/glyph.ts
+++ b/packages/engine-render/src/components/docs/layout/model/glyph.ts
@@ -23,7 +23,7 @@ import type {
} from '../../../../basics/i-document-skeleton-cached';
import type { IFontCreateConfig } from '../../../../basics/interfaces';
import type { IOpenTypeGlyphInfo } from '../shaping-engine/text-shaping';
-import { BooleanNumber, BulletAlignment, DataStreamTreeTokenType as DT, GridType } from '@univerjs/core';
+import { BooleanNumber, BulletAlignment, DataStreamTreeTokenType, GridType } from '@univerjs/core';
import { cjk } from '../../../../basics/cjk-regexp';
import { GlyphType } from '../../../../basics/i-document-skeleton-cached';
import {
@@ -101,7 +101,7 @@ export function createSkeletonLetterGlyph(
}
export function createSkeletonTabGlyph(config: IFontCreateConfig, glyphWidth?: number): IDocumentSkeletonGlyph {
- return _createSkeletonWordOrLetter(GlyphType.TAB, DT.TAB, config, glyphWidth);
+ return _createSkeletonWordOrLetter(GlyphType.TAB, DataStreamTreeTokenType.TAB, config, glyphWidth);
}
export function createHyphenDashGlyph(config: IFontCreateConfig) {
@@ -114,7 +114,7 @@ export function createHyphenDashGlyph(config: IFontCreateConfig) {
// It is used to create inline custom blocks, such as inline images, to occupy placeholders in the layout.
export function createSkeletonCustomBlockGlyph(config: IFontCreateConfig, glyphWidth = 0, glyphHeight = 0, drawingId = ''): IDocumentSkeletonGlyph {
const { fontStyle, textStyle } = config;
- const content = DT.CUSTOM_BLOCK;
+ const content = DataStreamTreeTokenType.CUSTOM_BLOCK;
return {
content: '',
@@ -139,7 +139,7 @@ export function createSkeletonCustomBlockGlyph(config: IFontCreateConfig, glyphW
isJustifiable: false,
adjustability: baseAdjustability(content, 0),
glyphType: GlyphType.PLACEHOLDER,
- streamType: content as DT,
+ streamType: content as DataStreamTreeTokenType,
count: 1,
drawingId,
};
@@ -154,27 +154,27 @@ export function _createSkeletonWordOrLetter(
): IDocumentSkeletonGlyph {
const { fontStyle, textStyle, charSpace = 1, gridType = GridType.LINES, snapToGrid = BooleanNumber.FALSE } = config;
const skipWidthList: string[] = [
- DT.SECTION_BREAK,
- DT.TABLE_START,
- DT.TABLE_END,
- DT.TABLE_ROW_START,
- DT.TABLE_ROW_END,
- DT.TABLE_CELL_START,
- DT.TABLE_CELL_END,
- DT.COLUMN_GROUP_START,
- DT.COLUMN_START,
- DT.COLUMN_END,
- DT.COLUMN_GROUP_END,
- DT.BLOCK_START,
- DT.BLOCK_END,
- DT.CUSTOM_RANGE_START,
- DT.CUSTOM_RANGE_END,
- DT.COLUMN_BREAK,
- DT.PAGE_BREAK,
- DT.DOCS_END,
- DT.CUSTOM_BLOCK,
+ DataStreamTreeTokenType.SECTION_BREAK,
+ DataStreamTreeTokenType.TABLE_START,
+ DataStreamTreeTokenType.TABLE_END,
+ DataStreamTreeTokenType.TABLE_ROW_START,
+ DataStreamTreeTokenType.TABLE_ROW_END,
+ DataStreamTreeTokenType.TABLE_CELL_START,
+ DataStreamTreeTokenType.TABLE_CELL_END,
+ DataStreamTreeTokenType.COLUMN_GROUP_START,
+ DataStreamTreeTokenType.COLUMN_START,
+ DataStreamTreeTokenType.COLUMN_END,
+ DataStreamTreeTokenType.COLUMN_GROUP_END,
+ DataStreamTreeTokenType.BLOCK_START,
+ DataStreamTreeTokenType.BLOCK_END,
+ DataStreamTreeTokenType.CUSTOM_RANGE_START,
+ DataStreamTreeTokenType.CUSTOM_RANGE_END,
+ DataStreamTreeTokenType.COLUMN_BREAK,
+ DataStreamTreeTokenType.PAGE_BREAK,
+ DataStreamTreeTokenType.DOCS_END,
+ DataStreamTreeTokenType.CUSTOM_BLOCK,
];
- let streamType = DT.LETTER;
+ let streamType = DataStreamTreeTokenType.LETTER;
if (skipWidthList.indexOf(content) > -1) {
return {
@@ -200,13 +200,13 @@ export function _createSkeletonWordOrLetter(
isJustifiable: false,
adjustability: baseAdjustability(content, 0),
glyphType: GlyphType.PLACEHOLDER,
- streamType: content as DT,
+ streamType: content as DataStreamTreeTokenType,
count: 1,
};
}
- if (content === DT.PARAGRAPH) {
- streamType = DT.PARAGRAPH;
+ if (content === DataStreamTreeTokenType.PARAGRAPH) {
+ streamType = DataStreamTreeTokenType.PARAGRAPH;
}
let bBox = null;
@@ -317,7 +317,7 @@ export function createSkeletonBulletGlyph(
isJustifiable: isJustifiable(content),
adjustability: baseAdjustability(content, width),
glyphType: GlyphType.LIST,
- streamType: DT.LETTER,
+ streamType: DataStreamTreeTokenType.LETTER,
// Deliberately set to 0 so that there is no need to count when calculating the cursor.
count: 0,
raw: content,
diff --git a/packages/find-replace/src/__tests__/create-test-bed.ts b/packages/find-replace/src/__tests__/create-test-bed.ts
index 4bcf8a584e..046c921c50 100644
--- a/packages/find-replace/src/__tests__/create-test-bed.ts
+++ b/packages/find-replace/src/__tests__/create-test-bed.ts
@@ -16,7 +16,6 @@
import type { Dependency, IWorkbookData, Workbook } from '@univerjs/core';
import type { IMessageProps } from '@univerjs/design';
-import type { IMessageService as IUiMessageService } from '@univerjs/ui';
import {
Disposable,
IConfirmService,
@@ -61,7 +60,7 @@ const TEST_WORKBOOK_DATA_DEMO: IWorkbookData = {
styles: {},
};
-class TestMessageService implements IUiMessageService {
+class TestMessageService implements IMessageService {
readonly messages: IMessageProps[] = [];
show(options: IMessageProps): Disposable {
diff --git a/packages/find-replace/src/controllers/find-replace.shortcut.ts b/packages/find-replace/src/controllers/find-replace.shortcut.ts
index 00464a830e..89ba5ed253 100644
--- a/packages/find-replace/src/controllers/find-replace.shortcut.ts
+++ b/packages/find-replace/src/controllers/find-replace.shortcut.ts
@@ -16,7 +16,6 @@
import type { IContextService } from '@univerjs/core';
import type { IShortcutItem } from '@univerjs/ui';
-
import { EDITOR_ACTIVATED, FOCUSING_SHEET } from '@univerjs/core';
import { KeyCode, MetaKeys } from '@univerjs/ui';
import {
@@ -26,7 +25,11 @@ import {
OpenFindDialogOperation,
OpenReplaceDialogOperation,
} from '../commands/operations/find-replace.operation';
-import { FIND_REPLACE_DIALOG_FOCUS, FIND_REPLACE_INPUT_FOCUS, FIND_REPLACE_REPLACE_REVEALED } from '../services/context-keys';
+import {
+ FIND_REPLACE_DIALOG_FOCUS,
+ FIND_REPLACE_INPUT_FOCUS,
+ FIND_REPLACE_REPLACE_REVEALED,
+} from '../services/context-keys';
function whenFindReplaceDialogFocused(contextService: IContextService): boolean {
return contextService.getContextValue(FIND_REPLACE_DIALOG_FOCUS);
diff --git a/packages/find-replace/src/index.ts b/packages/find-replace/src/index.ts
index 8bee1605fd..d1d97f7187 100644
--- a/packages/find-replace/src/index.ts
+++ b/packages/find-replace/src/index.ts
@@ -17,9 +17,15 @@
import './global.css';
export { ReplaceAllMatchesCommand, ReplaceCurrentMatchCommand } from './commands/commands/replace.command';
-export { GoToNextMatchOperation, GoToPreviousMatchOperation, OpenFindDialogOperation, OpenReplaceDialogOperation } from './commands/operations/find-replace.operation';
+export {
+ GoToNextMatchOperation,
+ GoToPreviousMatchOperation,
+ OpenFindDialogOperation,
+ OpenReplaceDialogOperation,
+} from './commands/operations/find-replace.operation';
export type { IUniverFindReplaceConfig } from './config/config';
export { FindReplaceController } from './controllers/find-replace.controller';
+export { menuSchema as FindReplaceMenuSchema } from './menu/schema';
export { UniverFindReplacePlugin } from './plugin';
export type {
IFindComplete,
diff --git a/packages/find-replace/src/services/find-replace.service.ts b/packages/find-replace/src/services/find-replace.service.ts
index 9b78d044d8..36d92fee01 100644
--- a/packages/find-replace/src/services/find-replace.service.ts
+++ b/packages/find-replace/src/services/find-replace.service.ts
@@ -16,7 +16,17 @@
import type { IDisposable, Nullable } from '@univerjs/core';
import type { Observable } from 'rxjs';
-import { createIdentifier, Disposable, DisposableCollection, ICommandService, IContextService, Inject, Injector, IUniverInstanceService, toDisposable } from '@univerjs/core';
+import {
+ createIdentifier,
+ Disposable,
+ DisposableCollection,
+ ICommandService,
+ IContextService,
+ Inject,
+ Injector,
+ IUniverInstanceService,
+ toDisposable,
+} from '@univerjs/core';
import { RENDER_RAW_FORMULA_KEY } from '@univerjs/engine-render';
import { BehaviorSubject, combineLatest, debounceTime, Subject, throttleTime } from 'rxjs';
import { FIND_REPLACE_REPLACE_REVEALED } from './context-keys';
diff --git a/packages/sheets-crosshair-highlight/src/index.ts b/packages/sheets-crosshair-highlight/src/index.ts
index 6ca1393911..7eede51a95 100644
--- a/packages/sheets-crosshair-highlight/src/index.ts
+++ b/packages/sheets-crosshair-highlight/src/index.ts
@@ -24,5 +24,6 @@ export {
} from './commands/operations/operation';
export type { ISetCrosshairHighlightColorOperationParams } from './commands/operations/operation';
export type { IUniverSheetsCrosshairHighlightConfig } from './config/config';
+export { menuSchema as SheetsCrosshairHighlightMenuSchema } from './menu/schema';
export { UniverSheetsCrosshairHighlightPlugin } from './plugin';
export { SheetsCrosshairHighlightService } from './services/crosshair.service';
diff --git a/packages/sheets-data-validation-ui/src/services/__tests__/dropdown-manager.service.spec.ts b/packages/sheets-data-validation-ui/src/services/__tests__/dropdown-manager.service.spec.ts
index 57eba43ed1..3d5d91a0cb 100644
--- a/packages/sheets-data-validation-ui/src/services/__tests__/dropdown-manager.service.spec.ts
+++ b/packages/sheets-data-validation-ui/src/services/__tests__/dropdown-manager.service.spec.ts
@@ -36,7 +36,7 @@ import { DataValidatorDropdownType, DataValidatorRegistryService } from '@univer
import { serializeListOptions, SetRangeValuesCommand, SheetsSelectionsService } from '@univerjs/sheets';
import { SheetDataValidationModel } from '@univerjs/sheets-data-validation';
import {
- IEditorBridgeService as IEditorBridgeServiceIdentifier,
+ IEditorBridgeService,
ISheetCellDropdownManagerService,
SetCellEditVisibleOperation,
} from '@univerjs/sheets-ui';
@@ -168,7 +168,7 @@ function createTestBed(): ITestBed {
[SheetDataValidationModel, { useClass: TestSheetDataValidationModel }],
[SheetsSelectionsService, { useClass: TestSheetsSelectionsService }],
[ISheetCellDropdownManagerService, { useClass: TestCellDropdownManagerService }],
- [IEditorBridgeServiceIdentifier, { useClass: TestEditorBridgeService }],
+ [IEditorBridgeService, { useClass: TestEditorBridgeService }],
[DataValidationDropdownManagerService],
];
dependencies.forEach((dependency) => this._injector.add(dependency));
@@ -271,7 +271,7 @@ describe('DataValidationDropdownManagerService', () => {
it('keeps a multiple-list dropdown open after serializing selected values', async () => {
testBed = createTestBed();
- (testBed.get(IEditorBridgeServiceIdentifier) as unknown as TestEditorBridgeService).visible = false;
+ (testBed.get(IEditorBridgeService) as unknown as TestEditorBridgeService).visible = false;
setRule(testBed, {
uid: 'rule-multiple',
type: 'list',
diff --git a/packages/sheets-data-validation-ui/src/views/components/DataValidationItem.tsx b/packages/sheets-data-validation-ui/src/views/components/DataValidationItem.tsx
index 0ab3f508a8..e0253f1fa4 100644
--- a/packages/sheets-data-validation-ui/src/views/components/DataValidationItem.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/DataValidationItem.tsx
@@ -15,6 +15,7 @@
*/
import type { ISheetDataValidationRule } from '@univerjs/core';
+import type { MouseEvent } from 'react';
import { ColorKit, ICommandService, ThemeService } from '@univerjs/core';
import { DataValidatorRegistryService } from '@univerjs/data-validation';
import { clsx } from '@univerjs/design';
@@ -23,7 +24,6 @@ import { DeleteIcon } from '@univerjs/icons';
import { RemoveSheetDataValidationCommand } from '@univerjs/sheets-data-validation';
import { IMarkSelectionService } from '@univerjs/sheets-ui';
import { useDependency, useObservable } from '@univerjs/ui';
-import * as React from 'react';
import { useEffect, useMemo, useRef, useState } from 'react';
export interface IDataValidationDetailProps {
@@ -55,7 +55,7 @@ export const DataValidationItem = (props: IDataValidationDetailProps) => {
stroke: color,
};
}, [theme]);
- const handleDelete = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
+ const handleDelete = (e: MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => {
commandService.executeCommand(RemoveSheetDataValidationCommand.id, {
ruleId: rule.uid,
unitId,
@@ -121,22 +121,20 @@ export const DataValidationItem = (props: IDataValidationDetailProps) => {
>
{rule.ranges.map((range) => serializeRange(range)).join(',')}
</div>
- {isHover
- ? (
- <div
- className={`
- univer-absolute univer-right-2 univer-top-[19px] univer-flex univer-size-5 univer-items-center
- univer-justify-center univer-rounded
- hover:univer-bg-gray-200
- dark:!univer-text-gray-300
- dark:hover:!univer-bg-gray-700
- `}
- onClick={handleDelete}
- >
- <DeleteIcon />
- </div>
- )
- : null}
+ {isHover && (
+ <div
+ className={`
+ univer-absolute univer-right-2 univer-top-[19px] univer-flex univer-size-5 univer-items-center
+ univer-justify-center univer-rounded
+ hover:univer-bg-gray-200
+ dark:!univer-text-gray-300
+ dark:hover:!univer-bg-gray-700
+ `}
+ onClick={handleDelete}
+ >
+ <DeleteIcon />
+ </div>
+ )}
</div>
);
};
diff --git a/packages/sheets-data-validation-ui/src/views/widgets/checkbox-widget.ts b/packages/sheets-data-validation-ui/src/views/widgets/checkbox-widget.ts
index 1648afea11..95298bc199 100644
--- a/packages/sheets-data-validation-ui/src/views/widgets/checkbox-widget.ts
+++ b/packages/sheets-data-validation-ui/src/views/widgets/checkbox-widget.ts
@@ -16,7 +16,12 @@
import type { ICellRenderContext, IDataValidationRule, IStyleData, Nullable } from '@univerjs/core';
import type { IBaseDataValidationWidget, IFormulaResult } from '@univerjs/data-validation';
-import type { IMouseEvent, IPointerEvent, UniverRenderingContext, UniverRenderingContext2D } from '@univerjs/engine-render';
+import type {
+ IMouseEvent,
+ IPointerEvent,
+ UniverRenderingContext,
+ UniverRenderingContext2D,
+} from '@univerjs/engine-render';
import type { ISetRangeValuesCommandParams } from '@univerjs/sheets';
import type { CheckboxValidator } from '@univerjs/sheets-data-validation';
import {
@@ -29,7 +34,14 @@ import {
UniverInstanceType,
VerticalAlign,
} from '@univerjs/core';
-import { CheckboxShape as Checkbox, CURSOR_TYPE, fixLineWidthByScale, getCurrentTypeOfRenderer, IRenderManagerService, Transform } from '@univerjs/engine-render';
+import {
+ CheckboxShape,
+ CURSOR_TYPE,
+ fixLineWidthByScale,
+ getCurrentTypeOfRenderer,
+ IRenderManagerService,
+ Transform,
+} from '@univerjs/engine-render';
import { SetRangeValuesCommand } from '@univerjs/sheets';
import {
CHECKBOX_FORMULA_1,
@@ -170,7 +182,7 @@ export class CheckboxRender implements IBaseDataValidationWidget {
const checked = String(value) === String(formula1);
const defaultColor = this._themeService.getColorFromTheme('primary.600');
- Checkbox.drawWith(ctx as UniverRenderingContext, {
+ CheckboxShape.drawWith(ctx as UniverRenderingContext, {
checked,
width: size,
height: size,
diff --git a/packages/sheets-data-validation/src/services/__tests__/dv-validator.service.spec.ts b/packages/sheets-data-validation/src/services/__tests__/dv-validator.service.spec.ts
index 386a37d741..b617a34b07 100644
--- a/packages/sheets-data-validation/src/services/__tests__/dv-validator.service.spec.ts
+++ b/packages/sheets-data-validation/src/services/__tests__/dv-validator.service.spec.ts
@@ -14,11 +14,19 @@
* limitations under the License.
*/
-import type { IDataValidationRule, IRange, IUniverInstanceService, LifecycleService, Nullable, Workbook, Worksheet } from '@univerjs/core';
+import type {
+ IDataValidationRule,
+ IRange,
+ IUniverInstanceService,
+ LifecycleService,
+ Nullable,
+ Workbook,
+ Worksheet,
+} from '@univerjs/core';
import type { ISheetLocation } from '@univerjs/sheets';
import type { SheetDataValidationModel } from '../../models/sheet-data-validation-model';
import type { DataValidationCacheService } from '../dv-cache.service';
-import { ObjectMatrix as CoreObjectMatrix, DataValidationStatus, LifecycleStages } from '@univerjs/core';
+import { DataValidationStatus, LifecycleStages, ObjectMatrix } from '@univerjs/core';
import { BehaviorSubject, Subject } from 'rxjs';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { SheetsDataValidationValidatorService } from '../dv-validator.service';
@@ -49,7 +57,7 @@ function createService() {
getActiveSheet: () => worksheet,
getSheetBySheetId: vi.fn((sheetId: string) => (sheetId === 'sheet-1' ? worksheet : null)),
} as unknown as Workbook;
- const cache = new CoreObjectMatrix<Nullable<DataValidationStatus>>();
+ const cache = new ObjectMatrix<Nullable<DataValidationStatus>>();
const rule = createRule('rule-1', [{ startRow: 0, endRow: 1, startColumn: 0, endColumn: 1 }]);
const model = {
getRuleByLocation: vi.fn(() => rule),
diff --git a/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts b/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts
index 44e564f1c6..2500bd9287 100644
--- a/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts
+++ b/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts
@@ -14,19 +14,87 @@
* limitations under the License.
*/
-import type { IDisposable, IDrawingSearch, IPosition, IRange, ITransformState, Nullable, Serializable, Workbook, Worksheet } from '@univerjs/core';
+import type {
+ IDisposable,
+ IDrawingSearch,
+ IPosition,
+ IRange,
+ ITransformState,
+ Nullable,
+ Serializable,
+ Workbook,
+ Worksheet,
+} from '@univerjs/core';
import type { IDrawingJsonUndo1 } from '@univerjs/drawing';
-import type { BaseObject, IBoundRectNoAngle, IRectProps, IRender, Scene, SpreadsheetSkeleton } from '@univerjs/engine-render';
-import type { ISetFrozenMutationParams, ISetSelectionsOperationParams, ISetWorksheetRowAutoHeightMutationParams } from '@univerjs/sheets';
-import type { IFloatDomData, IInsertDrawingCommandParams, ISetDrawingCommandParams, ISheetDrawing, ISheetDrawingPosition, ISheetFloatDom } from '@univerjs/sheets-drawing';
+import type {
+ BaseObject,
+ IBoundRectNoAngle,
+ IRectProps,
+ IRender,
+ Scene,
+ SpreadsheetSkeleton,
+} from '@univerjs/engine-render';
+import type {
+ ISetFrozenMutationParams,
+ ISetSelectionsOperationParams,
+ ISetWorksheetRowAutoHeightMutationParams,
+} from '@univerjs/sheets';
+import type {
+ IFloatDomData,
+ IInsertDrawingCommandParams,
+ ISetDrawingCommandParams,
+ ISheetDrawing,
+ ISheetDrawingPosition,
+ ISheetFloatDom,
+} from '@univerjs/sheets-drawing';
import type { IFloatDom, IFloatDomLayout } from '@univerjs/ui';
-import { Disposable, DisposableCollection, DrawingTypeEnum, fromEventSubject, generateRandomId, ICommandService, Inject, IUniverInstanceService, LifecycleService, LifecycleStages, Optional, Tools, UniverInstanceType } from '@univerjs/core';
+import {
+ Disposable,
+ DisposableCollection,
+ DrawingTypeEnum,
+ fromEventSubject,
+ generateRandomId,
+ ICommandService,
+ Inject,
+ IUniverInstanceService,
+ LifecycleService,
+ LifecycleStages,
+ Optional,
+ Tools,
+ UniverInstanceType,
+} from '@univerjs/core';
import { getDrawingShapeKeyByDrawingSearch, IDrawingManagerService } from '@univerjs/drawing';
import { disposeDrawingRenderObject, insertGroupObject } from '@univerjs/drawing-ui';
-import { DRAWING_OBJECT_LAYER_INDEX, IRenderManagerService, ObjectType, Rect, Image as RenderImage, SHEET_VIEWPORT_KEY } from '@univerjs/engine-render';
-import { COMMAND_LISTENER_SKELETON_CHANGE, getSheetCommandTarget, SetFrozenMutation, SetSelectionsOperation, SetWorksheetRowAutoHeightMutation } from '@univerjs/sheets';
-import { DrawingApplyType, InsertSheetDrawingCommand, ISheetDrawingService, SetDrawingApplyMutation, SetSheetDrawingCommand, transformToAxisAlignPosition, transformToDrawingPosition } from '@univerjs/sheets-drawing';
-import { ISheetSelectionRenderService, SetScrollOperation, SetZoomRatioOperation, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
+import {
+ DRAWING_OBJECT_LAYER_INDEX,
+ IRenderManagerService,
+ ObjectType,
+ Rect,
+ Image as RenderImage,
+ SHEET_VIEWPORT_KEY,
+} from '@univerjs/engine-render';
+import {
+ COMMAND_LISTENER_SKELETON_CHANGE,
+ getSheetCommandTarget,
+ SetFrozenMutation,
+ SetSelectionsOperation,
+ SetWorksheetRowAutoHeightMutation,
+} from '@univerjs/sheets';
+import {
+ DrawingApplyType,
+ InsertSheetDrawingCommand,
+ ISheetDrawingService,
+ SetDrawingApplyMutation,
+ SetSheetDrawingCommand,
+ transformToAxisAlignPosition,
+ transformToDrawingPosition,
+} from '@univerjs/sheets-drawing';
+import {
+ ISheetSelectionRenderService,
+ SetScrollOperation,
+ SetZoomRatioOperation,
+ SheetSkeletonManagerService,
+} from '@univerjs/sheets-ui';
import { CanvasFloatDomPreviewService, CanvasFloatDomService } from '@univerjs/ui';
import { BehaviorSubject, filter, map, of, Subject, switchMap, take } from 'rxjs';
diff --git a/packages/sheets-formula-ui/src/commands/operations/__tests__/insert-function.operation.spec.ts b/packages/sheets-formula-ui/src/commands/operations/__tests__/insert-function.operation.spec.ts
index 0323e07791..d5977c41ef 100644
--- a/packages/sheets-formula-ui/src/commands/operations/__tests__/insert-function.operation.spec.ts
+++ b/packages/sheets-formula-ui/src/commands/operations/__tests__/insert-function.operation.spec.ts
@@ -15,10 +15,18 @@
*/
import type { ICellData, Injector, Nullable, Univer } from '@univerjs/core';
-import type { IEditorService } from '@univerjs/docs-ui';
import type { IInsertFunctionOperationParams } from '../insert-function.operation';
-import { DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, ICommandService, IUniverInstanceService, ObjectMatrix, RANGE_TYPE, RedoCommand, UndoCommand } from '@univerjs/core';
-import { IEditorService as IEditorServiceToken } from '@univerjs/docs-ui';
+import {
+ DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,
+ DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
+ ICommandService,
+ IUniverInstanceService,
+ ObjectMatrix,
+ RANGE_TYPE,
+ RedoCommand,
+ UndoCommand,
+} from '@univerjs/core';
+import { IEditorService } from '@univerjs/docs-ui';
import {
SetRangeValuesCommand,
SetRangeValuesMutation,
@@ -57,10 +65,10 @@ describe('Test insert function operation', () => {
}
beforeEach(() => {
- const testBed = createCommandTestBed(undefined, [[IEditorServiceToken, { useClass: TestEditorService as never }]]);
+ const testBed = createCommandTestBed(undefined, [[IEditorService, { useClass: TestEditorService as never }]]);
univer = testBed.univer;
get = testBed.get;
- editorService = get(IEditorServiceToken);
+ editorService = get(IEditorService);
commandService = get(ICommandService);
commandService.registerCommand(InsertFunctionOperation);
diff --git a/packages/sheets-formula-ui/src/index.ts b/packages/sheets-formula-ui/src/index.ts
index 3556a1cc4c..01c1756b35 100644
--- a/packages/sheets-formula-ui/src/index.ts
+++ b/packages/sheets-formula-ui/src/index.ts
@@ -27,6 +27,7 @@ export { ReferenceAbsoluteOperation } from './commands/operations/reference-abso
export { SearchFunctionOperation } from './commands/operations/search-function.operation';
export type { IUniverSheetsFormulaUIConfig } from './config/config';
export { FormulaReorderController } from './controllers/formula-reorder.controller';
+export { menuSchema as SheetsFormulaUIMenuSchema } from './menu/schema';
export { UniverSheetsFormulaUIPlugin } from './plugin';
export { FORMULA_PROMPT_ACTIVATED } from './services/prompt.service';
export { GlobalRangeSelectorService } from './services/range-selector.service';
diff --git a/packages/sheets-formula-ui/src/views/formula-editor/index.tsx b/packages/sheets-formula-ui/src/views/formula-editor/index.tsx
index e1c870f6b2..f32a94a7ca 100644
--- a/packages/sheets-formula-ui/src/views/formula-editor/index.tsx
+++ b/packages/sheets-formula-ui/src/views/formula-editor/index.tsx
@@ -40,7 +40,14 @@ import {
VerticalAlign,
} from '@univerjs/core';
import { clsx } from '@univerjs/design';
-import { createEditorUndoRedoKeyboardConfig, DocBackScrollRenderController, DocSelectionRenderService, IEditorService, useKeyboardEvent, useResize } from '@univerjs/docs-ui';
+import {
+ createEditorUndoRedoKeyboardConfig,
+ DocBackScrollRenderController,
+ DocSelectionRenderService,
+ IEditorService,
+ useKeyboardEvent,
+ useResize,
+} from '@univerjs/docs-ui';
import { IRenderManagerService } from '@univerjs/engine-render';
import { EMBEDDING_FORMULA_EDITOR } from '@univerjs/sheets-ui';
import { useDependency, useEvent, useObservable, useUpdateEffect } from '@univerjs/ui';
diff --git a/packages/sheets-formula/src/services/formula-calculation-session.service.ts b/packages/sheets-formula/src/services/formula-calculation-session.service.ts
index f0de720b94..04b6feb64e 100644
--- a/packages/sheets-formula/src/services/formula-calculation-session.service.ts
+++ b/packages/sheets-formula/src/services/formula-calculation-session.service.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import type { FormulaExecutedStateType, IExecutionInProgressParams, ISetFormulaCalculationResultMutation } from '@univerjs/engine-formula';
+import type { IExecutionInProgressParams, ISetFormulaCalculationResultMutation } from '@univerjs/engine-formula';
import { Disposable } from '@univerjs/core';
-import { FormulaExecutedStateType as FormulaExecutedState, FormulaExecuteStageType } from '@univerjs/engine-formula';
+import { FormulaExecutedStateType, FormulaExecuteStageType } from '@univerjs/engine-formula';
import { BehaviorSubject, Subject } from 'rxjs';
export interface IFormulaCalculationSessionState {
@@ -114,12 +114,12 @@ export class FormulaCalculationSessionService extends Disposable {
}
markCompleted(state: FormulaExecutedStateType): void {
- const noResultToApply = state === FormulaExecutedState.NOT_EXECUTED || state === FormulaExecutedState.INITIAL;
+ const noResultToApply = state === FormulaExecutedStateType.NOT_EXECUTED || state === FormulaExecutedStateType.INITIAL;
this._emit({
...this.state,
- stopped: state === FormulaExecutedState.STOP_EXECUTION,
- completed: state !== FormulaExecutedState.INITIAL,
- resultApplied: this.state.resultApplied || noResultToApply || state === FormulaExecutedState.STOP_EXECUTION,
+ stopped: state === FormulaExecutedStateType.STOP_EXECUTION,
+ completed: state !== FormulaExecutedStateType.INITIAL,
+ resultApplied: this.state.resultApplied || noResultToApply || state === FormulaExecutedStateType.STOP_EXECUTION,
});
}
diff --git a/packages/sheets-numfmt/src/controllers/__tests__/numfmt-cell-content.controller.spec.ts b/packages/sheets-numfmt/src/controllers/__tests__/numfmt-cell-content.controller.spec.ts
index e4de4b2358..96041592fc 100644
--- a/packages/sheets-numfmt/src/controllers/__tests__/numfmt-cell-content.controller.spec.ts
+++ b/packages/sheets-numfmt/src/controllers/__tests__/numfmt-cell-content.controller.spec.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import type { Dependency, Injector, IWorkbookData, Workbook, Worksheet } from '@univerjs/core';
+import type { Dependency, IWorkbookData, Workbook, Worksheet } from '@univerjs/core';
import {
cellToRange,
CellValueType,
@@ -22,12 +22,12 @@ import {
IConfigService,
ILogService,
Inject,
+ Injector,
InterceptorEffectEnum,
IUniverInstanceService,
LocaleType,
LogLevel,
Plugin,
- Injector as RediInjector,
Univer,
UniverInstanceType,
} from '@univerjs/core';
@@ -102,7 +102,7 @@ function createControllerTestBed(workbookData?: IWorkbookData) {
constructor(
_config: undefined,
- @Inject(RediInjector) override readonly _injector: Injector
+ @Inject(Injector) override readonly _injector: Injector
) {
super();
}
diff --git a/packages/sheets-table-ui/src/views/components/SheetTableRenameDialog.tsx b/packages/sheets-table-ui/src/views/components/SheetTableRenameDialog.tsx
index 3ade201be0..cfc534aabd 100644
--- a/packages/sheets-table-ui/src/views/components/SheetTableRenameDialog.tsx
+++ b/packages/sheets-table-ui/src/views/components/SheetTableRenameDialog.tsx
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-import type { IDefinedNamesService } from '@univerjs/engine-formula';
import type { LocaleKey } from '../../locale/types';
import { ICommandService, IUniverInstanceService, LocaleService } from '@univerjs/core';
import { Button, Input } from '@univerjs/design';
-import { IDefinedNamesService as IDefinedNamesServiceIdentifier } from '@univerjs/engine-formula';
+import { IDefinedNamesService } from '@univerjs/engine-formula';
import {
getExistingNamesSet,
SetSheetTableCommand,
@@ -40,7 +39,7 @@ export function SheetTableRenameDialog(props: ISheetTableRenameDialogProps) {
const commandService = useDependency(ICommandService);
const tableManager = useDependency<TableManager>(TableManager);
const univerInstanceService = useDependency(IUniverInstanceService);
- const definedNamesService = useDependency<IDefinedNamesService>(IDefinedNamesServiceIdentifier);
+ const definedNamesService = useDependency<IDefinedNamesService>(IDefinedNamesService);
const table = tableManager.getTableById(unitId, tableId);
const [value, setValue] = useState(table?.getDisplayName() ?? '');
const [error, setError] = useState('');
diff --git a/packages/sheets-ui/src/controllers/__tests__/status-bar.controller.spec.ts b/packages/sheets-ui/src/controllers/__tests__/status-bar.controller.spec.ts
index bed0a0b9d9..174a0d3cf2 100644
--- a/packages/sheets-ui/src/controllers/__tests__/status-bar.controller.spec.ts
+++ b/packages/sheets-ui/src/controllers/__tests__/status-bar.controller.spec.ts
@@ -14,11 +14,30 @@
* limitations under the License.
*/
-import type { Dependency, Injector, IWorkbookData, Workbook } from '@univerjs/core';
+import type { Dependency, IWorkbookData, Workbook } from '@univerjs/core';
import type { ISelectionWithStyle } from '@univerjs/sheets';
-import { CellValueType, ICommandService, ILogService, Inject, IUniverInstanceService, LocaleType, LogLevel, Plugin, RANGE_TYPE, touchDependencies, Univer, Injector as UniverInjector, UniverInstanceType } from '@univerjs/core';
+import {
+ CellValueType,
+ ICommandService,
+ ILogService,
+ Inject,
+ Injector,
+ IUniverInstanceService,
+ LocaleType,
+ LogLevel,
+ Plugin,
+ RANGE_TYPE,
+ touchDependencies,
+ Univer,
+ UniverInstanceType,
+} from '@univerjs/core';
import { FormulaDataModel, FUNCTION_NAMES_MATH, FUNCTION_NAMES_STATISTICAL } from '@univerjs/engine-formula';
-import { INumfmtService, SetRangeValuesMutation, SetSelectionsOperation, SheetsSelectionsService } from '@univerjs/sheets';
+import {
+ INumfmtService,
+ SetRangeValuesMutation,
+ SetSelectionsOperation,
+ SheetsSelectionsService,
+} from '@univerjs/sheets';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { IStatusBarService, StatusBarService } from '../../services/status-bar.service';
import { StatusBarController } from '../status-bar.controller';
@@ -62,7 +81,7 @@ function createTestBed() {
constructor(
_config: undefined,
- @Inject(UniverInjector) override readonly _injector: Injector
+ @Inject(Injector) override readonly _injector: Injector
) {
super();
}
diff --git a/packages/sheets-ui/src/controllers/editor/__tests__/editing-render-business.spec.ts b/packages/sheets-ui/src/controllers/editor/__tests__/editing-render-business.spec.ts
index 92038c8ed1..f2cc90c4ab 100644
--- a/packages/sheets-ui/src/controllers/editor/__tests__/editing-render-business.spec.ts
+++ b/packages/sheets-ui/src/controllers/editor/__tests__/editing-render-business.spec.ts
@@ -24,14 +24,17 @@ import {
LocaleType,
UniverInstanceType,
} from '@univerjs/core';
-import { VIEWPORT_KEY as DOC_VIEWPORT_KEY, MoveCursorOperation, MoveSelectionOperation } from '@univerjs/docs-ui';
+import { MoveCursorOperation, MoveSelectionOperation, VIEWPORT_KEY } from '@univerjs/docs-ui';
import { LexerTreeBuilder } from '@univerjs/engine-formula';
import { DeviceInputEventType } from '@univerjs/engine-render';
import { SetRangeValuesCommand } from '@univerjs/sheets';
import { KeyCode } from '@univerjs/ui';
import { Subject } from 'rxjs';
import { describe, expect, it, vi } from 'vitest';
-import { MoveSelectionCommand, MoveSelectionEnterAndTabCommand } from '../../../commands/commands/set-selection.command';
+import {
+ MoveSelectionCommand,
+ MoveSelectionEnterAndTabCommand,
+} from '../../../commands/commands/set-selection.command';
import { EditingRenderController } from '../editing.render-controller';
function createController() {
@@ -157,7 +160,7 @@ function createController() {
controller._renderManagerService = {
getRenderById: vi.fn(() => ({
scene: {
- getViewport: vi.fn((key) => key === DOC_VIEWPORT_KEY.VIEW_MAIN
+ getViewport: vi.fn((key) => key === VIEWPORT_KEY.VIEW_MAIN
? { scrollToViewportPos: vi.fn() }
: null),
resetCursor: vi.fn(),
@@ -170,7 +173,7 @@ function createController() {
makeDirty: vi.fn(),
},
scene: {
- getViewport: vi.fn((key) => key === DOC_VIEWPORT_KEY.VIEW_MAIN
+ getViewport: vi.fn((key) => key === VIEWPORT_KEY.VIEW_MAIN
? { scrollToViewportPos: vi.fn() }
: null),
resetCursor: vi.fn(),
diff --git a/packages/sheets-ui/src/controllers/editor/__tests__/formula-editor.controller.spec.ts b/packages/sheets-ui/src/controllers/editor/__tests__/formula-editor.controller.spec.ts
index 2fbb3e1723..4524a3dab4 100644
--- a/packages/sheets-ui/src/controllers/editor/__tests__/formula-editor.controller.spec.ts
+++ b/packages/sheets-ui/src/controllers/editor/__tests__/formula-editor.controller.spec.ts
@@ -21,7 +21,7 @@ import {
FOCUSING_EDITOR_BUT_HIDDEN,
FOCUSING_FX_BAR_EDITOR,
} from '@univerjs/core';
-import { CoverContentCommand, VIEWPORT_KEY as DOC_VIEWPORT_KEY } from '@univerjs/docs-ui';
+import { CoverContentCommand, VIEWPORT_KEY } from '@univerjs/docs-ui';
import { DeviceInputEventType } from '@univerjs/engine-render';
import { Subject } from 'rxjs';
import { describe, expect, it, vi } from 'vitest';
@@ -43,7 +43,7 @@ function createController() {
scrollToViewportPos: vi.fn(),
resetCanvasSizeAndUpdateScroll: vi.fn(),
};
- const scene = { transformByState: vi.fn(), getViewport: vi.fn((key) => key === DOC_VIEWPORT_KEY.VIEW_MAIN ? viewport : null) };
+ const scene = { transformByState: vi.fn(), getViewport: vi.fn((key) => key === VIEWPORT_KEY.VIEW_MAIN ? viewport : null) };
const mainComponent = { resize: vi.fn() };
const formulaDoc = {
getBody: vi.fn(() => ({ dataStream: 'SUM(A1:A3)\r\n' })),
diff --git a/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts b/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
index ddafc67960..1eac9435ad 100644
--- a/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
+++ b/packages/sheets-ui/src/controllers/editor/editing.render-controller.ts
@@ -31,7 +31,11 @@ import type {
Workbook,
} from '@univerjs/core';
import type { IRichTextEditingMutationParams } from '@univerjs/docs';
-import type { ISetRangeValuesCommandParams, ISetWorksheetActivateCommandParams, MutationsAffectRange } from '@univerjs/sheets';
+import type {
+ ISetRangeValuesCommandParams,
+ ISetWorksheetActivateCommandParams,
+ MutationsAffectRange,
+} from '@univerjs/sheets';
import type { IUniverSheetsUIConfig } from '../../config/config';
import type { IEditorBridgeServiceVisibleParam } from '../../services/editor-bridge.service';
import {
@@ -64,7 +68,14 @@ import {
WrapStrategy,
} from '@univerjs/core';
import { DocSelectionManagerService, DocSkeletonManagerService, RichTextEditingMutation } from '@univerjs/docs';
-import { VIEWPORT_KEY as DOC_VIEWPORT_KEY, DocSelectionRenderService, IEditorService, MoveCursorOperation, MoveSelectionOperation, ReplaceSnapshotCommand } from '@univerjs/docs-ui';
+import {
+ DocSelectionRenderService,
+ IEditorService,
+ MoveCursorOperation,
+ MoveSelectionOperation,
+ ReplaceSnapshotCommand,
+ VIEWPORT_KEY,
+} from '@univerjs/docs-ui';
import { IFunctionService, LexerTreeBuilder, matchToken } from '@univerjs/engine-formula';
import { convertTextRotation, DeviceInputEventType, IRenderManagerService } from '@univerjs/engine-render';
import {
@@ -88,7 +99,11 @@ import { KeyCode, MetaKeys } from '@univerjs/ui';
import { distinctUntilChanged, filter } from 'rxjs';
import { getEditorObject } from '../../basics/editor/get-editor-object';
import { MoveSelectionCommand, MoveSelectionEnterAndTabCommand } from '../../commands/commands/set-selection.command';
-import { SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation, SetCellEditVisibleWithF2Operation } from '../../commands/operations/cell-edit.operation';
+import {
+ SetCellEditVisibleArrowOperation,
+ SetCellEditVisibleOperation,
+ SetCellEditVisibleWithF2Operation,
+} from '../../commands/operations/cell-edit.operation';
import { ScrollToRangeOperation } from '../../commands/operations/scroll-to-range.operation';
import { SHEETS_UI_PLUGIN_CONFIG_KEY } from '../../config/config';
import { IEditorBridgeService } from '../../services/editor-bridge.service';
@@ -454,7 +469,7 @@ export class EditingRenderController extends Disposable {
}
this._sheetCellEditorResizeService?.fitTextSize(() => {
- const viewMain = scene.getViewport(DOC_VIEWPORT_KEY.VIEW_MAIN);
+ const viewMain = scene.getViewport(VIEWPORT_KEY.VIEW_MAIN);
viewMain?.scrollToViewportPos({
viewportScrollX: Number.POSITIVE_INFINITY,
viewportScrollY: Number.POSITIVE_INFINITY,
@@ -725,7 +740,7 @@ export class EditingRenderController extends Disposable {
formulaBarEditor?.setSelectionRanges([], false);
formulaBarEditor?.blur();
const editorObject = this._getEditorObject();
- editorObject?.scene.getViewport(DOC_VIEWPORT_KEY.VIEW_MAIN)?.scrollToViewportPos({
+ editorObject?.scene.getViewport(VIEWPORT_KEY.VIEW_MAIN)?.scrollToViewportPos({
viewportScrollX: 0,
viewportScrollY: 0,
});
diff --git a/packages/sheets-ui/src/controllers/editor/formula-editor.controller.ts b/packages/sheets-ui/src/controllers/editor/formula-editor.controller.ts
index 5c22bfb47a..c2684996c5 100644
--- a/packages/sheets-ui/src/controllers/editor/formula-editor.controller.ts
+++ b/packages/sheets-ui/src/controllers/editor/formula-editor.controller.ts
@@ -15,9 +15,7 @@
*/
import type { DocumentDataModel, Nullable } from '@univerjs/core';
-import type {
- IRichTextEditingMutationParams,
-} from '@univerjs/docs';
+import type { IRichTextEditingMutationParams } from '@univerjs/docs';
import type { RenderComponentType } from '@univerjs/engine-render';
import type { IEditorBridgeServiceVisibleParam } from '../../services/editor-bridge.service';
import {
@@ -39,7 +37,7 @@ import {
DocSkeletonManagerService,
RichTextEditingMutation,
} from '@univerjs/docs';
-import { CoverContentCommand, VIEWPORT_KEY as DOC_VIEWPORT_KEY, IEditorService } from '@univerjs/docs-ui';
+import { CoverContentCommand, IEditorService, VIEWPORT_KEY } from '@univerjs/docs-ui';
import { DeviceInputEventType, IRenderManagerService, ScrollBar } from '@univerjs/engine-render';
import { combineLatest, filter, takeUntil } from 'rxjs';
import { getEditorObject } from '../../basics/editor/get-editor-object';
@@ -255,7 +253,7 @@ export class FormulaEditorController extends RxDisposable {
actualHeight += marginTop + marginBottom;
const { width, height } = position;
- const viewportMain = scene.getViewport(DOC_VIEWPORT_KEY.VIEW_MAIN);
+ const viewportMain = scene.getViewport(VIEWPORT_KEY.VIEW_MAIN);
let scrollBar = viewportMain?.getScrollBar() as Nullable<ScrollBar>;
scene.transformByState({
diff --git a/packages/sheets-ui/src/controllers/render-controllers/__tests__/render-test-bed.ts b/packages/sheets-ui/src/controllers/render-controllers/__tests__/render-test-bed.ts
index 17b06961e6..c9e46d1c5b 100644
--- a/packages/sheets-ui/src/controllers/render-controllers/__tests__/render-test-bed.ts
+++ b/packages/sheets-ui/src/controllers/render-controllers/__tests__/render-test-bed.ts
@@ -14,10 +14,24 @@
* limitations under the License.
*/
-import type { Dependency, IDisposable, Injector, IWorkbookData, Workbook } from '@univerjs/core';
+import type { Dependency, IDisposable, IWorkbookData, Workbook } from '@univerjs/core';
import type { IRenderContext, Vector2 } from '@univerjs/engine-render';
import type { Observable } from 'rxjs';
-import { ICommandService, IContextService, ILogService, Inject, IUniverInstanceService, LocaleService, LocaleType, LogLevel, Plugin, Tools, Univer, Injector as UniverInjector, UniverInstanceType } from '@univerjs/core';
+import {
+ ICommandService,
+ IContextService,
+ ILogService,
+ Inject,
+ Injector,
+ IUniverInstanceService,
+ LocaleService,
+ LocaleType,
+ LogLevel,
+ Plugin,
+ Tools,
+ Univer,
+ UniverInstanceType,
+} from '@univerjs/core';
import { IRenderManagerService, RenderManagerService, SHEET_VIEWPORT_KEY, Viewport } from '@univerjs/engine-render';
import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
import { BehaviorSubject, Subject } from 'rxjs';
@@ -443,7 +457,7 @@ export function createRenderTestBed(options?: { workbookData?: IWorkbookData; de
constructor(
_config: undefined,
- @Inject(UniverInjector) override readonly _injector: Injector
+ @Inject(Injector) override readonly _injector: Injector
) {
super();
}
diff --git a/packages/sheets-ui/src/services/clipboard/html-to-usm/paste-plugins/plugin-lark.ts b/packages/sheets-ui/src/services/clipboard/html-to-usm/paste-plugins/plugin-lark.ts
index e3c4a2f623..7bfb0ac7aa 100644
--- a/packages/sheets-ui/src/services/clipboard/html-to-usm/paste-plugins/plugin-lark.ts
+++ b/packages/sheets-ui/src/services/clipboard/html-to-usm/paste-plugins/plugin-lark.ts
@@ -15,9 +15,8 @@
*/
import type { IPastePlugin } from './type';
-
import { BooleanNumber, createParagraphId } from '@univerjs/core';
-import { extractNodeStyle as getInlineStyle } from '../parse-node-style';
+import { extractNodeStyle } from '../parse-node-style';
export const LarkPastePlugin: IPastePlugin = {
name: 'univer-sheet-paste-plugin-lark',
@@ -29,7 +28,7 @@ export const LarkPastePlugin: IPastePlugin = {
{
filter: ['s'],
getStyle(node) {
- const inlineStyle = getInlineStyle(node);
+ const inlineStyle = extractNodeStyle(node);
return {
st: {
diff --git a/packages/sheets-ui/src/services/clipboard/html-to-usm/paste-plugins/plugin-word.ts b/packages/sheets-ui/src/services/clipboard/html-to-usm/paste-plugins/plugin-word.ts
index 24ccf84ffd..301c13e12f 100644
--- a/packages/sheets-ui/src/services/clipboard/html-to-usm/paste-plugins/plugin-word.ts
+++ b/packages/sheets-ui/src/services/clipboard/html-to-usm/paste-plugins/plugin-word.ts
@@ -17,7 +17,7 @@
import type { IParagraph } from '@univerjs/core';
import type { IPastePlugin } from './type';
import { BooleanNumber, createParagraphId } from '@univerjs/core';
-import { extractNodeStyle as getInlineStyle } from '../parse-node-style';
+import { extractNodeStyle } from '../parse-node-style';
import { getParagraphStyle } from '../utils';
export const WordPastePlugin: IPastePlugin = {
@@ -30,7 +30,7 @@ export const WordPastePlugin: IPastePlugin = {
{
filter: ['b'],
getStyle(node) {
- const inlineStyle = getInlineStyle(node);
+ const inlineStyle = extractNodeStyle(node);
return { bl: BooleanNumber.TRUE, ...inlineStyle };
},
diff --git a/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx b/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
index 021434e778..18d08ce36a 100644
--- a/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
+++ b/packages/sheets-ui/src/views/editor-container/EditorContainer.tsx
@@ -17,13 +17,34 @@
import type { Nullable } from '@univerjs/core';
import type { KeyCode } from '@univerjs/ui';
import type { ICellEditorState } from '../../services/editor-bridge.service';
-import { DisposableCollection, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, FOCUSING_FX_BAR_EDITOR, ICommandService, IContextService, Injector, IUniverInstanceService, ThemeService, toDisposable, UniverInstanceType } from '@univerjs/core';
+import {
+ DisposableCollection,
+ DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
+ FOCUSING_FX_BAR_EDITOR,
+ ICommandService,
+ IContextService,
+ Injector,
+ IUniverInstanceService,
+ ThemeService,
+ toDisposable,
+ UniverInstanceType,
+} from '@univerjs/core';
import { DocSelectionRenderService, IEditorService } from '@univerjs/docs-ui';
import { DeviceInputEventType } from '@univerjs/engine-render';
-import { ComponentManager, DISABLE_AUTO_FOCUS_KEY, MetaKeys, useDependency, useEvent, useObservable, useSidebarClick } from '@univerjs/ui';
-import * as React from 'react';
+import {
+ ComponentManager,
+ DISABLE_AUTO_FOCUS_KEY,
+ MetaKeys,
+ useDependency,
+ useEvent,
+ useObservable,
+ useSidebarClick,
+} from '@univerjs/ui';
import { useEffect, useRef, useState } from 'react';
-import { SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation } from '../../commands/operations/cell-edit.operation';
+import {
+ SetCellEditVisibleArrowOperation,
+ SetCellEditVisibleOperation,
+} from '../../commands/operations/cell-edit.operation';
import { EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY } from '../../common/keys';
import { IEditorBridgeService } from '../../services/editor-bridge.service';
import { ICellEditorManagerService } from '../../services/editor/cell-editor-manager.service';
@@ -40,8 +61,6 @@ import {
import { focusSheetCellEditorElement, registerSheetCellEditorRuntimePortal } from './focus-editor';
import { useKeyEventConfig } from './hooks';
-interface ICellIEditorProps { }
-
const HIDDEN_EDITOR_POSITION = -1000;
const EDITOR_DEFAULT_POSITION = {
@@ -180,7 +199,7 @@ function isEmbedRuntimeEditorOrPopup(target: EventTarget | null | undefined): bo
* Cell editor container.
* @returns the rendered cell editor container.
*/
-export const EditorContainer: React.FC<ICellIEditorProps> = () => {
+export function EditorContainer() {
const [state, setState] = useState({
...EDITOR_DEFAULT_POSITION,
});
diff --git a/packages/slides-ui/src/controllers/slide-editing.render-controller.ts b/packages/slides-ui/src/controllers/slide-editing.render-controller.ts
index 111f8a2530..87d7792150 100644
--- a/packages/slides-ui/src/controllers/slide-editing.render-controller.ts
+++ b/packages/slides-ui/src/controllers/slide-editing.render-controller.ts
@@ -61,7 +61,15 @@ import {
DocSkeletonManagerService,
RichTextEditingMutation,
} from '@univerjs/docs';
-import { VIEWPORT_KEY as DOC_VIEWPORT_KEY, DOCS_COMPONENT_MAIN_LAYER_INDEX, DOCS_VIEW_KEY, DocSelectionRenderService, IEditorService, MoveCursorOperation, MoveSelectionOperation } from '@univerjs/docs-ui';
+import {
+ DOCS_COMPONENT_MAIN_LAYER_INDEX,
+ DOCS_VIEW_KEY,
+ DocSelectionRenderService,
+ IEditorService,
+ MoveCursorOperation,
+ MoveSelectionOperation,
+ VIEWPORT_KEY,
+} from '@univerjs/docs-ui';
import {
convertTextRotation,
DeviceInputEventType,
@@ -431,7 +439,7 @@ export class SlideEditingRenderController extends Disposable implements IRenderM
const { document: documentComponent, scene: editorScene, engine: docEngine } = editorObject;
- const viewportMain = editorScene.getViewport(DOC_VIEWPORT_KEY.VIEW_MAIN);
+ const viewportMain = editorScene.getViewport(VIEWPORT_KEY.VIEW_MAIN);
const clientHeight =
document.body.clientHeight -
@@ -601,7 +609,7 @@ export class SlideEditingRenderController extends Disposable implements IRenderM
// TODO: @JOCS, Get the position close to the cursor after clicking on the cell.
const cursor = documentDataModel.getBody()!.dataStream.length - 2 || 0;
- scene.getViewport(DOC_VIEWPORT_KEY.VIEW_MAIN)?.scrollToViewportPos({
+ scene.getViewport(VIEWPORT_KEY.VIEW_MAIN)?.scrollToViewportPos({
viewportScrollX: Number.POSITIVE_INFINITY,
});
diff --git a/packages/telemetry/src/index.spec.ts b/packages/telemetry/src/index.spec.ts
deleted file mode 100644
index 0b2329b770..0000000000
--- a/packages/telemetry/src/index.spec.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Copyright 2023-present DreamNum Co., Ltd.
- *
- * 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 { describe, expect, it } from 'vitest';
-import * as indexModule from './index';
-import { ITelemetryService } from './services/telemetry.service';
-
-describe('telemetry exports', () => {
- it('should re-export ITelemetryService identifier from index', () => {
- expect(indexModule.ITelemetryService).toBe(ITelemetryService);
- expect(String(ITelemetryService)).toContain('telemetry.service');
- });
-});
diff --git a/packages/ui/src/views/mobile-workbench/MobileWorkbench.tsx b/packages/ui/src/views/mobile-workbench/MobileWorkbench.tsx
index dfe1be5b6b..4c50ca8cf9 100644
--- a/packages/ui/src/views/mobile-workbench/MobileWorkbench.tsx
+++ b/packages/ui/src/views/mobile-workbench/MobileWorkbench.tsx
@@ -18,7 +18,7 @@ import type { Injector } from '@univerjs/core';
import type { ComponentType } from 'react';
import type { IWorkbenchOptions } from '../../controllers/ui/ui.controller';
import { LocaleService, ThemeService } from '@univerjs/core';
-import { borderBottomClassName, clsx, ConfigProvider, render as createRoot } from '@univerjs/design';
+import { borderBottomClassName, clsx, ConfigProvider, render } from '@univerjs/design';
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { BuiltInUIPart } from '../../services/parts/parts.service';
import { ThemeSwitcherService } from '../../services/theme-switcher/theme-switcher.service';
@@ -41,7 +41,7 @@ export function mountMobileWorkbench(
): void {
const ConnectedApp = connectInjector(MobileWorkbench, injector) as ComponentType<IUniverAppProps>;
- createRoot(
+ render(
<ConnectedApp
{...options}
mountContainer={mountContainer}
diff --git a/packages/ui/src/views/workbench/Workbench.tsx b/packages/ui/src/views/workbench/Workbench.tsx
index 363c7ac1dc..57feaa6a1e 100644
--- a/packages/ui/src/views/workbench/Workbench.tsx
+++ b/packages/ui/src/views/workbench/Workbench.tsx
@@ -19,7 +19,7 @@ import type { ComponentType } from 'react';
import type { IUniverUIConfig } from '../../config/config';
import type { IWorkbenchOptions } from '../../controllers/ui/ui.controller';
import { IConfigService, LocaleService, ThemeService } from '@univerjs/core';
-import { borderBottomClassName, clsx, ConfigContext, ConfigProvider, render as createRoot } from '@univerjs/design';
+import { borderBottomClassName, clsx, ConfigContext, ConfigProvider, render } from '@univerjs/design';
import { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { UI_PLUGIN_CONFIG_KEY } from '../../config/config';
@@ -50,7 +50,7 @@ export function mountDesktopWorkbench(
): void {
const ConnectedApp = connectInjector(DesktopWorkbench, injector) as ComponentType<IUniverWorkbenchProps>;
- createRoot(
+ render(
<ConnectedApp
{...options}
mountContainer={mountContainer}