@leafer/interface 1.0.9 → 1.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/interface",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "@leafer/interface",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -129,6 +129,7 @@ interface ICanvasMethod {
129
129
  copyWorldByReset(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: string, onlyResetTransform?: boolean): void
130
130
  copyWorldToInner(canvas: ILeaferCanvas, fromWorld: IMatrixWithBoundsData, toInnerBounds: IBoundsData, blendMode?: string): void
131
131
 
132
+ useGrayscaleAlpha(bounds: IBoundsData): void
132
133
  useMask(maskCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void
133
134
  useEraser(eraserCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void
134
135
 
@@ -28,6 +28,7 @@ export interface ILeafDataOptions {
28
28
 
29
29
  export interface ILeafData extends IDataProcessor, ILeafComputedData {
30
30
  __single?: boolean
31
+ readonly __hasMultiPaint?: boolean // fill 、stroke 、shadow 等同时存在两次以上外观绘制的情况
31
32
  __checkSingle(): void
32
33
  __removeNaturalSize(): void
33
34
  }
@@ -81,7 +81,9 @@ export type IHitType =
81
81
  export type IMaskType =
82
82
  | 'path'
83
83
  | 'pixel'
84
+ | 'grayscale'
84
85
  | 'clipping'
86
+ | 'clipping-path'
85
87
 
86
88
  export type IEraserType =
87
89
  | 'path'
@@ -285,6 +287,8 @@ export interface ILeafAttrData {
285
287
  cursor?: ICursorType | ICursorType[]
286
288
 
287
289
  motionPath?: IBoolean
290
+ motionPrecision?: INumber
291
+
288
292
  motion?: INumber | IUnitData
289
293
  motionRotation?: INumber | IBoolean
290
294
 
@@ -383,6 +387,8 @@ export interface ILeafComputedData {
383
387
  cursor?: ICursorType | ICursorType[]
384
388
 
385
389
  motionPath?: boolean
390
+ motionPrecision?: number
391
+
386
392
  motion?: number | IUnitData
387
393
  motionRotation?: number | boolean
388
394
 
@@ -413,6 +419,7 @@ export interface ILeafComputedData {
413
419
  __pathInputed?: number // 是否为输入path, 0:否,1:是,2:永远是(不自动检测)
414
420
  __pathForRender?: IPathCommandData
415
421
  __path2DForRender?: IPath2D
422
+ __pathForArrow?: IPathCommandData
416
423
  __pathForMotion?: IMotionPathData
417
424
  }
418
425
 
@@ -508,7 +515,7 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
508
515
 
509
516
  __bindLeafer(leafer: ILeaferBase | null): void
510
517
 
511
- set(data: IObject, isTemp?: boolean): void
518
+ set(data: IObject, transition?: any): void
512
519
  get(name?: string | string[] | IObject): ILeafInputData | IValue
513
520
  setAttr(name: string, value: any): void
514
521
  getAttr(name: string): any
@@ -519,6 +526,9 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
519
526
  toSVG(): string
520
527
  __SVG(data: IObject): void
521
528
  toHTML(): string
529
+ clone?(data?: ILeafInputData): ILeaf
530
+
531
+ animate?(_keyframe?: any, _options?: any, _type?: any, _isTemp?: boolean): any
522
532
 
523
533
  // ILeafData ->
524
534
  __setAttr(attrName: string, newValue: IValue, checkFiniteNumber?: boolean): boolean
@@ -603,15 +613,15 @@ export interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix,
603
613
  // transform
604
614
  setTransform(transform?: IMatrixData, resize?: boolean): void
605
615
  transform(transform?: IMatrixData, resize?: boolean): void
606
- move(x: number | IPointData, y?: number): void
616
+ move(x: number | IPointData, y?: number, transition?: any): void
607
617
 
608
- moveInner(x: number | IPointData, y?: number): void
618
+ moveInner(x: number | IPointData, y?: number, transition?: any): void
609
619
  scaleOf(origin: IPointData | IAlign, scaleX: number, scaleY?: number, resize?: boolean): void
610
620
  rotateOf(origin: IPointData | IAlign, rotation: number): void
611
621
  skewOf(origin: IPointData | IAlign, skewX: number, skewY?: number, resize?: boolean): void
612
622
 
613
623
  transformWorld(worldTransform?: IMatrixData, resize?: boolean): void
614
- moveWorld(x: number | IPointData, y?: number): void
624
+ moveWorld(x: number | IPointData, y?: number, transition?: any): void
615
625
  scaleOfWorld(worldOrigin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void
616
626
  rotateOfWorld(worldOrigin: IPointData, rotation: number): void
617
627
  skewOfWorld(worldOrigin: IPointData, skewX: number, skewY?: number, resize?: boolean): void
package/types/index.d.ts CHANGED
@@ -1039,6 +1039,7 @@ interface ICanvasMethod {
1039
1039
  copyWorld(canvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData, blendMode?: string): void;
1040
1040
  copyWorldByReset(canvas: ILeaferCanvas, from?: IBoundsData, to?: IBoundsData, blendMode?: string, onlyResetTransform?: boolean): void;
1041
1041
  copyWorldToInner(canvas: ILeaferCanvas, fromWorld: IMatrixWithBoundsData, toInnerBounds: IBoundsData, blendMode?: string): void;
1042
+ useGrayscaleAlpha(bounds: IBoundsData): void;
1042
1043
  useMask(maskCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void;
1043
1044
  useEraser(eraserCanvas: ILeaferCanvas, fromBounds?: IBoundsData, toBounds?: IBoundsData): void;
1044
1045
  fillWorld(bounds: IBoundsData, color: string | object, blendMode?: string): void;
@@ -1212,6 +1213,7 @@ interface ILeafDataOptions {
1212
1213
  }
1213
1214
  interface ILeafData extends IDataProcessor, ILeafComputedData {
1214
1215
  __single?: boolean;
1216
+ readonly __hasMultiPaint?: boolean;
1215
1217
  __checkSingle(): void;
1216
1218
  __removeNaturalSize(): void;
1217
1219
  }
@@ -1318,7 +1320,7 @@ interface IConstraint {
1318
1320
  }
1319
1321
  type IConstraintType = 'from' | 'center' | 'to' | 'from-to' | 'scale';
1320
1322
  type IHitType = 'path' | 'pixel' | 'all' | 'none';
1321
- type IMaskType = 'path' | 'pixel' | 'clipping';
1323
+ type IMaskType = 'path' | 'pixel' | 'grayscale' | 'clipping' | 'clipping-path';
1322
1324
  type IEraserType = 'path' | 'pixel';
1323
1325
  type IBlendMode = 'pass-through' | 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'source-over' | 'source-in' | 'source-out' | 'source-atop' | 'destination-over' | 'destination-in' | 'destination-out' | 'destination-atop' | 'xor';
1324
1326
  type IEditSize = 'size' | 'font-size' | 'scale';
@@ -1396,6 +1398,7 @@ interface ILeafAttrData {
1396
1398
  button?: IBoolean;
1397
1399
  cursor?: ICursorType | ICursorType[];
1398
1400
  motionPath?: IBoolean;
1401
+ motionPrecision?: INumber;
1399
1402
  motion?: INumber | IUnitData;
1400
1403
  motionRotation?: INumber | IBoolean;
1401
1404
  normalStyle?: IObject;
@@ -1466,6 +1469,7 @@ interface ILeafComputedData {
1466
1469
  button?: boolean;
1467
1470
  cursor?: ICursorType | ICursorType[];
1468
1471
  motionPath?: boolean;
1472
+ motionPrecision?: number;
1469
1473
  motion?: number | IUnitData;
1470
1474
  motionRotation?: number | boolean;
1471
1475
  normalStyle?: IObject;
@@ -1486,6 +1490,7 @@ interface ILeafComputedData {
1486
1490
  __pathInputed?: number;
1487
1491
  __pathForRender?: IPathCommandData;
1488
1492
  __path2DForRender?: IPath2D;
1493
+ __pathForArrow?: IPathCommandData;
1489
1494
  __pathForMotion?: IMotionPathData;
1490
1495
  }
1491
1496
  interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDataProxy, ILeafInputData, IEventer {
@@ -1552,7 +1557,7 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1552
1557
  nextRender(item: IFunction, bind?: IObject, off?: 'off'): void;
1553
1558
  removeNextRender(item: IFunction): void;
1554
1559
  __bindLeafer(leafer: ILeaferBase | null): void;
1555
- set(data: IObject, isTemp?: boolean): void;
1560
+ set(data: IObject, transition?: any): void;
1556
1561
  get(name?: string | string[] | IObject): ILeafInputData | IValue;
1557
1562
  setAttr(name: string, value: any): void;
1558
1563
  getAttr(name: string): any;
@@ -1562,6 +1567,8 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1562
1567
  toSVG(): string;
1563
1568
  __SVG(data: IObject): void;
1564
1569
  toHTML(): string;
1570
+ clone?(data?: ILeafInputData): ILeaf;
1571
+ animate?(_keyframe?: any, _options?: any, _type?: any, _isTemp?: boolean): any;
1565
1572
  __setAttr(attrName: string, newValue: IValue, checkFiniteNumber?: boolean): boolean;
1566
1573
  __getAttr(attrName: string): IValue;
1567
1574
  setProxyAttr(name: string, newValue: IValue): void;
@@ -1620,13 +1627,13 @@ interface ILeaf extends ILeafRender, ILeafHit, ILeafBounds, ILeafMatrix, ILeafDa
1620
1627
  getWorldPointByPage(page: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
1621
1628
  setTransform(transform?: IMatrixData, resize?: boolean): void;
1622
1629
  transform(transform?: IMatrixData, resize?: boolean): void;
1623
- move(x: number | IPointData, y?: number): void;
1624
- moveInner(x: number | IPointData, y?: number): void;
1630
+ move(x: number | IPointData, y?: number, transition?: any): void;
1631
+ moveInner(x: number | IPointData, y?: number, transition?: any): void;
1625
1632
  scaleOf(origin: IPointData | IAlign, scaleX: number, scaleY?: number, resize?: boolean): void;
1626
1633
  rotateOf(origin: IPointData | IAlign, rotation: number): void;
1627
1634
  skewOf(origin: IPointData | IAlign, skewX: number, skewY?: number, resize?: boolean): void;
1628
1635
  transformWorld(worldTransform?: IMatrixData, resize?: boolean): void;
1629
- moveWorld(x: number | IPointData, y?: number): void;
1636
+ moveWorld(x: number | IPointData, y?: number, transition?: any): void;
1630
1637
  scaleOfWorld(worldOrigin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void;
1631
1638
  rotateOfWorld(worldOrigin: IPointData, rotation: number): void;
1632
1639
  skewOfWorld(worldOrigin: IPointData, skewX: number, skewY?: number, resize?: boolean): void;