tiptapify 0.0.10 → 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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/tiptapify.css +1 -1
  3. package/dist/tiptapify.mjs +17514 -17174
  4. package/dist/tiptapify.umd.js +37 -38
  5. package/package.json +40 -40
  6. package/src/components/Tiptapify.vue +2 -2
  7. package/src/components/Toolbar/GroupBtn.vue +2 -2
  8. package/src/components/Toolbar/GroupDropdown.vue +4 -4
  9. package/src/components/Toolbar/Index.vue +3 -2
  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/editorExtensions.ts +1 -1
  14. package/src/{components/Toolbar/items/actions.ts → composables/Toolbar/useActionsItems.ts} +6 -3
  15. package/src/{components/Toolbar/items/alignment.ts → composables/Toolbar/useAlignmentItems.ts} +12 -9
  16. package/src/{components/Toolbar/items/formatExtra.ts → composables/Toolbar/useFormatExtraItems.ts} +9 -6
  17. package/src/{components/Toolbar/items/format.ts → composables/Toolbar/useFormatItems.ts} +8 -5
  18. package/src/{components/Toolbar/items/list.ts → composables/Toolbar/useListItems.ts} +14 -11
  19. package/src/{components/Toolbar/items/media.ts → composables/Toolbar/useMediaItems.ts} +22 -20
  20. package/src/{components/Toolbar/items/misc.ts → composables/Toolbar/useMiscItems.ts} +9 -6
  21. package/src/{components/Toolbar/items/style.ts → composables/Toolbar/useStyleItems.ts} +106 -79
  22. package/src/{components/Toolbar/fonts.ts → constants/style.ts} +21 -0
  23. package/src/extensions/components/FontFamily.vue +82 -0
  24. package/src/extensions/components/FontSize.vue +83 -0
  25. package/src/extensions/components/LineHeight.vue +82 -0
  26. package/src/extensions/components/LinkDialog.vue +20 -4
  27. package/src/extensions/components/ShowSourceDialog.vue +3 -2
  28. package/src/extensions/link.ts +8 -0
  29. package/src/extensions/slash-commands.ts +1 -1
  30. package/src/i18n/index.ts +0 -1
  31. package/src/i18n/locales/ch.json +83 -82
  32. package/src/i18n/locales/cz.json +30 -29
  33. package/src/i18n/locales/de.json +26 -25
  34. package/src/i18n/locales/en.json +1 -0
  35. package/src/i18n/locales/es.json +28 -27
  36. package/src/i18n/locales/fr.json +28 -27
  37. package/src/i18n/locales/it.json +30 -29
  38. package/src/i18n/locales/la.json +60 -59
  39. package/src/i18n/locales/lt.json +36 -35
  40. package/src/i18n/locales/nl.json +29 -28
  41. package/src/i18n/locales/pl.json +30 -29
  42. package/src/i18n/locales/pt.json +28 -27
  43. package/src/i18n/locales/ru.json +1 -0
  44. package/src/i18n/locales/se.json +29 -28
  45. package/src/i18n/locales/ua.json +1 -0
  46. /package/src/{components → extensions/components}/CodeBlockComponent.vue +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tiptapify",
3
3
  "types": "./index.d.ts",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "description": "Tiptap3 editor with Vuetify3 menu implementation",
