@univerjs-pro/engine-shape 1.0.0-alpha.2 → 1.0.0-alpha.3

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.
@@ -1,201 +1,12 @@
1
1
  export { BasicShapeModel as ShapeModel } from '../src/models/shape-model';
2
- export { LineShapeRenderModel } from '../src/render-engine/line-shape-render-model';
3
2
  export { BaseShapeRenderModel } from '../src/render-engine/shape-render-model';
4
- export { BasicShapeEnum, ImageFillModeEnum, ImageSourceTypeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeOperatorEnum, ShapePresetShadowValEnum, ShapeRenderModeEnum, ShapeSketchTypeEnum, ShapeTypeEnum, } from '../src/shape-enum';
5
- export type { IBasicShapeData, IConnectorLayoutResult, IConnectorRouteLayoutResult, IConnectPointInfo, ICustomShapeTextData, ICxnShapeData, IDrawingRect, IGdContext, IGdContextBase, ILineType, IPathCommand, IPresetShapeConfig, IShapeAdjustItem, IShapeAdjustItemResolved, IShapeContextOptions, IShapeData, IShapeHitTestResult, IShapeJSONData, IShapeLineStyle, IShapeModel, IShapePath, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeRenderParameters, IShapeShadowEffect, IShapeText, IShapeTextRectPadding, ShapeAdjustHandleTypeEnum, ShapeHitTestHitTypeEnum, ShapeTextDirection, } from '../src/shape-type';
6
- export { AccentBorderCallout1Shape } from '../src/shapes/accent-border-callout1-shape';
7
- export { AccentBorderCallout2Shape } from '../src/shapes/accent-border-callout2-shape';
8
- export { AccentBorderCallout3Shape } from '../src/shapes/accent-border-callout3-shape';
9
- export { AccentCallout1Shape } from '../src/shapes/accent-callout1-shape';
10
- export { AccentCallout2Shape } from '../src/shapes/accent-callout2-shape';
11
- export { AccentCallout3Shape } from '../src/shapes/accent-callout3-shape';
12
- export { ActionButtonBackPreviousShape } from '../src/shapes/action-button-back-previous-shape';
13
- export { ActionButtonBeginningShape } from '../src/shapes/action-button-beginning-shape';
14
- export { ActionButtonBlankShape } from '../src/shapes/action-button-blank-shape';
15
- export { ActionButtonDocumentShape } from '../src/shapes/action-button-document-shape';
16
- export { ActionButtonEndShape } from '../src/shapes/action-button-end-shape';
17
- export { ActionButtonForwardNextShape } from '../src/shapes/action-button-forward-next-shape';
18
- export { ActionButtonHelpShape } from '../src/shapes/action-button-help-shape';
19
- export { ActionButtonHomeShape } from '../src/shapes/action-button-home-shape';
20
- export { ActionButtonInformationShape } from '../src/shapes/action-button-information-shape';
21
- export { ActionButtonMovieShape } from '../src/shapes/action-button-movie-shape';
22
- export { ActionButtonReturnShape } from '../src/shapes/action-button-return-shape';
23
- export { ActionButtonSoundShape } from '../src/shapes/action-button-sound-shape';
24
- export { ArcShape } from '../src/shapes/arc-shape';
25
- export { BentArrowShape } from '../src/shapes/bent-arrow-shape';
26
- export { BentConnector2Shape } from '../src/shapes/bent-connector2-shape';
27
- export { BentConnector3Shape } from '../src/shapes/bent-connector3-shape';
28
- export { BentConnector4Shape } from '../src/shapes/bent-connector4-shape';
29
- export { BentConnector5Shape } from '../src/shapes/bent-connector5-shape';
30
- export { BentUpArrowShape } from '../src/shapes/bent-up-arrow-shape';
31
- export { BevelShape } from '../src/shapes/bevel-shape';
32
- export { BlockArcShape } from '../src/shapes/block-arc-shape';
33
- export { BorderCallout1Shape } from '../src/shapes/border-callout1-shape';
34
- export { BorderCallout2Shape } from '../src/shapes/border-callout2-shape';
35
- export { BorderCallout3Shape } from '../src/shapes/border-callout3-shape';
36
- export { BracePairShape } from '../src/shapes/brace-pair-shape';
37
- export { BracketPairShape } from '../src/shapes/bracket-pair-shape';
38
- export { Callout1Shape } from '../src/shapes/callout1-shape';
39
- export { Callout2Shape } from '../src/shapes/callout2-shape';
40
- export { Callout3Shape } from '../src/shapes/callout3-shape';
41
- export { CanShape } from '../src/shapes/can-shape';
42
- export { ChartPlusShape } from '../src/shapes/chart-plus-shape';
43
- export { ChartStarShape } from '../src/shapes/chart-star-shape';
44
- export { ChartXShape } from '../src/shapes/chart-x-shape';
45
- export { ChevronShape } from '../src/shapes/chevron-shape';
46
- export { ChordShape } from '../src/shapes/chord-shape';
47
- export { CircleShape } from '../src/shapes/circle-shape';
48
- export { CircularArrowShape } from '../src/shapes/circular-arrow-shape';
49
- export { CloudCalloutShape } from '../src/shapes/cloud-callout-shape';
50
- export { CloudShape } from '../src/shapes/cloud-shape';
51
- export { CornerShape } from '../src/shapes/corner-shape';
52
- export { CornerTabsShape } from '../src/shapes/corner-tabs-shape';
53
- export { CubeShape } from '../src/shapes/cube-shape';
54
- export { CurvedConnector2Shape } from '../src/shapes/curved-connector2-shape';
55
- export { CurvedConnector3Shape } from '../src/shapes/curved-connector3-shape';
56
- export { CurvedConnector4Shape } from '../src/shapes/curved-connector4-shape';
57
- export { CurvedConnector5Shape } from '../src/shapes/curved-connector5-shape';
58
- export { CurvedDownArrowShape } from '../src/shapes/curved-down-arrow-shape';
59
- export { CurvedLeftArrowShape } from '../src/shapes/curved-left-arrow-shape';
60
- export { CurvedRightArrowShape } from '../src/shapes/curved-right-arrow-shape';
61
- export { CurvedUpArrowShape } from '../src/shapes/curved-up-arrow-shape';
62
- export { DecagonShape } from '../src/shapes/decagon-shape';
63
- export { DiagStripeShape } from '../src/shapes/diagonal-stripe-shape';
64
- export { DiamondShape } from '../src/shapes/diamond-shape';
65
- export { DodecagonShape } from '../src/shapes/dodecagon-shape';
66
- export { DonutShape } from '../src/shapes/donut-shape';
67
- export { DoubleWaveShape } from '../src/shapes/double-wave-shape';
68
- export { DownArrowCalloutShape } from '../src/shapes/down-arrow-callout-shape';
69
- export { DownArrowShape } from '../src/shapes/down-arrow-shape';
70
- export { EllipseRibbon2Shape } from '../src/shapes/ellipse-ribbon2-shape';
71
- export { EllipseRibbonShape } from '../src/shapes/ellipse-ribbon-shape';
72
- export { EllipseShape } from '../src/shapes/ellipse-shape';
73
- export { FlowChartOfflineStorageShape } from '../src/shapes/flow-chart-offline-storage-shape';
74
- export { FlowchartAlternateProcessShape } from '../src/shapes/flowchart-alternate-process-shape';
75
- export { FlowchartCollateShape } from '../src/shapes/flowchart-collate-shape';
76
- export { FlowchartConnectorShape } from '../src/shapes/flowchart-connector-shape';
77
- export { FlowChartInputOutputShape } from '../src/shapes/flowchart-data-shape';
78
- export { FlowchartDecisionShape } from '../src/shapes/flowchart-decision-shape';
79
- export { FlowchartDelayShape } from '../src/shapes/flowchart-delay-shape';
80
- export { FlowchartDisplayShape } from '../src/shapes/flowchart-display-shape';
81
- export { FlowchartDocumentShape } from '../src/shapes/flowchart-document-shape';
82
- export { FlowchartExtractShape } from '../src/shapes/flowchart-extract-shape';
83
- export { FlowchartInternalStorageShape } from '../src/shapes/flowchart-internal-storage-shape';
84
- export { FlowchartMagneticDiskShape } from '../src/shapes/flowchart-magnetic-disk-shape';
85
- export { FlowchartMagneticDrumShape } from '../src/shapes/flowchart-magnetic-drum-shape';
86
- export { FlowchartMagneticTapeShape } from '../src/shapes/flowchart-magnetic-tape-shape';
87
- export { FlowchartManualInputShape } from '../src/shapes/flowchart-manual-input-shape';
88
- export { FlowchartManualOperationShape } from '../src/shapes/flowchart-manual-operation-shape';
89
- export { FlowchartMergeShape } from '../src/shapes/flowchart-merge-shape';
90
- export { FlowchartMultiDocumentShape } from '../src/shapes/flowchart-multidocument-shape';
91
- export { FlowchartOffPageConnectorShape } from '../src/shapes/flowchart-offpage-connector-shape';
92
- export { FlowchartOnlineStorageShape } from '../src/shapes/flowchart-online-storage-shape';
93
- export { FlowchartOrShape } from '../src/shapes/flowchart-or-shape';
94
- export { FlowchartPredefinedProcessShape } from '../src/shapes/flowchart-predefined-process-shape';
95
- export { FlowchartPreparationShape } from '../src/shapes/flowchart-preparation-shape';
96
- export { FlowchartProcessShape } from '../src/shapes/flowchart-process-shape';
97
- export { FlowchartPunchedCardShape } from '../src/shapes/flowchart-punched-card-shape';
98
- export { FlowchartPunchedTapeShape } from '../src/shapes/flowchart-punched-tape-shape';
99
- export { FlowchartSortShape } from '../src/shapes/flowchart-sort-shape';
100
- export { FlowchartSummingJunctionShape } from '../src/shapes/flowchart-summing-junction-shape';
101
- export { FlowchartTerminatorShape } from '../src/shapes/flowchart-terminator-shape';
102
- export { FoldedCornerShape } from '../src/shapes/folded-corner-shape';
103
- export { FrameShape } from '../src/shapes/frame-shape';
104
- export { FunnelShape } from '../src/shapes/funnel-shape';
105
- export { Gear6Shape } from '../src/shapes/gear6-shape';
106
- export { Gear9Shape } from '../src/shapes/gear9-shape';
107
- export { HalfFrameShape } from '../src/shapes/half-frame-shape';
108
- export { HeartShape } from '../src/shapes/heart-shape';
109
- export { HeptagonShape } from '../src/shapes/heptagon-shape';
110
- export { HexagonShape } from '../src/shapes/hexagon-shape';
111
- export { HomePlateShape } from '../src/shapes/home-plate-shape';
112
- export { HorizontalScrollShape } from '../src/shapes/horizontal-scroll-shape';
113
- export { IrregularSeal1Shape } from '../src/shapes/irregular-seal1-shape';
114
- export { IrregularSeal2Shape } from '../src/shapes/irregular-seal2-shape';
115
- export { LeftArrowCalloutShape } from '../src/shapes/left-arrow-callout-shape';
116
- export { LeftArrowShape } from '../src/shapes/left-arrow-shape';
117
- export { LeftBraceShape } from '../src/shapes/left-brace-shape';
118
- export { LeftBracketShape } from '../src/shapes/left-bracket-shape';
119
- export { LeftCircularArrowShape } from '../src/shapes/left-circular-arrow-shape';
120
- export { LeftRightArrowCalloutShape } from '../src/shapes/left-right-arrow-callout-shape';
121
- export { LeftRightArrowShape } from '../src/shapes/left-right-arrow-shape';
122
- export { LeftRightCircularArrowShape } from '../src/shapes/left-right-circular-arrow-shape';
123
- export { LeftRightRibbonShape } from '../src/shapes/left-right-ribbon-shape';
124
- export { LeftRightUpArrowShape } from '../src/shapes/left-right-up-arrow-shape';
125
- export { LeftUpArrowShape } from '../src/shapes/left-up-arrow-shape';
126
- export { LightningBoltShape } from '../src/shapes/lightning-bolt-shape';
127
- export { LineInvShape } from '../src/shapes/line-lnv-shape';
128
- export { LineShape } from '../src/shapes/line-shape';
129
- export { MathDivideShape } from '../src/shapes/math-divide-shape';
130
- export { MathEqualShape } from '../src/shapes/math-equal-shape';
131
- export { MathMinusShape } from '../src/shapes/math-minus-shape';
132
- export { MathMultiplyShape } from '../src/shapes/math-multiply-shape';
133
- export { MathNotEqualShape } from '../src/shapes/math-not-equal-shape';
134
- export { MathPlusShape } from '../src/shapes/math-plus-shape';
135
- export { MoonShape } from '../src/shapes/moon-shape';
136
- export { NoSmokingShape } from '../src/shapes/no-smoking-shape';
137
- export { NonIsoscelesTrapezoidShape } from '../src/shapes/non-isosceles-trapezoid';
138
- export { NotchedRightArrowShape } from '../src/shapes/notched-right-arrow-shape';
139
- export { OctagonShape } from '../src/shapes/octagon-shape';
140
- export { ParallelogramShape } from '../src/shapes/parallelogram-shape';
141
- export { PentagonShape } from '../src/shapes/pentagon-shape';
142
- export { PieShape } from '../src/shapes/pie-shape';
143
- export { PieWedgeShape } from '../src/shapes/pie-wedge-shape';
144
- export { PlaqueShape } from '../src/shapes/plaque-shape';
145
- export { PlaqueTabsShape } from '../src/shapes/plaque-tabs-shape';
146
- export { PlusShape } from '../src/shapes/plus-shape';
147
- export { QuadArrowCalloutShape } from '../src/shapes/quad-arrow-callout-shape';
148
- export { QuadArrowShape } from '../src/shapes/quad-arrow-shape';
149
- export { RectangleShape } from '../src/shapes/rectangle-shape';
150
- export { Ribbon2Shape } from '../src/shapes/ribbon2-shape';
151
- export { RibbonShape } from '../src/shapes/ribbon-shape';
152
- export { RightArrowCalloutShape } from '../src/shapes/right-arrow-callout-shape';
153
- export { RightArrowShape } from '../src/shapes/right-arrow-shape';
154
- export { RightBraceShape } from '../src/shapes/right-brace-shape';
155
- export { RightBracketShape } from '../src/shapes/right-bracket-shape';
156
- export { RightTriangleShape } from '../src/shapes/right-triangle-shape';
157
- export { Round1RectShape } from '../src/shapes/round-rectangle1-shape';
158
- export { Round2DiagRectShape } from '../src/shapes/round-rectangle2-diagonal-shape';
159
- export { Round2SameRectShape } from '../src/shapes/round-rectangle2-shape';
160
- export { RoundRectangleShape } from '../src/shapes/round-rectangle-shape';
161
- export { SmileyFaceShape } from '../src/shapes/smiley-face-shape';
162
- export { SnipRectangle1Shape } from '../src/shapes/snip-rectangle1-shape';
163
- export { SnipRectangle2DiagonalShape } from '../src/shapes/snip-rectangle2-diagonal-shape';
164
- export { SnipRectangle2SameShape } from '../src/shapes/snip-rectangle2-same-shape';
165
- export { SnipRoundRectangle1Shape } from '../src/shapes/snip-round-rectangle1-shape';
166
- export { SquareTabsShape } from '../src/shapes/square-tabs-shape';
167
- export { Star4Shape } from '../src/shapes/star4-shape';
168
- export { Star5Shape } from '../src/shapes/star5-shape';
169
- export { Star6Shape } from '../src/shapes/star6-shape';
170
- export { Star7Shape } from '../src/shapes/star7-shape';
171
- export { Star8Shape } from '../src/shapes/star8-shape';
172
- export { Star10Shape } from '../src/shapes/star10-shape';
173
- export { Star12Shape } from '../src/shapes/star12-shape';
174
- export { Star16Shape } from '../src/shapes/star16-shape';
175
- export { Star24Shape } from '../src/shapes/star24-shape';
176
- export { Star32Shape } from '../src/shapes/star32-shape';
177
- export { StraightConnector1Shape } from '../src/shapes/straight-connector1-shape';
178
- export { StripedRightArrowShape } from '../src/shapes/striped-right-arrow-shape';
179
- export { SunShape } from '../src/shapes/sun-shape';
180
- export { SwooshArrowShape } from '../src/shapes/swoosh-arrow-shape';
181
- export { TeardropShape } from '../src/shapes/teardrop-shape';
182
- export { TextBoxShape } from '../src/shapes/text-box-shape';
183
- export { TrapezoidShape } from '../src/shapes/trapezoid-shape';
184
- export { TriangleShape } from '../src/shapes/triangle-shape';
185
- export { UpArrowCalloutShape } from '../src/shapes/up-arrow-callout-shape';
186
- export { UpArrowShape } from '../src/shapes/up-arrow-shape';
187
- export { UpDownArrowCalloutShape } from '../src/shapes/up-down-arrow-callout-shape';
188
- export { UpDownArrowShape } from '../src/shapes/up-down-arrow-shape';
189
- export { UturnArrowShape } from '../src/shapes/uturn-arrow-shape';
190
- export { VerticalScrollShape } from '../src/shapes/vertical-scroll-shape';
191
- export { WaveShape } from '../src/shapes/wave-shape';
192
- export { WedgeEllipseCalloutShape } from '../src/shapes/wedge-ellipse-callout-shape';
193
- export { WedgeRectCalloutShape } from '../src/shapes/wedge-rect-callout-shape';
194
- export { WedgeRoundRectCalloutShape } from '../src/shapes/wedge-round-rect-callout-shape';
195
- export { computeConnectorRouteLayout, getBasicShapeRotateBound, rotatePointAroundCenter, routeConnectorLineShape, } from './render-engine/connector-points-util';
3
+ export { ImageFillModeEnum, ImageSourceTypeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeOperatorEnum, ShapePresetShadowValEnum, ShapeRenderModeEnum, ShapeSketchTypeEnum, ShapeTypeEnum, } from '../src/shape-enum';
4
+ export type { IBasicShapeData, IConnectorLayoutResult, IConnectPointInfo, ICustomShapeTextData, ICxnShapeData, IDrawingRect, IGdContext, ILineType, IPathCommand, IPresetShapeConfig, IShapeAdjustItemResolved, IShapeData, IShapeJSONData, IShapeLineStyle, IShapePath, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeShadowEffect, IShapeText, IShapeTextBodyBehavior, IShapeTextData, IShapeTextDataModel, ShapeTextHorizontalAnchor, ShapeTextWrapType, } from '../src/shape-type';
5
+ export { ShapeTextAutoFitType } from '../src/shape-type';
6
+ export { resolveShapeTextBodyBehavior, shouldUseFullShapeTextRectForAutoFit } from '../src/utils/shape-text-behavior.util';
7
+ export { computeConnectorRouteLayout, getBasicShapeRotateBound, routeConnectorLineShape, } from './render-engine/connector-points-util';
196
8
  export { ShapeDefaultConfig } from './shape-default';
