v-code-diff 1.15.0 → 1.16.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "v-code-diff",
3
3
  "type": "module",
4
- "version": "1.15.0",
4
+ "version": "1.16.0",
5
5
  "packageManager": "pnpm@11.2.2",
6
6
  "description": "A code diff viewer for Vue 2.6, Vue 2.7, and Vue 3",
7
7
  "license": "MIT",
@@ -72,30 +72,26 @@
72
72
  "dependencies": {
73
73
  "diff": "^5.2.2",
74
74
  "diff-match-patch": "^1.0.5",
75
- "highlight.js": "^11.10.0",
76
- "vue-demi": "^0.14.6"
75
+ "highlight.js": "^11.12.0",
76
+ "vue-demi": "^0.14.10"
77
77
  },
78
78
  "devDependencies": {
79
- "@antfu/eslint-config": "^2.4.5",
80
- "@types/diff": "^5.2.2",
79
+ "@antfu/eslint-config": "^2.27.3",
80
+ "@types/diff": "^5.2.3",
81
81
  "@types/diff-match-patch": "^1.0.36",
82
- "@types/node": "^18.11.18",
83
- "@unocss/eslint-plugin": "^0.58.0",
84
- "@vueuse/core": "^10.7.0",
82
+ "@types/node": "^22.19.15",
85
83
  "bumpp": "^8.2.1",
86
- "eslint": "^8.55.0",
84
+ "eslint": "^8.57.1",
87
85
  "npm-run-all": "^4.1.5",
88
86
  "rimraf": "^3.0.2",
89
- "sass": "^1.69.5",
90
- "tsx": "^4.19.4",
91
- "typescript": "~4.7.4",
92
- "vite": "^5.4.2",
87
+ "sass": "^1.103.1",
88
+ "tsx": "^4.23.12",
89
+ "typescript": "~5.9.3",
90
+ "vite": "^6.4.3",
93
91
  "vite-plugin-css-injected-by-js": "^2.4.0",
94
- "vitest": "^2.1.9",
95
- "vue": "^3.4.38",
96
- "vue-i18n": "^9.14.0",
97
- "vue-tsc": "^0.40.13",
98
- "vue2": "npm:vue@2",
99
- "vue3": "npm:vue@3"
92
+ "vitest": "^4.1.11",
93
+ "vue": "^3.5.41",
94
+ "vue2": "npm:vue@^2.7.16",
95
+ "vue3": "npm:vue@^3.5.41"
100
96
  }
101
97
  }
package/src/CodeDiff.vue CHANGED
@@ -144,6 +144,7 @@ watch(() => props, () => {
144
144
  <UpArrowIcon />
145
145
  </button>
146
146
  </span>
147
+ <slot name="header-actions" />
147
148
  <span v-if="!hideStat" class="diff-stat">
148
149
  <slot name="stat" :stat="diffChange.stat">
149
150
  <span class="diff-stat-added">+{{ diffChange.stat.additionsNum }} additions</span>
@@ -164,6 +165,7 @@ watch(() => props, () => {
164
165
  <UpArrowIcon />
165
166
  </button>
166
167
  </span>
168
+ <slot name="header-actions" />
167
169
  <span v-if="!hideStat" class="diff-stat">
168
170
  <slot name="stat" :stat="diffChange.stat">
169
171
  <span class="diff-stat-added">+{{ diffChange.stat.additionsNum }} additions</span>
@@ -36,7 +36,6 @@ function onChangeClick(event: MouseEvent, line: DiffLine, side: 'old' | 'new') {
36
36
  return
37
37
 
38
38
  // Vue 2 DOM templates require kebab-case event names.
39
- // eslint-disable-next-line vue/custom-event-name-casing
40
39
  emit('change-click', {
41
40
  side,
42
41
  type: line.type,
@@ -15,7 +15,6 @@ function onChangeClick(event: MouseEvent) {
15
15
  return
16
16
 
17
17
  // Vue 2 DOM templates require kebab-case event names.
18
- // eslint-disable-next-line vue/custom-event-name-casing
19
18
  emit('change-click', {
20
19
  side: props.line.type === DiffType.DELETE ? 'old' : 'new',
21
20
  type: props.line.type,
package/types/index.d.ts CHANGED
@@ -49,11 +49,12 @@ export interface DiffChangeClickEvent {
49
49
  }
50
50
 
51
51
  export interface CodeDiffSlots {
52
- stat: (props: { stat: DiffStat }) => VNode[]
52
+ 'header-actions': () => VNode[]
53
+ 'stat': (props: { stat: DiffStat }) => VNode[]
53
54
  }
54
55
 
55
56
  interface CodeDiffEmits {
56
- diff: (diffResult: DiffResult) => void
57
+ 'diff': (diffResult: DiffResult) => void
57
58
  'change-click': (payload: DiffChangeClickEvent) => void
58
59
  }
59
60