@univerjs/drawing-ui 0.25.0 → 1.0.0-alpha.0

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,24 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Disposable } from '@univerjs/core';
17
+ import { ComponentManager, IconManager } from '@univerjs/ui';
18
+ export declare class ComponentsController extends Disposable {
19
+ private readonly _componentManager;
20
+ private readonly _iconManager;
21
+ constructor(_componentManager: ComponentManager, _iconManager: IconManager);
22
+ private _registerComponents;
23
+ private _registerIcons;
24
+ }
@@ -14,14 +14,12 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Disposable, ICommandService } from '@univerjs/core';
17
- import { ComponentManager, IMenuManagerService } from '@univerjs/ui';
17
+ import { IMenuManagerService } from '@univerjs/ui';
18
18
  export declare class DrawingUIController extends Disposable {
19
- private readonly _componentManager;
20
19
  private readonly _commandService;
21
20
  private readonly _menuManagerService;
22
- constructor(_componentManager: ComponentManager, _commandService: ICommandService, _menuManagerService: IMenuManagerService);
21
+ constructor(_commandService: ICommandService, _menuManagerService: IMenuManagerService);
23
22
  private _init;
24
23
  private _initMenus;
25
24
  private _initCommands;
26
- private _initComponents;
27
25
  }
@@ -15,9 +15,11 @@
15
15
  */
16
16
  import './global.css';
17
17
  export { SetDrawingAlignOperation } from './commands/operations/drawing-align.operation';
18
- export { type IDrawingArrangeOperationParams, SetDrawingArrangeOperation, } from './commands/operations/drawing-arrange.operation';
19
- export { CancelDrawingGroupOperation, DRAWING_GROUP_TYPES, type ICancelDrawingGroupOperationParams, type IDrawingGroupOperationParams, SetDrawingGroupOperation, } from './commands/operations/drawing-group.operation';
20
- export { AutoImageCropOperation, CloseImageCropOperation, OpenImageCropOperation } from './commands/operations/image-crop.operation';
18
+ export { SetDrawingArrangeOperation } from './commands/operations/drawing-arrange.operation';
19
+ export type { IDrawingArrangeOperationParams, } from './commands/operations/drawing-arrange.operation';
20
+ export { CancelDrawingGroupOperation, DRAWING_GROUP_TYPES, SetDrawingGroupOperation, } from './commands/operations/drawing-group.operation';
21
+ export type { ICancelDrawingGroupOperationParams, IDrawingGroupOperationParams, } from './commands/operations/drawing-group.operation';
22
+ export { AutoImageCropOperation, CloseImageCropOperation, OpenImageCropOperation, } from './commands/operations/image-crop.operation';
21
23
  export { ImageResetSizeOperation } from './commands/operations/image-reset-size.operation';
22
24
  export type { IUniverDrawingUIConfig } from './config/config';
23
25
  export { getCurrentUnitInfo, insertGroupObject } from './controllers/utils';
@@ -28,5 +30,4 @@ export { DrawingRenderService } from './services/drawing-render.service';
28
30
  export { getUpdateParams } from './utils/get-update-params';
29
31
  export { ImageCropperObject } from './views/crop/image-cropper-object';
30
32
  export { COMPONENT_IMAGE_POPUP_MENU } from './views/image-popup-menu/component-name';
31
- export { ImagePopupMenu } from './views/image-popup-menu/ImagePopupMenu';
32
33
  export { DrawingCommonPanel } from './views/panel/DrawingCommonPanel';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { LocaleLeafKeys } from '@univerjs/core';
17
+ import type enUS from './en-US';
18
+ export type LocaleKey = LocaleLeafKeys<typeof enUS>;
@@ -15,13 +15,14 @@
15
15
  */
16
16
  import type { IAccessor } from '@univerjs/core';
