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(docs-ui): support doc checklist (#2917)

zhangw4d3c6d32dbfc
diff --git a/examples/package.json b/examples/package.json
index 69682a1a28..cda7faba2b 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.70",
+ "@univerjs/icons": "^0.1.72",
"@univerjs/rpc": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-conditional-formatting": "workspace:*",
diff --git a/examples/src/data/docs/default-document-data-cn.ts b/examples/src/data/docs/default-document-data-cn.ts
index cb59d88c59..80a9d77454 100644
--- a/examples/src/data/docs/default-document-data-cn.ts
+++ b/examples/src/data/docs/default-document-data-cn.ts
@@ -615,6 +615,9 @@ export const DEFAULT_DOCUMENT_DATA_CN: IDocumentData = {
renderConfig: {
vertexAngle: 0,
centerAngle: 0,
+ background: {
+ rgb: '#ccc',
+ },
},
defaultHeaderId: '',
defaultFooterId: '',
diff --git a/packages-experimental/uni-formula/package.json b/packages-experimental/uni-formula/package.json
index cc5f1b7111..062e08ae45 100644
--- a/packages-experimental/uni-formula/package.json
+++ b/packages-experimental/uni-formula/package.json
@@ -66,7 +66,7 @@
"@univerjs/sheets-formula": "workspace:*"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
diff --git a/packages-experimental/uniui/package.json b/packages-experimental/uniui/package.json
index 6c816f5f93..eb9c3c475e 100644
--- a/packages-experimental/uniui/package.json
+++ b/packages-experimental/uniui/package.json
@@ -70,7 +70,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"rc-util": "^5.43.0"
},
"devDependencies": {
diff --git a/packages/core/src/docs/data-model/preset-list-type.ts b/packages/core/src/docs/data-model/preset-list-type.ts
index 680e19cfaf..e7f8287ce1 100644
--- a/packages/core/src/docs/data-model/preset-list-type.ts
+++ b/packages/core/src/docs/data-model/preset-list-type.ts
@@ -14,9 +14,20 @@
* limitations under the License.
*/
-import type { IListData, INestingLevel } from '../../types/interfaces/i-document-data';
+import { Tools } from '../../shared';
+import { BooleanNumber } from '../../types/enum';
+import type { IListData, INestingLevel, ITextStyle } from '../../types/interfaces/i-document-data';
import { BulletAlignment, GlyphType } from '../../types/interfaces/i-document-data';
+export enum QuickListType {
+ ORDER_LIST_QUICK_1 = '1.',
+ ORDER_LIST_QUICK_2 = 'a)',
+ ORDER_LIST_QUICK_3 = 'a.',
+ ORDER_LIST_QUICK_4 = 'i.',
+ ORDER_LIST_QUICK_5 = 'A.',
+ ORDER_LIST_QUICK_6 = 'I.',
+}
+
export enum PresetListType {
BULLET_LIST = 'BULLET_LIST',
BULLET_LIST_1 = 'BULLET_LIST_1',
@@ -31,8 +42,26 @@ export enum PresetListType {
ORDER_LIST_3 = 'ORDER_LIST_3',
ORDER_LIST_4 = 'ORDER_LIST_4',
ORDER_LIST_5 = 'ORDER_LIST_5',
+
+ ORDER_LIST_QUICK_2 = 'ORDER_LIST_QUICK_2',
+ ORDER_LIST_QUICK_3 = 'ORDER_LIST_QUICK_3',
+ ORDER_LIST_QUICK_4 = 'ORDER_LIST_QUICK_4',
+ ORDER_LIST_QUICK_5 = 'ORDER_LIST_QUICK_5',
+ ORDER_LIST_QUICK_6 = 'ORDER_LIST_QUICK_6',
+
+ CHECK_LIST = 'CHECK_LIST',
+ CHECK_LIST_CHECKED = 'CHECK_LIST_CHECKED',
}
+const orderListSymbolMap = {
+ 'a)': { glyphFormat: ' %1)', glyphType: GlyphType.DECIMAL },
+ '1.': { glyphFormat: ' %1.', glyphType: GlyphType.DECIMAL },
+ 'a.': { glyphFormat: ' %1.', glyphType: GlyphType.LOWER_LETTER },
+ 'A.': { glyphFormat: ' %1.', glyphType: GlyphType.UPPER_LETTER },
+ 'i.': { glyphFormat: ' %1.', glyphType: GlyphType.LOWER_ROMAN },
+ 'I.': { glyphFormat: ' %1.', glyphType: GlyphType.UPPER_LETTER },
+};
+
type BulletSymbols = [string, string, string];
const bulletListFactory = (symbols: BulletSymbols): INestingLevel[] => {
return [
@@ -69,7 +98,24 @@ const orderListFactory = (options: { glyphFormat: string; glyphType: GlyphType }
}));
};
-export const PRESET_LIST_TYPE = {
+const checkListFactory = (symbol: string, textStyle: ITextStyle): INestingLevel[] => {
+ return Array(9).fill(0).map((_, i) => ({
+ glyphFormat: ` %${i + 1}`,
+ glyphSymbol: symbol,
+ bulletAlignment: BulletAlignment.START,
+ textStyle: {
+ fs: 16,
+ },
+ startNumber: 0,
+ paragraphProperties: {
+ hanging: { v: 21 },
+ indentStart: { v: 21 * (i + 1) },
+ textStyle,
+ },
+ } as INestingLevel));
+};
+
+export const PRESET_LIST_TYPE: Record<string, IListData> = {
[PresetListType.BULLET_LIST]: {
listType: PresetListType.BULLET_LIST,
nestingLevel: bulletListFactory(['\u25CF', '\u25CB', '\u25A0']),
@@ -177,4 +223,56 @@ export const PRESET_LIST_TYPE = {
{ glyphFormat: ' %9.', glyphType: GlyphType.LOWER_ROMAN },
]),
} as IListData,
+
+ [PresetListType.CHECK_LIST]: {
+ listType: PresetListType.CHECK_LIST,
+ nestingLevel: checkListFactory(
+ '\u2610',
+ {
+ st: {
+ s: BooleanNumber.FALSE,
+ },
+ }
+ ),
+ } as IListData,
+ [PresetListType.CHECK_LIST_CHECKED]: {
+ listType: PresetListType.CHECK_LIST_CHECKED,
+ nestingLevel: checkListFactory(
+ '\u2611',
+ {
+ st: {
+ s: BooleanNumber.TRUE,
+ },
+ }
+ ),
+ } as IListData,
+};
+
+const generateOrderList = (opt: { glyphFormat: string; glyphType: GlyphType }) => {
+ const { glyphFormat, glyphType } = opt;
+
+ const data = Tools.deepClone(PRESET_LIST_TYPE[PresetListType.ORDER_LIST]);
+ data.nestingLevel[0].glyphFormat = glyphFormat;
+ data.nestingLevel[0].glyphType = glyphType;
+
+ return data;
+};
+
+const QUICK_LIST_TYPE = {
+ [PresetListType.ORDER_LIST_QUICK_2]: generateOrderList(orderListSymbolMap[QuickListType.ORDER_LIST_QUICK_2]),
+ [PresetListType.ORDER_LIST_QUICK_3]: generateOrderList(orderListSymbolMap[QuickListType.ORDER_LIST_QUICK_3]),
+ [PresetListType.ORDER_LIST_QUICK_4]: generateOrderList(orderListSymbolMap[QuickListType.ORDER_LIST_QUICK_4]),
+ [PresetListType.ORDER_LIST_QUICK_5]: generateOrderList(orderListSymbolMap[QuickListType.ORDER_LIST_QUICK_5]),
+ [PresetListType.ORDER_LIST_QUICK_6]: generateOrderList(orderListSymbolMap[QuickListType.ORDER_LIST_QUICK_6]),
+};
+
+Object.assign(PRESET_LIST_TYPE, QUICK_LIST_TYPE);
+
+export const QuickListTypeMap = {
+ [QuickListType.ORDER_LIST_QUICK_1]: PresetListType.ORDER_LIST,
+ [QuickListType.ORDER_LIST_QUICK_2]: PresetListType.ORDER_LIST_QUICK_2,
+ [QuickListType.ORDER_LIST_QUICK_3]: PresetListType.ORDER_LIST_QUICK_3,
+ [QuickListType.ORDER_LIST_QUICK_4]: PresetListType.ORDER_LIST_QUICK_4,
+ [QuickListType.ORDER_LIST_QUICK_5]: PresetListType.ORDER_LIST_QUICK_5,
+ [QuickListType.ORDER_LIST_QUICK_6]: PresetListType.ORDER_LIST_QUICK_6,
};
diff --git a/packages/core/src/types/interfaces/i-document-data-interceptor.ts b/packages/core/src/types/interfaces/i-document-data-interceptor.ts
index c09d92c0bd..67459f593b 100644
--- a/packages/core/src/types/interfaces/i-document-data-interceptor.ts
+++ b/packages/core/src/types/interfaces/i-document-data-interceptor.ts
@@ -26,7 +26,7 @@ export interface ICustomDecorationForInterceptor extends ICustomDecoration {
show?: boolean;
}
-export interface IParagrapRange extends IParagraph {
+export interface IParagraphRange extends IParagraph {
paragraphStart: number;
paragraphEnd: number;
}
diff --git a/packages/core/src/types/interfaces/i-document-data.ts b/packages/core/src/types/interfaces/i-document-data.ts
index 998fd0cdb1..c82d7edc38 100644
--- a/packages/core/src/types/interfaces/i-document-data.ts
+++ b/packages/core/src/types/interfaces/i-document-data.ts
@@ -187,10 +187,10 @@ export interface IListData {
* Contains properties describing the look and feel of a list bullet at a given level of nesting.
*/
export interface INestingLevel {
- paragraphProperties?: IParagraphProperties;
+ paragraphProperties?: IParagraphStyle;
+ paragraphTextStyle?: ITextStyle;
bulletAlignment: BulletAlignment; // ordered list support lvlJc
-
// The glyph format contains one or more placeholders, and these placeholder are replaced with the appropriate values depending on the glyphType or glyphSymbol. The placeholders follow the pattern %[nestingLevel]. Furthermore, placeholders can have prefixes and suffixes. Thus, the glyph format follows the pattern <prefix>%[nestingLevel]<suffix>. Note that the prefix and suffix are optional and can be arbitrary strings.
// <prefix>%[nestingLevel]<suffix>
glyphFormat: string; // https://developers.google.com/docs/api/reference/rest/v1/documents#nestinglevel,ms word lvlText
diff --git a/packages/design/package.json b/packages/design/package.json
index 9b6ee78f00..f1d92272ff 100644
--- a/packages/design/package.json
+++ b/packages/design/package.json
@@ -74,7 +74,7 @@
"@rc-component/color-picker": "^2.0.0",
"@rc-component/trigger": "^2.2.0",
"@types/react-mentions": "^4.1.13",
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"rc-dialog": "^9.5.2",
"rc-dropdown": "^4.2.0",
"rc-input": "^1.6.2",
diff --git a/packages/docs-drawing-ui/package.json b/packages/docs-drawing-ui/package.json
index 364971d104..7b3ad860cc 100644
--- a/packages/docs-drawing-ui/package.json
+++ b/packages/docs-drawing-ui/package.json
@@ -77,7 +77,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
diff --git a/packages/docs-hyper-link-ui/package.json b/packages/docs-hyper-link-ui/package.json
index 67394fa7fd..393949356f 100644
--- a/packages/docs-hyper-link-ui/package.json
+++ b/packages/docs-hyper-link-ui/package.json
@@ -71,7 +71,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
diff --git a/packages/docs-thread-comment-ui/package.json b/packages/docs-thread-comment-ui/package.json
index 23aa9cf4ef..e6ba457e35 100644
--- a/packages/docs-thread-comment-ui/package.json
+++ b/packages/docs-thread-comment-ui/package.json
@@ -68,7 +68,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
diff --git a/packages/docs-ui/package.json b/packages/docs-ui/package.json
index 9ba8981f91..6406f34763 100644
--- a/packages/docs-ui/package.json
+++ b/packages/docs-ui/package.json
@@ -75,7 +75,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.65"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@types/react": "^18.3.3",
diff --git a/packages/docs-ui/src/controllers/doc-auto-format.controller.ts b/packages/docs-ui/src/controllers/doc-auto-format.controller.ts
index a049bac8c4..34de7d881d 100644
--- a/packages/docs-ui/src/controllers/doc-auto-format.controller.ts
+++ b/packages/docs-ui/src/controllers/doc-auto-format.controller.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-import { Disposable, Inject, LifecycleStages, OnLifecycle } from '@univerjs/core';
+import { Disposable, Inject, LifecycleStages, OnLifecycle, QuickListTypeMap } from '@univerjs/core';
import type { ITabCommandParams } from '@univerjs/docs';
-import { BreakLineCommand, ChangeListNestingLevelCommand, ChangeListNestingLevelType, DocAutoFormatService, EnterCommand, ListOperationCommand, TabCommand } from '@univerjs/docs';
+import { AfterSpaceCommand, BreakLineCommand, ChangeListNestingLevelCommand, ChangeListNestingLevelType, DocAutoFormatService, EnterCommand, ListOperationCommand, QuickListCommand, TabCommand } from '@univerjs/docs';
import type { Nullable } from 'vitest';
@OnLifecycle(LifecycleStages.Rendered, DocAutoFormatController)
@@ -26,12 +26,13 @@ export class DocAutoFormatController extends Disposable {
) {
super();
- this._initListAutoFormat();
+ this._initListTabAutoFormat();
+ this._initListSpaceAutoFormat();
this._initDefaultEnterFormat();
this._initExitListAutoFormat();
}
- private _initListAutoFormat() {
+ private _initListTabAutoFormat() {
this.disposeWithMe(
this._docAutoFormatService.registerAutoFormat({
id: TabCommand.id,
@@ -60,6 +61,43 @@ export class DocAutoFormatController extends Disposable {
);
}
+ private _initListSpaceAutoFormat() {
+ this.disposeWithMe(
+ this._docAutoFormatService.registerAutoFormat({
+ id: AfterSpaceCommand.id,
+ match: (context) => {
+ const { selection, paragraphs, unit } = context;
+ if (!selection.collapsed) {
+ return false;
+ }
+ if (paragraphs.length !== 1) {
+ return false;
+ }
+ const text = unit.getBody()?.dataStream.slice(paragraphs[0].paragraphStart, paragraphs[0].paragraphEnd - 1);
+ if (text && Object.keys(QuickListTypeMap).includes(text)) {
+ return true;
+ }
+ return false;
+ },
+ getMutations(context) {
+ const { paragraphs, unit } = context;
+ const text = unit.getBody()?.dataStream.slice(paragraphs[0].paragraphStart, paragraphs[0].paragraphEnd - 1);
+ if (text && Object.keys(QuickListTypeMap).includes(text)) {
+ const type = QuickListTypeMap[text as keyof typeof QuickListTypeMap];
+ return [{
+ id: QuickListCommand.id,
+ params: {
+ listType: type,
+ paragraph: paragraphs[0],
+ },
+ }];
+ }
+ return [];
+ },
+ })
+ );
+ }
+
private _initExitListAutoFormat() {
this.disposeWithMe(
this._docAutoFormatService.registerAutoFormat({
diff --git a/packages/docs-ui/src/controllers/doc-ui.controller.ts b/packages/docs-ui/src/controllers/doc-ui.controller.ts
index 17c8c2c923..7c0e2868e8 100644
--- a/packages/docs-ui/src/controllers/doc-ui.controller.ts
+++ b/packages/docs-ui/src/controllers/doc-ui.controller.ts
@@ -19,6 +19,7 @@ import type { IMenuItemFactory } from '@univerjs/ui';
import { BuiltInUIPart, ComponentManager, ILayoutService, IMenuService, IShortcutService, IUIPartsService } from '@univerjs/ui';
import { ITextSelectionRenderManager } from '@univerjs/engine-render';
+import { TodoList } from '@univerjs/icons';
import { COLOR_PICKER_COMPONENT, ColorPicker } from '../components/color-picker';
import {
FONT_FAMILY_COMPONENT,
@@ -53,6 +54,7 @@ import {
BackgroundColorSelectorMenuItemFactory,
BoldMenuItemFactory,
BulletListMenuItemFactory,
+ CheckListMenuItemFactory,
FontFamilySelectorMenuItemFactory,
FontSizeSelectorMenuItemFactory,
HeaderFooterMenuItemFactory,
@@ -95,6 +97,8 @@ export class DocUIController extends Disposable {
this.disposeWithMe(componentManager.register(FONT_SIZE_COMPONENT, FontSize));
this.disposeWithMe(componentManager.register(BULLET_LIST_TYPE_COMPONENT, BulletListTypePicker));
this.disposeWithMe(componentManager.register(ORDER_LIST_TYPE_COMPONENT, OrderListTypePicker));
+
+ this.disposeWithMe(componentManager.register('TodoList', TodoList));
}
private _initUiParts() {
@@ -128,6 +132,7 @@ export class DocUIController extends Disposable {
AlignJustifyMenuItemFactory,
OrderListMenuItemFactory,
BulletListMenuItemFactory,
+ CheckListMenuItemFactory,
ResetBackgroundColorMenuItemFactory,
BackgroundColorSelectorMenuItemFactory,
] as IMenuItemFactory[]
diff --git a/packages/docs-ui/src/controllers/menu/menu.ts b/packages/docs-ui/src/controllers/menu/menu.ts
index 4ab629408d..5ba08cb620 100644
--- a/packages/docs-ui/src/controllers/menu/menu.ts
+++ b/packages/docs-ui/src/controllers/menu/menu.ts
@@ -30,6 +30,7 @@ import {
AlignOperationCommand,
AlignRightCommand,
BulletListCommand,
+ CheckListCommand,
DocSkeletonManagerService,
getParagraphsInRange,
OrderListCommand,
@@ -765,6 +766,19 @@ export function BulletListMenuItemFactory(accessor: IAccessor): IMenuSelectorIte
};
}
+export function CheckListMenuItemFactory(accessor: IAccessor): IMenuButtonItem {
+ return {
+ id: CheckListCommand.id,
+ group: MenuGroup.TOOLBAR_LAYOUT,
+ type: MenuItemType.BUTTON,
+ icon: 'TodoList',
+ tooltip: 'toolbar.checklist',
+ positions: [MenuPosition.TOOLBAR_START],
+ hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_DOC),
+ activated$: listValueFactory$(accessor).pipe(map((v) => v && v.indexOf('CHECK_LIST') === 0)),
+ };
+}
+
export function ResetBackgroundColorMenuItemFactory(accessor: IAccessor): IMenuButtonItem {
return {
id: ResetInlineFormatTextBackgroundColorCommand.id,
diff --git a/packages/docs-ui/src/controllers/render-controllers/doc-checklist.render-controller.ts b/packages/docs-ui/src/controllers/render-controllers/doc-checklist.render-controller.ts
new file mode 100644
index 0000000000..c241d331cf
--- /dev/null
+++ b/packages/docs-ui/src/controllers/render-controllers/doc-checklist.render-controller.ts
@@ -0,0 +1,102 @@
+/**
+ * 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 { Documents, IRenderContext, IRenderModule, Viewport } from '@univerjs/engine-render';
+import { CURSOR_TYPE, getParagraphByGlyph, PageLayoutType, Vector2 } from '@univerjs/engine-render';
+import type { DocumentDataModel } from '@univerjs/core';
+import { Disposable, ICommandService, Inject, PresetListType } from '@univerjs/core';
+import { DocSkeletonManagerService, ToggleCheckListCommand, VIEWPORT_KEY } from '@univerjs/docs';
+import { DocHoverManagerService } from '../../services/doc-hover-manager.service';
+
+export class DocChecklistRenderController extends Disposable implements IRenderModule {
+ constructor(
+ private _context: IRenderContext<DocumentDataModel>,
+ @Inject(DocSkeletonManagerService) private readonly _docSkeletonManagerService: DocSkeletonManagerService,
+ @ICommandService private readonly _commandService: ICommandService,
+ @Inject(DocHoverManagerService) private readonly _docHoverManagerService: DocHoverManagerService
+ ) {
+ super();
+
+ this._initPointerDownObserver();
+ this._initHoverCursor();
+ }
+
+ private _initPointerDownObserver() {
+ this.disposeWithMe(
+ this._context.mainComponent!.onPointerDown$.subscribeEvent((evt) => {
+ const { offsetX, offsetY } = evt;
+
+ const documentComponent = this._context.mainComponent as Documents;
+ const coord = this._getTransformCoordForDocumentOffset(
+ documentComponent,
+ this._context.scene.getViewport(VIEWPORT_KEY.VIEW_MAIN)!,
+ offsetX,
+ offsetY
+ );
+ if (!coord) {
+ return;
+ }
+ const { pageLayoutType = PageLayoutType.VERTICAL, pageMarginLeft, pageMarginTop } = documentComponent.getOffsetConfig();
+ const skeleton = this._docSkeletonManagerService.getSkeleton();
+ const node = skeleton.findNodeByCoord(
+ coord,
+ pageLayoutType,
+ pageMarginLeft,
+ pageMarginTop
+ );
+ if (!node) {
+ return;
+ }
+ const index = node.node.parent!.st! + node.node.parent!.glyphGroup.indexOf(node.node)!;
+
+ const paragraph = getParagraphByGlyph(node.node, this._context.unit.getBody());
+ if (paragraph && paragraph.bullet && index === paragraph.paragraphStart) {
+ if (
+ paragraph.bullet.listType === PresetListType.CHECK_LIST ||
+ paragraph.bullet.listType === PresetListType.CHECK_LIST_CHECKED
+ ) {
+ this._commandService.executeCommand(ToggleCheckListCommand.id, {
+ index: paragraph.startIndex,
+ });
+ }
+ }
+ })
+ );
+ }
+
+ private _initHoverCursor() {
+ this.disposeWithMe(
+ this._docHoverManagerService.bullet$.subscribe((paragraph) => {
+ if (paragraph) {
+ this._context.mainComponent!.setCursor(CURSOR_TYPE.POINTER);
+ } else {
+ this._context.mainComponent!.setCursor(CURSOR_TYPE.TEXT);
+ }
+ })
+ );
+ }
+
+ private _getTransformCoordForDocumentOffset(document: Documents, viewport: Viewport, evtOffsetX: number, evtOffsetY: number) {
+ const { documentTransform } = document.getOffsetConfig();
+ const originCoord = viewport.transformVector2SceneCoord(Vector2.FromArray([evtOffsetX, evtOffsetY]));
+
+ if (!originCoord) {
+ return;
+ }
+
+ return documentTransform.clone().invert().applyPoint(originCoord);
+ }
+}
diff --git a/packages/docs-ui/src/controllers/render-controllers/doc-hover.render-controller.ts b/packages/docs-ui/src/controllers/render-controllers/doc-hover.render-controller.ts
index 4fe6d2ad43..40e753f2cd 100644
--- a/packages/docs-ui/src/controllers/render-controllers/doc-hover.render-controller.ts
+++ b/packages/docs-ui/src/controllers/render-controllers/doc-hover.render-controller.ts
@@ -34,7 +34,7 @@ export class DocHoverRenderController extends Disposable implements IRenderModul
private _initPointerDown() {
this.disposeWithMe(
fromEventSubject(this._context.scene.onPointerMove$)
- .pipe(debounceTime(200))
+ .pipe(debounceTime(100))
.subscribe((evt) => {
this._docHoverManagerService.onMouseMove(evt);
})
diff --git a/packages/docs-ui/src/docs-ui-plugin.ts b/packages/docs-ui/src/docs-ui-plugin.ts
index 39186ce30b..ce0a271ce0 100644
--- a/packages/docs-ui/src/docs-ui-plugin.ts
+++ b/packages/docs-ui/src/docs-ui-plugin.ts
@@ -61,6 +61,7 @@ import { DocHoverManagerService } from './services/doc-hover-manager.service';
import { DocHoverRenderController } from './controllers/render-controllers/doc-hover.render-controller';
import { DocAutoFormatController } from './controllers/doc-auto-format.controller';
import { ShiftTabShortCut } from './shortcuts/format.shortcut';
+import { DocChecklistRenderController } from './controllers/render-controllers/doc-checklist.render-controller';
import { DocParagraphSettingController } from './controllers/doc-paragraph-setting.controller';
import { DocParagraphSettingPanelOperation } from './commands/operations/doc-paragraph-setting-panel.operation';
@@ -192,6 +193,7 @@ export class UniverDocsUIPlugin extends Plugin {
[DocResizeRenderController],
[DocHoverRenderController],
[DocContextMenuRenderController],
+ [DocChecklistRenderController],
] as Dependency[]).forEach((m) => {
this._renderManagerSrv.registerRenderModule(UniverInstanceType.UNIVER_DOC, m);
});
diff --git a/packages/docs-ui/src/locale/en-US.ts b/packages/docs-ui/src/locale/en-US.ts
index 81319a7fc0..9b87a1affc 100644
--- a/packages/docs-ui/src/locale/en-US.ts
+++ b/packages/docs-ui/src/locale/en-US.ts
@@ -45,6 +45,7 @@ const locale: typeof zhCN = {
resetColor: 'Reset',
order: 'Ordered list',
unorder: 'Unordered list',
+ checklist: 'Task list',
alignLeft: 'Align Left',
alignCenter: 'Align Center',
alignRight: 'Align Right',
diff --git a/packages/docs-ui/src/locale/ru-RU.ts b/packages/docs-ui/src/locale/ru-RU.ts
index a4651ef29e..c86c3332d7 100644
--- a/packages/docs-ui/src/locale/ru-RU.ts
+++ b/packages/docs-ui/src/locale/ru-RU.ts
@@ -50,6 +50,7 @@ const locale: typeof zhCN = {
alignRight: 'Выровнять по правому краю',
alignJustify: 'Выровнять по ширине',
headerFooter: 'Header & Footer',
+ checklist: 'Task list',
},
table: {
insert: 'Insert',
diff --git a/packages/docs-ui/src/locale/vi-VN.ts b/packages/docs-ui/src/locale/vi-VN.ts
index 8e17ff9c5d..b977ad99b6 100644
--- a/packages/docs-ui/src/locale/vi-VN.ts
+++ b/packages/docs-ui/src/locale/vi-VN.ts
@@ -50,6 +50,7 @@ const locale: typeof zhCN = {
alignRight: 'Căn phải',
alignJustify: 'Căn đều hai bên',
headerFooter: 'Đầu trang và chân trang',
+ checklist: 'Task list',
},
table: {
insert: 'Insert',
diff --git a/packages/docs-ui/src/locale/zh-CN.ts b/packages/docs-ui/src/locale/zh-CN.ts
index 3a45b3b287..98f3307757 100644
--- a/packages/docs-ui/src/locale/zh-CN.ts
+++ b/packages/docs-ui/src/locale/zh-CN.ts
@@ -43,6 +43,7 @@ const locale = {
resetColor: '重置颜色',
order: '有序列表',
unorder: '无序列表',
+ checklist: '任务列表',
alignLeft: '左对齐',
alignCenter: '居中对齐',
alignRight: '右对齐',
diff --git a/packages/docs-ui/src/services/doc-hover-manager.service.ts b/packages/docs-ui/src/services/doc-hover-manager.service.ts
index 946a583fa8..09f9c3f55d 100644
--- a/packages/docs-ui/src/services/doc-hover-manager.service.ts
+++ b/packages/docs-ui/src/services/doc-hover-manager.service.ts
@@ -14,20 +14,24 @@
* limitations under the License.
*/
-import type { DocumentDataModel, ICustomRange, Nullable } from '@univerjs/core';
+import type { DocumentDataModel, ICustomRange, IParagraph, Nullable } from '@univerjs/core';
import { Disposable, IUniverInstanceService, UniverInstanceType } from '@univerjs/core';
import { DocSkeletonManagerService, VIEWPORT_KEY } from '@univerjs/docs';
import type { Documents, IMouseEvent, IPointerEvent, Viewport } from '@univerjs/engine-render';
-import { IRenderManagerService, PageLayoutType, Vector2 } from '@univerjs/engine-render';
-import { BehaviorSubject } from 'rxjs';
+import { getParagraphByGlyph, IRenderManagerService, PageLayoutType, Vector2 } from '@univerjs/engine-render';
+import { Subject } from 'rxjs';
+// TODO: this service need to be remove, calc cost to much time
export class DocHoverManagerService extends Disposable {
- private readonly _activeCustomRanges$ = new BehaviorSubject<ICustomRange[]>([]);
+ private readonly _activeCustomRanges$ = new Subject<ICustomRange[]>();
readonly activeCustomRanges$ = this._activeCustomRanges$.asObservable();
- private readonly _activeIndex$ = new BehaviorSubject<Nullable<number>>(null);
+ private readonly _activeIndex$ = new Subject<Nullable<number>>();
readonly activeIndex$ = this._activeIndex$.asObservable();
+ private readonly _bullet$ = new Subject<Nullable<IParagraph>>();
+ readonly bullet$ = this._bullet$.asObservable();
+
private _scrolling = false;
constructor(
@@ -86,23 +90,29 @@ export class DocHoverManagerService extends Disposable {
if (node && node.node) {
const left = node.node.left + pageMarginLeft;
const right = node.node.left + node.node.width + pageMarginLeft;
- if (coord.x < left || coord.x > right) {
+ let index = node.node.parent!.st! + node.node.parent!.glyphGroup.indexOf(node.node)!;
+ const paragraph = getParagraphByGlyph(node.node, document.getBody());
+ if (paragraph && paragraph.bullet && index === paragraph.paragraphStart) {
+ this._bullet$.next(paragraph);
this._activeIndex$.next(null);
this._activeCustomRanges$.next([]);
return;
}
- const index = node.node.parent!.st! + node.node.parent!.glyphGroup.indexOf(node.node)!;
- if (index !== this._activeIndex$.value) {
- this._activeIndex$.next(index);
+ if (coord.x < left || coord.x > right) {
+ this._activeIndex$.next(null);
+ this._activeCustomRanges$.next([]);
+ this._bullet$.next(null);
+ return;
}
- const ranges = document.getCustomRanges()?.filter((range) => range.startIndex <= index && range.endIndex >= index) ?? [];
- const currentRanges = this._activeCustomRanges$.value;
- if (currentRanges.length === ranges.length && currentRanges.every((range, i) => range.rangeId === ranges[i].rangeId)) {
- return;
+ if (paragraph && paragraph.bullet) {
+ index = index - 1;
}
+ this._bullet$.next(null);
+ this._activeIndex$.next(index);
+ const ranges = document.getCustomRanges()?.filter((range) => range.startIndex <= index && range.endIndex >= index) ?? [];
this._activeCustomRanges$.next(ranges);
}
}
diff --git a/packages/docs/src/commands/commands/auto-format.command.ts b/packages/docs/src/commands/commands/auto-format.command.ts
index 819dbfa8f6..50868cffab 100644
--- a/packages/docs/src/commands/commands/auto-format.command.ts
+++ b/packages/docs/src/commands/commands/auto-format.command.ts
@@ -33,14 +33,14 @@ export const TabCommand: ICommand<ITabCommandParams> = {
},
};
-const SpaceCommandId = 'doc.command.space';
+const AfterSpaceCommandId = 'doc.command.after-space';
-export const SpaceCommand: ICommand = {
- id: SpaceCommandId,
+export const AfterSpaceCommand: ICommand = {
+ id: AfterSpaceCommandId,
type: CommandType.COMMAND,
handler(accessor) {
const autoFormatService = accessor.get(DocAutoFormatService);
- const mutations = autoFormatService.onAutoFormat(SpaceCommand.id);
+ const mutations = autoFormatService.onAutoFormat(AfterSpaceCommand.id);
return sequenceExecute(mutations, accessor.get(ICommandService)).result;
},
};
diff --git a/packages/docs/src/commands/commands/break-line.command.ts b/packages/docs/src/commands/commands/break-line.command.ts
index d0b584963d..6a3fae6e7f 100644
--- a/packages/docs/src/commands/commands/break-line.command.ts
+++ b/packages/docs/src/commands/commands/break-line.command.ts
@@ -15,7 +15,7 @@
*/
import type { ICommand, IParagraph } from '@univerjs/core';
-import { CommandType, DataStreamTreeTokenType, getBodySlice, ICommandService, IUniverInstanceService, normalizeBody, Tools, updateAttributeByInsert } from '@univerjs/core';
+import { BooleanNumber, CommandType, DataStreamTreeTokenType, getBodySlice, ICommandService, IUniverInstanceService, normalizeBody, PresetListType, Tools, updateAttributeByInsert } from '@univerjs/core';
import { TextSelectionManagerService } from '../../services/text-selection-manager.service';
import { getInsertSelection } from '../../basics/selection';
@@ -41,10 +41,20 @@ export function generateParagraphs(dataStream: string, prevParagraph?: IParagrap
for (const paragraph of paragraphs) {
if (prevParagraph.bullet) {
paragraph.bullet = Tools.deepClone(prevParagraph.bullet);
+ if (paragraph.bullet.listType === PresetListType.CHECK_LIST_CHECKED) {
+ paragraph.bullet.listType = PresetListType.CHECK_LIST;
+ }
}
if (prevParagraph.paragraphStyle) {
paragraph.paragraphStyle = Tools.deepClone(prevParagraph.paragraphStyle);
+ if (prevParagraph.bullet?.listType === PresetListType.CHECK_LIST_CHECKED) {
+ if (paragraph.paragraphStyle?.textStyle) {
+ paragraph.paragraphStyle.textStyle.st = {
+ s: BooleanNumber.FALSE,
+ };
+ }
+ }
}
}
}
diff --git a/packages/docs/src/commands/commands/list.command.ts b/packages/docs/src/commands/commands/list.command.ts
index 0de509acc3..bb9fa98fec 100644
--- a/packages/docs/src/commands/commands/list.command.ts
+++ b/packages/docs/src/commands/commands/list.command.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import type { ICommand, IListData, IMutationInfo, IParagraph, ISectionBreak } from '@univerjs/core';
+import type { ICommand, IListData, IMutationInfo, IParagraph, IParagraphRange, ISectionBreak } from '@univerjs/core';
import {
CommandType,
GridType,
@@ -44,10 +44,8 @@ interface IListOperationCommandParams {
export const ListOperationCommand: ICommand<IListOperationCommandParams> = {
id: 'doc.command.list-operation',
-
type: CommandType.COMMAND,
-
- // eslint-disable-next-line max-lines-per-function
+ // eslint-disable-next-line max-lines-per-function, complexity
handler: (accessor, params: IListOperationCommandParams) => {
const textSelectionManagerService = accessor.get(TextSelectionManagerService);
const univerInstanceService = accessor.get(IUniverInstanceService);
@@ -90,10 +88,14 @@ export const ListOperationCommand: ICommand<IListOperationCommandParams> = {
if (prevParagraph && prevParagraph.bullet && prevParagraph.bullet.listType.indexOf(listType) === 0) {
listId = prevParagraph.bullet.listId;
- listType = prevParagraph.bullet.listType;
+ if (listType !== PresetListType.CHECK_LIST) {
+ listType = prevParagraph.bullet.listType;
+ }
} else if (nextParagraph && nextParagraph.bullet && nextParagraph.bullet.listType.indexOf(listType) === 0) {
listId = nextParagraph.bullet.listId;
- listType = nextParagraph.bullet.listType;
+ if (listType !== PresetListType.CHECK_LIST) {
+ listType = nextParagraph.bullet.listType;
+ }
}
}
@@ -127,8 +129,13 @@ export const ListOperationCommand: ICommand<IListOperationCommandParams> = {
const { indentFirstLine, snapToGrid, indentStart } = paragraphStyle;
const paragraphProperties = lists[listType].nestingLevel[0].paragraphProperties || {};
const { hanging: listHanging, indentStart: listIndentStart } = paragraphProperties;
+ const bulletParagraphTextStyle = paragraphProperties.textStyle;
const { charSpace, gridType } = findNearestSectionBreak(startIndex, sectionBreaks) || { charSpace: 0, gridType: GridType.LINES };
-
+ const bulletParagraphTextStyleEmpty = Object.keys(bulletParagraphTextStyle ?? {})
+ .reduce((acc: Record<string, any>, key) => {
+ acc[key] = undefined;
+ return acc;
+ }, {});
const charSpaceApply = getCharSpaceApply(charSpace, defaultTabStop, gridType, snapToGrid);
textX.push({
@@ -149,6 +156,10 @@ export const ListOperationCommand: ICommand<IListOperationCommandParams> = {
...paragraphStyle,
hanging: undefined,
indentStart: indentStart ? { v: Math.max(0, getNumberUnitValue(indentStart, charSpaceApply) + getNumberUnitValue(listHanging, charSpaceApply) - getNumberUnitValue(listIndentStart, charSpaceApply)) } : undefined,
+ textStyle: {
+ ...paragraphStyle.textStyle,
+ ...bulletParagraphTextStyleEmpty,
+ },
},
startIndex: 0,
}
@@ -156,6 +167,10 @@ export const ListOperationCommand: ICommand<IListOperationCommandParams> = {
startIndex: 0,
paragraphStyle: {
...paragraphStyle,
+ textStyle: {
+ ...paragraphStyle.textStyle,
+ ...bulletParagraphTextStyle,
+ },
indentFirstLine: undefined,
hanging: listHanging,
indentStart: { v: getNumberUnitValue(listIndentStart, charSpaceApply) - getNumberUnitValue(listHanging, charSpaceApply) + getNumberUnitValue(indentFirstLine, charSpaceApply) + getNumberUnitValue(indentStart, charSpaceApply) },
@@ -256,6 +271,7 @@ export const ChangeListTypeCommand: ICommand<IChangeListTypeCommandParams> = {
const { startIndex, paragraphStyle = {} } = paragraph;
const { indentFirstLine, snapToGrid, indentStart } = paragraphStyle;
const paragraphProperties = lists[listType].nestingLevel[0].paragraphProperties || {};
+ const bulletParagraphTextStyle = paragraphProperties.textStyle;
const { hanging: listHanging, indentStart: listIndentStart } = paragraphProperties;
const { charSpace, gridType } = findNearestSectionBreak(startIndex, sectionBreaks) || { charSpace: 0, gridType: GridType.LINES };
@@ -277,6 +293,10 @@ export const ChangeListTypeCommand: ICommand<IChangeListTypeCommandParams> = {
startIndex: 0,
paragraphStyle: {
...paragraphStyle,
+ textStyle: {
+ ...paragraphStyle.textStyle,
+ ...bulletParagraphTextStyle,
+ },
indentFirstLine: undefined,
hanging: listHanging,
indentStart: { v: getNumberUnitValue(listIndentStart, charSpaceApply) - getNumberUnitValue(listHanging, charSpaceApply) + getNumberUnitValue(indentFirstLine, charSpaceApply) + getNumberUnitValue(indentStart, charSpaceApply) },
@@ -460,6 +480,134 @@ export const BulletListCommand: ICommand<IBulletListCommandParams> = {
},
};
+export const CheckListCommand: ICommand<IBulletListCommandParams> = {
+ id: 'doc.command.check-list',
+ type: CommandType.COMMAND,
+ handler: (accessor, params) => {
+ const commandService = accessor.get(ICommandService);
+
+ if (params?.value) {
+ return commandService.syncExecuteCommand(ChangeListTypeCommand.id, {
+ listType: params.value,
+ });
+ }
+
+ return commandService.syncExecuteCommand(ListOperationCommand.id, {
+ listType: PresetListType.CHECK_LIST,
+ });
+ },
+};
+
+export interface IToggleCheckListCommandParams {
+ index: number;
+}
+
+export const ToggleCheckListCommand: ICommand<IToggleCheckListCommandParams> = {
+ id: 'doc.command.toggle-check-list',
+ type: CommandType.COMMAND,
+ // eslint-disable-next-line max-lines-per-function
+ handler: (accessor, params) => {
+ if (!params) {
+ return false;
+ }
+ const textSelectionManagerService = accessor.get(TextSelectionManagerService);
+ const univerInstanceService = accessor.get(IUniverInstanceService);
+ const commandService = accessor.get(ICommandService);
+ const { index } = params;
+
+ const docDataModel = univerInstanceService.getCurrentUniverDocInstance();
+ if (docDataModel == null) {
+ return false;
+ }
+
+ // const { segmentId } = activeRange;
+
+ const selections = textSelectionManagerService.getCurrentTextRanges() ?? [];
+ const paragraphs = docDataModel.getBody()?.paragraphs;
+ const serializedSelections = selections.map(serializeDocRange);
+ if (paragraphs == null) {
+ return false;
+ }
+
+ const currentParagraph = paragraphs.find((p) => p.startIndex === index);
+ const unitId = docDataModel.getUnitId();
+ if (!currentParagraph?.bullet || currentParagraph.bullet.listType.indexOf(PresetListType.CHECK_LIST) === -1) {
+ return false;
+ }
+
+ const doMutation: IMutationInfo<IRichTextEditingMutationParams> = {
+ id: RichTextEditingMutation.id,
+ params: {
+ unitId,
+ actions: [],
+ textRanges: serializedSelections,
+ },
+ };
+
+ const memoryCursor = new MemoryCursor();
+ memoryCursor.reset();
+
+ const textX = new TextX();
+ const jsonX = JSONX.getInstance();
+
+ const customLists = docDataModel.getSnapshot().lists ?? {};
+
+ const lists: Record<string, IListData> = {
+ ...PRESET_LIST_TYPE,
+ ...customLists,
+ };
+
+ const { startIndex, paragraphStyle = {} } = currentParagraph;
+ const listType = currentParagraph.bullet.listType === PresetListType.CHECK_LIST ?
+ PresetListType.CHECK_LIST_CHECKED
+ : PresetListType.CHECK_LIST;
+ const paragraphProperties = lists[listType].nestingLevel[0].paragraphProperties || {};
+ const bulletParagraphTextStyle = paragraphProperties.textStyle;
+
+ textX.push({
+ t: TextXActionType.RETAIN,
+ len: startIndex - memoryCursor.cursor,
+ });
+
+ textX.push({
+ t: TextXActionType.RETAIN,
+ len: 1,
+ body: {
+ dataStream: '',
+ paragraphs: [
+ {
+ ...currentParagraph,
+ paragraphStyle: {
+ ...paragraphStyle,
+ textStyle: {
+ ...paragraphStyle.textStyle,
+ ...bulletParagraphTextStyle,
+ },
+ },
+ startIndex: 0,
+ bullet: {
+ ...currentParagraph.bullet,
+ listType,
+ },
+ },
+ ],
+ },
+ coverType: UpdateDocsAttributeType.REPLACE,
+ });
+
+ memoryCursor.moveCursorTo(startIndex + 1);
+
+ const path = getRichTextEditPath(docDataModel);
+ doMutation.params.actions = jsonX.editOp(textX.serialize(), path);
+ const result = commandService.syncExecuteCommand<
+ IRichTextEditingMutationParams,
+ IRichTextEditingMutationParams
+ >(doMutation.id, doMutation.params);
+
+ return Boolean(result);
+ },
+};
+
interface IOrderListCommandParams {
value?: PresetListType;
}
@@ -483,6 +631,126 @@ export const OrderListCommand: ICommand<IOrderListCommandParams> = {
},
};
+interface IQuickListCommandParams {
+ listType: PresetListType;
+ paragraph: IParagraphRange;
+}
+
+export const QuickListCommand: ICommand<IQuickListCommandParams> = {
+ id: 'doc.command.quick-list',
+ type: CommandType.COMMAND,
+ // eslint-disable-next-line max-lines-per-function
+ handler(accessor, params) {
+ if (!params) {
+ return false;
+ }
+ const textSelectionManagerService = accessor.get(TextSelectionManagerService);
+ const univerInstanceService = accessor.get(IUniverInstanceService);
+ const commandService = accessor.get(ICommandService);
+ const docDataModel = univerInstanceService.getCurrentUniverDocInstance();
+ const activeRange = textSelectionManagerService.getActiveTextRange();
+ if (docDataModel == null || activeRange == null) {
+ return false;
+ }
+
+ const { segmentId } = activeRange;
+ const { listType, paragraph } = params;
+ const { paragraphStart, paragraphEnd } = paragraph;
+ // const selection =
+ const textX = new TextX();
+ const jsonX = JSONX.getInstance();
+ const { defaultTabStop = 36 } = docDataModel.getSnapshot().documentStyle;
+ const sectionBreaks = docDataModel.getSelfOrHeaderFooterModel(segmentId).getBody()?.sectionBreaks ?? [];
+ const { startIndex, paragraphStyle = {} } = paragraph;
+ const { indentFirstLine, snapToGrid, indentStart } = paragraphStyle;
+ const paragraphProperties = PRESET_LIST_TYPE[listType].nestingLevel[0].paragraphProperties || {};
+ const { hanging: listHanging, indentStart: listIndentStart } = paragraphProperties;
+ const bulletParagraphTextStyle = paragraphProperties.textStyle;
+ const { charSpace, gridType } = findNearestSectionBreak(startIndex, sectionBreaks) || { charSpace: 0, gridType: GridType.LINES };
+ const charSpaceApply = getCharSpaceApply(charSpace, defaultTabStop, gridType, snapToGrid);
+
+ const ID_LENGTH = 6;
+ let listId = Tools.generateRandomId(ID_LENGTH);
+ const paragraphs = docDataModel.getBody()?.paragraphs ?? [];
+
+ const curIndex = paragraphs.findIndex((i) => i.startIndex === paragraph.startIndex);
+ const prevParagraph = paragraphs[curIndex - 1];
+ const nextParagraph = paragraphs[curIndex + 1];
+
+ if (prevParagraph && prevParagraph.bullet && prevParagraph.bullet.listType.indexOf(listType) === 0) {
+ listId = prevParagraph.bullet.listId;
+ } else if (nextParagraph && nextParagraph.bullet && nextParagraph.bullet.listType.indexOf(listType) === 0) {
+ listId = nextParagraph.bullet.listId;
+ }
+
+ const doMutation: IMutationInfo<IRichTextEditingMutationParams> = {
+ id: RichTextEditingMutation.id,
+ params: {
+ unitId: docDataModel.getUnitId(),
+ actions: [],
+ textRanges: [{
+ startOffset: paragraphStart,
+ endOffset: paragraphStart,
+ collapsed: true,
+ }],
+ },
+ };
+
+ textX.push({
+ t: TextXActionType.RETAIN,
+ len: paragraphStart,
+ });
+
+ textX.push({
+ t: TextXActionType.DELETE,
+ len: paragraphEnd - paragraphStart,
+ line: 1,
+ });
+
+ textX.push({
+ t: TextXActionType.RETAIN,
+ len: 1,
+ body: {
+ dataStream: '',
+ paragraphs: [
+ {
+ startIndex: 0,
+ paragraphStyle: {
+ ...paragraphStyle,
+ textStyle: {
+ ...paragraphStyle.textStyle,
+ ...bulletParagraphTextStyle,
+ },
+ indentFirstLine: undefined,
+ hanging: listHanging,
+ indentStart: { v: getNumberUnitValue(listIndentStart, charSpaceApply) - getNumberUnitValue(listHanging, charSpaceApply) + getNumberUnitValue(indentFirstLine, charSpaceApply) + getNumberUnitValue(indentStart, charSpaceApply) },
+ },
+ bullet: {
+ ...(paragraph.bullet ?? {
+ nestingLevel: 0,
+ textStyle: {
+ fs: 20,
+ },
+ }),
+ listType,
+ listId,
+ },
+ },
+ ],
+ },
+ });
+ const path = getRichTextEditPath(docDataModel, segmentId);
+ doMutation.params.actions = jsonX.editOp(textX.serialize(), path);
+
+ const result = commandService.syncExecuteCommand<
+ IRichTextEditingMutationParams,
+ IRichTextEditingMutationParams
+ >(doMutation.id, doMutation.params);
+
+ return Boolean(result);
+ },
+};
+
export function getParagraphsInRange(activeRange: IActiveTextRange, paragraphs: IParagraph[]) {
const { startOffset, endOffset } = activeRange;
const results: IParagraph[] = [];
diff --git a/packages/docs/src/controllers/normal-input.controller.ts b/packages/docs/src/controllers/normal-input.controller.ts
index 41c9db1e45..7e25101ac2 100644
--- a/packages/docs/src/controllers/normal-input.controller.ts
+++ b/packages/docs/src/controllers/normal-input.controller.ts
@@ -21,6 +21,7 @@ import type { Subscription } from 'rxjs';
import { InsertCommand } from '../commands/commands/core-editing.command';
import { DocSkeletonManagerService } from '../services/doc-skeleton-manager.service';
+import { AfterSpaceCommand } from '../commands/commands/auto-format.command';
@OnLifecycle(LifecycleStages.Rendered, NormalInputController)
export class NormalInputController extends Disposable {
@@ -98,6 +99,11 @@ export class NormalInputController extends Disposable {
range: activeRange,
segmentId,
});
+
+ // Space
+ if (content === ' ') {
+ await this._commandService.executeCommand(AfterSpaceCommand.id);
+ }
});
}
}
diff --git a/packages/docs/src/doc-plugin.ts b/packages/docs/src/doc-plugin.ts
index 02e85016db..a9b8b4fff2 100644
--- a/packages/docs/src/doc-plugin.ts
+++ b/packages/docs/src/doc-plugin.ts
@@ -41,7 +41,7 @@ import {
SetInlineFormatTextColorCommand,
SetInlineFormatUnderlineCommand,
} from './commands/commands/inline-format.command';
-import { BulletListCommand, ChangeListNestingLevelCommand, ChangeListTypeCommand, ListOperationCommand, OrderListCommand } from './commands/commands/list.command';
+import { BulletListCommand, ChangeListNestingLevelCommand, ChangeListTypeCommand, CheckListCommand, ListOperationCommand, OrderListCommand, QuickListCommand, ToggleCheckListCommand } from './commands/commands/list.command';
import { CoverContentCommand, ReplaceContentCommand } from './commands/commands/replace-content.command';
import { SetDocZoomRatioCommand } from './commands/commands/set-doc-zoom-ratio.command';
import { RichTextEditingMutation } from './commands/mutations/core-editing.mutation';
@@ -60,7 +60,7 @@ import { DocCustomRangeService } from './services/doc-custom-range.service';
import { DocCustomRangeController } from './controllers/custom-range.controller';
import { DocsRenameMutation } from './commands/mutations/docs-rename.mutation';
import { DocAutoFormatService } from './services/doc-auto-format.service';
-import { EnterCommand, SpaceCommand, TabCommand } from './commands/commands/auto-format.command';
+import { AfterSpaceCommand, EnterCommand, TabCommand } from './commands/commands/auto-format.command';
import { CreateDocTableCommand } from './commands/commands/table/doc-table-create.command';
import { DocTableDeleteColumnsCommand, DocTableDeleteRowsCommand, DocTableDeleteTableCommand } from './commands/commands/table/doc-table-delete.command';
import { DocTableInsertColumnCommand, DocTableInsertColumnLeftCommand, DocTableInsertColumnRightCommand, DocTableInsertRowAboveCommand, DocTableInsertRowBellowCommand, DocTableInsertRowCommand } from './commands/commands/table/doc-table-insert.command';
@@ -141,10 +141,13 @@ export class UniverDocsPlugin extends Plugin {
DocTableShiftTabCommand,
DocsRenameMutation,
TabCommand,
- SpaceCommand,
+ AfterSpaceCommand,
EnterCommand,
ChangeListNestingLevelCommand,
ChangeListTypeCommand,
+ CheckListCommand,
+ ToggleCheckListCommand,
+ QuickListCommand,
] as ICommand[]
).forEach((command) => {
this._injector.get(ICommandService).registerCommand(command);
diff --git a/packages/docs/src/index.ts b/packages/docs/src/index.ts
index 8063916357..1527fe912e 100644
--- a/packages/docs/src/index.ts
+++ b/packages/docs/src/index.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-export { getParagraphsInRange } from './commands/commands/list.command';
+export { getParagraphsInRange, getParagraphsInRanges } from './commands/commands/list.command';
export { replaceSelectionFactory } from './basics/replace';
export { getSelectionText, getDeleteSelection, getInsertSelection, isSegmentIntersects } from './basics/selection';
export type { IDocObjectParam } from './basics/component-tools';
@@ -58,7 +58,16 @@ export {
ResetInlineFormatTextBackgroundColorCommand,
SetInlineFormatCommand,
} from './commands/commands/inline-format.command';
-export { ListOperationCommand, BulletListCommand, OrderListCommand, ChangeListNestingLevelCommand, ChangeListTypeCommand, getParagraphsInRanges } from './commands/commands/list.command';
+export {
+ ListOperationCommand,
+ BulletListCommand,
+ OrderListCommand,
+ ChangeListNestingLevelCommand,
+ ChangeListTypeCommand,
+ CheckListCommand,
+ ToggleCheckListCommand,
+ QuickListCommand,
+} from './commands/commands/list.command';
export {
AlignOperationCommand,
AlignLeftCommand,
@@ -68,7 +77,7 @@ export {
} from './commands/commands/paragraph-align.command';
export { ReplaceContentCommand, CoverContentCommand } from './commands/commands/replace-content.command';
export { SetDocZoomRatioCommand } from './commands/commands/set-doc-zoom-ratio.command';
-export { SpaceCommand, TabCommand, EnterCommand, type ITabCommandParams } from './commands/commands/auto-format.command';
+export { AfterSpaceCommand, TabCommand, EnterCommand, type ITabCommandParams } from './commands/commands/auto-format.command';
export {
RichTextEditingMutation,
type IRichTextEditingMutationParams,
diff --git a/packages/docs/src/services/doc-auto-format.service.ts b/packages/docs/src/services/doc-auto-format.service.ts
index 838863bed6..b2ffdd85d9 100644
--- a/packages/docs/src/services/doc-auto-format.service.ts
+++ b/packages/docs/src/services/doc-auto-format.service.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import type { DocumentDataModel, ICommandInfo, ICustomRange, IDisposable, IParagraph, IParagrapRange, ITextRange, Nullable } from '@univerjs/core';
+import type { DocumentDataModel, ICommandInfo, ICustomRange, IDisposable, IParagraph, IParagraphRange, ITextRange, Nullable } from '@univerjs/core';
import { Disposable, Inject, IUniverInstanceService, toDisposable, UniverInstanceType } from '@univerjs/core';
import { getCustomRangesIntesetsWithRange } from '../basics/custom-range';
import { TextSelectionManagerService } from './text-selection-manager.service';
@@ -29,7 +29,7 @@ export interface IAutoFormatContext {
/**
* selection relative paragraphs
*/
- paragraphs: IParagrapRange[];
+ paragraphs: IParagraphRange[];
/**
* selection relative custom ranges
*/
@@ -48,7 +48,7 @@ export interface IAutoFormat {
function getParagraphsInRange(activeRange: ITextRange, paragraphs: IParagraph[]) {
const { startOffset, endOffset } = activeRange;
- const results: IParagrapRange[] = [];
+ const results: IParagraphRange[] = [];
let start = -1;
diff --git a/packages/drawing-ui/package.json b/packages/drawing-ui/package.json
index 887115728a..4803586f68 100644
--- a/packages/drawing-ui/package.json
+++ b/packages/drawing-ui/package.json
@@ -73,7 +73,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
diff --git a/packages/drawing/package.json b/packages/drawing/package.json
index 43a3042db2..a1e9c91609 100644
--- a/packages/drawing/package.json
+++ b/packages/drawing/package.json
@@ -62,7 +62,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"ot-json1": "^1.0.2"
},
"devDependencies": {
diff --git a/packages/engine-render/src/basics/document-node-tools.ts b/packages/engine-render/src/basics/document-node-tools.ts
index 829a48e120..437e973d66 100644
--- a/packages/engine-render/src/basics/document-node-tools.ts
+++ b/packages/engine-render/src/basics/document-node-tools.ts
@@ -100,9 +100,15 @@ export function getParagraphByGlyph(glyph: Nullable<IDocumentSkeletonGlyph>, bod
return;
}
- for (const paragraph of paragraphs) {
+ for (let i = 0; i < paragraphs.length; i++) {
+ const paragraph = paragraphs[i];
+ const prevParagraph = paragraphs[i - 1];
if (paragraph.startIndex === line.paragraphIndex) {
- return paragraph;
+ return {
+ ...paragraph,
+ paragraphStart: (prevParagraph?.startIndex ?? -1) + 1,
+ paragraphEnd: paragraph.startIndex,
+ };
}
}
}
diff --git a/packages/engine-render/src/components/docs/extensions/font-and-base-line.ts b/packages/engine-render/src/components/docs/extensions/font-and-base-line.ts
index 384c7f9b17..84b9480601 100644
--- a/packages/engine-render/src/components/docs/extensions/font-and-base-line.ts
+++ b/packages/engine-render/src/components/docs/extensions/font-and-base-line.ts
@@ -24,6 +24,7 @@ import { Vector2 } from '../../../basics/vector2';
import type { UniverRenderingContext } from '../../../context';
import { DocumentsSpanAndLineExtensionRegistry } from '../../extension';
import { docExtension } from '../doc-extension';
+import { Checkbox } from '../../../shape';
const UNIQUE_KEY = 'DefaultDocsFontAndBaseLineExtension';
@@ -105,7 +106,19 @@ export class FontAndBaseLine extends docExtension {
ctx.fillText(content, 0, 0);
ctx.restore();
} else {
- ctx.fillText(content, spanPointWithFont.x, spanPointWithFont.y);
+ if (content === '\u2610' || content === '\u2611') {
+ ctx.save();
+ const size = glyph.ts?.fs ?? 16;
+ ctx.translate(spanStartPoint.x, spanStartPoint.y + centerPoint.y - size);
+ Checkbox.drawWith(ctx, {
+ width: size,
+ height: size,
+ checked: content === '\u2611',
+ });
+ ctx.restore();
+ } else {
+ ctx.fillText(content, spanPointWithFont.x, spanPointWithFont.y);
+ }
}
}
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 144bb4930d..499058a653 100644
--- a/packages/engine-render/src/components/docs/layout/model/glyph.ts
+++ b/packages/engine-render/src/components/docs/layout/model/glyph.ts
@@ -279,7 +279,10 @@ export function createSkeletonBulletGlyph(
return {
content,
- ts: textStyle,
+ ts: {
+ ...glyph.ts,
+ ...textStyle,
+ },
fontStyle,
width,
xOffset: 0,
diff --git a/packages/engine-render/src/components/docs/layout/tools.ts b/packages/engine-render/src/components/docs/layout/tools.ts
index 3104ca86bb..7d1ed9ae11 100644
--- a/packages/engine-render/src/components/docs/layout/tools.ts
+++ b/packages/engine-render/src/components/docs/layout/tools.ts
@@ -826,8 +826,14 @@ export function getFontCreateConfig(
return cache;
}
- const { snapToGrid = BooleanNumber.TRUE } = paragraphStyle;
- textStyle = { ...documentTextStyle, ...textStyle, ...customDecorationStyle, ...customRangeStyle };
+ const { snapToGrid = BooleanNumber.TRUE, textStyle: paragraphStyleTextStyle } = paragraphStyle;
+ textStyle = {
+ ...documentTextStyle,
+ ...textStyle,
+ ...customDecorationStyle,
+ ...customRangeStyle,
+ ...paragraphStyleTextStyle,
+ };
const fontStyle = getFontStyleString(textStyle, localeService);
@@ -848,6 +854,7 @@ export function getFontCreateConfig(
};
if (!hasAddonStyle) {
+ // TODO: cache should more precisely, take custom-range, custom-decroation, paragraphStyle into considering.
fontCreateConfigCache.setValue(st, ed, result);
}
diff --git a/packages/engine-render/src/components/docs/text-selection/text-selection-render-manager.ts b/packages/engine-render/src/components/docs/text-selection/text-selection-render-manager.ts
index 3f97f0656e..46b52b4fa2 100644
--- a/packages/engine-render/src/components/docs/text-selection/text-selection-render-manager.ts
+++ b/packages/engine-render/src/components/docs/text-selection/text-selection-render-manager.ts
@@ -276,7 +276,7 @@ export class TextSelectionRenderManager extends RxDisposable implements ITextSel
}
setCursorManually(evtOffsetX: number, evtOffsetY: number) {
- const startNode = this._findNodeByCoord(evtOffsetX, evtOffsetY, {
+ const startNode = this.findNodeByCoord(evtOffsetX, evtOffsetY, {
strict: true,
segmentId: this._currentSegmentId,
segmentPage: this._currentSegmentPage,
@@ -378,7 +378,7 @@ export class TextSelectionRenderManager extends RxDisposable implements ITextSel
const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
- const startNode = this._findNodeByCoord(evtOffsetX, evtOffsetY, {
+ const startNode = this.findNodeByCoord(evtOffsetX, evtOffsetY, {
strict: false,
segmentId: this._currentSegmentId,
segmentPage: this._currentSegmentPage,
@@ -440,7 +440,7 @@ export class TextSelectionRenderManager extends RxDisposable implements ITextSel
const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
- const startNode = this._findNodeByCoord(evtOffsetX, evtOffsetY, {
+ const startNode = this.findNodeByCoord(evtOffsetX, evtOffsetY, {
strict: false,
segmentId: this._currentSegmentId,
segmentPage: this._currentSegmentPage,
@@ -479,7 +479,7 @@ export class TextSelectionRenderManager extends RxDisposable implements ITextSel
const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
- const startNode = this._findNodeByCoord(evtOffsetX, evtOffsetY, {
+ const startNode = this.findNodeByCoord(evtOffsetX, evtOffsetY, {
strict: false,
segmentId: this._currentSegmentId,
segmentPage: this._currentSegmentPage,
@@ -945,7 +945,7 @@ export class TextSelectionRenderManager extends RxDisposable implements ITextSel
return;
}
- const focusNode = this._findNodeByCoord(moveOffsetX, moveOffsetY, {
+ const focusNode = this.findNodeByCoord(moveOffsetX, moveOffsetY, {
strict: true,
segmentId: this._currentSegmentId,
segmentPage: this._currentSegmentPage,
@@ -1199,7 +1199,7 @@ export class TextSelectionRenderManager extends RxDisposable implements ITextSel
return documentTransform.clone().invert().applyPoint(originCoord);
}
- private _findNodeByCoord(evtOffsetX: number, evtOffsetY: number, restrictions: IFindNodeRestrictions) {
+ findNodeByCoord(evtOffsetX: number, evtOffsetY: number, restrictions: IFindNodeRestrictions) {
const coord = this._getTransformCoordForDocumentOffset(evtOffsetX, evtOffsetY);
if (coord == null) {
diff --git a/packages/find-replace/package.json b/packages/find-replace/package.json
index f0368f0759..4ad20261ec 100644
--- a/packages/find-replace/package.json
+++ b/packages/find-replace/package.json
@@ -73,7 +73,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@types/react": "^18.3.3",
diff --git a/packages/sheets-conditional-formatting-ui/package.json b/packages/sheets-conditional-formatting-ui/package.json
index c3a88ebf0a..565ce4b627 100644
--- a/packages/sheets-conditional-formatting-ui/package.json
+++ b/packages/sheets-conditional-formatting-ui/package.json
@@ -79,7 +79,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"@univerjs/protocol": "0.1.38",
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",
diff --git a/packages/sheets-data-validation/package.json b/packages/sheets-data-validation/package.json
index 3d4c0f0ab2..cae35754f5 100644
--- a/packages/sheets-data-validation/package.json
+++ b/packages/sheets-data-validation/package.json
@@ -78,7 +78,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"@univerjs/protocol": "0.1.38"
},
"devDependencies": {
diff --git a/packages/sheets-drawing-ui/package.json b/packages/sheets-drawing-ui/package.json
index 921763c061..d223cc447b 100644
--- a/packages/sheets-drawing-ui/package.json
+++ b/packages/sheets-drawing-ui/package.json
@@ -77,7 +77,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
diff --git a/packages/sheets-filter-ui/package.json b/packages/sheets-filter-ui/package.json
index b61ed89f4c..f45249ffce 100644
--- a/packages/sheets-filter-ui/package.json
+++ b/packages/sheets-filter-ui/package.json
@@ -76,7 +76,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"rc-virtual-list": "^3.14.5"
},
"devDependencies": {
diff --git a/packages/sheets-formula/package.json b/packages/sheets-formula/package.json
index 4726aed8dd..62c6202c55 100644
--- a/packages/sheets-formula/package.json
+++ b/packages/sheets-formula/package.json
@@ -77,7 +77,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@types/react": "^18.3.3",
diff --git a/packages/sheets-hyper-link-ui/package.json b/packages/sheets-hyper-link-ui/package.json
index 4e5029707d..025d95a1e9 100644
--- a/packages/sheets-hyper-link-ui/package.json
+++ b/packages/sheets-hyper-link-ui/package.json
@@ -80,7 +80,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"@univerjs/sheets-hyper-link": "workspace:*"
},
"devDependencies": {
diff --git a/packages/sheets-numfmt/package.json b/packages/sheets-numfmt/package.json
index 39c103ae91..eacbf066a5 100644
--- a/packages/sheets-numfmt/package.json
+++ b/packages/sheets-numfmt/package.json
@@ -76,7 +76,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@types/react": "^18.3.3",
diff --git a/packages/sheets-sort-ui/package.json b/packages/sheets-sort-ui/package.json
index 51669bdcee..648e290974 100644
--- a/packages/sheets-sort-ui/package.json
+++ b/packages/sheets-sort-ui/package.json
@@ -73,7 +73,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"rc-virtual-list": "^3.14.5"
},
"devDependencies": {
diff --git a/packages/sheets-thread-comment/package.json b/packages/sheets-thread-comment/package.json
index 97e0ab8740..126e73ca13 100644
--- a/packages/sheets-thread-comment/package.json
+++ b/packages/sheets-thread-comment/package.json
@@ -73,7 +73,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
diff --git a/packages/sheets-ui/package.json b/packages/sheets-ui/package.json
index 96e29b2ce3..5736cc03ba 100644
--- a/packages/sheets-ui/package.json
+++ b/packages/sheets-ui/package.json
@@ -78,7 +78,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"@univerjs/protocol": "0.1.38"
},
"devDependencies": {
diff --git a/packages/sheets-zen-editor/package.json b/packages/sheets-zen-editor/package.json
index e5d2372774..741fa2caf2 100644
--- a/packages/sheets-zen-editor/package.json
+++ b/packages/sheets-zen-editor/package.json
@@ -76,7 +76,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"@univerjs/sheets": "workspace:*"
},
"devDependencies": {
diff --git a/packages/slides-ui/package.json b/packages/slides-ui/package.json
index 7708211b7d..07d05063f4 100644
--- a/packages/slides-ui/package.json
+++ b/packages/slides-ui/package.json
@@ -78,7 +78,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70"
+ "@univerjs/icons": "^0.1.72"
},
"devDependencies": {
"@types/react": "^18.3.3",
diff --git a/packages/thread-comment-ui/package.json b/packages/thread-comment-ui/package.json
index 3b77971b68..0be99443d2 100644
--- a/packages/thread-comment-ui/package.json
+++ b/packages/thread-comment-ui/package.json
@@ -75,7 +75,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"@univerjs/protocol": "0.1.38"
},
"devDependencies": {
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 8de0996d0e..f8d711c913 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -76,7 +76,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.70",
+ "@univerjs/icons": "^0.1.72",
"localforage": "^1.10.0",
"rc-notification": "^5.6.0",
"rc-util": "^5.43.0"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0c601873aa..eda2130046 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.70
+ specifier: ^0.1.72
'@univerjs/rpc':
specifier: workspace:*
version: link:../packages/rpc
@@ -392,8 +392,8 @@ importers:
packages-experimental/uni-formula:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -462,8 +462,8 @@ importers:
packages-experimental/uniui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
rc-util:
specifier: ^5.43.0
@@ -647,8 +647,8 @@ importers:
specifier: ^4.1.13
version: 4.1.13
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
rc-dialog:
specifier: ^9.5.2
@@ -800,8 +800,8 @@ importers:
packages/docs-drawing-ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -891,8 +891,8 @@ importers:
specifier: workspace:*
version: link:../docs-ui
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -1027,8 +1027,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -1073,8 +1073,8 @@ importers:
packages/docs-ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.65
+ specifier: ^0.1.72
devDependencies:
'@types/react':
specifier: ^18.3.3
@@ -1122,8 +1122,8 @@ importers:
packages/drawing:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
ot-json1:
specifier: ^1.0.2
version: 1.0.2
@@ -1153,8 +1153,8 @@ importers:
packages/drawing-ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -1352,8 +1352,8 @@ importers:
packages/find-replace:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@types/react':
specifier: ^18.3.3
@@ -1517,8 +1517,8 @@ importers:
packages/sheets-conditional-formatting-ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
'@univerjs/protocol':
specifier: 0.1.38
version: 0.1.38(@grpc/[email protected])([email protected])
@@ -1602,8 +1602,8 @@ importers:
packages/sheets-data-validation:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
'@univerjs/protocol':
specifier: 0.1.38
version: 0.1.38(@grpc/[email protected])([email protected])
@@ -1697,8 +1697,8 @@ importers:
packages/sheets-drawing-ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -1779,8 +1779,8 @@ importers:
packages/sheets-filter-ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
rc-virtual-list:
specifier: ^3.14.5
@@ -1883,8 +1883,8 @@ importers:
packages/sheets-formula:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@types/react':
specifier: ^18.3.3
@@ -1984,8 +1984,8 @@ importers:
specifier: workspace:*
version: link:../design
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
'@univerjs/sheets-hyper-link':
specifier: workspace:*
version: link:../sheets-hyper-link
@@ -2039,8 +2039,8 @@ importers:
packages/sheets-numfmt:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@types/react':
specifier: ^18.3.3
@@ -2124,8 +2124,8 @@ importers:
specifier: workspace:*
version: link:../engine-formula
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
rc-virtual-list:
specifier: ^3.14.5
@@ -2182,8 +2182,8 @@ importers:
specifier: workspace:*
version: link:../engine-render
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2277,8 +2277,8 @@ importers:
packages/sheets-ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
'@univerjs/protocol':
specifier: 0.1.38
version: 0.1.38(@grpc/[email protected])([email protected])
@@ -2338,8 +2338,8 @@ importers:
packages/sheets-zen-editor:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
'@univerjs/sheets':
specifier: workspace:*
version: link:../sheets
@@ -2421,8 +2421,8 @@ importers:
specifier: workspace:*
version: link:../docs-ui
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
devDependencies:
'@types/react':
specifier: ^18.3.3
@@ -2501,8 +2501,8 @@ importers:
packages/thread-comment-ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
'@univerjs/protocol':
specifier: 0.1.38
version: 0.1.38(@grpc/[email protected])([email protected])
@@ -2556,8 +2556,8 @@ importers:
packages/ui:
dependencies:
'@univerjs/icons':
- specifier: ^0.1.70
+ specifier: ^0.1.72
'@univerjs/ui':
specifier: workspace:*
version: 'link:'
@@ -5396,8 +5396,8 @@ packages:
'@univerjs/[email protected]':
resolution: {integrity: sha512-cy/Op8BQ8C4+K1kZdeHx+yfCAZ2qqYT6cMPy6Gosz1s6uBwDPsQa3HzZreOQh48Ew80I8XvrSMg61wL4K+6Ckg==}
- '@univerjs/[email protected]':
- resolution: {integrity: sha512-HcJ8T4n3jbdy6h2igIo+Y6nqVxGzM5pXyC9N47VlLIKHvp0abx9xgLxTqxizRZ+Lqns4OxsMuPtiJvBrBfjhuQ==}
+ '@univerjs/[email protected]':
+ resolution: {integrity: sha512-LfBM6v7YJhwGgEZtG7m9589Y4k6zmkshdm+166LTRbBlMBZ6Jl7hcmm9rQwT3jOt97rDma5xmnFbs+83hCD8Yw==}
peerDependencies:
react: '*'
react-dom: '*'
@@ -13825,7 +13825,7 @@ snapshots:
'@univerjs/[email protected]': {}
dependencies:
react: 18.3.1
react-dom: 18.3.1([email protected])