mce 0.16.7 → 0.17.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.
Files changed (74) hide show
  1. package/README.md +37 -22
  2. package/dist/components/EditorLayout.vue.d.ts +2 -9
  3. package/dist/components/Frame.vue.d.ts +6 -2
  4. package/dist/components/Rulers.vue.d.ts +17 -4
  5. package/dist/components/Selection.vue.d.ts +97 -79
  6. package/dist/components/shared/{TransformControls.vue.d.ts → Transform.vue.d.ts} +21 -25
  7. package/dist/composables/layer.d.ts +2 -2
  8. package/dist/composables/layout.d.ts +4 -4
  9. package/dist/composables/strategy.d.ts +1 -2
  10. package/dist/crdt/YDoc.d.ts +1 -2
  11. package/dist/editor.d.ts +10 -8
  12. package/dist/index.css +439 -399
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +6527 -6333
  15. package/dist/locale/en.d.ts +14 -16
  16. package/dist/locale/zh-Hans.d.ts +14 -16
  17. package/dist/mixins/0.config/base.d.ts +41 -26
  18. package/dist/mixins/0.config.d.ts +3 -3
  19. package/dist/mixins/0.context.d.ts +2 -2
  20. package/dist/mixins/0.font.d.ts +0 -3
  21. package/dist/mixins/1.screen.d.ts +11 -2
  22. package/dist/mixins/snapper.d.ts +27 -0
  23. package/dist/mixins/snapshot.d.ts +0 -3
  24. package/dist/mixins/tool.d.ts +25 -0
  25. package/dist/nodes/Doc.d.ts +3 -3
  26. package/dist/plugin.d.ts +3 -3
  27. package/dist/plugins/doc.d.ts +17 -3
  28. package/dist/plugins/edit.d.ts +3 -0
  29. package/dist/plugins/frame.d.ts +13 -1
  30. package/dist/plugins/image.d.ts +1 -1
  31. package/dist/plugins/layers.d.ts +2 -2
  32. package/dist/plugins/madeWith.d.ts +5 -2
  33. package/dist/plugins/menu.d.ts +3 -0
  34. package/dist/plugins/node.d.ts +6 -3
  35. package/dist/plugins/pen.d.ts +1 -1
  36. package/dist/plugins/ruler.d.ts +6 -9
  37. package/dist/plugins/scroll.d.ts +6 -3
  38. package/dist/plugins/selection.d.ts +4 -10
  39. package/dist/plugins/shape.d.ts +1 -1
  40. package/dist/plugins/smartGuides.d.ts +0 -7
  41. package/dist/plugins/state.d.ts +1 -1
  42. package/dist/plugins/statusbar.d.ts +4 -4
  43. package/dist/plugins/timeline.d.ts +4 -4
  44. package/dist/plugins/{drawingTool.d.ts → tool.d.ts} +1 -1
  45. package/dist/plugins/toolbelt.d.ts +5 -2
  46. package/dist/plugins/transform.d.ts +36 -4
  47. package/dist/plugins/typography.d.ts +41 -0
  48. package/dist/plugins/view.d.ts +16 -10
  49. package/dist/plugins/zoom.d.ts +10 -7
  50. package/dist/typed-global.d.ts +4 -1
  51. package/dist/typed-plugins.d.ts +7 -16
  52. package/dist/types/helper.d.ts +3 -0
  53. package/dist/types/index.d.ts +1 -0
  54. package/dist/utils/dnd.d.ts +28 -7
  55. package/dist/utils/helper.d.ts +2 -0
  56. package/dist/utils/index.d.ts +0 -1
  57. package/package.json +6 -11
  58. package/dist/mixins/3.view.d.ts +0 -9
  59. package/dist/mixins/4.1.text.d.ts +0 -21
  60. package/dist/mixins/drawingTool.d.ts +0 -25
  61. package/dist/plugins/copyAs.d.ts +0 -11
  62. package/dist/plugins/gif.d.ts +0 -12
  63. package/dist/plugins/move.d.ts +0 -20
  64. package/dist/plugins/new.d.ts +0 -12
  65. package/dist/plugins/open.d.ts +0 -12
  66. package/dist/plugins/panels.d.ts +0 -13
  67. package/dist/plugins/rotate.d.ts +0 -10
  68. package/dist/plugins/text.d.ts +0 -17
  69. package/dist/plugins/ui.d.ts +0 -20
  70. package/dist/utils/random.d.ts +0 -3
  71. /package/dist/components/{NodeCreator.vue.d.ts → Creator.vue.d.ts} +0 -0
  72. /package/dist/mixins/{2.export.d.ts → exporter.d.ts} +0 -0
  73. /package/dist/mixins/{1.hotkey.d.ts → hotkey.d.ts} +0 -0
  74. /package/dist/mixins/{2.load.d.ts → loader.d.ts} +0 -0
