mce 0.1.0 → 0.1.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 (76) hide show
  1. package/dist/components/ProgressIndicator.vue.d.ts +15 -0
  2. package/dist/components/Rulers.vue.d.ts +1 -6
  3. package/dist/components/Selector.vue.d.ts +6 -6
  4. package/dist/components/shared/Icon.vue.d.ts +24 -0
  5. package/dist/components/shared/Menu.vue.d.ts +1 -0
  6. package/dist/components/shared/Ruler.vue.d.ts +14 -4
  7. package/dist/components/shared/Transformable.vue.d.ts +2 -2
  8. package/dist/components/timeline/Playhead.vue.d.ts +3 -0
  9. package/dist/components/timeline/Segment.vue.d.ts +11 -0
  10. package/dist/components/timeline/Timeline.vue.d.ts +3 -0
  11. package/dist/components/timeline/Track.vue.d.ts +13 -0
  12. package/dist/components/timeline/Trackhead.vue.d.ts +7 -0
  13. package/dist/composables/icon.d.ts +105 -0
  14. package/dist/composables/icons.d.ts +22 -0
  15. package/dist/composables/index.d.ts +2 -0
  16. package/dist/editor.d.ts +21 -2
  17. package/dist/iconsets/mdi-svg.d.ts +25 -0
  18. package/dist/index.css +1 -1
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +4121 -3518
  21. package/dist/locale/en.d.ts +75 -0
  22. package/dist/mixins/0.command.d.ts +23 -0
  23. package/dist/{plugins → mixins}/0.config/base.d.ts +3 -1
  24. package/dist/{plugins → mixins}/0.config.d.ts +1 -1
  25. package/dist/{plugins → mixins}/0.context.d.ts +3 -2
  26. package/dist/{plugins → mixins}/0.element.d.ts +1 -1
  27. package/dist/{plugins → mixins}/0.font.d.ts +1 -1
  28. package/dist/mixins/0.locale.d.ts +22 -0
  29. package/dist/{plugins → mixins}/1.frame.d.ts +1 -1
  30. package/dist/{plugins → mixins}/1.hotkey.d.ts +7 -10
  31. package/dist/mixins/1.timeline.d.ts +18 -0
  32. package/dist/{plugins → mixins}/1.upload.d.ts +1 -1
  33. package/dist/{plugins → mixins}/2.box.d.ts +1 -1
  34. package/dist/mixins/2.export/json.d.ts +25 -0
  35. package/dist/mixins/2.export.d.ts +28 -0
  36. package/dist/{plugins/2.loader.d.ts → mixins/2.load.d.ts} +2 -2
  37. package/dist/mixins/2.loader/json.d.ts +2 -0
  38. package/dist/{plugins → mixins}/3.view.d.ts +1 -1
  39. package/dist/{plugins → mixins}/4.0.text.d.ts +1 -1
  40. package/dist/mixins/4.1.lock.d.ts +12 -0
  41. package/dist/{plugins → mixins}/4.2.element.d.ts +1 -8
  42. package/dist/{plugins → mixins}/4.3.frame.d.ts +1 -1
  43. package/dist/{plugins → mixins}/4.4.doc.d.ts +3 -3
  44. package/dist/{plugins → mixins}/snapshot.d.ts +1 -1
  45. package/dist/mixins.d.ts +1 -0
  46. package/dist/plugins/delete.d.ts +12 -0
  47. package/dist/plugins/flip.d.ts +2 -2
  48. package/dist/plugins/{2.exporter/video.d.ts → gif.d.ts} +4 -2
  49. package/dist/plugins/{insert/image.d.ts → image.d.ts} +6 -1
  50. package/dist/plugins/layerOrder.d.ts +19 -0
  51. package/dist/plugins/{4.1.lock.d.ts → lock.d.ts} +0 -6
  52. package/dist/plugins/menu.d.ts +2 -3
  53. package/dist/plugins/{theme.d.ts → mp4.d.ts} +2 -1
  54. package/dist/plugins/{2.exporter/pdf.d.ts → pdf.d.ts} +1 -1
  55. package/dist/plugins/{2.exporter/pptx.d.ts → pptx.d.ts} +1 -1
  56. package/dist/plugins/saveAs.d.ts +1 -4
  57. package/dist/plugins/{insert/text.d.ts → text.d.ts} +1 -1
  58. package/dist/plugins/url.d.ts +2 -0
  59. package/dist/plugins/view.d.ts +18 -0
  60. package/dist/plugins.d.ts +1 -0
  61. package/dist/typed-plugins.d.ts +35 -35
  62. package/package.json +25 -48
  63. package/dist/plugins/0.command.d.ts +0 -27
  64. package/dist/plugins/0.i18n.d.ts +0 -13
  65. package/dist/plugins/2.exporter/0.json.d.ts +0 -10
  66. package/dist/plugins/2.exporter/image.d.ts +0 -11
  67. package/dist/plugins/2.exporter.d.ts +0 -27
  68. package/dist/plugins/2.loader/0.url.d.ts +0 -2
  69. package/dist/plugins/2.loader/image.d.ts +0 -2
  70. package/dist/plugins/2.loader/json.d.ts +0 -2
  71. package/dist/plugins/2.loader/pptx.d.ts +0 -2
  72. package/dist/plugins/2.loader/txt.d.ts +0 -2
  73. package/dist/plugins/arrange.d.ts +0 -19
  74. package/dist/preset-plugins.d.ts +0 -1
  75. /package/dist/components/{Starter.vue.d.ts → Setup.vue.d.ts} +0 -0
  76. /package/dist/plugins/{align.d.ts → layerPosition.d.ts} +0 -0
