@vmz/plugin-codemirror 0.2.3 → 0.2.5

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.
@@ -1,33 +1,32 @@
1
1
  <template>
2
- <div class="codemirror-host" data-vmz-codemirror style="min-height: 200px; width: 100%"></div>
2
+ <div data-vmz-codemirror class="codemirror-host" style="min-height: 200px; width: 100%" />
3
3
  </template>
4
-
5
4
  <script client>
6
- import { mountCodemirror } from '@vmz/plugin-codemirror/runtime';
5
+ import { mountCodemirror } from "@vmz/plugin-codemirror/runtime";
7
6
 
8
7
  export default class Codemirror {
9
- public value: string = '';
8
+ public value: string = "";
10
9
 
11
- #api: { dispose: () => void } | null = null;
10
+ #api: { dispose: () => void } | null = null;
12
11
 
13
- async onMount() {
14
- const root = this.__vmzDomRoot;
15
- const el =
16
- (root && root.nodeType === 1 && root.matches?.('[data-vmz-codemirror]') && root) ||
17
- root?.querySelector?.('[data-vmz-codemirror]') ||
18
- root;
19
- if (!el || el.nodeType !== 1) return;
20
- this.#api = await mountCodemirror(el, {
21
- value: this.value,
22
- onChange: (v) => {
23
- this.value = v;
24
- },
25
- });
26
- }
12
+ async onMount() {
13
+ const root = this.__vmzDomRoot;
14
+ const el =
15
+ (root && root.nodeType === 1 && root.matches?.("[data-vmz-codemirror]") && root) ||
16
+ root?.querySelector?.("[data-vmz-codemirror]") ||
17
+ root;
18
+ if (!el || el.nodeType !== 1) return;
19
+ this.#api = await mountCodemirror(el, {
20
+ value: this.value,
21
+ onChange: (v) => {
22
+ this.value = v;
23
+ },
24
+ });
25
+ }
27
26
 
28
- onDestroy() {
29
- this.#api?.dispose();
30
- this.#api = null;
31
- }
27
+ onDestroy() {
28
+ this.#api?.dispose();
29
+ this.#api = null;
30
+ }
32
31
  }
33
32
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vmz/plugin-codemirror",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "description": "VMZ CodeMirror 6 editor adapter - <Codemirror>",
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@vmz/plugin": "0.2.3"
20
+ "@vmz/plugin": "0.2.5"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "codemirror": ">=6",