@univerjs-pro/engine-shape 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.
- package/README.md +1 -1
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/facade/f-connector-shape.d.ts +1 -1
- package/lib/types/facade/f-shape-text.d.ts +1 -1
- package/lib/types/facade/f-shape.d.ts +112 -2
- package/lib/types/facade/index.d.ts +1 -1
- package/lib/types/index.d.ts +18 -3
- package/lib/types/models/shape-model.d.ts +4 -3
- package/lib/types/render-engine/shape-3d-renderer.d.ts +91 -0
- package/lib/types/render-engine/shape-render-model.d.ts +1 -0
- package/lib/types/services/shape-host-adapter.service.d.ts +26 -0
- package/lib/types/shape-enum.d.ts +145 -18
- package/lib/types/shape-type.d.ts +225 -2
- package/lib/types/smart-art/smart-art-color-style.d.ts +11 -0
- package/lib/types/smart-art/smart-art-enum.d.ts +59 -0
- package/lib/types/smart-art/smart-art-layout-template.d.ts +32 -0
- package/lib/types/smart-art/smart-art-layout-templates.generated.d.ts +2 -0
- package/lib/types/smart-art/smart-art-model.d.ts +46 -0
- package/lib/types/smart-art/smart-art-operation.d.ts +83 -0
- package/lib/types/smart-art/smart-art-quick-style.d.ts +12 -0
- package/lib/types/smart-art/smart-art-transform.d.ts +2 -0
- package/lib/types/utils/svg-path-data.d.ts +48 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +6 -6
|
@@ -20,7 +20,7 @@ import { FShape } from './f-shape';
|
|
|
20
20
|
* const fConnectorShape = fDocument.insertShape({
|
|
21
21
|
* shapeType: univerAPI.Enum.ShapeTypeEnum.StraightConnector1,
|
|
22
22
|
* placement: {
|
|
23
|
-
* wrappingStyle: univerAPI.Enum.
|
|
23
|
+
* wrappingStyle: univerAPI.Enum.TextWrappingStyle.WRAP_SQUARE,
|
|
24
24
|
* anchor: {
|
|
25
25
|
* paragraphId: paragraph.getId(),
|
|
26
26
|
* segmentId: paragraph.getSegmentId(),
|
|
@@ -38,7 +38,7 @@ export interface IShapeTextImageFillOptions {
|
|
|
38
38
|
* const fShape = fDocument.insertShape({
|
|
39
39
|
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect,
|
|
40
40
|
* placement: {
|
|
41
|
-
* wrappingStyle: univerAPI.Enum.
|
|
41
|
+
* wrappingStyle: univerAPI.Enum.TextWrappingStyle.INLINE,
|
|
42
42
|
* anchor: {
|
|
43
43
|
* paragraphId: paragraph.getId(),
|
|
44
44
|
* segmentId: paragraph.getSegmentId(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IBasicShapeData, ImageSourceTypeEnum, IPresetShapeConfig, IShapeAdjustItemResolved, IShapeData, IShapeHostAdapter, IShapeLineStyle, IShapeRef, IShapeRelationItem, IShapeSnapshot, IShapeTransform, IShapeUpdateInput, ShapeGradientTypeEnum, ShapeHostType, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
1
|
+
import type { IBasicShapeData, IInsertSmartArtNodeOptions, ImageSourceTypeEnum, IMoveSmartArtNodeOptions, IPresetShapeConfig, IShapeAdjustItemResolved, IShapeData, IShapeHostAdapter, IShapeLineStyle, IShapePath, IShapeRef, IShapeRelationItem, IShapeSnapshot, IShapeTransform, IShapeUpdateInput, ISmartArtData, ISmartArtDataNode, ISmartArtPresentationShape, ShapeGradientTypeEnum, ShapeHostType, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeTypeEnum, SmartArtDirectionEnum } from '@univerjs-pro/engine-shape';
|
|
2
2
|
import type { Injector } from '@univerjs/core';
|
|
3
3
|
import { IShapeHostAdapterRegistry, ShapeLineTypeEnum } from '@univerjs-pro/engine-shape';
|
|
4
4
|
import { ICommandService } from '@univerjs/core';
|
|
@@ -24,6 +24,25 @@ export interface IShapeConnectionSite {
|
|
|
24
24
|
/** Outward site angle in OOXML angle units (1/60000 degree). */
|
|
25
25
|
ang: number;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* A single SVG path accepted by `FShape.setCustomGeometryFromSvgPath()`.
|
|
29
|
+
*
|
|
30
|
+
* `pathData` is the value of an SVG `<path d="...">` attribute, not complete SVG markup or a data
|
|
31
|
+
* URL. Fill and stroke colors remain Shape styles; `fill` and `stroke` only control whether this
|
|
32
|
+
* geometry path participates in filling and stroking.
|
|
33
|
+
*/
|
|
34
|
+
export interface IShapeSvgPathGeometryOptions {
|
|
35
|
+
/** SVG `<path>` `d` attribute value. */
|
|
36
|
+
pathData: string;
|
|
37
|
+
/** Optional virtual SVG coordinate-space width. The path scales to the Shape width when set. */
|
|
38
|
+
width?: number;
|
|
39
|
+
/** Optional virtual SVG coordinate-space height. The path scales to the Shape height when set. */
|
|
40
|
+
height?: number;
|
|
41
|
+
/** Optional geometry fill mode. Use `'none'` for an open or stroke-only path. */
|
|
42
|
+
fill?: IShapePath['fill'];
|
|
43
|
+
/** Whether the Shape stroke is applied to this geometry path. */
|
|
44
|
+
stroke?: boolean;
|
|
45
|
+
}
|
|
27
46
|
/** Optional image-fill properties accepted by `FShape.setImageFill()`. */
|
|
28
47
|
export type IShapeImageFillOptions = Pick<ShapeFill, 'imageFillMode' | 'imageOpacity' | 'imageRotateWithShape' | 'stretchFillRect' | 'srcRect' | 'imageTile'>;
|
|
29
48
|
/**
|
|
@@ -45,7 +64,7 @@ export type IShapeImageFillOptions = Pick<ShapeFill, 'imageFillMode' | 'imageOpa
|
|
|
45
64
|
* const fShape = fDocument.insertShape({
|
|
46
65
|
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect,
|
|
47
66
|
* placement: {
|
|
48
|
-
* wrappingStyle: univerAPI.Enum.
|
|
67
|
+
* wrappingStyle: univerAPI.Enum.TextWrappingStyle.INLINE,
|
|
49
68
|
* anchor: {
|
|
50
69
|
* paragraphId: paragraph.getId(),
|
|
51
70
|
* segmentId: paragraph.getSegmentId(),
|
|
@@ -182,6 +201,32 @@ export declare class FShape extends FBase {
|
|
|
182
201
|
* ```
|
|
183
202
|
*/
|
|
184
203
|
getShapeData(): IShapeData | null;
|
|
204
|
+
/** Returns whether this Shape is a SmartArt composite. */
|
|
205
|
+
isSmartArt(): boolean;
|
|
206
|
+
/** Returns a detached copy of the normalized SmartArt structure. */
|
|
207
|
+
getSmartArtData(): ISmartArtData | null;
|
|
208
|
+
/** Replaces the complete normalized SmartArt structure through the host Shape command. */
|
|
209
|
+
setSmartArtData(data: ISmartArtData): this;
|
|
210
|
+
/** Inserts one logical node into the SmartArt tree. */
|
|
211
|
+
insertSmartArtNode(options: IInsertSmartArtNodeOptions): this;
|
|
212
|
+
/** Deletes a logical SmartArt node and its subtree. */
|
|
213
|
+
deleteSmartArtNode(nodeId: string): this;
|
|
214
|
+
/** Moves a logical SmartArt node without changing its stable identity. */
|
|
215
|
+
moveSmartArtNode(options: IMoveSmartArtNodeOptions): this;
|
|
216
|
+
/** Promotes a logical SmartArt node by one hierarchy level. */
|
|
217
|
+
promoteSmartArtNode(nodeId: string): this;
|
|
218
|
+
/** Demotes a logical SmartArt node below its preceding sibling. */
|
|
219
|
+
demoteSmartArtNode(nodeId: string): this;
|
|
220
|
+
/** Updates Text Pane content or the assistant/content role of one logical node. */
|
|
221
|
+
updateSmartArtNode(nodeId: string, update: Partial<Pick<ISmartArtDataNode, 'fontSizeMode' | 'role' | 'text'>>): this;
|
|
222
|
+
/** Sets the SmartArt left-to-right or right-to-left direction. */
|
|
223
|
+
setSmartArtDirection(direction: SmartArtDirectionEnum): this;
|
|
224
|
+
/** Switches the SmartArt layout while retaining the logical content tree. */
|
|
225
|
+
setSmartArtLayout(id: string): this;
|
|
226
|
+
/** Updates one independently editable presentation Shape inside the SmartArt composite. */
|
|
227
|
+
updateSmartArtPresentationShape(presentationShapeId: string, update: Partial<Pick<ISmartArtPresentationShape, 'shapeData' | 'transform'>>): this;
|
|
228
|
+
/** Converts SmartArt to host-native ordinary Shapes while preserving one undo step. */
|
|
229
|
+
convertSmartArtToShapes(): FShape[];
|
|
185
230
|
/**
|
|
186
231
|
* Returns a detached snapshot of the Shape and its host identity.
|
|
187
232
|
* @returns {IShapeSnapshot | null} A detached snapshot of the Shape and its host identity, or `null` when the Shape is unavailable.
|
|
@@ -392,6 +437,59 @@ export declare class FShape extends FBase {
|
|
|
392
437
|
* ```
|
|
393
438
|
*/
|
|
394
439
|
setCustomGeometry(customGeometry: IPresetShapeConfig): this;
|
|
440
|
+
/**
|
|
441
|
+
* Replaces this Shape's geometry with one SVG path.
|
|
442
|
+
*
|
|
443
|
+
* Use this method when the source is an SVG `<path>` `d` attribute. Do not pass complete
|
|
444
|
+
* `<svg>`/`<path>` markup, a data URL, CSS, transforms, fill colors, or stroke colors in
|
|
445
|
+
* `options.pathData`. Configure visual styles with Shape facade methods such as
|
|
446
|
+
* `setSolidFill()`, `setNoneFill()`, and `setStroke()`.
|
|
447
|
+
*
|
|
448
|
+
* All standard SVG path commands are supported: `M/m`, `L/l`, `H/h`, `V/v`, `C/c`, `S/s`,
|
|
449
|
+
* `Q/q`, `T/t`, `A/a`, and `Z/z`. Relative commands and repeated coordinate groups are
|
|
450
|
+
* converted to absolute engine-shape commands. SVG arcs are converted to cubic Bézier segments
|
|
451
|
+
* instead of being misinterpreted as engine-shape's semantically different OOXML `A` command.
|
|
452
|
+
*
|
|
453
|
+
* Parsing finishes before the host Shape is updated. Invalid or unsupported path data throws a
|
|
454
|
+
* `SyntaxError` and leaves the existing Shape geometry unchanged.
|
|
455
|
+
*
|
|
456
|
+
* @param {IShapeSvgPathGeometryOptions} options SVG path geometry and optional virtual bounds.
|
|
457
|
+
* @returns {FShape} This Shape facade for chaining.
|
|
458
|
+
*
|
|
459
|
+
* @example Board — executable with `univer execute`
|
|
460
|
+
* ```ts
|
|
461
|
+
* const board = univerAPI.getActiveBoard();
|
|
462
|
+
* if (!board) throw new Error('No active board');
|
|
463
|
+
*
|
|
464
|
+
* const shape = board.insertShape({
|
|
465
|
+
* shapeType: univerAPI.Enum.ShapeTypeEnum.Rect,
|
|
466
|
+
* transform: { left: 300, top: 100, width: 160, height: 200 },
|
|
467
|
+
* });
|
|
468
|
+
* if (!shape) throw new Error('Cannot insert shape');
|
|
469
|
+
*
|
|
470
|
+
* shape
|
|
471
|
+
* .setCustomGeometryFromSvgPath({
|
|
472
|
+
* // This is only the value of <path d="...">.
|
|
473
|
+
* pathData: 'M 50,10 C 34,20 24,64 22,92 L 78,92 C 76,64 66,20 50,10 Z',
|
|
474
|
+
* width: 100,
|
|
475
|
+
* height: 100,
|
|
476
|
+
* fill: 'none',
|
|
477
|
+
* stroke: true,
|
|
478
|
+
* })
|
|
479
|
+
* .setNoneFill()
|
|
480
|
+
* .setStroke({
|
|
481
|
+
* lineStrokeType: univerAPI.Enum.ShapeLineTypeEnum.SolidLine,
|
|
482
|
+
* color: '#F0509B',
|
|
483
|
+
* width: 3,
|
|
484
|
+
* });
|
|
485
|
+
*
|
|
486
|
+
* return {
|
|
487
|
+
* id: shape.getId(),
|
|
488
|
+
* pathCount: shape.getCustomGeometry()?.pathLst?.length ?? 0,
|
|
489
|
+
* };
|
|
490
|
+
* ```
|
|
491
|
+
*/
|
|
492
|
+
setCustomGeometryFromSvgPath(options: IShapeSvgPathGeometryOptions): this;
|
|
395
493
|
/**
|
|
396
494
|
* Returns the sites where Connector endpoints can attach to this Shape.
|
|
397
495
|
* Coordinates are local to the unrotated Shape bounds. Shapes without
|
|
@@ -659,8 +757,20 @@ export declare class FShape extends FBase {
|
|
|
659
757
|
* ```
|
|
660
758
|
*/
|
|
661
759
|
sendToBack(): this;
|
|
760
|
+
/**
|
|
761
|
+
* Moves the Shape to a zero-based index in its host's persisted drawing order.
|
|
762
|
+
* The host clamps an out-of-range index to its nearest valid position.
|
|
763
|
+
* @param {number} index The zero-based target order index.
|
|
764
|
+
* @returns {FShape} This Shape facade for chaining.
|
|
765
|
+
* @example
|
|
766
|
+
* ```ts
|
|
767
|
+
* fShape.setZOrder(2);
|
|
768
|
+
* ```
|
|
769
|
+
*/
|
|
770
|
+
setZOrder(index: number): this;
|
|
662
771
|
protected _getAdapter(): IShapeHostAdapter | null;
|
|
663
772
|
private _patchShapeData;
|
|
773
|
+
private _updateSmartArt;
|
|
664
774
|
private _patchStroke;
|
|
665
775
|
private _getSnapshot;
|
|
666
776
|
private _getGeometryModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './f-enum';
|
|
2
2
|
export { FConnectorShape } from './f-connector-shape';
|
|
3
3
|
export { FShape } from './f-shape';
|
|
4
|
-
export type { IShapeConnectionSite, IShapeGradientStop, IShapeImageFillOptions } from './f-shape';
|
|
4
|
+
export type { IShapeConnectionSite, IShapeGradientStop, IShapeImageFillOptions, IShapeSvgPathGeometryOptions, } from './f-shape';
|
|
5
5
|
export { FShapeText } from './f-shape-text';
|
|
6
6
|
export type { IShapeTextImageFillOptions } from './f-shape-text';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
export { BasicShapeModel as ShapeModel } from '../src/models/shape-model';
|
|
2
2
|
export { BaseShapeRenderModel } from '../src/render-engine/shape-render-model';
|
|
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, IShapeFormulaBinding, IShapeJSONData, IShapeLineStyle, IShapePath, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeText, IShapeTextBodyBehavior, IShapeTextBoxOptions, IShapeTextData, IShapeTextDataModel, IShapeTextRectPadding, ShapeTextHorizontalAnchor, } from '../src/shape-type';
|
|
3
|
+
export { ImageFillModeEnum, ImageSourceTypeEnum, ShapeArrowSizeEnum, ShapeArrowTypeEnum, ShapeBevelPresetEnum, ShapeCameraPresetEnum, ShapeFillEnum, ShapeGradientTypeEnum, ShapeLightRigDirectionEnum, ShapeLightRigPresetEnum, ShapeLineCapEnum, ShapeLineDashEnum, ShapeLineJoinEnum, ShapeLineTypeEnum, ShapeMaterialPresetEnum, ShapeOperatorEnum, ShapePresetShadowValEnum, ShapeRenderModeEnum, ShapeSketchTypeEnum, ShapeTypeEnum, } from '../src/shape-enum';
|
|
4
|
+
export type { IBasicShapeData, IConnectorLayoutResult, IConnectPointInfo, ICustomShapeTextData, ICxnShapeData, IDrawingRect, IGdContext, ILineType, IPathCommand, IPresetShapeConfig, IShape3D, IShape3DRotation, IShape3DVector, IShapeAdjustItemResolved, IShapeData, IShapeFormulaBinding, IShapeJSONData, IShapeLineStyle, IShapePath, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeScene3D, IShapeText, IShapeTextBodyBehavior, IShapeTextBoxOptions, IShapeTextData, IShapeTextDataModel, IShapeTextRectPadding, ISmartArtData, ISmartArtDataNode, ISmartArtEditCapabilities, ISmartArtPresentationShape, ISmartArtPresentationTextBinding, ISmartArtShapeData, ISmartArtTransform, ShapeTextHorizontalAnchor, } from '../src/shape-type';
|
|
5
5
|
export { ShapeTextAutoFitType, ShapeTextDirection, ShapeTextWrapType } from '../src/shape-type';
|
|
6
6
|
export { applyShapeTextBoxOptions, resolveShapeTextBodyBehavior, resolveShapeTextBoxOptions, shouldUseFullShapeTextRectForAutoFit, } from '../src/utils/shape-text-behavior.util';
|
|
7
7
|
export type { IResolvedShapeTextBoxOptions } from '../src/utils/shape-text-behavior.util';
|
|
8
8
|
export { UniverShapePlugin } from './plugin';
|
|
9
9
|
export { computeConnectorRouteLayout, getBasicShapeRotateBound, routeConnectorLineShape, } from './render-engine/connector-points-util';
|
|
10
|
+
export { DEFAULT_SHAPE_BEVEL_EXTENT, getShape3DBounds, isShape3DProjectiveScene, projectShape3DPoint, projectShape3DRect, renderProjectedShapeRect, resolveShape3DGlyphRenderPlan, resolveShapeBevelExtent, shadeShape3DColor, } from './render-engine/shape-3d-renderer';
|
|
11
|
+
export type { IShape3DGlyphRenderPlan, IShape3DProjectedPoint, IShape3DProjectedQuad, } from './render-engine/shape-3d-renderer';
|
|
10
12
|
export { ConnectorShapeHostAdapter } from './services/connector-shape-host-adapter';
|
|
11
13
|
export { IConnectorShapeHostAdapter } from './services/connector-shape-host-adapter.service';
|
|
12
14
|
export type { IConnectorArrow, IConnectorEndpoint, IConnectorShapeSnapshot, } from './services/connector-shape-host-adapter.service';
|
|
13
15
|
export { canApplyShapeFormulaLastValue, IShapeHostAdapterRegistry, isShapeHostType, ShapeHostAdapterRegistry, } from './services/shape-host-adapter.service';
|
|
14
|
-
export type { IShapeCreateInput, IShapeFormulaLastValueGuard, IShapeHostAdapter, IShapeHostChange, IShapeHostChangeStream, IShapeRef, IShapeScope, IShapeSnapshot, IShapeTransform, IShapeUpdateInput, ShapeHostType, } from './services/shape-host-adapter.service';
|
|
16
|
+
export type { IShapeCreateInput, IShapeFormulaLastValueGuard, IShapeHostAdapter, IShapeHostAdapterRegistryChange, IShapeHostAdapterRegistryChangeStream, IShapeHostChange, IShapeHostChangeStream, IShapeRef, IShapeScope, IShapeSnapshot, IShapeTransform, IShapeUpdateInput, ShapeHostType, } from './services/shape-host-adapter.service';
|
|
15
17
|
export { ShapeDefaultConfig } from './shape-default';
|
|
16
18
|
export { resolveShapeDefaultInsertSize } from './shape-default-size';
|
|
19
|
+
export { applySmartArtColorStyle, SMART_ART_COLOR_STYLE_CATALOG } from './smart-art/smart-art-color-style';
|
|
20
|
+
export type { ISmartArtColorStyleCatalogItem, SmartArtColorStyleSection } from './smart-art/smart-art-color-style';
|
|
21
|
+
export { SmartArtCategoryEnum, SmartArtDirectionEnum, SmartArtInsertPositionEnum, SmartArtNodeRoleEnum, SmartArtPresentationShapeRoleEnum, SmartArtPresentationTextSourceEnum, SmartArtTextFontSizeModeEnum, } from './smart-art/smart-art-enum';
|
|
22
|
+
export { applySmartArtLayout, createSmartArtDataFromLayout } from './smart-art/smart-art-layout-template';
|
|
23
|
+
export type { ISmartArtLayoutTemplate } from './smart-art/smart-art-layout-template';
|
|
24
|
+
export { convertSmartArtToShapes, deleteSmartArtNode, demoteSmartArtNode, insertSmartArtNode, isSmartArtShapeData, moveSmartArtNode, promoteSmartArtNode, readSmartArtTextContent, replaceSmartArtTextContent, resetSmartArtTextFontSizes, resolveSmartArtPresentationNodeIdAtTextOffset, resolveSmartArtPresentationShapeData, resolveSmartArtPresentationShapeIdForNode, resolveSmartArtPresentationTextBindings, setSmartArtDirection, setSmartArtLayout, updateSmartArtNode, updateSmartArtPresentationShape, updateSmartArtPresentationText, validateSmartArtData, } from './smart-art/smart-art-model';
|
|
25
|
+
export type { IConvertedSmartArtShape, IInsertSmartArtNodeOptions, IMoveSmartArtNodeOptions, IUpdateSmartArtPresentationTextOptions, } from './smart-art/smart-art-model';
|
|
26
|
+
export { applySmartArtOperation, SmartArtOperationTypeEnum } from './smart-art/smart-art-operation';
|
|
27
|
+
export type { SmartArtOperation } from './smart-art/smart-art-operation';
|
|
28
|
+
export { applySmartArtQuickStyle, SMART_ART_QUICK_STYLE_CATALOG } from './smart-art/smart-art-quick-style';
|
|
29
|
+
export type { ISmartArtQuickStyleCatalogItem, SmartArtQuickStyleSection } from './smart-art/smart-art-quick-style';
|
|
30
|
+
export { resolveSmartArtPresentationTransform } from './smart-art/smart-art-transform';
|
|
17
31
|
export { ConnectorCoordinateTransform } from './util/connector-transform';
|
|
18
32
|
export { createUniqueShapeName } from './util/shape-name';
|
|
19
33
|
export { isConnectorShape, isCurvedConnectorShape, } from './util/shape-util';
|
|
20
34
|
export { buildConnectorEndpointUpdate, buildConnectorRoutePointsUpdate, createFreeConnectorPointInfo, resolveConnectorRoutePoints, resolveShapeConnectionPoint, } from './utils/connector.util';
|
|
21
35
|
export { applyDocumentToShapeText, applyRichTextToShapeText, applyShapeTextAlignment, applyShapeTextStyle, applyTextToShapeText, normalizeShapeTextData, shapeTextToRichTextValue, } from './utils/shape-text-converter';
|
|
22
36
|
export type { IShapeTextAlignmentOptions } from './utils/shape-text-converter';
|
|
37
|
+
export { parseSvgPathData } from './utils/svg-path-data';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { IBoundRectNoAngle } from '@univerjs/engine-render';
|
|
2
|
-
import type { ShapeTypeEnum } from '../shape-enum';
|
|
3
2
|
import type { IGdContext, IPresetShapeConfig, IShapeAdjustItemResolved, IShapeContextOptions, IShapeData, IShapeJSONData, IShapeModel, IShapePoint, IShapePointWithAdjName, IShapeRect, IShapeRelation, IShapeRelationItem, IShapeRenderParameters, IShapeTextData } from '../shape-type';
|
|
4
|
-
import { BasicShapeEnum } from '../shape-enum';
|
|
5
|
-
export declare function deepMerge<T extends
|
|
3
|
+
import { BasicShapeEnum, ShapeTypeEnum } from '../shape-enum';
|
|
4
|
+
export declare function deepMerge<T extends object>(target: T, ...sources: Partial<T>[]): T;
|
|
6
5
|
export declare class BasicShapeModel implements IShapeModel {
|
|
7
6
|
protected _shapeType: ShapeTypeEnum;
|
|
8
7
|
private readonly _id;
|
|
@@ -135,4 +134,6 @@ export declare class BasicShapeModel implements IShapeModel {
|
|
|
135
134
|
toJSON(): IShapeJSONData;
|
|
136
135
|
fromJSON(json: IShapeJSONData): void;
|
|
137
136
|
private _createRenderModel;
|
|
137
|
+
private _renderSmartArtPresentationShapes;
|
|
138
|
+
private _getSmartArtDrawingBounds;
|
|
138
139
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { IBoundRectNoAngle } from '@univerjs/engine-render';
|
|
2
|
+
import type { IShape3D, IShapeData, IShapeRect, IShapeRenderParameters, IShapeScene3D } from '../shape-type';
|
|
3
|
+
import type { BaseShapeContext } from './base-shape-context';
|
|
4
|
+
import type { BaseShapeRenderModel } from './shape-render-model';
|
|
5
|
+
import { ShapeBevelPresetEnum, ShapeMaterialPresetEnum } from '../shape-enum';
|
|
6
|
+
/** PowerPoint's implicit bevel extent, stored in the public model as points for OOXML round-trips. */
|
|
7
|
+
export declare const DEFAULT_SHAPE_BEVEL_EXTENT = 6;
|
|
8
|
+
export declare function resolveShapeBevelExtent(preset: ShapeBevelPresetEnum | undefined, extent: number | undefined): number;
|
|
9
|
+
export declare function resolveProjectedFlatMaterialFactor(scene3d?: IShapeScene3D): number;
|
|
10
|
+
interface IShape3DProjection {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
interface IShapeBevelProfile {
|
|
15
|
+
/** Effective inset in units of the OOXML bevel width/height. */
|
|
16
|
+
widthScale: number;
|
|
17
|
+
heightScale: number;
|
|
18
|
+
top: number;
|
|
19
|
+
right: number;
|
|
20
|
+
bottom: number;
|
|
21
|
+
left: number;
|
|
22
|
+
inner?: number;
|
|
23
|
+
secondary?: number;
|
|
24
|
+
/** Fraction of the bevel occupied by the outer face in a compound profile. */
|
|
25
|
+
outerRatio?: number;
|
|
26
|
+
/** Reverses the inner face light response for concave profiles. */
|
|
27
|
+
innerTop?: number;
|
|
28
|
+
innerRight?: number;
|
|
29
|
+
innerBottom?: number;
|
|
30
|
+
innerLeft?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface IShape3DProjectedPoint {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
depth: number;
|
|
36
|
+
}
|
|
37
|
+
export interface IShape3DProjectedQuad {
|
|
38
|
+
topLeft: IShape3DProjectedPoint;
|
|
39
|
+
topRight: IShape3DProjectedPoint;
|
|
40
|
+
bottomRight: IShape3DProjectedPoint;
|
|
41
|
+
bottomLeft: IShape3DProjectedPoint;
|
|
42
|
+
}
|
|
43
|
+
export declare function applyShape3DCameraTransform(canvasContext: CanvasRenderingContext2D, rect: IShapeRect, scene3d?: IShapeScene3D): void;
|
|
44
|
+
/** Stable renderer-level signature used by regression tests and cached glyph render plans. */
|
|
45
|
+
export declare function resolveShapeBevelProfileSignature(preset?: ShapeBevelPresetEnum): string;
|
|
46
|
+
/**
|
|
47
|
+
* Stable, fill-independent description of a PowerPoint bevel's light response.
|
|
48
|
+
* Consumers apply these signed alpha values over the current fill; presets never
|
|
49
|
+
* carry a source color of their own.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveShapeBevelLightCurveSignature(preset?: ShapeBevelPresetEnum, scene3d?: IShapeScene3D, material?: ShapeMaterialPresetEnum): string;
|
|
52
|
+
export interface IShape3DGlyphRenderPlan {
|
|
53
|
+
projection: IShape3DProjection;
|
|
54
|
+
layerCount: number;
|
|
55
|
+
extrusionColor: string;
|
|
56
|
+
extrusionInheritsFill: boolean;
|
|
57
|
+
extrusionOpacity: number;
|
|
58
|
+
lightFactor: number;
|
|
59
|
+
lightAngle: number;
|
|
60
|
+
materialGradientStops: ReadonlyArray<readonly [number, string]>;
|
|
61
|
+
bevel?: IShapeBevelProfile & {
|
|
62
|
+
width: number;
|
|
63
|
+
height: number;
|
|
64
|
+
};
|
|
65
|
+
contourWidth: number;
|
|
66
|
+
contourColor: string;
|
|
67
|
+
}
|
|
68
|
+
/** Resolves the Shape 2.5D semantics for a cached text-glyph alpha layer. */
|
|
69
|
+
export declare function resolveShape3DGlyphRenderPlan(scene3d: IShapeScene3D | undefined, shape3d: IShape3D | undefined, baseColor?: string, sceneRect?: IShapeRect): IShape3DGlyphRenderPlan | undefined;
|
|
70
|
+
export declare function shadeShape3DColor(color: string, factor: number): string;
|
|
71
|
+
export declare function getShape3DCameraTransformedBounds(bounds: IBoundRectNoAngle, sceneRect: IShapeRect, scene3d?: IShapeScene3D): IBoundRectNoAngle;
|
|
72
|
+
export declare function isShape3DProjectiveScene(scene3d?: IShapeScene3D): boolean;
|
|
73
|
+
export declare function projectShape3DPoint(point: {
|
|
74
|
+
x: number;
|
|
75
|
+
y: number;
|
|
76
|
+
z?: number;
|
|
77
|
+
}, sceneRect: IShapeRect, scene3d: IShapeScene3D): IShape3DProjectedPoint;
|
|
78
|
+
export declare function projectShape3DRect(rect: IShapeRect, sceneRect: IShapeRect, scene3d: IShapeScene3D, z?: number): IShape3DProjectedQuad;
|
|
79
|
+
export declare function renderProjectedShapeRect(canvasContext: CanvasRenderingContext2D, sceneRect: IShapeRect, rect: IShapeRect, scene3d: IShapeScene3D, shapeData: IShapeData, image?: HTMLImageElement): void;
|
|
80
|
+
export declare function renderShape3D(canvasContext: CanvasRenderingContext2D, rect: IShapeRect, shapeContext: BaseShapeContext, shapeData: IShapeData, renderOption: IShapeRenderParameters, renderModel: BaseShapeRenderModel): void;
|
|
81
|
+
export declare function renderShape3DFrontBevel(canvasContext: CanvasRenderingContext2D, rect: IShapeRect, shapeContext: BaseShapeContext, shapeData: IShapeData, renderOption: IShapeRenderParameters, renderModel: BaseShapeRenderModel): void;
|
|
82
|
+
interface IMaterialSurfaceAdjustment {
|
|
83
|
+
add: number;
|
|
84
|
+
colorCurve?: readonly number[];
|
|
85
|
+
scale: number;
|
|
86
|
+
}
|
|
87
|
+
/** Continuous material response shared by preset and explicit DrawingML camera rotations. */
|
|
88
|
+
export declare function resolveProjectedMaterialSurfaceAdjustment(material: ShapeMaterialPresetEnum, scene3d?: IShapeScene3D, shape3d?: IShape3D): IMaterialSurfaceAdjustment;
|
|
89
|
+
export declare function getShape3DBounds(rect: IShapeRect, scene3d?: IShapeScene3D, shape3d?: IShape3D, sceneRect?: IShapeRect, strokeWidth?: number): IBoundRectNoAngle | undefined;
|
|
90
|
+
export declare const DEFAULT_SHAPE_3D_SCENE: IShapeScene3D;
|
|
91
|
+
export {};
|
|
@@ -5,6 +5,7 @@ export declare abstract class BaseShapeRenderModel {
|
|
|
5
5
|
abstract readonly name: string;
|
|
6
6
|
abstract readonly presetShapeConfig: IPresetShapeConfig;
|
|
7
7
|
isLineShape(): boolean;
|
|
8
|
+
protected _isStrokeVisible(shapeData: IShapeData): boolean;
|
|
8
9
|
getConnectorLinePoints(): IShapeGdContextKeyPoint[];
|
|
9
10
|
/**
|
|
10
11
|
* This method tests whether a point (pointX, pointY) hits any interactive parts of the shape,
|
|
@@ -2,6 +2,7 @@ import type { IFormulaLastValue } from '@univerjs-pro/engine-formula';
|
|
|
2
2
|
import type { IAccessor, IDisposable, IMutationInfo } from '@univerjs/core';
|
|
3
3
|
import type { ShapeTypeEnum } from '../shape-enum';
|
|
4
4
|
import type { IShapeData } from '../shape-type';
|
|
5
|
+
import type { SmartArtOperation } from '../smart-art/smart-art-operation';
|
|
5
6
|
import { UniverInstanceType } from '@univerjs/core';
|
|
6
7
|
export type ShapeHostType = UniverInstanceType.UNIVER_SHEET | UniverInstanceType.UNIVER_DOC | UniverInstanceType.UNIVER_SLIDE | UniverInstanceType.UNIVER_BOARD;
|
|
7
8
|
export declare function isShapeHostType(type: UniverInstanceType): type is ShapeHostType;
|
|
@@ -26,6 +27,15 @@ export interface IShapeHostChangeStream {
|
|
|
26
27
|
unsubscribe(): void;
|
|
27
28
|
};
|
|
28
29
|
}
|
|
30
|
+
export interface IShapeHostAdapterRegistryChange {
|
|
31
|
+
type: 'registered' | 'unregistered';
|
|
32
|
+
adapter: IShapeHostAdapter;
|
|
33
|
+
}
|
|
34
|
+
export interface IShapeHostAdapterRegistryChangeStream {
|
|
35
|
+
subscribe(listener: (change: IShapeHostAdapterRegistryChange) => void): {
|
|
36
|
+
unsubscribe(): void;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
29
39
|
export interface IShapeTransform {
|
|
30
40
|
/** Horizontal position in host coordinates. */
|
|
31
41
|
left: number;
|
|
@@ -89,6 +99,8 @@ export interface IShapeUpdateInput {
|
|
|
89
99
|
visible?: boolean;
|
|
90
100
|
/** Canvas selectability to update. Omit to preserve the current value. */
|
|
91
101
|
selectable?: boolean;
|
|
102
|
+
/** Semantic SmartArt edits resolved by the host's undoable command. */
|
|
103
|
+
smartArtOperations?: readonly SmartArtOperation[];
|
|
92
104
|
}
|
|
93
105
|
/**
|
|
94
106
|
* Ephemeral compare-and-set guard carried by a derived Formula last-value mutation.
|
|
@@ -115,7 +127,14 @@ export interface IShapeHostAdapter {
|
|
|
115
127
|
*/
|
|
116
128
|
listShapesInUnit?(unitId: string): IShapeSnapshot[];
|
|
117
129
|
createShape(scope: IShapeScope, input: IShapeCreateInput): IShapeSnapshot | null;
|
|
130
|
+
/**
|
|
131
|
+
* Creates Shapes atomically and returns snapshots in input order.
|
|
132
|
+
* Implementations must return `null` without retaining partial changes when any input or the host command fails.
|
|
133
|
+
*/
|
|
134
|
+
createShapes?(scope: IShapeScope, inputs: IShapeCreateInput[]): IShapeSnapshot[] | null;
|
|
118
135
|
updateShape(ref: IShapeRef, input: IShapeUpdateInput): boolean;
|
|
136
|
+
/** Replaces one SmartArt composite with host-native ordinary Shapes in one undoable command. */
|
|
137
|
+
convertSmartArtToShapes?(ref: IShapeRef): IShapeSnapshot[] | null;
|
|
119
138
|
/**
|
|
120
139
|
* Builds the Host's existing Shape mutation for a successful Formula result.
|
|
121
140
|
*
|
|
@@ -128,14 +147,21 @@ export interface IShapeHostAdapter {
|
|
|
128
147
|
bringForward(ref: IShapeRef): boolean;
|
|
129
148
|
sendBackward(ref: IShapeRef): boolean;
|
|
130
149
|
sendToBack(ref: IShapeRef): boolean;
|
|
150
|
+
setZOrder(ref: IShapeRef, index: number): boolean;
|
|
131
151
|
}
|
|
132
152
|
export interface IShapeHostAdapterRegistry {
|
|
153
|
+
readonly adapterChanged$: IShapeHostAdapterRegistryChangeStream;
|
|
133
154
|
register(adapter: IShapeHostAdapter): IDisposable;
|
|
134
155
|
get(hostType: UniverInstanceType): IShapeHostAdapter | null;
|
|
156
|
+
list(): readonly IShapeHostAdapter[];
|
|
135
157
|
}
|
|
136
158
|
export declare const IShapeHostAdapterRegistry: import("@wendellhu/redi").IdentifierDecorator<IShapeHostAdapterRegistry>;
|
|
137
159
|
export declare class ShapeHostAdapterRegistry implements IShapeHostAdapterRegistry {
|
|
138
160
|
private readonly _adapters;
|
|
161
|
+
private readonly _adapterChangedListeners;
|
|
162
|
+
readonly adapterChanged$: IShapeHostAdapterRegistryChangeStream;
|
|
139
163
|
register(adapter: IShapeHostAdapter): IDisposable;
|
|
140
164
|
get(hostType: UniverInstanceType): IShapeHostAdapter | null;
|
|
165
|
+
list(): readonly IShapeHostAdapter[];
|
|
166
|
+
private _emitAdapterChanged;
|
|
141
167
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ImageSourceType } from '@univerjs/core';
|
|
2
|
+
export declare const ImageSourceTypeEnum: typeof ImageSourceType;
|
|
3
|
+
export type ImageSourceTypeEnum = ImageSourceType;
|
|
1
4
|
/**
|
|
2
5
|
* Basic shape types
|
|
3
6
|
*/
|
|
@@ -79,9 +82,148 @@ export declare enum ShapePresetShadowValEnum {
|
|
|
79
82
|
/** OOXML shdw20: Front Bottom Shadow, a front-facing shadow below the shape. */
|
|
80
83
|
Shdw20 = "shdw20"
|
|
81
84
|
}
|
|
85
|
+
/** OOXML ST_PresetCameraType values used by `<a:camera prst="...">`. */
|
|
86
|
+
export declare enum ShapeCameraPresetEnum {
|
|
87
|
+
LegacyObliqueTopLeft = "legacyObliqueTopLeft",
|
|
88
|
+
LegacyObliqueTop = "legacyObliqueTop",
|
|
89
|
+
LegacyObliqueTopRight = "legacyObliqueTopRight",
|
|
90
|
+
LegacyObliqueLeft = "legacyObliqueLeft",
|
|
91
|
+
LegacyObliqueFront = "legacyObliqueFront",
|
|
92
|
+
LegacyObliqueRight = "legacyObliqueRight",
|
|
93
|
+
LegacyObliqueBottomLeft = "legacyObliqueBottomLeft",
|
|
94
|
+
LegacyObliqueBottom = "legacyObliqueBottom",
|
|
95
|
+
LegacyObliqueBottomRight = "legacyObliqueBottomRight",
|
|
96
|
+
LegacyPerspectiveTopLeft = "legacyPerspectiveTopLeft",
|
|
97
|
+
LegacyPerspectiveTop = "legacyPerspectiveTop",
|
|
98
|
+
LegacyPerspectiveTopRight = "legacyPerspectiveTopRight",
|
|
99
|
+
LegacyPerspectiveLeft = "legacyPerspectiveLeft",
|
|
100
|
+
LegacyPerspectiveFront = "legacyPerspectiveFront",
|
|
101
|
+
LegacyPerspectiveRight = "legacyPerspectiveRight",
|
|
102
|
+
LegacyPerspectiveBottomLeft = "legacyPerspectiveBottomLeft",
|
|
103
|
+
LegacyPerspectiveBottom = "legacyPerspectiveBottom",
|
|
104
|
+
LegacyPerspectiveBottomRight = "legacyPerspectiveBottomRight",
|
|
105
|
+
OrthographicFront = "orthographicFront",
|
|
106
|
+
IsometricTopUp = "isometricTopUp",
|
|
107
|
+
IsometricTopDown = "isometricTopDown",
|
|
108
|
+
IsometricBottomUp = "isometricBottomUp",
|
|
109
|
+
IsometricBottomDown = "isometricBottomDown",
|
|
110
|
+
IsometricLeftUp = "isometricLeftUp",
|
|
111
|
+
IsometricLeftDown = "isometricLeftDown",
|
|
112
|
+
IsometricRightUp = "isometricRightUp",
|
|
113
|
+
IsometricRightDown = "isometricRightDown",
|
|
114
|
+
IsometricOffAxis1Left = "isometricOffAxis1Left",
|
|
115
|
+
IsometricOffAxis1Right = "isometricOffAxis1Right",
|
|
116
|
+
IsometricOffAxis1Top = "isometricOffAxis1Top",
|
|
117
|
+
IsometricOffAxis2Left = "isometricOffAxis2Left",
|
|
118
|
+
IsometricOffAxis2Right = "isometricOffAxis2Right",
|
|
119
|
+
IsometricOffAxis2Top = "isometricOffAxis2Top",
|
|
120
|
+
IsometricOffAxis3Left = "isometricOffAxis3Left",
|
|
121
|
+
IsometricOffAxis3Right = "isometricOffAxis3Right",
|
|
122
|
+
IsometricOffAxis3Bottom = "isometricOffAxis3Bottom",
|
|
123
|
+
IsometricOffAxis4Left = "isometricOffAxis4Left",
|
|
124
|
+
IsometricOffAxis4Right = "isometricOffAxis4Right",
|
|
125
|
+
IsometricOffAxis4Bottom = "isometricOffAxis4Bottom",
|
|
126
|
+
ObliqueTopLeft = "obliqueTopLeft",
|
|
127
|
+
ObliqueTop = "obliqueTop",
|
|
128
|
+
ObliqueTopRight = "obliqueTopRight",
|
|
129
|
+
ObliqueLeft = "obliqueLeft",
|
|
130
|
+
ObliqueRight = "obliqueRight",
|
|
131
|
+
ObliqueBottomLeft = "obliqueBottomLeft",
|
|
132
|
+
ObliqueBottom = "obliqueBottom",
|
|
133
|
+
ObliqueBottomRight = "obliqueBottomRight",
|
|
134
|
+
PerspectiveFront = "perspectiveFront",
|
|
135
|
+
PerspectiveLeft = "perspectiveLeft",
|
|
136
|
+
PerspectiveRight = "perspectiveRight",
|
|
137
|
+
PerspectiveAbove = "perspectiveAbove",
|
|
138
|
+
PerspectiveBelow = "perspectiveBelow",
|
|
139
|
+
PerspectiveAboveLeftFacing = "perspectiveAboveLeftFacing",
|
|
140
|
+
PerspectiveAboveRightFacing = "perspectiveAboveRightFacing",
|
|
141
|
+
PerspectiveContrastingLeftFacing = "perspectiveContrastingLeftFacing",
|
|
142
|
+
PerspectiveContrastingRightFacing = "perspectiveContrastingRightFacing",
|
|
143
|
+
PerspectiveHeroicLeftFacing = "perspectiveHeroicLeftFacing",
|
|
144
|
+
PerspectiveHeroicRightFacing = "perspectiveHeroicRightFacing",
|
|
145
|
+
PerspectiveHeroicExtremeLeftFacing = "perspectiveHeroicExtremeLeftFacing",
|
|
146
|
+
PerspectiveHeroicExtremeRightFacing = "perspectiveHeroicExtremeRightFacing",
|
|
147
|
+
PerspectiveRelaxed = "perspectiveRelaxed",
|
|
148
|
+
PerspectiveRelaxedModerately = "perspectiveRelaxedModerately"
|
|
149
|
+
}
|
|
150
|
+
/** OOXML ST_LightRigType values used by `<a:lightRig rig="...">`. */
|
|
151
|
+
export declare enum ShapeLightRigPresetEnum {
|
|
152
|
+
LegacyFlat1 = "legacyFlat1",
|
|
153
|
+
LegacyFlat2 = "legacyFlat2",
|
|
154
|
+
LegacyFlat3 = "legacyFlat3",
|
|
155
|
+
LegacyFlat4 = "legacyFlat4",
|
|
156
|
+
LegacyNormal1 = "legacyNormal1",
|
|
157
|
+
LegacyNormal2 = "legacyNormal2",
|
|
158
|
+
LegacyNormal3 = "legacyNormal3",
|
|
159
|
+
LegacyNormal4 = "legacyNormal4",
|
|
160
|
+
LegacyHarsh1 = "legacyHarsh1",
|
|
161
|
+
LegacyHarsh2 = "legacyHarsh2",
|
|
162
|
+
LegacyHarsh3 = "legacyHarsh3",
|
|
163
|
+
LegacyHarsh4 = "legacyHarsh4",
|
|
164
|
+
ThreePoint = "threePt",
|
|
165
|
+
Balanced = "balanced",
|
|
166
|
+
Soft = "soft",
|
|
167
|
+
Harsh = "harsh",
|
|
168
|
+
Flood = "flood",
|
|
169
|
+
Contrasting = "contrasting",
|
|
170
|
+
Morning = "morning",
|
|
171
|
+
Sunrise = "sunrise",
|
|
172
|
+
Sunset = "sunset",
|
|
173
|
+
Chilly = "chilly",
|
|
174
|
+
Freezing = "freezing",
|
|
175
|
+
Flat = "flat",
|
|
176
|
+
TwoPoint = "twoPt",
|
|
177
|
+
Glow = "glow",
|
|
178
|
+
BrightRoom = "brightRoom"
|
|
179
|
+
}
|
|
180
|
+
/** OOXML ST_LightRigDirection values. */
|
|
181
|
+
export declare enum ShapeLightRigDirectionEnum {
|
|
182
|
+
TopLeft = "tl",
|
|
183
|
+
Top = "t",
|
|
184
|
+
TopRight = "tr",
|
|
185
|
+
Left = "l",
|
|
186
|
+
Right = "r",
|
|
187
|
+
BottomLeft = "bl",
|
|
188
|
+
Bottom = "b",
|
|
189
|
+
BottomRight = "br"
|
|
190
|
+
}
|
|
191
|
+
/** OOXML ST_PresetMaterialType values used by `<a:sp3d prstMaterial="...">`. */
|
|
192
|
+
export declare enum ShapeMaterialPresetEnum {
|
|
193
|
+
LegacyMatte = "legacyMatte",
|
|
194
|
+
LegacyPlastic = "legacyPlastic",
|
|
195
|
+
LegacyMetal = "legacyMetal",
|
|
196
|
+
LegacyWireframe = "legacyWireframe",
|
|
197
|
+
Matte = "matte",
|
|
198
|
+
Plastic = "plastic",
|
|
199
|
+
Metal = "metal",
|
|
200
|
+
WarmMatte = "warmMatte",
|
|
201
|
+
TranslucentPowder = "translucentPowder",
|
|
202
|
+
Powder = "powder",
|
|
203
|
+
DarkEdge = "dkEdge",
|
|
204
|
+
SoftEdge = "softEdge",
|
|
205
|
+
Clear = "clear",
|
|
206
|
+
Flat = "flat",
|
|
207
|
+
SoftMetal = "softmetal"
|
|
208
|
+
}
|
|
209
|
+
/** OOXML ST_BevelPresetType values used by `<a:bevelT>` and `<a:bevelB>`. */
|
|
210
|
+
export declare enum ShapeBevelPresetEnum {
|
|
211
|
+
RelaxedInset = "relaxedInset",
|
|
212
|
+
Circle = "circle",
|
|
213
|
+
Slope = "slope",
|
|
214
|
+
Cross = "cross",
|
|
215
|
+
Angle = "angle",
|
|
216
|
+
SoftRound = "softRound",
|
|
217
|
+
Convex = "convex",
|
|
218
|
+
CoolSlant = "coolSlant",
|
|
219
|
+
Divot = "divot",
|
|
220
|
+
Riblet = "riblet",
|
|
221
|
+
HardEdge = "hardEdge",
|
|
222
|
+
ArtDeco = "artDeco"
|
|
223
|
+
}
|
|
82
224
|
/**
|
|
83
225
|
* Shape fill type enum
|
|
84
|
-
*
|
|
226
|
+
* Shape fill types supported by the renderer.
|
|
85
227
|
*/
|
|
86
228
|
export declare enum ShapeFillEnum {
|
|
87
229
|
NoFill = 1,
|
|
@@ -136,6 +278,8 @@ export declare enum ShapeOperatorEnum {
|
|
|
136
278
|
export declare enum ShapeTypeEnum {
|
|
137
279
|
/** No rendered geometry; reserve this value for an explicitly empty shape. */
|
|
138
280
|
None = "none",
|
|
281
|
+
/** SmartArt composite host. Its editable presentation shapes remain nested in `shapeData.smartArt`. */
|
|
282
|
+
SmartArt = "smartArt",
|
|
139
283
|
/** Rectangle for generic process steps, cards, and diagram nodes. */
|
|
140
284
|
Rect = "rect",
|
|
141
285
|
/** Rounded rectangle for friendly process steps, states, and cards. */
|
|
@@ -572,23 +716,6 @@ export declare enum ShapeSketchTypeEnum {
|
|
|
572
716
|
Freehand = 3,
|
|
573
717
|
HandDrawn = 4
|
|
574
718
|
}
|
|
575
|
-
/**
|
|
576
|
-
* The type of image data source
|
|
577
|
-
*/
|
|
578
|
-
export declare enum ImageSourceTypeEnum {
|
|
579
|
-
/**
|
|
580
|
-
* The image source is a URL, for example: https://avatars.githubusercontent.com/u/61444807?s=48&v=4
|
|
581
|
-
*/
|
|
582
|
-
URL = "URL",
|
|
583
|
-
/**
|
|
584
|
-
* The image source is a UUID, this ID is generated by the Univer image hosting service. For specific generation rules, please refer to the Univer image hosting service API documentation.
|
|
585
|
-
*/
|
|
586
|
-
UUID = "UUID",
|
|
587
|
-
/**
|
|
588
|
-
* The image source is BASE64, for example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAYAAAB7ZJ...
|
|
589
|
-
*/
|
|
590
|
-
BASE64 = "BASE64"
|
|
591
|
-
}
|
|
592
719
|
/**
|
|
593
720
|
* The image fill mode when ShapeFillEnum is PictureFill
|
|
594
721
|
*/
|