dragon-editor 3.2.0 → 3.2.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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "dragon-editor",
3
3
  "configKey": "dragon-editor",
4
- "version": "3.2.0"
4
+ "version": "3.2.2"
5
5
  }
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, addComponent, addTypeTemplate, installModule } from '@nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addComponent, addTypeTemplate, installModule, addPluginTemplate } from '@nuxt/kit';
2
2
 
3
3
  const module = defineNuxtModule({
4
4
  meta: {
@@ -20,6 +20,11 @@ const module = defineNuxtModule({
20
20
  write: true
21
21
  });
22
22
  await installModule("@pinia/nuxt");
23
+ addPluginTemplate({
24
+ src: resolver.resolve("./runtime/plugin.mjs"),
25
+ filename: "hljs.plugin.mjs"
26
+ });
27
+ nuxt.options.build.transpile.push("highlight.js");
23
28
  }
24
29
  });
25
30
 
@@ -0,0 +1,2 @@
1
+ declare function _default(nuxtApp: any): void;
2
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import hljs from "highlight.js";
2
+
3
+ export default (nuxtApp) => {
4
+ nuxtApp.vueApp.provide("hljs", hljs);
5
+ nuxtApp.provide("hljs", hljs);
6
+ };
@@ -37,10 +37,12 @@ export const useEditorStore = defineStore("editorStore", {
37
37
  this.controlBar.$element = value;
38
38
  },
39
39
  controlBarActive() {
40
- const currentRect = this.$currentBlock.getBoundingClientRect();
41
- this.controlBar.active = true;
42
- this.controlBar.x = Math.floor(currentRect.x + currentRect.width / 2);
43
- this.controlBar.y = Math.floor(currentRect.y - 50);
40
+ if (this.$currentBlock !== null) {
41
+ const currentRect = this.$currentBlock.getBoundingClientRect();
42
+ this.controlBar.active = true;
43
+ this.controlBar.x = Math.floor(currentRect.x + currentRect.width / 2);
44
+ this.controlBar.y = Math.floor(currentRect.y - 50);
45
+ }
44
46
  },
45
47
  controlBarDeactive() {
46
48
  this.controlBar.active = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dragon-editor",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "Javascript WYSIWYG editor in Nuxt3!",
5
5
  "repository": {
6
6
  "type": "git",