vue-codemirror6 1.0.3 → 1.1.1
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 +201 -0
- package/README.md +30 -22
- package/dist/components/CodeMirror.d.ts +173 -48
- package/dist/components/CodeMirror.d.ts.map +1 -1
- package/dist/index.es.js +64 -33
- package/dist/index.iife.js +62 -31
- package/dist/index.umd.js +64 -33
- package/package.json +37 -28
- package/src/components/CodeMirror.ts +156 -60
- package/dist/stats.html +0 -4034
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
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. This component works in both Vue2 and Vue3.
|
|
11
11
|
|
|
12
|
+
- [CHANGELOG](./CHANGELOG.md)
|
|
13
|
+
|
|
12
14
|
## Usage
|
|
13
15
|
|
|
14
16
|
```sh
|
|
@@ -25,22 +27,27 @@ This component can handle bidirectional binding by `v-model` like a general Vue
|
|
|
25
27
|
|
|
26
28
|
## Props
|
|
27
29
|
|
|
28
|
-
| Props
|
|
29
|
-
|
|
|
30
|
-
| basic
|
|
31
|
-
| minimal
|
|
32
|
-
| dark
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
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
|
+
| tab-size | number | Configures the tab size to use in this state. |
|
|
39
|
+
| line-separator | string | Set line break (separetor) char. |
|
|
40
|
+
| 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. |
|
|
41
|
+
| readonly | boolean | Makes the cursor visible or you can drag the text but not edit the value. |
|
|
42
|
+
| disabled | boolean | This is the reversed value of the CodeMirror editable. Similar to `readonly`, but setting this value to true disables dragging. |
|
|
43
|
+
| lang | LanguageSupport | The language you want to have syntax highlighting. see <https://codemirror.net/6/#languages> |
|
|
44
|
+
| phrases | Record<string, string> | Specify here if you want to make the displayed character string multilingual. see <https://codemirror.net/6/examples/translate/> |
|
|
45
|
+
| extensions | Extension[] | Includes enhancements to extend CodeMirror. |
|
|
46
|
+
| 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. |
|
|
47
|
+
| linterConfig | Object | see <https://codemirror.net/docs/ref/#lint.linter^config> |
|
|
48
|
+
| gutter | boolean | Display 🔴 on the line where there was an error when `linter` was specified. It will not work if `linter` is not specified. |
|
|
49
|
+
| gutterConfig | Object | see <https://codemirror.net/docs/ref/#lint.lintGutter^config> |
|
|
50
|
+
| tag | string | HTML tags used in the component. (Default is `div` tag.) |
|
|
44
51
|
|
|
45
52
|
⚠ 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.
|
|
46
53
|
|
|
@@ -244,12 +251,13 @@ export default defineComponent({
|
|
|
244
251
|
|
|
245
252
|
## Events
|
|
246
253
|
|
|
247
|
-
| Event
|
|
248
|
-
|
|
|
249
|
-
| ready
|
|
250
|
-
| focus
|
|
251
|
-
| update
|
|
252
|
-
| changed
|
|
254
|
+
| Event | Description |
|
|
255
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
256
|
+
| ready | When CodeMirror loaded. |
|
|
257
|
+
| focus | When focus changed. |
|
|
258
|
+
| update | When CodeMirror state changed. Returns [ViewUpdate](https://codemirror.net/docs/ref/#view.ViewUpdate) object. |
|
|
259
|
+
| changed | Value changed. (Please implement with `v-model` unless there is a special reason.) |
|
|
260
|
+
| diagnosticCount | Returns the number of active lint diagnostics in the given state. (Only when `linter` prop is specified) |
|
|
253
261
|
|
|
254
262
|
## Methods
|
|
255
263
|
|