@anweb/nuxt-aneditor 0.1.2 → 0.1.4

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "AnEditor",
3
3
  "configKey": "aneditor",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
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, addComponent, addImportsDir } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
2
 
3
3
  const module$1 = defineNuxtModule({
4
4
  meta: {
@@ -18,24 +18,8 @@ const module$1 = defineNuxtModule({
18
18
  ..._nuxt.options.icon.customCollections || [],
19
19
  { prefix: "aneditor", dir: resolve("./runtime/assets/icons") }
20
20
  ];
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")
21
+ addComponentsDir({
22
+ path: resolve("./runtime/components")
39
23
  });
40
24
  addImportsDir(resolve("./runtime/composables"));
41
25
  addImportsDir(resolve("./runtime/utils"));
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import { ref, computed, watch, onMounted } from "vue";
3
3
  import { useEventListener, useFileDialog, useDebounceFn, useThrottleFn } from "@vueuse/core";
4
- import { useTemplateRef, parseMarkdown, toMarkdown, extractYouTubeId, useAnDialogs, useSelection, useHistory, useBlocks, useTable, useImage, useList } from "#imports";
4
+ import { useTemplateRef, parseMarkdown, toMarkdown, extractYouTubeId, useAnDialogs, useSelection, useHistory, useBlocks, useTable, useEditorImage, useList } from "#imports";
5
5
  import { AnEditorToolbar, AnEditorPrompt } from "#components";
6
6
  const emit = defineEmits(["update:modelValue"]);
7
7
  const props = defineProps({
@@ -42,7 +42,7 @@ const syncToModel = () => {
42
42
  const history = useHistory(refContent, selection);
43
43
  const blocks = useBlocks(refContent, selection, syncToModel);
44
44
  const table = useTable(refContent, syncToModel);
45
- const image = useImage(refContent, syncToModel);
45
+ const image = useEditorImage(refContent, syncToModel);
46
46
  const list = useList(refContent, selection, syncToModel, blocks.ensureBlockWrapped, blocks.isInsideCodeBlock);
47
47
  const focus = () => {
48
48
  refContent.value?.focus();
@@ -1,5 +1,5 @@
1
1
  import { type Ref } from 'vue';
2
- export declare const useImage: (refContent: Ref<HTMLDivElement | null>, syncToModel: () => void) => {
2
+ export declare const useEditorImage: (refContent: Ref<HTMLDivElement | null>, syncToModel: () => void) => {
3
3
  activeImage: Ref<{
4
4
  img: HTMLImageElement;
5
5
  figure: HTMLElement;
@@ -1,6 +1,6 @@
1
1
  import { ref, computed, nextTick, onScopeDispose } from "vue";
2
2
  import { useThrottleFn } from "@vueuse/core";
3
- export const useImage = (refContent, syncToModel) => {
3
+ export const useEditorImage = (refContent, syncToModel) => {
4
4
  const activeImage = ref(null);
5
5
  const imageResizing = ref(null);
6
6
  const createImageElement = (url, alt = "") => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anweb/nuxt-aneditor",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "AnEditor Nuxt module — WYSIWYG markdown editor",
5
5
  "repository": "https://github.com/ANLTD/aneditor",
6
6
  "license": "MIT",