mce 0.13.8 → 0.13.10

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 (35) hide show
  1. package/dist/components/SmartGuides.vue.d.ts +3 -0
  2. package/dist/components/icon/ComponentIcon.d.ts +21 -0
  3. package/dist/components/icon/SvgIcon.d.ts +21 -0
  4. package/dist/components/icon/index.d.ts +3 -0
  5. package/dist/components/icon/makeIconProps.d.ts +9 -0
  6. package/dist/components/shared/FloatPanel.vue.d.ts +2 -2
  7. package/dist/components/shared/Layout.vue.d.ts +1 -1
  8. package/dist/components/shared/LayoutItem.vue.d.ts +1 -1
  9. package/dist/components/shared/Overlay.vue.d.ts +2 -2
  10. package/dist/components/timeline/Trackhead.vue.d.ts +2 -2
  11. package/dist/composables/icon.d.ts +0 -51
  12. package/dist/editor.d.ts +7 -18
  13. package/dist/index.css +298 -298
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.js +5428 -5298
  16. package/dist/mixin.d.ts +3 -0
  17. package/dist/mixins/0.config/base.d.ts +0 -3
  18. package/dist/mixins/0.context.d.ts +1 -0
  19. package/dist/mixins.d.ts +1 -1
  20. package/dist/plugin.d.ts +29 -0
  21. package/dist/plugins/frames.d.ts +2 -0
  22. package/dist/plugins/hover.d.ts +2 -0
  23. package/dist/plugins/layers.d.ts +9 -0
  24. package/dist/plugins/madeWith.d.ts +9 -0
  25. package/dist/plugins/menu.d.ts +1 -1
  26. package/dist/plugins/panels.d.ts +3 -2
  27. package/dist/plugins/ruler.d.ts +9 -0
  28. package/dist/plugins/scroll.d.ts +3 -2
  29. package/dist/plugins/select.d.ts +1 -1
  30. package/dist/plugins/{auxiliary.d.ts → smartGuides.d.ts} +4 -3
  31. package/dist/plugins.d.ts +1 -1
  32. package/dist/typed-plugins.d.ts +6 -1
  33. package/package.json +2 -2
  34. /package/dist/components/{Auxiliary.vue.d.ts → Panels.vue.d.ts} +0 -0
  35. /package/dist/components/{shared → icon}/Icon.vue.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ import type { Editor, Options } from './editor';
2
+ export type Mixin = (editor: Editor, options: Options) => (() => (void | Promise<void>)) | Mixin[] | Record<string, any> | undefined | void;
3
+ export declare function defineMixin(cb: Mixin): Mixin;
@@ -22,9 +22,6 @@ declare global {
22
22
  pixelGrid: boolean;
23
23
  pixelate: boolean;
24
24
  camera: boolean;
25
- ruler: boolean;
26
- scrollbar: boolean;
27
- layers: boolean;
28
25
  timeline: boolean;
29
26
  statusbar: boolean;
30
27
  frameOutline: boolean;
@@ -43,6 +43,7 @@ declare global {
43
43
  stateContext: Ref<StateContext | undefined>;
44
44
  getGlobalPointer: () => Vector2Data;
45
45
  parseAnchor: (anchor: Anchor, isRtl?: boolean) => ParsedAnchor;
46
+ isNode: (value: any) => value is Node;
46
47
  isRoot: (value: any) => value is Node;
47
48
  isElement: (value: any) => value is Element2D;
48
49
  isFrame: (value: any) => value is Element2D;
package/dist/mixins.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const mixins: import("./editor").Mixin[];
1
+ export declare const mixins: import("./mixin").Mixin[];
@@ -0,0 +1,29 @@
1
+ import type { Component } from 'vue';
2
+ import type { Editor, Events, Options } from './editor';
3
+ export interface BasePluginComponent {
4
+ ignore?: () => boolean;
5
+ component: Component;
6
+ }
7
+ export interface PanelPluginComponent extends BasePluginComponent {
8
+ name: string;
9
+ type: 'panel';
10
+ }
11
+ export interface OverlayPluginComponent extends BasePluginComponent {
12
+ type: 'overlay';
13
+ }
14
+ export type PluginComponent = OverlayPluginComponent | PanelPluginComponent;
15
+ export interface PluginObject {
16
+ name: string;
17
+ ignore?: () => boolean;
18
+ events?: {
19
+ [K in keyof Events]: (...args: Events[K]) => void;
20
+ };
21
+ commands?: Mce.Command[];
22
+ hotkeys?: Mce.Hotkey[];
23
+ loaders?: Mce.Loader[];
24
+ exporters?: Mce.Exporter[];
25
+ components?: PluginComponent[];
26
+ setup?: () => void | Promise<void>;
27
+ }
28
+ export type Plugin = PluginObject | ((editor: Editor, options: Options) => PluginObject);
29
+ export declare function definePlugin(cb: Plugin): Plugin;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../plugin").Plugin;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../plugin").Plugin;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ namespace Mce {
3
+ interface Panels {
4
+ layers: [];
5
+ }
6
+ }
7
+ }
8
+ declare const _default: import("../plugin").Plugin;
9
+ export default _default;
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ namespace Mce {
3
+ interface Config {
4
+ madeWith: boolean;
5
+ }
6
+ }
7
+ }
8
+ declare const _default: import("../plugin").Plugin;
9
+ export default _default;
@@ -17,5 +17,5 @@ declare global {
17
17
  }
