@univerjs/sheets-drawing-ui 0.5.0 → 0.5.1

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.
@@ -0,0 +1,44 @@
1
+ const e = {
2
+ sheetImage: {
3
+ title: "Image",
4
+ upload: {
5
+ float: "Image flottante",
6
+ cell: "Image de cellule"
7
+ },
8
+ panel: {
9
+ title: "Modifier l'image"
10
+ }
11
+ },
12
+ "image-popup": {
13
+ replace: "Remplacer",
14
+ delete: "Supprimer",
15
+ edit: "Éditer",
16
+ crop: "Rogner",
17
+ reset: "Réinitialiser la taille"
18
+ },
19
+ "drawing-anchor": {
20
+ title: "Propriétés de l'ancre",
21
+ both: "Déplacer et redimensionner avec les cellules",
22
+ position: "Déplacer mais ne pas redimensionner avec les cellules",
23
+ none: "Ne pas déplacer ni redimensionner avec les cellules"
24
+ },
25
+ "update-status": {
26
+ exceedMaxSize: "La taille de l'image dépasse la limite, la limite est de {0}M",
27
+ invalidImageType: "Type d'image invalide",
28
+ exceedMaxCount: "Seulement {0} images peuvent être téléchargées à la fois",
29
+ invalidImage: "Image invalide"
30
+ },
31
+ "sheet-drawing-view": "Dessin",
32
+ shortcut: {
33
+ sheet: {
34
+ "drawing-move-down": "Déplacer le dessin vers le bas",
35
+ "drawing-move-up": "Déplacer le dessin vers le haut",
36
+ "drawing-move-left": "Déplacer le dessin vers la gauche",
37
+ "drawing-move-right": "Déplacer le dessin vers la droite",
38
+ "drawing-delete": "Supprimer le dessin"
39
+ }
40
+ }
41
+ };
42
+ export {
43
+ e as default
44
+ };
@@ -1,5 +1,4 @@
1
- import { Nullable } from '@univerjs/core';
2
- import { ITransformState } from '@univerjs/drawing';
1
+ import { ITransformState, Nullable } from '@univerjs/core';
3
2
  import { ISheetDrawingPosition } from '@univerjs/sheets-drawing';
4
3
  import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
5
4
  export declare function drawingPositionToTransform(position: ISheetDrawingPosition, selectionRenderService: ISheetSelectionRenderService, sheetSkeletonManagerService: SheetSkeletonManagerService): Nullable<ITransformState>;
@@ -3,3 +3,4 @@ export interface IInsertImageCommandParams {
3
3
  files: Nullable<File[]>;
4
4
  }
5
5
  export declare const InsertFloatImageCommand: ICommand<IInsertImageCommandParams>;
6
+ export declare const InsertCellImageCommand: ICommand;
@@ -1,5 +1,5 @@
1
- import { ICommand } from '@univerjs/core';
2
- import { IDrawingOrderMapParam, ArrangeTypeEnum } from '@univerjs/drawing';
1
+ import { ICommand, ArrangeTypeEnum } from '@univerjs/core';
2
+ import { IDrawingOrderMapParam } from '@univerjs/drawing';
3
3
  export interface ISetDrawingArrangeCommandParams extends IDrawingOrderMapParam {
4
4
  arrangeType: ArrangeTypeEnum;
5
5
  }
@@ -1,3 +1,2 @@
1
- import { IOperation } from '@univerjs/core';
2
- import { IDrawingSearch } from '@univerjs/drawing';
1
+ import { IDrawingSearch, IOperation } from '@univerjs/core';
3
2
  export declare const EditSheetDrawingOperation: IOperation<IDrawingSearch>;
@@ -1,6 +1,6 @@
1
- import { MenuConfig } from '@univerjs/ui';
2
1
  import { DependencyOverride } from '@univerjs/core';
3
- export declare const PLUGIN_CONFIG_KEY = "sheets-drawing-ui.config";
2
+ import { MenuConfig } from '@univerjs/ui';
3
+ export declare const SHEETS_DRAWING_UI_PLUGIN_CONFIG_KEY = "sheets-drawing-ui.config";
4
4
  export declare const configSymbol: unique symbol;
