mce 0.15.20 → 0.15.22

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.
@@ -57,9 +57,10 @@ declare const _default: {
57
57
  delete: string;
58
58
  selectAll: string;
59
59
  deselectAll: string;
60
+ selectChildren: string;
60
61
  selectParent: string;
61
- previousSelection: string;
62
- nextSelection: string;
62
+ selectPreviousSibling: string;
63
+ selectNextSibling: string;
63
64
  view: string;
64
65
  'view:checkerboard': string;
65
66
  'view:pixelGrid': string;
@@ -83,6 +84,8 @@ declare const _default: {
83
84
  zoomTo100: string;
84
85
  zoomToFit: string;
85
86
  zoomToSelection: string;
87
+ zoomToNextFrame: string;
88
+ zoomToPreviousFrame: string;
86
89
  object: string;
87
90
  groupSelection: string;
88
91
  frameSelection: string;
@@ -58,9 +58,10 @@ declare const _default: {
58
58
  delete: string;
59
59
  selectAll: string;
60
60
  deselectAll: string;
61
+ selectChildren: string;
61
62
  selectParent: string;
62
- previousSelection: string;
63
- nextSelection: string;
63
+ selectPreviousSibling: string;
64
+ selectNextSibling: string;
64
65
  view: string;
65
66
  'view:checkerboard': string;
66
67
  'view:pixelGrid': string;
@@ -84,6 +85,8 @@ declare const _default: {
84
85
  zoomTo100: string;
85
86
  zoomToFit: string;
86
87
  zoomToSelection: string;
88
+ zoomToNextFrame: string;
89
+ zoomToPreviousFrame: string;
87
90
  object: string;
88
91
  groupSelection: string;
89
92
  frameSelection: string;
@@ -4,7 +4,6 @@ declare global {
4
4
  interface Options extends Partial<Config> {
5
5
  }
6
6
  type Theme = 'system' | 'light' | 'dark';
7
- type ViewMode = 'frame' | 'edgeless';
8
7
  type TypographyStrategy = 'autoHeight' | 'autoWidth' | 'fixedWidthHeight' | 'autoFontSize';
9
8
  type HandleShape = 'rect' | 'circle';
10
9
  interface ScreenCenterOffset {
@@ -15,7 +14,6 @@ declare global {
15
14
  }
16
15
  interface Config {
17
16
  theme: Theme;
18
- viewMode: ViewMode;
19
17
  watermark?: string;
20
18
  msaa: boolean;
21
19
  checkerboard: boolean;
@@ -47,7 +47,7 @@ declare global {
47
47
  isRoot: (value: any) => value is Node;
48
48
  isElement: (value: any) => value is Element2D;
49
49
  isFrame: (value: any) => value is Element2D;
50
- isTopLevelFrame: (value: any) => value is Element2D;
50
+ isTopFrame: (value: any) => value is Element2D;
51
51
  isVisible: (node: Node) => boolean;
52
52
  setVisible: (node: Node, visible: boolean) => void;
53
53
  isLock: (node: Node) => boolean;
@@ -1,6 +1,5 @@
1
1
  import type { Element2D, Node } from 'modern-canvas';
2
2
  import type { ComputedRef, Ref } from 'vue';
3
- import type { AxisAlignedBoundingBox } from '../types';
4
3
  declare global {
5
4
  namespace Mce {
6
5
  interface FrameThumb {
@@ -12,10 +11,7 @@ declare global {
12
11
  interface Editor {
13
12
  frameThumbs: Ref<FrameThumb[]>;
14
13
  frames: ComputedRef<Element2D[]>;
15
- currentFrameIndex: Ref<number>;
16
- currentFrame: ComputedRef<Element2D | undefined>;
17
- currentFrameAabb: ComputedRef<AxisAlignedBoundingBox>;
18
- getAncestorFrame: (node?: Node) => Element2D | undefined;
14
+ getAncestorFrame: (node?: Node, isTop?: boolean) => Element2D | undefined;
19
15
  }
20
16
  }
21
17
  }
@@ -8,6 +8,7 @@ declare global {
8
8
  getObb: (node: Node | Node[] | undefined, inTarget?: 'drawboard' | 'frame' | 'parent') => Obb2D;
9
9
  getAabb: (node: Node | Node[] | undefined, inTarget?: 'drawboard' | 'frame' | 'parent') => Aabb2D;
10
10
  aabbToDrawboardAabb: (aabb: Aabb2D) => Aabb2D;
11
+ viewportAabb: ComputedRef<Aabb2D>;
11
12
  rootAabb: ComputedRef<Aabb2D>;
12
13
  selectionAabb: ComputedRef<Aabb2D>;
13
14
  selectionAabbInDrawboard: ComputedRef<Aabb2D>;
@@ -1,9 +1,6 @@
1
- import type { ComputedRef } from 'vue';
2
- import type { AxisAlignedBoundingBox } from '../types';
3
1
  declare global {
4
2
  namespace Mce {
5
3
  interface Editor {
6
- viewAabb: ComputedRef<AxisAlignedBoundingBox>;
7
4
  bindRenderCanvas: (canvas: HTMLCanvasElement, setEventTarget?: HTMLElement) => () => void;
8
5
  }
9
6
  }
@@ -9,6 +9,7 @@ declare global {
9
9
  regenId?: boolean;
10
10
  }
11
11
  interface Editor {
12
+ findSibling: (target: 'previous' | 'next') => Node | undefined;
12
13
  addNode: (value: Element, options?: AddNodeOptions) => Node;
13
14
  }
14
15
  }
@@ -1,12 +1,14 @@
1
- import type { Element2D } from 'modern-canvas';
1
+ import type { Element2D, Vector2Like } from 'modern-canvas';
2
2
  declare global {
3
3
  namespace Mce {
4
- interface Editor {
5
- setCurrentFrame: (index?: number) => void;
6
- handleElementInsideFrame: (element: Element2D, context?: Record<string, any>) => void;
4
+ interface HandleDragOutReparentOptions {
5
+ pointer: Vector2Like;
6
+ parent: Element2D;
7
+ index: number;
7
8
  }
8
- interface Events {
9
- setCurrentFrame: [index: number, oldIndex: number];
9
+ interface Editor {
10
+ findFrame: (target: 'next' | 'previous') => Element2D | undefined;
11
+ handleDragOutReparent: (element: Element2D, context?: HandleDragOutReparentOptions) => void;
10
12
  }
11
13
  }
12
14
  }
@@ -6,6 +6,7 @@ declare global {
6
6
  y: number;
7
7
  } | Element2D[];
8
8
  interface ScrollToOptions {
9
+ intoView?: boolean;
9
10
  duration?: number;
10
11
  behavior?: 'smooth' | 'instant';
11
12
  }
@@ -8,8 +8,7 @@ declare global {
8
8
  interface Editor {
9
9
  snapshot: () => void;
10
10
  captureElementScreenshot: (element: Element | Element2D) => Promise<HTMLCanvasElement>;
11
- captureFrameScreenshot: (pageIndex: number) => void;
12
- renderFrameThumb: (target: HTMLCanvasElement) => void;
11
+ captureFrameScreenshot: (index: number) => void;
13
12
  }
14
13
  }
15
14
  }
@@ -1,9 +1,10 @@
1
1
  import type { Element2D } from 'modern-canvas';
2
2
  declare global {
3
3
  namespace Mce {
4
- type ZoomTarget = 'root' | 'selection' | Element2D[] | number;
4
+ type ZoomTarget = 'root' | 'selection' | Element2D | Element2D[] | number;
5
5
  type ZoomToMode = 'contain' | 'cover';
6
6
  interface ZoomToOptions {
7
+ intoView?: boolean;
7
8
  mode?: ZoomToMode;
8
9
  duration?: number;
9
10
  behavior?: 'smooth' | 'instant';
@@ -1,14 +1,19 @@
1
+ import type { Node } from 'modern-canvas';
1
2
  declare global {
2
3
  namespace Mce {
3
4
  type AlignCommandDirection = 'left' | 'horizontal-center' | 'right' | 'top' | 'vertical-center' | 'bottom';
4
5
  interface Commands {
6
+ bringForward: (target?: Node) => void;
7
+ sendBackward: (target?: Node) => void;
8
+ bringToFront: (target?: Node | Node[]) => void;
9
+ sendToBack: (target?: Node | Node[]) => void;
5
10
  align: (direction: AlignCommandDirection) => void;
6
11
  alignLeft: () => void;
7
- alignHorizontalCenter: () => void;
8
12
  alignRight: () => void;
9
13
  alignTop: () => void;
10
- alignVerticalCenter: () => void;
11
14
  alignBottom: () => void;
15
+ alignHorizontalCenter: () => void;
16
+ alignVerticalCenter: () => void;
12
17
  }
13
18
  }
14
19
  }
@@ -3,16 +3,18 @@ declare global {
3
3
  interface Hotkeys {
4
4
  selectAll: [event: KeyboardEvent];
5
5
  deselectAll: [event: KeyboardEvent];
6
+ selectChildren: [event: KeyboardEvent];
6
7
  selectParent: [event: KeyboardEvent];
7
- previousSelection: [event: KeyboardEvent];
8
- nextSelection: [event: KeyboardEvent];
8
+ selectPreviousSibling: [event: KeyboardEvent];
9
+ selectNextSibling: [event: KeyboardEvent];
9
10
  }
10
11
  interface Commands {
11
12
  selectAll: () => void;
12
13
  deselectAll: () => void;
14
+ selectChildren: () => void;
13
15
  selectParent: () => void;
14
- previousSelection: () => void;
15
- nextSelection: () => void;
16
+ selectPreviousSibling: () => void;
17
+ selectNextSibling: () => void;
16
18
  }
17
19
  }
18
20
  }
@@ -10,6 +10,7 @@ declare global {
10
10
  startTyping: (e?: MouseEvent | PointerEvent) => Promise<boolean>;
11
11
  startTransform: (e?: MouseEvent | PointerEvent) => boolean;
12
12
  openContextMenu: (e?: MouseEvent | PointerEvent) => boolean;
13
+ layerScrollIntoView: () => boolean;
13
14
  }
14
15
  interface Events {
15
16
  setTransform: [value: {
@@ -26,13 +26,13 @@ import './mixins/drawingTool'
26
26
  import './mixins/scroll'
27
27
  import './mixins/snapshot'
28
28
  import './mixins/zoom'
29
+ import './plugins/arrange'
29
30
  import './plugins/cancel'
30
- import './plugins/clipboard'
31
31
  import './plugins/copyAs'
32
32
  import './plugins/delete'
33
33
  import './plugins/drawingTool'
34
+ import './plugins/edit'
34
35
  import './plugins/enter'
35
- import './plugins/flip'
36
36
  import './plugins/frame'
37
37
  import './plugins/gif'
38
38
  import './plugins/group'
@@ -42,8 +42,6 @@ import './plugins/html'
42
42
  import './plugins/image'
43
43
  import './plugins/import'
44
44
  import './plugins/json'
45
- import './plugins/layerOrder'
46
- import './plugins/layerPosition'
47
45
  import './plugins/layers'
48
46
  import './plugins/lock'
49
47
  import './plugins/madeWith'
@@ -58,7 +56,7 @@ import './plugins/rotate'
58
56
  import './plugins/ruler'
59
57
  import './plugins/saveAs'
60
58
  import './plugins/scroll'
61
- import './plugins/select'
59
+ import './plugins/selection'
62
60
  import './plugins/shape'
63
61
  import './plugins/smartGuides'
64
62
  import './plugins/state'
@@ -66,6 +64,7 @@ import './plugins/statusbar'
66
64
  import './plugins/text'
67
65
  import './plugins/timeline'
68
66
  import './plugins/toolbelt'
67
+ import './plugins/transform'
69
68
  import './plugins/ui'
70
69
  import './plugins/url'
71
70
  import './plugins/view'
@@ -1,4 +1,5 @@
1
1
  import type { ComponentInternalInstance, ComponentPublicInstance, InjectionKey, VNodeChild } from 'vue';
2
+ export declare function noop(..._args: any): void;
2
3
  export declare function isClickInsideElement(event: MouseEvent, targetDiv: HTMLElement): boolean;
3
4
  export interface TemplateRef {
4
5
  (target: Element | ComponentPublicInstance | null): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.15.20",
4
+ "version": "0.15.22",
5
5
  "description": "The headless canvas editor framework. only the ESM.",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -58,10 +58,10 @@
58
58
  "@floating-ui/vue": "^1.1.9",
59
59
  "@vueuse/components": "^14.1.0",
60
60
  "@vueuse/core": "^14.1.0",
61
- "diff": "^8.0.2",
61
+ "diff": "^8.0.3",
62
62
  "file-saver": "^2.0.5",
63
63
  "lodash-es": "^4.17.22",
64
- "modern-canvas": "^0.14.35",
64
+ "modern-canvas": "^0.14.36",
65
65
  "modern-font": "^0.4.4",
66
66
  "modern-idoc": "^0.10.9",
67
67
  "modern-text": "^1.10.15",
@@ -1,19 +0,0 @@
1
- import type { Node } from 'modern-canvas';
2
- declare global {
3
- namespace Mce {
4
- interface Hotkeys {
5
- bringToFront: [event: KeyboardEvent];
6
- bringForward: [event: KeyboardEvent];
7
- sendBackward: [event: KeyboardEvent];
8
- sendToBack: [event: KeyboardEvent];
9
- }
10
- interface Commands {
11
- bringToFront: (target?: Node | Node[]) => void;
12
- bringForward: (target?: Node) => void;
13
- sendBackward: (target?: Node) => void;
14
- sendToBack: (target?: Node | Node[]) => void;
15
- }
16
- }
17
- }
18
- declare const _default: import("..").Plugin;
19
- export default _default;
File without changes
File without changes