197
- export { freeRouteBentConnectorLinePoints } from './util/connector-points-util';
198
- export type { IBentConnectorResult } from './util/connector-points-util';
9
+ export { resolveShapeDefaultInsertSize } from './shape-default-size';
199
10
  export { ConnectorCoordinateTransform } from './util/connector-transform';
200
11
  export { createUniqueShapeName } from './util/shape-name';
201
- export { isConnectorShape, isCurvedConnectorShape } from './util/shape-util';
12
+ export { isConnectorShape, isCurvedConnectorShape, } from './util/shape-util';
@@ -1,5 +1,5 @@
1
1
  import type { ShapeTypeEnum } from '../shape-enum';
2
- import type { ICustomShapeTextData, IGdContext, IPresetShapeConfig, IShapeAdjustItemResolved, IShapeContextOptions, IShapeData, IShapeJSONData, IShapeModel, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeRenderParameters, IShapeText } from '../shape-type';
2
+ import type { IGdContext, IPresetShapeConfig, IShapeAdjustItemResolved, IShapeContextOptions, IShapeData, IShapeJSONData, IShapeModel, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeRenderParameters, IShapeTextData } from '../shape-type';
3
3
  import { BasicShapeEnum } from '../shape-enum';
4
4
  export declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: Partial<T>[]): T;