17
17
  import type { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
18
+ import type { LocaleKey } from '../locale/types';
18
19
  export declare const DRAWING_ALIGN_CONTEXT_MENU_ID = "contextMenu.drawing-align";
19
- export declare function DrawingAlignContextMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
20
- export declare function SetDrawingAlignLeftMenuItemFactory(): IMenuButtonItem;
21
- export declare function SetDrawingAlignCenterMenuItemFactory(): IMenuButtonItem;
22
- export declare function SetDrawingAlignRightMenuItemFactory(): IMenuButtonItem;
23
- export declare function SetDrawingAlignTopMenuItemFactory(): IMenuButtonItem;
24
- export declare function SetDrawingAlignMiddleMenuItemFactory(): IMenuButtonItem;
25
- export declare function SetDrawingAlignBottomMenuItemFactory(): IMenuButtonItem;
26
- export declare function SetDrawingAlignHorizonMenuItemFactory(): IMenuButtonItem;
27
- export declare function SetDrawingAlignVerticalMenuItemFactory(): IMenuButtonItem;
20
+ export declare function DrawingAlignContextMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
21
+ export declare function SetDrawingAlignLeftMenuItemFactory(): IMenuButtonItem<LocaleKey>;
22
+ export declare function SetDrawingAlignCenterMenuItemFactory(): IMenuButtonItem<LocaleKey>;
23
+ export declare function SetDrawingAlignRightMenuItemFactory(): IMenuButtonItem<LocaleKey>;
24
+ export declare function SetDrawingAlignTopMenuItemFactory(): IMenuButtonItem<LocaleKey>;
25
+ export declare function SetDrawingAlignMiddleMenuItemFactory(): IMenuButtonItem<LocaleKey>;
26
+ export declare function SetDrawingAlignBottomMenuItemFactory(): IMenuButtonItem<LocaleKey>;
27
+ export declare function SetDrawingAlignHorizonMenuItemFactory(): IMenuButtonItem<LocaleKey>;
28
+ export declare function SetDrawingAlignVerticalMenuItemFactory(): IMenuButtonItem<LocaleKey>;
@@ -14,9 +14,10 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
17
+ import type { LocaleKey } from '../locale/types';
17
18
  export declare const DRAWING_ARRANGE_CONTEXT_MENU_ID = "contextMenu.drawing-arrange";
18
- export declare function DrawingArrangeContextMenuItemFactory(): IMenuSelectorItem<string>;
19
- export declare function SetDrawingArrangeFrontMenuItemFactory(): IMenuButtonItem;
20
- export declare function SetDrawingArrangeForwardMenuItemFactory(): IMenuButtonItem;
21
- export declare function SetDrawingArrangeBackMenuItemFactory(): IMenuButtonItem;
22
- export declare function SetDrawingArrangeBackwardMenuItemFactory(): IMenuButtonItem;
19
+ export declare function DrawingArrangeContextMenuItemFactory(): IMenuSelectorItem<LocaleKey>;
20
+ export declare function SetDrawingArrangeFrontMenuItemFactory(): IMenuButtonItem<LocaleKey>;
21
+ export declare function SetDrawingArrangeForwardMenuItemFactory(): IMenuButtonItem<LocaleKey>;
22
+ export declare function SetDrawingArrangeBackMenuItemFactory(): IMenuButtonItem<LocaleKey>;
23
+ export declare function SetDrawingArrangeBackwardMenuItemFactory(): IMenuButtonItem<LocaleKey>;
@@ -15,7 +15,8 @@
15
15
  */
16
16
  import type { IAccessor } from '@univerjs/core';
17
17
  import type { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
18
+ import type { LocaleKey } from '../locale/types';
18
19
  export declare const DRAWING_GROUP_CONTEXT_MENU_ID = "contextMenu.drawing-group";
19
- export declare function DrawingGroupContextMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
20
- export declare function SetDrawingGroupMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
21
- export declare function CancelDrawingGroupMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
20
+ export declare function DrawingGroupContextMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
21
+ export declare function SetDrawingGroupMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
22
+ export declare function CancelDrawingGroupMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
@@ -13,14 +13,20 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IDrawingSearch } from '@univerjs/core';
16
+ import type { IDrawingParam, IDrawingSearch } from '@univerjs/core';
17
17
  import type { IDocFloatDomData, IImageData } from '@univerjs/drawing';
18
- import type { IRectProps, Scene } from '@univerjs/engine-render';
19
- import { IUniverInstanceService, IURLImageService } from '@univerjs/core';
18
+ import type { BaseObject, IRectProps, Scene } from '@univerjs/engine-render';
19
+ import { BooleanNumber, IUniverInstanceService, IURLImageService } from '@univerjs/core';
20
20
  import { IDrawingManagerService, IImageIoService } from '@univerjs/drawing';
21
21
  import { Image, Rect } from '@univerjs/engine-render';
22
22
  import { IGalleryService } from '@univerjs/ui';
23
23
  import { DrawingImageClipService } from './drawing-image-clip.service';
24
+ type IDrawingParamWithBehindText = (Partial<IDrawingParam> | Partial<IImageData>) & {
25
+ behindText?: boolean | BooleanNumber;
26
+ };
27
+ export declare const DOC_DRAWING_BEHIND_TEXT_LAYER_INDEX = 1;
28
+ export declare function getDrawingRenderLayerIndex(param: IDrawingParamWithBehindText): number;
29
+ export declare function ensureDrawingRenderLayer(scene: Scene, object: BaseObject, param: IDrawingParamWithBehindText): void;
24
30
  export declare class DrawingRenderService {
25
31
  private readonly _drawingManagerService;
26
32
  private readonly _imageIoService;
@@ -36,3 +42,4 @@ export declare class DrawingRenderService {
36
42
  previewImage(key: string, src: string, width: number, height: number): void;
37
43
  private _adjustImageSize;
38
44
  }
45
+ export {};
@@ -32,4 +32,4 @@ export interface IImagePopupMenuProps {
32
32
  extraProps?: IImagePopupMenuExtraProps;
33
33
  };
34
34
  }
35
- export declare function ImagePopupMenu(props: IImagePopupMenuProps): import("react/jsx-runtime").JSX.Element | null;
35
+ export declare function ImagePopupMenu(props: IImagePopupMenuProps): import("react").JSX.Element | null;
@@ -18,4 +18,4 @@ export interface IDrawingAlignProps {
18
18
  drawings: IDrawingParam[];
19
19
  alignShow: boolean;
20
20
  }
21
- export declare const DrawingAlign: (props: IDrawingAlignProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const DrawingAlign: (props: IDrawingAlignProps) => import("react").JSX.Element;
@@ -18,4 +18,4 @@ export interface IDrawingArrangeProps {
18
18
  arrangeShow: boolean;
19
19
  drawings: IDrawingParam[];
20
20
  }
21
- export declare const DrawingArrange: (props: IDrawingArrangeProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const DrawingArrange: (props: IDrawingArrangeProps) => import("react").JSX.Element;
@@ -22,4 +22,4 @@ export interface IDrawingCommonPanelProps {
22
22
  hasCropper?: boolean;
23
23
  hasGroup?: boolean;
24
24
  }
25
- export declare const DrawingCommonPanel: (props: IDrawingCommonPanelProps) => import("react/jsx-runtime").JSX.Element | undefined;
25
+ export declare const DrawingCommonPanel: (props: IDrawingCommonPanelProps) => import("react").JSX.Element | undefined;
@@ -18,4 +18,4 @@ export interface IDrawingGroupProps {
18
18
  drawings: IDrawingParam[];
19
19
  hasGroup: boolean;
20
20
  }
21
- export declare const DrawingGroup: (props: IDrawingGroupProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const DrawingGroup: (props: IDrawingGroupProps) => import("react").JSX.Element;
@@ -18,4 +18,4 @@ export interface IDrawingTransformProps {
18
18
  transformShow: boolean;
19
19
  drawings: IDrawingParam[];
20
20
  }
21
- export declare const DrawingTransform: (props: IDrawingTransformProps) => import("react/jsx-runtime").JSX.Element | undefined;
21
+ export declare const DrawingTransform: (props: IDrawingTransformProps) => import("react").JSX.Element | undefined;
@@ -18,4 +18,4 @@ export interface IImageCropperProps {
18
18
  drawings: IDrawingParam[];
19
19
  cropperShow: boolean;
20
20
  }
21
- export declare const ImageCropper: (props: IImageCropperProps) => import("react/jsx-runtime").JSX.Element | undefined;
21
+ export declare const ImageCropper: (props: IImageCropperProps) => import("react").JSX.Element | undefined;