5
5
  export interface IUniverSheetsDrawingUIConfig {
6
6
  menu?: MenuConfig;
@@ -0,0 +1,8 @@
1
+ import { Disposable, Injector } from '@univerjs/core';
2
+ import { IAutoFillService } from '@univerjs/sheets-ui';
3
+ export declare class SheetCellImageAutofillController extends Disposable {
4
+ private readonly _autoFillService;
5
+ private readonly _injector;
6
+ constructor(_autoFillService: IAutoFillService, _injector: Injector);
7
+ private _initAutoFillHooks;
8
+ }
@@ -0,0 +1,20 @@
1
+ import { ICellData, Nullable, Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
2
+ import { ISheetLocationBase, SheetInterceptorService } from '@univerjs/sheets';
3
+ import { DocDrawingController } from '@univerjs/docs-drawing';
4
+ import { IDrawingManagerService } from '@univerjs/drawing';
5
+ import { IEditorBridgeService } from '@univerjs/sheets-ui';
6
+ export declare function resizeImageByCell(injector: Injector, location: ISheetLocationBase, cell: Nullable<ICellData>): boolean;
7
+ export declare class SheetCellImageController extends Disposable {
8
+ private readonly _commandService;
9
+ private readonly _sheetInterceptorService;
10
+ private readonly _univerInstanceService;
11
+ private readonly _injector;
12
+ private readonly _drawingManagerService;
13
+ private readonly _docDrawingController;
14
+ private readonly _editorBridgeService;
15
+ constructor(_commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _injector: Injector, _drawingManagerService: IDrawingManagerService, _docDrawingController: DocDrawingController, _editorBridgeService: IEditorBridgeService);
16
+ private _initHandleResize;
17
+ private _handleInitEditor;
18
+ private _handleWriteCell;
19
+ private _initCellContentInterceptor;
20
+ }
@@ -0,0 +1,15 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import { DrawingRenderService } from '@univerjs/drawing-ui';
3
+ import { IRenderManagerService } from '@univerjs/engine-render';
4
+ import { SheetsSelectionsService } from '@univerjs/sheets';
5
+ import { HoverManagerService } from '@univerjs/sheets-ui';
6
+ export declare class SheetCellImageHoverController extends Disposable {
7
+ private _hoverManagerService;
8
+ private _renderManagerService;
9
+ private _selectionsService;
10
+ private _drawingRenderService;
11
+ private _isSetCursor;
12
+ constructor(_hoverManagerService: HoverManagerService, _renderManagerService: IRenderManagerService, _selectionsService: SheetsSelectionsService, _drawingRenderService: DrawingRenderService);
13
+ private _initHover;
14
+ private _initImageClick;
15
+ }
@@ -1,9 +1,9 @@
1
1
  import { Workbook, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
- import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
3
2
  import { IDrawingManagerService } from '@univerjs/drawing';
3
+ import { IRenderContext, IRenderManagerService, IRenderModule } from '@univerjs/engine-render';
4
4
  import { SheetInterceptorService } from '@univerjs/sheets';
5
5
  import { ISheetDrawingService } from '@univerjs/sheets-drawing';
6
- import { IRenderContext, IRenderManagerService, IRenderModule } from '@univerjs/engine-render';
6
+ import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
7
7
  export declare class SheetDrawingTransformAffectedController extends Disposable implements IRenderModule {
8
8
  private readonly _context;
9
9
  private readonly _renderManagerService;
@@ -1,10 +1,14 @@
1
- import { Workbook, Disposable, ICommandService, IContextService, LocaleService } from '@univerjs/core';
2
- import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
1
+ import { IAccessor, Workbook, Disposable, ICommandService, IContextService, Injector, LocaleService } from '@univerjs/core';
2
+ import { ISheetLocationBase, SheetsSelectionsService } from '@univerjs/sheets';
3
3
  import { IDrawingManagerService, IImageIoService } from '@univerjs/drawing';
4
- import { SheetsSelectionsService } from '@univerjs/sheets';
4
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
5
5
  import { ISheetDrawingService } from '@univerjs/sheets-drawing';
6
6
  import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
7
7
  import { ILocalFileService, IMessageService } from '@univerjs/ui';
8
+ export declare function getDrawingSizeByCell(accessor: IAccessor, location: ISheetLocationBase, originImageWidth: number, originImageHeight: number, angle: number): false | {
9
+ width: number;
10
+ height: number;
11
+ };
8
12
  export declare class SheetDrawingUpdateController extends Disposable implements IRenderModule {
9
13
  private readonly _context;
10
14
  private readonly _skeletonManagerService;
@@ -17,10 +21,13 @@ export declare class SheetDrawingUpdateController extends Disposable implements
17
21
  private readonly _contextService;
18
22
  private readonly _messageService;
19
23
  private readonly _localeService;
24
+ private readonly _injector;
20
25
  private readonly _workbookSelections;
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);
26
+ 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, _injector: Injector);
22
27
  insertFloatImage(): Promise<boolean>;
28
+ insertCellImage(): Promise<boolean>;
23
29
  private _insertFloatImage;
30
+ private _insertCellImage;
24
31
  private _getUnitInfo;
25
32
  private _getImagePosition;
26
33
  private _updateOrderListener;
@@ -13,9 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import './global.css';
16
17
  export { UniverSheetsDrawingUIPlugin } from './plugin';
17
18
  export { type ICanvasFloatDom, SheetCanvasFloatDomManagerService } from './services/canvas-float-dom-manager.service';
18
- export { IMAGE_MENU_ID } from './views/menu/image.menu';
19
+ export { SHEETS_IMAGE_MENU_ID } from './views/menu/image.menu';
19
20
  export { DeleteDrawingsCommand } from './commands/commands/delete-drawings.command';
20
21
  export { GroupSheetDrawingCommand } from './commands/commands/group-sheet-drawing.command';
21
22
  export { InsertSheetDrawingCommand } from './commands/commands/insert-sheet-drawing.command';
@@ -0,0 +1,3 @@
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -1,7 +1,7 @@
1
- import { IDisposable, IPosition, ITransformState, Serializable, Worksheet, Disposable, ICommandService, IUniverInstanceService, LifecycleService } from '@univerjs/core';
1
+ import { IDisposable, IPosition, ITransformState, Serializable, Worksheet, Disposable, DrawingTypeEnum, ICommandService, IUniverInstanceService, LifecycleService } from '@univerjs/core';
2
2
  import { IBoundRectNoAngle, Scene, SpreadsheetSkeleton, IRenderManagerService, Rect } from '@univerjs/engine-render';
3
3
  import { IFloatDomLayout, CanvasFloatDomService } from '@univerjs/ui';
4
- import { DrawingTypeEnum, IDrawingManagerService } from '@univerjs/drawing';
4
+ import { IDrawingManagerService } from '@univerjs/drawing';
5
5
  import { ISheetDrawingService } from '@univerjs/sheets-drawing';
6
6
  import { BehaviorSubject } from 'rxjs';
7
7
  export interface ICanvasFloatDom {
@@ -1,6 +1,7 @@
1
- import { IMenuItem } from '@univerjs/ui';
2
1
  import { IAccessor } from '@univerjs/core';
2
+ import { IMenuItem } from '@univerjs/ui';
3
3
  export declare const IMAGE_UPLOAD_ICON = "addition-and-subtraction-single";
4
- export declare const IMAGE_MENU_ID = "sheet.menu.image";
4
+ export declare const SHEETS_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;
@@ -1,5 +1,5 @@
1
+ import { IDrawingParam } from '@univerjs/core';
1
2
  import { default as React } from 'react';
2
- import { IDrawingParam } from '@univerjs/drawing';
3
3
  export interface ISheetDrawingAnchorProps {
4
4
  drawings: IDrawingParam[];
5
5
  }