@tiptap/vue-2 3.22.4 → 3.23.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": "@tiptap/vue-2",
3
3
  "description": "Vue components for tiptap",
4
- "version": "3.22.4",
4
+ "version": "3.23.1",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -43,17 +43,17 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "vue": "^2.7.16",
46
- "@tiptap/core": "^3.22.4",
47
- "@tiptap/pm": "^3.22.4"
46
+ "@tiptap/core": "^3.23.1",
47
+ "@tiptap/pm": "^3.23.1"
48
48
  },
49
49
  "optionalDependencies": {
50
- "@tiptap/extension-bubble-menu": "^3.22.4",
51
- "@tiptap/extension-floating-menu": "^3.22.4"
50
+ "@tiptap/extension-bubble-menu": "^3.23.1",
51
+ "@tiptap/extension-floating-menu": "^3.23.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "vue": "^2.6.0",
55
- "@tiptap/core": "3.22.4",
56
- "@tiptap/pm": "3.22.4"
55
+ "@tiptap/core": "3.23.1",
56
+ "@tiptap/pm": "3.23.1"
57
57
  },
58
58
  "repository": {
59
59
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  import type { DecorationWithType, NodeViewProps, NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core'
2
- import { cancelPositionCheck, NodeView, schedulePositionCheck } from '@tiptap/core'
2
+ import { cancelPositionCheck, isNodeViewSelected, NodeView, schedulePositionCheck } from '@tiptap/core'
3
3
  import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
4
4
  import type { Decoration, DecorationSource, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'
5
5
  import type { VueConstructor } from 'vue'
@@ -146,14 +146,20 @@ class VueNodeView extends NodeView<Vue | VueConstructor, Editor, VueNodeViewRend
146
146
  * If it is, call `selectNode`, otherwise call `deselectNode`.
147
147
  */
148
148
  handleSelectionUpdate() {
149
- const { from, to } = this.editor.state.selection
150
149
  const pos = this.getPos()
151
150
 
152
151
  if (typeof pos !== 'number') {
153
152
  return
154
153
  }
155
154
 
156
- if (from <= pos && to >= pos + this.node.nodeSize) {
155
+ const isSelected = isNodeViewSelected({
156
+ selection: this.editor.state.selection,
157
+ pos,
158
+ nodeSize: this.node.nodeSize,
159
+ selectedOnTextSelection: this.options.selectedOnTextSelection,
160
+ })
161
+
162
+ if (isSelected) {
157
163
  if (this.renderer.ref.$props.selected) {
158
164
  return
159
165
  }