@univerjs-pro/engine-shape 0.24.0 → 0.25.0-insiders.20260604-29ebbff
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.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/{model → models}/shape-model.d.ts +1 -0
- package/lib/types/render-engine/custom-shape-render-model.d.ts +7 -0
- package/lib/types/render-engine/line-shape-render-model.d.ts +0 -15
- package/lib/types/shape-type.d.ts +7 -0
- package/lib/umd/index.js +1 -1
- package/package.json +3 -3
- /package/lib/types/{model → models}/group-shape-model.d.ts +0 -0
package/lib/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { BasicShapeModel as ShapeModel } from '../src/
|
|
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
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, ShapeAdjustHandleTypeEnum, ShapeHitTestHitTypeEnum, } from '../src/shape-type';
|
|
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, 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';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IPresetShapeConfig } from '../shape-type';
|
|
2
|
+
import { BaseShapeRenderModel } from './shape-render-model';
|
|
3
|
+
export declare class CustomShapeRenderModel extends BaseShapeRenderModel {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly presetShapeConfig: IPresetShapeConfig;
|
|
6
|
+
constructor(name: string, presetShapeConfig: IPresetShapeConfig);
|
|
7
|
+
}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
1
|
import type { IShapeData, IShapePoint, IShapeRect, IShapeRenderParameters } from '../shape-type';
|
|
17
2
|
import type { BaseShapeContext } from './base-shape-context';
|
|
18
3
|
import { BaseShapeRenderModel } from './shape-render-model';
|
|
@@ -104,6 +104,7 @@ export interface IGdContextBase {
|
|
|
104
104
|
lsd32: number;
|
|
105
105
|
}
|
|
106
106
|
export interface IGdContext extends IGdContextBase {
|
|
107
|
+
[key: string]: number | undefined;
|
|
107
108
|
x0?: number;
|
|
108
109
|
x1?: number;
|
|
109
110
|
x2?: number;
|
|
@@ -550,8 +551,10 @@ export interface IShapePath {
|
|
|
550
551
|
/** Parsed path data array (alternative to data string) */
|
|
551
552
|
dataArray?: IPathCommand[];
|
|
552
553
|
}
|
|
554
|
+
export type ShapeTextDirection = 'horz' | 'vert' | 'vert270' | 'wordArtVert' | 'eaVert' | 'mongolianVert' | 'wordArtVertRtl';
|
|
553
555
|
export interface IShapeTextAlign {
|
|
554
556
|
isHorizontal: boolean;
|
|
557
|
+
textDirection?: ShapeTextDirection;
|
|
555
558
|
}
|
|
556
559
|
export interface IShapeText extends IShapeTextAlign {
|
|
557
560
|
isRichText: false;
|
|
@@ -571,6 +574,7 @@ export interface ICustomShapeTextData extends IShapeTextAlign {
|
|
|
571
574
|
*/
|
|
572
575
|
export interface IBasicShapeData {
|
|
573
576
|
shapeType?: ShapeTypeEnum;
|
|
577
|
+
isTextBox?: boolean;
|
|
574
578
|
fill?: {
|
|
575
579
|
color?: string;
|
|
576
580
|
fillType?: ShapeFillEnum;
|
|
@@ -580,6 +584,7 @@ export interface IBasicShapeData {
|
|
|
580
584
|
gradientStops?: Array<{
|
|
581
585
|
position: number;
|
|
582
586
|
color: string;
|
|
587
|
+
opacity?: number;
|
|
583
588
|
}>;
|
|
584
589
|
/**
|
|
585
590
|
* Image fill source, can be a URL or base64 data URI. When fillType is 'image', this specifies the image to use for filling the shape.
|
|
@@ -630,6 +635,8 @@ export interface IBasicShapeData {
|
|
|
630
635
|
};
|
|
631
636
|
stroke?: IShapeLineStyle;
|
|
632
637
|
adjustValues?: Record<string, number>;
|
|
638
|
+
isCustom?: boolean;
|
|
639
|
+
customGeometry?: IPresetShapeConfig;
|
|
633
640
|
shapeText?: IShapeText | ICustomShapeTextData;
|
|
634
641
|
}
|
|
635
642
|
export interface ICxnShapeData extends IBasicShapeData {
|