tiptapify 0.0.1 → 0.0.4
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 +4 -3
- package/components.d.ts +1 -1
- package/dist/tiptapify.css +1 -1
- package/dist/tiptapify.es.js +12443 -12291
- package/dist/tiptapify.umd.js +33 -33
- package/package.json +18 -5
- package/src/components/MenuBubble.vue +75 -25
- package/src/components/Tiptapify.vue +16 -6
- package/src/components/Toolbar/Index.vue +142 -0
- package/src/components/Toolbar/items.ts +697 -0
- package/src/components/editorExtensions.ts +58 -53
- package/src/composable/useEditor.ts +2 -2
- package/src/i18n/locales/en.json +10 -2
- package/src/i18n/locales/ru.json +10 -2
- package/src/i18n/locales/ua.json +10 -2
- package/src/components/Toolbar.vue +0 -651
|
@@ -35,7 +35,7 @@ import { common, createLowlight } from 'lowlight'
|
|
|
35
35
|
// using all available languages
|
|
36
36
|
const lowlight = createLowlight(common)
|
|
37
37
|
|
|
38
|
-
// or
|
|
38
|
+
// or register specific languages
|
|
39
39
|
// const lowlight = createLowlight()
|
|
40
40
|
//
|
|
41
41
|
// import language example
|
|
@@ -44,55 +44,60 @@ const lowlight = createLowlight(common)
|
|
|
44
44
|
// register language example
|
|
45
45
|
// lowlight.register('ts', ts)
|
|
46
46
|
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
47
|
+
export function editorExtensions (placeholder: string, slashCommands: boolean) {
|
|
48
|
+
const extensions = [
|
|
49
|
+
TextStyleKit,
|
|
50
|
+
Document,
|
|
51
|
+
Text,
|
|
52
|
+
Paragraph,
|
|
53
|
+
Heading,
|
|
54
|
+
Bold,
|
|
55
|
+
Italic,
|
|
56
|
+
Strike,
|
|
57
|
+
Blockquote,
|
|
58
|
+
OrderedList,
|
|
59
|
+
BulletList,
|
|
60
|
+
TaskList,
|
|
61
|
+
TaskItem,
|
|
62
|
+
ListItem,
|
|
63
|
+
ListKeymap,
|
|
64
|
+
HardBreak,
|
|
65
|
+
HorizontalRule,
|
|
66
|
+
Dropcursor,
|
|
67
|
+
Typography,
|
|
68
|
+
Underline,
|
|
69
|
+
Highlight,
|
|
70
|
+
Link.configure({
|
|
71
|
+
openOnClick: false,
|
|
72
|
+
defaultProtocol: 'https',
|
|
73
|
+
}),
|
|
74
|
+
Image,
|
|
75
|
+
Superscript,
|
|
76
|
+
Subscript,
|
|
77
|
+
TableKit,
|
|
78
|
+
Code,
|
|
79
|
+
UndoRedo,
|
|
80
|
+
Focus,
|
|
81
|
+
CodeBlockLowlight
|
|
82
|
+
.extend({
|
|
83
|
+
addNodeView() {
|
|
84
|
+
return VueNodeViewRenderer(CodeBlockComponent)
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
.configure({ lowlight }),
|
|
88
|
+
Selection.configure({
|
|
89
|
+
className: 'selection',
|
|
90
|
+
}),
|
|
91
|
+
TextAlign.configure({
|
|
92
|
+
types: ['heading', 'paragraph'],
|
|
93
|
+
}),
|
|
94
|
+
Placeholder.configure({ placeholder }),
|
|
95
|
+
CharacterCount
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
if (slashCommands) {
|
|
99
|
+
extensions.push(SlashCommands.configure({ suggestion }))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return extensions
|
|
103
|
+
}
|
|
@@ -4,12 +4,12 @@ import { editorExtensions } from '@tiptapify/components/editorExtensions'
|
|
|
4
4
|
|
|
5
5
|
let editorInstance: any = null
|
|
6
6
|
|
|
7
|
-
export function useEditor(content: any = '', placeholder: string = '') {
|
|
7
|
+
export function useEditor(content: any = '', placeholder: string = '', slashCommands: boolean = true) {
|
|
8
8
|
class TiptapifyEditor {
|
|
9
9
|
private editor
|
|
10
10
|
|
|
11
11
|
constructor() {
|
|
12
|
-
const extensions = editorExtensions(placeholder)
|
|
12
|
+
const extensions = editorExtensions(placeholder, slashCommands)
|
|
13
13
|
this.editor = useEditorOriginal({
|
|
14
14
|
content,
|
|
15
15
|
extensions,
|
package/src/i18n/locales/en.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"style": {
|
|
3
3
|
"heading": "heading",
|
|
4
|
+
"headings": {
|
|
5
|
+
"h1": "heading level 1",
|
|
6
|
+
"h2": "heading level 2",
|
|
7
|
+
"h3": "heading level 3",
|
|
8
|
+
"h4": "heading level 4",
|
|
9
|
+
"h5": "heading level 5",
|
|
10
|
+
"h6": "heading level 6"
|
|
11
|
+
},
|
|
4
12
|
"fontFamily": "font family",
|
|
5
13
|
"fontSize": "font size",
|
|
6
14
|
"lineHeight": "line height"
|
|
@@ -18,8 +26,8 @@
|
|
|
18
26
|
"blockquote": "cite",
|
|
19
27
|
"code": "code",
|
|
20
28
|
"codeblock": "code block",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
29
|
+
"link": "external link",
|
|
30
|
+
"formatClear": "format clear"
|
|
23
31
|
},
|
|
24
32
|
"action": {
|
|
25
33
|
"undo": "undo",
|
package/src/i18n/locales/ru.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"style": {
|
|
3
3
|
"heading": "заголовок",
|
|
4
|
+
"headings": {
|
|
5
|
+
"h1": "заголовок 1-го уровня",
|
|
6
|
+
"h2": "заголовок 2-го уровня",
|
|
7
|
+
"h3": "заголовок 3-го уровня",
|
|
8
|
+
"h4": "заголовок 4-го уровня",
|
|
9
|
+
"h5": "заголовок 5-го уровня",
|
|
10
|
+
"h6": "заголовок 6-го уровня"
|
|
11
|
+
},
|
|
4
12
|
"fontFamily": "шрифт",
|
|
5
13
|
"fontSize": "размер",
|
|
6
14
|
"lineHeight": "высота строки"
|
|
@@ -18,8 +26,8 @@
|
|
|
18
26
|
"blockquote": "цитата",
|
|
19
27
|
"code": "код",
|
|
20
28
|
"codeblock": "блок кода",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
29
|
+
"link": "внешняя ссылка",
|
|
30
|
+
"formatClear": "очистить форматирование"
|
|
23
31
|
},
|
|
24
32
|
"action": {
|
|
25
33
|
"undo": "отмена",
|
package/src/i18n/locales/ua.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"style": {
|
|
3
3
|
"heading": "заголовок",
|
|
4
|
+
"headings": {
|
|
5
|
+
"h1": "заголовок 1-го рівня",
|
|
6
|
+
"h2": "заголовок 2-го рівня",
|
|
7
|
+
"h3": "заголовок 3-го рівня",
|
|
8
|
+
"h4": "заголовок 4-го рівня",
|
|
9
|
+
"h5": "заголовок 5-го рівня",
|
|
10
|
+
"h6": "заголовок 6-го рівня"
|
|
11
|
+
},
|
|
4
12
|
"fontFamily": "шрифт",
|
|
5
13
|
"fontSize": "розмір",
|
|
6
14
|
"lineHeight": "висота строки"
|
|
@@ -18,8 +26,8 @@
|
|
|
18
26
|
"blockquote": "цитата",
|
|
19
27
|
"code": "код",
|
|
20
28
|
"codeblock": "блок коду",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
29
|
+
"link": "зовнішнє посилання",
|
|
30
|
+
"formatClear": "очистити форматування"
|
|
23
31
|
},
|
|
24
32
|
"action": {
|
|
25
33
|
"undo": "відміна",
|