@univerjs-pro/engine-shape 1.0.0-alpha.0 → 1.0.0-alpha.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.
@@ -1,8 +1,8 @@
1
1
  export { BasicShapeModel as ShapeModel } from '../src/models/shape-model';
2
2
  export { LineShapeRenderModel } from '../src/render-engine/line-shape-render-model';
3
3
  export { BaseShapeRenderModel } from '../src/render-engine/shape-render-model';
4
- export { BasicShapeEnum, ImageFillModeEnum, ImageSourceTypeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeOperatorEnum, 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, IShapeText, IShapeTextRectPadding, ShapeAdjustHandleTypeEnum, ShapeHitTestHitTypeEnum, ShapeTextDirection, } from '../src/shape-type';
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
6
  export { AccentBorderCallout1Shape } from '../src/shapes/accent-border-callout1-shape';
7
7
  export { AccentBorderCallout2Shape } from '../src/shapes/accent-border-callout2-shape';
8
8
  export { AccentBorderCallout3Shape } from '../src/shapes/accent-border-callout3-shape';
@@ -192,7 +192,7 @@ export { WaveShape } from '../src/shapes/wave-shape';
192
192
  export { WedgeEllipseCalloutShape } from '../src/shapes/wedge-ellipse-callout-shape';
193
193
  export { WedgeRectCalloutShape } from '../src/shapes/wedge-rect-callout-shape';
194
194
  export { WedgeRoundRectCalloutShape } from '../src/shapes/wedge-round-rect-callout-shape';
195
- export { computeConnectorRouteLayout, getBasicShapeRotateBound, rotatePointAroundCenter, routeConnectorLineShape } from './render-engine/connector-points-util';
195
+ export { computeConnectorRouteLayout, getBasicShapeRotateBound, rotatePointAroundCenter, routeConnectorLineShape, } from './render-engine/connector-points-util';
196
196
  export { ShapeDefaultConfig } from './shape-default';
197
197
  export { freeRouteBentConnectorLinePoints } from './util/connector-points-util';
198
198
  export type { IBentConnectorResult } from './util/connector-points-util';
@@ -30,6 +30,55 @@ export declare enum ShapeDirectionEnum {
30
30
  Left = 180,
31
31
  Up = 270
32
32
  }
