@mirus/tiptap-editor 2.0.1 → 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/dist/tiptap-editor.mjs +3367 -3375
- package/package.json +58 -58
- package/src/App.vue~ +46 -0
- package/src/main.js~ +9 -0
- package/src/max-character-count.js~ +33 -0
- package/src/tiptap-editor.vue~ +501 -0
package/package.json
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirus/tiptap-editor",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "custom setup for the tiptap editor",
|
|
5
5
|
"repository": "https://github.com/mirusresearch/tiptap-editor",
|
|
6
6
|
"bugs": {
|
|
7
|
-
|
|
7
|
+
"url": "https://github.com/mirusresearch/tiptap-editor"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://github.com/mirusresearch/tiptap-editor",
|
|
10
10
|
"author": "alec@mirusresearch.com",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"main": "dist/tiptap-editor.mjs",
|
|
13
13
|
"browser": {
|
|
14
|
-
|
|
14
|
+
"./sfc": "src/tiptap-editor.vue"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
"dist/*",
|
|
18
|
+
"src/*",
|
|
19
|
+
"public/*",
|
|
20
|
+
"*.json",
|
|
21
|
+
"*.js"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
"serve": "vite",
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"preview": "vite preview",
|
|
27
|
+
"format": "prettier --write \"src\" \"test\"",
|
|
28
|
+
"validate:format": "prettier --check \"src\" \"test\"",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test:watch": "vitest",
|
|
31
|
+
"coverage": "vitest run --coverage"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
34
|
+
"@babel/core": "^7.4.4",
|
|
35
|
+
"@babel/helper-define-map": "^7.18.6",
|
|
36
|
+
"@babel/helper-regex": "^7.10.5",
|
|
37
|
+
"@babel/polyfill": "^7.4.4",
|
|
38
|
+
"@babel/preset-env": "^7.4.4",
|
|
39
|
+
"@tiptap/core": "^2.1.10",
|
|
40
|
+
"@tiptap/extension-bold": "^2.1.10",
|
|
41
|
+
"@tiptap/extension-bullet-list": "^2.1.10",
|
|
42
|
+
"@tiptap/extension-character-count": "^2.1.10",
|
|
43
|
+
"@tiptap/extension-document": "^2.1.10",
|
|
44
|
+
"@tiptap/extension-history": "^2.0.3",
|
|
45
|
+
"@tiptap/extension-italic": "^2.1.10",
|
|
46
|
+
"@tiptap/extension-list-item": "^2.1.10",
|
|
47
|
+
"@tiptap/extension-paragraph": "^2.1.10",
|
|
48
|
+
"@tiptap/extension-placeholder": "^2.1.10",
|
|
49
|
+
"@tiptap/extension-text": "^2.1.10",
|
|
50
|
+
"@tiptap/pm": "^2.0.3",
|
|
51
|
+
"@tiptap/vue-2": "^2.1.10",
|
|
52
|
+
"@vitejs/plugin-vue2": "^2.2.0",
|
|
53
|
+
"@vitest/coverage-v8": "^0.32.2",
|
|
54
|
+
"@vue/babel-preset-app": "^3.7.0",
|
|
55
|
+
"@vue/test-utils": "^1.3.6",
|
|
56
|
+
"babel-loader": "^8.0.5",
|
|
57
|
+
"babel-polyfill": "^6.26.0",
|
|
58
|
+
"current-script-polyfill": "^1.0.0",
|
|
59
|
+
"eslint": "^5.15.3",
|
|
60
|
+
"flush-promises": "^1.0.2",
|
|
61
|
+
"happy-dom": "^9.20.3",
|
|
62
|
+
"lodash.get": "^4.4.2",
|
|
63
|
+
"lodash.unescape": "^4.0.1",
|
|
64
|
+
"prettier": "2.8.8",
|
|
65
|
+
"sass": "1.60.0",
|
|
66
|
+
"tippy.js": "^4.3.1",
|
|
67
|
+
"vite": "^4.3.9",
|
|
68
|
+
"vitest": "^0.32.2",
|
|
69
|
+
"vue": "^2.6.10",
|
|
70
|
+
"webpack": "^4.31.0"
|
|
71
71
|
},
|
|
72
72
|
"browserslist": [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
"> 1%",
|
|
74
|
+
"last 2 versions",
|
|
75
|
+
"ie >= 9"
|
|
76
76
|
],
|
|
77
77
|
"dependencies": {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
"vite-plugin-css-injected-by-js": "^3.3.0",
|
|
79
|
+
"vue-template-compiler": "^2.7.14"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/src/App.vue~
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
testx
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
/* import tiptapEditor from './tiptap-editor.vue';*/
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
name: 'dev',
|
|
12
|
+
/* components: { tiptapEditor },*/
|
|
13
|
+
data() {
|
|
14
|
+
return {
|
|
15
|
+
warnings: [
|
|
16
|
+
{
|
|
17
|
+
value: 'red',
|
|
18
|
+
message: 'did you mean...',
|
|
19
|
+
options: ['read', 'reed'], // optional
|
|
20
|
+
// default class is red
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: '<script>', // can use the real thing, or escape it
|
|
24
|
+
isWord: false,
|
|
25
|
+
message: 'you sure you wanted a tag?',
|
|
26
|
+
overrideClass: 'underline-blue', // optional
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: 'green',
|
|
30
|
+
message: 'I really like this!',
|
|
31
|
+
overrideClass: 'underline-green', // optional
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: 'orange',
|
|
35
|
+
message: 'this is a bad idea!',
|
|
36
|
+
overrideClass: 'underline-orange', // optional
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
localtext:
|
|
40
|
+
'<script> welcome to tiptap editor, here is a red mark blue with suggestions. You can also to blue, orange, and green!!',
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style></style>
|
package/src/main.js~
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Extension, Plugin, PluginKey } from 'tiptap';
|
|
2
|
+
|
|
3
|
+
export default class MaxCharacterCount extends Extension {
|
|
4
|
+
get name() {
|
|
5
|
+
return 'max Character Count';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
get defaultOptions() {
|
|
9
|
+
return {
|
|
10
|
+
maxCharacterCount: 100,
|
|
11
|
+
onChange: () => {},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
get plugins() {
|
|
16
|
+
const self = this;
|
|
17
|
+
|
|
18
|
+
return [
|
|
19
|
+
new Plugin({
|
|
20
|
+
key: new PluginKey('maxCharacterCount'),
|
|
21
|
+
filterTransaction: (transaction, state) => {
|
|
22
|
+
if (self.options.maxCharacterCount !== null) {
|
|
23
|
+
return state.doc.content.size < self.options.maxCharacterCount;
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
},
|
|
27
|
+
appendTransaction: (transactions, oldState, newState) => {
|
|
28
|
+
self.options.onChange(newState.doc.content.size);
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
}
|