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,14 +1,16 @@
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 { computed, inject, ref, Ref, watch } 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 { computed, inject, PropType, ref, Ref, watch } from 'vue'
7
8
 
8
9
  import defaults from '@tiptapify/constants/defaults'
10
+ import { ComposerTranslation } from 'vue-i18n'
9
11
 
10
12
  const props = defineProps({
11
- variantBtn: { type: String, default: defaults.variantBtn },
13
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
12
14
  withDisc: { type: Boolean, default: true },
13
15
  withCircle: { type: Boolean, default: true },
14
16
  withSquare: { type: Boolean, default: true }
@@ -16,7 +18,7 @@ const props = defineProps({
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 disc = computed(() => props.withDisc)
22
24
  const circle = computed(() => props.withCircle)
@@ -54,9 +56,9 @@ checkButtonOrMenu()
54
56
 
55
57
  function toggleList(listType: string) {
56
58
  switch(listType) {
57
- case 'bulletList': editor.value.commands.toggleBulletList(); break;
58
- case 'bulletListCircle': editor.value.commands.toggleBulletListCircle(); break;
59
- case 'bulletListSquare': editor.value.commands.toggleBulletListSquare(); break;
59
+ case 'bulletList': editor.value.commands.toggleBulletList(); break
60
+ case 'bulletListCircle': editor.value.commands.toggleBulletListCircle(); break
61
+ case 'bulletListSquare': editor.value.commands.toggleBulletListSquare(); break
60
62
  }
61
63
  }
62
64
 
@@ -83,11 +85,11 @@ watch(() => bulletLists.value, () => {
83
85
  <VMenu v-if="isMenu">
84
86
  <template #activator="{ props: menuProps }">
85
87
  <VBtn
86
- :color="buttonActive ? 'primary' : ''"
87
- :disabled="buttonDisabled"
88
- :variant="variantBtn"
89
- v-bind="menuProps"
90
- size="32"
88
+ :color="buttonActive ? 'primary' : ''"
89
+ :disabled="buttonDisabled"
90
+ :variant="variantBtn"
91
+ v-bind="menuProps"
92
+ size="32"
91
93
  >
92
94
  <VTooltip activator="parent">
93
95
  {{ t('lists.bullet') }}
@@ -115,12 +117,12 @@ watch(() => bulletLists.value, () => {
115
117
  </VMenu>
116
118
 
117
119
  <VBtn
118
- v-else
119
- :color="editor.isActive('bulletList') ? 'primary' : ''"
120
- :disabled="!editor.can().chain().focus().toggleBulletList().run()"
121
- :variant="variantBtn"
122
- @click="editor.commands.toggleBulletList()"
123
- size="32"
120
+ v-else
121
+ :color="editor.isActive('bulletList') ? 'primary' : ''"
122
+ :disabled="!editor.can().chain().focus().toggleBulletList().run()"
123
+ :variant="variantBtn"
124
+ size="32"
125
+ @click="editor.commands.toggleBulletList()"
124
126
  >
125
127
  <VTooltip activator="parent">
126
128
  {{ t('lists.bullet') }}
@@ -1,4 +1,4 @@
1
- import { BulletList } from "@tiptap/extension-list"
1
+ import { BulletList } from '@tiptap/extension-list'
2
2
 
3
3
  export const BulletListCircle = BulletList.extend({
4
4
  name: 'bulletListCircle',
@@ -1,30 +1,32 @@
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
- :active="false"
23
- :disabled="!editor.can().sinkListItem('listItem')"
24
- size="32"
25
- color=""
26
- :variant="variantBtn"
27
- @click="editor.chain().focus().sinkListItem('listItem').run()"
24
+ :active="false"
25
+ :disabled="!editor.can().sinkListItem('listItem')"
26
+ size="32"
27
+ color=""
28
+ :variant="variantBtn"
29
+ @click="editor.chain().focus().sinkListItem('listItem').run()"
28
30
  >
29
31
  <VTooltip activator="parent">
30
32
  {{ t('lists.indent') }}
@@ -1,19 +1,21 @@
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 { computed, 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 { computed, 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
  const buttonDisabled = computed(() => {
19
21
  return !editor.value.can().chain().focus().toggleBulletList().run() &&
@@ -26,11 +28,11 @@ const buttonDisabled = computed(() => {
26
28
 
27
29
  <template>
28
30
  <VBtn
29
- :color="editor.isActive('orderedList') ? 'primary' : ''"
30
- :disabled="buttonDisabled"
31
- :variant="variantBtn"
32
- @click="editor.commands.toggleOrderedList()"
33
- size="32"
31
+ :color="editor.isActive('orderedList') ? 'primary' : ''"
32
+ :disabled="buttonDisabled"
33
+ :variant="variantBtn"
34
+ size="32"
35
+ @click="editor.commands.toggleOrderedList()"
34
36
  >
35
37
  <VTooltip activator="parent">
36
38
  {{ t('lists.numbered') }}
@@ -1,30 +1,32 @@
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
- :active="false"
23
- :disabled="!editor.can().liftListItem('listItem')"
24
- size="32"
25
- color=""
26
- :variant="variantBtn"
27
- @click="editor.chain().focus().liftListItem('listItem').run()"
24
+ :active="false"
25
+ :disabled="!editor.can().liftListItem('listItem')"
26
+ size="32"
27
+ color=""
28
+ :variant="variantBtn"
29
+ @click="editor.chain().focus().liftListItem('listItem').run()"
28
30
  >
29
31
  <VTooltip activator="parent">
30
32
  {{ t('lists.outdent') }}
@@ -1,19 +1,21 @@
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 { computed, 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 { computed, 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
  const buttonDisabled = computed(() => {
19
21
  return !editor.value.can().chain().focus().toggleBulletList().run() &&
@@ -26,11 +28,11 @@ const buttonDisabled = computed(() => {
26
28
 
27
29
  <template>
28
30
  <VBtn
29
- :color="editor.isActive('taskList') ? 'primary' : ''"
30
- :disabled="buttonDisabled"
31
- :variant="variantBtn"
32
- @click="editor.commands.toggleTaskList()"
33
- size="32"
31
+ :color="editor.isActive('taskList') ? 'primary' : ''"
32
+ :disabled="buttonDisabled"
33
+ :variant="variantBtn"
34
+ size="32"
35
+ @click="editor.commands.toggleTaskList()"
34
36
  >
35
37
  <VTooltip activator="parent">
36
38
  {{ t('lists.task') }}
@@ -1,14 +1,17 @@
1
1
  <script lang="ts" setup>
2
2
  import * as mdi from '@mdi/js'
3
- import { inject, Ref } from 'vue'
4
- import CharmapPicker from './Picker.vue';
3
+ import { Editor } from '@tiptap/core'
4
+ import { variantBtnTypes } from '@tiptapify/types/editor'
5
+ import { inject, PropType, Ref } from 'vue'
6
+ import { ComposerTranslation } from 'vue-i18n'
7
+ import CharmapPicker from './Picker.vue'
5
8
 
6
9
  defineProps({
7
- variantBtn: { type: String, default: 'flat' },
10
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return 'flat' } },
8
11
  })
9
12
 
10
- const editor = inject('tiptapifyEditor') as Ref<any>
11
- const { t } = inject('tiptapifyI18n') as any
13
+ const editor = inject('tiptapifyEditor') as Ref<Editor>
14
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
12
15
  </script>
13
16
 
14
17
  <template>
@@ -66,10 +66,10 @@ watch(filter, filterChars)
66
66
  <div class="tiptapify-slash-picker">
67
67
  <div class="tiptapify-slash-picker__sidebar">
68
68
  <button
69
- v-for="item in filteredChars"
70
- :key="item.group"
71
- :class="['tiptapify-slash-picker__tab', { 'tiptapify-slash-picker__tab--active': activeTab === item.group }]"
72
- @click="activeTab = item.group"
69
+ v-for="item in filteredChars"
70
+ :key="item.group"
71
+ :class="['tiptapify-slash-picker__tab', { 'tiptapify-slash-picker__tab--active': activeTab === item.group }]"
72
+ @click="activeTab = item.group"
73
73
  >
74
74
  <VTooltip activator="parent">
75
75
  {{ t(`media.charmap.categories.${item.group}`) }}
@@ -81,27 +81,29 @@ watch(filter, filterChars)
81
81
  <div class="tiptapify-slash-picker__content">
82
82
  <div class="tiptapify-slash-picker__search">
83
83
  <input
84
- v-model="filter"
85
- type="text"
86
- placeholder="Search characters..."
87
- class="tiptapify-slash-picker__search-input"
88
- />
89
- <button v-if="filter" class="tiptapify-slash-picker__clear" @click="resetFilter">&times;</button>
84
+ v-model="filter"
85
+ type="text"
86
+ placeholder="Search characters..."
87
+ class="tiptapify-slash-picker__search-input"
88
+ >
89
+ <button v-if="filter" class="tiptapify-slash-picker__clear" @click="resetFilter">
90
+ &times;
91
+ </button>
90
92
  </div>
91
93
 
92
94
  <div class="tiptapify-slash-picker__grid-container">
93
95
  <div
94
- v-for="item in filteredChars"
95
- :key="item.group"
96
- class="tiptapify-slash-picker__group"
96
+ v-for="item in filteredChars"
97
+ :key="item.group"
98
+ class="tiptapify-slash-picker__group"
97
99
  >
98
100
  <div v-show="activeTab === item.group" class="tiptapify-slash-picker__grid">
99
101
  <button
100
- v-for="charItem in item.items"
101
- :key="charItem.char"
102
- class="tiptapify-slash-picker__item"
103
- :title="charItem.name"
104
- @click="handleCharacterClick(charItem)"
102
+ v-for="charItem in item.items"
103
+ :key="charItem.char"
104
+ class="tiptapify-slash-picker__item"
105
+ :title="charItem.name"
106
+ @click="handleCharacterClick(charItem)"
105
107
  >
106
108
  {{ charItem.char }}
107
109
  </button>
@@ -1,17 +1,19 @@
1
1
  <script lang="ts" setup>
2
2
  import * as mdi from '@mdi/js'
3
- import { inject, Ref } from 'vue'
4
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
5
- import EmojiPicker from './Picker.vue';
3
+ import { TiptapifyEditor, variantBtnTypes } from '@tiptapify/types/editor'
4
+ import { inject, PropType, Ref } from 'vue'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import { ComposerTranslation } from 'vue-i18n'
7
+ import EmojiPicker from './Picker.vue'
6
8
  import defaults from '@tiptapify/constants/defaults'
7
9
 
8
10
  defineProps({
9
- variantBtn: { type: String, default: defaults.variantBtn }
11
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
10
12
  })
11
13
 
12
- const editor = inject('tiptapifyEditor') as Ref<any>
14
+ const editor = inject('tiptapifyEditor') as Ref<TiptapifyEditor>
13
15
 
14
- const { t } = inject('tiptapifyI18n') as any
16
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
15
17
  </script>
16
18
 
17
19
  <template>
@@ -62,10 +62,10 @@ watch(filter, filterEmoji)
62
62
  <div class="tiptapify-slash-picker">
63
63
  <div class="tiptapify-slash-picker__sidebar">
64
64
  <button
65
- v-for="item in filteredEmojis"
66
- :key="item.group"
67
- :class="['tiptapify-slash-picker__tab', { 'tiptapify-slash-picker__tab--active': activeTab === item.group }]"
68
- @click="activeTab = item.group"
65
+ v-for="item in filteredEmojis"
66
+ :key="item.group"
67
+ :class="['tiptapify-slash-picker__tab', { 'tiptapify-slash-picker__tab--active': activeTab === item.group }]"
68
+ @click="activeTab = item.group"
69
69
  >
70
70
  <VTooltip activator="parent">
71
71
  {{ t(`media.emoji.categories.${item.group}`) }}
@@ -77,27 +77,29 @@ watch(filter, filterEmoji)
77
77
  <div class="tiptapify-slash-picker__content">
78
78
  <div class="tiptapify-slash-picker__search">
79
79
  <input
80
- v-model="filter"
81
- type="text"
82
- placeholder="Search emoji..."
83
- class="tiptapify-slash-picker__search-input"
84
- />
85
- <button v-if="filter" class="tiptapify-slash-picker__clear" @click="resetFilter">&times;</button>
80
+ v-model="filter"
81
+ type="text"
82
+ placeholder="Search emoji..."
83
+ class="tiptapify-slash-picker__search-input"
84
+ >
85
+ <button v-if="filter" class="tiptapify-slash-picker__clear" @click="resetFilter">
86
+ &times;
87
+ </button>
86
88
  </div>
87
89
 
88
90
  <div class="tiptapify-slash-picker__grid-container">
89
91
  <div
90
- v-for="item in filteredEmojis"
91
- :key="item.group"
92
- class="tiptapify-slash-picker__group"
92
+ v-for="item in filteredEmojis"
93
+ :key="item.group"
94
+ class="tiptapify-slash-picker__group"
93
95
  >
94
96
  <div v-show="activeTab === item.group" class="tiptapify-slash-picker__grid">
95
97
  <button
96
- v-for="emojiItem in item.emojis"
97
- :key="emojiItem.char"
98
- class="tiptapify-slash-picker__item"
99
- :title="emojiItem.name"
100
- @click="handleEmojiClick(emojiItem)"
98
+ v-for="emojiItem in item.emojis"
99
+ :key="emojiItem.char"
100
+ class="tiptapify-slash-picker__item"
101
+ :title="emojiItem.name"
102
+ @click="handleEmojiClick(emojiItem)"
101
103
  >
102
104
  {{ emojiItem.char }}
103
105
  </button>
@@ -1,31 +1,33 @@
1
1
  <script lang="ts" setup>
2
2
 
3
- import { Editor } from "@tiptap/vue-3";
4
- import BtnIcon from "@tiptapify/components/UI/BtnIcon.vue";
5
- import IframeDialog from "@tiptapify/extensions/components/media/iframe/IframeDialog.vue";
6
- import { inject, ref, Ref } from "vue";
3
+ import { Editor } from '@tiptap/vue-3'
4
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
5
+ import IframeDialog from '@tiptapify/extensions/components/media/iframe/IframeDialog.vue'
6
+ import { variantBtnTypes } from '@tiptapify/types/editor'
7
+ import { inject, PropType, ref, Ref, useTemplateRef } 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
- const dialog = ref(null)
20
+ const dialog = useTemplateRef('dialog')
19
21
 
20
22
  const icon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M1 12h9.8L8.3 9.5l1.4-1.4l4.9 4.9l-4.9 4.9l-1.4-1.4l2.5-2.5H1zM21 2H3c-1.1 0-2 .9-2 2v6.1h2V6h18v14H3v-4H1v4c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2"/></svg>'
21
23
  </script>
22
24
 
23
25
  <template>
24
26
  <VBtn
25
- :color="editor.isActive('iframe') ? 'primary' : ''"
26
- :variant="variantBtn"
27
- @click="dialog?.open()"
28
- size="32"
27
+ :color="editor.isActive('iframe') ? 'primary' : ''"
28
+ :variant="variantBtn"
29
+ size="32"
30
+ @click="dialog?.open()"
29
31
  >
30
32
  <VTooltip activator="parent">
31
33
  {{ t('media.iframe') }}
@@ -1,20 +1,22 @@
1
1
  <script setup lang="ts">
2
2
 
3
- import { Editor } from "@tiptap/vue-3";
4
- import TiptapifyDialog from "@tiptapify/components/UI/TiptapifyDialog.vue";
5
- import defaults from "@tiptapify/constants/defaults";
3
+ import { Editor } from '@tiptap/vue-3'
4
+ import TiptapifyDialog from '@tiptapify/components/UI/TiptapifyDialog.vue'
5
+ import defaults from '@tiptapify/constants/defaults'
6
+ import { variantBtnTypes, variantFieldTypes } from '@tiptapify/types/editor'
6
7
 
7
8
  import type { iframeOptions } from '@tiptapify/types/iframe'
8
9
 
9
- import { computed, inject, Ref, ref, watch } from 'vue'
10
+ import { computed, inject, PropType, Ref, ref, useTemplateRef, watch } from 'vue'
11
+ import { ComposerTranslation } from 'vue-i18n'
10
12
 
11
13
  defineProps({
12
- variantBtn: { type: String, default() { return defaults.variantBtn }},
13
- variantField: { type: String, default() { return defaults.variantField }}
14
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
15
+ variantField: { type: String as PropType<variantFieldTypes>, default() { return defaults.variantField } },
14
16
  })
15
17
 
16
18
  const editor = inject('tiptapifyEditor') as Ref<Editor>
17
- const { t } = inject('tiptapifyI18n') as any
19
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
18
20
 
19
21
  const generateIframeAttrs = (): iframeOptions => ({
20
22
  src: '',
@@ -28,7 +30,7 @@ const generateIframeAttrs = (): iframeOptions => ({
28
30
  const attrs = ref(generateIframeAttrs())
29
31
  const srcInvalid = ref(false)
30
32
 
31
- const dialog = ref(null)
33
+ const dialog = useTemplateRef('dialog')
32
34
 
33
35
  const isDisabled = computed(() => {
34
36
  const { src } = attrs.value
@@ -138,30 +140,30 @@ watch(() => attrs.value.src, () => {
138
140
  <VRow>
139
141
  <VCol cols="12" md="6">
140
142
  <VTextField
141
- v-model="attrs.width"
142
- type="number"
143
- density="compact"
144
- variant="outlined"
145
- :precision="0"
146
- :min="1"
147
- :label="t('dialog.iframe.width')"
143
+ v-model="attrs.width"
144
+ type="number"
145
+ density="compact"
146
+ variant="outlined"
147
+ :precision="0"
148
+ :min="1"
149
+ :label="t('dialog.iframe.width')"
148
150
  />
149
151
  </VCol>
150
152
 
151
153
  <VCol cols="12" md="6">
152
154
  <VTextField
153
- v-model="attrs.height"
154
- type="number"
155
- density="compact"
156
- variant="outlined"
157
- :precision="0"
158
- :min="1"
159
- :label="t('dialog.iframe.height')"
155
+ v-model="attrs.height"
156
+ type="number"
157
+ density="compact"
158
+ variant="outlined"
159
+ :precision="0"
160
+ :min="1"
161
+ :label="t('dialog.iframe.height')"
160
162
  />
161
163
  </VCol>
162
164
 
163
165
  <VCol cols="12" class="ml-2">
164
- <VSwitch v-model="attrs.frameborder" density="compact" :hideDetails="true" :label="t('dialog.iframe.frameborder')" />
166
+ <VSwitch v-model="attrs.frameborder" density="compact" :hide-details="true" :label="t('dialog.iframe.frameborder')" />
165
167
  </VCol>
166
168
  </VRow>
167
169
  </VCol>
@@ -173,12 +175,12 @@ watch(() => attrs.value.src, () => {
173
175
  <VCardActions>
174
176
  <VRow>
175
177
  <VCol class="d-flex justify-start">
176
- <VBtn color="warning" v-if="editor.isActive('image')" :variant="variantBtn" :disabled="isDisabled" @click="clear">
178
+ <VBtn v-if="editor.isActive('image')" color="warning" :variant="variantBtn" :disabled="isDisabled" @click="clear">
177
179
  {{ t('dialog.clear') }}
178
180
  </VBtn>
179
181
  </VCol>
180
182
  <VCol class="d-flex justify-end">
181
- <VBtn :variant="variantBtn" @click="close" class="mr-2">
183
+ <VBtn :variant="variantBtn" class="mr-2" @click="close">
182
184
  {{ t('dialog.close') }}
183
185
  </VBtn>
184
186
  <VBtn color="primary" :variant="variantBtn" :disabled="isDisabled" @click="apply">
@@ -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 ImageDialog from "@tiptapify/extensions/components/media/image/ImageDialog.vue";
7
- import { inject, Ref } from "vue";
4
+ import { Editor } from '@tiptap/vue-3'
5
+ import BtnIcon from '@tiptapify/components/UI/BtnIcon.vue'
6
+ import ImageDialog from '@tiptapify/extensions/components/media/image/ImageDialog.vue'
7
+ import { variantBtnTypes } from '@tiptapify/types/editor'
8
+ import { inject, PropType, Ref } from 'vue'
8
9
 
9
10
  import defaults from '@tiptapify/constants/defaults'
11
+ import { ComposerTranslation } from 'vue-i18n'
10
12
 
11
13
  defineProps({
12
- variantBtn: { type: String, default: defaults.variantBtn }
14
+ variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
13
15
  })
14
16
 
15
17
  const editor = inject('tiptapifyEditor') as Ref<Editor>
16
18
 
17
- const { t } = inject('tiptapifyI18n') as any
19
+ const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
18
20
 
19
21
  </script>
20
22
 
21
23
  <template>
22
24
  <VBtn
23
- :color="editor.isActive('image') ? 'primary' : ''"
24
- :variant="variantBtn"
25
- @click="editor.commands.showTiptapifyImage()"
26
- size="32"
25
+ :color="editor.isActive('image') ? 'primary' : ''"
26
+ :variant="variantBtn"
27
+ size="32"
28
+ @click="editor.commands.showTiptapifyImage()"
27
29
  >
28
30
  <VTooltip activator="parent">
29
31
  {{ t('media.image') }}