v-code-diff 1.12.1 → 1.13.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "v-code-diff",
3
3
  "type": "module",
4
- "version": "1.12.1",
4
+ "version": "1.13.1",
5
5
  "description": "template component for vue-demi, can dev and build",
6
6
  "license": "MIT",
7
7
  "exports": {
@@ -50,16 +50,15 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "diff": "^5.1.0",
53
+ "diff": "^5.2.0",
54
54
  "diff-match-patch": "^1.0.5",
55
- "highlight.js": "^11.9.0",
56
- "vue-demi": "^0.14.6",
57
- "vue-i18n": "9"
55
+ "highlight.js": "^11.10.0",
56
+ "vue-demi": "^0.14.6"
58
57
  },
59
58
  "devDependencies": {
60
59
  "@antfu/eslint-config": "^2.4.5",
61
- "@types/diff": "^5.0.0",
62
- "@types/diff-match-patch": "^1.0.32",
60
+ "@types/diff": "^5.2.2",
61
+ "@types/diff-match-patch": "^1.0.36",
63
62
  "@types/node": "^18.11.18",
64
63
  "@unocss/eslint-plugin": "^0.58.0",
65
64
  "@vueuse/core": "^10.7.0",
@@ -69,9 +68,10 @@
69
68
  "rimraf": "^3.0.2",
70
69
  "sass": "^1.69.5",
71
70
  "typescript": "~4.7.4",
72
- "vite": "^4.5.1",
71
+ "vite": "^5.4.2",
73
72
  "vite-plugin-css-injected-by-js": "^2.4.0",
74
- "vue": "^3.3.11",
73
+ "vue": "^3.4.38",
74
+ "vue-i18n": "^9.14.0",
75
75
  "vue-tsc": "^0.40.13",
76
76
  "vue2": "npm:vue@2",
77
77
  "vue3": "npm:vue@3"
@@ -0,0 +1,25 @@
1
+ <script setup lang="ts">
2
+ import CodeDiff from './CodeDiff.vue'
3
+
4
+ withDefaults(defineProps<{
5
+ language?: string
6
+ text: string
7
+ }>(), {
8
+ language: 'plaintext',
9
+ })
10
+ </script>
11
+
12
+ <template>
13
+ <CodeDiff
14
+ hide-header
15
+ :language="language"
16
+ :old-string="text"
17
+ :new-string="text"
18
+ />
19
+ </template>
20
+
21
+ <style scoped>
22
+ .code-diff-view :deep(td:nth-child(1)) {
23
+ display: none;
24
+ }
25
+ </style>
package/src/global.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import CodeDiff from './CodeDiff.vue'
2
+ import CodeReader from './CodeReader.vue'
2
3
  import hljs from './highlight'
3
4
 
4
5
  function install(app: any) {
5
6
  app.component('CodeDiff', CodeDiff)
7
+ app.component('CodeReader', CodeReader)
6
8
  }
7
9
 
8
10
  export default {
package/src/index.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  import CodeDiff from './CodeDiff.vue'
2
+ import CodeReader from './CodeReader.vue'
2
3
  import hljs from './highlight'
3
4
 
4
5
  function install(app: any) {
5
6
  app.component('CodeDiff', CodeDiff)
7
+ app.component('CodeReader', CodeReader)
6
8
  }
7
9
 
8
10
  export {
9
11
  CodeDiff,
12
+ CodeReader,
10
13
  hljs,
11
14
  }
12
15
 
package/types/index.d.ts CHANGED
@@ -8,8 +8,11 @@ declare const _default: {
8
8
 
9
9
  // eslint-disable-next-line
10
10
  declare const CodeDiff: DefineComponent<{}, {}, any>
11
+ // eslint-disable-next-line
12
+ declare const CodeReader: DefineComponent<{}, {}, any>
11
13
  export {
12
14
  CodeDiff,
15
+ CodeReader,
13
16
  }
14
17
 
15
18
  export default _default