mirror of
https://github.com/dream-num/univer.git
synced 2026-09-24 15:32:18 +08:00
feat(docs-quick-insert-ui): quick-insert support table and image (#4949)
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
"@univerjs/design": "workspace:*",
|
||||
"@univerjs/docs": "workspace:*",
|
||||
"@univerjs/docs-drawing": "workspace:*",
|
||||
"@univerjs/docs-drawing-ui": "workspace:*",
|
||||
"@univerjs/docs-ui": "workspace:*",
|
||||
"@univerjs/drawing": "workspace:*",
|
||||
"@univerjs/drawing-ui": "workspace:*",
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
*/
|
||||
|
||||
import type { DocPopupMenu, IDocPopupMenuItem } from '../services/doc-quick-insert-popup.service';
|
||||
import { BulletListCommand, HorizontalLineCommand, OrderListCommand } from '@univerjs/docs-ui';
|
||||
import { InsertDocImageCommand } from '@univerjs/docs-drawing-ui';
|
||||
import { BulletListCommand, DocCreateTableOperation, HorizontalLineCommand, OrderListCommand } from '@univerjs/docs-ui';
|
||||
|
||||
export enum QuickInsertMenuGroup {
|
||||
Basic = 'quick.insert.group.basic',
|
||||
@@ -50,6 +51,20 @@ export const dividerMenu: IDocPopupMenuItem = {
|
||||
keywords: ['divider', 'line', 'separate'],
|
||||
};
|
||||
|
||||
export const tableMenu: IDocPopupMenuItem = {
|
||||
id: DocCreateTableOperation.id,
|
||||
title: 'docQuickInsert.menu.table',
|
||||
icon: 'GridSingle',
|
||||
keywords: ['table', 'grid', 'spreadsheet'],
|
||||
};
|
||||
|
||||
export const imageMenu: IDocPopupMenuItem = {
|
||||
id: InsertDocImageCommand.id,
|
||||
title: 'docQuickInsert.menu.image',
|
||||
icon: 'addition-and-subtraction-single',
|
||||
keywords: ['image', 'picture', 'photo'],
|
||||
};
|
||||
|
||||
export const builtInMenus: DocPopupMenu[] = [
|
||||
{
|
||||
title: 'docQuickInsert.group.basics',
|
||||
@@ -59,6 +74,8 @@ export const builtInMenus: DocPopupMenu[] = [
|
||||
numberedListMenu,
|
||||
bulletedListMenu,
|
||||
dividerMenu,
|
||||
tableMenu,
|
||||
imageMenu,
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -67,4 +84,6 @@ export const builtInMenuCommandIds = new Set([
|
||||
numberedListMenu.id,
|
||||
bulletedListMenu.id,
|
||||
dividerMenu.id,
|
||||
tableMenu.id,
|
||||
imageMenu.id,
|
||||
]);
|
||||
|
||||
@@ -23,6 +23,8 @@ const locale: typeof zhCN = {
|
||||
bulletedList: 'Bulleted List',
|
||||
divider: 'Divider',
|
||||
text: 'Text',
|
||||
table: 'Table',
|
||||
image: 'Image',
|
||||
},
|
||||
group: {
|
||||
basics: 'Basics',
|
||||
|
||||
@@ -23,6 +23,8 @@ const locale: typeof zhCN = {
|
||||
bulletedList: 'لیست نقطهدار',
|
||||
divider: 'خط تقسیم',
|
||||
text: 'متن',
|
||||
table: 'جدول',
|
||||
image: 'تصویر',
|
||||
},
|
||||
group: {
|
||||
basics: 'بنیادی',
|
||||
|
||||
@@ -23,6 +23,8 @@ const locale: typeof enUS = {
|
||||
bulletedList: 'Liste à puces',
|
||||
divider: 'Ligne de séparation',
|
||||
text: 'Texte',
|
||||
table: 'Tableau',
|
||||
image: 'Image',
|
||||
},
|
||||
group: {
|
||||
basics: 'Basiques',
|
||||
|
||||
@@ -23,6 +23,8 @@ const locale: typeof zhCN = {
|
||||
bulletedList: 'Маркированный список',
|
||||
divider: 'Разделительная линия',
|
||||
text: 'Текст',
|
||||
table: 'Таблица',
|
||||
image: 'Изображение',
|
||||
},
|
||||
group: {
|
||||
basics: 'Основные',
|
||||
|
||||
@@ -23,6 +23,8 @@ const locale: typeof zhCN = {
|
||||
bulletedList: 'Danh sách không được đánh số',
|
||||
divider: 'Đường phân cách',
|
||||
text: 'Văn bản',
|
||||
table: 'Bảng',
|
||||
image: 'Hình ảnh',
|
||||
},
|
||||
group: {
|
||||
basics: 'Cơ bản',
|
||||
|
||||
@@ -21,6 +21,8 @@ const locale = {
|
||||
bulletedList: '无序列表',
|
||||
divider: '分隔线',
|
||||
text: '文本',
|
||||
table: '表格',
|
||||
image: '图片',
|
||||
},
|
||||
group: {
|
||||
basics: '基础',
|
||||
|
||||
@@ -23,6 +23,8 @@ const locale: typeof zhCN = {
|
||||
bulletedList: '無序列表',
|
||||
divider: '分隔線',
|
||||
text: '文本',
|
||||
table: '表格',
|
||||
image: '圖片',
|
||||
},
|
||||
group: {
|
||||
basics: '基礎',
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
import type { Dependency } from '@univerjs/core';
|
||||
import { DependentOn, Inject, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
||||
import { UniverDocsDrawingPlugin } from '@univerjs/docs-drawing';
|
||||
import { UniverDocsDrawingUIPlugin } from '@univerjs/docs-drawing-ui';
|
||||
import { UniverDrawingPlugin } from '@univerjs/drawing';
|
||||
import { UniverDrawingUIPlugin } from '@univerjs/drawing-ui';
|
||||
import { UniverUIPlugin } from '@univerjs/ui';
|
||||
@@ -26,7 +27,7 @@ import { DocQuickInsertPopupService } from './services/doc-quick-insert-popup.se
|
||||
|
||||
const PLUGIN_NAME = 'DOC_QUICK_INSERT_UI_PLUGIN';
|
||||
|
||||
@DependentOn(UniverDrawingUIPlugin, UniverDrawingPlugin, UniverDocsDrawingPlugin, UniverUIPlugin)
|
||||
@DependentOn(UniverDrawingUIPlugin, UniverDrawingPlugin, UniverDocsDrawingUIPlugin, UniverDocsDrawingPlugin, UniverUIPlugin)
|
||||
export class UniverDocsQuickInsertUIPlugin extends Plugin {
|
||||
static override type = UniverInstanceType.UNIVER_DOC;
|
||||
static override pluginName = PLUGIN_NAME;
|
||||
|
||||
Generated
+6
-3
@@ -1453,6 +1453,9 @@ importers:
|
||||
'@univerjs/docs-drawing':
|
||||
specifier: workspace:*
|
||||
version: link:../docs-drawing
|
||||
'@univerjs/docs-drawing-ui':
|
||||
specifier: workspace:*
|
||||
version: link:../docs-drawing-ui
|
||||
'@univerjs/docs-ui':
|
||||
specifier: workspace:*
|
||||
version: link:../docs-ui
|
||||
@@ -4469,7 +4472,7 @@ packages:
|
||||
resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==}
|
||||
|
||||
'@protobufjs/fetch@1.1.0':
|
||||
resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==}
|
||||
resolution: {integrity: sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=}
|
||||
|
||||
'@protobufjs/float@1.0.2':
|
||||
resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==}
|
||||
@@ -4478,10 +4481,10 @@ packages:
|
||||
resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==}
|
||||
|
||||
'@protobufjs/path@1.1.2':
|
||||
resolution: {integrity: sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=}
|
||||
resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==}
|
||||
|
||||
'@protobufjs/pool@1.1.0':
|
||||
resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==}
|
||||
resolution: {integrity: sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=}
|
||||
|
||||
'@protobufjs/utf8@1.1.0':
|
||||
resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
|
||||
|
||||
Reference in New Issue
Block a user