@univerjs-pro/sheets-shape-ui 1.0.0 → 1.0.2

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.
Files changed (101) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/cjs/locale/ar-SA.js +1 -1
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/de-DE.js +1 -1
  5. package/lib/cjs/locale/en-US.js +1 -1
  6. package/lib/cjs/locale/es-ES.js +1 -1
  7. package/lib/cjs/locale/fa-IR.js +1 -1
  8. package/lib/cjs/locale/fr-FR.js +1 -1
  9. package/lib/cjs/locale/id-ID.js +1 -1
  10. package/lib/cjs/locale/it-IT.js +1 -1
  11. package/lib/cjs/locale/ja-JP.js +1 -1
  12. package/lib/cjs/locale/ko-KR.js +1 -1
  13. package/lib/cjs/locale/pl-PL.js +1 -1
  14. package/lib/cjs/locale/pt-BR.js +1 -1
  15. package/lib/cjs/locale/ru-RU.js +1 -1
  16. package/lib/cjs/locale/sk-SK.js +1 -1
  17. package/lib/cjs/locale/vi-VN.js +1 -1
  18. package/lib/cjs/locale/zh-CN.js +1 -1
  19. package/lib/cjs/locale/zh-HK.js +1 -1
  20. package/lib/cjs/locale/zh-TW.js +1 -1
  21. package/lib/es/index.js +1 -1
  22. package/lib/es/locale/ar-SA.js +1 -1
  23. package/lib/es/locale/ca-ES.js +1 -1
  24. package/lib/es/locale/de-DE.js +1 -1
  25. package/lib/es/locale/en-US.js +1 -1
  26. package/lib/es/locale/es-ES.js +1 -1
  27. package/lib/es/locale/fa-IR.js +1 -1
  28. package/lib/es/locale/fr-FR.js +1 -1
  29. package/lib/es/locale/id-ID.js +1 -1
  30. package/lib/es/locale/it-IT.js +1 -1
  31. package/lib/es/locale/ja-JP.js +1 -1
  32. package/lib/es/locale/ko-KR.js +1 -1
  33. package/lib/es/locale/pl-PL.js +1 -1
  34. package/lib/es/locale/pt-BR.js +1 -1
  35. package/lib/es/locale/ru-RU.js +1 -1
  36. package/lib/es/locale/sk-SK.js +1 -1
  37. package/lib/es/locale/vi-VN.js +1 -1
  38. package/lib/es/locale/zh-CN.js +1 -1
  39. package/lib/es/locale/zh-HK.js +1 -1
  40. package/lib/es/locale/zh-TW.js +1 -1
  41. package/lib/index.js +1 -1
  42. package/lib/locale/ar-SA.js +1 -1
  43. package/lib/locale/ca-ES.js +1 -1
  44. package/lib/locale/de-DE.js +1 -1
  45. package/lib/locale/en-US.js +1 -1
  46. package/lib/locale/es-ES.js +1 -1
  47. package/lib/locale/fa-IR.js +1 -1
  48. package/lib/locale/fr-FR.js +1 -1
  49. package/lib/locale/id-ID.js +1 -1
  50. package/lib/locale/it-IT.js +1 -1
  51. package/lib/locale/ja-JP.js +1 -1
  52. package/lib/locale/ko-KR.js +1 -1
  53. package/lib/locale/pl-PL.js +1 -1
  54. package/lib/locale/pt-BR.js +1 -1
  55. package/lib/locale/ru-RU.js +1 -1
  56. package/lib/locale/sk-SK.js +1 -1
  57. package/lib/locale/vi-VN.js +1 -1
  58. package/lib/locale/zh-CN.js +1 -1
  59. package/lib/locale/zh-HK.js +1 -1
  60. package/lib/locale/zh-TW.js +1 -1
  61. package/lib/umd/index.js +1 -1
  62. package/lib/umd/locale/ar-SA.js +1 -1
  63. package/lib/umd/locale/ca-ES.js +1 -1
  64. package/lib/umd/locale/de-DE.js +1 -1
  65. package/lib/umd/locale/en-US.js +1 -1
  66. package/lib/umd/locale/es-ES.js +1 -1
  67. package/lib/umd/locale/fa-IR.js +1 -1
  68. package/lib/umd/locale/fr-FR.js +1 -1
  69. package/lib/umd/locale/id-ID.js +1 -1
  70. package/lib/umd/locale/it-IT.js +1 -1
  71. package/lib/umd/locale/ja-JP.js +1 -1
  72. package/lib/umd/locale/ko-KR.js +1 -1
  73. package/lib/umd/locale/pl-PL.js +1 -1
  74. package/lib/umd/locale/pt-BR.js +1 -1
  75. package/lib/umd/locale/ru-RU.js +1 -1
  76. package/lib/umd/locale/sk-SK.js +1 -1
  77. package/lib/umd/locale/vi-VN.js +1 -1
  78. package/lib/umd/locale/zh-CN.js +1 -1
  79. package/lib/umd/locale/zh-HK.js +1 -1
  80. package/lib/umd/locale/zh-TW.js +1 -1
  81. package/package.json +20 -20
  82. package/lib/types/commands/command/set-shape-text-align.command.d.ts +0 -5
  83. package/lib/types/commands/command/set-shape-text-style.command.d.ts +0 -7
  84. package/lib/types/commands/command/set-shape-text-vertical-align.command.d.ts +0 -5
  85. package/lib/types/commands/command/shape-doc-align.command.d.ts +0 -10
  86. package/lib/types/commands/menu/shape-doc-format.menu.d.ts +0 -18
  87. package/lib/types/commands/menu/shape-font-size.menu.d.ts +0 -5
  88. package/lib/types/commands/menu/shape-text-align.menu.d.ts +0 -9
  89. package/lib/types/commands/menu/shape-vertical-align.menu.d.ts +0 -9
  90. package/lib/types/commands/operations/actvie-drawing-operation.d.ts +0 -2
  91. package/lib/types/controllers/config.schema.d.ts +0 -5
  92. package/lib/types/controllers/menu.schema.d.ts +0 -2
  93. package/lib/types/controllers/sheets-shape-ui.controller.d.ts +0 -126
  94. package/lib/types/view-model/shape-data-model.d.ts +0 -6
  95. package/lib/types/views/ShapeOptions.d.ts +0 -30
  96. package/lib/types/views/shape-editor-panel/ShapeLineEditor.d.ts +0 -11
  97. package/lib/types/views/shape-editor-panel/index.d.ts +0 -1
  98. package/lib/types/views/shape-text-editor/Editor.d.ts +0 -11
  99. package/lib/types/views/shape-text-editor/ShapePositionWrapper.d.ts +0 -15
  100. package/lib/types/views/shape-text-editor/hooks/use-shape-position.d.ts +0 -37
  101. package/lib/types/views/shapes.d.ts +0 -58
