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.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/tiptapify.css +1 -1
  3. package/dist/tiptapify.mjs +21133 -19765
  4. package/dist/tiptapify.umd.js +37 -38
  5. package/package.json +43 -43
  6. package/src/components/Tiptapify.vue +2 -2
  7. package/src/components/Toolbar/GroupBtn.vue +2 -6
  8. package/src/components/Toolbar/GroupDropdown.vue +4 -8
  9. package/src/components/Toolbar/Index.vue +5 -4
  10. package/src/components/Toolbar/Items.vue +2 -2
  11. package/src/components/Toolbar/Toggle.vue +2 -2
  12. package/src/components/Toolbar/items.ts +20 -20
  13. package/src/components/UI/Dialog.vue +141 -0
  14. package/src/components/editorExtensions.ts +1 -1
  15. package/src/{components/Toolbar/items/actions.ts → composables/Toolbar/useActionsItems.ts} +6 -3
  16. package/src/{components/Toolbar/items/alignment.ts → composables/Toolbar/useAlignmentItems.ts} +12 -9
  17. package/src/{components/Toolbar/items/formatExtra.ts → composables/Toolbar/useFormatExtraItems.ts} +10 -7
  18. package/src/{components/Toolbar/items/format.ts → composables/Toolbar/useFormatItems.ts} +20 -17
  19. package/src/{components/Toolbar/items/list.ts → composables/Toolbar/useListItems.ts} +14 -11
  20. package/src/{components/Toolbar/items/media.ts → composables/Toolbar/useMediaItems.ts} +22 -20
  21. package/src/{components/Toolbar/items/misc.ts → composables/Toolbar/useMiscItems.ts} +9 -6
  22. package/src/composables/Toolbar/useStyleItems.ts +231 -0
  23. package/src/{components/Toolbar/fonts.ts → constants/style.ts} +21 -0
  24. package/src/extensions/components/FontFamily.vue +82 -0
  25. package/src/extensions/components/FontSize.vue +83 -0
  26. package/src/extensions/components/ImageDialog.vue +17 -29
  27. package/src/extensions/components/LineHeight.vue +82 -0
  28. package/src/extensions/components/LinkDialog.vue +75 -44
  29. package/src/extensions/components/PreviewDialog.vue +8 -16
  30. package/src/extensions/components/ShowSourceDialog.vue +17 -18
  31. package/src/extensions/components/StyleColor.vue +68 -15
  32. package/src/extensions/components/TableBuilder.vue +3 -6
  33. package/src/extensions/link.ts +8 -0
  34. package/src/extensions/slash-commands.ts +1 -1
  35. package/src/i18n/index.ts +0 -1
  36. package/src/i18n/locales/ch.json +119 -0
  37. package/src/i18n/locales/cz.json +119 -0
  38. package/src/i18n/locales/de.json +83 -76
  39. package/src/i18n/locales/en.json +82 -75
  40. package/src/i18n/locales/es.json +80 -73
  41. package/src/i18n/locales/fr.json +81 -73
  42. package/src/i18n/locales/it.json +80 -73
  43. package/src/i18n/locales/la.json +119 -0
  44. package/src/i18n/locales/lt.json +119 -0
  45. package/src/i18n/locales/nl.json +119 -0
  46. package/src/i18n/locales/pl.json +80 -74
  47. package/src/i18n/locales/pt.json +119 -0
  48. package/src/i18n/locales/ru.json +78 -71
  49. package/src/i18n/locales/se.json +119 -0
  50. package/src/i18n/locales/ua.json +79 -72
  51. package/src/components/Toolbar/items/style.ts +0 -187
  52. /package/src/{components → extensions/components}/CodeBlockComponent.vue +0 -0
@@ -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": "заголовок 1-го рівня",
10
- "h2": "заголовок 2-го рівня",
11
- "h3": "заголовок 3-го рівня",
12
- "h4": "заголовок 4-го рівня",
13
- "h5": "заголовок 5-го рівня",
14
- "h6": "заголовок 6-го рівня"
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
- "target": "відкривати у новому вікні",
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
- }