Skip to content

Commit f50a2b2

Browse files
committed
types!: remove the Mode export, use the one in vanilla-jsoneditor
1 parent 09ae043 commit f50a2b2

File tree

8 files changed

+4648
-3818
lines changed

8 files changed

+4648
-3818
lines changed

README.md

+1-18
Original file line numberDiff line numberDiff line change
@@ -993,12 +993,7 @@ FAQ: How to keep the value as parsed JSON in text mode:
993993
> - Will output empty value when the input value is invalid.
994994
995995
```html
996-
<JsonEditorVue
997-
mode="text"
998-
:main-menu-bar="false"
999-
:stringified="false"
1000-
:debounce="1000"
1001-
/>
996+
<JsonEditorVue mode="text" :stringified="false" :debounce="1000" />
1002997
```
1003998

1004999
### Naming convention
@@ -1045,18 +1040,6 @@ onMounted(() => {
10451040

10461041
<br>
10471042

1048-
## Types
1049-
1050-
<a name="Mode"></a>
1051-
1052-
```ts
1053-
type Mode = 'tree' | 'text' | 'table'
1054-
```
1055-
1056-
<br>
1057-
1058-
<a name="dark-theme"></a>
1059-
10601043
## Dark Theme
10611044

10621045
```vue

demo/vue3/index.vue

+19-25
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script setup lang="ts">
22
import { onMounted, reactive, ref, version } from 'vue'
33
import { parse, stringify } from 'lossless-json'
4-
import type { Mode } from '../../src'
54
import JsonEditorVue from '../../src'
65
76
const LosslessJSONParser = {
@@ -14,30 +13,25 @@ const LosslessJSONParser = {
1413
stringify,
1514
}
1615
17-
const data = reactive<{
18-
value: any
19-
mode?: Mode
20-
readOnly?: boolean
21-
parser?: { parse: (...args: any) => unknown, stringify: (...args: any) => unknown }
22-
}>({
23-
value: {
24-
bigint: 124124124124124124124n,
25-
boolean: true,
26-
string: 'Hello World',
27-
number: 123.456,
28-
color: '#b0a4e3',
29-
null: null,
30-
time: 1575599819000,
31-
array: [1, 2],
32-
object: {
33-
a: 'b',
34-
c: 'd',
35-
},
36-
},
37-
mode: undefined,
38-
readOnly: false,
39-
parser: LosslessJSONParser,
40-
})
16+
const data = reactive({
17+
value: {
18+
bigint: 124124124124124124124n,
19+
boolean: true,
20+
string: 'Hello World',
21+
number: 123.456,
22+
color: '#b0a4e3',
23+
null: null,
24+
time: 1575599819000,
25+
array: [1, 2],
26+
object: {
27+
a: 'b',
28+
c: 'd',
29+
},
30+
},
31+
mode: undefined,
32+
readOnly: false,
33+
parser: LosslessJSONParser,
34+
})
4135
4236
const jsonEditorVueRef = ref()
4337
onMounted(() => {

docs/README.zh-CN.md

+1-18
Original file line numberDiff line numberDiff line change
@@ -991,12 +991,7 @@ FAQ: 如何在 text 模式下保持绑定值是 parsed JSON:
991991
> - 输入值无效时会输出空
992992
993993
```html
994-
<JsonEditorVue
995-
mode="text"
996-
:main-menu-bar="false"
997-
:stringified="false"
998-
:debounce="1000"
999-
/>
994+
<JsonEditorVue mode="text" :stringified="false" :debounce="1000" />
1000995
```
1001996

1002997
### 命名惯例
@@ -1043,18 +1038,6 @@ onMounted(() => {
10431038

10441039
<br>
10451040

1046-
## 类型
1047-
1048-
<a name="Mode"></a>
1049-
1050-
```ts
1051-
type Mode = 'tree' | 'text' | 'table'
1052-
```
1053-
1054-
<br>
1055-
1056-
<a name="dark-theme"></a>
1057-
10581041
## 暗色主题
10591042

10601043
```vue

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,27 @@
7272
}
7373
},
7474
"dependencies": {
75-
"vanilla-jsoneditor": "^0.23.1",
75+
"vanilla-jsoneditor": "^0.23.2",
7676
"vue-demi": "^0.14.7"
7777
},
7878
"devDependencies": {
79-
"@antfu/eslint-config": "^2.13.3",
80-
"@commitlint/cli": "^19.2.1",
81-
"@commitlint/config-conventional": "^19.1.0",
79+
"@antfu/eslint-config": "^2.15.0",
80+
"@commitlint/cli": "^19.2.2",
81+
"@commitlint/config-conventional": "^19.2.2",
8282
"@types/cross-spawn": "^6.0.6",
8383
"@types/lodash-es": "^4.17.12",
8484
"@types/node": "^20.12.7",
8585
"@types/prompts": "^2.4.9",
8686
"@types/semver": "^7.5.8",
8787
"@vitejs/plugin-vue": "^5.0.4",
8888
"@vitest/ui": "^1.5.0",
89-
"@vue/compiler-sfc": "^3.4.21",
89+
"@vue/compiler-sfc": "^3.4.23",
9090
"@vue/test-utils": "^2.4.5",
9191
"case-police": "^0.6.1",
9292
"cross-spawn": "^7.0.3",
9393
"del": "^7.1.0",
9494
"eslint": "npm:eslint-ts-patch@8.57.0-0",
95-
"eslint-plugin-format": "^0.1.0",
95+
"eslint-plugin-format": "^0.1.1",
9696
"eslint-ts-patch": "8.57.0-0",
9797
"esno": "^4.7.0",
9898
"happy-dom": "^14.7.1",
@@ -111,11 +111,11 @@
111111
"typescript": "^5.4.5",
112112
"unplugin-auto-import": "^0.17.5",
113113
"unplugin-vue-components": "^0.26.0",
114-
"vite": "^5.2.8",
115-
"vite-plugin-dts": "^3.8.2",
114+
"vite": "^5.2.9",
115+
"vite-plugin-dts": "^3.8.3",
116116
"vitepress": "^1.1.0",
117117
"vitest": "^1.5.0",
118-
"vue": "^3.4.21",
118+
"vue": "^3.4.23",
119119
"vue-global-config": "^0.6.0",
120120
"zhlint": "^0.8.1"
121121
},

0 commit comments

Comments
 (0)