18
18
  }
19
19
  }
20
- declare const _default: import("..").Plugin;
20
+ declare const _default: import("../plugin").Plugin;
21
21
  export default _default;
@@ -1,12 +1,13 @@
1
1
  declare global {
2
2
  namespace Mce {
3
3
  interface Panels {
4
- layers: [];
4
+ }
5
+ interface Config extends Record<keyof Panels, boolean> {
5
6
  }
6
7
  interface Commands {
7
8
  panel: <T extends keyof Panels>(panel: T, ...args: Panels[T]) => Promise<boolean>;
8
9
  }
9
10
  }
10
11
  }
11
- declare const _default: import("..").Plugin;
12
+ declare const _default: import("../plugin").Plugin;
12
13
  export default _default;
@@ -0,0 +1,9 @@
1
+ declare global {
2
+ namespace Mce {
3
+ interface Config {
4
+ ruler: boolean;
5
+ }
6
+ }
7
+ }
8
+ declare const _default: import("../plugin").Plugin;
9
+ export default _default;
@@ -3,9 +3,10 @@ declare global {
3
3
  interface Commands {
4
4
  scrollToSelection: (options?: ScrollToOptions) => void;
5
5
  }
6
- interface Editor {
6
+ interface Config {
7
+ scrollbar: boolean;
7
8
  }
8
9
  }
9
10
  }
10
- declare const _default: import("..").Plugin;
11
+ declare const _default: import("../plugin").Plugin;
11
12
  export default _default;
@@ -16,5 +16,5 @@ declare global {
16
16
  }
17
17
  }
18
18
  }
19
- declare const _default: import("..").Plugin;
19
+ declare const _default: import("../plugin").Plugin;
20
20
  export default _default;
@@ -2,13 +2,14 @@ import type { ComputedRef } from 'vue';
2
2
  declare global {
3
3
  namespace Mce {
4
4
  interface Editor {
5
- auxiliaryLines: ComputedRef<Record<string, any>[]>;
6
- getAdsorptionPoints: (resizing?: boolean) => {
5
+ snapThreshold: ComputedRef<number>;
6
+ snapLines: ComputedRef<Record<string, any>[]>;
7
+ getSnapPoints: (resizing?: boolean) => {
7
8
  x: number[];
8
9
  y: number[];
9
10
  };
10
11
  }
11
12
  }
12
13
  }
13
- declare const _default: import("..").Plugin;
14
+ declare const _default: import("../plugin").Plugin;
14
15
  export default _default;
package/dist/plugins.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const plugins: import("./editor").Plugin[];
1
+ export declare const plugins: import("./plugin").Plugin[];
@@ -24,29 +24,34 @@ import './mixins/4.4.doc'
24
24
  import './mixins/scroll'
25
25
  import './mixins/snapshot'
26
26
  import './mixins/zoom'
27
- import './plugins/auxiliary'
28
27
  import './plugins/clipboard'
29
28
  import './plugins/copyAs'
30
29
  import './plugins/delete'
31
30
  import './plugins/flip'
31
+ import './plugins/frames'
32
32
  import './plugins/gif'
33
33
  import './plugins/group'
34
34
  import './plugins/history'
35
+ import './plugins/hover'
35
36
  import './plugins/html'
36
37
  import './plugins/image'
37
38
  import './plugins/import'
38
39
  import './plugins/json'
39
40
  import './plugins/layerOrder'
40
41
  import './plugins/layerPosition'
42
+ import './plugins/layers'
41
43
  import './plugins/lock'
44
+ import './plugins/madeWith'
42
45
  import './plugins/menu'
43
46
  import './plugins/move'
44
47
  import './plugins/new'
45
48
  import './plugins/open'
46
49
  import './plugins/panels'
50
+ import './plugins/ruler'
47
51
  import './plugins/saveAs'
48
52
  import './plugins/scroll'
49
53
  import './plugins/select'
54
+ import './plugins/smartGuides'
50
55
  import './plugins/text'
51
56
  import './plugins/ui'
52
57
  import './plugins/url'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.13.8",
4
+ "version": "0.13.10",
5
5
  "description": "The headless canvas editor framework. only the ESM.",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "diff": "^8.0.2",
62
62
  "file-saver": "^2.0.5",
63
63
  "lodash-es": "^4.17.21",
64
- "modern-canvas": "^0.13.1",
64
+ "modern-canvas": "^0.13.2",
65
65
  "modern-font": "^0.4.4",
66
66
  "modern-idoc": "^0.10.5",
67
67
  "modern-text": "^1.10.4",
File without changes