@univerjs-pro/shape-editor-ui 1.0.0-alpha.8 → 1.0.0-beta.1

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 (135) 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.css +456 -59
  42. package/lib/index.js +1 -1
  43. package/lib/locale/ar-SA.js +1 -1
  44. package/lib/locale/ca-ES.js +1 -1
  45. package/lib/locale/de-DE.js +1 -1
  46. package/lib/locale/en-US.js +1 -1
  47. package/lib/locale/es-ES.js +1 -1
  48. package/lib/locale/fa-IR.js +1 -1
  49. package/lib/locale/fr-FR.js +1 -1
  50. package/lib/locale/id-ID.js +1 -1
  51. package/lib/locale/it-IT.js +1 -1
  52. package/lib/locale/ja-JP.js +1 -1
  53. package/lib/locale/ko-KR.js +1 -1
  54. package/lib/locale/pl-PL.js +1 -1
  55. package/lib/locale/pt-BR.js +1 -1
  56. package/lib/locale/ru-RU.js +1 -1
  57. package/lib/locale/sk-SK.js +1 -1
  58. package/lib/locale/vi-VN.js +1 -1
  59. package/lib/locale/zh-CN.js +1 -1
  60. package/lib/locale/zh-HK.js +1 -1
  61. package/lib/locale/zh-TW.js +1 -1
  62. package/lib/types/commands/operations/toggle-shape-floating-toolbar.operation.d.ts +2 -0
  63. package/lib/types/common/formula-shape-en-us.d.ts +0 -19
  64. package/lib/types/components/fill-style-tabs-editor/FillStyleTabsEditor.d.ts +2 -0
  65. package/lib/types/config/config.d.ts +2 -25
  66. package/lib/types/controllers/components.controller.d.ts +3 -2
  67. package/lib/types/index.d.ts +32 -6
  68. package/lib/types/locale/en-US.d.ts +132 -21
  69. package/lib/types/menu/shape-floating-toolbar.menu.d.ts +3 -0
  70. package/lib/types/plugin.d.ts +3 -2
  71. package/lib/types/services/formula-binding.service.d.ts +34 -0
  72. package/lib/types/services/shape-floating-toolbar.service.d.ts +16 -0
  73. package/lib/types/utils/drawing-type-name.d.ts +3 -0
  74. package/lib/types/utils/shape-contextual-ribbon-host.d.ts +2 -0
  75. package/lib/types/utils/shape-floating-toolbar-config.d.ts +3 -3
  76. package/lib/types/views/FormulaBindingEditorDialog.d.ts +1 -1
  77. package/lib/types/views/formula-shape/UseFormulaShapeToolbar.d.ts +3 -0
  78. package/lib/types/views/shape-floating-toolbar/ShapeFillControls.d.ts +14 -0
  79. package/lib/types/views/shape-floating-toolbar/ShapeFloatingToolbar.d.ts +6 -129
  80. package/lib/types/views/shape-floating-toolbar/ShapeFloatingToolbarPrimitives.d.ts +48 -0
  81. package/lib/types/views/shape-floating-toolbar/ShapeStrokeControls.d.ts +41 -0
  82. package/lib/types/views/shape-floating-toolbar/ShapeTextControls.d.ts +33 -0
  83. package/lib/types/views/shape-floating-toolbar/floating-toolbar-interaction.d.ts +4 -0
  84. package/lib/types/views/shape-floating-toolbar/shape-floating-toolbar-constants.d.ts +11 -0
  85. package/lib/types/views/shape-floating-toolbar/shape-floating-toolbar-types.d.ts +12 -0
  86. package/lib/types/views/shape-floating-toolbar/shape-floating-toolbar-utils.d.ts +7 -1
  87. package/lib/types/views/shape-floating-toolbar/shape-floating-toolbar-wheel.util.d.ts +1 -0
  88. package/lib/types/views/shape-format-ribbon/ShapeEffectControls.d.ts +19 -0
  89. package/lib/types/views/shape-format-ribbon/ShapeEffectPresetIcon.d.ts +11 -0
  90. package/lib/types/views/shape-format-ribbon/ShapeFormatRibbonControls.d.ts +27 -0
  91. package/lib/types/views/shape-format-ribbon/shape-effect-reference-paths.generated.d.ts +6 -0
  92. package/lib/types/views/shape-picker/ShapeChangePicker.d.ts +7 -0
  93. package/lib/types/views/shape-quick-style/ShapeQuickStyleGallery.d.ts +10 -0
  94. package/lib/types/views/shape-text-editor/DocParagraphTypeDropdown.d.ts +1 -1
  95. package/lib/types/views/shape-text-editor/ShapeTextEditor.d.ts +2 -193
  96. package/lib/types/views/shape-text-editor/ShapeTextEditorSurface.d.ts +16 -0
  97. package/lib/types/views/shape-text-editor/ShapeTextFloatToolbar.d.ts +0 -1
  98. package/lib/types/views/shape-text-editor/ShapeTextPositionWrapper.d.ts +1 -0
  99. package/lib/types/views/shape-text-editor/shape-text-document.d.ts +17 -2
  100. package/lib/types/views/shape-text-editor/shape-text-keyboard.d.ts +31 -0
  101. package/lib/types/views/shape-text-editor/shape-text-layout.d.ts +190 -1
  102. package/lib/types/views/shape-text-editor/types.d.ts +2 -1
  103. package/lib/types/views/smart-art/SmartArtColorGallery.d.ts +6 -0
  104. package/lib/types/views/smart-art/SmartArtLayoutGallery.d.ts +6 -0
  105. package/lib/types/views/smart-art/SmartArtLayoutIcon.d.ts +6 -0
  106. package/lib/types/views/smart-art/SmartArtQuickStyleGallery.d.ts +10 -0
  107. package/lib/types/views/smart-art/SmartArtRibbonControl.d.ts +33 -0
  108. package/lib/types/views/smart-art/SmartArtTextPane.d.ts +14 -0
  109. package/lib/types/views/smart-art/smart-art-layout-catalog.generated.d.ts +35 -0
  110. package/lib/types/views/smart-art/smart-art-layout-gallery-catalog.generated.d.ts +5 -0
  111. package/lib/umd/index.js +1 -1
  112. package/lib/umd/locale/ar-SA.js +1 -1
  113. package/lib/umd/locale/ca-ES.js +1 -1
  114. package/lib/umd/locale/de-DE.js +1 -1
  115. package/lib/umd/locale/en-US.js +1 -1
  116. package/lib/umd/locale/es-ES.js +1 -1
  117. package/lib/umd/locale/fa-IR.js +1 -1
  118. package/lib/umd/locale/fr-FR.js +1 -1
  119. package/lib/umd/locale/id-ID.js +1 -1
  120. package/lib/umd/locale/it-IT.js +1 -1
  121. package/lib/umd/locale/ja-JP.js +1 -1
  122. package/lib/umd/locale/ko-KR.js +1 -1
  123. package/lib/umd/locale/pl-PL.js +1 -1
  124. package/lib/umd/locale/pt-BR.js +1 -1
  125. package/lib/umd/locale/ru-RU.js +1 -1
  126. package/lib/umd/locale/sk-SK.js +1 -1
  127. package/lib/umd/locale/vi-VN.js +1 -1
  128. package/lib/umd/locale/zh-CN.js +1 -1
  129. package/lib/umd/locale/zh-HK.js +1 -1
  130. package/lib/umd/locale/zh-TW.js +1 -1
  131. package/package.json +23 -26
  132. package/lib/cjs/formula-shape-en-us-B0fVf3OO.js +0 -1
  133. package/lib/es/formula-shape-en-us-BbvC914f.js +0 -1
  134. package/lib/formula-shape-en-us-BbvC914f.js +0 -1
  135. package/lib/types/services/formula-binding-unit-viewer.service.d.ts +0 -67