6
6
  "exports": {
7
7
  ".": {
@@ -53,48 +53,48 @@
53
53
  "repository": "https://github.com/IVoyt/tiptapify",
54
54
  "packageManager": "pnpm@10.12.1",
55
55
  "dependencies": {
56
- "@tiptap/core": "next",
57
- "@tiptap/extension-blockquote": "next",
58
- "@tiptap/extension-bold": "next",
59
- "@tiptap/extension-bubble-menu": "next",
60
- "@tiptap/extension-code": "next",
61
- "@tiptap/extension-code-block": "next",
62
- "@tiptap/extension-code-block-lowlight": "next",
63
- "@tiptap/extension-color": "next",
64
- "@tiptap/extension-document": "next",
65
- "@tiptap/extension-floating-menu": "next",
66
- "@tiptap/extension-font-family": "next",
67
- "@tiptap/extension-hard-break": "next",
68
- "@tiptap/extension-heading": "next",
69
- "@tiptap/extension-highlight": "next",
70
- "@tiptap/extension-horizontal-rule": "next",
71
- "@tiptap/extension-image": "next",
72
- "@tiptap/extension-italic": "next",
73
- "@tiptap/extension-link": "next",
74
- "@tiptap/extension-list": "next",
75
- "@tiptap/extension-list-item": "next",
76
- "@tiptap/extension-paragraph": "next",
77
- "@tiptap/extension-placeholder": "next",
78
- "@tiptap/extension-strike": "next",
79
- "@tiptap/extension-subscript": "next",
80
- "@tiptap/extension-superscript": "next",
81
- "@tiptap/extension-table": "next",
82
- "@tiptap/extension-task-item": "next",
83
- "@tiptap/extension-task-list": "next",
84
- "@tiptap/extension-text": "next",
85
- "@tiptap/extension-text-align": "next",
86
- "@tiptap/extension-text-style": "next",
87
- "@tiptap/extension-typography": "next",
88
- "@tiptap/extension-underline": "next",
89
- "@tiptap/extensions": "next",
90
- "@tiptap/pm": "next",
91
- "@tiptap/starter-kit": "next",
92
- "@tiptap/suggestion": "next",
93
- "@tiptap/vue-3": "next",
56
+ "@tiptap/core": "^3.0.7",
57
+ "@tiptap/extension-blockquote": "^3.0.7",
58
+ "@tiptap/extension-bold": "^3.0.7",
59
+ "@tiptap/extension-bubble-menu": "^3.0.7",
60
+ "@tiptap/extension-code": "^3.0.7",
61
+ "@tiptap/extension-code-block": "^3.0.7",
62
+ "@tiptap/extension-code-block-lowlight": "^3.0.7",
63
+ "@tiptap/extension-color": "^3.0.7",
64
+ "@tiptap/extension-document": "^3.0.7",
65
+ "@tiptap/extension-floating-menu": "^3.0.7",
66
+ "@tiptap/extension-font-family": "^3.0.7",
67
+ "@tiptap/extension-hard-break": "^3.0.7",
68
+ "@tiptap/extension-heading": "^3.0.7",
69
+ "@tiptap/extension-highlight": "^3.0.7",
70
+ "@tiptap/extension-horizontal-rule": "^3.0.7",
71
+ "@tiptap/extension-image": "^3.0.7",
72
+ "@tiptap/extension-italic": "^3.0.7",
73
+ "@tiptap/extension-link": "^3.0.7",
74
+ "@tiptap/extension-list": "^3.0.7",
75
+ "@tiptap/extension-list-item": "^3.0.7",
76
+ "@tiptap/extension-paragraph": "^3.0.7",
77
+ "@tiptap/extension-placeholder": "^3.0.7",
78
+ "@tiptap/extension-strike": "^3.0.7",
79
+ "@tiptap/extension-subscript": "^3.0.7",
80
+ "@tiptap/extension-superscript": "^3.0.7",
81
+ "@tiptap/extension-table": "^3.0.7",
82
+ "@tiptap/extension-task-item": "^3.0.7",
83
+ "@tiptap/extension-task-list": "^3.0.7",
84
+ "@tiptap/extension-text": "^3.0.7",
85
+ "@tiptap/extension-text-align": "^3.0.7",
86
+ "@tiptap/extension-text-style": "^3.0.7",
87
+ "@tiptap/extension-typography": "^3.0.7",
88
+ "@tiptap/extension-underline": "^3.0.7",
89
+ "@tiptap/extensions": "^3.0.7",
90
+ "@tiptap/pm": "^3.0.7",
91
+ "@tiptap/starter-kit": "^3.0.7",
92
+ "@tiptap/suggestion": "^3.0.7",
93
+ "@tiptap/vue-3": "^3.0.7",
94
94
  "highlight.js": "^11.11.1",
95
95
  "linkifyjs": "^4.3.1",
96
96
  "lowlight": "^3.3.0",
97
- "vue-i18n": "^11.1.9"
97
+ "vue-i18n": "^11.1.10"
98
98
  },
99
99
  "peerDependencies": {
100
100
  "@mdi/js": "^7.4.47",
@@ -32,7 +32,7 @@ const props = defineProps({
32
32
  defaultFontFamily: { type: String, default () { return 'Inter' } },
33
33
  fontMeasure: { type: String, default () { return 'px' } },
34
34
  rounded: { type: String, default () { return '0' } },
35
- overrideExtensionsComponents: { type: Object as PropType<extensionsComponents>, default() { return {} } },
35
+ customExtensions: { type: Object as PropType<extensionsComponents>, default() { return {} } },
36
36
  })
37
37
 
38
38
  // console.log('override extension components', computed(() => props.overrideExtensionsComponents).value)
@@ -80,7 +80,7 @@ onBeforeUnmount(() => {
80
80
  :items="items"
81
81
  :items-exclude="itemsExclude"
82
82
  :rounded="rounded"
83
- :override-extensions-components="overrideExtensionsComponents"
83
+ :custom-extensions="customExtensions"
84
84
  :theme="currentTheme"
85
85
  />
86
86
  </template>
@@ -14,11 +14,11 @@ const { t } = useI18n();
14
14
 
15
15
  <template>
16
16
  <VBtn v-bind="toolbarItem?.props ?? {}" v-on="toolbarItem?.attrs ?? {}" size="32">
17
- <VTooltip :text="t(toolbarItem.tooltip)" location="top" activator="parent" />
17
+ <VTooltip :text="toolbarItem.tooltip" location="top" activator="parent" />
18
18
 
19
19
  <VIcon v-if="toolbarItem.icon" :icon="toolbarItem.icon" size="small" />
20
20
  <span v-else class="menu-item-title">
21
- {{ t(toolbarItem.name) }}
21
+ {{ toolbarItem.name }}
22
22
  </span>
23
23
 
24
24
  <VIcon v-if="toolbarItem.icon2" v-bind="toolbarItem?.icon2Props ?? {}" :icon="toolbarItem.icon2" size="small" style="position: absolute;" />
@@ -18,11 +18,11 @@ const { t } = useI18n();
18
18
  <VMenu v-model="toolbarItem.modelValue" v-bind="toolbarItem.props">
19
19
  <template v-if="!nested" #activator="{ props: menuProps }">
20
20
  <VBtn v-bind="{ ...menuProps, ...toolbarItem.props }" size="32">
21
- <VTooltip :text="t(toolbarItem.tooltip)" location="top" activator="parent" />
21
+ <VTooltip :text="toolbarItem.tooltip" location="top" activator="parent" />
22
22
 
23
23
  <VIcon v-if="toolbarItem.icon" :icon="toolbarItem.icon" size="small" />
24
24
  <span v-else class="menu-item-title">
25
- {{ t(toolbarItem.name) }}
25
+ {{ toolbarItem.name }}
26
26
  </span>
27
27
  </VBtn>
28
28
  </template>
@@ -43,7 +43,7 @@ const { t } = useI18n();
43
43
  v-bind="item.props ?? {}"
44
44
  v-on="item?.attrs ?? {}"
45
45
  >
46
- <VTooltip v-if="item.tooltip" :text="t(item.tooltip)" location="top" activator="parent" />
46
+ <VTooltip v-if="item.tooltip" :text="item.tooltip" location="top" activator="parent" />
47
47
 
48
48
  <VIcon v-if="item.icon" :icon="item.icon" size="small" />
49
49
 
@@ -52,7 +52,7 @@ const { t } = useI18n();
52
52
  {{ item.name }}
53
53
  </template>
54
54
  <template v-else>
55
- {{ t(item.toggle) }}
55
+ {{ item.toggle }}
56
56
  </template>
57
57
  </span>
58
58
 
@@ -20,7 +20,7 @@ const props = defineProps({
20
20
  theme: { type: String, default() { return 'light' } },
21
21
  rounded: { type: String, default() { return '0' } },
22
22
  toolbarScrollable: { type: Boolean, default() { return false } },
23
- overrideExtensionsComponents: { type: Object as PropType<extensionsComponents>, default() { return {} } },
23
+ customExtensions: { type: Object as PropType<extensionsComponents>, default() { return {} } },
24
24
  })
25
25
 
26
26
  const editor = inject('tiptapifyEditor') as Ref<Editor>
@@ -39,7 +39,7 @@ const defaultComponents: extensionsComponents = getDefaultComponents(props.varia
39
39
 
40
40
  const extensions: ShallowRef<extensionsComponents> = shallowRef({})
41
41
  Object.keys(defaultComponents).forEach(extension => {
42
- extensions.value[extension] = props.overrideExtensionsComponents[extension] ?? defaultComponents[extension]
42
+ extensions.value[extension] = props.customExtensions[extension] ?? defaultComponents[extension]
43
43
  })
44
44
 
45
45
  </script>
@@ -54,6 +54,7 @@ Object.keys(defaultComponents).forEach(extension => {
54
54
  <Items v-else :items="items" />
55
55
  </VToolbar>
56
56
 
57
+ <!-- mount components mentioned in "items" -->
57
58
  <template v-for="extension in extensions">
58
59
  <component :is="extension.component" v-bind="extension?.props ?? {}" />
59
60
  </template>
@@ -36,11 +36,11 @@ const toolbarItemsRef: Ref<ToolbarItemSections> = ref(computed(() => props.items
36
36
  elevation="4"
37
37
  rounded="sm"
38
38
  >
39
- <VTooltip :text="t(toolbarItem.tooltip)" location="top" activator="parent" />
39
+ <VTooltip :text="toolbarItem.tooltip" location="top" activator="parent" />
40
40
 
41
41
  <VIcon v-if="toolbarItem.icon" :icon="toolbarItem.icon" size="16" />
42
42
  <span v-else class="menu-item-title">
43
- {{ t(toolbarItem.name) }}
43
+ {{ toolbarItem.name }}
44
44
  </span>
45
45
  </VBtn>
46
46
 
@@ -17,11 +17,11 @@ const { t } = useI18n();
17
17
  <VBtnToggle :variant="variant" elevation="4">
18
18
  <template v-for="(item, key) in toolbarSection.items" :key="key">
19
19
  <VBtn v-bind="item.props" v-on="item.attrs" size="32">
20
- <VTooltip :text="t(item.name)" location="top" activator="parent" />
20
+ <VTooltip :text="item.name" location="top" activator="parent" />
21
21
 
22
22
  <VIcon v-if="item.icon" :icon="item.icon" size="small" />
23
23
  <span v-else class="menu-item-title">
24
- {{ t(item.name) }}
24
+ {{ item.name }}
25
25
  </span>
26
26
  </VBtn>
27
27
  </template>
@@ -1,11 +1,11 @@
1
- import { getActionsItems } from "@tiptapify/components/Toolbar/items/actions";
2
- import { getAlignmentItems } from "@tiptapify/components/Toolbar/items/alignment";
3
- import { getFormatExtraItems } from "@tiptapify/components/Toolbar/items/formatExtra";
4
- import { getFormatItems } from "@tiptapify/components/Toolbar/items/format";
5
- import { getListItems } from "@tiptapify/components/Toolbar/items/list";
6
- import { getMediaItems } from "@tiptapify/components/Toolbar/items/media";
7
- import { getMiscItems } from "@tiptapify/components/Toolbar/items/misc";
8
- import { getStyleItems } from "@tiptapify/components/Toolbar/items/style";
1
+ import { useActionsItems } from "@tiptapify/composables/Toolbar/useActionsItems";
2
+ import { useAlignmentItems } from "@tiptapify/composables/Toolbar/useAlignmentItems";
3
+ import { useFormatExtraItems } from "@tiptapify/composables/Toolbar/useFormatExtraItems";
4
+ import { useFormatItems } from "@tiptapify/composables/Toolbar/useFormatItems";
5
+ import { useListItems } from "@tiptapify/composables/Toolbar/useListItems";
6
+ import { useMediaItems } from "@tiptapify/composables/Toolbar/useMediaItems";
7
+ import { useMiscItems } from "@tiptapify/composables/Toolbar/useMiscItems";
8
+ import { useStyleItems } from "@tiptapify/composables/Toolbar/useStyleItems";
9
9
  import { ComputedRef, ref } from "vue";
10
10
 
11
11
  interface ToolbarItemAttrs {
@@ -17,8 +17,8 @@ interface ToolbarItemProps {
17
17
  }
18
18
 
19
19
  export interface ToolbarItem {
20
- name: string|number,
21
- tooltip: string,
20
+ name: string|number|ComputedRef<string>,
21
+ tooltip: string|ComputedRef<string>,
22
22
  icon: string|ComputedRef<string>,
23
23
  icon2?: string|ComputedRef<string>,
24
24
  noI18n?: boolean,
@@ -55,20 +55,20 @@ export function toolbarItems(
55
55
  items: { list: Array<string>, exclude: boolean },
56
56
  customHeadingLevels: Array<number>
57
57
  ): ToolbarItemSections {
58
- const styleItems = ref(getStyleItems(editor.value, theme, fontMeasure, customHeadingLevels))
59
- const formatItems = ref(getFormatItems(editor.value))
60
- const formatExtraItems = ref(getFormatExtraItems(editor.value))
61
- const alignmentItems = ref(getAlignmentItems(editor.value))
62
- const listItems = ref(getListItems(editor.value))
63
- const actionsItems = ref(getActionsItems(editor.value))
64
- const miscItems = ref(getMiscItems(editor.value))
65
- const mediaItems = ref(getMediaItems(editor.value))
58
+ const styleItems = ref(useStyleItems(editor.value, theme, fontMeasure, customHeadingLevels))
59
+ const formatItems = ref(useFormatItems(editor.value))
60
+ const formatExtraItems = ref(useFormatExtraItems(editor.value))
61
+ const alignmentItems = ref(useAlignmentItems(editor.value))
62
+ const listItems = ref(useListItems(editor.value))
63
+ const actionsItems = ref(useActionsItems(editor.value))
64
+ const miscItems = ref(useMiscItems(editor.value))
65
+ const mediaItems = ref(useMediaItems(editor.value))
66
66
 
67
67
  const allMenuItems: ToolbarItemSections = {
68
68
  /**
69
69
  * todo
70
70
  *
71
- * media (image, video)
71
+ * media (video)
72
72
  */
73
73
  style: { group: true, items: styleItems.value },
74
74
  format: { group: true, items: formatItems.value },
@@ -95,7 +95,7 @@ export function toolbarItems(
95
95
 
96
96
  const toolbarItems: ToolbarItemSections = {}
97
97
 
98
- const sections = {}
98
+ const sections: { [key: string]: number } = {}
99
99
 
100
100
  Object.keys(allMenuItems).forEach(sectionName => {
101
101
  const section = allMenuItems[sectionName]
@@ -25,7 +25,7 @@ import { CodeBlockLowlight } from '@tiptap/extension-code-block-lowlight'
25
25
 
26
26
  import { TiptapifyLink } from '@tiptapify/extensions/link'
27
27
  import { TiptapifyImage } from '@tiptapify/extensions/image'
28
- import CodeBlockComponent from '@tiptapify/components/CodeBlockComponent.vue'
28
+ import CodeBlockComponent from '@tiptapify/extensions/components/CodeBlockComponent.vue'
29
29
  import { ViewSource } from '@tiptapify/extensions/view-source'
30
30
  import { Preview } from '@tiptapify/extensions/preview'
31
31
  import SlashCommands from '@tiptapify/extensions/slash-commands'
@@ -1,12 +1,15 @@
1
1
  import * as mdi from "@mdi/js";
2
2
  import { Editor } from "@tiptap/vue-3";
3
3
  import { computed } from "vue";
4
+ import { useI18n } from "vue-i18n";
5
+
6
+ export function useActionsItems(editor: Editor) {
7
+ const { t } = useI18n();
4
8
 
5
- export function getActionsItems(editor: Editor) {
6
9
  return {
7
10
  undo: {
8
11
  name: 'undo',
9
- tooltip: 'action.undo',
12
+ tooltip: computed(() => t('action.undo')),
10
13
  icon: mdi.mdiUndo,
11
14
  enabled: true,
12
15
  props: {
@@ -18,7 +21,7 @@ export function getActionsItems(editor: Editor) {
18
21
  },
19
22
  redo: {
20
23
  name: 'redo',
21
- tooltip: 'action.redo',
24
+ tooltip: computed(() => t('action.redo')),
22
25
  icon: mdi.mdiRedo,
23
26
  enabled: true,
24
27
  props: {
@@ -1,12 +1,15 @@
1
1
  import * as mdi from "@mdi/js";
2
2
  import { Editor } from "@tiptap/vue-3";
3
3
  import { computed } from "vue";
4
+ import { useI18n } from "vue-i18n";
5
+
6
+ export function useAlignmentItems(editor: Editor) {
7
+ const { t } = useI18n();
4
8
 
5
- export function getAlignmentItems(editor: Editor) {
6
9
  return {
7
10
  alignmentLeft: {
8
- name: 'alignments.left',
9
- tooltip: 'alignments.left',
11
+ name: computed(() => t('alignments.left')),
12
+ tooltip: computed(() => t('alignments.left')),
10
13
  icon: mdi.mdiFormatAlignLeft,
11
14
  enabled: true,
12
15
  props: {
@@ -18,8 +21,8 @@ export function getAlignmentItems(editor: Editor) {
18
21
  }
19
22
  },
20
23
  alignmentCenter: {
21
- name: 'alignments.center',
22
- tooltip: 'alignments.center',
24
+ name: computed(() => t('alignments.center')),
25
+ tooltip: computed(() => t('alignments.center')),
23
26
  icon: mdi.mdiFormatAlignCenter,
24
27
  enabled: true,
25
28
  props: {
@@ -31,8 +34,8 @@ export function getAlignmentItems(editor: Editor) {
31
34
  }
32
35
  },
33
36
  alignmentRight: {
34
- name: 'alignments.right',
35
- tooltip: 'alignments.right',
37
+ name: computed(() => t('alignments.right')),
38
+ tooltip: computed(() => t('alignments.right')),
36
39
  icon: mdi.mdiFormatAlignRight,
37
40
  enabled: true,
38
41
  props: {
@@ -44,8 +47,8 @@ export function getAlignmentItems(editor: Editor) {
44
47
  }
45
48
  },
46
49
  alignmentJustify: {
47
- name: 'alignments.justify',
48
- tooltip: 'alignments.justify',
50
+ name: computed(() => t('alignments.justify')),
51
+ tooltip: computed(() => t('alignments.justify')),
49
52
  icon: mdi.mdiFormatAlignJustify,
50
53
  enabled: true,
51
54
  props: {
@@ -1,12 +1,15 @@
1
1
  import * as mdi from "@mdi/js";
2
2
  import { Editor } from "@tiptap/vue-3";
3
3
  import { computed } from "vue";
4
+ import { useI18n } from "vue-i18n";
5
+
6
+ export function useFormatExtraItems(editor: Editor) {
7
+ const { t } = useI18n();
4
8
 
5
- export function getFormatExtraItems(editor: Editor) {
6
9
  return {
7
10
  sup: {
8
11
  name: 'sup',
9
- tooltip: 'format.sup',
12
+ tooltip: computed(() => t('format.sup')),
10
13
  icon: mdi.mdiFormatSuperscript,
11
14
  enabled: true,
12
15
  props: {
@@ -19,7 +22,7 @@ export function getFormatExtraItems(editor: Editor) {
19
22
  },
20
23
  sub: {
21
24
  name: 'sub',
22
- tooltip: 'format.sub',
25
+ tooltip: computed(() => t('format.sub')),
23
26
  icon: mdi.mdiFormatSubscript,
24
27
  enabled: true,
25
28
  props: {
@@ -32,7 +35,7 @@ export function getFormatExtraItems(editor: Editor) {
32
35
  },
33
36
  code: {
34
37
  name: 'code',
35
- tooltip: 'format.code',
38
+ tooltip: computed(() => t('format.code')),
36
39
  icon: mdi.mdiXml,
37
40
  enabled: true,
38
41
  props: {
@@ -45,7 +48,7 @@ export function getFormatExtraItems(editor: Editor) {
45
48
  },
46
49
  codeBlock: {
47
50
  name: 'codeblock',
48
- tooltip: 'format.codeblock',
51
+ tooltip: computed(() => t('format.codeblock')),
49
52
  icon: mdi.mdiCodeBlockTags,
50
53
  enabled: true,
51
54
  props: {
@@ -58,7 +61,7 @@ export function getFormatExtraItems(editor: Editor) {
58
61
  },
59
62
  blockquote: {
60
63
  name: 'blockquote',
61
- tooltip: 'format.blockquote',
64
+ tooltip: computed(() => t('format.blockquote')),
62
65
  icon: mdi.mdiCommentQuote,
63
66
  enabled: true,
64
67
  props: {
@@ -1,12 +1,15 @@
1
1
  import * as mdi from "@mdi/js";
2
2
  import { Editor } from "@tiptap/vue-3";
3
3
  import { computed } from "vue";
4
+ import { useI18n } from "vue-i18n";
5
+
6
+ export function useFormatItems(editor: Editor) {
7
+ const { t } = useI18n();
4
8
 
5
- export function getFormatItems(editor: Editor) {
6
9
  return {
7
10
  bold: {
8
11
  name: 'bold',
9
- tooltip: 'format.bold',
12
+ tooltip: computed(() => t('format.bold')),
10
13
  icon: mdi.mdiFormatBold,
11
14
  enabled: true,
12
15
  props: {
@@ -19,7 +22,7 @@ export function getFormatItems(editor: Editor) {
19
22
  },
20
23
  italic: {
21
24
  name: 'italic',
22
- tooltip: 'format.italic',
25
+ tooltip: computed(() => t('format.italic')),
23
26
  icon: mdi.mdiFormatItalic,
24
27
  enabled: true,
25
28
  props: {
@@ -32,7 +35,7 @@ export function getFormatItems(editor: Editor) {
32
35
  },
33
36
  underline: {
34
37
  name: 'underline',
35
- tooltip: 'format.underline',
38
+ tooltip: computed(() => t('format.underline')),
36
39
  icon: mdi.mdiFormatUnderline,
37
40
  enabled: true,
38
41
  props: {
@@ -45,7 +48,7 @@ export function getFormatItems(editor: Editor) {
45
48
  },
46
49
  strike: {
47
50
  name: 'strike',
48
- tooltip: 'format.strike',
51
+ tooltip: computed(() => t('format.strike')),
49
52
  icon: mdi.mdiFormatStrikethroughVariant,
50
53
  enabled: true,
51
54
  props: {
@@ -1,12 +1,15 @@
1
1
  import * as mdi from "@mdi/js";
2
2
  import { Editor } from "@tiptap/vue-3";
3
3
  import { computed } from "vue";
4
+ import { useI18n } from "vue-i18n";
5
+
6
+ export function useListItems(editor: Editor) {
7
+ const { t } = useI18n();
4
8
 
5
- export function getListItems(editor: Editor) {
6
9
  return {
7
10
  listBullet: {
8
- name: 'lists.bullet',
9
- tooltip: 'lists.bullet',
11
+ name: computed(() => t('lists.bullet')),
12
+ tooltip: computed(() => t('lists.bullet')),
10
13
  icon: mdi.mdiFormatListBulleted,
11
14
  enabled: true,
12
15
  props: {
@@ -17,8 +20,8 @@ export function getListItems(editor: Editor) {
17
20
  }
18
21
  },
19
22
  listNumbered: {
20
- name: 'lists.numbered',
21
- tooltip: 'lists.numbered',
23
+ name: computed(() => t('lists.numbered')),
24
+ tooltip: computed(() => t('lists.numbered')),
22
25
  icon: mdi.mdiFormatListNumbered,
23
26
  enabled: true,
24
27
  props: {
@@ -29,8 +32,8 @@ export function getListItems(editor: Editor) {
29
32
  }
30
33
  },
31
34
  listTask: {
32
- name: 'lists.task',
33
- tooltip: 'lists.task',
35
+ name: computed(() => t('lists.task')),
36
+ tooltip: computed(() => t('lists.task')),
34
37
  icon: mdi.mdiFormatListChecks,
35
38
  enabled: true,
36
39
  props: {
@@ -41,8 +44,8 @@ export function getListItems(editor: Editor) {
41
44
  }
42
45
  },
43
46
  listIndent: {
44
- name: 'lists.indent',
45
- tooltip: 'lists.indent',
47
+ name: computed(() => t('lists.indent')),
48
+ tooltip: computed(() => t('lists.indent')),
46
49
  icon: mdi.mdiFormatIndentIncrease,
47
50
  enabled: true,
48
51
  props: {
@@ -54,8 +57,8 @@ export function getListItems(editor: Editor) {
54
57
  }
55
58
  },
56
59
  listOutdent: {
57
- name: 'lists.outdent',
58
- tooltip: 'lists.outdent',
60
+ name: computed(() => t('lists.outdent')),
61
+ tooltip: computed(() => t('lists.outdent')),
59
62
  icon: mdi.mdiFormatIndentDecrease,
60
63
  enabled: true,
61
64
  props: {