@mirus/tiptap-editor 2.0.0 → 2.1.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/README.md CHANGED
@@ -40,54 +40,60 @@ export default {
40
40
 
41
41
  ## Props
42
42
 
43
+ - **value:** `String` - the text to edit
43
44
 
44
- - **value:** `String` - the text to edit
45
+ - **placeholder:** `String` - the text to display when there is nothing in the editor
45
46
 
46
- - **placeholder:** `String` - the text to display when there is nothing in the editor
47
+ - **warnings:** `[ Objects ]` - an array of text that should be warned about
47
48
 
48
- - **warnings:** `[ Objects ]` - an array of text that should be warned about
49
+ - example:
49
50
 
50
- - example:
51
- ```js
52
- [
53
- {
54
- value: 'the',
55
- message: 'did you mean...',
56
- options: ['too', 'pizza'], // optional
57
- },
58
- {
59
- value: 'test text',
60
- message: 'cannot say that, sorry',
61
- overrideClass: 'underlined-green', // optional
62
- },
63
- ]
64
- ```
51
+ ```js
52
+ [
53
+ {
54
+ value: 'the',
55
+ message: 'did you mean...',
56
+ options: ['too', 'pizza'], // optional
57
+ },
58
+ {
59
+ value: 'test text',
60
+ message: 'cannot say that, sorry',
61
+ overrideClass: 'underlined-green', // optional
62
+ offset: 32, // optional
63
+ length: 9, // optional
64
+ },
65
+ ];
66
+ ```
65
67
 
66
- - **maxCharacterCount:** `Number` - Show a count of the current number of characters. If over the max the count will show red
68
+ - Optional `offset` and `length` values can be specified to highlight a specific instance of an error.
69
+ - **offset:** `Number` - character distance from beginning of the text to the index of the error
70
+ - **length:** `Number` - character length of the error
67
71
 
68
- - **height:** `String` - height of the text editor, default is `300px`
72
+ - **maxCharacterCount:** `Number` - Show a count of the current number of characters. If over the max the count will show red
69
73
 
70
- - **showMenu:** `Boolean` - if false, hide the format menu
74
+ - **height:** `String` - height of the text editor, default is `300px`
71
75
 
72
- - **id:** `String` - give the editor a unique id. Also adds aria tags to link the editor menu to the text area
76
+ - **showMenu:** `Boolean` - if false, hide the format menu
77
+
78
+ - **id:** `String` - give the editor a unique id. Also adds aria tags to link the editor menu to the text area
73
79
 
74
80
  ## Events
75
81
 
76
- - **update:value** - emitted whenever the core text value changes
82
+ - **update:value** - emitted whenever the core text value changes
77
83
 
78
- - **new-character-count** - the new internal character count of the value. This is useful since the synced value may have formatting, which internal is ignored when counting characters.
84
+ - **new-character-count** - the new internal character count of the value. This is useful since the synced value may have formatting, which internal is ignored when counting characters.
79
85
 
80
86
  ## Setup
81
87
 
82
- - clone this repo
83
- - `cd` into the repo directory and run `yarn install`
84
- - run `yarn serve`
88
+ - clone this repo
89
+ - `cd` into the repo directory and run `yarn install`
90
+ - run `yarn serve`
85
91
 
86
92
  ## Available Scripts
87
93
 
88
- - `yarn serve` - start the dev server
89
- - `yarn build` - build for production
90
- - `yarn preview` - locally preview production build
91
- - `yarn format` - run Prettier to format code
92
- - `yarn validate:format` - run Prettier with `--check` flag
93
- - `yarn test` - run tests using vitest
94
+ - `yarn serve` - start the dev server
95
+ - `yarn build` - build for production
96
+ - `yarn preview` - locally preview production build
97
+ - `yarn format` - run Prettier to format code
98
+ - `yarn validate:format` - run Prettier with `--check` flag
99
+ - `yarn test` - run tests using vitest