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
@@ -1,21 +1,23 @@
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 StyleColor from "@tiptapify/extensions/components/style/StyleColor.vue";
7
- import { computed, inject, Ref } from "vue";
8
- import { useTheme } from "vuetify/framework";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import StyleColor from '@tiptapify/extensions/components/style/StyleColor.vue'
7
+ import { variantBtnTypes } from '@tiptapify/types/editor'
8
+ import { computed, inject, PropType, Ref } from 'vue'
9
+ import { ComposerTranslation } from 'vue-i18n'
10
+ import { useTheme } from 'vuetify/framework'
9
11
 
10
12
  import defaults from '@tiptapify/constants/defaults'
11
13
 
12
14
  defineProps({
13
- variantBtn: { type: String, default: defaults.variantBtn }
15
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
14
16
  })
15
17
 
16
18
  const editor = inject('tiptapifyEditor') as Ref<Editor>
17
19
 
18
- const { t } = inject('tiptapifyI18n') as any
20
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
19
21
 
20
22
  const appTheme = useTheme()
21
23
 
@@ -30,11 +32,11 @@ const selectedColor = computed(() => editor.value.getAttributes('textStyle').col
30
32
 
31
33
  <template>
32
34
  <VBtn
33
- :id="`tiptapify-color-button-${editor.instanceId}`"
34
- :disabled="!editor.can().chain().focus().toggleHighlight().run()"
35
- :variant="variantBtn"
36
- @click="editor.chain().focus().redo().run()"
37
- size="32"
35
+ :id="`tiptapify-color-button-${editor.instanceId}`"
36
+ :disabled="!editor.can().chain().focus().toggleHighlight().run()"
37
+ :variant="variantBtn"
38
+ size="32"
39
+ @click="editor.chain().focus().redo().run()"
38
40
  >
39
41
  <VTooltip activator="parent">
40
42
  {{ t('style.color.text') }}
@@ -42,11 +44,11 @@ const selectedColor = computed(() => editor.value.getAttributes('textStyle').col
42
44
 
43
45
  <BtnIcon :icon="`mdiSvg:${mdi.mdiFormatColorText}`" />
44
46
  <VIcon
45
- :icon="`mdiSvg:${mdi.mdiColorHelper}`"
46
- :disabled="!editor.can().chain().focus().toggleHighlight().run()"
47
- :color="activeColor"
48
- size="small"
49
- style="position: absolute; filter: drop-shadow(rgba(0, 0, 0, .75) 1px 1px 2px)"
47
+ :icon="`mdiSvg:${mdi.mdiColorHelper}`"
48
+ :disabled="!editor.can().chain().focus().toggleHighlight().run()"
49
+ :color="activeColor"
50
+ size="small"
51
+ style="position: absolute; filter: drop-shadow(rgba(0, 0, 0, .75) 1px 1px 2px)"
50
52
  />
51
53
  </VBtn>
52
54
 
@@ -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 FontFamily from "@tiptapify/extensions/components/style/fontFamily/FontFamily.vue";
7
- import { fonts } from "@tiptapify/constants/style";
8
- import { computed, inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import FontFamily from '@tiptapify/extensions/components/style/fontFamily/FontFamily.vue'
7
+ import { fonts } from '@tiptapify/constants/style'
8
+ import { variantBtnTypes } from '@tiptapify/types/editor'
9
+ import { computed, inject, PropType, Ref } from 'vue'
9
10
 
10
11
  import defaults from '@tiptapify/constants/defaults'
12
+ import { ComposerTranslation } from 'vue-i18n'
11
13
 
12
14
  defineProps({
13
- variantBtn: { type: String, default: defaults.variantBtn }
15
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
14
16
  })
15
17
 
16
18
  const editor = inject('tiptapifyEditor') as Ref<Editor>
17
19
 
18
- const { t } = inject('tiptapifyI18n') as any
20
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
19
21
 
20
22
  const activeFontFamily = computed(() => {
21
23
  let fontFamily = ''
22
24
  for (const font in fonts) {
23
25
  if (editor.value.isActive('textStyle', { fontFamily: fonts[font].fontFamily })) {
24
26
  fontFamily = fonts[font].fontFamily
25
- break;
27
+ break
26
28
  }
27
29
  }
28
30
 
@@ -34,7 +36,7 @@ function getColor() {
34
36
  for (const font in fonts) {
35
37
  if (editor.value.isActive('textStyle', { fontFamily: fonts[font].fontFamily })) {
36
38
  color = 'primary'
37
- break;
39
+ break
38
40
  }
39
41
  }
40
42
 
@@ -45,11 +47,11 @@ function getColor() {
45
47
 
46
48
  <template>
47
49
  <VBtn
48
- :id="`tiptapify-font-family-button-${editor.instanceId}`"
49
- :disabled="!editor.can().chain().focus().unsetFontFamily().run()"
50
- :color="getColor()"
51
- :variant="variantBtn"
52
- size="32"
50
+ :id="`tiptapify-font-family-button-${editor.instanceId}`"
51
+ :disabled="!editor.can().chain().focus().unsetFontFamily().run()"
52
+ :color="getColor()"
53
+ :variant="variantBtn"
54
+ size="32"
53
55
  >
54
56
  <VTooltip activator="parent">
55
57
  {{ t('style.fontFamily') }}
@@ -1,15 +1,16 @@
1
1
  <script setup lang="ts">
2
2
 
3
- import { Editor } from "@tiptap/vue-3";
3
+ import { Editor } from '@tiptap/vue-3'
4
4
 
5
5
  import { computed, inject, Ref, ref } from 'vue'
6
+ import { ComposerTranslation } from 'vue-i18n'
6
7
 
7
8
  const props = defineProps({
8
9
  fonts: { type: Array<{ name: string, fontFamily: string }>, default: [] },
9
10
  fontFamily: { type: String, default: '' },
10
11
  })
11
12
 
12
- const { t } = inject('tiptapifyI18n') as any
13
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
13
14
 
14
15
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
16
 
@@ -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 FontSize from "@tiptapify/extensions/components/style/fontSize/FontSize.vue";
7
- import { fontSizes } from "@tiptapify/constants/style";
8
- import { computed, inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import FontSize from '@tiptapify/extensions/components/style/fontSize/FontSize.vue'
7
+ import { fontSizes } from '@tiptapify/constants/style'
8
+ import { variantBtnTypes } from '@tiptapify/types/editor'
9
+ import { computed, inject, PropType, Ref } from 'vue'
9
10
 
10
11
  import defaults from '@tiptapify/constants/defaults'
12
+ import { ComposerTranslation } from 'vue-i18n'
11
13
 
12
14
  const props = defineProps({
13
- fontMeasure: { type: String, default () { return 'px' }},
14
- variantBtn: { type: String, default: defaults.variantBtn }
15
+ fontMeasure: { type: String, default () { return 'px' } },
16
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
15
17
  })
16
18
 
17
19
  const editor = inject('tiptapifyEditor') as Ref<Editor>
18
20
 
19
- const { t } = inject('tiptapifyI18n') as any
21
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
20
22
 
21
23
  const activeFontSize = computed(() => {
22
24
  let fontSize = null
23
25
  for (const size of fontSizes) {
24
26
  if (editor.value.isActive('textStyle', { fontSize: `${size}${props.fontMeasure}` })) {
25
27
  fontSize = size
26
- break;
28
+ break
27
29
  }
28
30
  }
29
31
 
@@ -35,7 +37,7 @@ function getColor() {
35
37
  for (const size of fontSizes) {
36
38
  if (editor.value.isActive('textStyle', { fontSize: `${size}${props.fontMeasure}` })) {
37
39
  color = 'primary'
38
- break;
40
+ break
39
41
  }
40
42
  }
41
43
 
@@ -46,11 +48,11 @@ function getColor() {
46
48
 
47
49
  <template>
48
50
  <VBtn
49
- :id="`tiptapify-font-size-button-${editor.instanceId}`"
50
- :disabled="!editor.can().chain().focus().unsetFontSize().run()"
51
- :color="getColor()"
52
- :variant="variantBtn"
53
- size="32"
51
+ :id="`tiptapify-font-size-button-${editor.instanceId}`"
52
+ :disabled="!editor.can().chain().focus().unsetFontSize().run()"
53
+ :color="getColor()"
54
+ :variant="variantBtn"
55
+ size="32"
54
56
  >
55
57
  <VTooltip activator="parent">
56
58
  {{ t('style.fontSize') }}
@@ -1,8 +1,9 @@
1
1
  <script setup lang="ts">
2
2
 
3
- import { Editor } from "@tiptap/vue-3";
3
+ import { Editor } from '@tiptap/vue-3'
4
4
 
5
5
  import { computed, inject, Ref, ref } from 'vue'
6
+ import { ComposerTranslation } from 'vue-i18n'
6
7
 
7
8
  const props = defineProps({
8
9
  sizes: { type: Array<number>, default: [] },
@@ -10,7 +11,7 @@ const props = defineProps({
10
11
  fontSize: { type: Number, default () { return null } },
11
12
  })
12
13
 
13
- const { t } = inject('tiptapifyI18n') as any
14
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
14
15
 
15
16
  const editor = inject('tiptapifyEditor') as Ref<Editor>
16
17
 
@@ -64,7 +65,7 @@ function isFontSizeActive(fontSize: number): boolean {
64
65
  @mouseleave="resetFontSize"
65
66
  >
66
67
  <VListItemTitle>
67
- {{ size }}{{ measure}}
68
+ {{ size }}{{ measure }}
68
69
  </VListItemTitle>
69
70
  </VListItem>
70
71
  </VList>
@@ -1,16 +1,18 @@
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 { Level } from '@tiptap/extension-heading'
5
+ import { Editor } from '@tiptap/vue-3'
6
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
7
+ import { variantBtnTypes } from '@tiptapify/types/editor'
8
+ import { inject, PropType, Ref } from 'vue'
7
9
 
8
10
  import defaults from '@tiptapify/constants/defaults'
9
11
 
10
12
  const props = defineProps({
11
- customHeadingLevels: { type: Array<number>, default: () => [] },
13
+ customHeadingLevels: { type: Array<Level>, default: () => [] },
12
14
  withParagraph: { type: Boolean, default: () => true },
13
- variantBtn: { type: String, default: defaults.variantBtn }
15
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
14
16
  })
15
17
 
16
18
  interface MDIIcons { [key: string]: string }
@@ -18,20 +20,20 @@ const mdiIcons = mdi as MDIIcons
18
20
 
19
21
  const editor = inject('tiptapifyEditor') as Ref<Editor>
20
22
 
21
- const { t } = inject('tiptapifyI18n') as any
23
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
22
24
 
23
- import { headingLevels, setHeadingLevels } from "@tiptapify/constants/style";
25
+ import { headingLevels, setHeadingLevels } from '@tiptapify/constants/style'
26
+ import { ComposerTranslation } from 'vue-i18n'
24
27
  setHeadingLevels(props.customHeadingLevels)
25
-
26
28
  </script>
27
29
 
28
30
  <template>
29
31
  <VBtn
30
- :id="`tiptapify-heading-button-${editor.instanceId}`"
31
- :color="editor.isActive('heading') ? 'primary' : ''"
32
- :variant="variantBtn"
33
- @click="editor.chain().focus().redo().run()"
34
- size="32"
32
+ :id="`tiptapify-heading-button-${editor.instanceId}`"
33
+ :color="editor.isActive('heading') ? 'primary' : ''"
34
+ :variant="variantBtn"
35
+ size="32"
36
+ @click="editor.chain().focus().redo().run()"
35
37
  >
36
38
  <VTooltip activator="parent">
37
39
  {{ t('style.heading') }}
@@ -52,9 +54,10 @@ setHeadingLevels(props.customHeadingLevels)
52
54
  </VListItemTitle>
53
55
  </VListItem>
54
56
  <VListItem
55
- v-for="headingLevel in headingLevels" :key="headingLevel"
56
- :color="editor.isActive('heading', { level: headingLevel }) ? 'primary' : ''"
57
- @click="editor.chain().focus().toggleHeading({ level: headingLevel }).run()"
57
+ v-for="headingLevel in headingLevels"
58
+ :key="headingLevel"
59
+ :color="editor.isActive('heading', { level: headingLevel }) ? 'primary' : ''"
60
+ @click="editor.chain().focus().toggleHeading({ level: headingLevel }).run()"
58
61
  >
59
62
  <VListItemTitle class="d-flex justify-center align-center">
60
63
  <BtnIcon :icon="`mdiSvg:${mdiIcons[`mdiFormatHeader${headingLevel}`]}`" />
@@ -1,21 +1,23 @@
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 StyleColor from "@tiptapify/extensions/components/style/StyleColor.vue";
7
- import { computed, inject, Ref } from "vue";
8
- import { useTheme } from "vuetify/framework";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import StyleColor from '@tiptapify/extensions/components/style/StyleColor.vue'
7
+ import { variantBtnTypes } from '@tiptapify/types/editor'
8
+ import { computed, inject, PropType, Ref } from 'vue'
9
+ import { ComposerTranslation } from 'vue-i18n'
10
+ import { useTheme } from 'vuetify/framework'
9
11
 
10
12
  import defaults from '@tiptapify/constants/defaults'
11
13
 
12
14
  defineProps({
13
- variantBtn: { type: String, default: defaults.variantBtn }
15
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
14
16
  })
15
17
 
16
18
  const editor = inject('tiptapifyEditor') as Ref<Editor>
17
19
 
18
- const { t } = inject('tiptapifyI18n') as any
20
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
19
21
 
20
22
  const appTheme = useTheme()
21
23
 
@@ -30,11 +32,11 @@ const selectedColor = computed(() => editor.value.getAttributes('highlight').col
30
32
 
31
33
  <template>
32
34
  <VBtn
33
- :id="`tiptapify-highlight-button-${editor.instanceId}`"
34
- :disabled="!editor.can().chain().focus().toggleHighlight().run()"
35
- :variant="variantBtn"
36
- @click="editor.chain().focus().redo().run()"
37
- size="32"
35
+ :id="`tiptapify-highlight-button-${editor.instanceId}`"
36
+ :disabled="!editor.can().chain().focus().toggleHighlight().run()"
37
+ :variant="variantBtn"
38
+ size="32"
39
+ @click="editor.chain().focus().redo().run()"
38
40
  >
39
41
  <VTooltip activator="parent">
40
42
  {{ t('style.color.highlight') }}
@@ -42,11 +44,11 @@ const selectedColor = computed(() => editor.value.getAttributes('highlight').col
42
44
 
43
45
  <BtnIcon :icon="`mdiSvg:${mdi.mdiFormatColorFill}`" />
44
46
  <VIcon
45
- :icon="`mdiSvg:${mdi.mdiColorHelper}`"
46
- :disabled="!editor.can().chain().focus().toggleHighlight().run()"
47
- :color="activeColor"
48
- size="small"
49
- style="position: absolute; filter: drop-shadow(rgba(0, 0, 0, .75) 1px 1px 2px)"
47
+ :icon="`mdiSvg:${mdi.mdiColorHelper}`"
48
+ :disabled="!editor.can().chain().focus().toggleHighlight().run()"
49
+ :color="activeColor"
50
+ size="small"
51
+ style="position: absolute; filter: drop-shadow(rgba(0, 0, 0, .75) 1px 1px 2px)"
50
52
  />
51
53
  </VBtn>
52
54
 
@@ -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 LineHeight from "@tiptapify/extensions/components/style/lineHeight/LineHeight.vue";
7
- import { lineHeights } from "@tiptapify/constants/style";
8
- import { computed, inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import LineHeight from '@tiptapify/extensions/components/style/lineHeight/LineHeight.vue'
7
+ import { lineHeights } from '@tiptapify/constants/style'
8
+ import { variantBtnTypes } from '@tiptapify/types/editor'
9
+ import { computed, inject, PropType, Ref } from 'vue'
9
10
 
10
11
  import defaults from '@tiptapify/constants/defaults'
12
+ import { ComposerTranslation } from 'vue-i18n'
11
13
 
12
14
  defineProps({
13
- variantBtn: { type: String, default: defaults.variantBtn }
15
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
14
16
  })
15
17
 
16
18
  const editor = inject('tiptapifyEditor') as Ref<Editor>
17
19
 
18
- const { t } = inject('tiptapifyI18n') as any
20
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
19
21
 
20
22
  const activeLineHeight = computed(() => {
21
23
  let lineHeight = null
22
24
  for (const height of lineHeights) {
23
25
  if (editor.value.isActive('textStyle', { lineHeight: height.toString() })) {
24
26
  lineHeight = height
25
- break;
27
+ break
26
28
  }
27
29
  }
28
30
 
@@ -34,7 +36,7 @@ function getColor() {
34
36
  for (const height of lineHeights) {
35
37
  if (editor.value.isActive('textStyle', { lineHeight: height.toString() })) {
36
38
  color = 'primary'
37
- break;
39
+ break
38
40
  }
39
41
  }
40
42
 
@@ -45,11 +47,11 @@ function getColor() {
45
47
 
46
48
  <template>
47
49
  <VBtn
48
- :id="`tiptapify-line-height-button-${editor.instanceId}`"
49
- :disabled="!editor.can().chain().focus().unsetLineHeight().run()"
50
- :color="getColor()"
51
- :variant="variantBtn"
52
- size="32"
50
+ :id="`tiptapify-line-height-button-${editor.instanceId}`"
51
+ :disabled="!editor.can().chain().focus().unsetLineHeight().run()"
52
+ :color="getColor()"
53
+ :variant="variantBtn"
54
+ size="32"
53
55
  >
54
56
  <VTooltip activator="parent">
55
57
  {{ t('style.lineHeight') }}
@@ -1,15 +1,16 @@
1
1
  <script setup lang="ts">
2
2
 
3
- import { Editor } from "@tiptap/vue-3";
3
+ import { Editor } from '@tiptap/vue-3'
4
4
 
5
5
  import { computed, inject, Ref, ref } from 'vue'
6
+ import { ComposerTranslation } from 'vue-i18n'
6
7
 
7
8
  const props = defineProps({
8
9
  fonts: { type: Array<{ name: string, fontFamily: string }>, default: [] },
9
10
  fontFamily: { type: String, default: '' },
10
11
  })
11
12
 
12
- const { t } = inject('tiptapifyI18n') as any
13
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
13
14
 
14
15
  const emit = defineEmits(['close'])
15
16
 
@@ -1,15 +1,16 @@
1
1
  <script setup lang="ts">
2
2
 
3
- import { Editor } from "@tiptap/vue-3";
3
+ import { Editor } from '@tiptap/vue-3'
4
4
 
5
5
  import { computed, inject, Ref, ref } from 'vue'
6
+ import { ComposerTranslation } from 'vue-i18n'
6
7
 
7
8
  const props = defineProps({
8
9
  lineHeights: { type: Array<number>, default () { return [] } },
9
10
  lineHeight: { type: Number, default () { return null } },
10
11
  })
11
12
 
12
- const { t } = inject('tiptapifyI18n') as any
13
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
13
14
 
14
15
  const editor = inject('tiptapifyEditor') as Ref<Editor>
15
16