@cool-office/drawing-ui 0.0.0-stage → 1.2.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.
- package/LICENSE +176 -0
- package/README.md +40 -2
- package/lib/cjs/index.js +5691 -0
- package/lib/cjs/locale/ar-SA.js +110 -0
- package/lib/cjs/locale/ca-ES.js +110 -0
- package/lib/cjs/locale/de-DE.js +110 -0
- package/lib/cjs/locale/en-US.js +125 -0
- package/lib/cjs/locale/es-ES.js +110 -0
- package/lib/cjs/locale/fa-IR.js +110 -0
- package/lib/cjs/locale/fr-FR.js +110 -0
- package/lib/cjs/locale/id-ID.js +110 -0
- package/lib/cjs/locale/it-IT.js +110 -0
- package/lib/cjs/locale/ja-JP.js +110 -0
- package/lib/cjs/locale/ko-KR.js +110 -0
- package/lib/cjs/locale/pl-PL.js +110 -0
- package/lib/cjs/locale/pt-BR.js +110 -0
- package/lib/cjs/locale/ru-RU.js +110 -0
- package/lib/cjs/locale/sk-SK.js +110 -0
- package/lib/cjs/locale/vi-VN.js +110 -0
- package/lib/cjs/locale/zh-CN.js +110 -0
- package/lib/cjs/locale/zh-HK.js +110 -0
- package/lib/cjs/locale/zh-TW.js +110 -0
- package/lib/es/index.js +5637 -0
- package/lib/es/locale/ar-SA.js +110 -0
- package/lib/es/locale/ca-ES.js +110 -0
- package/lib/es/locale/de-DE.js +110 -0
- package/lib/es/locale/en-US.js +125 -0
- package/lib/es/locale/es-ES.js +110 -0
- package/lib/es/locale/fa-IR.js +110 -0
- package/lib/es/locale/fr-FR.js +110 -0
- package/lib/es/locale/id-ID.js +110 -0
- package/lib/es/locale/it-IT.js +110 -0
- package/lib/es/locale/ja-JP.js +110 -0
- package/lib/es/locale/ko-KR.js +110 -0
- package/lib/es/locale/pl-PL.js +110 -0
- package/lib/es/locale/pt-BR.js +110 -0
- package/lib/es/locale/ru-RU.js +110 -0
- package/lib/es/locale/sk-SK.js +110 -0
- package/lib/es/locale/vi-VN.js +110 -0
- package/lib/es/locale/zh-CN.js +110 -0
- package/lib/es/locale/zh-HK.js +110 -0
- package/lib/es/locale/zh-TW.js +110 -0
- package/lib/index.css +738 -0
- package/lib/index.js +5637 -0
- package/lib/locale/ar-SA.js +110 -0
- package/lib/locale/ca-ES.js +110 -0
- package/lib/locale/de-DE.js +110 -0
- package/lib/locale/en-US.js +125 -0
- package/lib/locale/es-ES.js +110 -0
- package/lib/locale/fa-IR.js +110 -0
- package/lib/locale/fr-FR.js +110 -0
- package/lib/locale/id-ID.js +110 -0
- package/lib/locale/it-IT.js +110 -0
- package/lib/locale/ja-JP.js +110 -0
- package/lib/locale/ko-KR.js +110 -0
- package/lib/locale/pl-PL.js +110 -0
- package/lib/locale/pt-BR.js +110 -0
- package/lib/locale/ru-RU.js +110 -0
- package/lib/locale/sk-SK.js +110 -0
- package/lib/locale/vi-VN.js +110 -0
- package/lib/locale/zh-CN.js +110 -0
- package/lib/locale/zh-HK.js +110 -0
- package/lib/locale/zh-TW.js +110 -0
- package/lib/types/commands/operations/drawing-align.operation.d.ts +43 -0
- package/lib/types/commands/operations/drawing-arrange.operation.d.ts +29 -0
- package/lib/types/commands/operations/drawing-group.operation.d.ts +37 -0
- package/lib/types/commands/operations/image-crop.operation.d.ts +38 -0
- package/lib/types/commands/operations/image-reset-size.operation.d.ts +17 -0
- package/lib/types/config/config.d.ts +22 -0
- package/lib/types/controllers/components.controller.d.ts +24 -0
- package/lib/types/controllers/drawing-update.controller.d.ts +49 -0
- package/lib/types/controllers/image-cropper.controller.d.ts +51 -0
- package/lib/types/controllers/image-update.controller.d.ts +37 -0
- package/lib/types/controllers/mobile/components.controller.d.ts +20 -0
- package/lib/types/controllers/mobile/image-cropper.controller.d.ts +51 -0
- package/lib/types/controllers/mobile/image-update.controller.d.ts +39 -0
- package/lib/types/controllers/mobile/ui.controller.d.ts +27 -0
- package/lib/types/controllers/ui.controller.d.ts +25 -0
- package/lib/types/controllers/utils.d.ts +31 -0
- package/lib/types/index.d.ts +43 -0
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/ca-ES.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +126 -0
- package/lib/types/locale/es-ES.d.ts +18 -0
- package/lib/types/locale/fa-IR.d.ts +18 -0
- package/lib/types/locale/fr-FR.d.ts +18 -0
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/ja-JP.d.ts +18 -0
- package/lib/types/locale/ko-KR.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/ru-RU.d.ts +18 -0
- package/lib/types/locale/sk-SK.d.ts +18 -0
- package/lib/types/locale/types.d.ts +18 -0
- package/lib/types/locale/vi-VN.d.ts +18 -0
- package/lib/types/locale/zh-CN.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/locale/zh-TW.d.ts +18 -0
- package/lib/types/menu/align.menu.d.ts +28 -0
- package/lib/types/menu/arrange.menu.d.ts +24 -0
- package/lib/types/menu/group.menu.d.ts +22 -0
- package/lib/types/menu/schema.d.ts +17 -0
- package/lib/types/mobile-plugin.d.ts +29 -0
- package/lib/types/plugin.d.ts +29 -0
- package/lib/types/services/drawing-image-clip.service.d.ts +48 -0
- package/lib/types/services/drawing-render.service.d.ts +52 -0
- package/lib/types/utils/clipboard-image.d.ts +25 -0
- package/lib/types/utils/config.d.ts +18 -0
- package/lib/types/utils/get-update-params.d.ts +19 -0
- package/lib/types/utils/image-crop-transform.d.ts +31 -0
- package/lib/types/utils/rotate-enabled.d.ts +19 -0
- package/lib/types/views/crop/MobileCropActions.d.ts +16 -0
- package/lib/types/views/crop/image-cropper-object.d.ts +49 -0
- package/lib/types/views/image-popup-menu/ImagePopupMenu.d.ts +46 -0
- package/lib/types/views/image-popup-menu/MobileImagePopupMenu.d.ts +26 -0
- package/lib/types/views/image-popup-menu/component-name.d.ts +17 -0
- package/lib/types/views/image-preview/mobile-image-preview-button.d.ts +37 -0
- package/lib/types/views/object-list-panel/MobileObjectListPanel.d.ts +17 -0
- package/lib/types/views/object-list-panel/ObjectListPanelBase.d.ts +174 -0
- package/lib/types/views/object-list-panel/object-list-panel-layer.d.ts +21 -0
- package/lib/types/views/panel/DrawingAlign.d.ts +21 -0
- package/lib/types/views/panel/DrawingArrange.d.ts +21 -0
- package/lib/types/views/panel/DrawingCommonPanel.d.ts +26 -0
- package/lib/types/views/panel/DrawingGroup.d.ts +21 -0
- package/lib/types/views/panel/DrawingTransform.d.ts +21 -0
- package/lib/types/views/panel/ImageCropper.d.ts +22 -0
- package/lib/types/views/panel/MobileDrawingArrange.d.ts +22 -0
- package/lib/types/views/panel/MobileDrawingControls.d.ts +32 -0
- package/lib/types/views/panel/MobileImageCropper.d.ts +17 -0
- package/lib/types/views/panel/component-name.d.ts +20 -0
- package/lib/types/views/panel/drawing-transform-rotation.d.ts +26 -0
- package/lib/types/views/panel/use-image-cropper.d.ts +31 -0
- package/lib/umd/index.js +13 -0
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -0
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/es-ES.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/fr-FR.js +1 -0
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -0
- package/lib/umd/locale/ko-KR.js +1 -0
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/sk-SK.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +84 -3
|
@@ -0,0 +1,29 @@
|
|
|
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 { IUniverDrawingUIConfig } from './config/config';
|
|
17
|
+
import { IConfigService, Injector, Plugin } from '@cool-office/core';
|
|
18
|
+
export declare class UniverDrawingMobileUIPlugin extends Plugin {
|
|
19
|
+
private readonly _config;
|
|
20
|
+
protected readonly _injector: Injector;
|
|
21
|
+
private readonly _configService;
|
|
22
|
+
static pluginName: string;
|
|
23
|
+
static packageName: string;
|
|
24
|
+
static version: string;
|
|
25
|
+
constructor(_config: Partial<IUniverDrawingUIConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
26
|
+
onStarting(): void;
|
|
27
|
+
onRendered(): void;
|
|
28
|
+
private _initDependencies;
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { IUniverDrawingUIConfig } from './config/config';
|
|
17
|
+
import { IConfigService, Injector, Plugin } from '@cool-office/core';
|
|
18
|
+
export declare class UniverDrawingUIPlugin extends Plugin {
|
|
19
|
+
private readonly _config;
|
|
20
|
+
protected _injector: Injector;
|
|
21
|
+
private readonly _configService;
|
|
22
|
+
static pluginName: string;
|
|
23
|
+
static packageName: string;
|
|
24
|
+
static version: string;
|
|
25
|
+
constructor(_config: Partial<IUniverDrawingUIConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
26
|
+
onStarting(): void;
|
|
27
|
+
onRendered(): void;
|
|
28
|
+
private _initDependencies;
|
|
29
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { IDisposable, Nullable } from '@cool-office/core';
|
|
17
|
+
import type { IImageShapeClipService, IShapeClipBounds, UniverRenderingContext } from '@cool-office/engine-render';
|
|
18
|
+
import { Disposable } from '@cool-office/core';
|
|
19
|
+
export declare const IMAGE_CLIP_SHAPE_PICKER_COMPONENT = "sheet.image-clip.shape.picker.component";
|
|
20
|
+
/**
|
|
21
|
+
* Delegate function type for building a shape clip path.
|
|
22
|
+
* The function should call ctx.beginPath(), build the shape outline path, and call ctx.clip().
|
|
23
|
+
* Coordinate system: (0,0) is at the top-left of the shape area.
|
|
24
|
+
* @returns The actual bounding rect of the clip region, or false if no clip was built
|
|
25
|
+
*/
|
|
26
|
+
export type ImageShapeClipDelegate = (ctx: UniverRenderingContext, prstGeom: string, width: number, height: number, adjustValues?: Nullable<Record<string, number>>) => IShapeClipBounds | false;
|
|
27
|
+
/**
|
|
28
|
+
* Bridge service that enables shape-based image clipping.
|
|
29
|
+
* This service lives in the open-source drawing-ui package and delegates
|
|
30
|
+
* to a registered clip implementation (provided by pro engine-shape package).
|
|
31
|
+
*
|
|
32
|
+
* When no delegate is registered, applyShapeClip returns false and images render normally without shape clipping.
|
|
33
|
+
*/
|
|
34
|
+
export declare class DrawingImageClipService extends Disposable implements IImageShapeClipService {
|
|
35
|
+
private _clipDelegate;
|
|
36
|
+
private readonly _canUseShapeClip$;
|
|
37
|
+
readonly canUseShapeClip$: import("rxjs").Observable<boolean>;
|
|
38
|
+
constructor();
|
|
39
|
+
setCanUseShapeClip(canUse: boolean): void;
|
|
40
|
+
/**
|
|
41
|
+
* Register a clip delegate that knows how to build shape clip paths.
|
|
42
|
+
* Typically called by the pro-side plugin with a ShapeModel-based implementation.
|
|
43
|
+
* @returns IDisposable to unregister the delegate
|
|
44
|
+
*/
|
|
45
|
+
registerClipDelegate(delegate: ImageShapeClipDelegate): IDisposable;
|
|
46
|
+
applyShapeClip(ctx: UniverRenderingContext, prstGeom: string, width: number, height: number, adjustValues?: Nullable<Record<string, number>>): IShapeClipBounds | false;
|
|
47
|
+
dispose(): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { IDrawingParam, IDrawingSearch } from '@cool-office/core';
|
|
17
|
+
import type { IDocFloatDomData, IImageData } from '@cool-office/drawing';
|
|
18
|
+
import type { BaseObject, IRectProps, Scene } from '@cool-office/engine-render';
|
|
19
|
+
import { BooleanNumber, IImageIoService, IUniverInstanceService, IURLImageService, PositionedObjectLayoutType } from '@cool-office/core';
|
|
20
|
+
import { IDrawingManagerService } from '@cool-office/drawing';
|
|
21
|
+
import { Image, Rect } from '@cool-office/engine-render';
|
|
22
|
+
import { IGalleryService } from '@cool-office/ui';
|
|
23
|
+
import { DrawingImageClipService } from './drawing-image-clip.service';
|
|
24
|
+
type IDrawingParamWithBehindText = (Partial<IDrawingParam> | Partial<IImageData>) & {
|
|
25
|
+
behindText?: boolean | BooleanNumber;
|
|
26
|
+
behindDoc?: BooleanNumber;
|
|
27
|
+
layoutType?: PositionedObjectLayoutType;
|
|
28
|
+
docxHeaderFooterDrawing?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const DOC_DRAWING_BEHIND_TEXT_LAYER_INDEX = 1;
|
|
31
|
+
export declare function getDrawingRenderLayerIndex(param: IDrawingParamWithBehindText): number;
|
|
32
|
+
export declare function ensureDrawingRenderLayer(scene: Scene, object: BaseObject, param: IDrawingParamWithBehindText): void;
|
|
33
|
+
export declare class DrawingRenderService {
|
|
34
|
+
private readonly _drawingManagerService;
|
|
35
|
+
private readonly _imageIoService;
|
|
36
|
+
private readonly _galleryService;
|
|
37
|
+
private readonly _urlImageService;
|
|
38
|
+
private readonly _univerInstanceService;
|
|
39
|
+
private readonly _drawingImageClipService;
|
|
40
|
+
constructor(_drawingManagerService: IDrawingManagerService, _imageIoService: IImageIoService, _galleryService: IGalleryService, _urlImageService: IURLImageService, _univerInstanceService: IUniverInstanceService, _drawingImageClipService: DrawingImageClipService);
|
|
41
|
+
renderImages(imageParam: IImageData, scene: Scene, options?: {
|
|
42
|
+
allowInactiveSheet?: boolean;
|
|
43
|
+
}): Promise<Image[] | undefined>;
|
|
44
|
+
private _getActiveSheetId;
|
|
45
|
+
renderFloatDom(param: IDocFloatDomData, scene: Scene): Rect<IRectProps>[] | undefined;
|
|
46
|
+
renderDrawing(param: IDrawingSearch, scene: Scene, options?: {
|
|
47
|
+
allowInactiveSheet?: boolean;
|
|
48
|
+
}): Promise<Image[] | undefined> | undefined;
|
|
49
|
+
previewImage(key: string, src: string, width: number, height: number): void;
|
|
50
|
+
private _adjustImageSize;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { IImageIoService } from '@cool-office/core';
|
|
17
|
+
import { ImageSourceType } from '@cool-office/core';
|
|
18
|
+
export declare function extractClipboardImageFiles(clipboardData: DataTransfer): File[];
|
|
19
|
+
export declare function isClipboardTextImage(text: string): boolean;
|
|
20
|
+
export declare function extractClipboardTextImageFile(text: string): Promise<File | null>;
|
|
21
|
+
export declare function isImageOnlyClipboardHtml(html: string): boolean;
|
|
22
|
+
export declare function extractClipboardHtmlImageFiles(html: string): Promise<File[]>;
|
|
23
|
+
export declare function normalizeClipboardImageFile(file: File): Promise<File | null>;
|
|
24
|
+
export declare function svgImageFileToDataUrl(file: File): Promise<string | null>;
|
|
25
|
+
export declare function writeImageSourceToClipboard(source: string, imageSourceType?: ImageSourceType, imageIoService?: IImageIoService): Promise<boolean>;
|
|
@@ -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
|
+
export declare const MIN_DRAWING_WIDTH_LIMIT = 20;
|
|
17
|
+
export declare const MIN_DRAWING_HEIGHT_LIMIT = 20;
|
|
18
|
+
export declare const RANGE_DRAWING_ROTATION_LIMIT: number[];
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { IDrawingParam, Nullable } from '@cool-office/core';
|
|
17
|
+
import type { IDrawingManagerService } from '@cool-office/drawing';
|
|
18
|
+
import type { BaseObject } from '@cool-office/engine-render';
|
|
19
|
+
export declare function getUpdateParams(objects: Map<string, BaseObject>, drawingManagerService: IDrawingManagerService): Nullable<IDrawingParam>[];
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { BaseObject } from '@cool-office/engine-render';
|
|
17
|
+
/** Crop insets in image coordinates, accounting for rotation around different centers. */
|
|
18
|
+
export declare function getImageCropRect(image: Pick<BaseObject, 'left' | 'top' | 'width' | 'height' | 'angle'>, crop: Pick<BaseObject, 'left' | 'top' | 'width' | 'height'>): {
|
|
19
|
+
srcRect: {
|
|
20
|
+
left: number;
|
|
21
|
+
top: number;
|
|
22
|
+
right: number;
|
|
23
|
+
bottom: number;
|
|
24
|
+
};
|
|
25
|
+
srcRectAngle: {
|
|
26
|
+
left: number;
|
|
27
|
+
top: number;
|
|
28
|
+
right: number;
|
|
29
|
+
bottom: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { DrawingType, IDrawingParam } from '@cool-office/core';
|
|
17
|
+
import type { IDrawingRotateEnabledResolverOptions } from '@cool-office/drawing';
|
|
18
|
+
export declare function isKnownDrawingUINonRotatableType(drawingType: DrawingType): boolean;
|
|
19
|
+
export declare function resolveDrawingUIRotateEnabled(drawing: IDrawingParam, options?: IDrawingRotateEnabledResolverOptions): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export declare function MobileCropActions(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { ISrcRect, ITransformState, Nullable } from '@cool-office/core';
|
|
17
|
+
import type { IShapeProps, IViewportInfo, UniverRenderingContext, Vector2 } from '@cool-office/engine-render';
|
|
18
|
+
import { Shape } from '@cool-office/engine-render';
|
|
19
|
+
export interface IImageCropperObjectProps extends IShapeProps {
|
|
20
|
+
/**
|
|
21
|
+
* 20.1.8.55 srcRect (Source Rectangle)
|
|
22
|
+
*/
|
|
23
|
+
srcRect?: Nullable<ISrcRect>;
|
|
24
|
+
/**
|
|
25
|
+
* 20.1.9.18 prstGeom (Preset geometry)
|
|
26
|
+
*/
|
|
27
|
+
prstGeom?: Nullable<string>;
|
|
28
|
+
applyTransform?: ITransformState;
|
|
29
|
+
dragPadding?: number;
|
|
30
|
+
}
|
|
31
|
+
export declare class ImageCropperObject<T extends IImageCropperObjectProps = IImageCropperObjectProps> extends Shape<T> {
|
|
32
|
+
private _srcRect;
|
|
33
|
+
private _prstGeom;
|
|
34
|
+
private _applyTransform;
|
|
35
|
+
private _dragPadding;
|
|
36
|
+
private _cacheCanvas;
|
|
37
|
+
constructor(key?: string, props?: T);
|
|
38
|
+
refreshSrcRect(value: Nullable<ISrcRect>, transform: Nullable<ITransformState>): void;
|
|
39
|
+
get srcRect(): Nullable<ISrcRect>;
|
|
40
|
+
dispose(): void;
|
|
41
|
+
isHit(coord: Vector2): boolean;
|
|
42
|
+
private _inSurround;
|
|
43
|
+
render(mainCtx: UniverRenderingContext, bounds?: IViewportInfo): this;
|
|
44
|
+
protected _draw(ctx: UniverRenderingContext): void;
|
|
45
|
+
private _clipForApplyObject;
|
|
46
|
+
private _applyProps;
|
|
47
|
+
private _applyCache;
|
|
48
|
+
private _initialCacheCanvas;
|
|
49
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { IValueOption } from '@cool-office/ui';
|
|
17
|
+
export interface IImagePopupMenuItem {
|
|
18
|
+
label: string;
|
|
19
|
+
index: number;
|
|
20
|
+
commandId: string;
|
|
21
|
+
commandParams?: object;
|
|
22
|
+
disable: boolean;
|
|
23
|
+
type?: 'button' | 'select';
|
|
24
|
+
value?: string;
|
|
25
|
+
options?: Array<{
|
|
26
|
+
icon?: string;
|
|
27
|
+
label: IValueOption['label'];
|
|
28
|
+
value: string;
|
|
29
|
+
}>;
|
|
30
|
+
commandParamsFactory?: (value: string) => object;
|
|
31
|
+
hideOnClick?: boolean;
|
|
32
|
+
icon?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IImagePopupMenuExtraProps {
|
|
35
|
+
menuItems: IImagePopupMenuItem[];
|
|
36
|
+
variant?: 'doc-floating-toolbar' | 'doc-chart-floating-toolbar';
|
|
37
|
+
unitId?: string;
|
|
38
|
+
subUnitId?: string;
|
|
39
|
+
drawingId?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface IImagePopupMenuProps {
|
|
42
|
+
popup: {
|
|
43
|
+
extraProps?: IImagePopupMenuExtraProps;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export declare function ImagePopupMenu(props: IImagePopupMenuProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { IImagePopupMenuExtraProps } from './ImagePopupMenu';
|
|
17
|
+
interface IMobileImagePopupMenuProps {
|
|
18
|
+
popup: {
|
|
19
|
+
extraProps?: Pick<IImagePopupMenuExtraProps, 'menuItems' | 'variant'> & {
|
|
20
|
+
dialogId?: string;
|
|
21
|
+
onClose?: () => void;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function MobileImagePopupMenu({ popup }: IMobileImagePopupMenuProps): import("react").JSX.Element | null;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export declare const COMPONENT_IMAGE_POPUP_MENU = "COMPONENT_IMAGE_POPUP_MENU";
|
|
17
|
+
export declare const COMPONENT_MOBILE_IMAGE_POPUP_MENU = "COMPONENT_MOBILE_IMAGE_POPUP_MENU";
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { ThemeService } from '@cool-office/core';
|
|
17
|
+
import type { Image, Scene, UniverRenderingContext } from '@cool-office/engine-render';
|
|
18
|
+
import { Rect } from '@cool-office/engine-render';
|
|
19
|
+
/** Transient canvas chrome: never part of the image model or its transformer. */
|
|
20
|
+
export declare class MobileImagePreviewButton extends Rect {
|
|
21
|
+
private readonly _image;
|
|
22
|
+
private readonly _scene;
|
|
23
|
+
private _enabled;
|
|
24
|
+
private readonly _icon;
|
|
25
|
+
private readonly _iconContainer;
|
|
26
|
+
private readonly _gesture;
|
|
27
|
+
private _pressed;
|
|
28
|
+
private _background;
|
|
29
|
+
private _border;
|
|
30
|
+
private _pressedBackground;
|
|
31
|
+
constructor(_image: Image, _scene: Scene, themeService: ThemeService, preview: () => void);
|
|
32
|
+
setPreviewEnabled(enabled: boolean): void;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
private _setPressed;
|
|
35
|
+
private _syncPosition;
|
|
36
|
+
protected _draw(ctx: UniverRenderingContext): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { IObjectListPanelBaseProps } from './ObjectListPanelBase';
|
|
17
|
+
export declare function MobileObjectListPanel(props: IObjectListPanelBaseProps): import("react").JSX.Element;
|