@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/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-upload-file-menu{position:absolute;height:100%;width:100%;text-align:center}.univer-upload-file-menu-input{display:none}.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}
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,5 @@
1
+ import { ICommand, Nullable } from '@univerjs/core';
2
+ export interface IInsertImageCommandParams {
3
+ files: Nullable<File[]>;
4
+ }
5
+ export declare const InsertFloatImageCommand: ICommand<IInsertImageCommandParams>;
@@ -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;
@@ -0,0 +1,2 @@
1
+ import { MenuSchemaType } from '@univerjs/ui';
2
+ export declare const menuSchema: MenuSchemaType;
@@ -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
- constructor(_context: IRenderContext, _sheetDrawingService: ISheetDrawingService, _drawingManagerService: IDrawingManagerService, _lifecycleService: LifecycleService);
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 { Workbook, Disposable, ICommandService, IContextService, LocaleService } from '@univerjs/core';
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 { DependencyOverride, Disposable, ICommandService, Injector } from '@univerjs/core';
2
- import { MenuConfig, ComponentManager, IMenuService, IShortcutService } from '@univerjs/ui';
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 _menuService;
6
+ private readonly _menuManagerService;
13
7
  private readonly _commandService;
14
8
  private readonly _shortcutService;
15
- constructor(_config: Partial<IUniverSheetsDrawingConfig>, _injector: Injector, _componentManager: ComponentManager, _menuService: IMenuService, _commandService: ICommandService, _shortcutService: IShortcutService);
9
+ constructor(_injector: Injector, _componentManager: ComponentManager, _menuManagerService: IMenuManagerService, _commandService: ICommandService, _shortcutService: IShortcutService);
16
10
  private _initCustomComponents;
17
11
  private _initMenus;
18
12
  private _initCommands;
@@ -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 { InsertFloatImageOperation, InsertCellImageOperation } from './commands/operations/insert-image.operation';
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';
@@ -1,14 +1,14 @@
1
- import { Injector, LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
1
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
2
  import { IRenderManagerService } from '@univerjs/engine-render';
3
- import { IUniverSheetsDrawingConfig } from './controllers/sheet-drawing.controller';
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
- private _pluginConfig;
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;
@@ -7,7 +7,7 @@ export interface ICanvasFloatDom {
7
7
  /**
8
8
  * whether allow transform float-dom
9
9
  */
10
- allowTransform: boolean;
10
+ allowTransform?: boolean;
11
11
  /**
12
12
  * initial position of float-dom
13
13
  */
@@ -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