@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 +1 -1
- package/dist/module.mjs +3 -19
- package/dist/runtime/components/AnEditor/{Editor.vue → Editor.client.vue} +2 -2
- package/dist/runtime/composables/useImage.d.ts +1 -1
- package/dist/runtime/composables/useImage.js +1 -1
- package/package.json +1 -1
- /package/dist/runtime/components/AnEditor/{Editor.vue.d.ts → Editor.client.vue.d.ts} +0 -0
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver,
|
|
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
|
-
|
|
22
|
-
|
|
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,
|
|
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 =
|
|
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
|
|
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
|
|
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
|
File without changes
|