@@ -0,0 +1,48 @@
1
+ import type { ComponentProps, MouseEvent, PointerEvent, ReactNode } from 'react';
2
+ import { Dropdown, Tooltip } from '@univerjs/design';
3
+ export declare function ShapeFloatingToolbarTooltip(props: Omit<ComponentProps<typeof Tooltip>, 'visible' | 'onVisibleChange'> & {
4
+ popupOpen: boolean;
5
+ }): import("react").JSX.Element;
6
+ type ShapeFloatingToolbarDropdownProps = Omit<ComponentProps<typeof Dropdown>, 'avoidCollisions'>;
7
+ export declare function ShapeFloatingToolbarDropdown(props: ShapeFloatingToolbarDropdownProps): import("react").JSX.Element;
8
+ export declare function ShapeFloatingToolbarIcon(props: {
9
+ children: ReactNode;
10
+ className?: string;
11
+ }): import("react").JSX.Element;
12
+ export declare function ShapeFloatingToolbarContent(props: {
13
+ children: ReactNode;
14
+ className?: string;
15
+ maxWidthClassName?: string;
16
+ onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
17
+ }): import("react").JSX.Element;
18
+ export declare function ShapeFloatingToolbarButton(props: {
19
+ title?: string;
20
+ active?: boolean;
21
+ disabled?: boolean;
22
+ children: ReactNode;
23
+ className?: string;
24
+ sizeClassName?: string;
25
+ popupOpen?: boolean;
26
+ ariaExpanded?: boolean;
27
+ onClick?: () => void;
28
+ onMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;
29
+ onPointerDown?: (event: PointerEvent<HTMLButtonElement>) => void;
30
+ }): import("react").JSX.Element;
31
+ export declare function ShapeFloatingToolbarDropdownTrigger(props: {
32
+ title?: string;
33
+ label?: string;
34
+ icon: ReactNode;
35
+ active?: boolean;
36
+ className?: string;
37
+ sizeClassName?: string;
38
+ onMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;
39
+ onPointerDown?: (event: PointerEvent<HTMLButtonElement>) => void;
40
+ }): import("react").JSX.Element;
41
+ export declare function ShapeFloatingToolbarFontSizeSelect(props: {
42
+ value: string | number;
43
+ className?: string;
44
+ dropdownSide?: 'top' | 'bottom';
45
+ onChange: (fontSize: number) => void;
46
+ onAfterChange?: () => void;
47
+ }): import("react").JSX.Element;
48
+ export {};
@@ -0,0 +1,41 @@
1
+ import type { IShapeData } from '@univerjs-pro/engine-shape';
2
+ import type { ShapeDataUpdateHandler } from './shape-floating-toolbar-types';
3
+ export type ShapeStrokePanelMode = 'none' | 'solid' | 'dash' | 'dot';
4
+ export declare function buildShapeStrokeDataUpdate(currentStroke: IShapeData['stroke'], resolvedStroke: NonNullable<IShapeData['stroke']>, partial: Partial<NonNullable<IShapeData['stroke']>>): {
5
+ nextShapeData: IShapeData;
6
+ patch: IShapeData;
7
+ };
8
+ export interface IShapeStrokePanelContentProps {
9
+ title: string;
10
+ shapeData: IShapeData;
11
+ disabled?: boolean;
12
+ resetLabel?: string;
13
+ modeOptions?: ShapeStrokePanelMode[];
14
+ showDashDropdown?: boolean;
15
+ fallbackColor?: string;
16
+ widthRange?: {
17
+ min: number;
18
+ max: number;
19
+ step: number;
20
+ };
21
+ onReset?: () => void;
22
+ onRequestClose?: () => void;
23
+ closeOnColorChange?: boolean;
24
+ onUpdateShapeData: ShapeDataUpdateHandler;
25
+ }
26
+ export declare function ShapeStrokePanelContent(props: IShapeStrokePanelContentProps): import("react").JSX.Element;
27
+ export declare function ShapeStrokePanelButton(props: {
28
+ title: string;
29
+ label?: string;
30
+ shapeData: IShapeData;
31
+ open?: boolean;
32
+ disabled?: boolean;
33
+ resetLabel?: string;
34
+ fallbackColor?: string;
35
+ dropdownSide?: 'top' | 'bottom';
36
+ onReset?: () => void;
37
+ onOpenChange?: (open: boolean) => void;
38
+ closeOnColorChange?: boolean;
39
+ keepOpenOnInternalInteraction?: boolean;
40
+ onUpdateShapeData: ShapeDataUpdateHandler;
41
+ }): import("react").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import type { HorizontalAlign, ITextStyle, VerticalAlign } from '@univerjs/core';
2
+ import type { IToolbarDropdownOption, ShapeTextUpdateHandler } from './shape-floating-toolbar-types';
3
+ export declare function TextFillButton(props: {
4
+ title: string;
5
+ textStyle: ITextStyle;
6
+ fallbackColor: string;
7
+ dropdownSide?: 'top' | 'bottom';
8
+ onChange: (textStyle: ITextStyle) => void;
9
+ }): import("react").JSX.Element;
10
+ export declare function TextBackgroundColorButton(props: {
11
+ title: string;
12
+ color: string;
13
+ dropdownSide?: 'top' | 'bottom';
14
+ onApply: () => void;
15
+ onReset?: () => void;
16
+ onChange: (color: string) => void;
17
+ }): import("react").JSX.Element;
18
+ export declare function TypographyPanelButton(props: {
19
+ title: string;
20
+ fontFamily: string;
21
+ textStyle: {
22
+ isBold: boolean;
23
+ isItalic: boolean;
24
+ isUnderline: boolean;
25
+ isStrike: boolean;
26
+ };
27
+ horizontalAlign: HorizontalAlign;
28
+ verticalAlign: VerticalAlign;
29
+ horizontalAlignOptions: Array<IToolbarDropdownOption<HorizontalAlign>>;
30
+ verticalAlignOptions: Array<IToolbarDropdownOption<VerticalAlign>>;
31
+ dropdownSide?: 'top' | 'bottom';
32
+ onUpdateText: ShapeTextUpdateHandler;
33
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import type { MouseEvent, PointerEvent } from 'react';
2
+ export declare function shouldKeepFloatingToolbarMouseDownDefault(target: EventTarget | null): boolean;
3
+ export declare function preventFloatingToolbarPanelBlur(event: MouseEvent<HTMLElement> | PointerEvent<HTMLElement>): void;
4
+ export declare function keepFloatingToolbarPanelInteraction(event: MouseEvent<HTMLElement> | PointerEvent<HTMLElement>): void;
@@ -0,0 +1,11 @@
1
+ import { ShapeFillEnum } from '@univerjs-pro/engine-shape';
2
+ export declare const SHAPE_FLOATING_TOOLBAR_DEFAULT_FILL_COLOR = "#3B82F6";
3
+ export declare const SHAPE_FLOATING_TOOLBAR_DEFAULT_STROKE_COLOR = "#2563EB";
4
+ export declare const SHAPE_FLOATING_TOOLBAR_DEFAULT_TEXT_COLOR = "#111827";
5
+ export declare const SHAPE_FLOATING_TOOLBAR_DEFAULT_TEXT_BACKGROUND_COLOR = "#ffffff";
6
+ export declare const SHAPE_FILL_TYPE_VALUES: {
7
+ none: ShapeFillEnum;
8
+ solid: ShapeFillEnum;
9
+ gradient: ShapeFillEnum;
10
+ picture: ShapeFillEnum;
11
+ };
@@ -0,0 +1,12 @@
1
+ import type { IShapeData } from '@univerjs-pro/engine-shape';
2
+ import type { ReactNode } from 'react';
3
+ import type { IShapeTextUpdateOptions } from './shape-floating-toolbar-utils';
4
+ export interface IToolbarDropdownOption<T extends string | number> {
5
+ label: string;
6
+ value: T;
7
+ icon: ReactNode;
8
+ }
9
+ export type ShapeDataUpdateHandler = (oldShapeJSON: {
10
+ oldShapeData?: IShapeData;
11
+ }, shapeData?: IShapeData, patch?: IShapeData) => void;
12
+ export type ShapeTextUpdateHandler = (params: IShapeTextUpdateOptions) => void;
@@ -1,11 +1,17 @@
1
1
  import type { IShapeData, IShapeTextDataModel } from '@univerjs-pro/engine-shape';
2
- import type { IDocumentData, ITextStyle } from '@univerjs/core';
2
+ import type { IDocumentData, ITextStyle, PresetListType } from '@univerjs/core';
3
3
  import { HorizontalAlign, VerticalAlign } from '@univerjs/core';
4
4
  export interface IShapeTextUpdateOptions {
5
5
  textStyle?: ITextStyle;
6
6
  verticalAlign?: VerticalAlign;
7
7
  horizontalAlign?: HorizontalAlign;
8
+ listType?: PresetListType | null;
8
9
  }
9
10
  export declare function createDefaultShapeTextDocument(textStyle?: ITextStyle, horizontalAlign?: HorizontalAlign, text?: string): IDocumentData;
10
11
  export declare function getShapeTextModel(shapeData: IShapeData, options: IShapeTextUpdateOptions): IShapeTextDataModel;
12
+ export declare function getShapeTextListState(shapeData: IShapeData, family: PresetListType.ORDER_LIST | PresetListType.BULLET_LIST): {
13
+ active: boolean;
14
+ mixed: boolean;
15
+ value?: PresetListType;
16
+ };
11
17
  export declare function buildShapeTextDataUpdate(shapeData: IShapeData, options: IShapeTextUpdateOptions): IShapeData;
@@ -0,0 +1 @@
1
+ export declare function forwardShapeFloatingToolbarWheel(source: WheelEvent, canvasElement: HTMLCanvasElement): boolean;
@@ -0,0 +1,19 @@
1
+ import type { IShapeData, ShapeBevelPresetEnum } from '@univerjs-pro/engine-shape';
2
+ import { ShapeCameraPresetEnum } from '@univerjs-pro/engine-shape';
3
+ export type ShapeEffectCategory = 'shadow' | 'reflection' | 'glow' | 'softEdge' | 'bevel' | 'rotation3d';
4
+ /**
5
+ * Values observed by applying the native PowerPoint gallery to a newly inserted rectangle.
6
+ * Existing 3D properties not owned by the selected gallery remain intact through mergeEffectPatch.
7
+ */
8
+ export declare function createBevelPresetPatch(preset: ShapeBevelPresetEnum): IShapeData;
9
+ export declare function createRotationPresetPatch(preset: ShapeCameraPresetEnum): IShapeData;
10
+ export declare const ROTATION_GROUPS: Record<string, ShapeCameraPresetEnum[]>;
11
+ export declare function mergeEffectPatch(shapeData: IShapeData, patch: IShapeData): IShapeData;
12
+ export declare function ShapeEffectButton(props: {
13
+ categories?: ShapeEffectCategory[];
14
+ shapeData: IShapeData;
15
+ disabled?: boolean;
16
+ dropdownSide?: 'top' | 'bottom';
17
+ titleKey?: string;
18
+ onUpdateShapeData: (patch: IShapeData) => void;
19
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { IShapeScene3D } from '@univerjs-pro/engine-shape';
2
+ import { ShapeBevelPresetEnum, ShapeCameraPresetEnum } from '@univerjs-pro/engine-shape';
3
+ export declare const BEVEL_PRESET_ORDER: readonly [ShapeBevelPresetEnum.RelaxedInset, ShapeBevelPresetEnum.Circle, ShapeBevelPresetEnum.Slope, ShapeBevelPresetEnum.Cross, ShapeBevelPresetEnum.Angle, ShapeBevelPresetEnum.SoftRound, ShapeBevelPresetEnum.Convex, ShapeBevelPresetEnum.CoolSlant, ShapeBevelPresetEnum.Divot, ShapeBevelPresetEnum.Riblet, ShapeBevelPresetEnum.HardEdge, ShapeBevelPresetEnum.ArtDeco];
4
+ export declare function BevelPresetIcon(props: {
5
+ preset: ShapeBevelPresetEnum;
6
+ }): import("react").JSX.Element;
7
+ export declare function RotationPresetIcon(props: {
8
+ group: string;
9
+ preset: ShapeCameraPresetEnum;
10
+ scene3d: IShapeScene3D;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import type { IShapeData, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
2
+ import type { ReactNode } from 'react';
3
+ import type { IShapeFloatingToolbarExtensionAction } from '../shape-floating-toolbar/ShapeFloatingToolbar';
4
+ export interface IShapeStyleRibbonControlProps {
5
+ shapeData: IShapeData;
6
+ shapeType?: ShapeTypeEnum;
7
+ onUpdateShapeData: (patch: IShapeData) => void;
8
+ }
9
+ export type IShapeEffectsRibbonControlProps = IShapeStyleRibbonControlProps;
10
+ export interface IShapeTextRibbonControlProps {
11
+ fontFamilyPopupDataComponent: string;
12
+ shapeData: IShapeData;
13
+ onUpdateShapeData: (patch: IShapeData) => void;
14
+ }
15
+ export interface IShapeTextEffectsRibbonControlProps {
16
+ shapeData: IShapeData;
17
+ onUpdateShapeData: (patch: IShapeData) => void;
18
+ }
19
+ export interface IShapeFormulaRibbonControlProps {
20
+ actions: IShapeFloatingToolbarExtensionAction[];
21
+ panel?: ReactNode;
22
+ }
23
+ export declare function ShapeStyleRibbonControl(props: IShapeStyleRibbonControlProps): import("react").JSX.Element;
24
+ export declare function ShapeEffectsRibbonControl(props: IShapeEffectsRibbonControlProps): import("react").JSX.Element;
25
+ export declare function ShapeTextEffectsRibbonControl(props: IShapeTextEffectsRibbonControlProps): import("react").JSX.Element;
26
+ export declare function ShapeFormulaRibbonControl(props: IShapeFormulaRibbonControlProps): import("react").JSX.Element | null;
27
+ export declare function ShapeTextRibbonControl(props: IShapeTextRibbonControlProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface IReferenceIconLayer {
2
+ fill: string;
3
+ d: string;
4
+ }
5
+ export declare const BEVEL_REFERENCE_PATHS: readonly IReferenceIconLayer[][];
6
+ export declare const ROTATION_REFERENCE_PATHS: readonly IReferenceIconLayer[][];
@@ -0,0 +1,7 @@
1
+ import type { ShapeTypeEnum } from '@univerjs-pro/engine-shape';
2
+ export declare const SHAPE_CHANGE_PICKER_COMPONENT = "shape-editor-ui.change-shape-picker";
3
+ interface IShapeChangePickerProps {
4
+ onChange?: (value: ShapeTypeEnum) => void;
5
+ }
6
+ export declare function ShapeChangePicker(props: IShapeChangePickerProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import { getShapeQuickStylePresets } from '@univerjs-pro/shape-editor';
2
+ type ShapeQuickStyleType = Parameters<typeof getShapeQuickStylePresets>[0];
3
+ export interface IShapeQuickStyleGalleryProps {
4
+ type: ShapeQuickStyleType;
5
+ ariaLabel: string;
6
+ activePresetId?: string | null;
7
+ onSelect: (presetId: string) => void;
8
+ }
9
+ export declare function ShapeQuickStyleGallery(props: IShapeQuickStyleGalleryProps): import("react").JSX.Element;
10
+ export {};
@@ -1,8 +1,8 @@
1
1
  import type { MouseEvent as ReactMouseEvent } from 'react';
2
2
  export interface IDocParagraphTypeDropdownProps {
3
- buttonClassName?: string;
4
3
  className?: string;
5
4
  popupDataComponent?: string;
5
+ size?: 'small' | 'middle';
6
6
  title?: string;
7
7
  onAfterCommand?: () => void;
8
8
  onBeforeCommand?: () => void;
@@ -1,9 +1,5 @@
1
- import type { ICustomShapeTextData, IShapeRect, IShapeTextDataModel } from '@univerjs-pro/engine-shape';
2
- import type { IDocumentData, Nullable } from '@univerjs/core';
3
- import type { Editor, IKeyboardEventConfig } from '@univerjs/docs-ui';
4
- import type { CSSProperties } from 'react';
5
- import type { IShapeTextEditingParams, IShapeTextEditingService, IShapeTextEditorAdapter, IShapeTextEditorModel } from './types';
6
- import { HorizontalAlign, ICommandService, VerticalAlign } from '@univerjs/core';
1
+ import type { Nullable } from '@univerjs/core';
2
+ import type { IShapeTextEditingParams, IShapeTextEditingService, IShapeTextEditorAdapter } from './types';
7
3
  export { resolveShapeTextEditorBehaviorShapeData, resolveShapeTextEditorWrapStrategy, shouldAllowShapeTextEditorHostSizeShrink, shouldAutoFitShapeTextEditorNoWrap, } from './shape-text-behavior';
8
4
  export interface IShapeTextEditorProps {
9
5
  adapter: IShapeTextEditorAdapter;
@@ -16,191 +12,4 @@ export interface IShapeTextEditorProps {
16
12
  scaleY: number;
17
13
  verticalAlignCommandId?: string;
18
14
  }
19
- interface IContentLayout {
20
- documentMarginTop: number;
21
- editorLeft: number;
22
- editorTop: number;
23
- editorWidth: number;
24
- editorHeight: number;
25
- editorSurfaceWidth?: number;
26
- }
27
- export declare function resolveShapeTextEditingContentHeight(measuredContentHeight: number, caretHeight?: number): number;
28
- export declare function getShapeTextEditingCaretHeight(activeRange?: {
29
- getAbsolutePosition(): Nullable<{
30
- height?: number;
31
- }>;
32
- }): number | undefined;
33
- export declare function areShapeTextEditorLayoutsEqual(a: IContentLayout, b: IContentLayout): boolean;
34
- interface IShapeTextEditorLayoutOptions {
35
- actualHeight: number;
36
- contentWidth?: number;
37
- scaleX: number;
38
- scaleY: number;
39
- textRect: {
40
- left: number;
41
- top: number;
42
- width: number;
43
- height: number;
44
- };
45
- verticalAlign: VerticalAlign;
46
- opticalVerticalOffset?: number;
47
- }
48
- interface IShapeTextEditorLayout {
49
- documentMarginTop: number;
50
- editorLeft: number;
51
- editorTop: number;
52
- editorWidth: number;
53
- editorHeight: number;
54
- pageHeight: number;
55
- }
56
- interface IShapeTextEditorKeyboardRange {
57
- startOffset?: number;
58
- endOffset?: number;
59
- collapsed?: boolean;
60
- }
61
- export declare function isShapeTextEditorKeyboardFocusActive(isInputFocusing: boolean, textRanges: readonly IShapeTextEditorKeyboardRange[] | null | undefined): boolean;
62
- interface IShapeTextEditorHostHeightOptions {
63
- hostHeight: number;
64
- textRect: {
65
- left: number;
66
- top: number;
67
- width: number;
68
- height: number;
69
- };
70
- contentHeight: number;
71
- }
72
- interface IShapeTextEditorHostSizeOptions {
73
- hostWidth: number;
74
- hostHeight: number;
75
- textRect: {
76
- left: number;
77
- top: number;
78
- width: number;
79
- height: number;
80
- };
81
- contentWidth: number;
82
- contentHeight: number;
83
- allowShrink?: boolean;
84
- }
85
- interface IShapeTextEditorHostSizeChangeOptions {
86
- nextWidth: number;
87
- nextHeight: number;
88
- baselineWidth: number;
89
- baselineHeight: number;
90
- tolerance?: number;
91
- }
92
- interface IShapeTextEditorKeyboardOptions {
93
- commitOnEnter?: boolean;
94
- cancel?: () => void;
95
- commit?: () => void;
96
- currentFontSize?: number;
97
- }
98
- export declare function getShapeTextEditorFocusSessionKey(options: {
99
- editorUnitId: string;
100
- editingParams: Nullable<IShapeTextEditingParams>;
101
- }): string | null;
102
- export declare function shouldCompleteShapeTextEditingOnPointerDown(target: EventTarget | null, editorElement: HTMLElement | null): boolean;
103
- export declare function resolveShapeTextEditorTextRect(options: {
104
- shapeModel: Pick<IShapeTextEditorModel, 'getShapeTextRect'>;
105
- hostRect: IShapeRect;
106
- }): IShapeRect;
107
- export declare function buildShapeTextEditorCommitShapeText(options: {
108
- dataModel?: IShapeTextDataModel;
109
- isHorizontal?: boolean;
110
- shapeText?: ICustomShapeTextData | null;
111
- }): ICustomShapeTextData;
112
- export declare function createEmptyShapeTextEditorDocument(editorUnitId: string, pageWidth: number): IDocumentData;
113
- export declare function resolveShapeTextEditorEmptyTextBoxMinSize(options: {
114
- isHorizontal: boolean;
115
- placeholderWidth: number;
116
- }): {
117
- width: number;
118
- height: number;
119
- };
120
- export declare function measureShapeTextEditorPlaceholderWidth(documentData: IDocumentData, placeholder: string): number;
121
- export declare function resolveShapeTextEditorMeasurePageWidth(options: {
122
- autoFitNoWrap: boolean;
123
- maxAutoFitWidth?: number;
124
- textRectWidth: number;
125
- }): number;
126
- export declare function measureShapeTextEditorNoWrapContentWidth(documentData: IDocumentData | null | undefined): number;
127
- export declare function resolveShapeTextEditorRenderedContentWidth(options: {
128
- actualWidth: number;
129
- autoFitNoWrap: boolean;
130
- measuredContentWidth?: number;
131
- textRectWidth: number;
132
- }): number;
133
- export declare function resolveShapeTextEditorHostContentWidth(options: {
134
- actualWidth: number;
135
- allowShrink: boolean;
136
- autoFitNoWrap: boolean;
137
- measuredContentWidth?: number;
138
- renderedContentWidth: number;
139
- }): number;
140
- export declare function resolveShapeTextEditorFinalPageWidth(options: {
141
- autoFitNoWrap: boolean;
142
- measurePageWidth?: number;
143
- renderedContentWidth: number;
144
- textRectWidth: number;
145
- }): number;
146
- export declare function resolveShapeTextEditorRenderSurfaceWidth(options: {
147
- autoFitNoWrap: boolean;
148
- editorWidth: number;
149
- measurePageWidth: number;
150
- renderedContentWidth?: number;
151
- scaleX: number;
152
- }): number;
153
- export declare function hasShapeTextEditorHostSizeChanged(options: IShapeTextEditorHostSizeChangeOptions): boolean;
154
- export declare function resolveShapeTextEditorShouldShrinkHostSize(options: {
155
- adapter: Pick<IShapeTextEditorAdapter, 'allowHostSizeShrink' | 'updateHostSize'>;
156
- editingParams: Nullable<IShapeTextEditingParams>;
157
- }): boolean;
158
- export declare function shouldDeferShapeTextEditorHostSizeUpdateDuringEditing(options: {
159
- adapter: Pick<IShapeTextEditorAdapter, 'deferHostSizeUpdateDuringEditing'>;
160
- editingParams: Nullable<IShapeTextEditingParams>;
161
- }): boolean;
162
- export declare function resolveShapeTextEditorDocumentVerticalAlign(options: {
163
- opticalVerticalAlign: boolean;
164
- verticalAlign: VerticalAlign;
165
- }): VerticalAlign;
166
- export declare function resolveShapeTextEditorLayout(options: IShapeTextEditorLayoutOptions): IShapeTextEditorLayout;
167
- export declare function resolveShapeTextEditorPlaceholderLayout(options: {
168
- documentMarginTop: number;
169
- editorLeft: number;
170
- editorSurfaceWidth?: number;
171
- editorTop: number;
172
- editorWidth: number;
173
- horizontalAlign: HorizontalAlign;
174
- }): {
175
- left: number;
176
- textAlign: 'center' | 'left' | 'right';
177
- top: number;
178
- width: number;
179
- };
180
- export declare function resolveShapeTextEditorHostHeight(options: IShapeTextEditorHostHeightOptions): number;
181
- export declare function resolveShapeTextEditorHostSize(options: IShapeTextEditorHostSizeOptions): {
182
- width: number;
183
- height: number;
184
- };
185
- export declare function resolveShapeTextEditorPhysicalContentSize(options: {
186
- crossAxisLength: number;
187
- flowAxis: 'width' | 'height';
188
- flowAxisLength: number;
189
- }): {
190
- height: number;
191
- width: number;
192
- };
193
- export declare function getShapeTextEditorContentStyle(leftOrWidth: number, topOrHeight: number, width?: number, height?: number): CSSProperties;
194
- export declare function setShapeTextEditorDocumentData(editor: Pick<Editor, 'setDocumentData' | 'clearUndoRedoHistory'>, ...params: Parameters<Editor['setDocumentData']>): void;
195
- export declare function getShapeTextEditorDocumentData(editor: Pick<Editor, 'getDocumentData' | 'getDocumentDataModel'>): IDocumentData | null;
196
- export declare function applyShapeTextEditorCanvasTransparency(renderer: {
197
- engine?: {
198
- getCanvasElement?: () => HTMLElement | null;
199
- };
200
- } | null | undefined | void): void;
201
- export declare function getShapeTextEditorKeyboardConfig(commandService: Pick<ICommandService, 'executeCommand'>, executeUndoRedoCommand?: (commandId: string) => void, options?: IShapeTextEditorKeyboardOptions): IKeyboardEventConfig;
202
- /**
203
- * Shape editor component - second layer DOM.
204
- * Handles document editing, content height tracking, and vertical alignment.
205
- */
206
15
  export declare const ShapeTextEditor: (props: IShapeTextEditorProps) => import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import type { HorizontalAlign, ITransformState } from '@univerjs/core';
2
+ import type { CSSProperties, RefObject } from 'react';
3
+ import type { IContentLayout } from './shape-text-layout';
4
+ export interface IShapeTextEditorSurfaceProps {
5
+ containerRef: RefObject<HTMLDivElement | null>;
6
+ editingContentStyle?: CSSProperties;
7
+ editorContainerRef: RefObject<HTMLDivElement | null>;
8
+ editorUnitId: string;
9
+ fontSize: number;
10
+ horizontalAlign: HorizontalAlign;
11
+ layout: IContentLayout;
12
+ placeholder: string;
13
+ showPlaceholder: boolean;
14
+ transform: ITransformState;
15
+ }
16
+ export declare function ShapeTextEditorSurface(props: IShapeTextEditorSurfaceProps): import("react").JSX.Element;
@@ -2,7 +2,6 @@ export declare const STYLE_COMMAND_IDS: string[];
2
2
  export declare const SHAPE_TEXT_FLOAT_TOOLBAR_CLASSES: {
3
3
  root: string;
4
4
  group: string;
5
- button: string;
6
5
  select: string;
7
6
  };
8
7
  export declare function ShapeTextFloatToolbar(): import("react").JSX.Element;
@@ -49,6 +49,7 @@ export declare function resolveShapeTextEditorPositionTransform(options: {
49
49
  renderUnit: Nullable<ReturnType<IRenderManagerService['getRenderUnitById']>>;
50
50
  scene: Nullable<Scene>;
51
51
  }): Nullable<IShapeObjectLike>;
52
+ export declare function resolveShapeTextEditorPositionRoot(editorElement: HTMLElement | null): Element | null;
52
53
  /**
53
54
  * Position wrapper component that handles shape positioning in DOM.
54
55
  * This is the first layer DOM that tracks shape position with scroll.
@@ -1,5 +1,7 @@
1
- import type { IShapeRect, IShapeText, IShapeTextBodyBehavior } from '@univerjs-pro/engine-shape';
2
- import type { IDocumentData } from '@univerjs/core';
1
+ import type { ICustomShapeTextData, IShapeRect, IShapeText, IShapeTextBodyBehavior, IShapeTextDataModel } from '@univerjs-pro/engine-shape';
2
+ import type { IDocumentData, Nullable } from '@univerjs/core';
3
+ import type { Editor } from '@univerjs/docs-ui';
4
+ import type { IShapeTextDataContext } from './types';
3
5
  import { HorizontalAlign, VerticalAlign, WrapStrategy } from '@univerjs/core';
4
6
  interface IPrepareShapeTextDocumentOptions {
5
7
  bodyBehavior?: IShapeTextBodyBehavior;
@@ -20,4 +22,17 @@ export declare function prepareShapeTextDocumentData(documentData: IDocumentData
20
22
  export declare function resolveShapeTextDocumentPageHeight(documentData: IDocumentData, viewportHeight: number): number;
21
23
  export declare function stripShapeTextDocumentLayout(documentData: IDocumentData, options?: IShapeTextDocumentAlignmentOptions): IDocumentData;
22
24
  export declare function createEditableShapeTextDocumentDataCopy(documentData: IDocumentData): IDocumentData;
25
+ export declare function buildShapeTextEditorCommitShapeText(options: {
26
+ dataModel?: IShapeTextDataModel;
27
+ isHorizontal?: boolean;
28
+ shapeText?: ICustomShapeTextData | null;
29
+ }): ICustomShapeTextData;
30
+ export declare function createEmptyShapeTextEditorDocument(editorUnitId: string, pageWidth: number): IDocumentData;
31
+ export declare function createShapeTextEditorInitialDocument(options: {
32
+ editorUnitId: string;
33
+ pageWidth: number;
34
+ shapeData: Nullable<IShapeTextDataContext>;
35
+ }): IDocumentData;
36
+ export declare function setShapeTextEditorDocumentData(editor: Pick<Editor, 'setDocumentData' | 'clearUndoRedoHistory'>, ...params: Parameters<Editor['setDocumentData']>): void;
37
+ export declare function getShapeTextEditorDocumentData(editor: Pick<Editor, 'getDocumentData' | 'getDocumentDataModel'>): IDocumentData | null;
23
38
  export {};
@@ -0,0 +1,31 @@
1
+ import type { ICommandService, Nullable } from '@univerjs/core';
2
+ import type { IKeyboardEventConfig } from '@univerjs/docs-ui';
3
+ import type { IShapeTextEditingParams } from './types';
4
+ interface IShapeTextEditorKeyboardRange {
5
+ startOffset?: number;
6
+ endOffset?: number;
7
+ collapsed?: boolean;
8
+ }
9
+ export declare function getShapeTextEditorSelectAllRange(dataStreamLength: number): {
10
+ startOffset: number;
11
+ endOffset: number;
12
+ };
13
+ export declare function isShapeTextEditorKeyboardFocusActive(isInputFocusing: boolean, textRanges: readonly IShapeTextEditorKeyboardRange[] | null | undefined): boolean;
14
+ interface IShapeTextEditorKeyboardOptions {
15
+ commitOnEnter?: boolean;
16
+ cancel?: () => void;
17
+ commit?: () => void;
18
+ currentFontSize?: number;
19
+ }
20
+ export declare const DEFAULT_SHAPE_TEXT_EDITOR_FONT_SIZE = 14;
21
+ export declare function getShapeTextEditorFocusSessionKey(options: {
22
+ editorUnitId: string;
23
+ editingParams: Nullable<IShapeTextEditingParams>;
24
+ }): string | null;
25
+ export declare function shouldCompleteShapeTextEditingOnPointerDown(target: EventTarget | null, editorElement: HTMLElement | null): boolean;
26
+ export declare function getShapeTextEditorKeyboardConfig(commandService: Pick<ICommandService, 'executeCommand'>, executeUndoRedoCommand?: (commandId: string) => void, options?: IShapeTextEditorKeyboardOptions): IKeyboardEventConfig;
27
+ export {};
28
+ /**
29
+ * Shape editor component - second layer DOM.
30
+ * Handles document editing, content height tracking, and vertical alignment.
31
+ */