tiptapify 0.0.9 → 0.0.11
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 +1 -1
- package/dist/tiptapify.css +1 -1
- package/dist/tiptapify.mjs +21133 -19765
- package/dist/tiptapify.umd.js +37 -38
- package/package.json +43 -43
- package/src/components/Tiptapify.vue +2 -2
- package/src/components/Toolbar/GroupBtn.vue +2 -6
- package/src/components/Toolbar/GroupDropdown.vue +4 -8
- package/src/components/Toolbar/Index.vue +5 -4
- package/src/components/Toolbar/Items.vue +2 -2
- package/src/components/Toolbar/Toggle.vue +2 -2
- package/src/components/Toolbar/items.ts +20 -20
- package/src/components/UI/Dialog.vue +141 -0
- package/src/components/editorExtensions.ts +1 -1
- package/src/{components/Toolbar/items/actions.ts → composables/Toolbar/useActionsItems.ts} +6 -3
- package/src/{components/Toolbar/items/alignment.ts → composables/Toolbar/useAlignmentItems.ts} +12 -9
- package/src/{components/Toolbar/items/formatExtra.ts → composables/Toolbar/useFormatExtraItems.ts} +10 -7
- package/src/{components/Toolbar/items/format.ts → composables/Toolbar/useFormatItems.ts} +20 -17
- package/src/{components/Toolbar/items/list.ts → composables/Toolbar/useListItems.ts} +14 -11
- package/src/{components/Toolbar/items/media.ts → composables/Toolbar/useMediaItems.ts} +22 -20
- package/src/{components/Toolbar/items/misc.ts → composables/Toolbar/useMiscItems.ts} +9 -6
- package/src/composables/Toolbar/useStyleItems.ts +231 -0
- package/src/{components/Toolbar/fonts.ts → constants/style.ts} +21 -0
- package/src/extensions/components/FontFamily.vue +82 -0
- package/src/extensions/components/FontSize.vue +83 -0
- package/src/extensions/components/ImageDialog.vue +17 -29
- package/src/extensions/components/LineHeight.vue +82 -0
- package/src/extensions/components/LinkDialog.vue +75 -44
- package/src/extensions/components/PreviewDialog.vue +8 -16
- package/src/extensions/components/ShowSourceDialog.vue +17 -18
- package/src/extensions/components/StyleColor.vue +68 -15
- package/src/extensions/components/TableBuilder.vue +3 -6
- package/src/extensions/link.ts +8 -0
- package/src/extensions/slash-commands.ts +1 -1
- package/src/i18n/index.ts +0 -1
- package/src/i18n/locales/ch.json +119 -0
- package/src/i18n/locales/cz.json +119 -0
- package/src/i18n/locales/de.json +83 -76
- package/src/i18n/locales/en.json +82 -75
- package/src/i18n/locales/es.json +80 -73
- package/src/i18n/locales/fr.json +81 -73
- package/src/i18n/locales/it.json +80 -73
- package/src/i18n/locales/la.json +119 -0
- package/src/i18n/locales/lt.json +119 -0
- package/src/i18n/locales/nl.json +119 -0
- package/src/i18n/locales/pl.json +80 -74
- package/src/i18n/locales/pt.json +119 -0
- package/src/i18n/locales/ru.json +78 -71
- package/src/i18n/locales/se.json +119 -0
- package/src/i18n/locales/ua.json +79 -72
- package/src/components/Toolbar/items/style.ts +0 -187
- /package/src/{components → extensions/components}/CodeBlockComponent.vue +0 -0
package/src/i18n/locales/ua.json
CHANGED
|
@@ -1,109 +1,116 @@
|
|
|
1
1
|
{
|
|
2
|
+
"defaultValue": "Значення за замовчуванням",
|
|
2
3
|
"content": {
|
|
3
|
-
"placeholder": "
|
|
4
|
+
"placeholder": "Напишіть щонебудь..."
|
|
4
5
|
},
|
|
5
6
|
"style": {
|
|
6
|
-
"paragraph": "
|
|
7
|
-
"heading": "
|
|
7
|
+
"paragraph": "Абзац",
|
|
8
|
+
"heading": "Заголовок",
|
|
8
9
|
"headings": {
|
|
9
|
-
"h1": "
|
|
10
|
-
"h2": "
|
|
11
|
-
"h3": "
|
|
12
|
-
"h4": "
|
|
13
|
-
"h5": "
|
|
14
|
-
"h6": "
|
|
10
|
+
"h1": "Заголовок 1-го рівня",
|
|
11
|
+
"h2": "Заголовок 2-го рівня",
|
|
12
|
+
"h3": "Заголовок 3-го рівня",
|
|
13
|
+
"h4": "Заголовок 4-го рівня",
|
|
14
|
+
"h5": "Заголовок 5-го рівня",
|
|
15
|
+
"h6": "Заголовок 6-го рівня"
|
|
15
16
|
},
|
|
16
|
-
"fontFamily": "
|
|
17
|
-
"fontSize": "
|
|
18
|
-
"lineHeight": "
|
|
17
|
+
"fontFamily": "Шрифт",
|
|
18
|
+
"fontSize": "Розмір",
|
|
19
|
+
"lineHeight": "Висота строки",
|
|
19
20
|
"color": {
|
|
20
|
-
"highlight": "
|
|
21
|
-
"text": "
|
|
22
|
-
"unset": "
|
|
23
|
-
"custom": "
|
|
21
|
+
"highlight": "Колір виділення",
|
|
22
|
+
"text": "Колір тексту",
|
|
23
|
+
"unset": "Очистити колір",
|
|
24
|
+
"custom": "Власний вибір"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
"format": {
|
|
27
|
-
"bold": "
|
|
28
|
-
"italic": "
|
|
29
|
-
"strike": "
|
|
30
|
-
"underline": "
|
|
31
|
-
"sup": "
|
|
32
|
-
"sub": "
|
|
33
|
-
"break": "
|
|
34
|
-
"line": "
|
|
35
|
-
"blockquote": "
|
|
36
|
-
"code": "
|
|
37
|
-
"codeblock": "
|
|
38
|
-
"formatClear": "
|
|
28
|
+
"bold": "Жирний",
|
|
29
|
+
"italic": "Курсив",
|
|
30
|
+
"strike": "Закреслення",
|
|
31
|
+
"underline": "Підкреслення",
|
|
32
|
+
"sup": "Верхній індекс",
|
|
33
|
+
"sub": "Нижній індекс",
|
|
34
|
+
"break": "Розрив строки",
|
|
35
|
+
"line": "Горизонтальна лінія",
|
|
36
|
+
"blockquote": "Цитата",
|
|
37
|
+
"code": "Код",
|
|
38
|
+
"codeblock": "Блок коду",
|
|
39
|
+
"formatClear": "Очистити форматування"
|
|
39
40
|
},
|
|
40
41
|
"media": {
|
|
41
|
-
"link": "
|
|
42
|
-
"image": "
|
|
42
|
+
"link": "Зовнішнє посилання",
|
|
43
|
+
"image": "Зображення",
|
|
43
44
|
"tables": {
|
|
44
|
-
"table": "
|
|
45
|
-
"insertTable": "
|
|
46
|
-
"deleteTable": "
|
|
47
|
-
"insertWithHeaderRow": "
|
|
48
|
-
"rows": "
|
|
49
|
-
"row": "
|
|
50
|
-
"insertRowBefore": "
|
|
51
|
-
"insertRowAfter": "
|
|
52
|
-
"deleteRow": "
|
|
53
|
-
"cols": "
|
|
54
|
-
"col": "
|
|
55
|
-
"insertColBefore": "
|
|
56
|
-
"insertColAfter": "
|
|
57
|
-
"deleteCol": "
|
|
58
|
-
"mergeCells": "
|
|
59
|
-
"splitCell": "
|
|
45
|
+
"table": "Таблиця",
|
|
46
|
+
"insertTable": "Вставити таблицю",
|
|
47
|
+
"deleteTable": "Видалити таблицю",
|
|
48
|
+
"insertWithHeaderRow": "Вставити таблицю із заголовком",
|
|
49
|
+
"rows": "Строки",
|
|
50
|
+
"row": "Строка",
|
|
51
|
+
"insertRowBefore": "Вставити строку перед",
|
|
52
|
+
"insertRowAfter": "Вставити строку після",
|
|
53
|
+
"deleteRow": "Видалити строку",
|
|
54
|
+
"cols": "Стовпчики",
|
|
55
|
+
"col": "Стовпчик",
|
|
56
|
+
"insertColBefore": "Вставити колонку перед",
|
|
57
|
+
"insertColAfter": "Вставити колонку після",
|
|
58
|
+
"deleteCol": "Видалити колонку",
|
|
59
|
+
"mergeCells": "Об'єднати клітинки",
|
|
60
|
+
"splitCell": "Розділити клітинки"
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
"action": {
|
|
63
|
-
"undo": "
|
|
64
|
-
"redo": "
|
|
64
|
+
"undo": "Відміна",
|
|
65
|
+
"redo": "Повтор"
|
|
65
66
|
},
|
|
66
|
-
"alignment": "
|
|
67
|
+
"alignment": "Вирівнювання",
|
|
67
68
|
"alignments": {
|
|
68
|
-
"left": "
|
|
69
|
-
"center": "
|
|
70
|
-
"right": "
|
|
71
|
-
"justify": "
|
|
69
|
+
"left": "Вирівнювання по лівому краю",
|
|
70
|
+
"center": "Вирівнювання по центру",
|
|
71
|
+
"right": "Вирівнювання по правому краю",
|
|
72
|
+
"justify": "Вирівнювання по ширині"
|
|
72
73
|
},
|
|
73
|
-
"list": "
|
|
74
|
+
"list": "Список",
|
|
74
75
|
"lists": {
|
|
75
|
-
"bullet": "
|
|
76
|
-
"numbered": "
|
|
77
|
-
"task": "
|
|
78
|
-
"indent": "
|
|
79
|
-
"outdent": "
|
|
76
|
+
"bullet": "Ненумерований список",
|
|
77
|
+
"numbered": "Нумерований список",
|
|
78
|
+
"task": "Список задач",
|
|
79
|
+
"indent": "Збільшити відступ елемента списку",
|
|
80
|
+
"outdent": "Зменшити відступ елемента списку"
|
|
80
81
|
},
|
|
81
82
|
"dialog": {
|
|
82
|
-
"apply": "
|
|
83
|
-
"clear": "
|
|
84
|
-
"close": "
|
|
83
|
+
"apply": "Застосувати",
|
|
84
|
+
"clear": "Очистити",
|
|
85
|
+
"close": "Закрити",
|
|
85
86
|
"image": {
|
|
86
|
-
"title": "
|
|
87
|
-
"src": "
|
|
87
|
+
"title": "Додавання/зміна зображення",
|
|
88
|
+
"src": "Джерело",
|
|
88
89
|
"alt": "alt",
|
|
89
|
-
"width": "
|
|
90
|
-
"height": "
|
|
90
|
+
"width": "Ширина",
|
|
91
|
+
"height": "Висота"
|
|
91
92
|
},
|
|
92
93
|
"link": {
|
|
93
|
-
"title": "
|
|
94
|
-
"href": "
|
|
95
|
-
"
|
|
94
|
+
"title": "Додавання/зміна посилання",
|
|
95
|
+
"href": "Адреса посилання",
|
|
96
|
+
"href_error": "Некоректна адреса посилання",
|
|
97
|
+
"target": "Відкривати у...",
|
|
98
|
+
"target_blank": "Новому вікні",
|
|
99
|
+
"target_self": "Поточному вікні",
|
|
96
100
|
"rel": "rel",
|
|
97
101
|
"class": "CSS клас"
|
|
98
102
|
},
|
|
103
|
+
"preview": {
|
|
104
|
+
"title": "Попередній перегляд"
|
|
105
|
+
},
|
|
99
106
|
"source": {
|
|
100
|
-
"title": "
|
|
107
|
+
"title": "Перегляд вихідного коду",
|
|
101
108
|
"prettify": "prettify"
|
|
102
109
|
}
|
|
103
110
|
},
|
|
104
111
|
"misc": {
|
|
105
|
-
"source": "
|
|
106
|
-
"preview": "
|
|
112
|
+
"source": "Перегляд вихідного коду",
|
|
113
|
+
"preview": "Попередній перегляд"
|
|
107
114
|
},
|
|
108
115
|
"footer": {
|
|
109
116
|
"words": "слова",
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import * as mdi from "@mdi/js";
|
|
2
|
-
import { Editor } from "@tiptap/vue-3";
|
|
3
|
-
import { fonts } from "@tiptapify/components/Toolbar/fonts";
|
|
4
|
-
import StyleColor from "@tiptapify/extensions/components/StyleColor.vue";
|
|
5
|
-
import { computed, markRaw, ref } from "vue";
|
|
6
|
-
|
|
7
|
-
interface MDIIcons {
|
|
8
|
-
[key: string]: string
|
|
9
|
-
}
|
|
10
|
-
const mdiIcons = mdi as MDIIcons
|
|
11
|
-
|
|
12
|
-
export function getStyleItems(editor: Editor, theme: any, fontMeasure: string, customHeadingLevels: Array<number> = []) {
|
|
13
|
-
const headingLevels = ref([1, 2, 3, 4, 5, 6])
|
|
14
|
-
if (customHeadingLevels.length) {
|
|
15
|
-
customHeadingLevels.forEach(level => {
|
|
16
|
-
if (level <= 0 || level > 6) {
|
|
17
|
-
throw new Error('customHeadingLevels must be between 1 and 6')
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
headingLevels.value = customHeadingLevels
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const fontSizes = [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 32, 48, 64, 96]
|
|
25
|
-
|
|
26
|
-
const lineHeights = [1, 1.5, 2, 3, 4]
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
heading: {
|
|
30
|
-
name: 'heading',
|
|
31
|
-
tooltip: 'style.heading',
|
|
32
|
-
icon: mdi.mdiFormatHeaderPound,
|
|
33
|
-
modelValue: null,
|
|
34
|
-
enabled: true,
|
|
35
|
-
props: {
|
|
36
|
-
color: computed(() => editor.isActive('heading') || editor.isActive('paragraph') ? 'primary' : ''),
|
|
37
|
-
},
|
|
38
|
-
children: [
|
|
39
|
-
{
|
|
40
|
-
name: `paragraph`,
|
|
41
|
-
tooltip: `style.paragraph`,
|
|
42
|
-
icon: mdiIcons[`mdiFormatParagraph`],
|
|
43
|
-
noI18n: true,
|
|
44
|
-
enabled: true,
|
|
45
|
-
props: {
|
|
46
|
-
color: computed(() => editor.isActive('paragraph') ? 'primary' : ''),
|
|
47
|
-
},
|
|
48
|
-
attrs: {
|
|
49
|
-
click: () => editor.chain().focus().setParagraph().run()
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
].concat(
|
|
53
|
-
headingLevels.value.map(level => {
|
|
54
|
-
return {
|
|
55
|
-
name: `H${level}`,
|
|
56
|
-
tooltip: `style.headings.h${level}`,
|
|
57
|
-
icon: mdiIcons[`mdiFormatHeader${level}`],
|
|
58
|
-
noI18n: true,
|
|
59
|
-
enabled: true,
|
|
60
|
-
props: {
|
|
61
|
-
color: computed(() => editor.isActive('heading', { level: level }) ? 'primary' : ''),
|
|
62
|
-
},
|
|
63
|
-
attrs: {
|
|
64
|
-
click: () => editor.chain().focus().toggleHeading({ level }).run()
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
)
|
|
69
|
-
},
|
|
70
|
-
fontFamily: {
|
|
71
|
-
name: 'font-family',
|
|
72
|
-
tooltip: 'style.fontFamily',
|
|
73
|
-
icon: mdi.mdiFormatFont,
|
|
74
|
-
modelValue: false,
|
|
75
|
-
enabled: true,
|
|
76
|
-
attrs: {
|
|
77
|
-
click: () => editor.chain().focus().unsetFontFamily().run()
|
|
78
|
-
},
|
|
79
|
-
children: fonts.map((font) => {
|
|
80
|
-
return {
|
|
81
|
-
name: font.name,
|
|
82
|
-
tooltip: '',
|
|
83
|
-
icon: '',
|
|
84
|
-
enabled: true,
|
|
85
|
-
noI18n: true,
|
|
86
|
-
props: {
|
|
87
|
-
color: computed(() => editor.isActive('textStyle', {fontFamily: font.fontFamily}) ? 'primary' : ''),
|
|
88
|
-
style: `font-family: ${font.fontFamily};`
|
|
89
|
-
},
|
|
90
|
-
attrs: {
|
|
91
|
-
click: () => editor.chain().focus().setFontFamily(font.fontFamily).run()
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
},
|
|
96
|
-
fontSize: {
|
|
97
|
-
name: 'font-size',
|
|
98
|
-
tooltip: 'style.fontSize',
|
|
99
|
-
icon: mdi.mdiFormatSize,
|
|
100
|
-
modelValue: false,
|
|
101
|
-
enabled: true,
|
|
102
|
-
attrs: {
|
|
103
|
-
click: () => editor.chain().focus().unsetFontSize().run()
|
|
104
|
-
},
|
|
105
|
-
children: fontSizes.map((fontSize) => {
|
|
106
|
-
return {
|
|
107
|
-
name: `${fontSize}${fontMeasure}`,
|
|
108
|
-
tooltip: '',
|
|
109
|
-
icon: '',
|
|
110
|
-
enabled: true,
|
|
111
|
-
noI18n: true,
|
|
112
|
-
props: {
|
|
113
|
-
color: computed(() => editor.isActive('textStyle', {fontSizes: fontSize}) ? 'primary' : ''),
|
|
114
|
-
},
|
|
115
|
-
attrs: {
|
|
116
|
-
click: () => editor.chain().focus().setFontSize(`${fontSize}${fontMeasure}`).run()
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
},
|
|
121
|
-
lineHeight: {
|
|
122
|
-
name: 'line-height',
|
|
123
|
-
tooltip: 'style.lineHeight',
|
|
124
|
-
icon: mdi.mdiFormatLineHeight,
|
|
125
|
-
modelValue: null,
|
|
126
|
-
enabled: true,
|
|
127
|
-
attrs: {
|
|
128
|
-
click: () => editor.chain().focus().unsetLineHeight().run()
|
|
129
|
-
},
|
|
130
|
-
children: lineHeights.map((lineHeight) => {
|
|
131
|
-
return {
|
|
132
|
-
name: lineHeight,
|
|
133
|
-
tooltip: '',
|
|
134
|
-
icon: '',
|
|
135
|
-
enabled: true,
|
|
136
|
-
noI18n: true,
|
|
137
|
-
props: {
|
|
138
|
-
color: computed(() => editor.isActive('textStyle', {lineHeights: lineHeight}) ? 'primary' : ''),
|
|
139
|
-
},
|
|
140
|
-
attrs: {
|
|
141
|
-
click: () => editor.chain().focus().setLineHeight(lineHeight.toString()).run()
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
})
|
|
145
|
-
},
|
|
146
|
-
highlight: {
|
|
147
|
-
name: 'highlight',
|
|
148
|
-
tooltip: 'style.color.highlight',
|
|
149
|
-
icon: mdi.mdiFormatColorFill,
|
|
150
|
-
icon2: mdi.mdiColorHelper,
|
|
151
|
-
enabled: true,
|
|
152
|
-
icon2Props: {
|
|
153
|
-
color: computed(() => {
|
|
154
|
-
const defaultColor = theme.global.current.value.dark ? '#fff' : '#000'
|
|
155
|
-
return editor.getAttributes('highlight').color || defaultColor
|
|
156
|
-
}),
|
|
157
|
-
style: 'filter: drop-shadow(rgba(0, 0, 0, .75) 1px 1px 2px);'
|
|
158
|
-
},
|
|
159
|
-
component: markRaw(StyleColor),
|
|
160
|
-
componentProps: {
|
|
161
|
-
fontColor: false,
|
|
162
|
-
backgroundColor: true,
|
|
163
|
-
color: computed(() => editor.getAttributes('highlight').color || ''),
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
color: {
|
|
167
|
-
name: 'color',
|
|
168
|
-
tooltip: 'style.color.text',
|
|
169
|
-
icon: mdi.mdiFormatColorText,
|
|
170
|
-
icon2: mdi.mdiColorHelper,
|
|
171
|
-
enabled: true,
|
|
172
|
-
icon2Props: {
|
|
173
|
-
color: computed(() => {
|
|
174
|
-
const defaultColor = theme.global.current.value.dark ? '#fff' : '#000'
|
|
175
|
-
return editor.getAttributes('textStyle').color || defaultColor
|
|
176
|
-
}),
|
|
177
|
-
style: 'filter: drop-shadow(rgba(0, 0, 0, .75) 1px 1px 2px);'
|
|
178
|
-
},
|
|
179
|
-
component: markRaw(StyleColor),
|
|
180
|
-
componentProps: {
|
|
181
|
-
fontColor: true,
|
|
182
|
-
backgroundColor: false,
|
|
183
|
-
color: computed(() => editor.getAttributes('textStyle').color || ''),
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
File without changes
|