@univerjs-pro/docs-shape-ui 0.24.0-insiders.20260528-29f582d

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 (140) hide show
  1. package/README.md +43 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/cjs/locale/ar-SA.js +1 -0
  4. package/lib/cjs/locale/ca-ES.js +1 -0
  5. package/lib/cjs/locale/de-DE.js +1 -0
  6. package/lib/cjs/locale/en-US.js +1 -0
  7. package/lib/cjs/locale/es-ES.js +1 -0
  8. package/lib/cjs/locale/fa-IR.js +1 -0
  9. package/lib/cjs/locale/fr-FR.js +1 -0
  10. package/lib/cjs/locale/id-ID.js +1 -0
  11. package/lib/cjs/locale/it-IT.js +1 -0
  12. package/lib/cjs/locale/ja-JP.js +1 -0
  13. package/lib/cjs/locale/ko-KR.js +1 -0
  14. package/lib/cjs/locale/pl-PL.js +1 -0
  15. package/lib/cjs/locale/pt-BR.js +1 -0
  16. package/lib/cjs/locale/ru-RU.js +1 -0
  17. package/lib/cjs/locale/sk-SK.js +1 -0
  18. package/lib/cjs/locale/vi-VN.js +1 -0
  19. package/lib/cjs/locale/zh-CN.js +1 -0
  20. package/lib/cjs/locale/zh-HK.js +1 -0
  21. package/lib/cjs/locale/zh-TW.js +1 -0
  22. package/lib/es/index.js +1 -0
  23. package/lib/es/locale/ar-SA.js +1 -0
  24. package/lib/es/locale/ca-ES.js +1 -0
  25. package/lib/es/locale/de-DE.js +1 -0
  26. package/lib/es/locale/en-US.js +1 -0
  27. package/lib/es/locale/es-ES.js +1 -0
  28. package/lib/es/locale/fa-IR.js +1 -0
  29. package/lib/es/locale/fr-FR.js +1 -0
  30. package/lib/es/locale/id-ID.js +1 -0
  31. package/lib/es/locale/it-IT.js +1 -0
  32. package/lib/es/locale/ja-JP.js +1 -0
  33. package/lib/es/locale/ko-KR.js +1 -0
  34. package/lib/es/locale/pl-PL.js +1 -0
  35. package/lib/es/locale/pt-BR.js +1 -0
  36. package/lib/es/locale/ru-RU.js +1 -0
  37. package/lib/es/locale/sk-SK.js +1 -0
  38. package/lib/es/locale/vi-VN.js +1 -0
  39. package/lib/es/locale/zh-CN.js +1 -0
  40. package/lib/es/locale/zh-HK.js +1 -0
  41. package/lib/es/locale/zh-TW.js +1 -0
  42. package/lib/index.css +612 -0
  43. package/lib/index.js +1 -0
  44. package/lib/locale/ar-SA.js +1 -0
  45. package/lib/locale/ca-ES.js +1 -0
  46. package/lib/locale/de-DE.js +1 -0
  47. package/lib/locale/en-US.js +1 -0
  48. package/lib/locale/es-ES.js +1 -0
  49. package/lib/locale/fa-IR.js +1 -0
  50. package/lib/locale/fr-FR.js +1 -0
  51. package/lib/locale/id-ID.js +1 -0
  52. package/lib/locale/it-IT.js +1 -0
  53. package/lib/locale/ja-JP.js +1 -0
  54. package/lib/locale/ko-KR.js +1 -0
  55. package/lib/locale/pl-PL.js +1 -0
  56. package/lib/locale/pt-BR.js +1 -0
  57. package/lib/locale/ru-RU.js +1 -0
  58. package/lib/locale/sk-SK.js +1 -0
  59. package/lib/locale/vi-VN.js +1 -0
  60. package/lib/locale/zh-CN.js +1 -0
  61. package/lib/locale/zh-HK.js +1 -0
  62. package/lib/locale/zh-TW.js +1 -0
  63. package/lib/types/command-util.d.ts +19 -0
  64. package/lib/types/commands/command/menu-insert-shape.command.d.ts +20 -0
  65. package/lib/types/commands/operations/close-shape-panel.operation.d.ts +7 -0
  66. package/lib/types/commands/operations/open-shape-panel.operation.d.ts +7 -0
  67. package/lib/types/const.d.ts +3 -0
  68. package/lib/types/controllers/config.schema.d.ts +7 -0
  69. package/lib/types/controllers/doc-shape-adjust.controller.d.ts +43 -0
  70. package/lib/types/controllers/doc-shape-render.controller.d.ts +24 -0
  71. package/lib/types/controllers/docs-shape-ui.controller.d.ts +64 -0
  72. package/lib/types/controllers/image-shape-clip.controller.d.ts +11 -0
  73. package/lib/types/controllers/menu.schema.d.ts +2 -0
  74. package/lib/types/controllers/shape-text-editing.render-controller.d.ts +22 -0
  75. package/lib/types/controllers/shape-text-float-menu.render-controller.d.ts +18 -0
  76. package/lib/types/controllers/shape-update.controller.d.ts +18 -0
  77. package/lib/types/index.d.ts +7 -0
  78. package/lib/types/locale/ar-SA.d.ts +3 -0
  79. package/lib/types/locale/ca-ES.d.ts +3 -0
  80. package/lib/types/locale/de-DE.d.ts +3 -0
  81. package/lib/types/locale/en-US.d.ts +309 -0
  82. package/lib/types/locale/es-ES.d.ts +3 -0
  83. package/lib/types/locale/fa-IR.d.ts +3 -0
  84. package/lib/types/locale/fr-FR.d.ts +3 -0
  85. package/lib/types/locale/id-ID.d.ts +3 -0
  86. package/lib/types/locale/it-IT.d.ts +3 -0
  87. package/lib/types/locale/ja-JP.d.ts +3 -0
  88. package/lib/types/locale/ko-KR.d.ts +3 -0
  89. package/lib/types/locale/pl-PL.d.ts +3 -0
  90. package/lib/types/locale/pt-BR.d.ts +3 -0
  91. package/lib/types/locale/ru-RU.d.ts +3 -0
  92. package/lib/types/locale/sk-SK.d.ts +3 -0
  93. package/lib/types/locale/vi-VN.d.ts +3 -0
  94. package/lib/types/locale/zh-CN.d.ts +3 -0
  95. package/lib/types/locale/zh-HK.d.ts +3 -0
  96. package/lib/types/locale/zh-TW.d.ts +3 -0
  97. package/lib/types/plugin.d.ts +18 -0
  98. package/lib/types/services/shape-text-editing.service.d.ts +20 -0
  99. package/lib/types/utils/shape-text-document.d.ts +11 -0
  100. package/lib/types/view-model/doc-shape-adjust-point-object.d.ts +22 -0
  101. package/lib/types/view-model/drawing-shape.d.ts +78 -0
  102. package/lib/types/view-model/shape-data-model.d.ts +6 -0
  103. package/lib/types/views/ShapeOptions.d.ts +30 -0
  104. package/lib/types/views/ShapePicker.d.ts +8 -0
  105. package/lib/types/views/shape-editor-panel/ShapeEditorPanel.d.ts +12 -0
  106. package/lib/types/views/shape-editor-panel/ShapeFillEditor.d.ts +13 -0
  107. package/lib/types/views/shape-editor-panel/ShapeImageFillEditor.d.ts +10 -0
  108. package/lib/types/views/shape-editor-panel/ShapeLineEditor.d.ts +11 -0
  109. package/lib/types/views/shape-editor-panel/ShapePositionEditor.d.ts +1 -0
  110. package/lib/types/views/shape-editor-panel/index.d.ts +1 -0
  111. package/lib/types/views/shape-floating-toolbar/ShapeFloatingToolbar.d.ts +19 -0
  112. package/lib/types/views/shape-floating-toolbar/shape-floating-toolbar-utils.d.ts +10 -0
  113. package/lib/types/views/shape-menu/shape-menu-factory.d.ts +11 -0
  114. package/lib/types/views/shape-text-editor/Editor.d.ts +24 -0
  115. package/lib/types/views/shape-text-editor/ShapeTextFloatToolbar.d.ts +1 -0
  116. package/lib/types/views/shape-text-editor/hooks/use-shape-position.d.ts +29 -0
  117. package/lib/types/views/shape-text-editor/index.d.ts +5 -0
  118. package/lib/types/views/shape-text-editor/position-wrapper.d.ts +15 -0
  119. package/lib/types/views/shapes.d.ts +58 -0
  120. package/lib/umd/index.js +1 -0
  121. package/lib/umd/locale/ar-SA.js +1 -0
  122. package/lib/umd/locale/ca-ES.js +1 -0
  123. package/lib/umd/locale/de-DE.js +1 -0
  124. package/lib/umd/locale/en-US.js +1 -0
  125. package/lib/umd/locale/es-ES.js +1 -0
  126. package/lib/umd/locale/fa-IR.js +1 -0
  127. package/lib/umd/locale/fr-FR.js +1 -0
  128. package/lib/umd/locale/id-ID.js +1 -0
  129. package/lib/umd/locale/it-IT.js +1 -0
  130. package/lib/umd/locale/ja-JP.js +1 -0
  131. package/lib/umd/locale/ko-KR.js +1 -0
  132. package/lib/umd/locale/pl-PL.js +1 -0
  133. package/lib/umd/locale/pt-BR.js +1 -0
  134. package/lib/umd/locale/ru-RU.js +1 -0
  135. package/lib/umd/locale/sk-SK.js +1 -0
  136. package/lib/umd/locale/vi-VN.js +1 -0
  137. package/lib/umd/locale/zh-CN.js +1 -0
  138. package/lib/umd/locale/zh-HK.js +1 -0
  139. package/lib/umd/locale/zh-TW.js +1 -0
  140. package/package.json +93 -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,8 @@
