@tmagic/stage 1.2.13 → 1.2.14

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,5 +1,5 @@
1
1
  {
2
- "version": "1.2.13",
2
+ "version": "1.2.14",
3
3
  "name": "@tmagic/stage",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -30,9 +30,9 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@scena/guides": "^0.23.3",
33
- "@tmagic/core": "1.2.13",
34
- "@tmagic/schema": "1.2.13",
35
- "@tmagic/utils": "1.2.13",
33
+ "@tmagic/core": "1.2.14",
34
+ "@tmagic/schema": "1.2.14",
35
+ "@tmagic/utils": "1.2.14",
36
36
  "events": "^3.3.0",
37
37
  "keycon": "^1.1.2",
38
38
  "lodash-es": "^4.17.21",
@@ -45,7 +45,7 @@
45
45
  "@types/node": "^15.12.4",
46
46
  "rimraf": "^3.0.2",
47
47
  "sass": "^1.35.1",
48
- "typescript": "^4.7.4",
49
- "vite": "^3.1.3"
48
+ "typescript": "^5.0.4",
49
+ "vite": "^4.2.1"
50
50
  }
51
51
  }
package/types/types.d.ts CHANGED
@@ -5,20 +5,20 @@ import type { Id, MApp, MContainer, MNode } from '@tmagic/schema';
5
5
  import { GuidesType, ZIndex } from './const';
6
6
  import DragResizeHelper from './DragResizeHelper';
7
7
  import StageCore from './StageCore';
8
- export declare type TargetElement = HTMLElement | SVGElement;
9
- export declare type CanSelect = (el: HTMLElement, event: MouseEvent, stop: () => boolean) => boolean | Promise<boolean>;
10
- export declare type IsContainer = (el: HTMLElement) => boolean | Promise<boolean>;
11
- export declare type CustomizeRender = (renderer: StageCore) => Promise<HTMLElement> | HTMLElement;
8
+ export type TargetElement = HTMLElement | SVGElement;
9
+ export type CanSelect = (el: HTMLElement, event: MouseEvent, stop: () => boolean) => boolean | Promise<boolean>;
10
+ export type IsContainer = (el: HTMLElement) => boolean | Promise<boolean>;
11
+ export type CustomizeRender = (renderer: StageCore) => Promise<HTMLElement> | HTMLElement;
12
12
  /** 业务方自定义的moveableOptions,可以是配置,也可以是回调函数 */
13
- export declare type CustomizeMoveableOptions = ((config?: CustomizeMoveableOptionsCallbackConfig) => MoveableOptions) | MoveableOptions | undefined;
13
+ export type CustomizeMoveableOptions = ((config?: CustomizeMoveableOptionsCallbackConfig) => MoveableOptions) | MoveableOptions | undefined;
14
14
  /** render提供给的接口,如果是id则转成el,如果是el则直接返回 */
15
- export declare type GetTargetElement = (idOrEl: Id | HTMLElement) => HTMLElement;
15
+ export type GetTargetElement = (idOrEl: Id | HTMLElement) => HTMLElement;
16
16
  /** render提供的接口,通过坐标获得坐标下所有HTML元素数组 */
17
- export declare type GetElementsFromPoint = (point: Point) => HTMLElement[];
18
- export declare type GetRenderDocument = () => Document | undefined;
19
- export declare type DelayedMarkContainer = (event: MouseEvent, exclude: Element[]) => NodeJS.Timeout | undefined;
20
- export declare type MarkContainerEnd = () => HTMLElement | null;
21
- export declare type GetRootContainer = () => HTMLDivElement | undefined;
17
+ export type GetElementsFromPoint = (point: Point) => HTMLElement[];
18
+ export type GetRenderDocument = () => Document | undefined;
19
+ export type DelayedMarkContainer = (event: MouseEvent, exclude: Element[]) => NodeJS.Timeout | undefined;
20
+ export type MarkContainerEnd = () => HTMLElement | null;
21
+ export type GetRootContainer = () => HTMLDivElement | undefined;
22
22
  /** 将组件添加到容器的方式 */
23
23
  export declare enum ContainerHighlightType {
24
24
  /** 默认方式:组件在容器上方悬停一段时间后加入 */
@@ -26,7 +26,7 @@ export declare enum ContainerHighlightType {
26
26
  /** 按住alt键,并在容器上方悬停一段时间后加入 */
27
27
  ALT = "alt"
28
28
  }
29
- export declare type UpdateDragEl = (el: TargetElement, target: TargetElement) => void;
29
+ export type UpdateDragEl = (el: TargetElement, target: TargetElement) => void;
30
30
  export interface StageCoreConfig {
31
31
  /** 需要对齐的dom节点的CSS选择器字符串 */
32
32
  snapElementQuerySelector?: string;
@@ -117,7 +117,7 @@ export declare enum StageDragStatus {
117
117
  /** 拖动结束 */
118
118
  END = "end"
119
119
  }
120
- export declare type Rect = {
120
+ export type Rect = {
121
121
  width: number;
122
122
  height: number;
123
123
  } & Offset;