@@ -2,56 +2,56 @@
2
2
  /* prettier-ignore */
3
3
  // @ts-nocheck
4
4
  // Generated by script. ‼️ DO NOT MODIFY THIS FILE ‼️
5
- import './plugins/0.command'
6
- import './plugins/0.config'
7
- import './plugins/0.config/base'
8
- import './plugins/0.context'
9
- import './plugins/0.element'
10
- import './plugins/0.font'
11
- import './plugins/0.i18n'
12
- import './plugins/1.frame'
13
- import './plugins/1.hotkey'
14
- import './plugins/1.upload'
15
- import './plugins/2.box'
16
- import './plugins/2.exporter'
17
- import './plugins/2.exporter/0.json'
18
- import './plugins/2.exporter/image'
19
- import './plugins/2.exporter/pdf'
20
- import './plugins/2.exporter/pptx'
21
- import './plugins/2.exporter/video'
22
- import './plugins/2.loader'
23
- import './plugins/2.loader/0.url'
24
- import './plugins/2.loader/image'
25
- import './plugins/2.loader/json'
26
- import './plugins/2.loader/pptx'
27
- import './plugins/2.loader/txt'
28
- import './plugins/3.view'
29
- import './plugins/4.0.text'
30
- import './plugins/4.1.lock'
31
- import './plugins/4.2.element'
32
- import './plugins/4.3.frame'
33
- import './plugins/4.4.doc'
34
- import './plugins/align'
35
- import './plugins/arrange'
5
+ import './mixins/0.command'
6
+ import './mixins/0.config'
7
+ import './mixins/0.config/base'
8
+ import './mixins/0.context'
9
+ import './mixins/0.element'
10
+ import './mixins/0.font'
11
+ import './mixins/0.locale'
12
+ import './mixins/1.frame'
13
+ import './mixins/1.hotkey'
14
+ import './mixins/1.timeline'
15
+ import './mixins/1.upload'
16
+ import './mixins/2.box'
17
+ import './mixins/2.export'
18
+ import './mixins/2.export/json'
19
+ import './mixins/2.load'
20
+ import './mixins/2.loader/json'
21
+ import './mixins/3.view'
22
+ import './mixins/4.0.text'
23
+ import './mixins/4.1.lock'
24
+ import './mixins/4.2.element'
25
+ import './mixins/4.3.frame'
26
+ import './mixins/4.4.doc'
27
+ import './mixins/snapshot'
36
28
  import './plugins/auxiliary'
37
29
  import './plugins/clipboard'
30
+ import './plugins/delete'
38
31
  import './plugins/flip'
39
32
  import './plugins/frame'
33
+ import './plugins/gif'
40
34
  import './plugins/group'
41
35
  import './plugins/history'
36
+ import './plugins/image'
42
37
  import './plugins/import'
43
- import './plugins/insert/image'
44
- import './plugins/insert/text'
38
+ import './plugins/layerOrder'
39
+ import './plugins/layerPosition'
40
+ import './plugins/lock'
45
41
  import './plugins/menu'
46
42
  import './plugins/move'
43
+ import './plugins/mp4'
47
44
  import './plugins/new'
48
45
  import './plugins/open'
46
+ import './plugins/pdf'
47
+ import './plugins/pptx'
49
48
  import './plugins/preference'
50
49
  import './plugins/saveAs'
