@univerjs/sheets-drawing-ui 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +302 -290
- package/lib/index.css +1 -1
- package/lib/types/commands/commands/insert-image.command.d.ts +5 -0
- package/lib/types/controllers/config.schema.d.ts +9 -0
- package/lib/types/controllers/drawing-popup-menu.controller.d.ts +1 -1
- package/lib/types/controllers/menu.schema.d.ts +2 -0
- package/lib/types/controllers/render-controllers/sheet-drawing.render-controller.d.ts +4 -1
- package/lib/types/controllers/sheet-drawing-transform-affected.controller.d.ts +4 -2
- package/lib/types/controllers/sheet-drawing-update.controller.d.ts +6 -9
- package/lib/types/controllers/sheet-drawing.controller.d.ts +4 -10
- package/lib/types/index.d.ts +1 -1
- package/lib/types/plugin.d.ts +5 -5
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +1 -1
- package/lib/types/views/menu/image.menu.d.ts +0 -1
- package/lib/types/views/upload-component/component-name.d.ts +0 -1
- package/lib/umd/index.js +1 -1
- package/package.json +24 -24
- package/lib/types/commands/operations/insert-image.operation.d.ts +0 -6
- package/lib/types/views/upload-component/UploadFile.d.ts +0 -8
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-upload-loading{position:absolute;height:100%;width:100%;text-align:center;background-color:rgba(var(--color-black),.5);z-index:1000;user-select:none}.univer-upload-loading-body{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:rgb(var(--color-white));padding:20px 40px;display:flex;align-items:center;justify-items:center;border-radius:var(--border-radius-lg)}.univer-upload-loading-body-animation{width:30px;height:30px;border:2px solid rgb(var(--color-black));border-top-color:transparent;border-radius:100%;animation:univer-UniverCircleAnimation infinite .75s linear}.univer-upload-loading-body-text{font-size:var(--font-size-xs);color:var(--color-black);padding:10px}@keyframes univer-UniverCircleAnimation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.univer-
|
|
1
|
+
.univer-upload-loading{position:absolute;height:100%;width:100%;text-align:center;background-color:rgba(var(--color-black),.5);z-index:1000;user-select:none}.univer-upload-loading-body{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:rgb(var(--color-white));padding:20px 40px;display:flex;align-items:center;justify-items:center;border-radius:var(--border-radius-lg)}.univer-upload-loading-body-animation{width:30px;height:30px;border:2px solid rgb(var(--color-black));border-top-color:transparent;border-radius:100%;animation:univer-UniverCircleAnimation infinite .75s linear}.univer-upload-loading-body-text{font-size:var(--font-size-xs);color:var(--color-black);padding:10px}@keyframes univer-UniverCircleAnimation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.univer-image-common-panel{text-align:center;padding:var(--padding-sm);font-size:var(--font-size-sm)}.univer-image-common-panel-grid{position:relative;width:100%}.univer-image-common-panel-border{border-top:1px solid rgb(var(--border-color));margin-top:20px}.univer-image-common-panel-title{color:rgb(var(--text-color-secondary));text-align:left}.univer-image-common-panel-subtitle{color:rgb(var(--text-color-primary));text-align:left}.univer-image-common-panel-row{position:relative;display:flex;justify-content:flex-start;align-items:flex-start;height:100%;margin-top:10px}.univer-image-common-panel-row-vertical{justify-content:center;align-items:center;height:36px}.univer-image-common-panel-column{width:100%}.univer-image-common-panel-column-center{display:flex;justify-content:center;align-items:center}.univer-image-common-panel-inline{display:flex;align-items:center;gap:var(--margin-xxs)}.univer-image-common-panel-span2{width:50%}.univer-image-common-panel-span3{width:33.33333333%}.univer-image-common-panel-input{width:90%}.univer-sheet-image-menu{position:absolute;height:100%;width:100%;text-align:center}.univer-sheet-image-menu-input{display:none}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MenuConfig } from '@univerjs/ui';
|
|
2
|
+
import { DependencyOverride } from '@univerjs/core';
|
|
3
|
+
export declare const PLUGIN_CONFIG_KEY = "sheets-drawing-ui.config";
|
|
4
|
+
export declare const configSymbol: unique symbol;
|
|
5
|
+
export interface IUniverSheetsDrawingUIConfig {
|
|
6
|
+
menu?: MenuConfig;
|
|
7
|
+
overrides?: DependencyOverride;
|
|
8
|
+
}
|
|
9
|
+
export declare const defaultPluginConfig: IUniverSheetsDrawingUIConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IContextService, Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
2
|
+
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
2
3
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
4
|
import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
|
|
4
|
-
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
5
5
|
import { IUIPartsService } from '@univerjs/ui';
|
|
6
6
|
export declare class DrawingPopupMenuController extends RxDisposable {
|
|
7
7
|
private _injector;
|
|
@@ -2,12 +2,15 @@ import { Disposable, LifecycleService } from '@univerjs/core';
|
|
|
2
2
|
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
3
3
|
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
4
4
|
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
|
|
5
|
+
import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
|
|
5
6
|
export declare class SheetsDrawingRenderController extends Disposable implements IRenderModule {
|
|
6
7
|
private _context;
|
|
7
8
|
private readonly _sheetDrawingService;
|
|
8
9
|
private readonly _drawingManagerService;
|
|
9
10
|
private _lifecycleService;
|
|
10
|
-
|
|
11
|
+
private _sheetSelectionRenderService;
|
|
12
|
+
private _sheetSkeletonManagerService;
|
|
13
|
+
constructor(_context: IRenderContext, _sheetDrawingService: ISheetDrawingService, _drawingManagerService: IDrawingManagerService, _lifecycleService: LifecycleService, _sheetSelectionRenderService: ISheetSelectionRenderService, _sheetSkeletonManagerService: SheetSkeletonManagerService);
|
|
11
14
|
private _init;
|
|
12
15
|
private _drawingInitializeListener;
|
|
13
16
|
}
|
|
@@ -3,9 +3,10 @@ import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univ
|
|
|
3
3
|
import { IDrawingManagerService } from '@univerjs/drawing';
|
|
4
4
|
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
5
5
|
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
|
|
6
|
-
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
6
|
+
import { IRenderContext, IRenderManagerService, IRenderModule } from '@univerjs/engine-render';
|
|
7
7
|
export declare class SheetDrawingTransformAffectedController extends Disposable implements IRenderModule {
|
|
8
8
|
private readonly _context;
|
|
9
|
+
private readonly _renderManagerService;
|
|
9
10
|
private readonly _commandService;
|
|
10
11
|
private readonly _selectionRenderService;
|
|
11
12
|
private readonly _skeletonManagerService;
|
|
@@ -13,7 +14,7 @@ export declare class SheetDrawingTransformAffectedController extends Disposable
|
|
|
13
14
|
private readonly _sheetDrawingService;
|
|
14
15
|
private readonly _drawingManagerService;
|
|
15
16
|
private readonly _univerInstanceService;
|
|
16
|
-
constructor(_context: IRenderContext<Workbook>, _commandService: ICommandService, _selectionRenderService: ISheetSelectionRenderService, _skeletonManagerService: SheetSkeletonManagerService, _sheetInterceptorService: SheetInterceptorService, _sheetDrawingService: ISheetDrawingService, _drawingManagerService: IDrawingManagerService, _univerInstanceService: IUniverInstanceService);
|
|
17
|
+
constructor(_context: IRenderContext<Workbook>, _renderManagerService: IRenderManagerService, _commandService: ICommandService, _selectionRenderService: ISheetSelectionRenderService, _skeletonManagerService: SheetSkeletonManagerService, _sheetInterceptorService: SheetInterceptorService, _sheetDrawingService: ISheetDrawingService, _drawingManagerService: IDrawingManagerService, _univerInstanceService: IUniverInstanceService);
|
|
17
18
|
private _sheetInterceptorListener;
|
|
18
19
|
private _getRangeMoveUndo;
|
|
19
20
|
private _getUpdateOrDeleteDrawings;
|
|
@@ -23,6 +24,7 @@ export declare class SheetDrawingTransformAffectedController extends Disposable
|
|
|
23
24
|
private _getDrawingUndoForRowVisible;
|
|
24
25
|
private _getDrawingUndoForRowAndColSize;
|
|
25
26
|
private _getUnitIdAndSubUnitId;
|
|
27
|
+
private _moveRangeInterceptor;
|
|
26
28
|
private _moveRowInterceptor;
|
|
27
29
|
private _moveColInterceptor;
|
|
28
30
|
private _expandCol;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Disposable, ICommandService, IContextService, LocaleService, Workbook } from '@univerjs/core';
|
|
2
2
|
import { IDrawingManagerService, IImageIoService } from '@univerjs/drawing';
|
|
3
|
-
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
|
|
4
3
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
4
|
+
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
|
|
5
5
|
import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
|
|
6
|
-
import { IMessageService } from '@univerjs/ui';
|
|
6
|
+
import { ILocalFileService, IMessageService } from '@univerjs/ui';
|
|
7
7
|
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
8
8
|
export declare class SheetDrawingUpdateController extends Disposable implements IRenderModule {
|
|
9
9
|
private readonly _context;
|
|
@@ -11,18 +11,15 @@ export declare class SheetDrawingUpdateController extends Disposable implements
|
|
|
11
11
|
private readonly _commandService;
|
|
12
12
|
private readonly _selectionRenderService;
|
|
13
13
|
private readonly _imageIoService;
|
|
14
|
+
private readonly _fileOpenerService;
|
|
14
15
|
private readonly _sheetDrawingService;
|
|
15
16
|
private readonly _drawingManagerService;
|
|
16
17
|
private readonly _contextService;
|
|
17
18
|
private readonly _messageService;
|
|
18
19
|
private readonly _localeService;
|
|
19
20
|
private readonly _workbookSelections;
|
|
20
|
-
constructor(_context: IRenderContext<Workbook>, _skeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService, _selectionRenderService: ISheetSelectionRenderService, _imageIoService: IImageIoService, _sheetDrawingService: ISheetDrawingService, _drawingManagerService: IDrawingManagerService, _contextService: IContextService, _messageService: IMessageService, _localeService: LocaleService, selectionManagerService: SheetsSelectionsService);
|
|
21
|
-
|
|
22
|
-
* Upload image to cell or float image
|
|
23
|
-
*/
|
|
24
|
-
private _initCommandListeners;
|
|
25
|
-
private _insertCellImage;
|
|
21
|
+
constructor(_context: IRenderContext<Workbook>, _skeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService, _selectionRenderService: ISheetSelectionRenderService, _imageIoService: IImageIoService, _fileOpenerService: ILocalFileService, _sheetDrawingService: ISheetDrawingService, _drawingManagerService: IDrawingManagerService, _contextService: IContextService, _messageService: IMessageService, _localeService: LocaleService, selectionManagerService: SheetsSelectionsService);
|
|
22
|
+
insertFloatImage(): Promise<boolean>;
|
|
26
23
|
private _insertFloatImage;
|
|
27
24
|
private _getUnitInfo;
|
|
28
25
|
private _getImagePosition;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface IUniverSheetsDrawingConfig {
|
|
4
|
-
menu?: MenuConfig;
|
|
5
|
-
overrides?: DependencyOverride;
|
|
6
|
-
}
|
|
7
|
-
export declare const DefaultSheetsDrawingConfig: IUniverSheetsDrawingConfig;
|
|
1
|
+
import { Disposable, ICommandService, Injector } from '@univerjs/core';
|
|
2
|
+
import { ComponentManager, IMenuManagerService, IShortcutService } from '@univerjs/ui';
|
|
8
3
|
export declare class SheetDrawingUIController extends Disposable {
|
|
9
|
-
private readonly _config;
|
|
10
4
|
private readonly _injector;
|
|
11
5
|
private readonly _componentManager;
|
|
12
|
-
private readonly
|
|
6
|
+
private readonly _menuManagerService;
|
|
13
7
|
private readonly _commandService;
|
|
14
8
|
private readonly _shortcutService;
|
|
15
|
-
constructor(
|
|
9
|
+
constructor(_injector: Injector, _componentManager: ComponentManager, _menuManagerService: IMenuManagerService, _commandService: ICommandService, _shortcutService: IShortcutService);
|
|
16
10
|
private _initCustomComponents;
|
|
17
11
|
private _initMenus;
|
|
18
12
|
private _initCommands;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export { SetSheetDrawingCommand } from './commands/commands/set-sheet-drawing.co
|
|
|
25
25
|
export { UngroupSheetDrawingCommand } from './commands/commands/ungroup-sheet-drawing.command';
|
|
26
26
|
export { ClearSheetDrawingTransformerOperation } from './commands/operations/clear-drawing-transformer.operation';
|
|
27
27
|
export { EditSheetDrawingOperation } from './commands/operations/edit-sheet-drawing.operation';
|
|
28
|
-
export {
|
|
28
|
+
export { InsertFloatImageCommand, type IInsertImageCommandParams } from './commands/commands/insert-image.command';
|
|
29
29
|
export { SidebarSheetDrawingOperation } from './commands/operations/open-drawing-panel.operation';
|
|
30
30
|
export { IMAGE_MENU_ID } from './views/menu/image.menu';
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
2
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
-
import {
|
|
3
|
+
import { IUniverSheetsDrawingUIConfig } from './controllers/config.schema';
|
|
4
4
|
export declare class UniverSheetsDrawingUIPlugin extends Plugin {
|
|
5
|
+
private readonly _config;
|
|
5
6
|
protected _injector: Injector;
|
|
6
|
-
private readonly _localeService;
|
|
7
7
|
private readonly _renderManagerService;
|
|
8
|
+
private readonly _configService;
|
|
8
9
|
static type: UniverInstanceType;
|
|
9
10
|
static pluginName: string;
|
|
10
|
-
|
|
11
|
-
constructor(config: Partial<IUniverSheetsDrawingConfig> | undefined, _injector: Injector, _localeService: LocaleService, _renderManagerService: IRenderManagerService);
|
|
11
|
+
constructor(_config: Partial<IUniverSheetsDrawingUIConfig> | undefined, _injector: Injector, _renderManagerService: IRenderManagerService, _configService: IConfigService);
|
|
12
12
|
onStarting(): void;
|
|
13
13
|
onRendered(): void;
|
|
14
14
|
private _initDependencies;
|
|
@@ -4,4 +4,3 @@ export declare const IMAGE_UPLOAD_ICON = "addition-and-subtraction-single";
|
|
|
4
4
|
export declare const IMAGE_MENU_ID = "sheet.menu.image";
|
|
5
5
|
export declare function ImageMenuFactory(accessor: IAccessor): IMenuItem;
|
|
6
6
|
export declare function UploadFloatImageMenuFactory(_accessor: IAccessor): IMenuItem;
|
|
7
|
-
export declare function UploadCellImageMenuFactory(_accessor: IAccessor): IMenuItem;
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare const COMPONENT_UPLOAD_FILE_MENU = "COMPONENT_UPLOAD_FILE_MENU";
|
|
17
16
|
export declare enum UploadFileType {
|
|
18
17
|
cellImage = 0,
|
|
19
18
|
floatImage = 1
|