@mirus/tiptap-editor 2.0.0 → 2.0.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/README.md +39 -33
- package/dist/tiptap-editor.mjs +22388 -0
- package/package.json +59 -58
- package/src/App.vue +6 -3
- package/src/tiptap-editor.vue +37 -9
- package/src/warnings.js +27 -4
- package/vite.config.js +14 -6
- package/dist/assets/index-40717dd0.js +0 -115
- package/dist/assets/index-7678a4fb.css +0 -1
- package/dist/index.html +0 -14
- package/src/App.vue~ +0 -46
- package/src/main.js~ +0 -9
- package/src/max-character-count.js~ +0 -33
- package/src/tiptap-editor.vue~ +0 -501
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
|
-
-
|
|
45
|
+
- **placeholder:** `String` - the text to display when there is nothing in the editor
|
|
45
46
|
|
|
46
|
-
-
|
|
47
|
+
- **warnings:** `[ Objects ]` - an array of text that should be warned about
|
|
47
48
|
|
|
48
|
-
-
|
|
49
|
+
- example:
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
72
|
+
- **maxCharacterCount:** `Number` - Show a count of the current number of characters. If over the max the count will show red
|
|
69
73
|
|
|
70
|
-
-
|
|
74
|
+
- **height:** `String` - height of the text editor, default is `300px`
|
|
71
75
|
|
|
72
|
-
-
|
|
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
|
-
-
|
|
82
|
+
- **update:value** - emitted whenever the core text value changes
|
|
77
83
|
|
|
78
|
-
-
|
|
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
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
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
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
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
|