51
50
  import './plugins/select'
52
- import './plugins/snapshot'
53
- import './plugins/theme'
51
+ import './plugins/text'
54
52
  import './plugins/ui'
53
+ import './plugins/url'
54
+ import './plugins/view'
55
55
  import './plugins/visibility'
56
56
  import './plugins/zoom'
57
57
 
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.1.0",
5
- "packageManager": "pnpm@10.18.1",
6
- "description": "Modern canvas editor, based modern-canvas and Vue.js. only the ESM.",
4
+ "version": "0.1.1",
5
+ "description": "The headless canvas editor framework. only the ESM.",
7
6
  "author": "wxm",
8
7
  "license": "MIT",
9
8
  "homepage": "https://github.com/qq15725/mce",
@@ -55,19 +54,18 @@
55
54
  "files": [
56
55
  "dist"
57
56
  ],
58
- "scripts": {
59
- "build:code": "vite build",
60
- "build:tsc": "NODE_ENV=production vue-tsc --emitDeclarationOnly --project tsconfig.build.json",
61
- "build:plugins": "jiti ./scripts/plugins.ts",
62
- "build:dts": "jiti ./scripts/dts.ts",
63
- "build": "pnpm build:code && pnpm build:tsc && pnpm build:dts",
64
- "dev": "MODE=local vite playground",
65
- "lint": "eslint src",
66
- "version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
67
- "release": "bumpp package.json --commit \"release: v%s\" --push --all --tag",
68
- "test": "vitest",
69
- "typecheck": "vue-tsc --noEmit",
70
- "prepare": "simple-git-hooks"
57
+ "dependencies": {
58
+ "@floating-ui/vue": "^1.1.9",
59
+ "@vueuse/components": "^14.0.0",
60
+ "@vueuse/core": "^14.0.0",
61
+ "diff": "^8.0.2",
62
+ "file-saver": "^2.0.5",
63
+ "lodash-es": "^4.17.21",
64
+ "modern-canvas": "^0.12.15",
65
+ "modern-font": "^0.4.4",
66
+ "modern-idoc": "^0.10.4",
67
+ "modern-text": "^1.9.1",
68
+ "yjs": "^13.6.27"
71
69
  },
72
70
  "peerDependencies": {
73
71
  "lottie-web": "^5",
@@ -102,46 +100,25 @@
102
100
  "optional": true
103
101
  }
104
102
  },
105
- "dependencies": {
106
- "@floating-ui/vue": "^1.1.9",
107
- "@vueuse/components": "^13.9.0",
108
- "@vueuse/core": "^13.9.0",
109
- "diff": "^8.0.2",
110
- "file-saver": "^2.0.5",
111
- "lodash-es": "^4.17.21",
112
- "modern-canvas": "^0.12.4",
113
- "modern-font": "^0.4.4",
114
- "modern-idoc": "^0.10.1",
115
- "modern-text": "^1.9.1",
116
- "yjs": "^13.6.27"
117
- },
118
103
  "devDependencies": {
119
- "@antfu/eslint-config": "^6.0.0",
120
104
  "@types/file-saver": "^2.0.7",
121
105
  "@types/lodash-es": "^4.17.12",
122
- "@types/node": "^24.8.1",
123
106
  "@vitejs/plugin-vue": "^6.0.1",
124
- "bumpp": "^10.3.1",
125
- "conventional-changelog-cli": "^5.0.0",
126
- "eslint": "^9.38.0",
127
107
  "jiti": "^2.6.1",
128
- "lint-staged": "^16.2.4",
129
108
  "modern-gif": "^2.0.4",
130
109
  "modern-mp4": "^0.2.0",
131
110
  "modern-openxml": "^1.9.0",
132
111
  "modern-pdf": "^1.3.2",
133
- "sass-embedded": "^1.93.2",
134
- "simple-git-hooks": "^2.13.1",
135
- "typescript": "^5.9.3",
136
- "vite": "^7.1.11",
137
- "vitest": "^3.2.4",
138
- "vue": "^3.5.22",
139
- "vue-tsc": "^3.1.1"
112
+ "sass-embedded": "^1.93.2"
140
113
  },
