@umoteam/umo-editor-nuxt 0.0.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 ADDED
@@ -0,0 +1,71 @@
1
+ # Umo Editor Nuxt
2
+
3
+ <p style="text-align: center; margin: 2rem 0;">
4
+ <a href="https://umodoc.com" target="_blank"><img src="https://unpkg.com/@umoteam/editor-external@latest/static/logo.svg" alt="umodoc.com" width="280" /></a>
5
+ </p>
6
+
7
+ <p style="text-align: center;">
8
+ <a href="https://github.com/umodoc/editor/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/npm/l/@umoteam/editor" /></a>
9
+ <a href="https://www.npmjs.com/package/@umoteam/editor" target="_blank"><img src="https://img.shields.io/npm/v/@umoteam/editor" /></a>
10
+ <a href="https://www.npmjs.com/package/@umoteam/editor" target="_blank"><img src="https://img.shields.io/npm/d18m/@umoteam/editor" /></a>
11
+ <a href="https://www.npmjs.com/package/@umoteam/editor" target="_blank"><img src="https://img.shields.io/npm/unpacked-size/%40umoteam%2Feditor" /></a>
12
+ <a href="https://github.com/umodoc/editor/commits" target="_blank"><img src="https://img.shields.io/github/commit-activity/m/umodoc/editor" /></a>
13
+ </p>
14
+
15
+ A powerful integration that brings the full capabilities of Umo Editor to your Nuxt3 applications.
16
+
17
+ # 中文介绍
18
+
19
+ Umo Editor 是一个基于 Vue3 和 Tiptap 的本土化开源文档编辑器,专为国人用户设计。它提供了强大的文档编辑能力和 AI 创作功能,支持分页模式、Markdown 语法、富文本编辑、多种格式的节点插入、页面样式设置、文档导出与打印等功能。此外,Umo Editor 还支持自定义扩展、多语言设置和暗色主题。
20
+
21
+ Umo Editor 最大的特点是代码完全开源且自主可控,支持私有部署,您可以内网环境中使用,而无需担心数据安全问题。同时 Umo Editor 基于 Vue3 和 Tiptap,两者都有丰富的生态系统和社区支持,在遇到问题时可以迅速得到解决。
22
+
23
+ ## Introduction
24
+
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
+
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)
29
+
30
+ 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
+
32
+ [Documentation](https://editor.umodoc.com/en/docs) | [中文文档](https://editor.umodoc.com/cn/docs) | [Playground](https://demo.umodoc.com/editor?lang=en-US) | [GitHub](https://github.com/umodoc/editor) | [NPM](https://www.npmjs.com/package/@umoteam/editor)
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ npx nuxi module add umo-editor-nuxt
38
+ ```
39
+
40
+ ## Usage
41
+
42
+ 1. Install and Configure the module
43
+ ```ts
44
+ // nuxt.config.ts
45
+ export default defineNuxtConfig({
46
+ modules: ['@umoteam/umo-editor-nuxt'],
47
+ umoEditor: {
48
+ // Global configuration, see default options at:
49
+ // https://editor.umodoc.com/en/docs/options/default
50
+ locale: 'en-US',
51
+ },
52
+ })
53
+ ```
54
+
55
+ 2. Use the Umo Editor component in your pages
56
+ ```vue
57
+ <template>
58
+ <div style="height: 600px;">
59
+ <UmoEditor />
60
+ </div>
61
+ </template>
62
+
63
+ <script setup>
64
+ const options = $ref({
65
+ // Configuration options, see:
66
+ // https://editor.umodoc.com/en/docs/options/default
67
+ })
68
+ </script>
69
+ ```
70
+
71
+ That's it! You can now use Umo Editor in your Nuxt app ✨
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+
3
+ export { _default as default };
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "umo-editor",
3
+ "configKey": "umoEditor",
4
+ "compatibility": {
5
+ "nuxt": "^3.0.0"
6
+ },
7
+ "version": "0.0.1",
8
+ "builder": {
9
+ "@nuxt/module-builder": "1.0.1",
10
+ "unbuild": "3.5.0"
11
+ }
12
+ }
@@ -0,0 +1,50 @@
1
+ import { defineNuxtModule, createResolver, addPluginTemplate } from '@nuxt/kit';
2
+ import serialize from 'serialize-javascript';
3
+
4
+ const module = defineNuxtModule({
5
+ meta: {
6
+ name: "umo-editor",
7
+ configKey: "umoEditor",
8
+ compatibility: {
9
+ nuxt: "^3.0.0"
10
+ }
11
+ },
12
+ defaults: {},
13
+ setup(_options, _nuxt) {
14
+ const resolver = createResolver(import.meta.url);
15
+ const runtimeDir = resolver.resolve("./runtime");
16
+ const options = serialize(_options, {});
17
+ const alias = {
18
+ "dayjs": "dayjs",
19
+ "debug": "debug",
20
+ "@braintree/sanitize-url": "@braintree/sanitize-url",
21
+ "ndarray": "ndarray",
22
+ "highlight.js": "highlight.js",
23
+ "jsbarcode": "jsbarcode",
24
+ "file-saver": "file-saver",
25
+ "dom-to-image-more": "dom-to-image-more",
26
+ "nzh": "nzh",
27
+ "qrcode-svg": "qrcode-svg",
28
+ "@tiptap-extend/columns": "@tiptap-extend/columns",
29
+ "file64": "file64"
30
+ };
31
+ _nuxt.options.alias = {
32
+ ..._nuxt.options.alias,
33
+ ...alias
34
+ };
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
+ }
46
+ });
47
+ }
48
+ });
49
+
50
+ export { module as default };
@@ -0,0 +1,13 @@
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>
@@ -0,0 +1,2 @@
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;
@@ -0,0 +1,7 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
2
+
3
+ import type { default as Module } from './module.mjs'
4
+
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
+
7
+ export { default } from './module.mjs'
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@umoteam/umo-editor-nuxt",
3
+ "version": "0.0.1",
4
+ "author": {
5
+ "name": "umodoc",
6
+ "email": "contact@umodoc.com",
7
+ "url": "https://www.umodoc.com"
8
+ },
9
+ "description": "Quickly integrate Umo editor into your Nuxt3 applications",
10
+ "repository": "umodoc/umo-editor-nuxt",
11
+ "license": "MIT",
12
+ "type": "module",
13
+ "keywords": [
14
+ "umo editor",
15
+ "umodoc editor",
16
+ "document editor",
17
+ "docs editor",
18
+ "word editor",
19
+ "office edtior",
20
+ "web editor",
21
+ "richtext editor",
22
+ "wysiwyg editor",
23
+ "vue editor",
24
+ "vue3 editor",
25
+ "ai editor",
26
+ "editor",
27
+ "web office",
28
+ "online office",
29
+ "tiptap",
30
+ "nuxt module"
31
+ ],
32
+ "homepage": "https://editor.umodoc.com/en/docs",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/types.d.mts",
36
+ "import": "./dist/module.mjs"
37
+ }
38
+ },
39
+ "main": "./dist/module.mjs",
40
+ "types": "./dist/types.d.mts",
41
+ "files": [
42
+ "dist"
43
+ ],
44
+ "scripts": {
45
+ "prepack": "nuxt-module-build build",
46
+ "dev": "nuxi dev playground",
47
+ "dev:build": "nuxi build playground",
48
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
49
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
50
+ "lint": "eslint ."
51
+ },
52
+ "dependencies": {
53
+ "@nuxt/kit": "^3.17.4",
54
+ "@umoteam/editor": "latest",
55
+ "serialize-javascript": "^6.0.2"
56
+ },
57
+ "devDependencies": {
58
+ "@nuxt/devtools": "^2.4.1",
59
+ "@nuxt/eslint-config": "^1.4.1",
60
+ "@nuxt/module-builder": "^1.0.1",
61
+ "@nuxt/schema": "^3.17.4",
62
+ "@types/node": "latest",
63
+ "changelogen": "^0.6.1",
64
+ "eslint": "^9.27.0",
65
+ "nuxt": "^3.17.4",
66
+ "typescript": "~5.8.3",
67
+ "vitest": "^3.1.4",
68
+ "vue-tsc": "^2.2.10"
69
+ }
70
+ }