tiptapify 0.1.3 → 0.1.5

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 (110) hide show
  1. package/dist/tiptapify.css +2 -1
  2. package/dist/tiptapify.mjs +64316 -50753
  3. package/dist/tiptapify.umd.js +88 -78
  4. package/index.d.ts +97 -40
  5. package/package.json +65 -66
  6. package/src/components/Footer.vue +4 -3
  7. package/src/components/MenuBubble.vue +16 -16
  8. package/src/components/MenuFloating.vue +13 -13
  9. package/src/components/Tiptapify.vue +31 -16
  10. package/src/components/Toolbar/Index.vue +21 -17
  11. package/src/components/Toolbar/Items.vue +9 -8
  12. package/src/components/Toolbar/actions.ts +3 -3
  13. package/src/components/Toolbar/alignment.ts +5 -5
  14. package/src/components/Toolbar/format.ts +5 -5
  15. package/src/components/Toolbar/formatExtra.ts +6 -6
  16. package/src/components/Toolbar/items.ts +8 -8
  17. package/src/components/Toolbar/list.ts +6 -6
  18. package/src/components/Toolbar/media.ts +8 -8
  19. package/src/components/Toolbar/misc.ts +8 -8
  20. package/src/components/Toolbar/style.ts +7 -7
  21. package/src/components/UI/TiptapifyDialog.vue +14 -13
  22. package/src/components/editorExtensions.ts +2 -2
  23. package/src/components/index.ts +6 -6
  24. package/src/constants/style.ts +4 -3
  25. package/src/extensions/charmap/arrows.ts +700 -700
  26. package/src/extensions/charmap/box_drawing.ts +184 -184
  27. package/src/extensions/charmap/currency.ts +93 -93
  28. package/src/extensions/charmap/cyrillic.ts +368 -368
  29. package/src/extensions/charmap/diacritics.ts +60 -60
  30. package/src/extensions/charmap/extended_letters.ts +748 -748
  31. package/src/extensions/charmap/greek.ts +252 -252
  32. package/src/extensions/charmap/hebrew.ts +105 -105
  33. package/src/extensions/charmap/math.ts +1684 -1684
  34. package/src/extensions/charmap/punctuation.ts +68 -68
  35. package/src/extensions/charmap/symbols.ts +288 -288
  36. package/src/extensions/charmap/typography.ts +284 -284
  37. package/src/extensions/components/CodeBlockComponent.vue +2 -2
  38. package/src/extensions/components/actions/redo/Button.vue +12 -10
  39. package/src/extensions/components/actions/undo/Button.vue +12 -10
  40. package/src/extensions/components/alignment/center/Button.vue +11 -9
  41. package/src/extensions/components/alignment/justify/Button.vue +11 -9
  42. package/src/extensions/components/alignment/left/Button.vue +11 -9
  43. package/src/extensions/components/alignment/right/Button.vue +11 -9
  44. package/src/extensions/components/format/bold/Button.vue +12 -10
  45. package/src/extensions/components/format/italic/Button.vue +12 -10
  46. package/src/extensions/components/format/strike/Button.vue +12 -10
  47. package/src/extensions/components/format/underline/Button.vue +5 -3
  48. package/src/extensions/components/formatExtra/code/Button.vue +12 -10
  49. package/src/extensions/components/formatExtra/codeBlock/Button.vue +12 -10
  50. package/src/extensions/components/formatExtra/quote/Button.vue +12 -10
  51. package/src/extensions/components/formatExtra/sub/Button.vue +12 -10
  52. package/src/extensions/components/formatExtra/sup/Button.vue +12 -10
  53. package/src/extensions/components/list/bullet/Button.vue +21 -19
  54. package/src/extensions/components/list/bullet/index.ts +1 -1
  55. package/src/extensions/components/list/indent/Button.vue +13 -11
  56. package/src/extensions/components/list/numbered/Button.vue +12 -10
  57. package/src/extensions/components/list/outdent/Button.vue +13 -11
  58. package/src/extensions/components/list/task/Button.vue +12 -10
  59. package/src/extensions/components/media/charmap/Button.vue +8 -5
  60. package/src/extensions/components/media/charmap/Picker.vue +20 -18
  61. package/src/extensions/components/media/emoji/Button.vue +8 -6
  62. package/src/extensions/components/media/emoji/Picker.vue +20 -18
  63. package/src/extensions/components/media/iframe/Button.vue +13 -11
  64. package/src/extensions/components/media/iframe/IframeDialog.vue +27 -25
  65. package/src/extensions/components/media/image/Button.vue +12 -10
  66. package/src/extensions/components/media/image/ImageDialog.vue +46 -42
  67. package/src/extensions/components/media/link/Button.vue +12 -11
  68. package/src/extensions/components/media/link/LinkDialog.vue +34 -32
  69. package/src/extensions/components/media/link/index.ts +6 -7
  70. package/src/extensions/components/media/table/Button.vue +21 -19
  71. package/src/extensions/components/media/table/ColumnActions.vue +5 -4
  72. package/src/extensions/components/media/table/RowActions.vue +5 -4
  73. package/src/extensions/components/media/table/TableBuilder.vue +15 -13
  74. package/src/extensions/components/media/video/Button.vue +12 -10
  75. package/src/extensions/components/media/video/VideoDialog.vue +33 -15
  76. package/src/extensions/components/misc/break/Button.vue +8 -6
  77. package/src/extensions/components/misc/formatClear/Button.vue +12 -10
  78. package/src/extensions/components/misc/fullscreen/Button.vue +20 -18
  79. package/src/extensions/components/misc/invisibleChar/Button.vue +11 -9
  80. package/src/extensions/components/misc/line/Button.vue +11 -9
  81. package/src/extensions/components/misc/preview/Button.vue +11 -9
  82. package/src/extensions/components/misc/source/Button.vue +9 -7
  83. package/src/extensions/components/misc/source/ShowSourceDialog.vue +27 -25
  84. package/src/extensions/components/slashCommands/CommandsList.vue +3 -1
  85. package/src/extensions/components/style/StyleColor.vue +26 -22
  86. package/src/extensions/components/style/color/Button.vue +19 -17
  87. package/src/extensions/components/style/fontFamily/Button.vue +16 -14
  88. package/src/extensions/components/style/fontFamily/FontFamily.vue +3 -2
  89. package/src/extensions/components/style/fontSize/Button.vue +17 -15
  90. package/src/extensions/components/style/fontSize/FontSize.vue +4 -3
  91. package/src/extensions/components/style/heading/Button.vue +19 -16
  92. package/src/extensions/components/style/highlight/Button.vue +19 -17
  93. package/src/extensions/components/style/lineHeight/Button.vue +16 -14
  94. package/src/extensions/components/style/lineHeight/FontFamily.vue +3 -2
  95. package/src/extensions/components/style/lineHeight/LineHeight.vue +3 -2
  96. package/src/extensions/emoji/activities.ts +534 -534
  97. package/src/extensions/emoji/animals_and_nature.ts +978 -978
  98. package/src/extensions/emoji/component.ts +54 -54
  99. package/src/extensions/emoji/flags.ts +1644 -1644
  100. package/src/extensions/emoji/food_and_drink.ts +810 -810
  101. package/src/extensions/emoji/objects.ts +1608 -1608
  102. package/src/extensions/emoji/people_and_body.ts +2022 -2022
  103. package/src/extensions/emoji/smileys_and_emotion.ts +1038 -1038
  104. package/src/extensions/emoji/symbols.ts +1290 -1290
  105. package/src/extensions/emoji/travel_and_places.ts +1332 -1332
  106. package/src/index.ts +15 -5
  107. package/src/types/editor.ts +10 -0
  108. package/src/types/slashCommandsTypes.ts +1 -1
  109. package/src/types/toolbarTypes.ts +3 -1
  110. package/src/utils/helpers.ts +1 -1