1
+ import type { IMenuInsertShapeCommandParams } from '../commands/command/menu-insert-shape.command';
2
+ import { IMAGE_CLIP_SHAPE_PICKER_COMPONENT } from '@univerjs/drawing-ui';
3
+ export declare const SHAPE_PICKER_COMPONENT = "doc.shape.picker.component";
4
+ export { IMAGE_CLIP_SHAPE_PICKER_COMPONENT };
5
+ export declare function ImageClipShapePicker(): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ShapePicker({ paragraphMenuPlacement }: {
7
+ paragraphMenuPlacement?: IMenuInsertShapeCommandParams['paragraphMenuPlacement'];
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { 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,13 @@
1
+ import type { IShapeData } from '@univerjs-pro/engine-shape';
2
+ import { ShapeFillEnum } from '@univerjs-pro/engine-shape';
3
+ interface IShapeFillProps {
4
+ unitId: string;
5
+ subUnitId: string;
6
+ shapeId: string;
7
+ shapeData: IShapeData;
8
+ isLineShape: boolean;
9
+ disableShapeOption: boolean;
10
+ }
11
+ export declare function getInitialShapeFillType(shapeData: IShapeData): ShapeFillEnum;
12
+ export declare function ShapeFillEditor(props: IShapeFillProps): import("react/jsx-runtime").JSX.Element | null;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { IShapeData } from '@univerjs-pro/engine-shape';
2
+ interface IShapeImageFillEditorProps {
3
+ unitId: string;
4
+ subUnitId: string;
5
+ shapeId: string;
6
+ shapeData: IShapeData;
7
+ disableShapeOption: boolean;
8
+ }
9
+ export declare function ShapeImageFillEditor(props: IShapeImageFillEditorProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
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 {};
@@ -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,19 @@
1
+ import type { IShapeData, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
2
+ export declare const DOCS_SHAPE_FLOATING_TOOLBAR_KEY = "doc.shape.floating-toolbar";
3
+ interface IShapeFloatingToolbarExtraProps {
4
+ unitId: string;
5
+ subUnitId: string;
6
+ drawingId: string;
7
+ shapeType: ShapeTypeEnum;
8
+ shapeData: IShapeData;
9
+ }
10
+ interface IShapeFloatingToolbarProps {
11
+ popup: {
12
+ extraProps?: IShapeFloatingToolbarExtraProps;
13
+ };
14
+ }
15
+ export declare function ShapeFloatingToolbar(props: IShapeFloatingToolbarProps): import("react/jsx-runtime").JSX.Element | null;
16
+ export declare namespace ShapeFloatingToolbar {
17
+ var displayName: string;
18
+ }
19
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { IShapeData } from '@univerjs-pro/engine-shape';
2
+ import type { ITextStyle } from '@univerjs/core';
3
+ import { HorizontalAlign, VerticalAlign } from '@univerjs/core';
4
+ interface IShapeTextUpdateOptions {
5
+ textStyle?: ITextStyle;
6
+ verticalAlign?: VerticalAlign;
7
+ horizontalAlign?: HorizontalAlign;
8
+ }
9
+ export declare function buildShapeTextDataUpdate(shapeData: IShapeData, options: IShapeTextUpdateOptions): IShapeData;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { ShapeTypeEnum } from '@univerjs-pro/engine-shape';
2
+ import type { IAccessor } from '@univerjs/core';
3
+ import type { IMenuSelectorItem } from '@univerjs/ui';
4
+ export interface IShapeTypeOption {
5
+ label: string;
6
+ value: ShapeTypeEnum;
7
+ icon: string;
8
+ }
9
+ export declare const ShapeMenuItemFactory: (accessor: IAccessor) => IMenuSelectorItem;
10
+ export declare const ShapeInsertBelowMenuItemFactory: (accessor: IAccessor) => IMenuSelectorItem;
11
+ export declare const EmptyParagraphShapeMenuItemFactory: (accessor: IAccessor) => IMenuSelectorItem;
@@ -0,0 +1,24 @@
1
+ import type { IKeyboardEventConfig } from '@univerjs/docs-ui';
2
+ import type { CSSProperties } from 'react';
3
+ import { ICommandService } from '@univerjs/core';
4
+ export interface IShapeEditorProps {
5
+ containerWidth: number;
6
+ containerHeight: number;
7
+ scaleX: number;
8
+ scaleY: number;
9
+ }
10
+ export declare function getShapeTextEditorContentStyle(containerWidth: number, containerHeight: number): CSSProperties;
11
+ export declare function applyShapeTextEditorCanvasTransparency(renderer: {
12
+ engine?: {
13
+ getCanvasElement?: () => HTMLElement | null;
14
+ };
15
+ } | null | undefined | void): void;
16
+ export declare function getShapeTextEditorKeyboardConfig(commandService: Pick<ICommandService, 'executeCommand'>): IKeyboardEventConfig;
17
+ /**
18
+ * Shape editor component - second layer DOM.
19
+ * Handles document editing, content height tracking, and vertical alignment.
20
+ */
21
+ export declare const ShapeEditor: {
22
+ (props: IShapeEditorProps): import("react/jsx-runtime").JSX.Element;
23
+ displayName: string;
24
+ };
@@ -0,0 +1 @@
1
+ export declare function ShapeTextFloatToolbar(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import type { IEditingParams } from '../../../services/shape-text-editing.service';
2
+ import type { Nullable } from '@univerjs/core';
3
+ import type { Scene } 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
+ export declare function calcShapePosition(shapeLeft: number, shapeTop: number, shapeWidth: number, shapeHeight: number, shapeAngle: number, scene: Scene): IShapePosition;
18
+ export interface IUseShapePositionOptions {
19
+ editingParams: Nullable<IEditingParams>;
20
+ scene: Nullable<Scene>;
21
+ getShapeTransform: () => Nullable<{
22
+ left: number;
23
+ top: number;
24
+ width: number;
25
+ height: number;
26
+ angle: number;
27
+ }>;
28
+ }
29
+ export declare function useShapePosition(options: IUseShapePositionOptions): IShapePositionResult;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Main shape text editor container component.
3
+ * Combines PositionWrapper (first layer) and Editor (second layer).
4
+ */
5
+ export declare const ShapeTextEditorContainer: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
@@ -0,0 +1,15 @@
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>;
@@ -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
+ })[];