tiptapify 0.1.4 → 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.
- package/dist/tiptapify.css +2 -1
- package/dist/tiptapify.mjs +64289 -50740
- package/dist/tiptapify.umd.js +88 -78
- package/index.d.ts +97 -40
- package/package.json +65 -66
- package/src/components/Footer.vue +4 -3
- package/src/components/MenuBubble.vue +16 -16
- package/src/components/MenuFloating.vue +13 -13
- package/src/components/Tiptapify.vue +19 -9
- package/src/components/Toolbar/Index.vue +21 -17
- package/src/components/Toolbar/Items.vue +2 -1
- package/src/components/Toolbar/actions.ts +3 -3
- package/src/components/Toolbar/alignment.ts +5 -5
- package/src/components/Toolbar/format.ts +5 -5
- package/src/components/Toolbar/formatExtra.ts +6 -6
- package/src/components/Toolbar/items.ts +8 -8
- package/src/components/Toolbar/list.ts +6 -6
- package/src/components/Toolbar/media.ts +8 -8
- package/src/components/Toolbar/misc.ts +8 -8
- package/src/components/Toolbar/style.ts +7 -7
- package/src/components/UI/TiptapifyDialog.vue +14 -13
- package/src/components/editorExtensions.ts +2 -2
- package/src/components/index.ts +6 -6
- package/src/constants/style.ts +4 -3
- package/src/extensions/charmap/arrows.ts +700 -700
- package/src/extensions/charmap/box_drawing.ts +184 -184
- package/src/extensions/charmap/currency.ts +93 -93
- package/src/extensions/charmap/cyrillic.ts +368 -368
- package/src/extensions/charmap/diacritics.ts +60 -60
- package/src/extensions/charmap/extended_letters.ts +748 -748
- package/src/extensions/charmap/greek.ts +252 -252
- package/src/extensions/charmap/hebrew.ts +105 -105
- package/src/extensions/charmap/math.ts +1684 -1684
- package/src/extensions/charmap/punctuation.ts +68 -68
- package/src/extensions/charmap/symbols.ts +288 -288
- package/src/extensions/charmap/typography.ts +284 -284
- package/src/extensions/components/CodeBlockComponent.vue +2 -2
- package/src/extensions/components/actions/redo/Button.vue +12 -10
- package/src/extensions/components/actions/undo/Button.vue +12 -10
- package/src/extensions/components/alignment/center/Button.vue +11 -9
- package/src/extensions/components/alignment/justify/Button.vue +11 -9
- package/src/extensions/components/alignment/left/Button.vue +11 -9
- package/src/extensions/components/alignment/right/Button.vue +11 -9
- package/src/extensions/components/format/bold/Button.vue +12 -10
- package/src/extensions/components/format/italic/Button.vue +12 -10
- package/src/extensions/components/format/strike/Button.vue +12 -10
- package/src/extensions/components/format/underline/Button.vue +5 -3
- package/src/extensions/components/formatExtra/code/Button.vue +12 -10
- package/src/extensions/components/formatExtra/codeBlock/Button.vue +12 -10
- package/src/extensions/components/formatExtra/quote/Button.vue +12 -10
- package/src/extensions/components/formatExtra/sub/Button.vue +12 -10
- package/src/extensions/components/formatExtra/sup/Button.vue +12 -10
- package/src/extensions/components/list/bullet/Button.vue +21 -19
- package/src/extensions/components/list/bullet/index.ts +1 -1
- package/src/extensions/components/list/indent/Button.vue +13 -11
- package/src/extensions/components/list/numbered/Button.vue +12 -10
- package/src/extensions/components/list/outdent/Button.vue +13 -11
- package/src/extensions/components/list/task/Button.vue +12 -10
- package/src/extensions/components/media/charmap/Button.vue +8 -5
- package/src/extensions/components/media/charmap/Picker.vue +20 -18
- package/src/extensions/components/media/emoji/Button.vue +8 -6
- package/src/extensions/components/media/emoji/Picker.vue +20 -18
- package/src/extensions/components/media/iframe/Button.vue +13 -11
- package/src/extensions/components/media/iframe/IframeDialog.vue +27 -25
- package/src/extensions/components/media/image/Button.vue +12 -10
- package/src/extensions/components/media/image/ImageDialog.vue +46 -42
- package/src/extensions/components/media/link/Button.vue +12 -11
- package/src/extensions/components/media/link/LinkDialog.vue +34 -32
- package/src/extensions/components/media/link/index.ts +6 -7
- package/src/extensions/components/media/table/Button.vue +21 -19
- package/src/extensions/components/media/table/ColumnActions.vue +5 -4
- package/src/extensions/components/media/table/RowActions.vue +5 -4
- package/src/extensions/components/media/table/TableBuilder.vue +15 -13
- package/src/extensions/components/media/video/Button.vue +12 -10
- package/src/extensions/components/media/video/VideoDialog.vue +33 -15
- package/src/extensions/components/misc/break/Button.vue +8 -6
- package/src/extensions/components/misc/formatClear/Button.vue +12 -10
- package/src/extensions/components/misc/fullscreen/Button.vue +20 -18
- package/src/extensions/components/misc/invisibleChar/Button.vue +11 -9
- package/src/extensions/components/misc/line/Button.vue +11 -9
- package/src/extensions/components/misc/preview/Button.vue +11 -9
- package/src/extensions/components/misc/source/Button.vue +9 -7
- package/src/extensions/components/misc/source/ShowSourceDialog.vue +27 -25
- package/src/extensions/components/slashCommands/CommandsList.vue +3 -1
- package/src/extensions/components/style/StyleColor.vue +26 -22
- package/src/extensions/components/style/color/Button.vue +19 -17
- package/src/extensions/components/style/fontFamily/Button.vue +16 -14
- package/src/extensions/components/style/fontFamily/FontFamily.vue +3 -2
- package/src/extensions/components/style/fontSize/Button.vue +17 -15
- package/src/extensions/components/style/fontSize/FontSize.vue +4 -3
- package/src/extensions/components/style/heading/Button.vue +19 -16
- package/src/extensions/components/style/highlight/Button.vue +19 -17
- package/src/extensions/components/style/lineHeight/Button.vue +16 -14
- package/src/extensions/components/style/lineHeight/FontFamily.vue +3 -2
- package/src/extensions/components/style/lineHeight/LineHeight.vue +3 -2
- package/src/extensions/emoji/activities.ts +534 -534
- package/src/extensions/emoji/animals_and_nature.ts +978 -978
- package/src/extensions/emoji/component.ts +54 -54
- package/src/extensions/emoji/flags.ts +1644 -1644
- package/src/extensions/emoji/food_and_drink.ts +810 -810
- package/src/extensions/emoji/objects.ts +1608 -1608
- package/src/extensions/emoji/people_and_body.ts +2022 -2022
- package/src/extensions/emoji/smileys_and_emotion.ts +1038 -1038
- package/src/extensions/emoji/symbols.ts +1290 -1290
- package/src/extensions/emoji/travel_and_places.ts +1332 -1332
- package/src/index.ts +15 -5
- package/src/types/editor.ts +10 -0
- package/src/types/slashCommandsTypes.ts +1 -1
- package/src/types/toolbarTypes.ts +3 -1
- 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
|
|
5
|
-
import BtnIcon from
|
|
6
|
-
import {
|
|
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
|
|
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
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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,30 +1,32 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
|
|
3
3
|
import * as mdi from '@mdi/js'
|
|
4
|
-
import { Editor } from
|
|
5
|
-
import BtnIcon from
|
|
6
|
-
import {
|
|
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
|
|
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
|
|
18
|
+
const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
|
|
17
19
|
|
|
18
20
|
</script>
|
|
19
21
|
|
|
20
22
|
<template>
|
|
21
23
|
<VBtn
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
|
5
|
-
import BtnIcon from
|
|
6
|
-
import {
|
|
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
|
|
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
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
5
|
-
import BtnIcon from
|
|
6
|
-
import {
|
|
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
|
|
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
|
|
18
|
+
const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
|
|
17
19
|
|
|
18
20
|
</script>
|
|
19
21
|
|
|
20
22
|
<template>
|
|
21
23
|
<VBtn
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
|
5
|
-
import BtnIcon from
|
|
6
|
-
import {
|
|
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
|
|
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
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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 {
|
|
4
|
-
import
|
|
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
|
|
10
|
+
variantBtn: { type: String as PropType<variantBtnTypes>, default() { return 'flat' } },
|
|
8
11
|
})
|
|
9
12
|
|
|
10
|
-
const editor = inject('tiptapifyEditor') as Ref<
|
|
11
|
-
const { t } = inject('tiptapifyI18n') as
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<button v-if="filter" class="tiptapify-slash-picker__clear" @click="resetFilter"
|
|
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
|
+
×
|
|
91
|
+
</button>
|
|
90
92
|
</div>
|
|
91
93
|
|
|
92
94
|
<div class="tiptapify-slash-picker__grid-container">
|
|
93
95
|
<div
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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 {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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
|
|
11
|
+
variantBtn: { type: String as PropType<variantBtnTypes>, default() { return defaults.variantBtn } },
|
|
10
12
|
})
|
|
11
13
|
|
|
12
|
-
const editor = inject('tiptapifyEditor') as Ref<
|
|
14
|
+
const editor = inject('tiptapifyEditor') as Ref<TiptapifyEditor>
|
|
13
15
|
|
|
14
|
-
const { t } = inject('tiptapifyI18n') as
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<button v-if="filter" class="tiptapify-slash-picker__clear" @click="resetFilter"
|
|
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
|
+
×
|
|
87
|
+
</button>
|
|
86
88
|
</div>
|
|
87
89
|
|
|
88
90
|
<div class="tiptapify-slash-picker__grid-container">
|
|
89
91
|
<div
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
|
4
|
-
import BtnIcon from
|
|
5
|
-
import IframeDialog from
|
|
6
|
-
import {
|
|
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
|
|
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
|
|
18
|
+
const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
|
|
17
19
|
|
|
18
|
-
const dialog =
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
4
|
-
import TiptapifyDialog from
|
|
5
|
-
import defaults from
|
|
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
|
|
13
|
-
variantField: { type: String
|
|
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
|
|
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 =
|
|
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
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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" :
|
|
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
|
|
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"
|
|
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
|
|
5
|
-
import BtnIcon from
|
|
6
|
-
import ImageDialog from
|
|
7
|
-
import {
|
|
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
|
|
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
|
|
19
|
+
const { t } = inject('tiptapifyI18n') as { t: ComposerTranslation }
|
|
18
20
|
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
23
|
<template>
|
|
22
24
|
<VBtn
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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') }}
|