@@ -1,5 +1,15 @@
1
+ import type { DragContext } from '../utils';
1
2
  declare global {
2
3
  namespace Mce {
4
+ interface InteractionConfig {
5
+ transform: TransformConfig;
6
+ }
7
+ interface TransformConfig {
8
+ handleShape: 'rect' | 'circle';
9
+ handleStyle: '8-points' | '4-points';
10
+ lockAspectRatioStrategy: 'all' | 'diagonal';
11
+ rotator: boolean;
12
+ }
3
13
  interface TransformValue {
4
14
  left: number;
5
15
  top: number;
@@ -11,17 +21,39 @@ declare global {
11
21
  type TransformHandleDirection = 't' | 'l' | 'r' | 'b';
12
22
  type TransformHandleCorner = 'tl' | 'tr' | 'bl' | 'br';
13
23
  type TransformHandle = 'move' | `resize-${TransformHandleDirection | TransformHandleCorner}` | `rotate-${TransformHandleCorner}` | `round-${TransformHandleCorner}`;
14
- type FlipType = 'horizontal' | 'vertical';
24
+ interface TransformContext extends DragContext {
25
+ handle: TransformHandle;
26
+ value: TransformValue;
27
+ oldValue: TransformValue;
28
+ }
29
+ type MoveDirection = 'left' | 'top' | 'right' | 'bottom';
30
+ type FlipDirection = 'horizontal' | 'vertical';
31
+ type TransformType = 'move' | 'resize' | 'rotate' | 'round';
32
+ interface TransformOptions {
33
+ event?: MouseEvent;
34
+ isCorner?: boolean;
35
+ }
15
36
  interface Commands {
16
37
  enter: () => void;
17
- getTransformValue: () => TransformValue;
18
- transform: (handle: Mce.TransformHandle, value: Partial<TransformValue>) => void;
19
- flip: (type: Mce.FlipType) => void;
38
+ getTransform: () => TransformValue;
39
+ setTransform: (type: TransformType, value: Partial<TransformValue>, options?: TransformOptions) => void;
40
+ move: (direction: MoveDirection, distance?: number) => void;
41
+ moveLeft: (distance?: number) => void;
42
+ moveTop: (distance?: number) => void;
43
+ moveRight: (distance?: number) => void;
44
+ moveBottom: (distance?: number) => void;
45
+ rotate: (deg: number) => void;
46
+ rotate90: () => void;
47
+ flip: (direction: FlipDirection) => void;
20
48
  flipHorizontal: () => void;
21
49
  flipVertical: () => void;
22
50
  }
23
51
  interface Hotkeys {
24
52
  enter: [event: KeyboardEvent];
53
+ moveLeft: [event: KeyboardEvent];
54
+ moveTop: [event: KeyboardEvent];
55
+ moveRight: [event: KeyboardEvent];
56
+ moveBottom: [event: KeyboardEvent];
25
57
  flipHorizontal: [event: KeyboardEvent];
26
58
  flipVertical: [event: KeyboardEvent];
27
59
  }
@@ -0,0 +1,41 @@
1
+ import type { Element2D } from 'modern-canvas';
2
+ import type { FontSource } from 'modern-font';
3
+ import type { NormalizedFill, NormalizedFragment } from 'modern-idoc';
4
+ import type { Ref } from 'vue';
5
+ declare global {
6
+ namespace Mce {
7
+ interface Config {
8
+ typography: TypographyConfig;
9
+ }
10
+ interface TypographyConfig {
11
+ strategy: TypographyStrategy;
12
+ defaultFont?: FontSource;
13
+ }
14
+ type TypographyStrategy = 'autoHeight' | 'autoWidth' | 'fixedWidthHeight' | 'autoFontSize';
15
+ interface Editor {
16
+ hasTextSelectionRange: Ref<boolean>;
17
+ isTextAllSelected: Ref<boolean>;
18
+ }
19
+ interface addTextElementOptions extends AddElementOptions {
20
+ content?: string;
21
+ style?: Record<string, any>;
22
+ }
23
+ interface Commands {
24
+ startTyping: (event?: MouseEvent) => Promise<boolean>;
25
+ addTextElement: (options?: addTextElementOptions) => Element2D;
26
+ handleTextSelection: (textSelection: IndexCharacter[], cb: (arg: Record<string, any>) => boolean) => void;
27
+ textFontSizeToFit: (element: Element2D, scale?: number) => void;
28
+ textToFit: (element: Element2D, typography?: TypographyStrategy) => void;
29
+ getTextStyle: (key: string) => any;
30
+ setTextStyle: (key: string, value: any) => void;
31
+ getTextFill: () => NormalizedFill | undefined;
32
+ setTextFill: (value: NormalizedFill | undefined) => void;
33
+ setTextContentByEachFragment: (handler: (fragment: NormalizedFragment) => void) => void;
34
+ }
35
+ interface Tools {
36
+ text: [options?: addTextElementOptions];
37
+ }
38
+ }
39
+ }
40
+ declare const _default: import("..").Plugin;
41
+ export default _default;
@@ -1,17 +1,23 @@
1
+ import type { PointerInputEvent } from 'modern-canvas';
1
2
  declare global {
2
3
  namespace Mce {
3
- interface Views {
4
- msaa: [];
5
- checkerboard: [];
6
- pixelGrid: [];
7
- ruler: [];
8
- scrollbar: [];
9
- timeline: [];
10
- statusbar: [];
11
- frameOutline: [];
4
+ type Ui = keyof UIConfig;
5
+ interface PointerDownOptions {
6
+ allowTopFrame?: boolean;
12
7
  }
13
8
  interface Commands {
14
- view: <T extends keyof Views>(view: T, ...args: Views[T]) => Promise<boolean>;
9
+ getUiConfig: <T extends Ui>(name: T) => UIConfig[T];
10
+ setUiVisible: (name: Ui, visible: boolean | 'toggle') => void;
11
+ isUiVisible: (name: Ui) => boolean;
12
+ hideUi: (name: Ui) => void;
13
+ showUi: (name: Ui) => void;
14
+ toggleUi: (name: Ui) => void;
15
+ isPanelVisible: (name: string) => boolean;
16
+ setPanelVisible: (name: string, visible: boolean | 'toggle') => void;
17
+ hidePanel: (name: string, visible: boolean | 'toggle') => void;
18
+ showPanel: (name: string, visible: boolean | 'toggle') => void;
19
+ togglePanel: (name: string, visible: boolean | 'toggle') => void;
20
+ pointerDown: (e: PointerInputEvent, options?: PointerDownOptions) => void;
15
21
  }
16
22
  }
17
23
  }
@@ -1,21 +1,24 @@
1
1
  import type { Element2D } from 'modern-canvas';
2
2
  declare global {
3
3
  namespace Mce {
4
- type ZoomTarget = 'root' | 'selection' | Element2D | Element2D[] | number;
5
- type ZoomToMode = 'contain' | 'cover' | 'width' | 'height';
4
+ interface ViewportConfig {
5
+ zoom: ZoomConfig;
6
+ }
7
+ interface ZoomConfig {
8
+ strategy: ZoomToStrategy;
9
+ }
10
+ type ZoomToTarget = 'root' | 'selection' | Element2D | Element2D[] | number;
11
+ type ZoomToStrategy = 'cover' | 'contain' | 'containWidth' | 'containHeight';
6
12
  interface ZoomToOptions {
7
13
  intoView?: boolean;
8
- mode?: ZoomToMode;
14
+ strategy?: ZoomToStrategy;
9
15
  duration?: number;
10
16
  behavior?: 'smooth' | 'instant';
11
17
  }
12
- interface Config {
13
- zoomToFit: ZoomToMode;
14
- }
15
18
  interface Commands {
16
19
  zoomIn: () => void;
17
20
  zoomOut: () => void;
18
- zoomTo: (target: ZoomTarget, options?: ZoomToOptions) => Promise<void>;
21
+ zoomTo: (target: ZoomToTarget, options?: ZoomToOptions) => Promise<void>;
19
22
  zoomTo100: () => void;
20
23
  zoomToFit: () => void;
21
24
  zoomToSelection: (options?: ZoomToOptions) => void;
@@ -1,4 +1,5 @@
1
1
  import type { Vector2Like } from 'modern-canvas'
2
+ import type { DeepMaybe } from './types'
2
3
  import 'modern-canvas'
3
4
 
4
5
  declare module 'modern-canvas' {
@@ -18,7 +19,6 @@ declare module 'modern-canvas' {
18
19
  declare global {
19
20
  namespace Mce {
20
21
  interface Editor {}
21
- interface Options {}
22
22
  interface Slots {}
23
23
  interface Events {
24
24
  ready: []
@@ -27,6 +27,9 @@ declare global {
27
27
  interface Commands {}
28
28
  interface Exporters {}
29
29
  interface Config {}
30
+ interface Options extends DeepMaybe<Config> {
31
+ //
32
+ }
30
33
 
31
34
  type State
32
35
  = | 'loading'
@@ -9,30 +9,26 @@ import './mixins/0.context'
9
9
  import './mixins/0.font'
10
10
  import './mixins/0.locale'
11
11
  import './mixins/1.frame'
12
- import './mixins/1.hotkey'
13
12
  import './mixins/1.screen'
14
13
  import './mixins/1.timeline'
15
14
  import './mixins/1.upload'
16
15
  import './mixins/2.box'
17
- import './mixins/2.export'
18
- import './mixins/2.load'
19
- import './mixins/3.view'
20
16
  import './mixins/4.0.node'
21
- import './mixins/4.1.text'
22
17
  import './mixins/4.2.frame'
23
18
  import './mixins/4.3.element'
24
- import './mixins/drawingTool'
19
+ import './mixins/exporter'
20
+ import './mixins/hotkey'
25
21
  import './mixins/http'
22
+ import './mixins/loader'
23
+ import './mixins/snapper'
26
24
  import './mixins/snapshot'
25
+ import './mixins/tool'
27
26
  import './plugins/arrange'
28
27
  import './plugins/autoNest'
29
- import './plugins/copyAs'
30
28
  import './plugins/doc'
31
- import './plugins/drawingTool'
32
29
  import './plugins/edit'
33
30
  import './plugins/formatPaint'
34
31
  import './plugins/frame'
35
- import './plugins/gif'
36
32
  import './plugins/history'
37
33
  import './plugins/hover'
38
34
  import './plugins/html'
@@ -43,13 +39,8 @@ import './plugins/layers'
43
39
  import './plugins/madeWith'
44
40
  import './plugins/memory'
45
41
  import './plugins/menu'
46
- import './plugins/move'
47
- import './plugins/new'
48
42
  import './plugins/node'
49
- import './plugins/open'
50
- import './plugins/panels'
51
43
  import './plugins/pen'
52
- import './plugins/rotate'
53
44
  import './plugins/ruler'
54
45
  import './plugins/saveAs'
55
46
  import './plugins/scroll'
@@ -61,11 +52,11 @@ import './plugins/smartSelection'
61
52
  import './plugins/state'
62
53
  import './plugins/statusbar'
63
54
  import './plugins/test'
64
- import './plugins/text'
65
55
  import './plugins/timeline'
56
+ import './plugins/tool'
66
57
  import './plugins/toolbelt'
67
58
  import './plugins/transform'
68
- import './plugins/ui'
59
+ import './plugins/typography'
69
60
  import './plugins/url'
70
61
  import './plugins/view'
71
62
  import './plugins/zoom'
@@ -0,0 +1,3 @@
1
+ export type DeepMaybe<T> = T extends Function ? T : T extends Array<infer U> ? Array<DeepMaybe<U>> | undefined : T extends object ? {
2
+ [K in keyof T]?: DeepMaybe<T[K]>;
3
+ } : T | undefined;
@@ -1 +1,2 @@
1
1
  export * from './box';
2
+ export * from './helper';
@@ -1,10 +1,31 @@
1
- export interface HandleDragOptions {
2
- threshold?: number;
3
- start?: (event: MouseEvent) => void;
4
- move?: (offset: {
1
+ export interface DragContext {
2
+ [key: string]: any;
3
+ event: MouseEvent;
4
+ dragging: boolean;
5
+ startEvent: MouseEvent;
6
+ startPoint: {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ moveEvent: MouseEvent;
11
+ movePoint: {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ lastPoint: {
5
16
  x: number;
6
17
  y: number;
7
- }, event: MouseEvent) => void;
8
- end?: (event: MouseEvent) => void;
18
+ };
19
+ endEvent: MouseEvent;
20
+ endPoint: {
21
+ x: number;
22
+ y: number;
23
+ };
24
+ }
25
+ export interface DragListenerOptions<T extends DragContext> {
26
+ threshold?: number;
27
+ start?: (ctx: T) => void;
28
+ move?: (ctx: T) => void;
29
+ end?: (ctx: T) => void;
9
30
  }
10
- export declare function handleDrag(downEvent: MouseEvent, options?: HandleDragOptions): void;
31
+ export declare function addDragListener<T extends DragContext>(downEvent: MouseEvent | undefined, options?: DragListenerOptions<T>): () => void;
@@ -1,4 +1,5 @@
1
1
  import type { ComponentInternalInstance, ComponentPublicInstance, InjectionKey, VNodeChild } from 'vue';
2
+ import type { DeepMaybe } from '../types';
2
3
  export declare function noop(..._args: any): void;
3
4
  export declare function isClickInsideElement(event: MouseEvent, targetDiv: HTMLElement): boolean;
4
5
  export interface TemplateRef {
@@ -17,3 +18,4 @@ export declare function toKebabCase(str?: string): string;
17
18
  export declare namespace toKebabCase {
18
19
  var cache: Map<string, string>;
19
20
  }
21
+ export declare function deepMerge<T>(target: T, ...sources: DeepMaybe<T>[]): T;
@@ -6,4 +6,3 @@ export * from './dnd';
6
6
  export * from './helper';
7
7
  export * from './image';
8
8
  export * from './propsFactory';
9
- export * from './random';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.16.7",
4
+ "version": "0.17.1",
5
5
  "description": "A headless infinite canvas editor framework built on WebGL rendering, supports exporting to image, video, and PPT. Only the ESM.",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -56,12 +56,12 @@
56
56
  ],
57
57
  "dependencies": {
58
58
  "@floating-ui/vue": "^1.1.10",
59
- "@vueuse/components": "^14.2.0",
60
- "@vueuse/core": "^14.2.0",
59
+ "@vueuse/components": "^14.2.1",
60
+ "@vueuse/core": "^14.2.1",
61
61
  "diff": "^8.0.3",
62
62
  "file-saver": "^2.0.5",
63
63
  "lodash-es": "^4.17.23",
64
- "modern-canvas": "^0.15.4",
64
+ "modern-canvas": "^0.15.5",
65
65
  "modern-font": "^0.4.4",
66
66
  "modern-idoc": "^0.10.21",
67
67
  "modern-text": "^1.10.15",
@@ -69,7 +69,6 @@
69
69
  },
70
70
  "peerDependencies": {
71
71
  "lottie-web": "^5",
72
- "modern-gif": "^2",
73
72
  "typescript": ">=4.7",
74
73
  "vue": "^3.5.0",
75
74
  "yoga-layout": "^3"
@@ -78,9 +77,6 @@
78
77
  "lottie-web": {
79
78
  "optional": true
80
79
  },
81
- "modern-gif": {
82
- "optional": true
83
- },
84
80
  "typescript": {
85
81
  "optional": true
86
82
  },
@@ -93,10 +89,9 @@
93
89
  "@types/lodash-es": "^4.17.12",
94
90
  "@vitejs/plugin-vue": "^6.0.4",
95
91
  "jiti": "^2.6.1",
96
- "modern-gif": "^2.0.4",
97
92
  "sass-embedded": "^1.97.3",
98
- "typedoc": "^0.28.16",
99
- "typedoc-plugin-markdown": "^4.9.0"
93
+ "typedoc": "^0.28.17",
94
+ "typedoc-plugin-markdown": "^4.10.0"
100
95
  },
101
96
  "scripts": {
102
97
  "build:code": "vite build",
@@ -1,9 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- interface Editor {
4
- bindRenderCanvas: (canvas: HTMLCanvasElement, setEventTarget?: HTMLElement) => () => void;
5
- }
6
- }
7
- }
8
- declare const _default: import("..").Mixin;
9
- export default _default;
@@ -1,21 +0,0 @@
1
- import type { Element2D } from 'modern-canvas';
2
- import type { NormalizedFill, NormalizedFragment } from 'modern-idoc';
3
- import type { Ref } from 'vue';
4
- declare global {
5
- namespace Mce {
6
- interface Editor {
7
- hasTextSelectionRange: Ref<boolean>;
8
- isTextAllSelected: Ref<boolean>;
9
- handleTextSelection: (textSelection: IndexCharacter[], cb: (arg: Record<string, any>) => boolean) => void;
10
- textFontSizeToFit: (element: Element2D, scale?: number) => void;
11
- textToFit: (element: Element2D, typography?: Mce.TypographyStrategy) => void;
12
- getTextStyle: (key: string) => any;
13
- setTextStyle: (key: string, value: any) => void;
14
- getTextFill: () => NormalizedFill | undefined;
15
- setTextFill: (value: NormalizedFill | undefined) => void;
16
- setTextContentByEachFragment: (handler: (fragment: NormalizedFragment) => void) => void;
17
- }
18
- }
19
- }
20
- declare const _default: import("..").Mixin;
21
- export default _default;
@@ -1,25 +0,0 @@
1
- import type { Vector2Like } from 'modern-canvas';
2
- import type { Reactive, Ref } from 'vue';
3
- declare global {
4
- namespace Mce {
5
- interface DrawingTools {
6
- }
7
- type DrawingToolHandle = (position: Vector2Like) => {
8
- move?: (position: Vector2Like) => void;
9
- end?: (position: Vector2Like) => void;
10
- } | void;
11
- interface DrawingTool {
12
- name: string;
13
- handle?: DrawingToolHandle;
14
- }
15
- interface Editor {
16
- drawingTools: Reactive<Map<string, Mce.DrawingTool>>;
17
- activeDrawingTool: Ref<Mce.DrawingTool>;
18
- registerDrawingTool: (tool: Mce.DrawingTool | Mce.DrawingTool[]) => void;
19
- unregisterDrawingTool: (tool: string) => void;
20
- setActiveDrawingTool: (tool: string | keyof DrawingTools | undefined) => void;
21
- }
22
- }
23
- }
24
- declare const _default: import("..").Mixin;
25
- export default _default;
@@ -1,11 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- interface CopyAsOptions extends ExportOptions {
4
- }
5
- interface Commands {
6
- copyAs: (type: keyof Exporters, options?: CopyAsOptions) => Promise<void>;
7
- }
8
- }
9
- }
10
- declare const _default: import("..").Plugin;
11
- export default _default;
@@ -1,12 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- interface Options {
4
- gifWorkerUrl?: string;
5
- }
6
- interface Exporters {
7
- gif: Promise<Blob>;
8
- }
9
- }
10
- }
11
- declare const _default: import("..").Plugin;
12
- export default _default;
@@ -1,20 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- type MoveCommandDirection = 'left' | 'top' | 'right' | 'bottom';
4
- interface Commands {
5
- move: (direction: MoveCommandDirection, distance?: number) => void;
6
- moveLeft: (distance?: number) => void;
7
- moveTop: (distance?: number) => void;
8
- moveRight: (distance?: number) => void;
9
- moveBottom: (distance?: number) => void;
10
- }
11
- interface Hotkeys {
12
- moveLeft: [event: KeyboardEvent];
13
- moveTop: [event: KeyboardEvent];
14
- moveRight: [event: KeyboardEvent];
15
- moveBottom: [event: KeyboardEvent];
16
- }
17
- }
18
- }
19
- declare const _default: import("..").Plugin;
20
- export default _default;
@@ -1,12 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- interface Commands {
4
- new: () => void;
5
- }
6
- interface Hotkeys {
7
- new: [event: KeyboardEvent];
8
- }
9
- }
10
- }
11
- declare const _default: import("..").Plugin;
12
- export default _default;
@@ -1,12 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- interface Commands {
4
- open: () => Promise<void>;
5
- }
6
- interface Hotkeys {
7
- open: [event: KeyboardEvent];
8
- }
9
- }
10
- }
11
- declare const _default: import("..").Plugin;
12
- export default _default;
@@ -1,13 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- interface Panels {
4
- }
5
- interface Config extends Record<keyof Panels, boolean> {
6
- }
7
- interface Commands {
8
- panels: <T extends keyof Panels>(panel: T, ...args: Panels[T]) => Promise<boolean>;
9
- }
10
- }
11
- }
12
- declare const _default: import("..").Plugin;
13
- export default _default;
@@ -1,10 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- interface Commands {
4
- rotate: (deg: number) => void;
5
- rotate90: () => void;
6
- }
7
- }
8
- }
9
- declare const _default: import("..").Plugin;
10
- export default _default;
@@ -1,17 +0,0 @@
1
- import type { Element2D } from 'modern-canvas';
2
- declare global {
3
- namespace Mce {
4
- interface addTextElementOptions extends AddElementOptions {
5
- content?: string;
6
- style?: Record<string, any>;
7
- }
8
- interface Commands {
9
- addTextElement: (options?: addTextElementOptions) => Element2D;
10
- }
11
- interface DrawingTools {
12
- text: [options?: addTextElementOptions];
13
- }
14
- }
15
- }
16
- declare const _default: import("../plugin").Plugin;
17
- export default _default;
@@ -1,20 +0,0 @@
1
- import type { PointerInputEvent } from 'modern-canvas';
2
- declare global {
3
- namespace Mce {
4
- interface PointerDownOptions {
5
- allowTopFrame?: boolean;
6
- }
7
- interface Commands {
8
- pointerDown: (e: PointerInputEvent, options?: PointerDownOptions) => void;
9
- startTyping: (e?: MouseEvent | PointerEvent) => Promise<boolean>;
10
- startTransform: (e?: MouseEvent | PointerEvent) => boolean;
11
- openContextMenu: (e?: MouseEvent | PointerEvent) => boolean;
12
- layerScrollIntoView: () => boolean;
13
- }
14
- interface Events {
15
- pointerMove: [event: PointerEvent];
16
- }
17
- }
18
- }
19
- declare const _default: import("..").Plugin;
20
- export default _default;
@@ -1,3 +0,0 @@
1
- export declare const getRandomValues: <T extends ArrayBufferView>(array: T) => T;
2
- export declare const uint32: () => number;
3
- export declare function uuidv4(): string;
File without changes
File without changes
File without changes