@anweb/nuxt-aneditor 0.1.1 → 0.1.2

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
@@ -1,81 +1,81 @@
1
- # AnEditor — WYSIWYG markdown editor for Nuxt
2
-
3
- [![npm version][npm-version-src]][npm-version-href]
4
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
- [![Nuxt][nuxt-src]][nuxt-href]
6
-
7
- Visual WYSIWYG editor with markdown output. Toolbar, keyboard shortcuts, tables, lists, images, YouTube embeds, undo/redo.
8
-
9
- ## Setup
10
-
11
- ```bash
12
- npm i @anweb/nuxt-aneditor
13
- ```
14
-
15
- ```ts
16
- export default defineNuxtConfig({
17
- modules: ['@anweb/nuxt-aneditor']
18
- })
19
- ```
20
-
21
- ## Components
22
-
23
- | Name | Description |
24
- |---|---|
25
- | `AnEditor` | WYSIWYG editor with toolbar, markdown v-model |
26
- | `AnEditorViewer` | Read-only markdown renderer |
27
-
28
- ## AnEditor Props
29
-
30
- | Prop | Type | Default | Description |
31
- |---|---|---|---|
32
- | `modelValue` | `string` | `''` | Markdown content (v-model) |
33
- | `placeholder` | `string` | `''` | Placeholder text |
34
- | `upload` | `(file: File) => Promise<string>` | — | Image upload function, returns URL |
35
- | `disabled` | `boolean` | `false` | Disable editing |
36
-
37
- ## AnEditor Exposed
38
-
39
- | Method | Description |
40
- |---|---|
41
- | `focus()` | Focus the editor |
42
- | `clear()` | Clear all content |
43
-
44
- ## AnEditorViewer Props
45
-
46
- | Prop | Type | Description |
47
- |---|---|---|
48
- | `content` | `string` | Markdown string to render |
49
-
50
- ## Keyboard Shortcuts
51
-
52
- | Shortcut | Action |
53
- |---|---|
54
- | `Ctrl+B` | Bold |
55
- | `Ctrl+I` | Italic |
56
- | `Ctrl+K` | Insert link |
57
- | `Ctrl+Z` | Undo |
58
- | `Ctrl+Shift+Z` | Redo |
59
- | `Tab` | Indent list item |
60
- | `Shift+Tab` | Outdent list item |
61
-
62
- ## CSS Variables
63
-
64
- | Variable | Default | Description |
65
- |---|---|---|
66
- | `--an-editor-border` | `#e0e0e0` | Border color |
67
- | `--an-editor-border-focus` | `#7c83ff` | Focus border color |
68
- | `--an-editor-background` | `#fff` | Editor background |
69
- | `--an-editor-toolbar-background` | `#fafafa` | Toolbar background |
70
- | `--an-editor-font-size` | `15px` | Content font size |
71
- | `--an-editor-min-height` | `200px` | Minimum editor height |
72
-
73
- <!-- Badges -->
74
- [npm-version-src]: https://img.shields.io/npm/v/@anweb/nuxt-aneditor/latest.svg?style=flat&colorA=020420&colorB=00DC82
75
- [npm-version-href]: https://npmjs.com/package/@anweb/nuxt-aneditor
76
-
77
- [npm-downloads-src]: https://img.shields.io/npm/dm/@anweb/nuxt-aneditor.svg?style=flat&colorA=020420&colorB=00DC82
78
- [npm-downloads-href]: https://npm.chart.dev/@anweb/nuxt-aneditor
79
-
80
- [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
1
+ # AnEditor — WYSIWYG markdown editor for Nuxt
2
+
3
+ [![npm version][npm-version-src]][npm-version-href]
4
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
+ [![Nuxt][nuxt-src]][nuxt-href]
6
+
7
+ Visual WYSIWYG editor with markdown output. Toolbar, keyboard shortcuts, tables, lists, images, YouTube embeds, undo/redo.
8
+
9
+ ## Setup
10
+
11
+ ```bash
12
+ npm i @anweb/nuxt-aneditor
13
+ ```
14
+
15
+ ```ts
16
+ export default defineNuxtConfig({
17
+ modules: ['@anweb/nuxt-aneditor']
18
+ })
19
+ ```
20
+
21
+ ## Components
22
+
23
+ | Name | Description |
24
+ |---|---|
25
+ | `AnEditor` | WYSIWYG editor with toolbar, markdown v-model |
26
+ | `AnEditorViewer` | Read-only markdown renderer |
27
+
28
+ ## AnEditor Props
29
+
30
+ | Prop | Type | Default | Description |
31
+ |---|---|---|---|
32
+ | `modelValue` | `string` | `''` | Markdown content (v-model) |
33
+ | `placeholder` | `string` | `''` | Placeholder text |
34
+ | `upload` | `(file: File) => Promise<string>` | — | Image upload function, returns URL |
35
+ | `disabled` | `boolean` | `false` | Disable editing |
36
+
37
+ ## AnEditor Exposed
38
+
39
+ | Method | Description |
40
+ |---|---|
41
+ | `focus()` | Focus the editor |
42
+ | `clear()` | Clear all content |
43
+
44
+ ## AnEditorViewer Props
45
+
46
+ | Prop | Type | Description |
47
+ |---|---|---|
48
+ | `content` | `string` | Markdown string to render |
49
+
50
+ ## Keyboard Shortcuts
51
+
52
+ | Shortcut | Action |
53
+ |---|---|
54
+ | `Ctrl+B` | Bold |
55
+ | `Ctrl+I` | Italic |
56
+ | `Ctrl+K` | Insert link |
57
+ | `Ctrl+Z` | Undo |
58
+ | `Ctrl+Shift+Z` | Redo |
59
+ | `Tab` | Indent list item |
60
+ | `Shift+Tab` | Outdent list item |
61
+
62
+ ## CSS Variables
63
+
64
+ | Variable | Default | Description |
65
+ |---|---|---|
66
+ | `--an-editor-border` | `#e0e0e0` | Border color |
67
+ | `--an-editor-border-focus` | `#7c83ff` | Focus border color |
68
+ | `--an-editor-background` | `#fff` | Editor background |
69
+ | `--an-editor-toolbar-background` | `#fafafa` | Toolbar background |
70
+ | `--an-editor-font-size` | `15px` | Content font size |
71
+ | `--an-editor-min-height` | `200px` | Minimum editor height |
72
+
73
+ <!-- Badges -->
74
+ [npm-version-src]: https://img.shields.io/npm/v/@anweb/nuxt-aneditor/latest.svg?style=flat&colorA=020420&colorB=00DC82
75
+ [npm-version-href]: https://npmjs.com/package/@anweb/nuxt-aneditor
76
+
77
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@anweb/nuxt-aneditor.svg?style=flat&colorA=020420&colorB=00DC82
78
+ [npm-downloads-href]: https://npm.chart.dev/@anweb/nuxt-aneditor
79
+
80
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
81
81
  [nuxt-href]: https://nuxt.com
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "AnEditor",
3
3
  "configKey": "aneditor",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addComponent, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const module$1 = defineNuxtModule({
4
4
  meta: {
@@ -18,8 +18,24 @@ const module$1 = defineNuxtModule({
18
18
  ..._nuxt.options.icon.customCollections || [],
19
19
  { prefix: "aneditor", dir: resolve("./runtime/assets/icons") }
20
20
  ];
21
- addComponentsDir({
22
- path: resolve("./runtime/components")
21
+ addComponent({
22
+ name: "AnEditor",
23
+ filePath: resolve("./runtime/components/AnEditor/Editor.vue"),
24
+ mode: "client"
25
+ });
26
+ addComponent({
27
+ name: "AnEditorToolbar",
28
+ filePath: resolve("./runtime/components/AnEditor/Toolbar.vue"),
29
+ mode: "client"
30
+ });
31
+ addComponent({
32
+ name: "AnEditorPrompt",
33
+ filePath: resolve("./runtime/components/AnEditor/Prompt.vue"),
34
+ mode: "client"
35
+ });
36
+ addComponent({
37
+ name: "AnEditorViewer",
38
+ filePath: resolve("./runtime/components/AnEditor/Viewer.vue")
23
39
  });
24
40
  addImportsDir(resolve("./runtime/composables"));
25
41
  addImportsDir(resolve("./runtime/utils"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anweb/nuxt-aneditor",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "AnEditor Nuxt module — WYSIWYG markdown editor",
5
5
  "repository": "https://github.com/ANLTD/aneditor",
6
6
  "license": "MIT",