@@ -1,10 +0,0 @@
1
- import type { HorizontalAlign, ICommand } from '@univerjs/core';
2
- export interface IShapeDocAlignCommandParams {
3
- value: HorizontalAlign;
4
- }
5
- /**
6
- * Wrapper command for shape text horizontal alignment.
7
- * This command receives the value from the menu selector and forwards it
8
- * to the Doc's AlignOperationCommand with the correct parameter format.
9
- */
10
- export declare const ShapeDocAlignCommand: ICommand<IShapeDocAlignCommandParams>;
@@ -1,18 +0,0 @@
1
- import type { IAccessor } from '@univerjs/core';
2
- import type { IMenuSelectorItem } from '@univerjs/ui';
3
- import { HorizontalAlign } from '@univerjs/core';
4
- import { MenuItemType } from '@univerjs/ui';
5
- import { Observable } from 'rxjs';
6
- export declare const SHAPE_HORIZONTAL_ALIGN_CHILDREN: {
7
- label: string;
8
- icon: string;
9
- value: HorizontalAlign;
10
- }[];
11
- export declare function ShapeHorizontalAlignMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<HorizontalAlign>;
12
- export declare function ShapeBackgroundColorSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string, string | undefined>;
13
- export declare function ShapeResetBackgroundColorMenuItemFactory(accessor: IAccessor): {
14
- id: string;
15
- type: MenuItemType;
16
- title: string;
17
- hidden$: Observable<boolean>;
18
- };
@@ -1,5 +0,0 @@
1
- import type { IAccessor } from '@univerjs/core';
2
- import type { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
3
- export declare function ShapeFontSizeSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<number>;
4
- export declare function ShapeFontSizeIncreaseMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
5
- export declare function ShapeFontSizeDecreaseMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
@@ -1,9 +0,0 @@
1
- import type { IAccessor } from '@univerjs/core';
2
- import type { IMenuSelectorItem } from '@univerjs/ui';
3
- import { HorizontalAlign } from '@univerjs/core';
4
- export declare const SHAPE_HORIZONTAL_ALIGN_CHILDREN: {
5
- label: string;
6
- icon: string;
7
- value: HorizontalAlign;
8
- }[];
9
- export declare function ShapeTextHorizontalAlignMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<HorizontalAlign>;
@@ -1,9 +0,0 @@
1
- import type { IAccessor } from '@univerjs/core';
2
- import type { IMenuSelectorItem } from '@univerjs/ui';
3
- import { VerticalAlign } from '@univerjs/core';
4
- export declare const SHAPE_VERTICAL_ALIGN_CHILDREN: {
5
- label: string;
6
- icon: string;
7
- value: VerticalAlign;
8
- }[];
9
- export declare function ShapeVerticalAlignMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<VerticalAlign>;
@@ -1,2 +0,0 @@
1
- import type { IDrawingSearch, IOperation } from '@univerjs/core';
2
- export declare const ActiveDrawingSelectedOperation: IOperation<IDrawingSearch[]>;
@@ -1,5 +0,0 @@
1
- export declare const SHEETS_SHAPE_UI_PLUGIN_CONFIG_KEY = "sheets-shape-ui.config";
2
- export declare const configSymbol: unique symbol;
3
- export interface IUniverSheetsShapeUIConfig {
4
- }
5
- export declare const defaultPluginConfig: IUniverSheetsShapeUIConfig;
@@ -1,2 +0,0 @@
1
- import type { MenuSchemaType } from '@univerjs/ui';
2
- export declare const menuSchema: MenuSchemaType;
@@ -1,126 +0,0 @@
1
- import { SheetsShapeService } from '@univerjs-pro/sheets-shape';
2
- import { Disposable, DrawingTypeEnum, ICommandService, IContextService, IUniverInstanceService, LocaleService } from '@univerjs/core';
3
- import { IDrawingManagerService } from '@univerjs/drawing';
4
- import { SheetInterceptorService } from '@univerjs/sheets';
5
- import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
6
- import { ComponentManager, IMenuManagerService, ISidebarService } from '@univerjs/ui';
7
- export declare class SheetsShapeUIController extends Disposable {
8
- private readonly _univerInstanceService;
9
- private readonly _sheetInterceptorService;
10
- private _sidebarService;
11
- protected readonly _menuManagerService: IMenuManagerService;
12
- private _sheetsShapeService;
13
- private readonly _localeService;
14
- private _componentManager;
15
- private readonly _commandService;
16
- private _drawingManagerService;
17
- private readonly _sheetCanvasPopManagerService;
18
- private readonly _contextService;
19
- private _sidebarDisposable;
20
- private _activeShapeInfo;
21
- private _isOpenedShapeEditPanel;
22
- constructor(_univerInstanceService: IUniverInstanceService, _sheetInterceptorService: SheetInterceptorService, _sidebarService: ISidebarService, _menuManagerService: IMenuManagerService, _sheetsShapeService: SheetsShapeService, _localeService: LocaleService, _componentManager: ComponentManager, _commandService: ICommandService, _drawingManagerService: IDrawingManagerService, _sheetCanvasPopManagerService: SheetCanvasPopManagerService, _contextService: IContextService);
23
- private _initMenu;
24
- private _registerShapeMenu;
25
- getShapePopupMenus(unitId: string, subUnitId: string, drawingId: string, drawingType: DrawingTypeEnum): ({
26
- label: string;
27
- index: number;
28
- commandId: string;
29
- commandParams: {
30
- unitId: string;
31
- subUnitId: string;
32
- drawingId: string;
33
- drawings?: undefined;
34
- shapeId?: undefined;
35
- flipH?: undefined;
36
- flipV?: undefined;
37
- rotate?: undefined;
38
- };
39
- disable: boolean;
40
- } | {
41
- label: string;
42
- index: number;
43
- commandId: string;
44
- commandParams: {
45
- unitId: string;
46
- drawings: {
47
- unitId: string;
48
- subUnitId: string;
49
- drawingId: string;
50
- drawingType: DrawingTypeEnum;
51
- }[];
52
- subUnitId?: undefined;
53
- drawingId?: undefined;
54
- shapeId?: undefined;
55
- flipH?: undefined;
56
- flipV?: undefined;
57
- rotate?: undefined;
58
- };
59
- disable: boolean;
60
- } | {
61
- label: string;
62
- index: number;
63
- commandId: string;
64
- commandParams: {
65
- unitId: string;
66
- subUnitId: string;
67
- shapeId: string;
68
- flipH: boolean;
69
- drawingId?: undefined;
70
- drawings?: undefined;
71
- flipV?: undefined;
72
- rotate?: undefined;
73
- };
74
- disable: boolean;
75
- } | {
76
- label: string;
77
- index: number;
78
- commandId: string;
79
- commandParams: {
80
- unitId: string;
81
- subUnitId: string;
82
- shapeId: string;
83
- flipV: boolean;
84
- drawingId?: undefined;
85
- drawings?: undefined;
86
- flipH?: undefined;
87
- rotate?: undefined;
88
- };
89
- disable: boolean;
90
- } | {
91
- label: string;
92
- index: number;
93
- commandId: string;
94
- commandParams: {
95
- unitId: string;
96
- subUnitId: string;
97
- shapeId: string;
98
- rotate: number;
99
- drawingId?: undefined;
100
- drawings?: undefined;
101
- flipH?: undefined;
102
- flipV?: undefined;
103
- };
104
- disable: boolean;
105
- } | {
106
- label: string;
107
- index: number;
108
- commandId: string;
109
- commandParams: {
110
- unitId: string;
111
- subUnitId: string;
112
- shapeId: string;
113
- drawingId?: undefined;
114
- drawings?: undefined;
115
- flipH?: undefined;
116
- flipV?: undefined;
117
- rotate?: undefined;
118
- };
119
- disable: boolean;
120
- })[];
121
- private _getShapeInfo;
122
- private _registerOperations;
123
- private _registerComponent;
124
- private _openShapeEditPanel;
125
- private _closeShapeEditPanel;
126
- }
@@ -1,6 +0,0 @@
1
- import type { HorizontalAlign, IDocumentData, VerticalAlign } from '@univerjs/core';
2
- export interface IShapeTextModel {
3
- va: VerticalAlign;
4
- ha: HorizontalAlign;
5
- doc: IDocumentData;
6
- }
@@ -1,30 +0,0 @@
1
- import { ShapeFillEnum, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
2
- export declare const shapeFillOptions: {
3
- label: string;
4
- value: ShapeFillEnum;
5
- }[];
6
- export declare const shapeTypeOptions: (ShapeTypeEnum | {
7
- type: ShapeTypeEnum;
8
- endArrow: boolean;
9
- startArrow?: undefined;
10
- horizontal?: undefined;
11
- vertical?: undefined;
12
- } | {
13
- type: ShapeTypeEnum;
14
- endArrow: boolean;
15
- startArrow: boolean;
16
- horizontal?: undefined;
17
- vertical?: undefined;
18
- } | {
19
- type: ShapeTypeEnum;
20
- horizontal: boolean;
21
- endArrow?: undefined;
22
- startArrow?: undefined;
23
- vertical?: undefined;
24
- } | {
25
- type: ShapeTypeEnum;
26
- vertical: boolean;
27
- endArrow?: undefined;
28
- startArrow?: undefined;
29
- horizontal?: undefined;
30
- })[];
@@ -1,11 +0,0 @@
1
- import type { IShapeData } from '@univerjs-pro/engine-shape';
2
- interface IShapeLineProps {
3
- unitId: string;
4
- subUnitId: string;
5
- shapeId: string;
6
- shapeData: IShapeData;
7
- isLineShape: boolean;
8
- disableShapeOption: boolean;
9
- }
10
- export declare function ShapeLineEditor(props: IShapeLineProps): import("react/jsx-runtime").JSX.Element;
11
- export {};
@@ -1 +0,0 @@
1
- export { ShapeEditPanel } from './ShapeEditorPanel';
@@ -1,11 +0,0 @@
1
- export interface IShapeEditorProps {
2
- containerWidth: number;
3
- containerHeight: number;
4
- scaleX: number;
5
- scaleY: number;
6
- }
7
- /**
8
- * Shape editor component - second layer DOM.
9
- * Handles document editing, content height tracking, and vertical alignment.
10
- */
11
- export declare const ShapeEditor: (props: IShapeEditorProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- export interface IShapePositionWrapperProps {
3
- children: ReactNode;
4
- onPositionUpdate?: (position: {
5
- width: number;
6
- height: number;
7
- scaleX: number;
8
- scaleY: number;
9
- }) => void;
10
- }
11
- /**
12
- * Position wrapper component that handles shape positioning in DOM.
13
- * This is the first layer DOM that tracks shape position with scroll.
14
- */
15
- export declare const ShapePositionWrapper: import("react").MemoExoticComponent<(props: IShapePositionWrapperProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,37 +0,0 @@
1
- import type { IEditingParams } from '../../../services/shape-text-editing.service';
2
- import type { Nullable } from '@univerjs/core';
3
- import type { Scene, SpreadsheetSkeleton } from '@univerjs/engine-render';
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, skeleton: SpreadsheetSkeleton): IShapePosition;
21
- export interface IUseShapePositionOptions {
22
- editingParams: Nullable<IEditingParams>;
23
- scene: Nullable<Scene>;
24
- skeleton: Nullable<SpreadsheetSkeleton>;
25
- getShapeTransform: () => Nullable<{
26
- left: number;
27
- top: number;
28
- width: number;
29
- height: number;
30
- angle: number;
31
- }>;
32
- }
33
- /**
34
- * Hook to calculate and track shape position in DOM coordinates.
35
- * Handles freeze zones and scroll updates.
36
- */
37
- export declare function useShapePosition(options: IUseShapePositionOptions): IShapePositionResult;
@@ -1,58 +0,0 @@
1
- import { ShapeTypeEnum } from '@univerjs-pro/engine-shape';
2
- export declare enum ShapeGroupEnum {
3
- Line = "line",
4
- Rectangle = "rectangle",
5
- BasicShape = "basicShape",
6
- BlockArrow = "blockArrow",
7
- EquationShape = "equationShape",
8
- Flowchart = "flowchart",
9
- StarAndBanner = "starAndBanner",
10
- Callout = "callout",
11
- Other = "other"
12
- }
13
- export declare const shapeTypeOptions: ({
14
- group: ShapeGroupEnum;
15
- type: ShapeTypeEnum;
16
- icon: string;
17
- name: string;
18
- endArrow?: undefined;
19
- startArrow?: undefined;
20
- horizontal?: undefined;
21
- vertical?: undefined;
22
- } | {
23
- group: ShapeGroupEnum;
24
- type: ShapeTypeEnum;
25
- icon: string;
26
- name: string;
27
- endArrow: boolean;
28
- startArrow?: undefined;
29
- horizontal?: undefined;
30
- vertical?: undefined;
31
- } | {
32
- group: ShapeGroupEnum;
33
- type: ShapeTypeEnum;
34
- icon: string;
35
- name: string;
36
- endArrow: boolean;
37
- startArrow: boolean;
38
- horizontal?: undefined;
39
- vertical?: undefined;
40
- } | {
41
- group: ShapeGroupEnum;
42
- type: ShapeTypeEnum;
43
- icon: string;
44
- name: string;
45
- horizontal: boolean;
46
- endArrow?: undefined;
47
- startArrow?: undefined;
48
- vertical?: undefined;
49
- } | {
50
- group: ShapeGroupEnum;
51
- type: ShapeTypeEnum;
52
- icon: string;
53
- name: string;
54
- vertical: boolean;
55
- endArrow?: undefined;
56
- startArrow?: undefined;
57
- horizontal?: undefined;
58
- })[];