@umoteam/umo-editor-nuxt 0.0.2 → 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.
package/README.md CHANGED
@@ -25,7 +25,12 @@ Umo Editor 最大的特点是代码完全开源且自主可控,支持私有部
25
25
  Umo Editor is an open-source document editor based on Vue3 and Tiptap. It provides powerful document editing capabilities and AI-assisted creation features. Umo Editor supports pagination, Markdown syntax, rich text editing, insertion of various node types, page style settings, document export, and printing. Additionally, it supports custom extensions, multi-language settings, and a dark theme.
26
26
 
27
27
  Umo Editor's largest feature is that its code is completely open source and controllable. It supports private deployment, allowing you to use it in an intranet environment without worrying about data security issues. At the same time, Umo Editor is based on Vue3 and Tiptap, both of which have rich ecosystems and communities, making it easy to solve problems when needed.
28
- ![Umo Editor](https://unpkg.com/@umoteam/editor-external@latest/static/umo-editor-en@2x.png)
28
+
29
+ ![umo editor](https://s2.umodoc.com/images/umo-editor1-en@2x.png)
30
+
31
+ ![umo editor](https://s2.umodoc.com/images/umo-editor2-en@2x.png)
32
+
33
+ ![umo editor](https://s2.umodoc.com/images/umo-editor3-en@2x.png)
29
34
 
30
35
  As an independent Vue3 plugin, Umo Editor can be easily integrated into various Vue3 projects with zero configuration. For non-Vue3 projects, you can embed Umo Editor into your project via an iframe.
31
36
 
@@ -71,4 +76,4 @@ const options = ref({
71
76
  </script>
72
77
  ```
73
78
 
74
- That's it! You can now use Umo Editor in your Nuxt App ✨
79
+ That's it! You can now use Umo Editor in your Nuxt4 App ✨
package/dist/module.d.mts CHANGED
@@ -1,3 +1,9 @@
1
- declare const _default: any;
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface UmoEditorOptions {
4
+ [key: string]: any;
5
+ }
6
+ declare const _default: _nuxt_schema.NuxtModule<UmoEditorOptions, UmoEditorOptions, false>;
2
7
 
3
8
  export { _default as default };
9
+ export type { UmoEditorOptions };
@@ -0,0 +1,9 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface UmoEditorOptions {
4
+ [key: string]: any;
5
+ }
6
+ declare const _default: _nuxt_schema.NuxtModule<UmoEditorOptions, UmoEditorOptions, false>;
7
+
8
+ export { _default as default };
9
+ export type { UmoEditorOptions };
package/dist/module.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
- "name": "umo-editor",
2
+ "name": "@umoteam/umo-editor-nuxt",
3
3
  "configKey": "umoEditor",
4
4
  "compatibility": {
5
- "nuxt": "^3.0.0"
5
+ "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "0.0.2",
7
+ "version": "0.1.1",
8
8
  "builder": {
9
- "@nuxt/module-builder": "1.0.1",
10
- "unbuild": "3.5.0"
9
+ "@nuxt/module-builder": "1.0.2",
10
+ "unbuild": "3.6.1"
11
11
  }
12
12
  }
package/dist/module.mjs CHANGED
@@ -1,50 +1,82 @@
1
- import { defineNuxtModule, createResolver, addPluginTemplate } from '@nuxt/kit';
2
- import serialize from 'serialize-javascript';
1
+ import { defineNuxtModule, createResolver, addPlugin, addComponent } from '@nuxt/kit';
3
2
 
4
- const module = defineNuxtModule({
3
+ const module$1 = defineNuxtModule({
5
4
  meta: {
6
- name: "umo-editor",
5
+ name: "@umoteam/umo-editor-nuxt",
7
6
  configKey: "umoEditor",
8
7
  compatibility: {
9
- nuxt: "^3.0.0"
8
+ nuxt: ">=4.0.0"
10
9
  }
11
10
  },
12
- defaults: {},
13
- setup(_options, _nuxt) {
14
- const resolver = createResolver(import.meta.url);
15
- const runtimeDir = resolver.resolve("./runtime");
16
- const options = serialize(_options, {});
11
+ defaults: {
12
+ locale: "en-US"
13
+ },
14
+ async setup(moduleOptions, nuxt) {
17
15
  const alias = {
18
16
  "dayjs": "dayjs",
19
17
  "debug": "debug",
20
18
  "@braintree/sanitize-url": "@braintree/sanitize-url",
21
19
  "ndarray": "ndarray",
22
- "highlight.js": "highlight.js",
23
20
  "jsbarcode": "jsbarcode",
24
21
  "file-saver": "file-saver",
25
22
  "dom-to-image-more": "dom-to-image-more",
26
23
  "nzh": "nzh",
27
- "qrcode-svg": "qrcode-svg",
28
- "@tiptap-extend/columns": "@tiptap-extend/columns",
29
- "file64": "file64"
24
+ "pure-svg-code": "pure-svg-code",
25
+ "file64": "file64",
26
+ "highlight.js": "highlight.js",
27
+ "plyr": "plyr"
30
28
  };
31
- _nuxt.options.alias = {
32
- ..._nuxt.options.alias,
29
+ nuxt.options.alias = {
30
+ ...nuxt.options.alias,
33
31
  ...alias
34
32
  };
35
- addPluginTemplate({
36
- filename: "umo-editor.js",
37
- getContents() {
38
- return `import { defineNuxtPlugin } from '#imports';
39
- import UmoEditor from '${runtimeDir}/components'
40
-
41
- export default defineNuxtPlugin(({ vueApp }) => {
42
- vueApp.config.globalProperties.$umoEditorOptions = ${options}
43
- vueApp.component('UmoEditor', UmoEditor)
44
- })`;
45
- }
33
+ nuxt.options.vite ||= {};
34
+ nuxt.options.vite.optimizeDeps ||= {};
35
+ nuxt.options.vite.optimizeDeps.include ||= [];
36
+ const optimizeInclude = nuxt.options.vite.optimizeDeps.include;
37
+ if (!optimizeInclude.includes("@tiptap-extend/columns")) {
38
+ optimizeInclude.push("@tiptap-extend/columns");
39
+ }
40
+ nuxt.options.vite.optimizeDeps.esbuildOptions ||= {};
41
+ if (nuxt.options.vite.optimizeDeps.esbuildOptions.sourcemap == null) {
42
+ nuxt.options.vite.optimizeDeps.esbuildOptions.sourcemap = false;
43
+ }
44
+ const publicRuntimeConfig = nuxt.options.runtimeConfig.public ||= {};
45
+ const existingConfig = publicRuntimeConfig.umoEditor ||= {};
46
+ publicRuntimeConfig.umoEditor = {
47
+ ...existingConfig,
48
+ ...moduleOptions
49
+ };
50
+ if (!nuxt.options.build.transpile.includes("@umoteam/editor")) {
51
+ nuxt.options.build.transpile.push("@umoteam/editor");
52
+ }
53
+ const resolver = createResolver(import.meta.url);
54
+ addPlugin(resolver.resolve("./runtime/plugin.client"));
55
+ addComponent({
56
+ name: "UmoEditor",
57
+ export: "UmoEditor",
58
+ filePath: "@umoteam/editor",
59
+ mode: "client"
60
+ });
61
+ addComponent({
62
+ name: "UmoDialog",
63
+ export: "UmoDialog",
64
+ filePath: "@umoteam/editor",
65
+ mode: "client"
66
+ });
67
+ addComponent({
68
+ name: "UmoMenuButton",
69
+ export: "UmoMenuButton",
70
+ filePath: "@umoteam/editor",
71
+ mode: "client"
72
+ });
73
+ addComponent({
74
+ name: "UmoTooltip",
75
+ export: "UmoTooltip",
76
+ filePath: "@umoteam/editor",
77
+ mode: "client"
46
78
  });
47
79
  }
48
80
  });
49
81
 
50
- export { module as default };
82
+ export { module$1 as default };
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { defineNuxtPlugin, useRuntimeConfig } from "#app";
2
+ import { useUmoEditor } from "@umoteam/editor";
3
+ export default defineNuxtPlugin((nuxtApp) => {
4
+ const runtimeConfig = useRuntimeConfig();
5
+ nuxtApp.vueApp.use(useUmoEditor, runtimeConfig.public.umoEditor || {});
6
+ });
package/dist/types.d.mts CHANGED
@@ -5,3 +5,5 @@ import type { default as Module } from './module.mjs'
5
5
  export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
6
 
7
7
  export { default } from './module.mjs'
8
+
9
+ export { type UmoEditorOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,15 +1,21 @@
1
1
  {
2
2
  "name": "@umoteam/umo-editor-nuxt",
3
- "version": "0.0.2",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "private": false,
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
4
9
  "author": {
5
10
  "name": "umodoc",
6
11
  "email": "contact@umodoc.com",
7
12
  "url": "https://www.umodoc.com"
8
13
  },
9
- "description": "Quickly integrate Umo editor into your Nuxt3 applications",
10
- "repository": "umodoc/umo-editor-nuxt",
11
- "license": "MIT",
12
- "type": "module",
14
+ "description": "Quickly integrate Umo editor into your Nuxt4 applications",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/umodoc/editor-nuxt.git"
18
+ },
13
19
  "keywords": [
14
20
  "umo editor",
15
21
  "umo editor nuxt",
@@ -30,6 +36,7 @@
30
36
  "tiptap",
31
37
  "nuxt module"
32
38
  ],
39
+ "license": "MIT",
33
40
  "homepage": "https://editor.umodoc.com/en/docs",
34
41
  "exports": {
35
42
  ".": {
@@ -38,34 +45,39 @@
38
45
  }
39
46
  },
40
47
  "main": "./dist/module.mjs",
41
- "types": "./dist/types.d.mts",
48
+ "typesVersions": {
49
+ "*": {
50
+ ".": [
51
+ "./dist/types.d.mts"
52
+ ]
53
+ }
54
+ },
42
55
  "files": [
43
56
  "dist"
44
57
  ],
45
58
  "scripts": {
46
- "prepack": "nuxt-module-build build",
47
- "dev": "nuxi dev playground",
48
- "dev:build": "nuxi build playground",
49
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
50
- "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
51
- "lint": "eslint ."
59
+ "dev:prepare": "nuxt build-module --build --stub && nuxt prepare playground",
60
+ "dev": "nuxt dev playground",
61
+ "prepack": "nuxt build-module --build",
62
+ "typecheck": "nuxt build-module --build --stub",
63
+ "lint": "eslint .",
64
+ "test": "vitest run"
52
65
  },
53
66
  "dependencies": {
54
- "@nuxt/kit": "^3.17.4",
55
- "@umoteam/editor": "latest",
56
- "serialize-javascript": "^6.0.2"
67
+ "@nuxt/kit": "^4.0.0",
68
+ "@umoteam/editor": "latest"
57
69
  },
58
70
  "devDependencies": {
59
- "@nuxt/devtools": "^2.4.1",
60
- "@nuxt/eslint-config": "^1.4.1",
61
- "@nuxt/module-builder": "^1.0.1",
62
- "@nuxt/schema": "^3.17.4",
63
- "@types/node": "latest",
64
- "changelogen": "^0.6.1",
65
- "eslint": "^9.27.0",
66
- "nuxt": "^3.17.4",
67
- "typescript": "~5.8.3",
68
- "vitest": "^3.1.4",
69
- "vue-tsc": "^2.2.10"
71
+ "@eslint/js": "^9.19.0",
72
+ "@nuxt/module-builder": "^1.0.0",
73
+ "@types/node": "^22.13.5",
74
+ "eslint": "^9.19.0",
75
+ "nuxt": "^4.0.0",
76
+ "typescript": "^5.7.3",
77
+ "unbuild": "^3.3.1",
78
+ "vitest": "^2.1.8"
79
+ },
80
+ "peerDependencies": {
81
+ "nuxt": ">=4.0.0"
70
82
  }
71
83
  }
@@ -1,13 +0,0 @@
1
- <script setup>
2
- import { useNuxtApp } from "#imports";
3
- import { UmoEditor } from "@umoteam/editor";
4
- defineOptions({ name: "UmoEditor" });
5
- const { vueApp } = useNuxtApp();
6
- const options = vueApp.config.globalProperties.$umoEditorOptions;
7
- </script>
8
-
9
- <template>
10
- <client-only>
11
- <umo-editor v-bind="options" />
12
- </client-only>
13
- </template>
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- export default _default;