141
- "simple-git-hooks": {
142
- "pre-commit": "pnpm lint-staged"
143
- },
144
- "lint-staged": {
145
- "*": ""
114
+ "scripts": {
115
+ "build:code": "vite build",
116
+ "build:tsc": "NODE_ENV=production vue-tsc --emitDeclarationOnly --project tsconfig.json",
117
+ "build:preset": "jiti ./scripts/preset.ts",
118
+ "build:dts": "jiti ./scripts/dts.ts",
119
+ "build": "pnpm build:code && pnpm build:tsc && pnpm build:dts",
120
+ "lint": "eslint src",
121
+ "test": "vitest",
122
+ "typecheck": "vue-tsc --noEmit"
146
123
  }
147
- }
124
+ }
@@ -1,27 +0,0 @@
1
- import type { Ref } from 'vue';
2
- declare global {
3
- namespace Mce {
4
- interface Commands {
5
- }
6
- type CommandHandle = (...args: any[]) => any;
7
- type CommandEvents = {
8
- [K in keyof Commands as `command:${K}`]: [ReturnType<Commands[K]>];
9
- };
10
- interface Events extends CommandEvents {
11
- }
12
- interface Editor {
13
- commands: Ref<Map<string, Commands[keyof Commands]>>;
14
- registerCommand: {
15
- <K extends keyof Commands>(key: K, command: Commands[K]): void;
16
- <K extends keyof Commands>(commands: {
17
- key: K;
18
- handle: Commands[K];
19
- }[]): void;
20
- };
21
- unregisterCommand: <K extends keyof Commands = keyof Commands>(key: K) => void;
22
- exec: <K extends keyof Commands>(key: K, ...args: Parameters<Commands[K]>) => ReturnType<Commands[K]>;
23
- }
24
- }
25
- }
26
- declare const _default: import("..").Plugin;
27
- export default _default;
@@ -1,13 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- type Translation = (key: string, fallback?: string) => string;
4
- interface Editor {
5
- t: Translation;
6
- }
7
- interface Options {
8
- t?: Translation;
9
- }
10
- }
11
- }
12
- declare const _default: import("..").Plugin;
13
- export default _default;
@@ -1,10 +0,0 @@
1
- import type { NormalizedDocument } from 'modern-idoc';
2
- declare global {
3
- namespace Mce {
4
- interface Exporters {
5
- json: NormalizedDocument;
6
- }
7
- }
8
- }
9
- declare const _default: import("../..").Plugin;
10
- export default _default;
@@ -1,11 +0,0 @@
1
- declare global {
2
- namespace Mce {
3
- interface Exporters {
4
- png: Blob;
5
- jpeg: Blob;
6
- webp: Blob;
7
- }
8
- }
9
- }
10
- declare const _default: import("../..").Plugin;
11
- export default _default;
@@ -1,27 +0,0 @@
1
- import type { Element2D } from 'modern-canvas';
2
- import type { Ref } from 'vue';
3
- declare global {
4
- namespace Mce {
5
- type ExporterProgress = (current: number, total: number) => void;
6
- interface ExporterOptions {
7
- scale?: number;
8
- selected?: boolean | Element2D[];
9
- onProgress?: ExporterProgress;
10
- }
11
- type Exporter = (options: ExporterOptions) => any | Promise<any>;
12
- interface Editor {
13
- exporters: Ref<Map<string, Exporter>>;
14
- registerExporter: {
15
- (key: string, exporter: Exporter): void;
16
- (exporters: {
17
- key: string;
18
- handle: Exporter;
19
- }[]): void;
20
- };
21
- unregisterExporter: (key: keyof Exporters) => void;
22
- to: <K extends keyof Exporters>(key: K, options?: ExporterOptions) => Exporters[K];
23
- }
24
- }
25
- }
26
- declare const _default: import("..").Plugin;
27
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("../..").Plugin;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("../..").Plugin;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("../..").Plugin;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("../..").Plugin;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("../..").Plugin;
2
- export default _default;
@@ -1,19 +0,0 @@
1
- import type { Element2D } from 'modern-canvas';
2
- declare global {
3
- namespace Mce {
4
- interface Hotkeys {
5
- raiseToFront: [event: KeyboardEvent];
6
- raise: [event: KeyboardEvent];
7
- lower: [event: KeyboardEvent];
8
- lowerToBack: [event: KeyboardEvent];
9
- }
10
- interface Commands {
11
- raiseToFront: (target?: Element2D | Element2D[]) => void;
12
- raise: (target?: Element2D) => void;
13
- lower: (target?: Element2D) => void;
14
- lowerToBack: (target?: Element2D | Element2D[]) => void;
15
- }
16
- }
17
- }
18
- declare const _default: import("..").Plugin;
19
- export default _default;
@@ -1 +0,0 @@
1
- export declare const presetPlugins: import("./editor").Plugin[];
File without changes