@univerjs-pro/shape-editor-ui 0.25.0-insiders.20260604-29ebbff
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 +34 -0
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/index.js +1 -0
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/index.css +714 -0
- package/lib/index.js +1 -0
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/components/fill-style-tabs-editor/FillStyleTabsEditor.d.ts +39 -0
- package/lib/types/index.d.ts +17 -0
- package/lib/types/locale/ar-SA.d.ts +3 -0
- package/lib/types/locale/ca-ES.d.ts +3 -0
- package/lib/types/locale/de-DE.d.ts +3 -0
- package/lib/types/locale/en-US.d.ts +340 -0
- package/lib/types/locale/es-ES.d.ts +3 -0
- package/lib/types/locale/fa-IR.d.ts +3 -0
- package/lib/types/locale/fr-FR.d.ts +3 -0
- package/lib/types/locale/id-ID.d.ts +3 -0
- package/lib/types/locale/it-IT.d.ts +3 -0
- package/lib/types/locale/ja-JP.d.ts +3 -0
- package/lib/types/locale/ko-KR.d.ts +3 -0
- package/lib/types/locale/pl-PL.d.ts +3 -0
- package/lib/types/locale/pt-BR.d.ts +3 -0
- package/lib/types/locale/ru-RU.d.ts +3 -0
- package/lib/types/locale/sk-SK.d.ts +3 -0
- package/lib/types/locale/vi-VN.d.ts +3 -0
- package/lib/types/locale/zh-CN.d.ts +3 -0
- package/lib/types/locale/zh-HK.d.ts +3 -0
- package/lib/types/locale/zh-TW.d.ts +3 -0
- package/lib/types/views/shape-editor-panel/ShapeEditorPanel.d.ts +13 -0
- package/lib/types/views/shape-editor-panel/ShapeFillEditor.d.ts +9 -0
- package/lib/types/views/shape-editor-panel/ShapeImageFillEditor.d.ts +5 -0
- package/lib/types/views/shape-editor-panel/ShapeLineEditor.d.ts +5 -0
- package/lib/types/views/shape-editor-panel/types.d.ts +13 -0
- package/lib/types/views/shape-floating-toolbar/ShapeFloatingToolbar.d.ts +48 -0
- package/lib/types/views/shape-floating-toolbar/shape-floating-toolbar-utils.d.ts +16 -0
- package/lib/types/views/shape-text-editor/DocParagraphTypeDropdown.d.ts +11 -0
- package/lib/types/views/shape-text-editor/ShapeTextEditor.d.ts +61 -0
- package/lib/types/views/shape-text-editor/ShapeTextEditorContainer.d.ts +9 -0
- package/lib/types/views/shape-text-editor/ShapeTextFloatToolbar.d.ts +4 -0
- package/lib/types/views/shape-text-editor/ShapeTextPositionWrapper.d.ts +19 -0
- package/lib/types/views/shape-text-editor/hooks/use-shape-position.d.ts +38 -0
- package/lib/types/views/shape-text-editor/shape-text-document.d.ts +15 -0
- package/lib/types/views/shape-text-editor/shape-text-float-menu-render-controller-base.d.ts +25 -0
- package/lib/types/views/shape-text-editor/types.d.ts +62 -0
- package/lib/umd/index.js +1 -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 +88 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Nullable } from '@univerjs/core';
|
|
2
|
+
import type { Scene, SpreadsheetSkeleton } from '@univerjs/engine-render';
|
|
3
|
+
import type { IShapeTextEditingParams, IShapeTextEditorViewportKeys } from '../types';
|
|
4
|
+
export interface IShapePosition {
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
angle: number;
|
|
10
|
+
scaleX: number;
|
|
11
|
+
scaleY: number;
|
|
12
|
+
}
|
|
13
|
+
export interface IShapePositionResult {
|
|
14
|
+
position: IShapePosition;
|
|
15
|
+
updatePosition: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Calculate shape position in DOM coordinates.
|
|
19
|
+
*/
|
|
20
|
+
export declare function calcShapePosition(shapeLeft: number, shapeTop: number, shapeWidth: number, shapeHeight: number, shapeAngle: number, scene: Scene, viewportKeys: IShapeTextEditorViewportKeys, skeleton?: Nullable<SpreadsheetSkeleton>): IShapePosition;
|
|
21
|
+
export interface IUseShapePositionOptions {
|
|
22
|
+
editingParams: Nullable<IShapeTextEditingParams>;
|
|
23
|
+
scene: Nullable<Scene>;
|
|
24
|
+
viewportKeys: IShapeTextEditorViewportKeys;
|
|
25
|
+
skeleton?: Nullable<SpreadsheetSkeleton>;
|
|
26
|
+
getShapeTransform: () => Nullable<{
|
|
27
|
+
left: number;
|
|
28
|
+
top: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
angle: number;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Hook to calculate and track shape position in DOM coordinates.
|
|
36
|
+
* Handles freeze zones and scroll updates.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useShapePosition(options: IUseShapePositionOptions): IShapePositionResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IShapeRect } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import type { HorizontalAlign, IDocumentData, VerticalAlign } from '@univerjs/core';
|
|
3
|
+
interface IPrepareShapeTextDocumentOptions {
|
|
4
|
+
isHorizontal: boolean;
|
|
5
|
+
textRect: IShapeRect;
|
|
6
|
+
verticalAlign?: VerticalAlign;
|
|
7
|
+
horizontalAlign?: HorizontalAlign;
|
|
8
|
+
}
|
|
9
|
+
interface IShapeTextDocumentAlignmentOptions {
|
|
10
|
+
verticalAlign?: VerticalAlign;
|
|
11
|
+
horizontalAlign?: HorizontalAlign;
|
|
12
|
+
}
|
|
13
|
+
export declare function prepareShapeTextDocumentData(documentData: IDocumentData, options: IPrepareShapeTextDocumentOptions): IDocumentData;
|
|
14
|
+
export declare function stripShapeTextDocumentLayout(documentData: IDocumentData, options?: IShapeTextDocumentAlignmentOptions): IDocumentData;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DocumentDataModel } from '@univerjs/core';
|
|
2
|
+
import type { DocSelectionManagerService } from '@univerjs/docs';
|
|
3
|
+
import type { DocCanvasPopManagerService, DocSelectionRenderService } from '@univerjs/docs-ui';
|
|
4
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
5
|
+
import type { ComponentManager } from '@univerjs/ui';
|
|
6
|
+
import type { ComponentType } from 'react';
|
|
7
|
+
import { Disposable } from '@univerjs/core';
|
|
8
|
+
export interface IShapeTextFloatMenuRenderControllerConfig {
|
|
9
|
+
componentKey: string;
|
|
10
|
+
editorUnitId: string;
|
|
11
|
+
toolbarComponent: ComponentType;
|
|
12
|
+
}
|
|
13
|
+
export declare class ShapeTextFloatMenuRenderControllerBase extends Disposable implements IRenderModule {
|
|
14
|
+
private readonly _context;
|
|
15
|
+
private readonly _docSelectionManagerService;
|
|
16
|
+
private readonly _docCanvasPopManagerService;
|
|
17
|
+
private readonly _componentManager;
|
|
18
|
+
private readonly _docSelectionRenderService;
|
|
19
|
+
private readonly _config;
|
|
20
|
+
private _floatMenu;
|
|
21
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docCanvasPopManagerService: DocCanvasPopManagerService, _componentManager: ComponentManager, _docSelectionRenderService: DocSelectionRenderService, _config: IShapeTextFloatMenuRenderControllerConfig);
|
|
22
|
+
private _initSelectionChange;
|
|
23
|
+
private _hideFloatMenu;
|
|
24
|
+
private _showFloatMenu;
|
|
25
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ICustomShapeTextData, IShapeRect } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import type { HorizontalAlign, IDocumentData, ITransformState, Nullable, VerticalAlign } from '@univerjs/core';
|
|
3
|
+
import type { IRender } from '@univerjs/engine-render';
|
|
4
|
+
import type { Observable } from 'rxjs';
|
|
5
|
+
export interface IShapeTextEditingParams {
|
|
6
|
+
unitId: string;
|
|
7
|
+
subUnitId: string;
|
|
8
|
+
shapeId: string;
|
|
9
|
+
shapeKey: string;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface IShapeTextEditingServiceLike {
|
|
13
|
+
editingParams$: Observable<Nullable<IShapeTextEditingParams>>;
|
|
14
|
+
onSavingEditorData$: Observable<Nullable<boolean>>;
|
|
15
|
+
setEditing(params: Nullable<IShapeTextEditingParams>): void;
|
|
16
|
+
}
|
|
17
|
+
export interface IShapeTextModel {
|
|
18
|
+
va?: VerticalAlign;
|
|
19
|
+
ha?: HorizontalAlign;
|
|
20
|
+
doc: IDocumentData;
|
|
21
|
+
}
|
|
22
|
+
export interface IShapeTextModelLike {
|
|
23
|
+
getShapeTextData(): ICustomShapeTextData;
|
|
24
|
+
getShapeTextRect(rect: IShapeRect): IShapeRect;
|
|
25
|
+
}
|
|
26
|
+
export interface IShapeTextDataContext {
|
|
27
|
+
doc?: IDocumentData;
|
|
28
|
+
verticalAlign: VerticalAlign;
|
|
29
|
+
horizontalAlign: HorizontalAlign;
|
|
30
|
+
textRect: IShapeRect;
|
|
31
|
+
transform: ITransformState;
|
|
32
|
+
isHorizontal: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface IShapeTextUpdateParams {
|
|
35
|
+
unitId: string;
|
|
36
|
+
subUnitId: string;
|
|
37
|
+
shapeId: string;
|
|
38
|
+
shapeText: ICustomShapeTextData;
|
|
39
|
+
oldShapeText: ICustomShapeTextData;
|
|
40
|
+
}
|
|
41
|
+
export interface IShapeTextHostHeightUpdateParams {
|
|
42
|
+
unitId: string;
|
|
43
|
+
subUnitId: string;
|
|
44
|
+
shapeId: string;
|
|
45
|
+
height: number;
|
|
46
|
+
}
|
|
47
|
+
export interface IShapeTextEditorAdapter {
|
|
48
|
+
getShapeModel(unitId: string, subUnitId: string, shapeId: string): Nullable<IShapeTextModelLike>;
|
|
49
|
+
getDrawingTransform(unitId: string, subUnitId: string, shapeId: string): Nullable<ITransformState>;
|
|
50
|
+
updateShapeText(params: IShapeTextUpdateParams): void;
|
|
51
|
+
updateHostHeight?(params: IShapeTextHostHeightUpdateParams): void;
|
|
52
|
+
}
|
|
53
|
+
export interface IShapeTextEditorViewportKeys {
|
|
54
|
+
main: string;
|
|
55
|
+
leftTop?: string;
|
|
56
|
+
top?: string;
|
|
57
|
+
left?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface IShapeTextEditorPositionOptions {
|
|
60
|
+
viewportKeys: IShapeTextEditorViewportKeys;
|
|
61
|
+
getSkeleton?: (renderUnit: IRender, editingParams: IShapeTextEditingParams) => unknown;
|
|
62
|
+
}
|