@@ -20,14 +20,14 @@ const selectedLanguage = computed({
20
20
 
21
21
  <template>
22
22
  <NodeViewWrapper class="code-block">
23
- <select contenteditable="false" v-model="selectedLanguage">
23
+ <select v-model="selectedLanguage" contenteditable="false">
24
24
  <option :value="null">
25
25
  auto
26
26
  </option>
27
27
  <option disabled>
28
28
 
29
29
  </option>
30
- <option v-for="(language, index) in languages" :value="language" :key="index">
30
+ <option v-for="(language, index) in languages" :key="index" :value="language">
31
31
  {{ language }}
32
32
  </option>
33
33
  </select>
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :disabled="!editor.can().chain().focus().redo().run()"
23
- size="32"
24
- color=""
25
- :variant="variantBtn"
26
- @click="editor.chain().focus().redo().run()"
24
+ :disabled="!editor.can().chain().focus().redo().run()"
25
+ size="32"
26
+ color=""
27
+ :variant="variantBtn"
28
+ @click="editor.chain().focus().redo().run()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('action.redo') }}
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :disabled="!editor.can().chain().focus().undo().run()"
23
- size="32"
24
- color=""
25
- :variant="variantBtn"
26
- @click="editor.chain().focus().undo().run()"
24
+ :disabled="!editor.can().chain().focus().undo().run()"
25
+ size="32"
26
+ color=""
27
+ :variant="variantBtn"
28
+ @click="editor.chain().focus().undo().run()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('action.undo') }}
@@ -1,28 +1,30 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive({ textAlign: 'center' }) ? 'primary' : ''"
23
- :variant="variantBtn"
24
- @click="editor.chain().focus().toggleTextAlign('center').run()"
25
- size="32"
24
+ :color="editor.isActive({ textAlign: 'center' }) ? 'primary' : ''"
25
+ :variant="variantBtn"
26
+ size="32"
27
+ @click="editor.chain().focus().toggleTextAlign('center').run()"
26
28
  >
27
29
  <VTooltip activator="parent">
28
30
  {{ t('alignments.center') }}
@@ -1,28 +1,30 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive({ textAlign: 'justify' }) ? 'primary' : ''"
23
- :variant="variantBtn"
24
- @click="editor.chain().focus().toggleTextAlign('justify').run()"
25
- size="32"
24
+ :color="editor.isActive({ textAlign: 'justify' }) ? 'primary' : ''"
25
+ :variant="variantBtn"
26
+ size="32"
27
+ @click="editor.chain().focus().toggleTextAlign('justify').run()"
26
28
  >
27
29
  <VTooltip activator="parent">
28
30
  {{ t('alignments.justify') }}
@@ -1,28 +1,30 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive({ textAlign: 'left' }) ? 'primary' : ''"
23
- :variant="variantBtn"
24
- @click="editor.chain().focus().toggleTextAlign('left').run()"
25
- size="32"
24
+ :color="editor.isActive({ textAlign: 'left' }) ? 'primary' : ''"
25
+ :variant="variantBtn"
26
+ size="32"
27
+ @click="editor.chain().focus().toggleTextAlign('left').run()"
26
28
  >
27
29
  <VTooltip activator="parent">
28
30
  {{ t('alignments.left') }}
@@ -1,28 +1,30 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive({ textAlign: 'right' }) ? 'primary' : ''"
23
- :variant="variantBtn"
24
- @click="editor.chain().focus().toggleTextAlign('right').run()"
25
- size="32"
24
+ :color="editor.isActive({ textAlign: 'right' }) ? 'primary' : ''"
25
+ :variant="variantBtn"
26
+ size="32"
27
+ @click="editor.chain().focus().toggleTextAlign('right').run()"
26
28
  >
27
29
  <VTooltip activator="parent">
28
30
  {{ t('alignments.right') }}
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive('bold') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleBold().run()"
24
- :variant="variantBtn"
25
- @click="editor.commands.toggleBold()"
26
- size="32"
24
+ :color="editor.isActive('bold') ? 'primary' : ''"
25
+ :disabled="!editor.can().chain().focus().toggleBold().run()"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.toggleBold()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('format.bold') }}
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive('italic') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleItalic().run()"
24
- :variant="variantBtn"
25
- @click="editor.commands.toggleItalic()"
26
- size="32"
24
+ :color="editor.isActive('italic') ? 'primary' : ''"
25
+ :disabled="!editor.can().chain().focus().toggleItalic().run()"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.toggleItalic()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('format.italic') }}
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive('strike') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleStrike().run()"
24
- :variant="variantBtn"
25
- @click="editor.commands.toggleStrike()"
26
- size="32"
24
+ :color="editor.isActive('strike') ? 'primary' : ''"
25
+ :disabled="!editor.can().chain().focus().toggleStrike().run()"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.toggleStrike()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('format.strike') }}
@@ -3,17 +3,19 @@
3
3
  import * as mdi from '@mdi/js'