33
+ /**
34
+ * OOXML ST_PresetShadowVal values used by `<a:prstShdw prst="...">`.
35
+ *
36
+ * The enum member names intentionally keep the OOXML `shdw*` numbering so JSON
37
+ * can map back to OOXML losslessly. Use each member's JSDoc for the human-readable
38
+ * Office preset name.
39
+ */
40
+ export declare enum ShapePresetShadowValEnum {
41
+ /** OOXML shdw1: Top Left Drop Shadow, a regular outer shadow toward the top-left. */
42
+ Shdw1 = "shdw1",
43
+ /** OOXML shdw2: Top Right Drop Shadow, a regular outer shadow toward the top-right. */
44
+ Shdw2 = "shdw2",
45
+ /** OOXML shdw3: Back Left Perspective Shadow, a perspective shadow behind the shape on the left. */
46
+ Shdw3 = "shdw3",
47
+ /** OOXML shdw4: Back Right Perspective Shadow, a perspective shadow behind the shape on the right. */
48
+ Shdw4 = "shdw4",
49
+ /** OOXML shdw5: Bottom Left Drop Shadow, a regular outer shadow toward the bottom-left. */
50
+ Shdw5 = "shdw5",
51
+ /** OOXML shdw6: Bottom Right Drop Shadow, a regular outer shadow toward the bottom-right. */
52
+ Shdw6 = "shdw6",
53
+ /** OOXML shdw7: Front Left Perspective Shadow, a perspective shadow in front of the shape on the left. */
54
+ Shdw7 = "shdw7",
55
+ /** OOXML shdw8: Front Right Perspective Shadow, a perspective shadow in front of the shape on the right. */
56
+ Shdw8 = "shdw8",
57
+ /** OOXML shdw9: Top Left Small Drop Shadow, a smaller top-left outer shadow. */
58
+ Shdw9 = "shdw9",
59
+ /** OOXML shdw10: Top Left Large Drop Shadow, a larger top-left outer shadow. */
60
+ Shdw10 = "shdw10",
61
+ /** OOXML shdw11: Back Left Long Perspective Shadow, a longer back-left perspective shadow. */
62
+ Shdw11 = "shdw11",
63
+ /** OOXML shdw12: Back Right Long Perspective Shadow, a longer back-right perspective shadow. */
64
+ Shdw12 = "shdw12",
65
+ /** OOXML shdw13: Top Left Double Drop Shadow, a double-layer top-left outer shadow. */
66
+ Shdw13 = "shdw13",
67
+ /** OOXML shdw14: Bottom Right Small Drop Shadow, a smaller bottom-right outer shadow. */
68
+ Shdw14 = "shdw14",
69
+ /** OOXML shdw15: Front Left Long Perspective Shadow, a longer front-left perspective shadow. */
70
+ Shdw15 = "shdw15",
71
+ /** OOXML shdw16: Front Right Long Perspective Shadow, a longer front-right perspective shadow. */
72
+ Shdw16 = "shdw16",
73
+ /** OOXML shdw17: 3D Outer Box Shadow, a 3D-style shadow outside the shape box. */
74
+ Shdw17 = "shdw17",
75
+ /** OOXML shdw18: 3D Inner Box Shadow, a 3D-style shadow inside the shape box. */
76
+ Shdw18 = "shdw18",
77
+ /** OOXML shdw19: Back Center Perspective Shadow, a centered perspective shadow behind the shape. */
78
+ Shdw19 = "shdw19",
79
+ /** OOXML shdw20: Front Bottom Shadow, a front-facing shadow below the shape. */
80
+ Shdw20 = "shdw20"
81
+ }
33
82
  /**
34
83
  * Shape fill type enum
35
84
  * Currently, PatternFill and PictureFill are not supported, but we define them for future use, if will be treat as Nofill currently.
@@ -1,4 +1,4 @@
1
- import type { BasicShapeEnum, ImageFillModeEnum, ImageSourceTypeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeOperatorEnum, ShapeRenderModeEnum, ShapeSketchTypeEnum, ShapeTypeEnum } from './shape-enum';
1
+ import type { BasicShapeEnum, ImageFillModeEnum, ImageSourceTypeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeOperatorEnum, ShapePresetShadowValEnum, ShapeRenderModeEnum, ShapeSketchTypeEnum, ShapeTypeEnum } from './shape-enum';
2
2
  /**
3
3
  * GdContext 用来计算 OOXML Shape 的 Geometry Definitions (gd)
4
4
  * 包含:
@@ -575,6 +575,30 @@ export interface IShapeText extends IShapeTextAlign {
575
575
  export interface ICustomShapeTextData extends IShapeTextAlign {
576
576
  dataModel?: unknown;
577
577
  }
578
+ /**
579
+ * A shape outer-shadow effect. Distances and blur radius use slide drawing
580
+ * units; direction is in degrees where 0 points right and 90 points down.
581
+ */
582
+ export interface IShapeShadowEffect {
583
+ /** Shadow color as a CSS color string. */
584
+ color: string;
585
+ /** OOXML preset shadow value, when the shadow originated from `<a:prstShdw>`. */
586
+ preset?: ShapePresetShadowValEnum;
587
+ /** Shadow opacity, from 0 (transparent) to 1 (opaque). */
588
+ opacity?: number;
589
+ /** Blur radius in slide drawing units. */
590
+ blurRadius?: number;
591
+ /** Direction angle in degrees, with 0 pointing right and 90 pointing down. */
592
+ direction?: number;
593
+ /** Offset distance from the shape in slide drawing units. */
594
+ distance?: number;
595
+ /** Horizontal shadow scale factor; 1 means 100%. */
596
+ sx?: number;
597
+ /** Vertical shadow scale factor; 1 means 100%. */
598
+ sy?: number;
599
+ /** Whether the shadow rotates together with the shape. */
600
+ rotateWithShape?: boolean;
601
+ }
578
602
  /**
579
603
  * This interface defines the shape data structure , and this part will save in json
580
604
  */
@@ -643,6 +667,8 @@ export interface IBasicShapeData {
643
667
  adjustValues?: Record<string, number>;
644
668
  isCustom?: boolean;
645
669
  customGeometry?: IPresetShapeConfig;
670
+ /** Basic outer shadow effect applied while rendering the shape path. */
671
+ outerShadow?: IShapeShadowEffect;
646
672
  shapeText?: IShapeText | ICustomShapeTextData;
647
673
  /**
648
674
  * Text box inset used to calculate the editable/rendered text rect.