5
5
  export declare class BasicShapeModel implements IShapeModel {
@@ -26,12 +26,12 @@ export declare class BasicShapeModel implements IShapeModel {
26
26
  * get shape text data
27
27
  * @returns The shape text data
28
28
  */
29
- getShapeTextData(): IShapeText | ICustomShapeTextData;
29
+ getShapeTextData(): IShapeTextData<unknown, unknown, unknown>;
30
30
  /**
31
31
  * set shape text data
32
32
  * @param shapeText The shape text data
33
33
  */
34
- setShapeTextData(shapeText: IShapeText | ICustomShapeTextData): void;
34
+ setShapeTextData(shapeText: IShapeTextData): void;
35
35
  /**
36
36
  * get shape text rect, the shape text rect is defined in shape preset config, if not exist, return the whole shape rect, we will add padding in render model
37
37
  * @param rect The drawing rect, define the position and size of the shape
@@ -24,7 +24,6 @@ export declare abstract class BaseShapeRenderModel {
24
24
  * @returns {IShapeRect} The text rectangle within the shape
25
25
  */
26
26
  getTextRect(rect: IShapeRect, gdRecord: Partial<IGdContext>, shapeData?: IShapeData): IShapeRect;
27
- private _hasExplicitTextRectPadding;
28
27
  private _getPaddedWholeRect;
29
28
  private _getTextRectPadding;
30
29
  /**
@@ -0,0 +1,9 @@
1
+ import { ShapeTypeEnum } from './shape-enum';
2
+ export declare const SHAPE_DEFAULT_INSERT_BASE_SIZE = 100;
3
+ export interface IShapeDefaultInsertSize {
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export declare const SHAPE_DEFAULT_INSERT_SIZE: Record<ShapeTypeEnum, IShapeDefaultInsertSize>;
8
+ export declare function resolveShapeDefaultAspectRatio(shapeType: ShapeTypeEnum | string | null | undefined): number | undefined;
9
+ export declare function resolveShapeDefaultInsertSize(shapeType: ShapeTypeEnum | string | null | undefined, baseSize?: number): IShapeDefaultInsertSize | undefined;
@@ -1,8 +1,17 @@
1
- import { ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum } from './shape-enum';
1
+ import { ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeSketchTypeEnum } from './shape-enum';
2
2
  export declare const ShapeDefaultConfig: {
3
+ fillType: ShapeFillEnum;
3
4
  fill: string;
5
+ fillOpacity: number;
6
+ gradientType: ShapeGradientTypeEnum;
7
+ gradientAngle: number;
8
+ gradientEndColor: string;
9
+ lineType: ShapeLineTypeEnum;
4
10
  stroke: string;
5
11
  strokeWidth: number;
12
+ strokeOpacity: number;
13
+ cornerRadius: number;
14
+ sketchType: ShapeSketchTypeEnum;
6
15
  cxnPointRadius: number;
7
16
  cxnPointFill: string;
8
17
  cxnPointStroke: string;
@@ -19,7 +28,6 @@ export declare const ShapeDefaultConfig: {
19
28
  fontSize: number;
20
29
  fontFamily: string;
21
30
  color: string;
22
- isRichText: boolean;
23
31
  bold: boolean;
24
32
  italic: boolean;
25
33
  underline: boolean;