4
4
  import { Editor } from '@tiptap/vue-3'
5
5
  import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
- import { inject, Ref } from 'vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive('code') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleCode().run()"
24
- :variant="variantBtn"
25
- @click="editor.commands.toggleCode()"
26
- size="32"
24
+ :color="editor.isActive('code') ? 'primary' : ''"
25
+ :disabled="!editor.can().chain().focus().toggleCode().run()"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.toggleCode()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('format.code') }}
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive('codeBlock') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleCodeBlock().run()"
24
- :variant="variantBtn"
25
- @click="editor.commands.toggleCodeBlock()"
26
- size="32"
24
+ :color="editor.isActive('codeBlock') ? 'primary' : ''"
25
+ :disabled="!editor.can().chain().focus().toggleCodeBlock().run()"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.toggleCodeBlock()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('format.codeblock') }}
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive('blockquote') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleBlockquote().run()"
24
- :variant="variantBtn"
25
- @click="editor.commands.toggleBlockquote()"
26
- size="32"
24
+ :color="editor.isActive('blockquote') ? 'primary' : ''"
25
+ :disabled="!editor.can().chain().focus().toggleBlockquote().run()"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.toggleBlockquote()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('format.blockquote') }}
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive('sub') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleSubscript().run()"
24
- :variant="variantBtn"
25
- @click="editor.commands.toggleSubscript()"
26
- size="32"
24
+ :color="editor.isActive('sub') ? 'primary' : ''"
25
+ :disabled="!editor.can().chain().focus().toggleSubscript().run()"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.toggleSubscript()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('format.sub') }}
@@ -1,29 +1,31 @@
1
1
  <script lang="ts" setup>
2
2
 
3
3
  import * as mdi from '@mdi/js'
4
- import { Editor } from "@tiptap/vue-3";
5
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
6
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, Ref } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn }
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  })
13
15
 
14
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
17
 
16
- const { t } = inject('tiptapifyI18n') as any
18
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
17
19
 
18
20
  </script>
19
21
 
20
22
  <template>
21
23
  <VBtn
22
- :color="editor.isActive('sup') ? 'primary' : ''"
23
- :disabled="!editor.can().chain().focus().toggleSuperscript().run()"
24
- :variant="variantBtn"
25
- @click="editor.commands.toggleSuperscript()"
26
- size="32"
24
+ :color="editor.isActive('sup') ? 'primary' : ''"
25
+ :disabled="!editor.can().chain().focus().toggleSuperscript().run()"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.toggleSuperscript()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('format.sup') }}