vue-codemirror6 1.0.2 → 1.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,201 @@
1
+ ### Changelog
2
+
3
+ All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4
+
5
+ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
+
7
+ #### [1.1.0](https://github.com/logue/vue-codemirror6/compare/1.0.3...1.1.0)
8
+
9
+ > 31 October 2022
10
+
11
+ - Rewrite the demo code with Vue3 setup. [`fdc7e3c`](https://github.com/logue/vue-codemirror6/commit/fdc7e3c172ff8f1710a74459b1ed7da70420b732)
12
+ - Fixed wrong typing of computed value. [`9b5a572`](https://github.com/logue/vue-codemirror6/commit/9b5a572c5a18bfd3cf9cd5f4c0b0866efab9e893)
13
+ - Add CHANGELOG.md. [`1de388f`](https://github.com/logue/vue-codemirror6/commit/1de388f5126a6afeaec250adefc82bc709251bbd)
14
+
15
+ #### [1.0.3](https://github.com/logue/vue-codemirror6/compare/1.0.2...1.0.3)
16
+
17
+ > 12 October 2022
18
+
19
+ - Update dependencies. [`7f096da`](https://github.com/logue/vue-codemirror6/commit/7f096da24bfc50c9f2932cac6ad023d3982281bf)
20
+ - Update demo code. [`ac33441`](https://github.com/logue/vue-codemirror6/commit/ac33441c2886664c11a91b5b838db74220f0b565)
21
+ - Fixed vite.config.docs.ts. [`b13628a`](https://github.com/logue/vue-codemirror6/commit/b13628aeaa29df6c525b899776ae7706cdf800bc)
22
+
23
+ #### [1.0.2](https://github.com/logue/vue-codemirror6/compare/1.0.1...1.0.2)
24
+
25
+ > 15 September 2022
26
+
27
+ - Enabled to specify HTML tags used in components. [`9b9eecd`](https://github.com/logue/vue-codemirror6/commit/9b9eecdb4da434295bf176c4c17d832871aba927)
28
+
29
+ #### [1.0.1](https://github.com/logue/vue-codemirror6/compare/1.0.0...1.0.1)
30
+
31
+ > 8 September 2022
32
+
33
+ - Update dependencies. [`f3631d0`](https://github.com/logue/vue-codemirror6/commit/f3631d0c3c00a07ba8e69916116db1d611397fb9)
34
+ - Disable drop console. [`e27b9ef`](https://github.com/logue/vue-codemirror6/commit/e27b9efea75180b3c6031c8e3a06c2bd5cee228b)
35
+
36
+ ### [1.0.0](https://github.com/logue/vue-codemirror6/compare/0.6.8...1.0.0)
37
+
38
+ > 20 August 2022
39
+
40
+ - Fixed editable and readonly toggle. [`97ac1bf`](https://github.com/logue/vue-codemirror6/commit/97ac1bf8b24775daefb58af91c318771ea355c8d)
41
+ - 1.0 [`4493c74`](https://github.com/logue/vue-codemirror6/commit/4493c744d38002fbca943f43b14985a3ae2c592c)
42
+
43
+ #### [0.6.8](https://github.com/logue/vue-codemirror6/compare/0.6.5...0.6.8)
44
+
45
+ > 1 August 2022
46
+
47
+ - Unify props monitoring process. [`15b8a17`](https://github.com/logue/vue-codemirror6/commit/15b8a171cec652a03800fc9b53c9f3c5b78f74bf)
48
+ - Fixed an error around linter. [`b2fe3db`](https://github.com/logue/vue-codemirror6/commit/b2fe3dba9f6edd3167edeeff08f34139e444ecd7)
49
+ - Fixed dispatch may be executed multiple times when the value of prop is changed. [`2e19316`](https://github.com/logue/vue-codemirror6/commit/2e193168876e7e0da06695e68176433fd328c0b7)
50
+
51
+ #### [0.6.5](https://github.com/logue/vue-codemirror6/compare/0.6.4...0.6.5)
52
+
53
+ > 4 July 2022
54
+
55
+ - Remove banner from source code. [`043e0ed`](https://github.com/logue/vue-codemirror6/commit/043e0ed0769c0b3bf52777e0d64199e713377418)
56
+ - Delete unnecessary cursor movement processing and assignment processing. [`c89fd00`](https://github.com/logue/vue-codemirror6/commit/c89fd0020e241dca2d8292511a2b55ffbece5a82)
57
+
58
+ #### [0.6.4](https://github.com/logue/vue-codemirror6/compare/0.6.0...0.6.4)
59
+
60
+ > 28 June 2022
61
+
62
+ - Fixed a bug that the cursor may move to a strange place when inputting. [`9977976`](https://github.com/logue/vue-codemirror6/commit/9977976678fda8a268a5c998f6bb95bdf0b86a1e)
63
+ - Changed the logic when assigning text values to CodeMirror. [`313e701`](https://github.com/logue/vue-codemirror6/commit/313e70196573f9365519a7558cbc0f05c193a000)
64
+ - Fixed the problem that the definition file was omitted because the binary output by analyze was given to npm. [`503a52e`](https://github.com/logue/vue-codemirror6/commit/503a52ef7c5077241b72909ee27afb262b52312e)
65
+
66
+ #### [0.6.0](https://github.com/logue/vue-codemirror6/compare/0.5.5...0.6.0)
67
+
68
+ > 9 June 2022
69
+
70
+ - Added minimal prop. [`d454d25`](https://github.com/logue/vue-codemirror6/commit/d454d257c1fd04b765f5fdb555b240395fe030b5)
71
+ - Migrate to CodeMirror 6.0.0. [`50cb696`](https://github.com/logue/vue-codemirror6/commit/50cb696dcc3af61d77a7e74ef37041d20bfb71fc)
72
+ - Add methods jsdoc and manual. [`44975eb`](https://github.com/logue/vue-codemirror6/commit/44975ebedf76d1179ab2c1835e9f16b8e583a64a)
73
+
74
+ #### [0.5.5](https://github.com/logue/vue-codemirror6/compare/0.5.4...0.5.5)
75
+
76
+ > 8 June 2022
77
+
78
+ - Urgent release. [`7db9007`](https://github.com/logue/vue-codemirror6/commit/7db9007886b5daeea94f7986d256291911b7a55c)
79
+
80
+ #### [0.5.4](https://github.com/logue/vue-codemirror6/compare/0.5.3...0.5.4)
81
+
82
+ > 31 May 2022
83
+
84
+ - Fixed a bug that the cursor goes to a strange place when inputting. [`81af5b2`](https://github.com/logue/vue-codemirror6/commit/81af5b2e950cd972bfe540621fb75a6a8e18d544)
85
+
86
+ #### [0.5.3](https://github.com/logue/vue-codemirror6/compare/0.5.2...0.5.3)
87
+
88
+ > 31 May 2022
89
+
90
+ - Fixed an issue where parent-to-child binding did not work properly. [`d355f2c`](https://github.com/logue/vue-codemirror6/commit/d355f2c7de4437360fdbf021029506d6cce4adba)
91
+ - Changed the implementation to call the extension directly with a function. [`98d338f`](https://github.com/logue/vue-codemirror6/commit/98d338f05a48922529f15f9d706f9614447ff1cb)
92
+ - The initial value of linter is set to simple undefined. [`6cec8b0`](https://github.com/logue/vue-codemirror6/commit/6cec8b000ce18a44a4077c375285a45df2993931)
93
+
94
+ #### [0.5.2](https://github.com/logue/vue-codemirror6/compare/0.5.1...0.5.2)
95
+
96
+ > 30 May 2022
97
+
98
+ - Simplify extension processing. [`cd875ff`](https://github.com/logue/vue-codemirror6/commit/cd875ffdeffa072c6abb5b4e3964298bd490b582)
99
+ - Since lintGutter is displayed even for components for which linter is not specified, lintGutter is made an option. [`ab16cbb`](https://github.com/logue/vue-codemirror6/commit/ab16cbb1472a5b29c572279a303a4baa593f4eb3)
100
+ - Fixed innerText is undefined error. [`6466784`](https://github.com/logue/vue-codemirror6/commit/64667849779d0511a472cf8d116ecef8e51f1db8)
101
+
102
+ #### [0.5.1](https://github.com/logue/vue-codemirror6/compare/0.5.0...0.5.1)
103
+
104
+ > 28 May 2022
105
+
106
+ - Fixed linter bug. [`03013b4`](https://github.com/logue/vue-codemirror6/commit/03013b44ce89ba455acafaceac68b2084fe364cf)
107
+
108
+ #### [0.5.0](https://github.com/logue/vue-codemirror6/compare/0.3.7...0.5.0)
109
+
110
+ > 27 May 2022
111
+
112
+ - The output program is compatible with both Vue2 and Vue3.☺ [`7571423`](https://github.com/logue/vue-codemirror6/commit/7571423b0b4f6150300b184b3fc765cb3bf2e21b)
113
+
114
+ #### [0.3.7](https://github.com/logue/vue-codemirror6/compare/0.3.6...0.3.7)
115
+
116
+ > 26 May 2022
117
+
118
+ - Change the formatting settings. [`42188a5`](https://github.com/logue/vue-codemirror6/commit/42188a5de4ddf1163789cdc2fbd255ed19487fad)
119
+ - Update documents. [`5a78106`](https://github.com/logue/vue-codemirror6/commit/5a7810681c786020afdac8f5d8da8d15f8ad802c)
120
+ - Update docs. [`15d7f8e`](https://github.com/logue/vue-codemirror6/commit/15d7f8e7e1edda995420485160cb9cfd4980fe74)
121
+
122
+ #### [0.3.6](https://github.com/logue/vue-codemirror6/compare/0.3.2...0.3.6)
123
+
124
+ > 19 May 2022
125
+
126
+ - Rename serve.vue to DemoPage.vue. [`3ba582b`](https://github.com/logue/vue-codemirror6/commit/3ba582b6fa24259b49d1f123b79db185ab7e077a)
127
+ - Fixed an issue where CodeMirror may not work properly during initial display. [`8092b64`](https://github.com/logue/vue-codemirror6/commit/8092b64039e9a3340624ca4e347151609c933a12)
128
+ - Add basic and tab props. [`54eace6`](https://github.com/logue/vue-codemirror6/commit/54eace641678967163fdf93d051181f701167e0e)
129
+
130
+ #### [0.3.2](https://github.com/logue/vue-codemirror6/compare/0.3.0...0.3.2)
131
+
132
+ > 6 April 2022
133
+
134
+ - When building with vue3, it doesn't work with vue2, so build with vue2. [`87be702`](https://github.com/logue/vue-codemirror6/commit/87be702b278df9cf0f5b26bb8307f7a6d592fd73)
135
+ - Rewrite the wrapper part. [`1e77661`](https://github.com/logue/vue-codemirror6/commit/1e776619bb5f711a789bbe758d10142725de39aa)
136
+ - Update sample. [`f7ed0a5`](https://github.com/logue/vue-codemirror6/commit/f7ed0a507175b6c0d79cf6be55fbd317c5c999b6)
137
+
138
+ #### [0.3.0](https://github.com/logue/vue-codemirror6/compare/0.1.7...0.3.0)
139
+
140
+ > 29 March 2022
141
+
142
+ #### [0.1.7](https://github.com/logue/vue-codemirror6/compare/0.1.6...0.1.7)
143
+
144
+ > 26 May 2022
145
+
146
+ - Change Lint settings. [`89558c1`](https://github.com/logue/vue-codemirror6/commit/89558c1ad3a11bc5bd4ee55a11d6bd58022c99eb)
147
+
148
+ #### [0.1.6](https://github.com/logue/vue-codemirror6/compare/0.1.2...0.1.6)
149
+
150
+ > 19 May 2022
151
+
152
+ - Follow changes in the master branch [`d7a9e3f`](https://github.com/logue/vue-codemirror6/commit/d7a9e3f9cfd7580bb78c29f96e1f2c84d77d5801)
153
+ - Follow Vue3 version. [`1867c6c`](https://github.com/logue/vue-codemirror6/commit/1867c6c18fdc10f331e1dace37c5773242069150)
154
+ - Since past values may be included, nextTick processing was added to onMouted. [`dac2bdd`](https://github.com/logue/vue-codemirror6/commit/dac2bdd1ea935141ed25b93c9882f6ecc871099e)
155
+
156
+ #### [0.1.2](https://github.com/logue/vue-codemirror6/compare/0.1.0...0.1.2)
157
+
158
+ > 6 April 2022
159
+
160
+ - Squashed commit of the following: [`db4abdd`](https://github.com/logue/vue-codemirror6/commit/db4abdddda262a7fa4f69f028b423d13442cec68)
161
+ - When building with vue3, it doesn't work with vue2, so build with vue2. [`87be702`](https://github.com/logue/vue-codemirror6/commit/87be702b278df9cf0f5b26bb8307f7a6d592fd73)
162
+ - Rewrite the wrapper part. [`1e77661`](https://github.com/logue/vue-codemirror6/commit/1e776619bb5f711a789bbe758d10142725de39aa)
163
+
164
+ #### [0.1.0](https://github.com/logue/vue-codemirror6/compare/0.0.6...0.1.0)
165
+
166
+ > 18 March 2022
167
+
168
+ - Update Samples. (run `yarn run dev`) [`f658c65`](https://github.com/logue/vue-codemirror6/commit/f658c654f2910a133914f2fa0fdc8206dadb7232)
169
+ - Fixed IME probrem. [`7a42e63`](https://github.com/logue/vue-codemirror6/commit/7a42e63f75748039ebb082732fe46cd7967f32d7)
170
+
171
+ #### [0.0.6](https://github.com/logue/vue-codemirror6/compare/0.0.5...0.0.6)
172
+
173
+ > 17 March 2022
174
+
175
+ - Fixed d.ts file destination. [`2cd9cdf`](https://github.com/logue/vue-codemirror6/commit/2cd9cdf3f0658d62ae434600e4e8cda14c407a47)
176
+
177
+ #### [0.0.5](https://github.com/logue/vue-codemirror6/compare/0.0.4...0.0.5)
178
+
179
+ > 17 March 2022
180
+
181
+ - Fixed a bug that the cursor position may be at the top when entering a key. [`e7f5407`](https://github.com/logue/vue-codemirror6/commit/e7f5407c76185cc805c10fc0366c5e6dff5f44f6)
182
+
183
+ #### [0.0.4](https://github.com/logue/vue-codemirror6/compare/0.0.2...0.0.4)
184
+
185
+ > 16 February 2022
186
+
187
+ - Update demo code. [`599fa5f`](https://github.com/logue/vue-codemirror6/commit/599fa5f4d87cc7783c98f56a9436a314b368fb64)
188
+ - Removed code that depends on other libraries from the output code. [`7d9e383`](https://github.com/logue/vue-codemirror6/commit/7d9e383c17f31ed8721f94711e7cd1dc595f9e07)
189
+ - Add demo code. [`3e06ef7`](https://github.com/logue/vue-codemirror6/commit/3e06ef70f5ed30fce5a6cb72add2b41fea2745fe)
190
+
191
+ #### [0.0.2](https://github.com/logue/vue-codemirror6/compare/0.0.1...0.0.2)
192
+
193
+ > 14 February 2022
194
+
195
+ - Update package.json. Fixed typing settings. [`12ead23`](https://github.com/logue/vue-codemirror6/commit/12ead23c53c0a5ebc5a68c3bee7b192b587efafc)
196
+
197
+ #### 0.0.1
198
+
199
+ > 10 February 2022
200
+
201
+ - Initial commit. [`b410884`](https://github.com/logue/vue-codemirror6/commit/b41088482f82615e9380e6231a59a39387d172a2)
package/README.md CHANGED
@@ -5,8 +5,11 @@
5
5
  [![Open in unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/vue-codemirror6/file/README.md)
6
6
  [![npm version](https://img.shields.io/npm/v/vue-codemirror6.svg)](https://www.npmjs.com/package/vue-codemirror6)
7
7
  [![Open in Gitpod](https://shields.io/badge/Open%20in-Gitpod-green?logo=Gitpod)](https://gitpod.io/#https://github.com/logue/vue-codemirror6)
8
+ [![Twitter Follow](https://img.shields.io/twitter/follow/logue256?style=plastic)](https://twitter.com/logue256)
8
9
 
9
- A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. Unrelated to [surmon-china's vue-codemirror](https://github.com/surmon-china/vue-codemirror), it is for CodeMirror6.
10
+ A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. This component works in both Vue2 and Vue3.
11
+
12
+ - [CHANGELOG](./CHANGELOG.md)
10
13
 
11
14
  ## Usage
12
15
 
@@ -14,36 +17,37 @@ A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. Unrelat
14
17
  yarn add vue-codemirror6 codemirror
15
18
  ```
16
19
 
17
- This component can handle bidirectional binding by `v-model` like a general Vue component.
18
-
19
- When using with Vue <2.6, [@vue/composition-api](https://www.npmjs.com/package/@vue/composition-api) is required separately.
20
+ For Vue 2.7 or below, [@vue/composition-api](https://www.npmjs.com/package/@vue/composition-api) is required separately.
20
21
 
21
22
  ```sh
22
23
  yarn add vue-codemirror6 @vue/composition-api
23
24
  ```
24
25
 
25
- For Vue 2.7 or later, import vue directly like Vue3.
26
-
27
- ### Props
28
-
29
- | Props | Type | Information |
30
- | ---------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
31
- | basic | boolean | Use [basicSetup](https://codemirror.net/docs/ref/#codemirror.basicSetup). |
32
- | minimal | boolean | Use [miniSetup](https://codemirror.net/docs/ref/#codemirror.minimalSetup). If a `basic` prop is also specified, that setting will take precedence. |
33
- | dark | boolean | Toggle Darkmode. |
34
- | wrap | boolean | Line text wrapping. see [lineWrapping](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping). |
35
- | tab | boolean | Enables tab indentation. |
36
- | theme | { [selector: string]: StyleSpec } | Specify the theme. For example, if you use [@codemirror/theme-one-dark](https://github.com/codemirror/theme-one-dark), import `oneDark` and put it in this prop. |
37
- | readonly | boolean | Makes the cursor visible or you can drag the text but not edit the value. |
38
- | editable | boolean | When this is set to false, it is similar to `readonly`, except that the cursor is not displayed like the normal pre tag. |
39
- | lang | LanguageSupport | The language you want to have syntax highlighting. see <https://codemirror.net/6/#languages> |
40
- | phrases | Record&lt;string, string&gt; | Specify here if you want to make the displayed character string multilingual. see <https://codemirror.net/6/examples/translate/> |
41
- | extensions | Extension[] | Includes enhancements to extend CodeMirror. |
42
- | linter | LintSource | Set Linter. Enter a linter (eg `esLint([arbitrary rule])` function for `@codemirror/lang-javascript`, `jsonParseLinter()`function for`@codemirror/json`). See the sources for various language libraries for more information. |
43
- | lintGutter | boolean | Display 🔴 on the line where there was an error when `linter` was specified. It will not work if `linter` is not specified. |
44
- | tag | string | HTML tags used in the component. (Default is `div` tag.) |
45
-
46
- Notice: `lang` and `linter` can also be set together in `extensions`. This is defined for usability compatibility with past CodeMirrors.
26
+ This component can handle bidirectional binding by `v-model` like a general Vue component.
27
+
28
+ ## Props
29
+
30
+ | Props | Type | Information |
31
+ | ------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
32
+ | basic | boolean | Use [basicSetup](https://codemirror.net/docs/ref/#codemirror.basicSetup). |
33
+ | minimal | boolean | Use [miniSetup](https://codemirror.net/docs/ref/#codemirror.minimalSetup). If a `basic` prop is also specified, that setting will take precedence. |
34
+ | dark | boolean | Toggle Darkmode. |
35
+ | placeholder | string | Add placeholder text when blank |
36
+ | wrap | boolean | Line text wrapping. see [lineWrapping](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping). |
37
+ | tab | boolean | Enables tab indentation. |
38
+ | theme | { [selector: string]: StyleSpec } | Specify the theme. For example, if you use [@codemirror/theme-one-dark](https://github.com/codemirror/theme-one-dark), import `oneDark` and put it in this prop. |
39
+ | readonly | boolean | Makes the cursor visible or you can drag the text but not edit the value. |
40
+ | disabled | boolean | This is the reversed value of the CodeMirror editable. Similar to `readonly`, but setting this value to true disables dragging. |
41
+ | lang | LanguageSupport | The language you want to have syntax highlighting. see <https://codemirror.net/6/#languages> |
42
+ | phrases | Record&lt;string, string&gt; | Specify here if you want to make the displayed character string multilingual. see <https://codemirror.net/6/examples/translate/> |
43
+ | extensions | Extension[] | Includes enhancements to extend CodeMirror. |
44
+ | linter | LintSource | Set Linter. Enter a linter (eg `esLint([arbitrary rule])` function for `@codemirror/lang-javascript`, `jsonParseLinter()`function for`@codemirror/json`). See the sources for various language libraries for more information. |
45
+ | linterConfig | Object | see <https://codemirror.net/docs/ref/#lint.linter^config> |
46
+ | gutter | boolean | Display 🔴 on the line where there was an error when `linter` was specified. It will not work if `linter` is not specified. |
47
+ | gutterConfig | Object | see <https://codemirror.net/docs/ref/#lint.lintGutter^config> |
48
+ | tag | string | HTML tags used in the component. (Default is `div` tag.) |
49
+
50
+ ⚠ Notice: `lang` and `linter` can also be set together in `extensions`. These are separated for compatibility with previous versions of CodeMirror settings and for typing props.
47
51
 
48
52
  ### Supported Languages
49
53
 
@@ -152,8 +156,8 @@ import { ref, defineComponent, type Ref } from 'vue';
152
156
  import CodeMirror from 'vue-codemirror6';
153
157
 
154
158
  // CodeMirror extensions
155
- import type { LanguageSupport } from '@codemirror/language';
156
159
  import { markdown as md } from '@codemirror/lang-markdown';
160
+ import type { LanguageSupport } from '@codemirror/language';
157
161
  import type { Extension } from '@codemirror/state';
158
162
  import type { ViewUpdate } from '@codemirror/view';
159
163
 
@@ -164,6 +168,7 @@ export default defineComponent({
164
168
  setup() {
165
169
  /**
166
170
  * Get Vuetify instance
171
+ *
167
172
  * @see {@link https://github.com/logue/vite-vue2-vuetify-ts-starter | vite-vue2-vuetify-ts-starter}
168
173
  */
169
174
  const vuetify = useVuetify();
@@ -244,12 +249,13 @@ export default defineComponent({
244
249
 
245
250
  ## Events
246
251
 
247
- | Event | Description |
248
- | ------- | ------------------------------------------------------------------------------------------------------------- |
249
- | ready | When CodeMirror loaded. |
250
- | focus | When focus changed. |
251
- | update | When CodeMirror state changed. Returns [ViewUpdate](https://codemirror.net/docs/ref/#view.ViewUpdate) object. |
252
- | changed | Value changed. (Please implement with `v-model` unless there is a special reason.) |
252
+ | Event | Description |
253
+ | --------------- | ------------------------------------------------------------------------------------------------------------- |
254
+ | ready | When CodeMirror loaded. |
255
+ | focus | When focus changed. |
256
+ | update | When CodeMirror state changed. Returns [ViewUpdate](https://codemirror.net/docs/ref/#view.ViewUpdate) object. |
257
+ | changed | Value changed. (Please implement with `v-model` unless there is a special reason.) |
258
+ | diagnosticCount | Returns the number of active lint diagnostics in the given state. (Only when `linter` prop is specified) |
253
259
 
254
260
  ## Methods
255
261
 
package/dist/Meta.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type MetaInterface from '@/interfaces/MetaInterface';
2
+ declare const meta: MetaInterface;
3
+ export default meta;
4
+ //# sourceMappingURL=Meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Meta.d.ts","sourceRoot":"","sources":["../src/Meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAG5D,QAAA,MAAM,IAAI,EAAE,aAGX,CAAC;AACF,eAAe,IAAI,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type ObjectEmitsOptions, type PropType, type Ref, type SetupContext } from 'vue-demi';
1
+ import { type ObjectEmitsOptions, type PropType, type Ref, type SetupContext, type WritableComputedRef } from 'vue-demi';
2
2
  import { EditorSelection, EditorState } from '@codemirror/state';
3
3
  import { EditorView } from '@codemirror/view';
4
4
  import type { Extension, SelectionRange, Text } from '@codemirror/state';
@@ -18,10 +18,12 @@ export interface CodeMirrorEmitsOptions extends ObjectEmitsOptions {
18
18
  (e: 'ready', value: {
19
19
  view: EditorView;
20
20
  state: EditorState;
21
- container: HTMLDivElement;
21
+ container: HTMLElement;
22
22
  }): void;
23
- /** onChanged (same as update:modelValue) */
24
- (e: 'changed', value: string | Text): void;
23
+ /** onChange (same as update:modelValue) */
24
+ (e: 'change', value: string | Text): void;
25
+ /** CodeMirror linter active diagnostic aount */
26
+ (e: 'diagnosticCount', value: number): void;
25
27
  }
26
28
  /** CodeMirror Component */
27
29
  declare const _default: import("vue-demi").DefineComponent<{
@@ -64,9 +66,18 @@ declare const _default: import("vue-demi").DefineComponent<{
64
66
  type: BooleanConstructor;
65
67
  default: boolean;
66
68
  };
69
+ /**
70
+ * Placeholder
71
+ */
72
+ placeholder: {
73
+ type: StringConstructor;
74
+ default: undefined;
75
+ };
67
76
  /**
68
77
  * Line wrapping
69
78
  *
79
+ * An extension that enables line wrapping in the editor (by setting CSS white-space to pre-wrap in the content).
80
+ *
70
81
  * @see {@link https://codemirror.net/6/docs/ref/#view.EditorView%5ElineWrapping | LineWrapping}
71
82
  */
72
83
  wrap: {
@@ -74,7 +85,7 @@ declare const _default: import("vue-demi").DefineComponent<{
74
85
  default: boolean;
75
86
  };
76
87
  /**
77
- * Tab handling
88
+ * Allow tab key indent.
78
89
  *
79
90
  * @see {@link https://codemirror.net/6/examples/tab/ | Tab Handling}
80
91
  */
@@ -92,11 +103,14 @@ declare const _default: import("vue-demi").DefineComponent<{
92
103
  default: boolean;
93
104
  };
94
105
  /**
95
- * Editable
106
+ * Disable input.
107
+ *
108
+ * This is the reversed value of the CodeMirror editable.
109
+ * Similar to `readonly`, but setting this value to true disables dragging.
96
110
  *
97
111
  * @see {@link https://codemirror.net/6/docs/ref/#view.EditorView%5Eeditable | editable}
98
112
  */
99
- editable: {
113
+ disabled: {
100
114
  type: BooleanConstructor;
101
115
  default: boolean;
102
116
  };
@@ -136,12 +150,37 @@ declare const _default: import("vue-demi").DefineComponent<{
136
150
  type: PropType<LintSource>;
137
151
  default: undefined;
138
152
  };
139
- /** Show Gutter */
140
- lintGutter: {
153
+ /**
154
+ * Linter Config
155
+ *
156
+ * @see {@link https://codemirror.net/docs/ref/#lint.linter^config}
157
+ */
158
+ linterConfig: {
159
+ type: ObjectConstructor;
160
+ default: () => void;
161
+ };
162
+ /**
163
+ * Show Linter Gutter
164
+ *
165
+ * An area to 🔴 the lines with errors will be displayed.
166
+ * This feature is not enabled if `linter` is not specified.
167
+ */
168
+ gutter: {
141
169
  type: BooleanConstructor;
142
170
  defalt: boolean;
143
171
  };
144
- /** Using tag */
172
+ /**
173
+ * Gutter Config
174
+ *
175
+ * @see {@link https://codemirror.net/docs/ref/#lint.lintGutter^config}
176
+ */
177
+ gutterConfig: {
178
+ type: ObjectConstructor;
179
+ default: () => void;
180
+ };
181
+ /**
182
+ * Using tag
183
+ */
145
184
  tag: {
146
185
  type: StringConstructor;
147
186
  default: string;
@@ -149,10 +188,10 @@ declare const _default: import("vue-demi").DefineComponent<{
149
188
  }, {
150
189
  context: SetupContext<CodeMirrorEmitsOptions>;
151
190
  editor: Ref<HTMLElement | undefined>;
152
- cursor: Ref<number>;
153
- selection: Ref<EditorSelection>;
154
- state: Ref<EditorState>;
155
- focus: Ref<boolean>;
191
+ cursor: WritableComputedRef<number>;
192
+ selection: WritableComputedRef<EditorSelection>;
193
+ state: WritableComputedRef<EditorState>;
194
+ focus: WritableComputedRef<boolean>;
156
195
  getRange: (from?: number, to?: number) => string;
157
196
  getLine: (number: number) => string;
158
197
  lineCount: () => number;
@@ -167,7 +206,7 @@ declare const _default: import("vue-demi").DefineComponent<{
167
206
  setSelection: (anchor: number, head?: number) => void;
168
207
  setSelections: (ranges: readonly SelectionRange[], primary?: number) => void;
169
208
  extendSelectionsBy: (f: Function) => void;
170
- }, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, CodeMirrorEmitsOptions, "update:modelValue" | "update" | "focus" | "ready" | "changed", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
209
+ }, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, CodeMirrorEmitsOptions, "update:modelValue" | "update" | "focus" | "ready" | "diagnosticCount" | "changed", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
171
210
  /** Model value */
172
211
  modelValue: {
173
212
  type: PropType<string | Text>;
@@ -207,9 +246,18 @@ declare const _default: import("vue-demi").DefineComponent<{
207
246
  type: BooleanConstructor;
208
247
  default: boolean;
209
248
  };
249
+ /**
250
+ * Placeholder
251
+ */
252
+ placeholder: {
253
+ type: StringConstructor;
254
+ default: undefined;
255
+ };
210
256
  /**
211
257
  * Line wrapping
212
258
  *
259
+ * An extension that enables line wrapping in the editor (by setting CSS white-space to pre-wrap in the content).
260
+ *
213
261
  * @see {@link https://codemirror.net/6/docs/ref/#view.EditorView%5ElineWrapping | LineWrapping}
214
262
  */
215
263
  wrap: {
@@ -217,7 +265,7 @@ declare const _default: import("vue-demi").DefineComponent<{
217
265
  default: boolean;
218
266
  };
219
267
  /**
220
- * Tab handling
268
+ * Allow tab key indent.
221
269
  *
222
270
  * @see {@link https://codemirror.net/6/examples/tab/ | Tab Handling}
223
271
  */
@@ -235,11 +283,14 @@ declare const _default: import("vue-demi").DefineComponent<{
235
283
  default: boolean;
236
284
  };
237
285
  /**
238
- * Editable
286
+ * Disable input.
287
+ *
288
+ * This is the reversed value of the CodeMirror editable.
289
+ * Similar to `readonly`, but setting this value to true disables dragging.
239
290
  *
240
291
  * @see {@link https://codemirror.net/6/docs/ref/#view.EditorView%5Eeditable | editable}
241
292
  */
242
- editable: {
293
+ disabled: {
243
294
  type: BooleanConstructor;
244
295
  default: boolean;
245
296
  };
@@ -279,12 +330,37 @@ declare const _default: import("vue-demi").DefineComponent<{
279
330
  type: PropType<LintSource>;
280
331
  default: undefined;
281
332
  };
282
- /** Show Gutter */
283
- lintGutter: {
333
+ /**
334
+ * Linter Config
335
+ *
336
+ * @see {@link https://codemirror.net/docs/ref/#lint.linter^config}
337
+ */
338
+ linterConfig: {
339
+ type: ObjectConstructor;
340
+ default: () => void;
341
+ };
342
+ /**
343
+ * Show Linter Gutter
344
+ *
345
+ * An area to 🔴 the lines with errors will be displayed.
346
+ * This feature is not enabled if `linter` is not specified.
347
+ */
348
+ gutter: {
284
349
  type: BooleanConstructor;
285
350
  defalt: boolean;
286
351
  };
287
- /** Using tag */
352
+ /**
353
+ * Gutter Config
354
+ *
355
+ * @see {@link https://codemirror.net/docs/ref/#lint.lintGutter^config}
356
+ */
357
+ gutterConfig: {
358
+ type: ObjectConstructor;
359
+ default: () => void;
360
+ };
361
+ /**
362
+ * Using tag
363
+ */
288
364
  tag: {
289
365
  type: StringConstructor;
290
366
  default: string;
@@ -299,15 +375,18 @@ declare const _default: import("vue-demi").DefineComponent<{
299
375
  dark: boolean;
300
376
  basic: boolean;
301
377
  minimal: boolean;
378
+ placeholder: string;
302
379
  wrap: boolean;
303
380
  tab: boolean;
304
381
  readonly: boolean;
305
- editable: boolean;
382
+ disabled: boolean;
306
383
  extensions: Extension[];
307
384
  phrases: Record<string, string>;
308
385
  lang: LanguageSupport;
309
386
  linter: LintSource;
310
- lintGutter: boolean;
387
+ linterConfig: Record<string, any>;
388
+ gutter: boolean;
389
+ gutterConfig: Record<string, any>;
311
390
  tag: string;
312
391
  }>;
313
392
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeMirror.d.ts","sourceRoot":"","sources":["../../src/components/CodeMirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,YAAY,EAElB,MAAM,UAAU,CAAC;AAOlB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAU,MAAM,kBAAkB,CAAC;AAKtD,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,IAAI,EAEL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,qBAAqB;AACrB,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,mBAAmB;IACnB,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACrD,4BAA4B;IAC5B,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACvC,yBAAyB;IACzB,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,yBAAyB;IACzB,CACE,CAAC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OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArKP,wBA6eG"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * h-demi - h function for Vue 2 and 3
3
+ *
4
+ * @see {@link https://github.com/vueuse/vue-demi/issues/65}
5
+ */
1
6
  import { type VNode } from 'vue-demi';
2
7
  interface Options {
3
8
  class?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"h-demi.d.ts","sourceRoot":"","sources":["../../src/helpers/h-demi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,KAAK,EAAQ,MAAM,UAAU,CAAC;AAEhE,UAAU,OAAO;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAWD,QAAA,MAAM,CAAC,SACC,MAAM,GAAG,OAAO,GAAG,EAAE,GAAG,CAAC,YACtB,OAAO,YACN,GAAG,KACZ,KAcF,CAAC;AAEF,QAAA,MAAM,IAAI,iBAAkB,GAAG,QACoC,CAAC;AAEpE,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"h-demi.d.ts","sourceRoot":"","sources":["../../src/helpers/h-demi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAsB,KAAK,KAAK,EAAQ,MAAM,UAAU,CAAC;AAEhE,UAAU,OAAO;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAWD,QAAA,MAAM,CAAC,SACC,MAAM,GAAG,OAAO,GAAG,EAAE,GAAG,CAAC,YACtB,OAAO,YACN,GAAG,KACZ,KAcF,CAAC;AAEF,QAAA,MAAM,IAAI,iBAAkB,GAAG,QACoC,CAAC;AAEpE,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,OAAO,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import CodeMirror from './components/CodeMirror';
2
+ import Meta from './Meta';
2
3
  declare const installCodeMirror: (app: any) => any;
3
- export { CodeMirror as default, installCodeMirror as install };
4
+ export { CodeMirror as default, installCodeMirror as install, Meta };
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAGjD,QAAA,MAAM,iBAAiB,QAAS,GAAG,QAA4C,CAAC;AAEhF,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,IAAI,MAAM,QAAQ,CAAC;AAG1B,QAAA,MAAM,iBAAiB,QAAS,GAAG,QAA4C,CAAC;AAEhF,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC"}