@univerjs-pro/slides-ui 1.0.0-alpha.2 → 1.0.0-alpha.4
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/README.md +5 -2
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/index.css +155 -120
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/components/canvas-view/CanvasView.d.ts +141 -3
- package/lib/types/components/editor-content/EditorContent.d.ts +4 -1
- package/lib/types/components/embed-child-workbench/SlideEmbedChildWorkbench.d.ts +7 -0
- package/lib/types/components/embed-floating-menu/SlideEmbedFloatingMenu.d.ts +33 -0
- package/lib/types/components/embed-floating-preview/SlideEmbedFloatingPreview.d.ts +24 -0
- package/lib/types/components/embed-floating-preview/SlideEmbedFloatingPreview.spec.d.ts +4 -0
- package/lib/types/components/host-ui/SlideHostUiParts.d.ts +7 -0
- package/lib/types/components/insert-toolbar/ShapePicker.d.ts +1 -5
- package/lib/types/components/object-list-panel/slide-object-list-state.d.ts +1 -0
- package/lib/types/components/presentation/SlidePresentationEmbedLayer.d.ts +34 -0
- package/lib/types/components/table-size/SlideTableSizePicker.d.ts +2 -12
- package/lib/types/components/thumbnail-bar/ThumbnailBar.d.ts +21 -0
- package/lib/types/controllers/slide-connector-endpoint.controller.d.ts +1 -1
- package/lib/types/controllers/slide-contextual-ribbon.controller.d.ts +10 -1
- package/lib/types/controllers/slide-drawing-selection.controller.d.ts +15 -3
- package/lib/types/controllers/slide-drawing-transform.controller.d.ts +3 -0
- package/lib/types/controllers/slide-drawing-transformer-config.util.d.ts +3 -1
- package/lib/types/controllers/slide-image-cropper.controller.d.ts +20 -1
- package/lib/types/controllers/slide-render.controller.d.ts +2 -0
- package/lib/types/default-config.d.ts +2 -2
- package/lib/types/embed-active-page.d.ts +5 -0
- package/lib/types/embed-floating-menu-stage.d.ts +14 -0
- package/lib/types/embed-focus-owner.d.ts +40 -0
- package/lib/types/index.d.ts +30 -7
- package/lib/types/locale/en-US.d.ts +25 -0
- package/lib/types/quick-styles/presets.d.ts +4 -3
- package/lib/types/render-objects/document-text-render.util.d.ts +7 -0
- package/lib/types/render-objects/index.d.ts +1 -0
- package/lib/types/render-objects/placeholder-object/index.d.ts +1 -0
- package/lib/types/render-objects/placeholder-object/placeholder-text-rect.util.d.ts +7 -0
- package/lib/types/render-objects/slide-drawing-base.d.ts +1 -3
- package/lib/types/render-objects/slide-image-object.d.ts +7 -2
- package/lib/types/render-objects/slide-page-background-object.d.ts +6 -3
- package/lib/types/render-objects/slide-shape-object.d.ts +2 -2
- package/lib/types/render-objects/slide-table-object.d.ts +11 -6
- package/lib/types/services/slide-canvas-pop-manager.service.d.ts +2 -1
- package/lib/types/services/slide-embed-integration.service.d.ts +51 -0
- package/lib/types/services/slide-embed-runtime.service.d.ts +50 -0
- package/lib/types/services/slide-hit-test.service.d.ts +2 -0
- package/lib/types/services/slide-insert.service.d.ts +8 -6
- package/lib/types/slide-editor/const.d.ts +1 -0
- package/lib/types/slide-editor/controllers/shape-text-float-menu.render-controller.d.ts +1 -2
- package/lib/types/slide-editor/editor-ui/index.d.ts +1 -1
- package/lib/types/slide-editor/editor-ui/utils/render.d.ts +13 -3
- package/lib/types/slide-editor/services/slide-text-editing.service.d.ts +3 -1
- package/lib/types/utils/shape-text-style.util.d.ts +8 -6
- package/lib/types/views/render/adaptors/image-adaptor.d.ts +4 -4
- package/lib/types/views/render/adaptors/placeholder-adaptor.d.ts +3 -4
- package/lib/types/views/render/adaptors/shape-adaptor.d.ts +3 -4
- package/lib/types/views/render/adaptors/table-adaptor.d.ts +4 -4
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +18 -19
- package/lib/types/slide-editor/views/shape-text-editor/ShapeTextFloatToolbar.d.ts +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IShapeRect } from '@univerjs-pro/engine-shape';
|
|
2
|
+
export declare const SLIDE_PLACEHOLDER_TEXT_HORIZONTAL_INSET = 12;
|
|
3
|
+
export declare const SLIDE_PLACEHOLDER_TEXT_VERTICAL_INSET: number;
|
|
4
|
+
export declare function resolveSlidePlaceholderTextRect(width: number, height: number, options?: {
|
|
5
|
+
horizontalInset?: number;
|
|
6
|
+
verticalInset?: number;
|
|
7
|
+
}): IShapeRect;
|
|
@@ -27,9 +27,7 @@ export declare abstract class SlideDrawingBase<T extends ISlideElementBase = ISl
|
|
|
27
27
|
updateTransform(transform: Partial<ISlideDrawingTransform>): void;
|
|
28
28
|
isVisible(): boolean;
|
|
29
29
|
setVisible(visible: boolean): void;
|
|
30
|
-
|
|
31
|
-
setLocked(locked: boolean): void;
|
|
32
|
-
/** Selectable when not locked and `selectable` is not explicitly false. */
|
|
30
|
+
/** Selectable when `selectable` is not explicitly false. */
|
|
33
31
|
isSelectable(): boolean;
|
|
34
32
|
/** Emit the current snapshot without any mutation (forces re-render). */
|
|
35
33
|
protected _emit(): void;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { IShapeShadowEffect } from '@univerjs-pro/engine-shape';
|
|
1
2
|
import type { ISlideConnectionSite } from '@univerjs-pro/slides';
|
|
2
|
-
import type { IImageIoService } from '@univerjs/
|
|
3
|
+
import type { IImageIoService } from '@univerjs/core';
|
|
3
4
|
import type { IImageProps, IViewportInfo, UniverRenderingContext } from '@univerjs/engine-render';
|
|
4
5
|
import { SlidePresentationBackgroundGraphicFitEnum } from '@univerjs-pro/slides';
|
|
5
|
-
import { ImageSourceType } from '@univerjs/
|
|
6
|
+
import { ImageSourceType } from '@univerjs/core';
|
|
6
7
|
import { Image } from '@univerjs/engine-render';
|
|
7
8
|
export interface ISlideImageObjectProps extends IImageProps {
|
|
8
9
|
backgroundImageFit?: SlidePresentationBackgroundGraphicFitEnum;
|
|
10
|
+
outerShadow?: IShapeShadowEffect;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Slide image runtime object.
|
|
@@ -16,6 +18,7 @@ export interface ISlideImageObjectProps extends IImageProps {
|
|
|
16
18
|
*/
|
|
17
19
|
export declare class SlideImageObject extends Image {
|
|
18
20
|
private readonly _backgroundImageFit?;
|
|
21
|
+
private readonly _outerShadow?;
|
|
19
22
|
constructor(key: string, props: ISlideImageObjectProps);
|
|
20
23
|
/** Rectangle-like default connection sites: top/right/bottom/left. */
|
|
21
24
|
getConnectionSites(): ISlideConnectionSite[];
|
|
@@ -23,5 +26,7 @@ export declare class SlideImageObject extends Image {
|
|
|
23
26
|
setNativeImage(native: HTMLImageElement): void;
|
|
24
27
|
protected _draw(ctx: UniverRenderingContext, bounds?: IViewportInfo, renderWidth?: number, renderHeight?: number): void;
|
|
25
28
|
private _drawPictureStroke;
|
|
29
|
+
private _drawPictureShadow;
|
|
30
|
+
private _tracePicturePath;
|
|
26
31
|
private _applyResolvedSource;
|
|
27
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ISlideBackgroundData } from '@univerjs-pro/slides';
|
|
2
2
|
import type { IViewportInfo, UniverRenderingContext } from '@univerjs/engine-render';
|
|
3
|
-
import { IImageIoService } from '@univerjs/
|
|
3
|
+
import { IImageIoService } from '@univerjs/core';
|
|
4
4
|
import { Rect } from '@univerjs/engine-render';
|
|
5
5
|
interface ISlidePageBackgroundObjectProps {
|
|
6
6
|
left: number;
|
|
@@ -13,20 +13,23 @@ interface ISlidePageBackgroundObjectProps {
|
|
|
13
13
|
requestRender?: () => void;
|
|
14
14
|
}
|
|
15
15
|
export declare class SlidePageBackgroundObject extends Rect<ISlidePageBackgroundObjectProps> {
|
|
16
|
-
private readonly _imageIoService
|
|
16
|
+
private readonly _imageIoService;
|
|
17
17
|
private static readonly _imageNativeCache;
|
|
18
18
|
private static readonly _imageLoadingCache;
|
|
19
19
|
private _background?;
|
|
20
20
|
private _native?;
|
|
21
21
|
private readonly _requestRender?;
|
|
22
|
-
constructor(key: string, props: ISlidePageBackgroundObjectProps, _imageIoService
|
|
22
|
+
constructor(key: string, props: ISlidePageBackgroundObjectProps, _imageIoService: IImageIoService);
|
|
23
23
|
updateBackground(background?: ISlideBackgroundData): void;
|
|
24
24
|
protected _draw(ctx: UniverRenderingContext, _bounds?: IViewportInfo, renderWidth?: number, renderHeight?: number): void;
|
|
25
25
|
private _prepareImage;
|
|
26
26
|
private _markImageReady;
|
|
27
27
|
private _createImagePromise;
|
|
28
28
|
private _drawImage;
|
|
29
|
+
private _drawRepeatedImage;
|
|
29
30
|
private _createGradient;
|
|
31
|
+
private _resolveGradientStops;
|
|
32
|
+
private _interpolateGradientStopSegment;
|
|
30
33
|
private _createPattern;
|
|
31
34
|
private _withAlpha;
|
|
32
35
|
private _normalizeColor;
|
|
@@ -42,6 +42,7 @@ export declare class SlideShapeObject extends Shape<ISlideShapeObjectProps> {
|
|
|
42
42
|
updateElement(element: ISlideShapeElement): void;
|
|
43
43
|
getElement(): ISlideShapeElement;
|
|
44
44
|
getShapeModel(): ShapeModel;
|
|
45
|
+
measureTextBoxNaturalCrossSize(width: number, height: number): number | null;
|
|
45
46
|
isLineShape(): boolean;
|
|
46
47
|
/**
|
|
47
48
|
* Returns the text rect in top-left-origin coordinates `{ 0, 0, w, h }` space.
|
|
@@ -53,12 +54,11 @@ export declare class SlideShapeObject extends Shape<ISlideShapeObjectProps> {
|
|
|
53
54
|
getTextRect(width: number, height: number): IShapeRect;
|
|
54
55
|
setEditing(isEditing: boolean): void;
|
|
55
56
|
setFillImage(image?: HTMLImageElement): void;
|
|
56
|
-
private
|
|
57
|
+
private _applyNoWrapAutoFitSize;
|
|
57
58
|
_draw(ctx: UniverRenderingContext, _bounds?: IViewportInfo, renderWidth?: number, renderHeight?: number): void;
|
|
58
59
|
private _drawShapeText;
|
|
59
60
|
private _applyReadableTextFlip;
|
|
60
61
|
private _renderShapePath;
|
|
61
|
-
private _applyOuterShadow;
|
|
62
62
|
render(mainCtx: UniverRenderingContext, bounds: IViewportInfo): this;
|
|
63
63
|
getInverseCoord(coord: Vector2): Vector2;
|
|
64
64
|
dispose(): void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { ISlideConnectionSite } from '@univerjs-pro/slides';
|
|
2
|
-
import type { ISlideTableCellRange, ISlideTableSnapshot, ISlideTableTrigger } from '@univerjs-pro/slides-table';
|
|
3
|
-
import type { LocaleService } from '@univerjs/core';
|
|
4
|
-
import type { IImageIoService } from '@univerjs/drawing';
|
|
2
|
+
import type { ISlideTableCellRange, ISlideTableSnapshot, ISlideTableThemePalette, ISlideTableThemeSnapshot, ISlideTableTrigger } from '@univerjs-pro/slides-table';
|
|
3
|
+
import type { IImageIoService, LocaleService } from '@univerjs/core';
|
|
5
4
|
import type { IRectProps, IViewportInfo, UniverRenderingContext, Vector2 } from '@univerjs/engine-render';
|
|
6
5
|
import { Rect } from '@univerjs/engine-render';
|
|
7
6
|
export interface ISlideTableObjectProps extends IRectProps {
|
|
8
7
|
table?: ISlideTableSnapshot;
|
|
9
|
-
imageIoService
|
|
8
|
+
imageIoService: IImageIoService;
|
|
10
9
|
localeService?: LocaleService;
|
|
10
|
+
tableThemes?: Record<string, ISlideTableThemeSnapshot>;
|
|
11
|
+
tableThemePalette?: ISlideTableThemePalette;
|
|
11
12
|
}
|
|
12
13
|
export interface ISlideTableCellTextRect {
|
|
13
14
|
left: number;
|
|
@@ -55,8 +56,10 @@ export declare class SlideTableObject extends Rect<ISlideTableObjectProps> {
|
|
|
55
56
|
private static readonly _imageLoadingCache;
|
|
56
57
|
isDrawingObject: boolean;
|
|
57
58
|
private readonly _table?;
|
|
58
|
-
private readonly _imageIoService
|
|
59
|
+
private readonly _imageIoService;
|
|
59
60
|
private readonly _localeService?;
|
|
61
|
+
private readonly _tableThemes?;
|
|
62
|
+
private readonly _tableThemePalette?;
|
|
60
63
|
private readonly _textRenderCaches;
|
|
61
64
|
private _editingCell;
|
|
62
65
|
private _previewTable;
|
|
@@ -81,11 +84,12 @@ export declare class SlideTableObject extends Rect<ISlideTableObjectProps> {
|
|
|
81
84
|
isHit(coord: Vector2): boolean;
|
|
82
85
|
getCellTextRect(row: number, column: number, width?: number, height?: number): ISlideTableCellTextRect | null;
|
|
83
86
|
_draw(ctx: UniverRenderingContext, _bounds?: IViewportInfo, renderWidth?: number, renderHeight?: number): void;
|
|
87
|
+
private _drawTableOuterShadow;
|
|
84
88
|
private _drawRowFills;
|
|
85
89
|
private _drawGrid;
|
|
86
|
-
private _drawResolvedGrid;
|
|
87
90
|
private _drawTableOutline;
|
|
88
91
|
private _drawCellFills;
|
|
92
|
+
private _drawMatchingCellFillSeams;
|
|
89
93
|
private _drawCellBorders;
|
|
90
94
|
private _drawCellHover;
|
|
91
95
|
private _drawCellTexts;
|
|
@@ -115,6 +119,7 @@ export declare class SlideTableObject extends Rect<ISlideTableObjectProps> {
|
|
|
115
119
|
private _isEditingCell;
|
|
116
120
|
private _shouldHideCellTextForEditor;
|
|
117
121
|
private _getRenderTable;
|
|
122
|
+
private _resolveRenderModel;
|
|
118
123
|
private _resolvePictureFill;
|
|
119
124
|
private _createImagePromise;
|
|
120
125
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IDisposable } from '@univerjs/core';
|
|
2
|
-
import type { BaseObject } from '@univerjs/engine-render';
|
|
2
|
+
import type { BaseObject, IBoundRectNoAngle } from '@univerjs/engine-render';
|
|
3
3
|
import type { IPopup } from '@univerjs/ui';
|
|
4
4
|
import { Disposable } from '@univerjs/core';
|
|
5
5
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
@@ -14,4 +14,5 @@ export declare class SlideCanvasPopManagerService extends Disposable {
|
|
|
14
14
|
constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService);
|
|
15
15
|
private _createObjectPositionObserver;
|
|
16
16
|
attachPopupToObject(unitId: string, subUnitId: string, targetObject: BaseObject, popup: ISlideCanvasPopup): IDisposable;
|
|
17
|
+
attachPopupToClientRect(unitId: string, subUnitId: string, bound: IBoundRectNoAngle, popup: ISlideCanvasPopup): IDisposable;
|
|
17
18
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ISlidePage, ISlideTextElement } from '@univerjs-pro/slides';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { Observable } from 'rxjs';
|
|
4
|
+
export interface ISlideEmbedFloatingActivation {
|
|
5
|
+
hostUnitId: string;
|
|
6
|
+
childUnitId: string;
|
|
7
|
+
embedId: string;
|
|
8
|
+
stage?: 'inactive' | 'stage1' | 'stage2';
|
|
9
|
+
}
|
|
10
|
+
export interface ISlideEmbedFloatingActiveService {
|
|
11
|
+
active$: Observable<ISlideEmbedFloatingActivation | null>;
|
|
12
|
+
getActive(): ISlideEmbedFloatingActivation | null;
|
|
13
|
+
clear(embedId?: string): void;
|
|
14
|
+
}
|
|
15
|
+
export declare const ISlideEmbedFloatingActiveService: import("@wendellhu/redi").IdentifierDecorator<ISlideEmbedFloatingActiveService>;
|
|
16
|
+
export interface ISlideEmbedMountSession {
|
|
17
|
+
hostUnitId: string;
|
|
18
|
+
childUnitId?: string;
|
|
19
|
+
embedId: string;
|
|
20
|
+
entry: string;
|
|
21
|
+
layout?: string;
|
|
22
|
+
context?: {
|
|
23
|
+
descriptor: {
|
|
24
|
+
hostAnchorId: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface ISlideEmbedMountService {
|
|
29
|
+
listSessions(): ISlideEmbedMountSession[];
|
|
30
|
+
}
|
|
31
|
+
export declare const ISlideEmbedMountService: import("@wendellhu/redi").IdentifierDecorator<ISlideEmbedMountService>;
|
|
32
|
+
export interface ISlideEmbedActivationService {
|
|
33
|
+
clearTab(embedId: string): void;
|
|
34
|
+
clearFloating(embedId: string, hostUnitId: string): void;
|
|
35
|
+
}
|
|
36
|
+
export declare const ISlideEmbedActivationService: import("@wendellhu/redi").IdentifierDecorator<ISlideEmbedActivationService>;
|
|
37
|
+
export declare function resolveSlideEmbedFloatingElements(page: Pick<ISlidePage, 'elementOrder' | 'elements'> | null | undefined): Array<{
|
|
38
|
+
element: ISlideTextElement;
|
|
39
|
+
zIndex: number;
|
|
40
|
+
}>;
|
|
41
|
+
export interface ISlideEmbedFloatDomRendererProps {
|
|
42
|
+
data: unknown;
|
|
43
|
+
onRuntimeStageEnter?: (stage: 'inactive' | 'stage1' | 'stage2') => void;
|
|
44
|
+
floatingChromeZIndex?: number;
|
|
45
|
+
enableStage1BodyDrag?: boolean;
|
|
46
|
+
isExternalHostInteraction?: (event: PointerEvent) => boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface ISlideEmbedFloatDomRenderer {
|
|
49
|
+
render(props: ISlideEmbedFloatDomRendererProps): ReactNode;
|
|
50
|
+
}
|
|
51
|
+
export declare const ISlideEmbedFloatDomRenderer: import("@wendellhu/redi").IdentifierDecorator<ISlideEmbedFloatDomRenderer>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { IDisposable, UniverInstanceType } from '@univerjs/core';
|
|
2
|
+
export interface ISlideEmbedPageListMountParams {
|
|
3
|
+
hostUnitId: string;
|
|
4
|
+
embedId: string;
|
|
5
|
+
hostAnchorId: string;
|
|
6
|
+
childUnitId: string;
|
|
7
|
+
childType: UniverInstanceType;
|
|
8
|
+
}
|
|
9
|
+
export interface ISlideEmbedFloatingObjectMountParams {
|
|
10
|
+
hostElement: HTMLElement;
|
|
11
|
+
hostUnitId: string;
|
|
12
|
+
embedId: string;
|
|
13
|
+
hostAnchorId: string;
|
|
14
|
+
childUnitId: string;
|
|
15
|
+
childType: UniverInstanceType;
|
|
16
|
+
}
|
|
17
|
+
export interface ISlideEmbedPresentationMountParams {
|
|
18
|
+
hostElement: HTMLElement;
|
|
19
|
+
hostUnitId: string;
|
|
20
|
+
slideId: string;
|
|
21
|
+
embedId: string;
|
|
22
|
+
hostAnchorId: string;
|
|
23
|
+
childUnitId?: string;
|
|
24
|
+
childType?: UniverInstanceType;
|
|
25
|
+
entry: 'slides-floating-object' | 'slides-page-list-block';
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
dpr: number;
|
|
29
|
+
}
|
|
30
|
+
export interface ISlideEmbedRuntimeSession {
|
|
31
|
+
embedId: string;
|
|
32
|
+
hostUnitId: string;
|
|
33
|
+
entry: string;
|
|
34
|
+
childType?: UniverInstanceType;
|
|
35
|
+
childUnitId?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ISlideEmbedRuntimeService {
|
|
38
|
+
mountPageList(params: ISlideEmbedPageListMountParams): IDisposable | undefined;
|
|
39
|
+
mountFloatingObject(params: ISlideEmbedFloatingObjectMountParams): IDisposable | undefined;
|
|
40
|
+
clearAndUnmount(embedId: string): void;
|
|
41
|
+
unmountFloatingSessions(hostUnitId: string): void;
|
|
42
|
+
listSessions(): ISlideEmbedRuntimeSession[];
|
|
43
|
+
capturePreviewByHostAnchorId(hostAnchorId: string): Promise<string | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* Optional so standalone Slides does not depend on EmbedUI. The EmbedUI
|
|
46
|
+
* contribution supplies the real presentation runtime when installed.
|
|
47
|
+
*/
|
|
48
|
+
mountPresentationEmbed?(params: ISlideEmbedPresentationMountParams): IDisposable | undefined;
|
|
49
|
+
}
|
|
50
|
+
export declare const ISlideEmbedRuntimeService: import("@wendellhu/redi").IdentifierDecorator<ISlideEmbedRuntimeService>;
|
|
@@ -118,6 +118,8 @@ export declare class SlideHitTestService extends RxDisposable implements ISlideH
|
|
|
118
118
|
private _toScenePoint;
|
|
119
119
|
private _resolveDeepestHitFromGroup;
|
|
120
120
|
private _resolveTopGroupSelectionTarget;
|
|
121
|
+
private _isSelectableDrawing;
|
|
122
|
+
private _getLatestDrawingForOKey;
|
|
121
123
|
private _resolveParentGroupId;
|
|
122
124
|
private _collectGroupDescendantIds;
|
|
123
125
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ISlideInsertShapeOptions, ISlideInsertTextBoxOptions } from '@univerjs-pro/slides';
|
|
2
|
-
import {
|
|
3
|
-
import { IImageIoService,
|
|
2
|
+
import type { ImageSourceType } from '@univerjs/core';
|
|
3
|
+
import { ICommandService, IImageIoService, IUniverInstanceService } from '@univerjs/core';
|
|
4
|
+
import { SlideTextEditingService } from '../slide-editor/services/slide-text-editing.service';
|
|
4
5
|
import { ISlideDrawingStateService } from './slide-drawing-state.service';
|
|
5
6
|
export interface ISlideInsertTableOptions {
|
|
6
7
|
rows?: number;
|
|
@@ -11,10 +12,12 @@ export interface ISlideInsertTableOptions {
|
|
|
11
12
|
export declare class SlideInsertService {
|
|
12
13
|
private readonly _instanceService;
|
|
13
14
|
private readonly _commandService;
|
|
14
|
-
private readonly
|
|
15
|
-
private readonly
|
|
16
|
-
|
|
15
|
+
private readonly _textEditingService;
|
|
16
|
+
private readonly _imageIoService;
|
|
17
|
+
private readonly _drawingStateService;
|
|
18
|
+
constructor(_instanceService: IUniverInstanceService, _commandService: ICommandService, _textEditingService: SlideTextEditingService, _imageIoService: IImageIoService, _drawingStateService: ISlideDrawingStateService);
|
|
17
19
|
insertShape(options: ISlideInsertShapeOptions): boolean;
|
|
20
|
+
private _insertShape;
|
|
18
21
|
insertTextBox(options?: ISlideInsertTextBoxOptions): boolean;
|
|
19
22
|
insertTable(options?: ISlideInsertTableOptions): boolean;
|
|
20
23
|
insertImage(file: File): Promise<boolean>;
|
|
@@ -30,5 +33,4 @@ export declare class SlideInsertService {
|
|
|
30
33
|
private _resolveTextBoxIsHorizontal;
|
|
31
34
|
private _fitSize;
|
|
32
35
|
private _resolveImageSource;
|
|
33
|
-
private _fileToDataUrl;
|
|
34
36
|
}
|
|
@@ -3,7 +3,6 @@ import type { IRenderContext } from '@univerjs/engine-render';
|
|
|
3
3
|
import { ShapeTextFloatMenuRenderControllerBase } from '@univerjs-pro/shape-editor-ui';
|
|
4
4
|
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
5
5
|
import { DocCanvasPopManagerService, DocSelectionRenderService } from '@univerjs/docs-ui';
|
|
6
|
-
import { ComponentManager } from '@univerjs/ui';
|
|
7
6
|
export declare class ShapeTextFloatMenuRenderController extends ShapeTextFloatMenuRenderControllerBase {
|
|
8
|
-
constructor(context: IRenderContext<DocumentDataModel>, docSelectionManagerService: DocSelectionManagerService, docCanvasPopManagerService: DocCanvasPopManagerService,
|
|
7
|
+
constructor(context: IRenderContext<DocumentDataModel>, docSelectionManagerService: DocSelectionManagerService, docCanvasPopManagerService: DocCanvasPopManagerService, docSelectionRenderService: DocSelectionRenderService);
|
|
9
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { EDITOR_UI_PLUGIN_CONFIG_KEY } from './config/config';
|
|
2
2
|
export type { IUniverEditorUIConfig } from './config/config';
|
|
3
3
|
export { EditorUIService, IEditorUIService } from './services/editor-ui.service';
|
|
4
|
-
export type { IEditorUIDocumentLayout, IEditorUIInsets, IEditorUIKeyboardEvent, IEditorUILayoutMeasurement, IEditorUIOpenOptions, IEditorUIRect, IEditorUIScale, IEditorUISession, IEditorUITransform, } from './types';
|
|
4
|
+
export type { IEditorUIDocumentLayout, IEditorUIInsets, IEditorUIKeyboardEvent, IEditorUILayoutMeasurement, IEditorUIOpenOptions, IEditorUIPointerEvent, IEditorUIRect, IEditorUIScale, IEditorUISession, IEditorUITransform, } from './types';
|
|
5
5
|
export { applyEditorUIDocumentAlignment, applyEditorUIDocumentTextStyle, getEditorUITextStyle, prepareEditorUIDocumentData, stripEditorUIDocumentData } from './utils/document';
|
|
6
6
|
export type { IEditorUITextStyleOptions } from './utils/document';
|
|
7
7
|
export { createEditorUIHostLayout, getEditorUIHostHeightFromMeasurement, normalizeEditorUIInsets } from './utils/layout';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { HorizontalAlign, IDocumentData, LocaleService, WrapStrategy } from '@univerjs/core';
|
|
1
|
+
import type { BooleanNumber, HorizontalAlign, IDocumentData, LocaleService, WrapStrategy } from '@univerjs/core';
|
|
2
2
|
import type { IEditorUIDocumentLayout, IEditorUILayoutMeasurement, IEditorUIRect } from '../types';
|
|
3
|
-
import {
|
|
3
|
+
import { DocumentDataModel, VerticalAlign } from '@univerjs/core';
|
|
4
4
|
import { Documents, DocumentSkeleton, DocumentViewModel, UniverRenderingContext } from '@univerjs/engine-render';
|
|
5
|
+
export { getShapeTextOpticalVerticalOffset } from '@univerjs-pro/shape-editor-ui';
|
|
5
6
|
export interface IRenderEditorUIDocumentBaseOptions {
|
|
6
7
|
documentData: IDocumentData;
|
|
7
8
|
size: Pick<IEditorUIRect, 'width' | 'height'>;
|
|
@@ -12,6 +13,7 @@ export interface IRenderEditorUIDocumentBaseOptions {
|
|
|
12
13
|
isHorizontal?: boolean;
|
|
13
14
|
wrapStrategy?: WrapStrategy;
|
|
14
15
|
shapeTextOpticalVerticalAlign?: BooleanNumber | boolean;
|
|
16
|
+
onTextFillImageLoaded?: () => void;
|
|
15
17
|
}
|
|
16
18
|
export interface IRenderEditorUIDocumentToCanvasOptions extends IRenderEditorUIDocumentBaseOptions {
|
|
17
19
|
canvas: HTMLCanvasElement;
|
|
@@ -31,10 +33,18 @@ export interface IEditorUIDocumentRenderResources extends IRenderEditorUIDocumen
|
|
|
31
33
|
skeleton: DocumentSkeleton;
|
|
32
34
|
docViewModel: DocumentViewModel;
|
|
33
35
|
docModel: DocumentDataModel;
|
|
36
|
+
contentVerticalOffset: number;
|
|
34
37
|
opticalVerticalOffset: number;
|
|
38
|
+
isHorizontal: boolean;
|
|
35
39
|
}
|
|
36
|
-
export declare function
|
|
40
|
+
export declare function resolveEditorUIDocumentFlowSize(size: Pick<IEditorUIRect, 'width' | 'height'>, isHorizontal?: boolean): {
|
|
41
|
+
pageWidth: number;
|
|
42
|
+
alignmentExtent: number;
|
|
43
|
+
renderHeight: number;
|
|
44
|
+
};
|
|
45
|
+
export declare function resolveEditorUIDocumentSurfaceHeight(layoutContentHeight: number, viewportHeight: number, isHorizontal?: boolean): number;
|
|
37
46
|
export declare function renderEditorUIDocumentToCanvas(options: IRenderEditorUIDocumentToCanvasOptions): IRenderEditorUIDocumentToCanvasResult;
|
|
38
47
|
export declare function renderEditorUIDocumentToContext(options: IRenderEditorUIDocumentToContextOptions): IRenderEditorUIDocumentToCanvasResult;
|
|
39
48
|
export declare function drawEditorUIDocumentResources(context: UniverRenderingContext, resources: IEditorUIDocumentRenderResources, clip: boolean): void;
|
|
40
49
|
export declare function createEditorUIDocumentRenderResources(options: IRenderEditorUIDocumentBaseOptions): IEditorUIDocumentRenderResources;
|
|
50
|
+
export declare function createPreparedEditorUIDocumentRenderResources(options: IRenderEditorUIDocumentBaseOptions): IEditorUIDocumentRenderResources;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IShapeTextEditingParams, IShapeTextHostHeightUpdateParams, IShapeTextHostSizeUpdateParams, IShapeTextUpdateParams } from '@univerjs-pro/shape-editor-ui';
|
|
2
|
-
import type { PageTypeEnum } from '@univerjs-pro/slides';
|
|
2
|
+
import type { ISlideDrawing, PageTypeEnum } from '@univerjs-pro/slides';
|
|
3
3
|
import type { IDocumentData, Nullable } from '@univerjs/core';
|
|
4
4
|
import type { Observable } from 'rxjs';
|
|
5
5
|
import { ISlideDrawingService } from '@univerjs-pro/slides';
|
|
@@ -30,6 +30,8 @@ export declare class SlideTextEditingService extends Disposable {
|
|
|
30
30
|
setEditing(params: Nullable<ISlideTextEditingParams>): void;
|
|
31
31
|
setOnSavingEditorData(params: Nullable<boolean>): void;
|
|
32
32
|
getEditing(): Nullable<ISlideTextEditingParams>;
|
|
33
|
+
startEditingDrawing(drawing: ISlideDrawing, shapeKey?: string): void;
|
|
34
|
+
startInsertedTextBoxEditing(params: Pick<ISlideTextEditingParams, 'unitId' | 'subUnitId' | 'shapeId'>): void;
|
|
33
35
|
ignoreExternalFocusChanges(duration?: number): void;
|
|
34
36
|
shouldIgnoreExternalFocusChanges(): boolean;
|
|
35
37
|
completeEditing(): void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IShapeText } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import type { ISlideThemeData } from '@univerjs-pro/slides';
|
|
2
3
|
import type { ITextStyle } from '@univerjs/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare function
|
|
4
|
+
/**
|
|
5
|
+
* Resolves legacy slide plain shape text for read-only compatibility paths.
|
|
6
|
+
* New writes should create canonical `shapeText.dataModel.doc` instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolvePlainShapeTextData(shapeText: Partial<IShapeText> | undefined, themeData?: ISlideThemeData): IShapeText;
|
|
9
|
+
export declare function toDocumentTextStyle(shapeText: IShapeText): ITextStyle;
|
|
@@ -2,19 +2,19 @@ import type { ISlideDrawing } from '@univerjs-pro/slides';
|
|
|
2
2
|
import type { Nullable } from '@univerjs/core';
|
|
3
3
|
import type { BaseObject } from '@univerjs/engine-render';
|
|
4
4
|
import type { IRenderConvertContext } from '../adaptor';
|
|
5
|
-
import { IImageIoService } from '@univerjs/
|
|
5
|
+
import { IImageIoService } from '@univerjs/core';
|
|
6
6
|
import { SlideImageShapeClipService } from '../../../services/slide-image-shape-clip.service';
|
|
7
7
|
import { ObjectAdaptor } from '../adaptor';
|
|
8
8
|
/**
|
|
9
9
|
* Image rendering adaptor.
|
|
10
10
|
*/
|
|
11
11
|
export declare class ImageObjectAdaptor extends ObjectAdaptor {
|
|
12
|
-
private readonly
|
|
13
|
-
private readonly
|
|
12
|
+
private readonly _imageClipService;
|
|
13
|
+
private readonly _imageIoService;
|
|
14
14
|
zIndex: number;
|
|
15
15
|
private static readonly _globalImageNativeCache;
|
|
16
16
|
private static readonly _globalImageLoadingCache;
|
|
17
|
-
constructor(
|
|
17
|
+
constructor(_imageClipService: SlideImageShapeClipService, _imageIoService: IImageIoService);
|
|
18
18
|
check(drawing: ISlideDrawing): boolean;
|
|
19
19
|
convert(drawing: ISlideDrawing, ctx: IRenderConvertContext): Nullable<BaseObject>;
|
|
20
20
|
private _getOrCreateImageLoadingPromise;
|
|
@@ -2,16 +2,15 @@ import type { ISlideDrawing } from '@univerjs-pro/slides';
|
|
|
2
2
|
import type { Nullable } from '@univerjs/core';
|
|
3
3
|
import type { BaseObject } from '@univerjs/engine-render';
|
|
4
4
|
import type { IRenderConvertContext } from '../adaptor';
|
|
5
|
-
import { LocaleService } from '@univerjs/core';
|
|
6
|
-
import { IImageIoService } from '@univerjs/drawing';
|
|
5
|
+
import { IImageIoService, LocaleService } from '@univerjs/core';
|
|
7
6
|
import { SlideTextEditingService } from '../../../slide-editor/services/slide-text-editing.service';
|
|
8
7
|
import { ObjectAdaptor } from '../adaptor';
|
|
9
8
|
export declare class PlaceholderObjectAdaptor extends ObjectAdaptor {
|
|
10
9
|
private readonly _localeService;
|
|
10
|
+
private readonly _imageIoService;
|
|
11
11
|
private readonly _slideTextEditingService?;
|
|
12
|
-
private readonly _imageIoService?;
|
|
13
12
|
zIndex: number;
|
|
14
|
-
constructor(_localeService: LocaleService,
|
|
13
|
+
constructor(_localeService: LocaleService, _imageIoService: IImageIoService, _slideTextEditingService?: SlideTextEditingService | undefined);
|
|
15
14
|
check(drawing: ISlideDrawing): boolean;
|
|
16
15
|
convert(drawing: ISlideDrawing, ctx: IRenderConvertContext): Nullable<BaseObject>;
|
|
17
16
|
private _createImageObject;
|
|
@@ -2,18 +2,17 @@ import type { ISlideDrawing } from '@univerjs-pro/slides';
|
|
|
2
2
|
import type { Nullable } from '@univerjs/core';
|
|
3
3
|
import type { BaseObject } from '@univerjs/engine-render';
|
|
4
4
|
import type { IRenderConvertContext } from '../adaptor';
|
|
5
|
-
import { LocaleService } from '@univerjs/core';
|
|
6
|
-
import { IImageIoService } from '@univerjs/drawing';
|
|
5
|
+
import { IImageIoService, LocaleService } from '@univerjs/core';
|
|
7
6
|
import { SlideTextEditingService } from '../../../slide-editor/services/slide-text-editing.service';
|
|
8
7
|
import { ObjectAdaptor } from '../adaptor';
|
|
9
8
|
export declare class ShapeObjectAdaptor extends ObjectAdaptor {
|
|
10
9
|
private readonly _localeService;
|
|
10
|
+
private readonly _imageIoService;
|
|
11
11
|
private readonly _slideTextEditingService?;
|
|
12
|
-
private readonly _imageIoService?;
|
|
13
12
|
zIndex: number;
|
|
14
13
|
private static readonly _globalImageNativeCache;
|
|
15
14
|
private static readonly _globalImageLoadingCache;
|
|
16
|
-
constructor(_localeService: LocaleService,
|
|
15
|
+
constructor(_localeService: LocaleService, _imageIoService: IImageIoService, _slideTextEditingService?: SlideTextEditingService | undefined);
|
|
17
16
|
check(drawing: ISlideDrawing): boolean;
|
|
18
17
|
convert(drawing: ISlideDrawing, ctx: IRenderConvertContext): Nullable<BaseObject>;
|
|
19
18
|
private _loadShapePictureFill;
|
|
@@ -3,15 +3,15 @@ import type { Nullable } from '@univerjs/core';
|
|
|
3
3
|
import type { BaseObject } from '@univerjs/engine-render';
|
|
4
4
|
import type { IRenderConvertContext } from '../adaptor';
|
|
5
5
|
import { SlideTableResourceService } from '@univerjs-pro/slides-table';
|
|
6
|
-
import { LocaleService } from '@univerjs/core';
|
|
7
|
-
import { IImageIoService } from '@univerjs/drawing';
|
|
6
|
+
import { IImageIoService, LocaleService, ThemeService } from '@univerjs/core';
|
|
8
7
|
import { ObjectAdaptor } from '../adaptor';
|
|
9
8
|
export declare class TableObjectAdaptor extends ObjectAdaptor {
|
|
10
9
|
private readonly _localeService;
|
|
10
|
+
private readonly _themeService;
|
|
11
|
+
private readonly _imageIoService;
|
|
11
12
|
private readonly _tableResourceService?;
|
|
12
|
-
private readonly _imageIoService?;
|
|
13
13
|
zIndex: number;
|
|
14
|
-
constructor(_localeService: LocaleService,
|
|
14
|
+
constructor(_localeService: LocaleService, _themeService: ThemeService, _imageIoService: IImageIoService, _tableResourceService?: SlideTableResourceService | undefined);
|
|
15
15
|
check(drawing: ISlideDrawing): boolean;
|
|
16
16
|
convert(drawing: ISlideDrawing, ctx: IRenderConvertContext): Nullable<BaseObject>;
|
|
17
17
|
private _resolveTableSnapshot;
|