@tiptap/core 2.0.0-beta.169 → 2.0.0-beta.172

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/core",
3
3
  "description": "headless rich text editor",
4
- "version": "2.0.0-beta.169",
4
+ "version": "2.0.0-beta.172",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -45,5 +45,5 @@
45
45
  "directory": "packages/core"
46
46
  },
47
47
  "sideEffects": false,
48
- "gitHead": "ed56337470efb4fd277128ab7ef792b37cfae992"
48
+ "gitHead": "88ef8eabb054a475b878a1fdb78ba80e6470961a"
49
49
  }
@@ -1,4 +1,4 @@
1
- import { Selection, TextSelection } from 'prosemirror-state'
1
+ import { TextSelection } from 'prosemirror-state'
2
2
  import { minMax } from '../utilities/minMax'
3
3
  import { RawCommands, Range } from '../types'
4
4
 
@@ -19,8 +19,8 @@ export const setTextSelection: RawCommands['setTextSelection'] = position => ({
19
19
  const { from, to } = typeof position === 'number'
20
20
  ? { from: position, to: position }
21
21
  : position
22
- const minPos = Selection.atStart(doc).from
23
- const maxPos = Selection.atEnd(doc).to
22
+ const minPos = 0
23
+ const maxPos = tr.doc.content.size
24
24
  const resolvedFrom = minMax(from, minPos, maxPos)
25
25
  const resolvedEnd = minMax(to, minPos, maxPos)
26
26
  const selection = TextSelection.create(doc, resolvedFrom, resolvedEnd)
@@ -9,8 +9,12 @@ export const Tabindex = Extension.create({
9
9
  new Plugin({
10
10
  key: new PluginKey('tabindex'),
11
11
  props: {
12
- attributes: {
13
- tabindex: '0',
12
+ attributes: () => {
13
+ if (this.editor.isEditable) {
14
+ return {
15
+ tabindex: '0',
16
+ }
17
+ }
14
18
  },
15
19
  },
16
20
  }),
@@ -1,7 +1,6 @@
1
1
  import { ParseRule } from 'prosemirror-model'
2
2
  import { ExtensionAttribute } from '../types'
3
3
  import { fromString } from '../utilities/fromString'
4
- import { isObject } from '../utilities/isObject'
5
4
 
6
5
  /**
7
6
  * This function merges extension attributes into parserule attributes (`attrs` or `getAttrs`).