@plait/core 0.0.35 → 0.0.38

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,5 +1,6 @@
1
1
  export declare type CursorStatus = BaseCursorStatus | string;
2
2
  export declare enum BaseCursorStatus {
3
+ 'drag' = "drag",
3
4
  'move' = "move",
4
5
  'select' = "select"
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/core",
3
- "version": "0.0.35",
3
+ "version": "0.0.38",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^12.2.0",
6
6
  "@angular/core": "^12.2.0"
@@ -37,14 +37,14 @@
37
37
 
38
38
  .zoom-toolbar {
39
39
  position: absolute;
40
- top: 20px;
41
- right: 30px;
40
+ top: 24px;
41
+ right: 24px;
42
42
  display: flex;
43
43
  align-items: center;
44
44
 
45
45
  .zoom-value {
46
46
  user-select: none;
47
- width: 36px;
47
+ width: 54px;
48
48
  height: 20px;
49
49
  padding: 0 8px;
50
50
  font-size: 14px;
@@ -91,6 +91,7 @@
91
91
  transition: transform 200ms;
92
92
  }
93
93
  }
94
+ .icon-active,
94
95
  .plait-action-icon:hover {
95
96
  color: rgb(102, 152, 255);
96
97
  background: rgba(102, 152, 255, 0.1);
package/utils/board.d.ts CHANGED
@@ -1,8 +1,21 @@
1
- import { PlaitBoard, Point } from '../interfaces';
1
+ import { BaseCursorStatus, PlaitBoard, Point } from '../interfaces';
2
2
  export declare function transformPoints(board: PlaitBoard, points: Point[]): Point[];
3
3
  export declare function transformPoint(board: PlaitBoard, point: Point): Point;
4
4
  export declare function getViewBox(board: PlaitBoard): ViewBox;
5
5
  export declare function isNoSelectionElement(e: Event): Element | null;
6
+ /**
7
+ * viewZoom 转 zoom
8
+ * @param viewZoom 视图上显示的 zoom 缩放级别 %
9
+ * @returns zoom 真实的 zoom
10
+ */
11
+ export declare const transformViewZoom: (viewZoom: number) => number;
12
+ /**
13
+ * zoom 转 viewZoom
14
+ * @param zoom this.board.viewport.zoom
15
+ * @returns 视图上显示的 zoom 缩放级别 %
16
+ */
17
+ export declare const transformZoom: (zoom: number) => number;
18
+ export declare const updateCursorStatus: (board: PlaitBoard, cursor: BaseCursorStatus) => void;
6
19
  export declare type ViewBox = {
7
20
  minX: number;
8
21
  minY: number;