@univerjs-pro/sheets-shape-ui 0.15.3-insiders.20260131-cbd5fac

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 (119) hide show
  1. package/lib/cjs/index.js +1 -0
  2. package/lib/cjs/locale/ca-ES.js +1 -0
  3. package/lib/cjs/locale/en-US.js +1 -0
  4. package/lib/cjs/locale/es-ES.js +1 -0
  5. package/lib/cjs/locale/fa-IR.js +1 -0
  6. package/lib/cjs/locale/fr-FR.js +1 -0
  7. package/lib/cjs/locale/ja-JP.js +1 -0
  8. package/lib/cjs/locale/ko-KR.js +1 -0
  9. package/lib/cjs/locale/ru-RU.js +1 -0
  10. package/lib/cjs/locale/sk-SK.js +1 -0
  11. package/lib/cjs/locale/vi-VN.js +1 -0
  12. package/lib/cjs/locale/zh-CN.js +1 -0
  13. package/lib/cjs/locale/zh-TW.js +1 -0
  14. package/lib/es/index.js +1 -0
  15. package/lib/es/locale/ca-ES.js +1 -0
  16. package/lib/es/locale/en-US.js +1 -0
  17. package/lib/es/locale/es-ES.js +1 -0
  18. package/lib/es/locale/fa-IR.js +1 -0
  19. package/lib/es/locale/fr-FR.js +1 -0
  20. package/lib/es/locale/ja-JP.js +1 -0
  21. package/lib/es/locale/ko-KR.js +1 -0
  22. package/lib/es/locale/ru-RU.js +1 -0
  23. package/lib/es/locale/sk-SK.js +1 -0
  24. package/lib/es/locale/vi-VN.js +1 -0
  25. package/lib/es/locale/zh-CN.js +1 -0
  26. package/lib/es/locale/zh-TW.js +1 -0
  27. package/lib/index.js +1 -0
  28. package/lib/locale/ca-ES.js +1 -0
  29. package/lib/locale/en-US.js +1 -0
  30. package/lib/locale/es-ES.js +1 -0
  31. package/lib/locale/fa-IR.js +1 -0
  32. package/lib/locale/fr-FR.js +1 -0
  33. package/lib/locale/ja-JP.js +1 -0
  34. package/lib/locale/ko-KR.js +1 -0
  35. package/lib/locale/ru-RU.js +1 -0
  36. package/lib/locale/sk-SK.js +1 -0
  37. package/lib/locale/vi-VN.js +1 -0
  38. package/lib/locale/zh-CN.js +1 -0
  39. package/lib/locale/zh-TW.js +1 -0
  40. package/lib/types/command-util.d.ts +19 -0
  41. package/lib/types/commands/command/add-shape-command.d.ts +9 -0
  42. package/lib/types/commands/command/menu-insert-shape.command.d.ts +27 -0
  43. package/lib/types/commands/command/set-shape-fill.command.d.ts +5 -0
  44. package/lib/types/commands/command/set-shape-flip-command.d.ts +14 -0
  45. package/lib/types/commands/command/set-shape-rotate.command.d.ts +10 -0
  46. package/lib/types/commands/command/set-shape-text-align.command.d.ts +5 -0
  47. package/lib/types/commands/command/set-shape-text-style.command.d.ts +7 -0
  48. package/lib/types/commands/command/set-shape-text-vertical-align.command.d.ts +5 -0
  49. package/lib/types/commands/command/shape-doc-align.command.d.ts +10 -0
  50. package/lib/types/commands/command/test-line.shape.command.d.ts +8 -0
  51. package/lib/types/commands/command/update-connector-relation.command.d.ts +41 -0
  52. package/lib/types/commands/command/update-line-shape-resize.command.d.ts +18 -0
  53. package/lib/types/commands/command/update-shape-data-command.d.ts +13 -0
  54. package/lib/types/commands/menu/shape-doc-format.menu.d.ts +16 -0
  55. package/lib/types/commands/menu/shape-fill.menu.d.ts +3 -0
  56. package/lib/types/commands/menu/shape-font-size.menu.d.ts +5 -0
  57. package/lib/types/commands/menu/shape-text-align.menu.d.ts +8 -0
  58. package/lib/types/commands/menu/shape-vertical-align.menu.d.ts +8 -0
  59. package/lib/types/commands/operations/close-shape-panel.operation.d.ts +7 -0
  60. package/lib/types/commands/operations/open-shape-panel.operation.d.ts +7 -0
  61. package/lib/types/const.d.ts +5 -0
  62. package/lib/types/controllers/config.schema.d.ts +5 -0
  63. package/lib/types/controllers/menu.schema.d.ts +2 -0
  64. package/lib/types/controllers/shape-text-editing.render-controller.d.ts +17 -0
  65. package/lib/types/controllers/shape-update.controller.d.ts +19 -0
  66. package/lib/types/controllers/sheet-basic-shape-connection.controller.d.ts +99 -0
  67. package/lib/types/controllers/sheet-shape-adjust-controller.d.ts +45 -0
  68. package/lib/types/controllers/sheet-shape-command-interceptor.controller.d.ts +31 -0
  69. package/lib/types/controllers/sheet-shape-connector.controller.d.ts +110 -0
  70. package/lib/types/controllers/sheet-shape-render.controller.d.ts +12 -0
  71. package/lib/types/controllers/sheets-shape-ui.controller.d.ts +111 -0
  72. package/lib/types/index.d.ts +3 -0
  73. package/lib/types/locale/ca-ES.d.ts +3 -0
  74. package/lib/types/locale/en-US.d.ts +279 -0
  75. package/lib/types/locale/es-ES.d.ts +3 -0
  76. package/lib/types/locale/fa-IR.d.ts +3 -0
  77. package/lib/types/locale/fr-FR.d.ts +3 -0
  78. package/lib/types/locale/ja-JP.d.ts +3 -0
  79. package/lib/types/locale/ko-KR.d.ts +3 -0
  80. package/lib/types/locale/ru-RU.d.ts +3 -0
  81. package/lib/types/locale/sk-SK.d.ts +3 -0
  82. package/lib/types/locale/vi-VN.d.ts +3 -0
  83. package/lib/types/locale/zh-CN.d.ts +3 -0
  84. package/lib/types/locale/zh-TW.d.ts +3 -0
  85. package/lib/types/plugin.d.ts +18 -0
  86. package/lib/types/services/shape-text-editing.service.d.ts +19 -0
  87. package/lib/types/types.d.ts +14 -0
  88. package/lib/types/view-model/drawing-shape.d.ts +66 -0
  89. package/lib/types/view-model/shape-data-model.d.ts +5 -0
  90. package/lib/types/view-model/sheet-basic-shape-connection-site-object.d.ts +44 -0
  91. package/lib/types/view-model/sheet-shape-adjust-point-object.d.ts +21 -0
  92. package/lib/types/view-model/sheet-shape-connector-handler-object.d.ts +22 -0
  93. package/lib/types/views/ShapeOptions.d.ts +30 -0
  94. package/lib/types/views/ShapePicker.d.ts +2 -0
  95. package/lib/types/views/shape-editor-panel/ShapeEditorPanel.d.ts +12 -0
  96. package/lib/types/views/shape-editor-panel/ShapeFillEditor.d.ts +11 -0
  97. package/lib/types/views/shape-editor-panel/ShapeLineEditor.d.ts +11 -0
  98. package/lib/types/views/shape-editor-panel/ShapePositionEditor.d.ts +1 -0
  99. package/lib/types/views/shape-editor-panel/index.d.ts +1 -0
  100. package/lib/types/views/shape-menu/shape-menu-factory.d.ts +10 -0
  101. package/lib/types/views/shape-text-editor/Editor.d.ts +14 -0
  102. package/lib/types/views/shape-text-editor/hooks/use-shape-position.d.ts +37 -0
  103. package/lib/types/views/shape-text-editor/index.d.ts +6 -0
  104. package/lib/types/views/shape-text-editor/position-wrapper.d.ts +16 -0
  105. package/lib/types/views/shapes.d.ts +58 -0
  106. package/lib/umd/index.js +1 -0
  107. package/lib/umd/locale/ca-ES.js +1 -0
  108. package/lib/umd/locale/en-US.js +1 -0
  109. package/lib/umd/locale/es-ES.js +1 -0
  110. package/lib/umd/locale/fa-IR.js +1 -0
  111. package/lib/umd/locale/fr-FR.js +1 -0
  112. package/lib/umd/locale/ja-JP.js +1 -0
  113. package/lib/umd/locale/ko-KR.js +1 -0
  114. package/lib/umd/locale/ru-RU.js +1 -0
  115. package/lib/umd/locale/sk-SK.js +1 -0
  116. package/lib/umd/locale/vi-VN.js +1 -0
  117. package/lib/umd/locale/zh-CN.js +1 -0
  118. package/lib/umd/locale/zh-TW.js +1 -0
  119. package/package.json +99 -0
@@ -0,0 +1,30 @@
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
+ })[];
@@ -0,0 +1,2 @@
1
+ export declare const SHAPE_PICKER_COMPONENT = "sheet.shape.picker.component";
2
+ export declare function ShapePicker(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { IShapeData, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
2
+ interface IShapeEditPanelProps {
3
+ unitId: string;
4
+ subUnitId: string;
5
+ shapeId: string;
6
+ shapeData: IShapeData;
7
+ shapeType: ShapeTypeEnum;
8
+ version: number;
9
+ disableShapeOption: boolean;
10
+ }
11
+ export declare function ShapeEditPanel(props: IShapeEditPanelProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,11 @@
1
+ import { IShapeData } from '@univerjs-pro/engine-shape';
2
+ interface IShapeFillProps {
3
+ unitId: string;
4
+ subUnitId: string;
5
+ shapeId: string;
6
+ shapeData: IShapeData;
7
+ isLineShape: boolean;
8
+ disableShapeOption: boolean;
9
+ }
10
+ export declare function ShapeFillEditor(props: IShapeFillProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { 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 {};
@@ -0,0 +1 @@
1
+ export declare function ShapePositionEditor(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export { ShapeEditPanel } from './ShapeEditorPanel';
@@ -0,0 +1,10 @@
1
+ import { ShapeTypeEnum } from '@univerjs-pro/engine-shape';
2
+ import { IAccessor } from '@univerjs/core';
3
+ import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
4
+ export interface IShapeTypeOption {
5
+ label: string;
6
+ value: ShapeTypeEnum;
7
+ icon: string;
8
+ }
9
+ export declare function ShapeMenuItemFactory(accessor: IAccessor): IMenuSelectorItem;
10
+ export declare const testShapeConnectorMenuFactory: (accessor: IAccessor) => IMenuButtonItem;
@@ -0,0 +1,14 @@
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: {
12
+ (props: IShapeEditorProps): import("react/jsx-runtime").JSX.Element;
13
+ displayName: string;
14
+ };
@@ -0,0 +1,37 @@
1
+ import { IEditingParams } from '../../../services/shape-text-editing.service';
2
+ import { Nullable } from '@univerjs/core';
3
+ import { 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;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Main shape text editor container component.
4
+ * Combines PositionWrapper (first layer) and Editor (second layer).
5
+ */
6
+ export declare const ShapeTextEditorContainer: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from 'react';
2
+ import * as React from 'react';
3
+ export interface IShapePositionWrapperProps {
4
+ children: ReactNode;
5
+ onPositionUpdate?: (position: {
6
+ width: number;
7
+ height: number;
8
+ scaleX: number;
9
+ scaleY: number;
10
+ }) => void;
11
+ }
12
+ /**
13
+ * Position wrapper component that handles shape positioning in DOM.
14
+ * This is the first layer DOM that tracks shape position with scroll.
15
+ */
16
+ export declare const ShapePositionWrapper: React.MemoExoticComponent<(props: IShapePositionWrapperProps) => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,58 @@
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
+ })[];